akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
#define rep(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define all(x) (x).begin(),(x).end()

int main() {
  int n;
  cin>>n;
  if(400<=n&&n<600)cout<<8<<endl;
  else if(600<=n&&n<800)cout<<7<<endl;
  else if(800<=n&&n<1000)cout<<6<<endl;
  else if(1000<=n&&n<1200)cout<<5<<endl;
  else if(1200<=n&&n<1400)cout<<4<<endl;
  else if(1400<=n&&n<1600)cout<<3<<endl;
  else if(1600<=n&&n<1800)cout<<2<<endl;
  else if(1800<=n&&n<2000)cout<<1<<endl;
}


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

using namespace std;

int main() {
    string w;
    int cnt[26] = {0};

    cin >> w;
    for (int i = 0; i < w.length(); i++)
        cnt[w[i]-'a']++;

    bool can = true;

    for (int i = 0; i < 26; i++) {
        if (cnt[i] % 2)
            can = false;
    }

    if (can)
        cout << "Yes" << endl;
    else 
        cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int a[200005],t[200005];
int main()
{
	int n,k;
	cin>>n>>k;
	for(int i=0;i<n;i++)
		cin>>a[i];
	t[0]=0;
	int ans=0;
	for(int i=1;i<n;i++)
	{
		if(a[i]>a[i-1])
			t[i]=t[i-1]+1;
		else
			t[i]=0;
		if(t[i]>=k-1)
			ans=1;
	}
	set<int>s;
	for(int i=0;i<k;i++)
		s.insert(a[i]);
	if(t[k-1]!=k-1)
		ans++;
	for(int i=k;i<n;i++)
	{
		s.insert(a[i]);
		if(*s.begin()!=a[i-k]||*s.rbegin()!=a[i])
		{
			if(t[i]<k-1)
				ans++;
		}
		s.erase(a[i-k]);
	}
	cout<<ans;

	return 0;
}

Measured memory_bytes: 11136
#!/usr/bin/python
import sys
if sys.version_info[0]>=3: raw_input=input

try:
	while True:
		n=int(raw_input())
		if n==0: break
		r=0
		i=1
		while 1:
			n-=i
			if n<i: break
			i+=1
			if n%i==0: r+=1
		print(r)
except EOFError:
	pass

Measured memory_bytes: 6284
#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <set>
#include <map>
#include <iterator>
#include <stack>
#include <string.h>
#include <cstdlib>
#include <queue>
#include <list>
#include <string>

using namespace std;

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


Measured memory_bytes: 3636
/*dismint|jjc*/
#include <bits/stdc++.h>
using namespace std;

#define io(F) string t_="";ifstream fin(t_+F+".in");ofstreamfout(t_+F+".out")
#define qio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define forl(V, S, E) for(int V = S; V < E; V++)
#define ford(V, S, E) for(int V = S; V >= E; V--)
#define fore(E, X) for(auto &E:X)
#define println(X) cout << X << endl
#define printe(X) for(auto &E:X) cout << E << " "; cout << endl
#define graph unordered_map<int, unordered_set<int>>
typedef long long ll;

int main() {
	qio; int n, m; cin >> n >> m;
	vector<int> nums(m); forl(i, 0, m) cin >> nums[i];
	int tot = accumulate(nums.begin(), nums.end(), 0);
	if(tot > n) println(-1);
	else println(n-tot);
}


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

int n;
const int MAX_N = 200000;
vector<int> vec;


int main() {
  cin >> n;

  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    vec.push_back(x);
  }

  set<int> s(vec.begin(), vec.end());

  int vec_len = vec.size();
  int set_len = s.size();

  if (vec_len == set_len) {
    printf("YES");
  } else {
    printf("NO");
  }

  return 0;
}

Measured memory_bytes: 10356
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<queue>
#include<algorithm>
#define ll long long
#define rg register 
#define go(i,x,a) for(rg int i=a;i<x;i++)
#define inf 0x3f3f3f3f
#define mod 1000000007
using namespace std;

const int maxn=5e5+5;
int n,a[maxn],b[maxn],hx[maxn],tl,s0[maxn],q[maxn],tt;
ll ans,f[maxn][2];
vector<int>g[maxn];

inline int rd(){
	int ret=0,af=1; char gc=getchar();
	while(gc < '0' || gc > '9'){ if(gc == '-') af=-af; gc=getchar(); }
	while(gc >= '0' && gc <= '9') ret=ret*10+gc-'0',gc=getchar();
	return ret*af;
}

inline void add(ll &a,ll b){ a=a+b; if(a >= mod) a-=mod; return; }
inline void dec(ll &a,ll b){ a=a-b; if(a < 0) a+=mod; return ; }

inline  void cal(int x){
	tt=0;
	go(i,g[x].size(),0) q[++tt]=g[x][i];
	ll sa=1,sb=0;
	go(i,tt+1,1){
		ll ss=s0[q[i]]-s0[q[i-1]];
		add(sa,sb*ss%mod);
		add(sb,sa); 
	}
	if(q[tt] != n){
		ll ss=s0[n]-s0[q[tt]];
		add(sa,sb*ss%mod);
	}
	add(ans,b[n] == 0 ? sb : sa);
}

inline ll qpow(int x,int k){
	ll ss=1,tmp=x;
	while(k > 0){
		if(k & 1) ss=ss*tmp%mod;
		tmp=tmp*tmp%mod;
		k>>=1;
	}
	return ss;
}

