akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h> 

#define INF INT_MAX/2;
#define MOD 1000000007

using namespace std;

using ll = long long;
using ull = unsigned long long ;

int main(){
   ios::sync_with_stdio(false);
   cin.tie(0);
   
   int N;
   cin>>N;
   ll c=INF;
   for(int i=0;i<=N;i++){
      ll cc=0;
      int six = i;
      int nine = N-i;
      while(six){
         cc+=(six%6);
         six/=6;
      }
      while(nine){
         cc+=(nine%9);
         nine/=9;
      }
      c = min(cc,c);
   }
   cout<<c<<endl;
   return 0; 
}


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

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> sum(n + 1);
    FOR (i, 1, n + 1) cin >> sum[i];
    FOR (i, 1, n + 1) sum[i] += sum[i - 1];
    map<ll, int> mp;
    ll res = 0;
    rep (i, n + 1) {
        res += mp[sum[i]];
        mp[sum[i]]++;
    }
    cout << res << endl;
    
    return 0;
}



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

using namespace std;

using ll = long long;

constexpr ll MOD = 1000000007;

#ifndef ONLINE_JUDGE
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
#else
#define print(...)
#endif

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

    ll x,ans = 0;

    cin >> x;

    for(ll m=100; m<x; m*=1.01){
        ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3656
#include<bits/stdc++.h>
using namespace std;
int main(){
   string s;
   cin>>s;
   int one=0,zero=0;
   for(int i=0;i<s.size();i++){
        if(s[i]=='1'){
            one++;
        }
        else
            zero++;
   }
   cout<<min(one,zero)*2;
}


Measured memory_bytes: 512
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7



int main() {


	char S;
	scanf("%c", &S);

	if (S == 'a' || S == 'i' || S == 'u' || S == 'e' || S == 'o') {
		printf("vowel");
	}
	else {
		printf("consonant");
	}


}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
 
int main()
{
    int N;
    long long W;
    cin>>N>>W;
    long long w0 = -1;
    vector<long long> v[4];
    for (int i=0; i<N; i++)
    {
        long long tw, tv;
        cin>>tw>>tv;
        if (w0==-1)
            w0 = tw;
        v[tw-w0].push_back(tv);
    }
 
    for (int i=0; i<4; i++)
    {
        sort(v[i].begin(), v[i].end());
        reverse(v[i].begin(), v[i].end());
    }
 
    vector<long long> s[4];
    for (int i=0; i<4; i++)
    {
        s[i].resize(v[i].size()+1);
        for (int j=0; j<(int)v[i].size(); j++)
            s[i][j+1] = s[i][j]+v[i][j];
    }
 
    long long ans = 0;
    long long n[4];
    for (n[0]=0; n[0]<=v[0].size(); n[0]++)
    for (n[1]=0; n[1]<=v[1].size(); n[1]++)
    for (n[2]=0; n[2]<=v[2].size(); n[2]++)
    {
        long long t = n[0]*w0 + n[1]*(w0+1) + n[2]*(w0+2);
        if (t<=W)
        {
            n[3] = min((long long)v[3].size(), (W-t)/(w0+3));
            long long a = 0;
            for (int i=0; i<4; i++)
                a += s[i][n[i]];
            ans = max(ans, a);
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define eb emplace_back
#define precision(n) cout << fixed << setprecision(n);
#define fast {ios_base::sync_with_stdio(false);cin.tie(NULL);}
int main()
{
    fast;
    int x,a;
    cin>>x>>a;
    if(x>=a)
    {
        cout<<10<<endl;
    }
    else
        cout<<0<<endl;
return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <array>
#include <algorithm>
using namespace std;
int n, r, p, c;

int main(){
  while( cin >> n >> r && n > 0){
    int a[50];
    for(int i = 1; i < n+1; i++){
      a[i-1] = i;
    }
    for (int i = 0; i < r; i++){
      cin >> p >> c;
      rotate(a+n+1-c-p, a+n+1-p, a+n);
    }


    cout << a[n-1] << endl;


  }




}


Measured memory_bytes: 3152
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

// container util
#define all(x) (x).begin(), (x).end()

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

// typedef
typedef long long lint;
typedef unsigned long long ull;
typedef complex<long double> Complex;
typedef pair<int, int> P;
typedef tuple<int, int, int> TP;
typedef vector<int> vec;
typedef vector<vec> mat;

// constant
const int MOD = (int)1e9 + 7;
const int INF = (int)1e18;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

// conversion
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();
}

//
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
//

struct dir {
  int r = 0, l = 0, u = 0, d = 0;
};

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

  int n;
  while (cin >> n, n) {
    vector<dir> block(n);
    for (int i = 1; i < n; i++) {
      int nn, d;
      cin >> nn >> d;

      block[i].l = block[nn].l + (d == 0 ? 1 : 0);
      block[i].d = block[nn].d + (d == 1 ? 1 : 0);
      block[i].r = block[nn].r + (d == 2 ? 1 : 0);
      block[i].u = block[nn].u + (d == 3 ? 1 : 0);

      block[i].l -= (d == 2 ? 1 : 0);
      block[i].d -= (d == 3 ? 1 : 0);
      block[i].r -= (d == 0 ? 1 : 0);
      block[i].u -= (d == 1 ? 1 : 0);
    }

    int r = 0, l = 0, u = 0, d = 0;
    for (int i = 0; i < n; i++) {
      r = max(r, block[i].r);
      l = max(l, block[i].l);
      u = max(u, block[i].u);
      d = max(d, block[i].d);
    }

    cout << r + l + 1 << " " << u + d + 1 << "\n";
  }

  return 0;
}


Measured memory_bytes: 3012
#include<stdio.h>
 int main(int argc, char const *argv[])
 {
     int A,B;
     scanf("%d%d",&A,&B);
     int ans=2*A-1;
     if (ans<2*B-1)
     {
         ans=2*B-1;
     }
     if (ans<A+B)
     {
        ans=A+B;
     }
     printf("%d\n",ans);
     return 0;
 }
 

Measured memory_bytes: 128
#include <iostream>
#include <fstream>
// #include <bits/stdc++.h>
#include <sstream>
#include <list>
#include <stack>
#include <deque>
#include <utility>
#include <queue>
#include <set>
#include <map>
#include <assert.h>
#include <bitset>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <ctime>
#include <iterator>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <complex>
 
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()

#define ll long long
#define ld long double
#define pii pair<int,int>

#define files1 freopen("input.txt","r",stdin)
#define files2 freopen("output.txt","w",stdout)
#define files files1;files2
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0)

#define endl '\n'
#define ln(i,n) " \n"[(i) == (n) - 1]

using namespace std;
 
void bad(string mes = "Impossible"){cout << mes;exit(0);}
template<typename ... T> void shit(T& ... x){}
template<typename ... T> void dec(T& ... x){shit(--x...);}
template<typename ... T> void inc(T& ... x){shit(++x...);}
#include <unordered_map>
#include <unordered_set>

template<typename T>
string bin(T x, int st = 2){
    string ans = "";
    while (x > 0){
        ans += char('0' + x % st);
        x /= st;
    }
    reverse(ans.begin(), ans.end());
    return ans.empty() ? "0" : ans;
}

template<typename T>
T input(){
    T ans = 0, m = 1;
    char c = ' ';

    while (!((c >= '0' && c <= '9') || c == '-')) {
        c = getchar();
    }

    if (c == '-')
        m = -1, c = getchar();
    while (c >= '0' && c <= '9'){
        ans = ans * 10 + (c - '0'), c = getchar();
    }
    return ans * m;
}

template<typename T>
void read(T& a) {
    a = input<T>();
}

template<typename T>
void read(T& a, T& b) {
    read(a), read(b);
}

template<typename T>
void read(T& a, T& b, T& c) {
    read(a, b), read(c);
}

template<typename T>
void read(T& a, T& b, T& c, T& d) {
    read(a, b), read(c, d);
}

const int inf = 1e9;
const double eps = 1e-9;
const int maxn = 3e5 + 100, base = 1e9 + 7;
const ll llinf = 1e18 + 1;

template<typename T>
T binpow(T n, T s)
{
    if (s <= 0)
        return 1LL;
    if (s % 2 == 0){
        T b = binpow(n, s / 2);
        return ( 1LL * b * b ) % base;
    } else {
        return (1LL* binpow(n, s - 1) * n) % base;
    }
}

int main() {
    ll res = llinf;
    int a, b, c;
    read(a, b, c);

    if (a % 2 == 0 || b % 2 == 0 || c % 2 == 0)
        res = 0;
    res = min(1LL * a * b, res);
    res = min(1LL * a * c, res);
    res = min(1LL * b * c, res);
    cout << res;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int area = a*b;
        int length = 2*a + 2*b;
        System.out.println(area + " " + length);
        sc.close();
    }
}


Measured memory_bytes: 26132
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using ll = long long;
#define chmin(i, j) i = min(i, j);
#define chmax(i, j) i = max(i, j);
#define rep(i, n) for(int i=0;i<n;i++)
int main() {
  ll k, n;
  cin >> k >> n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  ll ma = 0;
  for(int i=0;i<n-1;i++) chmax(ma, a[i+1] - a[i]);
  chmax(ma, a[0] + k - a.back());
  cout << k - ma << endl;
  return 0;
}


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

using namespace std;

int main() {
	int r;
	string g;
	cin >> r >> g;
	int ans = 0;
	for (int i = 0; i < r-2; i++) {
		if (g.at(i) == 'A' && g.at(i+1) == 'B' && g.at(i + 2) == 'C') {
			ans++;
		}
		else{ 
			continue;
		}
			
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}

//INSERT ABOVE HERE
signed main(){
  int n=1e5;
  int m;
  cin>>m;
  vector<int> cs(m);
  for(int i=0;i<m;i++) cin>>cs[i];
  vector<int> used(n+1,0);
  stack<int> stk;
  for(int i=0;i<m;i++){
    if(cs[i]>0){
      if(used[+cs[i]]) drop(i+1);
      stk.emplace(+cs[i]);
      used[+cs[i]]=1;
    }else{
      if(!used[-cs[i]]) drop(i+1);
      if(stk.empty()) drop(i+1);
      if(stk.top()!=-cs[i]) drop(i+1);
      stk.pop();
      used[-cs[i]]=0;
    }
  }
  drop("OK");
  return 0;
}



Measured memory_bytes: 3508
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(N: int, X: "List[int]"):
    ans = INF
    for i in range(1, 101):
        cost = sum([(i-X[j])**2 for j in range(N)])
        ans = min(ans, cost)

    print(ans)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    X = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, X)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <iomanip>	
#include <deque>
#include <set>
#include <climits>
#include <memory>
#include <numeric>
#include <utility>


#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
#define fore(i,a) for(auto &i:a)
#define INF INT_MAX/2;
#define PI 3.14159265358979323846264338327950L;
const int INF2 = 1001001001;
typedef long long ll;
using namespace std;
using vi = vector<int>;
using vll = vector<ll>;
ll mod = 1e9 + 7;
//ll llmax = 10000000000000000000ll;
using namespace std;
using Graph = vector<vector<int>>;



int cnt_digit(ll N)
{
	int digit = 0;

	while (N > 0)
	{
		N /= 10;
		digit++;
	}
	return digit;
}


 // 最大公約数計算
 
ll gcd(ll a, ll b)
{
	if (b == 0) {
		return a;
	}
	else {
		return gcd(b, a % b);
	}
}
// 最小公倍数の計算

ll lcm(ll a, ll b)
{
	ll g = gcd(a, b);

	return a / g * b;
}

struct union_find
{
	vector<int> par, r;
	union_find(int n)
	{
		par.resize(n);
		r.resize(n);
		init(n);
	}


	void init(int n)
	{
		for (int i = 0; i < n; i++) par[i] = i;
		for (int i = 0; i < n; i++) r[i] = 0;
	}

	int find(int x)
	{
		if (par[x] == x)return x;
		else return find(par[x]);
	}

	void unite(int x, int y)
	{
		x = find(x);
		y = find(y);

		if (r[x] < r[y])
		{
			par[x] = y;
		}
		else
		{
			par[y] = x;
			if (r[x] == r[y])
			{
				r[x]++;
			}
		}
	}
};

const int MAX_N = 110000;

int memo[MAX_N];

int rec(int n) {
	if (n == 0)return 0;
	if (memo[n] != -1)return memo[n];

	int res = n;

	for (int pow6 = 1; pow6 <= n; pow6 *= 6)res = min(res, rec(n - pow6) + 1);

	for (int pow9 = 1; pow9 <= n; pow9 *= 9)res = min(res, rec(n - pow9) + 1);

	return memo[n] = res;
}

int calc(int x) {
	int ret = 0;
	while (x % 2 == 0) {
		x /= 2;
		ret++;
	}

	return ret;
}

int a[12][12];
int D;
ll G;
vector<ll> P, C;

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

	cin >> a;
	int ans = 0;
	for (int i = 1; i < a + 1; i += 2) {
		int cnt = 0;
		rep(j, 1, i + 1) {
			if (i % j == 0) {
				cnt++;
			}
		}
		if (cnt == 8)ans++;
	}

	cout << ans << endl;

}
	

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>

