akhauriyash/Code-Regression huggingface dataset:
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = std::numeric_limits<long long>::max();
const double PI = acos(-1);
#define fir first
#define sec second
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Mfor(i,mf) for(LL i=mf-1;i>=0;i--)
LL h, w, n, m, k, s, t, q, ans, sum, last, cnt, a[1000000];
Pll mn[1000000];
struct Edge { LL to,cost; };
vector<Edge>vec;
int  par[1000000];  // リーダーの値を格納 
int find(int x) { if (par[x] == x)return x; par[x] = find(par[x]); return par[x]; }
void unite(int x, int y) { x = find(x); y = find(y); if (x == y)return; par[x] = y; }
bool same(int x, int y) { return find(x) == find(y); }
bool f=0;
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
int main() {
	for (int i = 0; i < 1000000; i++)par[i] = i;
	for (int i = 0; i < 1000000; i++)mn[i].fir = INF;
	cin >> n >> m;
	rep(i, n) {
		cin >> a[i];
	}
	rep(i, m) {
		LL x, y;
		cin >>x >> y;
		unite(x, y);
	}
	rep(i, n) {
		if (mn[find(i)].fir> a[i]) {
			mn[find(i)].fir = a[i];
			mn[find(i)].sec = i;
		}
	}
	rep(i, n) {
		if (mn[i].fir != INF) {
			ans += mn[i].fir;
			cnt++;
			a[mn[i].sec] = INF;
		}
	}
	sort(a, a + n);
	if (cnt < 2) {
		cout << 0 << endl;
		return 0;
	}
	cnt -= 3;
	while(cnt>=0) {
		if (a[cnt] == INF) {
			cout << "Impossible" << endl;
			return 0;
		}
		ans += a[cnt];
		cnt--;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 20736
#pragma GCC optimize ("Ofast")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

int N;
int A[200001];
int E[400001], ne[400001], he[200001];
vector<int> V;

void dfs(int p, int mae) {

	int itr = lower_bound(V.begin(), V.end(), A[p]) - V.begin();
	if (itr == V.size()) {
		V.pb(A[p]);
		for (auto to = he[p]; to; to = ne[to]) {
			if (E[to] != mae) {
				dfs(E[to], p);
			}
		}
		he[p] = V.size();
		V.pop_back();
	}
	else {
		swap(V[itr], A[p]);
		for (auto to = he[p]; to; to = ne[to]) {
			if (E[to] != mae) {
				dfs(E[to], p);
			}
		}
		he[p] = V.size();
		V[itr] = A[p];
	}
}

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci += 72 - dig >> 3;
	return tmp;
}
inline int getintA() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	int dig = ((tmp & ma0) ^ ma0) ? 68 - __builtin_ctzll((tmp & ma0) ^ ma0) : 0;
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci += (64 - dig >> 3);
	while ((ct = *ci++) >= '0') tmp = tmp * 10 + ct - '0';
	return tmp;
}

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

	N = getint();
	rep1(i, N) A[i] = getintA();
	int k = 1;
	rep(i, N - 1) {
		int u = getint(), v = getint();
		E[k] = v;
		ne[k] = he[u];
		he[u] = k++;
		E[k] = u;
		ne[k] = he[v];
		he[v] = k++;
	}

	V.pb(2000000000);
	dfs(1, -1);

	rep1(i, N) printf("%d\n", he[i]);

	Would you please return 0;
}

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

