akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define pb(x) push_back(x)
#define eb(x,y) emplace_back(x,y)
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
#define EPS 1e-9
 
using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;
struct edge{int from, to; ll cost;};

int n;
vector<int> edges[100000];
vector<int> fdist(100000, INF);
vector<int> sdist(100000, INF);

int bfs(bool f, bool s, int start, int goal){
    vector<bool> used(n, false);
    queue<Pii> que;
    que.push(Pii(start, 0));
    Pii v;
    while(!que.empty()){
        v = que.front(); que.pop();
        if(f) fdist[v.first] = v.second;
        if(s) sdist[v.first] = v.second;
        used[v.first] = true;
        if(v.first == goal){
            return v.second;
        }
        for(int u : edges[v.first]){
            if(!used[u]){
                que.push(Pii(u, v.second+1));
            }
        }
    }
    return -1;
}

signed main(){
    int a,b;
    cin >> n;
    rep(n-1){
        cin >> a >>b; 
        a--; b--;
        edges[a].pb(b);
        edges[b].pb(a);
    }
    int dist = bfs(false, false, 0, n-1);
    int f = bfs(true, false, 0, -1);
    int s = bfs(false, true, n-1, -1);
    f = 0;
    s = 0;
    rep(n){
        if(fdist[i] <= sdist[i]){
            f++;
        }else{
            s++;
        }
    }

    if(dist % 2 == 1){
        if(f > s){
            cout << "Fennec";
        }else{
            cout << "Snuke";
        }
    }else{
        if(dist/2+f > dist/2-1+s){
            cout << "Fennec";
        }else{
            cout << "Snuke";
        }
    }
    return 0;
}


Measured memory_bytes: 6824
/****Author: Barish Namazov****/
#include <bits/stdc++.h>

using namespace std;

/***TEMPLATE***/
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

#define F first
#define S second
#define pb push_back

#define endl '\n'

const int max4 = 10004;
const int maxx = 100005;
const int max6 = 1000006;
const int lg5 = 17;

const int INF = 2 * 1000000007;
const long long INFLL = 4LL * 1000000000 * 1000000000;

/***************/

int powmod (int a, int b, int mod) {
    int res = 1; a %= mod;
    for (; b; b >>= 1) {
        if (b & 1) {
            res = 1LL * res * a % mod;
        }
        a = 1LL * a * a % mod;
    }
    return res;
}

int gcd (int a, int b) {
    while (b > 0) {
        int t = a % b;
        a = b, b = t;
    }
    return a;
}

int lcm (int a, int b) {
    return (a / gcd (a, b)) * b;
}

int is_prime (int n) {
    if (n <= 1 || n > 3 && (n % 2 == 0 || n % 3 == 0))
        return 0;
    for (int i = 5, t = 2; i * i <= n; i += t, t = 6 - t)
        if (n % i == 0)
            return 0;
    return 1;
}

/******Don't forget to use long long when needed!!******/


int main() {
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    ios_base :: sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    long long a, b, x;
    cin >> a >> b >> x;
    long long ax = (a % x == 0 ? a : a + (x - a % x));
    long long bx = (b % x == 0 ? b : b - b % x);
    cout << (bx - ax) / x + 1 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    if(n % 2 == 1) {
        cout << 0 << endl;
    } else {
        ll now = 10;
        ll ans = 0;
        while((n / now) > 0) {
            ans += (n / now);
            now *= 5;
        }
        cout << ans << endl;
    }
}

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

using namespace std;

const long long Mod = 1000000007;

int n;
string str;
int a[200005], xd[200005];
long long p[200005];

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    p[0] = 1;
    for (int i = 1; i <= n; i++)
    {
        p[i] = (p[i - 1] * i) % Mod;
    }
    n *= 2;
    cin >> str;
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        if (str[i] == 'B')
        {
            a[i] = 1;
        }
        else
        {
            a[i] = 0;
        }
        if (a[i] == s)
        {
            xd[i] = -1;
        }
        else
        {
            xd[i] = 1;
        }
        s ^= 1;
    }
    int s1 = 0, s2 = 0;
    long long res = 1;
    for (int i = 0; i < n; i++)
    {
        if (xd[i] == 1)
        {
            s1++;
        }
        else
        {
            if (s1 > s2)
            {
                res = (res * (s1 - s2)) % Mod;
            }
            else
            {
                res = 0;
            } 
            if (res == 0)
            {
                break;
            }
            s2++;
        }
    }
    if (s1 != s2)
    {
        res = 0;
    }
    cout << (res * p[n / 2]) % Mod;
    return 0;
}

Measured memory_bytes: 2964
#include <bits/stdc++.h>
using namespace std;
int main() {
	string A, B, C;
	cin >> A;
	cin >> B;
	cin >> C;

	int flag = 0;
	char first = A[0];
	A.erase(0, 1);
	while (flag < 300) {
		if (first == 'a') {
			if (A.empty()) {
				cout << "A" << endl;
				return 0;
			}
			first = A[0];
			A.erase(0, 1);
			flag++;
		}
		
		if (first == 'b') {
			if (B.empty()) {
				cout << "B" << endl;
				return 0;
			}
			first = B[0];
			B.erase(0, 1);
			flag++;
		}

		if (first == 'c') {
			if (C.empty()) {
				cout << "C" << endl;
				return 0;
			}
			first = C[0];
			C.erase(0, 1);
			flag++;
		}
	}
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var s = Console.ReadLine();
        var z = int.Parse(s) % s.Sum(x => int.Parse(x.ToString()));
        Console.WriteLine(z == 0 ? "Yes" : "No");
    }
}

