akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define long long long
#define up(i,a,b) for (int i=a; i<=b; i++)
#define down(i,a,b) for (int i=a; i>=b; i--)
#define endl '\n'
#define X first
#define Y second
#define II pair<int, int>
#define III pair<int, pair<int, int> >
#define debug(X) cerr<< #X << " = " <<X << endl
#define debug2(X,Y) cerr<< #X << " = " <<X << ","<<#Y<<" = "<<Y<<endl
#define show(X,a,b) {cerr << #X << " = "; up(__,a,b) cerr << X[__] << ' '; cerr << endl;}
#define gc getchar
#define pc putchar
using namespace std;

inline void read(int &x)
{
    register int c = gc();
    x = 0;
    int neg = 0;
    for (;((c<48 || c>57) && c != '-') ;c = gc());
    if(c=='-') {neg=1;c=gc();}
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}
inline void writeln(int x){

         char buffor[21];
         register int i=0;
         int neg=0; if (x<0) {neg=1; x= -x;}
         do{
               buffor[i++]=(x%10)+'0';
               x/=10;
            } while(x);
           i--;
           if (neg) pc('-');
           while(i>=0) pc(buffor[i--]);
           pc('\n');
       }
long Ai,Ao,At,Aj,Al,As,Az;
long res= 0;

void solve()
{
	res= 0;
	res+= Ao;
	if (Aj%2==0 and Al%2== 0) res+= Aj+ Al+ Ai- ((Ai%2==0)?0:1);
	else if (Aj%2==1 and Al%2== 1)
	{
		res+= (Aj-1)+ (Al-1);
        if (Ai%2== 1) res+= 3+ (Ai-1);
        else
		{
			if (Ai!=0) res+= 3+ (Ai-2);
		}
	}
	else
	{
        if (Al%2==1) swap(Aj,Al);
        if (Ai%2== 0) res+= Ai+ Aj-1+ Al;
        else
		{
            if (Al!= 0) res+= Ai-1+ Aj-1+ Al-2+ 3;
            else res+= Ai-1+ Aj-1;
		}
	}
	cout<<res<<endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);// don't use when interactive

    #ifdef I_Love_Pork
    #define TASK "tmp"
    freopen(TASK".inp","r",stdin);
    freopen(TASK".out","w",stdout);
	  #endif
	while (cin>>Ai>>Ao>>At>>Aj>>Al>>As>>Az)
	{
    solve();
	
	}
    return 0;
}


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

int main()
{
  int n;
  vector<int> v;

  cin >> n;
  for (int i = 0; i < n; ++i) {
    int d;
    cin >> d;
    v.push_back(d);
  }
  sort(v.begin(), v.end());
  cout << v[n/2] - v[n/2 - 1];

  return 0;
}


Measured memory_bytes: 892
# int(input()) # 入力が1つ
a, b, k = map(int, input().split()) # 入力が複数
# [int(i) for i in input().split()] # 配列で数字

ans = []

if a + k > b:
    for i in range(a, b + 1):
        ans.append(i)
else:
    for i in range(a, a + k):
        ans.append(i)
    for i in range(b - k + 1, b + 1):
        ans.append(i)
ans = list(set(ans))
ans.sort()
for a in ans:
    print(a)

