akhauriyash/Code-Regression huggingface dataset:
#include <string>
#include <vector>
#include <list>
#include <iostream>
#include <map>
#include <algorithm>
#include <cmath>

std::list<unsigned int> Eratosthenes(int N) {
	std::list<unsigned int> search_list, prime_list;
	for (int i = 2; i <= N; i++) search_list.push_back(i);

	unsigned int p;
	while (1) {
		p = search_list.front();
		prime_list.push_back(p);
		search_list.pop_front();
		if (p > sqrt(N)) break;
		auto it = search_list.begin();
		auto prev_it = it;
		while(it != search_list.end()) {
			
			if (*it%p == 0) {
				search_list.erase(it);
				it = prev_it;
			}
			prev_it = it;
			++it;

		}
	}
	for (auto it = search_list.begin(); it != search_list.end(); ++it) {
		prime_list.push_back(*it);
	}
	return prime_list;
}

int main() {
	std::list<unsigned int> prime_list = Eratosthenes(100000);
	std::map<unsigned int, unsigned int> prime_map;

	int order = 1;
	for (auto it = prime_list.begin(); it != prime_list.end(); ++it) {
		prime_map[*it] = order++;
	}

	std::map<unsigned int, unsigned int> like2017_map;
	order = 1;
	for (auto it = prime_map.begin(); it != prime_map.end(); ++it) {
		if ((it->first + 1) % 2 == 0 && prime_map.find((it->first + 1) / 2) != prime_map.end()) {
			like2017_map[it->first] = order;
			order++;
		}
	}

	int Q;
	std::cin >> Q;
	for (int i = 0; i < Q; i++) {
		int l, r;
		std::cin >> l;
		std::cin >> r;
		
		if (like2017_map.upper_bound(r) != like2017_map.end() && like2017_map.lower_bound(l) != like2017_map.end()) {
			//printf("%d %d %d %d\n", (like2017_map.lower_bound(r))->first, (like2017_map.upper_bound(l))->first,(like2017_map.lower_bound(r))->second, (like2017_map.upper_bound(l))->second);
			std::cout << (like2017_map.upper_bound(r))->second - (like2017_map.lower_bound(l))->second << '\n';
		}
		else if (like2017_map.lower_bound(l) != like2017_map.end()) {
			std::cout << like2017_map.size() - like2017_map.lower_bound(l)->second + 1<< '\n';
		}
		else
			std::cout << 0 << '\n';
	}

	return 0;
}

Measured memory_bytes: 3840
// Devarshi

/*
We will not return to the countless mistakes of the past
I will not relive the failures of the man I once was

Only through dedication will I destroy all preconception

No longer will I let myself be truly satisfied with the standard
We will not return to the countless mistakes of the past

Only through dedication will I destroy all preconception

Let this be
Be the day
Day of my
My declaration
Let this be the day of my declaration

Join me,
Walk with me

Shatter the bonds that tie us
To what we strive to never be

Join me,
Walk with me
*/
#include<bits/stdc++.h>

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

const int maxn=1000001;

int div(int n){
int cnt=0;
fore(i,1,sqrt(n)){

if(n%i==0){

    if(i*i==n){
        cnt+=1;
    }
    else{
        cnt+=2;
    }

}

}

return cnt;
}

int main(){

int n;
cin>>n;
int cnt=0;
fore(i,1,n){
if(i%2){

    if(div(i)==8){
        cnt++;
    }

}

}
cout<<cnt;
return 0;
}


Measured memory_bytes: 256
def main():
    ans = 0
    mt = ""
    for i in range(N):
        if i - K >= 0:
            if mt[i-K] == win[T[i]][0]:
                if i+K < N and win[T[i+K]][0] == T[i]:
                    mt += lose[T[i]]
                else:
                    mt += T[i]
            else:
                mt += win[T[i]][0]
                ans += win[T[i]][1]
        else:
            mt += win[T[i]][0]
            ans += win[T[i]][1]
    print(ans)


if __name__ == "__main__":
    N, K = map(int, input().split())
    R, S, P = map(int, input().split())
    win = {"r": ("p", P), "s": ("r", R), "p": ("s", S)}
    lose = {"r": "s", "s": "r", "p": "r"}
    T = input()
    main()


Measured memory_bytes: 3444
#include<iostream>
using namespace std;
int main(){
  int a,b;
  char op;
  cin >> a >> op >> b;
  while(op!='?'){
    int c;
    if(op=='+') c=a+b;
    if(op=='-') c=a-b;
    if(op=='*') c=a*b;
    if(op=='/') c=a/b;
    cout << c << endl;
    cin >> a >> op >> b;
  }
}



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

#define pb push_back


int main(){
    int k;
    string s;
    cin >> k ;
    cin >> s;
    if(s.length() <= k){
        cout << s <<"\n";
    }
    else{
       //selecting only the first k chars 
        s=s.substr(0,k);
        s.append("...");
        cout << s<<"\n";
    }
        
    return 0;
}


Measured memory_bytes: 3592
#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
typedef long long ll;
const ll INF = 2147483647;
const ll MOD = 1e9 + 7;
const double EPS = 1e-10;
const double pi = acos(-1);//3.1415926535897932384626433832795028...
const ll SIZE = 2000005;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
ll fac[SIZE], finv[SIZE], inv[SIZE];
vector<ll>dij;
struct edge { ll to, cost; };
vector<vector<edge> >G;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

ll mod_pow(ll a, ll b) {
	ll res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}
	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

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);
}

template<typename T>
void outp(vector<T>v) {
	for (int i = 0; i < v.size(); ++i) {
		cout << v[i];
		if (i != v.size() - 1) { cout << " "; }
	}
}

double add(double a, double b) {
	if (abs(a + b) < EPS * (abs(a) + abs(b))) { return 0; }
	return a + b;
}