Measured memory_bytes: 11220
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#define ll long long
#define inf 1<<30
#define il inline 
#define in1(a) read(a)
#define in2(a,b) in1(a),in1(b)
#define in3(a,b,c) in2(a,b),in1(c)
#define in4(a,b,c,d) in2(a,b),in2(c,d)
il void readl(ll &x){
    x=0;ll f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    x*=f;
}
il void read(int &x){
    x=0;int f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')f=-f;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    x*=f;
}
using namespace std;
/*===================Header Template=====================*/
#define N 100010
char s[N];
int main(){
	scanf("%s",s+1);
	int len=strlen(s+1);
	int pd=0;
	if(s[1]!='A'){puts("WA");return 0;}
	for(int i=3;i<=len-1;i++){
		if(s[i]<'a'||s[i]>'z'){
			if(s[i]=='C'){
				if(!pd)pd=1;
				else return puts("WA"),0;
			}else {
				return puts("WA"),0;
			}
		}
	}
	if(!pd)return puts("WA"),0;
	if(s[len]>'z'||s[len]<'a')return puts("WA"),0;
	if(s[2]>'z'||s[2]<'a')return puts("WA"),0;
	printf("AC\n");
	return 0;
}


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

int dr[4] = {1, 0, -1, 0};
int dc[4] = {0, 1, 0, -1};

class Dice {
public:
  int u, d, r, l, f, b;
  Dice() {}
  Dice(int u_, int f_) {
    u = 1; f = 3; r = 5; l = 2; d = 6; b = 4;
    while( not ( u_ == u and f_ == f ) ) {
      Rotate(rand() % 4);
    }
  }
  void R() {
    int t; t = u; u = l; l = d; d = r; r = t;
  }
  void L() {
    int t; t = u; u = r; r = d; d = l; l = t;
  }
  void F() {
    int t; t = u; u = b; b = d; d = f; f = t;
  }
  void B() {
    int t; t = u; u = f; f = d; d = b; b = t;
  }
  void Rotate(int k) {
    switch( k ) {
    case 0 : F(); break;
    case 1 : R(); break;
    case 2 : B(); break;
    case 3 : L(); break;
    }        
  }
  int W(int k) {
    switch( k ) {
    case 0 : return f;
    case 1 : return r;
    case 2 : return b;
    case 3 : return l;
    }
    return 0;
  }
};

int vs[256][256];
int hs[256][256];

void Init() {
  for(int i = 0; i < 256; ++i) {
    for(int j = 0; j < 256; ++j) {
      vs[i][j] = 0;
      hs[i][j] = 0;
    }
  }
}

void solve() {
  int xs[7] = {};
  for(int i = 0; i < 256; ++i) {
    for(int j = 0; j < 256; ++j) {
      xs[vs[i][j]] += 1;
    }
  }
  printf("%d", xs[1]);
  for(int i = 2; i <= 6; ++i) {
    printf(" %d", xs[i]);
  }
  printf("\n");
}

int main() {
  for(;;) {
    Init();
    int n;
    scanf("%d", &n);
    if( n == 0 ) break;
    for(int i = 0; i < n; ++i) {
      int r = 128, c = 128;
      int u, f;
      scanf("%d %d", &u, &f);
      int h = hs[r][c];
      Dice dice(u, f);
      bool end = true;
      do {
        end = true;
        for(int x = 6; x >= 4; --x) {
          for(int k = 0; k < 4; ++k) {
            if( dice.W(k) != x ) continue;
            int nr = r + dr[k];
            int nc = c + dc[k];
            if( hs[nr][nc] >= h ) continue;
            dice.Rotate(k);
            r = nr; c = nc;
            h = hs[r][c];
            end = false;
            goto label_1;
          }
        }
      label_1:;        
      } while( not end );
      hs[r][c] += 1;
      vs[r][c] = dice.u;
    }
    solve();
  }
  
  return 0;
}

