akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()

#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;

#define bit(k) (1LL<<(k))

typedef long long ll;

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

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18;
const ll MOD = (ll)1e9+7;
const double PI = acos(-1.0);

const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

/*------------------------------------/
for library*/

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    ll N,K;
    cin>>N>>K;
    vector<ll> A(N);
    rep(i,N)cin>>A[i];
    sort(all(A));
    auto check = [&](ll X){
        ll res = 0;
        vector<int> cnt(N, 0);
        //A[i] * A[j]がX未満の数がK個未満かどうか
        rep(i,N){
            if(A[i] == 0){
                if(X > 0){
                    cnt[i] = N - 1;
                    res += cnt[i];
                }
            }
            else if(A[i] > 0){
                //右が大きい
                //indexの二分探索を行う
                int ok = -1;
                int ng = N;
                while(ng - ok > 1){
                    int mid = (ok + ng) / 2;
                    if(A[i] * A[mid] < X)ok = mid;
                    else ng = mid;
                }
                cnt[i] = ok + 1;
                if(A[i] * A[i] < X)cnt[i]--;
                res += cnt[i];
            }
            //A[i] < 0
            else{
                //左が大きい
                int ng = -1;
                int ok = N;
                while(ok - ng > 1){
                    int mid = (ok + ng) / 2;
                    if(A[i] * A[mid] < X)ok = mid;
                    else ng = mid;
                }
                cnt[i] = N - ok;
                if(A[i] * A[i] < X)cnt[i]--;
                res += cnt[i];
            }
        }
        return res/2 < K;
    };
    ll ok = -INFLL-1;
    ll ng = +INFLL+1;

    while(ng - ok > 1){
        ll mid = (ok + ng)/2;
        if(check(mid))ok = mid;
        else ng = mid;
    }
    cout<<ok<<endl;
}

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

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

  int n, a;
  cin >> n;

  vector<int> v(n);
  rep(i, 0, n) {
    cin >> a;
    v[a - 1] = i + 1;
  }

  rep(i, 0, n) {
    if (i != 0) cout << " ";
    cout << v[i];
  }
  cout << endl;
}


Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef set <int> si;
typedef set <int> :: iterator sitr;
typedef set <ll> :: iterator sltr;
#define mset multiset
typedef mset <int> msi;
typedef mset <ll> msll;
typedef mset <int> :: iterator msitr;
typedef mset <ll> :: iterator msltr;
#define mp make_pair
#define pb push_back
#define pob pop_back
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newline '\n'
char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 126)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 126)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 126)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
//void IO(){
//	#ifndef ONLINE_JUDGE
//	    freopen("input.txt", "r", stdin);
//	    freopen("output.txt", "w", stdout);
//	#endif
//}
// end of Template
ll n,a[200100],BIT[200100],s[200100];
ll getsum (int idx){
    int sum = 0;
    idx++;
    while(idx>0){
        sum += BIT[idx];
        idx -= idx & (-idx);
    }
    return sum;
}
void update (int idx, int val){
    idx ++ ;
    while(idx<=200005){
        BIT[idx]+=val;
        idx += idx & (-idx);
    }
}
bool check (int x){
    int pre[200000];
    pre[0]=0;
    si sr;
    sitr it;

    for(int i=1;i<=n;i++){
        int temp;
        if(a[i]<x){temp=-1;}
        else{temp=1;}
        pre[i]=pre[i-1]+temp;
    }


    for(int i=0;i<=200004;i++)BIT[i]=0;

    ll num=0;
    for(int i=0;i<=n;i++){
        int temp = pre[i] + 100000;
        num += getsum(temp);
        update(temp,1);
    }

//    ll M = ( n * (n+1) )/2;
//    ll half = M/2;
//    if(M%2==1){half++;}
    ll half = (ll) (n*(n+1))/4;

    if(num>=half)return true;
    else return false;

}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];s[i]=a[i];
    }
    sort(s+1,s+1+n);
    int l=1;
    int r=n;
    ll ans;
    while(l<=r){
        int mid = (l+r)/2;
        if(check (s[mid])){ans=s[mid];l=mid+1;}
        else{r=mid-1;}
    }

    cout<<ans<<newline;



}


Measured memory_bytes: 3968
from collections import deque


def bfs(y, x):
    dist = [[-1] * w for _ in range(h)]
    dist[y][x] = 0
    que, frag = deque([(x, y)]), set([(x, y)])

    while que:
        qx, qy = que.popleft()
        near = [(qx - 1, qy), (qx, qy - 1), (qx + 1, qy), (qx, qy + 1)]
        for i, j in near:
            if (i, j) in frag:
                continue
            if 0 <= i < w and 0 <= j < h and s[j][i] == '.':
                dist[j][i] = dist[qy][qx] + 1
                que.append((i, j)), frag.add((i, j))
    return dist[qy][qx]


h, w = map(int, input().split())
s = [input() for _ in range(h)]

ans = 0
for i, si in enumerate(s):
    for j, sij in enumerate(si):
        if sij == '.':
            ans = max(ans, bfs(i, j))
print(ans)


Measured memory_bytes: 74920
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <math.h>
using namespace std;

int main() {
    int N;
    cin >> N;
    long long one[60], zero[60];
    for (auto k = 0; k < 60; ++k) {
        one[k] = 0;
        zero[k] = 0;
    }
    for (auto i = 0; i < N; ++i) {
        long long A;
        cin >> A;
        long long hoge = 1;
        for (auto k = 0; k < 60; ++k) {
            if (A % 2 == 0) {
                zero[k] ++;
            } else {
                one[k] ++;
            }
            A = A/2;
        }
    }

    long long sum = 0;
    long long max = 1e9 + 7;
    long long a = 1;
    for (long long i = 0; i < 60;i ++) {
        sum += ((((a % max) * one[i]) % max) * zero[i]) % max;
        sum %= max;
        a = a * 2;
    }
    cout << sum % max << endl;
    return 0;
}

