akhauriyash/Code-Regression huggingface dataset:
// Aizu Vol-1 0110: Alphametic
// 2017.8.4

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

char *gets(char *buf);
char buf[500], *p;

char a[10][150], b[10][150], s[10][150], *pa, *pb, *ps;

int main()
{
	int i;
	int la, lb, ls, aa, bb, ss;
	int sum, ca, zero;

	while (gets(p = buf) != NULL) {
		zero = 0, la = lb = ls = 0;
//		while (isspace(*p)) p++;
		if (*p == 'X' && isdigit(*(p + 1))) {
			zero = 1;
			for (i = 1; i < 10; i++) a[i][la] = i;
			la++, p++;
		}
		while (isdigit(*p) || *p == 'X') {
			if (*p == 'X') for (i = 0; i < 10; i++) a[i][la] = i;
			else for (i = 0; i < 10; i++) a[i][la] = *p - '0';
			la++, p++;
		}
		if (*p++ != '+') while (1);

		if (*p == 'X' && isdigit(*(p + 1))) {
			zero = 1;
			for (i = 1; i < 10; i++) b[i][lb] = i;
			lb++, p++;
		}
		while (isdigit(*p) || *p == 'X') {
			if (*p == 'X') for (i = 0; i < 10; i++) b[i][lb] = i;
			else for (i = 0; i < 10; i++) b[i][lb] = *p - '0';
			lb++, p++;
		}
		if (*p++ != '=') while (1);
		
		if (*p == 'X' && isdigit(*(p + 1))) {
			zero = 1;
			for (i = 1; i < 10; i++) s[i][ls] = i;
			ls++, p++;
		}
		while (isdigit(*p) || *p == 'X') {
			if (*p == 'X') for (i = 0; i < 10; i++) s[i][ls] = i;
			else for (i = 0; i < 10; i++) s[i][ls] = *p - '0';
			ls++, p++;
		}

		for (i = zero, aa = la, bb = lb, ss = ls; i < 10; i++, la = aa, lb = bb, ls = ss) {
			pa = a[i] + la - 1;
			pb = b[i] + lb - 1;
			ps = s[i] + ls - 1, ca = 0;

			while (la > 0 || lb > 0) {
				sum = ca;
				if (la > 0) sum += (*pa--), la--;
				if (lb > 0) sum += (*pb--), lb--;
				if (sum >= 10) ca = 1, sum -= 10;
				else ca = 0;
				if (ls <= 0 || *ps != sum) goto NEXT;
				ps--, ls--;
			}
			if (ca > 0) {
				if (*ps != ca) goto NEXT;
				ps--, ls--;
			}
			if (ls == 0) { putchar(i + '0'), putchar('\n'); goto DONE; }
		NEXT:;
		}
		puts("NA"); continue;
	DONE:;
	}
	return 0;
}

Measured memory_bytes: 524
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1e9+7;
int main(){
 
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 
    ll n,k;
    cin >> n >> k;

    ll ans = 0;

    for(ll i=k;i<=n+1;++i){
    	ll n1 = (n*(i))%mod;
    	ll n2 = (i*(i-1))%mod;
    	ll temp = n1-n2 + 1;
    	//ans = ans +  + mod;
    	//cout << temp << " ";
    	ans = (ans+temp)%mod;
    }

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

Measured memory_bytes: 3652
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define mod 1000000007
typedef long long ll;
using namespace std;

int main(){
  int A,B;
  cin >> A >> B;
  cout << ((A+B<10)? to_string(A+B) : "error") << endl;
  return 0;
}


Measured memory_bytes: 256
N = int(input())
SS = [i  for i in input()]

L = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
LL = [i for i in range(1, 26)]
ZZ = {}
YY = {}
for i, j in zip(L,LL) :
        ZZ[j] = i
        YY[i] = j
ZZ[0] = "Z"
YY["Z"] = 0

XX = [YY[i]+N for i in SS]
WW = [ZZ[i%26] for i in XX]
print("".join(WW))

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

#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n, a, b;
  cin >> n >> a >> b;
  if ((b - a) % 2 == 0) {
    cout << (b - a) / 2;
  } else {
    cout << min({n - a, b - 1, a + (b - a) / 2, n - b + (b - a + 1) / 2});
  }
  return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define de7k_gamed ios_base::sync_with_stdio(false);cin.tie(NULL);//freopen("out.txt","w",stdout);

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


int main()
{
    de7k_gamed

    string s,t;
    cin>>s>>t;
    ll dp[s.size()+1][t.size()+1]={};

    for (ll i=0;i<s.size();i++)
        for(ll j=0;j<t.size();j++)
        {
            if (s[i]==t[j])
            {
                if (i==0 || j==0)
                    dp[i][j]=1;
                else
                    dp[i][j]=dp[i-1][j-1]+1;
            }
            else
            {
                if (i==0 && j!=0)
                    dp[i][j]=dp[i][j-1];
                else if (i!=0 && j==0)
                    dp[i][j]=dp[i-1][j];
                else if (i!=0 && j!=0)
                    dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
            }
        }
    string ans="";
    ll i=s.size()-1,j=t.size()-1;
    while (i>=0 && j>=0 && dp[i][j]>0)
    {
        if (i>0 && dp[i][j]==dp[i-1][j])
            i--;
        else if (j>0 && dp[i][j]==dp[i][j-1])
            j--;
        else
            ans=s[i]+ans,i--,j--;
    }
    cout<<ans<<'\n';
    return 0;
}


Measured memory_bytes: 73880
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int[] array = new int[123];
		int count=0;
		for(int i=0;i<S.length();i++) {
			array[S.charAt(i)]++;
		}

		for(int i=97;i<123;i++) {
			if(array[i]!=0) {
				count++;
			}
			if(count==26) {
				System.out.println("None");
				System.exit(0);
			}
		}
		for(int i=97;i<123;i++) {
			if(array[i]==0) {
				System.out.println(Character.toChars(i));
				break;
			}
		}
		//System.out.println(Character.toChars(97));

	}
	public static int sample() {
		return 1;
	}

}