int main(){
	long long int n,k,num,ans=0;
	cin>>n>>k;

	num=n/k;
	ans+=num*num*num;

	if(k%2==0){
		num=(n+k/2)/k;

		ans+=num*num*num;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007

typedef long long int lli;

int main(void) {
  // 105, 135, 165, 189, 195
  int n;
  scanf("%d", &n);
  int ans = 0;
  if ( n >= 105 ) ans++;
  if ( n >= 135 ) ans++;
  if ( n >= 165 ) ans++;
  if ( n >= 189 ) ans++;
  if ( n >= 195 ) ans++;
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 128
import random
import time
import copy
import math
start=time.time()
d=int(input())
c=list(map(int, input().split()))
cli=[]
for i in range(d+1):
  ch=[]
  for j in c:
    ch.append(i*j)
  cli.append(ch)
s=[]
solution=[]
last=[0]*26
sco=0
for i in range(d):
  s.append(list(map(int, input().split())))
for day in range(1,d+1):
  man=[]
  for i in range(26):
    man.append(s[day-1][i]+last[i]*c[i])
  con=man.index(max(man))
  sco+=s[day-1][con]
  last[con]=day
  for (i,j) in zip(last,range(26)):
    sco-=cli[i][j]
  solution.append(con)
#print(sco)
stemp=1000000
etemp=10000
def tem():
  return stemp-((stemp-etemp)*(time.time()-start)/1.9)
while time.time()-start<1.9:
  
  sc=0
  sol=copy.deepcopy(solution)
  for x in [random.randrange(d) for i in range(3)]:
    sol[x]=random.randrange(26)
  last=[0]*26
  for (day,i) in zip(range(1,d+1),sol):
    sc+=s[day-1][i]
    last[i]=day
    for (i,j) in zip(last,range(26)):
      sc-=cli[i][j]
  prob = math.exp((sco-sc)/tem())
  if 1-prob>random.random():
    solution=copy.deepcopy(sol)
    sco=sc
for i in solution:
  print(i+1)
#print(sco)

Measured memory_bytes: 10300
#include<stdio.h>
 
int main(){
   
  int x,i,fibo[44];

   scanf("%d",&x);
   for(i=0; i<=x; i++){
      if(i==0) fibo[i]=1;
      if(i==1) fibo[i]=1;
      if(i>1) fibo[i] = fibo[i-1] + fibo[i-2];
      if(i==x) printf("%d\n", fibo[i]);
    }

    return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <complex>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;

int main(void)
{
    int a[6];
    string str;
    for (int i = 0; i < 6; ++i)
        cin >> a[i];
    cin >> str;
    for (auto itr = str.begin(); itr != str.end(); ++itr) {
        int tmp;
        switch (*itr) {
            case 'N':
                tmp = a[0];
                a[0] = a[1];
                a[1] = a[5];
                a[5] = a[4];
                a[4] = tmp;
                break;
            case 'S':
                tmp = a[0];
                a[0] = a[4];
                a[4] = a[5];
                a[5] = a[1];
                a[1] = tmp;
                break;
            case 'W':
                tmp = a[3];
                a[3] = a[0];
                a[0] = a[2];
                a[2] = a[5];
                a[5] = tmp;
                break;
            case 'E':
                tmp = a[2];
                a[2] = a[0];
                a[0] = a[3];
                a[3] = a[5];
                a[5] = tmp;
                break;
        }
    }
    cout << a[0] << endl;
    return 0;
}







Measured memory_bytes: 3212
from itertools import permutations
A = list(map(int,input().split()))

per_ls = list(permutations(A))

ans = float("inf")
for (a,b,c) in per_ls:
  tmp = 0 + abs(a - b) + abs(b - c)
  ans = min(ans, tmp)
  
print(ans)

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

lint gcd(lint x, lint y) {
  if(x == 0) { return y; }
  else { return gcd(y%x,x); }
}

lint lcm(lint x, lint y) { return abs(x-y)/gcd(x,y); }


int main() {
  double a,b,h,m; cin >> a >> b >> h >> m;
  double xa,ya,xb,yb,angle_a,angle_b,pi=acos(-1);

  angle_b = (360/60)*m;
  angle_a = (360/12)*h + 360*m/(60*12); // cout << angle_a << endl;

  xa = a*cos(angle_a*pi/180); //cout << xa << endl;
  ya = a*sin(angle_a*pi/180); //cout << ya << endl;
  xb = b*cos(angle_b*pi/180); //cout << xb << endl;
  yb = b*sin(angle_b*pi/180); //cout << yb << endl;

  printf("%.20lf\n", sqrt( (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb) ) );
  return 0;
}

Measured memory_bytes: 4144
H, N = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]

dp = [[10 ** 9] * (H + 1) for _ in range(N + 1)]
dp[0][0] = 0

for i, (a, b) in enumerate(X):
    for j in range(H + 1):
        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
        dp[i + 1][min(j + a, H)] = min(dp[i + 1][min(j + a, H)], dp[i + 1][j] + b)

print(dp[-1][-1])


Measured memory_bytes: 120540
#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O2")
#pragma GCC optimization ("unroll-loops")
using namespace std;

signed main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n;
	cin >> n;
	vector < vector < int > > a(n + 1, vector < int > (n - 1));
	for (int i = 1; i <= n; ++i) {
		for (int j = 0; j < n - 1; ++j)
			cin >> a[i][j];
	}
	vector < int > pointers(n + 1, 0);
	int days = 0;
	bool fucked_up = 0;
	while (true) {
		bool moves = 0;
		vector < bool > played(n + 1, 0);
		for (int i = 1; i <= n; ++i) {
			if (pointers[i] < n - 1) {
				int j = a[i][pointers[i]];
				if (pointers[j] < n - 1 && a[j][pointers[j]] == i && !played[i] && !played[j]) {
					++pointers[i];
					++pointers[j];
					played[i] = 1;
					played[j] = 1;
					moves = 1;
				}
			}
		}
		++days;
		if (!moves)
			fucked_up = 1;
		bool johny_b_good = 1;
		for (int i = 1; i <= n; ++i) {
			if (pointers[i] != n - 1)
				johny_b_good = 0;
		}
		if (fucked_up || johny_b_good)
			break;
	}
	if (fucked_up)
		days = -1;
	cout << days << '\n';
}


Measured memory_bytes: 6272
N, M = map(int, input().split())
ks = [list(map(int, input().split())) for i in range(M)]
p = list(map(int, input().split()))

ans = 0

for i in range(2**N):
    cnt = 0
    for j in range(M):
        count=0
        for k in ks[j][1:]:
            if (i >> k-1)&1:
                count += 1
        if count%2==p[j]:
            cnt+=1
    if cnt==M:
        ans+=1
print(ans)

Measured memory_bytes: 3064
import java.util.*;
public class Main{
   public static void main(String[] args) {
     Scanner sc = new Scanner(System.in);
     int S = sc.nextInt();
     boolean YYMM,MMYY;
     YYMM = ((S%100>0) &&(S%100<=12));
     MMYY = ((S/100>0) &&(S/100<=12));
     if(YYMM && MMYY){
       System.out.println("AMBIGUOUS");
     }else if(YYMM){
        System.out.println("YYMM");
     }else if(MMYY){
        System.out.println("MMYY");
     }else {
        System.out.println("NA");
      }
   }
}


Measured memory_bytes: 21076
#include <cstdio>
#include <vector>
int N, M, O[200001], H = 100000, T = 100001, in[100001], checked[100001];
std::vector < int > V[100001];
int check(int x)
{
	for (int i : V[x])
		if (!in[i])
			return i;
	checked[x] = 1;
	return 0;
}
int main()
{
	scanf("%d%d", &N, &M);
	while (M--)
	{
		int u, v;
		scanf("%d%d", &u, &v);
		V[u].push_back(v);
		V[v].push_back(u);
	}
	in[O[H] = 1] = in[O[T] = V[1].front()] = 1;
	int nc = 0;
	while (1)
		if (!checked[O[H]] && (nc = check(O[H])))
			in[O[--H] = nc] = 1;
		else if (!checked[O[T]] && (nc = check(O[T])))
			in[O[++T] = nc] = 1;
		else
			break;
	printf("%d\n", T - H + 1);
	for (int i = H; i <= T; i++)
		printf("%d%c", O[i], " \n"[i == T]);
	return 0;
}


Measured memory_bytes: 7040
#include <bits/stdc++.h>
#include <string.h>
#include <vector>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15
#define MOD 1000000007

#define access(i) a[i/3][i%3]
//#define random_shuffle(r...)random_shuffle(r,[](int _){return my_rand()%_;})

 int main(){

  ll n;
  string s;
  cin>>n>>s;

  ll res=n,sum=0;

  for(ll i=0;i<n;i++){
      if(s[i] == 'E')
            sum++;
  }

  for(int j=0;j<n;j++){
      if(s[j] == 'E')
            sum--;
       //cout<<res<<" ? "<<sum<<endl;
      res = min(res,sum);
      if(s[j] == 'W')
            sum++;
     //  cout<<res<<" * "<<sum<<endl;
  }

  cout<<res<<endl;

 return 0;
 }


Measured memory_bytes: 3884
// AOJ CGL_4_C Convex Cut
// 2018.5.3 bal4u

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

typedef struct { double x, y; } PP;
typedef struct { PP s, e; } SEG, LINE;

#define INF			1e8
#define EPS			1e-8
#define EQ(a,b)		(fabs((a)-(b))<EPS)
#define PPeQ(a,b)	(EQ(a.x,b.x)&&EQ(a.y,b.y))

int dcmp(double x) { if (fabs(x) < EPS) return 0; return x <= 0 ? -1 : 1; }
PP vset(double x, double y) { PP r; r.x = x, r.y = y; return r; }
PP vadd(PP p1, PP p2) { PP r; r.x = p1.x + p2.x, r.y = p1.y + p2.y; return r; }
PP vsub(PP p1, PP p2) { PP r; r.x = p1.x - p2.x, r.y = p1.y - p2.y; return r; }
PP vsmul(PP p, double k) { PP r; r.x = p.x * k, r.y = p.y * k; return r; }
PP vmul(PP p1, PP p2) { PP r;
	r.x = p1.x * p2.x - p1.y * p2.y, r.y = p1.x * p2.y + p1.y * p2.x; return r; }
double vabs(PP a) { return hypot(a.x, a.y); }
double dist(PP p1, PP p2) {	return hypot(p1.x-p2.x, p1.y-p2.y); }
double cross(PP a, PP b) { return a.x * b.y - a.y * b.x; }
double dot(PP a, PP b) { return a.x * b.x + a.y * b.y; }
double norm(PP a) { return a.x * a.x + a.y * a.y; }

#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()
{
	int n = 0, c = gc();
	if (c == '-') {	c = gc();
		do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
		return -n;
	}
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

PP intersectLL(LINE a, PP vs, PP ve)
{
    double d1, d2;
	PP p;

	d1 = cross(vsub(ve, vs), vsub(a.s, vs));
	d2 = cross(vsub(ve, vs), vsub(a.e, vs));
	p.x = (a.s.x*d2 - a.e.x*d1) / (d2-d1);
	p.y = (a.s.y*d2 - a.e.y*d1) / (d2-d1);
	return p;
}

int convex_cut(LINE u, int n, PP *p, PP *po)
{
	int i, d1, d2, top = 0;

	p[n] = p[0];
    for (i = 0; i < n; i++) {
        d1 = dcmp(cross(vsub(u.e, u.s), vsub(p[i]  , u.s)));
        d2 = dcmp(cross(vsub(u.e, u.s), vsub(p[i+1], u.s)));
        if (d1 >= 0) po[top++] = p[i];
        if (d1*d2 < 0) po[top++] = intersectLL(u, p[i], p[i+1]);
    }
	po[top] = po[0];
    return top;
}

double polygonArea(int n, PP *p)
{
    double area = 0;
    for (int i = 1; i < n-1; i++) {
        area += cross(vsub(p[i], p[0]), vsub(p[i+1], p[0]));
    }
    return fabs(area) / 2;
}

PP p[110];
PP cut[110];

int main()
{
	int  n, q, i, k;
	LINE u;

	n = in();
	for (i = 0; i < n; i++) p[i].x = in(), p[i].y = in();
	q = in();
	while (q--) {
		u.s.x = in(), u.s.y = in(), u.e.x = in(), u.e.y = in();
		k = convex_cut(u, n, p, cut);
		printf("%.10lf\n", polygonArea(k, cut));
	}
	return 0;
}



Measured memory_bytes: 2124
#include <bits/stdc++.h>
#define yabs(x) ((x<0)?(-(x)):(x))

typedef long long LL;

using std::min;

const int N=2e5+10,Node=N<<2;
const LL Inf=1e11;

int n,q,a,b;

void Init() {
	scanf("%d%d%d%d",&n,&q,&a,&b);
}

struct SegmentTree{
	#define ls z<<1
	#define rs z<<1|1
	int root;
	LL Min[Node][3],lazy[Node];
	
	
	void Update(int z) { for (int i=0;i<3;++i) Min[z][i]=min(Min[ls][i]+lazy[ls],Min[rs][i]+lazy[rs]); }
	
	void prepare(int z,int l,int r,LL v) {
		if (l==r) {
			Min[z][0]=v; Min[z][1]=v-l; Min[z][2]=v+l;
			lazy[z]=0;
			return ;
		}
		int mid=(l+r)>>1;
		prepare(ls,l,mid,v);
		prepare(rs,mid+1,r,v);
		Update(z);
	}
	
	void lazydown(int z) {
		lazy[ls]+=lazy[z];
		lazy[rs]+=lazy[z];
		lazy[z]=0;
	}
	
	void setmin(int z,int l,int r,int pos,LL v) {
		if (l==r) {
			for (int i=0;i<3;++i) Min[z][i]+=lazy[z]; lazy[z]=0;
			if (Min[z][0]<v) return ;
			Min[z][0]=v; Min[z][1]=v-l; Min[z][2]=v+l;
			return ;
		}
		lazydown(z);
		int mid=(l+r)>>1;
		if (pos<=mid) setmin(ls,l,mid,pos,v);
		else setmin(rs,mid+1,r,pos,v);
		Update(z);
	}
	
	LL query(int z,int l,int r,int ql,int qr,int op) {
		if (ql<=l && r<=qr) return Min[z][op]+lazy[z];
		int mid=(l+r)>>1; LL ret=Inf;
		if (ql<=mid) ret=min(ret,query(ls,l,mid,ql,qr,op));
		if (qr>mid)  ret=min(ret,query(rs,mid+1,r,ql,qr,op));
		Update(z);
		return ret+lazy[z];
	}
	
	void add(int z,int l,int r,int ql,int qr,LL v) {
		if (ql<=l && r<=qr) { lazy[z]+=v; return ; }
		int mid=(l+r)>>1;
		if (ql<=mid) add(ls,l,mid,ql,qr,v);
		if (qr>mid)  add(rs,mid+1,r,ql,qr,v);
		Update(z);
	}
	
}st;

void Solve() {
	st.root=1; 
	st.prepare(st.root,1,n,Inf); 
	st.setmin(st.root,1,n,b,0);
	int pre=a,now;
	for (int i=1;i<=q;++i) {
		scanf("%d",&now);
		LL lmin=st.query(st.root,1,n,1,now,1)+now;
		LL rmin=st.query(st.root,1,n,now,n,2)-now;
		st.add(st.root,1,n,1,n,yabs(pre-now));
		st.setmin(st.root,1,n,pre,min(lmin,rmin));
		pre=now;
	}
	printf("%lld\n",st.query(st.root,1,n,1,n,0));
}

int main() {
	Init();
	Solve();
	return 0;
}

Measured memory_bytes: 20736
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>

#define REP(i,a,n) for(int i=a;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define vsort(v) sort(v.begin(),v.end())
#define asort(a,n) sort(a, a + n)
#define vi vector<int>
#define vd vector<double>

//ここからAtCoder向けdefine
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    cout << 48 - n << endl;

    return 0;
}

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

#define fast ios::sync_with_stdio(false);cin.tie(0); cout.tie(0)
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for(int i = (int)a; i <= (int)b; ++i)
#define sz(s) (int)s.size()
#define all(v) v.begin(),v.end()
#define rall(x) (x).rbegin(), (x).rend()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf = (ll)1e14;
const ll N = (ll)2e5+77;
const ll mod = (ll)1e9+7;

int n,m,k,x,y,ans;
int pre[N],bit[1<<26];
string s;

int main() {
    fast;
    cin >> s;
    n = sz(s);

    forn(i, n) {
        pre[i + 1] = pre[i] ^ (1 << (s[i] - 'a'));
    }

    forn(i, 1 << 26) bit[i] = 1e9;

    bit[0] = 0;
    for1(i, n) {
        int group = bit[pre[i]];

        forn(j, 26) group = min(group, bit[pre[i] ^ (1 << j)]);
        group++;

        bit[pre[i]] = min(bit[pre[i]], group);
        ans = group;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 263504
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s  = sc.next().toCharArray();
		int[] a = new int[26];
		for (int i = 0; i < s.length; i++)
			a[s[i] - 'a']++;
		for (int i = 0; i < 26; i++)
			if (a[i] > 1) {
				System.out.println("no");
				return;
			}
		System.out.println("yes");
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 5e5 + 5;
const ll MOD = 1e9 + 7;
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
#define pis pair<ll,string>
#define F first
#define S second
#define LCM(a,b) ((a*b)/__gcd(a,b))
#define inf 1e15
#define test ll cse;cin>>cse;for(ll _i=1;_i<=cse;_i++)
#define PI 3.14159265
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const double EPS = 1E-9;
typedef vector< vector<double> > matrix;
typedef vector< vector<int> > array_2D;
typedef pair<int, pair<int, int> > ppi;
typedef vector<int> vi;

ll binaryExponentiation(ll x, ll n){
    ll result = 1LL;
    while(n > 0){
        if(n&1) result *= x;
        x = x*x;
        n >>= 1;
    }
    return result;
}
// 1000000000000000000


int main() {

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


    ll div = n / b;
    ll x;

    if(div == 0)
        x = n % b;
    else
        x = (div - 1)*b + (b-1);

    ll part1 = (a * x) / b;
    ll part2 = a * (x / b);

    cout << part1 - part2 << "\n";

    return 0;
}

Measured memory_bytes: 3552
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <algorithm>
#include <bitset>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#include <cassert>
#include <functional>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(...) ;
#else
#define debug(...) cerr << __LINE__ << " : " << #__VA_ARGS__ << " = " << _tostr(__VA_ARGS__) << endl;

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v);

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}

void _tostr_rec(ostringstream &oss) {
  oss << "\b\b \b";
}

template<typename Head, typename... Tail>
void _tostr_rec(ostringstream &oss, Head &&head, Tail &&... tail) {
  oss << head << ", ";
  _tostr_rec(oss, forward<Tail>(tail)...);
}

template<typename... T>
string _tostr(T &&... args) {
  ostringstream oss;
  int size = sizeof...(args);
  if (size > 1) oss << "{";
  _tostr_rec(oss, forward<T>(args)...);
  if (size > 1) oss << "}";
  return oss.str();
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main() {
  char c;
  cin >> c;
  cout << (islower(c) ? "a" : "A") << endl;
  return 0;
}

Measured memory_bytes: 3608
#include "bits/stdc++.h"
using namespace std;
using ll     = long long;
using pii    = pair<int, int>;
using pll    = pair<ll, ll>;
using vi     = vector<int>;
using vl     = vector<ll>;
using vvi    = vector<vi>;
using vvl    = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
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;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    int n;
    cin >> n;
    vl a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    vl ord(n);
    vl sorted = a;
    sort(sorted.begin(), sorted.end());
    for (int i = 0; i < n; ++i) {
        ord[i] = lower_bound(sorted.begin(), sorted.end(), a[i]) - sorted.begin();
    }
    ll odds = 0;
    for (int i = 0; i < n; ++i) {
        if (i % 2 != ord[i] % 2)
            odds++;
    }
    cout << odds / 2 << "\n";
    return 0;
}

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

int main() {
  vector<int> A(5);
  rep(i,5){
    cin >> A.at(i);
      if(A.at(i) == 0){
        cout << i + 1 << endl;
        break;
      }
  }
}



Measured memory_bytes: 3592
# -*- coding: utf-8 -*-
n = int(input())
a = sorted(list(map(int, input().split())))

# 探索範囲は数列aの最大値まで
max_a = a[-1]
b = [0] * (max_a + 1)
ans = set()
for i in a:
    if b[i] == 1:
        if i in ans:
            ans.remove(i)
        continue
    # 探索範囲内のiの倍数をチェック
    for j in range(i, max_a+1, i):
            b[j] = 1
    ans.add(i)

print(len(ans))


Measured memory_bytes: 40232
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <cstdio>
#include <complex>
#include <numeric>
#include <string.h>
#include <random>
#define rep(i,n) for (int i = 0; i < (int)n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
double PI = 3.141592653589793238462643383279;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;

ll solve (vector<int>& v) {
    ll dp[62][2];
    dp[0][0] = 1; dp[0][1] = 0;
    for (int i = 0; i <= 60; i++) {
        if (v[i] == 0) {
            dp[i+1][0] = dp[i][0];
            dp[i+1][1] = (dp[i][0]+dp[i][1]) % MOD;
        } else if (v[i] == 1) {
            dp[i+1][0] = (dp[i][0]+dp[i][1]) % MOD;
            dp[i+1][1] = dp[i][1];
        } else {
            dp[i+1][0] = (2*dp[i][0]+dp[i][1]) % MOD;
            dp[i+1][1] = (dp[i][0]+2*dp[i][1]) % MOD;
        }
    }
    return dp[61][0];
}

ll ans = 0;

int main() {
    ll N; cin >> N;
    vector<int> v(61, 2);
    for (ll i = 60; i >= 0; i--) {
        if (N&(1LL<<i)) {
            v[i] = 0;
            ans = (ans + solve(v)) % MOD;
            v[i] = 1;
        } else {
            v[i] = 0;
        }
    }
    ans = (ans + solve(v)) % MOD;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

#define MAX 100

int main() {
  int i, j;
  int n, index, k, v;
  int adj[MAX][MAX];

  scanf("%d", &n);

  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      adj[i][j] = 0;
    }
  }

  
  for (i = 0; i < n; i++) {
    scanf("%d %d", &index, &k);
    for (j = 0; j < k; j++) {
      scanf("%d", &v);
      adj[index - 1][v - 1] = 1;
    }
  }

  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (j != 0) printf(" "); 
      printf("%d", adj[i][j]);
    }
    printf("\n");
  }
  
  return 0;
}