Measured memory_bytes: 384
// RAKSHIT KADAM
 
//  -- Declare array globally...
 #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree< int ,  null_type ,  less<int> ,  rb_tree_tag ,  tree_order_statistics_node_update>
// find_by_order returns iterator to  element present at that index...
// order_of_key returns no. of elements having value stricktly less than that given in the order_of_key();
#warning !!!check the size of arrayss!!!
 
// NUMERIC DEFINITIONS :
    #define INF 1000000000000000005
    #define inf 1000000003
    #define MOD  1000000007
    #define newMOD  998244353
    #define MAX 200006
    #define pi 3.1415926535897932384626433832795
#define ld long double
 #define ll long long
 #define int long long
 
 #define P(gg) for(auto rax:gg){cout<<rax<<" ";}cout<<endl;
 #define Need_for_speed(activated) ios_base :: sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
 #define satisfy ll t; cin>> t; while(t--)
 #define inp(n) int n;cin >> n
 #define mp make_pair
 #define pb push_back
 #define endl "\n"
 #define x first
 #define y second
 #define fore(i,a,b) for(ll i=a;i<b;i++)
 #define forci(i,n) for(ll i=0;i<n;i++)
 #define vi vector<ll>
 #define Endl endl
 #define lb lower_bound
 #define ub upper_bound
#define pii pair<ll,ll>
 
 #define input freopen("input.txt", "r", stdin),freopen("output.txt", "w", stdout)
 #define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
using namespace std;
ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
int power(int x, unsigned int y, unsigned int m){ if (y == 0) return 1;int p = power(x, y/2, m) % m;  p = (p * p) % m;return (y%2 == 0)? p : (x * p) % m;}
ll modInverse(int a, int m){{ return power(a, m-2, m);}}
const int maxn = 500066;
ll cal(ll x,ll y,ll z)
{
    return x*x +y*y +z*z +x*y +x*z +y*z;
}
ll ans[maxn];
ll n;
set< pair<ll,pii> >s;
void rec(ll x,ll y,ll z)
{
    if(cal(x,y,z)>n)return;
    
    
    if(s.find(mp(x,mp(y,z)))!=s.end())return;
    s.insert(mp(x,mp(y,z)));
    
    
    ll  p =cal(x,y,z);
    set<ll>d;
    d.insert(x);d.insert(y);d.insert(z);
    if(d.size()==1)ans[p]++;
    else if(d.size()==2)ans[p]++;
    else ans[p]+=1;

    

    rec(x+1,y,z);
    rec(x,y+1,z);
    rec(x,y,z+1);
}

void solve()
{
    cin>>n;

    rec(1,1,1);
    for(ll i=1;i<=n;i++)cout<<ans[i]<<endl;
   
}
 
signed main()
{
   Need_for_speed(activated);
 
//satisfy
//    {
//  solve();
//   }
 
    solve();
    return 0;
}



Measured memory_bytes: 19448
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;

ll a[100010], dp[100010];

int main(){
    int n;
    cin >> n;
    rrep(i, n) cin >> a[i];
    fill(dp, dp+n, LINF);

    rep(i, n){
        *upper_bound(dp, dp+n, a[i]) = a[i];
    }
    cout << lower_bound(dp, dp+n, LINF) - dp << endl;

    return 0;
}


Measured memory_bytes: 5200
N = int(input())
R = [list(map(int,input().split())) for n in range(N)]
B = [list(map(int,input().split())) for n in range(N)]
R.sort(key=lambda x:-x[1])
B.sort()
ans=0

for c,d in B:
  for a,b in R:
    if a<c and b<d:
      ans+=1
      R.remove([a,b])
      break

print(ans)

Measured memory_bytes: 9124
#include <iostream>
#include <algorithm>

using namespace std;

long long getMaxBit(long long x);

int main()
{
	int n, k;
	cin >> n >> k;

	long long* map = new long long[n];
	for (int i = 0; i < n; i++) {
		cin >> map[i];
	}

	int size_nums = n * (n + 1) / 2;
	long long * nums = new long long[size_nums];

	for (int i = 0, k = 0; i < n; i++) {
		long long s = 0;
		for (int j = i; j < n; j++) {
			s += map[j];
			nums[k++] = s;
		}
	}

	// 昇順
	sort(nums, nums + size_nums);

	long long max = getMaxBit(nums[size_nums - 1]);
	long long ans = 0;

	/*
	for (int i = 0; i < size_nums; i++) {
		cout << nums[i] << " ";
	}
	cout << endl;
	*/

	for (long long a = max; a > 0; a >>= 1) {
		int count = 0;
		for (int i = size_nums - 1; i >= 0; i--) {
			if (a & nums[i]) count++;
			if (nums[i] != 0 && nums[i] < a)break;
		}

		if (count >= k) {
			//cout << "add " << a << endl;
			ans += a;
			for (int i = size_nums - 1; i >= 0; i--) {
				if ((a & nums[i]) == 0) nums[i] = 0;
			}
		}
	}
	/*
	for (int i = 0; i < size_nums; i++) {
		cout << nums[i] << " ";
	}
	cout << endl;
	*/

	cout << ans << endl;
}

long long getMaxBit(long long x) {
	if (x == 0)return 1;
	long long num = -1;
	for (; x > 0; x >>= 1) num++;
	return 1LL << num;
}