Measured memory_bytes: 24600
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = sorted(iil(),reverse=True)
print(sum(A[::2])-sum(A[1::2]))


Measured memory_bytes: 3060
#include<iostream>
    using namespace std;
    typedef long long ll;
    ll a[5];
    int main()
    {
      for(ll i=1;i<=5;i++) cin>>a[i];
      for(ll i=1;i<=5;i++)
      {
        if(a[i]==0)
        {
          cout<<i<<endl;
          break;
        }
      }
      return 0;
    }

Measured memory_bytes: 3060
/*
title:

url:
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <queue>
#include <limits>
#include <string>
#include <utility>
#include <cstring>
#include <map>
#include <cmath>
#include <iterator>

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define INF 1000000007
#define int long long

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

signed main()
{
    int n;
    cin >> n;
    int n_name[5] = {};
    char prefix[5] = {'M', 'A', 'R', 'C', 'H'};
    REP(i, n)
    {
        string tmp;
        cin >> tmp;
        REP(j, 5)
        {
            if (tmp[0] == prefix[j])
            {
                n_name[j]++;
                break;
            }
        }
    }

    int ans = 0;
    for (int i = 0; i < 5; i++)
    {
        for (int j = i + 1; j < 5; j++)
        {
            for (int k = j + 1; k < 5; k++)
            {
                ans += n_name[i] * n_name[j] * n_name[k];
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <string>
#include <cmath>
#include <sstream>
#include <istream>
#include <iomanip>
#include <typeinfo>
#include <stack>
#include <map>

using namespace std;
typedef long long int ll;

int main(){

    string s;

    cin >> s;

    for(ll i = 0; i < s.length(); i += 2){
        cout << s[i];
    }

} 

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

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

  ll i = 0;
  vector<int> vec;
  while(N > 0) {
    N /= K;
    i++;
  }

  cout << i << endl;
}


Measured memory_bytes: 256
def main():
  params = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
  
  return params[int(input())-1]

print(main())

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    string S;
    cin >> S;
    for(auto c:S){
        if(c == ',')cout << " ";
        else cout << c;
    }
    cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ABS(x) ((x) >= 0 ? (x) : -(x))
#define int long long

using namespace std;

const int mod = 1e9 + 7;

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int sum;
    cin >> sum;
    if(sum < 3) {
        cout << 0;
        return 0;
    }
    vector < int > dp(sum + 1);
    dp[3] = 1;
    for(int i = 4; i <= sum; ++i) {
        dp[i] = 1;
        for(int j = 3; j <= i - 3; ++j)
            dp[i] = (dp[i] + dp[i - j]) % mod;
    }
    cout << dp[sum];
}


Measured memory_bytes: 3636
/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n , m;
    cin >> n >> m;
    cout << n / m + (n % m != 0) << endl;
    return 0;
}


Measured memory_bytes: 256
/*-In the name of God-
 
Author : Syed Mujtaba
Seek knowledge from the Cradle to the Grave !!
https://www.linkedin.com/in/syed-mujtaba
*/

#include <bits/stdc++.h>
using namespace std;
#define int             long long
#define ld              long double
#define ll              long long
#define pb              push_back
#define fi              first
#define se              second
#define MAXN            200064
#define mod             1000000007  //998244353 // 1e9 + 7
#define MAX             8000000000000000064LL
#define MIN            -8000000000000000064LL
#define mt              make_tuple
#define eps             1e-6
#define endl            '\n'
#define test            int T_T; cin>>T_T; while(T_T--)
#define fast_io         ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

signed main()
{
   fast_io
   int ans = 0;
   int n;
   cin >> n;
   int x = 1, y = 1, z = 1;
   map < int, int > mp;
   for(int x = 1; x <= 100; x++)
   {
      for(int y = 1; y <= 100; y++)
      {
         for(int z = 1; z <= 100; z++)
         {
            int val = (x + y + z)*(x + y + z) - x*y -z*x -y*z;
            if(val >= 1 && val <= n)
               mp[val]++;
         }
      }
   }
   for(int i = 1; i <= n; i++)
      cout << mp[i] << endl;
}

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

using namespace std;

int main(){
   string n;
   int k; 
   cin>>k;
   string dot = "...";
   
   cin>>n;
   if(n.size()>k){
   n = n.substr(0,k);
   n.append(dot);
   }
   cout<<n<<endl;
   return 0;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
   int n,k;
   cin>>n>>k;
   int a[n];
   for(int i=0;i<n;i++)
        cin>>a[i];
    vector<bool> dp(100001,false);
    for(int i=1;i<=k;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(i>=a[j]&&dp[i-a[j]]==false)
                dp[i]=true;
        }
    }
    string s="";
    s=dp[k]==true?"First":"Second";
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 3640
def try_set(v):
    def print_board():
        for (r, c) in preset:
            if queen_pos[r] != c:
                return
        for pos in queen_pos:
            for c in range(8):
                print('Q' if c == pos else '.', end='')
            print()

    for h in range(8):
        if all((horizontal[h], dip_positive[v+h], dip_negative[v-h+7])):
            queen_pos[v] = h
            if v == 7:
                print_board()
            else:
                horizontal[h] = dip_positive[v+h] = dip_negative[v-h+7] = False
                try_set(v + 1)
                horizontal[h] = dip_positive[v+h] = dip_negative[v-h+7] = True

