akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define inf 100000000000
#define int long long int

using namespace std;

void solve(){
    double pi=3.141592;
    double r;
    cin>>r;
    cout<<fixed<<setprecision(5)<<2*pi*r;
}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    //cin>>t;
    t=1;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 3804
#include<bits/stdc++.h>
using namespace std;
#define ll long long
 
#define ff first
#define ss second
#define pb push_back

ll const lim = 2e5+5;
ll const mod = 1000000007;
ll n, arr[lim+5], pref[lim+5];

ll solve() 
{ 
	ll sum = 0 ;
	for(int i=1;i<=n;i++) 
		pref[i] = (arr[i] + pref[i-1]) ;
	
	for(int i=1;i<=n;i++) {
		sum = (sum + ( (arr[i] % mod) * ((pref[n] - pref[i]) % mod) ) % mod) % mod ;
	}
	return sum ;
} 

int main() 
{ 
	cin >> n;
	for(ll i=1; i<=n; i++) cin >> arr[i];
	ll ans = (solve() + mod) % mod;
	cout<<ans<<endl;
    return 0; 
} 

Measured memory_bytes: 6660
n = int(input())
hs = list(map(int, input().split()))
stack = []
ans = 0

for i, h in enumerate(hs):
    j = -1
    while stack and stack[-1][1] > h:
        j, h2 = stack.pop()
        ans = max(ans, (i - j) * h2)
    if not stack or stack[-1][1] < h:
        stack.append((i if j == -1 else j, h))
ans = max(ans, max((n - j) * h2 for j, h2 in stack))

print(ans)

Measured memory_bytes: 22324
#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;

const ll INF = 1e11;

int A, B, Q;

int main() {
    cin >> A >> B >> Q;
    vector< ll > s(A), t(B), x(Q);
    for (int i = 0; i < A; i++) {
        cin >> s[i];
    }
    for (int i = 0; i < B; i++) {
        cin >> t[i];
    }
    for (int i = 0; i < Q; i++) {
        ll x;
        cin >> x;

        auto s_lb = lower_bound(s.begin(), s.end(), x);
        auto t_lb = lower_bound(t.begin(), t.end(), x);

        ll ans = INF;
        for (auto s_itr = s_lb; s_itr >= s.begin() && s_itr >= s_lb - 1;
             s_itr--) {
            for (auto t_itr = t_lb; t_itr >= t.begin() && t_itr >= t_lb - 1;
                 t_itr--) {
                ans = min(ans, abs(x - *s_itr) + abs(*s_itr - *t_itr));
                ans = min(ans, abs(x - *t_itr) + abs(*t_itr - *s_itr));
            }
        }

        cout << ans << endl;
    }
}

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

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

bool valid(int r, int c){
  return r >= 0 && r < 12 && c >= 0 && c < 12 && A[r][c];
}    

void dfs_rec(int r, int c){
  if(!A[r][c]) return ;
  A[r][c] = 0;
  for(int i=0; i<4; ++i){
    if(valid(r+dx[i], c+dy[i])) dfs_rec(r+dx[i], c+dy[i]);
  }
}

int main(){
  string row;
  while(cin >> row){
    for(int r=0; r<12; ++r){
      if(r != 0){
	cin >> row;
      }
      for(int c=0; c<12; ++c){
	A[r][c] = row[c] - '0';
      }
    }
    
    int sum = 0;
    for (int r=0; r<12; ++r) {
      for (int c=0; c<12; ++c) {
	if (A[r][c]) {
	  sum++;
	  dfs_rec(r, c);
	}
      }
    }

    cout << sum << endl;
  }

  return 0;
}

Measured memory_bytes: 1180
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k;
    cin>>n>>k;
    int arr[n+1]={0};
    for(int i=0;i<k;i++)
    {
        int d;
        cin>>d;
        for(int i=0;i<d;i++)
        {int a;cin>>a;arr[a]=1;}
    }
    int count1=0;
    for(int i=1;i<=n;i++)
        if(arr[i]==0)
        count1++;
    cout<<count1<<"\n";

}


Measured memory_bytes: 3620
c[1100000],n=1e6;main(i,j){for(i=2;i*i<n;++i)for(j=i;!c[i]&&j<n;c[j+=i]=1);for(i=2;i<n;i++)c[i]=c[i-1]+!c[i];for(j=0;~scanf("%d",&n);printf("%d\n",c[n]));}

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

int main(void){
    int n;
    cin >> n;
    int a[n];
    for(int i = 0;i < n;i++)cin >> a[i];
    map<int,int> num;
    for(int i = 0;i < n;i++){
        num[a[i]]++;
        num[a[i]+1]++;
        num[a[i]-1]++;
    }
    int max = 0;
    for(auto i:num){
        int b = i.second;
        if(b > max)max = b;
    }
    cout << max;
} 

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

int main() {
	long long N,k;cin>>N;
	long long ar [N][3];
	for(int i=0;i<N;i++)
	cin>>ar[i][0]>>ar[i][1]>>ar[i][2];
	//long long dp[N]={0};
	//dp[0]=0;
	for(int i=N-2;i>=0;i--)
	{  
		ar[i][0]=ar[i][0]+max(ar[i+1][2],ar[i+1][1]);
		ar[i][1]=ar[i][1]+max(ar[i+1][2],ar[i+1][0]) ;
		ar[i][2]=ar[i][2]+max(ar[i+1][1],ar[i+1][0]);
		
	}
	long long ans =ar[0][0];
	ans=max(ans,ar[0][1]);
	ans=max(ans,ar[0][2]);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 2560
package main

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

var (
	uft []int
	ch  []int
	ans []int64
)

func find(x int) int {
	if uft[x] == x {
		return x
	}

	uft[x] = find(uft[x])
	return uft[x]
}

func union(a, b, i int) {
	ans[i-1] = ans[i]
	ar, br := find(a), find(b)
	if ar == br {
		return
	}

	ans[i-1] -= int64(ch[ar] * ch[br])
	uft[ar] = br
	ch[br] += ch[ar]
}

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	as := make([]int, m)
	bs := make([]int, m)
	for i := 0; i < m; i++ {
		sc.Scan()
		as[i], _ = strconv.Atoi(sc.Text())
		sc.Scan()
		bs[i], _ = strconv.Atoi(sc.Text())
	}

	uft = make([]int, n+1)
	ch = make([]int, n+1)
	for i := range uft {
		uft[i] = i
		ch[i] = 1
	}

	ans = make([]int64, m)
	ans[m-1] = int64(n * (n - 1) / 2)
	for i := m - 1; i >= 1; i-- {
		union(as[i], bs[i], i)
	}

	for _, v := range ans {
		fmt.Println(v)
	}
}


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

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

    int hon = n % 10;
    if (hon == 3)
        cout << "bon" << endl;
    else if (hon == 0 || hon == 1 || hon == 6 || hon == 8)
        cout << "pon" << endl;
    else
        cout << "hon" << endl;
}

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