Measured memory_bytes: 4224
#pragma GCC optimize ("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<int,int> P; typedef pair<Int,Int> Pl;
static const int mod = 1e9+7;
#define END {cout<<ans<<'\n'; return 0;}
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define Pr(t) priority_queue<t>
#define gPr(t) priority_queue<t,vector<t>,greater<t>>
#define V(t) vector<t>
#define rep(i,n) for(int i=0; i<n; i++)
#define rer(i,l,r) for(int i=l; i<=r; i++)
#define gnr(i,l,r) for(int i=r; i>=l; i--)
#define eb emplace_back
#define pri1(a) cout<<(a)<<'\n'
#define pri2(a,n) rep(i,n-1)cout<<a[i]<<' '; cout<<a[n-1]<<'\n'
#define prip(p) cout<<p.first<<' '<<p.second<<'\n'
template<class T> inline bool cmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool cmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

Int n,m,_,x,y,q,key;
string s,sb;
bool ok;

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

  cin>>n>>m; int a[n]; P b[m]; Int sum=0;
	rep(i,n)cin>>a[i];
	rep(i,m)cin>>b[i].se>>b[i].fi;
	sort(b,b+m,greater<P>()); sort(a,a+n);
	int id=0;
	rep(i,n){
		if(id>=m)break;
		if(a[i]<b[id].fi){
			a[i]=b[id].fi; b[id].se--;
			if(!b[id].se)id++;
		}else break;
	}
	rep(i,n)sum+=a[i];
	pri1(sum);
}

Measured memory_bytes: 1408
n = int(input())
s = 0
if n < 10:
  s = n
if (n >= 10) & (n < 100):
  s = 9
if (n >= 100) & (n < 1000):
  s = 9 + n - 100 + 1
if (n >= 1000) & (n < 10000):
  s = 909
if (n >= 10000) & (n < 100000):
  s = 909 + n - 10000 + 1
if n == 100000:
  s = 90909
print(s)

Measured memory_bytes: 3060
#include <iostream>
using namespace std;
void trace(int A[],int N)
{
	int i;
	cout<<A[0];
	for(i=1;i<N;i++)cout<<' '<<A[i];
	cout<<endl; 
}

void insertionSort(int A[],int N)
{
	int i,j,v;
	for(i=1;i<N;i++){
		v=A[i];
		j=i-1;
		while(j>=0&&v<A[j]){
			A[j+1]=A[j];
			j--;
		}
		A[j+1]=v;
	    trace(A,N);
	}

}
int main() {
	
	int i,N;
	int A[100];
		cin >>N;
	for(i=0;i<N;i++)cin>>A[i];
	void trace(int A[],int N);
	void insertionSort(int A[],int N);
    trace(A,N);
	insertionSort(A,N);
	return 0;
}


Measured memory_bytes: 3080
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    import heapq
    mod=10**9+7
    N,M=MI()
    A=LI()
    for i in range(N):
        A[i]*=-1
    heapq.heapify(A)
    
    for i in range(M):
        a=heapq.heappop(A)
        heapq.heappush(A,a/2)
        
    ans=0
    for i in range(N):
        a=heapq.heappop(A) * -1
        ans+=int(a)
        
    print(ans)
        

main()


Measured memory_bytes: 86564
# DP
H, N = map(int, input().split())
A, B = [], []
for _ in range(N):
    ai, bi = map(int, input().split())
    A.append(ai)
    B.append(bi)
maxA = max(A)


"""
DP[i] モンスターの体力をi減らすため消耗する魔力の最小値

答え min_{H <= i < H + maxAi} DP[i]
"""

INF = int(1e18)
DP = [INF for _ in range(H + maxA + 1)]
DP[0] = 0

# print(DP)
for item in range(N):
    ai, bi = A[item], B[item]
    for idp, value in enumerate(DP):
        if value != INF and idp + ai < len(DP):
            DP[idp + ai] = min(DP[idp + ai], DP[idp] + bi)

ans = min(DP[H:H+maxA+1])
print(ans)