Measured memory_bytes: 38608
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			String str = scan.nextLine();
			if(str.equals("END OF INPUT")){
				break;
			}
			String[] nstr = str.split(" ");
			for(int i = 0;i < nstr.length;i++){
				System.out.print(nstr[i].length());
			}
			System.out.println();
		}
	}
}

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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int n, k;
    cin >> n >> k;
    vi p(n);
    rep(i, n) cin >> p[i];
    int ans = 0;
    rep(i, k) {
        pii m = pii(INF, -1);
        rep(j, n) m = min(m, pii(p[j], j));
        ans += m.first;
        p[m.second] = INF;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
int n;
int a[200005];
vector<ii> s;
bool test(int x){
    //printf("test %d\n",x);
    s.clear();
    for (int i = 1; i <= n; i++){
        //printf("now %d\n",a[i]);
        if (a[i] > a[i-1]){
            s.push_back(ii(a[i]-a[i-1],0));
        }
        else{
            int num = a[i-1];
            while (num > a[i]){
                ii cur = s.back(); s.pop_back();
                int d = cur.first, ch = cur.second;
                if (num-d < a[i]){
                    s.push_back({d-num+a[i],ch});
                    num = a[i];
                }
                else{
                    num -= d;
                }
            }
            int ct = 0;
            while (s.size() && s.back().second == x-1){
                ct += s.back().first;
                s.pop_back();
            }
            if (s.size() == 0) return false;
            int pct = s.back().first, pid = s.back().second; s.pop_back();
            if (pct-1) s.push_back({pct-1,pid});
            s.push_back({1,pid+1});
            if (ct) s.push_back({ct,0});
        }

        for (auto x : s){
            //printf("%d %d\n",x.first,x.second);
        }
    }
    return true;
}
int main(){
    scanf("%d",&n);
    for (int i = 1 ; i <= n; i++){
        scanf("%d",&a[i]);
    }
    int lo = 1, hi = n;
    while (lo < hi){
        int mid = (lo+hi)/2;
        if (test(mid)){
            hi = mid;
        }
        else lo = mid+1;
    }
    printf("%d",lo);

}



Measured memory_bytes: 6084
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
sosu = 0
n = int(input())
while sosu == 0:
    #print (make_divisors(n))
    if 2 == len(make_divisors(n)):
        sosu = 1
    else:
        n +=1
print (n)

Measured memory_bytes: 38640
//#include <bits/stdc++.h>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <map>
#include <stack>
#include <bitset>
#include <array>
#include <set>
#include <string>

#include <iterator>
#include <algorithm>
#include <numeric>

#include <ios>
#include <sstream>
#include <iostream>
#include <fstream>

#include <climits>
#include <cmath>

using namespace std;

using ll=long long;

using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;

void OUT(bool isTrue, string t="YES", string f="NO"){
    cout<<(isTrue?t:f)<<endl;
}
void out(bool isTrue, string t="yes", string f="yes"){
    cout<<(isTrue?t:f)<<endl;
}

template <typename T>
string printItr(T b, T e, string delim=" ")
{
    stringstream ss;
    ostream_iterator<decltype(*b)> out_it(ss, delim.c_str());
    copy(b,e - 1, out_it);
    ss<<*(e-1);
    return ss.str();
}

void bulk(){}
template <class Head, class... Tail>
void bulk(Head& head, Tail&... tail){
    cin>>head;
    bulk(tail...);
}

#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define range(i,m,n) for(int i=m; i<n;i++)
#define each(i,n) for(auto i:n)
#define all(i) i.begin(),i.end()
#define cint(...) int __VA_ARGS__;bulk(__VA_ARGS__);

int main(void){
    cint(n,k);
    vi a(k),b;
    rep(i,k){cin>>a[i];}
    range(p,n,1000000){
        bool is=true;
        rep(i,(int)log10(p)+1){
            is&=!binary_search(all(a),p/((int)pow(10,i))%10);
        }
        if(is){cout<<p;break;}
    }
}

Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
using namespace std;

#define rep(i, s) for (int i = 0; i < s; ++i)
#define all(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<ll, ll>
/*
sort(sp.begin(), sp.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
*/

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    ll n,m;
    cin>>n>>m;
    vector<pair<ll, ll> >ab(n+1);
    for(ll i=0;i<n;i++){
        cin>>ab.at(i).first>>ab.at(i).second;
    }
    ab.at(n).first=999999999999999;
    ab.at(n).second=0;
    sort(ab.begin(), ab.end(), [](PAIR l, PAIR r){
        return l.first<r.first || (l.first==r.first && l.second > r.second);
        });
    // cout<<"AAA"<<endl;
    // for(ll i=0;i<n+1;i++){
    //     cout<<ab.at(i).first<<" "<<ab.at(i).second<<endl;
    // }
    ll ans=0;
    ll day=m;
    priority_queue<ll>a;

    for(ll i=0;i<n+1;i++){
        while(ab.at(i).first+day<=m){
            // cout<<"i:"<<i<<endl;
            a.push(ab.at(i).second);
            i++;
            if(i>=n)break;
        }
        if(a.size()!=0){
            ans+=a.top();
            // cout<<ab.at(i-1).first<<endl;
            // cout<<a.top()<<endl;
            a.pop();
            // cout<<"AAA"<<endl;
        }
        day--;
        i--;
        // cout<<a.size() << "ans:" << ans<<endl;
        if(day<0)break;
    }
    // for(int i=0;i<n;i++){
    //     cout<<ab.at(i).first<<" "<<ab.at(i).second<<endl;
    // }

    cout<<ans<<endl;







    return 0;
}


Measured memory_bytes: 2936
import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        int input = Integer.parseInt(str);

        if (input >= 30) println("Yes");
        else println("No");
    }

    public static void println(String msg){
        System.out.println(msg);
    }

}


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

using namespace std;

int main()
{
    string S;
    cin >> S;
    if(S[0] == S[1] && S[1] == S[2])
    {
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
    }
    
}

Measured memory_bytes: 256
// ABC146A.cpp :
//#include "pch.h"
#include <iostream>
#include<string> // string型を使う
#include<vector> // vectorを使う
using namespace std;
int main()
{
	string S;
	cin >> S;
	string W="SUN,MON,TUE,WED,THU,FRI,SAT";

	int ans = W.find(S);
	cout << 7-ans/4 << endl;
}

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

using namespace std;

int vet[112], prefix[112], suffix[112];

int main() {
	int n, sum=0;
	
	scanf("%d", &n);
	
	for (int i=0; i<n; ++i) {
		scanf("%d", &vet[i]);
		sum+=vet[i];
		if (i) 
			prefix[i] = prefix[i-1] + vet[i];
		else
			prefix[i] = vet[i];
	}
	
	int resp = 1e9;
	for (int i=0; i<n; ++i) {
		resp = min(resp, abs(prefix[i] - (sum-prefix[i])) );
	}
		
	printf("%d\n", resp);
	
	
	return 0;
}