double len(int a, int b, int c, int d) {
	return (double)sqrt((a - c) * (a - c) + (b - d) * (b - d));
}

ll n, ans;
int main() {
	cin >> n;
  
	for (ll i = 1; i * i <= n - 1; ++i) {
		if ((n - 1) % i == 0) {
			ans += ((n - 1) / i != i ? 2 : 1);
		}
	}

	for (ll i = 2; i * i <= n; ++i) {
		if (n % i == 0) {
			ll mon = n;
			while (mon % i == 0) { mon /= i; }
			if (mon % i == 1) { ++ans; }
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
import numpy as np

n = int(input())
x_list = [int(i) for i in input().split()] 

i = 0
count = 0

while i < n:
  x = x_list[i]
  while x % 2 == 0:
    count += 1
    x = x / 2
  i += 1
  
print(count)

Measured memory_bytes: 13176
a,b,c = map(int,input().split())
k = int(input())

from itertools import product

l = []

for t in product(range(3),repeat=k):
    bd = [a,b,c]
    for i in range(k):
        bd[t[i]]*=2
    l.append(sum(bd))
print(max(l))


Measured memory_bytes: 43996
#include<iostream>
using namespace std;
int main() {
	int a, b, c;
	int d;
	cin >> a;
	cin >> b;
	if (a > b) {
		c = a;
		a = b;
		b = c;
	}
	cin >> c;
	if (b > c) {
		d = b;
		b = c;
		c = d;
	}
	if (a > b) {
		d = a;
		a = b;
		b = d;
	}
	cout << c * 10 + b + a << endl;
	return 0;
}

Measured memory_bytes: 764
/**
 *  author: mahfuzz
 *  created: 05.05.2020
**/
 
#include <iostream>
using namespace std;

int mark[1000001];
void sieve(int x){
    for(int i = 2; i <= 1000001; i++){
        if(!mark[i]){
            if(i == x || i > x){
                cout << i << "\n";
                return;
            }
            for(int j = i * 2; j <= 1000001; j += i){
                mark[j] = 1;
            }
        }
    }
}

int main(int argc, char* argv[]){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    
    int x; cin >> x;
    
    sieve(x);
        
    return 0;
}
  


Measured memory_bytes: 4224
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long d = (int)Math.pow(10, 9)+7;
		sc.close();


		int prime[] = new int[1001];
		int primes[] = new int[1001];
		int k = 0;

		for(int i=2;i<1001;i++){
			prime[i] = 1;
			primes[i] = 0;
		}
		for(int i=2;i<1001;i++){
			if(prime[i] == 0) continue;
			primes[k++] = i;
			int j = 2;
			while(i*j<1001){
				prime[i*j] = 0;
				j++;
			}
		}

		long factorials[] = new long[k];
		for(int i=0;i<k;i++) factorials[i] = 1;
		for(int i=2;i<=n;i++){
			int num = i;
			for(int j=0;j<k;j++){
				while(num%primes[j]==0){
					factorials[j] ++;
					num /= primes[j];
					if(num == 1) break;
				}
			}
		}
		long answer = 1;
		for(int i=0;i<k;i++){
			answer *= factorials[i];
			answer %= d;
		}

		System.out.println(answer);
	}

}

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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << std::setprecision(10);

  int n; std::cin >> n;
  std::cout << n * n * n << "\n";
}


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


int main(){
  int N;
  string X;
  cin>>N>>X;

  int m=0;
  for(int i=0;i<N;i++){
    if(X.at(i)=='1'){
      m++;
    }
  }

  int m1=m+1;
  int m2=m-1;
  vector<int> a(N),b(N);
  int res1=1;
  int res2=1;
  int sum1=0;
  int sum2=0;
  for(int i=N-1;i>=0;i--){
    int x=X.at(i)-'0';
    sum1+=res1*x;
    sum2+=res2*x;
    sum1%=m1;
    if(m2>0){
      sum2%=m2;
    }
    a[i]=res1;
    b[i]=res2;
    res1<<=1;
    res1%=m1;
    res2<<=1;
    if(m2>0){
      res2%=m2;
    }
  }

  for(int i=0;i<N;i++){
    int ans=0;
    if(X.at(i)=='0'){
      int sum=(sum1+a[i])%m1;
      ans=1;
      while(sum>0){
        int mod=0;
        int tmp=sum;
        while(tmp>0){
          mod+=tmp%2;
          tmp>>=1;
        }
        sum%=mod;
        ans++;
      }
      cout<<ans<<endl;
    }else{
      if(m2==0){
        cout<<0<<endl;
      }else{
        int sum=(sum2-b[i]+m2)%m2;
        ans=1;
        while(sum>0){
          int mod=0;
          int tmp=sum;
          while(tmp>0){
            mod+=tmp%2;
            tmp>>=1;
          }
          sum%=mod;
          ans++;
        }
        cout<<ans<<endl;
      }
    }
  }
}


Measured memory_bytes: 5244
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <numeric>
#include <sstream>
#include <iostream>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <cassert>
using namespace std;

#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll> 
#define VVI vector<vector<ll> >
#define VVVI vector<vector<vector<ll>>>
#define VVVVI vector<vector<vector<vector<ll>>>>
#define REP(i,n) for(ll i=0,_n=(n);(i)<(ll)_n;++i)
#define REPR(i,n) for(ll i=(ll)(n)-1;0<=(i);--i)
#define RANGE(i,a,b) for(ll i=(ll)a,_b=(ll)(b);(i)<_b;++i)
#define RANGER(i,a,b) for(ll i=(ll)(b)-1,_a=(ll)(a);(_a)<=i;--i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define UNIFORM_DOUBLE(a, b) (((b-a)*(double)rand()/RAND_MAX)+a) // [a, b) 
#define UNIFORM_LL(a, b) (ll)UNIFORM_DOUBLE(a, b) // [a, b) 
#define IN(v, lo, hi) ((lo)<=(v) && (v)<(hi))
#define DD(v) cout<<#v<<": "<<v<<endl
#define FI first
#define SE second
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const map<T0, T1>& v) { for( typename map<T0, T1>::const_iterator p = v.begin(); p!=v.end(); p++ ){os << p->first << ": " << p->second << " ";} return os; }
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const pair<T0, T1>& v) { os << v.first << ": " << v.second << " "; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << " "; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const set<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const deque<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<vector<T> >& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << endl; } return os; }
template<typename T>void maxUpdate(T& a, T b) {a = max(a, b);}
template<typename T>void minUpdate(T& a, T b) {a = min(a, b);}

