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

int mat[501][501];

void construct(int left, int right, int level = 1) {
  if(right - left <= 1) return;
  int mid = (left + right) / 2;
  for(int i = left; i < mid; i++) for(int j = mid; j < right; j++) mat[i][j] = mat[j][i] = level;
  construct(left, mid, level + 1);
  construct(mid, right, level + 1);
}

int main() {
  int N;
  cin >> N;
  construct(0, N);
  for(int i = 0; i < N; i++) for(int j = i + 1; j < N; j++) cout << mat[i][j] << " \n"[j + 1 == N];
  return 0;
}

Measured memory_bytes: 1408
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def solve(inp):
    A = int(inp.readline().strip())
    S = inp.readline().strip()
    if A >= 3200:
        return S
    else:
        print("red")


def main():
    import sys
    result = solve(sys.stdin)
    if result is not None and result != '':
        print(result)


if __name__ == '__main__':
    main()


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

signed main(){
	int a,b;cin>>a>>b;
	if(b==1||b==2*a-1){puts("No");return 0;}
	puts("Yes");
	if(a==2){puts("1");puts("2");puts("3");}
	else{
		vector<int>ans(2*a-1);
		set<int>L;
		for(int i=1;i<2*a;i++)L.insert(i);
		ans[a-1]=b;
		ans[a-2]=b-1;
		ans[a]=b+1;
		L.erase(b);
		L.erase(b-1);
		L.erase(b+1);
		if(b==2){
			ans[a-3]=b+2;
			L.erase(b+2);
			}
		else{
			ans[a+1]=b-2;
			L.erase(b-2);
			}	
		for(int i=0;i<2*a-1;i++){
			if(ans[i]==0){
				ans[i]=*L.begin();
				L.erase(L.begin());
				}
			}	
		for(int i:ans){
			cout<<i<<endl;
			}
		}
	}


Measured memory_bytes: 13184
#include<bits/stdc++.h>
using namespace std;
 
typedef long long int ll;
typedef long double ld;
 
//****************************************************                
#define f(var,start,end) for(ll var = start; var <end ; ++var)
#define rf(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define vvll vector<vector<ll>>
#define mtp make_tuple
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll,ll> 
#define vpll vector<pll>
#define all(X) X.begin(),X.end()
#define nl cout<<"\n"
#define trace1(a) cerr << #a << ": " << a << endl;
#define trace2(a,b) cerr << #a << ": " << a << " " << #b << ": " << b << endl;
#define trace3(a,b,c) cerr << #a << ": " << a << " " << #b << ": " << b << " " << #c << ": " << c << endl;
#define trace4(a,b,c,d) cerr << #a << ": " << a << " " << #b << ": " << b << " " << #c << ": " << c << #d << ": " << d << endl;
#define OC freopen("input.txt" , "r", stdin); freopen("output.txt" , "w", stdout) 
#define MOD (ll)1e9+7; //change it for other mods
#define FAST_IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
        //*******************************************************
//Some Functions
void solve();

int binary(int a[],int l,int r,int find)
{
    if(l>r)
    {
        return -1; 
    }else
    {
        int mid=(l+r)/2;
        if(a[mid]==find)
        {
            return mid+1;
        }else if(a[mid]>find)
        {
            binary(a,l,mid-1,find);
        }else
        {
            binary(a,mid+1,r,find);
        }   
    }   
}

int main()
{
    FAST_IO;
    ll testcases = 1;
    // cin >> testcases; //comment for 1 test case
    while(testcases--)
    {
        solve();
    }
}

