akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<ll,ll,ll> T;
const long long INF = 1LL<<60;
const int MOD = 1000000000+7;
#define rev(s) (string((s).rbegin(), (s).rend()))
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };
// cout << fixed << setprecision(10) << ans << endl; 有効桁数指定
// *min_element(c + l, c + r) *max_element(c + l, c + r) 配列の中のmin-max
// int dx[8]={1,1,0,-1,-1,-1,0,1};
// int dy[8]={0,1,1,1,0,-1,-1,-1};
// int dx[4]={1,0,-1,0};
// int dy[4]={0,1,0,-1};
// ~ は、-1の時だけfalse
// struct Edge {
//   int to, id;
//   Edge(int a, int b): to(a), id(b) {}
// };

ll dp[10010][2][110];


int main(int argc, char const *argv[])
{
	string s;int d;cin>>s>>d;

	int n = (int)s.size();


	dp[0][0][0]=1;


	rep(i,n) {
		rep(j,2) {
			rep(k,d) {
				int e = s[i]-'0';
				if (j==0) {
					dp[i+1][0][(k+e)%d]+=dp[i][j][k];
					dp[i+1][0][(k+e)%d]%=MOD;
					if (e>=1) {
						rep(l,e) {
							dp[i+1][1][(k+l)%d]+=dp[i][j][k];
							dp[i+1][1][(k+l)%d]%=MOD;
						}
					}
				} else {
					rep(l,10) {
						dp[i+1][1][(k+l)%d]+=dp[i][j][k];
						dp[i+1][1][(k+l)%d]%=MOD;
					}
				}
			}
		}
	}

	cout<<(dp[n][0][0]+dp[n][1][0]-1+MOD)%MOD<<endl;


	return 0;
}

Measured memory_bytes: 17408
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

int main(void) {

	// TODO: submit前にprintf-debugの削除確認！
	int n;
	cin >> n;

	int h = n/100;
	int d = (n/10)%10;
	int c = n%10;
	
	if(h == d && h== c) {
		cout << n;
	} else {
		if(h == d) {
			if(d > c) {
				cout << (d*100+d*10+d);
			} else {
				cout << (d*100+d*10+d + 111);
			}
		} else if(h > d) {
				cout << (h*100+h*10+h);
		} else {
				cout << (h*100+h*10+h + 111);
		}
	}
	return 0;
}



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

using namespace std;

int main(void)
{
	string s,t;
	cin>>s;
	int len = s.size();
	int i;
	for(i = 0; i < len; i++){
		s[i] = 'x';
	}
	cout<<s<<endl;
	
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Math;
class Z { static void Main() => new K(); }
class K
{
	int F => int.Parse(Str);
	long FL => long.Parse(Str);
	int[] G => Strs.Select(int.Parse).ToArray();
	long[] GL => Strs.Select(long.Parse).ToArray();
	double[] GR => Strs.Select(double.Parse).ToArray();
	string Str => ReadLine();
	string[] Strs => Str.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
	const int MOD = 1000000007;
	const long INFL = 4011686018427387913L;
	public K()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		Out.Flush();
	}
	void Solve()
	{
		var I = G;
		int N = I[0], K = I[1];
		var dp = new bool[K + 1];
		var a = G;
		dp[0] = false;
		for (var i = 1; i <= K; i++)
		{
			dp[i] = false;
			foreach (var x in a) if (i >= x) dp[i] |= !dp[i - x];
		}
		WriteLine(dp[K] ? "First" : "Second");
	}
}


Measured memory_bytes: 13288
#include <iostream>
#include <stdio.h>
#include <numeric>
#include <algorithm>
using namespace std;
int main(){
    while(true){
        int m,f,r;
        cin>>m>>f>>r;
        if(m==-1&&f==-1&&r==-1){
            return 0;
        }
        if(m==-1||f==-1){
            cout<<"F"<<endl;
        }
        else{
            if(m+f>=80){
                cout<<"A"<<endl;
            }
            else if(m+f>=65){
                cout<<"B"<<endl;
            }
            else if(m+f>=50){
                cout<<"C"<<endl;
            }
            else if(m+f>=30){
                if(r>=50){
                    cout<<"C"<<endl;
                }
                else{
                    cout<<"D"<<endl;
                }
            }
            else{
                cout<<"F"<<endl;
            }
        }
    }
}



Measured memory_bytes: 3132
/*
If you want to shine like a sun, first burn like a sun.
*/

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define vpi vector<ppi>
#define vpl vector<ppl>
#define all(x) x.begin(),x.end()
#define ii int,int 
#define ff first    
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define imx INT_MAX
#define imn INT_MIN
#define inf 9000000000000000000
#define minf -inf
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse 
#define itr iterator 
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793
#define MAXN 100005
#define test1(x) cout << #x " = " << x << endl;
#define test2(x,y) cout << #x " = " << x << " " << #y " = " << y << endl;
const ll infinity = 9e18;

