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

#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;

using f32 = float;
using f64 = double;

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) for(i64 i = 1; i <= n; ++i)
#define RREP(i, n) for(i64 i = n - 1; i >= 0 ; --i)
#define RREPS(i, n) for(i64 i = n; i >= 1; --i)

#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define pb push_back
#define mp make_pair
#define F first
#define S second

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; }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }

template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }


struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;


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

    i64 a;
    if (A == "SUN") {
        a = 0;
    } else if (A == "MON") {
        a = 1;
    } else if (A == "TUE") {
        a = 2;
    } else if (A == "WED") {
        a = 3;
    } else if (A == "THU") {
        a = 4;
    } else if (A == "FRI") {
        a = 5;
    } else if (A == "SAT") {
        a = 6;
    }

    cout << 7 - a << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int inf = INT_MAX;
const ll INF = LLONG_MAX;
const ll MOD = 1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b, const ll mod=MOD) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b, const ll mod=MOD) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b, const ll mod=MOD) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b, const ll mod=MOD) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n; cin >> n;
    vi a(n); for(auto& e : a) cin >> e;

    bool ok = true;
    for(auto& e : a){
        if(e % 2) continue;
        if(e % 3 == 0 or e % 5 == 0) continue;
        ok = false;
        break;
    }

    cout << (ok ? "APPROVED":"DENIED") << endl;

    return 0;
}


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

#pragma region Macro
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define SORT(v) sort(v.begin(), v.end())
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define vi vector<int>
#define vvi vector<vector<int>>
#define chmax(x,y) (x = max(x,y))
#define chmin(x,y) (x = min(x,y))

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#pragma endregion

void solve(){
	#define int ll
	// ここに処理を記述
	// コンパイル時はエイリアス「gpp」--> c++17でコンパイル
	ll n;
	cin >> n;
	
	ll temp = n;
	string ans = "";
	while(temp > 0){
		temp--;
		int dist = temp % 26;
		char add = 'a' + dist;
		ans = add + ans;
		temp /= 26;
	}
	
	cout << ans << endl;
}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	
	solve();
	return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
#define all(x) (x).begin(),(x).end()
#define dump(x) cout << #x << " = " << (x) << endl

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

const ll MOD = 1000000007;


int main() {
    int n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    ll ans = 0;
    rep(i, 60) {
        ll x = 0;
        rep(j, n) if (a[j] >> i & 1) x++;
        ll now = x * (n - x) % MOD;
        rep(j, i) now = now * 2 % MOD;
        ans += now;
        ans %= MOD;
    }
    cout << ans << endl;
}

Measured memory_bytes: 2560
//shan61916
#include <bits/stdc++.h>
  using namespace std;
typedef   long long ll;
typedef   unsigned long long ull ;
typedef   double dll ;

#define   mp make_pair
#define   pb push_back
#define   ff first 
#define   ss second
#define   IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   endl "\n" 
#define   pll pair<ll, ll>
#define   all(x) x.begin(), x.end()
#define   vll vector<ll> 


int main(){
 IOS
#ifdef SHAN
    freopen("input.txt" , "r" , stdin);  
#endif
  string s;
  cin >> s;
  ll n = s.length();
  vector<ll> ans(n, -1);
  ll last = 0; 
  for(ll i = 0; i < n-1; i++) {
    if(s[i]=='R' and s[i+1] == 'L') { 
    	ll ct1 = 0;
    	ll idx1 = i - 1; 
    	while(idx1 >= 0 and idx1 < n and idx1 >= last and s[idx1] == 'R') {
    		ct1++ ;
    		idx1-- ;
    	}  
    	ll ct2 = 0; 
    	ll idx2 = i+2 ;
    	while(idx2 < n and s[idx2] == 'L') {
    		ct2++ ;
    		idx2++ ;
    	}

    	ll tot = ct2 + ct1 ;
    	tot+=2;
    	
    	if(tot%2 == 0) {
    		ans[i] = tot/2 ;
    		ans[i+1] = tot/2 ;
    	}
    	else {
    		if(ct1 > ct2) {
    		ans[i+1] = tot/2 ;
    		ans[i] = tot - (tot/2); 
    	    }
    	    else {
               ans[i] = tot/2 ;
    		   ans[i+1] = tot - (tot/2); 
    	    }
    	    ll xx = max(ct1, ct2)  ;
    	    if(xx%2 == 1)  {
    	    	swap(ans[i], ans[i+1]);
    	    }
    	}
    	last = idx2;
    	i = idx2 - 1;
    }
  }
   for(ll i = 0; i < n; i++){
    if(ans[i] == -1) cout << 0 << " "; 
    else cout << ans[i] << " ";
}
  return 0;
} //good night.

Measured memory_bytes: 1488
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main() {
    int n;
    cin >> n;
    set<string> S;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        S.insert(s);
    }
    cout << S.size();
    return 0;
}

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

int main(){
	int n,r;
	cin >> n >> r;
	if(n >= 10){
		cout << r << endl;
	}else{
		cout << r + 100*(10-n) << endl;
	}
	return 0;
}



Measured memory_bytes: 256
N = int(input())
D = [list(map(int, input().split())) for _ in range(N)]
 