Measured memory_bytes: 43768
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef map<char,int> mci;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vii;
typedef vector<char> vc;
typedef vector<vc> vcc;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define F first
#define S second
#define in insert
#define mina(a,b) (a)=min((a),(b));
#define maxa(a,b) (a)=max((a),(b));
const int INF = 1e9 + 7;
void solve(){
    string s; cin>>s;
    for(int i = 0; i < 3; i++){
        if(s[i]==s[i+1]){
            cout<<"Bad";
            return;
        }
    }
    cout<<"Good";
}
int main(){
    int T=1;
    //cin>>T;
    for(int i = 0; i < T; i++) solve(); 
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;

void IF()
{
    int a, b;
    cin >> a >> b;

    if(a<b)
    {
        cout << "a < b" << endl;
    }
    if(a==b)
    {
        cout << "a == b" << endl;
    }
    if(a>b)
    {
        cout << "a > b" << endl;
    }
}

int main()
{
    IF();
}



Measured memory_bytes: 3056
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
#define all(obj) (obj).begin(), (obj).end()
static const int dx[4] = {0, 1, 0, -1};
static const int dy[4] = {1, 0, -1, 0};
static const char dir[4] = {'u', 'r', 'd', 'l'};
static const ll INF = 1 << 21;
static const ll MOD = 1e9 + 7;
int N;

signed main() {
  cin >> N;
  vector<int> A(N);
  rep(i, N) { cin >> A[i]; }
  sort(all(A));
  ll res = 1, sum = A[0];
  for (int i = 1; i < N; i++) {
    if (2 * sum < A[i]) {
      res = 0;
    }
    sum += A[i];
    ++res;
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 640
#include<iostream> 
#include<iomanip> 
#include<vector> 
#include<map> 
#include<set> 
#include<algorithm> 
#include<numeric> 
#include<limits> 
#include<bitset> 
#include<functional> 
#include<type_traits> 
#include<queue> 
#include<stack> 
#include<array> 
#include<random> 
#include<utility> 
#include<cstdlib> 
#include<ctime>
#define _LIBCPP_DEBUG 0
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (n); i++)	
using namespace std;


int max(int a,int b) {
	int max;
	if (a > b) max = a;
	else max = b;
	return max;
}
int min(int a, int b) {
	int min;
	if (a < b) min = a;
	else min = b;
	return min;
}


int main() {
	int n, a;
	cin >> n >> a;

	cout << (n + a + 1) / 2 << endl;
}

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

#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define fcin ios::sync_with_stdio(false); cin.tie(nullptr);
#define INF 0x3f3f3f3f
#define all(x) x.begin(), x.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;
typedef pair<int, int> pii;

int n, m;

const int N = 13;
const int M = 1003;

int key[M][N];
int qt[M];
int cost[M];
int memo[M][(1 << N)];

// i - which key, mask - locks opened
int dp(int i, int mask){
    if(__builtin_popcount(mask) == n) return 0;
    if(i == m) return INF;

    int& ret = memo[i][mask];
    if(ret) return ret;

    int open = mask;
    for(int k = 0; k < qt[i]; k++){
        open |= (1 << key[i][k]);
    }

    return ret = min(cost[i] + dp(i+1, open), dp(i+1, mask));
}

int main(){
    fcin;
    cin >> n >> m;

    for(int i = 0; i < m; i++){
        cin >> cost[i]; 
        int k;  cin >> k;
        qt[i] = k;
        for(int j = 0; j < k; j++){
            int x;  cin >> x;
            key[i][j] = x-1;
        }
    }

    int ans = dp(0, 0);
    cout << (ans == INF ? -1 : ans) << endl;
    return 0;
}



Measured memory_bytes: 30720
import java.util.*;
public class Main {
	public static void main(String[] args)
	{
		//変数
		int count=0;
		int count2=0;
		boolean sw=false;
		String answer="";
		//int t[]=new int[(int)Math.pow(10,5)];
		int max=Integer.MIN_VALUE;
		int min=Integer.MAX_VALUE;
		
		//入力
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		String s=sc.next();
		//List<Integer> A=new ArrayList<Integer>();
		//Arrays.sort(a,(x,y) -> Long.compare(x[0], y[0]));
		//処理
		for(int i=0;i<N;i++)
		{
			String ss=s.substring(i,i+1);
			if(ss.equals("R"))
			{
				count++;
			}else
			{
				count2++;
			}
		}
		if(count>count2)
		{
			answer="Yes";
		}else
		{
			answer="No";
		}
		// 出力
		//System.out.println(Arrays.toString(X));
		//System.out.println(Arrays.deepToString(a));
		//System.out.println(Arrays.toString(A.toArray()));
		System.out.println(answer);
	}
}

Measured memory_bytes: 24020
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>
#include <string.h>
using namespace std;

int main() {
	int a1,a2,a3,b1,b2 ,b3;
	bool l=false,m=false,n=false,k=false;
	int c[9]={};
	bool ans=false;
	for(int i=0;i<9;i++)cin>>c[i];
	if(c[1]-c[0]==c[4]-c[3]&&c[1]-c[0]==c[7]-c[6])k=true;
	if(c[2]-c[0]==c[5]-c[3]&&c[2]-c[0]==c[8]-c[6])l=true;
	if(c[3]-c[0]==c[4]-c[1]&&c[3]-c[0]==c[5]-c[2])m=true;
	if(c[6]-c[0]==c[7]-c[1]&&c[6]-c[0]==c[8]-c[2])n=true;
	if(k&&l&&m&&n)cout<<"Yes";
	else cout<<"No";
	}

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

int main()
{
    /* ------- 宣言と入力 ------- */

    string S;

    cin >> S;

    /* ------- 計算 ------- */

    for (int i = 0; i < S.length(); i++)
    {
        cout << "x";
    }

    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define sz(X) ((int)(X).size())
#define endl "\n";
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	string a,b;
	cin>>a>>b;
    if (a==b)
	{
		cout<<"EQUAL";
		return 0;
	}
	if (sz(a)==sz(b))
	{
	  if(a[0]<b[0]) cout<<"LESS"; else cout<<"GREATER";
	  return 0;
	}
	
	if(sz(a)<sz(b)) cout<<"LESS"; else cout<<"GREATER";
	

   return 0;
}


Measured memory_bytes: 3592
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        n: usize,
        m: usize,
        mut x: [i64; 3*n],
    }

    let mut ans = 0;

    for c in 0..8 {
        let mut vec = Vec::new();
        let mut sign = Vec::new();
        let mut _c = c;
        for _ in 0..3 {
            sign.push(
                if _c & 1 == 0 {
                    1
                } else {
                    -1
                }
            );
            _c = _c >> 1;
        }

        for i in 0..n {
            let mut v = 0;
            for j in 0..3 {
                v += x[3*i + j] * sign[j];
            }
            vec.push(v);
        }
        vec.sort();

        let mut _ans = 0;
        for i in 0..m {
            _ans += vec[n-1-i];
        }

        if _ans > ans {
            ans = _ans;
        }
    }

    println!("{}", ans);
}


Measured memory_bytes: 2276
#include <stdio.h>
#include <string.h>

int main(void)
{
	int s, i, j, ii, n, len;
	char str[15], str1[25];
	
	scanf("%s", str);
	scanf("%d", &n);
	
	s = 0;
	len = strlen(str);
	
	for (i = 0; i < n; i++){
		scanf("%s", str1);
		strcat(str1,str1);
		
		for (j = 0; j < 20; j++){
			if (str[0] == str1[j]){
				for (ii = 0; ii < len; ii++){
					if (str[ii] != str1[j + ii]){
						break;
					}
				}
			}
			if (ii == len){
				s++;
				ii = 0;
				break;
			}
		}
	}
	
	printf("%d\n", s);
	
	return (0);
}
	