/*
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/


int main()
{
    fast

/*
    #ifndef ONLINE_JUDGE
        freopen("input.txt",  "r",  stdin);
        freopen("output.txt", "w", stdout);
    #endif
//*/

        
	ll n,a,b;
	cin>>n>>a>>b;

	ll ans = inf;

    if((b-a)%2 == 0)
    {
    	ans = min(ans,(b-a)/2);
    }    
    else
    {
    	ll x = a-1 + 1 + (b-a)/2;
    	ll y = n-b + 1 + (b-a)/2;
    	ans = min(x,y);	
    }

    cout<<ans;    












    return 0;
}

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

using namespace std;


int main() {
     
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); 
    int n;
    scanf("%d",&n);
    int a[n],i;
    for(i=0;i<n;++i)
         scanf("%d",&a[i]);
  
    int cnt1=0,cnt2=0;
    for(i=0;i<n-1;++i)
    {
      if(a[i]==a[i+1])
        {cnt1++;
          i++;
        }
      
    }
  
   for(i=n-1;i>=0;--i)
   {
      if(a[i]==a[i-1])
      {
        cnt2++;
        i--;
      }
   }
  
   if(cnt1>=cnt2)
       printf("%d",cnt2);
  
  else
     printf("%d",cnt1);
    
	return 0;
}

Measured memory_bytes: 256
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

def main():
    N, X = map(int, input().split())
    L_l = [int(x) for x in input().split()]

    h = 0
    ans = 1
    for l in L_l:
        h = h + l
        if h > X:
            break
        else:
            ans = ans + 1

    print(ans)





# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc130","b",main)

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
typedef long long ll;
int main(){
	ll n,m;
	cin >> n>>m;
	cout << min((n*2+m)/4, m/2) << endl;
	
	return 0;
}


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

int count(int n0) {
  int c = 0;
  int n = n0;
  while(true) {
    if(n%2 == 0) {
      c++;
      n /= 2;
    } else break;
  }
  return c;
}

int main() {
  int n,min;
  cin >> n;
  int A[n];
  min = 100000;
  for(int i = 0;i < n; i++) {
    cin >> A[i];
  }
  for(int i = 0;i < n;i++) {
    if(min > count(A[i]))
      min = count(A[i]);
  }
  cout << min << endl;
  return 0;
}

Measured memory_bytes: 256
import sys

n = 1000000
a = [True] * n
a[0] = False
for i in range(2,n):
	if(a[i-1]):
		for j in range(i**2-1, n, i):
			a[j] = False
p = set(i[0]+1 for i in enumerate(a) if i[1])

for s in sys.stdin:
	a,d,n = map(int,s.split())
	if a == 0:
		exit()
	c = 0
	while c != n:
		if a in p:
			c += 1
		b = a
		a += d
	print(b)

Measured memory_bytes: 59500
#include <iostream>
#include <map>

using namespace std;