ans = 'No'
for i in range(N-2):
  if D[i][0] == D[i][1] and D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]:
    ans = 'Yes'
    break
    
print(ans)

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

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

#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;


int main(){
    int a;
    cin >> a;
    cout << a + a*a + a*a*a << endl;
}

Measured memory_bytes: 3596
#!/usr/bin/env python3

from collections import deque

INF = 10 ** 12


H, W = map(int, input().split())
s_i, s_j = map(lambda x: int(x) - 1, input().split())
t_i, t_j = map(lambda x: int(x) - 1, input().split())
field = [input() for _ in range(H)]

# 1. bfs でワープなしで到達できるマスを探索
# 2. 1 で見つかったマスから一回ワープして到達できるマスを探索
# 3. 1, 2 を繰り返す


walk = [(1, 0), (0, 1), (-1, 0), (0, -1)]
warp = [(i, j) for i in range(-2, 3) for j in range(-2, 3) if (i, j) not in [(0, 0)] + walk]

warp_times = [[INF for j in range(W)] for i in range(H)]
que = deque()

warp_times[s_i][s_j] = 0
que.append((s_i, s_j, 0))

while que:
    i, j, times = que.popleft()
    # ワープ無しで到達できるマスの探索
    for di, dj in walk:
        i_adj, j_adj = i + di, j + dj
        if 0 <= i_adj < H and 0 <= j_adj < W and field[i_adj][j_adj] == '.':
            if warp_times[i_adj][j_adj] > times:
                warp_times[i_adj][j_adj] = times
                que.appendleft((i_adj, j_adj, times))

    # ワープ有りで到達できるマスの探索
    for di, dj in warp:
        i_adj, j_adj = i + di, j + dj
        if 0 <= i_adj < H and 0 <= j_adj < W and field[i_adj][j_adj] == '.':
            if warp_times[i_adj][j_adj] > times + 1:
                warp_times[i_adj][j_adj] = times + 1
                # ワープ無しで到達できるマスを探索しきった後に探索するため、単に append
                que.append((i_adj, j_adj, times + 1))

ans = warp_times[t_i][t_j] if warp_times[t_i][t_j] < INF else '-1'
print(ans)


Measured memory_bytes: 95444
import java.util.Arrays;
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) 
	{
		Scanner in=new Scanner(System.in);
		while(in.hasNext())
		{
			int n=in.nextInt();
			int m=in.nextInt();
			int M=1000000;
			int road[][]=new int[n+1][n+1];
			for(int i=0;i<=n;i++)
				Arrays.fill(road[i], M);
			for(int i=0;i<=n;i++)
				road[i][i]=0;
			for(int i=0;i<m;i++)
			{
				String s[]=in.next().split(",");
				road[Integer.valueOf(s[0])][Integer.valueOf(s[1])]=Integer.valueOf(s[2]);
				road[Integer.valueOf(s[1])][Integer.valueOf(s[0])]=Integer.valueOf(s[3]);
			}
			String va[]=in.next().split(",");
			int s=Integer.valueOf(va[0]);
			int t=Integer.valueOf(va[1]);
			int give=Integer.valueOf(va[2]);
			int cost=Integer.valueOf(va[3]);
			int ans=give-cost;
			int start=0;
			int goal=0;
			for(int I=0;I<2;I++)
			{
				int p=0;
				int leng[]=new int[n+1];// minimum distance
				int v[] = new int[n+1];// decision flag
				if(I==0)
				{
					start =s;
					goal=t;
				}
				else
				{
					start=t;
					goal=s;
				}
				for(int k=0;k<=n;k++)
				{
					leng[k]=M;
					v[k]=0;
				}
				leng[start]=0;
				for(int i=0;i<=n;i++)
				{
					int min=M;//最小の節点を探す
					for(int k=0;k<=n;k++)
					{
						if(v[k]==0&&leng[k]<min)
						{
							p=k;
							min=leng[k];
						}
					}
					v[p]=1;//確定フラグ
					for(int k=0;k<=n;k++) //pを経由してkに至長さがそれまでの最短経路より小さければ更新
					{
						if((leng[p]+road[p][k])<leng[k])
							leng[k]=leng[p]+road[p][k];
					}
				}
				ans-=leng[goal];
			}
			System.out.println(ans);
		}
	}
}

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