long long int a[100010];

int main(){

	int n;
	long long int ans=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%lld",&a[i]);
		if(a[i]!=0 && a[i]%2==0){
			ans+=(a[i]/2-1);
			a[i]=2;
		}
		else if(a[i]!=0){
			ans+=(a[i]/2);
			a[i]=1;
		}
		//printf("ans1:%d\n",ans);
	}
	
	int tmp=0;
	for(int i=1;i<n;i++){
		if(a[i]==1 && (a[i+1]==1 || a[i+1]==2)){
			ans++;
			a[i]--;
			a[i+1]--;
		}
	}

	//printf("ans2:%d\n",ans);

	for(int i=1;i<=n;i++){
		if(a[i]==2){
			ans++;
			a[i]=0;
		}
	}
	printf("%lld",ans);
	return 0;
}

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

bool isprime(ll a)
{
	ll count=0;
	for(int i=1;i*i<=a;i++)
	{
		if(a%i==0)count+=2;
		if(i*i==a)count--;
	}
	
	if(count==2)return true;
	else
	return false;
	
}


vector<ll>d(151,0);
ll digitsum(ll n)
{
	ll s=0;
		while(n>0)
		{
			s+=n%10;
			n=n/10;
		}
		return s;
		
	
}
void solve()
{
	
 char c;
 cin>>c;
 if(isupper(c))cout<<"A";
 else
 cout<<"a";



}