int main()
{
	int n, m;
	cin >> n;
	map<int, int> d;
	int a;
	for (int i = 0; i < n; i++) {
		cin >> a;
		d[a]++;
	}
	cin >> m;
	map<int, int> t;
	for (int i = 0; i < m; i++) {
		cin >> a;
		t[a]++;
	}

	for (auto & i : t) {
		if (i.second > d[i.first]) {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;

	return 0;
}

Measured memory_bytes: 18944
a=[]
b=[]
n,m=map(int,input().split())
for i in range(n):
	a.append(input())
for i in range(m):
	b.append(input())

for i in range(n-m+1):
	for j in range(n-m+1):
		cnt=0
		for x in range(m):
			for y in range(m):
				if b[x][y]!=a[i+x][j+y]:
					break
				else:
					cnt+=1
		if cnt==m**2:
			print("Yes")
			exit()
print("No")

Measured memory_bytes: 3064
import sys
read = sys.stdin.buffer.read

from collections import deque

N,C,*H = map(int,read().split())

dp = [0] * N
funcs = deque() # ax + b

def add(i):
    h = H[i]
    a3,b3 = -2*h,h*h+dp[i]
    while len(funcs) >= 2:
        a1,b1 = funcs[-2]
        a2,b2 = funcs[-1]
        if (a2-a1)*(b3-b2) < (b2-b1)*(a3-a2):
            break
        funcs.pop()
    funcs.append((a3,b3))

def get_min(x):
    a,b = funcs[0]
    y = a*x+b
    while len(funcs) >= 2:
        a2,b2 = funcs[1]
        y2 = a2*x+b2
        if y < y2:
            break
        y = y2
        funcs.popleft()
    return y

add(0)
for i,h in enumerate(H[1:],1):
    dp[i] = get_min(h) + h*h + C
    add(i)

answer = dp[-1]
print(answer)


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

int main(){
    int N;
    cin >> N;
    vector<int> weight(N,0);
    int allsum = 0;
    for(int i=0;i<N;i++){
        cin >> weight[i];
        allsum += weight[i];
    }
    int tmpsum = 0;
    int mindiff = abs((allsum - weight[0]) - weight[0]);
    for(int i=0;i<N;i++){
        tmpsum += weight[i];
        int diff = abs((allsum - tmpsum) - tmpsum);
        if(mindiff > diff) mindiff = diff;
    }
    cout << mindiff << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  int W, H;
  int N;
  int tmp;
  int cnt = 0;
  
  cin >> W;
  cin >> H;
  cin >> N;
  
  if(W <= H){
    tmp = H;
  }
  else{
    tmp = W;
  }
  
  while(N > 0){
    N -= tmp;
    cnt++;
  }
  
  cout << cnt << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define POF pop_front
#define POB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
#define VP vector<PA>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=1e9+7;
//
struct pol{
	int X;int Y;int Z;
  bool operator<(const pol&R)const{
		return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
	}
};
//
int main(){
	int N;
	int P[100];
	cin>>N;
	FOR(i,0,N){
		cin>>P[i];
	}
	sort(P,P+N);
	int now=P[N-1];
	while(1){
		if(N-(lower_bound(P,P+N,now)-P)>=now){
			cout<<now<<endl;
			break;
		}else{
			now--;
		}
	}
	return 0;
}



Measured memory_bytes: 3144
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <cstring>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; i++)
#define rep(i,b) Rep(i,0,b)
#define rrep(i,a) for(int i = a; i >= 0; i--)
#define allof(a) (a).begin(), (a).end()

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1ll << 60ll;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

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

	ll n, m;
	cin >> n >> m;
	vector<ll> x(m);
	rep(i, m) cin >> x[i];

	if (n >= m) {
		cout << 0 << endl;
		return 0;
	}

	sort(allof(x));

	vector<ll> d(m - 1);
	Rep(i, 1, m) {
		d[i - 1] = x[i] - x[i - 1];
	}

	sort(allof(d), greater<ll>());

	ll ans = 0;
	rep(i, m - 1) {
		ans += d[i];
	}

	rep(i, n - 1) {
		ans -= d[i];
	}

	cout << ans << endl;
}

Measured memory_bytes: 1792
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define MOD 1000000007
#define INF 1e9
#define PIE 3.14159265358979323

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>
T GCD(T a, T b) {
    if (b == 0)
        return a;
    else
        return GCD(b, a % b);
}
template <class T>
inline T LCM(T a, T b) {
    return (a * b) / GCD(a, b);
}

using namespace std;
//#inculude <bits/stdc++.h>
#define int long long

signed main() {
    string s;
    cin >> s;
    int n = s.size();
    while (true) {
        s.pop_back();
        s.pop_back();
        n -= 2;
        string s1 = s.substr(0, n / 2);
        string s2 = s.substr(n / 2, n / 2);
        if (s1 == s2)
            break;
    }
    cout << n << endl;
}

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

int n,m;
int check[30];
int A[30];
int type = 0;

int main(){
	cin >> n >> m;
	int c;
	for(int i=0; i<n; ++i){
		cin >> c;
		for(int j=0; j<c; ++j){
			cin >> A[j];
		}

		for(int k=0; k<c; ++k){
			++check[A[k]-1];
		}
	}
	
	for(int i=0; i<30; ++i){
		if(check[i]==n){
			++type;
		}
	}
	
	cout << type ;
	
	return 0;
}

Measured memory_bytes: 256
x = [input() for i in range(2)]
S = x[0]
T = x[1]
moji = len(T)

for a in range(len(S) - len(T) + 1):
  count = 0
  for b in range(len(T)):
    
    if S[a+b] != T[b]:
      count += 1
  if count < moji:
    moji = count

print(moji)

Measured memory_bytes: 9124
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define st first
#define sc second
#define arr array
#define yes cout << "Yes" <<"\n"
#define no cout << "No" <<"\n"
#define lb lower_bound
#define ub upper_bound
#define fast ios_base::sync_with_stdio(false)
#define out cin.tie(nullptr)
#define task "A"
#define open(task)  if(fopen(task".inp", "r")){freopen(task".inp", "r", stdin); freopen(task".out", "w", stdout);}
#define open_to_check(task)  if(fopen(task".inp", "r")){freopen(task".inp", "r", stdin);}
#define int64 long long

const int maxn = 1e6 + 40;
const int maxN = 1e5 + 5;
const ll mod = 1e9 + 7;

using namespace std;

/// Count : 1

ll a[maxn + 60];
ll can[maxn + 60];
vector<int>adj[maxn];

int main()
{
    //if(fopen(task".inp", "r")){
        //freopen(task".inp", "r", stdin);
        //freopen(task".out", "w", stdout);
    //}
    fast;
    out;
    int n;
    cin >> n;
    for(int i=1; i<=n; i++){
        cin >> a[i];
    }

    for(int i=2; i<=maxn - 40; i++){
        if(adj[i].size() == 0){
            adj[i].pb(i);
            for(int j=2*i; j<=maxn - 40; j+=i){
                if(i != 1) adj[j].pb(i);
            }
        }
    }

    ll g = 0;
    bool chk = true;
    for(int i=1; i<=n; i++){
        g = __gcd(g, a[i]);
        if(can[a[i]] == 1){
            chk = false;
        }
        if(chk == true){
        for(auto j : adj[a[i]]){
           for(int j1=j; j1<=maxn - 40; j1 += j){
               can[j1] = 1;
           }
        }
        }
    }
    if(chk == true){
        cout << "pairwise coprime";
        return 0;
    }
    if(g == 1){
        cout << "setwise coprime";
        return 0;
    }
    cout << "not coprime";
}


Measured memory_bytes: 74564
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll                long long int
#define ld                long double
#define pb                push_back
#define mk                make_pair
#define in(i,a,n)         for(ll i=0;i<n;++i) cin>>a[i];
#define out(i,a,n)        for(ll i=0;i<n;++i) cout<<a[i]<<" ";
#define sz(c)             (ll)c.size()
#define all(c)            c.begin(), c.end()
#define rall(c)           c.rbegin(), c.rend()
#define loop(i,a,b)       for(ll i=a;i<b;i++)
#define rloop(i,a,b)      for(ll i=a;i>b;i--)
#define F                 first
#define S                 second
#define copy(a,b)         copy(all(a),back_inserter(b));
#define intersect(a,b,w)    set_intersection(a.begin(), a.end(),b.begin(), b.end(),back_inserter(w));
#define union(a,b,w)      set_union(a.begin(), a.end(),b.begin(), b.end(),back_inserter(w));
#define diff(a,b,w)       set_difference(a.begin(), a.end(),b.begin(), b.end(),back_inserter(w));
#define symdiff(a,b,w)    set_symmetric_difference(a.begin(), a.end(),b.begin(), b.end(),back_inserter(w));
const ll N=300001;
const ll MOD = 1000 * 1000 * 1000 + 7;
ll mod(ll n) {
    return (n % MOD + MOD) % MOD;
}

void solve(){
    ll n, k = 0, i, x, y;
    cin >> n;
    map<ll,ll> mp;
    loop(i,0,n-1){
        cin >> k;
        mp[k]++;
    }
    loop(i,1,n+1){
        cout << mp[i] << "\n";
    }
}

signed main(){
    //fin fout
    fast
    ll t=1; //cin>>t;
    while(t--) solve();
}  

Measured memory_bytes: 16160
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define debug(x) cout << #x << " = " << (x) << endl;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
//cout << fixed << setprecision(10);

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

int main () {
  int a, b, c;
  cin >> a >> b >> c;
  int m = max({a,b,c});
  int x;
  3*m%2==(a+b+c)%2 ? x = m : x = m+1;
  cout << (3*x-(a+b+c))/2 << endl;
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include<queue>
#include <cmath>
#include <complex>
#include<map>
#include <string>
#include<iostream>
#include<bits/stdc++.h>


#define pi 3.141592654
#define forr(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define input ios_base::sync_with_stdio(0);cin.tie(0);


using namespace std;
typedef pair<double,double>pdd;
typedef long long  ll;
typedef pair<ll, ll>pii;
typedef complex<double> point;
//template<typename T>T gcd(T x, T y) { if(y == 0)return x; else return gcd(y, x%y); }
//typedef bitset<30> mask;
//int x[8]={1,0,0,-1,-1,-1,1,1};
//int y[8]={0,1,-1,0,-1,1,-1,1};
//#define var(x) ((x)<<1)
//#define nvar(x) ((x)^1)

/*typedef complex< double> point;

#define X real()
#define Y imag()
#define angle(a)                (atan2((a).imag(), (a).real()))
#define vec(a,b)                ((b)-(a))
#define same(p1,p2)             (dp(vec(p1,p2),vec(p1,p2)) < EPS)
#define dp(a,b)                 ( (conj(a)*(b)).real() )	// a*b cos(T), if zero -> prep
#define cp(a,b)                 ( (conj(a)*(b)).imag() )	// a*b sin(T), if zero -> parllel
#define length(a)               (hypot((a).imag(), (a).real()))
#define normalize(a)            (a)/length(a)
//#define polar(r,ang)            ((r)*exp(point(0,ang)))  ==> Already added in c++11
#define rotateO(p,ang)          ((p)*exp(point(0,ang)))
#define rotateA(p,ang,about)  (rotateO(vec(about,p),ang)+about)
#define reflectO(v,m)  (conj((v)/(m))*(m))
*/
const int N=50000,M=1000000;
const double EPS= 1e-9;


ll a,b,c,d;


 int main()
{
//freopen("travel.in","r",stdin);
//freopen("travel.out","w",stdout);
//__builtin_popcount()
input;
int t;
cin>>t;
while(t--)
{
    cin>>a>>b>>c>>d;
    if(a<b||b>d)cout<<"No"<<endl;
    else if(c>=b)cout<<"Yes"<<endl;
    else{
        ll g=__gcd(b,d);
        ll u=(a-c)/g*g;
        u=a-u;
        if(u<b&&u>c)cout<<"No"<<endl;
        else if((u+g)<b&&(u+g)>c)cout<<"No"<<endl;
        else cout<<"Yes"<<endl;
    }
}

return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    static int modP = 1000000007;
    static long inf = 1 << 61;
    static int[] x4 = {-1, 0, 0, 1};
    static int[] y4 = {0, -1, 1, 0};
    static int[] x8 = {-1, -1, 0, 1, 1, 1, 0, -1};
    static int[] y8 = {0, -1, -1, -1, 0, 1, 1, 1};


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int w = in.nextInt();
        int[] V = new int[n];
        int[] W = new int[n];
        for(int i = 0; i < n; i++) {
            V[i] = in.nextInt();
            W[i] = in.nextInt();
        }

        long[][] dp = new long[n+1][w+1];
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < w+1; j++) {
                if(j < W[i]) {
                    dp[i+1][j] = dp[i][j];
                }else{
                    dp[i+1][j] = Math.max(dp[i][j-W[i]] + V[i], dp[i][j]);
                }
            }
        }

        System.out.println(dp[n][w]);
    }

    static public void printArray2D(char[][] map) {
        for(int i = 0; i < map.length; i++) {
            for(int j = 0; j < map[i].length; j++) {
                System.out.format("%c\t", map[i][j]);
            }
            System.out.print("\n");
        }
    }

    static public void printArray2D(int[][] map) {
        for(int i = 0; i < map.length; i++) {
            for(int j = 0; j < map[i].length; j++) {
                System.out.format("%d\t", map[i][j]);
            }
            System.out.print("\n");
        }
    }
}