n = int(input())
queen_pos = [None] * 8
preset = [[pre for pre in map(int, input().split())] for _ in range(n)]
horizontal = [True] * 8
dip_positive = [True] * 15
dip_negative = [True] * 15
try_set(0)

Measured memory_bytes: 7792
package main

import "fmt"

func main() {
	var h,w,H,W int
	fmt.Scan(&H,&W,&h,&w)
	if H%h==0 && W%w==0 {
		fmt.Println("No")
		return
	}
	fmt.Println("Yes")
	for i:=1; i<=H; i++ {
		for j:=1; j<=W; j++ {
			if i%h==0 && j%w==0 {
				fmt.Print(-1000*h*w+999," ")
			} else {
				fmt.Print(1000," ")
			}
		}
		fmt.Println()
	}
}


Measured memory_bytes: 6912
# ABC106D - AtCoder Express 2
from itertools import accumulate as acc


def main():
    # 2D cumulative sum
    N, M, Q, *X = map(int, open(0).read().split())
    LR, PQ = X[: 2 * M], X[2 * M :]
    rails = [[0] * (N + 1) for _ in range(N + 1)]
    for l, r in zip(*[iter(LR)] * 2):
        rails[l][r] += 1
    rails = [tuple(acc(a)) for a in rails]
    rails = [tuple(acc(a[::-1]))[::-1] for a in zip(*rails)]
    ans = []
    for p, q in zip(*[iter(PQ)] * 2):
        ans.append(rails[q][p])
    print("\n".join(map(str, ans)))


if __name__ == "__main__":
    main()

Measured memory_bytes: 57672
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
const ll MAX_N=1e5-1;
ll N,A[MAX_N];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>N;
    REP(i,N)cin>>A[i];
    ll b=0,sgn=1;;
    REP(i,N){
        b+=A[i]*sgn;
        sgn*=-1;
    }
    cout<<b;
    REP(i,N-1){
        b=2*A[i]-b;
        cout<<' '<<b;
    }
    cout<<endl;
}


Measured memory_bytes: 2176
#include <stdio.h>

int N, K, R, S, P; 
long long int ans = 0;
char T[200000];

int rePoint(char hand) {
	if (hand == 'p') return S;
	if (hand == 'r') return P;
	if (hand == 's') return R;
	return 0;
}

int main() {
	scanf("%d%d%d%d%d", &N, &K, &R, &S, &P);
	scanf("%s", T);
	for (int i = 0; i < K; i++) ans = ans + rePoint(T[i]);
	for (int i = K; i < N; i++) {
		if (T[i - K] != T[i]) {
			ans = ans + rePoint(T[i]);
		}
		else {
			T[i] = 'n';
		}
	}
	printf("%lld", ans);
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <string>
using namespace std;

int main() {
  int n, m, a[10001];
  long long sum = 0;
  int res = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) cin >> a[i];
  for (int i = 0; i < m; i++) sum += a[i];
  res = n - sum;
  if (res < 0) res = -1;
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 3624
n, a, b = map(int, input().split())
def cmb(n,k):
    x,y = 1,1
    for i in range(k):
        x = x * (n-i) % mod
        y = y * (k-i) % mod
    return x * pow(y, mod-2, mod) % mod
mod = 10**9+7
All = pow(2, n, mod)-1
ac = cmb(n, a)
bc = cmb(n, b)
ans = (All-ac-bc)%mod
print(ans)

Measured memory_bytes: 38768
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <functional>
#include <complex>
#include <bitset>
#include <numeric>
using namespace std;

typedef long long LL;
#define REP(i,n) for(int (i)=0; (i)<(n) ;++(i))
#define REPN(i,a,n) FOR((i),(a),(a)+(n))
#define FOR(i,a,b) for(int (i)=(a); (i)<(b) ;++(i))
#define PB push_back
#define MP make_pair
#define OUT(a) cout<<(a)<<endl;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m,q,a[100010],rank[100010]={},cnt=1,l,dat[100010]={100010};
    vector<int> res;
    cin >> n >> m >> q;
    REP(i,q){
        cin >> a[i];
    }
    for(int i= q-1; i>=0;--i){
        if(rank[a[i]]==0){
            rank[a[i]]=cnt;
            ++cnt;
            res.push_back(a[i]);
        }
    }
    REPN(i,1,m){
        if(rank[i]==0){
            rank[i]=cnt;
            ++cnt;
            res.push_back(i);
        }
    }

    for(int i=m-1;i>0;--i){
        if(res[i]<res[i-1]){
            l=i;
            break;
        }
    }

    for(int i= q-1; i>=0;--i){
        if(dat[rank[a[i]]]<dat[rank[a[i]]-1]){
        ++dat[rank[a[i]]];
        }
    }
    REPN(i,1,l){
        if(dat[l]<n){
            cout << "No" <<endl;
            return 0;
        }
    }
    cout << "Yes" <<endl;
    /*
    OUT(l)
    REP(i,m){
        OUT(res[i])
    }
    REP(i,m+1){
        OUT(dat[i])
    }
    //*/



    return 0;
}


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

int main()
{
    std::string labelS;
    std::cin >> labelS;

    std::string labelT;
    std::cin >> labelT;

    int countS = 0;
    std::cin >> countS;

    int countT = 0;
    std::cin >> countT;

    std::string selectedLabel;
    std::cin >> selectedLabel;

    if (selectedLabel == labelS)
    {
        std::cout << (countS - 1) << " " << countT;
    }
    else
    {
        std::cout << countS << " " << (countT - 1);
    }

    return 0;
}