Measured memory_bytes: 3716
#include <bits/stdc++.h>
#define dcout cout << fixed << setprecision(15)
#define rep(i, a) for(int i = 0; i < a; i++)
#define arep(i, x) for(auto i : x)
#define all(v) v.begin(), v.end()
#define int long long
#define F first
#define S second
#define VE vector<int>
#define pb(x) push_back(x)
using namespace std;
signed main() {
    int n, k;
    cin >> n >> k;
    VE h;
    rep(i, n) {
        int enter;
        cin >> enter;
        h.pb(enter);
    }
    sort(all(h), greater<int>());
    int ans = 1000000001;
    rep(i, n - k + 1) {
        if(h[i] - h[i + k - 1] < ans) {
            ans = h[i] - h[i + k - 1];
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1400
#include <cstdio>
int cnt[400050];
int hash[400050];
int maxn = 400000;

int Hash(int p){
	int ha = (p ^ 7) % maxn;
	while (hash[ha] != 0 && hash[ha] != p) ha++;
	hash[ha] = p;
	return ha;
}

int main(){
	int n, m;
	scanf("%d", &n);
	for (int i = 1, x = 0; i <= n; i++){
		scanf("%d", &x);
		cnt[Hash(x)]++;
	}
	scanf("%d", &m);
	for (int i = 1, x = 0; i <= m; i++){
		scanf("%d", &x);
		int hax = Hash(x);
		cnt[hax]--;
		if (cnt[hax] < 0){
			puts("NO");
			return 0;
		}
	}
	puts("YES");
	return 0;
}


Measured memory_bytes: 3328
/*
the top of the losers
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define sz(v)   ((int)(v).size())
#define  all(v)    ((v).begin()),((v).end())
#define  allr(v)    ((v).rbegin()),((v).rend())
#define   pb         push_back
#define   mp         make_pair
#define    Lcm(a,b)  ((a*b)/(__gcd(a,b)))
#define   length(a)      hypot( (a.imag()),(a.real()) )
#define    x            real()
#define    y            imag()
#define    clr(v,d)      memset( v, d ,sizeof(v))
#define     point        complex<double>
#define    dp(a,b)          (((conj(a))*(b)).real())
#define    cp(a,b)          (((conj(a))*(b)).imag())
typedef  long long     ll ;
typedef  unsigned long long     ull ;
const double eps= (1e-9);
using namespace std;
using namespace __gnu_pbds;
int getBit(ll num, int idx) {return ((num >> idx) & 1ll) == 1;}
int setBit1(int num, int idx) {return num | (1<<idx);}
ll setBit0(ll num, int idx) {return num & ~(1ll<<idx);}
ll flipBit(ll num, int idx) {return num ^ (1ll<<idx);}
int dcmp(long double a,long double b){   return fabsl(a-b)<=eps ? 0: (a>b)? 1:-1  ;}
int countNumBit1(int mask) {int ret=0; while (mask) 	{mask &= (mask-1);++ret;	}return ret;}
void GO(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);}
const int N=5009;
string st;
vector<int> computeprefix(string pat){
    int m=sz(pat);
    vector<int> longestprefix(m);

    for(int i=1,k=0;i<m;i++){
        while(k>0&&pat[k]!=pat[i])
            k=longestprefix[k-1];

        if(pat[k]==pat[i])
           longestprefix[i]= ++k;
        else
            longestprefix[i]=k;

    }
    return longestprefix;
}
 bool KMP(string str,string pat){
    int n=sz(str);
    int m=sz(pat);
    vector<int> longestprefix= computeprefix(pat);
    for(int i=0,k=0;i<n;i++){
        while(k>0&&pat[k]!=str[i])
            k=longestprefix[k-1];

        if(pat[k]==str[i])
            k++;
        if(k==m){
            return 1;    // begining index of the first match
            k=longestprefix[k-1];
        }
    }
    return 0;
}

bool check(int len){

   for(int i=0;i+len-1<sz(st);i++){
      string str="",pat="";
      for(int j=i;j<i+len;j++) pat+=st[j];
      for(int j=i+len;j<sz(st);j++){
        str+=st[j];
      }
      if(KMP(str,pat))
        return 1;
   }
   return 0;
}
int BS(int l,int r){
    int ans=0;
    while(l<=r){
        int mid=(l+r)/2;
        if(check(mid)){
            l=mid+1;
            ans=mid;
        }
        else{
            r=mid-1;
        }
    }
    return ans;
}
int main(){
    GO();
    int n;
    cin>>n>>st;
    cout<<BS(1,n)<<"\n";
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)

using lli = long long int;
using namespace std;
struct dijkstra {
    using lli = long long int;
    vector<vector<pair<lli, lli>>> e;
    int n;
    lli inf = 1e18;
    dijkstra(int n) : n(n)
    {
        e.resize(n);
    }
    void add(int a, int b, lli c)
    {
        e[a].push_back(make_pair(b, c));
    }
    void biadd(int a, int b, lli c)
    {
        add(a, b, c);
        add(b, a, c);
    }
    vector<lli> get(int s)
    {
        vector<lli> dist(n, inf);
        dist[s] = 0;
        using p = pair<lli, lli>;
        priority_queue<p, vector<p>, greater<p>> que;
        que.push(make_pair(0, s));
        while (!que.empty()) {
            lli d = que.top().first;
            lli cur = que.top().second;
            que.pop();
            if (dist[cur] < d)
                continue;
            dist[cur] = d;
            for (auto s : e[cur]) {
                lli wei = s.second;
                lli to = s.first;
                if (dist[to] > dist[cur] + wei) {
                    dist[to] = dist[cur] + wei;
                    que.push(make_pair(dist[cur] + wei, to));
                }
            }
        }
        return dist;
    }
};
int main() {
  int n,m,l,r,c;
  cin >> n >> m ;

  dijkstra dij(n);
  rep(i,m){
    cin >> l >> r >> c;
    dij.add(l-1,r-1,c);
  }
  rep(i,n-1)dij.add(i+1,i, 0);
  lli dist = dij.get(0)[n-1];
  if(dist >= dij.inf ){
    cout << -1 << endl;
    return 0;
  }
  cout << dist << endl;
}

Measured memory_bytes: 9340
import java.util.Scanner;
public class Main {

	public static void main (String [] args) {
		int count = 0;
		Scanner in = new Scanner(System.in);
		while(in.hasNextInt()) {
			if(isPrime(in.nextInt())) {
				count++;
			}
		}
		
		System.out.println(count);
	}
		public static boolean isPrime(int i) {
			
			
			if(i == 2 || i == 3) {
				return true;
			}
			
			else if (i % 2 == 0 || i % 3 == 0) {
				return false;
			}
			
			
		
			else {
			
				for(int j = 5; j * j <= i; j += 6) {
					
					if((i % j == 0) || (i % (j + 2) == 0)) {
						return false;
					
					}
				}
				
				return true;
						
						
				}
			
		
			}
		}
		
		
		
		

	
	





Measured memory_bytes: 42944
#include <stdio.h>
int main(void){
  int W;
  int a,b;
  scanf("%d %d %d",&W,&a,&b);
  int c;
  if(a<b){
    c=b-(a+W);
    if(c<=0){
      printf("0\n");
    }
    else{
      printf("%d\n",c);
    }
  }
  else{
    c=a-(b+W);
    if(c<=0){
      printf("0\n");
    }
    else{
      printf("%d\n",c);
    }
  }
  return 0;
}

Measured memory_bytes: 1708
#include <bits/stdc++.h>
#define int long long int
#define ii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
using namespace std;
#define output(x) for (auto a:x) cout<<a<<" ";cout<<endl;
#define output2(x) for (auto a:x) cout<<a.fi<<" "<<a.se<<endl;
#define PI 3.14159265
#define rall(x) x.rbegin(),x.rend()
#define all(x) x.begin(),x.end()
#define sz(x) (int) x.size()
// DEBUG TEMPLATE
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
  *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
  
// DEBUG TEMPLATE ENDS

#define MOD 1000000007
int power(int x,int y,int mod = MOD) 
{ 
  int ret = 1;
  x = x % mod;
  while (y){
    if(y&1) ret = (ret*x)%mod;
    y = y>>1;
    x = (x*x)%mod;
    } 
    return ret%mod; 
}

void solve()
{ 
  int n;
  cin>>n;
  vector<int> inp(n);
  for (auto &x:inp) cin>>x;
  int ans = 0;
  for (int i = 0 ; i < n ; i++){
    for (int j = i +  1 ; j < n ; j++){
      for (int k = j + 1 ; k < n ; k++){
        vector<int> temp;
        temp.pb(inp[i]);
        temp.pb(inp[j]);
        temp.pb(inp[k]);
        sort(all(temp));
        if (temp[0] == temp[1] or temp[1] == temp[2]) continue;
        if (temp[0] + temp[1] > temp[2]){
         ans++;
          debug() << imie(temp);

        }
       }
    }
  }
  cout<<ans<<endl;
}


/*
  
*/
signed main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  // cin>>t;
  while (t--)
  solve();
}
// Check MOD values plox :(


Measured memory_bytes: 3648
#line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for(ll i = l; i < (ll)r; i++)
#define per(i, n) for(ll i = n-1; i >= 0; i--)
#define per3(i, l, r) for(ll i = r-1; i >= (ll)l; i--)
#define all(v) begin(v), end(v)
template<class T, class U>
inline void cmax(T& a, U b) { if (a < b) a = b; }
template<class T, class U>
inline void cmin(T& a, U b) { if (a > b) a = b; }

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
  }
} io_setup;