#define MOD 1000000007LL
#define INF (1LL<<60)

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll H,A;
	while(cin>>H>>A) {
		ll ans = (H+A-1)/A;
		cout<<ans<<endl;
	}
	
	return 0;
}


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

int main(){
    int l;
    cin>>l;
    int n=l/3;
    if((l-n*3)==0){
	    cout<<n*n*n<<".000000000000"<<endl;
	    return 0;
	}
    long double ans;
    if((l-n*3)==1){
	    ans=(n+0.333)*(n+0.333)*(n+0.334);
	}
	if((l-n*3)==2){
	    ans=(n+0.666)*(n+0.667)*(n+0.667);
	}
    cout.setf(ios::fixed);
    cout<<ans<<"000000"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    int a,b;
    scanf("%d",&a);
    scanf("%d",&b);
    if (a<=9 && b<=9)
    {
        printf("%d\n",a*b);
    }
    else
    {
        printf("-1\n");
    }
    return 0;
}

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

int main() {
  int A, B;
  cin >> A >> B;
  
  for(int i=1; i<=1250; i++){
    if((int)(i*0.08) == A && (int)(i*0.1) == B){
     cout << i << endl; 
     return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}

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

typedef long long ll;
#define RE register
#define clear(a) memset(a,0,sizeof a)

inline int read(){
    int date=0,w=1;char c=0;
    while(c<'0'||c>'9'){if(c=='-')w=-1;c=getchar();}
    while(c>='0'&&c<='9'){date=date*10+c-'0';c=getchar();}
    return date*w;
}

void chkmin(int &x,int y){
	x=min(x,y);
}
void chkmax(int &x,int y){
	x=max(x,y);
}
const int N=100000;

int n,m ,head[N],nxt[N],ver[N],tot=1,num,ans,e[N],dfn[N],low[N];
void add(int x,int y){
	ver[++tot]=y;nxt[tot]=head[x];head[x]=tot; 
} 
void tarjan(int x,int fa){
	dfn[x]=low[x]=++num;
	for(int i=head[x];i;i=nxt[i]){
		int y=ver[i];
		if(y==fa)continue;
		if(!dfn[y]){
			tarjan(y,x);
			chkmin(low[x],low[y]); 
			if(dfn[x]<low[y]){
				e[i]=e[i^1]=1; 
				//cout<<"OK"<<endl;
			} 
		} else{
			chkmin(low[x],dfn[y]);
		}
	}
}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin>>n>>m;
    for(int i=1;i<=m;++i){
    	int x,y;
    	cin>>x>>y;
    	add(x,y);
    	add(y,x);
	}
	for(int i=1;i<=n;++i){
		if(!dfn[i])tarjan(i,0);
		//cout<<dfn[i]<<"  "<<low[i]<<"WWWWW"<<endl;
	}
	for(int i=2;i<=tot;i+=2){
		if(e[i])ans++; 
	} 
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  long freq[n+1];
  int arr[n+1];
  for(int i=1;i<=n;i++)
    freq[i]=0;
  for(int i=1;i<=n;i++)
  {
    int x;
    cin>>x;
    arr[i]=x;
    freq[x]++;
  }
  long sum=0;
  for(int i=1;i<=n;i++)
  {
    if(freq[i]<2)
      continue;
    sum+=(freq[i]*(freq[i]-1))/2;
  }
  for(int i=1;i<=n;i++)
  {
    if(freq[arr[i]]<2)
      cout<<sum<<endl;
    else
    {
      long ans=sum-(freq[arr[i]]*(freq[arr[i]]-1))/2+((freq[arr[i]]-1)*(freq[arr[i]]-2))/2;
      cout<<ans<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 4992
#include<stdio.h>
#include<math.h>
int main(void)
{
    int a[10] = {0},b[10] = {0};
    int x,i;
    int ans;
    while(scanf("%d",&x) != EOF){
        for(i = 9; i >= 0; i--){
            if(x - pow(2,i) >= 0){
                a[i] = 1;
                x -= pow(2,i);
            }
        }
        x = 0;
        for(i = 0; i < 10; i++){
            if(a[i] == 1){
                b[x] = pow(2,i);
                x++;
            }
        }
        for(i = 0; i < x-1; i++){
            printf("%d ",b[i]);
        }
        printf("%d\n",b[x-1]);
        for(i = 0; i < 10; i++){
            a[i] = 0;
            b[i] = 0;
        }
    }

    return 0;
}

Measured memory_bytes: 636
/*
17D8101013F 森田　匡博
ID:key4 使用言語:C++
*/

#include <iostream>
#include <cmath>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>

int main()
{
  int n, q;

  std::cin >> n >> q;
  std::vector<int> t;
  std::string str[n];
  int p[n];
  int cnt;
  //std::vector<int> num;

  cnt = 0;

  for(int i = 0; i < n; i++) {
    std::cin >> str[i] >> p[i];
    t.push_back(p[i]);
  }

  std::queue<int> que;

  for(int i = 0; i < n; i++) {
    que.push(i);
  }

  int j = 0;
  int minus = 0;
  
  while(!que.empty()) {
    j = que.front();
    que.pop();
    if(t[j] > q) {
      t[j] = t[j] - q;
      cnt += q;
      que.push(j);
    }
    else if(t[j] > 0) {
      cnt += t[j];
      t[j] = 0;
      std::cout << str[j] << " " << cnt << std::endl;
    }
  }

  /*
  std::sort(num.begin(), num.end(), [&cnt](size_t i1, size_t i2) {
      return cnt[i1] < cnt[i2];
    });
  std::sort(cnt.begin(), cnt.end());

  for(int i = 0; i < n; i++) {
    std::cout << str[num[i]] << " " << cnt[i] << "\n";
  }
  */

  return 0;
}


Measured memory_bytes: 6196
#include <stdio.h>

int main(void){
    
    int testCases[10001] = {0};
    int testNum = 0;

    for(int i = 0;i < 10001 ; i++){
        scanf("%d",&testCases[i]);
        if(testCases[i] == 0){
            break;
        }
        testNum++;
    }
    
    for(int i = 0 ; i < testNum ; i++){
        printf("Case %d: %d\n",(i+1),testCases[i]);
    }
    return 0;
}

Measured memory_bytes: 1076
using System;
using System.Collections.Generic;
using System.IO.Pipes;
using System.Linq;
using System.Numerics;
using System.Text.RegularExpressions;
using System.Threading;

namespace Atcoder
{
	class Program
	{
		//string s = Console.ReadLine();
		//int[] intArray = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
		//int H = intArray[0];
		//int W = intArray[1];
		//int N = int.Parse(Console.ReadLine());
		//List<int> A = new List<int>(Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray());
		//Boolean ok = false;

		//Console.WriteLine(ans);
		//Console.WriteLine("Yes");
		//Console.WriteLine("No");
		//Console.ReadKey();
		//Console.WriteLine(cnt);

		//string[] strArray = Console.ReadLine().Split(' ').ToArray();
		//string S = strArray[0];
		//string T = strArray[1];
		static void Main(string[] args)
		{
			int N = int.Parse(Console.ReadLine());
			string S = Console.ReadLine();
			if(N % 2 != 0)
            {
				Console.WriteLine("No");
				return;
			}
			int len = S.Length;
			string L = S.Substring(0, len / 2);
			string R = S.Substring(len / 2);
			if(L == R)
				Console.WriteLine("Yes");
			else
				Console.WriteLine("No");


		}

		/// <summary>
		/// 回文
		/// </summary>
		/// <param name="Target"></param>
		/// <param name="len"></param>
		/// <returns></returns>
		static bool Palindrome(string Target , int len)
        {
			bool yes = true;

			for(int i = 0;i < len; i++)
            {
				if(Target[i] != Target[len - 1 - i])
                {
					yes = false;
					break;
                }
            }
			return yes;
        }

		/// <summary>
		/// アナグラム
		/// </summary>
		/// <param name="word1"></param>
		/// <param name="word2"></param>
		/// <returns></returns>
		static bool IsAnagramOf(string word1, string word2)
		{
			return word1.OrderBy(x => x).SequenceEqual(word2.OrderBy(x => x));
		}
		/// <summary>
		/// 最小公倍数
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <returns></returns>
		public static BigInteger Lcm(BigInteger a, BigInteger b)
		{
			return a * b / Gcd(a, b);
		}

		/// <summary>
		/// 最大公約数
		/// </summary>
		/// <param name="a"></param>
		/// <param name="b"></param>
		/// <returns></returns>
		public static BigInteger Gcd(BigInteger a, BigInteger b)
		{
			if (a < b)
				// 引数を入替えて自分を呼び出す
				return Gcd(b, a);
			while (b != 0)
			{
				var remainder = a % b;
				a = b;
				b = remainder;
			}
			return a;
		}
	}
}

Measured memory_bytes: 27528
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	long long s = 0, i, n,a[200000];
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	for (i = 1; i < n; i++)
	{
		if (a[i] < a[i - 1])
		{
			s += a[i - 1] - a[i];
			a[i] = a[i - 1];
		}
	}
	cout << s;
}

Measured memory_bytes: 5196
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 210000;
long long fact[C_SIZE];
long long finv[C_SIZE];
long long inv[C_SIZE];
long long C(int a,int b){
	if(a<b||b<0)return 0;
	return fact[a]*finv[b]%mod*finv[a-b]%mod;
}
void init_C(int n){
	fact[0]=finv[0]=inv[1]=1;
	for(int i=2;i<n;i++){
		inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
	}
	for(int i=1;i<n;i++){
		fact[i]=fact[i-1]*i%mod;
		finv[i]=finv[i-1]*inv[i]%mod;
	}
}
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
double ABS(double a){return max(a,-a);}
// ここから編集しろ
int p[210000];
long long dp[210000][5];
int main(){
	int a;scanf("%d",&a);
	for(int i=0;i<a;i++)scanf("%d",p+i);
	for(int i=0;i<210000;i++)for(int j=0;j<5;j++)dp[i][j]=inf;
	dp[0][0]=0;
	for(int i=0;i<a;i++){
		for(int j=0;j<5;j++){
			if(dp[i][j]==inf)continue;
			if(j<4)dp[i][j+1]=min(dp[i][j+1],dp[i][j]);
			if(j==0||j==4)dp[i+1][j]=min(dp[i+1][j],dp[i][j]+p[i]);
			if(j==1||j==3)dp[i+1][j]=min(dp[i+1][j],dp[i][j]+(p[i]==0?2:p[i]%2));
			if(j==2)dp[i+1][j]=min(dp[i+1][j],dp[i][j]+(p[i]+1)%2);
		}
	}
	long long ret=inf;
	for(int i=0;i<5;i++)ret=min(ret,dp[a][i]);
	printf("%lld\n",ret);
}

Measured memory_bytes: 10368
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> Pii;

string S;
const int MOD = 2019;

ll pow_mod(ll n, ll k, ll mod) {
    if (k == 0) return 1;
    else if (k % 2 == 1) {
        return pow_mod(n, k-1, mod) * n % mod;
    }
    else {
        ll tmp = pow_mod(n, k/2, mod);
        return tmp * tmp % mod;
    }
}

int main() {
    cin >> S;
    int N = S.length();

    ll dp[N+1];
    dp[0] = 0;
    dp[1] = S[N-1] - '0';
    for (int i = 2; i <= N; i++) {
        dp[i] = (dp[i-1] + pow_mod(10, i-1, MOD) * (S[N-i] - '0') % MOD) % MOD;
    }

    map<ll, ll> mp;
    for (int i = 0; i <= N; i++) {
        mp[dp[i]]++;
    }

    ll ans = 0;
    for (auto itr = mp.begin(); itr != mp.end(); itr++) {
        ll val = itr->second;
        ans += (val - 1) * val / 2;
    }

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


Measured memory_bytes: 5276
#include<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vll=vector<ll>;
using vvll=vector<vll>;


int main(void)
{
	int a;
	char s[10+2];

	while(scanf("%d\n%10s\n", &a, s)==2)
	{
		const char *ans="red";

		if(a>=3200) ans=s;
		printf("%s\n", ans);
	}
	return 0;
}


Measured memory_bytes: 128
Wg, Hg, n = map(int, input().split())
Ws, Hs = 0, 0

for i in range(n):
  x, y, a = map(int, input().split())
  if a == 1 and Ws < x:
    Ws = x
  elif a == 2 and Wg > x:
    Wg = x
  elif a == 3 and Hs < y:
    Hs = y
  elif a == 4 and Hg > y:
    Hg = y
    
  if Ws > Wg or Hs > Hg:
    break
    
ans = (Wg - Ws) * (Hg - Hs)
if ans <= 0:
  print("0")
else:
  print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define rep(N) for (int i = 0; i < N; ++i)
#define Rep(a, b) for (int i = a; i < b; ++i)
#define For(i, N) for (int i = 0; i < N; ++i)
#define all(v) v.begin(), v.end()
#define rev(v) v.rbegin(), v.rend()
#define makei(N) int N; cin >> N;
#define makel(N) ll N; cin >> N;
#define makes(s) string s; cin >> s;
#define maked(d) double d; cin >> d;
#define makev(v, N) vi v(N); rep(N)cin >> v[i];
#define mod 1000000007
#define distance(x1,y1,x2,y2) sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));

using namespace std;
using ll = long long int;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using msi = map<string, int>;

template<typename T>
void say(T s) {
	cout << s << "\n";
}

template<typename T>
void say(vector<T> s) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << " " << *(itr++);
	}
	cout << "\n";
}

void yn(bool b) {
	if (b)say("yes");
	else say("no");
}

void Yn(bool b) {
	if (b)say("Yes");
	else say("No");
}

void YN(bool b) {
	if (b)say("YES");
	else say("NO");
}

template<typename T>
void maxi(T& a, T b) {
	a = max(a, b);
}

template<typename T>
void mini(T& a, T b) {
	a = min(a, b);
}

void exact_say(double x) {
	cout << setprecision(numeric_limits<double>::max_digits10) << x << endl;
}

template<class T> void getVector(vector<T>& v) {
	for (int i = 0; i < v.size(); ++i)
		cin >> v[i];
}

int main() {
	int a, b, c;
	int ans = 0;
	cin >> a >> b >> c;
	for (int i = a; i <= b; ++i) {
		if (c % i == 0)ans++;
	}
	say(ans);
}


Measured memory_bytes: 3112
{-# LANGUAGE OverloadedStrings #-}
module Main where

import           Data.List
import           Control.Monad
import           Debug.Trace
import qualified Data.ByteString.Char8         as BC
import           Data.Maybe                     ( fromJust )
import qualified Data.Set                      as S
import qualified Data.IntMap.Strict            as IM
import qualified Data.Map.Strict               as M
import           Data.Char
import Data.Bits


readTuple2 :: IO (Int, Int)
readTuple2 = do
    [a, b] <- map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
    return (a, b)

readTuple3 :: IO (Int, Int, Int)
readTuple3 = do
    [a, b, c] <- map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
    return (a, b, c)

readInt :: IO Int
readInt = fst . fromJust . BC.readInt <$> BC.getLine

readInts :: IO [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

split :: (a -> Bool) -> [a] -> [[a]]
split f [] = []
split f as =
    let (fo, la) = span f as
        las      = case la of
            [] -> []
            xs -> split f $ tail xs
    in  case fo of
            [] -> las
            xs -> xs : las



solve :: Int -> [[(Int, Int)]] -> Int
solve n testifies =  let
    possibilities = replicateM n [True, False]
    isTestifyTrue possible = and $ do
        (saidMan, oneTestifySet) <- zip [1..]  testifies
        if not $ possible IM.! saidMan then pure True
        else do
            (targetMan, kindOrNot) <- oneTestifySet 
            if possible IM.! targetMan then pure $ kindOrNot == 1 else
                pure $ kindOrNot == 0

    countTrue possible = length $ filter id possible
    in
    maximum $ (\p -> if isTestifyTrue (IM.fromList $ zip [1..] p) then countTrue p else -1) <$> possibilities
main = do
    n <- readInt
    testifies <- replicateM n $ do
        i <- readInt
        replicateM i readTuple2
    print $ solve n testifies






Measured memory_bytes: 3964
#include <stdio.h>
int main(){
  int a[100][100]={0},b[101][101]={0};
  int i,j,r,c;
  scanf("%d %d",&r,&c);
  for(i=0;i<r;i++){
    for(j=0;j<c;j++){
      scanf("%d",&a[i][j]);
      b[i][j]=a[i][j];
    }
  }
  for(i=0;i<r;i++){
    for(j=0;j<c;j++)
      b[i][c]+=a[i][j];
  }
  for(i=0;i<=c;i++){
    for(j=0;j<r;j++)
      b[r][i]+=b[j][i];
  }
  for(i=0;i<=r;i++){
    for(j=0;j<c;j++)
      printf("%d ",b[i][j]);
    printf("%d\n",b[i][j]);
  }
  return 0;
}



Measured memory_bytes: 2040
N, K = map(int, input().split())
A = sorted([int(a) for a in input().split()])

X = [0] * 45
for i in range(N):
    b = bin((1<<45)+A[i])
    # print(b)
    for j in range(45):
        if b[-j-1] == "1":
            X[j] += 1

# print(X)
ans = 0
for i in range(45):
    if 1<<i > K:
        break
    ans += max(X[i], N - X[i]) << i
    
def intlog2(n):
    if n <= 0:
        return -1
    i = 0
    while 2**i <= n:
        i += 1
    return i-1
def calc(k, t):
    # print(k, t)
    if t<0:
        return 0
    if k == 0 or intlog2(k) < t:
        return X[t] * (2**t) + calc(k, t-1)
        
    a = k+1
    while a%2==0:
        a//=2
    if a == 1:
        ret = 0
        for i in range(45):
            if 1<<i > k:
                break
            ret += max(X[i], N - X[i]) << i
            # print(max(X[i], N - X[i]) << i, "=>", ret)
        return ret
    else:
        ll = intlog2(k)
        kk = 2**ll
        ret = kk * X[ll] + calc(kk-1, t-1)
        if X[ll] < N - X[ll]:
            ret2 = kk * (N - X[ll]) + calc(k-kk, t-1)
            ret = max(ret, ret2)
            
        return ret
        
if K == 0:
    print(sum(A))
else:
    print(calc(K, 44))


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

#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define RFOR(i, a, b) for(int i=(a); i>=(b); i--)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) RFOR(i, n, 0)
#define dump(x)  cout << #x << " = " << (x) << endl;

typedef long long ll;
typedef pair<int, int> ii;
const ll INF = 1e18;
const int inf = 1e8;

const string YES = "Yes";
const string NO = "No";

void solve()
{
  ll A;
  scanf("%lld",&A);
  ll B;
  scanf("%lld",&B);
  ll C;
  scanf("%lld",&C);
  if (C<=A+B) cout << YES << endl;
  else cout << NO << endl;
}

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


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

#define ll long long

#define fr(i,a,b) for (ll i = (a), _b = (b); i <= _b; i++)
#define frr(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define rep(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i,n) for (ll i = n - 1; i >= 0; i--)
#define fill(ar,val) memset(ar, val, sizeof(ar))
#define fill0(ar) fill((ar), 0)
#define debug(x) cout<<#x<<": "<<x<<endl

#define ld long double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef vector<ii> vii;
typedef vector<int> vi;

#define INF 1000000000000000000
#define PI 3.14159265358979323846L

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

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

    if(b%a==0)
    	cout << a+b << endl;
    else
    	cout << b-a << endl;
}


Measured memory_bytes: 256
import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
        int A = stdIn.nextInt();
	int B = stdIn.nextInt();
	int C = stdIn.nextInt();
	if((A==B&&A==C)||(A!=B&&A!=C&&B!=C)){
	    System.out.println("No");
	}else{
	    System.out.println("Yes");
	}
    }
}


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

const int mod = 1e9 + 7;
int dp[2001];
int s;

int solve(int n) {
	int ret = 0;

	if (n == 0)
	{
		return 1;
	}
	if (dp[n] != -1)
	{
		return dp[n];
	}

	for (int i = 3; i <= n; i++)
	{
		ret += solve(n - i);
		ret %= mod;
	}

	return dp[n] = ret;
}

int main() {
	memset(dp, -1, sizeof(dp));

	cin >> s;

	cout << solve(s) << endl;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }
template<typename T>
bool isin(T y, T x, T h, T w) { return (0 <= y && 0 <= x && y < h && x < w); }
template<typename T>
bool isin1(T y, T x, T h, T w) { return (0 < y && 0 < x && y <= h && x <= w); }

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

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u; return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	string S; cin >> S;
	int N = S.size() + 1;
	int minv = INF;
	int cnt = 0;
	queue<int> que;
	vint a(N, -1);

	for (int i = 0; i < S.size()-1; i++) {
		if (S[i] == '>' && S[i+1] == '<') {
			a[i+1] = 0;
			que.push(i+1);
		}
	}
	if (S[0] == '<') { que.push(0);	a[0] = 0; }
	if (S[S.size()-1] == '>') { que.push(N-1); a[N-1] = 0; }
	ll sum = 0;
	while (!que.empty()) {
		int x = que.front(); que.pop();
		if (x > 0 && S[x-1] == '>' && a[x-1] < a[x] + 1) {
			a[x-1] = a[x] + 1;
			que.push(x-1);
		}
		if (x < N-1 && S[x] == '<' && a[x+1] < a[x] + 1) {
			a[x+1] = a[x] + 1;
			que.push(x+1);
		}
	}
	cout << accumulate(begin(a), end(a), 0ll) << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout << fixed << setprecision(20);
	Main();
	return (0);
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
    int H,W;
    cin>>H>>W;
    vector<string> map(H,"");
    vector<int> era;
    REP(i,H)cin>>map[i];
    for(int i=H-1;i>=0;i--){
        if(map[i].find("#")==string::npos)map.erase(map.begin()+i);
    }
    REP(i,W){
        bool is=false;
        REP(y,map.size())if(map[y][i]=='#')is=true;
        if(!is)era.push_back(i);
    }
    REP(i,map.size()){
        REP(y,W){
            if(find(era.begin(),era.end(),y)==era.end())cout<<map[i][y];
        }
        cout<<endl;
    }
}

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