int main(){
  int l, r; cin >> l >> r;
  r = min(r, l+2*2019);
  const int mod = 2019;
  int ans = 2019;
  for(int i = l; i<=r; i++){
    for(int j = i+1; j<=r; j++){
      ans = min(ans, ((i%mod)*(j%mod))%mod);
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
H, W = gets.split.map(&:to_i)
c = ["@"*(W+2)]
H.times do
    c << "@#{gets.chomp}@"
end
c << "@"*(W+2)

(1..H).each do |h|
    (1..W).each do |w|
        if c[h][w] == '.'
            around = c[h][w+1] + c[h][w-1]+ c[h+1][w] + c[h-1][w] + c[h+1][w+1] + c[h-1][w-1] + c[h+1][w-1] + c[h-1][w+1]
            c[h][w] = around.count('#').to_s
        end
    end
end

(1..H).each do |h|
    puts c[h][1...-1]
end



Measured memory_bytes: 3836
s=input()
k=int(input())
if len(set(list(s)))==1:print((len(s)*k)//2);exit()
t=[1]
for i in range(1,len(s)):
  if s[i-1]==s[i]:t[-1]+=1
  else:t.append(1)
a=0
for i in t:a+=(i//2)*k
if s[0]==s[-1]:
  if t[0]%2==t[-1]%2==1:a+=k-1
print(a)


Measured memory_bytes: 3064
N,M = map(int,input().split())
H = list(map(int,input().split()))
A = []
for i in range(N):
    A.append(0)
    
for i in range(M):
    a,b = map(int,input().split())
    if H[a-1] > H[b-1]:
        A[b-1] = -1
    elif H[a-1] < H[b-1]:
        A[a-1] = -1
    elif H[a-1] == H[b-1]:
        A[a-1] = -1
        A[b-1] = -1

print(A.count(0))
    

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

int main(void){
  int N,i;
  string flag = "Three";
  cin >> N;

  for (i=0;i<N;i++){
    string s;
    cin >> s;
    if (s=="Y"){
      flag = "Four";
      break;
    }
  }
  cout << flag <<endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#define mt(a) memset(a,0,sizeof(a))
#define MAXN 1000+10
#define ll long long
const ll INF = 0x3f3f3f3f;
using namespace std;
int main (void)  
{   
	int a,b,c;
	int k;
	cin>>a>>b>>c>>k;
	int sum = a+b+c;
	int maxx = max(max(a,b),c);
	//cout<<maxx<<endl;
	sum-=maxx;
	sum+=(ll)pow(2,k)*maxx;
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 256
/**
       **********    ************
	  Author : Avi J Patel
	  University : DAIICT
       **********    ************
**/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define pf push_front
#define mp make_pair 
#define mt make_tuple
#define ff first
#define ss second
#define si size()
#define MOD 1000000007
#define Mod 998244353
#define N 200001
#define large 10000000000000001
#define For(i,m,n) for(long long i=m;i<n;i++)
#define st(x) sort(x.begin(),x.end())
#define re(x,i) reverse(x.begin()+i,x.end())
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL));
bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    if(a.second < b.second) return true; 
    else if(a.ss==b.ss) return a.ff<b.ff;
	else return false;
}
bool sortbyboth(const pair<int,int> &a, const pair<int,int> &b)
{
	if(a.first<b.first) return true;
	else if(a.first==b.first) return a.second<b.second;
	else return false;
} 
ull powr(ull x1, ull n1) {
    if(x1==0)
    {
        return 0;
    }
    ull result=1;
    while(n1>0)
    {
        if(n1&1)
        {
            result=(result*x1);
        }
        n1=n1>>1;
        x1=(x1*x1);
    }
    return result;
}   
int main()
{
	FAST
	int a,b;
	cin>>a>>b;
	cout<<6-a-b;
	return 0;
}















Measured memory_bytes: 256
n = int(input())
r = int(n ** 0.5)
mx = 10 ** 9
if r * r - n < 0:
    r += 1
res = [0] * 6
res[2] = r
res[4] = 1
res[5] = r
while 1:
    d = res[2] * res[5] - n
    if d > mx or d < 0:
        if res[5] > 0:
            res[5] -= 1
        else:
            res[2] -= 1
        continue
    res[3] = d
    break
# if res[2] * res[5] - res[3] * res[4] != n:
#     print('no')
print(*res)

Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;cin>>n;
    vector<int>h(n,0);
    for(int i=0;i<n;i++){
        cin>>h[i];
    }
    reverse(h.begin(),h.end());
    int dp[n+1];
    dp[1]=0;dp[2]=abs(h[1]-h[0]);
    for(int i=3;i<=n;i++){
        dp[i]=min(dp[i-1]+abs(h[i-1]-h[i-2]),dp[i-2]+abs(h[i-1]-h[i-3]));
    }
    cout<<dp[n];
    return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

/**
 * Created by oka on 2018/06/05.
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int x = sc.nextInt();
        if (x == 1) {
            System.out.println(1);
            return;
        }

        int b = 2;
        int pow = b;
        int counter = 1;
        int max = 1;
        while (true) {
            pow *= b;
            counter++;
            if (pow > x) {
                if (counter == 2) {
                    break;
                } else {
                    b++;
                    pow = b;
                    counter = 1;
                }
            } else {
                if (max < pow) {
                    max = pow;
                }
            }
        }
        System.out.println(max);
    }
}


Measured memory_bytes: 21716
n = int(input())
D = list(map(int,input().split()))
L = [1] + [0]*12
for d in D:
    L[min(d, 24-d)] += 1
if max(L)>2 or L[0]>1 or L[12]>1:
    print(0)
else:
    ans = 0
    for i in range(2**11):
        T = [1] + [0]*23 + [1]
        for j in range(1, 12):
            if L[j]==2:
                T[j] = 1
                T[24-j] = 1 
            elif L[j]==1:
                if i&(1<<(j-1)):
                    T[j] = 1
                else:
                    T[24-j] = 1
        if L[12] == 1:
            T[12] = 1
        cur = 24
        t = 0
        for j in range(1, 25):
            if T[j]==1:
                cur = min(cur, t+1)
                t = 0
            else:
                t += 1
        ans = max(ans, cur)
    print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
        using namespace std;
   #define int long long
const int MAX = 510000;
const int MOD =  998244353;
//
int fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
int COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int modpow(int a, int n, int mod) {
    int res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

     signed main(){
          COMinit();
          int k,n,ans;
          cin>>k>>n;
          for(int i=1;i<2*k;i++){
             ans=0;
            
                  for(int j=0;j<=max(0ll,min(2*k-i,i))/2;j++){
                    ans=(ans+COM(n+k-1-max(0ll,min(2*k-i,i)),n-j)*modpow(2,j,MOD)%MOD*COM(max(0ll,min(2*k-i,i))/2,j)%MOD)%MOD;
                   // cerr<<ans<<' ';
                            }
               
               if(i%2){
                    for(int j=0;j<=max(0ll,min(2*k-i,i))/2;j++){
                    ans=(ans+COM(n+k-1-max(0ll,min(2*k-i,i))-1,n-j-1)*modpow(2,j,MOD)%MOD*COM(max(0ll,min(2*k-i,i))/2,j)%MOD)%MOD;
                   // cerr<<ans<<' ';
                            }
               }
               cout<<ans<<endl;
          }
   }
         


        


Measured memory_bytes: 12288
N = int(input())
H = list(map(int, input().split()))
ans = 0
while sum(H):
  f = 0
  for i in range(N):
    if f == 0:
      if H[i] > 0:
        f = 1
        H[i] -= 1
        ans += 1
    else:
      if H[i] > 0:
        H[i] -= 1
      else:
        f = 0
print(ans)

Measured memory_bytes: 67696
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/

int main(){
    int N; cin >> N;
    vector<int> p(N);
    for(int i=0; i<N; i++) { cin >> p[i]; p[i]--; }
    
    int ans = 0;
    int cnt = 0;
    int id = 0;

    while(id < N){
        if(p[id] == id){
            cnt = 0;
            while(id < N && p[id] == id){ id++; cnt++; }
            ans += (cnt-1)/2 + 1;
        } else {
            id++;
        }
    }

    cout << ans << endl;
}

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

using namespace std;

using ll = long long;

struct CityInfo : private std::pair<ll, ll> {
    ll p = 0, y = 0, id = 0;
};

struct CompareYear {
    constexpr bool operator()(const CityInfo &c1, const CityInfo &c2) {
        return c1.y < c2.y;
    }
};

struct CompareID {
    constexpr bool operator()(const CityInfo &c1, const CityInfo &c2) {
        return c1.id < c2.id;
    }
};

int main() {
    ll N, M;
    cin >> N >> M;

    std::vector<CityInfo> cities;

    CityInfo info;
    for (ll i = 0; i < M; ++i) {
        cin >> info.p >> info.y;
        info.id = i;
        cities.emplace_back(info);
    }
    std::sort(cities.begin(), cities.end(), CompareYear());
    
    std::vector<CityInfo> numbers;
    {
        std::map<ll, ll> m;
        for (auto &c : cities) {
            info = c;
            info.y = ++m[c.p];
            numbers.emplace_back(info);
        }
    }
    sort(numbers.begin(), numbers.end(), CompareID());
    
    std::string output;
    for (auto &n : numbers) {
        printf("%06lld%06lld\n", n.p, n.y);
    }

    return 0;
}


Measured memory_bytes: 17132
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>

#define INF 1000000021
#define MOD 1000000007
#define pb push_back
#define sqr(a) (a)*(a)
#define M(a, b) make_pair(a,b)
#define T(a, b, c) make_pair(a, make_pair(b, c))
#define F first
#define S second
#define all(x) (x.begin(), x.end())
#define deb(x) cerr << #x << " = " << x << '\n'
#define N 222222

using namespace std;
//using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

const ld pi = 2 * acos(0.0);
template<class T> bool umin(T& a, T b){if(a>b){a=b;return 1;}return 0;}
template<class T> bool umax(T& a, T b){if(a<b){a=b;return 1;}return 0;}
template<class T, class TT> bool pal(T a, TT n){int k=0;for(int i=0;i<=n/2;i++){if(a[i]!=a[n-i-1]){k=1;break;}}return k?0:1;}

//int month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

int main()
{
	int x, y, z;
	cin >> x >> y >> z;
	swap(x, y);
	swap(x, z);
	cout << x << ' ' << y << ' ' << z;




	





	getchar();
	getchar();
	return 0;
	//ios::sync_with_stdio(false);
	//cin.tie(0);
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
using LL=long long;
int main(){
  int H,W;cin>>H>>W;
  vector<LL>dp(W+1,0);
  dp[1]=1;
  for(int h=1;h<=H;h++){
    vector<LL>dp2(W+1,0);
    for(int w=1;w<=W;w++){
      char a;cin>>a;
      if(a=='.')
        dp2[w]=(dp[w]+dp2[w-1])%1000000007L;
    }
    dp=dp2;
  }
  cout<<dp[W]<<endl;
}

Measured memory_bytes: 256
N,A=map(int,input().split())
xlist=list(map(int,input().split()))

dp=[[[0]*(sum(xlist)+1) for _ in range(N+1)] for _ in range(N+1)]
dp[0][0][0]=1
for i in range(1,N+1):
  dp[i][0][0]=1
  for j in range(1,i+1):
    for k in range(1,sum(xlist)+1):
      dp[i][j][k]=dp[i-1][j][k]
      if k-xlist[i-1]>=0:
        dp[i][j][k]+=dp[i-1][j-1][k-xlist[i-1]]
#print(dp)

answer=0
for j in range(1,N+1):
  if j*A>sum(xlist):
    break
  answer+=dp[N][j][j*A]
  
print(answer)

Measured memory_bytes: 93020
#include <iostream>

using namespace std;

int eulerPhi(int);

int main(void){

	int ans = 0;
	unsigned n;
	cin >> n;
	cout << eulerPhi(n) << endl;
	return 0;
}

int eulerPhi(int n){

	int ans = n;
	for(int i = 2 ; i*i <= n ; ++i){
		if(n % i == 0){
			ans -= ans/i;
			while(n % i == 0) n /= i;
		}
	}
	if(n > 1) ans -= ans / n;
	return ans;
}

Measured memory_bytes: 1160
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    String s = sc.next();
    if(3200 <= a){
      System.out.println(s);
    }else{
      System.out.println("red");
    }
  }
}

Measured memory_bytes: 21588
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<cctype>
using namespace std;
bool check(int n,int a,int b)
{
	int ans=0;
	while(n!=0)
	{ans+=n%10;n/=10;}
	if(ans<=b&&ans>=a)return true;
	return false;
}
int main()
{
	int n,a,b,i,ans=0;
	scanf("%d%d%d",&n,&a,&b);
	for(i=1;i<=n;i++)
		if(check(i,a,b))ans+=i;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#include<bits/stdc++.h>
#include <utility>

#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (a); (b) <= i; i--)
#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))
#define elif else if
#define MOD 1000000007
#define INF (1<<29)

using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  char c;
  cin >> c;
  if(c!='a' && c!='i' && c!='u' && c!='e' && c!='o'){
    cout << "consonant" << endl;
  }else{
    cout << "vowel" << endl;
  }
  return 0;
}

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))
#define sz(v) ((int) v.size())

using namespace std;

using i64 = long long;
using f80 = long double;
using vi32 = vector<int>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << endl; exit(0); }
inline void no() { cout << "No" << endl; exit(0); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { x = max(x, y); }
template <typename T> inline void amin(T &x, T y) { x = min(x, y); }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }

void solve() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  while (true) {
    c -= b;
    if (c <= 0) {
      cout << "Yes" << endl;
      return;
    }
    a -= d;
    if (a <= 0) {
      cout << "No" << endl;
      return;
    }
  }
}

Measured memory_bytes: 3612
#include <iostream>
#include <cmath>
bool isprime(unsigned x){
	if(x == 2)
		return true;
	if(x < 2 || x % 2 == 0)
		return false;

	unsigned i = 3;
	while ( i <= static_cast<unsigned int>(sqrt(x)) ) {
		if (x % i == 0)
			return false;
		i += 2;
	} 
	return true;
}

int main(int argc, char const* argv[])
{
	unsigned n;
	unsigned int count = 0;
	std::cin >> n;
	for (int i = 0; i < n; i++) {
		unsigned x;
		std::cin >> x;
		if (isprime(x)) {
			++count;
		}
	}
	std::cout << count << std::endl;
	
	return 0;
}

Measured memory_bytes: 3084
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,a[100009][3],dp[100009][3];
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n;
for(ll i=0;i<n;i++)
cin>>a[i][0]>>a[i][1]>>a[i][2];
dp[0][0]=a[0][0];
dp[0][1]=a[0][1];
dp[0][2]=a[0][2];
for(ll i=1;i<n;i++)
    for(ll j=0;j<3;j++){
     ll &r=dp[i][j];
     if(j!=0)
     r=max(r,dp[i-1][0]);
     if(j!=1)
     r=max(r,dp[i-1][1]);
     if(j!=2)
     r=max(r,dp[i-1][2]);
     r+=a[i][j];
    }
n--;
cout<<max(dp[n][0],max(dp[n][1],dp[n][2]));
return 0;
}


Measured memory_bytes: 8332
#include <stdio.h>

int main(void)
{
	int n, m, l;
	int i, j, k;   //くり返し用
	int A[100][100];   //行列A
	int B[100][100];   //行列B
	long long C[100][100] = { 0 };   //行列C

	scanf("%d %d %d", &n, &m, &l);

	/*行列A入力*/
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < m; j++)
		{
			scanf("%d", &A[i][j]);
		}
	}

	/*行列B入力*/
	for (i = 0; i < m; i++)
	{
		for (j = 0; j < l; j++)
		{
			scanf("%d", &B[i][j]);
		}
	}

	/*行列A×行列Bを求める*/
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < l; j++)
		{
			for (k = 0; k < m; k++)
			{
				C[i][j] += A[i][k] * B[k][j];
			}
			if (j != 0)
			{
				printf(" ");
			}
			printf("%ld", C[i][j]);
		}
		printf("\n");
	}
	return 0;
}