Measured memory_bytes: 604
// MOHIT KUMAR
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pin;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;
void change(ll&a , ll b) {a = max(a, b);}
#define ff(i, a, b) for ( ll i=a; i<(b); i++)
#define ffd(i, a, b) for ( ll i=a; i<= b; i++)
#define fr(i, a, b) for ( ll i = (b)-1; i >= a; i--)
#define ffr(i, a, b) for ( ll i = b ; i >= a; i--)
#define vl vector < ll >
#define vp vector < pl >
#define endl "\n"
#define sz(x) (ll)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()

const ld pi = acos(-1) ;
const ll maxn = 105 ;
const int mod = 1e9 + 7 ;
const ll INF = 1e18 ;
const int MX = 2000000001 ; // check the limits, dummy

int main() {
  ios_base::sync_with_stdio(0) , cin.tie(0);
  ll t, q, n, a, b, c, d, k, l, m, r,  x = 0, y = 0, z = 0 , sum = 0, ans = 0, temp = 0, res = 0 ;
  string s ;
  cin >> a >> b >> c >> d ;
  x = a * c ;
  y = a * d ;
  z = b *  c ;
  ans = b * d ;
  cout << max({x, y, z, ans}) ;
}

Measured memory_bytes: 3648
using System;
using System.Collections.Generic;
using System.Linq;

class D
{
	static void Main()
	{
		var h = Console.ReadLine().Split().Select(long.Parse).ToArray();
		var g = Gcd(h[0], h[1]);

		var l = new List<long>();
		foreach (var d in Divisors(g))
		{
			if (d == 1) continue;
			if (l.TrueForAll(x => d % x != 0)) l.Add(d);
		}
		Console.WriteLine(l.Count + 1);
	}

	static long Gcd(long x, long y) { for (long r; (r = x % y) > 0; x = y, y = r) ; return y; }

	static long[] Divisors(long v)
	{
		var d = new List<long>();
		var c = 0;
		for (long i = 1, j, rv = (long)Math.Sqrt(v); i <= rv; i++)
			if (v % i == 0)
			{
				d.Insert(c, i);
				if ((j = v / i) != i) d.Insert(++c, j);
			}
		return d.ToArray();
	}
}


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

int zyou(int N) {
  int A;
  N--;
  if(N == 0){
    A = 2;
  }else{
    A = zyou(N)*2;
  }
  return A;
}

int hantei(int y,int x ,vector<vector<int>> &A){
  int W,H,count;
  count = 0;
  W = A.at(0).size();
  H = A.size();
  vector<int> W_bit(W);
  for(int i =0;i < W;i++){
    W_bit.at(i) = x %2;
    x /=2;
    //cout << W_bit.at(i) << endl;
  }
  //cout << endl;
  vector<int> H_bit(H);
  for(int i =0;i < H;i++){
    H_bit.at(i) = y %2;
    y /=2;
    //cout << H_bit.at(i) << endl;
  }
  //cout << endl;
  
  for (int i = 0; i < W; i++) {
    //cout << i <<endl;
    if(0 == W_bit.at(i)){
      //cout << 33 <<endl;
      for (int j = 0; j < H; j++) {
        //cout << j <<endl;
        if(0 == H_bit.at(j)){
          //cout << 44 <<endl;
          if(A.at(j).at(i) ==1){
            count++;
          }
        }
      }
    }
  }
  //cout << count << endl;
  
  return count;
}