using namespace std;

int main() {
    string s;
    cin >> s;
    int price = 700;
    for(int i = 0; i < 3; i++){
        if(s[i] == 'o') {
            price += 100;
        }
    }
    cout << price;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
using namespace std;

string input;
queue<char> q,q2;
vector<int> pool;

//?°´???????????????????????°???
int f() {

	while(true) {
		if(q.empty()) return 0;
		if(q.front() == '\\') break;
		q.pop();
	}

	int h = 0,oldh = 0,res = 0;
	while(!q2.empty()) q2.pop();
	while(true) {
		char c = q.front();
		h += (c == '\\');
		h -= (c == '/');

		res += h + oldh;

		if(h == 0) {
			break;
		}

		q2.push(c);
		q.pop();
		if(q.empty()) {
			q2.pop();
			q = q2;
			return f();
		}

		oldh = h;
	}
	return res;
}

int main() {
	cin >> input;
	for(int i = 0;i < input.size();i++) q.push(input[i]);
	int n = f() / 2;
	while(n != 0) {
		pool.push_back(n);
		n = f() / 2;
	}

	int total = 0;
	for(int i = 0;i < pool.size();i++) total += pool[i];

	cout << total << endl;
	cout << pool.size();
	for(int i = 0;i < pool.size();i++) cout << " " << pool[i];
	cout << endl;
}

Measured memory_bytes: 1292
#include <bits/stdc++.h>
#include <stdlib.h>
#include <time.h> 
 
using namespace std;
long long mod = 1e9 + 7;
long long INF = 1e7;
double EPS = 1e-12;
typedef long long int lld;
long double tick(){static clock_t oldt; clock_t newt=clock();
    long double diff=1.0L*(newt-oldt)/CLOCKS_PER_SEC; oldt = newt; return diff; }
#define rep(i,a,n) for(long long int i = (a); i <= (n); ++i)
#define repI(i,a,n) for(int i = (a); i <= (n); ++i)
#define repD(i,a,n) for(long long int i = (a); i >= (n); --i)
#define repDI(i,a,n) for(int i = (a); i >= (n); --i)
inline lld sc() { lld a; scanf("%lld", &a); return a; }
inline int scd() { int a; scanf("%d", &a); return a; }
inline double scf() { double a; scanf("%lf",&a); return a; }
#define prL(a) printf("%lld\n",a)
#define prS(a) printf("%lld ",a)
#define prdL(a) printf("%d\n",a)
#define prdS(a) printf("%d ",a)
#define all(c) (c).begin(), (c).end()
#define sz(a) ((int)a.size())
#define Error(x...) { cout << "(" << #x << ")" << " = ( "; printIt(x); }
template <typename T1> void printIt(T1 t1) { cout << t1 << " )" << endl; }
template <typename T1, typename... T2>
void printIt(T1 t1, T2... t2) { cout << t1 << " , "; printIt(t2...); }
#define errorpair(a) cout<<#a<<" = ( "<<((a).first)<<" , "<<((a).second)<<" )\n";
#define mset(a, v) memset(a, v, sizeof(a))
#define popcount __builtin_popcountll

typedef pair<lld,lld> PA;

lld powP(lld x, lld y) {
    lld ans = 1, po = x % mod;
    while(y > 0) {
        if(y & 1) ans = ans * po % mod;
        y >>= 1; po = po * po % mod;
    }
    return ans;
}
 
bool bitSet(lld n, lld bit){
    if((n & (1LL << bit)) != 0) return true;
    else return false;
}
 
lld findGcd(lld a, lld b){
    while(a != 0) { lld temp = b % a; b = a; a = temp; }
    return b;
}

#define lim 300010
#define lim2 200010
#define qqqqqq 210
// Ab :)
// inline lld sqr(lld x) { return x * x; }
// unordered_map<lld,lld>::iterator it;
// std::ios::sync_with_stdio(false);
// priority_queue<PA> Q;
// lld dp[1<<18];

// vector<lld> G[lim];
// string S[lim];
// lld A[lim];

int main(){
    int k = scd();
    string S;
    cin >> S;
    cout << S.substr(0, k);
    if(S.size() > k) printf("...");
    return 0;
}


Measured memory_bytes: 3760
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		
		for (int i = 0; i < 100 ;i++) {
			c = c - b;
			if (c <= 0) {
				System.out.println("Yes");
				break;
			}
			a = a - d;
			if (a <= 0) {
				System.out.println("No");
				break;
			}
		}
	}
}