int main()
{


ios::sync_with_stdio(0); 
	cin.tie(0);

		solve();
	
return 0;

		
	}
	
	
	


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

int main(){
  string s;
  string ans;
  cin >> s;

  if(s[0] =='A'&&s[1]=='R'&&s[2]=='C'){
    ans ="ABC";
  }

  if(s[0] =='A'&&s[1]=='B'&&s[2]=='C'){
    ans ="ARC";
  }

cout << ans <<endl;


}


Measured memory_bytes: 3596
#include<stdio.h>

int main()
{
  int l,r,d;
  int a,b,ans;
  scanf("%d%d%d",&l,&r,&d);
  a=(l+d-1)/d;
  b=r/d;
  ans=b-a+1;
  printf("%d",ans);
  return 0;
}


Measured memory_bytes: 1680
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BeginnerCont143
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var d = Console.ReadLine().Split().Select(e => int.Parse(e)).ToList();
            var s = 0;
            for(int i = 0; i < n -1; i++)
            {
                var x = 0;
                for(int j = i + 1; j < n; j++)
                {
                    x += d[j];
                }
                s += d[i] * x;
            }

            Console.WriteLine(s.ToString());
        }
    }
}


Measured memory_bytes: 13268
#include<iostream>
#include<string>
#include<typeinfo>
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
typedef long long int ll;
using namespace std;
int main()
{
	int a,b,c,d;
	cin >> a >> b >> c >> d;
	int ans;
	ans = min(b,d) - max(a,c);
	if(ans<0){
		ans = 0;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
/*Lucky_Glass*/
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

const int H=1e4;

long long f[H*2+3][2];
int h,n;

int main(){
    scanf("%d%d",&h,&n);
    memset(f,0x3f,sizeof f);
    long long INF=f[0][0];
    f[0][0]=0;
    for(int i=1;i<=n;i++){
        for(int j=0;j<=2*H;j++) f[j][i&1]=INF;
        int num,cst;scanf("%d%d",&num,&cst);
        int _i=!(i&1);
        for(int j=0;j<=2*H;j++){
            f[j][i&1]=f[j][_i];
            if(j>=num) f[j][i&1]=min(f[j][i&1],f[j-num][i&1]+cst);
        }
    }
    long long ans=INF;
    for(int i=h;i<=2*H;i++)
        ans=min(ans,f[i][n&1]);
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define LL long long int
using namespace std;
int main(void)
{
	int i,j,k,d,l,buf,ama;
	cin>>d>>l;
	buf=d/l;
	ama=d%l;
	if(ama==0) {
		cout<<buf<<endl;
	}
	else cout<<buf+ama<<endl;
}

Measured memory_bytes: 3096
N,M = map(int,input().split())

ans = [-1] * N

for i in range(M):
    s,c = map(int,input().split())
    if ans[s-1] != -1 and ans[s-1] != c :
        print(-1)
        exit()
    ans[s-1] = c

if N != 1 :
    if ans[0] == 0 :
        print(-1)
        exit()
    if ans[0] == -1 :
        ans[0] = 1
    for i in range(N):
        if ans[i] == -1:
            ans[i] = 0
else :
    if ans[0] == -1 :
        ans[0] = 0

print(*ans,sep='')


Measured memory_bytes: 9160
#include<stdio.h>

int main(){
	int a,b,c;
	while(scanf("%d%d%d",&a,&b,&c),a!=-1||b!=-1||c!=-1){
		if(a==-1||b==-1)puts("F");
		else if(a+b>=80)puts("A");
		else if(a+b>=65)puts("B");
		else if(a+b>=50)puts("C");
		else if(a+b>=30&&c>=50)puts("C");
		else if(a+b>=30)puts("D");
		else puts("F");
	}
}


Measured memory_bytes: 2052
// template version 1.6
// {{{ define basic macro
using namespace std;
#include <iostream>
#include <bits/stdc++.h>
// varibable settings
#define int long long
#define INF 1000000000000000000LL
// #define INF 2147483647
#define MOD 1000000007LL
// #define MOD 998244353LL
#define infile "../test/sample-1.in"

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)(b-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ten(n) ((int)1e##n)
template<class T, size_t N> size_t sza(const T (&array)[N]) { return N; }
template<class T> inline void chmax(T &a, const T &b) { if(a < b) a = b; }
template<class T> inline void chmin(T &a, const T &b) { if(a > b) a = b; }
template<class T=int> T in() {T x; cin>>x; return (x);}
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

// dump macro
#ifdef PCM
  #include "dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;
template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};
#define fi first
#define se second

// }}}

int solve(){
  int n;cin>>n;
  string a;cin>>a;
  string b;cin>>b;
  string c;cin>>c;

  int res = 0;
  rep(i, n){
    set<int> s;
    s.insert(a[i]);
    s.insert(b[i]);
    s.insert(c[i]);
    if (sz(s)==1){
    }
    else if(sz(s)==2){
      res++;
    }
    else if(sz(s)==3){
      res += 2;
    }
  }
  cout << res << endl;

  return 0;
}

signed main() { //{{{
#ifdef INPUT_FROM_FILE
  std::ifstream in(infile);
  std::cin.rdbuf(in.rdbuf());
#endif
  solve();
  return 0;
} //}}}


Measured memory_bytes: 256
/*
      author : nishi5451
      created: 11.08.2020 22:23:06
*/

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


int main(){
    int n;
    cin >> n;
    double ans = (n+n%2)/2/double(n);
    printf("%.12lf\n",ans);
    return 0;
}

Measured memory_bytes: 3764
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())





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

	int n;
	int w[100];

	cin >> n;
	rep(i, n)cin >> w[i];


	int ans = 1 << 30;
	rep(i, n - 1) {
		int x = accumulate(w, w + i + 1, 0);
		int y = accumulate(w + i + 1, w + n, 0);
		ans = min(ans, abs(x - y));
	}
	cout << ans << endl;



	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <tuple>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <cstdio>
#include <numeric>
#define REP(i, n) for(LL i = 0;i < n;i++)
#define REPR(i, n) for(LL i = n;i >= 0;i--)
#define FOR(i, m, n) for(LL i = m;i < n;i++)
#define FORR(i, m, n) for(LL i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define INF (LL)1e15
#define MOD 1000000007
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;
typedef pair<int, P> PP;
typedef pair<LL, LP> LPP;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

LL change_div_mul_mod(LL divisor, LL mod_minus_2, LL mod){
    if(mod_minus_2 == 0) return 1;
    else if(mod_minus_2 % 2 == 0){
        LL d = change_div_mul_mod(divisor, mod_minus_2/2, mod);
        return (d * d) % mod;
    }else{
        return (divisor * change_div_mul_mod(divisor, mod_minus_2-1, mod)) % mod;
    }
}

//#define int long long

/*************** using variables ***************/
int n;
vector<LL> ryuka;
/**********************************************/

signed main(){
    cin >> n;
    ryuka.resize(n+1);
    ryuka[0] = 2; ryuka[1] = 1;
    FOR(i, 2, n+1){
        ryuka[i] = ryuka[i-2] + ryuka[i-1];
    }

    cout << ryuka[n] << endl;

}


Measured memory_bytes: 256
#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>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

int dx[]={1, 0, -1, 0};
int dy[]={0, -1, 0, 1};

ll dp[3010][3010];

int main(){
    int n; cin>>n;
    vector<int> a(n);
    for(int i=0; i<n; i++) cin>>a[i];

    for(int len=1; len<=n; len++){
        for(int i=0; i+len<=n; i++){
            int j = i + len;

            // [i, j)
            if((n - len) % 2 == 0){
                // 先手
                // [i+1, j) -> [i, j) と [i, j-1) -> [i, j) の大きい方を取る
                dp[i][j] = max(dp[i+1][j] + a[i], dp[i][j-1] + a[j-1]);
            }
            else{
                // 後手
                // [i+1, j) -> [i, j) と [i, j-1) -> [i, j) の小さい方を取る
                dp[i][j] = min(dp[i+1][j] - a[i], dp[i][j-1] - a[j-1]);
            }
        }
    }

    cout << dp[0][n] << endl;
}

Measured memory_bytes: 70016
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const int MOD = 998244353;
const ll INF = 1000000000000000000;


int main()
{
	ll a, b, c, d;
	cin >> a >> b >> c >> d;
	ll ans = -INF;
	ans = max(ans, a * c);
	ans = max(ans, a * d);
	ans = max(ans, b * c);
	ans = max(ans, b * d);
	cout << ans << endl;
}

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

#define rng(i, a, b) for (int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define per(i, b) gnr(i, 0, b)

using namespace std;

using ll = long long;
using P = pair<int, int>;

int main() {
  int k, a, b;
  cin >> k >> a >> b;
  bool ok = false;
  for (int i = a; i <= b; i++) {
    if (i % k == 0) {
      ok = true;
    }
  }
  cout << (ok ? "OK" : "NG") << endl;
  return 0;
}


Measured memory_bytes: 3624
IDENTIFICATION DIVISION.
      PROGRAM-ID. 058A.
      DATA DIVISION.
      WORKING-STORAGE SECTION.
      01 INP PIC X(100).
      01 A   PIC 9(3).
      01 B   PIC 9(3).
      01 C   PIC 9(3).
      
      01 ANS1 PIC 9(3).
      01 ANS2 PIC 9(3).
      
      PROCEDURE DIVISION.
      ACCEPT INP.
      UNSTRING INP DELIMITED " "
      INTO A B C.
            
      IF B - A = C - B
      THEN
	      DISPLAY "YES"
		ELSE
    	  DISPLAY "NO"
      END-IF.
      
      STOP RUN.

Measured memory_bytes: 384
//
// Created by kuroneko on 2019-07-06.
//

#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip>

typedef long long ll;
using namespace std;

int main() {
    ll N; cin >> N;
    vector<ll> v(5);
    for (int i = 0; i < 5; i++) {
        cin >> v[i];
    }
    ll max_p = 1e16;
    for (int i = 0; i < 5; i++) {
        max_p = min(max_p, v[i]);
    }

    ll once = 0;
    if (N % max_p == 0) once = N / max_p;
    else once = N / max_p + 1;

    cout << 4 + once << endl;
    return 0;
}


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

int main() {
    int n;
    string s;
    cin>>n>>s;
    if(n >= s.size()) {
        cout<<s;
    }
    else {
        s = s.substr(0,n);
        cout<<s<<"...";
    }
}

Measured memory_bytes: 3628
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInteger = readLn :: IO Integer
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readIntegers = map ( fst . fromJust . B.readInteger ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

modifyArray a i f = writeArray a i =<< f <$> readArray a i

main = do
	x <- readInteger
	let
		r1 = x `div` 11 * 2
		x' = x `mod` 11
		r2 = if | x' == 0 -> 0
				| x' <= 6 -> 1
				| otherwise -> 2
	print $ r1 + r2

Measured memory_bytes: 508
import java.util.*;

class Main{
	Scanner s=new Scanner(System.in);
	int n=s.nextInt();
	int[]a=new int[n],b=new int[n],min=new int[n],max=new int[n];
	
	public static void main(String[]$){
		new Main().main();
	}
	void main() {
		Arrays.setAll(a,i->s.nextInt());
		Arrays.setAll(b,i->s.nextInt());
		Arrays.fill(min,1);
		Arrays.fill(max,Integer.MAX_VALUE);
		
		if(f(a,0,n,1)*f(b,n-1,-1,-1)==0) {
			System.out.println(0);
			return;
		}
		
		long r=1;
		for(int i=0;i<n;++i) {
			r*=Math.max(0,max[i]-min[i]+1);
			r%=1000000007;
		}
		System.out.println(r);
	}
	int f(int[]b,int f,int t,int d) {
		for(int i=f;i!=t;i+=d) {
			if(i==f||b[i]!=b[i-d]) {
				if(min[i]>b[i]||max[i]<b[i])
					return 0;
				min[i]=max[i]=b[i];
			}else {
				max[i]=Math.min(max[i],b[i]);
			}
		}
		return 1;
	}
}


Measured memory_bytes: 88924
import sys
input = sys.stdin.readline

n,h = map(int,input().split())
l = []
wield_max = 0
for i in range(n):
    a,b = map(int,input().split())
    l.append((a,b))
    wield_max = max(wield_max,a)

strong_throws = []
for i in range(n):
    if l[i][1] >= wield_max:
        strong_throws.append(l[i][1])

cnt = 0
for throws in sorted(strong_throws,reverse=True):
    h -= throws
    cnt += 1
    if h <= 0:
        print(cnt)
        exit()
cnt += h//wield_max
if h % wield_max != 0:
    cnt += 1
print(cnt)


Measured memory_bytes: 80932
L = input()[::-1]
M = len(L)

#print(L)

mod = 10**9 + 7

power3 = [1]*(M+1)
for i in range(1,M):
  power3[i] = (3*power3[i-1])%mod

#print(power3)
  
dp = [1]* (M) #dp[n]: n桁以上は上限値で，n桁目までの場合の数

for i,l in enumerate(L):
  if l=='0':
    dp[i] = dp[i-1]
  else:
    dp[i] = (2*dp[i-1] + power3[int(i)])%mod

#print(dp)
print(dp[M-1])

Measured memory_bytes: 11124
#include<stdio.h>
int main()
{
    int a,b,c;
    int flag = 0;
    scanf("%d %d %d",&a,&b,&c);
    int sum = 0;
    sum = a+b+c;
    if(sum>=22)
    {
        printf("bust\n");

    }
    else {
        printf("win\n");
    }
}


Measured memory_bytes: 128
x, y = map(int,input().split())
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]

if x in a:
    x_flag = 0
elif x in b:
    x_flag = 1
else:
    x_flag = 2

if y in a:
    y_flag = 0
elif y in b:
    y_flag = 1
else:
    y_flag = 2

if x_flag==y_flag:
    print("Yes")
else:
    print("No")

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


int main(){
  int n;
  cin >> n;
  vector<ll>a(n);
  rep(i,n)cin>>a[i];
  sort(a.begin(),a.end());
  bool f=true;
  rep(i,n-1){
    if(a[i]==a[i+1])f=false;
  }
  if(f)cout<<"YES";
  else cout<<"NO";

  return 0;
}



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

using namespace std;

typedef long long ll;

int main(){
  ll N,A,B,C,D; cin >> N >> A >> B >> C >> D;
  for(ll k = 0; k < N; k++){
    if( k * ( C + D) - ( N - 1 ) * D <= ( B - A)){
      if( ( B - A ) <= k * ( C + D) - ( N - 1) * C){
        cout << "YES" << endl; return 0;}}}
    
    cout << "NO" << endl; return 0;}


Measured memory_bytes: 256
#![allow(non_snake_case, unused)]
use std::collections::*;
use std::cmp::{min, max};

////////// missing functions in 1.15.1 //////////
macro_rules! eprint {
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = write!(::std::io::stderr(), $($t)*);
	}};
}
macro_rules! eprintln {
	() => { eprintln!(""); };
	($($t:tt)*) => {{
		use ::std::io::Write;
		let _ = writeln!(::std::io::stderr(), $($t)*);
	}};
}
/////////////////////////////////////////////////
pub trait SetMinMax {
	fn setmin(&mut self, v: Self) -> bool;
	fn setmax(&mut self, v: Self) -> bool;
}
impl<T> SetMinMax for T where T: PartialOrd {
	fn setmin(&mut self, v: T) -> bool {
		*self > v && { *self = v; true }
	}
	fn setmax(&mut self, v: T) -> bool {
		*self < v && { *self = v; true }
	}
}

