akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Linq;

namespace AtCoderPanasonicContest2020
{
	class Program
	{
		static void Main(string[] args)
		{
			var array = new int[]
			{
				1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
			};

			var number = ReadInt();
			Console.WriteLine(array[number - 1]);
		}

		public static int ReadInt()
			=> int.Parse(Console.ReadLine());

		public static int[] ReadIntArray()
			=> Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

		public static long ReadLong()
			=> long.Parse(Console.ReadLine());

		public static long[] ReadLongArray()
			=> Console.ReadLine().Split().Select(x => long.Parse(x)).ToArray();

		public static string ReadString()
			=> Console.ReadLine();

		public static string[] ReadStringArray()
			=> Console.ReadLine().Split();
	}
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
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; }
//(a+b-1)/b
//cout << fixed << setprecision();
//priority_queue<ll, vector<ll>, greater<ll>> q;
signed main(){
	ll hp,n; cin>>hp>>n;
	vl a(n),b(n);
	rep(i,0,n)cin>>a[i]>>b[i];
	vvl dp(n+10,vl(hp+1,MOD));
	dp[0][0]=0;
	rep(i,0,n){
		rep(j,0,hp+1){
			chmin(dp[i+1][j],dp[i][j]);
			chmin(dp[i+1][min(j+a[i],hp)],dp[i+1][j]+b[i]);
		}
	}
	cout<<dp[n][hp]<<endl;
	return 0;
}

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

int main() {
	int a, b;
	cin >> a >> b;
	int k; cin >> k;
	int num = 0;
	vector<int> v1;
	if (a <= b) {
		for (int i = 1; i <= a; i++) {
			if (a%i == 0 && b%i == 0) {
				v1.push_back(i);
			}
			
		}
	}
	else {
		for (int i = 1; i <= a; i++) {
			if (a%i == 0 && b%i == 0) {
				v1.push_back(i);
				}
			}

		}
	reverse(v1.begin(), v1.end());
	cout << v1[k - 1];
    system("pause");
	return 0;
}

Measured memory_bytes: 504
//Leonidas
#pragma GCC optimize("Ofast")
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container'.',hpp>
//#include <ext/pb_ds/tree_policy'.',hpp>
//typedef tree < int , null_type, less <int>, rb_tree_tag, tree_order_statistics_node_update> TREE;
#define ll long long
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define pss pair<short,short>
#define pld pair<long double,long double >
#define ld long double
#define piii  pair<pii,int>
#define vii vector<pair<int,int> >
#define st first
#define nd second
#define pll pair<ll,ll>
#define speed ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define M_PI 3.14159265358979323846
//#define int long long
const int mod=1e9+7;
//const int mod=1009;
//const int mod=998244353;
const int inf=1000000009;
const long long INF=1000000000000000009;
const long long big=1000000000000000;
const long double eps=0.000000000000000000001;
using namespace std;
int T[200005];
int32_t main()
{
    speed
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>T[i];
    sort(T+1,T+n+1);
    int last=n-1;
    int ile=0;
    ll suma=T[n];
    for(int i=n-2;i>=1;i--)
    {
        suma+=T[last];
        ile++;
        if(ile==2)
        {
            ile=0;
            last--;
        }
    }
    cout<<suma;
    return 0;
}


Measured memory_bytes: 4424
#include<stdio.h>
#include<math.h>
int main()
{
  int x,n;
  int max=1;
  scanf("%d",&x);

  for(int i=2;i<=32;i++)
  {
    for(int j=2;j<=10;j++)
      {
        if (pow(i,j)>max && pow(i,j)<=x) max= pow(i,j);
      }
  }

  printf("%d\n",max);

  return 0;
}

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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

bool can_reach(vll& v, ll goal) {
  set<ll> a;
  a.insert(0);

  FORm(i, v) {
    set<ll> b;
    FORm(it, a) {
      b.insert(*it + *i);
      b.insert(*it - *i);
    }
    a = b;
  }

  if (binary_search(all(a), goal)) {
    return true;
  }

  return false;
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  string s;
  ll x, y;

  cin >> s >> x >> y;

  vll u, v;
  ll dist = 0;
  ll angle = 0;

  s = s + "T";
  rep(i, s.size()) {
    if (s[i] == 'F') {
      dist++;
    } else {
      if (angle == 0) {
        u.push_back(dist);
      } else {
        v.push_back(dist);
      }
      dist = 0;
      angle = (angle + 1) % 2;
    }
  }

  x -= u[0];
  u.erase(u.begin());

  bool ans = can_reach(u, x) & can_reach(v, y);

  cout << (ans ? "Yes" : "No") << endl;

  return 0;
}


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

using namespace std;

typedef long long int64;

const int64 INF = (1ll << 63) - 1;

vector <vector <pair <int, int> > > g;

vector <int64> dist;

void dijkstra(int s){
    int n = g.size();
    dist.resize(n, INF);
    dist[s] = 0;
    set <pair <int64, int>> v;
    for (int i = 0; i < n; i++){
        v.insert({dist[i], i});
    }
    while(!v.empty()){
        auto it = v.begin();
        int cur_v = it->second;
        int64 cur_v_w = it->first;
        for (int i = 0; i < g[cur_v].size(); i++){
            int nw = g[cur_v][i].first;
            int64 e = g[cur_v][i].second;
            int64 nw_w = cur_v_w + e;
            int64 o_w = dist[nw];
            if (o_w > nw_w){
                v.erase({o_w, nw});
                v.insert({nw_w, nw});
                dist[nw] = nw_w;
            }
        }
        v.erase(v.begin());
    }
}