Measured memory_bytes: 2148
#include<stdio.h>

int main(void){
  int n,i,ans=0;
  scanf("%d",&n);
  int a[n],b[n];
  for(i=0;i<n;i++){
    scanf("%d %d",&a[i],&b[i]);
    ans+=b[i]-a[i]+1;
  }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int currentMonth = sc.nextInt();
        int currentDay = sc.nextInt();
        int nextMonth = sc.nextInt();
        int nextDay = sc.nextInt();

        if(currentMonth != nextMonth) {
            System.out.println("1");
        }else{
            System.out.println("0");
        }
    }
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPi(i, a, b) for(int i=int(a); i<int(b); i++)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define mp make_pair
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; }
const ll MOD = 1e9+7;

bool B[10][10];

int main(){
    ll H, W, K;
    cin >> H >> W >> K;
    REP(i,H){
        REP(j,W){
            char c;
            cin >> c;
            if(c == '#')
                B[i][j] = true;
            else
                B[i][j] = false;
        }
    }

    ll ans = 0;
    for(int h = 0; h < (1LL << H); h++){
        for(int w = 0; w < (1LL << W); w++){
            ll num = 0;
            REP(i,H){
                REP(j,W){
                    bool x = B[i][j];
                    if((h >> i) & 1) x = false;
                    if((w >> j) & 1) x = false;
                    if(x) num++;
                }
            }
            //printf("%d %d %lld\n", h, w, num);
            if(num == K)
                ans++;
        }

    }

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


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  string s;
  cin >> n >> s;
  int k=0;
  int x=0;
  
  for(int i=0;i<n;i++){
    if(s.at(i)=='I')
      k++;
    else
      k--;
    x=max(k,x);
  }
  cout << x << endl;
}