macro_rules! debug {
	($($v: expr),*) => {
		$(eprint!("{} = {:?} ", stringify!($v), $v);)*
		eprintln!("@ {}:{}", file!(), line!());
	}
}

macro_rules! mat {
	($($e:expr),*) => { Vec::from(vec![$($e),*]) };
	($($e:expr,)*) => { Vec::from(vec![$($e),*]) };
	($e:expr; $d:expr) => { Vec::from(vec![$e; $d]) };
	($e:expr; $d:expr $(; $ds:expr)+) => { Vec::from(vec![mat![$e $(; $ds)*]; $d]) };
}

pub fn readln() -> String {
	let mut line = String::new();
	::std::io::stdin().read_line(&mut line).unwrap_or_else(|e| panic!("{}", e));
	line
}

macro_rules! read {
	($($t:tt),*; $n:expr) => {{
		let stdin = ::std::io::stdin();
		let ret = ::std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
			let line = line.unwrap();
			let mut it = line.split_whitespace();
			_read!(it; $($t),*)
		}).collect::<Vec<_>>();
		ret
	}};
	($($t:tt),*) => {{
		let line = readln();
		let mut it = line.split_whitespace();
		_read!(it; $($t),*)
	}};
}

macro_rules! _read {
	($it:ident; [char]) => {
		_read!($it; String).chars().collect::<Vec<_>>()
	};
	($it:ident; [u8]) => {
		Vec::from(_read!($it; String).into_bytes())
	};
	($it:ident; [$t:ty]) => {
		$it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
	};
	($it:ident; $t:ty) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
	};
	($it:ident; $($t:ty),+) => {
		($(_read!($it; $t)),*)
	};
}