void solve()
{
	ll n,k;
	cin>>n>>k;
	vll a(n);
	f(x,0,n)
	{
		cin>>a[x];
	}
	sort(all(a));
	ll ans=0;
	f(x,0,k)
	{
		ans+=a[x];
	}
	cout<<ans;
	nl;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using ll = long long;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define ALL(x) x.begin(),x.end()

#define INF (int)1e9 //10^9:∞
#define LLINF (long long)1e12
#define MOD (int)1e9+7 //10^9+7:合同式の法
#define PI 3.141592653589
#define PB push_back
#define F first
#define S second
#define __MAGIC__ ios::sync_with_stdio(false);cin.tie(nullptr);

#define YESNO(T) if(T){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(T) if(T){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(T) if(T){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#define Graph vector<vector<int>>
#define PII pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>
#define VPII vector<pair<int,int>>

#define DDD fixed<<setprecision(10)

using namespace std;
/*..................DEFINE GLOBAL VARIABLES...................*/


/*.....................DEFINE FUNCTIONS ......................*/



/*.........................kemkemG0...........................*/
signed main() {
	__MAGIC__

	int N;
	cin>>N;
	map<int,int> mp;
	REP(i,N){
		int a;cin>>a;
		mp[a]++;
	}
	int ans=0;
	for(auto m:mp){
		int a=m.F;
		int num=m.S;
		if(num<a)ans+=num;
		if(num>a)ans+=num-a;
	}

	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 8044
#include<iostream>
using namespace std;
int main(void) {
	int a, b;
	cin >> a >> b;
	double tax_double_a, tax_double_b;
	int answer(-1);
	for (int i(0); i <= 1000; i++) {
		tax_double_a = (double)i*0.080;
		tax_double_b = (double)i*0.100;
		if ((int)tax_double_a == a && (int)tax_double_b == b) {
			answer = i;
			break;
		}
	}
	cout << answer << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(void){
   ll N,K,sum=0;
   cin >> N >> K;
   vector<ll> A(N);
   if(K>=N){
       cout << 0 << endl;
   }
   else{
   for(int i=0;i<N;i++){
       cin >> A[i];
       sum+=A[i];
   }
   sort(A.begin(),A.end());
   reverse(A.begin(),A.end());
   for(int i=0;i<K;i++) {
       sum-=A[i];
   }
   cout << sum << endl;
   }
}


Measured memory_bytes: 4852
//      https://www.youtube.com/watch?v=RBtlPT23PTM

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef long long unsigned llu;
typedef pair<long long, long long> pll;
const long long inf = 2000000000000000000LL;    // 2e18
#define pi                  acos(-1.0)
#define fast                ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define nl                  "\n"
#define ff                  first
#define ss                  second
#define pb                  push_back
#define pf                  push_front
#define all(x)              x.begin(),x.end()
#define debug(x)            cout<<"debug "<<x<<"\n"

int main()
{
    fast;
    ll t,i,j,k,l,m,n,o,p,q,temp,ans=0,flag=0,mod=1000000007,zero=0;
    cin>>n>>k;
    vector<ll>pos,neg;
    for(i=0;i<n;i++){
        cin>>temp;
        if(temp>0) pos.pb(temp);
        else if(temp<0) neg.pb(temp);
        else zero++;
    }
    sort(all(pos));
    sort(all(neg));
    //for pos product
    temp=0;
    if(k%2){
        if(!pos.size()){
             flag++;
             //break;
        }else{
            ans=pos[pos.size()-1];
            j=pos.size()-2;
        }
    }else{
        ans=1;
        j=pos.size()-1;
    }
    //cout<<pos.size()<<nl<<neg.size()<<nl;
    for(i=0,l=0;i<k-(k%2)&&!flag;i+=2){
        if(j-1-temp<0 && l+1>=neg.size()){
            flag++;
            break;
        }else if(j-1-temp<0){
            ans*=((neg[l]*neg[l+1])%mod);
            ans%=mod;
            l+=2;
        }else if(l+1>=neg.size()){
            ans*=((pos[j]*pos[j-1])%mod);
            ans%=mod;
            j-=2;
        }else{
            //cout<<'?';
            ll temp1=((neg[l]*neg[l+1]));
            ll temp2=((pos[j]*pos[j-1]));
            if(temp1>=temp2){
                temp1%=mod;
                ans*=temp1;
                ans%=mod;
                l+=2;
            }else{
                temp2%=mod;
                ans*=temp2;
                ans%=mod;
                j-=2;
            }
        }
    }
    if(temp && pos.size() && !flag){
        ans*=pos[j];
        ans%=mod;
    }else if(temp && !pos.size()) flag++;
    if(!flag){
        cout<<ans;
        return 0;
    }
    if(zero){
        cout<<"0";
        return 0;
    }
    //for neg product
    vector<ll>v;
    for(i=0;i<pos.size();i++) v.pb(pos[i]);
    for(i=0;i<neg.size();i++) v.pb(-1*neg[i]);
    sort(all(v));
    for(i=0,ans=-1;i<k;i++){
        ans+=mod;
        ans%=mod;
        ans*=v[i];
        ans%=mod;
    }
    cout<<ans;
}


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

typedef long long ll;
typedef pair<ll, ll> P;


#define rep(i,n) for(ll (i)=0; (i)<(ll)(n); (i)++)
#define frep(i,m,n) for(ll (i)=(m); (i)<=(ll)(n); (i)++)
#define rrep(i,n) for(ll (i)=(n)-1; (i)>-1; (i)--)
#define frrep(i,m,n) for(ll (i)=(n); (i)>(ll)(m); (i)--)
#define ALL(x) (x).begin(), (x).end()
#define PB(x) push_back(x)

const ll INF = 100100100100100100;
const ll MOD = 1000000007;

// get abs
ll my_abs(ll a);
// a^n
ll a_n(ll a, ll n);
// get gcd
ll my_gcd(ll a, ll b);
// a^(-1) % MOD 
ll inv(ll a);
// (a+b+c)%MOD
ll madd(ll a, ll b, ll c);
// (a-b)%MOD
ll msub(ll a, ll b);
// (a*b*c)%MOD
ll mtime(ll a, ll b, ll c);


int main() {
    ll n; cin >> n;
    string s; cin >> s;
    vector<ll> a(26, 1);
    rep(i, n) {
        a[s[i]-'a']++;
    }
    ll ans = 1;
    rep(i, 26) {
        ans = mtime(ans, a[i], 1);
    }
    ans = msub(ans, 1);
    cout << ans << endl;
    return 0;
}

ll my_abs(ll a) {
    if(a >= 0) return a;
    else return -1 *a;
}

ll a_n(ll a, ll n) { 
    if(n == 0) return 1;
    
    ll ret = a, count = 1;
    while(count * 2 < n) {
        ret *= ret;
        count *= 2;
    }
    if(count == n) return ret;
    else return (ret * a_n(a, n-count));
}

ll my_gcd(ll a, ll b) {
    if(b == 0) return a;
    return my_gcd(b, a%b);
}

ll inv(ll a) {
    return a_n(a, MOD-2);
}

ll madd(ll a, ll b, ll c) {
    ll ret = (a+b) % MOD;
    return (ret+c) % MOD;
}

ll msub(ll a, ll b) {
    if(a < b) return (a-b+MOD) % MOD;
    else return (a-b) % MOD;
}

ll mtime(ll a, ll b, ll c) {
    ll ret = (a*b) % MOD;
    return (ret*c) % MOD;
}


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

int main() {
  //A B C
  //D E F
  //G H I
  int A,B,C,D,E,F,G,H,I;
  cin >> A >> B >> C >> D >> E >> F >> G >> H >> I;
  if(A+E != B+D){
    cout << "No" << endl;
    return 0;
  }
  if(E+I != F+H){
    cout << "No" << endl;
    return 0;
  }
  if(A+I != C+G){
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
#define endl '\n';
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr double INFD = 1e100;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[4] = {1, 0, -1, 0};
const int 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; }
// ios::sync_with_stdio(false);
// cin.tie(nullptr);
// ---------------------------------------------------------------------------

int main(){
  double n,m,d;
  cin >> n >> m >> d;
  double ans;
  if(d == 0){
    ans = ((m-1.0)*(n-d))/(n*n);
  }else{
    ans = ((m-1.0)*2.0*(n-d))/(n*n);
  }
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (long long i = 0, max_i = (n); i < max_i; i++)
#define REPI(i, a, b) for (long long i = (a), max_i = (b); i < max_i; i++)
#define ALL(obj) begin(obj), end(obj)
#define RALL(obj) rbegin(obj), rend(obj)
#define fi first
#define se second
using ii = pair<int, int>;
vector<ii> dirs = {
    {1, 0}, {0, 1}, {-1, 0}, {0, -1},  // 4方向
    {1, 1}, {-1, 1}, {-1, -1}, {1, -1},  // 斜め
    {0, 0},  // 自身
};
template <class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template <class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <class T, class S> vector<T> make_vec(size_t n, S x) { return vector<T>(n, x); }
template <class T, class... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(n, make_vec<T>(ts...)); }

// debug
template <class T> ostream& operator<<(ostream& s, vector<T>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : " "); return s; }
template <class T> ostream& operator<<(ostream& s, vector<vector<T>>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : "\n"); return s; }
template <class T, class S> ostream& operator<<(ostream& s, pair<T, S>& p) { s << "{" << p.first << ", " << p.second << "}"; return s; }
template <class T, class S> ostream& operator<<(ostream& s, map<T, S> m) { for (auto it = m.begin(); it != m.end(); it++) { s << *it << (next(it) == m.end() ? "" : "\n"); } return s; }
#ifdef _MY_DEBUG
    #define dump(...) cerr << "/* " << #__VA_ARGS__ << " :[" << __LINE__ << ":" << __FUNCTION__ << "]" << endl, dump_func(__VA_ARGS__), cerr << "*/\n\n";
#else
    #define dump(...)
    #define endl "\n"
#endif
void dump_func() { cerr << endl; }
template <class Head, class... Tail> void dump_func(Head&& h, Tail&&... t) { cerr << h << (sizeof...(Tail) == 0 ? "" : ", "), dump_func(forward<Tail>(t)...); }

struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); } } fast;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
constexpr int MOD = 1000000007;
// *************** TEMPLATE END *************** 