int main(){
	n=rd();
	go(i,n+1,1){
		a[i]=rd();	b[i]=b[i-1]^a[i];
		if(b[i]) hx[++tl]=b[i];
	}
//	go(i,n+1,1) printf("%d ",b[i]);	puts("");
	go(i,n+1,1) s0[i]=s0[i-1]+(b[i] == 0);
	sort(hx+1,hx+tl+1); tl=unique(hx+1,hx+tl+1)-hx-1;
//	go(i,tl+1,1) printf("%d ",hx[i]); puts("");
	go(i,n+1,1)
		if(b[i]) b[i]=lower_bound(hx+1,hx+tl+1,b[i])-hx;
	go(i,n+1,1) g[b[i]].push_back(i);
	if(b[n] == 0){
		go(i,tl+1,1) cal(i);//,printf("%d: %lld\n",hx[i],ans);
		add(ans,qpow(2,s0[n]-1));
	}else cal(b[n]);
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 33012
def main():
    N = int(input())
    S = input()
    RGBdict = {"R":0,"G":0,"B":0}
    for i in range(N):
        RGBdict[S[i]] += 1

    if N%2 == 0:
        maxsa = (N//2) -1
    else:
        maxsa = N//2

    tmp = N - 2
    cnt = 0
    for j in range(maxsa+1):
        num = tmp-(j*2)
        for k in range( num ):
            if (S[N-num+k] != S[N-num+k-j-1]) and (S[N-num+k] != S[N-num+k-2*j-2]) and (S[N-num+k-j-1] != S[N-num+k-2*j-2]):
                cnt += 1

    ans = RGBdict["R"]*RGBdict["G"]*RGBdict["B"]
    ans -= cnt
    return ans

print(main())


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

/*
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)*/
#define all(a) (a).begin(),(a).end()		//sort(all(vi S)) sort(all(string S))

/*
typedef long long ll;
typedef vector<int> vi;
typedef set<int> seti;
typedef vector<string> vs;

const int MOD = 1e9+7;
const int INF = 1e9;*/

int main() {
	string S;
	int K;
	cin>>S>>K;
	int N = S.size();
	vector<string> vs;

    //n文字の中のk文字を探す
	for (int i = 0; i < N; ++i){
		for (int j = 0; i+j <= N&& j <=K; ++j){
			vs.push_back(S.substr(i,j));
		}
	}

	set<string> ss(all(vs));//全ての文字列のStringを構成
	vector<string> vs2(all(ss));//文字列をvector化する
	sort(all(vs2));//文字列を昇順にソート
	cout<<vs2[K]<<endl;
}


Measured memory_bytes: 2428
#include <iostream>
#include <cmath>
using namespace std;
#define eps .0000000000001
long long n,x,t;
void solve()
{
    double u=1.0*n/x;
    long long tmp=(long long)u;
    if (fabs(u-tmp)<eps) ;
    else tmp++;
    cout<<tmp*t<<endl;
}
int main()
{
    while(cin>>n>>x>>t)
        solve();
}

Measured memory_bytes: 3188
#include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(aa, (v).size()) { cout << v[aa]; if (aa != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

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


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int x, a, b;
	cin >> x >> a >> b;
	if (abs(x - a) > abs(x - b))cout << "B" << endl;
	else cout << "A" << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string.h>
#include<complex>
using namespace std;
typedef long long int llint;
int main(){
	char s[3][11];
	cin >> s[0] >> s[1] >> s[2];
	s[0][0] = s[0][0] - 0x20;
	s[1][0] = s[1][0] - 0x20;
	s[2][0] = s[2][0] - 0x20;
	cout << s[0][0] << s[1][0] << s[2][0] << endl;
	return 0;
}


Measured memory_bytes: 256
loop do
	h,w=gets.chomp.split.map(&:to_i)
	break if h==0 && w==0

	h.times do |i|
		w.times do |j|
			if((i.even? && j.even?)||(i.odd? && j.odd?))
				print "#"
			elsif((i.even? && j.odd?)  || (i.odd? && j.even?))
				print "."
			end
		end
		puts
	end
	puts
end

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

int main(){
  ll a,b,k;
  cin >>a >>b >>k;
  if(a>=k) cout << a-k << " " << b << endl;
  else if(k<=a+b) cout << 0 << " " << b-(k-a) << endl;
  else cout << 0 << " " << 0 << endl;
  return 0;
}

Measured memory_bytes: 256
#include<cmath>
#include<cctype>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
using namespace std;
char a[100001],b[100001];
int lena;
int main(){
    cin>>a;
    lena=strlen(a); 
    for(register int i=0;i<lena;i++)
    {
        if(a[i]=='b') b[lena-i-1]='d';
        else if(a[i]=='d') b[lena-i-1]='b';
        else if(a[i]=='p') b[lena-i-1]='q';
        else if(a[i]=='q') b[lena-i-1]='p';
    }
    if(!strcmp(a,b)) cout<<"Yes";
    else cout<<"No";
    return 0;
}

Measured memory_bytes: 384
#include "bits/stdc++.h"

using namespace std;

string board =
	"10101010"
	"11111111"
	"10101010"
	"11111111"
	"10101010"
	"11111111"
	"10101010"
	"11111111";

void solve()
{
	int Q, a, b, c, d;
	cin >> Q;
	while(Q--)
	{
		scanf("%d%d%d%d", &a, &b, &c, &d);
		int ans = 0;
		for (int i = a-1; i < c; i++)
			for (int j = b-1; j < d; j++)
		{
			ans += board[i*8+j] == '1';
		}
		printf("%d\n", ans);
	}
}

int main(void)
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}



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

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

  vector<long long> d(k);
  for(auto& x: d){
    cin >> x;
  }

  for(int q_ = 0; q_ < q; q_++){
    long long n, x, m;
    cin >> n >> x >> m;

    vector<long long> d_mod(k), d_sum(k + 1, 0);
    long long d_mod_0_cnt = 0;
    for(int i = 0; i < k; i++){
      d_mod[i] = d[i] % m;
      if(d_mod[i] == 0){
        d_mod_0_cnt++;
      }
      d_sum[i + 1] = d_sum[i] + d_mod[i];
    }

    long long ans_comp = 0;

    long long a_n = x;
    a_n += (n - 1) / k * d_sum[k];
    for(int i = 0; i < (n - 1) % k; i++){
      a_n += d_mod[i];
    }
    // a_n >= pm, a_0 = qm
    long long p = a_n / m, q = x / m;

    ans_comp += (p - q);

    ans_comp += (n - 1) / k * d_mod_0_cnt;
    for(int i = 0; i < (n - 1) % k; i++){
      if(d_mod[i] == 0){
        ans_comp++;
      }
    }

    cout << (n - 1) - ans_comp << endl;
  }
}