pub fn main() {
	let _ = ::std::thread::Builder::new().name("run".to_string()).stack_size(32 * 1024 * 1024).spawn(run).unwrap().join();
}

fn run() {
	let N = read!(usize);
	let mut x = vec![];
	for i in 0..N {
		let (a, b) = read!(i64, i64);
		x.push((a + b, a, b));
	}
	x.sort();
	x.reverse();
	let mut sum = 0;
	for i in 0..N {
		if i % 2 == 0 {
			sum += x[i].1;
		} else {
			sum -= x[i].2;
		}
	}
	println!("{}", sum);
}


Measured memory_bytes: 13604
// AOJ ALDS1_1_A Insertion Sort
// 2018.4.26 bal4u

#include <stdio.h>

void dump(int n, int *a)
{
	int i;

	printf("%d", a[0]);
	for (i = 1; i < n; i++) printf(" %d", a[i]);
	putchar('\n');
}

void insertion_sort(int n, int *a)
{
	int i, j, key;

	dump(n, a);
	for (i = 1; i < n; i++) {
		key = a[i];
		j = i-1;
		while (j >= 0 && a[j] > key) a[j+1] = a[j], j--;
		a[j+1] = key;
		dump(n, a);
	}
}

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0, c = getchar_unlocked();
	do n = 10*n + (c & 0xf), c = getchar_unlocked(); while (c >= '0');
	return n;
}