signed main() {
    int a, b, c; cin >> a >> b >> c;
    c -= min(c, a - b);
    cout << c << endl;
}


Measured memory_bytes: 256
n = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

m_total = 0
l = make_divisors(n)

for x in l:
    m = n//x - 1
    if x < m:
        m_total += m

print(m_total)


Measured memory_bytes: 3268
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--)
#define itn int
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
const long long INF = 1LL << 60;
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
struct LazySegTree{ //seg sum
    int n;
    vector <int> node, lazy;
   
    LazySegTree(vector <int> v){
        int sz = v.size();
        n = 1;
        while(n<sz) n*=2;
        node.resize(2*n-1);
        lazy.resize(2*n-1, 0);
        for(int i=0; i<sz; i++) node[i+n-1] = v[i]; //一番下側
        for(int i=n-2;i>=0;i--) node[i] = node[2*i+1]+node[2*i+2];
    }
    void eval(int k,int l, int r){
        if(lazy[k] != 0){
            node[k] += lazy[k];
            if(r - l >1){
                lazy[2*k+1] += lazy[k]/2;
                lazy[2*k+2] += lazy[k]/2;
            }
            lazy[k] = 0;
        }
    }
    void add(int a, int b, int x, int k=0, int l=0, int r=-1) {
        
        if(r < 0) r = n;
        eval(k, l, r);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] += (r - l) * x;
            eval(k, l, r);
        }
        else {
            add(a, b, x, 2*k+1, l, (l+r)/2);
            add(a, b, x, 2*k+2, (l+r)/2, r);
            node[k] = node[2*k+1] + node[2*k+2];
        }
    }
    int getsum(int a, int b, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        if(b <= l || r <= a) return 0;
        eval(k, l, r);
        if(a <= l && r <= b) return node[k];
        int vl = getsum(a, b, 2*k+1, l, (l+r)/2);
        int vr = getsum(a, b, 2*k+2, (l+r)/2, r);
        return vl + vr;
    }
};
//http://tsutaj.hatenablog.com/entry/2017/03/30/224339
signed main(void){
    int n, q; cin>>n>>q;
    vector <int> a(n);
    LazySegTree Lseg(a);
    rep(i,q){
        
        int c; cin>>c;
        if(c){
            int s,t; cin>>s>>t;
            s--; t--;
            cout<<Lseg.getsum(s, t+1)<<endl;
            
        }else{
           int s,t,c; cin>>s>>t>>c;
           s--; t--;
           Lseg.add(s,t+1,c);
        }
    }
}



Measured memory_bytes: 8428
ss = input()

ans = ''
b = 'P'
for i in range(len(ss)):
  c = ss[len(ss)-1-i]
  if c == '?':
    if b == 'D':
      if len(ss)-1-i != 0:
        if ss[len(ss)-2-i] == 'P':
          ans = 'D' + ans
          b = 'D'
        else:
          ans = 'P' + ans
          b = 'P'
      else:
        ans = 'P' + ans
        b = 'P'
    else:
      ans = 'D' + ans
      b = 'D'
  else:
    ans = c + ans
    b = c