int main() {
  int H,W,K,count;
  cin >> H >> W >> K;
  count = 0;
  
  vector<vector<int>> data(H, vector<int>(W));
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      char C;
      cin >> C;
      if(C =='.'){
        data.at(i).at(j) = 0;
      }else{
        data.at(i).at(j) = 1;
      }
    }
  }
  //for (int i = 0; i < H; i++) {
  //  for (int j = 0; j < W; j++) {
  //    cout << data.at(i).at(j) << " ";
  //  }
  //  cout << endl;
  //}  

  for (int i = 0; i < zyou(H); i++) {
    for (int j = 0; j < zyou(W); j++) {
    int B;
    B= hantei(i,j,data);
    if(B == K){
    count++;
    }
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
 
int main() {
  long n;
  cin>>n;
  if(n<4||n==5||n==6||n==9||n==10||n==13||n==17){
    cout<<"No"<<endl;
  }
  else{
    cout<<"Yes"<<endl;
  }
}

Measured memory_bytes: 3596
num_t = int(input())
T_point = 0
H_point = 0
for i in range(num_t):
    TH = input()
    TH_list = TH.split(" ")
    if TH_list[0] > TH_list[1]:
        T_point += 3
    elif TH_list[0] < TH_list[1]:
        H_point += 3
    else:
        T_point += 1
        H_point += 1
print(str(T_point) + " " + str(H_point))


Measured memory_bytes: 5596
/*
C:\Users\jolog\CLionProjects\progcpp
 */
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
#define all(x) (x).begin(),(x).end()
#define endl '\n'
#define int long long


signed main() { //[J][O][L][S][K][E][Y]
        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
//        freopen("input.txt", "r", stdin);
        int k; cin >> k;
        queue<int> q;
        for (int x = 1; x <= 9; x++) q.push(x);

        while (k) {
                int x = q.front(); q.pop();
                if (--k == 0) cout << x;
                if (x % 10) q.push(10 * x + x % 10 - 1);
                q.push(10 * x + x % 10);
                if (x % 10 != 9) q.push(10 * x + x % 10 + 1);
        }


        return 0;
}

/*

*/

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

int main(){
    string s;
    cin >> s;
    int q;
    cin >> q;
    string t;
    rep(qi, q) {
        int ty;
        cin >> ty;
        if(ty == 1) {
            swap(s, t);
        } else {
            int f; char c;
            cin >> f >> c;
            if (f == 1) {
                t += c;
            } else {
                s += c;
            }
        }
    }
    reverse(t.begin(), t.end());
    t += s;
    cout << t << endl;
    return 0;
}

Measured memory_bytes: 1156
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int N;
int A[300000];

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N;
  rep(i, 3*N) cin >> A[i];
  sort(A, A+3*N);
  long long s = 0;
  for (int i=N; i<3*N; i+=2) {
    s += A[i];
  }
  cout << s << "\n";
  return 0;
}


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

using namespace std;
int num[20],check1[20],check2[20];//check1串从1开始，check2串从0开始
int main()
{
    int n,m,a,index=0,numOfOne=0;
    int check=2;
    std::ios::sync_with_stdio(false);
    cin>>n>>m;
    for (int i=0; i<n; i++)
    {
        cin>>num[i];
        numOfOne+=num[i];
    }
    int x=0;
    for (int i=0; i<m; i++)
    {
        cin>>a;
        if (i%2==0)
        {
            for (int j=0; j<a; j++)
            {
                check1[index]=1;
                check2[index++]=0;
            }
            x+=a;
        }
        else
            for (int j=0; j<a; j++)
            {
                check1[index]=0;
                check2[index++]=1;
            }
    }
    if (x!=numOfOne)
        check=0;
    else if (x!=n-numOfOne)
        check=1;
    int ans=0;
    if (check==2)
    {
        int ans1=0,ans2=0;
        for (int i=0; i<n; i++)
        {
            if (num[i]!=check1[i])
            {
                int result=find(check1+i,check1+n, num[i])-check1;
                swap( check1[i],check1[result] );
                ans1+=result-i;

            }
        }
        for (int i=0; i<n; i++)
        {
            if (num[i]!=check2[i])
            {
                int result=find(check2+i,check2+n, num[i])-check2;
                swap(check2[i],check2[result] );
                ans2+=result-i;
            }
        }
        ans=min(ans1,ans2);
    }
    else if (check==1)//check1
    {
        for (int i=0; i<n; i++)
        {
            if (num[i]!=check1[i])
            {
                int result=find(check1+i,check1+n, num[i])-check1;
                swap( check1[i],check1[result] );
                ans+=result-i;

            }
        }
    }
    else
    {
        for (int i=0; i<n; i++)
        {
            if (num[i]!=check2[i])
            {
                int result=find(check2+i,check2+n, num[i])-check2;
                swap( check2[i],check2[result] );
                ans+=result-i;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}



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

#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main()
{
    vector<int> antenna(5);
    REP(i, 5)   cin >> antenna[i];

    int k;
    cin >> k;

    int maxi = *max_element(antenna.begin(), antenna.end());
    int mini = *min_element(antenna.begin(), antenna.end());

    if ((maxi - mini) <= k)  cout << "Yay!" << endl;
    else                    cout << ":(" << endl;
    
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <regex>
#include <random>
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exout(x) printf("%.10f\n", x)
const double pi = acos(-1.0);
const ll MOD = 1000000007;
const ll INF = 1e18;
const ll MAX_N = 201010;

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

ll dx[4] = { 0,0,-1,1 };
ll dy[4] = { -1,1,0,0 };
char a[110][110];

//long longしか使わない
//素数は1より大きい
//lower_boundは指定したkey以上の要素の一番左のイテレータをかえす
//upper_boundは指定したkeyより大きい要素の一番左のイテレータをかえす
int main() {
	ll n;
	cin >> n;
	vector<ll>a(n);
	rep(i, n) {
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	vector<pair<ll, ll>>p;
	ll y = a[0];
	ll x = a[n - 1];
	for (ll i = 1;i < n - 1;++i) {
		if (a[i] < 0) {
			p.push_back(make_pair(x, a[i]));
			x = x - a[i];
		}
		else {
			p.push_back(make_pair(y, a[i]));
			y = y - a[i];
		}
	}
	p.push_back(make_pair(x, y));
	cout << x - y << endl;
	rep(i, n - 1) {
		cout << p[i].first << " " << p[i].second << endl;
	}
	return 0;
}


Measured memory_bytes: 6156
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n+1;i++)
#define sort(A) sort(A.begin(),A.end())
#define reverse(A) reverse(A.begin(),A.end())
typedef long long ll;
typedef pair<int,int> P;

int main(){
  
  int n;
  cin >>n;
  map<string,int> mp;
  rep(i,n){
    string s;
    cin >>s;
    mp[s] ++;
  }
  int m;
  cin >>m;
  rep(i,m){
    string s;
    cin >>s;
    mp[s] --;
  }
  int ans = 0;
  for (auto p : mp) ans = max(ans,p.second);
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>

constexpr int NUM_OF_DAYS = 31;
bool dp[50][50] = { {false} }; //??°???????????????????????????????????? [???][??°???] = hasMap
bool isFree[50][31] = { {false} };

int main() {
	int n;
	while (std::cin >> n && n) {
		bool next = false;
		std::memset(dp, false, 50*50);
		std::memset(isFree, false, 50*31);
		for (int i = 0; i < n; i++) {
			int f;
			std::cin >> f;
			//100%???????????????
			if (!f) {
				std::cout << -1 << std::endl;
				next = true;
			}
			for (int j = 0; j < f; j++) {
				int day;
				std::cin >> day;
				isFree[i][day] = true;
			}
		}
		if (next) continue;
		for (int i = 0; i < n; i++) {
			dp[i][i] = true;
		}

		bool isOk[50] = { false };
		for (int i = 1; i < NUM_OF_DAYS; i++) {
			//????????????????????????????????¢???
			for (int j = 0; j < n; j++) {
				isOk[j] = isFree[j][i];
			}

			//???????????????????????????????????§?????°????????????
			for (int j = 0; j < n; j++) { //???
				if (!isFree[j][i]) continue; //???????????????????????????????????????
				for (int k = 0; k < n; k++) { //??°????????? ???
					if (isOk[k]) {
						for (int l = 0; l < n; l++) { //??°???
							dp[j][l] = dp[j][l] || dp[k][l];
						}
					}
				}
			}

			//????????£???????????????
			for (int j = 0; j < n && !next; j++) {
				bool isGather = true;
				for (int k = 0; k < n; k++) {
					isGather = isGather && dp[j][k];
				}
				if (isGather) {
					std::cout << i << std::endl;
					next = true;
				}
			}
		}
		if (!next) std::cout << -1 << std::endl;
	}
	return 0;
}

Measured memory_bytes: 2996
#include <bits/stdc++.h>
#define mem(s,t) memset(s,t,sizeof(s))
#define pb(s) push_back(s)
#define inf 0x3f3f3f3f
#define mn 100010
typedef long long ll;
using namespace std;

struct X
{
    int w,i;
}a[100010],b[100010];

bool cmp(X x,X y)
{
    return x.w<y.w;
}

int n,to[100010],vis[100010];

int main()
{
    int i,j;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i].w);
        a[i].i=i;
    }
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&b[i].w);
        b[i].i=i;
    }
    sort(a+1,a+n+1,cmp);
    sort(b+1,b+n+1,cmp);

    for (i=1;i<=n;i++)
    if (a[i].w>b[i].w)
    {
        printf("No\n");
        return 0;
    }
    bool f=false;
    for (i=1;i<n;i++)
        if (a[i+1].w<=b[i].w) f=true;
    if (f)
    {
        printf("Yes\n");
        return 0;
    }
    for (i=1;i<=n;i++)
        to[a[i].i]=b[i].i;
    int now=1;
    while (vis[now]!=1)
    {
        vis[now]=1;
        now=to[now];
    }
    for (i=1;i<=n;i++)
        if (vis[i]==0)
        {
            printf("Yes\n");
            return 0;
        }
    printf("No\n");
    return 0;
}



Measured memory_bytes: 2560
for i in range(30):
    n = int(input())
    if n == 0:
        break

    INF = 105 * 10 ** 7
    dp = [0] * 100010

    dp[0] = 1
    dp[1] = 2
    dp[2] = 4

    for i in range(3, n):
        dp[i] = dp[i-1] + dp[i-2] + dp[i-3]

    years = dp[n-1] // 3650  + 1 if dp[n-1] % 3650 else dp[n-1] // 3650
    print(years)



Measured memory_bytes: 7040
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
#define all(x) x.begin(),x.end()
template<class T>
void dmp(T a){
	rep(i,a.size()) cout << a[i] << " ";
	cout << endl;
}
template<class T>
bool chmax(T&a, T b){
	if(a < b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a, T b){
	if(a > b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(T a){
	cout << a << '\n';
}
const ll mod = 1000000007;//998244353
template<class T>
void add(T&a,T b){
	a+=b;
	if(a >= mod) a-=mod;
}
string as[4] = {"Yes", "YES", "No", "NO"};

ll a,b;
int main(){
	g(a); g(b);
	if(a == 1 || b == 1) o(1);
	else{
		o( (a*b+1)/2 );
	}
}

Measured memory_bytes: 256
import java.util.Scanner;


public class Main {

	public static final int TABLESIZE = 1000003;
	static String[] table = new String[TABLESIZE];

	public static void main(String[] args) throws Exception {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();

		String cmd,str;

		for(int i = 0 ; i < n ; i++){
			cmd = scan.next();
			str = scan.next();

			if("insert".equals(cmd)){
				insert(str);
			}else{
				if(find(str)){
					System.out.println("yes");
				}else{
					System.out.println("no");
				}
			}
		}
	}

	public static void insert(String str){
		int i = 0;
		int hash;
		while(i < TABLESIZE){
			hash = makeHash(str,i);
			if(table[hash] == null){
				table[hash] = str;
				return;
			}
			i++;
		}
	}

	public static boolean find(String str){
		int i = 0;
		int hash;
		while(i < TABLESIZE){
			hash = makeHash(str,i);
			if(str.equals(table[hash])){
				return true;
			}else if(table[hash] == null){
				return false;
			}
			i++;
		}

		return false;

	}

	public static int makeHash(String str,int i){
		int key = getKey(str);
		return (h1(key) + i * h2(key)) % TABLESIZE;
	}

	public static int getKey(String str){
		int key = 0;
		int x = 1;
		for(int i = 0 ; i < str.length() ; i++){
			key += x * getChar(str.charAt(i));
			x *= 5;
		}
		return key;
	}

	public static int getChar(char c){
		if('A' == c){
			return 1;
		}else if('C' == c){
			return 2;
		}else if('G' == c){
			return 3;
		}else{
			return 4;
		}
	}

	public static int h1(int key){
		return key % TABLESIZE;
	}

	public static int h2(int key){
		return 1 + (key % (TABLESIZE - 1));
	}
}

Measured memory_bytes: 257592
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,m,rudu[100005];
int main(){
	scanf("%d%d",&n,&m);int x,y;
	for(int i=1;i<=m;i++){
		scanf("%d%d",&x,&y),rudu[x]++,rudu[y]++;
	}
	for(int i=1;i<=n;i++)if(rudu[i]%2==1){puts("NO");return 0;}
	puts("YES");
}



Measured memory_bytes: 512
import scala.annotation.tailrec
object Main extends App {

  import scala.io.StdIn._

  solve
  def solve: Unit = {
    val Array(expression, i) = readLine.split(' ')
    if (expression == "0") return
    expression.toList match {
      case g Genome Nil ⇒ g.nThGenome(i.toInt) match {
        case Right(c) ⇒ println(c)
        case Left(_) ⇒ println(0)
      }
      case g Genome t ⇒ println(g, t)
    }
    solve
  }
  object Genome {
    def unapply(arg: List[Char]): Option[(Genome, List[Char])] = {
      arg match {
        case l Term rest ⇒ rest match {
          case g Genome t ⇒ Some(SequenceGenome(l, g), t)
          case _ ⇒ Some(l, rest)
        }
        case _ ⇒ None
      }
    }
  }
  object Term{
    def unapply(arg: List[Char]): Option[(Genome, List[Char])] = {
      arg match {
        case '('::(g Genome ')'::t) ⇒ Some(g, t)
        case n Number (g Term t) ⇒ Some(RepeatGenome(g, n), t)
        case h::t if h.isLetter ⇒ Some(SingleGenome(h), t)
        case _ ⇒ None
      }
    }
  }
  trait Genome {
    def nThGenome(n: Int): Either[Int, Char]
    def length: Int
  }
  case class SingleGenome(char: Char) extends Genome {
    override def nThGenome(n: Int): Either[Int, Char] = if (n == 0) Right(char) else Left(n - 1)
    override def length: Int = 1
  }
  case class SequenceGenome(head: Genome, tail: Genome) extends Genome {
    override def nThGenome(n: Int): Either[Int, Char] = if (n >= length) Left(n - length) else head.nThGenome(n) match {
      case Left(l) ⇒ tail.nThGenome(l)
      case r ⇒ r
    }
    override val length: Int = (head.length + tail.length).let{i ⇒ if (i > 1000001) 1000001 else i}
  }
  case class RepeatGenome(genome: Genome, repeat: Int) extends Genome {
    override def nThGenome(n: Int): Either[Int, Char] = if (n >= length) Left(n - length) else genome.nThGenome(n % genome.length)
    override val length: Int = (genome.length.toLong * repeat).let{i ⇒ if (i > 1000001) 1000001 else i.toInt}
  }
  object Number {
    def unapply(arg: List[Char]): Option[(Int, List[Char])] = {
      arg.span(_.isDigit) match {
        case (Nil, _) ⇒ None
        case (number, t) ⇒ Some(number.mkString.toInt, t)
      }
    }
  }
  implicit class Extension[T](val value :T) extends AnyVal {
    @inline
    def let[A](@inline func: T ⇒ A): A = func(value)
    @inline
    def also(@inline func: T ⇒ Unit): T = {func(value); value}
  }
}


Measured memory_bytes: 58608
#include<iostream>
#include<stack>
#include<queue>
using namespace std;
using ll= long long;

int main()
{
  string s;
  cin>>s;
   ll i,sum=0;
   for(i=0;i<s.size();i++)
   {
  sum=sum+s[i]-48;
  }

  if(sum%9==0)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

}

Measured memory_bytes: 3696
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

int main()
{
    int x, y;
    cin >> x >> y;

    int ans = 0;
    if(x <= 3)
        ans += (4 - x) * 100000;
    if(y <= 3)
        ans += (4 - y) * 100000;
    if(x == 1 && y == 1)
        ans += 400000;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long ll;

#define FOR(i,S,E) for(int i=S; i<E; i++)
#define ri(x) scanf("%d", &x)

const int MAXN = 1e5+10;
int A[MAXN], B[MAXN], C[MAXN];  // upper, middle, lower parts
ll preB[MAXN];                 // prefix sum of middle parts

int main() {
    int N;
    ri(N);
    FOR(i,0,N) ri(A[i]);
    FOR(i,0,N) ri(B[i]);
    FOR(i,0,N) ri(C[i]);
    // sort parts
    sort(A, A+N);
    sort(B, B+N);
    sort(C, C+N);
    ll ans=0;   // answer

    /*
        for each middle part, find number of lower parts that
        can be put below
    */
    FOR(i,0,N) {
        int b = B[i];
        auto itr = upper_bound(C, C+N, b);

        /*
            prefix_sum(i) = (# valid lower parts below B[i]) + prefix_sum(i-1)
            prefix_sum(0) = (# valid lower parts below B[0])
        */
        preB[i] = distance(itr, C+N);
        if (i) preB[i] += preB[i-1];
    }

    /*
        for each upper part, find middle parts that can be put below
    */
    FOR(i,0,N) {
        int a = A[i];
        auto itr = upper_bound(B, B+N, a);
        int idx = distance(B, itr);
        ans += preB[N-1] - preB[idx-1];
    }

    printf("%lld\n", ans);
}


Measured memory_bytes: 2176
#include <cstdio>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_in(int c){int n=0;bool m=false;if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0');return m?-n:n;} //&&c<='9'
_in() {return in(gcu());}
_sc(int &n){int c=gcu();return c==EOF?false:(n=in(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
//_sc(string &s){int c;s="";
//	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
template <typename H,typename... T> _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
template <typename T>
_vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
//_vo(string &s){for (char c: s) pcu(c);}
template <typename H,typename... T> _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename T> _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);out('\n');}
_vl(){out('\n');}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	vector<int> v(in());
	for (int &x: v)
		x = in();
	auto s = v.begin();
	for (int q = in(); q; q--) {
		int b = in(), e = in();
		swap_ranges(s + b, s + e, s + in());
	}
	out(v);
}


Measured memory_bytes: 2636