#define MAX_N 102
int a[MAX_N];

int main()
{
	int N, i;

	N = in();
	for (i = 0; i < N; i++) a[i] = in();
	insertion_sort(N, a);
	return 0;
}



Measured memory_bytes: 2040
#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>

#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <deque>

#include <algorithm>

using namespace std;
int main(int argc, char *argv[]) {
	int n, m;
	cin >> n >> m;
	vector<vector<int> > vv;
	for (int i = 0; i < m; i++) {
		vector<int> v;
		int k;
		cin >> k;
		for (int j = 0; j < k; j++) {
			int t;
			cin >> t;
			v.push_back(t - 1);
		}
		vv.push_back(v);
	}
	vector<int> b;
	for (int i = 0; i < m; i++) {
		int t;
		cin >> t;
		b.push_back(t);
	}
	int res = 0;

	for (int i = 0; i < pow(2, n); i++) {
		vector<int> sw (n, 0);
		int ii = i;
		int index = 0;
		while (ii > 0) {
			sw[index++] = ii % 2;
			ii /= 2;
		}
		int flag = 1;
		for (int j = 0; j < m; j++) {
			int c = 0;
			for (int k = 0; k < vv[j].size(); k++) {
				if (sw[vv[j][k]] == 1) {
					c = 1 - c;
				}
			}
			if (c != b[j])
				flag = 0;
			if (flag == 0)
				break;
		}
		res += flag;
	}
	cout << res << endl;
}