print(ans)

Measured memory_bytes: 9708
#include <stdio.h>
#define N_NAME_MAX 11
 
int main(void)
{
  unsigned long num;
  int i = 1, place_num;
  char n[N_NAME_MAX] = {0};
  scanf("%lu", &num);
  while(num > 0) {
    num--;
    place_num = num % 26;
    n[N_NAME_MAX-i] = 'a' + place_num;
    i++;
    num /= 26;
  }
  printf("%s", &n[N_NAME_MAX - i + 1]);
}

Measured memory_bytes: 1728
#include <iostream>
using namespace std;
int main(){
  int n;cin >> n; string s,t ; cin >>s>>t; long long p[26], m=1e9+7;
  for(int i=0; i<26;i++) p[i]=0;
  p[s[0]-'a']=1;
  for(int i=1; i<n-1;i++) p[s[i]-'a'] = (p[t[i]-'a'] + p[s[i]-'a'])%m;
  
  cout <<p[t[n-1]-'a']<<endl;
}



Measured memory_bytes: 3308
#include<stdio.h>
#include<stdlib.h>
int main(){
    int x,h,m,s;
    scanf("%d",&x);
    s=x%60;
    x=x/60;
    m=x%60;
    h=x/60;
    printf("%d:%d:%d\n",h,m,s);
    return 0;
} 



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

using namespace std;

struct Complex {
	double a,b;
	Complex(){
		a = b = 0;
	}
	Complex(double a,double b):a(a),b(b) {}
	Complex operator +(Complex r) {
		return Complex(a+r.a,b+r.b);
	}
	Complex operator -(Complex r) {
		return Complex(a-r.a,b-r.b);
	}
	Complex operator *(Complex r) {
		return Complex(a*r.a-b*r.b,a*r.b+b*r.a);
	}
	Complex operator /(double r) {
		return Complex(a/r,b/r);
	}
	Complex conj() {
		return Complex(a,-b);
	}
}a[804040],b[804040],w1[804040],w2[804040];
int nn = 1,rev[804040],n,m;
const int mod = 200003;
const double pi = acos(-1);
inline void FFT(Complex *x,Complex *w) {
	register int i,j,k;
	for (i = 1;i < nn; i++)
		if (rev[i] > i)
			swap(x[rev[i]],x[i]);
	Complex t0,t1;
	for (i = 1;i < nn; i <<= 1)
		for (j = 0;j < nn;j += (i<<1))
			for (k = 0;k < i; k++) {
				t0 = x[j|k],t1 = x[i|j|k]*w[i|k];
				x[j|k] = t0+t1,x[i|j|k] = t0-t1;
			}
}
int rg[202020],rgcnt = 0;

inline int quick_pow(int x,int p,int mul=1) {
	for (;p;p>>=1,x=1LL*x*x%mod) if (p&1) mul=1LL*mul*x%mod; return mul;
}
inline int getRoot() {
	for (int i = 2;i < mod-1; i++)
		if ((mod-1)%i == 0)
			rg[++rgcnt] = i;
	for (int i = 2;i < mod; i++) {
		int j;
		for (j = 1;j <= rgcnt; j++)
			if (quick_pow(i,rg[j]) == 1)
				break;
	//	if (j > rgcnt)
	//		cout << i << endl;
	}
	return 0;
}
int pows[202020] = {0},t[202020];
	int aa[202020];
int main() {
	int rt = getRoot();
	rt = 5;
	pows[0] = 1;
	t[1] = 0;
	for (int i = 1;i <= mod-1; i++) {
		pows[i] = pows[i-1]*rt%mod;
		t[pows[i]] = i;
	}
	scanf("%d",&n);
	for (int i = 1;i <= n; i++) {
		scanf("%d",&aa[i]);
		if (aa[i])
		a[t[aa[i]]].a++;
	}
	int N = n;
	n = m = mod-1;
	while (nn <= n+m)
		nn <<= 1;
	int half = nn/2;
	for (int i = 1;i < nn; i++)
		rev[i] = ((rev[i>>1]>>1)|((i&1)?half:0));
	for (int i = 0;i < half; i++)
		w1[i|half] = Complex(cos(pi*i/half),sin(pi*i/half));
	for (int i = half-1;i; i--)
		w1[i] = w1[i<<1];
	for (int i = 0;i < nn; i++)
		w2[i] = w1[i].conj();
	FFT(a,w1);
	for (int i = 0;i < nn; i++)
		a[i] = a[i]*a[i];
	FFT(a,w2);
	long long ans = 0,now = 1;
	for (int i = 0;i <= n+m; i++) {
		ans += now*(long long)(a[i].a/nn+.5);
		now *= rt;
		now %= mod;
	}
	for (int i = 1;i <= n; i++)
		ans -= (long long)aa[i]*aa[i]%mod;
	ans /= 2;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 58708
package main

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

func main() {
	N := nextInt()
	M := nextInt()
	A := make([]int, M)
	B := make([]int, M)
	for i := 0; i < M; i++ {
		A[i] = nextInt() - 1
		B[i] = nextInt() - 1
	}

	ans := make([]int, M)
	ans[M-1] = N * (N - 1) / 2

	uf := newUnionFind(N)

	for i := M - 1; i >= 1; i-- {
		ans[i-1] = ans[i]
		if uf.root(A[i]) != uf.root(B[i]) {
			ans[i-1] -= uf.size(A[i]) * uf.size(B[i])
			uf.connect(A[i], B[i])
		}
	}

	for i := 0; i < M; i++ {
		fmt.Println(ans[i])
	}
}

type unionFind struct {
	parent []int
}

func newUnionFind(N int) *unionFind {
	parent := make([]int, N)
	for i := 0; i < N; i++ {
		parent[i] = -1
	}

	return &unionFind{parent: parent}
}

func (uf *unionFind) root(A int) int {
	if uf.parent[A] < 0 {
		return A
	}

	uf.parent[A] = uf.root(uf.parent[A])
	return uf.parent[A]
}

func (uf *unionFind) size(A int) int {
	return -uf.parent[uf.root(A)]
}

func (uf *unionFind) connect(A, B int) bool {
	A = uf.root(A)
	B = uf.root(B)
	if A == B {
		return false
	}

	if uf.size(A) < uf.size(B) {
		A, B = B, A
	}

	uf.parent[A] += uf.parent[B]
	uf.parent[B] = A

	return true
}

// Input. ----------

var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Buffer([]byte{}, math.MaxInt64)
	sc.Split(bufio.ScanWords)
}

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

	return i
}