Measured memory_bytes: 256
function Main(input: string) {
  const lines: string[] = input.split("\n");

  const x = parseInt(lines[0]);
  
  const m = Math.floor(x / 500);
  const n = Math.floor((x - 500 * m) / 5);
  
  const happy = 1000 * m + 5 * n;
  
  console.log(happy);
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
#include<bits/stdc++.h>
using namespace std;
#define INS(x) (x).begin(),(x).end()
#define gcd(x,y) __gcd((x),(y))

int a[200005];
int t[200005];

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n;
    cin>>n;

    for (int i=2;i<=n;i++)
    {   
        cin>>a[i];
        t[a[i]]++;
    }

    for (int i=1;i<=n;i++)
    {
        cout<<t[i]<<'\n';
    }
    return 0;
}

Measured memory_bytes: 5108
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define rep(i, n) for(i = 0; i < (n); i++)
#define chmax(x, y) x = max(x, y)
#define MOD 1000000007
#define INF 1 << 30

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

int main(void) {
	int num, i, k;
	ll ans = 0;
	cin >> num >> k;
	vector<int> d(num);
	rep(i, num)
		cin >> d[i];
	sort(d.begin(), d.end());
	rep(i, num - k)
		ans += (ll)d[i];
	cout << ans << "\n";
	return 0;
}

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

using namespace std;

#define lli long long
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(),i.rend()
#define rep0(i,j) for(lli i=0;i<j;i++)
#define rep1(i,j) for(lli i=1;i<=j;i++)
#define rep0d(i,j) for(lli i=j-1;i>=0;i--)
#define MAX 1000000007

int main(){
  int a,b,c;
  cin >> a >> b;
  cout << max(0, a-b*2);

}

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

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

    if (500 * k >= x)
        puts("Yes");
    else
        puts("No");
    return 0;
}

Measured memory_bytes: 256
var week: [String: Int]
week = [:]
week["SUN"] = 7
week["MON"] = 6
week["TUE"] = 5
week["WED"] = 4
week["THU"] = 3
week["FRI"] = 2
week["SAT"] = 1

let s = readLine()!
print(week[s]!)

Measured memory_bytes: 768
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;

void a()
{
    int n;
    cin >> n;
    if (n % 2 == 0)
    {
        cout << n / 2 - 1;
        return;
    }
    else
    {
        cout << n / 2;
        return;
    }
}
int main(void)
{
    a();
}

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

int findSumOfDigits(int n)
{
    int sum = 0;
    while (n > 0)
    {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}

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

vector<string> field;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout << fixed << setprecision(15);
    int N;
    cin >> N;
    vector<string> S(N);
    string ans;
    for (int i = 0; i < N; i++)
    {
        cin >> S[i];
    }
    ll MI = 999999999;

    ll count = 0;
    for (char c = 'a'; c <= 'z'; c++)
    {
        MI = 99999999;
        for (int i = 0; i < N; i++)
        {
            count = 0;
            for (int j = 0; j < S[i].size();j++)
            {
                if (S[i][j] == c)
                {
                    count++;
                }
            }
            MI = min(MI, count);
            if(MI == 0){
                break;
            }
        }
        for (int i = 0; i < MI;i++)
        {
            cout << c;
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
ll n;
ll ans = INF;
cin >> n;
ll a[n];
for (ll i = 0; i < n; i++) cin >> a[i];
for (ll i = -100; i < 101; i++) {
    ll tmp = 0;
    for (ll j = 0; j < n; j++) {
        tmp += (a[j] - i) * (a[j] - i);
    }
    chmin(ans, tmp);
}
cout << ans << endl;
}

Measured memory_bytes: 3624
#include <iostream>
int main(){
  int a,b;
  std::cin >> a >> b;
  if(a>b){
    std::cout << "a > b"<< std::endl;
  } else if(a<b){
    std::cout << "a < b"<< std::endl;
  } else {
    std::cout << "a == b"<< std::endl;
  }
}



Measured memory_bytes: 3076
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

int main(){
    long long int a,b,c;
    cin >> a>>b>>c;
    if(c>=a && c<=b)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    return 0;
}


Measured memory_bytes: 256
/*
    AOJ Volume0 0002

    Digit Number

    Write a program which computes the digit number of sum of two integers a and b.

    Input
        There are several test cases. 
        Each test case consists of two non-negative integers a and b 
        which are separeted by a space in a line. The input terminates with EOF.

    Constraints
        0 ≤ a, b ≤ 1,000,000
        The number of datasets ≤ 200

    Output
        Print the number of digits of a + b for each data set.

    Sample Input
        5 7
        1 99
        1000 999

    Output for the Sample Input
        2
        3
        4

*/

#include <iostream>


int digit_of(long long int value)
{
    int i = 1;
    while(value >= 10)
    {
        value /= 10;
        i += 1;
    }
    return i;
}


int main(void)
{
    while(true)
    {
        long long int a, b;
        if(std::cin >> a >> b)
        {
            std::cout << digit_of(a + b) << std::endl;
        }
        else
        {
            break;
        }
    }

    return 0;
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

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

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

int main(){
	ll sx, sy, tx, ty;
	cin >> sx >> sy >> tx >> ty;
	ll dx = tx - sx;
	ll dy = ty - sy;
	REP(i, dy) cout << 'U';
	REP(i, dx) cout << 'R';
	REP(i, dy) cout << 'D';
	REP(i, dx) cout << 'L';
	cout << 'L';
	REP(i, dy+1) cout << 'U';
	REP(i, dx+1) cout << 'R';
	cout << 'D';
	cout << 'R';
	REP(i, dy+1) cout << 'D';
	REP(i, dx+1) cout << 'L';
	cout << 'U';
	cout << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] age)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuffer sb = new StringBuffer();
		StringBuffer sb2 = new StringBuffer();

		String str = br.readLine();
		int q = Integer.parseInt(br.readLine());
		int z = 0;

		while( z<q ){
			String[] input = br.readLine().split(" ");

			if( input[0].equals("replace")){
				if( input[1].equals("0") && input[2].equals(Integer.toString(str.length()-1))){
					str = input[3];
				}else if( input[1].equals("0") ){
					sb.append(input[3]).append(str.substring(Integer.parseInt(input[2])+1, str.length()));
					str = sb.toString();
				}else if( input[2].equals(Integer.toString(str.length()-1)) ){
					sb.append(str.substring(0, Integer.parseInt(input[1]))).append(input[3]);
					str = sb.toString();
				}else{
					sb.append(str.substring(0, Integer.parseInt(input[1]))).append(input[3]).append(str.substring(Integer.parseInt(input[2])+1, str.length()));
					str = sb.toString();
				}
			}else if( input[0].equals("reverse") ){
				sb.append(str.substring(Integer.parseInt(input[1]), Integer.parseInt(input[2])+1));
				String rts = sb.reverse().toString();
				sb.setLength(0);

				if( input[1].equals("0") && input[2].equals(Integer.toString(str.length()-1))){
					str = rts;
				}else if( input[1].equals("0") ){
					sb.append(rts).append(str.substring(Integer.parseInt(input[2])+1, str.length()));
					str = sb.toString();
				}else if( input[2].equals(Integer.toString(str.length()-1)) ){
					sb.append(str.substring(0, Integer.parseInt(input[1]))).append(rts);
					str = sb.toString();
				}else{
					sb.append(str.substring(0, Integer.parseInt(input[1]))).append(rts).append(str.substring(Integer.parseInt(input[2])+1, str.length()));
					str = sb.toString();
				}
			}else if( input[0].equals("print") ){
				sb2.append(str.substring(Integer.parseInt(input[1]), Integer.parseInt(input[2])+1) ).append("\n");
			}
			sb.setLength(0);
			z++;
		}

		System.out.print(sb2);
	}
}