Measured memory_bytes: 256
import re
pattern = r'[ACGT]+'
ans = 0
# text = 'SHINJUKU'
text = input()
match_list = re.findall(pattern, text)

# print(match_list)
if match_list:
    match_list_len = [len(x) for x in match_list]
    ans = max(match_list_len)

print(ans)


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

int main(){
	int n;
	cin>>n;
	int a=n/1000;
	int b=n%1000/100;
	int c=n%100/10;
	int d=n%10;
	if(a==b||b==c||c==d)
		cout<<"Bad";
	else cout<<"Good";
	return 0;
} 

Measured memory_bytes: 256
#include <stdio.h> 
 
 
 int main(){ 
     int i, n; 
     int arr[100]; 
     scanf("%d", &n); 
     for(i=0;i<n;i++){ 
         scanf(" %d", &arr[i]); 
     } 
     for(i=0;i<n;i++){ 
         if(i)printf(" "); 
         printf("%d", arr[n-i-1]); 
     } 
     printf("\n"); 
     return 0;
 }



Measured memory_bytes: 2044
#include <iostream>
#include <cstdio>
#include <algorithm>
#define mem(i,a) memset(i,a,sizeof(i))
#define PI acos(-1.0)
#define DMAX 105
#define MOD 20190823
#define eps 1e-8
#define bl bool
#define INF 1e+9
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
template<class T> inline void read(T &f){
	f=0;
    T x=1;
    char ch=getchar();
    while(ch<48 || ch>57) {
        if(ch=='-') {
            x=-1;
        }
        ch=getchar();
    }
    while(ch<=57 && ch>=48) {
        f=f*10+ch-'0';
        ch=getchar();
    }
    f*=x;
}
ll n;
ll a[DMAX];
int main(){
	read(n);
	ll ans=0;
	for(ll i=1;i<=n-1;i++){
		read(a[i]);
	}
	ans+=a[1];
	ans+=a[n-1];
	for(ll i=2;i<=n-1;i++){
		ans+=min(a[i-1],a[i]);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B, C, X;
  cin >> A;   //500円玉の枚数
  cin >> B;   //100円玉の枚数
  cin >> C;   //50円玉の枚数
  cin >> X;    //目標合計金額
  
  int count = 0;    //目標合計金額になる払い方の種類

  for(int i = 0; i <= A; i++){                //500円玉の枚数 0 <= i <= A
    for(int j = 0; j <= B; j++){              //100円玉の枚数 0 <= j <= B
      for(int k = 0; k <= C; k++){        //50円玉の枚数    0 <= k <= C
        if(500 * i + 100 * j + 50 * k == X)              //計算量はN^3だが、A,B,Cの上限が低いのでOK
          count++;
      }
    }
  }

  cout << count << endl;

}

Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))

ans = []

l1 = A[0::2]
l2 = A[1::2]
if N % 2 == 0:
    l2 = l2[::-1]
    ans = l2+l1
else:
    l1 = l1[::-1]
    ans = l1+l2

print(" ".join(list(map(str, ans))))


Measured memory_bytes: 31172
#include <iostream>
#include <vector>
#include <algorithm>

using ll = long long;
using namespace std;

/* initialize */
int n;
int c[15000];
int A[2000001];
void countingsort(int A[], int k){

    for (int i = 0; i < k; ++i) {
        c[i] = 0;
    }
    for (int j = 0; j < n; ++j) {
        c[A[j]]++;
    }
}
/* main */
int main() {
    cin >> n;
    int co = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", &A[i]);
    }
    countingsort(A, 15000);
    for (int j = 0; j < 12000; j++) {
        if (c[j]) {
            for (int i = 0; i < c[j];++i) {
                co++;
                if(co != n) printf("%d ", j);
                else {printf("%d\n", j); return 0;}
            }
        }
    }
    return 0;
}


Measured memory_bytes: 11048
h, n = map(int, input().split())


l = []
for i in range(n):
  a, b = map(int, input().split())
  l.append((a, b))
m = max(l, key=lambda x: x[0])[0]
dp = [9]*(h+m+1)
dp[0] = 0
for i in range(1, h+m+1):
  dp[i] = min([dp[i-l[j][0]]+l[j][1] for j in range(n)])
print(min(dp[h:h+m]))

Measured memory_bytes: 42588
#include "iostream"
#include "string"
#include "cstdio"

using namespace std;

int main()
{
    int N, K;
    scanf("%d%d", &N, &K);
    char have[N + 1] = {0};

    while(K--)
    {
        int s_num;
        scanf("%d", &s_num);
        while(s_num--)
        {
            int snukes;
            scanf("%d", &snukes);
            have[snukes] = 1;
        }
    }

    int count = 0;
    for(int i=1; i<=N; ++i)
    {
        if(have[i] == 0)
            count++;
    }
    printf("%d\n", count);

    return 0;
}