Measured memory_bytes: 256
MOD = 10**9+7 #素数 変える場所 
class ModInt:
    def __init__(self, x):
        self.x = x % MOD

    def __str__(self):
        return str(self.x)

    __repr__ = __str__

    def __add__(self, other):
        return (
            ModInt(self.x + other.x) if isinstance(other, ModInt) else
            ModInt(self.x + other)
        )

    def __sub__(self, other):
        return (
            ModInt(self.x - other.x) if isinstance(other, ModInt) else
            ModInt(self.x - other)
        )

    def __mul__(self, other):
        return (
            ModInt(self.x * other.x) if isinstance(other, ModInt) else
            ModInt(self.x * other)
        )

    def __truediv__(self, other):
        return (
            ModInt(
                self.x * pow(other.x, MOD - 2, MOD)
            ) if isinstance(other, ModInt) else
            ModInt(self.x * pow(other, MOD - 2, MOD))
        )

    def __pow__(self, other):
        return (
            ModInt(pow(self.x, other.x, MOD)) if isinstance(other, ModInt) else
            ModInt(pow(self.x, other, MOD))
        )

    __radd__ = __add__

    def __rsub__(self, other):
        return (
            ModInt(other.x - self.x) if isinstance(other, ModInt) else
            ModInt(other - self.x)
        )

    __rmul__ = __mul__

    def __rtruediv__(self, other):
        return (
            ModInt(
                other.x * pow(self.x, MOD - 2, MOD)
            ) if isinstance(other, ModInt) else
            ModInt(other * pow(self.x, MOD - 2, MOD))
        )

    def __rpow__(self, other):
        return (
            ModInt(pow(other.x, self.x, MOD)) if isinstance(other, ModInt) else
            ModInt(pow(other, self.x, MOD))
        )