func nextFloat() float64 {
	sc.Scan()
	f64, err := strconv.ParseFloat(sc.Text(), 64)
	if err != nil {
		panic(err)
	}

	return f64
}

func nextString() string {
	sc.Scan()
	if err := sc.Err(); err != nil {
		panic(err)
	}

	return sc.Text()
}

// ---------- Input.

// Util. ----------

func abs(x int) int {
	return int(math.Abs(float64(x)))
}

func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}

func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}

// ---------- Util.


Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
struct Fast {
    Fast() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} fast;
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
long long mod = 1000000007;
#define REP(i, n) for (long long i = 0; i < (n); i++)
#define rep(i, a, n) for (long long i = a; i < (n); i++)
long long modpow(long long m, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2);
        return (t * t) % mod;
    } else {
        return (modpow(m, n - 1) * m) % mod;
    }
}

template <typename A, size_t N, typename T> void Fill(A (&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
// long long mod = 998244353;
long long power(long long m, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2);
        return t * t;
    } else {
        return modpow(m, n - 1) * m;
    }
}

long long moddiv(long long a, long long b) { return (a * modpow(b, mod - 2)) % mod; }

const ll INF = 1LL << 60;

void print_binary(long long a) {
    for (int i = 31; i >= 0; i--) {
        cout << (a >> i & 1);
    }
    cout << endl;
}

ll nCkmod(ll n, ll k) {
    ll denomi = 1;
    for (int i = n; i > n - k; i--) {
        denomi *= i;
        denomi %= mod;
    }
    ll numera = 1;
    REP(i, k) {
        numera *= (i + 1);
        numera %= mod;
    }
    return moddiv(denomi, numera);
}
map<ll, ll> cnt;
void primeFactors(long long n) {
    while (n % 2 == 0) {
        cnt[2]++;
        n = n / 2;
    }
    for (int i = 3; i <= sqrt(n); i = i + 2) {
        while (n % i == 0) {
            cnt[i]++;
            n = n / i;
        }
    }
    if (n > 2) {
        cnt[n]++;
    }
}
map<ll, ll> cnt2;
void primeFactors2(long long n) {
    while (n % 2 == 0) {
        cnt2[2]++;
        n = n / 2;
    }
    for (int i = 3; i <= sqrt(n); i = i + 2) {
        while (n % i == 0) {
            cnt2[i]++;
            n = n / i;
        }
    }
    if (n > 2) {
        cnt2[n]++;
    }
}
int main() {
    ll a, b;
    cin >> a >> b;
    primeFactors(a);
    primeFactors2(b);
    ll ans = 0;
    for (auto x : cnt) {
        if (x.second > 0 && cnt2[x.first] > 0) {
            ans++;
        }
    }
    cout << ans + 1 << endl;
}

Measured memory_bytes: 3684
# coding:utf-8

S = input()

# "<" then flag=0
# ">" then flag=1

if(S[0] == "<"):
    flag=0
else:
    flag=1

sum_count = 0
count=1
tmp_count = 1
for i in range(1, len(S)):
    if(S[i-1] == "<" and S[i] == "<"):
        count+=1
        tmp_count += 1
        
    elif(S[i-1] == "<" and S[i] == ">"):
        sum_count += int(((count-1)*count)/2)
        #reset
        count=1
        
    elif(S[i-1] == ">" and S[i] == "<"):
        if(tmp_count > count):
            sum_count += int(((count+1)*count)/2 + (tmp_count - count))
        else:
            sum_count += int(((count+1)*count)/2)
        #reset
        count=1
        tmp_count = 1
        
    elif(S[i-1] == ">" and S[i] == ">"):
        count+=1

if(S[-1] == ">"):
    if(tmp_count > count):
        sum_count += int(((count+1)*count)/2 + (tmp_count - count))
    else:
        sum_count += int(((count+1)*count)/2)
else:
    sum_count += int(((count+1)*count)/2)
  
  
print(sum_count)