Measured memory_bytes: 3816
// "include" {{{
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
#include <iomanip>
#include <tuple>
// }}}
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define pii pair<int,int> 
#define int long long
#define setout(n,x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10)
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const long long mod = 1000000007;

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	int k;
	cin >> s >> k;
	int n = s.size();
	rep(i,n-1){
		if(s[i] == 'a') continue;
		if('z' + 1 - s[i] > k) continue;
		k -= ('z'+1 - s[i]);
		s[i] = 'a';
	}
	k %= 26;
	if(s[n-1] + k > 'z'){
		k -= 'z' - s[n-1] + 1;
		s[n-1] = 'a';
	}
	s[n-1] += k;
	cout << s << '\n';
	return 0;
}


Measured memory_bytes: 592
use std::cmp::Ordering;
use whiteread::parse_line;

fn main() {
    let n: usize = parse_line().unwrap();
    let a: Vec<u32> = parse_line().unwrap();
    let mut cnt = 1;

    if n != 1 {
        let mut ord = a[0].cmp(&a[1]);

        for i in 1..n - 1 {
            let nord = a[i].cmp(&a[i + 1]);
            match ord {
                Ordering::Equal => ord = nord,
                Ordering::Less => {
                    if nord == Ordering::Greater {
                        cnt += 1;
                        ord = Ordering::Equal;
                    }
                }
                Ordering::Greater => {
                    if nord == Ordering::Less {
                        cnt += 1;
                        ord = Ordering::Equal;
                    }
                }
            }
        }
    }
    println!("{}", cnt);
}


Measured memory_bytes: 3432
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	int A,B,C;
	int[] cnt;
	public void solve() {
		A = nextInt();
		B = nextInt();
		C = nextInt();
		cnt = new int[8];
		cnt[A]++;
		cnt[B]++;
		cnt[C]++;

		if(cnt[7] == 1 && cnt[5] == 2){
			out.println("YES");
		}else{
			out.println("NO");
		}

	}

	public static void main(String[] args) {
		out.flush();
		new Main().solve();
		out.close();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

Measured memory_bytes: 8020
a = [[[0 for _ in range(10)] for _ in range(3)] for _ in range(4)]

n = int(input())

for i in range(n):
    b, f, r, v = map(int, input().split())
    a[b - 1][f - 1][r - 1] += v

for i, j in enumerate(a):
    for k in j:
        for l in k:
            print(' ' + str(l), end='')
        print()
    if i < len(a) - 1:
        print('#'*20, sep='')


Measured memory_bytes: 5624
#include <iostream>
using namespace std;
int main(void){
    int n[4];
    
    for (int i = 0; i < 4; i++) {
        cin >> n[i];
    }
    
    int s = 0, k = 1;
    for (int i = 0; i < 4; i++) {
        s += n[i];
        k *= n[i];
    }
    
    if (s == 21 && k == 252) cout << "YES";
    else cout << "NO";
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int i, j, k, H, W;

  for (i=0; ; i++){
    scanf("%d %d", &H, &W);

    if ( !H && !W)
      break;

    if ((H==1) && (W==1)){
      printf("#\n\n");
      continue;
    }

    for (j=0; j < H/2; j++){
      for (k=0; k < W/2; k++)
	printf("#.");
      if (W%2)
	printf("#");
      printf("\n");
      
      for (k=0; k < W/2; k++)
	printf(".#");
      if (W%2)
	printf(".");
      printf("\n");
    }
    if (H%2){
      for (k=0; k < W/2; k++)
	printf("#.");
      if (W%2)
	printf("#");
      printf("\n");
    }

    printf("\n");
  }

  return 0;
}

      

Measured memory_bytes: 1028
n = int(input())
stat2id = {
  "AC": 0,
  "WA": 1,
  "TLE": 2,
  "RE": 3,
}
id2stat = {i:s for s,i in stat2id.items()}
count = [0 for _ in range(4)]

for i in range(n):
  s = input()
  count[stat2id[s]] += 1
for i, c in enumerate(count):
  print(id2stat[i], "x", c)


Measured memory_bytes: 9116
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,N,ans=0;
  bool b;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>N;
    b=true;
    if(N<2 || N%2==0) b=false;
    if(N==2) b=true;
    for(int j=3;j<=sqrt(N);j++){
      if(N%j==0){
	b=false;
	break;
      }
    }
    if(b) ans++;
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 3076
/*Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.

My little horse must think it queer
To stop without a farmhouse near
Between the woods and frozen lake
The darkest evening of the year.

He gives his harness bells a shake
To ask if there is some mistake.
The only other sound’s the sweep
Of easy wind and downy flake.

The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.*/

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
const int maxn= 100010;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=0,k=0;string s;
    cin>>n>>k;
    cin>>s;
    s[k-1]=tolower(s[k-1]);
    cout<<s<<endl;
}

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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;

Node root,NIL;

Node treeMinimum(Node x){
  while(x->left!=NIL)
    x=x->left;
      return x;
}

Node treeMaximum(Node x){
while(x->right!=NIL)
  x=x->right;
      return x;
}

Node treeSearch(Node u, int k){
  while(u!=NIL && k!=u->key){
    if(k<u->key) u=u->left;
    else u=u->right;
  }
  return u;
}