int s[4][32], d[32][32], grid[502][502];

int main(){
    int n, c; cin >> n >> c;
    for(int i=0;i<c;i++) for(int j=0;j<c;j++) cin >> d[i][j];
    for(int i=0;i<n;i++) for(int j=0;j<n;j++) cin >> grid[i][j];

    for(int i=0;i<c;i++){
        for(int j=0;j<n;j++)
            for(int k=0;k<n;k++) s[(j+k)%3][i] += d[grid[j][k]-1][i];
    }

    int ans = 1e9;
    for(int i=0;i<c;i++){
        for(int j=0;j<c;j++){
            if(i == j) continue;
            for(int k=0;k<c;k++){
                if(i == k || j == k) continue;
                ans = min(ans, s[0][i]+s[1][j]+s[2][k]);
            }
        }
    }

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


Measured memory_bytes: 1280
import numpy as np

pn,cn=list(map(int,input().split()))
x=list(list(map(int,input().split())) for _ in range(cn))
y=list([range(cn)])
z=np.hstack([np.array(x),np.array(y).T])
al=sorted(z,key=lambda a:(a[0],a[1]))

res=['']*cn
cnt=1

for i in range(cn):
	if i>0:
		if al[i-1][0]==al[i][0]:
			cnt+=1
		else:
			cnt=1
	res[al[i][2]]=str(1000000+al[i][0])[1:7]+str(1000000+cnt)[1:7]

for i in range(cn):
	print(res[i])

Measured memory_bytes: 68884
#include <stdio.h>
int main(){
    int a1,a2,a3;
    scanf("%d %d %d",&a1,&a2,&a3);
    int a=a1+a2+a3;
    if(a>=22){
        printf("bust");
    }
    else
    {
        printf("win");
    }
    
} 

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

using namespace std;

int main() {
	int n;
	long long ans = 0;
	cin >> n;
	for(int i = 1; i <= n; ++i) {
		if(i % 3 == 0) continue;
		if(i % 5 == 0) continue;
		ans += i;
	}
	cout << ans << endl;
	return 0;
}

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

int MOD=1000000007;
struct edge {
    int to, cost;
};

int modpow(int a,int x){
  if(a<0)a+=MOD;
  int ans=1;
  while(x>0){
    if(x&1) ans=ans*a%MOD;
      a=a*a%MOD;
      x>>=1;
  }
  return ans;
}

int gyaku(int n){
    return modpow(n,MOD-2);
}

auto factor(int n){
  map<int,int>res;
  for(int i=2;i*i<=n;i++){
      for(; n%i==0;n/=i) res[i]++;
  }
  if(n>1)res[n]++;
  return res;
}
////////////////////////////////////////////////////////////
signed main() {
  int n;
  cin>>n;
  vector<int>x(n);
  rep(i,n)cin>>x[i];
  vector<int>s=x;
  sort(s.begin(),s.end());
  int z1,z2;
    z1=s[n/2-1];
    z2=s[n/2];
    rep(i,n){
      if(x[i]<=z1)cout<<z2<<endl;
      else cout<<z1<<endl;
    }

  }


Measured memory_bytes: 6248
/**
 *      ABC 92 B
 *      author  : kyomukyomupurin
 *      created : 2018-08-30 17:35:04
**/

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int N, D, X; cin >> N >> D >> X;
    vector<int> v;
    for (int i = 0; i < N; ++i) {
        int x; cin >> x;
        v.push_back(x);
    }

    int sum = 0;
    for (int i = 0; i < N; ++i) {
        sum += ((D - 1) / v[i]) + 1;
    }

    cout << sum + X << '\n';

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
const ll mod = 1e9 + 7;

int h, w;
int graph[20][20];

int bfs(int a, int b) {
  queue<pair<int, int>> que;
  int dist[h][w];
  rep(i, h) rep(j, w) dist[i][j] = -1;
  dist[a][b] = 0;
  //方向ベクトル
  int dx[4] = {1, 0, -1, 0};
  int dy[4] = {0, 1, 0, -1};
  if (graph[a][b] == 1) return 0;
  que.push(make_pair(a, b));
  while (!que.empty()) {
    pair<int, int> v = que.front();
    que.pop();
    rep(i, 4) {
      pair<int, int> nv = make_pair(v.first + dy[i], v.second + dx[i]);
      if (nv.first < 0 || nv.second < 0 || nv.first >= h || nv.second >= w)
        continue;
      if (graph[nv.first][nv.second] == 1) continue;
      if (dist[nv.first][nv.second] != -1) continue;
      que.push(nv);
      dist[nv.first][nv.second] = dist[v.first][v.second] + 1;
    }
  }
  int r = 0;
  rep(i, h) rep(j, w) { r = max(r, dist[i][j]); }
  return r;
}

int main() {
  cin >> h >> w;
  rep(i, h) {
    string s;
    cin >> s;
    rep(j, w) {
      if (s[j] == '.')
        graph[i][j] = 0;
      else
        graph[i][j] = 1;
    }
  }
  int ans = 0;
  rep(i, h) rep(j, w) ans = max(ans, bfs(i, j));
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
bool check(vector<int>&v,int z,string s){
    if(s=="x"){
            for(int i=0;i<v.size();i++){
                if(z<=v[i]){
                    return false;
                }
            }
    }else{
             for(int i=0;i<v.size();i++){
                if(z>v[i]){
                    return false;
                }
            }
    }
    return true;
}
int main () {
  int n,m,x,y;
  cin>>n>>m>>x>>y;
  vector<int>xs;
  vector<int>ys;
  for(int i=0;i<n;i++){
    int x;
    cin>>x;
    xs.push_back(x);
  }
  for(int i=0;i<m;i++){
    int y;
    cin>>y;
    ys.push_back(y);
  }
  sort(xs.begin(),xs.end());
  for(int z=xs[xs.size()-1]+1;z<=100;z++){
      bool con1=false;
      bool con2=false;
      bool con3=false;
      if(z>x&&z<=y){
        con1=true;
      }
      con2=check(xs,z,"x");
      con3=check(ys,z,"y");
      if(con1&&con2&&con3){
        cout<<"No War"<<endl;
        return 0;
      }
  }
  cout<<"War"<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define il inline
#define ll long long
#define outy printf("Yes\n")
#define outn printf("No\n")
#define outf printf("First\n")
#define outs printf("Second\n")
#define FOR(a,b,c) for(int a=b;a<=c;a++)
#define FORD(a,b,c) for(int a=b;a>=c;a--)
#define FORL(a,b) for(int a=head[b];a;a=nxt[a])
#define in(a)  a=read()
#define in2(a,b)  in(a),in(b)
#define in3(a,b,c)  in2(a,b),in(c)
#define in4(a,b,c,d)  in2(a,b),in2(c,d)
#define out(a) printf("%d\n",a)
#define out2(a,b) printf("%d %d\n",a,b)
#define out3(a,b,c) printf("%d %d %d\n",a,b,c)
#define out4(a,b,c,d) printf("%d %d %d %d\n",a,b,c,d)
#define outl(a) printf("%lld\n",a)
#define outl2(a,b) printf("%lld %lld\n",a,b)
#define outl3(a,b,c) printf("%lld %lld %lld\n",a,b,c)
#define outl4(a,b,c,d) printf("%lld %lld %lld %lld\n",a,b,c,d)
#define clr(x,y) memset(x,y,sizeof(x))
ll read(){
    ll f=1,x=0;char c=getchar();
    while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();
    return x*f;
}
/*------------------------------------------------------------*/
#define mod 1000000007
#define maxn 300010
#define inf 0x7fffffff
/*------------------------------------------------------------*/
int n,m;
char a[maxn];
int f[maxn],g[maxn];
int main(){
	int n;
	in(n);
	scanf("%s",a+1);
	FOR(i,1,n)f[i]=f[i-1]+(a[i]=='W');
	FORD(i,n,1)g[i]=g[i+1]+(a[i]=='E');
	int ans=inf;
	FOR(i,1,n){
//		out2(f[i-1],g[i+1]);
		if(f[i-1]+g[i+1]<ans)ans=f[i-1]+g[i+1];
	}
	out(ans);
}

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

int main() {
    string st; cin >> st;
    for(int i = 0; i < 3; i++) {
        if(st[i] == '1') {
            cout << 9;
        } else {
            cout << 1;
        }
    }
    cout << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <functional>
#include <bitset>
#include <limits>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <random>

#ifdef DEBUG
#include "library/Utility/debug.cpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i=0;i<(n);++i)
#define EL '\n'
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using lnt = long long;
struct FIO{FIO(){std::cin.tie(0);std::cout.tie(0);std::ios_base::sync_with_stdio(0);std::cout<<std::fixed<<std::setprecision(15);}}fIO;
/*-*/

int main() {
	int n;
	std::cin >> n;
	std::vector<lnt> a(n);
	rep(i,n) std::cin >> a[i];
	std::sort(a.rbegin(),a.rend());
	std::priority_queue<lnt> que;
	que.emplace(a[0]);
	lnt ans=0;
	for(int i=1;i<n;i++) {
		ans+=que.top();
		que.pop();
		que.emplace(a[i]);
		que.emplace(a[i]);
	}
	print(ans);
}


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

#define int ll
#define FOR(i,n,k) for(int i=n;i<k;i++)
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

struct node
{
    int v,p;
};

bool cmp(node a,node b)
{
    if(a.p!=b.p) return a.v < b.v;
}

int32_t main()
{
    IOS;
    int n;
    cin>>n;
    n++;
    node a[n];
    FOR(i,1,n)
    {
        cin>>a[i].v;
        a[i].p = i;
    }
    sort(a+1,a+n,cmp);
    FOR(i,1,n) cout<<a[i].p<<" ";
    return 0;
}

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

typedef long long int int64;
typedef unsigned long long int uint64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

void run(void){
  int n;
  scanf("%d",&n);
  int *a=(int *)malloc(sizeof(int)*n);
  int i;
  for(i=0;i<n;i++) scanf("%d",a+i);
  int sum=0;
  for(i=0;i<n;i++) sum+=a[i];

  const int b=64;
  const int len=(sum+b-1)/b;
  uint64 *bit=(uint64 *)calloc(len,sizeof(uint64));
  bit[0]=1;
  int localSum=0;
  for(i=0;i<n;i++){
    const int aa=a[i];
    int j;
    for(j=localSum/b;j>=0;j--){
      if(aa%b!=0){
	bit[(b*j+aa)/b+1]|=bit[j]>>(b-aa%b);
      }
      bit[(b*j+aa)/b]|=bit[j]<<(aa%b);
    }
    localSum+=aa;
  }
  int median=(sum+1)/2;
  while(((bit[median/b]>>(median%b))&0x01)==0) median++;
  printf("%d\n",median);
}

int main(void){
  run();
  return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll hor[300005] , ver[300005];

int main(){

  ll n,m,t,res = 0;
  cin>>n>>m>>t;
  set<pair<ll,ll>>s;
  set<ll> px, py;
  while (t--){
      ll x, y; cin>>x>>y;
      hor[x]++; ver[y]++;
      s.insert({x,y});
  }
  
  ll mx = *max_element(hor,hor+300005);
  ll my = *max_element(ver,ver+300005);
  
  for(ll i=1;i<=300005;i++){
      if(hor[i]==mx)px.insert(i);
      if(ver[i]==my)py.insert(i);
  }

  for(auto i:px){
      for(auto j:py){
          ll tmp = hor[i] + ver[j];
          if(s.find({i,j})!=s.end())tmp-=1;
          res = max(res,tmp);
          if(res == mx+my){
              cout<<res; return 0;
          }
      }
  }
  
  cout<<res;
}

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

class Dice{
public:
    int Now[7], Will[7];
    
    Dice(int N[]){
        for(int i=1; i<7; i++){
            Now[i]=N[i];
            Will[i]=N[i];
        }
    }
    
    void move_S(){
        Will[1] = Now[5];
        Will[2] = Now[1];
        Will[6] = Now[2];
        Will[5] = Now[6];
        
        for(int i=1; i<7; i++){
            Now[i] = Will[i];
        }
    }
    
    void move_E(){
        Will[1] = Now[4];
        Will[3] = Now[1];
        Will[6] = Now[3];
        Will[4] = Now[6];
        
        for(int i=1; i<7; i++){
            Now[i] = Will[i];
        }
    }
    
    void move_N(){
        Will[1] = Now[2];
        Will[5] = Now[1];
        Will[6] = Now[5];
        Will[2] = Now[6];
        
        for(int i=1; i<7; i++){
            Now[i] = Will[i];
        }
    }
    
    void move_W(){
        Will[1] = Now[3];
        Will[4] = Now[1];
        Will[6] = Now[4];
        Will[3] = Now[6];
        
        for(int i=1; i<7; i++){
            Now[i] = Will[i];
        }
    }

    void turn(){
        Will[2] = Now[4];
        Will[3] = Now[2];
        Will[5] = Now[3];
        Will[4] = Now[5];

        for(int i=1; i<7; i++){
            Now[i] = Will[i];
        }
    }
    
    int top(){
        return Now[1];
    }

    int front(){
        return Now[2];
    }

    int right(){
        return Now[3];
    }

    int left(){
        return Now[4];
    }

    int back(){
        return Now[5];
    }

    int bottom(){
        return Now[6];
    }
};


int main(){
    int Face1[7];
    for(int i=1; i<7; i++){
        cin >> Face1[i];
    }
    int Face2[7];
    for(int j=1; j<7; j++){
        cin >> Face2[j];
    }

    Dice dice1(Face1);
    Dice dice2(Face2);

    if(dice1.top() != dice2.top() || dice1.bottom() == dice2.front()){
        dice1.move_N();
        if(dice1.top() != dice2.top() || dice1.bottom() == dice2.front()){
            dice1.move_W();
            if(dice1.top() != dice2.top() || dice1.bottom() == dice2.front()){
                dice1.move_W();
                if(dice1.top() != dice2.top() || dice1.bottom() == dice2.front()){
                    dice1.move_W();
                    if(dice1.top() != dice2.top() || dice1.bottom() == dice2.front()){
                        dice1.move_N();
                    }
                }
            }
        }
    }

    if(dice1.front() != dice2.front()){
        dice1.turn();
        if(dice1.front() != dice2.front()){
            dice1.turn();
            if(dice1.front() != dice2.front()){
                dice1.turn();
            }
        }
    }


    if(dice1.right() == dice2.right()){
        if(dice1.left() == dice2.left()){
            if(dice1.back() == dice2.back()){
                if(dice1.bottom() == dice2.bottom()){
                    cout << "Yes" << endl;
                } else {
                    cout << "No" << endl;
                }
            } else {
                cout << "No" << endl;
            }
        } else {
            cout << "No" << endl;
        }
    } else {
        cout << "No" << endl;
    }

    
return 0;
}


Measured memory_bytes: 3100
#include <iostream>
using namespace std;
int main()
{
	int x1, x2, x3, x4;
	int y1, y2, y3, y4;
	cin >> x1 >> y1 >> x2 >> y2;
	int dx, dy;
	dx = x2 - x1;
	dy = y2 - y1;
	x3 = x2 - dy;
	y3 = y2 + dx;
	x4 = x1 - dy;
	y4 = y1 + dx;
	cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pi acos(-1)
int main()
{
  long long n,x,y,z; cin>>n;
  if(n%1000==0) cout<<0<<endl;
  else {
  x=n/1000;
  y=(x+1)*1000;
  z=(y-n);
  cout<<z<<endl;
}

}


Measured memory_bytes: 3616
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<map>
#include<stdbool.h>
#include<math.h>
#include<sstream>
#include<math.h>
#include<vector>
#include<functional>
#include<queue>
#include<utility>
#include<bitset>
typedef long long ll;
#define N (1000000000+7)
#define INF 1e10
using namespace std;
typedef pair<ll, ll> P;

ll dp[50][2] = { 0 };
int main(void) {
	string s, t;
	int k;
	cin >> s >> k;
	set<string>st;
	for (int i = 0;i < s.length();i++) {
		t = "";
		for (int j = i;j < i + k;j++) {
			if (j >= s.length())break;
			t += s[j];
			st.insert(t);
		}
	}
	ll count = 0;
	for (auto itr = st.begin();itr != st.end();++itr) {
		count++;
		if (count == k) {
			cout << *itr << endl;
			return 0;
		}
	}
}

Measured memory_bytes: 1664
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {
	
	public static long MergeSort(final int[] A, final int left, final int right){ //[left, right)        
		if(left + 1 < right){
            final int mid = (left + right) / 2;
             
            long ret = 0;
            ret += MergeSort(A, left, mid);
            ret += MergeSort(A, mid, right);
             
            final int l_size = mid - left;
            final int r_size = right - mid;
            final int size = l_size + r_size;
            int[] ls = new int[l_size];
            for(int i = 0; i < l_size; i++){
                ls[i] = A[left + i];
            }
            int[] rs = new int[r_size];
            for(int i = 0; i < r_size; i++){
                rs[i] = A[mid + i];
            }
             
            int l_pos = 0, r_pos = 0;
            int count = 0;
            while(count < size){
            	if(l_pos == l_size){
            		A[left + count] = rs[r_pos];
            		r_pos++;
            	}else if(r_pos == r_size){
            		A[left + count] = ls[l_pos];
            		l_pos++;
            	}else if(ls[l_pos] <= rs[r_pos]){
                    A[left + count] = ls[l_pos];
                    l_pos++;
                }else{
                    A[left + count] = rs[r_pos];
                    ret += ((mid + r_pos) - (left + count));
                    r_pos++;
                }
                
                count++;
            }
             
            return ret;
        }
         
        return 0;
    }
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		int[] array = new int[n];
		for(int i = 0; i < n; i++){
			array[i] = sc.nextInt();
		}
		
		System.out.println(MergeSort(array, 0, array.length));
	}
	
	public static class Scanner {
	    private BufferedReader br;
	    private StringTokenizer tok;

	    public Scanner(InputStream is) throws IOException {
	        br = new BufferedReader(new InputStreamReader(is));
	    }

	    private void getLine() throws IOException {
	        while (!hasNext()) { tok = new StringTokenizer(br.readLine()); }
	    }

	    private boolean hasNext() {
	        return tok != null && tok.hasMoreTokens();
	    }

	    public String next() throws IOException {
	        getLine(); return tok.nextToken();
	    }

	    public int nextInt() throws IOException {
	        return Integer.parseInt(next());
	    }
	    
	    public long nextLong() throws IOException {
	    	return Long.parseLong(next());
	    }
	    
	    public void close() throws IOException {
	        br.close();
	    }
	}

}

Measured memory_bytes: 63932
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
  let stdin = stdin();
  let stdin = stdin.lock();
  let token: String = stdin
    .bytes()
    .map(|c| c.expect("failed to read char") as char)
    .skip_while(|c| c.is_whitespace())
    .take_while(|c| !c.is_whitespace())
    .collect();
  token.parse().ok().expect("failed to parse token")
}

use std::cmp::{max, min};
use std::collections::HashMap;

fn main() {
  let n = read::<i64>();
  let s = read::<String>();
  let mut memo = vec![0; n as usize];
  let s_vec: Vec<char> = s.chars().collect();

  // 右から
  let mut point = 0;
  for i in 0..n - 1 {
    let i_usize = i as usize;
    let current = s_vec[i_usize];
    let next = s_vec[i_usize + 1];

    if current == 'E' {
      point += 1;
    }

    if current == 'E' && next == 'W' {
      memo[i_usize] += point;
      memo[i_usize + 1] += point;
    }

    if i == n - 2 && current == 'E' && next == 'E' {
      memo[i_usize + 1] += point + 1;
    }
  }

  // 左から
  let mut point2 = 0;
  for i in 0..n - 1 {
    let back_i = n - i - 1;
    let back_i_usize = back_i as usize;
    let current = s_vec[back_i_usize];
    let next = s_vec[back_i_usize - 1];

    if current == 'W' {
      point2 += 1;
    }

    if current == 'W' && next == 'E' {
      memo[back_i_usize] += point2;
      memo[back_i_usize - 1] += point2;
    }

    if i == n - 2 && current == 'W' && next == 'W' {
      memo[back_i_usize - 1] += point2 + 1;
    }
  }

  let max_cnt = memo.iter().max().unwrap();
  println!("{}", n - max_cnt);
}



Measured memory_bytes: 10492
#include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <vector>

#define int long long

using namespace std;

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

    int n;

    cin >> n;

    vector<int> mons(n + 1);
    
    for (int i = 0; i < n + 1; ++i)
    {
        cin >> mons[i];
    }

    vector<int> bra(n);
    for (int i = 0; i < n; ++i)
    {
        cin >> bra[i];
    }

    int score = 0;
    int before = 0;

    const int zero = 0;
    for (int i = n - 1; i >= 0; --i)
    {
        //候補を用意
        int sum = mons[i] + mons[i + 1];
        //討伐
        score += std::min(sum, bra[i]);
        //iへの火力
        const auto diff = max(zero, bra[i] - mons[i + 1]);
        //残りカウント
        mons[i] = max(zero, mons[i] - diff);
    }

    cout << score << endl;
}

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

using namespace std;
using ll = long long;
// #define int ll
using PII = pair<ll, ll>;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()

template<typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> bool IN(T a, T b, T x) { return a<=x&&x<b; }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }

template<typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type
fill_v(T &t, const V &v) { t=v; }
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t, const V &v ) { for(auto &e:t) fill_v(e,v); }

template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.first<<','<<a.second<<')'; return out;
}
template<class T>
ostream &operator <<(ostream& out,const vector<T>& a){
    out<<'['; for(T i: a) {out<<i<<',';} out<<']'; return out;
}