Measured memory_bytes: 384
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val Array(h, w) = sc.nextLine.split(" ").map(_.toInt)
  val seqs = Seq.fill(h)(sc.nextLine.split("").toSeq.filter(_.nonEmpty).zipWithIndex).zipWithIndex
  
  def findOpt[T](index: Int, seq: Seq[(T, Int)]): Option[T] = {
    import scala.util.Try
    Try(seq.map{case (t, index) => t}.apply(index)).toOption
  }
  
  val results = seqs.map{ case (seq, seqIndex) =>
    val preSeq = findOpt(seqIndex - 1, seqs)
    val curSeq = findOpt(seqIndex, seqs)
    val nextSeq = findOpt(seqIndex + 1, seqs)

    seq.map { case (e, eIndex) =>
      if (e == "#" ) "#"
      else Seq(preSeq.flatMap(findOpt(eIndex - 1, _)),
              preSeq.flatMap(findOpt(eIndex, _)),
              preSeq.flatMap(findOpt(eIndex + 1, _)),
              curSeq.flatMap(findOpt(eIndex - 1, _)),
              curSeq.flatMap(findOpt(eIndex + 1, _)),
              nextSeq.flatMap(findOpt(eIndex - 1, _)),
              nextSeq.flatMap(findOpt(eIndex, _)),
              nextSeq.flatMap(findOpt(eIndex + 1, _))
             ).count(_.contains("#")).toString
    }
  }
  
  results.foreach(seq => println(seq.mkString))
}

Measured memory_bytes: 37592
#include <bits/stdc++.h>
#define rep(i, n, s) for (int i = s; i < n; i++)
#define graph map<int, vector<int>>
#define field vector<vector<int>>
using namespace std;
int main()
{
    int x;
    cin >> x;
    if (599 >= x)
    {
        cout << 8 << endl;
    }
    else if (799 >= x)
    {
        cout << 7 << endl;
    }
    else if (999 >= x)
    {
        cout << 6 << endl;
    }
    else if (1199 >= x)
    {
        cout << 5 << endl;
    }
    else if (1399 >= x)
    {
        cout << 4 << endl;
    }
    else if (1599 >= x)
    {
        cout << 3 << endl;
    }
    else if (1799 >= x)
    {
        cout << 2 << endl;
    }
    else if (1999 >= x)
    {
        cout << 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 3636
#include<stdio.h>
#include<string.h>
int main()
{   int i,j,l,lIV,c = 0;
    char str1[101];
    char str2[101];
    scanf("%s%s",&str1,&str2);
    l = strlen(str1);
    for(i=0; i<l; i++) {
        if(strcmp(str1,str2)==0) {
            c= 1;
            break;
        }
        lIV= str2[l-1];
        for(j=l-1; j>0; j--) {
            str2[j] = str2[j-1];
        }
        str2[j] = lIV;
        str2[l] = '\0';
    }
    if(c == 1 ) printf("Yes\n");
    else printf("No\n");
    return 0;
}


Measured memory_bytes: 2064
N = int(input())
S = input()
min_turn = 300000
wnum = 0
for i in range(N):
    if i == 0:
        enum = S[1:].count('E')
    if (1 <= i) and (S[i] == 'E'):
        enum -= 1
    if (1 <= i) and (S[i-1] == 'W'):
        wnum += 1
    turn = enum + wnum
    if min_turn > turn:
        min_turn = turn
print(min_turn)

Measured memory_bytes: 3700
//#pragma GCC optimize("O3")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
//#pragma GCC optimize ("unroll-loops")
#include <bits/stdc++.h>

using namespace std;

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

const int N = 1000;
int f[N][N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    for (int i = a; i < w; i++) {
        for (int j = 0; j < b; j++) {
            f[j][i] = 1;
        }
    }
    for (int i = 0; i < a; i++) {
        for (int j = b; j < b * 2; j++) {
            f[j][i] = 1;
        }
    }
    for (int i = a; i < w; i++) {
        for (int j = b * 2; j < h; j++) {
            f[j][i] = 1;
        }
    }
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cout << f[i][j];
        }
        cout << '\n';
    }
    return 0;
}

Measured memory_bytes: 5120
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        a: i64,
        b: i64,
        p: [i64; n],
    }

    let mut p1 = 0;
    let mut p2 = 0;
    let mut p3 = 0;

    use std::cmp::min;

    for &p in p.iter() {
        if p <= a {
            p1 += 1;
        } else if p <= b {
            p2 += 1;
        } else {
            p3 += 1;
        }
    }

    let ans = min(p1, min(p2, p3));

    println!("{}", ans);
}


Measured memory_bytes: 4352
fun main(args: Array<String>) {
    val b = readLine()!!

    println(b.map {
        when (it) {
            'A' -> 'T'
            'C' -> 'G'
            'G' -> 'C'
            'T' -> 'A'
            else -> it
        }
    }.joinToString(""))
}