def framod(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
    return a

def pow(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return pow(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * pow(n, r-1, mod) % mod

def com(n, k, mod):
    a=framod(n, mod)
    b=framod(k, mod)
    c=framod(n-k, mod)
    return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod
def gcd(a,b):
    while b:
        a,b=b,a%b
    return a
n=int(input())
a=list(map(int,input().split()))
ans = a[0]
for i in range(1, n):
    ans = ans * a[i] // gcd(ans, a[i])
cnt=ModInt(0)
ans=ModInt(ans)
for i in range(n):
    cnt+=ans/ModInt(a[i])
print(cnt)

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

int main() {
	int n, m;
	cin >> n;
	cin >> m;
	int c[n];
	for (int i = 0; i < n; ++i) {
		c[i] = -1;
	}
	bool norm = true;
	for (int i = 0; i < m; ++i) {
		int s1, c1;
		cin >> s1;
		cin >> c1;
		--s1;
		if (s1 == 0 && c1 == 0) {
			if (n == 1) {
				c[0] = 0;
			} else {
				norm = false;
				break;
			}
		} else if (c[s1] == -1) {
			c[s1] = c1;
		} else if (c[s1] != c1) {
			norm = false;
			break;
		}
	}
	if (norm) {
		int ans = 0;
		for (int i = 0; i < n; ++i) {
			if (c[i] == -1) {
				if (i == 0) {
					if (n == 1) {
						ans = 0;
					} else {
						ans = 1;
					}
				} else {
					ans *= 10;
				}
			} else {
				ans = ans * 10 + c[i];
			}
		}
		cout << ans << endl;
	} else {
		cout << -1 << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
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(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<P> v(n);
    rep(i,n) cin >> v[i].first >> v[i].second;
    sort(v.rbegin(), v.rend());
    ll ans = v[0].first + v[0].second;
    cout << ans << endl;
    return 0;
}

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

pair< int, int > rec(int X, int Y, int Step)
{
  if(Y == 0) return(make_pair(X, Step));
  else return(rec(Y, X % Y, Step + 1));
}

int main()
{
  int X, Y;
  while(cin >> X >> Y, X|Y) {
    pair< int, int > ret = rec(max(X, Y), min(X, Y), 0);
    cout << ret.first << " " << ret.second << endl;
  }
}

Measured memory_bytes: 1160
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
      	int Y = sc.nextInt();
      	int A = sc.nextInt();
      	int B = sc.nextInt();
     	int C = sc.nextInt();
        Long[] Aa = new Long[A];
      	for(int i = 0; i < A; i++){
        	Aa[i] = sc.nextLong();
        }
      	Long[] Ba = new Long[B];
      	for(int i = 0; i < B; i++){
        	Ba[i] = sc.nextLong();
        }
      	Long[] Ca = new Long[C];
      	for(int i = 0; i < C; i++){
        	Ca[i] = sc.nextLong();
        }
      	Arrays.sort(Aa, Collections.reverseOrder());
      	Arrays.sort(Ba, Collections.reverseOrder());
      	Arrays.sort(Ca, Collections.reverseOrder());
      
      	Long[] Sa = new Long[X+Y+C];
      	for(int i = 0; i < X; i++){
        	Sa[i] = Aa[i];
        }
      	for(int i = 0; i < Y; i++){
        	Sa[X+i] = Ba[i];
        }
      	for(int i = 0; i < C; i++){
        	Sa[X+Y+i] = Ca[i];
        }
      
      	Arrays.sort(Sa, Collections.reverseOrder());
      
		long sum = 0;
      	for(int i = 0; i < X+Y; i++){
        	sum += Sa[i];
        }

		System.out.println(sum);
	}
}

Measured memory_bytes: 103136
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
const long long INF = (1LL << 60);
using namespace std;

long long dp[2005][2005];

int main(){
    long long n, x;
    cin >> n >> x;

    long long a[2005];
    rep(i,n) cin >> a[i];

    rep(i,2005) rep(j,2005) dp[i][j] = INF;

    rep(i,n) dp[i][0] = a[i];

    rep(i,n){
        range(j,1,n + 1) {
            int prev_j = (i - j + n) % n;
            dp[i][j] = min(dp[i][j - 1], a[prev_j]);
        }
    }

    long long ans = INF;
    rep(j,n + 1) {
        long long tmp = 0;
        rep(i,n) tmp += dp[i][j];
        ans = min(ans, tmp + static_cast<long long>(j) * x);
    }

    cout << ans << endl;
}


Measured memory_bytes: 31616
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>

using namespace std;

typedef long long ll;

#define FOR(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR1(i,n) for(int (i)=1;(i)<(n);(i)++)
#define eFOR(i,n) for(int (i)=0;(i)<=(n);(i)++)
#define eFOR1(i,n) for(int (i)=1;(i)<=(n);(i)++)
#define SORT(i) sort((i).begin(),(i).end())
#define INF 1000000000

int main() {

	ll ans = 0;
	int n;
	cin >> n;
	set<ll> m;
	map<ll, int> a;
	FOR(i, n){
		int M;
		cin >> M;
		m.insert(M);
		a[M]++;
	}
	auto itr = m.begin();
	FOR(i, m.size()){
		if (a[*itr] < *itr)ans += a[*itr];
		else ans += a[*itr] - *itr;
		itr++;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 10752
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)
	var cnt int
	min := int(2e5 + 1)
	for i := 0; i < n; i++ {
		var p int
		fmt.Scan(&p)
		if p <= min {
			cnt++
			min = p
		}
	}
	fmt.Println(cnt)
}


Measured memory_bytes: 7552
#include <stdlib.h>
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <bitset>

using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<string> vs;

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



int main(){
	string o, e, ans;
	cin >> o;
	cin >> e;

	for (int i = 0; i < o.length(); i++) {
		ans += o[i];
		if (e.length() > i) ans += e[i];
	}

	cout << ans << endl;
}


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

const int N = 200000;
int n, a[N], b[N], c[N + 1], d[N + 1], ans[N];

int main() {
  cin >> n;
  rep(i, n) cin >> a[i];
  rep(i, n) cin >> b[i];

  memset(c, 0, sizeof(int) * (n + 1));
  memset(c, 0, sizeof(int) * (n + 1));
  rep(i, n) c[a[i]]++;
  rep(i, n) d[b[i]]++;

  rep(i, n + 1) if (c[i] + d[i] > n) {
    cout << "No" << endl;
    return 0;
  }
  rep(i, n) c[i + 1] += c[i];
  rep(i, n) d[i + 1] += d[i];

  int x = 0;
  rep(i, n) x = max(x, c[i + 1] - d[i]);
  rep(i, n) ans[(i + x) % n] = b[i];

  cout << "Yes" << endl;
  rep(i, n - 1) cout << ans[i] << " ";
  cout << ans[n - 1] << endl;
  return 0;
}

Measured memory_bytes: 7540
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,s,n) for(int i=s;i<n;i++)
typedef long long int ll;
typedef pair<int, int> P;
typedef long double ld;
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}

const ll inf=10000000000;
int main(){
  ll l;cin>>l;
  ld a=(ld)l/3.0;
  cout<<fixed<<setprecision(10);
  cout<<a*a*a<<endl;
}

Measured memory_bytes: 256
#include <iostream>
int main(){
  long int N,K,Q,temp;
  std::cin>>N>>K>>Q;
  long int Points[N];
  for (int i=0;i<N;i++){
    Points[i]=K-Q;
  }
  for (int i=0;i<Q;i++){
    std::cin>>temp;
    Points[temp-1]+=1;
  }
  for (long int i=0;i<N;i++){
    if(Points[i]>0){
      std::cout<<"Yes"<<std::endl;
    }else{
      std::cout<<"No"<<std::endl;
    }
  }

}


Measured memory_bytes: 1408
#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <bitset>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (ll i = a; i < n; i++)
#define repm(i, a, n) for (ll i = a; i >= n; i--)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vs vector<string>
#define vii vector<vector<int>>
#define vll vector<ll>
#define vllll vector<vector<ll>>
#define vd vector<double>
#define ALL(a) (a).begin(), (a).end()
#define sort_v(a) sort(a.begin(), a.end())
#define reverse_v(a) reverse(a.begin(), a.end())
#define fi first
#define se second

void print(bool c)
{
    (c) ? (cout << "Yes" << endl) : (cout << "No" << endl);
}

void Print(bool c)
{
    (c) ? (cout << "YES" << endl) : (cout << "NO" << endl);
}

//最小公倍数
template <typename T>
T gcd(T a, T b)
{
    while (1)
    {
        if (a < b)
            swap(a, b);
        if (b == 0)
            break;
        a %= b;
    }
    return a;
}

//最大公約数
template <typename T>
T lcm(T a, T b)
{
    return a * b / gcd(a, b);
}
//セカンドキー->ファーストキーの順ソート
bool cmp(const pii &a, const pii &b)
{
    if (a.second != b.second)
        return a.second < b.second;
    return a.first < b.first;
}

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

int eve(int x)
{
    if (x % 400 == 0)
        return 1;
    if (x % 100 == 0)
        return 0;
    if (x % 4 == 0)
        return 1;
    return 0;
}

int main(void)
{
    string s;
    ll k;
    cin >> s >> k;
    ll cnt = 0, sp = 0;
    while (1)
    {
        if (sp == s.size() - 1)
        {
            rep(i, 0, k - cnt)
            {
                (s[sp] == 'z') ? s[sp] = 'a' : s[sp]++;
            }
            cnt = k;
        }
        else if (s[sp] == 'a')
        {
            sp++;
            continue;
        }
        else if (26 - (s[sp] - 'a') <= k - cnt)
        {
            cnt += (26 - (s[sp] - 'a'));
            s[sp] = 'a';
        }
        if (cnt >= k)
            break;
        sp++;
    }
    cout << s << endl;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

/* REPmacro */
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOREACH(x, a) for(auto x : a)

/* exchange */
#define CHMIN(a, b) (a) = min((ll)(a), (ll)(b))
#define CHMAX(a, b) (a) = max((ll)(a), (ll)(b))

/* function */
#define IN(x) cin >> x
#define DEBUG(x) cerr << (x) << " "
#define LN() cerr << "\n"
#define PRINT(x) cout << (x) << endl
#define BR cout << endl

/* const */
const int ARRAY = 100005;
const int INF = 1001001001; // 10^9
const ll LINF = 1001001001001001001; // 10^18
const int MOD = 1e9 + 7;

ll N = 0;
ll K = 0;
ll t;
ll ret = 0;
string s;
ll dp[10][10];

void input() {
  IN(N);
}

void solve() {
  FOR(i, 1, 10) {
    FOR(j, 1, 10) {
      dp[i][j] = 0;
    }
  }
  FOR(i, 1, N+1) {
    ll r = i % 10;
    ll l = 0;
    ll k = 1;
    while(i / k > 0) {
      l = i / k;
      k *= 10;
    }
    dp[l][r] += 1;
  }
  FOR(i, 1, 10) {
    FOR(j, i, 10) {
      if (i == j) ret += dp[i][j] * dp[i][j];
      else ret += dp[i][j] * dp[j][i] * 2;
    }
  }
  PRINT(ret);
}

int main(void){
  input();
  solve();
}


Measured memory_bytes: 384
#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define cmax(_i,_j) ((_i)<(_j)?(_i)=(_j):0)
#define cmin(_i,_j) ((_i)>(_j)?(_i)=(_j):0)
#define N 100005
using namespace std;
namespace runzhe2000
{
	char s[N]; int n, ans;
	void main()
	{
		scanf("%s",s+1); n = strlen(s+1);
		for(int i = 2; i <= n; i++) if(s[i] != s[i-1]) ans++;
		printf("%d\n",ans);
	}
}
int main()
{
	runzhe2000::main();
}

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

int main()
{
    int l,i,j,k,x,c;
    char s[15];

    gets(s);

    l=strlen(s);

    for(i=l-1;i>=0;i--){
        if(s[i]=='B'){
            for(j=i-1;j>=0;j--){
                if(s[j]=='0'||s[j]=='1'){
                    s[j]='2';
                    s[i]='2';
                    break;
                }
            }
        }
    }
    for(i=0;i<l;i++){
        if(s[i]=='0'||s[i]=='1'){
            printf("%c",s[i]);
        }
    }
    printf("\n");

    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) (int)((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl "\n"
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

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

const int MAXN = 3005;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T max_self(T& a, T b) { if (a < b) a = b; return a; }
template<typename T>   T min_self(T& a, T b) { if (a > b) a = b; return a; }
template<typename T>   T add(T x, T y) { return ((x % MOD)  + (y % MOD)) % MOD;}
template<typename T>   T mul(T x, T y) { return ((x % MOD) * (long long)(y % MOD)) % MOD;}
template<typename T>   T sub(T x, T y) { return add(x, -y + MOD);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}
template<typename T>   vector<T> read(vector<T>& v, int n) {v.resize(n); for (auto &x : v)cin >> x;}
template<typename T>   void trav(vector<T> &v) {for (int i = 0 ; i < (int)v.size() ; ++i) {cout << v[i]; if (i != (int)v.size() - 1) cout << ' ';}}
int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

int n, a[MAXN];
ll dp[MAXN][MAXN];

ll solve(int i, int j) {
	if (i >= n || j < 0) return -INF;
	if (i == j) return a[i];
	if (dp[i][j] != -1) return dp[i][j];
	return dp[i][j] = max(a[i] - solve(i + 1, j), a[j] - solve(i, j - 1));
}

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

	memset(dp, -1, sizeof dp);

	cin >> n;

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

	cout << solve(0, n - 1) << endl;



	return 0;
}


Measured memory_bytes: 71168
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
 
int x, y;

int main(void){
	
	scanf("%d %d", &x, &y);
	if((x == 1 || x == 3 || x == 5 || x == 7 || x == 8 || x == 10 || x == 12) && (y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12)) printf("Yes\n");
	else if((x == 4 || x == 6 || x == 9 || x == 11) && (y == 4 || y == 6 || y == 9 || y == 11)) printf("Yes\n");
	else if(x == 2 && y == 2) printf("Yes\n");
	else printf("No\n");
	
    return 0;
}

Measured memory_bytes: 256
data = input()

continuous = 0
is_before_rain = False
for i in range(3):
  if data[i] == 'R' and is_before_rain:
    continuous += 1
  if data[i] == 'R':
    is_before_rain = True
  else:
    is_before_rain = False

print( continuous + int('R' in data) )

Measured memory_bytes: 9128
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const long Mod = 1000000007;

    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static object process(TextReader input) {
        var spl = input.ReadLine().Split(' ');
        var n = int.Parse(spl[0]);
        var k = int.Parse(spl[1]);

        var dic = new Dictionary<int, int>();
        foreach(var z in input.ReadLine().Split(' ')){
            var x = int.Parse(z);
            if (!dic.ContainsKey(x)) dic[x] = 0;
            dic[x]++;
        }

        var list = dic.Values.ToList();
        list.Sort();

        var c = 0L;
        for(int i=0; i<dic.Count - k; i++) {
            c += list[i];
        }

        return c;
    }

    static int[] ToIntArray(string strs, int n) {
        var ret = new int[n];
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++)
            ret[i] = int.Parse(spl[i]);
        return ret;
    }
}


Measured memory_bytes: 37196