int main()
{
    #ifdef HOME
    freopen("input.txt", "rt", stdin);
    #endif // HOME
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    g.resize(n);
    for (int i = 0; i < n - 1; i++){
        int a, b;
        int64 c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a].push_back({b, c});
        g[b].push_back({a, c});
    }
    int q, k;
    cin >> q >> k;
    k--;
    dijkstra(k);
    for (int i = 0; i < q; i++){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        cout << dist[a] + dist[b] << endl;
    }
    return 0;
}


Measured memory_bytes: 14592
#include <functional>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <string>
#include <cstring>
#include <math.h>
using namespace std;


int main() {
   string n;
 
   cin >> n;
  
   string m;
  
   for(int i = 0;i<n.size();i++){
     
     if(n[i]=='B'){
        if(m.size()>=1){
           m.erase(m.size()-1);
        }
     }else{
        m=m+n[i];
     }
   }
  
   cout << m << endl;
   
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
 int main(){
 	int W,H,x,y,r;
 	cin>>W>>H>>x>>y>>r;
 	if(x>=r && y>=r && W>=x+r && H>=y+r){
 		cout<<"Yes"<<endl;
	 }
	else cout<<"No"<<endl;
 }


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

int main (void)
{
	int n, len;
	string s;
	cin >> n >> s;
	len = s.size();
	for (int i = 0; i < len; i++) cout << (char)((s[i] - 'A' + n) % 26 + 'A');
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include <vector>
#include <string>
#include <cstdio>

using namespace std;

string inputWord() {
    char buf[256];
    scanf("%s", buf);
    return buf;
}

int inputInt() {
    int i;
    scanf("%d", &i);
    return i;
}

int H;
int W;
int K;
vector<string> c;
int ret;
int k;

int main() {
    H = inputInt();
    W = inputInt();
    K = inputInt();
    c.resize(max((int)c.size(), H)); for(int i=0; i<H; ++i) c[i] = inputWord();
    ret = 0;
    for(int h=0; h<1<<H; ++h) {
        for(int w=0; w<1<<W; ++w) {
            k = 0;
            for(int $1=0; $1<H; ++$1) for(int $2=0; $2<W; ++$2) k += c[$1][$2]=='#' && (h >> $1) & 1 && (w >> $2) & 1;
            if(k==K) {
                ++ret;
            }
        }
    }
    printf("%d\n", ret);
    return 0;
}


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

using namespace std;

#define FOR(i,l,r) for( int i = l; i < r; i++ )
#define li long long int

int main() {
    int n; cin>>n;
    li a[n];
    FOR(i,0,n) cin>>a[i];
    li dp[n][n];
    FOR(i,0,n) dp[i][i] = a[i];
    FOR(j,2,n+1) {
        FOR(i,0,n) {
            int k = i+j-1;
            if( k >= n ) break;
            dp[i][k] = max(a[i]-dp[i+1][k],a[k]-dp[i][k-1]);
        }
    }
    cout<<dp[0][n-1]<<"\n";
    return 0;
}

Measured memory_bytes: 70144
#pragma GCC optimize("O3") 
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx") 
#define __USE_MINGW_ANSI_STDIO 0
#include<bits/stdc++.h>                               
using namespace std;

#define PI acos(-1)
#define pb push_back
#define fi first
#define se second
#define sz(a) (int)(a).size()
#define all(c) (c).begin(), (c).end()
#define TIMESTAMP fprintf(stderr, "Execution time: %.3lf s.\n", (double)clock()/CLOCKS_PER_SEC)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair <int, int> pii;
typedef vector <vi> vvi;
typedef vector <pii> vpii;
typedef vector<string> vs;

const int MAXN = 2e5 + 9;
const int MOD = (int)(1e9 + 7);
const int INF = 100500;

int n, k;
ll fact[MAXN], ifact[MAXN];
int aa[MAXN];
map < int, int > was;

ll bpow(ll a, ll p) {
	ll x = 1;
	while(p) {
		if(p & 1) x = (x * a) % MOD;
		a = (a * a) % MOD;
		p /= 2;
	}
	return x;
}

ll c(int N, int K) {
	if(K > N) return 0;
	return (((fact[N] * ifact[N - K]) % MOD) * (ifact[K])) % MOD;
}

void input() {
	cin >> n;
	int pos = -1;
	int delta = 0;
	for(int i = 0; i <= n; i++) {
		cin >> aa[i];
		if(was[aa[i]]) {
			pos = i;
			continue;
		}
		was[aa[i]] = i + 1;
	}
	assert(pos != -1);
	delta = -pos + was[aa[pos]] - 1;
	fact[0] = 1;
	ifact[0] = 1;
	for(int i = 1; i <= n + 1; i++) {
		fact[i] = (fact[i - 1] * i) % MOD;
		ifact[i] = bpow(fact[i], MOD - 2);
	}
	cout << n << endl;
	for(int i = 2; i <= n; i++) {
		ll res = c(n + 1, i);
		res = (res + MOD - c(n + delta, i - 1)) % MOD;
		cout << res << endl;
	}
	cout << 1 << endl;
}

void solve() {

}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
#ifdef LOCAL
	freopen("xxx.in", "r", stdin);
	freopen("xxx.out", "w", stdout);
#else
	//freopen("xxx.in", "r", stdin);
	//freopen("xxx.out", "w", stdout);
#endif	
	input();
	solve();
	return 0;
}

Measured memory_bytes: 7936
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <iomanip>
#include <set>
#include <sstream>
#include <queue>
using namespace std;
typedef long long ll;

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

  int ans = 1;
  ll x = A;
  while (x * 2 <= B) {
    x *= 2;
    ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3160
#include <stdio.h>
#include <string.h>
#define N 36
int isStable(char in[N][2],char out[N][2],int n){
  int i,j,a,b;
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      for(a=0;a<n;a++){
	for(b=a+1;b<n;b++){
	  if(in[i][1]==in[j][1] && in[i][0]==out[b][0] && in[j][0] == out[a][0] && in[i][1]==out[b][1] && in[j][1] == out[a][1]){
	    return 0;
	  }
	}
      }
    }
  }
  return 1;
}
int main(){
  int i,n,j,min;
  char a[N][2],b[N][2],c[N][2],d[3]; 
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s",a[i]);
    strncpy(b[i],a[i],2);
    strncpy(c[i],a[i],2);
  }
  for(i=0;i<n;i++){
    for(j=n-1;j>i;j--){
      if(b[j][1] <b[j-1][1]){    
    strncpy(d,b[j],2);
    strncpy(b[j],b[j-1],2);
    strncpy(b[j-1],d,2);
      }
    }
  }
  for(i=0;i<n;i++){
    if(i<n-1) printf("%c%c ",b[i][0],b[i][1]);
    else printf("%c%c\n",b[i][0],b[i][1]);
  }
  if(isStable(&a[0],&b[0],n)==0) printf("Not stable\n");
  else printf("Stable\n");
     for(i=0;i<n;i++){
      min=i; 
      for(j=i;j<n;j++){
    if(c[j][1]<c[min][1]) min=j;
      }
      if(i==min) continue;
       strncpy(d,c[i],2);
       strncpy(c[i],c[min],2);
       strncpy(c[min],d,2);
      }
    for(i=0;i<n;i++){
      if(i<n-1) printf("%c%c ",c[i][0],c[i][1]);
      else printf("%c%c\n",c[i][0],c[i][1]);
    }
    if(isStable(&a[0],&c[0],n)==0) printf("Not stable\n");
    else printf("Stable\n");
    return 0;
}

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