int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0}; // DRUL
const int INF = 1<<30;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;

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

    ll n;
    cin >> n;

    if(n == 3) {
        cout << 2 << endl;
        cout << 1 << " " << 3 << endl;
        cout << 2 << " " << 3 << endl;
        return 0;
    }

    ll t = n * (n-1) / 2;
    // t を 分割する
    
    vector<PII> v;
    if(n%2==0) {
        FOR(i, 1, n/2+1) {
            v.push_back({i, n-i+1});
        }
    } else {
        FOR(i, 1, n/2+1) {
            v.push_back({i, n-i});
        }
        v.push_back({-1, n});
    }
    // cout << v << endl;
    vector<PII> ans;
    REP(i, v.size()) {
        FOR(j, i+1, v.size()) {
            if(i == j) continue;
            if(v[j].first != -1) ans.push_back({v[i].first, v[j].first});
            ans.push_back({v[i].first, v[j].second});
            if(v[j].first != -1) ans.push_back({v[i].second, v[j].first});
            ans.push_back({v[i].second, v[j].second});
        }
    }
    cout << ans.size() << endl;
    sort(ALL(ans));
    REP(i, ans.size()) cout << ans[i].first << " " << ans[i].second << endl;

    // vector<ll> sum(n+1);
    // for(auto p: ans) {
    //     sum[p.first] += p.second;
    //     sum[p.second] += p.first;
    // }
    // cout << sum << endl;
    
    return 0;
}