Node treeSuccessor(Node x){
  if(x->right!=NIL)
    return treeMaximum(x->right);

 Node  y=x->parent;
  while(y!=NIL && x==y->right){
    x=y;
    y=y->parent;
  }
  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y

  if(z->left==NIL || z->right==NIL) y=z;
  else y=treeSuccessor(z);

  if(y->left!=NIL) x=y->left;
  else x=y->right;

  if(x!=NIL) x->parent=y->parent;
  if(y->parent==NIL) root=x;
  else if (y==y->parent->left) y->parent->left=x;
  else y->parent->right=x;
  if(y!=z) z->key=y->key;
}

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x!=NIL){
    y=x;
    if(z->key<x->key) x=x->left;
    else x=x->right;
  }
    z->parent=y;

    if(y==NIL) root=z;
    else if (z->key<y->key) y->left=z;
    else y->right=z;
  }

void inorder(Node u){
if(u==NIL) return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
}
void preorder(Node u){
if(u==NIL) return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }

  return 0;
}



Measured memory_bytes: 20536
using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;

class Program
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        bool[,] f = new bool[n, 10];
        for (int i = 0; i < n; i++)
        {
            string[] cin = Console.ReadLine().Split();
            for (int j = 0; j < 10; j++)
            {
                if (cin[j] == "1") f[i, j] = true;
                else f[i, j] = false;
            }
        }
        long[][] p = new long[n][];
        for (int i = 0; i < n; i++)
        {
            p[i] = Console.ReadLine().Split().Select(t => long.Parse(t)).ToArray();
        }

        long ans = long.MinValue;
        for (int i = 1; i < 1 << 10; i++)
        {
            int[] x = new int[n];
            for (int j = 0; j < 10; j++)
            {
                if ((1 & i >> j) == 1)
                {
                    for (int k = 0; k < n; k++)
                    {
                        if (f[k, j]) x[k]++;
                    }
                }
            }
            long sum = 0;
            for (int j = 0; j < n; j++)
            {
                sum += p[j][x[j]];
            }
            ans = Math.Max(ans, sum);
        }
        Console.WriteLine(ans);
    }
}

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

