akhauriyash/Code-Regression huggingface dataset:
package main

import "fmt"

func getMin(a []int) (min int) {
	min = a[0]
	for i := 0; i < len(a); i++ {
		if a[i] < min {
			min = a[i]
		}
	}
	return
}

func getMax(a []int) (max int) {
	max = a[0]
	for i := 0; i < len(a); i++ {
		if a[i] > max {
			max = a[i]
		}
	}
	return
}

func main() {
	var N int
	fmt.Scan(&N)
	a := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&a[i])
	}
	min := 4000000
	for i := getMin(a); i <= getMax(a); i++ {
		tmp := 0
		for j := 0; j < N; j++ {
			tmp += (a[j] - i) * (a[j] - i)
		}
		if tmp < min {
			min = tmp
		}
	}
	fmt.Println(min)
}


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

int main(){
    int N;
    cin >> N;
    int A[N+1];
    for(int i=1;i<=N;i++) cin >> A[i];
    int B[N+1];
    for(int i=N/2+1;i<=N;i++){
        B[i] = A[i];
    }
    for(int i=N/2;i>=1;i--){
        int k = 2*i;
        int flag = 0;
        while (k <= N){
            if (B[k]){
                flag += 1;
                flag %= 2;
            }
            k += i;
        }
        if (flag == A[i]) B[i] = 0;
        else B[i] = 1;
    }
    int cnt = 0;
    for(int i=1;i<=N;i++) cnt += B[i];
    cout << cnt << endl;
    for(int i=1;i<=N;i++) if(B[i]) cout << i << " ";
    if (cnt) cout << endl;
}

Measured memory_bytes: 2432
/*
  AOJ 1056
  Title:Ben Toh
  @kankichi573
*/
#include <stdio.h>
#include <float.h>

double memo[100000][21];
double visit[100000][21];
double solve(int n,int success_days)
{
  double cont_succ,ret;

  //printf("arg=%d %d\n",n,success_days);

  if(n<=0)
    return(0);
  if(success_days<=20 && visit[n][success_days])
    return(memo[n][success_days]);
 
  if(success_days < 20)
    cont_succ=1.0/(double)(1<<success_days);
  else
    cont_succ=0.0;

  if(success_days < 20)
    {
      ret =  cont_succ*(1+solve(n-1,success_days+1));
      ret += (1-cont_succ)*(solve(n-1,0));
    }
  else
    ret = (solve(n-1,0));
  if(success_days==0 && success_days<=20)
    {
    memo[n][success_days]=ret;
    visit[n][success_days]=ret;
    }
  return(ret);
}
main()
{
  int n;
  while(scanf("%d",&n) && n)
    {
      printf("%lf\n",solve(n,0));
    }
  return(0);
}

Measured memory_bytes: 38796
#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#define INT_MAX 2147483647
#define LLINT_MAX 9223372036854775807
#define mod 1000000007
using namespace std;

int main() {
	string o, e;
	cin >> o >> e;
	for (int i = 0; i < e.length(); i++)
			cout << o[i] << e[i];
	if (o.length() != e.length())
		cout << o[o.length() - 1];
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 1e18
#define int long long
#define Rep(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
using namespace std;
typedef pair<int, int> P;
typedef pair<int, P> PP;
const int mod = 1000000007;
//const int mod = 998244353;

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

    int n, m;
    cin >> n >> m;
    vector<int> cnt(n, 0);
    int AC = 0, WA = 0;
    rep(i, m)
    {
        int p;
        string s;
        cin >> p >> s;
        p--;
        if (cnt[p] == -1)
            continue;
        if (s == "AC")
        {
            AC++;
            WA += cnt[p];
            cnt[p] = -1;
        }
        else
            cnt[p]++;
    }
    cout << AC << " " << WA << endl;
}


Measured memory_bytes: 3992
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define LI list<int>
#define vct vector
#define vi vct<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vvi vct<vi>
#define vll vct<ll>
#define vvll vct<vll>
#define vpii vct<pii>
#define vpll vct<pll>
#define vb vct<bool>
#define vs vector<string>
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define ff first
#define ss second
#define bg begin()
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define ft cout<<"for test"<<endl;
#define read(v,a,n) for(int i=a; i<n; i++)cin>>v[i];
#define print(v) for(auto it:v)cout<<it<<' ';cout<<endl;
#define PI 2*acos(0.0)
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define t_c int test,cs=1;cin>>test;while(test--)
///................function.....................///
#define siz(s) (int)(s.size())
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define mod 999999937
int main()
{
    FIO;
    ///freopen("in.txt","r",stdin);
    ///freopen("output.txt","w",stdout);
    int l,r,d;
    cin>>l>>r>>d;
    int ok=(l%d==0)?1:0;
    cout<<r/d-l/d+ok<<endl;
}


Measured memory_bytes: 3596
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#include <set>
#include <map>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;