Measured memory_bytes: 25220
N = int(input())
s1 = list(input())
s2 = list(input())

s = list(zip(s1, s2))
ss = []

skip = 0
for i in s:
    if skip:
        skip=0
        continue

    if i[0]!=i[1]:
        skip = 1
    ss.append(i)
# print(ss)


mod = 10**9+7
ans = 1
if ss[0][0]==ss[0][1]:
    f = 1
    ans *= 3
else:
    f = 0
    ans *= 6

#f = 1 : X
for i in range(1, len(ss)):
    if ss[i][0]==ss[i][1]:
        nf = 1
    else:
        nf = 0

    if f:
        ans *= 2
    else:
        if not nf:
            ans *= 3
    ans %= mod
    f = nf
print(ans)

Measured memory_bytes: 9200
#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <sstream>
#include <string>
#include <cstdlib>
using namespace std;

template <class T> int streamvar(std::istream& in, T& var)
{
    if (!in) {
        return 1;
    }
    in >> var;
    if (in.fail()) {
        return 1;
    }
    return 0;
}
template <class T> int streamvec(std::istream& in, std::vector<T> &v)
{
    v.clear();
    string s;

    if (!in) {
        return 1;
    }
    getline(in, s);
    if (in.fail()) {
        return 1;
    }
    istringstream is(s);
    while (1) {
        T tmp;
        is >> tmp;
        if (is.fail())
            break;
        v.push_back(tmp);
    }
    return 0;
}

int getd(int input)
{
    int ret = 1;
    while (input /= 10) {
        if (input)
            ret++;
    }
    return ret;
}

int main(void)
{
    vector<int> v;
    int tmp;
    while (!streamvec(cin, v)) {
        cout << getd(v[0] + v[1]) << endl;
    }
    return 0;
}

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

int main() {
int n,m,r,x[8],d[200][200],INF=1000000000;
long long p=INF;
cin>>n>>m>>r;
for(int i=0;i<r;i++){
  cin>>x[i];
  x[i]--;
}
sort(x,x+r);
for(int i=0;i<n;i++)for(int j=0;j<n;j++)d[i][j]=INF;
for(int i=0;i<m;i++){
    int a,b,c;
    cin>>a>>b>>c;
    a--;
    b--;
    d[a][b]=d[b][a]=c;
}
for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
do{
    long long q=0;
    for(int i=0;i<r-1;i++){
        q+=d[x[i]][x[i+1]];
    }
    p=min(p,q);
}while(next_permutation(x,x+r));
cout<<p<<endl;
	return 0;
}


Measured memory_bytes: 384
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int h = sc.nextInt();
		int w = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		// 計算
		long result = 0;
		int MOD = 1000000007;
		Combination comb = new Combination(h+w-2);
		result = comb.combination(h+w-2, h-1);
		for(int i = 1; i <= b; i++){
		    result += MOD - comb.combination(h-a+i-2, i-1)*comb.combination(a+w-i-1, w-i)%MOD;
		    result %= MOD;
		}
		
		// 出力
		System.out.println(result);
	}
	
	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
	
}

class Combination {
	static final int MOD = 1000000007;
	long[] fact;
	long[] invFact;
	long[] inv;
	
	public Combination (int n) {
		fact = new long[n+1];
		invFact = new long[n+1];
		inv = new long[n+1];
		fact[0] = 1;
		fact[1] = 1;
		invFact[0] = 1;
		invFact[1] = 1;
		inv[1] = 1;
		for (int i = 2; i < n+1; i++) {
			fact[i] = fact[i - 1] * i % MOD;
			inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
			invFact[i] = invFact[i - 1] * inv[i] % MOD;
		}
	}
	
	public long combination(int n, int k) {
		if (n < k || n < 0 || k < 0) {
			return 0;
		}
		return fact[n] * (invFact[k] * invFact[n - k] % MOD) % MOD;
	}
}