signed main() {
	int n;
	cin >> n;
	vector<pair<int, int>> v;
	rep(i, n) {
		int a, b;
		cin >> a >> b;
		v.push_back(make_pair(a, 1));
		v.push_back(make_pair(b + 1, -1));
	}
	sort(v.begin(), v.end());
	int now = 0;
	int ma = 0;
	for(auto i: v) {
		now += i.second;
		ma = max(ma, now);
	}
	cout << ma << endl;
}


Measured memory_bytes: 7016
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;
 
import static java.util.Comparator.*;
 
public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        Solver solver = new Solver(System.in, out);
        solver.solve();
        out.close();
    }
}
class Solver {
	Scanner sc;
	PrintWriter out;
    public Solver(InputStream in, PrintWriter out) {
    	sc = new Scanner(in);
    	this.out = out;
    }
    //================================================================================
    public void solve() {
    	long N = Long.parseLong(sc.next());
    	if(N % 2 == 1) {
    		out.println(0);
    		return;
    	}
    	N /= 2;
    	long ans = 0;
    	while(N > 0) {
    		ans += N / 5;
    		N /= 5;
    	}
    	out.println(ans);
    }
}

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

int main() {
  string a;
  cin>> a;
  int count=0;
  for(int i=0;i<a.size();i++){
    if (a[i] =='1'){
      count ++ ;
    }
  }
  cout<< count <<endl;
    
}


Measured memory_bytes: 256
#include <assert.h>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using ll = long long;
using P = std::pair<ll, ll>;

template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << "[" << pa.first << ", " << pa.second << "]";
}

template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  os << "{";
  for (int i = 0; i < vec.size(); i++)
    os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
  os << "}";
  return os;
}

#define rep(i, a, b) for (ll(i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cerr << "debug " << i << std::endl

// const ll MOD = 998244353;
const ll MOD = 1e9 + 7;


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

  ll n;
  std::cin>>n;

  std::vector<ll> a(n);

  rep(i,0,n)std::cin>>a[i];
  P max={-MOD,-1},min={MOD,-1};

  rep(i,0,n){
    if(a[i]>max.first)max={a[i],i};
    if(a[i]<min.first)min={a[i],i};
  }

  bool plus;

  if(max.first+min.first>=0){
    plus=true;
    std::cout<<2*n-2<<"\n";
    rep(i,0,n){
      if(i!=max.second)std::cout<<max.second+1<<" "<<i+1<<"\n";
    }
  }else{
    plus=false;
    std::cout<<2*n-2<<"\n";
    rep(i,0,n){
      if(i!=min.second)std::cout<<min.second+1<<" "<<i+1<<"\n";
    }
  }

  if(plus){
    rep(i,1,n)std::cout<<i<<" "<<i+1<<"\n";
  }else{
    for(ll i=n-1;i>0;i--)std::cout<<i+1<<" "<<i<<"\n";
  }

  return 0;
}






Measured memory_bytes: 256
#include <iostream>
#include <iomanip>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define IN(v) int v;cin>>v;
#define OUT(v) cout<<v<<endl

int main() {
  IN(N);

  double sum = 0;
  REP(i, N) {
    IN(a);
    sum += (double)1/a;
  }
  OUT(fixed<<setprecision(12) << (double)1/sum);

  return 0;
}


Measured memory_bytes: 256
import sys
c=lambda w,n:reduce(lambda a,b:a+b,[chr((ord(x)-97+n)%26+97)if x.isalpha() else x for x in w])
for i in sys.stdin:
	n=0
	for s in i.replace(".","").split():
		r=c(s,116-ord(s[0]))
		m=len(s)
		if m==3 and"the"==r or m==4 and r in["this","that"]:n=116-ord(s[0])
	print c(i,n).replace("\n","")

Measured memory_bytes: 4324
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define eb emplace_back
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 233;
int main()
{
	int a,b;cin>>a>>b;
	cout << (a+b-1)/b << endl; 
}


Measured memory_bytes: 256
//                                               KEEP GRINDING
#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; 

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>   new_data_set;

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 