constexpr char el = '\n';
#line 2 "c2.cpp"

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

  double ans = 0;
  rep(i, n) {
    ll t = i+1;
    if (t < k) ans += pow(0.5, ceil(log2((double)k/t))) / n;
    else ans += 1.0 / n;
  }
  cout << ans << endl;
  cout << flush;
}


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

using namespace std;

#ifdef LOCAL
#define err cerr
#else
#define err if (false) cerr
#endif

typedef long long ll;

const int MAXN = 55;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
   ll x, y;
cin >> x >> y;
cout << x * y / __gcd(x, y);
}


Measured memory_bytes: 256
#include<stdio.h>

int main()
{
	int a = 0, b = 0, c = 0, k = 0;
	int sub = 0, i = 0;
	scanf("%d %d %d",&a, &b, &c);
	scanf("%d",&k);
	if(a>b)
		{
			sub = a;
			a = b;
			b = sub;
		}
		if(b>c)
		{
			sub = b;
			b = c;
			c = sub;
		}
	for(i=0;i<k;i++)
	{

		c *= 2;
	}
	printf("%d\n", a+b+c);
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int main(int argc, const char * argv[])
{

    long long stnum;
    double weight, height;
    
    while (scanf("%lld,%lf,%lf",&stnum ,&weight ,&height) != EOF) {
        if (25 <= weight / height / height) {
            printf("%lld\n",stnum);
        }
    }
    return 0;
}

Measured memory_bytes: 624
/*Made by Shivam Solanki*/
#include<bits/stdc++.h> 
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define ll long long int
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<pii> vp;
typedef vector<pll> vpll;
typedef map<int,int> mii;
typedef map<ll,ll> mll;
typedef set<int> sii;
typedef set<ll> sll;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umii;
typedef unordered_map<ll,ll> umll;
typedef queue<int> qii;
#define rep(i,k,n) for (int i = k; i < n; ++i) 
#define repr(i,k,n) for (int i = n; i>=k; --i)
#define repll(i,k,n) for (ll i = k; i < n; ++i) 
#define repllr(i,k,n) for (ll i = n; i >= k; --i) 
#define pb push_back
#define mp make_pair
#define gcd __gcd
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int INF = 1e9+5;
const int MOD = 1e9+7;

void solve(){
    int a,b;
    cin>>a>>b;
    string x="",y="";
    rep(i,0,a) x+=to_string(b);
    rep(i,0,b) y+=to_string(a);
    // cout<<x<<' '<<y<<'\n';
    cout<<(a>b?x:y);
}
    
int main(){
    // #ifndef ONLINE_JUDGE  
        // freopen("input.txt", "r", stdin); 
        // freopen("output.txt", "w", stdout); 
    // #endif 
    // fastio;
    int t=1;
    // cin>>t;
    while(t--)
        solve();
    return 0;
}

Measured memory_bytes: 256
//g++ -std=gnu++14 a.cpp

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>
//#include <ostream>

using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;

int main(){
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans =0;
  rep(i,S.size()-2){
    if(S.at(i)=='A' && S.at(i+1)=='B' && S.at(i+2)=='C')ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
	string s; cin >> s;
	std::vector<char> v(4);
	for (int i = 0; i < 4; ++i)
	{
		v[i] = s[i];
	}

	sort(v.begin(), v.end());
	if(v[0]==v[1] && v[2]==v[3] && v[1]!=v[2]) cout <<  "Yes"  << endl;
	else cout << "No" << endl;
}

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

using namespace std;
 
int main() {
	string s,t;
	int i;
	cin >> s;
	int n;
	n=s.length();
	for(i=0;i<n;i++){
		if(i%2==0){
			cout << s[i];
		}
	}
	cout << endl;
	return 0;
}

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

map<int,int> m;

int main() {	
	int n;
	scanf("%d",&n);
	while(n--) {
		int a;
		scanf("%d",&a);
		++m[a];
	}
	int ans = 0;
	for(auto p : m) {
		if(p.second < p.first) ans += p.second;
		else ans += p.second - p.first;
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 4736
///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"

#define                           ll                          long long
#define                           int                         ll
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<ll,ll>
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

const ll inf=1e18;
const int mod=1e9+7;
const int M=100005;
map<int,int>cnt;
 main()

{
    fast
    int n,m,x,sum=0,ses=0;
    cin>>n>>m;
    cnt[0]=1;
    f(i,1,n)
    {
        cin>>x;
        sum=(sum+x)%m;
        ses+=cnt[sum];
        cnt[sum]++;
    }
    cout<<ses<<endl;
    return 0;

}





































Measured memory_bytes: 7436
#include <iostream>
#include <numeric>
#include <cstdint>
using namespace std;

int main() {
    int64_t a, b, c, d;
    cin >> a >> b >> c >> d;

    // CとDの最小公倍数
    auto lcmn = lcm(c, d);
    // A以上、B未満の間に存在するCの倍数の数 (B以下に存在する倍数の数 - A未満に存在する倍数の数)
    auto cn = b / c - (a - 1) / c;
    // A以上、B未満の間に存在するDの倍数の数
    auto dn = b / d - (a - 1) / d;
    // A以上。B未満の間に存在するCとDの最小公倍数の倍数の数
    auto cdn = b / lcmn - (a - 1) / lcmn;

    // 全体 - Cの倍数の数 - Dの倍数の数 + CとDの最小公倍数の倍数の数
    cout << (b - a + 1) - cn - dn + cdn << endl;
}



Measured memory_bytes: 3680
import bisect

n=int(input())
A=list(map(int,input().split()))
q=int(input())
m=list(map(int,input().split()))

l=[]
for k in range(2**n):
    a=0
    for i in range(n):
        if (k>>i)&1==1:
            a+=A[i]
    l.append(a)
l.sort()

for mi in m:
    if bisect.bisect_left(l,mi)<bisect.bisect_right(l,mi):
        print('yes')
    else:
        print('no')


Measured memory_bytes: 47012
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define ll long long
#define INF 999999999
using namespace std;
ll gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
ll lcm(int x, int y) { return x / gcd(x, y) * y; }
ll gcd_3(int a, int b , int c){
  ll ans;
  ans = gcd(a,b);
  ans = gcd(ans,c);
  return ans;
}
int main() {
  int K;
  ll sum = 0;
  std::cin >> K;
  for (size_t i = 1; i < K+1; i++) {
    for (size_t j = 1; j < K+1; j++) {
      for (size_t k = 1; k < K+1; k++) {
        sum += gcd_3(i,j,k);
      }
    }
  }
  std::cout << sum << '\n';
}


Measured memory_bytes: 3636
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;

int main()
{
	string a,b;
	cin >> a >> b;
	int len = a.size();
	bool ans = 0;
	for (int i = 0;i < len;i++)
	{
		bool f = 0;
		for (int j = 0;j < len;j++)
		{
			if (a[j] != b[(j+i) % len]) f = 1;
		}
		if (!f) ans = 1;
	}
	if (ans) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int n; string s;
  cin >> n >> s;
  rep(i,s.size()){
    s[i] = s[i]+n;
    if(s[i]>'Z') s[i]-=26;
  }
  cout << s << endl;
}


Measured memory_bytes: 888
//C - Rally

#include <iostream>

using namespace std;

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

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

    int min = x[0];
    int max = x[0];
    for(int i=0; i<n; i++){
        if (min > x[i]) min = x[i];
        if (max < x[i]) max = x[i];
    }

    long t[100];
    for(int i=0; i<=(max-min); i++){
        t[i] = 0;
        for(int j=0; j<n; j++){
            t[i] += (x[j] - (i + min)) * (x[j] - (i + min));
        }
    }
    
    int tmin = t[0];
    for(int i=0; i<(max-min); i++){
        if (tmin > t[i]){
            tmin = t[i];
        }
    }

    cout << tmin << endl;

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;

typedef long long ll;

const ll INF=0x7fffffff;
const ll MAXN=50+5;

int main(){
	char s1[MAXN],s2[MAXN];
	cin>>s1>>s2;
	bool f=true;
	int sit=-1;
	int len1=strlen(s1),len2=strlen(s2);
	for(int i=0;i<=len1-len2;i++){
		f=true;
		for(int j=0;j<len2;j++){
			if(s1[i+j]!=s2[j]&&s1[i+j]!='?'){
				f=false;
				break;
			}
		}
		if(f){
			sit=i;
		}
	}
	if(sit==-1){
		printf("UNRESTORABLE");
		return 0;
	}
	for(int j=0;j<len2;j++){
		s1[sit+j]=s2[j];
	}
	for(int i=0;i<len1;i++){
		if(s1[i]=='?'){
			printf("a");
		}
		else {
			printf("%c",s1[i]);
		}
	}
	return 0;
} 
	
	
	

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


int main(){
  ll N;
  cin >> N;
  vector<ll> A(N),B(N);
  for(int i=0;i<N;++i){
    cin >> A[i];
    B[i] = A[i];
  }
  map<ll,ll> m{};
  for(int i=0;i<N;++i){
    m[A[i]]++;
  }
  sort(B.begin(),B.end());
  ll i=0,cnt=1,ans=0;
  while(i<B.size()){
    if(i!=0 && B[i-1]==B[i]){
      cnt++;
    }
    else {
      ans += cnt*(cnt-1)/2;
      cnt = 1;
    }
    ++i;
  }  
  ans += cnt*(cnt-1)/2;

  for(ll i=0;i<N;++i){
    cout << ans - ( m[A[i]] - 1) << endl;
  }
}

Measured memory_bytes: 12672
#include <iostream>

int main() {
    std::string S;
    std::cin >> S;
    
    int cnt = 0;
    
    for (size_t i=0; i<3; ++i) {
        if (S[i]=='o')
            cnt++;
    }
    
    std::cout << 700 + (100*cnt) << std::endl;
}

Measured memory_bytes: 256
n,l=map(int,input().split())
if(-n+1<=l<=0):
  print('{0}'.format(n*(2*l+n-1)//2))
elif(l>0):
  print('{0}'.format(n*(2*l+n-1)//2-l))
else:
  print('{0}'.format(n*(2*l+n-1)//2-l-n+1))

Measured memory_bytes: 3060
/*input
8 6
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}
int main()
{
	IOS;
	int a,b;
	cin>>a>>b;
	if(a<=8&&b<=8) cout<<"Yay!";
	else cout<<":(";
	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int main(){
	for (int i = 0; i < 20000; ++i)
	{
		int a,b;
		string op;
		cin >> a >> op >> b;
		if(op=="+"){
			cout << a + b << endl;
		}
		else if(op=="-"){
			cout << a - b << endl;
		}
		else if(op=="*"){
			cout << a*b << endl;
		}
		else if(op=="/"){
			cout << a/b << endl;
		}
		else{
			break;
		}


	}
}
	



Measured memory_bytes: 3152
A = int(input())
B = int(input())
C = int(input())
X = int(input())

cnt = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if(i*500+j*100+k*50 == X):
        cnt += 1
print(cnt)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}}
#define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;}
#define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;}
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> llP;
ll gcd(int x, int y){ return y?gcd(y, x%y):x;}
ll lcm(ll x, ll y){ return (x*y)/gcd(x,y);}


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

    vector<ll> c(n);
    vector<vector<ll>> a(n, vector<ll>(m, 0));

    rep(i, n) {
        cin >> c[i];
        rep(j, m){
            cin >> a[i][j];
        }
    }



    int ans = MOD;
    rep(i, 1<<n){
        int tans = 0;
        vector<int> rikaido(m, 0);
        bool isok = true;
        for (int b = 0; b < n; b++)
        {
            if ((i>>b)&1){
                //b番目の本を洗濯
                tans += c[b];
                rep(algo, m){
                    rikaido[algo] += a[b][algo];
                }
            }
        }
            rep(algo, m){
                //cout << rikaido[algo] << ":";
                if (rikaido[algo] < x){
                    isok = false;
                }
            }
        
        //cout << i << ":::" << tans << ";;;" << isok << endl;
        
        if (isok) ans = min(tans, ans);
    }

    if (ans == MOD) cout << -1 << endl;
    else cout << ans << endl;

}



Measured memory_bytes: 3644
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define puts(i) cout << i << endl
#define INF INT_MAX
#define INFL LLONG_MAX
typedef long long ll;
using namespace std;
int main(){
  string s; cin >> s;
  int ans;

  if(s=="SUN") ans = 7;
  else if(s=="MON") ans = 6;
  else if(s=="TUE") ans = 5;
  else if(s=="WED") ans = 4;
  else if(s=="THU") ans = 3;
  else if(s=="FRI") ans = 2;
  else if(s=="SAT") ans = 1;

  cout << ans << endl;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define debug(a) cout << #a ": " << a << endl
#define IOS ios::sync_with_stdio(false), cin.tie(0)
using namespace std;
typedef long long ll;

int main(void){
    IOS;
    int l, r, k; cin >> l >> r >> k;
    int cnt = 0;
    for (int i = l; i <= r; ++i){
        if (i%k == 0) cnt++;
    }
    cout << cnt << endl;
    return 0;
}

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

int main()
{
 	int n;
  	cin>>n;
  int a[n];
  for(int i=0;i<n;i++)cin>>a[i];
  int m=a[0];
  int j=0;
  for(int i=0;i<n;i++)
  {
    if(a[i]>=m)
    {
      m=a[i];
      j++;
    }
  }
  cout<<j;
  
}

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

#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll ;
typedef long double ld ;

const ll MOD = 1E9 + 7, INF = 2E18 + 5 ;
const double PI = 2 * acos(0.0) ;
const long double EPS = 1.0E-14 ;

ll arr[200005] ;
priority_queue < pair <ll, ll> > pq ;

int main()
{
    ll n, ans = 0, valX, valY ;
    cin >> n ;
    for (int i = 0; i < n; i++) {
        cin >> arr[i] ;
    }
    sort(arr, arr + n, greater<ll>()) ;
    pq.push({arr[0], 1}) ;
    for (int i = 1; i < n; i++) {
        pq.push({arr[i], 2}) ;
        ans += pq.top().first ;
        valX = pq.top().first, valY = pq.top().second ;
        valY-- ;
        pq.pop() ;
        if (valY != 0) {
            pq.push({valX, valY}) ;
        }
    }
    cout << ans ;

    return 0 ;
}


Measured memory_bytes: 8936
#include<bits/stdc++.h>
#define rep(i,N) for(ll i=0; i<N; i++)
using namespace std;
using ll = long long;
int main(){
    ll N; cin >> N;
    int d[N]; rep(i,N) cin >> d[i];
  	sort(d,d+N);
    cout << max(d[N/2] - d[N/2-1], 0) << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;

typedef long long ll;

#define INF 10e10
#define rep(i,n) for(int i=0; i<n; i++)
#define rep_r(i,n,m) for(int i=m; i<n; i++)
#define END cout << endl
#define MOD 1000000007
#define pb push_back
// 昇順sort
#define sorti(x) sort(x.begin(), x.end())
// 降順sort
#define sortd(x) sort(x.begin(), x.end(), std::greater<int>())

int main() {
  ll n;
  scanf("%lld", &n);
  vector<ll> a(n,0), b(n,0);

  rep(i,n) {
    scanf("%d %d", &a[i], &b[i]);
  }

  ll sum = 0;
  for (int i = n-1; i >= 0; --i) {
    a[i] += sum;
    int di = (a[i] % b[i]);
    if (di != 0) {
      sum += b[i] - di;
    }
  }

  cout << sum << endl;
}


Measured memory_bytes: 1792
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
#include<cstring>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

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


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


	ll N = getint(), D = getint();
	D = D * D;

	int kotae = 0;
	rep(i, N) {
		ll X = getint(), Y = getint();
		kotae += (D >= X * X + Y * Y);
	}
	printf("%lld\n", kotae);


	Would you please return 0;
}

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

int main() {
    
    long long int h;
    cin>>h;
    long long int z=0;
    long long int c=0;
     if(h==1){
         cout<<"1"<<endl;
     }else{
         while(h!=1){
            
            c=c+1;
            h=floor(h/2);
         }
         long long int l=0;
         for(long long int i=1;i<=c+1;i++){
            l=l+pow(2,i-1);
         }
         
         cout<<l<<endl;
     }
    
    
    
    
    
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define space putchar(' ')
#define enter putchar('\n')
#define eps 1e-10
#define MAXN 10005
//#define ivorysi
using namespace std;
typedef long long int64;
typedef unsigned int u32;
typedef double db;
template<class T>
void read(T &res) {
    res = 0;T f = 1;char c = getchar();
    while(c < '0' || c > '9') {
	if(c == '-') f = -1;
	c = getchar();
    }
    while(c >= '0' && c <= '9') {
	res = res * 10 +c - '0';
	c = getchar();
    }
    res *= f;
}
template<class T>
void out(T x) {
    if(x < 0) {x = -x;putchar('-');}
    if(x >= 10) {
	out(x / 10);
    }
    putchar('0' + x % 10);
}
set<int> S;
int g;
int N,a[MAXN],b[MAXN],c[MAXN];
int prime[MAXN],tot;
bool nonprime[MAXN];
int gcd(int a,int b) {
    return  b == 0 ? a : gcd(b,a % b);
}
void Solve() {
    read(N);
    for(int i = N ; i >= 0 ; --i) {
	read(a[i]);
	g = gcd(g,abs(a[i]));
    }
    for(int i = 2 ; i <= g / i ; ++i) {
	if(g % i == 0) {
	    S.insert(i);
	    while(g % i == 0) g /= i;
	}
    }
    if(g > 1) S.insert(g);
    for(int i = 2 ; i <= 10000 ; ++i) {
	if(!nonprime[i]) {
	    prime[++tot] = i;
	}
	for(int j = 1 ; j <= tot ; ++j) {
	    if(1LL * i * prime[j] > 10000) break;
	    nonprime[i * prime[j]] = 1;
	    if(i % prime[j] == 0) break;
	}
    }
    for(int i = 1 ; i <= tot ; ++i) {
	if(prime[i] > N) break;
	int p = prime[i];
	if(S.find(p) != S.end()) continue;
	memset(b,0,sizeof(b));
	memset(c,0,sizeof(c));
	bool flag = 1;
	for(int i = N ; i >= 0 ; --i) {
	    b[i] = (a[i] + c[i]) % p;
	    if(i >= p) {
		c[1 + i - p] += b[i];
		c[1 + i - p] %= p;
	    }
	    else if(b[i]){
		flag = 0;break;
	    }
	}
	if(flag) S.insert(p);
    }
    for(auto t : S) {
	out(t);enter;
    }
}
int main() {
#ifdef ivorysi
    freopen("f1.in","r",stdin);
#endif
    Solve();
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long h = sc.nextLong();
		sc.close();

		long ans = 0;
		long num = 1;
		while (h > 0) {
			ans += num;
			h /= 2;
			num *= 2;
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 21844
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

H, W, K = inm()
grid = [ins() for _ in range(H)]


def solve():
    ans = 0
    for i in range(1 << H):
        for j in range(1 << W):
            cnt = 0
            for r in range(H):
                if i & (1 << r):
                    continue
                for c in range(W):
                    if j & (1 << c):
                        continue
                    if grid[r][c] == "#":
                        cnt += 1
            if cnt == K:
                ans += 1

    return ans


print(solve())


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

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

  vector<ll> h(N);
  rep(i, N) { cin >> h[i]; }

  sort(h.begin(), h.end(), greater<int>());

  ll ret = 0;
  if (K < N) {
    ret = accumulate(next(h.begin(), K), h.end(), (ll)0);
  }

  cout << ret << endl;
}

Measured memory_bytes: 1792
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
typedef vector<char> vc;
typedef vector<vector<char> > vvc;
typedef vector<double> vd;
typedef vector<vector<double> > vvd;
template<class T> using vv=vector<vector< T > >;
typedef deque<int> di;
typedef deque<deque<int> > ddi;
typedef deque<bool> db;
typedef deque<deque<bool> > ddb;

// cout pair
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {
    s << p.first << " " << p.second << "\n";
    return s;
}

// cout vector<pair>
template<typename T1, typename T2> ostream& operator<<(ostream& s, const vector<pair<T1, T2> >& vp) {
    int len = vp.size();
    for (int i = 0; i < len; ++i) {
        s << vp[i];
    }
    s << "\n";
    return s;
}

// cout vector
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
    int len = v.size();
    for (int i = 0; i < len; ++i) {
        s << v[i]; if (i < len - 1) s << "\t";
    }
    return s;
}

// cout deque
template<typename T> ostream& operator<<(ostream& s, const deque<T>& v) {
    int len = v.size();
    for (int i = 0; i < len; ++i) {
        s << v[i]; if (i < len - 1) s << "\t";
    }
    return s;
}

// cout 2-dimentional vector
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
    int len = vv.size();
    for (int i = 0; i < len; ++i) {
        s << vv[i] << "\n";
    }
    return s;
}

// cout 2-dimentional deque
template<typename T> ostream& operator<<(ostream& s, const deque< deque<T> >& vv) {
    int len = vv.size();
    for (int i = 0; i < len; ++i) {
        s << vv[i] << "\n";
    }
    return s;
}

int main() {
    int n, x;
    cin >> n >> x;
    vll a(n);
    rep (i, n) {
        cin >> a[i];
    }

    vvll mi(n, vll(n));
    rep (i, n) {
        mi[i][0] = a[i];
    }
    rep (i, n) {
        FOR (j, 1, n) {
            int k = i - j;
            if (k < 0) {
                k += n;
            }
            mi[i][j] = min(mi[i][j-1], a[k]);
        }
    }
    vll cost(n);
    ll ans = 1;
    ans <<= 60;
    rep (i, n) {
        cost[i] = x * i;
        rep (j, n) {
            cost[i] += mi[j][i];
        }
        ans = min(ans, cost[i]);
    }
    printf("%lld\n", ans);

    return 0;
}


Measured memory_bytes: 31616
#include <iostream>
#include <string>
using namespace std;
int N, Q, l, r, sum[100000]; string S;
int main() {
  cin >> N >> Q >> S;
  for(int i = 1; i < N; ++i) {
    sum[i] = sum[i-1]+(S.substr(i-1,2)=="AC");
  }
  for(int i = 0; i < Q; ++i) {
    cin >> l >> r;
    cout << sum[r-1]-sum[l-1] << endl;
  }
}

Measured memory_bytes: 1408
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

#define MIN_INT -2147483648
#define MAX_INT 2147483647
#define MIN_LONG -9223372036854775808L
#define MAX_LONG 9223372036854775807L
#define PI 3.141592653589793238462643383279502884L

#define long long long int

using std::vector;
using std::map;
using std::set;
using std::string;
using std::pair;
using std::cin;
using std::cout;
using std::cerr;

// @author: pashka

int main() {
    std::ios::sync_with_stdio(false);
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    std::sort(a, a + 3);
    cout << a[2] -  a[0] << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <set>

using namespace std;
using ll = long long;
const int 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; }

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }



int main(int argc, char**argv){
    int n, k;
    cin >> n >> k;

    ll ans = k * pow(k-1, n-1);
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256