Measured memory_bytes: 30948
#include<iostream>
#include<cstdio>
#include<cmath>
# define PI acos(-1)
using namespace std;
int main()
{
    double r,s,c;
    cin>>r;
    s = PI*r*r;
    c = 2*PI*r;  
    printf("%.6lf %.6lf\n",s,c);
    return 0;
}


Measured memory_bytes: 3288
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;

const int P = 1000010;

int is_prime[P];
int main() {
    fill(is_prime + 2, is_prime + P, true);
    for(int i=2; i<P; i++) {
        if(!is_prime[i]) continue;
        for(int k=2*i; k<P; k+=i) is_prime[k] = false;
    }

    int X; cin >> X;
    while(!is_prime[X]) X++;
    cout << X << endl;
    return 0;
}


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

using namespace std;

#define fio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define watch(x) cout << (#x) << " is " << (x) << endl
#define f(t) for(ll i =0;i<t;i++)
#define bs(a,x) binary_search(a.begin(),a.end(),x)
#define ll long long int
#define ul unsigned long int
#define ld long double
#define umpi unordered_map<int,int> 
#define umpl unordered_map<ll,ll> 
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define mod 1000000007 
#define N 10000000
#define all(a) a.begin(),a.end()
#define point pair<int,int>
const int inf = 1000000007;
const ll linf = 1ll * inf * inf;

inline ll mul(ll a, ll b){ return (a * 1ll * b) % mod; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > mod) c -= mod; return c; }

struct hash_pair { 
    template <class T1, class T2> 
    size_t operator()(const pair<T1, T2>& p) const
    { 
        auto hash1 = hash<T1>{}(p.first); 
        auto hash2 = hash<T2>{}(p.second); 
        return hash1 ^ hash2; 
    } 
};

ll dp[100005];

bool rec(vl &a,ll k)
{
	if(k<0)return false;
	else if(dp[k]!=-1)return (dp[k]==1)?true:false;
	else
	{
		bool flag=false;
		for(auto &value:a)
		{
			if(k-value>=0)
			{
				if(rec(a,k-value)==false){flag=true;break;}	
			}
		}
		dp[k]=(flag)?1:0;
		return flag;
	}
}

int main()
{	
	fio;
	ll t;t=1;
	while(t--)
	{
		ll n,k;cin>>n>>k;
		vl a(n);
		f(n)cin>>a[i];
		memset(dp,-1,sizeof(dp));
		if(rec(a,k))cout<<"First\n";
		else cout<<"Second\n";
	}
}


Measured memory_bytes: 5760
#include<iostream>

using namespace std;

int main(){
    int w,h,n;
    cin >> w >> h >> n;
    int xmn=0,xmx=w,ymn=0,ymx=h;
    int tmpx, tmpy, tmpa;
    for(int i=0;i<n;i++){
        cin >> tmpx >> tmpy >> tmpa;
        if(tmpa==1){
            xmn = max(xmn, tmpx);
        }
        else if(tmpa==2){
            xmx = min(xmx, tmpx);
        }
        else if(tmpa==3){
            ymn = max(ymn, tmpy);
        }
        else if(tmpa==4){
            ymx = min(ymx, tmpy);
        }
    }
    if(xmx-xmn<=0 || ymx-ymn<=0){
        cout << 0 << endl;
    }
    else{
        cout << (xmx-xmn)*(ymx-ymn) << endl;
    }
}

Measured memory_bytes: 768
for i in range(10**6):
    n,x = map(int,input().split())
    if n==0 and x==0:
        exit()
    ans=0
    for j in range(1,n+1):
        for k in range(j+1,n+1):
            if x-j-k>k and x-j-k<=n:
                ans+=1
                
    print(ans)


Measured memory_bytes: 5592
#include <algorithm>
#include <cmath>
#include <climits>
#include <functional>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

using namespace std;
using ll  = long long;
template <typename T> T In() {
    T t;
    cin >> t;
    return t;
}
template <typename T> vector<T> ReadVec1(int N) {
    vector<T> vec(N);
    for(int i = 0; i < N; i++)
        vec[i] = In<T>();
    return move(vec);
}
template <typename T> vector<vector<T>> Vec2(int i, int j, T ini = 0) {
    vector<vector<T>> vec(i, vector<T>(j, ini));
    return move(vec);
}
template <typename T> vector<vector<vector<T>>> Vec3(int i, int j, int k, T ini = 0) {
    vector<vector<vector<T>>> vec(i, vector<vector<T>>(j, vector<T>(k, ini)));
    return move(vec);
}

int main() { 
    int A = In<int>(), B = In<int>();
    cout << max(A - 2 * B, 0) << endl;
}

Measured memory_bytes: 888
N=int(input())
t=int(0)
h=int(0)
for i in range(N):
    T,H=input().split()
    if T>H:
        t=t+3
    elif T<H:
        h=h+3
    elif H==T:
        t=t+1
        h=h+1
print (t,h)


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