Measured memory_bytes: 512
object Main extends App {
	val a = Array(1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
	val k = scala.io.StdIn.readInt - 1
	println(a(k))
}

Measured memory_bytes: 25292
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>

using namespace std;

int main(){
	string input;
	cin>>input;
	
	for(register int i=0; i<input.length(); i++){
		if('A' <= input[i] && input[i] <= 'Z' && input[i] != 'A' && input[i] != 'C'){
			puts("WA");
			return 0;
		}
	}
	
	if(input[0] != 'A'){
		puts("WA");
		return 0;
	}
	
	int tmp = 0;
	for(register int i=2; i<input.length()-1; i++){
		if(input[i] == 'C'){
			tmp++;
		}
	}
	
	if(tmp != 1){
		puts("WA");
		return 0;
	}
	
	puts("AC");
	return 0;
}


Measured memory_bytes: 256
use proconio::input;

fn main() {
    input! {
        s: String,
        t: String,
    }

    let ok: bool = s.chars().zip(t.chars()).all(|(a, b)| a == b) && s.len() + 1 == t.len();
    let ans = if ok { "Yes" } else { "No" };
    println!("{}", ans);
}


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

int sum[200] = {0};
int memo[200][2] = {0};
int ans[1000005][2] = {0};
int n, size[2];

void setans();

int main() {
  setans();
  while(1) {
    cin >> n;
    if(n == 0) break;
    cout << ans[n][0] << " " << ans[n][1] << endl;
  }
  return 0;
}

void setans() {
  size[0] = size[1] = 1;
  sum[0] = memo[0][0] = memo[0][1] = 1;
  while(memo[size[0] - 1][0] < 1000000) {
    sum[size[0]] = sum[size[0] - 1] + size[0] + 1;
    memo[size[0]][0] = memo[size[0] - 1][0] + sum[size[0]];
    if(memo[size[0]][0] % 2 == 1)
      memo[size[1]++][1] = memo[size[0]][0];
    ++size[0];
  }
  --size[1];
  --size[0];
  for(int t = 0; t < 2; ++t)
    for(int i = 1; i < 1000001; ++i) ans[i][t] = 100000000;
  for(int t = 0; t < 2; ++t)
    for(int i = 0; i < size[t]; ++i)
      for(int j = 1; j < 1000001; ++j) {
        int now = memo[i][t];
        if(j >= now)
          ans[j][t] = min(ans[j][t], ans[j - now][t] + 1);
      }
}



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

int main(){
    string S;
    cin >> S;
    string ans;
    if(S[0] == 'S') ans = "Cloudy";
    if(S[0] == 'C') ans = "Rainy";
    if(S[0] == 'R') ans = "Sunny";
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int main()
{
    long long n,k,ans=0;
    cin >> n>> k;
    if(k==0) ans=n*n;
    else
    {
        for(int b=k+1;b<=n;b++)
        {
        ans+=(n/b)*(b-k);
        if(n%b>=k) ans+=n%b-k+1;
        }
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 256
using System;

class Program {
    static void Main() {
        string[] stdin = Console.ReadLine().Split();
        int w = int.Parse(stdin[0]);
        int h = int.Parse(stdin[1]);
        int x = int.Parse(stdin[2]);
        int y = int.Parse(stdin[3]);
        int r = int.Parse(stdin[4]);
        Console.WriteLine(x >= r && y >= r && x + r <= w && y + r <= h? "Yes": "No");
    }
}


Measured memory_bytes: 15988
#include<map>
int64_t K,d=1,n,_;int S(int64_t n){return n?S(n/10)+n%10:0;}main(){for(scanf("%d",&K);printf("%ld\n",n+=d),--K;S(_=n+d+d)*(n+d)<=S(n+d)*_?:d*=10);}

Measured memory_bytes: 128
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma warning(disable:4996)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
#include <ctime>
using namespace std;
typedef long long ll;

const int INF = 100000000;





int main(int argc, char *args[]) {
	ll N;
	ll A, B, C, D, E;
	cin >> N;
	cin >> A >> B >> C >> D >> E;
	ll M = min({ A,B,C,D,E });
	cout << ((N + M - 1) / M) + 4 << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#define NIL -1
struct Node{
    int left;
    int right;
    int parent;
};
 
int sibling(int);
int children(int);
int depth(int);
int height(int);
void judge(int);

struct Node inputNodedata[10000];
 
int main(){
 
    int sumNode,Nodeid,i,j,leftdata,rightdata;
 
    scanf("%d",&sumNode);
    for(i = 0; i < sumNode; i++){
        inputNodedata[i].left = NIL;
        inputNodedata[i].right = NIL;
        inputNodedata[i].parent = NIL;
  }
  
    for(i = 0; i < sumNode; i++){
        scanf("%d",&Nodeid);
        scanf("%d",&leftdata);
        scanf("%d",&rightdata);
 
        inputNodedata[Nodeid].left = leftdata;
        inputNodedata[Nodeid].right = rightdata;
 
        if(leftdata != NIL) {
            inputNodedata[leftdata].parent = Nodeid; 
        }
 
        if(rightdata != NIL){
            inputNodedata[rightdata].parent = Nodeid;
 
        }
    }
 
    for(i = 0; i < sumNode; i++){
        printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, ",i,inputNodedata[i].parent,sibling(i),children(i),depth(i),height(i));
        judge(i);
    }
 
    return 0;
 
}
 
 
int sibling(int Nodeid){ 
    if(inputNodedata[Nodeid].parent == NIL){
        return NIL;
    }

    else  if(inputNodedata[inputNodedata[Nodeid].parent].left != Nodeid && inputNodedata[inputNodedata[Nodeid].parent].left != NIL){
        return inputNodedata[inputNodedata[Nodeid].parent].left;
    }
 
    else if(inputNodedata[inputNodedata[Nodeid].parent].right != Nodeid && inputNodedata[inputNodedata[Nodeid].parent].right != NIL){
        return inputNodedata[inputNodedata[Nodeid].parent].right;
    }
 
    else {
        return NIL; 
    }
}
 
int children(int Nodeid){    
    int sumchild ;
    sumchild = 0;
    
    if(inputNodedata[Nodeid].left != NIL){
        sumchild = sumchild + 1;
    }
    
    if(inputNodedata[Nodeid].right != NIL){
        sumchild = sumchild + 1;
    }

    return sumchild;    
}
 
int depth(int Nodeid){
    int depth = 0;
    int id = inputNodedata[Nodeid].parent;

    while(id != NIL){
        id = inputNodedata[id].parent;
        depth = depth + 1;
    }

    return depth;
}
 
int height(int Nodeid){
    int leftheight=0,rightheight=0;
    
    if(inputNodedata[Nodeid].left != NIL){
        leftheight = height(inputNodedata[Nodeid].left) + 1;
    }
    
    if(inputNodedata[Nodeid].right != NIL){
        rightheight = height(inputNodedata[Nodeid].right) + 1;
    
    }
    
    if(leftheight > rightheight){
        return leftheight;    
    }
    
    else{
        return rightheight;
    }
    
}
    
    
void judge(int i){    
    if(inputNodedata[i].parent == NIL){
        printf("root\n");
    }
    
    else if(inputNodedata[i].left ==NIL && inputNodedata[i].right == NIL){
        printf("leaf\n");
    }
    
    else{
        printf("internal node\n");
    }
} 

Measured memory_bytes: 612
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define MOD (int) (1e9+7)
#define INF (int) 2e9
#define LLINF (ll) 2e18

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

    set <string> ss;
    for (int i = 0; i < s.size(); i++) {
        for (int j = i; j < min(i+k, (int) s.size()); j++) {
            ss.insert(s.substr(i, j-i+1));
            // printf("%s\n", s.substr(i, j-i+1));
        }
    }

    int id =0;
    for (auto sss : ss) {
        id++;
        if(id==k) cout << sss << endl;
        // cout << sss << endl;
    }
    return 0;
}

Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rrep(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    ll n, m;
    cin >> n >> m;

    ll ans = 1;
    for (ll g = 1; g <= sqrt(m); g++) {
        if (m % g == 0) {
            ll h = m / g;
            if (g <= m/n) ans = max(ans, g);
            if (h <= m/n) ans = max(ans, h);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,c) for(int i=0;i<c;++i)
int main(){
 string s;
 cin >> s;
 bool isgood = true;
 rep(i,4)
 if(s[i]==s[i+1]) isgood = false;
 if(isgood){
     cout << "Good" << endl;
 }else{
     cout << "Bad" << endl;
 }
 return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <list>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <numeric>
#include <unordered_set>
#include <unordered_map>
#include <chrono>
#include <random>
#include <bits/stdc++.h>
 
using namespace std;
 
#define ll long long
#define PI 3.14159265358979323846
#define min(a,b) ((a<b)?(a):(b))
#define max(a,b) ((a<b)?(b):(a))
#define abs(a) ((a>0)?a:-(a))
#define pii pair<int,int>

const double eps = (double)1e-6;
const int maxn = 2e5+5;
const ll mod = 1e9+7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

ll arr[maxn];

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

    ll n,k; cin >> n >> k;
    if (n <= k) { cout << 0 << endl; return 0;}
    for (int i = 0; i < n; i++) cin >> arr[i];
    sort(arr,arr+n);
    ll ans = 0;
    for (int i = 0; i < n-k; i++) ans += arr[i];
    cout << ans << endl;


}



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


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

    vector<vector<int>> s(M);
    int k, t;
    rep(i, M) {
        cin >> k;
        rep(j, k) {
            cin >> t;
            s[i].push_back(t - 1);
        }
    }
    vector<int> p(M);
    rep(i, M) cin >> p[i];

    int ans = 0;
    for (int bit = 0; bit < (1 << N); bit++) {
        bool are_light = true;
        for (int i = 0; i < M; i++) {
            int count = 0;
            for (auto ss : s[i]) {
                if (bit & (1 << ss)) count++;
            }
            if (count % 2 != p[i]) are_light = false;
        }
        if (are_light) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3616
#include<math.h>
long N,A;
main()
{
	scanf("%ld%ld",&N,&A);
	long ans=N;
	for(int k=1;k<40;k++)
	{
		long p=pow(N,1./(k+1));
		long now=1;
		for(int i=0;i<k;i++)now*=p;
		for(int i=0;i<=k;i++)
		{
			ans=fmin(ans,A*k+p*k+i+(N+now-1)/now);
			now=now/p*(p+1);
		}
	}
	printf("%ld\n",ans);
}


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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string c1;
    cin >> c1;
    string c2;
    cin >> c2;
    string c3;
    cin >> c3;
    cout << c1[0] << c2[1] << c3[2] << "\n";
    return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int[] kazu=new int[N];
		int odd=0;
		int even=0;
		for(int i=0; i<N; i++) {
			kazu[i]=sc.nextInt();
			if(kazu[i]%2==0) {
				even++;
			}
			else {
				odd++;
			}
		}
		if(odd%2==0) {
			System.out.println("YES");
		}
		else {
			System.out.println("NO");
		}
	}
}

Measured memory_bytes: 52444
s = []
t = []
N = int(input())
for _ in range(N):
    s.append(input())
M = int(input())
for _ in range(M):
    t.append(input())
s_set = set(s)
s_list = list(s_set)
c = []
count = 0
for i in range(len(s_list)):
    for j in range(len(s)):
        if s_list[i] == s[j]:
            count += 1
    for k in range(len(t)):
        if s_list[i] == t[k]:
            count -= 1
    c.append(count)
    count = 0
ans = max(c)
if ans > 0:
    print(ans)
else:
    print(0)

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

#include <fstream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <bitset>
#include <numeric>
#include <unordered_set>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <numeric>
#include <cstdlib>
#include <random>
#include <bits/stdc++.h>


using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
//typedef vector<ll> vec;
//typedef vector<vec> mat;

const ll mod=1000000007ll;
const ll inf=1000000000000000ll;

ll D,N;

int main(){
  cin>>D>>N;
  ll ans;
  if(N==100)ans=pow(100,D)*101;
  else ans=pow(100,D)*N;

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


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    unsigned long A, B, C, D;

    cin >> A >> B >> C >> D;

    unsigned long zbc = B/C;
    unsigned long zac = (A-1)/C;
    unsigned long c = zbc - zac;

    unsigned long zbd = B/D;
    unsigned long zad = (A-1)/D;
    unsigned long d = zbd - zad;

    unsigned long GCD;
    {
        unsigned long a, b, x, r;
        a = C;
        b = D;
        x = a * b;
        if ( a > b ) swap( a, b );
        r = a%b;
        while ( r ) {
            a = b;
            b = r;
            r = a%b;
        }
        GCD = x/b;

    }

    unsigned long zbgcd = B/GCD;
    unsigned long zagcd = (A-1)/GCD;
    unsigned long gcd = zbgcd - zagcd;

    cout << B - (A-1) - c - d + gcd << endl;

    return 0;
}


Measured memory_bytes: 256
# 【abc-178】個人的ふりかえり（A〜E）
# https://qiita.com/nyororingo/items/d372d1ff3f690b0d1fe2

S = int(input())
MOD = 10 ** 9 + 7
    
dp = [0] * (S + 1)
dp[0] = 1
for i in range(3, S + 1):
    #print(dp)
    for j in range((i - 3) + 1):

        dp[i] += dp[j]
        dp[i] %= MOD
print(dp[S] % MOD)

Measured memory_bytes: 9020
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<map>
#include<stack>
#include<set>
using namespace std;
int main(){
	int a,b;
	cin >> a >> b;
	for(int i = 1;i <= a;i++){
	string s;
	cin >> s;
	cout << s << endl;
	cout << s << endl;
	}
	return 0;
	}

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

int main(){
  int a, b;
  cin >> a >> b;
  if(b < 0) {
    if(abs(a - b) % 2 == 1) cout << "Positive" << endl;
    else cout << "Negative" << endl;
  } else if(a > 0) cout << "Positive" << endl;
  else cout << "Zero" << endl;
  return 0;
}

Measured memory_bytes: 256
#pragma region RegionDefs
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include "boost/multi_array.hpp"
#define rep(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define reps(i,j,n) for(int i=(j),i##_len=(n);i<i##_len;++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define all(x) begin(x),end(x)
using namespace std;
const int INF = 1e9;
template<class T=int> using P  = pair<T, T>;
template<class T=int> using V  = vector<T>;
template<class T=int> using PQ = priority_queue<T>;
template<class T=int> using PQG = priority_queue<T, V<T>, greater<T>>;
typedef long long ll;
const ll MOD = 1000000007LL;
void in() {}
template<class Head, class... Tail>
void in(Head&& head, Tail&&... tail)
{
    cin >> head;
    in(move(tail)...);
}
#define IN(...) ll __VA_ARGS__; in(__VA_ARGS__)

//時間が厳しいとき使う
#define INI(...) int __VA_ARGS__; in(__VA_ARGS__)
#define INS(T, ...) T __VA_ARGS__; in(__VA_ARGS__)
#define VIN(T, v, n) V<T> v(n); for(auto& _elem:v)cin>>_elem
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;}
#define y0 y__0
#define y1 y__1
#define j0 j__0
#define j1 j__1
#pragma endregion RegionDefs

void solve()
{
    IN(n, k);
    ll i = 0;
    while (n != 0)
    {
        n /= k;
        ++i;
    }
    cout << i << endl;
}

int main()
{
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(numeric_limits<double>::max_digits10);

    solve();

    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env pypy
from __future__ import division, print_function

import os
import sys
from __builtin__ import xrange as range
from cStringIO import StringIO
from future_builtins import ascii, filter, hex, map, oct, zip
from io import IOBase

import __pypy__


def main():
    n = int(input())
    nums = read_int_array()
    S = sum(nums)
    min_diff = S
    pr = 0
    for x in nums:
        pr += x
        S -= x
        min_diff = min(min_diff, abs(S - pr))
    print(min_diff)

# region fastio

BUFSIZE = 8192


class FastI(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = StringIO()
        self.newlines = 0

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count("\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()


class FastO(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = __pypy__.builders.StringBuilder()
        self.write = lambda s: self._buffer.append(s)

    def flush(self):
        os.write(self._fd, self._buffer.build())
        self._buffer = __pypy__.builders.StringBuilder()


def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

read = input
read_int = lambda: int(input())
read_array = lambda sep=None, maxsplit=-1: input().split(sep, maxsplit)
read_int_array = lambda: [int(a) for a in read_array()]

if __name__ == "__main__":
    main()


Measured memory_bytes: 29804