int main() {
    ll N,A,B;
    cin >> N >> A >> B;
    ll n = (N/(A+B))*A;
    ll c;
    if(N%(A+B) <= A) c = N%(A+B);
    else c = A;
    ll ans = n+c;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
int main(void){
	unsigned long i,N,K,sum=0;
	scanf("%lu%lu",&N,&K);
	for(i=K+1;i <= N;i++){
		if(N%i >=K && K > 0)sum += N - ((N/i)*K + K-1);
		else if(N%i >=K && K == 0)sum += N - ((N/i)*K);
		else sum += N - ((N/i)*K + N%i);
	}	
	printf("%lu\n",sum);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 128
"use strict";

const input = require("fs").readFileSync("/dev/stdin", "utf8");

const N = Number(input);
const main = N => {
  const digit = String(N).length;
  switch (digit) {
    case 1:
      // 1桁の場合 => 数値そのもの
      return N;
      break;
    case 2:
      // 2桁の場合 => 9
      return 9;
      break;
    case 3:
      // 3桁の場合 => 9 + 数値そのもの + 1
      return 9 + 1 + (N - 100);
      break;
    case 4:
      // 4桁の場合 => 9 + 900
      return 9 + 900;
      break;
    case 5:
      // 5桁の場合 => 9 + 900 + 数値そのもの + 1
      return 9 + 900 + 1 + (N - 10000);
      break;
    case 6:
      // 6桁の場合 => 9 + 900 + 90000
      return 9 + 900 + 90000;
      break;
  }

  return N;
};

console.log(main(N));

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

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

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using P = pair<int,int>;
using vl = vector<ll>; using vvl = vector<vl>;
#define mp make_pair
#define pb push_back
#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) for (int i=(n-1);i >= 0;i--)
#define all(v) v.begin(),v.end()
#define sz(v) (int)((v).size())
#define MAX(v) *max_element(all(v))
#define MIN(v) *min_element(all(v))
#define Sort(v) sort(all(v))
#define Rev(v) reverse(all(v))
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
#define VEC(type,name,size) vector<type> name(size);in(name)
#define vv(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define VV(type,name,h,w) vector<vector<type>>name(h,vector<type>(w));in(name)
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cout << H << " ";
    debug_out(T...);
}
#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
    for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
    return os;
}
inline void IN(void){return;}
template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){cin >> first;IN(rest...);return;}
template<class T>bool chmax(T &a, const T &b) {if(a<b){a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if(b<a){a=b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll mod = 1000000007;
const int dx[8] = {1,0,-1,0,1,1,-1,-1}; const int dy[8] = {0,1,0,-1,1,1,-1,-1};

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    string s;
    cin >> s;
    if(s[s.size()-1] == 's') s+="es";
    else s+="s";
    cout << s << endl;
}

Measured memory_bytes: 3652
import itertools

N, D = list(map(int, input().split()))
X = [list(map(int, input().split())) for _ in range(N)]

l = [i for i in range(N)]
C = list(itertools.combinations(l, 2))

a = 0
ans = 0
for c in C:
    a = 0
    for i in range(D):
        a += (X[c[0]][i] - X[c[1]][i]) ** 2
    a **= 0.5
    if a % 1 == 0:
        ans += 1
print(ans)

Measured memory_bytes: 3064
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	L, R, d := ReadInt(), ReadInt(), ReadInt()
	fmt.Println(R/d - (L-1)/d)
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 1840
object Main {
  def main(args: Array[String]): Unit = {
    val colors       = io.StdIn.readLine.split(" ")
    val nums         = io.StdIn.readLine.split(" ").map{_.toInt}
    val select_color = scala.io.StdIn.readLine
    if( select_color == colors( 0 ) ) println( ( nums( 0 ) - 1 ) + " " + nums( 1 ) )
    else                              println( nums( 0 ) + " " + ( nums( 1 ) - 1 ) )
  }
}

Measured memory_bytes: 54604
#include <bits/stdc++.h> 
using namespace std;
//関数
const long INF=1000000000000000;
const long MOD=1000000007;
bool check=false;


int main(void){
    long N;
    cin>>N;
    vector<long> B(N-1);
    for(int i=0;i<N-1;i++) cin>>B.at(i);
    
    long ans=B.at(0)+B.at(N-2);
    for(int i=1;i<N-1;i++) ans+=min(B.at(i-1),B.at(i));
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define For(i,a,b) for(int i=a;i<b;i++)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define mp make_pair
#define bit(n) (1LL<<(n))
#define F first
#define S second
#define debug(x) cerr << x << endl
#define Complex complex<double>
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;

/*
テストケース全てに目を通す
テストケースが2個以下だったらなんかある
N最小のコーナーケースがないか調べる
制約をしっかりと確認する（1からNまでの順列、全て異なる値などの制約も含め）
制約のn*mとn,mを読み違えない
操作の逆順を考える
オーバーフローしないか確かめる
Codeforcesではscanfを使う
modの引き算には+modをする
エラー出力は消す
エラー出力を消せ！！！！！
数値の区切り位置を誤読しない
cout << fixed;
cout << setprecision(n) << ans;
 */

int main() {
    int n;
    cin >> n;
    set<int> s;
    rep(i,n){
        int a;
        cin >> a;
        if(!s.insert(a).S){
            cout << "NO";
            return 0;
        }
    }
    cout << "YES";



    
}

/*
*/



Measured memory_bytes: 9600
s = input()
if s == "SUN":
  print(7)
if s == "SAT":
  print(1)
if s == "FRI":
  print(2)
if s == "THU":
  print(3)
if s == "WED":
  print(4)
if s == "TUE":
  print(5)
if s == "MON":
  print(6)


Measured memory_bytes: 38256
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll inf=1e9+7;
const ll mod=1e9+7;
int main(){
    ll ans=-1;
    ll a,b;cin>>a>>b;
    REP(i,1,1000000){
        ll c=i*8/100;
        ll d=i/10;
        if(c==a&&b==d){
            ans=i;
            break;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5+10;
char c[maxn];
int a[maxn],b[maxn];
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++) cin>>c[i];
	int ans=0x3f3f3f3f;
	for(int i=1;i<=n+1;i++){
		if(c[i]=='W') a[i]=a[i-1]+1;
		else a[i]=a[i-1];
	}
	for(int i=n;i>=0;i--){
		if(c[i]=='R') b[i]=b[i+1]+1;
		else b[i]=b[i+1];
	}
	for(int i=0;i<=n+1;i++){
		ans=min(ans,max(a[i],b[i+1]));
	}
	
	cout<<ans;
}

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

const int N = 1e3+23;
long long a[N], b[N], c[N];
vector<long long> d;

void solve() {
  int x, y, z, k; scanf("%d%d%d%d", &x, &y, &z, &k);
  for (int i = 0; i < x; ++i) scanf("%lld", a+i);
  for (int i = 0; i < y; ++i) scanf("%lld", b+i);
  for (int i = 0; i < z; ++i) scanf("%lld", c+i);
  for (int i = 0; i < x; ++i) {
    for (int j = 0; j < y; ++j) {
      d.push_back(a[i]+b[j]);
    }
  }
  sort(c, c+z, greater<long long>());
  sort(d.begin(), d.end(), greater<long long>());
  vector<long long> sperma;
  for (int i = 0; i < min(k, (int)d.size()); ++i) {
    for (int j = 0; j < z; ++j) {
      sperma.push_back(d[i]+c[j]);
    }
  }
  sort(sperma.begin(), sperma.end(), greater<long long>());
  for (long long e: sperma) {
    printf("%lld\n", e);
    if (--k <= 0) return;
  }
  return;
  priority_queue<pair<long long, pair<int, int>>> pq;
  pq.push({0, {0, 0}});
  while (!pq.empty()) {
  pipi:;
    int i = pq.top().second.first, j = pq.top().second.second;
    debug(pq.top().first);
    pq.pop();
    if (i+1 < d.size()) pq.push({d[i+1]+c[0], {i+1, 0}});
    for (; i < d.size(); ++i) {
      for (; j < z; ++j) {
	if (d[i]+c[j] < pq.top().first) {
	  pq.push({d[i]+c[j], {i, j}});
	  goto pipi;
	}
	printf("%lld\n", d[i]+c[j]);
	if (--k <= 0) return;
      }
    }
  }
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


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

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

  for(int i=0;i<=100000;i++){
    int tmp1=i*0.08;
    int tmp2=i*0.10;
    if(tmp1==A && tmp2==B){
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;

  return 0;
}


Measured memory_bytes: 256
while True:
    a, op, b = input().split()
    a = int(a)
    b = int(b)
    if op == "?":
        break
    elif op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    else:
        print(a // b)

Measured memory_bytes: 7656
i = [int(input()) for i in range(6)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[4] - i[2] > i[5]:
  temp += 1
if i[4] - i[1] > i[5]:
  temp += 1
if i[4] - i[0] > i[5]:
  temp += 1
if i[3] - i[2] > i[5]:
  temp += 1
if i[3] - i[1] > i[5]:
  temp += 1
if i[3] - i[0] > i[5]:
  temp += 1
if i[2] - i[1] > i[5]:
  temp += 1
if i[2] - i[0] > i[5]:
  temp += 1  
if i[1] - i[0] > i[5]:
  temp += 1  
if temp != 0:
  print(':(')
else:
  print('Yay!')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
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; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
    詰まった時に、別の分野の問題として考え直す（これdpでは？、グラフとしてみればいいのでは？）
    多くの問題はパターンマッチだが、パターンに落とし込むまでが難しく、そのための訓練としてわからない問題をあれこれ色々な角度から考察してみるのではないか
*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n == 0) return 1;

    ll res = modpow(x, n/2);
    if(n%2 == 0) return res*res%mod;
    else return res*res%mod*x%mod;
}

ll power(ll x, ll n){
    if(n == 0) return 1;

    ll res = power(x, n/2);
    if(n%2 == 0) return res*res;
    else return res*res*x;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };

/* <--------------------------------------------> */

typedef tuple<ll, ll, ll> T;

const ll inf = 1LL<<50;


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

    int a, b; cin >> a >> b;
    int h = 100, w = 100;
    vector<vector<char>> fi(101, vector<char>(101));

    for(int i=1; i<=50; ++i) for(int j=1; j<=100; ++j) fi[i][j] = '.';
    for(int i=51; i<=100; ++i) for(int j=1; j<=100; ++j) fi[i][j] = '#';

    --a; --b;
    for(int i=1; i<50; i+=2) for(int j=1; j<100; j+=2){
        if(b==0) break;
        fi[i][j] = '#';
        --b;
    }

    for(int i=52; i<=100; i+=2) for(int j=1; j<100; j+=2){
        if(a==0) break;
        fi[i][j] = '.';
        --a;
    }

    printf("100 100\n");
    for(int i=1; i<=100; ++i){
        for(int j=1; j<=100; ++j){
            cout << fi[i][j];
        }
        cout << endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

constexpr int MOD = 2;

long long power(long long x, long long n, long long mod = MOD) {
    if (n == 0) return 1;
    if (n % 2 == 0) return power(x * x % mod, n/2, mod);
    else return x * power(x, n-1, mod) % mod;
}

void solve() {
    int n;
    string s;
    cin >> n >> s;
    VI a(n);
    REP(i,0,n) a[i] = s[i] - '0';
    VI b(n-1);
    REP(i,0,n-1) b[i] = abs(a[i] - a[i+1]);
    bool is02 = true;
    REP(i,0,n-1) if (b[i] == 1) {
        is02 = false;
        break;
    }
    int ans = 0;
    if (is02) {
        bool odd = false;
        REP(i,0,n-1) {
            if (b[i] != 2) continue;
            if (((n-2) & i) != i) continue;
            odd = !odd;
        }
        if (odd) ans = 2;
    } else {
        bool odd = false;
        REP(i,0,n-1) {
            if (b[i] != 1) continue;
            if (((n-2) & i) != i) continue;
            odd = !odd;
        }
        if (odd) ans = 1;
    }
    cout << ans << endl;
    //REP(i,0,n-1) dump(b[i]);
}

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

Measured memory_bytes: 9220
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <queue>
using ll = long long;
using namespace std;
int main(){
    ll r,c;
    cin >> r >>c ;
    ll dot_c=0;
    vector<vector<ll>> vec(r,vector<ll>(c));
    for(int i=0;i<r;i++){
        string s;
        cin >> s;
        for(int j=0;j<c;j++){
            vec[i][j]=s[j];
            if(s[j]=='.'){
                dot_c++;
            }
        }
    }
    vector<vector<ll>> dist(r,vector<ll>(c));
    vector<vector<ll>> reg(r,vector<ll>(c,0));
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++){
            dist[i][j]=1e7;
        }
    }
    queue<pair<ll,ll>> q;
    q.push(pair<ll,ll>(0,0));
    dist[0][0]=0;
    //reg[0][0]=1;
    int dx[]={+1,0,-1,0};
    int dy[]={0,+1,0,-1};
//    vector<vector<bool>> reg((r,vector<bool>(c));
    while(!q.empty()){
        pair<ll,ll> p=q.front();
        q.pop();
        if(vec[p.first][p.second]=='#')continue;
        if(reg[p.first][p.second]==1)continue;
        
        reg[p.first][p.second]=1;
      //  cout<<p.first<<" "<<p.second<<endl;
        for(int i=0;i<4;i++){
            if(p.first+dy[i]>=0&&p.first+dy[i]<r&&p.second+dx[i]>=0&&p.second+dx[i]<c&&reg[p.first+dy[i]][p.second+dx[i]]==0&&vec[p.first+dy[i]][p.second+dx[i]]=='.'){
                q.push(pair<int,int>(p.first+dy[i],p.second+dx[i]));
                dist[p.first+dy[i]][p.second+dx[i]]=dist[p.first][p.second]+1;
            }
        }
    }
    if(dist[r-1][c-1]==1e7){
        cout<<-1<<endl;
    }else if(dot_c-dist[r-1][c-1]-1<0){
        cout<<0<<endl;
    }else{
        cout<<dot_c-dist[r-1][c-1]-1<<endl;
    }
  /*  for(int i=0;i<r;i++){
        for(int j=0;j<c;j++){
            cout<<dist[i][j]<<" ";
        }
        cout<<endl;
    }*/
}


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

int main() {
	int A[3][3], B[3][3], n, flag , b[10];

	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) cin >> A[i][j];
	}

	/*for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			cout << A[i][j] << " ";
		}
	}
	cout << endl;*/

	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) B[i][j] = 0;
	}

	cin >> n;
	for (int i = 0; i < n; i++) cin >> b[i];
	/*for (int i = 0; i < n; i++) {
		cout << b[i] << " ";
	}
	cout << endl;*/

	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			B[i][j] = 0;
			for (int k = 0; k < n; k++) {
				if (A[i][j] == b[k]) B[i][j] = 1;
			}
		}
	}

	/*for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			cout << B[i][j] << " ";
		}
	}
	cout << endl;*/

	flag = 0;
	for (int i = 0; i < 3; i++) {
		if (B[i][0] == 1 && B[i][1] == 1 && B[i][2] == 1) flag = 1;
	}
	for (int i = 0; i < 3; i++) {
		if (B[0][i] == 1 && B[1][i] == 1 && B[2][i] == 1) flag = 1;
	}

	if (B[0][0] == 1 && B[1][1] == 1 && B[2][2] == 1) flag = 1;
	if (B[0][2] == 1 && B[1][1] == 1 && B[2][0] == 1) flag = 1;

	if (flag == 1) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

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