Measured memory_bytes: 34920
#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;

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 main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n, k;
	cin >> n >> k;

	vector<int> p(n);
	rep(i, n) cin >> p[i];

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

	ll sm = 0;
	rep(i, k) sm += p[i];

	cout << sm << endl;
}


Measured memory_bytes: 3652
import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        String t = sc.next();


        for(int i=0;i<n;i++){
            System.out.print(s.charAt(i));
            System.out.print(t.charAt(i));
        }
                

    } 
}

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

//typedef
typedef long long LL;
typedef unsigned int UINT;
typedef unsigned long long ULL;
typedef set<int, greater<int> > setdownINT;
typedef set<long long, greater<long long> > setdownLL;
typedef priority_queue<int, vector<int>, greater<int> > priqueupINT;
typedef priority_queue<long long, vector<long long>, greater<long long> > priqueupLL;
//container utill
#define ALL(v) (v).begin(),(v).end()
#define sortdown(v) sort((v).begin(),(v).end()), reverse((v).begin(),(v).end())
#define PB(a) push_back(a)
#define MP make_pair
#define MT make_tuple
//constant
#define PI 3.141592653589793

int main(){
    //input
    LL N;
    cin >> N;
    LL A[N], B[N];
    LL i;
    vector<pair<LL,LL> > vec;
    for(i=0; i<N; i++){
        cin >> A[i] >> B[i];
        vec.PB(MP(A[i]+B[i],i));
    }

    //calc
    sortdown(vec);
    vector<LL> taka, aoki;
    for(i=0; i<N; i++){
        if(i%2==0){
            taka.PB(vec[i].second);
        }else{
            aoki.PB(vec[i].second);
        }
    }
    LL ans=0;
    for(i=0; i<taka.size(); i++){
        ans+=A[taka[i]];
    }
    for(i=0; i<aoki.size(); i++){
        ans-=B[aoki[i]];
    }

    //output
    cout << ans << endl;
    system("pause");
    return 0;
}