int main(){
  int n,m;
  cin >> n >> m;
  bool table[n][m];
  fill(table[0],table[n],false);
  REP(i,n){
    int k; cin >> k;
    REP(j,k){
      int a; cin >> a;
      table[i][a-1] = true;
    }
  }
  int ans = 0;
  REP(j,m){
    bool liked = true;
    REP(i,n){
      if(!table[i][j]) liked = false;
    }
    if(liked) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int main() {
	long long N; cin >> N;
	vector<long long>A(N + 1, 0);
	for (long long i = 1; i <= 3334; i++) {
		for (long long j = 1; j <= 3334; j++) {
			long long num = (i + j) * (i + j) - i * j;
			for (long long k = 1; k <= 100; k++) {
				if (k * k + k * (i + j) + num <= N) A.at(k * k + k * (i + j) + num)++;
			}
		}
	}
	for (long long i = 1; i <= N; i++) {
		cout << A.at(i) << endl;
	}
}


Measured memory_bytes: 3572
import java.io.*;
import java.math.*;
import java.util.*;
public class Main {

	public static void main(String[] args) { //WOOOOOOO AtCoder is HELPING!!!!!!!!!!
		Scanner input = new Scanner(System.in);
		String ans = "";
		int N = input.nextInt();
		int[] cnts = new int[300]; //Encapsulating all possible characters to prevent debugging
		String first = input.next();
		for (int i = 0; i < first.length(); i++) {
			char letter = first.charAt(i);
			cnts[(int)(letter)]++;
		}
		for (int i = 1; i < N; i++) {
			String x = input.next();
			int[] cur = new int[300];
			for (int j = 0; j < x.length(); j++) {
				char letter = x.charAt(j);
				cur[(int)(letter)]++;
			}
			for (int j = 0; j < cur.length; j++) {
				cnts[j]=Math.min(cnts[j], cur[j]);
			}
		}
		for (int i = 0; i < cnts.length; i++) {
			for (int j = 0; j < cnts[i]; j++) {
				char cur = (char)(i);
				String curans = Character.toString(cur);
				ans+=curans;
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P, P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i, x) for (long long i = 0; i < x; i++)
#define repn(i, x) for (long long i = 1; i <= x; i++)
#define SORT(x) sort(x.begin(), x.end())
#define ERASE(x) x.erase(unique(x.begin(), x.end()), x.end())
#define POSL(x, v) (lower_bound(x.begin(), x.end(), v) - x.begin())
#define POSU(x, v) (upper_bound(x.begin(), x.end(), v) - x.begin())
vector<pair<string, P>> vec;
// vector<vector<int>> data(3, vector<int>(4));

void solve(long long X, long long Y, long long A, long long B, long long C,
           vector<long long> p, vector<long long> q, vector<long long> r) {
    sort(p.begin(), p.end(), greater<ll>());
    sort(q.begin(), q.end(), greater<ll>());
    sort(r.begin(), r.end(), greater<ll>());
    priority_queue<ll, vector<ll>, greater<ll>> que;
    rep(i, X) { que.push(p[i]); }
    rep(i, Y) { que.push(q[i]); }
    rep(i, C) {
        if (que.top() < r[i]) {
            que.pop();
            que.push(r[i]);
        }
    }
    ll res = 0;
    while (!que.empty()) {
        res += que.top();
        que.pop();
    }
    cout << res << endl;
}

int main() {
    long long Y;
    long long C;
    long long A;
    long long X;
    long long B;
    scanf("%lld", &X);
    scanf("%lld", &Y);
    scanf("%lld", &A);
    vector<long long> p(A - 1 + 1);
    scanf("%lld", &B);
    vector<long long> q(B - 1 + 1);
    scanf("%lld", &C);
    vector<long long> r(C - 1 + 1);
    for (int i = 0; i <= A - 1; i++) {
        scanf("%lld", &p[i]);
    }
    for (int i = 0; i <= B - 1; i++) {
        scanf("%lld", &q[i]);
    }
    for (int i = 0; i <= C - 1; i++) {
        scanf("%lld", &r[i]);
    }
    solve(X, Y, A, B, C, p, q, r);
    return 0;
}


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

int main() {
	ios_base::sync_with_stdio( false );

	double x = 0;
	double y = 0;
	double ang = 90;

	int d, a;
	char c;

	while( cin >> d >> c >> a ) {
		if( d == 0 && a == 0 ) { break; }

		x += d * cos( ang * 3.14159265358979 / 180.0 );
		y += d * sin( ang * 3.14159265358979 / 180.0 );
		ang -= a;
	}

	cout << (int)x << '\n' << (int)y << endl;
}



Measured memory_bytes: 3336
#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
int dp[MAX];
int a[MAX];
int n, k;
const int inf = 0x3f3f3f3f;


int main() {
	scanf("%d %d", &n, &k);
	for(int i = 0; i < n; ++i) {
		scanf("%d", a+i);
	}
	dp[n-1] = 0;
	for(int i = n-2; i >= 0; --i){
		dp[i] = dp[i+1] + abs(a[i] - a[i+1]);
		for(int j = 2; j <= k; ++j) {
			if(i+j < n) dp[i] = min(dp[i], abs(a[i] - a[i+j]) + dp[i+j]);
		}
		
	}
	printf("%d\n", dp[0]);

	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main() {
string s;
int a,b,c,i,n,j,t;
int g,h,o;
    map<int,int> ma;
    map<int,int> :: iterator it;
vector<int> v;
    h=0;
cin>>s;
if(s[0]=='S')cout<<"Cloudy"<<endl;
if(s[0]=='C')cout<<"Rainy"<<endl;
if(s[0]=='R')cout<<"Sunny"<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
	string a;
	char b[101];
	while(true){
	int count=0;
	getline(cin,a);
	if(a==".")
		break;
	for(int i=0;i<a.size();i++){
		if(a[i]=='('||a[i]==')'||a[i]=='['||a[i]==']'){
			b[count]=a[i];
			count++;
		}
	}
	int check;
	while(true){
		check=count;
		for(int i=0;i<count-1;i++){
			if((b[i]=='('&&b[i+1]==')')||(b[i]=='['&&b[i+1]==']')){
				for(int j=0;j<count;j++){
					if(j<i)
						b[j]=b[j];
					if(j>i+1)
						b[j-2]=b[j];
				}
				count-=2;
			}
		}
		if(count==check)
			break;
	}
	if(count==0)
		cout<<"yes"<<endl;
	else
		cout<<"no"<<endl;
	}
    return 0;
}

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

inline int nxt(){
    int n;
    scanf("%d", &n);
    return n;
}
int main(){
    int h = nxt(), w = nxt();
    std::string s[h+2];
    s[0] = s[h+1] = std::string(w+2,'.');
    for(int i = 1; i < h +1; ++i){
        std::string a;
        std::cin >> a;
        s[i] = '.' + a + '.';
    }
    for(int i = 1; i <= h; ++i){
        for(int j = 1; j <= w; ++j){
            int count = 0;
            if(s[i][j] == '.'){
                for(int k = -1; k <=1; ++k){
                    for(int l = -1; l <=1; ++l){
                        if(s[i+k][j+l] == '#') count++;
                    }
                }
                s[i][j] = '0' + count;
            }
        }
        std::cout << s[i].substr(1,w) << std::endl;
    }
    
}



Measured memory_bytes: 256
////////////////////////////////////////////
///                                      ///
///         Template ver. 1 rapel        ///
/// Fear is Temporary, Regret is Forever ///
///          Must Try and Get AC         ///
///                                      ///
////////////////////////////////////////////
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <iomanip>

#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <utility>

#include <math.h>
#include <complex>

#include <assert.h>
#include <time.h>
//#include <chrono>
//#include <random>

#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <bitset>

#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define endl '\n'
using namespace std;

typedef long long LL;
typedef unsigned long long ULL;

void desperate_optimization(int precision){
  	ios_base::sync_with_stdio(false);
  	cin.tie(0);
  	cout.tie(0);
  	cout.setf(ios::fixed);
  	cout.setf(ios::showpoint);
  	cout.precision(precision);
}

const int N = 400;
const LL MOD = 1e9 + 7;
LL psum[N + 5][N + 5];
LL val[N + 5];

void pre() {
	for(int i = 1;i <= N;i++) val[i] = 1;
	for(int i = 0;i <= N;i++) {
		for(int j = 1;j <= N;j++) psum[i][j] = (psum[i][j-1] + val[j]) % MOD;
		for(int j = 1;j <= N;j++) val[j] = val[j] * j % MOD;
	}
}

int A[N + 5],B[N + 5];
LL dp[N + 5][N + 5];

LL solve(int idx,int sisa) {
	if(idx == 0) return (psum[sisa][B[idx]] + MOD - psum[sisa][A[idx] - 1]) % MOD;
	LL &res = dp[idx][sisa];
	if(res != -1) return res;
	res = 0;
	for(int i = 0;i <= sisa;i++) {
		res += solve(idx - 1, sisa - i) * (psum[i][B[idx]] + MOD - psum[i][A[idx] - 1]) % MOD;
	}
	return res %= MOD;
}

void hora(int tc) {
	int n,m;
	cin>>n>>m;
	for(int i = 0;i < n;i++) cin>>A[i];
	for(int i = 0;i < n;i++) cin>>B[i];
	memset(dp, -1, sizeof dp);
	cout<<solve(n - 1, m)<<endl;
}

int main(){
	pre();
	desperate_optimization(10);
	int ntc = 1;
	//cin>>ntc;
	for(int tc = 1;tc <= ntc;tc++) hora(tc);
	return 0;
}




Measured memory_bytes: 2816
i,a[10],b[10],h,g,c,x;
main(n)
{ 
  for(scanf("%d",&n);n--;puts(x?"NO":"YES"))
    {
      for(a[0]=b[0]=h=g=i=x=0;i++<10;)
	{
	  scanf("%d",&c);
	  if(x!=0)continue;
	  if(a[h]>=c && b[g]>=c)
	    x=-1;
	  else
	    {
	      if(a[h]<c && (a[h]>b[g] || b[g]>=c))
		a[++h]=c;
	      else
		b[++g]=c;
	    }
	}
    }
}

Measured memory_bytes: 0
#include <stdio.h>
 
int main(void)
{
    int a, b, c, i, j, n, m;
    int gyouretu_a[101][101]={{0}};
	int gyouretu_b[101]={0};
	int gyouretu_c[101]={0};
     
    scanf("%d %d\n", &n, &m);
 
    for(i=1; i<= n; i++)
	{
        for(j=1; j<= m; j++)
		{
            scanf("%d", &a);
            
			gyouretu_a[i][j] = a;
 
            if(j < (m-1))
			{
                scanf(" ");
            }
			else if(j ==m)
			{
                scanf("\n");
            }
        }
    }
     
    for(i=1; i<= m; i++)
	{
		scanf("%d\n", &b);
        gyouretu_b[i] = b;
    }
 
    for(i=1; i <= n; i++)
	{
        for(j=1; j<= m; j++)
		{
            gyouretu_c[i] += (gyouretu_a[i][j])* (gyouretu_b[j]);
        }
    }
     
     
    for(j=1; j <= n; j++)
	{
        c = gyouretu_c[j];
        printf("%d\n", c);
    }
     
    return 0;
}

Measured memory_bytes: 652
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef tuple<ll, ll, int> T;
const int MAX_M = 100005;
ll A[MAX_M];

int main()
{
	int N,M;
	cin >> N >> M;
	vector<T> t;
	rep(i,M)
	{
		int p,y;
		cin >> p >> y;
		t.push_back(T(p,y,i));
	}

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

	int cnt = 1;

	for (int i = 0; i < M; ++i)
	{
		if (i != 0 && get<0>(t[i-1]) != get<0>(t[i])) cnt = 1;
		A[get<2>(t[i])] = get<0>(t[i]) * 1e6 + cnt;
		cnt++;
	}	

	for (int i = 0; i < M; ++i)
	{
		int digit = to_string(A[i]).length();
		rep(j,12-digit) cout << "0";
		cout << A[i] << endl;
	}
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define SP << " " 
#define LLi long long int

using namespace std;

int imax=2147483647;
long long int llimax=9223372036854775807;

//int型vectorを出力
void PV(vector<int> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}

//LLi型vectorを出力
void PVL(vector<LLi> pvv) {
	rep(i, pvv.size()) cout << pvv[i] SP;
	cout << endl;
}

int main(){

	int n, l, r, mid, tmp;
	LLi mi=llimax, sul, sur, sb;
	vector<LLi> v, su(4);

	cin>> n;
	v.resize(n+1);

	rep(i, n){
		cin >> tmp;
		v[i+1]=v[i]+tmp;
	}
	//PVL(v);

	for(int i=2;i<=n-2;i++){
		fill( all(su), 0 );

		l=1;
		r=i;
		while(1){
			mid=(l+r)/2;
			sul=v[mid];
			sur=v[i]-v[mid];
			//cout<< l << "#" << r << " " << sul << " " << sur <<endl;
			if(r-l<2) break;

			if(sul<sur) l=mid;
			else r=mid;
		}
		sb=abs(sur-sul);
		su[0]=sul;
		su[1]=sur;
		if(abs(sur-sul-2*(v[mid+1]-v[mid]))<sb){
			su[0]+=v[mid+1]-v[mid];
			su[1]-=v[mid+1]-v[mid];
		}
		//cout<< su[0] << " " << su[1] << " ";

		l=i+1;
		r=n;
		while(1){
			mid=(l+r)/2;
			sul=v[mid]-v[i];
			sur=v[n]-v[mid];
			//cout<< l << "#" << r << " " << sul << " " << sur <<endl;
			if(r-l<2) break;

			if(sul<sur) l=mid;
			else r=mid;
		}
		sb=abs(sur-sul);
		su[2]=sul;
		su[3]=sur;
		if(abs(sur-sul-2*(v[mid+1]-v[mid]))<sb){
			su[2]+=v[mid+1]-v[mid];
			su[3]-=v[mid+1]-v[mid];
		}
		//cout<< su[2] << " " << su[3] <<endl;

		sort(su.begin(), su.end());
		//PVL(su);
		mi=min(mi, su[3]-su[0]);
	}

	cout<< mi <<endl;
 
	return 0;
}

Measured memory_bytes: 4816
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<utility>
#include<stdio.h>
#include<iomanip>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)
#define setp(n) fixed<<setprecision(n)
int main(){
    int n, k;
    string s;
    cin>>n>>k>>s;
    s[k-1]+=32;
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 256
import std.stdio;
import std.algorithm;
import std.array;
import std.conv;
import std.string;
import std.uni;
import std.range;

void main()
{
    auto a = readln.strip.repeat(10).join("");
    if (a.indexOf(readln.strip) != -1)
        writeln("Yes");
    else
        writeln("No");
}



Measured memory_bytes: 2484
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    int have = 1,cnt = 0;
    while(have<b)   ++cnt,--have,have+=a;
    printf("%d\n",cnt);
    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main(){
    int n,a,b;
    cin>>n>>a>>b;
    string A="Alice",B="Borys",D="Draw";
    int dif=b-a;
    if(dif%2){
        cout<<B<<endl;
    }
    else{
        cout<<A<<endl;
    }
    return 0;
}


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

int N;
int A[3][3];

signed main() {
  for(int i=0; i<3; i++) for(int j=0; j<3; j++) cin >> A[i][j];
  cin >> N;
  for(int n=0; n<N; n++) {
    int b; cin >> b;
    for(int i=0; i<3; i++) for(int j=0; j<3; j++) {
     if(A[i][j] == b) A[i][j] = 0;
    }
  }
  for(int i=0; i<3; i++) {
    if(A[i][0] == 0 && A[i][1] ==0 && A[i][2] ==0) {
      puts("Yes"); return 0;
    }
    if(A[0][i] == 0 && A[1][i] ==0 && A[2][i] ==0) {
      puts("Yes"); return 0;
    }
  }
  if(A[0][0] == 0 && A[1][1] ==0 && A[2][2] ==0) {
    puts("Yes"); return 0;
  }
  if(A[2][0] == 0 && A[1][1] ==0 && A[0][2] ==0) {
    puts("Yes"); return 0;
  }
  puts("No");
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
   int i,n;
   char s[101],t[101];
 
   scanf("%d",&n);
   scanf("%s %s",s,t);
   for (i=0;i<n;i++)
      printf("%c%c",s[i],t[i]);
   puts("");
   return 0;
}


Measured memory_bytes: 128
R1=range(-2,3)
R2=range(-1,2)
A1=[(x,y) for x in R1 for y in R1 if 3<x**2+y**2<6]
A2=[(x,y) for x in R2 for y in R2]
def fi(): return map(int,raw_input().split(" "))
def f(x,y,i):
  A=[A1,A2][i>0]
  return set([(x+dx,y+dy) for dx,dy in A if 0<=x+dx<10 and 0<=y+dy<10])

while 1:
  xf,yf=fi()
  if yf==xf==0: break
  raw_input()
  tmp=fi()
  PA=zip(tmp[0::2],tmp[1::2])
  FA=set([(xf,yf)])
  for xs,ys in PA:
    SA=f(xs,ys,1)
    tmp=set([])
    for xf,yf in FA: tmp=tmp|(SA&f(xf,yf,0))
    FA=tmp
  print ["NA","OK"][len(FA)>0]

Measured memory_bytes: 4284
N = int(input())
scedule = []
scedule.append([0, 0, 0])
for i in range(N):
    scedule.append(list(map(int,input().split())))

for i in range(N):
    timelimit = scedule[i+1][0] - scedule[i][0]
    x_distance = abs(scedule[i+1][1] - scedule[i][1])
    y_distance = abs(scedule[i+1][2] - scedule[i][2])

    if timelimit < (x_distance + y_distance):
        print("No")
        exit()
    if timelimit % (x_distance + y_distance) != 0:
        print("No")
        exit()

print("Yes")

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

using namespace std;

#define ll long long int

int main()
{
ios_base::sync_with_stdio(false);
cout.tie(NULL);
cin.tie(NULL);
              ll x,y,z;
  cin>>x>>y>>z;
  if(x+y+z>=22)
    cout<<"bust";
  else
    cout<<"win";
  
  return(0);
}


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int> A(2 * N), perm(2 * N);
	for (int i = 0; i < N; ++i) cin >> A[i] >> A[i + N];
	for (int i = 0; i < 2 * N; ++i) perm[i] = i;
	sort(perm.begin(), perm.end(), [&](int i, int j) { return A[i] < A[j]; });
	vector<int> c(N);
	long long sum = 0;
	for (int i = 0; i < N; ++i) {
		c[perm[i] % N] |= 1 << (perm[i] / N);
		sum += A[perm[i]];
	}
	vector<int> n(4);
	for (int i = 0; i < N; ++i) ++n[c[i]];
	if (n[1] >= 1 && n[2] >= 1 && n[0] == 0) {
		if (perm[N] % N != perm[N - 1] % N) sum += A[perm[N]] - A[perm[N - 1]];
		else sum += min(A[perm[N + 1]] - A[perm[N - 1]], A[perm[N]] - A[perm[N - 2]]);
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 2176
#include "iostream"
#include "fstream"
#include "algorithm"
#include "iomanip"
#include "stack"
#include "queue"
#include "string"
#include "vector"
#include "map"
#include "set"
#include "list"
#include "deque"
#include "complex"
#include "bitset"
#include "cmath"
#include "unordered_set"
#include "unordered_map"
#include "iterator"
#include <ctime>
#include <cassert>
#include "numeric"
#include <cstdio>

using namespace std;

//#define f(i,n) for(int i=0; i<n;i++) 
//#define rf(i, n) for(int i=n-1;i>=0;i--)
//#define forn(i, j, n) for(int i=j; i<n; i++)
//#define ff(i, j, n) f(i, n)f(j, n)
#define pb push_back
#define maxi(a,b) a = max(a, b);
#define mini(a,b) a = min(a, b);
#define endl '\n'
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sqr(x) ((x) * (x))
#define SZ(a) ((int)(a.size()))
#define watch(x) cout << (#x) << " = " << x << endl;
//typedef long long ll;
typedef long double ld;
#define int long long
#define double ld
typedef map<int, int> mii;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<pii> vpii;
typedef vector<char> vc;

template<class T>
void show(const vector<T> &a)
{
	for (T x : a)
		cout << x << " ";
	cout << endl;
}

const int sze = 3e5 + 50, oo = 1e18 + 500, mod = 1e9 + 7;
const double eps = 1e-9, PI = 2 * acos(0.0);
const int N = 1e6 + 10;
vi vertices[sze];
vi visit(sze, 0);
vc used(sze, false);
vi arr(sze, 0);
int n, m, k;
int cnt = 0;


signed main()
{
	ios::sync_with_stdio(0);
	cout.tie(0); cin.tie(0);
	/*freopen("stars.in", "r", stdin);
	freopen("stars.out", "w", stdout);*/

	cin >> n >> k;

	int mn = oo;
	int ans;

	for (int i = 1; i <= n; i++)
	{
		if (abs(k + i - 1) < mn)
		{
			mn = abs(k + i - 1);
			ans = i;
		}

		cnt += i;
	}

	cout << k*(n - 1) + cnt - n + 1 - ans;
	return 0;
}

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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
ll mod = 1000000007;

int main() {
source:
    ll x, y, a, b, c;
    cin >> x >> y >> a >> b >> c;
    ll p[a], q[b], r[c];
    rep(i, a) { cin >> p[i]; }
    rep(i, b) { cin >> q[i]; }
    rep(i, c) { cin >> r[i]; }

    sort(p, p + a, greater<ll>());
    sort(q, q + b, greater<ll>());

    ll index = 0;
    vector<ll> v(c + x + y);
    rep(i, x) {
        v[index] = p[i];
        index++;
    }
    rep(i, y) {
        v[index] = q[i];
        index++;
    }
    rep(i, c) {
        v[index] = r[i];
        index++;
    }

    sort(v.begin(), v.end(), greater<ll>());

    ll sum = 0;
    rep(i, x + y) { sum += v[i]; }
    cout << sum << endl;
    return 0;
}



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

typedef long long   ll;
typedef long double ld;
using namespace std;

int main() {
    ll k;
    cin >> k;
    vector<ll> a;
    for(int i = 1; i <= 9; i++) {
        a.emplace_back(i);
    }
    while(true) {
        if(k<=a.size()){
            cout << a[k-1] << "\n";
            return 0;
        }
        k-=a.size();
        vector<ll> oa;
        swap(oa,a);
        for(int x = 0; x < oa.size(); x++) {
            for(int i = -1; i <= 1; i++) {
                int d=oa[x]%10+i;
                if(d<0 || d>9) continue;
                ll nx=oa[x]*10+d;
                a.emplace_back(nx);
            }
        }
    }
    return 0;
}

Measured memory_bytes: 1712
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<map>
using namespace std;
map<int,int>mp;
 
int main()
{
    int n,m,x;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>x;
        mp[x]++;
    }
    cin>>m;
    for(int i=0;i<m;i++){
        cin>>x;
        if(mp[x]==0){
            cout<<"NO"<<endl;
            exit(0);
        }else mp[x]--;
    }
    cout<<"YES"<<endl;
    return 0;
}

Measured memory_bytes: 9600
#include <vector>
#include <iostream>
#include <stack>
#include <string>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <limits>
#include <cmath>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef pair<ll, ll> P;

#define rep(a,n) for(int a = 0;a < n;a++)
ll n, k;
vector<ll> as;
vector<ll> fs;

bool binary_search(ll m)
{
	ll rest = k;
	rep(i, n) {
		ll time = as[i] * fs[i];
		auto diff = time - m;
		if (diff > 0) {
			auto mod = diff % fs[i];
			rest -= (diff / fs[i]);
			if (mod) rest--;
		}
		if (rest < 0) {
			break;
		}
	}
	if (rest >= 0) {
		return true;
	}
	else {
		return false;
	}

}

int main(void)
{
	cin >> n >> k;
	as.resize(n); fs.resize(n);
	rep(i, n) cin >> as[i];
	rep(i, n) cin >> fs[i];
	sort(as.begin(), as.end(), greater<ll>());
	sort(fs.begin(), fs.end());
	ll l = 0;
	ll r = as.front() * fs.back() * 2 + 10;
	while (r - l > 1) {
		ll m = (l + r) / 2;
		bool ok = binary_search(m);
		if (ok) {
			r = m;
		}
		else {
			l = m;
		}
	}
	if (binary_search(l)) {
		cout << l << endl;
		return 0;
	}
	cout << r << endl;
	return 0;
}

Measured memory_bytes: 3328
#define ENABLE_DEBUG 1
// Kana's kitchen {{{
#include<bits/stdc++.h>
#define ALL(v) std::begin(v), std::end(v)
#define REP(i, k) for (decltype(k) i = 0; i < k; i++)
#define LOOP(k) REP (ngtkana_is_a_genius, k)

using i32 = std::int_least32_t;
using i64 = std::int_least64_t;
using u32 = std::uint_least32_t;
using u64 = std::uint_least64_t;
using usize = std::size_t;

template <class T, class U> using pair = std::pair<U, T>;
template <class T> using diag_pair = std::pair<T, T>;
template <class... Args> using tuple = std::tuple<Args...>;
template <class T> using vec = std::vector<T>;
template <class T> using numr = std::numeric_limits<T>;

#ifdef NGTKANA
#include<debug.hpp>
#else
#define DEBUG(...)(void)0
#endif
/*}}}*/

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::setprecision(15) << std::fixed;

    i32 X, n;
    std::cin >> X >> n;
    vec<i32> a(n);
    for (i32& x: a) std::cin >> x;

    auto kore = [&](i32 x){
        if (std::find(ALL(a), x)==a.end()) {
            std::cout << x << '\n';
            exit(0);
        }
    };

    kore(X);
    for (i32 i=1; i<=101; i++) {
        kore(X-i);
        kore(X+i);
    }
}


Measured memory_bytes: 3652
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
using namespace std;

/*
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long ll;

#define fi first
#define se second

using Graph = vector<vector<int>>;

const int mod = 998244353;
struct mint
{
    ll x; // typedef long long ll;
    mint(ll x = 0) : x((x % mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint &operator+=(const mint a)
    {
        if ((x += a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator-=(const mint a)
    {
        if ((x += mod - a.x) >= mod)
            x -= mod;
        return *this;
    }
    mint &operator*=(const mint a)
    {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const
    {
        if (!t)
            return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1)
            a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const { return pow(mod - 2); }
    mint &operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream &operator>>(istream &is, const mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }

struct combination
{
    vector<mint> fact, ifact;
    combination(int n) : fact(n + 1), ifact(n + 1)
    {
        assert(n < mod);
        fact[0] = 1;
        for (int i = 1; i <= n; ++i)
            fact[i] = fact[i - 1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i)
            ifact[i - 1] = ifact[i] * i;
    }
    mint operator()(int n, int k)
    {
        if (k < 0 || k > n)
            return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }
} c(200005);

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

    mint ans = 0;
    mint col = m;
    for (int x = n - 1; x >= 0; --x)
    {
        mint now = col;
        now *= c(n - 1, x);

        if (x <= k)
            ans += now;
        col *= (m - 1);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 6224
#include <bits/stdc++.h>
using namespace std;
struct unionfind{
  vector<int> p;
  unionfind(int n){
    p = vector<int>(n, -1);
  }
  int root(int x){
    if (p[x] == -1){
      return x;
    } else {
      p[x] = root(p[x]);
      return p[x];
    }
  }
  bool same(int x, int y){
    return root(x) == root(y);
  }
  void unite(int x, int y){
    x = root(x);
    y = root(y);
    if (x != y){
      p[x] = y;
    }
  }
};
int main(){
  int N;
  cin >> N;
  vector<pair<int, int>> X(N), Y(N);
  for (int i = 0; i < N; i++){
    int x, y;
    cin >> x >> y;
    X[i] = make_pair(x, i);
    Y[i] = make_pair(y, i);
  }
  sort(X.begin(), X.end());
  sort(Y.begin(), Y.end());
  vector<tuple<int, int, int>> E;
  for (int i = 0; i < N - 1; i++){
    int v = X[i].second;
    int w = X[i + 1].second;
    int d = X[i + 1].first - X[i].first;
    E.push_back(make_tuple(d, v, w));
  }
  for (int i = 0; i < N - 1; i++){
    int v = Y[i].second;
    int w = Y[i + 1].second;
    int d = Y[i + 1].first - Y[i].first;
    E.push_back(make_tuple(d, v, w));
  }
  sort(E.begin(), E.end());
  int M = E.size();
  unionfind UF(N);
  long long ans = 0;
  for (int i = 0; i < M; i++){
    int d = get<0>(E[i]);
    int v = get<1>(E[i]);
    int w = get<2>(E[i]);
    if (!UF.same(v, w)){
      UF.unite(v, w);
      ans += d;
    }
  }
  cout << ans << endl;
}

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

using namespace std;

vector<int> adj[100005];

int a = 0, b = 0;
int paths = 0;

bool dfs(int i, int p) {
    if (i == a) return true;
    if (i == b) return false;
    for (int j : adj[i]) {
        if (j == p) continue;
        return dfs(j, i);
    }
}

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

    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    int cnt = 0;
    for (int i = 1; i <= n; i++) {
        if (adj[i].size() % 2) {
            cout << "No";
            return 0;
        }
    }

    for (int i = 1; i <= n; i++) {
        if (adj[i].size() > 4) {
            cout << "Yes";
            return 0;
        }
        else if (adj[i].size() == 4) {
            cnt++;
            if (!a) {
                a = i;
            }
            else {
                b = i;
            }
        }
    }

    if (cnt > 2) {
        cout << "Yes";
        return 0;
    }
    else if (cnt < 2) {
        cout << "No";
        return 0;
    }

    for (int i : adj[a]) {
        if (dfs(i, a)) {
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
using namespace std;
int n, h[1000001];
int dp[1000001];

int main() {
	// your code goes here
    cin>>n;
    for(int i = 1; i<=n;++i)
    cin>>h[i];
    dp[1]=0;
    dp[2]= abs(h[2]-h[1]);
    for(int i=3;i<=n;++i)
    dp[i]= min( abs(h[i]-h[i-2])+dp[i-2],  abs(h[i]-h[i-1])+dp[i-1]  );
    cout<<dp[n];
	return 0;
}


Measured memory_bytes: 4736
import java.util.Scanner;
class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		int D = Integer.parseInt(sc.next());

		int a = N / (2*D + 1);
		int b = N % (2*D + 1);
		if(b == 0) {
			System.out.println(a);
		} else {
			System.out.println(a+1);
		}
	}

}


Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
#define int long long
#undef int
#define mk make_pair
#define pb push_back
typedef pair<int, int> pii;
const int mod = 1000000007;
const int INF = 1000000009;

int W, H, a[1010], b[1010];
int sum1, sum2;

signed main()
{
    cin >> W >> H;
    for(int i = 0; i < W; i++){
        cin >> a[i];
        sum1 += a[i];
    }
    for(int i = 0; i < H; i++){
        cin >> b[i];
        sum2 += b[i];
    }
    if(sum1 != sum2){
        printf("0\n");
        return 0;
    }
    for(int i = 0; i < W; i++){
        sort(b, b + H, greater<int>() );
        for(int j = 0; j < a[i]; j++){
            if(b[j] <= 0){
                printf("0\n");
                return 0;
            }
            b[j]--;
        }
    }
    printf("1\n");

    return 0;
}

/*



*/



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

int main(){
int h,b;
string r;
string a;
 while(true){
    cin >> r >> a;
    if(r=="0"&&a=="0"){
        break;
    }
    h=0;b=0;
    for(int i=0;i<r.size();i++){
               for(int k=0;k<a.size();k++){
                      if(r[i]==a[k]){
                                  if(i==k){
                                     h++;
                                  }else{
                                         b++;
                                      }
                         }
                 }
     }
     cout << h << ' ' << b << endl;
}
   
return 0;
}

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

int main() {
  int N;
  cin >> N;
  int X = 0;
  for(int i=1; i <10; i++){
  if(N%i ==0 && N/i < 10){
    X++;
  }
  }
  if(X > 0){
    cout << "Yes" <<endl;
  }
  else{
    cout << "No"<<endl;
  }
}
     



Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Math;
class Z { static void Main() => new K(); }
class K
{
	int F => int.Parse(Str);
	long FL => long.Parse(Str);
	int[] G => Strs.Select(int.Parse).ToArray();
	long[] GL => Strs.Select(long.Parse).ToArray();
	string Str => ReadLine();
	string[] Strs => Str.Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
	const int MOD = 1000000007;
	public K()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		Out.Flush();
	}
	void Solve()
	{
		var x = G;
		int N = x[0], K = x[1];
		x = G;
		var min = int.MaxValue;
		for (var i = 0; i + K <= N; i++)
		{
			int l = x[i], r = x[i + K - 1];
			if (l < 0 && r < 0) r = 0;
			else if (l > 0 && r > 0) l = 0;
			min = Min(min, r - l + Min(r, -l));
		}
		WriteLine(min);
	}
}


Measured memory_bytes: 21728
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

s=input()
if "AC" in s:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3444
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;
const double EPS = 1e-8;

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

    int N, M;
    string S;
    cin >> N >> M >> S;

    vector<int> iszero;
    for (int i = 0; i <= N; ++i)
        if (S[i] == '0')
            iszero.push_back(i);

    bool isok = true;
    vector<int> ans;
    int idx = N;
    while (idx) {
        auto itr = lower_bound(iszero.begin(), iszero.end(), idx - M);
        if (*itr >= idx) {
            isok = false;
            break;
        }
        ans.push_back(idx - *itr);
        idx = *itr;
    }

    if (isok)
        for (auto itr = ans.rbegin(); itr != ans.rend(); ++itr)
            cout << *itr << " ";
    else
        cout << -1;
    cout << endl;
    return 0;
}


Measured memory_bytes: 1480
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
#define pb push_back

using namespace std;

string s;
int ima;

int sol(){
  ima++;
  if(s[ima]!='['&&s[ima]!=']'){
    int tmp;
    tmp=s[ima]-'0';ima++;
    while(s[ima]!='['&&s[ima]!=']'){
      tmp=tmp*10+s[ima++]-'0';
    }
    ima++;
    return tmp/2+1;
  }

  vector<int> a;
  while(s[ima]!=']'){
    a.pb(sol());
  }
  sort(a.begin(),a.end());
  int res=0;
  for(int i=0;i<a.size()/2+1;i++) res+=a[i];
  ima++;
  return res;
}

int main(){
  int n;
  int i,j,k;
  int tmp;

  cin>>n;
  while(n--){
    cin>>s;
    ima=0;
    cout<<sol()<<endl;
  }
  return 0;
}

Measured memory_bytes: 3224
#include<iostream>
using namespace std;
int main(){
  int i,j,k;
  int r,c;
  int b;
  cin >> r >> c;
  int rsum[100]={};
  int csum[100]={};
  int sum=0;
  for(i=0;i<r;i++){
    cin >> b;
    cout << b;
    rsum[i]+=b;
    csum[0]+=b; 
    for(j=1;j<c;j++){
      cin >> b;
      cout <<" " << b;
      rsum[i]+=b;
      csum[j]+=b; 
    }
    cout << " " << rsum[i] << endl;
    sum+=rsum[i];
  }
  cout << csum[0];
  for(j=1;j<c;j++){
    cout << " " << csum[j];    
  }
  cout << " " << sum <<  endl;
  return 0;
}



Measured memory_bytes: 3076
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <random>
#include <iomanip>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
typedef map<int, int> mii;
typedef set<int> si;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
// #define endl '\n';
#define fi first
#define se second
#define NONVOID [[nodiscard]]
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;}
template<class T> inline void dump(T &v){irep(i, v){cout<<*i<<((i==--v.end())?'\n':' ');}}
inline string getline(){string s; getline(cin,s); return s;}
inline void yn(const bool b){b?fin("yes"):fin("no");}
inline void Yn(const bool b){b?fin("Yes"):fin("No");}
inline void YN(const bool b){b?fin("YES"):fin("NO");}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;




int main() {
    
    int n,m;
    cin>>n>>m;
    cout<<(n-m)*100*pow(2,m)+pow(2,m)*1900*m<<endl;

}



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

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

pll K[10005];
ll dp[1005][5000];

int main()
{
    ll N, M;
    cin >> N >> M;
    REP(i, M)
    {
        ll a, b;
        cin >> a >> b;
        ll k = 0;
        REP(i, b)
        {
            ll c;
            cin >> c;
            c--;
            k |= (1LL << c);
        }
        K[i] = pll(a, k);
    }

    ll P = pow(2, N);
    REP(i, M + 1)
    {
        REP(j, P)
        {
            dp[i][j] = INF;
        }
    }

    dp[0][0] = 0;
    REP(i, M)
    {
        REP(j, P)
        {
            dp[i + 1][j] = std::min(dp[i][j], dp[i + 1][j]);
            ll s = j | K[i].second;
            dp[i + 1][s] = std::min(dp[i + 1][s], dp[i][j] + K[i].first);
        }
    }

    if (dp[M][P - 1] == INF)
        cout << -1 << endl;
    else
        cout << dp[M][P - 1] << endl;
    return 0;
}

Measured memory_bytes: 39168
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=int(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
using ll = long long;

int main(){
    typedef pair<int,int> P;
    int H,W;
    cin>>H>>W;
    vector<string> S(H);
    int h,w;
    REP(i,H){
        cin>>S[i];
        REP(j,W) if(S[i][j]=='.'){
            h=i;w=j;
        }
    }
    int ans=0;
    int dx[4]={-1,1,0,0},dy[4]={0,0,1,-1};
    vector<vector<bool>> used(H,vector<bool>(W,false));
    REP(hoge,10){
        vector<vector<int>> d(H,vector<int> (W,-1));
        queue<P> que;
        que.push(P(h,w));
        d[h][w]=0;
        used[h][w]=true;
        while(!que.empty()){
            P p=que.front();que.pop();
            int x=p.first,y=p.second;
            REP(j,4){
                int nx=x+dx[j],ny=y+dy[j];
                if(0<=nx&&nx<H&&0<=ny&&ny<W&&S[nx][ny]=='.'&&d[nx][ny]==-1){
                    que.push(P(nx,ny)); d[nx][ny]=d[x][y]+1;
                    ans=max(ans,d[nx][ny]);
                    if(!used[nx][ny]){
                        h=nx;w=ny;
                    }
                }
            }
            
        }
    }
    std::cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
#define dbg          cout<<"Freak"<<endl;
#define dbgg(i)      cout<<i<<endl;
#define N            1e9+7;
using namespace std;
ll t;
char str[100005];
char s[100005];
vector<ll>v[30];
int main()
{
    ll a,b,c,d,e,f=0,g,h,i,j;
    gets(str);
    gets(s);
    b=1;
    d=0;
    c=0;
    f=0;
    for(i=0; i<30; i++)
        v[i].clear();
    g=strlen(str);
    for(i=0; i<g; i++)
    {
        v[str[i]-'a'].push_back(i);
        //cout<<i<<endl;
    }
    /*for(i=0;i<26;i++)
    {
        for(j=0;j<v[i].size();j++)
        {
            cout<<v[i][j]<<' ';
        }
        cout<<endl;
    }*/
    h=strlen(s);
    for(i=0; i<h; i++)
    {
        c=s[i]-'a';
        if(v[c].size()==0)
        {
            b=-1;
            break;
        }
        e=lower_bound(v[c].begin(),v[c].end(),f)-v[c].begin();
        if(e>=v[c].size())
        {
            b++;
            f=v[c][0]+1;
            //cout<<v[c][0]<<endl;
        }
        else
        {
            f=v[c][e]+1;
            //cout<<v[c][0]<<endl;
        }
        //cout<<f<<endl;
    }
    if(b!=-1){
    b=(b-1)*g;
    cout<<b+f<<endl;}
    else cout<<"-1"<<endl;

}



Measured memory_bytes: 1656
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;

const int mod=1e9+7;
const int inf=-1;
const int sz=2e5;

#define pi acos(-1)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define gap ' '
#define lb lower_bound
#define ub upper_bound
#define clr(x) memset(x,0,sizeof(x))
#define all(x) sort(x.begin(),x.end())
#define rall(x) reverse(x.begin(),x.end())
#define dbg puts("finding wrong")
#define case(x,y) printf("Case %lld: %lld\n",++x,y)
#define fastio ios::sync_with_stdio(false);cin.tie(0)


int ar[sz];

int main()
{
  fastio;
  ll t, a, b, c, ans, i, n;
  	cin>>n>>a>>b;
    ans=n/a;
    if(n%a!=0)ans++;
    cout<<(ans*b)<<endl;
}


Measured memory_bytes: 3660
#include<bits/stdc++.h>
using namespace std;
int main() {
	int x, y;
	char  str[102][102];
	memset(str, '#', sizeof(str));
	cin >> x >> y;
	for (int i = 1; i <= x; i++) {
		for (int j = 1; j <= y; j++) {
			cin >> str[i][j];
		}
	}
	for (int i = 0; i <= x + 1; i++) {
		for (int j = 0; j <= y + 1; j++) {
			cout << str[i][j];
		}
		cout << endl;
	}
}

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

int main() {
    int N; 
    cin >> N;
    if (N == 1) {
        cout << "Hello World" << endl;
    }
    if (N == 2) {
        int A,B;
        cin >> A >> B;
        cout << A + B << endl;
    }
}

Measured memory_bytes: 256
/*
* @Author: kabbo
* @Date:   2020-04-19 20:54:12
* @Last Modified by:   kabbo
* @Last Modified time: 2020-04-19 21:10:26
*/
#include<bits/stdc++.h>
using namespace std;
#define mem(x,y) memset(x,y,sizeof(x));
#define eps 1e-9
#define pii pair<int,int>
#define sdi(x) scanf("%d",&x)
#define sdii(x,y) scanf("%d%d",&x,&y)
#define endl '\n'
#define ull unsigned long long
#define ll long long
const int mod=1e9+7;
using u64 = uint64_t;
using u128=__uint128_t;
void solve(){
  ll n;
  cin>>n;
  vector<ll>employ(n+1);
  for(int i(1);i<=n;++i)
  	cin>>employ[i];
   vector<ll>ans(n+1);
   for(int i(1);i<=n;++i){
   	  ans[employ[i]]++;
   }
   for(int i(1);i<=n;++i)
   	cout<<ans[i]<<endl;
}
int main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	/*int t;
	cin>>t;
	for(int i(1);i<=t;++i){
	  printf("Case %d: ",i);*/
	  solve();
	//}
	#ifndef LOCAL_DEFINE
	  cerr<< "Time elapsed: "<<1.0*clock()/CLOCKS_PER_SEC <<"s.\n";
	#endif
	return 0;
}

Measured memory_bytes: 6368