Measured memory_bytes: 4236
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int A = in.nextInt();
            int B = in.nextInt();

            if ((B - A) % 2 == 1) {
                out.println("Borys");
            } else {
                out.println("Alice");
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 21460
S = input()
count = 0
S = [c for c in S]

for i, c in enumerate(S):
    if i != 0:
        if S[i-1] == c:
            if S[i-1] == '0':
                S[i] = '1'
            else :
                S[i] = '0'
            count += 1
print(count)
            

        



Measured memory_bytes: 3956
#include"bits/stdc++.h"

using namespace std;

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

	int R, G, B, N;
	cin >> R >> G >> B >> N;

	int cnt = 0;
	for (int i = 0; i <= N; i++) {
		for (int j = 0; j <= N; j++){
			int sum = R*i + G*j;
			if (sum <=N && (N-sum)%B == 0) {
				cnt++;
			}
		}
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
//wherever you are,whatever you do, be in love

#include<bits/stdc++.h>
using namespace std;
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
 
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

ll a[2*100002],s[2*100002];
ll hell=1e9+7;
int main(){
	ll n,ans=0;
	cin>>n;
	forn(i,n) {
		cin>>a[i];
		if(i==0) s[i]=a[i];
		else s[i]=s[i-1]+a[i];
		s[i]=s[i]%hell;
		ans=(ans+(s[i]*a[i])%hell)%hell;
	}
	ans=((s[n-1]*s[n-1])%hell-ans+hell)%hell;
	cout<<ans;
}

Measured memory_bytes: 6752
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m;
    while(1){
        cin>>n>>m;
        if(n==0) break;
        int P[m][n];
        for(int i=0;i<m;i++){
            for(int j=0;j<n;j++){
                cin>>P[i][j];
            }
        }
        int sum[n];
        for(int j=0;j<n;j++){
            sum[j]=0;
            for(int i=0;i<m;i++){
                sum[j]+=P[i][j];
            }
        }
        int max=0;
        for(int j=0;j<n;j++){
            if(max<sum[j]) max=sum[j];
        }
        cout<<max<<endl;
    }
}


Measured memory_bytes: 3212
#include<iostream>
using namespace std;
#include<stdlib.h>

void to_post(int* A, int* B, int* C, int h)
{
    int x = A[0];
    C[h - 1] = x;
    if(h < 2) return;
    int m = 0;
    while(B[m] != x) m++; 
    if(m > 0) to_post(A + 1, B, C, m);
    if(h - m - 1 > 0) to_post(A + m + 1, B + m + 1, C + m, h - m - 1);
}

int main()
{
    int *A, *B, *C;
    int i, n; cin >> n;

    A = new int [n]; B = new int [n]; C = new int [n];
    if(A == NULL || B == NULL || C == NULL) exit(EXIT_FAILURE);

    for(i = 0; i < n; i++){ cin >> A[i]; C[i] = 0; }
    for(i = 0; i < n; i++){ cin >> B[i]; }

    to_post(A, B, C, n);

    cout << C[0]; for(i = 1; i < n; i++){ cout << " " << C[i]; } cout << endl;

    return 0;
}

Measured memory_bytes: 1192
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;cin>>N;
  map<int, int> table;
  for (int i=0;i<N;++i){
    int a;cin>>a;table[a]++;
  } 
  if(table.size()>2) {cout << "No" << endl;return 0;}
  
  vector<pair<int, int>> v;
  for (auto p:table){
    int k=p.first;int l=p.second;
    pair<int, int> q=make_pair(k,l);
    v.push_back(q);
  }
 
  if(table.size()==1){
    if(v[0].first==N-1||2*v[0].first<=N){cout << "Yes" << endl;return 0;}
    cout << "No" << endl; return 0;
  }
 
  sort(v.begin(), v.end());

  if(table.size()==2){
    if(v[1].first-v[0].first>1){cout << "No" << endl;return 0;}
    int k=v[1].first, j=v[0].second;
    if((2*(k-j)<=N-j)&&j<k){cout << "Yes" << endl;return 0;}
    cout << "No" << endl;return 0;
  }
}


Measured memory_bytes: 4992
// B.

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

typedef long long LL;

