akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPl(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define REPRl(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < (int)n; i++)
#define FORl(i, m, n) for(ll i = m; i < (ll)n; i++)
#define ALL(v) v.begin(), v.end()
ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
const string bans(bool ans){
  return (ans?"Yes":"No");
}
int main() {
  int d,n;cin>>d>>n;
  int tar=pow(100,d);
  int ans=tar*n;
  if(n==100){
    ans+=tar;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)
#define print(x,n) for(int i_ = 0;i_ < n;i_++) printf("%lld%c",x[i_]," \n"[i_ == n - 1])

#define int long long
//using ll = long long;
using P = pair<int,int>;

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }

int n,a[100010],ans[100010];

vector<int> check(set<int> s,int t){
	vector<int> v;
	for(int x : s) v.push_back(x);
	do{
		int p = t;
		bool isOK = true;
		for(int i = 0;i < 3;i++){
			if(p == v[i]) isOK = false;
			p = a[v[i]];
		}
		if(isOK){
			return v;
		}
	}while(next_permutation(all(v)));
}

signed main(){
	cin >> n;
	for(int i = 0;i < n;i++){
		cin >> a[i]; a[i]--;
	}
	if(n == 2){
		if(a[0] == 1 && a[1] == 0) cout << -1 << endl;
		else if(a[0] == 1) cout << "2 1" << endl;
		else cout << "1 2" << endl;
		return 0;
	}
	int cnt[100010] = {};
	priority_queue<P> que;
	for(int i = 0;i < n;i++){
		if(i != a[i]) cnt[a[i]]++;
	}
	for(int i = 0;i < n;i++){
		que.emplace(cnt[i],i);
	}
	int prv = -1;
	set<int> unused;
	for(int i = 0;i < n;i++) unused.insert(i);
	for(int i = 0;i < n - 3;i++){
		while(!unused.count(que.top().second) || cnt[que.top().second] != que.top().first) que.pop();
		P p = que.top();
		if(p.first == n - i - 1){
			ans[i] = p.second;
		}else{
			auto it = unused.begin();
			if(*it == prv) it++;
			ans[i] = *it;
		}
		prv = a[ans[i]];
		if(ans[i] != a[ans[i]]) cnt[a[ans[i]]]--;
		que.emplace(cnt[a[ans[i]]],a[ans[i]]);
		unused.erase(ans[i]);
	}
	vector<int> v = check(unused,prv);
	for(int i = 0;i < 3;i++) ans[n - 3 + i] = v[i];
	for(int i = 0;i < n;i++) ans[i]++;
	print(ans,n);
}

Measured memory_bytes: 12528
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define ALL(v) (v).begin(), (v).end()
template<class T>
using reverse_priority_queue = priority_queue<T, vector<T>, greater<T>>;


int main(){
    ll n;
    cin >> n;
    ll ans = 0;
    REP(i, n){
        ll ai;
        cin >> ai;
        if(i % 2 == 0 && ai % 2 == 1){ ans++; }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3604
N, M = map(int, input().split())
X = [int(i) for i in input().split()]
X.sort()
diff = []

if M <= N:
    print(0)
else:
    for i in range(1, M):
        diff.append(X[i] - X[i-1])   
    diff.sort()
    print(sum(diff[0:M-N]))

Measured memory_bytes: 13840
#include <bits/stdc++.h>
#define int long long
 
using namespace std;
 
const int mod = 1e9 + 7;
 
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n, k, ans = 0;
    cin >> n >> k;
    for (int i = k; i <= n + 1; ++i) {
        ans = (ans + i * (n - i + 1) + 1) % mod;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,i1,n) for(int i=(int)(i1);i<(int)(n);i++)
#define ll long long
#define vi vector<int>
#define vll vector<long long>

int main() {
  string s,t;
  cin>>s>>t;
  
  int count=0;
  int max=10000;
  
  rep(i,0,s.size()-t.size()+1){
    rep(j,0,t.size()){
      if(s.at(i+j)!=t.at(j)){
        count++;
      }
    }
    if(count<max){
      max=count;
    }
    count=0;
  }
  cout<<max;
}

Measured memory_bytes: 3628
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};

template<class T> 
inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> 
inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};



void solve(){
    ll n;
    ll a[100010];
    map<ll,ll> mp;
    cin>>n;
    rep(i,n){
        cin>>a[i];
        if(mp[a[i]]>0) mp.erase(a[i]);
        else mp[a[i]]=1;
    }
    cout<<mp.size()<<endl;

}


signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
    
    solve();

    return 0;
}


Measured memory_bytes: 7296
#include<bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int arr[n];
    int dp[n];
    cin>>arr[0];
    cin>>arr[1];
    
    dp[0] = 0;
    dp[1] = abs(arr[1]-arr[0]);
    
    for(int i=2;i<n;i++)
    {
        cin>>arr[i];
        
        dp[i] = min(abs(arr[i]-arr[i-1])+dp[i-1],abs(arr[i]-arr[i-2])+dp[i-2]);
        
    }
    
    cout<<dp[n-1];
    
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int mod = 1000000007;
//const int mod = 998244353;
const int INF = 1001001001;
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};