Measured memory_bytes: 7604
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(unsigned long long x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
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(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

//    x    y    in
ll py[101][101][100];

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n;
    cin >> n;
    vll h(n);
    ll x, y;
    rep(i, n){
        ll ht;
        cin >> x >> y >> ht;
        h[i] = ht;
        rep(p, 101){
            rep(q, 101){
                py[p][q][i] = ht+abs(x-p)+abs(y-q);
            }
        }
    }
    rep(i, 101){
        rep(j, 101){
            bool f = 1;
            ll x;
            rep(k, n){
                if(h[k] > 0){
                    x = py[i][j][k];
                    break;
                }
            }
            rep(k, n){
                if(h[k] > 0 && py[i][j][k] != x){
                    f = 0;
                    break;
                }
                if(h[k] == 0 && py[i][j][k] < x){
                    f = 0;
                    break;
                }
            }
            if(f){
                cout << i << " " << j << " " << x << endl;
                return 0;
            }
        }
    }
    return 0;
}

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

int main()
{
	int n, m, a[100], b[100], c, d, e, f, r, s, t;
	const int INF = 10000000;

	while (cin >> n >> m && n && m)
	{
		for (int i = c = 0; i < n; ++i)
		{
			cin >> a[i];
			c += a[i];
		}
		for (int i = d = 0; i < m; ++i)
		{
			cin >> b[i];
			d += b[i];
		}

		t = INF;
		for (int i = 0; i < n; ++i)
		{
			for (int j = 0; j < m; ++j)
			{
				e = c, f = d;
				if (a[i] < b[j])
				{
					e += b[j]-a[i];
					f -= b[j]-a[i];
				}
				else if (a[i] > b[j])
				{
					e -= a[i]-b[j];
					f += a[i]-b[j];
				}
				if (e == f && e+f < t)
					r = a[i], s = b[j], t = e+f;
			}
		}
		if (t == INF) cout << -1 << endl;
		else cout << r << " " << s << endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,arr[105]={},a,s=0,c=0;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        s+=arr[i];
    }
    a=round((double)s/n);
    for(int i=0;i<n;i++)
    {
        c+=pow((arr[i]-a),2);
    }
    cout<<c;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cmath>
#include <string>
#include <string.h>
#include <stack>
#include <queue>
#include <map>
#include <stdlib.h>
#include <set>
typedef long long ll;
using namespace std;

int main() {
	int a,b,c,d,w1,w2;
	cin>>a>>b>>c>>d;
	w1=a-c;
	w2=b-d;
	cout<<c+w2<<" "<<d-w1<<" "<<a+w2<<" "<<b-w1<<endl;
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
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 (b<a) { a=b; return 1; } return 0; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}



signed main(){
  int n;
  cin >>n;
  int i=0;
  bool h=false;
  while(i*4<=n){
    int ans = n-i*4;
    if(ans%7==0) h=true;
    i++;
  } 
  cout << (h ? "Yes" : "No") fin;
  
  return 0;
}



struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;



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

#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define RFOR(i, a, b) for(int i=(a); i>=(b); i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define CEIL(n, m) ceil(n/pow(10.0, m))*pow(10.0, m)
#define FLOOR(n, m) floor(n/pow(10.0, m))*pow(10.0, m)
#define ROUND(n, m) round(n/pow(10.0, m))*pow(10.0, m)
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).begin(),(x).end(),greater<int>())
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define llong long long
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) " (L" << __LINE__ << ") " << __FILE__ << endl;

