akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;

#define int ll
#define LOCAL 0
#define dbg(x) cout << #x << " is " << x << "\n"
#define gll(x) scanf("%d",&x)
#define gll2(x,y) scanf("%d%d",&x,&y)
#define gll3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define gllarr(arr,n) f(i,n) gll(arr[i]);
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=n-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)

const ll mod = (ll)1e9 + 7;
const ll inf = (ll)1e16;
const ld eps = 1e-12;
const ll N = (int)1e5 + 5;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
inline ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
inline ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
inline ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    if (LOCAL) {
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\input.txt", "r", stdin);
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\output.txt", "w", stdout);
    }
    string s;
    cin>>s;
    vector<string> tt = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
    int pos = 0;
    for(int i = 0; i < tt.size(); i++) {
    	if(tt[i] == s) {
    		pos = i;
    		break;
    	}
    }
    pos++;
    pos %= 7;
    int cnt = 1;
    while(1) {
    	if(tt[pos] == "SUN") {
    		cout<<cnt;
    		return 0;
    	}
    	pos++;
    	cnt++;
    	pos %= 7;
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
 
int main(void){
 
    int c, a, n, Q;
 
    cin >> Q;
    for(int i=0;i<Q;i++){
        int sum = 0;
        cin >> c >> a >> n;
        while(c >= 1 && a >=1 && n >= 1){
			sum = sum + 1;
			c = c - 1;
			a = a - 1;
			n = n - 1;
		}
        while(c >= 2 && a >= 1){
			sum = sum + 1;
			c = c - 2;
			a = a - 1;
		}
        while(c >= 3){
			sum = sum + 1;
			c = c - 3;
		}
        cout << sum << endl;
    }
 
    return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <string>
#include <stdio.h>
#include<string.h>
#include <algorithm>

using namespace std;

char str1[1234],str2[1234];

int main()
{
    scanf("%s%s",str1,str2);
    int len1=strlen(str1);
    int len2=strlen(str2);
    if(len1>len2)
    {
        puts("GREATER");
    }
    else if(len1<len2)
    {
        puts("LESS");
    }
    else
    {
        for(int i=0;i<len1;i++)
        {
            if(str1[i]>str2[i])
            {
                puts("GREATER");
                return 0;
            }
            else if(str1[i]<str2[i])
            {
                puts("LESS");
                return 0;
            }
        }
        puts("EQUAL");
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main()
{
    string S;
    cin >> S;
    int res = INT_MAX;
    REP( i, (int)S.size() - 2 )
    {
        int N = stoi( S.substr( i, 3 ) );
        res = min( res, abs( 753 - N ) ); 
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
P = list(map(int,input().split()))
p = list(range(1,N+1))
cnt = 0
element = []
for i in range(0,N):
    if P[i] == p[i]:
        cnt += 0
    else:
        cnt += 1
        element.append(i)
if cnt == 0:
    print('YES')
elif cnt == 2:
    if p[element[0]] == P[element[1]] and p[element[1]] == P[element[0]]:
        print('YES')
    else:
        print('NO')
else:
    print('NO')

Measured memory_bytes: 3064
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>

#define rep(i, x, n) for(int i = x; i < n; i++)
using namespace std;
const long long INF = 1LL << 60;

long long GCD(long long a, long long b) {
    if(b == 0)
        return a;
    else
        return GCD(b, a % b);
}
long long LCM(long long a, long long b) {
    long long g = GCD(a, b);
    return a / g * b;
}

int main() {
    int N;
    cin >> N;
    vector<int> p(N);
    rep(i, 0, N) { cin >> p[i]; }
    int min = p[0];
    int res = 1;
    rep(i, 1, N) {
        if(p[i] <= min) {
            res++;
            min = p[i];
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 1024
//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#include <iomanip>
#include <stack>
#include <bitset>

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

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

/*
int life[200100];
bool dead[200100];
vector<int> alp[200100];
int ans;

bool check(int a, int n){
  return (0 < a && a < n+1);
}

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

  int n, q;
  cin >> n >> q;
  string s;
  cin >> s;
  REP(i, n) {
    alp[s[i]-'A'].push_back(i);  
    life[i] = i+1;    
  }

  char t, d;
  REP(i, q){    
    cin >> t >> d;
    // t[i]カラーのゴーレムを-1
    if(d == 'L') {
      int tmp = t-'A';
      for(auto itr = alp[tmp].begin(); itr != alp[tmp].end(); itr++){
	life[*itr]--;
	if(!check(life[*itr], n) && !dead[*itr]) {
	  ans++;
	  dead[*itr] = true;
	}
      }
    }
    else{
     int tmp = t-'A';
     for(auto itr = alp[tmp].begin(); itr != alp[tmp].end(); itr++){
       life[*itr]++;
       if(!check(life[*itr], n) && !dead[*itr]) {
	 ans++;
	 dead[*itr] = true;
       }
     }
    }
    REP(i, n) cerr << life[i] << " ";
    cerr << endl;
  }  
  cout << n - ans << endl;
  return 0;
}
*/

int ans, ans_l, ans_r;
char t[200100], d[200100];
int n, q;
string s;

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

  cin >> n >> q;
  cin >> s;
  REP(i, q) cin >> t[i] >> d[i];

  int l = 0, r = n+1, mid;
  while(r - l > 1){
    int mid = (l+r)/2;
    int pos = mid;
    
    REP(i, q){
      if(pos == 0 || pos == n+1) break;
      if(s[pos-1] == t[i]){
	if(d[i] == 'R') pos++;
	else pos--;
      }
    }
    if(pos == 0) l = mid;
    else r = mid;
  }
  ans_l = l;
  
  //cerr << "l -> r" << endl;
  
  l = 0, r = n+1;
  while(r - l > 1){    
    int mid = (l+r)/2;
    int pos = mid;

    REP(i, q){
      if(pos == 0 || pos == n+1) break;
      if(s[pos-1] == t[i]){
	if(d[i] == 'R') pos++;
	else pos--;
      }      
    }
    if(pos == n+1) r = mid;
    else l = mid;
  }  
  ans_r = r;
  
  cout << ans_r - ans_l - 1 << endl;
  return 0;
}


Measured memory_bytes: 976
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<ll,ll>;
#define For(i,a,b)  for(int i=a;i<=b;i++)
#define Forr(i,a,b) for(int i=a;i>=b;i--)
#define F first
#define S second
#define int ll
#define sz(x) ((ll)x.size())
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define mkp make_pair
#define INF (ll)(1e17)
#define MOD (ll)(998244353)

int s[200020];

inline int get(int l,int r){
	if(r<1) return 0;
	l=max(1ll,l);
	return (s[r]-s[l-1]+MOD)%MOD;
}

int32_t main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	//I won't misunderstand the problem statement anymore.
	//I won't misunderstand the problem statement anymore.
	//I won't misunderstand the problem statement anymore.
	//I won't misunderstand the problem statement anymore.
	//I won't misunderstand the problem statement anymore.
	//I won't misunderstand the problem statement anymore.
	//I won't misunderstand the problem statement anymore.
	//I won't misunderstand the problem statement anymore.
	//I won't misunderstand the problem statement anymore.
	//I won't misunderstand the problem statement anymore.
	int n; cin>>n;
	memset(s,0,sizeof(s));
	int k; cin>>k;
	vector<pii> v(k);
	for(auto &i:v) cin>>i.F>>i.S;
	s[1]=1;
	For(i,2,n){
		s[i]=s[i-1];
		for(auto &j:v){
			s[i]=(s[i]+get(i-j.S,i-j.F))%MOD;
		}
	}
	cout<<(s[n]-s[n-1]+MOD)%MOD<<"\n";
	return 0;
}























Measured memory_bytes: 5212
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
S = input()

for i in range(1, len(S)//2 + 1):
	T = S[:-2*i]
	if T[:len(T)//2] == T[len(T)//2:]:
		print(len(T))
		break

Measured memory_bytes: 5144
#include <iostream>

using namespace std;

int main() {

	unsigned int a, b, c, k;
	unsigned int sum = 0, max;

	cin >> a >> b >> c;
	cin >> k;

	max = a;
	sum = a + b + c;

	if (max < b) 
		max = b;
	if (max < c) 
		max = c;

	if (max == a)
		sum = sum - a;
	else if (max == b)
		sum = sum - b;
	else if (max == c)
		sum = sum - c;


	for (int i = 0; i < k; i++) {
		max = max * 2;
	}
	sum = sum + max;
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int n,num;
    vector<int>v;
    int maxnum=-102,mini=102;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>num;
        v.push_back(num);
        maxnum=max(maxnum,num);
        mini=min(mini,num);
    }
    int sq=1e6;
    for(int i=mini;i<=maxnum;i++){
        int sub=0;
        for(int x:v){
            sub+=(i-x)*(i-x);
        }
        sq=min(sq,sub);
    }
    cout<<sq;
    return 0;
}

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

using namespace std;

int main(void) {
    long mod = 1000000007;
    int n;
    int ans = 0;
    cin >> n;
    vector<long> a(n);
    vector<long> add(n);
    // long addtmp = 0;
    for(int i = 0; i < n; i++){
        cin >> a.at(i);
    }
    add.at(n - 1) = a.at(n - 1);
    // cout << n - 1 << " " << add.at(n - 1) << endl;
    for(int i = n - 2; i >=0 ; i--){
        add.at(i) = ((long)(add.at(i + 1) + a.at(i))) % mod;
        // cout << "add  i = " << i << " " << add.at(i) << endl;
    }
    for(int i = 0; i < n - 1; i++){
        long mul = (long)(a.at(i) * add.at(i + 1));
        int tmp = mul % mod;
        ans = ((long)(ans + tmp)) % mod;
        // cout << "ans = " << ans << endl;
        // for(int j = i + 1; j < n; j++){
        //     long mul = (long)(a.at(i) * a.at(j));
        //     int tmp = mul % mod;
        //     ans = ((long)(ans + tmp)) % mod;
        // }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6344
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

a,b,c=map(int, input().split())

print(min(c, b//a))




Measured memory_bytes: 8868
#include <bits/stdc++.h>
  
using namespace std;
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)
  
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()
  
#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD
 
int dp[11][353][1252];
 
int dfs(int cnt, int msk, int cur){
  if(cnt>10 || cur>330) return 0;
  if(cnt == 0) return (cur==0?1:0);
  if(dp[cnt][cur][msk] != -1) return dp[cnt][cur][msk];
  dp[cnt][cur][msk] = 0;
  REP(i,10){
    if(msk&(1<<i))continue;
    int nmsk = msk | (1<<i);
    int ncur = cur - cnt*i;
    if(ncur >= 0)
      dp[cnt][cur][msk] += dfs(cnt-1,nmsk,ncur);
  }
  return dp[cnt][cur][msk];
}
 
int main(){
  REP(i,11)REP(j,353)REP(k,1252)dp[i][j][k] = -1;
  int n,s;
  while(~scanf("%d%d",&n,&s)){
    cout<<dfs(n,0,s)<<endl;
  }
  return 0;
}

Measured memory_bytes: 20196
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
    int n;
    scanf("%d", &n);
    set<int> A;
    for (int i = 0; i < n; i++)
    {
        int temp;
        scanf("%d", &temp);
        A.insert(temp);
    }
    cout << A.size() << endl;
    return 0;
}

Measured memory_bytes: 3672
#include<stdio.h>
#include<math.h>
#include <stdlib.h>

double distance(double p1[2],double p2[2]){
	double answer = pow(pow(fabs(p1[0] - p2[0]), 2.0) + pow(fabs(p1[1] - p2[1]), 2.0), 0.5);
	return answer;
}

int main(void){
	double p1[2] = { 0 };
	double p2[2] = { 0 };

	scanf("%lf %lf %lf %lf", &p1[0], &p1[1], &p2[0], &p2[1]);

	printf("%lf\n",distance(p1, p2));


	return 0;
}


Measured memory_bytes: 2068
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <iomanip>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define All(v) (v).begin(),(v).end()
typedef long long ll;

int main(){
    ll N,M;
    cin >> N >> M;
    priority_queue<int> pq;
    rep(i,N){
        int a;
        cin >> a;
        pq.push(a);
    }
    rep(i,M){
        int b = pq.top();
        pq.pop();
        pq.push(b/2);
    }
    ll res = 0;
    rep(i,N){
        res+=pq.top();pq.pop();
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 892
#include <iostream>

using namespace std;

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

    int num_of_even = 0;
    int num_of_odd = 0;
    for (int i = 1; i <= k; ++i) {
        if (i % 2 == 0)
            ++num_of_even;
        else
            ++num_of_odd;
    }
    cout << num_of_even * num_of_odd << '\n';
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
  int x, y;
  cin >> x >> y;
  if (x > y) {
    cout << "a > b" << endl;
  }
  if (x < y) {
    cout << "a < b" << endl;
  }
  if (x == y) {
    cout << "a == b" << endl;
  }
  return 0;
}



Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
long long P = 1000000007;
long long inv[1000010]; 
long long Pow(long long a, long long n) {
	long long tmp = a; 
	long long pow = n;
	long long Q = 1;  
  	while(pow > 0){
		if(pow & 1){
			Q *= tmp; Q %= P; 
		}
		tmp = tmp * tmp % P; 
     		pow >>= 1; 
  	}
	return Q;
} 
void init(){
	inv[1] = 1;
	for (int i = 2; i < 1000005; i++) {    
		inv[i] = P - inv[P % i] * (P / i) % P;
	}
}
int main(){
	int N; cin >> N; 
	long long A[10010] = {}; 
	for(int i = 0; i < N; i++) cin >> A[i]; 
	int F[1000010] = {}; 
	for(int i = 0; i < N; i++){
	    long long tmp = A[i]; 
		for(long long j = 2; j * j <= A[i]; j++){
			int cnt = 0; 
			while(tmp % j == 0){
				cnt ++; tmp /= j; 
			}
			F[j] = max(F[j], cnt); 
		}
		if(tmp != 1) F[tmp] = max(F[tmp], 1); 
	}
	long long LCM = 1; 
	for(long long i = 1; i <= 1000000; i++){
		LCM *= Pow(i, F[i]); LCM %= P; 
	}
	init(); 
	long long SumInv = 0; 
	for(long long i = 0; i < N; i++){
		SumInv += inv[A[i]]; 
		SumInv %= P; 
	}	
	cout << SumInv * LCM % P << endl; 
}

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

void test_case(){

}

int main(){
	// int c=1;
	int X,Y;
	cin >> X >> Y;

	for(int c=0; c<=X;c++){
		if(2*c + 4*(X-c)==Y){
			cout << "Yes\n";
			return 0;
		}
	}
	
	cout << "No\n";

	return 0;
}

Measured memory_bytes: 3632
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n = int(ipt())
    a = [int(i) for i in ipt().split()]
    a.sort()
    ma = max(a)+1
    al = [True]*ma
    ans = 0
    pi = 0
    for i in a:
        if al[i]:
            ans += 1
            for j in range(i,ma,i):
                al[j] = False
            pi = i
        else:
            if i == pi:
                ans -= 1
                pi = 0

    print(ans)

    return

if __name__ == '__main__':
    main()


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

#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif

#define rep(i, n) for (int i = 0; i < (n); i++)
#define mins(x, y) (x = min(x, y))
#define maxs(x, y) (x = max(x, y))
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using P = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;

ll gcd(ll a, ll b) { return (a == 0) ? b : gcd(b % a, a); }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }

void solve() {
  int k;
  cin >> k;
  ll ans = 0;
  rep(a, k) rep(b, k) rep(c, k) {
    ll x;
    x = gcd(a + 1, b + 1);
    x = gcd(x, c + 1);
    ans += x;
  }
  cout << ans << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  // freopen("temp.1", "r", stdin);
  solve();
  return 0;
}

Measured memory_bytes: 3616
#include<stdio.h>
#define N 100

int main(){
    int i, j, k, n, v, h, A[1000];
    
    scanf("%d",&n);
    
    for(i=0 ; i<n ; i++){
        scanf("%d",&A[i]);
        }
        
    for(i= 0 ; i<n ; i++){
        v = A[i];
        j = i-1;
        while(j>=0 && A[j]>v){
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;
        for(h=0 ; h<n ;h++) { 
            if(h!=0)printf(" ");
            printf("%d",A[h]);
            if(h==n-1)printf("\n");
        }
        
    }
    return 0;
}






Measured memory_bytes: 2072
#include <stdio.h>

using namespace std;

void outPut(int Array[],char mark){
	for(int i = 1; i <= 13; i++){
		if(Array[i] == 0) printf("%c %d\n",mark,i);
	}
}

int main(){
	char mark[2];
	int n,S[14],H[14],C[14],D[14],tmp;
	for(int i = 0; i < 14; i++) S[i] = H[i] = C[i] = D[i] = 0;
	scanf("%d",&n);

	for(int i = 0; i < n; i++){
		scanf("%s %d",mark,&tmp);
		switch(mark[0]){
		case 'S':
			S[tmp] = 1;
			break;
		case 'H':
			H[tmp] = 1;
			break;
		case 'C':
			C[tmp] = 1;
			break;
		case 'D':
			D[tmp] = 1;
			break;
		}
	}
	outPut(S,'S');
	outPut(H,'H');
	outPut(C,'C');
	outPut(D,'D');
}



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

int main(){
  int n, x;
  cin >> n >> x;
  vector<int> m(n);
  rep(i,n) cin >> m[i];
  sort(m.begin(), m.end());
  rep(i,n) x -= m[i];
  int ans = n;
  while(x>=m[0]){
    x-=m[0];
    ans++;
  }
  cout << ans;
  return 0;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';

template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }

int main() {
    int N, T;
    int A[100005];
    int maxdiff = 0;
    int minv = INF;

    cin >> N >> T;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        minv = min(minv, A[i]);
        maxdiff = max(maxdiff, A[i] - minv);
    }
    
    minv = INF;
    int ct = 0;
    for (int i = 0; i < N; i++) {
        minv = min(minv, A[i]);
        if (maxdiff == A[i] - minv) ct++;
    }

    cout << ct << endl;

    return (0);
}

Measured memory_bytes: 640
# -*- coding: utf-8 -*-
import sys;
import string;
sys.setrecursionlimit(20000) # 再起呼び出しの最大数をセット

import copy
import itertools

from functools import lru_cache
#@lru_cache(maxsize = None)

PPP = 1000000007

# 整数の入力
#n = int(input())

# スペース区切りの整数の入力
#a = [int(x) for x in input().split()]
#n, m = map(int, input().split())
#print("sp", n, k, file=sys.stderr)
#p, q, r = map(int, input().split())
#s = [int(x) for x in input().split()]
#t = [int(x) for x in input().split()]

# 改行区切りの整数の入力
#a = []
#for x in range(n):
#  a.append(int(input()))
#  a.append([int(x) for x in input().split()])
#p = [int(x) for x in input().split()]
#a.sort()
#print(l, file=sys.stderr)

# 文字列の入力
s = input()

# 出力
#print("{} {}".format(a+b+c, s))
#a.sort()
#print(set(a), file=sys.stderr)
#print(len(set(a)))

#cache = dict()

import re

def isGood(s):
  prev = ""
  for x in s:
    if prev == x:
      return False
    prev = x
  return True

def doit():
  if isGood(s):
    return "Good"
  return "Bad"


#print(doit([0] * 4))
#doit(s)
#print(doit())
try:
  print(doit())
except Exception as e:
  print("e", e, file=sys.stderr)


Measured memory_bytes: 3964
#include <stdio.h>

int main(void)
{
    int student[30] = {0};
    int i;
    int s;
    
    while (scanf("%d", &s) != EOF) student[s - 1] = 1;
    for (i = 0; i < 30; i++){
        if (student[i] == 0) printf("%d\n", i + 1);
    }
    
    return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#include <stack>
typedef long long ll;
#define rep(i,n) for(ll i = 0; i < (n); ++i )
#define rep_rev(n,i) for(ll i = n; i >= 0; --i )
using namespace std;
using P = pair<int, int>;
const long long INF = 1LL << 60;

int main(){
  int N,M; cin >> N >> M;
  vector<int> a(N),b(N),c(M),d(M);
  rep(i,N) cin >> a[i] >> b[i];
  rep(i,M) cin >> c[i] >> d[i];
  rep(i,N){
    int checkpoint;
    ll m = INF;
    rep(j,M){
      int dist = abs(a[i]-c[j])+abs(b[i]-d[j]);
      if(m > dist){
        m = dist;
        checkpoint = j+1;
      }
    }
    cout << checkpoint << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define M ((ll)(1e9)+7)
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;

void solve()
{
    int n,m;cin>>n>>m;
    int h[n+1][2]={0};
    int a;string s;
    for(int i=0;i<m;i++)
    {
        cin>>a>>s;
        if(s=="WA"&&h[a][1]==0)
        {
            h[a][0]++;
        }
        else
        {
            h[a][1]=1;
        }
    }
    ll ans1=0,ans2=0;
    for(int i=1;i<n+1;i++)
    {
        if(h[i][1]==1){
        ans1+=h[i][0];
        ans2++;
        }
    }
    cout<<ans2<<" "<<ans1<<endl;
}

int main()
{
    solve();
}

Measured memory_bytes: 1024
inputAllNumber,inputChoiceNumber = gets.chomp.split(" ").map(&:to_i)
inputNumber = gets.chomp.split(" ").map(&:to_i)

sortedNumber = inputNumber.sort {|a, b| b <=> a }
answer = 0

inputChoiceNumber.times do | i |
  answer += sortedNumber[i]
end

print answer


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

int main(void) {
  int n;
  cin >> n;
  vector<int> a(n+2,0);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  
  int sum = 0;
  for (int i = 1; i <= n+1; i++) {
    sum += abs(a[i]-a[i-1]);
  }

  for (int i = 1; i <= n; i++) {
    if(a[i] > a[i-1] && a[i] > a[i+1]){
      cout << sum - 2 * min(a[i]-a[i-1],a[i]-a[i+1]) << endl;
    } else if (a[i] < a[i-1] && a[i] < a[i+1]){
      cout << sum - 2 * min(a[i-1]-a[i], a[i+1]-a[i]) << endl;
    } else {
      cout << sum << endl;
    }
  }
    
  return 0;
}


Measured memory_bytes: 1664
#include <stdio.h>
#define N 100
#define INF (1<<21)
#define WHITE 0
#define GRAY  1
#define BLACK 2

int n, M[N][N];
int color[N], d[N], p[N];

int prim();
int main(){
  int i, j;
  int weight;
  scanf("%d", &n);

  for( i = 0; i < n; i++ ){
    for( j = 0; j < n; j++ ){
      scanf("%d", &weight);
      M[i][j] = ( weight == -1 ) ? INF : weight;
    }
  }

  printf("%d\n", prim() );
  return 0;
}
int prim(){
  int i, u;
  int v, mincost;
  int sum;
  for( i = 0; i < n; i++ ){
    d[i] = INF;
    p[i] = -1;
    color[i] = WHITE;
  }
  d[0] = 0;

  while( 1 ){
    mincost = INF;
    u = -1;
    for( i = 0; i < n; i++ ){
      if( mincost > d[i] && color[i] != BLACK ){
	mincost = d[i];
	u = i;
      }
    }
    if( u == -1 ){
      break;
    }
    color[u] = BLACK;
    for( v = 0; v < n; v++ ){
      if( color[v] != BLACK && M[u][v] != INF ){
	    if( M[u][v] < d[v] ){
	    d[v] = M[u][v];
	    p[v] = u;
	    color[v] = GRAY;
	    }
      }
    }
  }

  sum = 0;
  for( i = 0; i < n; i++ ){
    if( p[i] != -1 ){
      sum += M[i][p[i]];
    }
  }
  return sum;
}



Measured memory_bytes: 2056
program dm
    implicit none
    character(2*10**5)::S
    integer(16)::A(0:2018,2)
    integer(16)::ANS=0
    integer::i,j
    read*,S
    A=0
    do i=1,len_trim(S)
        do j=0,2018
            A(mod(j*10+ichar(S(i:i))-ichar("0"),2019),2)=A(j,1)
        end do
        A(ichar(S(i:i))-ichar("0"),2) = A(ichar(S(i:i))-ichar("0"),2)+1
        ANS=ANS+A(0,2)
        A(:,1)=A(:,2)
        A(:,2)=0
    end do
    print"(i0)",ANS
contains
end program dm

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

using namespace std;

#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(int i=st; i<ed; i++)
#define repn(i, st, ed) for(int i=st; i<=ed; i++)


typedef long long ll;
typedef unsigned long long int llt;

const int N = 1e5 + 10;

vector<int> g[N];
bool viss[N];
int vis[N];

void dfs(int curr, int par)
{
  for(auto x: g[curr])
    if(x != par)
      dfs(x, curr);
}

void dfs1(int curr, int par)
{
  viss[curr] = 1;
  for(auto x: g[curr])
    if(!viss[x])
      dfs1(x, curr);
}

void dfs2(int curr, int par, int num)
{
  vis[curr] = num;
  for(auto x: g[curr])
    if(vis[x] == 0)
      dfs2(x, curr, num);
}

ll fxor(ll n)
{
  if(n < 0) return 0;
  if(n % 4 == 3) return 0;
  else if(n % 4 == 0) return n;
  else if(n % 4 == 1) return n^(n-1);
  else if(n%4 == 2) return n^(n-1)^(n-2);
}

llt ppow(llt x, llt y)
{
  llt res = 1;
  while(y > 0){
    if(y&1)
      res = (res * x)%M;
    y = y >> 1;
    x = (x * x)%M;
  }
  return res;
}

llt factdp[N];
llt fact(llt x)
{
  if(x == 0) return 1;
  if(x == 1) return 1;
  if(factdp[x] != -1) return factdp[x];
  return factdp[x] = (x*fact(x-1))%M;
}

string ans ="";
void convert10tob(llt N, int b)
{
     if (N == 0)
        return;
     int x = N % b;
     N /= b;
     if (x < 0)
        N += 1;
     convert10tob(N, b);
     ans += to_string(x);
     return;
}

llt convertstrtob(string a, int b)
{
  llt aa = 0;
  llt mul = 1;
  for(int i=a.length()-1; i>=0; i--)
  {
    int curr = a[i] - '0';
    aa += (curr * mul);
    mul *= b;
  }
  return aa;
}

int main()
{
  int h, w;
  cin>>h>>w;
  rep(i, 0, h)
  {
    string s;
    cin>>s;
    cout<<s<<endl;
    cout<<s<<endl;
  }

  return 0;
}


Measured memory_bytes: 2560
/**
 *  author: mahfuzz
 *  created: 19.09.2019
**/

#include <bits/stdc++.h>
using namespace std;
#define debug(x) cout << '>' << #x << ':' << x << endl;
//~ const double pi = 2*acos(0.0);
//~ const long long mod = 1000000007;
//~ const int max_n = 1000005;
typedef long long ll;


int main(int argc, char* argv[]){
    //~ ios_base::sync_with_stdio(0);
    //~ cin.tie(NULL);
       
    #ifdef _DEBUG
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    #endif
    
    string s; getline(cin, s);
    
    if(s == "Sunny")
        printf("Cloudy\n");
    else if(s == "Cloudy")
        printf("Rainy\n");
    else
        printf("Sunny\n");
    
    return 0;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
    int k, x;
    cin >> k >> x;
    for(int i=k-1;i>0;i--){
        if(-1000000 <= x-i){
            cout << x-i << ' ';
        }
    }
    cout << x << ' ';
    for(int i=1;i<=k-1;i++){
        if(x+i<=1000000){
            cout << x+i << ' ';
        }
    }
    cout << endl;
}

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

int main() {
    string N;
    cin >> N;
    bool contains7 = false;

    for(int i=0; i<N.size(); ++i){
        if(N[i] == '7'){
            contains7 = true;
            break;
        }
    }

    if(contains7){
        cout << "Yes";
    } else {
        cout << "No";
    }
    return 0;
}


Measured memory_bytes: 3628
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
const int N=1000005;
ll h,w,a,b;
ll fact[N],inv[N];
ll ksm(ll x,ll y){
    ll res=1;
    while(y){
        if(y&1)
            res=(res*x)%mod;
        x=(x*x)%mod;
        y>>=1;
    }
    return res;
}
void pre(){
    fact[0]=1;
    for(int i=1;i<=1000000;i++)
        fact[i]=(i*fact[i-1])%mod;
    //inv[100000]=ksm(100000ll,mod-2);
    //for(int i=1;i<=1000000;i++)
        //inv[i]=ksm(fact[i],mod-2);
    inv[0]=1;
}
ll Inv(ll x){
    if(x==0)
        return 1;
    return ksm(fact[x],mod-2);
}
ll C(ll x,ll y){
    if(x>y)
        return 0;
    //return fact[y]*inv[x]%mod*inv[y-x]%mod;
    return fact[y]*Inv(x)%mod*Inv(y-x)%mod;
}
int main()
{
    pre();
    scanf("%lld%lld%lld%lld",&h,&w,&a,&b);
    ll ans=0,sum;
    /*ans=C(a,a+b);
    h-=a+1,w-=b+1;
    ans=ans*C(h,h+w)%mod;*/
    /*ans=C(h-1,h+w-2);
    ans-=C(a-1,a+b-2);*/
    for(int i=a+1;i<=h&&b-a+i<=w;i++){
        //printf("%lld\n",C(h-i,h-i+b+i-a-1));
        //printf("%lld\n",C(i-1,w-(b-a+i)+i-1));
        //printf("%lld\n",ans);
        sum=C(h-i,h-i+b+i-a-1)*C(i-1,w-(b-a+i)+i-1)%mod;
        ans=(sum+ans)%mod;
    }
    printf("%lld\n",ans);
}


Measured memory_bytes: 9600
// Contest.cpp : アプリケーションのエントリ ポイントを定義します。
//

#include"iostream"
#include"string"
#include"vector"
#include"algorithm"

using namespace std;

int main()
{
	int n,k;
	cin >> n;
	vector<char>s(n);
	for (int j = 0; j < n; j++)  cin >> s[j];
	cin >> k;
	for (int i = 0; i < n; i++)
	{
		if (s[i] != s[k-1]) {
			s[i] = '*';
		}
	}

	for (int l = 0; l < n; l++)
	{
		cout << s[l] ;
	}

	return 0;
}






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

const int N=1e7+10;
long long f[N];
int n;
int main()
{
	cin>>n;
	for(int i=1;i<N;i++)
	{
		for(int j=i;j<N;j+=i)
		{
			f[j]++;//逆向思维
		} 
	}
		
    long long ans=0;
	
	for( int i=1;i<=n;i++) 
	{
		ans=ans+f[i]*i;
	}
	cout<<ans<<endl;
 } 


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

int main(){
  int64_t N, sum;
  int64_t x;
  cin >> N >> x;
  vector<int64_t> a(N);
  for (int i = 0; i < N; i++){
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  for (int i = N; i > 0; i--){
    sum = 0;
    for (int j = 0; j < i; j++){
      sum += a.at(j);
    }
    if ((i < N && sum <= x )||(i == N && sum == x)){
      cout << i << endl;
      return 0;
    }
  }
  cout << 0 << endl;
  return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n;
    cin >> n;
    vector<ll> h(n);
    rep(i, n) cin >> h[i];
    ll ans = 0, cv = 0;
    rrep(i, n - 1) {
        if (h[i] >= h[i + 1]) {
            cv++;
        }
        else {
            ans = max(ans, cv);
            cv = 0;
        }
    }
    ans = max(ans, cv);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
while(true){
   var n=Arr.shift()-0;
   if(n==0)break;
   var sum=0;
   for(var i=0;i<n;i++){
      var arr=(Arr.shift()).split(" ").map(Number);
      var L=arr[0]+arr[1]+arr[2];
      var W=arr[3];
      var x;
      if(L>160)x=0;
      if(L<=160)x=1600;
      if(L<=140)x=1400;
      if(L<=120)x=1200;
      if(L<=100)x=1000;
      if(L<=80)x=800;
      if(L<=60)x=600;
      var y;
      if(W>25)y=0;
      if(W<=25)y=1600;
      if(W<=20)y=1400;
      if(W<=15)y=1200;
      if(W<=10)y=1000;
      if(W<=5)y=800;
      if(W<=2)y=600;
      if(x!=0 && y!=0)sum+=Math.max(x,y);
   }
   console.log(sum);
}

Measured memory_bytes: 13384
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        int answer = (int)Math.pow(N,3); 
        
        System.out.println(answer);
        
        
    }
}


Measured memory_bytes: 35892
#include <stdio.h>
#define N 100

int main () {
  int i, j, n = 0, A[N], min = 0, cnt = 0, tmp = 0;

  scanf("%d",&n);

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

  for(i = 0 ; i < n - 1 ; i++) {
    min = i;
    
    for(j = i ; j < n ; j++) {

      if(A[j] < A[min]) {
	min = j;
      }
    }
    tmp = A[i];
    A[i] = A[min];
    A[min] = tmp;

    if(A[i] != tmp) cnt++;
  }

  for(i = 0 ; i < n ; i++) {
    if(i == n - 1) printf("%d\n",A[i]);
    else printf("%d ",A[i]);
  }

  printf("%d\n",cnt);

  return 0;
}



Measured memory_bytes: 2128
/*
    author: blue_matrix
*/
#include <bits/stdc++.h>
#include <math.h>
using namespace std;

# define M_PI           3.14159265358979323846
#define ll long long
const ll mod=1e9 +7;
vector<ll> f(200009);
int main()
{
    ll n,k;
    cin>>n>>k;
    set<ll> s;
    for(ll i=0;i<k;i++)
    {
        ll d;
        cin>>d;

        for(ll j=0;j<d;j++)
        {
            ll a;
            cin>>a;
            s.insert(a);
        }
        
    }
    cout<<n-s.size()<<endl;
    return 0;
}

Measured memory_bytes: 4612
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
static const double EPS = 1e-8;
static const double PI = 3.14159265;

typedef complex<double> P;
struct C {P p; double r;C(const P &p, double r) : p(p), r(r) { }};
#define toRad(n) (n*(PI/180.0))
vector<P> data;
pair<C,C> get(P a,P b){
	P diff = a-b;
	if(abs(diff) > 2)return make_pair(C(P(-1,-1),-1),C(P(-1,-1),-1));
	double theta = atan2(diff.imag(),diff.real()) + toRad(90);
	P mid = (a+b) / 2.0;
	double d = sqrt( 1 - (abs(diff)*abs(diff))/4.0 );
	double X = cos(theta)*d , Y = sin(theta)*d;
	return make_pair(C(mid+P(X,Y),1),C(mid-P(X,Y),1));
}
int check(C t){
	int ret = 0;
	rep(i,data.size()){
		if(abs(data[i]-t.p) <= 1+EPS)ret++;
	}
	return ret;
}
int main(){
	int n; 
	while(cin >> n , n){
		data.resize(n);
		rep(i,n){
			cin >> data[i].real() >> data[i].imag();
		}
		int ret = 1;
		rep(i,n){
			for(int j=i+1;j<n;j++){
				pair<C,C> g = get(data[i],data[j]);
				if(g.first.r == -1)continue;
				ret = max(ret,check(g.first));
				ret = max(ret,check(g.second));
			}
		}
		cout << ret << endl;
	}
}

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

int main(){
	int weight;
	while(cin >> weight){
		vector<int> vi;
		for(int i = 512; weight != 0; i = i / 2){
			if(weight >= i){
				weight -= i;
				vi.push_back(i);
			}
		}
		int size = vi.size();
		if(size > 0){
			cout << vi[size - 1];
			for(int i = size - 2; i >= 0; i--){
				cout << " " << vi[i];
			}
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

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

    int n, k, q; cin>>n>>k>>q;
    vector<int> a(q);
    for(int i=0; i<q; i++) cin>>a[i];

    vector<int> po(n, 0);
    for(int i=0; i<q; i++){
        a[i]--;
        po[a[i]]++;
    }

    for(int i=0; i<n; i++){
        if(k - (q - po[i]) <= 0) cout << "No" << endl;
        else cout << "Yes" << endl;
    }

    return 0;
}

Measured memory_bytes: 1408
/*??°???????????????(Unique number)*/
#include <stdio.h>
int main(){
  int i, k, l, x, N;
  int data[200][3];
  int sum[200] = {0};
  scanf("%d", &N);
  for (i = 0; i < N; i++) {
    for (k = 0; k < 3; k++) {
      scanf("%d", &data[i][k]);
	}
  }
  for (i = 0; i < N; i++) {
    for (k = 0; k < 3; k++) {
      x = 0;
      for (l = 0; l < N; l++) {
        if (data[i][k] == data[l][k] && i != l) {
          x++;
		}
	  }
	  if (x == 0) {
        sum[i] += data[i][k];
	  }
    }
  }
  for (i = 0; i < N; i++) {
    printf("%d\n", sum[i]);
  }
  return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define mll map<ll,ll>
#define pb push_back
#define mp make_pair
#define endl "\n"
#define MAX 1e18
#define F first
#define S second
#define all(s) s.begin(),s.end()
#define mod 998244353
ll lcm(ll a,ll b){return (a*b)/(__gcd(a,b));}
ll cel(ll n,ll d){return (n+d-1)/d;}

void hertz()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
    #endif
}

int main()
{
    //hertz();
    ll t=5;
    ll x,y;
    cin>>x>>y;
    if(y%2==0 && (y<=(x*4)) && (y>=(x*2)))
    	cout<<"Yes"<<endl;
    else
    	cout<<"No"<<endl;
}

Measured memory_bytes: 3620
import sys
#input = sys.stdin.buffer.readline

def main():
    N,M = map(int,input().split())
    s = str(input())
    s = list(reversed(s))
    ans = []
    now = 0
    while now < N:
        for i in reversed(range(min(M,N-now))):
            i += 1
            if s[now+i] == "0":
                now += i
                ans.append(i)
                break
            if i == 1:
                print(-1)
                exit()
        
    print(*reversed(ans))
        
if __name__ == "__main__":
    main()


Measured memory_bytes: 7080
#include "bits/stdc++.h"
using namespace std;
#define OUT(x) cout << #x << " = " << x << endl
#define rep(i, n)             for (int (i) = 0; (i) < (int)(n); (i)++)
#define rer(i, l, r)          for (int (i) = (int)(l); (i) <= (int)(r); (i)++)
#define reu(i, l, r)          for (int (i) = (int)(l); (i) < (int)(r); (i)++)
#define all(x)                (x).begin(), (x).end()
#define rall(x)               (x).rbegin(), (x).rend()
template<typename T> void pv(T a, T b) { for (T i = a; i != b; i ++) cout << *i << " "; cout << endl; }
template<typename T, typename U> inline void amin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if (x < y) x = y; }
int in() { int x; scanf("%d", &x); return x; }
long long lin() { long long x; scanf("%lld", &x); return x; }

int n;
int a[101010];
int b[101010];
int m[202020];
int cnt;
int c[202020];
vector<int> g[202020];
bool v[202020];

void dfs(int a) {
        v[a] = true;
        rep(i, g[a].size()) if (!v[g[a][i]]) dfs(g[a][i]);
}


signed main() { 
        cin >> n;
        int s = 0;
        rep(i, n) {
                cin >> a[i];
                s ^= a[i];
        }
        a[n] = s;
        s = 0;
        rep(i, n) {
                cin >> b[i];
                s ^= b[i];
        }
        b[n] = s;
        rer(i, 0, n) { 
                m[++ cnt] = a[i];
                m[++ cnt] = b[i];
        }

        //座圧
        sort(m + 1, m + cnt + 1);
        rer(i, 0, n) {
                a[i] = lower_bound(m + 1, m + cnt + 1, a[i]) - m;
                b[i] = lower_bound(m + 1, m + cnt + 1, b[i]) - m;
        }
        //rer(i, 0, n) cout << a[i] << ' ';
        //cout << endl;
        //rer(i, 0, n) cout << b[i] << ' ';
        //cout << endl;

        //同じ集合になっているかをチェックする
        rer(i, 0, n) { 
                c[a[i]] ++;
                c[b[i]] --;
        }
        rer(i, 0, cnt) {
                if (c[i]) {
                        cout << -1 << endl;
                        return 0;
                }
        }

        int ans = 0;
        rer(i, 0, n) {
                if (a[i] != b[i]) { 
                        g[a[i]].push_back(b[i]);
                        ans ++;
                }
        }
        rer(i, 1, cnt) {
                if (!v[i] && !g[i].empty()) {
                        dfs(i);
                        ans ++;
                }
        }
        if (!g[a[n]].empty()) ans --;
        if (a[n] != b[n]) ans --;
        cout << ans << endl;
        return 0;
}               



Measured memory_bytes: 15360
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <cassert>
#include <numeric>
#include <functional>
#include <cassert>
//#include <numeric>
#pragma warning(disable:4996) 
 
typedef long long ll;
typedef unsigned long long ull;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF  9223300000000000000
#define LINF2 1223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;


void solve()
{
    ll x;
    scanf("%lld", &x);

    double a = 100;
    int i;
    for (i = 0; i < 10000000; i++) {
        a *= 1.01;
        a = floor(a);
        if (a >= x) {
            printf("%d\n", i+1);
            return;
        }
    }

    return;
}

int main(int argc, char* argv[])
{
#if 1
    solve();
#else
    int T;
    scanf("%d", &T);
    int t;
    for(t=0; t<T; t++) {
        //printf("Case #%d: ", t+1);
        solve();
    }
#endif
    return 0;
}



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

int main(){
  
  while(1){
    int a, b;
    string op;
    cin>>a>>op>>b;
    if(op == "?") break;
    
    int ans;
    if(op == "+") ans = a + b;
    if(op == "-") ans = a - b;
    if(op == "*") ans = a * b;
    if(op == "/") ans = a / b;
    
    cout<<ans<<endl;
  }
  return 0;
}



Measured memory_bytes: 3124
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
 
 
int main() {
    int a,b;
    cin >>a>>b;
    cout << max(a+b,max(2*a-1,2*b-1)) <<endl;
}

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

#define REP(i,n) for(int i = 0; i < n; i++)
#define ll long long
#define PI 3.141592653589

using namespace std;

int main(void){
    string S; cin >> S;
    int ans;

    if(S == "SUN") ans = 7;
    else if(S == "MON") ans = 6;
    else if(S == "TUE") ans = 5;
    else if(S == "WED") ans = 4;
    else if(S == "THU") ans = 3;
    else if(S == "FRI") ans = 2;
    else ans = 1;
    
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//絶対値
long long int change_plus(long long int a) {
	if (a < 0) { return -a; }
	if (a >= 0) { return a; }
}
//大小比較(大)
long long int big(long long int a, long long int b) {
	if (a >= b) {
		return a;
	}
	else {
		return b;
	}
}

//大小比較(小)
long long int small(long long int a, long long int b) {
	if (a >= b) {
		return b;
	}
	else {
		return a;
	}
}

int main() {
	long long int n, m, k,p;
	char str[30],str2[15],str3[15];
	scanf("%lld %c%lld",&n,&str[0],&m);
	if (str[0] == '+') { n += m; }
	if (str[0] == '-') { n -= m; }
		printf("%lld",n);
	
}

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

int main()
{
    while (1) {
        int n, x, cnt = 0;
        cin >> n >> x;
        if (n == 0 && x == 0)
            break;
        for (int i = 1; i <= n - 2; i++)
            for (int j = i + 1; j <= n - 1; j++)
                for (int k = j + 1; k <= n; k++)
                    if (i + j + k == x)
                        cnt++;
        cout << cnt << endl;
    }
}


Measured memory_bytes: 3092
import java.util.*;
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		double n = Double.parseDouble(br.readLine());
		String[] s = br.readLine().split(" ");
		int[] arr = new int[4];
		for (int q = 0; q < n; q++) {
			arr[Integer.parseInt(s[q])]++;
		}
		
		int m1 = arr[1] + arr[2] + arr[3];
		int m2 = arr[2] + arr[3];
		int m3 = arr[3];
		
		int t = (int) n + 1;
		double 	[][][] dp = new double[t][t][t];
		for (int k = 0; k <= m3; k++) {
			for (int j = 0; j <= m2-k; j++) {
				for (int i = 0; i <= m1-j-k; i++) {
//					System.out.println(i + " " + j + " " + k);
					if (i == 0 && j == 0 && k == 0)
						continue;

					int sum = i + j + k;
					dp[i][j][k] = n / sum;

					if (i != 0)
						dp[i][j][k] += (double) dp[i - 1][j][k] * i / sum;
					if (j != 0)
						dp[i][j][k] += (double) dp[i + 1][j - 1][k] * j / sum;
					if (k != 0)
						dp[i][j][k] += (double) dp[i][j + 1][k - 1] * k / sum;
				}
			}
		}

		System.out.println(dp[arr[1]][arr[2]][arr[3]]);

	}

}


Measured memory_bytes: 303956
#include <bits/stdc++.h>
#pragma GCC optimize("O999")
//示例：#define ll long long
//unsigned long long ;
const int INF=0x3f3f3f3f;
const int maxn=50000005;
using namespace std;

int main(){
	//freopen(".in", "r",stdin );
	//freopen(".out","w",stdout);
	ios::sync_with_stdio(0);
	string s;
	cin >> s;
	if(s[2]==s[3] && s[4]==s[5])
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 256
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
cnt = 0
for i in range(0, N):
	A = list(map(int, input().split()))
	sum = C
	for j in range(0, M):
		sum += A[j]*B[j]
	if sum > 0:
		cnt += 1
print(cnt)

Measured memory_bytes: 38384
#include<iostream>
#include<map>
using namespace std;
string s,t;int n;
bool f;
map<string,int>M;
main()
{
	cin>>n;
	cin>>s;
	M[s]=1;
	for(int i=1;i<n;i++)
	{
		cin>>t;
		f|=M[t];
		M[t]=1;
		f|=s.back()!=*t.begin();
		s=t;
	}
	cout<<(f?"No":"Yes")<<endl;
}


Measured memory_bytes: 256