typedef long long ll;
typedef pair<ll,ll> P;

const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;

#define rep(i, a, b) for(ll (i) = (a); (i) < (b);++i)

int main() {
	ll N, M;
	cin >> N >> M;
	if (N >= M * 2 - 1) {
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys


def solve(H: int, W: int, S: "List[str]"):
    DH = (1, 1, 1, 0, 0, -1, -1, -1)
    DW = (-1, 0, 1, -1, 1, -1, 0, 1)
    ans = [['#'] * W for _ in range(H)]
    for h in range(H):
        for w in range(W):
            if S[h][w] == '#':
                continue
            t = 0
            for dh, dw in zip(DH, DW):
                nh, nw = h + dh, w + dw
                if not(0 <= nh < H and 0 <= nw < W):
                    continue
                if S[nh][nw] == '#':
                    t += 1
            ans[h][w] = str(t)
    for a in ans:
        print(''.join(a))

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(H)]  # type: "List[str]"
    solve(H, W, S)

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()


Measured memory_bytes: 3188
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif




#define int long long
#define rng(i,l,r) for(size_t i=(l);i<(r);++i)
#define rep(i,n) rng(i,0,n)
#define gnr(i,l,r) for(size_t i=(r)-1;i>=(l);i--)
#define per(i,b) gnr(i,0,b)
#define ALL(obj) (obj).begin(), (obj).end()   //1,2,3,...
#define rALL(obj) (obj).rbegin(), (obj).rend()//...,3,2,1

using namespace std;


//constant
const int MOD = 1e9+7;
const int INF = 1e18;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1,1,0,-1,-1,-1,0,1};
const int dy8[8] = {0,1,1,1,0,-1,-1,-1};
const double pi = acos(-1);


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 gcd(int a,int b){return b?gcd(b,a%b):a;}
//*max_element(ALL(vector))
//count(ALL(vector),num) -> n
//memset(obj,value,sizeof(obj));




void solve(){
    
    // remove the bottom 3 lines when you submit this code.
    std::ifstream in("sample.txt");
    std::cin.rdbuf(in.rdbuf());

    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int x,y; cin >> x >> y;
    
    int ans = 0;
    while(x<=y){
        x *= 2;
        ans++;
    }
    cout << ans << endl;
    
    
    
    
}





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




Measured memory_bytes: 256