void solve()
{

  int a, b, t;
  cin >> a >> b >> t;

  cout << (t/a)*b << endl;
}

int main()
{
  solve();
  return 0;
}


Measured memory_bytes: 256
L,R = map(int,input().split())

mod = 10**9+7
m = 64 +1
fac = [1]*m
ninv = [1]*m
finv = [1]*m
for i in range(2,m):
    fac[i] = fac[i-1]*i%mod
    ninv[i] = (-(mod//i)*ninv[mod%i])%mod
    finv[i] = finv[i-1]*ninv[i]%mod

def comb(n,k):
    return (fac[n]*finv[k]%mod)*finv[n-k]%mod

def f(L,R):
    if L>R : return 0
    R = bin(R)[2:]
    N = len(R)
    ret = f(L,int("0"+"1"*(N-1),2))
    L = bin(L)[2:]
    if len(L) != N : L = "1"+"0"*(N-1)
    for i in range(N):
        if R[i] == "0" : continue
        R2 = R[:i] + "0" + "?"*(N-i-1)
        if i==0: R2 = R
        for j in range(N):
            if L[j] == "1" and j!=0 : continue
            L2 = L[:j] + "1" + "?"*(N-j-1)
            if j==0 : L2 = L
            if L2[0] == "0" : break
            tmp = 1
            for r,l in zip(R2[1:],L2[1:]):
                if r=="0" and l=="1" : tmp *= 0
                if r=="?" and l=="?" : tmp *= 3
                if r=="?" and l=="0" : tmp *= 2
                if r=="1" and l=="?" : tmp *= 2
                tmp %= mod
            ret += tmp
            ret %= mod
    return ret%mod

print(f(L,R))

Measured memory_bytes: 3188
use proconio::{input, fastout};
use std::collections::HashSet;
#[fastout]
fn main() {
  input!{
    n:usize,
    m:usize,
    a:[usize;m]
  }
  let mut can = a.into_iter().collect::<HashSet<usize>>();
  let mut note = vec![0; n+1];
  let mut ans = 0;
  let mod_num = 1_000_000_007;
  note[0] = 1; if !(can.contains(&1)){note[1] = 1}
  for i in 2..=n {
      if !(can.contains(&i)) {
        note[i] += note[i-1] + note[i-2];
        note[i] %= mod_num;
      }
  }
  println!("{}",note[n]);
}


Measured memory_bytes: 4556
#include <bits/stdc++.h>
using namespace std;
int main () {
  //input
  int n,k,q;
  cin >> n >> k >> q;

  vector<int> a(q);
  for (int i = 0; i < q; i++ ) {
    cin >> a.at(i);
  }

  vector <int> point(n,k-q);
  int tmp;
  for (int i = 0; i < q; i++ ) {
    tmp = a.at(i);
    point.at(tmp-1)++;
  }

  for (int i = 0; i < n; i++ ) {
    if(point.at(i) > 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  
}


Measured memory_bytes: 1408
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <map>
#include <vector>
#include <queue>
using namespace std;
const int N=1e5+10,INF=0x3f3f3f3f;
typedef pair<int,int>P;
typedef vector<int>::iterator ive;
long long step[N];
int k;
map<int,vector<int> >m;
map<P,int>mmp;
void bfs(){
    queue<int>q;
    q.push(k);
    step[k]=0;
    while(!q.empty()){
        int now=q.front();
        q.pop();
        for(ive it=m[now].begin();it!=m[now].end();it++){
            if(step[now]+mmp[P(max(*it,now),min(*it,now))]<step[*it]){
                step[*it]=step[now]+mmp[P(max(*it,now),min(*it,now))];
                q.push(*it);
            }


        }
    }
}
int main()
{
    int n,a,b,c,q,x,y;
    while(~scanf("%d",&n)){
        memset(step,INF,sizeof(step));
        m.clear();
        mmp.clear();
        n--;
        while(n--){
            scanf("%d%d%d",&a,&b,&c);
            m[a].push_back(b);
            m[b].push_back(a);
            mmp[P(max(a,b),min(a,b))]=c;
        }
        scanf("%d%d",&q,&k);
        bfs();
        while(q--){
            scanf("%d%d",&x,&y);
            printf("%lld\n",step[x]+step[y]);
        }
    }
    return 0;
}


Measured memory_bytes: 20088
#include <cstdio>
#include <numeric>
#include <iostream>
#include <vector>
#include <set>
#include <cstring>
#include <string>
#include <map>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <queue>
#include <sstream>
#include <deque>
#include <cassert>

using namespace std;

#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i = 0; i < (n); i++)
#define re return
#define fi first
#define se second
#define sz(x) ((int) (x).size())
#define all(x) (x).begin(), (x).end()
#define sqr(x) ((x) * (x))
#define sqrt(x) sqrt(abs(x))
#define y0 y3487465
#define y1 y8687969
#define fill(x,y) memset(x,y,sizeof(x))
#define prev PREV
                         
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef double D;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<vi> vvi;

template<class T> T abs(T x) { re x > 0 ? x : -x; }

int n;
int m;
int p[200000];
int q[200000];

int main () {
	scanf ("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf ("%d", &p[i]); p[i]--;
		q[p[i]] = i;
	}
	int cur = 0, ans = 0;
	for (int i = 0; i < n; i++) {
		if (i == 0 || q[i - 1] > q[i]) cur = 0;
		cur++;
		ans = max (ans, cur);
	}
	printf ("%d\n", n - ans);
	return 0;
}

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

typedef long long intt;

int main()
{
        int n;
        cin>>n;
        int a[n];
        for(int i=0;i<n;i++)
        {
            cin>>a[i];
        }
        //cout << 0;
        vector<int> dp (100000);
        dp[0]=0;
        dp[1]=abs(a[0]-a[1]);
        dp[2]=min(abs(a[0]-a[2]),dp[1]+abs(a[1]-a[2]));
        for(int i=3;i<n;i++)
        {
            dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i-2]-a[i]));
        }
        /*for(int i=0;i<n;i++)
        {
            cout<<dp[i]<<" ";
        }
*/
        cout<<dp[n-1]<<" ";

	return 0;
}
/**
2
aaa
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
abab
1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
*/


Measured memory_bytes: 3976
import sys
from io import StringIO
import unittest
import os

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 実装を行う関数
def resolve(test_def_name=""):
    x = input()

    if x.__contains__("RRR"):
        print(3)
        return
    if x.__contains__("RR"):
        print(2)
        return

    if x.__contains__("R"):
        print(1)
        return

    print(0)
    return


# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """RRS"""
        output = """2"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """SSS"""
        output = """0"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """RSR"""
        output = """1"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main()


Measured memory_bytes: 70856
#include<stdio.h>

int main(){
    int N;
    scanf("%d", &N);
  	int d[N];
    for(int i = 0; i < N; i++) scanf("%d", &d[i]);
    int sum = 0;
    for(int i = 0; i < N; i++){
        for(int j = i + 1; j < N; j++){
            if(i < j){
                sum += d[i]*d[j];
            }
        }
    }
    printf("%d", sum);
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cstdio>
#include<cmath>
#include<deque>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#include<tuple>
#include<utility>
#include<vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef vector<vector<int>> vvi;

#define rep(i, a, n)  for(int i=a; i<n; i++)
#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 PER(i, n) for(int i=(int)(n)-1; i>= 0; i--)
#define PERS(i, n)  for(int i=(int)(n); i>0; i--)
#define FOR(i, c) for(__typeof((c).begin()) i = (c).begin(); i!=(c).end(); i++)
#define RFOR(i, c)  for(__typeof((c).rbegin()) i=(c).rbegin(); i!=(c).end(); i++)
#define ALL(container)  (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) (container).size()
#define FILL0(n)  setfill('0') << right << setw(n)
#define mp(a, b)  make_pair(a, b)
#define toLower(c)  c+0x20
#define toUpper(c)  c-0x20
#define pb  push_back
#define eb  emplace_back

const int INF = 1e9;
const long long LLINF = 1e18;
const int MOD = 1000000007;

int main(){
  int n;  cin >> n;
  string s; cin >> s;
   s = n>=3200? s : "red";
  cout << s << endl;
}


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

using namespace std;

int main() {
  while (true) {
    vector<int> imos(24 * 60 * 60);
    int n;
    cin >> n;
    if (n == 0) {
      break;
    }
    
    for (int i = 0; i < n; i++) {
      string str1, str2;
      cin >> str1 >> str2;
      int t1, t2;
      t1 = ((str1[0] - '0') * 10 + str1[1] - '0') * 3600 +
           ((str1[3] - '0') * 10 + str1[4] - '0') * 60 +
            (str1[6] - '0') * 10 + str1[7] - '0';
      t2 = ((str2[0] - '0') * 10 + str2[1] - '0') * 3600 +
           ((str2[3] - '0') * 10 + str2[4] - '0') * 60 +
            (str2[6] - '0') * 10 + str2[7] - '0';

      imos[t1]++;
      imos[t2]--;
    }
    int ans = 0;
    for (int i = 1; i < 24 * 60 * 60; i++) {
      imos[i] += imos[i - 1];
      ans = max(ans, imos[i]);
    }

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

Measured memory_bytes: 3464
#include <iostream>
#include <vector>
#include <algorithm>

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	std::vector<long> vec;
	int n, q, com, b, e;
	long result;

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif


#if INPUT_FROM_FILE
	ifs >> n;
#else
	std::cin >> n;
#endif
	vec.resize(n, 0);

	for(int i = 0; i < n; i++){
#if INPUT_FROM_FILE
		ifs >> vec[i];
#else
		std::cin >> vec[i];
#endif
	}

#if INPUT_FROM_FILE
	ifs >> q;
#else
	std::cin >> q;
#endif

	for(int i = 0; i < q; i++){
#if INPUT_FROM_FILE
		ifs >> com >> b >> e;
#else
		std::cin >> com >> b >> e;
#endif
		if(com == 0){
			result = *std::min_element(vec.begin() + b, vec.begin() + e);
		}
		else{
			result = *std::max_element(vec.begin() + b, vec.begin() + e);
		}
		std::cout << result << std::endl;

	}

	return 0;
}



Measured memory_bytes: 3104
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_C main
#include "bits/stdc++.h"
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
using psi = pair<string, int>;
// functions

#endif

int N;
int A, B, C;
vi l;
int ans;

void dfs(int n, int a, int b, int c, int cost) {
    if (n >= N) {
        if (a>0 && b>0 && c>0){
            ans = min(ans, cost - 30 + abs(a - A) + abs(b - B) + abs(c - C));
        }
        return;
    }

    dfs(n + 1, a + l[n], b, c, cost+10);
    dfs(n + 1, a, b + l[n], c, cost+10);
    dfs(n + 1, a, b, c + l[n], cost+10);
    dfs(n + 1, a, b, c, cost); // Not used
}

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

    cin >> N;
    cin >> A >> B >> C;
    l = vi(N); REP(i, N) cin >> l[i];
    
    ans = INF;
    dfs(0, 0, 0, 0, 0);

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
// È¥°É£¡Æ¤¿¨Çð! °ÑAC´ø»ØÀ´£¡
//      ¤Ø¡¡¡¡¡¡¡¡¡¡£¯|
// ¡¡¡¡/£Ü7¡¡¡¡¡¡ ¡Ï£ß/
// ¡¡ /¡¡©¦¡¡¡¡ £¯¡¡£¯								AC		AC		AC		AC
//    ©¦¡¡Z £ß,£¼¡¡£¯¡¡¡¡ /`©c						AC		AC		AC		AC
//    ©¦¡¡¡¡¡¡¡¡¡¡©c¡¡¡¡ /¡¡¡¡¡µ					AC		AC		AC		AC
// ¡¡Y¡¡¡¡¡¡¡¡¡¡`¡¡ /¡¡¡¡/  /						AC		AC		AC		AC
// ¡¡Øé¡ñ¡¡.¡¡¡ñ¡¡¡¡¡´¡¡/¡¡/						AC		AC		AC		AC
// ¡¡()¡¡ ¤Ø¡¡¡¡¡¡¡¡|¡¡£Ü¡´							AC		AC		AC		AC
// ¡¡¡¡>- ._¡¡ ¥£¡¡ ©¦ £¯£¯							AC		AC		AC		AC
// ¡¡ / ¤Ø¡¡¡¡ /¡¡/£¼| £Ü£Ü							AC		AC		AC		AC
// ¡¡ ©c_/¡¡¡¡(_£¯¡¡ ©¦£¯£¯							AC		AC		AC		AC
// ¡¡¡¡ 7¡¡¡¡¡¡¡¡¡¡¡¡¡¡|£¯							AC		AC		AC		AC
// ¡¡¡¡ £¾¨Dr£þ£þ`-¨D£ß/							AC		AC		AC		AC
//**************************************Accepted*****************************************//

#include<bits/stdc++.h>

#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define Unique(x) x.erase(unique(all(x)),x.end());

using namespace std;

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

const int Days[]={-1,31,28,31,30,31,30,31,31,30,31,30,31};

inline int read()
{
	#define gc getchar
	int ans=0;
	bool f=1;
	char ch=gc();
	
	while(!isdigit(ch))f^=ch=='-',ch=gc();
	
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	
	return f?ans:-ans;
	
	#undef gc
}

typedef long long ll;

set<pair<int,int> > tg;
int cnth[300010],cntw[300010];
vector<int> xs,ys;

int main(int argc, char const *argv[])
{
	ios::sync_with_stdio(false);
	
	int h,w,m;cin>>h>>w>>m;
	for(int i=0;i<m;i++)
	{
		int x,y;cin>>x>>y;x--,y--;
		
		cnth[x]++,cntw[y]++;
		
		tg.insert(mp(x,y));
	}
	
	int maxh=*max_element(cnth,cnth+h);
	int maxw=*max_element(cntw,cntw+w);
	
	for(int i=0;i<h;i++)if(maxh==cnth[i])xs.pb(i);
	for(int j=0;j<w;j++)if(maxw==cntw[j])ys.pb(j);
	
	int ans=maxh+maxw;
	
	for(int i=0;i<xs.size();i++)for(int j=0;j<ys.size();j++)
	{
		if(tg.count(mp(xs[i],ys[j])))continue;
		
		cout<<ans;return 0;
	}
	
	cout<<ans-1;
	
	//printf("Time used = %.12f",(double)(clock())/CLOCKS_PER_SEC);
	return 0;
}

/*  GOD BLESS  */


Measured memory_bytes: 23724