Measured memory_bytes: 888
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <tuple>
#include <cassert>
#include <memory>
using namespace std;
typedef long long ll;
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;

int main ()
{
    ll X;
    cin >> X;

    vector<pair<ll,ll>> cnd;
    for (ll i = 0; (i * i * i * i * i) < 3e18; i++) {
        cnd.emplace_back(i * i * i * i * i, i);
    }
    for (ll i = -1; (i * i * i * i * i) > -3e18; i--) {
        cnd.emplace_back(i * i * i * i * i, i);
    }

    for (auto A: cnd) {
        for (auto B: cnd) {
            if ((A.first - B.first) == X) {
                cout << A.second << " " << B.second << endl;
                return 0;
            }
        }
    }

    assert(false);

    return 0;
}


Measured memory_bytes: 3756
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main()
{
	char w[12];
	char data[1024];
	int w_size;
	int data_size;
	char *ptr;
	int i;
	int match=0;
	char *dmy;

	gets(w);
	w_size  = strlen(w);
	for(i=0 ; i<w_size ; i++) {
		if (isalpha(w[i])==0) {
			continue;
		}
		/*-- ALPHA OOMOJI--*/
		w[i] = tolower(w[i]);
	}
	while(1) {
		gets(data);
		data_size = strlen(data);
		i = strlen("END_OF_TEXT");
		if (i == data_size) {
			if (strcmp(data,"END_OF_TEXT")==0) {
				printf("%d\n",match);
				return 0;
			}
		}

		for(i=0 ; i<data_size ; i++) {
			if (isalpha(data[i])==0) {
				continue;
			}
			/*-- ALPHA OOMOJI--*/
			data[i] = tolower(data[i]);
		}

		ptr = strtok(data," ");
		for (i=0 ;; i++) {
			if (ptr == NULL) {
				break;
			}
			if (strcmp(w,ptr)==0) {
				match++;
			}
			ptr = strtok(NULL," ");
		}
	}
}

Measured memory_bytes: 532
import std.algorithm, std.conv, std.range, std.stdio, std.string;
import std.bitmanip;  // BitArray

static inf = 10 ^^ 8;

void main()
{
  auto rd1 = readln.split, n = rd1[0].to!size_t, ma = rd1[1].to!int, mb = rd1[2].to!int;
  auto d = new Chemical[](n);
  foreach (i; 0..n) {
    auto rd2 = readln.split.to!(int[]), a = rd2[0], b = rd2[1], c = rd2[2];
    d[i] = Chemical(a, b, c);
  }

  auto n1 = (n+1)/2, n2 = n-n1;

  auto a2s = d[n1..$].map!"a.a".sum, da2 = (a2s+ma-1)/ma;
  auto b2s = d[n1..$].map!"a.b".sum, db2 = (b2s+mb-1)/mb;

  auto e = new Chemical[][][](ma, mb, da2+db2+1);
  foreach (i; 0..ma)
    foreach (j; 0..mb)
      e[i][j][] = Chemical(-1, -1, inf);
    
  foreach (i; 1..1<<n2) {
    auto f = d[n1..$].indexed(i.bitsSet).sum;
    auto ia = f.a % ma, ib = f.b % mb, id = (f.b+mb-1)/mb - (f.a+ma-1)/ma + da2;
    if (f.c < e[ia][ib][id].c) e[ia][ib][id] = f;
  }

  auto ans = inf;
  foreach (i; 0..1<<n1) {
    auto f = d.indexed(i.bitsSet).sum;
    if (f.a > 0 && f.b > 0 && f.a % ma == 0 && f.b % mb == 0 && f.a/ma == f.b/mb) {
      ans = min(ans, f.c);
    } else {
      auto ia = (ma - f.a % ma) % ma, ib = (mb - f.b % mb) % mb, id = f.a/ma - f.b/mb + da2;
      if (0 <= id && id <= da2 + db2)
        ans = min(ans, f.c + e[ia][ib][id].c);
    }
  }

  writeln(ans == inf ? -1 : ans);
}

struct Chemical
{
  int a, b, c;
  auto opBinary(string op: "+")(Chemical rhs) { return Chemical(a + rhs.a, b + rhs.b, c + rhs.c); }
}


Measured memory_bytes: 256
H,W = map(int, input().split())
List = [input() for i in range(H)]
queue = [(0,0,1)]
shape = sum(row.count("#") for row in List)
used ={(0,0)}

def check(x,y,c):
    if(x>W-1 or y>H-1 or x<0 or y<0):
        return
    if(List[y][x] == '#'):
        return
    if(x,y) in used:
        return
    queue.append((x,y,c+1))
    used.add((x,y))

f= -1
while queue:
    x,y,c = queue[0]
    if x==W-1 and y==H-1:
        f=1
        break
    queue.pop(0)
    check(x+1,y,c)
    check(x, y+1,c)
    check(x-1,y,c)
    check(x, y-1,c)
print(f if f == -1 else(H*W-c-shape))


Measured memory_bytes: 3316
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        int x = scanner.nextInt();
        int A, B, C, D;
        D = x % 10;
        x = x / 10;
        C = x % 10;
        x = x / 10;
        B = x % 10;
        x = x / 10;
        A = x;

        if ((A + B + C + D) == 7) {
            System.out.println(A + "+" + B + "+" + C + "+" + D + "=7");
        } else if ((A - B + C + D) == 7) {
            System.out.println(A + "-" + B + "+" + C + "+" + D + "=7");
        } else if ((A + B - C + D) == 7) {
            System.out.println(A + "+" + B + "-" + C + "+" + D + "=7");
        } else if ((A - B - C + D) == 7) {
            System.out.println(A + "-" + B + "-" + C + "+" + D + "=7");
        } else if ((A + B + C - D) == 7) {
            System.out.println(A + "+" + B + "+" + C + "-" + D + "=7");
        } else if ((A - B + C - D) == 7) {
            System.out.println(A + "-" + B + "+" + C + "-" + D + "=7");
        } else if ((A + B - C - D) == 7) {
            System.out.println(A + "+" + B + "-" + C + "-" + D + "=7");
        } else if ((A - B - C - D) == 7) {
            System.out.println(A + "-" + B + "-" + C + "-" + D + "=7");
        }
    }
}