struct mint {
  ll x;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main()
{
    int x;
    cin >> x;
    if(x == 1){
        cout << 1 << endl;
        return 0;
    }
    for(int i = x; i >=1; i--){
        for(int j = 2; j*j <= i; j++){
            int tmp = i;
            while(tmp%j == 0){
                tmp /= j;
                if(tmp == 1){
                    cout << i << endl;
                    return 0;
                }
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3604
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

#define MAX(x,y) (x>y?x:y)
#define MIN(x,y) (x<y?x:y)
#define ABS(x) (x>0?x:-(x))
#define INF 2147483647
#define LLINF 9223372036854775807
#define MOD 1000000007

typedef long long int lli;

void swap(int* a, int* b)
{
    int tmp;
    tmp = *a;
    *a = *b;
    *b = tmp;
}

void ll_swap(lli* a, lli* b)
{
    lli tmp;
    tmp = *a;
    *a = *b;
    *b = tmp;
}

int gcd(int a, int b)
{
    if (a < b)
        swap(&a, &b);

    if (a % b == 0)
        return b;
    else
        return gcd(b, a % b);
}

int lcm(int a, int b)
{
    return a * b / gcd(a, b);
}

long power(long x, int n) {
    long ans = 1;
    while (n > 0) {
        if ((n & 1) == 1) {
            ans = ans * x;
        }
        x = x * x;
        n >>= 1;
    }
    return ans;
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
        printf("res:%lld a:%lld\n", res, a);
    }
    return res;
}


lli comb(lli n, lli r)
{
    if (n == 0)
        return 0;

    if (r == 0 || r == n)
        return (1);
    else if (r == 1)
        return (n);
    return (comb(n - 1, r - 1) + comb(n - 1, r));
}

/*
#define MAX 100000
long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
// 二項係数計算
long long COM(int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
*/

int d(long long int N)
{
    int count = 0;

    while (N > 0)
    {
        N /= 10;
        count++;
    }

    return count;
}

double rad2(double x)
{
    return x * (M_PI / 180);
}

int kaibun(char S[], int n)
{
    for (int i = 0; i < n / 2; i++)
    {
        if (S[i] != S[n - i - 1])
            return 0;
    }
    return 1;
}

int main()
{
    int N;

    scanf("%d", &N);

    printf("%d\n", (1000 - N % 1000)%1000);

    return 0;
}


Measured memory_bytes: 3828
#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;

int main() {

    int n;
    cin >> n;
    vector<int> s(n);
    int ans = 0;
    bool exist_not_multiple_of_ten = false;
    rep(i, n) {
        cin >> s[i];
        ans += s[i];
        if (s[i] % 10) exist_not_multiple_of_ten = true;
    }

    if (ans % 10) {
        cout << ans << endl;
        return 0;
    }

    if (!exist_not_multiple_of_ten) {
        cout << 0 << endl;
        return 0;
    }

    sort(s.begin(), s.end());

    rep(i,n) {
        if(s[i]%10){
            ans -= s[i];
            break;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3568
import numpy as np

k=int(input())
a=np.array([i+1 for i in range(9)])
ans=a
temp=a
for i in range(10):
    for j in range(3):
        b=temp*10+temp%10
        c=temp*10+np.minimum(temp%10+1,9)
        d=temp*10+np.maximum(temp%10-1,0)
    ans=np.append(np.append(np.append(ans,b),c),d)
    temp=np.append(np.append(b,c),d)

ans=np.sort(np.unique(ans))
print(ans[k-1])

Measured memory_bytes: 52644
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include<string>
#include <iomanip>
#include<deque>

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e8;

using namespace std;


//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用


int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	int k, x;
	cin >> k >> x;

	ll start = max(x - k + 1, -1000000);
	ll end = min(x + k - 1, 1000000);
	for (int i = start; i <= end; i++)
	{
		if (i != start)
		{
			cout << " ";
		}
		cout << i;
	}

}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
using namespace std;
using llong = long long;

string s;
llong k;

int main() {
    cin >> s >> k;

    for (int i = 0; i < s.length(); i++) {
        if (s[i] == 'a') continue;

        if (26 - (s[i] - 'a') <= k) {
            k -= 26 - (s[i] - 'a');
            s[i] = 'a';
        }

    }

    k %= 26;
    s.back() += k;

    cout << s << endl;

    return 0;
}


Measured memory_bytes: 512
def solve():
    from itertools import permutations
    n = int(input())
    p = tuple(map(int, input().split()))
    q = tuple(map(int, input().split()))

    t = list(permutations(range(1, n + 1)))

    d = {i: j for j, i in enumerate(t)}
    print(abs(d[p] - d[q]))

solve()

Measured memory_bytes: 11052
#include <bits/stdc++.h>
using namespace std;

// 小数点以下桁数
// fixed << setprecision(i)

int64_t gcd(int64_t a,int64_t b){return (a%b==0?b:gcd(b, a%b));}
int64_t lcm(int64_t a,int64_t b){return a/gcd(a, b)*b;}
int factorial(int a){int b=1;while(a){b*=a--;}return b;} //13以下対応
bool is_prime(int64_t a){if(a<=1)return false;for(int64_t i=2;(int64_t)i*i<=a;i++){if(a%i==0)return false;}return true;}
int get_adp(double x, int n){return (int)round((x-(int)x)*pow(10,n))%10;} // 小数点以下の指定桁の値を取得
int64_t sigma(int64_t s, int64_t n){return n*(2*s+n-1)/2;}

//順列の全列挙
// vector<int> v(N);
// iota(v.begin(), v.end(), 1);       // v に 1, 2, ... N を設定
// do {
//	for(auto x : v) cout << x << " "; cout << "\n";     // v の要素を表示
// } while( next_permutation(v.begin(), v.end()) ); 

//bit全探索
// for (int tmp = 0; tmp < (1 << ビット数); tmp++) {
//	bitset<ビット数> s(tmp);
//	// (ビット列sに対する処理)
// }



int main()
{
	int64_t n, ans = 0, temp;

	cin >> n;
	for (int64_t i = 2; i * i <= n; i++)
	{
		if (n % i != 0)
			continue;
		temp = i;
		while (n % temp == 0)
		{
			n /= temp;
			ans++;
			temp *= i;
		}
		while (n % i == 0)
			n /= i;
	}
	if (n != 1)
		ans++;
	cout << ans << endl;
}

// 6534603030013

Measured memory_bytes: 3548
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define pb            push_back
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)

const int INF = 1e9;

// code
// ------------------------------------------------
int main() {

  int a,b;cin >> a >> b;
  int ans = (a - b * 2);
  ans = (ans < 0) ? 0 : ans;
    cout << ans;




  return 0;
}

// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}

Measured memory_bytes: 256
export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const [n]: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    return `${n % 2 == 0 ? (n / 2) / n : (n + 1) / 2 / n}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));


Measured memory_bytes: 7372
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,n) for (int64_t i=0; i<(n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




int main(){
    int n; cin>>n;
    vector<int> t(n),x(n),y(n);
    rep(i,n) cin>>t[i]>>x[i]>>y[i];
    bool ok=true;
    rep(i,n-1){
        int kari=abs(x[i+1]-x[i])+abs(y[i+1]-y[i])-t[i+1]+t[i];
        if(kari<=0 && kari%2==0){
        }else{
            ok=false;
        }
    }
    int kari=abs(x[0])+abs(y[0])-t[0];
    if(kari<=0 && kari%2==0){

    }else{
        ok=false;
    }
    cout<<(ok?"Yes":"No")<<endl;
}

Measured memory_bytes: 4236
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;
const int N = 2e5 + 10;
const ll inf = 1e15 + 42;
#define endl "\n"
const ll mod = 1000000007;

typedef tree<pair<ll, int>, null_type, less<pair<ll, int>>, rb_tree_tag, tree_order_statistics_node_update> pbds;

//Ordered set
//pbds s1
 
void testCase() {
    int n;
    cin >> n;
    ll sum = 0;
    ll fre[100007] = {0};
    for (int i=0; i<n; i++) {
        ll v;
        cin >> v;
        fre[v]++;
        sum += v;
    }
    int q;
    cin >> q;
    while (q--) {
        ll b, c;
        cin >> b >> c;
        sum = sum - b*fre[b];
        sum = sum + c*fre[b];
        fre[c] += fre[b];
        fre[b] = 0;
        cout << sum << endl;
    }
}
 
int main() {
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    testCase();
    return 0;
}

Measured memory_bytes: 4420
#include <bits/stdc++.h>
using namespace std;

int main(){
    long long int X;
    cin >> X;

    long long int count = 0;
    long long int total = 100;
    
    for(long long int i=0;;i++) {
        count += 1;
        total = total * 1.01;
        if(total>=X){
            cout << count << endl;
            return 0;
        }
    }

}


Measured memory_bytes: 3596
<?php
fscanf(STDIN, "%d%d", $N, $X);

$dp[0] = 1;
$p[0] = 1;
for($i = 1; $i <= 50; $i++){
    $dp[$i] = $dp[$i - 1] * 2 + 3;
    $p[$i] = $p[$i - 1] * 2 + 1;
}

echo dfs($N, $X);

function dfs($N, $X){
    global $dp, $p;
    if($X >= $dp[$N])return $p[$N];
    if($X <= 0)return 0;
    if($N == 0)return 1;
    $sum = dfs($N - 1, $X - 1);
    if($X >= $dp[$N - 1] + 2)$sum++;
    $sum += dfs($N - 1, $X - 1 - $dp[$N-1] - 1);
    return $sum;
}


Measured memory_bytes: 4732
S = input()
N = int(len(S))
S_a = S[:(N-1)//2]
S_b = S[(N+1)//2:]
#print(S)
if S == S[::-1] and S_a == S_a[::-1] and S_b == S_b[::-1]:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;

int main() {
  vector<vector<int>> card(3, vector<int>(3));
  for(int i = 0; i < 3; i++) {
    for(int j = 0; j < 3; j++) {
      cin >> card.at(i).at(j);
    }
  }
  int n;
  cin >> n;
  vector<int> num(n);
  for(int i = 0; i < n; i++) {
    cin >> num.at(i);
  }
  for(int i = 0; i < 3; i++) {
    for(int j = 0; j < 3; j++) {
      for(int k = 0; k < n; k++) {
        if(card.at(i).at(j) == num.at(k)) {
          card.at(i).at(j) = 0;
          break;
        }
      }
    }
  }
  bool bingo = false;
  if(card.at(0).at(0) + card.at(1).at(1) + card.at(2).at(2) == 0) {
    bingo = true;
  } else if(card.at(2).at(0) + card.at(1).at(1) + card.at(0).at(2) == 0) {
    bingo = true;
  } else {
    for(int i = 0; i < 3; i++) {
      int sum = 0;
      for(int j = 0; j < 3; j++) {
        sum += card.at(i).at(j);
      }
      if(sum == 0) {
        bingo = true;
        break;
      }
    }
    if (!bingo) {
      for(int j = 0; j < 3; j++) {
        int sum = 0;
        for(int i = 0; i < 3; i++) {
          sum += card.at(i).at(j);
        }
        if(sum == 0) {
          bingo = true;
        }
      }
    }
  }
  if(bingo) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	int A, B, K;
	cin >> A >> B >> K;
	int cnt = 0;
	for(int i=100; i>=1; i--){
		if(A % i == 0 && B % i == 0){
			cnt++;
			if(cnt == K){
				cout << i << endl;
				return 0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>


#define REP(i,N) for(auto i = 0; i <N; i++)


typedef long long ll;
//const int MOD = pow(10,9)+7;
//const int MAX = 100001;

using namespace std;
int in(){
    int temp;
    scanf("%d",&temp);
    return temp;
}

ll lin(){
    ll temp;
    scanf("%lld",&temp);
    return temp;
}




void dfs(int &flag, int st, int gl, vector<int> *links, int depth, int *visited){
    
    if (depth == 2 && st == gl)  {  //条件を満たすパスを発見
        flag = 1;
        return;
    }
  
    if (depth >= 2) return;
    if (flag == 1) return; ///ルートが一度発見されたらもう再帰は必要ない。
  
  
    for(auto it = links[st].begin(); it != links[st].end() ;it++){

        if (visited[*it] == 1) continue;
        visited[*it] = 1;
        dfs(flag,*it, gl,links,depth+1,visited);
        visited[*it] = 0;
        
    }
    
}

int main() {
    
    int N = in(); int M = in();
    
    vector<int> links[N+1];
    
  	int st,gl;
    REP(i,M){
        st = in();
	    gl = in();
        links[st].push_back(gl);
    }

    
    int visited[N+1];
    REP(i,N+1){
        visited[i] = 0;
    }
    
    visited[1] = 1;
    
    int flag = 0;
    dfs(flag ,1,N,links,0,visited);
    
    
    if(flag == 1){
        cout << "POSSIBLE" << endl;
    }else{
        cout << "IMPOSSIBLE" << endl;
    }
    
    
    return 0;
    
    
}









Measured memory_bytes: 9344
S = input()
if len(S)%2 == 0:
  SL = S[0:len(S)//2]
  SR = S[len(S)//2:]
  SR = SR[::-1]
else:
  SL = S[0:len(S)//2+1]
  SR = S[len(S)//2:]
  SR = SR[::-1]
ans = 0
for i in range(len(SR)):
  if SL[i] != SR[i]:
    ans += 1
print(ans)


Measured memory_bytes: 3060
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var scan = bufio.NewScanner(os.Stdin)

func main() {
	scanWords()
	r := readNextFloat()
	s := r * r * math.Pi
	l := 2 * r * math.Pi

	fmt.Printf("%0.6f %0.6f\n", s, l)
}

func scanWords() {
	scan.Split(bufio.ScanWords)
}

func readNextFloat() float64 {
	scan.Scan()

	input, err := strconv.ParseFloat(scan.Text(), 64)
	if err != nil {
		panic(err)
	}
	return input
}



Measured memory_bytes: 1124
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
  int a,b;
  cin>>a>>b;
  if(a>b)swap(a,b);
  while(a!=0){
    b = b%a;
    swap(a,b);
  }
  //cerr<<b;
  int t=2,ans=1;
 
  a=b;
  while(b!=1&&t*t<=a){
    if(b%t==0){
      ans++;
      b /=t;
      while(b%t==0)b/=t;
    }
    
    t++;
  }
  if(b!=1)cout<<ans+1;
  else cout<<ans;
  return 0;
}


Measured memory_bytes: 384
#define _ 2<<17
A[_];long P[_],M=1e9+7,F[_],I[_]={1},X;i,j,k,t;c(a,b)int*a,*b;{t=*a-*b?:a[1]-b[1];}p(a,b){return b?p(a%M*a%M,b/2)*(b%2?a:1L)%M:1;}f(a,b){return F[a+b]*I[a]%M*I[b]%M;}main(s){for(;++X<_;)I[X]=p(s=F[X]=X*s%M,M-2);for(;~scanf("%d",A+i);)i++-1||gets(P);for(qsort(A,i/=2,8,c);j<i;P[j++]=X)for(k=j,X=f(s=A[j*2]-=1,t=A[j*2+1]-=1);k--;)X=t<A[k*2+1]?X:(X-f(s-A[k*2],t-A[k*2+1])*P[k]%M+M)%M;printf("%d",X);}

Measured memory_bytes: 6396
#include<stdio.h>
int main(){
    int n,m,i;
    int a[10001];
    scanf("%d %d",&n,&m);
    for (i = 0; i < m; i++){
        scanf("%d", &a[i]);
    }
    for (i = 0; i < m; i++){
        n = n - a[i];
    }
    if (n < 0) {
        puts("-1");
    }
    else {
        printf("%d",n);
    }
    return 0;
}

Measured memory_bytes: 2156
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int[] a = new int[3];
		a[0] = sc.nextInt();
		a[1] = sc.nextInt();
		a[2] = sc.nextInt();
		Arrays.sort(a);
		System.out.println(a[0]+" "+a[1]+" "+a[2]);
}
}

Measured memory_bytes: 17156
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n ;
  cin>>n;
  int i , a[n];
  for(i = 0 ; i < n ; i++)
  {cin>>a[i];
   if(a[i] % 2 == 0)
   if(a[i] % 3 != 0 && a[i] % 5 != 0)
   {cout<<"DENIED";
     return 0;  }
  }
  cout<<"APPROVED";
  return 0;
}
  

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;


bool check(string C1, string C2) {
  for (int i = 0; i < 3; ++i) {
      if (C1.at(i) != C2.at(2 - i)) return false;
  }
  return true;
}

int main () {
  string C1, C2;
  cin >> C1 >> C2;
  
  if (check(C1, C2)) cout << "YES" << endl;
  else cout << "NO" << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    if(s == "Y") {
      cout << "Four" << endl;
      return 0;
    }
  }
cout << "Three" << endl;
}

Measured memory_bytes: 3616
#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef list<int> liint;
typedef pair<int, int> pint;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }



int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string S;
    cin >> S;
    int N = S.size();
    S = "*" + S;
    
    if (S[1] != '1') {
        cout << -1 << endl;
        return 0;
    }
    REP(i, 1, N) {
        if (S[i] != S[N - i]) {
            cout << -1 << endl;
            return 0;
        }
    }
    if (S[N] == '1') {
        cout << -1 << endl;
        return 0;
    }
    unordered_map<int, unordered_set<int>> ans;
    int nd = 1;
    vint nodes;
    REP(i, 1, N + 1) {
        if (S[i] == '1') {
            nodes.push_back(i);
        }
    }
    sort(nodes.begin(), nodes.end(), greater<int>());
    ans[N].insert(nd);
    rep(i, nodes.size() - 1) {
        int t = nodes[i] - nodes[i + 1];
        rep(j, t) {
            if (nd >= N) {
                cout << -1 << endl;
                return 0;
            }
            ans[nd].insert(nd + 1 + j);
            if (nd + 1 + j >= N + 1) {
                cout << -1 << endl;
                return 0;
            }
        }
        nd += t;
    }
    //REP(i, nd + 1, N) {
    //    ans[N].insert(i);
    //}
    for (auto& nd : ans) {
        int u = nd.first;
        for(auto& v : nd.second) {
            cout << u << " " << v << endl;
        }
    }



    return 0;
}

Measured memory_bytes: 18560
<?php
$n = int();
$a = ints();
$c = 0;
$max = 0;
for($i = 0; $i < $n - 1;$i++){
  if($a[$i+1] <= $a[$i]){
    $c++;
    $max = max($max, $c);
  }else{
    $c = 0;
  }
}
echo $max;

function str(){
  return trim(fgets(STDIN));
}
function ints(){
  return array_map("intval", explode(" ", trim(fgets(STDIN))));
}
function int(){
  return intval(trim(fgets(STDIN)));
}
function o(...$val){
    if(count($val)==1)$val = array_shift($val);
    $trace = debug_backtrace();
    echo $trace[0]['line'].")";
    if(is_array($val)){
        if(count($val) == 0){
            echo "empty array";
        }elseif(!is_array(current($val))){
            echo "array:";
            echo implode(" ", $val)."\n";
        }else{
            echo "array:array\n";
            foreach($val as $row){
                echo implode(" ", $row)."\n";
            }
        }
    }else{
        echo $val."\n";
    }
}

Measured memory_bytes: 16884
#include <bits/stdc++.h>

using namespace std;

static inline int in(){ int x; scanf("%d", &x); return x; }

int main()
{
  int n = in();
  for (int i = 0; i < n; i++){
    int sudoku[9][9];
    for (int j = 0; j < 9; j++){
      for (int k = 0; k < 9; k++){
        sudoku[j][k] = in() - 1;
      }
    }
    int col[9][9] = {};
    int row[9][9] = {};
    int blk[9][9] = {};
    for (int j = 0; j < 9; j++){
      for (int k = 0; k < 9; k++){
        row[j][sudoku[j][k]]++;
        col[k][sudoku[j][k]]++;
        blk[j/3*3+k/3][sudoku[j][k]]++;
      }
    }
    if (i) puts("");
    for (int j = 0; j < 9; j++){
      for (int k = 0; k < 9; k++){
        if (row[j][sudoku[j][k]] > 1 ||
            col[k][sudoku[j][k]] > 1 ||
            blk[j/3*3+k/3][sudoku[j][k]] > 1){
          printf("*");
        }
        else printf(" ");
        printf("%d", sudoku[j][k] + 1);
      }
      puts("");
    }
  }
  return 0;
}

Measured memory_bytes: 1200
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct f{
  int i;
  int v;
}s,g;

int compara(const void * a, const void * b){
  s = *(struct f *) a;
  g = *(struct f *) b;
  int x = s.v;
  int y = g.v;
  return x>y?1:x<y?-1:0;
}

int main(){
   int m,n,i,j;
  scanf("%d %d",&n,&m);
  int a[n],b[n],c[m],d[m];
  struct f r[n][m];
  int v[n];
  for (i = 0; i < n; i++) {
    scanf("%d %d",&a[i],&b[i]);
  }

  for (i = 0; i < m; i++) {
    scanf("%d %d",&c[i],&d[i]);
    for (j = 0; j < n; j++) {
      r[j][i].i = i+1;
      r[j][i].v = (abs(a[j]-c[i])+abs(b[j]-d[i]));
    }
  }

  for (i = 0; i < n; i++) {
    qsort(r[i],m,sizeof(r[0][0]),compara);
    for (j = 0; j < m; j++) {
      if (v[i-1]!=r[i][j].i) {
        printf("%d\n",r[i][j].i);
        break;
      }
    }
  }

  return 0;
}


Measured memory_bytes: 128
// by adiforluls
#pragma GCC optimize ("-O2")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define FAST         ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ll           long long
#define ld           long double
#define pb           push_back
#define mp           make_pair
#define pii          pair<int,int>
#define mii          map<int,int>
#define vi           vector<int>
#define vll          vector<long long>
#define all(a)       (a).begin(),(a).end()
#define clz(a)       __builtin_clz(a) // count leading zeroes
#define ctz(a)       __builtin_ctz(a) // count trailing zeroes
#define popc(a)      __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define lul          1000000007
#define rep(i,a,b)   for(int i=a;i<b;i++)
#define rfor(i,a,b)  for(int i=a; i>=b; i--)
#define SIZE         1000005
#define F            first
#define S            second
#define mod          998244353
 
#define TRACE
 
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " = " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " = " << arg1<<" |";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 
#define endl         '\n'
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key(k)
// find_by_order(k)
const ld PI = acos(-1.0);
const int INF = 0x3f3f3f3f;

void solve()
{
    int n; cin>>n;
    vi a(n);
    rep(i,0,n) cin>>a[i];
    vector<vll> dp(n,vll(n,0));
    rfor(i,n-1,0)
    {
        rep(j,i,n)
        {
            if(i == j) dp[i][j] = a[j];
            else{
                dp[i][j] = max(a[j]-dp[i][j-1],a[i]-dp[i+1][j]);
            }
        }
    }
    cout<<dp[0][n-1]; 
}
int main()
{   
    FAST;
   //  #ifndef ONLINE_JUDGE
     // freopen("input.txt", "r", stdin);
     // freopen("output.txt", "w", stdout);
   //  #endif
    int t; t=1; //cin>>t;
    while(t--){
       solve();
    }
    return 0;
}

Measured memory_bytes: 70784
#include <iostream>

int main()
{
    while (1) {
        int x, y;

        std::cin >> x >> y;

        if (x == 0 && y == 0)
            break;
        if (x > y) {
            std::cout << y << " " << x << std::endl;
        } else {
            std::cout << x << " " << y << std::endl;
        }

    }
}


Measured memory_bytes: 3080
# Problem D - Flipping Signs

# input
N = int(input())
a_list = list(map(int, input().split()))

# initialization
minus_count = 0
max_cost = 0

# count
for a in a_list:
    if a<0:
        minus_count += 1

# check
if minus_count%2==0:
    for a in a_list:
        max_cost += abs(a)
    print(max_cost)
else:
    min_abs = 10**10
    for a in a_list:
        min_abs = min(min_abs, abs(a))
        max_cost += abs(a)
    print(max_cost - min_abs*2)


Measured memory_bytes: 64752
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getInts(N int) []int {
	ret := make([]int, N)
	for i := 0; i < N; i++ {
		ret[i] = getInt()
	}
	return ret
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	K := getInt()
	q := make([]int, 0)
	for i := 1; i < 10; i++ {
		q = append(q, i)
	}
	ans := 0
	for i := 0; i < K; i++ {
		x := q[0]
		q = q[1:]
		ans = x
		b := x % 10
		if b != 0 {
			q = append(q, x*10+b-1)
		}
		q = append(q, x*10+b)
		if b != 9 {
			q = append(q, x*10+b+1)
		}
	}
	out(ans)
}


Measured memory_bytes: 7592
#include <stdio.h>

int main()
{
    int n, i;
    
    scanf("%d", &n);
    
    int a[n];
    
    for(i = 0; i < n; i++){
        scanf("%d", &a[i]);
    }
    
    for(i = n-1; i >= 0; i--){
        printf("%d", a[i]);
        
        if(i != 0){
            printf(" ");
        }
    }
    printf("\n");
    
    return 0;
}

Measured memory_bytes: 600
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1e9+7;
const LL LINF=1LL<<62;



int main(){
    int N;
    cin >> N;
    LL C;
    cin >> C;
    priority_queue<LL> q;
    LL x[N];
    LL v[N];
    for(int i=0;i<N;i++){
        cin >> x[i] >> v[i];
    }
    LL sum=0,m[N],mt=0;
    q.push(0);
    for(int i=0;i<N;i++){
        sum+=v[i];
        mt=max(mt,sum-x[i]);
        m[i]=mt;
        q.push(sum-x[i]);
    }
    sum=0;
    LL maxi[N];
    LL ma=0;
    for(int i=N-1;i>=0;i--){
        sum+=v[i];
        ma=max(ma,sum-(C-x[i]));
        maxi[i]=ma;
        q.push(sum-(C-x[i]));
    }
    sum=0;
    for(int i=0;i<N-1;i++){
        sum+=v[i];
        q.push(sum-2*x[i]+maxi[i+1]);
    }
    sum=0;
    for(int i=N-1;i>=1;i--){
        sum+=v[i];
        q.push(sum-2*(C-x[i])+m[i-1]);
    }
    cout << q.top() << endl;
    return 0;
}

Measured memory_bytes: 9584
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(a) (a).begin(), (a).end()

int main() {
    string S;
    cin >> S;
    if (S.find('a') != string::npos &&
        S.find('b') != string::npos &&
        S.find('c') != string::npos)
        cout << "Yes" << endl;
    else 
        cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
// AtCoder Beginners Selection
// ABC176A Takoyaki
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, X, T;
  cin >> N >> X >> T;
  
  //loop
  if (N % X == 0){
    cout << (N / X) * T << endl;
  } else {
    cout << ((N / X) + 1) * T << endl;
  }

  return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 0x7ffffff;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	vector<int> a(3);
	rep(i, 3) cin >> a[i];
	sort(all(a));
	int ans = inf;
	for (int i = a[0]; i <= a[2]; ++i) {
		int tmp = 0;
		rep(j, 3) {
			if (a[j] == i) continue;
			if (a[j] > i) {
				tmp += a[j] - i;
			}
			else {
				if ((i - a[j]) % 2 == 0) tmp += (i - a[j]) / 2;
				else {
					tmp += (i - a[j]) / 2 + 2;
				}
			}
		}
		ans = min(ans, tmp);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define debug(x) cerr << #x << ": " << x << '\n'
#define INF 999999999
typedef long long int Int;
using ll = long long;
using VI = vector<int>;

int main(){
  int a,b;cin >> a >> b;
  string s;cin >> s;
  int lc=0,rc=0;
  bool tyu = false;
  for(int i=0;i<s.size();i++){
    if(s[i]=='-'){
      tyu = true;
    }else{
      if(tyu){
        rc++;
      }else{
        lc++;
      }
    }
  }
  if(lc==a&&rc==b) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
    int64_t n, a[100];
    cin >> n;
    a[0]=2;
    a[1]=1;
    for(int i=0; i<n; i++) {
        a[i+2] = a[i+1] + a[i];
    }
    cout << a[n] << endl;
}

Measured memory_bytes: 256
/* #region template */
#![allow(unused_imports)]
use std::cmp::{max, min};
use std::io::{stdin, stdout, Bytes, Read, Stdin, StdinLock, Stdout, StdoutLock, Write};
use std::iter::{repeat, repeat_with};
use std::mem::swap;
use std::str::FromStr;
#[allow(dead_code)]
struct Io<'a> {
    reader: Bytes<StdinLock<'a>>,
    writer: StdoutLock<'a>,
    in_buf: [u8; BUF_SIZE],
}
#[allow(dead_code)]
impl<'a> Io<'a> {
    fn new(stdin: &'a Stdin, stdout: &'a Stdout) -> Io<'a> {
        Io {
            reader: stdin.lock().bytes(),
            writer: stdout.lock(),
            in_buf: [0; BUF_SIZE],
        }
    }
    fn r<T: FromStr>(&mut self) -> T {
        let mut count = 0;
        loop {
            match self.reader.next() {
                Some(Ok(b' ')) | Some(Ok(b'\n')) => break,
                Some(Ok(c)) => self.in_buf[count] = c,
                _ => panic!(),
            }
            count += 1;
        }

        let s = unsafe { std::str::from_utf8_unchecked(&self.in_buf[0..count]) };
        s.parse().unwrap_or_else(|_| panic!())
    }
    fn ru(&mut self) -> usize {
        self.r()
    }
    fn iter<'b, T>(&'b mut self) -> IoIter<'a, 'b, T> {
        IoIter::new(self)
    }
    fn c<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        self.iter().take(n).collect()
    }
    fn cu(&mut self, n: usize) -> Vec<usize> {
        self.c(n)
    }
    fn w<T: std::fmt::Display>(&mut self, v: T) {
        writeln!(self.writer, "{}", v).unwrap();
    }
    fn wn<T: std::fmt::Display>(&mut self, v: T) {
        write!(self.writer, "{}", v).unwrap();
    }
}
#[allow(dead_code)]
struct IoIter<'a: 'b, 'b, T> {
    io: &'b mut Io<'a>,
    m: std::marker::PhantomData<T>,
}
#[allow(dead_code)]
impl<'a: 'b, 'b, T> IoIter<'a, 'b, T> {
    fn new(io: &'b mut Io<'a>) -> IoIter<'a, 'b, T> {
        IoIter {
            io,
            m: std::marker::PhantomData,
        }
    }
}
impl<'a, 'b, T: FromStr> Iterator for IoIter<'a, 'b, T> {
    type Item = T;
    fn next(&mut self) -> Option<Self::Item> {
        Some(self.io.r())
    }
}
fn main() {
    let stdin = stdin();
    let stdout = stdout();
    let mut io = Io::new(&stdin, &stdout);
    unsafe {
        solve(&mut io);
    }
}
/* #endregion */

const BUF_SIZE: usize = 1024;

unsafe fn solve(io: &mut Io) {
    let x: i128 = io.r();
    for i in 1..(x as f64).sqrt() as i128 + 1 {
        if x % i == 0 {
            check(x, i, io);
            if i != x / i {
                check(x, x / i, io);
            }
        }
    }
    unreachable!();
}

fn check(x: i128, i: i128, io: &mut Io) {
    let mut a = i / 2;
    let mut b = a - i;

    while check2(x, a, b, io) {
        a += 1;
        b += 1;
    }
}

fn check2(x: i128, a: i128, b: i128, io: &mut Io) -> bool {
    let res = (a - b) * (a.pow(4) + a.pow(3) * b + a.pow(2) * b.pow(2) + a * b.pow(3) + b.pow(4));
    if res == x {
        io.wn(a);
        io.wn(' ');
        io.w(b);
        std::process::exit(0);
    } else if res > x {
        false
    } else {
        true
    }
}


Measured memory_bytes: 2152
#include <cstdio>

const int MAXN=1e6+5,P=1e9+7;
int n;
int fac[MAXN],fac_inv[MAXN];

inline int pow(int x,int y){
	int ret=1;
	for(;y;x=(long long)x*x%P,y>>=1){
		if(y&1) ret=(long long)ret*x%P;
	}
	return ret;
}

inline int inv(int x){return pow(x,P-2);}

inline int C(int n,int m){
	if(n<m || m<0) return 0;
	return (long long)fac[n]*fac_inv[m]%P*fac_inv[n-m]%P;
}

inline int cal(){
	static int f[MAXN];
	for(int i=1;i<n;++i)
		f[i]=(long long)C(i-1,n-1-i)*fac[i]%P*fac[n-1-i]%P;
	int ret=0;
	for(int i=1;i<n;++i)
		ret=(ret+(long long)(f[i]-f[i-1]+P)%P*i%P)%P;
	return ret;
}

inline void pre_cal(){
	fac[0]=1;
	for(int i=1;i<=n;++i)
		fac[i]=(long long)fac[i-1]*i%P;
	fac_inv[n]=inv(fac[n]);
	for(int i=n-1;i>=0;--i)
		fac_inv[i]=(long long)fac_inv[i+1]*(i+1)%P;
}

int main(){
	scanf("%d",&n);
	pre_cal();
	printf("%d",cal());
	return 0;
}

Measured memory_bytes: 11904
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define rep(i, n) FOR(i, 0, n)
using namespace std;
typedef long long ll;

const int mod = 1e9 + 7;

template <typename T> inline bool chmax(T &a, const T &b) {
    if(a >= b) {
        return false;
    }
    a = b;
    return true;
}
template <typename T> inline bool chmin(T &a, const T &b) {
    if(a <= b) {
        return false;
    }
    a = b;
    return true;
}

/*-------------------------------------------*/

int h, w;
char s[30][30];

int x[4] = {0, 1, 0, -1}, y[4] = {1, 0, -1, 0};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

    cin >> h >> w;
    rep(i, h) rep(j, w) cin >> s[i][j];
    int ans = 0;
    rep(i, h) rep(j, w) {
        if(s[i][j] == '#') continue;
        queue<pair<int, int>> que;
        que.push({i, j});
        int d[30][30] = {};
        d[i][j] = 1;
        while(!que.empty()) {
            pair<int, int> now = que.front();
            que.pop();
            chmax(ans, d[now.first][now.second]);
            rep(k, 4) {
                int nx = now.first + x[k], ny = now.second + y[k];
                if(nx < 0 || nx >= h || ny < 0 || ny >= w || s[nx][ny] == '#' ||
                   d[nx][ny])
                    continue;
                d[nx][ny] = d[now.first][now.second] + 1;
                que.push({nx, ny});
            }
        }
    }
    cout << ans - 1 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <limits>
#include <algorithm>
#include <functional>

#include <map>

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	map<char, int> chmap;
	
	string w;
	cin >> w;

	for (char ch : w)
	{
		chmap[ch]++;
	}

	for (pair<int, int> e : chmap)
	{
		if (e.second % 2 != 0)
		{
			cout << "No";
			return 0;
		}
	}

	cout << "Yes";
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

int coin[] = {1, 5, 10, 50, 100, 500};
int sum = 0;

int main(){
    for(int i = 0; i < 6; i++){
        int cnt;
        std::cin >> cnt;
        sum += cnt * coin[i];
    }

    std::cout << (sum >= 1000 ? 1 : 0 ) << std::endl;
    return 0;
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
using namespace std;
int gcd(int n,int m)
{
   return (m==0)?n:gcd(m,n%m);
}
int main()
{
    int n,m;
    cin>>n>>m;
    cout<<gcd(n,m)<<endl;
    return 0;
}




Measured memory_bytes: 3100