Measured memory_bytes: 2112
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
#define rep(i, n) for(int i=0;i<(int)n;i++)
#define PI acos(-1)
#define fast_io ios_base::sync_with_stdio(false) ; cin.tie(0); cout.tie(0);
ll mod=1e9+7;



int main(){
    
    int a, b;
    cin>>a>>b;
    if(b<10){
        a*=10;
        a+=b;
    }else if(b==100){
        a*=1000;
        a+=b;
    }else{
        a*=100;
        a+=b;
    }


    for(int i=1;i<=a+1;i++){
        if(i*i == a){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
    
    
    return 0;
    
}


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

int main(){
    int i, j, k;
    int N;
    cin >> N;
    vector<int> V(N);
    for(i=0; i<N; i++) cin >> V[i];

    map<int, int> cnt[2];
    for(i=0; i<N; i++) cnt[i%2][V[i]]++;

    vector<pair<int, int>> pairs[2];
    for(k=0; k<2; k++){
        cnt[k][0] = 0;
        for(auto&& p : cnt[k]) pairs[k].push_back({p.second, p.first});
        sort(pairs[k].rbegin(), pairs[k].rend());
    }

    int ans;
    if(pairs[0][0].second != pairs[1][0].second){
        ans = N - pairs[0][0].first - pairs[1][0].first;
    }else{
        ans = N - max(pairs[0][1].first + pairs[1][0].first, pairs[0][0].first + pairs[1][1].first);
    }

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

Measured memory_bytes: 6520
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
typedef unsigned long long llu;
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define f  first
#define s  second
#define mp make_pair
#define pb push_back
#define ep emplace_back
#define sz(a) (int) a.size()
#define FOR(x,a,b) for (int x=a;x<=b;x++)
#define FOD(x,a,b) for (int x=a;x>=b;x--)
#define REP(x,a,b) for (int x=a;x<b;x++)
#define RED(x,a,b) for (int x=a;x>b;x--)
#define EL printf("\n")
#define man 100007
ll c,b;
ll GCD(ll a,ll b)
{
       ll r=a%b;
       while(r)
       {
             a=b;
             b=r;
             r=a%b;
       }
return b;
}
vector<ll> ptich(ll v)
{
      vector<ll> ret;
      for(ll i=2;i*i<=v;i++)
      {
            if(v%i==0)
            {
                  ret.pb(i);
            }
            while(v%i==0) v/=i;
      }
      if(v>1) ret.pb(v);
return ret;
}
int main()
{
	IO;
	cin>>c>>b;
	ll n=GCD(c,b);
	vector<ll> res;
	res=ptich(n);
	cout<<res.size()+1;
	return 0;
}


Measured memory_bytes: 256
class Integer
  def combination(k)
    return 1 if k.zero?

    (self - k + 1..self).inject(:*) / k.factorial
  end

  def permutation(k)
    return 1 if k.zero?

    (self - k + 1..self).inject(:*)
  end

  def factorial
    return 1 if self.zero?

    (1..self).inject(:*)
  end
end

n, k = gets.chomp.split.map &:to_i
1.upto(k) do |i|
  if i > n - k + 1
    puts 0
  else
    puts (n - k + 1).combination(i)  * (k - 1).combination(i - 1) % (10 ** 9 + 7)
  end
end


Measured memory_bytes: 3836
#include <bits/stdc++.h>
#define pb push_back
#define all(a) a.begin(), a.end()
#define sz(a) (int)a.size()
#define x first
#define y second
#define debug(...) cout<<"["<<#__VA_ARGS__<<": "<<__VA_ARGS__<<"]\n"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int>pii;
const int maxn = 1e5 + 100;
const int mod = 1e9 + 7;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int add(int a, int b)
{
    int c=a+b;
    if(c > mod)c-=mod;
    return c;
}
int mul(int a, int b)
{
    ll c=(ll)a*b;
    c%=mod;
    return (int)c;
}
struct matrix
{
    int N, M;
    vector<vector<int> >mat;
    matrix(int n, int m)
    {
        N=n, M=m;
        mat=vector<vector<int> >(N, vector<int>(M, 0));
    }
    matrix(vector<vector<int> >arr)
    {
        N=sz(arr), M=sz(arr[0]);
        mat=vector<vector<int> >(N, vector<int>(M, 0));
        for(int i=0; i<N; i++)
            for(int j=0; j<M; j++)
                mat[i][j]=arr[i][j];
    }
    void ident()
    {
        for(int i=0; i<N; i++)
                mat[i][i]=1;
    }
    matrix operator*(const matrix &o)
    {
        matrix ret(N, o.M);
        for(int i=0; i<ret.N; i++)
            for(int j=0; j<ret.M; j++)
                for(int k=0; k<M; k++)
                    ret.mat[i][j]=add(ret.mat[i][j], mul(mat[i][k], o.mat[k][j]));
        return ret;
    }
};
matrix pwr(matrix a, ll pw)
{
    matrix ret(a.N, a.M);
    ret.ident();
    while(pw > 0)
    {
        if(pw&1)ret=ret*a;
        a=a*a;
        pw>>=1;
    }
    return ret;
}
ll n, k;
int main()
{
    ios_base::sync_with_stdio(false), cin.tie(0);
    cin >> n >> k;
    matrix arr(n, n);
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            cin >> arr.mat[i][j];
    arr = pwr(arr, k);
    ll ans = 0;
    for(int i = 0; i < n; i++)
        for(int j = 0; j < n; j++)
            ans = (ans + arr.mat[i][j]) % mod;
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
using ll = long long;

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

	ll target; cin >> target;
	ll cur = 100;
	int rep = 0;
	while (cur < target) {
		cur += cur/100;
		++rep;
	}

	cout << rep << "\n";

	return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <map>
#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int MOD = 1000000007;

int main() {
  int N, M; cin >> N >> M;
  vector<vector<int>> q(M, vector<int>(2,0)); 
  rep(i,M) { cin >> q[i][0] >> q[i][1]; q[i][0]--; q[i][1]--; }
  sort(q.begin(), q.end(), [](vector<int> &x,vector<int> &y){return x[0]>y[0];});

  int result = 0, cut = N;
  rep(i, M) {
    if (cut>q[i][1]) {
      result++;
      cut = q[i][0] + 1;
    }
  }

  cout << result << endl;
  return 0;
}

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

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

int main(){

    ll n;
    cin >> n;
    ll a,b;
    a = n / 500;
    n -= a*500;
    b = n/5;

    cout << a*1000+b*5 << endl;

    return 0;
}  

Measured memory_bytes: 256
import sys
import os
import itertools
import numpy as np
from collections import deque

def main():
    if os.getenv("ENV")=='LOCAL':
        sys.stdin = open(os.path.dirname(__file__)+'/input.txt', 'r')

    N,K=map(int, input().split())
    P=list(map(int, input().split()))

    P.sort()
    sum=0
    for i in range(K):
        sum+=P[i]

    print(sum)

if __name__ == '__main__':
    main()


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

int main(void){

    int W,H,N; cin>>W>>H>>N;
    int x_left=0,x_right=W, y_down=0,y_up=H;

    for (int i = 0; i < N; ++i) {
        int x,y,a; cin>>x>>y>>a;
        if(a==1){
            x_left = max(x_left, x);
        }else if(a==2){
            x_right = min(x_right, x);
        }else if(a==3){
            y_down = max(y_down, y);
        }else{
            y_up = min(y_up, y);
        }
    }
    int X,Y;
    if((x_right-x_left)>0) X=x_right-x_left;
    else X=0;
    if((y_up-y_down)>0) Y=y_up-y_down;
    else Y=0;
    int S=X*Y;
    if(S>0)cout<<S<<endl;
    else cout<<0<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int vx[] = {3, 2, 6, 7, 0, 1, 5, 4};
const int vy[] = {4, 0, 3, 7, 5, 1, 2, 6};
const int vz[] = {1, 2, 3, 0, 5, 6, 7, 4};

vector< string > rollX(vector< string >& t)
{
  vector< string > u(8);
  for(int i = 0; i < 8; i++) u[i] = t[vx[i]];
  return(u);
}
vector< string > rollY(vector< string >& t)
{
  vector< string > u(8);
  for(int i = 0; i < 8; i++) u[i] = t[vy[i]];
  return(u);
}
vector< string > rollZ(vector< string >& t)
{
  vector< string > u(8);
  for(int i = 0; i < 8; i++) u[i] = t[vz[i]];
  return(u);
}

int main()
{
  string s[8];
  while(cin >> s[0]) {
    for(int i = 1; i < 8; i++) cin >> s[i];
    sort(s, s + 8);
    set< vector< string > > ss;
    int ret = 0;
    do {
      vector< string > buff(s, s + 8);
      if(ss.find(buff) == ss.end()) {
        ++ret;
        for(int i = 0; i < 4; i++) {
          for(int j = 0; j < 4; j++) {
            for(int k = 0; k < 4; k++) {
              ss.insert(buff);
              buff = rollX(buff);
            }
            buff = rollY(buff);
          }
          buff = rollZ(buff);
        }
      }
    } while(next_permutation(s, s + 8));
    cout << ret << endl;
  }
}

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

int main(){
    int A, B, K;
    cin >> A >> B >> K;

    int count = 0;
    int ans = 0;
    for(int i = 100; i > 0; i--) {
        if(A%i==0 && B%i==0) {
            ++count;
            if (count==K) {
                ans = i;
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <random>
#include <cassert>
#include <numeric>
#define ll long long int
#define LL unsigned long long
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
using namespace std;

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;



int main() {
    ll s; cin >> s;
    ll x,y;
    if(s/1000000000ll<1000000000ll){
        y = s / 1000000000ll + 1ll;
        x = 1000000000ll * y - s;
        cout << 0 << " " << 0 << " " << 1000000000 << " " << 1 << " " << x << " " << y << endl;
    }else{
        cout << 0 << " " << 0 << " " << 1000000000 << " " << 1 << " " << 0 << " " << 1000000000 << endl;
    }

}

Measured memory_bytes: 3604
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue> //C++
#include <string> //C++
#include <iostream> //C++
#include <vector> //C++
#include <algorithm> //C++
using namespace std; //C++
#define rep(i, a, n) for (i = (a); i < (n); i++)






int main()
{

	int x, y;
	cin >> x >> y;

	if (x < 10 && y < 10)
		cout << x * y;
	else cout << -1;

}






Measured memory_bytes: 384
n = gets.to_i
n.times do
    out = 0
    hit = 0
    score = 0
    until out == 3
        input = gets.chomp

        if input == "HIT"
            hit += 1
            if hit == 4
                hit = 3
                score += 1
            end 
        elsif input == "HOMERUN"
            score += hit + 1
            hit = 0
        elsif input == "OUT"
            out += 1
        end

    end
    puts score
end


Measured memory_bytes: 6836
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
#define  int long long int
typedef complex<long double> cd;
const long double pi=acos(-1);
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <db, db> pdd;
typedef vector<int> vi;
typedef vector<vector<int> > matrix;
#define m1 make_pair
#define pb push_back
#define flush fflush(stdout)
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define reset(x,v) memset(x,v,sizeof(x))
#define sz(x) (int)(x.size())
#define ff first
#define ss second
#define endl "\n"
#define debug(x) (cerr << #x << ": " << x << "\n")
#define setbits(x) __builtin_popcount(x)
inline ll gcd(ll a,ll b){if(a==0) return b;return gcd(b%a,a);}
inline ll power(ll a,ll n,ll m){if(n==0)return 1;ll p=power(a,n/2,m);p=(p*p)%m;if(n%2) return (p*a)%m;else return p;}
const ll MOD =998244353;
const ll hell=1000000007;
const int INF = 1e17;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;

typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
const int N=100005;

int32_t main()
{
    IOS;
    int n;
    cin>>n;
    string s;
    cin>>s;
    int ans=1;
    for(int i=0;i<n-1;i++)
    {
        if(s[i]!=s[i+1])
            ans++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  string s;
  R s;
  pr(count(all(s),'1'));
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;
using static System.Console;

class Program {
    static Scanner cin = new Scanner();

    internal static void Main(string[] args) {
        int N = cin.nextInt();
        WriteLine("ABC" + N);
    }
}




class Scanner {
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner() {
        s = new string[0];
        i = 0;
    }

    public string next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt() {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0) {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong() {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0) {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble() {
        return double.Parse(next());
    }

    public double[] ArrayDouble(int N, double add = 0) {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

Measured memory_bytes: 13268
#include<stdio.h>

int main(void)
{
	int i, j, n,d = 0, v;
	int sosuu = 0;

	scanf("%d", &n);

	for (i = 0; i < n; i++) {
		scanf("%d", &j);
		d = 0;

		for (v = 2; v <= 10000; v++){
			if ((j % v) == 0) {
				if (j != 1)
					d++;
			}
		}

		if(j >= 0 && j <= 10000) {
			if (d == 1) {
				sosuu++;
			}
		}
		else {
			if (d == 0) {
				sosuu++;
			}
			}
		}


	printf("%d\n", sosuu);
	return 0;
}


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

int main() {
  
  int N;
  cin >> N;
  
  if(N==22){cout<<"Christmas Eve Eve Eve"<<endl;}
  else if(N==23){cout<<"Christmas Eve Eve"<<endl;}
  else if(N==24){cout<<"Christmas Eve"<<endl;}
  else{cout<<"Christmas"<<endl;}

}


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

int main()
{
	int n,f=0,s=0;
	
	cin>>n;
	
	int a[n+1],i;
	
	for(i=1;i<=n;i++){
		cin>>a[i];
	}
	
	do{
		for(i=1;i<=n;i++){
			if(a[i]%2==0){
				a[i]=a[i]/2;
			}else{
				f=1;
				break;
			}
			
		}
		if(f==0){
				s++;
		}
	}while(f==0);
	
	cout<<s<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <set>
#include <algorithm>
#include <vector>
#include <map>
#include <cassert>
#include <string>
#include <cstring>
#include <queue>

using namespace std;

#define rep(i,a,b) for(int i = a; i < b; i++)
#define S(x) scanf("%d",&x)
#define S2(x,y) scanf("%d%d",&x,&y)
#define P(x) printf("%d\n",x)
#define all(v) v.begin(),v.end()
#define FF first
#define SS second
#define pb push_back
#define mp make_pair

typedef long long int LL;
typedef pair<int, int > pii;
typedef vector<int > vi;

double eps = 1e-9;

int n;
int A[200005];

bool f(int x, int y) {
  LL cnt = 0;
  rep(i,0,n) {
    int val = (A[i] + x - 1) / x;
    if(val * x < A[i]) val++;
    cnt += val - 1;
  }
  return cnt <= y;
}

int main() {
  int k;
  S2(n,k);
  rep(i,0,n) {
    S(A[i]);
  }
  int lo = 1, hi = 1000000000;
  int ans = 0;
  while(lo <= hi) {
    int mi = (lo + hi) >> 1;
    if(f(mi, k)) {
      ans = mi;
      hi = mi - 1;
    } else {
      lo = mi + 1;
    }
  }
  // cout << ans << "\n";
  P(ans);
  return 0;
}


Measured memory_bytes: 4484