Measured memory_bytes: 21844
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <sstream>

using namespace std;

int main (void)
{
	int a,b,c,d,p,q;
	p = 0;
	q = 0;

	cin >> a >> b >> c >> d;

	if (a >= b)
	{
		p = b;
	}
	else
	{
		p = a;
	}
	if (c >= d)
	{
		q = d;
	}
	else
	{
		q = c;
	}

	cout << p + q << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

class Edge
{
public:
    int to, cap, rev;
    Edge(){};
    Edge(int to0, int cap0){to = to0; cap = cap0;}
    Edge(int to0, int cap0, int rev0){to = to0; cap = cap0; rev = rev0;}
};

int maxFlow(const vector<vector<Edge> >& edges0, int source, int sink)
{
    static vector<vector<Edge> > edges;
    static vector<bool> used;

    class Func{
    public:
        static int dfs(int s, int t, int f){
            if(s == t)
                return f;
            used[s] = true;
            for(unsigned i=0; i<edges[s].size(); ++i){
                Edge& e = edges[s][i];
                if(!used[e.to] && e.cap > 0){
                    int g = dfs(e.to, t, min(f, e.cap));
                    if(g > 0){
                        e.cap -= g;
                        edges[e.to][e.rev].cap += g;
                        return g;
                    }
                }
            }
            return 0;
        }
    };

    int n = edges0.size();
    edges.assign(n, vector<Edge>());
    for(int i=0; i<n; ++i){
        for(unsigned j=0; j<edges0[i].size(); ++j){
            const Edge& e = edges0[i][j];
            edges[i].push_back(Edge(e.to, e.cap, edges[e.to].size()));
            edges[e.to].push_back(Edge(i, 0, edges[i].size()-1));
        }
    }

    int ret = 0;
    for(;;){
        used.assign(n, false);
        int f = Func::dfs(source, sink, INT_MAX);
        if(f == 0)
            return ret;
        ret += f;
    }
}

int coverNode(vector<vector<int> > dag)
{
    int n = dag.size();
    vector<vector<Edge> > edges(2*n+2);
    for(int i=0; i<n; ++i){
        edges[0].push_back(Edge(i+2, 1));
        edges[i+n+2].push_back(Edge(1, 1));
    }
    for(int i=0; i<n; ++i){
        for(unsigned j=0; j<dag[i].size(); ++j){
            edges[i+2].push_back(Edge(dag[i][j]+n+2, 1));
        }
    }
    return n - maxFlow(edges, 0, 1);
}

bool solve(vector<vector<int> > a)
{
    int h = a.size();
    int w = a[0].size();
    sort(a.rbegin(), a.rend());
    a.insert(a.begin(), vector<int>(a[0].begin(), a[0].end()));
    ++ h;

    vector<vector<int> > dag(h);
    for(int i=0; i<h; ++i){
        for(int j=i+1; j<h; ++j){
            bool ok = true;
            for(int k=0; k<w; ++k){
                if(a[i][k] <= a[j][k])
                    ok = false;
            }
            if(ok)
                dag[i].push_back(j);
        }
    }

    return coverNode(dag) == 2;
}

int main()
{
    int h, w;
    cin >> h >> w;
    vector<vector<int> > a(h, vector<int>(w));
    vector<vector<int> > b(w, vector<int>(h));
    for(int i=0; i<h; ++i){
        for(int j=0; j<w; ++j){
            cin >> a[i][j];
            b[j][i] = a[i][j];
        }
    }

    if(solve(a) && solve(b))
        cout << "YES" << endl;
    else
        cout << "NO" << endl;

    return 0;
}

Measured memory_bytes: 45356
#include<cstdio>
int main(){
	char s[6]={};
	scanf("%s",s);
	int x=0;
	for(int i=0;i<5;i++){
		if(s[i]=='A' && s[i+1]=='C')x=1;
	}
	if(x==1)printf("Yes");
	else printf("No");
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include<string>
#include<cmath>
#include<ciso646>
#include<cstring>
#include<iomanip>
#include<vector>
using ll = long long;

using namespace std;
int main()
{/*三日目*/
//少数も使いたい割り算はしない方がいい(三日目）
// 数値の大きさ
	string s; cin >> s;
	int len = s.length();
	for (int i = 0;i < len;i++) {
		cout << "x";
	}

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int64_t times2(int64_t n) {
	int64_t output = 1;
	for (int64_t i = 0; i < n; ++i) {
		output *= 2;
	}
	return output;
}

int main() {
	//input
	int N;
	cin >> N;

	vector<int> A(N, 0);
	for (int i = 1; i < N; i++) {
		int temp;
		cin >> temp;
		A[temp - 1] += 1;
	}

	//output
	for (int i = 0; i < N; i++) {
		cout << A[i] << endl;
	}

	return 0;
}


Measured memory_bytes: 4052
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void put(int x){
	if(x<0) {
		putchar('-');
		x*=-1;
	}
	if(x==0) {
		putchar('0');
	}
	int num=0;
	char c[15];
	while(x) {
		c[++num]=(x%10)+48;
		x/=10;
	}
	while(num) {
		putchar(c[num--]);
	}
	putchar('\n');
}
inline void in(int &x){
	char ch=getchar();
	int flag=1;
	while(!(ch>='0'&&ch<='9')) {
		if(ch=='-')
			flag*=-1;
		ch=getchar();
	}
	x=ch-'0';
	ch=getchar();
	while(ch>='0'&&ch<='9') {
		x=((x<<3)+(x<<1))+ch-'0';
		ch=getchar();
	}
	x*=flag;
}
int k;string s;
int main(){
//	freopen("1.in","r",stdin);
//	freopen("1.out","w",stdout);
	in(k);cin>>s;
	if(s.length()>=k){
		for(int i=0;i<k;i++)cout<<s[i];
		if(s.length()!=k)cout<<"..."<<endl;
	}
	else cout<<s<<endl;
	return 0;
}

Measured memory_bytes: 3620
S = input()

if len(S) % 2 != 0:
    print("No")
else:
    N = int(len(S) / 2)

    flag = 0

    for indx in range(N):
        if ((S[indx * 2 + 0] != "h") or
            (S[indx * 2 + 1] != "i")):
            flag = 1

    if flag == 0:
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 3060
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//typedef
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

template<class Functor>
LL bin_search(LL initial_ng, LL initial_ok, Functor functor){
    LL ng = initial_ng;
    LL ok = initial_ok;

    while(abs(ok - ng) > 1){
        LL mid = (ok + ng) / 2;
        if(functor(mid)) ok = mid;
        else ng = mid;
    }
    return ok;
}

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    LL n;
    cin>>n;
    VL a(n);
    REP(i,n)cin>>a[i];
    VL ans(n);

    LL ok = bin_search(0 - 1, a[0]+1 +1, [&](LL x){
        LL z = x*2;
        REP(k,n){
            z = (a[k] - z/2) * 2;
        }
        return x*2 >= z;
    });

    ans[0] = ok*2;
    FOR(k,1,n){
        ans[k] = (a[k-1] - ans[k-1]/2) * 2;
    }

    //LL l = 0;
    //LL r = a[0]+1;

    //while(l < r){
    //    LL x = (l+r)/2;
    //    ans[0] = x*2;
    //    FOR(k,1,n){
    //        ans[k] = (a[k-1] - ans[k-1]/2) * 2;
    //    }
    //    LL z = (a[n-1] - ans[n-1]/2)*2;
    //    if(ans[0] == z){
    //        break;
    //    }
    //    else if(ans[0] < z){
    //        l = x;
    //    }
    //    else{
    //        r = x;
    //    }
    //}


    REP(i,n)cout<<ans[i]<<" ";
    cout<<endl;
}

Measured memory_bytes: 2944
#include<bits/stdc++.h>
using namespace std;
int n,k,a[101];
bool dp[100001];
int main()
{
    cin >> n >> k;
    for(int i=1; i<=n; i++) cin >> a[i];
    dp[0] = false;
    for(int i=1; i<=k; i++)
    {
        for(int j=1; j<=n; j++)
        {
            if(i>= a[j] && dp[i - a[j]] == false){ dp[i] = true; break; }
        }
    }
    if(dp[k] == true) cout << "First";
    else cout << "Second";
}

Measured memory_bytes: 384
# 一つの数字の入力
a = int(input())

if(a<=111):
    print('111')
elif(a<=222):
    print('222')
elif(a<=333):
    print('333')
elif(a<=444):
    print('444')
elif(a<=555):
    print('555')
elif(a<=666):
    print('666')
elif(a<=777):
    print('777')
elif(a<=888):
    print('888')
elif(a<=999):
    print('999')


Measured memory_bytes: 3060
#include <iostream>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
#define rep(i,N) for(int i=0;i<((int)N);i++)
#define mod 1000000007
typedef long long ll;
using namespace std;
int main(void){
  int N;
  cin>>N;
  int a[N]; int num[100001];
  for(int i=0;i<N;i++){
      cin>>a[i];
  }
  for(int i=0;i<=100000;i++){
      num[i]=0;
  }
  for(int i=0;i<N;i++){
      num[a[i]]++;
  }
  int ans=0;
  
  for(int i=0;i<=99998;i++){
    if(num[i]+num[i+1]+num[i+2]>ans) ans=num[i]+num[i+1]+num[i+2];
  }
  cout<<ans;
  return 0;
  
}


Measured memory_bytes: 1024
import java.util.Scanner;
import java.util.stream.Stream;


public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] list = Stream.of(sc.nextLine().split("")).mapToInt(Integer::parseInt).toArray();
		int value=0;
		int result=0;
		int min_result=0;
		
		for(int i=0;i<=1;i++) {
			int cnt=i;
			result=0;
	        for(int j=0;j<list.length;j++) {
	        	value = cnt++ % 2;
	        	if(list[j] != value) result++;
			}
	        if(i==0) min_result = result;
	        else min_result = Math.min(min_result, result);
		}
    	System.out.println(min_result);
	}
}