Measured memory_bytes: 35792
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<iostream>
# define ll int64_t
# define rep(i,n) for(ll i=0;i<n;i++)
# define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007
# define vec vector
#define dump(x) cerr<<#x<<"="<<x<<endl
using namespace std;

bool compare_by_b(pair<string,ll> a,pair<string,ll> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

bool my_compare(pair<string,ll> a,pair<string,ll> b){
    
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

ll factorial(ll n){
    ll x=1;
    rrep(i,n) (x*=i)%=mod;
    return x;
}

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

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

//累乗だってさ
ll modpow(ll a,ll n,ll mod1) {
    ll res=1;
    while(n>0){
        if(n&1) res=res*a%mod1;
        a = a*a%mod1;
        n >>= 1;
    }
    return res;
}
//逆元だってさ
ll modinv(ll a,ll mod1) {
    return modpow(a, mod1 - 2, mod1);
}


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n;
    string ans="";
    vec<ll> mini(26,10000000);
    cin>>n;
    rep(i,n){
        string a;
        cin>>a;
        vec<ll> b(26,0);
        rep(j,a.size()) b[(ll)(a.at(j)-'a')]++;
        rep(i,26) mini[i]=min(mini[i],b[i]);
    }
    rep(i,26){
        while(mini[i]>0){
            ans+=(char)(i+'a');
            mini[i]--;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define ALL(v) (v).begin(),(v).end()
#define Vi vector<int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>b;i--)
#define leng(n) (int)(log10(n)+1)
#define INF 9000000000000000000
using namespace std;

int gcd(int a,int b){return b?gcd(b,a%b):a;}  //  最大公約数gcd
int lcm(int a,int b){return a/gcd(a,b)*b;}  //  最小公倍数lcm

signed main() {
  int n,m;
  cin >> n >> m;
  vector<pair<int,int>> work(n+1);
  int a,b;
  rep(i,0,n){
    cin >> a >> b;
    work[i] = make_pair(a-1,b);
  } 
  work[n] = make_pair(INF,0);
  sort(ALL(work));
  reverse(ALL(work));
  
  priority_queue<int> mon;
  int ans = 0;
  int now = work[work.size()-1].first;
  rep(i,0,m){
    
    while(now == i){
      mon.push(work[work.size()-1].second);
      work.pop_back();
      now = work[work.size()-1].first;
    }
    
    if(!mon.empty()) {
      ans += mon.top();
      mon.pop();
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 2936
#include<iostream>
int main()
{
    std::string tin,comp="";
    int i=0;
    std::cin>>tin;
    while(i<tin.length()){
        switch (tin[i])
        {
        case 'e':
            if(i+6>tin.length()){
                comp+="erase";i+=5;break;
            }
            if(tin.substr(i,6)=="eraser"&&tin.substr(i+6,5)=="erase"||tin.substr(i+6,5)=="dream"||tin[i+6]=='\0'){
                comp+="eraser";
                i+=6;
            }else{
                comp+="erase";
                i+=5;
            }
            continue;
        case 'd':
            if(i+7>tin.length()){
                comp+="dream";i+=5;break;
            }
            if(tin.substr(i,7)=="dreamer"&&tin.substr(i+7,5)=="erase"||tin.substr(i+7,5)=="dream"||tin[i+7]=='\0'){
                comp+="dreamer";
                i+=7;
            }else{
                comp+="dream";
                i+=5;
            }
            continue;
        default:
            std::cout<<"NO";
            return 0;
        }
    }
    if(tin==comp){
        std::cout<<"YES";
    }else{
        std::cout<<"NO";
    }
    return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<vector>

using namespace std;

int main()
{
	const string alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
	int n;
	while (cin >> n && n != 0)
	{
		vector<int> keys;
		for (int i = 0; i < n; i++)
		{
			int k;
			cin >> k;
			keys.push_back(k);
		}

		char ch[101];
		cin >> ch;
		string crypt = ch;
		vector<char> encrypt;
		for (int i = 0; i < crypt.length(); i++)
		{
			int alphaIndex = alpha.find(crypt.at(i));
			int keyIndex = keys.at(i % keys.size());
			encrypt.push_back(alpha.at((alphaIndex + (alpha.length() - keyIndex)) % alpha.length()));
		}

		for (int i = 0; i < encrypt.size();i++)
		{
			cout << encrypt.at(i);
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1232
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>

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

ll N;
int main(){
  cin >> N;
  ll h=0, n=0, w=0;
  ll x = 3*N/4;
  for(ll i = 1; i <= x+1; i++){
    for(ll j = i; j <= 3500; j++){
      ll x2 = 4*i*j - N*i - N*j;
      if (x2 <= 0) continue;
      ll kk = N*i*j / x2;
      if (kk >= 3500) continue;
      for(ll k = kk; k <= kk+1; k++){
        ll xx = 4*i*j*k;
        ll yy = N*(i*j+j*k+k*i);
        if(xx == yy){
          h = i; n = j; w = k;
          i = x*2; j = 4000; k = 4000;
        }
      }
    }
  }
  cout << h << " " << n << " " << w << endl;

  return 0;
}


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

using namespace std;

int main() {
	string S,T;
	cin >> S >> T;
	int ans = 0;
	for (int n = 0;n<S.size(); ++n) {
		if (S[n] != T[n]) {
			++ans;
		}
	}
	cout << ans <<endl;
	return 0;
}

Measured memory_bytes: 3916
#include<iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <queue>
#include <stack>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	long long n,x,t;
	scanf("%lld%lld%lld",&n,&x,&t);
	if(n%x==0)
	{
		printf("%lld",n/x*t);
	}
	else
	{
		printf("%lld",(n/x +1)*t);
	}
	return 0;
}

Measured memory_bytes: 3808
#include<bits/stdc++.h>
#define LL long long
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define PII pair<int,int>
#define PLI pair<long long, int>
#define PLL pair<long long, long long>
#define PDD pair<double, double>
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define INFLL ((LL)1e18)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
#define BIT(x) (1 << (x))
using namespace std;

LL modinv(LL a){
    LL b = MOD, u = 1, v = 0;
    while(b){
        LL t = a / b;
        a -= t * b;swap(a, b);
        u -= t * v;swap(u, v);
    }
    u%=MOD;
    if(u < 0) u += MOD;
    return u;

}

LL exp(LL a, LL b){
    LL res = 1;
    LL sum = a;
    while(b){
        if(b&1)res = (res * sum);
        sum = (sum * sum);
        b>>=1;
    }
    return res;
}

double exp(double a, LL b){
    double res = 1;
    double sum = a;
    while(b){
        if(b&1)res = (res * sum);
        sum = (sum * sum);
        b>>=1;
    }
    return res;
}

signed  main(){
    int N;
    cin >> N;
    vector<PII> line(N);
    for(auto &i:line)cin>>i.second>>i.first;
    sort(ALL(line));
    int sum = 0;
    for(auto &i:line){
        sum+=i.second;
        if(sum>i.first){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}



Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fi first
#define se second
int main(){
	ll n; cin>>n;
	bool a=0;
	for(ll i=1;i<=9;i++){
		if(n%i==0 and n/i<10) a=1;
	}
	if(a) cout<<"Yes"; else cout<<"No";
}


Measured memory_bytes: 3624