#define int long long
#define ld long double
#define MOD 1000000007
#define mod 998244353
#define precise(i) fixed << setprecision(10) << i
#define f(i,a,b) for(int i=a;i<b;++i)

#define endl '\n'
#define debug cout<<"\n========================================\n"<<endl;
#define err1(a) cout<<#a<<" "<<a<<endl;
#define err2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl;
#define err3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl;
#define err4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl;

#define all(a) a.begin(),a.end()
#define show(a) for(auto xyz:a)cout<<xyz<<" ";cout<<endl;
#define mx(a) *max_element(a)
#define mn(a) *min_element(a) 
#define LB lower_bound  //THIS GIVES THE ITR TO THE ELEMENT IN RANGE [SI,EI) THAT IS >= OUR VALUE 
#define UB upper_bound  //THIS GIVES THE ITR TO THE ELEMENT IN RANGE [SI,EI) THAT IS > OUR VALUE 

#define fr first
#define sc second

#define MAXN 500000
#define INF 9223372036854775807
signed main(){
    fastio
    int x[5];
    f(i,0,5){
    	cin>>x[i];
    	if(x[i]==0){
    		cout<<i+1<<endl;
    		return 0;
		}
	}
}

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

int main(){
  int N, K;
  cin >> N >> K;
  vector<int> D(K);
  for(int i=0; i<K; i++){
    cin >> D.at(i);
  }
  int ans=0;
  for(int i=N; i<N*10; i++){
    int num=i;
    int flag=0;
    while(num!=0){
      for(int j=0; j<K; j++){
        if(num%10==D.at(j)){
          flag++;
        }
      }
      num=num/10;
    }
    if(flag==0){
      ans=i;
      break;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<vector>
using namespace std;

bool isprime[50010];
int ans[50010];

int main()
{
    for(int i=2; i<=50000; i++){
        isprime[i] = true;
    }
    for(int i=2; i<300; i++){
        if(isprime[i]){
            for(int j=i*i; j<=50000; j+=i){
                isprime[j]=false;
            }
        }
    }

    vector<int> primes;
    for(int i=2; i<=50000; i++){
        if(isprime[i])primes.push_back(i);
    }
    for(int i=0; primes[i]<=25000; i++){
        for(int j=i; primes[i]+primes[j]<=50000; j++){
            ans[primes[i]+primes[j]]++;
        }
    }

    int n;
    while(scanf("%d",&n),n){
        printf("%d\n",ans[n]);
    }
    return 0;
}

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

typedef long long ll;
const ll MOD = 1000000007;

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll l, r, ans = 2018;
    cin >> l >> r;
    if (l == 0 || r - l + 1 >= 2019) {
        cout << "0";
        return 0;
    }
    for (ll i = l; i < r; i++) {
        for (ll j = i + 1; j <= r; j++) {
            ans = min(ans, (i * j) % (ll)2019);
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, q, k;
char s[1000010];
ll M[1000010], C[1000010], MC[1000010], ans;
int main()
{
	scanf("%d", &n);
	scanf("%s", s);
	scanf("%d", &q);
	for (int i = 0; i < n; i++)
	{
		M[i] = (i > 0 ? M[i - 1] : 0) + (s[i] == 'M');
		C[i] = (i > 0 ? C[i - 1] : 0) + (s[i] == 'C');
		MC[i] = (i > 0 ? MC[i - 1] : 0) + (s[i] == 'C') * M[i];
	}
	for (int i = 1; i <= q; i++)
	{
		scanf("%d", &k);
		ans = 0;
		for (int j = 0; j < n; j++)
			if (s[j] == 'D')
				ans += MC[min(j + k - 1, n - 1)] - MC[j] - M[j] * (C[min(j + k - 1, n - 1)] - C[j]);
		printf("%lld\n", ans);
	}
	return 0;
}

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

#define endl '\n'
#define ends ' '
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define sz(x) (int)(x.size())
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) { cerr << ends << H; debug_out(T...); }
#define debug(...) cerr << "{" << #__VA_ARGS__ << "}:", debug_out(__VA_ARGS__)
typedef long long ll;
typedef pair<int, int> pii;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;

////////////////////////////////////////////////////////////////////

const int N = 1e5 + 5;

int main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	
	char c; cin >> c;
	cout << (char)(c + 1) << endl;

	return 0;
}


Measured memory_bytes: 256
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
# 候補はNかN-1の約数
answer = 0

def make_divisors(n):  # nの約数を列挙
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors[1:]

cand = make_divisors(N) + make_divisors(N-1)
for x in cand:
    M = N
    while M % x == 0:
        M //= x
    r = M % x
    if r == 1:
        answer += 1

print(answer)


Measured memory_bytes: 9308
N = int(input())
A = []
xy = []
for i in range(N):
  A.append(int(input()))
  xye = []
  for j in range(A[i]):
    xye.append(list(map(int,input().split())))
  xy.append(xye)

person = [0]*(N)
c = 0

for i in range(2 ** N):
  person = [0]*(N)
  for j in range(N):
    if ((i >> j) & 1):
      person[j] = 1
  cc = sum(person)
  for j in range(N):
    if person[j] == 1:
      for k in range(A[j]):
        p = xy[j][k]
        if person[p[0]-1] != p[1]:
          #out!
          cc = 0
  c = max(c,cc)  


print(c)    

Measured memory_bytes: 3064
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> edges(n);
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        edges[a].push_back(b);
        edges[b].push_back(a);
    }

    vector<bool> used(n, false);


    list<int> path;
    int n1 = 0, n2 = edges[0][0];
    used[n1] = true, used[n2] = true;
    path.push_back(n1);
    path.push_back(n2);

    while (1) {
        bool flag = false;
        for (auto e : edges[n1]) {
            if (!used[e]) {
                flag = true;
                used[e] = true;
                n1 = e;
                path.push_front(n1);
                break;
            }
        }
        if (!flag)
            break;
    }
    while (1) {
        bool flag = false;
        for (auto e : edges[n2]) {
            if (!used[e]) {
                flag = true;
                used[e] = true;
                n2 = e;
                path.push_back(n2);
                break;
            }
        }
        if (!flag)
            break;
    }
    cout << path.size() << endl;
    bool first = true;
    for (auto t : path) {
        if (first)
            first = false;
        else
            cout << " ";

        cout << t + 1;
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 9472
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 2e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> s(m);
    rep(i, 0, m) {
        int k;
        cin >> k;
        rep(j, 0, k) {
            int x;
            cin >> x;
            x--;
            s[i].push_back(x);
        }
    }
    vector<int> p(m);
    rep(i, 0, m) {
        cin >> p[i];
    }

    ll ans = 0;
    for (int i = 0; i < (1 << n); i++) {
        bool on[n] = {};
        for (int j = 0; j < n; j++) {
            if (i & (1 << j)) {
                on[j] = true;
            }
        }
        bool flag = true;
        rep(j, 0, m) {
            int cnt_on = 0;
            rep(k, 0, (int)s[j].size()) {
                if (on[s[j][k]] == true) cnt_on++;
            }
            if (cnt_on % 2 != p[j]) flag = false;
        }
        if (flag) ans++;
    }

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


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
struct node
{
    int a,b,c,d;
}re[10000];
int a[1005][1005];
int main()
{
    int h,w;
    scanf("%d%d",&h,&w);
    for(int i=1;i<=h;i++)
        for(int j=1;j<=w;j++)
        scanf("%d",&a[i][j]);
    int cnt=0;
    for(int i=1;i<h;i++)
        for(int j=1;j<=w;j++)
        if(a[i][j]%2==1) a[i][j]--,a[i+1][j]++,re[cnt].a=i,re[cnt].b=j,re[cnt].c=i+1,re[cnt].d=j,cnt++;
    for(int j=1;j<w;j++)
        if(a[h][j]%2==1) a[h][j]--,a[h][j+1]++,re[cnt].a=h,re[cnt].b=j,re[cnt].c=h,re[cnt].d=j+1,cnt++;
    printf("%d\n",cnt);
    for(int i=0;i<cnt;i++)
        printf("%d %d %d %d\n",re[i].a,re[i].b,re[i].c,re[i].d);
}


Measured memory_bytes: 6144
#include <bits/stdc++.h>
using namespace std;
#define all(n) begin(n), end(n)
const long long INF = numeric_limits<long long>::max();
typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef unsigned long long ull;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

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

template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v)
{
    for (auto &e : t)
        fill_v(e, v);
}
int main()
{
    int N;
    cin>>N;
    string c;
    cin>>c;
    int widx=-1;
    int ridx=N;

    int ans = 0;
    while(ridx-widx>=1)
    {
        bool f1=false,f2=false;
        for (size_t i = widx+1; i < N; i++)
        {
            if(c[i]=='W')
            {
                widx=i;
                f1=true;
                break;
            }
        }
        for (int i = ridx - 1; i >= 0; i--)
        {
            if(c[i]=='R')
            {
                ridx=i;
                f2=true;
                break;
            }
        }
        if(f1 and f2 and ridx>widx)
        ans++;
        else
        {
            break;
        }
        
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3756
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N; cin >> N;
	vector<int>v(10010, 0);
	rep(i, 0, N) {
		int x; cin >> x;
		v[x]++;
	}
	vector<int>ans;
	rep(i, 0, 10010) {
		while (v[i]--)ans.push_back(i);
	}
	rep(i, 0, ans.size())cout << ans[i] << (i == ans.size() - 1 ? '\n' : ' ');
	return 0;
}

Measured memory_bytes: 11256
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define N 100010
int n,m,a[N];
struct matrix{int n,m,a[5][5];}t1,t2,ans;
inline matrix operator*(matrix x,matrix y){
	matrix res;
	res.n=x.n;res.m=y.m;
	memset(res.a,0,sizeof(res.a));
	for(int i=1;i<=x.n;++i)
		for(int j=1;j<=y.m;++j)
			for(int k=1;k<=x.m;++k)
				res.a[i][j]=(res.a[i][j]+1ll*x.a[i][k]*y.a[k][j]%mod)%mod;
	return res;
}
inline matrix operator^(matrix x,int y){
	matrix res;
	res.n=x.n,res.m=x.m;
	memset(res.a,0,sizeof(res.a));
	for(int i=1;i<=x.n;++i) res.a[i][i]=1;
	while(y>0){
		if(y&1) res=res*x;
		x=x*x;y>>=1;
	}
	return res;
}
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;++i) scanf("%d",&a[i]);a[m+1]=n+1;
	t1.n=t1.m=3;
	t1.a[1][1]=2;t1.a[1][2]=1;t1.a[1][3]=1;
	t1.a[2][1]=2;t1.a[2][2]=1;t1.a[2][3]=2;
	t1.a[3][1]=1;t1.a[3][2]=0;t1.a[3][3]=1;
	t2.n=t2.m=3;
	t2.a[1][1]=1;t2.a[1][2]=1;t2.a[1][3]=1;
	t2.a[2][1]=0;t2.a[2][2]=1;t2.a[2][3]=2;
	t2.a[3][1]=0;t2.a[3][2]=0;t2.a[3][3]=1;
	ans.n=1;ans.m=3;ans.a[1][1]=1;
	ans=ans*(t1^(a[1]-1));
	for(int i=1;i<=m;++i){
		ans=ans*t2;
		ans=ans*(t1^(a[i+1]-a[i]-1));
	}
	printf("%d\n",ans.a[1][3]);
	return 0;
}

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

void p(vector<int> &a){
    return;
    cout<<"[";
    for(int i:a)cout<<i<<" ";
    cout<<"]"<<endl;
}

bool check(vector<int> &a){
    p(a);
    int n=a.size();
    for(int i:a)if(i>=n)return 0;
    return 1;
}
void ope(vector<int> &a){
    int n=a.size();
    int z=max_element(a.begin(),a.end())-a.begin();
    a[z]-=n;
    for(int i=0;i<n;++i){
        if(i==z)continue;
        ++a[i];
    }
}

int main(){
#ifndef WEAK
    long long k; cin >> k;
    if( k == 0 ) { cout << "2\n0 0" << endl; exit(0); }
    if( k == 2 ) { cout << "2\n2 2" << endl; exit(0); }
    if( k <= 10000 ) { cout << "2\n" << ( k % 3 == 2 ) << " " << k + !! ( k % 3 != 2 ) << endl; exit(0); }
    long long base = k / 50 + 49;
    if( k % 50 == 0 ) { cout << "50\n"; for( int i=0 ; i<50 ; ++i ) { cout << base << " "; } cout << endl; exit(0); }
    vector<long long> a(50, base - k % 50);
    for( int i=0 ; i<k%50 ; ++i) a[i] = base + 1;
    cout << 50 << endl;
    for( int i=0 ; i<50 ; ++i) cout << a[i] << " "; cout << endl;
    exit(0);
#else
    // vector<int> a(10,17);
    // a[0]=21; a[1]=21; a[2]=21;
    // vector<int> a(50,0);
    // stringstream ss("1991227 1991227 1991227 1991227 1991227 1991227 1991227 1991227 1991227 1991227 1991227 1991227 1991227 1991227 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212 1991212");
    // for(int &i:a)ss>>i;
    vector<int> a; int n; cin>>n; a.resize(n);
    for(int &i:a)cin>>i;
    int cnt=0;
    while(!check(a)){
        ope(a);
        ++cnt;
    }
    cout<<cnt<<endl;
#endif
}



Measured memory_bytes: 256
def main():
    n, k, q = map(int, input().split())
    a = [int(input()) for i in range(q)]
    point = [k for i in range(n)]

    for i in a:
        point[i-1] += 1
    
    for val in point:
        val -= q
        if val > 0:
            print('Yes')
        else:
            print('No')

main()


Measured memory_bytes: 10460
#include <stdio.h>
#include <string.h>
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 300001

int main(void) {
  int n;
  char s[MAX];
  scanf("%d %s", &n, s);
  int count = 0;
  rep(ci, 0, 1000) {
    int c[3] = {ci / 100, (ci / 10) % 10, ci % 10};
    int digit = 0;
    rep(si, 0, n) {
      if (c[digit] + '0' == s[si]) digit++;
      if (digit == 3) {
        count++;
        break;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}


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

int main(){
	int n;
	cin >> n;
	vector<int> v(n);
	rep(i, n) cin >> v.at(i);

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

	double ans = v.at(0);
	for(int i = 1; i < n; i++){
		ans = (v.at(i)+ans)/2;
	}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {  
  
  string word, word2, word3, Pal, Pal2, Pal3;
  int L, L3;
  bool A = true;
  cin >> word;
  L = word.size();
  Pal = word;
  
  reverse(Pal.begin(), Pal.end());
  if(word != Pal){
  A = false;
  } 
  
  for(int i = 0;i < (L - 1) / 2;i++){
  word2 = word2 + word.at(i);
  }
  Pal2 = word2;
  reverse(Pal2.begin(), Pal2.end());
  if(word2 != Pal2){
  A = false;
  } 
  
  L3 = (L + 3) / 2;
  for(int i = 0;i < L - L3 + 1 ;i++){
  word3 = word3 + word.at(L3 - 1 + i);
  }
  Pal3 = word3;
  reverse(Pal3.begin(), Pal3.end());
  if(word3 != Pal3){
  A = false;
  } 
  
  if(A){
  cout << "Yes" << endl;
  }
  else{
  cout << "No" << endl;
  }
}

Measured memory_bytes: 256
from bisect import bisect
ref = [0.2,0.6,1.1]
l,r = [0]*4,[0]*4
while 1:
    try:
        le,re = map(float, raw_input().split())
    except:
        break
    l[bisect(ref,le)] += 1
    r[bisect(ref,re)] += 1
for i in range(1,5):
	print l[-i],r[-i]

Measured memory_bytes: 4320
import java.util.*;
import java.math.*;

class Main
{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [] a = new int[n];
        int [] dp = new int[n];
        dp[0] = 0;
        for(int i = 0; i < n; i++)
        {
            a[i] = sc.nextInt();
            if(i - 1 >= 0)
                dp[i] = dp[i - 1] + Math.abs(a[i] - a[i - 1]);
            if(i - 2 >= 0)
                dp[i] = Math.min(dp[i], dp[i - 2] + Math.abs(a[i] - a[i - 2]));
        }
        System.out.println(dp[n - 1]);
    }
}

Measured memory_bytes: 61148
while True:
    a, op, b = input().split()   # 3変数ともに文字列として読み込む
    a =int(a)                   # a を整数に変換
    b = int(b)                   # b を整数に変換


    if op=="?": # opが"?"の時は終了
        break
    else:    #opが"?"以外の時
        if op=="+":
            print(a+b)
        elif op=="-":
            print(a-b)
        elif op=="*":
            print(a*b)
        else:
            print(a//b)
            # ここ処理を書いてください
        # else のなかです。この通りのインデントを付けてください。




Measured memory_bytes: 5592
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

const ll mod = 1000000007;
const int N = 500010;
ll fact[N], invf[N];

ll add(ll x, ll y){
    return (x+y)%mod;
}

ll mul(ll x, ll y){
    return (x%mod)*(y%mod)%mod;
}

ll powll(ll x, ll y){
    x %= mod;
    ll res = 1LL;
    while(y){
        if (y & 1LL)
            res *= x;
        res %= mod;
        x = (x*x) % mod;
        y >>= 1LL;
    }
    return res;
}

ll divll(ll x, ll y){
    x %= mod;
    return (x * powll(y,mod-2)) % mod;
}

ll nPr(ll n, ll r){
    if (n < r || r < 0) return 0;
    return mul(fact[n], invf[n-r]);
}

ll nCr(ll n, ll r){
    if (n < r || r < 0) return 0;
    return mul(mul(fact[n], invf[r]), invf[n-r]);
}

void init_f(){
    fact[0] = 1;
    FOR(i,1,N-1){
        fact[i] = (fact[i-1] * i) % mod;
    }
    invf[N-1] = divll(1, fact[N-1]);
    FORR(i,N-1,1){
        invf[i-1] = (invf[i] * i) % mod;
    }
}


int main(void){
    ll n, m;
    cin >> n >> m;
    ll d = m - n;
    VL a(n + 1);
    a[0] = 1;
    a[1] = d;
    FOR(x,2,n){
        a[x] = (x + d - 1) * a[x - 1] + (x - 1) * a[x - 2];
        a[x] %= mod;
    }
    init_f();
    ll ans = (a[n] * nPr(m, n)) % mod;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 14636
#include <cstdio>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <ctime>
#include <cstring>
#include <cassert>
#include <bitset>
#include <sstream>
#include <queue>

#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define sz(a) ((int) (a).size())
#define eprintf(...) fprintf(stderr, __VA_ARGS__)

using namespace std;

typedef long long int64;
typedef long double ldb;

const long double eps = 1e-9;
const int inf = (1 << 30) - 1;
const long long inf64 = ((long long)1 << 62) - 1;
const long double pi = acos(-1);

template <class T> T sqr (T x) {return x * x;}
template <class T> T abs (T x) {return x < 0 ? -x : x;}

vector<vector<int>> adj;
vector<int> pr;
vector<int> num_ch;
vector<int> h;

void DFS(int v, int p) {
	pr[v] = p;
	num_ch[v] = 0;
	if (p == -1) {
		h[v] = 0;
	} else {
		h[v] = h[p] + 1;
	}
	
	for (int i = 0; i < sz(adj[v]); ++i) {
		if (adj[v][i] != p) {
			++num_ch[v];
			DFS(adj[v][i], v);
		}
	}
}

int main () {
    ios_base::sync_with_stdio(0);
//	freopen("input.txt", "rt", stdin);
//	freopen("output.txt", "wt", stdout);

	int n;
	cin >> n;

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

	adj.resize(n);
	pr.resize(n);
	num_ch.resize(n);
	h.resize(n);

	for (int i = 0; i < n - 1; ++i) {
		int v1, v2;
		cin >> v1 >> v2;
		--v1, --v2;
		adj[v1].pb(v2);
		adj[v2].pb(v1);
	}

	DFS(0, -1);

	set<pair<int, int>> vert;
	for (int i = 0; i < n; ++i) {
		vert.insert(mp(h[i], i));
	}

	while (!vert.empty()) {
		auto it = vert.end();
		--it;
		
		int v1 = it->sc;
		vert.erase(it);

		if (pr[v1] == -1 || num_ch[pr[v1]] > 1) {
			cout << "First" << endl;
			return 0;
		}

		int v2 = pr[v1];
		if (pr[v2] != -1) {
			--num_ch[pr[v2]];
		}
		vert.erase(mp(h[v2], v2));
	}

	cout << "Second" << endl;

	return 0;
}


Measured memory_bytes: 11648
#include<iostream>
#define _USE_MATH_DEFINES
#include<math.h>
#include<vector>
#include<array>
#include<algorithm>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vector<ll>> mat;
typedef pair<ll,ll> P;
typedef map<ll,ll> MP;
typedef priority_queue<ll> PQ;
typedef stack<ll> ST;
typedef queue<ll> QUE;
#define pb push_back
#define st first
#define nd second
#define SZ(x) ((int)(x).size())
#define FOR(i,s,n) for(int i=(int)(s); i< (int)(n); i++)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define each(x,c) for(auto x: (c))
#define LB(x,a) lower_bound(all(x), a)
#define UB(x,a) upper_bound(all(x), a)
const ll mod=1e9+7;
const ll INF=1e18;
const double EPS=1.0e-10;
const double PI=M_PI;

int main(){
    vec A(3); cin>>A[0]>>A[1]>>A[2];
    if(A[0]%2==0 || A[1]%2==0 || A[2]%2==0){
        cout<<0<<endl;
        return 0;
    }
    sort(all(A));
    cout<<A[0]*A[1]<<endl;
    return 0;
}

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

const int inf = 1e9;
const ll linf = 1e18;

int main()
{
    int a, b, c, d; cin >> a >> b >> c >> d;
    cout << min(a, b) + min(c, d) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int d,i;
	unsigned long long ans;
	while(scanf("%d",&d)!=EOF) {
		ans=0;
		for(i=1;i*d<600;i++) {
			ans+=i*i*d*d*d;
		}
		printf("%lld\n",ans);
	}
	return 0;
}

Measured memory_bytes: 592
// Problem : C - Tax Increase
// Contest : AtCoder Beginner Contest 158
// URL : https://atcoder.jp/contests/abc158/tasks/abc158_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cp-editor)

/*/ Author:Amar1503/*/
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("Ofast")
#define fio ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ull unsigned long long
#define ll long long
#define inf INT_MAX
#define mninf INT_MIN
#define Mod 1000000007
#define endl "\n"
#define cp(x) cout<<(x)<<" "
#define cl(x) cout<<(x)<<endl
#define ct(x,y) cout<<(x)<<" "<<(y)<<endl;
#define nl   cout<<endl
//const double PI=3.1415926535897932384626433832;
//looping
#define For(i,a,b) for(int i=a;i<b;i++)
#define test(t)  int (t); cin>>(t); while((t)--)
#define array(a,n) int (n); cin>>(n); int a[n]; for(int i=0;i<(n);i++) cin>>a[i];
#define trace(x) clog<<#x<<": "<<x<<" "<<endl
#define trace2(x,y) clog<<#x<<": "<<x<<"     "<<#y<<" "<<y<<endl
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define printa(a,n) for(int i = 0 ; i < n ; i++) cout<<a[i]<<' '
#define printv(v)  for(int i=0;i<(v).size();i++) cout<<v[i]<<" "
//containers
#define F first
#define S second
#define pb emplace_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define all(v) (v).begin(),(v).end()
#define mp make_pair
#define itr(it, a) for(auto it = (a).begin(); it != (a).end(); it++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ers(v)   sort(all(v)); (v).erase(unique(all(v)),(v).end())
#define printmatrix(a,n,m) for(int i=0;i<n;i++){ for(int j=0;j<m;j++) cout<<a[i][j]<<" "; cout<<endl;}
typedef vector<int> vi;
typedef vector< vector< int > > vvi;
typedef pair <int, int> pii;
typedef vector < pair <int, int> > vpii;
// cout<<"\nTime Elapsed : " << 1.0*clock() /CLOCKS_PER_SEC << " s\n";
int dx[8]={1,1,1,-1,-1,-1,0,0};
int dy[8]={1,0,-1,1,-1,0,1,-1};
//#define int long double
/*/----------------------------Code begins----------------------------------/*/
int32_t main(){
fio;
int a,b;
cin>>a>>b;
for(int i=1;i<2000;i++){
	if((int(i*0.08)==a)&&(int(i*0.1)==b))
	{cout<<i;
	return 0;}
}
cout<<-1;
}









Measured memory_bytes: 256
/*      Abhijith    */
#include<bits/stdc++.h>
#include<iomanip>
#define lld long long int
#define ld long double
#define mod 1000000007
#define all(v) v.begin(),v.end()
#define rep(i,a,b)	for(lld i=a;i<=b;i++)
#define repr(i,a,b) for(lld i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
using namespace std;

int main()
{
     ios_base::sync_with_stdio(false);
     cin.tie(0);
     cout.tie(0);
     lld n;
     cin>>n;
     set<pair<lld,lld> > req;
     if(n%2==0)
     {
         rep(i,1,n)
         {
             rep(j,1,n)
             {
                 if(i+j!=n+1&&i!=j)
                 {
                     req.insert(mp(min(i,j),max(i,j)));
                 }
             }
         }
     }
     else
     {
         rep(i,1,n-1)
         {
             req.insert(mp(i,n));
         }
         rep(i,1,n-1)
         {
             rep(j,1,n-1)
             {
                 if(i+j!=n&&i!=j)
                 {
                        req.insert(mp(min(i,j),max(i,j)));
                 }
             }
         }
     }
              cout<<req.size()<<endl;
         for(set<pair<lld,lld> >::iterator it=req.begin();it!=req.end();it++)
         {
             cout<<it->first<<" "<<it->second<<endl;
         }
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>

using namespace std;

int main() {
    int n;
    int res = 0;
    int a[100];

    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d ", &a[i]);
    }
    sort(a, a + n, greater<int>());
    for (int i = 0; i < n; i++) {
        if (i % 2 == 0) {
            res += a[i];
        } else {
            res -= a[i];
        }
    }
    printf("%d", res);

    return 0;
}

Measured memory_bytes: 256
n, m = gets.split.map(&:to_i)
edges = []
m.times { edges << gets.split.map(&:to_i) }
graph = Array.new(n + 1) { Array.new }
edges.each do |from, to|
  graph[from] << to
  graph[to] << from
end
puts graph.all? { |g| g.size.even? } ? "YES" : "NO"


Measured memory_bytes: 16252
import math
val = int(input())
res = 0
current = 1
while True:
    rest = val - current
    plus = math.floor(rest / current)
    if plus == 0:
        break

    if math.floor(val / plus) == val % plus:
        res += plus
    if current * current + current >= val:
        break
    current += 1
print(str(res))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define ri register int
#define fi first
#define se second
using namespace std;
inline int read(){
	#define gc getchar
	int ans=0;
	char ch=gc();
	while(!isdigit(ch))ch=gc();
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	return ans;
	#undef gc
}
typedef long long ll;
typedef pair<int,int> pii;
const int mod=1e9+7;
inline int add(const int&a,const int&b){return a+b>=mod?a+b-mod:a+b;}
inline int dec(const int&a,const int&b){return a>=b?a-b:a-b+mod;}
inline int mul(const int&a,const int&b){return (ll)a*b%mod;}
inline void Add(int&a,const int&b){a=a+b>=mod?a+b-mod:a+b;}
inline void Dec(int&a,const int&b){a=a>=b?a-b:a-b+mod;}
inline void Mul(int&a,const int&b){a=(ll)a*b%mod;}
inline int ksm(int a,int p){int ret=1;for(;p;p>>=1,a=mul(a,a))if(p&1)Mul(ret,a);return ret;}
inline bool check(int x){
	int ret=0;
	while(x)x/=10,++ret;
	return ret&1;
}
int main(){
	int a=read();
	int cnt=0;
	for(ri i=1;i<=a;++i)if(check(i))++cnt;
	cout<<cnt;
	return 0;
}

Measured memory_bytes: 256