int main(int argc, char *argv[]) {
	int n, k;
	cin >> n >> k;
	int sz = (n * (n + 1)) / 2;
	vector<LL> a(n), v(sz);
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	int si = 0;
	for (int i = 0; i < n; ++i) {
		LL c = 0;
		for (int j = i; j < n; ++j) {
			c += a[j];
			v[si++] = c;
		}
	}
	LL ans = 0;
	for (int b = 40; b >= 0; --b) {
		LL x = 1LL << b;
		sort(v.rbegin(), v.rend());
		LL c = 0;
		for (int i = 0; i < sz; ++i) {
			if (!(v[i] & x)) {
				break;
			}
			++c;
			v[i] &= ~x;
		}
		if (c >= k) {
			ans |= x;
			v.resize(c);
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4224
import java.util.Arrays;
import java.util.Scanner;

public class Main {
  Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {
    new Main().run();
  }

  long f(long b, long n) {
    if (n < b) {
      return n;
    } else {
      return f(b, n / b) + n % b;
    }
  }

  void run() {
    long n = sc.nextLong();
    long s = sc.nextLong();
    if (n == s) {
      System.out.println(n + 1);
      return;
    }
    long ans = Long.MAX_VALUE;
    for (long b = 2; b * b <= n; ++b) {
      if (f(b, n) == s) {
        ans = Math.min(ans, b);
      }
    }
    for (long p = 1; p * p < n; ++p) {
      long b = (n - s) / p + 1;
      if (b < 2) {
        continue;
      }
      if (f(b, n) == s) {
        ans = Math.min(ans, b);
      }
    }
    if (ans != Long.MAX_VALUE) {
      System.out.println(ans);
    } else {
      System.out.println(-1);
    }
  }

  int ni() {
    return Integer.parseInt(sc.next());
  }

  void debug(Object... os) {
    System.err.println(Arrays.deepToString(os));
  }
}

Measured memory_bytes: 10320
n,k = map(int, input().split())

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
s = Base_10_to_n(n, k)
print(len(s))

Measured memory_bytes: 9060
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<stack>
using namespace std;
typedef long long ll;
int main(){
	ll a,k;
	stack<char>p;
	cin>>a;
	while(a){
		k=a%26;
		if(k==0) k=26;
		k--;
		p.push('a'+k);
		a=a/26;
		if(k==25)
		a--;
	}
	while(!p.empty()){
		cout<<p.top();
		p.pop();
	}
}

Measured memory_bytes: 3076
#include<iostream>
using namespace std;
int main(){
	int n;
	cin >> n;
	int a[n];
	for(int i=0;i<n;i++)
		cin >> a[i];
	for(int i=0;i<n;i++){
		cout<< a[n-i-1];
		if(i==n-1)break;
		cout<< " ";
	}
	cout<< endl;
	return 0;
}

Measured memory_bytes: 1160
// include headers{{{
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
/*}}}*/
# define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

template<typename integer>
integer __lcm(integer a, integer b) {
    return (a * b) / __gcd(a, b);
}

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

    int base = pow(100, d);
    int ans = base * n;

    if ((ans / (int)pow(100, d)) % 100 == 0) {
        ans = base * (n+1);
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		boolean isPoss = false;
		int number = input.nextInt();
		for (int i=1;i<10;i++) {
			for (int j=1;j<10;j++) {
				if (i*j == number) {
					isPoss = true;
				}
			}
		}
		if (isPoss) {
			System.out.println("Yes");
		}else {
			System.out.print("No");
		}
    }
}


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

int main(){
  int M, D;
  cin >> M >> D;
  int ans=0;
  for(int i=1; i<=D; i++){
    for(int j=1; j<=M; j++){
      int done=i%10;
      int dten=i/10;
      if(done>=2 && dten>=2 && done*dten==j) ans++; 
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
// 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>

const int INF = 1e9;

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

  string n;
  cin >> n;

  if(n[0] == '9' || n[1] == '9')cout << "Yes";
  else cout << "No";

  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
//“Make it work, make it right, make it fast.” – Kent Beck
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double dd;
const ll INF = 1e18L + 5;
const ll siz = 1e6 + 5;
#define deb(x) cout << #x << " = " << x << endl;

void solve()
{
	int n;
	cin >> n;
	int a[n];
	for(int i = 0; i < n; ++i){
		cin >> a[i];
	}
	sort(a, a+n);
	long long count= 0;
	for(int i = 0; i < n - 2; ++i){
		for(int j = i + 1; j < n - 1; ++j){
			for(int k = j + 1; k < n; ++k){
				if(a[i] + a[j] > a[k]) count++;
			}
		}
	}
	cout << count;
}

int main()
{
		ios::sync_with_stdio(false);
		cin.tie(nullptr);
		ll t = 1;
		//cin >> t;
		while(t--)
		{
			solve();
		}
	return 0;
}
	


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
  int n,x;
  int i,j,k;
  int sum;
  int cnt=0;

  while(true){
    cnt=0;
    cin >> n >> x;
    
    if(n==0 && x==0)
      break;

    for(i=1;i<=n;i++){
      for(j=i+1;j<=n;j++){
	for(k=j+1;k<=n;k++){
	  sum = i+j+k;
	  if(sum==x)
	    cnt+=1;
	}
      }
    }

    cout << cnt << endl;
  }
}

Measured memory_bytes: 3068
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<pair<ll, ll>>> vvpll;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    ll n;
    string s;
    cin >> n >> s;

    ll cnt1 = 0, cnt2 = 0;
    rep(i, n) {
        if(s[i] == 'R') {
            cnt1++;
        }
        else {
            cnt2++;
        }
    }

    if(cnt1 > cnt2) {
        out("Yes");
    }
    else {
        out("No");
    }

    re0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stdio.h>
#include <cmath>
#include <cctype>
#include <map>
#include <set>

const int INT_INF = 1e9;
const long long LONG_INF = 1e18;
const long long MOD = 1e9 + 7;

using namespace std;

int main()
{
    long long int x;
    cin >> x;
    long long int a = 100;
    int count = 0;
    while (a < x)
    {
        a = floor(a * 1.01);
        count++;
    }
    cout << count << endl;
    return 0;
}

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

int main()
{
	int k, x;
  cin >> k >> x;
  int start = max(-1000000, x - k + 1);
  int end = min(1000000, x + k - 1);
  for (int i = start; i <= end; i++)
  {
	cout << i << " ";
  }
  cout << "\n";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, a, b) for(int i = a, i##_len = (b); i < i##_len; ++i)

int H, N, sm;

int main()
{
    scanf("%d %d", &H, &N);
    for(int i = 0; i < N; ++i) {
        int a;
        scanf("%d", &a);
        sm += a;
    }
    if(sm < H) printf("No\n");
    else printf("Yes\n");
    return 0;
}

Measured memory_bytes: 256
/*
	Problem A: ICPC 得点集計ソフトウェア
	http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1147&lang=jp
*/

package main

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

// 標準入力を取得するScannerのインスタンスを作成
var sc = bufio.NewScanner(os.Stdin)

// 標準入力で各行を読み込み文字列として返す
func readLine() string {
	if sc.Scan() {
		return sc.Text()
	}
	return ""
}

func average() (avg int) {
	// 審判の人数を取得する
	n, _ := strconv.Atoi(readLine())

	// 得点
	score := make([]int, 0, n)

	// 得点を読み込む
	for n > 0 {
		line, _ := strconv.Atoi(readLine())
		score = append(score, line)
		n--
	}

	if len(score) == 0 {
		return 0
	}

	// ソート
	sort.Ints(score)
	// 先頭を削除
	score = append(score[:0], score[1:]...)
	// 末尾を削除
	score = score[:len(score)-1]

	// 合計
	for i := 0; i < len(score); i++ {
		avg += score[i]
	}

	// 平均
	avg = avg / len(score)
	return avg
}

func main() {
	// 改行区切りから単語(スペース)区切りで読み込むように変更する
	sc.Split(bufio.ScanWords)
	for {
		avg := average()
		if avg != 0 {
			fmt.Println(avg)
		} else {
			break
		}
	}
}



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

int main() {
  int K;
  cin >> K;
  int A, B;
  cin >> A >> B;
  
  string ans = "NG"; 
  for (int i = A; i <= B; i++) {
    if (i % K == 0) {
      ans = "OK";
    }
  }
  
  cout << ans << endl;
  
}

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

#define rep(i, n) for(int i = 0; i < n; i++)

typedef long long ll;
using namespace std;
int mod = 1000000007;

int solve(int num, int A, int B){
    int ret = num;
    int acc = 0;
    while(num > 0){
        acc += num % 10;
        num /= 10;
    }
    //cout << ret << ": " << acc << endl;
    if(A <= acc && acc <= B) return ret;
    else return 0;
}

int main(void){
    int N, A, B;
    int ans = 0;
    cin >> N >> A >> B;
    for(int i = 1; i <= N; i++){
        ans += solve(i, A, B);
        //cout << ans << endl;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define range(i, l, r) for(int (i) = (l); (i) < (r); (i)++)
#define reversed_range(i, l, r) for (int (i) = (r) - 1; (i) >= l; (i)--)
using namespace std;
template <typename T>
using vec = vector<T>;
using lint = long long;
using ulint = unsigned long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;

template <typename S, typename T>
ostream& operator <<(ostream& os, pair<S, T> p) {
    os << "(";
    os << p.first << ", " << p.second;
    return os << ")";
}

template <typename T>
ostream& operator <<(ostream& os, vec<T> v) {
    os << "[";
    for (int i = 0; i < v.size() - 1; i++) {
        os << v.at(i) << ", ";
    }
    return os << v.at(v.size() - 1) << "]";
}

template <typename T>
ostream& operator <<(ostream& os, set<T>& s) {
    os << "{";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename T>
ostream& operator <<(ostream& os, unordered_set<T>& s) {
    os << "{";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, map<K, V> m) {
    os << "{";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, unordered_map<K, V> m) {
    os << "{";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

int main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    string s_num;
    range(i, 0, 3) {
        char tmp;
        cin >> tmp;
        s_num.push_back(tmp);
    }
    lint num = stoll(s_num);
    cout << (num % 4 == 0 ? "YES" : "NO") << "\n";
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        if (a + b == 3) {
            System.out.println(3);
        }
        else if (a + b == 4) {
            System.out.println(2);
        }
        else {
            System.out.println(1);
        }
    }
}


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

int main()
{
  int64_t N, K, ans = (1LL << 62);
  cin >> N >> K;
  vector<int64_t> X(N), Y(N);
  for (int i = 0; i < N; i++)
  {
    cin >> X[i] >> Y[i];
  }
  for (int i = 0; i < N; i++) // left
  {
    for (int j = 0; j < N; j++) // right
    {
      if (X[i] >= X[j])
        continue;
      for (int k = 0; k < N; k++) // top
      {
        for (int l = 0; l < N; l++) // bottom
        {
          if (Y[k] <= Y[l])
            continue;
          int64_t cnt = 0;
          for (int m = 0; m < N; m++)
          {
            if (X[i] <= X[m] && X[m] <= X[j] && Y[l] <= Y[m] && Y[m] <= Y[k])
              cnt++;
          }
          if (cnt >= K)
            ans = min(ans, (X[j] - X[i]) * (Y[k] - Y[l]));
        }
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3620
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdint.h>
#include <queue>
#include <bitset>
#include <iomanip>

using namespace std;

#define PI 3.14159265358979323846
#define INF 1e+9
#define DIV_NUM (1000000007)



int main() {

	string S, T;
	cin >> S >> T;
	int A, B;
	cin >> A >> B;
	string U;
	cin >> U;
	if (U == S) A--;
	if (U == T) B--;


	long long int N = 1000* 1000 * 1000;
	long long ans = 0;
	for (long long i = 0; i < N; i++) {
		ans += 1;
	}

	ans *= 0;

	A = A - ans;

	cout << A << " " << B << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef unsigned long long ll;
ll mod=1e9+7;
using namespace std;
ll boom[100];
ll boom1[100];

ll ksm(ll a,ll b)
{
    ll ans=1;
    for(;b;b>>=1,a=a*a%mod) if(b&1) ans=ans*a%mod;
    return ans%mod;
}
int main()
{
    //freopen("in.txt","r",stdin);
    ll n;cin>>n;
    ll t;
    for(int i=0;i<n;i++)
    {
        cin>>t;
        ll temp=0;
        for(;t;t>>=1)
        {
            if(t&1) boom[temp]++;
            temp++;
        }
    }
    ll ans=0;
    for(int i=0;i<=64;i++)
    {
        if(boom[i]!=0)
            boom1[i]=n-boom[i];
    }
    for(int i=0;i<=64;i++)
    {
        ans=(ans+(ksm(2,i)*((boom[i]*boom1[i])%mod)%mod)%mod)%mod;
    }

    cout<<ans<<endl;
}


Measured memory_bytes: 3640