Measured memory_bytes: 33692
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000000007;
#define ll long long

int main()
{
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int x = c - a;
	int y = d - b;
	cout << c - y << " " << d + x << " " << a - y << " " << b + x << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
typedef pair<int,int> pa;
#define w1 first
#define w2 second
#define ls (x<<1)
#define rs (x<<1|1)
#define pb push_back
#define mp make_pair
#define mid ((l+r)>>1)
#define SZ(x) ((x).size())
#define All(x) (x).begin(),(x).end()
#define rep(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)
#define rep2(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define per(i,a,b) for(int (i)=(a);(i)>=(b);(i)--)
#define Rep(p,x) for(int (p)=head[(x)];(p);(p)=nxt[(p)])
template<class T>void read(T&num){
	num=0;T f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')num=num*10+ch-'0',ch=getchar();
	num*=f;
}
int power(int x,int k,int p){int res=1;for(;k;k>>=1,x=1ll*x*x%p)if(k&1)res=1ll*res*x%p;return res;}
int getgcd(int x,int y){return !x?y:getgcd(y%x,x);}
const int maxn=1e5+5,mod=1e9+7;
int n,m,ans;
int x[maxn];
int add(int x,int y){return x+y>=mod?x+y-mod:x+y;}
struct mat{
	int a[3][3];
	mat(){memset(a,0,sizeof a);}
	friend mat operator+(mat A,mat B){
		mat C;
		rep(i,0,2)rep(j,0,2)C.a[i][j]=add(A.a[i][j],B.a[i][j]);
		return C;
	}
	friend mat operator*(mat A,mat B){
		mat C;
		rep(i,0,2)rep(j,0,2)rep(k,0,2)C.a[i][j]=(C.a[i][j]+1ll*A.a[i][k]*B.a[k][j])%mod;
		return C;
	}
	friend void print(mat A){
		puts("---");
		rep(i,0,2){
			rep(j,0,2)printf("%d ",A.a[i][j]);
			puts("");
		}
		puts("---");
	}
}I,F,Trans1,Trans2;
mat Power(mat A,int k){
	mat Res=I;
	for(;k;k>>=1,A=A*A)if(k&1)Res=Res*A;
	return Res;
}
int main(){
	read(n);read(m);
	rep(i,1,m)read(x[i]);
	rep(i,0,2)I.a[i][i]=1;
	Trans1.a[2][2]=2;Trans1.a[2][1]=2;Trans1.a[2][0]=1;
	Trans1.a[1][2]=1;Trans1.a[1][1]=1;Trans1.a[1][0]=1;
	Trans1.a[0][0]=1;Trans1.a[0][2]=1;
	Trans2=Trans1;
	Trans2.a[2][2]--;Trans2.a[1][2]--;Trans2.a[0][2]--;
	F.a[0][0]=F.a[1][0]=F.a[2][0]=1;
	rep(i,1,m){
		F=Power(Trans1,x[i]-x[i-1]-1)*F;
		F=Trans2*F;
	}
	F=Power(Trans1,n-x[m]-1)*F;
	printf("%d\n",F.a[2][0]);
	return 0;
}

Measured memory_bytes: 640
n = int(input())

count = [[0] * 10 for _ in range(10)]

for i in range(1, n + 1):
    now = str(i)
    pre, pos = int(now[0]), int(now[-1])
    if pos == 0: continue
    count[pre][pos] += 1

res = 0
for i in range(1, 10):
    for j in range(1, 10):
        res += count[i][j] * count[j][i]

print(res)



Measured memory_bytes: 73528
#include<iostream>
#include<map>
#include<algorithm>
#include <iomanip>
#include <cmath>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <vector>
#include <bitset>
#include <queue>
#include <set>
#include <stack>
#include <string>

using namespace std;

int main() {
	int H, W, h, w; cin >> H >> W >> h >> w;
	cout << (W - w)*(H - h) << endl;

}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(void){
    ll n;
    ll ans = 0;
    cin >> n;
    int a[1000001];
    for(ll i=2;i<=1000000;i++){
        a[i]=0;
    }
    for(ll i=2;i<=1000000;i++){
        while(n%i==0){
            a[i]++;
            n/=i;
        }
    }
    ll b[11] = {0,1,3,6,10,15,21,28,36,45,55};
    for(ll i=2;i<=1000000;i++){
        for(int j=0;j<=9;j++){
            if(b[j]<=a[i]&&a[i]<b[j+1])ans+=j;
        }
    }
    if(n>=1000001)ans++;
    cout << ans << endl;
    return 0;
}

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

using namespace std;

int main(){
    int n=0;
    string a,b;
    cin >>a>>b;
    for(int i=0;i<3;i++){
        if(a.substr(i,1)==b.substr(i,1))n++;
    }
    cout << n;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
    string s1,s2,s3,a,A;
    cin>>s1>>s2>>s3;
    string ans;
    ans += (char) (s1[0]-'a'+'A');
    ans += (char) (s2[0]-'a'+'A');
    ans += (char) (s3[0]-'a'+'A');

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


Measured memory_bytes: 3596
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <functional>
using namespace std;


int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    string s;
    cin >> s;
    
    int fs = 300000, ls = 0;

    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'A' && i < fs) {
            fs = i;
        }
        if (s[i] == 'Z') {
            ls = i;
        }
    }
    cout << ls - fs + 1 << endl;
	return 0;
}

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

int main(void) {
  int A, B;
  cin >> A >> B;
  cout << (A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0 ? "Possible"
                                                        : "Impossible")
       << endl;
  return 0;
}

Measured memory_bytes: 384