int main()
{
	string S;
	cin >> S;

	char s3 = S[2];
	char s4 = S[3];
	char s5 = S[4];
	char s6 = S[5];

	if (s3 == s4 && s5 == s6)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
char st[1005],x[1005],y[1005];
int n,color[1005];
long long dp[105][105],ans;
void dfs(int t)
{
    if (t>n)
    {
        int len1=0,len2=0;
        for (int i=1;i<=n;i++)
            if (color[i]==1)
                x[++len1]=st[i];
        for (int i=1;i<=n;i++)
            if (color[i]==2)
                y[++len2]=st[i];
        dp[0][0]=1;
        for (int i=0;i<=n-len1;i++)
            for (int j=0;j<=n-len2;j++)
            {
                if (i+j==0) continue;
                dp[i][j]=0;
                if (i>=1 && st[n+n-i-j+1]==y[i]) dp[i][j]+=dp[i-1][j];
                if (j>=1 && st[n+n-i-j+1]==x[j]) dp[i][j]+=dp[i][j-1];
            }
        ans+=dp[n-len1][n-len2];
        return;
    }
    color[t]=1;
    dfs(t+1);
    color[t]=2;
    dfs(t+1);
}
int main()
{
    scanf("%d",&n);
    scanf("%s",st+1);
    dfs(1);
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 256
using System;
class Program{
	static void Main(){
		long[] s=Array.ConvertAll(Console.ReadLine().Split(),long.Parse);
		if(s[0]%3==0||s[1]%3==0){Console.WriteLine("{0}",0);}
		else{
			long ans=Math.Min(s[0],s[1]);
			for(long i=s[0]/2;i>0;i--){
				long a=i*s[1],b=(s[0]-i)*(s[1]/2),c=(s[0]-i)*(s[1]-s[1]/2);
				ans=Math.Min(ans,Math.Abs(Math.Min(Math.Min(a,b),c)-Math.Max(Math.Max(a,b),c)));
			}
			for(long i=s[1]/2;i>0;i--){
				long a=i*s[0],b=(s[1]-i)*(s[0]/2),c=(s[1]-i)*(s[0]-s[0]/2);
				ans=Math.Min(ans,Math.Abs(Math.Min(Math.Min(a,b),c)-Math.Max(Math.Max(a,b),c)));
			}
			Console.WriteLine("{0}",ans);
		}
	}
}

Measured memory_bytes: 13268
#include<iostream>

int *p,*d,m,n,o;

int max(){
	int tmp=d[0],ans=0;
	for(int i=1; i<m; i++){
		if(d[i]>tmp){
			tmp = d[i];
			ans = i;
		}
	}
	return ans;
}

int main(){
	while(true){
		std::cin >> m;
		if(!m)
			return 0;
		p = new int[m];
		d = new int[m];
		for(int i=0; i<m; i++){
			std::cin >> p[i] >> n >> o;
			d[i] = n+o;
		}
		n = max();
		std::cout << p[n] << ' ' << d[n] << std::endl;
		delete[] p;
		delete[] d;
	}
}

Measured memory_bytes: 980
s = "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51"
s = s.split(", ")
print(s[int(input()) - 1])

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

const int mod = pow(10, 9) + 7;

long long mymod(long long x, long long mod) {
  return (x + mod) % mod;
}

long long modpow(long long x, long long n, long long mod) {
  long long res = 1;
  while (n > 0 ) {
    if (n & 1) res = mymod(res * x, mod);
    x = mymod(x * x, mod);
    n >>= 1;
  }
  return res;
}

long long modinv(long long x, long long mod) {
  return modpow(x, mod - 2, mod);
}


int main() {
  int n, a, b;
  cin >> n >> a >> b;

  long long tmp1 = 1;
  for (int i = 0; i < a; ++i) {
    tmp1 = mymod(tmp1 * (n - i), mod);
    tmp1 = mymod(tmp1 * modinv(i + 1, mod), mod);
  }

  long long tmp2 = 1;
  for (int i = 0; i < b; ++i) {
    tmp2 = mymod(tmp2 * (n - i), mod);
    tmp2 = mymod(tmp2 * modinv(i + 1, mod), mod);
  }

  long long tmp3 = mymod(modpow(2, n, mod) - 1, mod);

  cout << mymod(mymod(tmp3 - tmp1, mod) - tmp2, mod) << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <bitset>

#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define STRS(i,str) for(int i=0;(str)[i];i++)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX3(a,b,c) ((a)>(b)?(a)>(c)?(a):(c):(b)>(c)?(b):(c))
#define MIN3(a,b,c) ((a)<(b)?(a)<(c)?(a):(c):(b)<(c)?(b):(c))
#define MED(a,b,c) ((a)<(b)?(a)>(c)?(a):(b)<(c)?(b):(c):(a)>(c)?(b)<(c)?(c):(b):(a))
#define RNG(a,b) ((a)>(b)?(a)-(b):(b)-(a))
#define RNG3(a,b,c) ((a)>(b)?(b)>(c)?(a)-(c):(c)>(a)?(c)-(b):(a)-(b):(b)>(c)?(c)>(a)?(b)-(a):(b)-(c):(c)-(a))
#define MAXI(a,b) {if((a)<(b))(a)=(b);}
#define MINI(a,b) {if((a)>(b))(a)=(b);}
#define BEGINFOR(a,b,c,d,e,f,g,h,i) a;goto i##_6;i##_2:c;goto i##_6;i##_3:h;goto i##_7;i##_4:d;goto i##_8;i##_5:f;goto i##_8;i##_6:if(b)goto i##_4;else goto i##_9;i##_7:if(g)goto i##_5;else goto i##_1;i##_8:if(e)goto i##_2;else goto i##_3;i##_9:
#define CONTINUE(i) goto i##_3
#define BREAK(i) goto i##_1
#define ENDFOR(i) goto i##_3;i##_1:

int main(){
	std::bitset<20000> x, y;
	x[10000] = 1;
	y[10000] = 1;
	int count = 0;
	int dir = 0;
	while(1){
		char ch = getchar();
		if(ch == 'F'){
			count++;
		}else{
			if(dir == 0){
				x = (x << count);
				dir = 1;
			}else if(dir == 2){
				x = (x >> count) | (x << count);
				dir = 1;
			}else if(dir == 1){
				y = (y >> count) | (y << count);
				dir = 2;
			}
			if(ch == 'T') count = 0;
			else break;
		}
	}
	//FOR(i, -100, 100) if(x[i + 10000]) printf("%d ", i);
	//putchar('\n');
	int tox, toy;
	scanf("%d%d", &tox, &toy);
	if(x[tox + 10000] && y[toy + 10000]) printf("Yes\n");
	else printf("No\n");
}

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

int N;
const int MAX_N = 1.0e5 + 100;
pair<int, int> A[MAX_N];

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        int a;
        cin >> a;
        A[i] = make_pair(a, i+1);
    }

    sort(A, A+N);

    for (int i = 0; i < N; i++) {
        cout << A[i].second << " ";

    }
    cout << endl;
 
    return 0;
}


Measured memory_bytes: 1536
n, a, b = map(int, input().split())
i = 0
if (b - a)%2 == 0:
    print((b-a)//2)
else:
    if a-1 >= n-b:
        bx = n-b
        bw = 1
        print(bx + bw + (n-a-bx-bw)//2)
    else:
        ax = a-1
        aw = 1
        print(ax + aw + (b-ax-aw-1)//2)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
string n;
int main()
{
    cin>>n;
    for(int i=2;i<n.size();i++)
    {
        if(n[i]==n[i-1]&&n[i]==n[i-2])
        {
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
import math
import copy

n = int(input())
m = int(math.sqrt(n)+.1)+1

def f(x):
    a = copy.copy(n)
    while a%x == 0:
        a /= x
    return a%x == 1

ans = {n}
if n > 2:
    ans.add(n-1)

for k in range(2,m):
    if (n-1)%k == 0:
        ans.add(k)
        ans.add((n-1)//k)
    elif f(k):
        ans.add(k)
print(len(ans))

Measured memory_bytes: 3572
N = int(input())
H = [int(c) for c in input().split()]

cur = abs(H[1] - H[0])
prv1 = cur
prv2 = 0
for i in range(2, N):
    cur = min(abs(H[i] - H[i-1]) + prv1, abs(H[i] - H[i-2]) + prv2)
    prv2 = prv1
    prv1 = cur

print(cur)


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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef long long ll;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<63;
const long long MOD = 1000000007;

#define CLR(a) memset((a), 0 ,sizeof(a))

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

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

int main(void){
    string S; cin >> S;
    int ans;
    if(S.size()%2){
        char c = S[(S.size()-1)/2]; 
        ans = (S.size()+1)/2;
        int i = 1;
        while(i <= (S.size()-1)/2){
            if(S[ans-1+i] == c && S[ans-1-i] == c){
                i++;
            }
            else break;
        }
        ans += i-1;
    }
    else{
        ans = S.size()/2;
        int i = 1;
        while(i <= S.size()/2){
            if(S[ans-i] == S[ans-1+i]) i++;
            else break;
        }
        ans += i-1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int K;
    int X;
    int N;
    cin >> K >> X;
    N =  2 * K - 1;
    int S;
    S = X - K + 1;
    vector<int> retu(N);

    for (int i = 0;i < N;i++){
        retu.at(i) = S + i;    
    }

    for (int i = 0;i < N;i++){
        cout << retu.at(i) << endl;
    }


}

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

int main(void) {
  string s;
  cin >> s;
  if (s.size() < 4) {
    cout << "No" << endl;
    return 0;
  }

  if (s.substr(0, 4) == "YAKI") {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define INF 1e12

#define PB push_back
#define PF push_front
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vpi vector<pii>
#define vll vector<ll>
#define vpl vector<pll>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))
#define ios ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pr_d(x) cout << fixed << setprecision(15) << x << endl
#define ud(c, x) distance(c.begin(), upper_bound(all(c), x))
#define ld(c, x) distance(c.begin(), lower_bound(all(c), x))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define rep3(i, n) for (int i = (n - 1); i >= 0; --i)
#define rep4(i, a, b) for (int i = (a); i > (b); --i)
#define pb push_back
#define out(x) cout << x << "\n"
bool odd(int i)
{
    return i % 2;
}

#define all(v) v.begin(), v.end()
#define size(x) int(x.size())

int gcd(int a, int b)
{
    return __gcd(a, b);
}
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
void Yes_No(bool f)
{
    if (f)
        printf("Yes\n");
    else
        printf("No\n");
}
void YES_NO(bool f)
{
    if (f)
        printf("YES\n");
    else
        printf("NO\n");
}

template <typename T>
void deb1(T x)
{
    cout << x << "\n";
}

template <typename T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <typename T>
bool chmin(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
//-------------------ここから回答する-----------------------

void solve(void)
{
    int d, t, s;
    cin >> d >> t >> s;
    if (s * t >= d)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}
int main(void) { solve(); }

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int x;
	int c1=0,c2=0;
	for (int i=0;i<n;i++){
		cin>>x;
		if (x&1)c1++;
		else c2++;
	}
	if (c1%2==0)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
const int md=1000000007;
int n,m,f[3005][3005][2],i,j,k;
int main()
{
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;++i)
		f[0][i][0]=1;
	f[0][0][1]=1;
	for(i=0;i<m;++i)
		for(j=0;j<=n;++j)
			for(k=0;k<=1;++k)
				if(f[i][j][k])
				{
					if(j)
					{
						f[i+1][j][k||j==1]=(f[i+1][j][k||j==1]+f[i][j][k])%md;
						f[i+1][j-1][k||j==1]=(f[i+1][j-1][k||j==1]+f[i][j][k])%md;
					}
					if(j<n)
					{
						f[i+1][j][k]=(f[i+1][j][k]+f[i][j][k])%md;
						f[i+1][j+1][k]=(f[i+1][j+1][k]+f[i][j][k])%md;
					}
				}
	k=0;
	for(j=0;j<=n;++j)
		k=(k+f[m][j][1])%md;
	printf("%d",k);
	return 0;
}


Measured memory_bytes: 70656