akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
int a, b, x, y;

int main() {
	scanf("%d%d", &a, &b);
	if((max(a, b) > 0) && (min(a, b) < 0)) {
		printf("Zero\n");
		return 0;
	}
	else if((a > 0) && (b > 0)) {
		printf("Positive\n");
		return 0;
	}
	else if(a == b) {
		if(a > 0) {
			printf("Positive\n");
			return 0;
		}
		else if(a < 0) {
			printf("Negative\n");
			return 0;
		}
		else {
			printf("Zero\n");
			return 0;
		}
	}
	else {
		if((max(a, b) - min(a, b)) % 2 == 0) {
			printf("Negative\n");
			return 0;
		}
		else {
			printf("Positive\n");
			return 0;
		}
	}
}
//ciyang原创

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<bitset>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef long long int ll;
#define int long long
typedef pair<int,int> P;
struct edge{int to,cost;};
#define REP(i,n) for(int i=0;i<(n);i++)
const int INF=100000000000000000;

signed main(){
	int A[5];
	REP(i,4){
		cin>>A[i];
	}
	string S;
	REP(i,4){
		S+=char(A[i]+'0');
	}
	DEB(S)END
	sort(S.begin(),S.end());
	if(S=="1479"){
		cout<<"YES"<<endl;
	}
	else{
		cout<<"NO"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
int n,i,j;
  cin >> n;
  for(i=1;i<=9;i++){
    for(j=1;j<=9;j++){
      if(i*j==n){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
} 

Measured memory_bytes: 3584
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i, n) for (int i=0; i<n; ++i)
#define all(obj) (obj).begin(),(obj).end()
using namespace std;
typedef long long ll;

int main(){
    int N;
    cin >> N;
    vector<pair<int, int>>A(N);
    rep(i, N){
        int a;
        cin >> a;
        A[i] = {a, i+1};
    }
    sort(A.begin(), A.end());
    for(auto aaa: A){
        cout << aaa.second << " ";
    }
    cout << endl;
}


Measured memory_bytes: 1664
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]

def knapzap(N, A, B) :
    dp = [0] * (N + 1)

    for n in range(1, N + 1) :
        dp[n] = max(
            dp[n-1] + 1,
            dp[n-A[0]] + B[0] if n - A[0] >= 0 else 0,
            dp[n-A[1]] + B[1] if n - A[1] >= 0 else 0,
            dp[n-A[2]] + B[2] if n - A[2] >= 0 else 0
        )

    return dp[N]

M = knapzap(N, A, B)
ret = knapzap(M, B, A)
print(ret)

Measured memory_bytes: 228636
#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()
{
    int n, k;
    cin >> n >> k;
    int ans = 1;
    while (n > pow(k, ans) -1 ) {
        ans++;
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 4060
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
typedef long long LL;

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
	int n;
	scanf("%d",&n);
	printf("ABC");
	printf("%d\n",n);
    return 0;
}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

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

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

int main()
{
    int n;
    cin >> n;
    ll ans = 1;
    rep(i, n)
    {
        ll a;
        cin >> a;
        ans = lcm(ans, a);
    }

    OP(ans);
    return 0;
}

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

constexpr int mod = 1e9 + 7;

int main()
{
    int n;
    while(cin>>n,n){
        int w,h;
        cin>>w>>h;
        vector<vector<int>>mp(2*w,vector<int>(2*h,0));
        vector<pair<int,int>>v;
        for(int i=0;i<n;++i){
            int x,y;
            cin>>x>>y;
            v.push_back({x-1,y-1});
        }
        int s,t;
        cin>>s>>t;
        for(int i=0;i<n;++i){
            int x=v[i].first,y=v[i].second;
            mp[x][y]++;
            mp[x+s][y]--;
            mp[x][y+t]--;
            mp[x+s][y+t]++;
        }
        for(int i=0;i<2*w;++i){
            for(int j=1;j<2*h;++j){
                mp[i][j]+=mp[i][j-1];
            }
        }
        int ans=0;
        for(int i=1;i<2*w;++i){
            for(int j=0;j<2*h;++j){
                mp[i][j]+=mp[i-1][j];
            }
        }
        for(int i=0;i<w;++i){
            for(int j=0;j<h;++j){
                ans=max(ans,mp[i][j]);
            }
        }
        cout<<ans<<endl;
    }
}


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

int main() {
  int64_t a,b,c,k;
  int64_t sum=0;
  cin >> a >> b>> c>> k;
  if(a>=k){
    sum=k;
  }
  if(a<k){
    sum+=a;
    if(b<k-a){
      sum-=(k-a-b);
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
#define pii pair<int,int> 
#define mp make_pair
using namespace std;
const int mxn=2e4+4;
int A[mxn],B[mxn],X[mxn],n,cnt;
int ord[mxn],scc[mxn],mid;
set<pii>s;
bool used[mxn];
inline void dfs(int a,int x){
	int tx,po;
	if(a<=n)tx=X[a+n],po=a+n;
	else tx=X[a-n],po=a-n;
	used[a]=1;
	s.erase(mp(tx,po));
	for(;s.size();){
		set<pii>::iterator it=s.lower_bound(mp(x-mid+1,-1));
		if(it==s.end() or it->first>x+mid-1)break;
		int y=it->second;
		if(y==a){
			it++;
			if(it==s.end() or it->first>x+mid-1)break;
			y=it->second;
		}
		if(y>n)dfs(y-n,X[y-n]);
		else dfs(y+n,X[y+n]);
	}
	ord[++cnt]=a;
}
inline void dfs2(int a,int x){
	scc[a]=cnt;
	s.erase(mp(x,a));
	int tx;
	if(a<=n)tx=X[a+n];
	else tx=X[a-n];
	for(;s.size();){
		set<pii>::iterator it2=s.lower_bound(mp(tx-mid+1,-1));
		if(it2==s.end() or it2->first>tx+mid-1)break;
		int y=it2->second;
		if(y==a-n or y==a+n){
			it2++;
			if(it2==s.end() or it2->first>tx+mid-1)break;
			y=it2->second;
		}
		dfs2(y,X[y]);
	}
}
inline bool check(int md){
	mid=md,s.clear();
	memset(used,0,sizeof(used));
	memset(scc,0,sizeof(scc));
	for(int i=1;i<=n*2;++i)s.insert(mp(X[i],i));
	cnt=0;
	for(int i=1;i<=n*2;++i)if(!used[i])dfs(i,X[i]);
	cnt=0;
	for(int i=1;i<=n*2;++i)s.insert(mp(X[i],i));
	for(int i=n*2;i;--i){
		if(!scc[ord[i]]){
			++cnt;
			dfs2(ord[i],X[ord[i]]);
		}
	}
	for(int i=1;i<=n;++i)if(scc[i]==scc[i+n])return 0;
	return 1;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;++i){
		cin>>A[i]>>B[i];
		X[i]=A[i],X[i+n]=B[i];
	}
	int lo=0,hi=1000000009,md;
	for(;lo<hi-1;){
		int md=lo+hi>>1;
		if(check(md))lo=md;
		else hi=md; 
	}
	cout<<lo<<endl;
	return 0;
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int A[200005],B[200005];
struct node
{
	int r,v;
	node(int r,int v):r(r),v(v){}
	bool operator < (const node& rhs) const
	{
		return v < rhs.v;
	}
};
priority_queue<node> q;
int main()
{
	int N;
	scanf("%d",&N);
	ll cnt = 0;int cnt2 = 0;
	for(int i = 1;i <= N;i ++)
		scanf("%d",&A[i]);
	for(int i = 1;i <= N;i ++)
	{
		scanf("%d",&B[i]);
		if(A[i] == B[i])
			cnt2 ++;
		else
			q.push(node(i,B[i]));
	}
	while(true)
	{
		if(cnt2 == N)
		{
			printf("%lld\n",cnt);
			return 0;
		}
		if(q.empty())
		{
			printf("-1\n");
			return 0;
		}
		node t = q.top();q.pop();
		int i0 = t.r == 1?N:t.r-1;
		int i1 = t.r;
		int i2 = t.r == N?1:t.r+1;
		if(B[i1] < A[i1])
		{
			printf("-1\n");
			return 0;
		}
		if(B[i1] == A[i1])
		{
			cnt2 ++;
			continue;
		}
		if(B[i1]-A[i1] < B[i0]+B[i2])
		{
			printf("-1\n");
			return 0;
		}
		int rm = (B[i1]-A[i1])/(B[i0]+B[i2]);
		cnt += rm;B[i1] -= rm*(B[i0]+B[i2]);
		q.push(node(i1,B[i1]));
	}
	return 0;
}

Measured memory_bytes: 3700
#include<stdio.h>

int main()
{
     long long int a,b,t,x,y,gcd,lcm;
     while(scanf("%lld %lld",&a,&b)!=EOF)
     {
        x=a;
        y=b;
        if(a == 0) 
        {
            gcd = a;
        }
        else if(b == 0)
        {
            gcd = b;
        } 
        else
         {
        	 while(b != 0)
        	 {
              t = a%b;
              a = b;
              b = t;
           }
           gcd = a ;
           
       }
       
       lcm= (x*y) /gcd ;
       printf("%lld %lld\n",gcd,lcm);
    }
    
       return 0;
}
           


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

using namespace std;
 
 


//c++ templte for help............................................................................................................................................
typedef long long ll;

//template<typename... T>
//void print1(T... t){
	//((cout<<t<<" "),...);
//}

//template<typename... T>
//void print2(T... t){
		//vector<vector<ll>> ans={t...};
		//for(ll i=0;i<(ll)ans.size();i++){
			//if(i!=0) cout<<"\t\t";
			//else cout<<"\t";
			//for(ll j=0;j<(ll)ans[i].size();j++){
				//cout<<ans[i][j]<<" ";
			//}
			//if(i!=(ll)ans.size()-1)
			//cout<<endl;
		//}
//}	
//#define deb(...) cout<<" [ "#__VA_ARGS__<<" : "; print1(__VA_ARGS__); cout<<"]"<<endl; 
//#define vdeb(...) cout<<" [ "#__VA_ARGS__<<" : "; print2(__VA_ARGS__); cout<<"]"<<endl;





	
 
//for loop
//#define fo(i,n) for(int i=0;i<(ll)n;i++)
//#define Fo(i,k,n) for(int i=k;i<n;i++)
 
 
//to print vector element 
//template<typename T>
//void printV(T vec){
	//fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
	//cout<<endl;
	//}
	
 
//#define M int(1e9+7)
//const int INF=1e9+5;
 
//iterate map
//template<typename T>
//void itR(T map){
	 //for(auto itr=map.begin();itr!=map.end();itr++){
				//deb(itr->first,itr->second);
			//}
	//cout<<endl;
//}


 

 
//c++ template for help...........................................................................................................................................

ll solve(){
	int n;
	cin>>n;
	
	vector<int> vec(n+1);
	for(int i=1;i<=n;i++){
		cin>>vec[i];
	}
	
	int ans=0;
	for(int i=1;i<=n;i++){
		if(i%2!=0 and vec[i]%2!=0) ans++;
	}
	
	return ans;
	
}


int main() {
	//stringstream ss;
	//ss<<"akhil";
	//cout<<ss.str()<<endl;
	cout<<setprecision(10);
	ios::sync_with_stdio(0);
	cin.tie(0);
	

	//ll testCase;
	//cin>>testCase;
	//for(ll tt=0;tt<testCase;tt++){
		//solve();
		ll ans=solve();
		cout<<ans<<endl;
	//}
	return 0;
}


Measured memory_bytes: 3648
N, K = map(int, input().split())
a = []
b = []
hairetu = []
for i in range(N):
    A, B = map(int, input().split())
    hairetu.append([A, B])

hairetu.sort()
for i in range(N):
    K -= hairetu[i][1]
    if K <= 0:
        print(hairetu[i][0])
        break


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

int main() {
	long long int n;
	cin>>n;
	long long int x=n/500;
	long long int y=n%500;
	long long int h=0;
	h=x*1000;
	if(y)
	{
	    x=y/5;
	    h=h+x*5;
	}
	cout<<h;
	return 0;
}

Measured memory_bytes: 256
N, M, X, Y = map(int, input().split())
xls = list(map(int, input().split()))
yls = list(map(int, input().split()))
xls.sort(reverse=True)
yls.sort()
if xls[0] < yls[0] and X < yls[0] and xls[0] < Y:
    print('No War')
else:
    print('War')


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


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

    int n;
    cin >> n;
    vector<int> S(n);
    copy_n(istream_iterator<int>(cin), n, S.begin());

    vector<int> D;
    for (int i = 1; i * i <= n; i++){
        if (n % i != 0) continue;
        D.push_back(i);
        if (i * i != n) D.push_back(n / i);
    }

    auto check = [&](auto d){
        for (int i = 0; i < n - d; i++){
            if (S[i] != S[i + d])
                return false;
        }
        return true;
    };
    int ans = n;
    for (const auto &d: D){
        if (check(d))
            ans = min(ans, d);
    }
    
    cout << n / ans << endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ld long double
#define pll pair < long long , long long >
#define endl "\n"
using namespace std;

int main()
{
    ll h;
    cin >> h;
    ll i = 0;
    ll ch = 0;
    ll answ = h;
    ll tim = 1;
    while(h!=1)
    {
        if(h%2==1)
        {
            answ-=(tim);
        }
        answ+=tim;
        h/=2;
        tim*=2;
    }
    cout << answ;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <set>
#include <string>

using namespace std;

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

  size_t ans = 0;
  const set<char> set{'A', 'C', 'G', 'T'};
  for (int i = 0; i < s.size(); ++i) {
    for (int j = 1; j <= s.size() - i; ++j) {
      const auto sub = s.substr(i, j);
      cerr << "j = " << j << " sub = [" << sub << "]\n";
      bool valid = true;
      for (char c : sub) {
        if (set.find(c) == set.end()) {
          valid = false;
          break;
        }
      }
      if (valid) {
        ans = max(ans, sub.size());
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,j,n) for(int i=j;i<n;i++)
#define all(v) v.begin(),v.end()
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int>
#define MOD 1000000007
#define INF 10000000000000
#define m0(x) memset(x,0,sizeof(x))
typedef long long ll;
using namespace std;
using namespace std;

int main(){
  	ll n,m,l,a,b,c; cin >> n >> m >> l;
    vector<vector<ll>> d(n, vector<ll>(n,INF));
    rep(i,m){
      cin >> a >> b >> c;
      a--;b--;
      d[a][b] = c;
      d[b][a] = c;
    }
    //ワーシャルフロイド
	rep(i,n){      
  		rep(j,n){    
    		rep(k,n){ 
      			d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
    		}
  		}
	}
    vector<vector<ll>> d2(n, vector<ll>(n,INF));
    rep(i,n)rep(j,n) if(d[i][j] <= l) d2[i][j] = 1;
    rep(i,n){    
  		rep(j,n){ 
    		rep(k,n){
      			d2[j][k] = min(d2[j][k], d2[j][i] + d2[i][k]);
    		}
  		}
	}
    ll q; cin >> q;
    ll s,t;
    while(q--){
      cin >> s >> t;
      s--;t--;
      if(d2[s][t] ==INF) cout << "-1" << endl;
      else cout << d2[s][t] - 1 << endl;
    }

	return 0;
}


Measured memory_bytes: 1920
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <tuple>
#include <cassert>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define mp(a,b) make_pair((a), (b))
#define mt(a,b,c) make_tuple((a),(b),(c))

typedef long long ll;


struct UnionFind {
    vector<int> data;
    UnionFind(int size) : data(size, -1) { }
    bool unionSet(int x, int y) {
      x = root(x); y = root(y);
    if (x != y) {
        if (data[y] < data[x]) swap(x, y);
        data[x] += data[y]; data[y] = x;
    }
    return x != y;
    }
    bool findSet(int x, int y) {
    return root(x) == root(y);
    }
    int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
    }
    int size(int x) {
     return -data[root(x)];
    }
};

int main(){
    int n,m,k; cin >> n >> m >> k;
    vector<vector<int>> fre(n);
    vector<vector<int>> hat(n);

    UnionFind uf(n);

    rep(i,m){
        int a,b; cin >> a >> b;
        fre[a-1].push_back(b-1);
        fre[b-1].push_back(a-1);

        uf.unionSet(a-1,b-1);
    }

    rep(i,k){
        int a,b; cin >> a >> b;
        hat[a-1].push_back(b-1);
        hat[b-1].push_back(a-1);
    }

    vector<int> ans(n);
    rep(i,n){
        ans[i] = uf.size(i) - fre[i].size() - 1;
        for(auto x: hat[i]) if(uf.findSet(x,i)) ans[i]--;
    }
    for(auto x: ans) cout << x << " ";
    cout << endl;
    return 0; 
}

Measured memory_bytes: 12664
N,K = map(int,input().split())
l = []
mod = 998244353
for i in range(K):
    L,R = map(int,input().split())
    l.append([L,R])
l.sort()

a = [0 for i in range(N+1)]
a[1] = 1
b = [0 for i in range(N+1)]
b[1] = 1
for i in range(2,N+1):
    for j in range(K):
        if l[j][0] < i:
            a[i] += (b[i-l[j][0]]-b[max(0,i-l[j][1]-1)])%mod
        else:
            break
    b[i] = (b[i-1]+a[i])%mod
mod = 998244353
print(a[N]%mod)

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

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //

#define int                                       long long
#define lop(i,s,e)                                for(int i=s;i<(int)e;i++)
#define rlop(i,e,s)                               for(int i=e;i>=s;i--)
#define prvec(v)                                  lop(R15,0,v.size())cout << v[R15] <<" "; cout << endl;
#define prarr(arr,s1,e1)                          lop(R15,s1,e1)cout << arr[R15] << " "; cout << endl;

#define endl                                      '\n'
#define ff                                        first
#define ss                                        second
#define pii                                       pair<int,int>

#define pb                                        push_back
#define all(v)                                    v.begin(),v.end()

#define bug(...)                                  __f (#__VA_ARGS__, __VA_ARGS__)
#define rtn                                       if(0)return;
template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { rtn cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{	rtn
	const char* comma = strchr (names + 1, ',');
	cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

// M A F I A - M A F I A - M A F I A - M A F I A - M A F I A - M A F I A //

const int N = 3e6 + 7, M = 1000000007, inf = INT_MAX;
const long long INF = LLONG_MAX;

int n, Q;
int arr[N + 2];
int dp[N][2][2];
int get(int id, int f, int f3)
{
	if ( id < 0 )
	{
		if (n % 2 == 0) return 0;
		if (f3) return -1e15;
		return 0;
	}

	int &mafia = dp[id][f][f3];
	if (mafia != -1) return mafia;

	int c = -1e15;
	if (n & 1 and f3) c = get(id - 1, f, 0);
	int a = -1e15, b = -1e15;
	if (f)
	{
		a = arr[id] + get(id - 2, 1, f3);
	}
	else
	{
		a = arr[id] + get(id - 2, 0, f3);
		if ( id - 1 >= 0 ) b = arr[id - 1] + get(id - 3, 1, f3);
	}
	a = max(a, c);
	return mafia = max(a, b);
}

void solve()
{
	cin >> n;
	lop(i, 0, n) cin >> arr[i];
	memset(dp, -1, sizeof dp);

	int res = -INF;
	int x = 0;
	if (n & 1) x = 1;
	res = max(res,  get(n - 1, 0, x));
	cout << res << endl;

}

int32_t main()
{
	ios_base::sync_with_stdio(0);   cin.tie(0);   cout.tie(0);

	int test = 1;
	// cin >> test;

	// cout << setprecision(9) << fixed;
	// clock_t z = clock();
	while (test--)solve();
	// cerr << "Run Time : " << ((double)(clock() - z) / CLOCKS_PER_SEC);
}





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

int main() {
    int a;
    cin >> a;
    int h,m,s;
    h=a/3600;
    a-=h*3600;
    m=a/60;
    a-=m*60;
    s=a;
    cout << h << ":" << m << ":" << s << endl;
}


Measured memory_bytes: 3092
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
//using System.Text;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
//using System.Numerics;
//using static System.Math;
//using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    void chmax<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? b : a; }
    void chmin<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? a : b; }

    void solve()
    {
        int L = cin.nextint + cin.nextint;
        int R = cin.nextint + cin.nextint;
        if (L > R)
        {
            WriteLine("Left");
        }
        else if (L == R)
        {
            WriteLine("Balanced");
        }
        else
        {
            WriteLine("Right");
        }
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

Measured memory_bytes: 11092
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	int ans = 700;
	for (int i = 0; i < 3; i++)
	{
		char s;
		cin >> s;
		if (s == 'o')
			ans += 100;
	}
	cout << ans << endl;
} 

Measured memory_bytes: 3592
package main

import (
	f "fmt"
)

func main() {
	var hp, a int
	f.Scan(&hp, &a)

	sum := 0
	num := 0

	for i := 1; ; i++ {
		sum += a
		num = i
		if sum >= hp {
			break
		}
	}

	f.Println(num)
}


Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp15
{
    class Class19
    {
        static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            var A = Console.ReadLine().Split().Select(int.Parse).ToArray();
            bool frag = true;
            foreach(int i in A)
            {
                if (i % 2 == 0)
                {
                    if (i % 3 == 0 | i % 5 == 0)
                        continue;
                    frag = false;
                }
            }
            Console.WriteLine(frag ? "APPROVED" : "DENIED");
        }
    }
}


Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
typedef long long ll;


int main(){
  int n,k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i,n){
    cin >> a[i];
  }
  vector<long long> sum;
  rep(i,n){
    long long sumNum = a[i];
    sum.push_back(sumNum);
    FOR(j,i+1,n){
      sumNum  += a[j];
      sum.push_back(sumNum);
    }
  }

  vector<bool> deside(sum.size(),true);


  for(int j = 40; j >= 0; j--){
    int cnt = 0;
    rep(i,sum.size()){
      if(!!(sum[i] & 1LL<<j) && deside[i]){
        cnt++;
      }
    }
    if(cnt >= k){
      rep(i,sum.size()){
        if(!!(sum[i] & 1LL<<j) && deside[i]){
          deside[i] = true;
        }else{
          deside[i] = false;
        }
      }
    }
  }
  long long ans = (1LL<<41) - 1;
  rep(i,sum.size()){
    if(deside[i]){
      ans &= sum[i];
    }
  }
  cout << ans << endl;
  return 0;
}


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

int N , A[100003];

int main(){
	cin >> N; long long sum = 0; for(int i = 1 ; i <= N ; ++i){cin >> A[i]; sum += A[i];}
	long long num = N * (N + 1ll) / 2; if(sum % num){puts("NO"); return 0;}
	sum /= num; A[N + 1] = A[1]; long long cnt = 0;
	for(int i = 2 ; i <= N + 1 ; ++i){
		if(A[i - 1] + sum < A[i] || (A[i - 1] + sum - A[i]) % N){puts("NO"); return 0;}
		cnt += (A[i - 1] + sum - A[i]) / N;
	}
	puts(sum == cnt ? "YES" : "NO");
	return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using std::cin;
using std::cout;
using std::pair;

int main(int argc, char* argv[]) {
  int n, m;
  cin >> n >> m;

  std::vector<pair<int, int>> j(n);
  for (int i = 0; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    j[i] = std::make_pair(a, b);
  }

  sort(j.begin(), j.end(),
       [](const pair<int, int>& p1, const pair<int, int>& p2) {
         return p1.first < p2.first;
       });

  std::vector<pair<int, int>> l;
  int i = 0;
  unsigned long total = 0;
  for (int k = 1; k <= m; ++k) {
    while (i < n && j[i].first <= k) {
      l.push_back(j[i]);
      push_heap(l.begin(), l.end(), [](const pair<int, int>& p1, const pair<int, int>& p2) {
          return !((p1.second > p2.second)
                   ? true
                   : (p1.second == p2.second) ? (p1.first < p2.first) : false);
        });
      ++i;
    }
    if (l.size() > 0) {
      pop_heap(l.begin(), l.end(), [](const pair<int, int>& p1, const pair<int, int>& p2) {
          return !((p1.second > p2.second)
                   ? true
                   : (p1.second == p2.second) ? (p1.first < p2.first) : false);
        });
      total += l[l.size() - 1].second;
      l.pop_back();
    }
  }

  cout << total;

  return 0;
}


Measured memory_bytes: 2168
#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>

using namespace std;
typedef long long ll;

ll n, m;
ll mo = 1e9+7;

int main(){
  cin >> n >> m;
  ll xx = 0, yy = 0;
  ll x, y, px, py, r;
  cin >> px;
  for(ll i = 1; i < n; i++){
    cin >> r; x = r-px; px = r;
    xx = (xx + ((i * (n-i) % mo) * x) % mo) % mo;
  }
  cin >> py;
  for(ll i = 1; i < m; i++){
    cin >> r; y = r-py; py = r;
    yy = (yy + ((i * (m-i) % mo) * y) % mo) % mo;
  }

  cout << (xx*yy) % mo << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

int main() {
    string s, t; cin >> s >> t;
    sort(all(s)); sort(rall(t));
    if (s < t) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace atcorder_BeginnerContest_118
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] line = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            int ret = 0;
            if (0 == line[1] % line[0])
            {
                ret = line[0] + line[1];
            }
            else
            {
                ret = line[1] - line[0];
            }

            Console.WriteLine(ret);
        }
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define INF 1e8;
typedef long long ll;
ll mod = 998244353;
long long fast_exp(long long a, long long b)
{
    if(b == 0)
	   return 1;
    else
    {
	   long long res = 1;
	   res = fast_exp(a,b/2);
	   res = (res*res)%mod;
	   if(b%2 == 1)
		  res = (res*a)%mod;
	   return res;
 
    }
}
const ll N = 1e6;


int main()
{
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int  n;
	cin>>n;
	int x[17][17];
	for(int i = 0; i<17 ; i++)
		for(int j = 0; j<17 ; j++)
			x[i][j] = -1;
	int a[n+1];
	for(int i = 0; i<n ; i++)
		{
			cin>>a[i];
			for(int j = 0; j<a[i] ; j++)
			{
				int x1,y1;
				cin>>x1>>y1;
				x1--;
				x[i][x1] = y1;		
			}
		}
	int assign = 0;
	int mnum = 0;
	
	int p = pow(2,n);
	for(assign = 0; assign < p ; assign++)
	{
		int chk = 1;
		int c = -1;
		for(int i = 1; i<p ; i=i*2)
		{
			c++;
			if((i&assign)>0)
			{
				int bit = 1;
				for(int j = 0; j<n ; j++)
				{
					if(x[c][j] > 0 && (bit&assign) == 0)
					{
						chk = 0;
					}
					else if(x[c][j] == 0 && (bit&assign)>0)
						chk = 0;
					bit = bit*2;
				}


			}
		}
				if(chk)
					mnum = max(mnum, __builtin_popcount(assign));
	}
	cout<<mnum<<endl;
	return 0;
	
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define endl '\n'
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;}
template<class T> inline void prn(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << ' ';}
template<class T> inline void printv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << (i == n - 1 ? endl : ' ');}
template<class T> inline void printvv(vector<vector<T>>& v) {for (auto u : v) printv(u);}
template<class T> inline void printlnv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << endl;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    int n;
    cin >> n;
    vl a(n);
    vl b(n);
    REP(i, n) cin >> a[i] >> b[i];
    ll ans = 0;
    REPR(i, n) {
        if ((a[i] + ans) % b[i] == 0) continue;
        ans += b[i] - ((a[i] + ans) % b[i]);
    }
    cout << ans << endl;
}


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

int csum(int ,int);

int A[20],n;

int main(){
  int i,j,num,sum = 0,q;
  char display[200][4];

  scanf("%d",&n);

  for(i = 0;i < n;i++){
    scanf("%d",&A[i]);
  }

  scanf("%d",&q);

  for(i = 0;i < q;i++){
    scanf("%d",&num);
      if(csum(0,num)){
        strcpy(display[i],"yes");
        continue;
      }
      else{
        strcpy(display[i],"no");
        continue;
      }
    }


  for(i = 0;i < q;i++) printf("%s\n",display[i]);
  return 0;
}

int csum(int i,int num){
  int res;
  if(num == 0) return 1;
  if(i >= n) return 0;
  res = csum(i+1,num-A[i]) || csum(i+1,num);
  return res;
}



Measured memory_bytes: 2148
#[allow(unused_macros)]
macro_rules ! read_value {($ next : expr , ($ ($ t : tt ) ,* ) ) => {($ (read_value ! ($ next , $ t ) ) ,* ) } ; ($ next : expr , [$ t : tt ; $ len : expr ] ) => {(0 ..$ len ) . map (| _ | read_value ! ($ next , $ t ) ) . collect ::< Vec < _ >> () } ; ($ next : expr , chars ) => {read_value ! ($ next , String ) . chars () . collect ::< Vec < char >> () } ; ($ next : expr , usize1 ) => {read_value ! ($ next , usize ) - 1 } ; ($ next : expr , $ t : ty ) => {$ next () . parse ::<$ t > () . expect ("Parse error" ) } ; }
#[allow(unused_macros)]
macro_rules ! input_inner {($ next : expr ) => {} ; ($ next : expr , ) => {} ; ($ next : expr , $ var : ident : $ t : tt $ ($ r : tt ) * ) => {let $ var = read_value ! ($ next , $ t ) ; input_inner ! {$ next $ ($ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input {(source = $ s : expr , $ ($ r : tt ) * ) => {let mut iter = $ s . split_whitespace () ; let mut next = || {iter . next () . unwrap () } ; input_inner ! {next , $ ($ r ) * } } ; ($ ($ r : tt ) * ) => {let stdin = std :: io :: stdin () ; let mut bytes = std :: io :: Read :: bytes (std :: io :: BufReader :: new (stdin . lock () ) ) ; let mut next = move || -> String {bytes . by_ref () . map (| r | r . unwrap () as char ) . skip_while (| c | c . is_whitespace () ) . take_while (| c |! c . is_whitespace () ) . collect () } ; input_inner ! {next , $ ($ r ) * } } ; }

fn main() {
    input! {
        a: i32,
        b: i32,
        c: i32,
    }
    if a == b {
        println!("{}", c);
    } else if a == c {
        println!("{}", b);
    } else {
        println!("{}", a);
    }
}


Measured memory_bytes: 2124
def gcd(a,b)
  return b if a%b==0
  return gcd(b, a%b)
end

def lcs(a,b)
  a*b/gcd(a,b)
end

N = readline.strip.to_i
T = readlines.map(&:strip).map(&:to_i)

result=T[0]

T.each do|t|
  result = lcs(result,t)
end

p result




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

int main() {
	int a,b;
	while (true) {
		cin >> a >> b;
		if (a == 0 && b == 0) {
			break;
		}
		if (a > b) {
			swap(a,b);
		}
		cout << a << " " << b << endl;
	}
}

Measured memory_bytes: 3048
#include <bits/stdc++.h>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const long double PI  = acos(-1.0L);
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef pair<double,double> PDD;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
#define chmax(a,b) a = (((a)<(b))?(b):(a))
#define chmin(a,b) a = (((a)>(b))?(b):(a))

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
	int x; cin>>x;
	if(x>=1200) cout<<"ARC"<<endl;
	else cout<<"ABC"<<endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#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++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;
//const double pi = 3.14159265358979323846;

void	solve()
{
	int r;
	cin >> r;
	cout << 3 * r * r << endl;
}

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

	solve();
}

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

#define ll long long int

#define rep(p,q) for(int i = p; i < q;i++)


class Algo {

public:
	static int gcd(ll a, ll b) {
		if (a < b) {
			ll swap = a;
			a = b;
			b = swap;
		}
		int c = a % b;
		if (c == 0) return b;
		else gcd(b, c);
	}

	static void eratos(bool isPrime[10000000]) {

		rep(0, 10000000)isPrime[i] = true;
		rep(2, 10000000) {
			if (!isPrime[i])continue;
			else {
				for (int j = i * 2; j < 10000000; j += i) {
					isPrime[j] = false;
				}
			}
		}
	}

};

int main(void) {
	int a, b;
	cin >> a >> b;
	cout << Algo::gcd(a, b) << endl;
}


Measured memory_bytes: 3084
/* << IN THE NAME OF GOD >> */
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pob pop_back
#define ft first
#define sc second
#define err(x) cerr << #x  << " = "<<  x << '\n'
#define out(x) cout << x << '\n'
#define forp(i, r, l) for(int i = int(r); i < int(l); i++)
#define forn(i, r, l) for(int i = int(r); i > int(l); i--)
#define FAST ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
#define ctz __builtin_ctz
typedef pair<int, int> pii;
const int maxn = 1e6;
 



int main(){FAST;
    int a , b ,c;
    cin >> a >> b >> c;
        a + b >= c ? cout << "Yes" : cout << "No";

   return 0;
}
 












Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;
int main(){
int a,b=0,s=100000;
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>a;
b=max(b,a);
if(s>=a)
s=a;}
cout<<b-s;
system("pause");
return 0;
}

Measured memory_bytes: 504
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define pb push_back
#define fr(i,n) for(int i=0;i<n;i++)
#define Fr(i,n) for(int i=0;i++<n;)
#define ifr(i,n) for(int i=n-1;i>=0;i--)
#define iFr(i,n) for(int i=n;i>0;i--)

int v2(int a){
  int k=0;
  while(1-a%2){a/=2;k++;}
  return k;
}

int main(){
  int n,a,ans=0;
  cin>>n;
  fr(I,n){cin>>a;ans+=v2(a);}
  cout<<ans<<endl;
}

Measured memory_bytes: 256
# util functions
class UnionFind
  def initialize(n) # n: number of elements in the forest
    @par  = []
    @rank = []
    @vs   = []
    n.times do |i|
      @par[i] = i
      @rank[i] = 0
      @vs[i] = 1
    end
  end
  attr_accessor :par, :rank, :vs

  def find(x)
    raise "x = #{x} is out of range 0..#{@par.size - 1}" unless @par[x]
    if @par[x] == x
      return x
    else
      return find( @par[x] )
    end
  end

  def unite( x, y )
    xrt = find(x)
    yrt = find(y)
    return if xrt == yrt

    if @rank[xrt] > @rank[yrt]
      @par[yrt] = xrt
      @vs[xrt] += @vs[yrt]
    else
      @par[xrt] = yrt
      @vs[yrt] += @vs[xrt]
      @rank[yrt] += 1 if @rank[xrt] == @rank[yrt]
    end
  end

  def same( x, y ) # returns true/false
    return find( x ) == find( y )
  end

end # UnionFind

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

def pd(str)
  p str if $debugFlag
end

def printd(str)
  print str if $debugFlag
end

# input
inputs = []
lc = 0
while l = $stdin.gets do
  if false
    inputs << l.chomp.split(" ").map(&:to_s)
  else
    inputs << l.chomp.split(" ").map(&:to_i)
  end
  lc += 1
end

# input check
if $debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

nn = inputs[0][0]
$lst = inputs[1]

# body
if $debugFlag
end

nn = inputs[0][0]

arr = [11, 31, 41, 61, 71, 101, 131, 151, 181, 191, 211, 241, 251, 271, 281, 311, 331, 401, 421, 431, 461, 491, 521, 541, 571, 601, 631, 641, 661, 691, 701, 751, 761, 811, 821, 881, 911, 941, 971, 991, 1021, 1031, 1051, 1061, 1091, 1151, 1171, 1181, 1201, 1231, 1291, 1301, 1321, 1361, 1381]

for i in 0..nn-1
  print "#{arr[i]} "
end
print "\n"


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

#define SIZE_OF_ARRAY(array) sizeof(array)/sizeof(array[0])

int main() {
    int H, N;
    cin >> H >> N;
    int attack = 0;
    for(int i = 0; i < N; i++){
        int A;
        cin >> A;
        attack += A;
        if(H <= attack){
            cout << "Yes" << endl;
            break;
        }
        if(i == N-1){
            cout << "No" << endl;
        }
    }
}

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

using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    int h[25];
    for(int i = 0; i < n; ++i)
        scanf("%d", &h[i]);
    int ans = 0;
    for(int i = 0; i < n; ++i)
    {
        int flag = 1;
        for(int j = 0; j < i; ++j)
        {
            if(h[i] < h[j])
            {
                flag = 0;
                break;
            }
        }
        if(flag)
            ans++;
    }
    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,i,j;
    cin>>n;
    double prob[n];
    for(i=0;i<n;i++)
        cin>>prob[i];
    double dp[n+1][n+1];
    memset(dp, 0, sizeof(dp));
    for(i=0;i<=n;i++){
        for(j=0;j<=n;j++){
            if(i==0 && j==0)
                dp[i][j] = 1;
            else if(i<j)
                continue;
            else{
                if(j==0)
                    dp[i][j] = (1-prob[i-1]) * dp[i-1][j];
                else
                {
                    dp[i][j] = prob[i-1] * dp[i-1][j-1] + (1-prob[i-1]) * dp[i-1][j];
                }
            }
        }
    }

    // for(i=0;i<=n;i++){
    //     for(j=0;j<=n;j++)
    //         cout<<dp[i][j]<<" ";
    //     cout<<endl;
    // }

    if(n&1)
        j = n/2 + 1;
    else
        j = n/2;
    double ans = 0;
    for(;j<=n;j++)
        ans += dp[n][j];
    // cout<<ans;
    printf("%.10lf\n", ans);
}

Measured memory_bytes: 70528
package main

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

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8 + 7
)

var buf []byte = make([]byte, maxBufSize)
var sc = bufio.NewScanner(os.Stdin)

func init() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBufSize)
}

// 期待値・累積和
// https://drken1215.hatenablog.com/entry/2020/02/10/235800
// https://qiita.com/drken/items/56a6b68edef8fc605821

func main() {
	N := nextInt()
	K := nextInt()
	Pn := make([]int, N)
	Csum := make([]int, N+1)
	var ans int
	// (p+1)/2 がサイコロの期待値。2で割るのは最後にして、まずはpi+1を配列に入れる
	for i := range Pn {
		Pn[i] = nextInt()
		Pn[i]++
	}
	// 累積和
	for i, Pi := range Pn {
		Csum[i+1] = Csum[i] + Pi
	}

	for i := 0; i+K <= N; i++ {
		sum := Csum[i+K] - Csum[i]
		if ans < sum {
			ans = sum
		}
	}
	fmt.Printf("%.7f\n", float64(ans)/2)
	// fmt.Println(float64(ans) / 2)

}

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


Measured memory_bytes: 10624
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
  unsigned ll n; cin>>n;
  unsigned ll t = 10, ans = 0;
  if(n & 1)
  {
  	 cout<<"0\n"; return 0;
  }
  while(t<=n)
  {
  	ans += (n/t);
  	t *= 5;
  }
  
  cout<<ans<<"\n";
}


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

namespace ProgramingStudying2
{
    class Program
    {

        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var k = int.Parse(Console.ReadLine());
            var x = Console.ReadLine().Split().Select(int.Parse).ToList();

            var ans = 0;
            for(int i = 0; i < n; i++)
            {
                ans += Math.Min(Math.Abs(x[i]), Math.Abs(x[i] - k)) * 2;
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 28240
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <list>
#include <string.h>
#include <functional>
//#include <Windows.h>
//#include "Library.h"
//#include "Math.h"
using namespace std;
typedef long long int ll; typedef pair <double, int> P; typedef vector <int> vecint;
const int INF = 2000000000;
const double EPS = 10e-9;
int a[2000];
int main()
{
	int n, z, w; cin >> n >> z >> w;
	for (int i = 0; i < n; i++)cin >> a[i];
	if(n >= 2) cout << max(abs(a[n - 1] - a[n - 2]), abs(a[n - 1] - w)) << endl;
	if (n ==1) cout << abs(a[0] - w) << endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        char[] ans = new char[10];
        for (int i = 0; i < 10; i++) {
            ans[i] = str.charAt(i);
            if (i == 3) {
                ans[i] = '8';
            }
            System.out.print(ans[i]);
        }
        System.out.println();
    }

}


Measured memory_bytes: 23252
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define req(i,n,m) for(int i=n;i<m;i++)
#define REQ(i,n,m,l) for(int i=n;i<m;i+=l) 
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
signed gcd(int x, int y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
signed lcm(int x, int y) {
    return x / gcd(x, y) * y;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main() {
    int N, M; cin >> N >> M;
    vector<int>K(N);
    vector<vector<int>>A(N, vector<int>(M));
    vector<int>B(M+1);
    rep(i, N) {
        cin >> K[i];
        rep(j, K[i]) {
            cin >> A[i][j];
            B[A[i][j]]++;
        }
    }
    int ans = 0;
    REP(i, M+1)if (B[i] == N)ans++;
    cout << ans << endl;
}

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;
using std::bitset;

#define rep(i,n)    for(int i=0; i<(int)n; i++)
#define reps(i,s,e) for(int i=s; i<(int)e; i++)
#define coutd(i) cout << std::fixed << std::setprecision(i)
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef std::pair<int, int> pii;
typedef std::pair<ll, ll> pll;

template<class T>
using Set = std::set<T>;
template<class T, class U>
using Map = std::map<T, U>;

template<class T>
using Graph = vector<vector<T>>;

const int INT_BIG = 1<<28;

int main() {
    double r;
    cin >> r;
    coutd(7) << r*2*3.141592 << endl;
}

Measured memory_bytes: 3736
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
const ll INF=1e18;
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<endl;}
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; }



int main(int argc, char const *argv[]) {
  char s;
  cin >> s;
  /*if (isupper(s)) puts("A");
  else
    puts("a");
    */
  if (s <= 90) puts("A");
  else puts("a");
  return 0;
}

Measured memory_bytes: 3552