Measured memory_bytes: 37068
#include <iostream>
#include <algorithm>
#include <vector>
#include <string.h>
#include <queue>
#include <cassert>
using namespace std;
using lint = long long;
const long mod = 1e9 + 7;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl(long(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr start, itr goal){ for(auto i = start; i != goal; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<long> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } long C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };

int main(){
    int A, B, C;
    cin >> A >> B >> C;
    Yes(A == B && B == C);
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(void){

  int a[4],b[4];
  while( cin >> a[0] >> a[1] >> a[2] >> a[3] >> b[0] >> b[1] >> b[2] >> b[3] ){

    int hit = 0;
    int blow = 0;

    for( int i = 0 ; i < 4 ; i++ ){
      if( a[i] == b[i] ) hit++; 
      for( int j = 0 ; j < 4 ; j++ ){
	if( i != j && a[i] == b[j] ) blow++;
      }
    }
    cout << hit << " " << blow << endl;
  }
  return 0;
}

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

typedef long long ll;
typedef pair<int,int> pii;
const int INF=2e9+10;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert
#define era erase
typedef vector<int> vi;
typedef queue<int> qi;
typedef greater<int> gi;
typedef priority_queue<int> pqi;
typedef priority_queue<int,vi,gi> pqgi;

inline ll read() {
	ll xx=0,ww=1;
	char ch=getchar();
	while(ch>'9'||ch<'0') {
		if(ch=='-') ww=-ww;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9') {
		xx=10*xx+ch-48;
		ch=getchar();
	}
	return xx*ww;
}

ll n,p;
ll a[1000010];

bool prime(ll x) {
	if(x<2) return false;
	for(int i=1; i*i<=x; i++) if(x%(ll)i==0) return false;
	return true;
}

ll Pow(ll a,ll b) {
	ll ans=1;
	if(a==1) return 1;
	for(int i=1; i<=b; i++){
		ans*=(ll)a;
		if(ans>1000000000000) return -1;
	}
	return ans;
}

void init() {
	n=read();
	p=read();
	if(n==1) printf("%lld\n",p);
	else {
		ll ans=1;
		for(ll i=2;; i++) {
			ll now=Pow(i,n);
			if(now==-1) break;
			if(p%now==0) ans=i;
		}
		printf("%lld\n",ans);
//		int cnt=0;
//		for(int i=3;i*i<=p;i+=2)
//			if(prime(i)) a[++cnt]=i;
//		for(int i=1;i<=cnt;i++){
//			int ans=1;
//			for(int j=1;;j++){
//				ll now=Pow(a[i],j*n);
//				if(p%now==0)
//			}
//		}
	}
}

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

Measured memory_bytes: 256
using System;

class ABC074D
{
	static public void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
		int[,] A = new int[N+1,N+1];
		string[] vals;
		for(int i=1; i<=N; i++)
		{
			vals = Console.ReadLine().Split(' ');
			for(int j=1; j<=N; j++)
			{
				A[i,j] = int.Parse(vals[j-1]);
			}
		}
		
		bool[,] direct = new bool[N+1, N+1];
		for(int i=1; i<=N; i++)
			for(int j=1; j<=N; j++)
				direct[i,j] = true;

		for(int i=1; i<=N-1; i++)
		{
			for(int j=i+1; j<=N; j++)
			{
				for(int k=1; k<=N; k++)
				{
					if(k == i || k == j)
						continue;
					if(A[i,j] > A[i,k] + A[k, j])
					{
						Console.WriteLine("-1");
						return;
					}
					else if(A[i,j] == A[i,k] + A[k,j])
					{
						direct[i,j] = false;
					}
				}
			}
		}
		
		long ans = 0;
		for(int i=1; i<=N-1; i++)
		{
			for(int j=i+1; j<=N; j++)
			{
				if(direct[i,j] == true)
					ans += A[i,j];
			}
		}
		Console.WriteLine(ans);
	}
}


Measured memory_bytes: 21080
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
int n,q;
int c[200];
int main(){
    while(1) {
        cin >> n >> q;
        if(n == 0) 
            break;
        REP(i,101) {
            c[i] = 0;
        }

        REP(i,n) {
            int m;
            cin >> m;
            REP(i,m) {
                int d;
                cin >> d;
                c[d]++;
            }
        }
        int ans = 1;
        FOR(i,1,101) {
            if(c[ans] < c[i]) {
                ans = i;
            }
        }
        cout << (c[ans] >= q ? ans : 0) << endl;
    }
}




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

using namespace std;

int main()
{
	int N;
	int K;
	int p;
	vector<int> pList;

	int result = 0;

	cin >> N >> K;

	for (int i = 0; i < N; i++)
	{
		cin >> p;
		pList.push_back(p);
	}

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

	for (int i = 0; i < K; i++)
	{
		result += pList[i];
	}
	
	cout << result << endl;
	return 0;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
constexpr int mod = 1000000007;
constexpr int inf = 1e9;
const int maxn = 100005;
ll a, b, n, ans, l , r;
int main(){
	cin>>a>>b>>n;
	ans = 0;
	if(b <= n){
		ll y = floor(a * (b - 1) / b) - a * floor((b - 1) / b);
		cout<<y<<endl;
	}
	else{
		ll y = floor(a * n / b) - a * floor(n / b);
		cout<<y<<endl;
	}
	return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define vmax 10000
constexpr ll inf = 100000000000000;
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/

//最大公約数
ll gcd(ll a,ll b){
    if(b==0){
        return a;
    }else{
        return gcd(b,a%b);
    }
}

//最小公倍数
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}

//素因数分解
map<int,int> prime_factor(int n,map<int,int> &res){
    for(int i=2;i*i<=n;i++){
        while(n%i==0){
            res[i]++;
            n/=i;
        }
    }
    if(n!=1){
        if(res[n]==0){
            res[n]=1;
        }else{
            res[n]++;
        }
    }
    return res;
}

//約数列挙
vector<ll> divisor(ll n){
    vector<ll> a;
    for(ll i=1;i*i<=n;i++){
        if(n%i==0){
            a.push_back(i);
            if(i*i!=n){
                a.push_back(n/i);
            }
        }
    }
    SORT(a);
    return a;
}

//拡張ユークリッドの互除法
int extgcd(int a,int b,int &x,int &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }else{
        int d=extgcd(b,a%b,y,x);
        y-=a/b*x;
        return d;
    }
}

//素数判定
void sieve(int n,vector<bool> &is_prime) {
	is_prime[0]=false;
	is_prime[1]=false;
	for (int i = 2; i * i <= n; i++) {
		if (is_prime[i]) {
			for (int j = i * i; j <= n; j += i) is_prime[j] = false;
		}
	}
	return;
}

//繰り返し2乗法
ll mod_pow(ll x,ll n,ll mod){
    x%=mod;
    ll res=1;
    while(n>0){
        if(n&1){
            res=res*x%mod;
        }
        x=x*x%mod;
        n>>=1;
    }
    return res;
}

//mod　m での a の逆元
int mod_inverse(int a,int m){
    int x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}

//nCkの前計算
void init(ll n,ll m,vector<ll> &factrial,vector<ll> &inverse){
    factrial.resize(n+1);
    inverse.resize(n+1);
    factrial[0]=1;
    inverse[0]=1;
    for(ll i=1;i<=n;i++){
        factrial[i]=factrial[i-1]*i%m;
        inverse[i]=mod_inverse(factrial[i],m);
    }
}

//nCk
ll nCk(ll n,ll k,ll m,vector<ll> &factrial,vector<ll> &inverse){
    if(n<0||k<0||n<k){
        return 0;
    }
    return factrial[n]*inverse[k]%m*inverse[n-k]%m;
}

int main(){
    ll n,m,ans1=0,ans2=0;
    cin>>n>>m;
    ll a[m];
    string  s[m];
    ll v1[n],v2[n];
    for(int i=0;i<m;i++){
        cin>>a[i]>>s[i];
        a[i]--;
    }
    rep(i,n){
        v1[i]=0;
        v2[i]=0;
    }
    for(int i=0;i<m;i++){
        if(s[i]=="WA"&&!v2[a[i]]){
            v1[a[i]]++;
        }else{
            if(!v2[a[i]]){
                v2[a[i]]++;
            }
        }
    }
    for(int i=0;i<n;i++){
        if(!v2[i]){
            v1[i]=0;
        }
        ans1+=v2[i];
        ans2+=v1[i];
    }
    cout<<ans1<<" "<<ans2<<endl;
}

Measured memory_bytes: 8064
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds; 
#define gc getchar_unlocked
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long int
#define s(x)	cin>>x
#define p(x)	cout<<x<<"\n"
#define goog(x, y)  cout<<"Case #"<<x<<": "<<y<<"\n"
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define INF 100000000000
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpi;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
typedef long double ld;

mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
int mpow(int base, int exp); 
void ipgraph(int n, int m);
void dfs(int u, int par);
int gcd(int a, int b) ;

const int mod = 1'000'000'007;
const int N = 3e5, M = N;
//=======================

vi g[N];
int a[N];

void solve() {
  int d,t,s;cin>>d>>t>>s;
  int k=d/s;
  if(k<t)
  p("Yes");
  else if(k==t)
  { if(d%s==0)
    p("Yes");
    else p("No");
  }
  else p("No");
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

    int t = 1;
    //cin >> t;
    while(t--) {
      solve();
    }

    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(int n, int m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
    //u--, v--;
		g[u].pb(v);
		g[v].pb(u);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}

int gcd(int a, int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 

Measured memory_bytes: 10700
import java.util.Scanner



object Main {
  def read() = {
    val sc = new Scanner(System.in)
    val n, k = sc.nextInt()
    (n, k)
  }

  def solve2(n: Int, k: Int): Double = {
    val tlist = (1 to n).map(i => {
      var t = 0
      var point = i
      while (point < k) {
        point = 2 * point
        t = t + 1
      }
      t
    })
    tlist.map(t => Math.pow(0.5, t)).sum/n
  }

  def main(args: Array[String]): Unit = {
    val (n, k) = read()
    println(solve2(n, k))
  }
}

Measured memory_bytes: 40788
//#include "pch.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(V) V.begin(),V.end()

vector<vector<int>> X(100000);
vector<int> ANS(100010, -1);
vector<int> par(100010);

void init(int N) {
	for (int i = 0;i < N;i++)
		par[i] = i;
	return;
}

int root(int x) {
	if (par[x] == x) return x;
	return par[x] = root(par[x]);
}

void unite(int x, int y) {
	x = root(x);
	y = root(y);
	if (x == y) return;
	par[y] = x;
}

int main() {
	int N, M, p, q, c;
	cin >> N >> M;
	vector<pair<int, pair<int, int>>> T(M);
	for (int i = 0;i < M;i++) {
		cin >> p >> q >> c;
		p--;q--;
		T[i] = { c,{p,q} };
	}
	sort(all(T));
	map<int, int> corr, ncor, in;
	map<int, vector<int>> U;
	int cnt = 0, scnt = 0, t;
	for (int i = 0;i < M;i++) {
		if (i > 0 && T[i].first != T[i - 1].first) {
			for (int j = 0;j < cnt;j++) {
				t = root(j) + scnt;
				if (U.count(t))
					U[t].push_back(ncor[j]);
				else
					U.insert({ t,{ncor[j]} });
				X[ncor[j]].push_back(t);
				//cout << "S" << scnt << t << j << ncor[j] << endl;
				corr.erase(ncor[j]);
				ncor.erase(j);
			}
			scnt += cnt;
			cnt = 0;
		}

		p = T[i].second.first;
		q = T[i].second.second;

		if (corr.count(p) == 0) {
			corr.insert({ p, cnt });
			ncor.insert({ cnt, p });
			par[cnt] = cnt;
			cnt++;
		}
		if (corr.count(q) == 0) {
			corr.insert({ q, cnt });
			ncor.insert({ cnt, q });
			par[cnt] = cnt;
			cnt++;
		}
		//cout << "T" << cnt << " " << p<<corr[p]<<ncor[corr[p]] << " " << q<<corr[q]<<ncor[corr[q]]<< endl;
		p = corr[p]; q = corr[q];

		unite(p, q);
	}

	for (int j = 0;j < cnt;j++) {
		t = root(j) + scnt;
		if (U.count(t))
			U[t].push_back(ncor[j]);
		else
			U.insert({ t,{ncor[j]} });
		X[ncor[j]].push_back(t);
		//cout << "S" << scnt << t << j << ncor[j] << endl;
	}

	//ここまででX[a]にはaから一つの会社の路線で行ける場所の配列が会社ごとに分かれて入っている、、、はず

	queue<int> bfs;
	bfs.push(0);
	int g, gs, vs;
	vector<int> V;
	set<int> al;
	ANS[0] = 0;
	while (!bfs.empty()) {
		g = bfs.front();
		bfs.pop();
		gs = X[g].size();
		for (int i = 0;i < gs;i++) {
			if (al.count(X[g][i])) continue;
			al.insert(X[g][i]);
			V = U[X[g][i]];
			vs = V.size();
			for (int j = 0;j < vs;j++) {
				if (ANS[V[j]] == -1) {
					bfs.push(V[j]);
					ANS[V[j]] = ANS[g] + 1;
				}
			}
		}
	}
	/*for (int i = 0;i < N;i++)
		cout << ANS[i] << endl;*/
	cout << ANS[N - 1] << endl;
}


Measured memory_bytes: 40704
import java.util.Scanner

/**
 * Created by sonetsuyoshi on 2015/12/16.
 */

case class UnionFind(n: Int) {
  val sizes = Array.fill(n)(1)
  val par = 0.until(n).toArray
  var size = n

  def find(x: Int): Int = {
    if(par(x) == x) return x
    par(x) = find(par(x))
    par(x)
  }

  def unite(x: Int, y: Int): Boolean = {
    val parentX = find(x)
    val parentY = find(y)

    if(parentX == parentY) {
      return false
    }

    val (sId, lId) = if(sizes(parentX) < sizes(parentY)) {
      (parentX, parentY)
    } else {
      (parentY, parentX)
    }

    par(sId) = lId
    sizes(lId) += sizes(sId)
    sizes(sId) = 0

    size -= 1
    true
  }

  def isSame(x: Int, y: Int): Boolean = {
    return find(x) == find(y)
  }
}

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt
  val M = sc.nextInt

  val uf = UnionFind(N + M)

  for(i <- 0 until N) {
    val K = sc.nextInt
    for(j <- 0 until K) {
      val l = sc.nextInt - 1
      uf.unite(i, l + N)
    }
  }

  if(1.until(N).forall(id => uf.isSame(0, id))) {
    println("YES")
  } else {
    println("NO")
  }
}

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

using namespace std;

int main(){
  long n,m,a,b,c;
  char N,M,A,B,C;
  c= 0;
  cin >>  a;
  b= 1;
  for(int i =0 ; i <= 9; i++){
    c+= int(a/b)%10;
    b*= 10;
  }

  if(a%c) cout << "No"<< endl;
  else cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <sstream>
#include <iomanip>
#include <complex>
using namespace std;

#define ll long long
#define vvi vector< vector<int> >
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

vector<char> cmap;
char getrev(char c,int kagi){
	int rst;
	if(c>='a') rst = c -'a' ;
	else rst = c - 'A'+ ('Z'-'A'+1);
	if(rst-kagi<0) return cmap[rst-kagi+cmap.size()];
	else return cmap[rst-kagi];
}
int main(){
	for(int i='a';i<'z'+1;i++) cmap.pb(i);
	for(int i='A';i<'Z'+1;i++) cmap.pb(i);

	while(1){
		int n;
		cin >> n;
		if(n==0) break;
		int klist[100];
		REP(i,n){
			cin >> klist[i];
		}
		string ango;
		cin >> ango;
		int nowkagi = 0;
		REP(i,ango.size()){
			cout << getrev(ango[i],klist[nowkagi]);
			if(nowkagi==n-1) nowkagi = 0;
			else nowkagi++;
		}
		cout << endl;
	}
}

Measured memory_bytes: 1224
//ABC130A
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
using namespace std;

int main(){
	int x, a;
	cin >> x >> a;
	if(x < a){
		cout << "0" << endl;
	}else{
		cout << "10" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
import numpy as np
import sys
input = sys.stdin.readline


def main():
    n, s = map(int, input().split())
    A = [int(i) for i in input().split()]

    MOD = 998244353

    dp = np.zeros(s + 1, dtype="int32")
    dp[0] = 1

    for a in A:
        p = (dp * 2) % MOD
        p %= MOD
        p[a:] += dp[:-a]
        dp = p % MOD

    print(dp[s])


if __name__ == '__main__':
    main()

Measured memory_bytes: 27408
#include <bits/stdc++.h>
#include <cstdlib>  // abs() for integer 絶対値求めやつ
#include <cmath>    // abs() for float, and fabs()
#include <algorithm>
#include <vector>
#include <string>
#include<iomanip>//浮動小数点数を出力する制度の指定
//使い方　数値をnumとして　cout<<setprecision(n)<<num ;nは桁数
#define rep(i,n) for(int i = 0; i < (n);i++)
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
using namespace std;
using ll =long long;
using db = double;
#define INF 2000000000
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
/*覚えてないことメaモ
  数値型から文字列に変換　to_string(number);これは簡単
  文字列から数値型に変換　stoi(number)
  文字列からllに変換　stoll(number)
  __gcd(a,b)は最大公約数を取ってくれる、aとb
  の大きい方をNとしたとき、計算量は√N
 */

//ここから書き始める
int main(){
	int n;
	cin >> n;
	//要素数nの配列を作るテンプレート
	vector<int> A(n);
	for(int i = 0 ; i < n; i ++){
		cin>>A[i];
	}

	//要素数nの配列を作るテンプレート
	vector<int> B(n);
	for(int i = 0 ; i < n; i ++){
		cin>>B[i];
	}

	ll ans = 0;
	rep(i,n){
		if(A[i] > B[i]){
			ans += A[i]-B[i];
		}
	}
	cout << ans<<endl;

}



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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}

ll nextLong() { ll x; scanf("%lld", &x); return x;}

int main2() {
  ll X = nextLong();
  ll Y = nextLong();
  ll A = nextLong();
  ll B = nextLong();
  ll C = nextLong();
  vector<ll> p(A), q(B), r(C);
  REP(i, A) p[i] = nextLong();
  REP(i, B) q[i] = nextLong();
  REP(i, C) r[i] = nextLong();

  sort(ALL(p)); reverse(ALL(p));
  sort(ALL(q)); reverse(ALL(q));
  sort(ALL(r)); reverse(ALL(r));

  vector<ll> eat;
  REP(i, X) eat.push_back(p[i]);
  REP(i, Y) eat.push_back(q[i]);
  REP(i, r.size()) eat.push_back(r[i]);
  sort(ALL(eat)); reverse(ALL(eat));

  ll ans = 0;
  REP(i, X+Y) ans += eat[i];
  cout << ans << endl;
  
  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}

Measured memory_bytes: 9748