akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;

// template {{{  0 
// using {{{ 1
using ll = long long int;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%lld", &x)
#define Scll2(x,y) scanf("%lld%lld", &x, &y)
#define Scll3(x,y,z) scanf("%lld%lld%lld", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (2e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Repe(x,y,z) for(ll x = z; x < y; x++)
#define Rep(x,y) Repe(x,y,0)
#define RRepe(x,y,z) for(ll x = y-z-1; x >= 0; x--)
#define RRep(x,y) RRepe(x,y,0)
// }}} 2
// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n")
#define YESNO(a) (a)?printf("YES\n"):printf("NO\n")
// }}} 2
// }}} 1
// input {{{ 1
// }}} 1
// }}} 0

int main() {

    int N,M;
    Scd2(N,M);
    vi p(N);
    int x,y;
    vector<vi> e(N);
    Rep(i,N){
        Scd(p[i]);
        p[i]--;
    }
    Rep(i,M){
        Scd2(x,y);
        x--,y--;
        e[x].push_back(y);
        e[y].push_back(x);
    }

    int cnt = 0;
    vi gp(N,-1);

    stack<int> s;
    Rep(i,N){
        if( gp[i] != -1 ) continue;
        gp[i] = cnt;
        s.push(i);
        while(s.size()){
            int from = s.top();
            s.pop();
            for( int to : e[from] ){
                if( gp[to] != -1 ) continue;
                gp[to] = cnt;
                s.push(to);
            }
        }
        cnt++;
    }

    int ans = 0;
    Rep(i,N) if( gp[p[i]] == gp[i] ) ans++;

    printf ("%d\n", ans );

    return 0;
}



Measured memory_bytes: 6528
#include <iostream>
using namespace std;
int main()
{
	int n, x;
	int c = 0;
	while (true)
	{
		cin >> n >> x;
		if (n == 0 && x == 0)
		{
			break;
		}

		int count = 0;
		for (int x1 = 1; x1 <= n; x1++)
		{
			for (int x2 = 1; x2 <= n; x2++)
			{
				for(int x3 = 1; x3 <= n; x3++)
				{
					if (x1 == x2 || x1 == x3 || x2 == x3)
					{
						continue;
					}

					int result = x1 + x2 + x3;
					if (result == x)
					{

						count++;

					}
				}
			}
		}
		cout << count / 6 << endl;
	}
	return 0;
}


Measured memory_bytes: 3116
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
  
  int N,K,X,Y;cin>>N>>K>>X>>Y;
  
  if(N<=K){
    cout<<N*X<<endl;
  }
  else{
  cout<<K*X+(N-K)*Y<<endl;
  }
}


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

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		// 入力
		int n = sc.nextInt();
		double[] v = new double[n]; 
		for(int i = 0; i < n; i++){
			v[i] = sc.nextDouble();
		}

		// 計算
		Arrays.sort(v);
		double result = v[0];
		for(int i = 1; i < n; i++){
			result = (result + v[i])/2;
		}
		// 出力
		System.out.println(result);
	}

}


Measured memory_bytes: 23124
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
//#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
//#include<list>
#include<queue>
#include<deque>
#include<algorithm>
//#include<numeric>
#include<utility>
#include<complex>
//#include<memory>
#include<functional>
#include<cassert>
#include<set>
#include<stack>

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;

const int MAXN = 50040;
int T[MAXN], S[MAXN];

bool check(int start, int n, int m) {
    int now = start;
    for (int i = 0; i < m; i++) {
        if (now > n-1) return false;
        int tar = S[i];
        bool ok = false;
        for (int j = -1; j <= 1; j++) {
            int next = (T[now]+j + 12) % 12;
            if (tar == next) {
                ok = true;
                now += j;
                if (j >= 0) now++;
                break;
            }
        }
        if (now < 0) return false;
        if (!ok) return false;
    }
    if (now == n) return true;
    else return false;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int test;
    cin >> test;
    map<string, int> oto;
    oto["C"] = 0;
    oto["C#"] = 1;
    oto["D"] = 2;
    oto["D#"] = 3;
    oto["E"] = 4;
    oto["F"] = 5;
    oto["F#"] = 6;
    oto["G"] = 7;
    oto["G#"] = 8;
    oto["A"] = 9;
    oto["A#"] = 10;
    oto["B"] = 11;
    while (test--) {
        int n, m;
        cin >> n >> m;
        for (int i = 0; i < n; i++) {
            string s;
            cin >> s;
            T[i] = oto[s];
        }
        for (int i = 0; i < m; i++) {
            string s;
            cin >> s;
            S[i] = oto[s];
        }
        reverse(S, S+m);
        reverse(T, T+n);
        if (check(0, n, m) || check(1, n, m)) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 1616
#include<stdio.h>
int main(){
	int n, x, i, j, k;
	while(1){
		int c = 0;
		scanf("%d %d", &n, &x);
		if(n == 0 && x == 0){break;}
		for(i=1; i<=n-2; i++){
			for(j=i+1; j<=n-1; j++){
				for(k=j+1; k<=n; k++){
					if(i + j + k == x){
						c++;
					}
				}
			}
		}
		printf("%d\n", c);
	}
}
	


Measured memory_bytes: 2140
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int (i)=0;(i)<(n);++(i))
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);++(i))
#define EACH(e,v) for(auto& e:v)
#define ALL(v) (v).begin(),(v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort((v).rbegin(),(v).rend())
#define PERM(v) SORT(v);for(bool c##p=1;c##p;c##p=next_permutation(ALL(v)))
#define UNIQUE(v) SORT(v);(v).erase(unique(ALL(v)),(v).end())
template<typename A,typename B> inline bool chmax(A &a,const B &b){if(a<b){a=b;return 1;}return 0;}
template<typename A,typename B> inline bool chmin(A &a,const B &b){if(a>b){a=b;return 1;}return 0;}

const int MOD = (int)1e9 + 7;
const int INF = 1 << 30;
const ll INFF = 1LL << 62;

vector<ll> divisor(ll n) {
    vector<ll> ret;
    for(ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.emplace_back(i);
            if (i * i != n) ret.emplace_back(n / i);
        }
    }
    RSORT(ret);
    return ret;
}

int N, K;
vector<int> A;
ll sum;

bool ok(int num) {
    vector<int> v;
    EACH(e, A) {
        int a = (e / num) * num;
        v.emplace_back(e - a);
    }
    SORT(v);
    ll p = v[0], q = 0;
    for (int i = 1; i < N; ++i) q += num - v[i];
    if (p == q and p <= K) return true;
    for (int i = 1; i < N - 1; ++i) {
        p += v[i];
        q -= num - v[i];
        if (p == q and p <= K) return true;
    }
    return false;
}

signed main() {

    cin >> N >> K;

    A.resize(N);
    REP(i, N) {
        cin >> A[i];
        sum += A[i];
    }

    auto div = divisor(sum);
    EACH(e, div) {
        if (ok(e)) {
            cout << e << endl;
            return 0;
        }
    }

    int g = 0;
    EACH(e, A) g = __gcd(g, e);
    cout << g << endl;

}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<queue>
#include<stack>
#include<algorithm>
#include<string>
using namespace std;

int main()
{
	long long int i,j,k,n,ans=0,gcd1;cin>>n;
	for(i=1;i<=n;i=i+1)
	{
	    for(j=1;j<=n;j=j+1)
	    {
	        gcd1=__gcd(i,j);
	        for(k=1;k<=n;k=k+1)
	        {
	            
	            ans=ans+__gcd(gcd1,k);
	        }
	    }
	}
	cout<<ans<<endl;
	return 0;
	
	
}

Measured memory_bytes: 3624
/*by freesteed*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define pb push_back
#define fill(x,c) memset(x,c,sizeof(x))
#define fi first
#define se second
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define caset int ___T; cin>>___T; for(int cs=1;cs<=___T;cs++)
#define get_be(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
//get_be biger & equal
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
const ll mod=1e9+7;
const ll oo=1e9+10;
const int Max = 1e6+10;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll a[Max],b[Max];
ll n,m,k,res; 
struct BIT {
private:
	vector<ll> node; int n;
public:
	void init(int n_) {
		n = n_; node.resize(n, 0);
	}
	//0-indexed
	void add(int a, ll w) {
		for (int i = a; i < n; i |= i + 1)node[i] += w;
	}
	//[0,a)
	ll sum(int a) {
		ll ret = 0;
		for (int i = a - 1; i >= 0; i = (i&(i + 1)) - 1)ret += node[i];
		return ret;
	}
	//[a,b)
	ll sum(int a, int b) {
		return sum(b) - sum(a);
	}
};
void solve(){
	string s;
	cin>>s;
	if(s[0]==s[1]&&s[1]==s[2]){
		cout<<"No";
	}else{
		cout<<"Yes";
	}
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//caset{
		solve();
	//}
  	return 0;
}





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

int main(){
  int A, B;
  cin >> A >> B;
  int count = 0;
  int mouth = 1;              //初期は1個口
  while(mouth< B){
    mouth += A - 1;         //A個口増える一方、1つの個口が消費
    count++;
  }

  cout << count << endl;
  return 0;

}

Measured memory_bytes: 256
//BISMILLAH
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,m,total=0,countt=0;
    cin>>n>>m;
    int arr[n];
    float result=0.0,flag=0;

    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        total+=arr[i];
    }
    //cout<<total<<endl;
    result=(float) ((float)total/((float)4*(float)m));
    //cout<<result<<endl;

    for(int i=0;i<n;i++)
    {
        if(arr[i]>=result)
            countt++;
    }

    if(countt>=m)
        cout<< "Yes"<<endl;
    else
        cout<< "No"<<endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <bitset>
#include <climits>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RFOR(i,a,b) for (int i=(a)-1;i>=(b);i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int INF = 1e9;
const int MOD = 1e9 + 7;

using namespace std;

using State = string::const_iterator;

int formula(State& begin);

void consume(State &begin, char expected){
	if(*begin==expected)begin++;
	else{
		cerr << "expected '" << expected << "' but got '" << *begin << "'" << endl;
		cerr << "Rest string is'";
		while(*begin)cerr << *begin++;
		cerr << "'" << endl;
		exit(0);
	}
}


int reverse(int a){
	if(a==2)return 0;
	else if(a==0)return 2;
	else return 1;
}

int number(State& begin){
	int ret = (int)(*begin - '0');
	begin++;
	return ret;
}

int factor(State& begin){
	int ret = formula(begin);
	if(*begin == '+'){
		begin++;
		int ret2 = formula(begin);
		ret = max(ret,ret2);
	}else if(*begin == '*'){
		begin++;
		int ret2 = formula(begin);
		ret = min(ret,ret2);
	}
	return ret;
}

int formula(State& begin){
	if(*begin == '-'){
		begin++;
		return reverse(formula(begin));
	}else if(*begin == '('){
		consume(begin,'(');
		int ret = factor(begin);
		consume(begin,')');
		return ret;
	}else{
		return number(begin);
	}
}



int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	string s;
	while(cin>>s,s[0]!='.'){
		int ct = 0;
		REP(P,3){
			REP(Q,3){
				REP(R,3){
					string tmps = s;
					replace(tmps.begin(),tmps.end(),'P',(char)('0' + P));
					replace(tmps.begin(),tmps.end(),'Q',(char)('0' + Q));
					replace(tmps.begin(),tmps.end(),'R',(char)('0' + R));
					State start = tmps.begin();
					if(formula(start) == 2)ct++;
				}
			}
		}
		cout << ct << endl;
	}
  return 0;
}

Measured memory_bytes: 3220
import bisect
import sys
input = sys.stdin.readline
inpl = lambda: list(map(int,input().split()))

class SegmentTree:
    def __init__(self, value, N=0, comp=lambda x,y: x<=y, reverse=False):
        M = max(len(value),N)
        N = 2**(len(bin(M))-3)
        if N < M: N *= 2
        self.N = N
        self.node = [0] * (2*N-1)
        for i in range(N):
            self.node[N-1+i] = i
        self.value = [None] * N
        for i, v in enumerate(value):
            self.value[i] = v
        self.comp = lambda x, y: True if y is None else False if x is None else comp(x,y)^reverse
        for i in range(N-2,-1,-1):
            left_i, right_i = self.node[2*i+1], self.node[2*i+2]
            left_v, right_v = self.value[left_i], self.value[right_i]
            if self.comp(left_v, right_v):
                self.node[i] = left_i
            else:
                self.node[i] = right_i

    def set_input(self, n, v):
        self.value[n] = v
        i = (self.N-1) + n
        while i > 0:
            i = (i-1)//2
            left_i, right_i = self.node[2*i+1], self.node[2*i+2]
            left_v, right_v = self.value[left_i], self.value[right_i]
            if self.comp(left_v, right_v):
                new_i = left_i
            else:
                new_i = right_i
            if new_i == self.node[i] and new_i != n:
                break
            else:
                self.node[i] = new_i

    def get_input(self, n):
        if n is None:
            return None
        else:
            return self.value[n]

    def get_output(self, a=0, b=-1):
        return self.get_input(self.get_output_index(a,b))

    def get_output_index(self,
                         a=0, b=-1,
                         k=0, l=0, r=-1):
        if b < 0:
            b = self.N
        if r < 0:
            r = self.N
        if a <= l and r <= b:
            return self.node[k]
        elif r <= a or b <= l:
            return None
        else:
            left_i = self.get_output_index(a,b,2*k+1,l,(l+r)//2)
            right_i = self.get_output_index(a,b,2*k+2,(l+r)//2,r)
            left_v, right_v = self.get_input(left_i), self.get_input(right_i)
            if left_v is None and right_v is None:
                return None
            elif self.comp(left_v, right_v):
                return left_i
            else:
                return right_i

N, M = inpl()
AB = [ inpl() for _ in range(N) ]
AB.sort()
A = [ ab[0] for ab in AB ]
B = [ ab[1] for ab in AB ]
sg = SegmentTree(B, reverse=True)
ans = 0
n = 0
for m in range(1,M+1):
    n = bisect.bisect_right(A, m, lo=n)
    p = sg.get_output_index(0, n)
    if p is not None:
        ans += sg.get_input(p)
        sg.set_input(p, None)
print(ans)

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

int n, m, l, r;

int main() {
        //freopen("C.INP", "r", stdin);
        //freopen("C.OUT", "w", stdout);
        ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

        cin >> n >> m;
        l = 0; r = 100000 + 1;
        for (int i = 0; i < m; i++) {
                int x, y;
                cin >> x >> y;
                l = max(l, x);
                r = min(r, y);
        }

        int res;
        r = min(r, n);
        if (l <= r) res = r-l+1;
        else res = 0;
        cout << res << '\n';

        return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main() {
	int time;
	cin >> time;
	long long int T = 1, A = 1;
	int dummy1, dummy2;
	for (int i = 0; i < time; ++i) {
		cin >> dummy1 >> dummy2;
		if ((T + dummy1 - 1) / dummy1 > (A + dummy2 - 1) / dummy2) {
			T = (T + dummy1 - 1) / dummy1*dummy1;
			A = T / dummy1*dummy2;
		}
		else {
			A = (A + dummy2 - 1) / dummy2*dummy2;
			T = A / dummy2*dummy1;
		}
	}
	cout << A + T << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;
typedef long long ll;

void vecprint(vector<ll> v) {
    for(auto x : v) {
        cout << x << " ";
    }
    cout << endl;
}

void qprint(priority_queue<ll> q) {
    while(!q.empty()) {
        cout << q.top() << " ";
        q.pop();
    }
    cout << endl;
}

int main(void) {
    int n;
    cin >> n;
    
    vector<ll> va, vb;
    for(int i = 0; i < n-1; i++) {
        ll tmp;
        cin >> tmp;
        vb.push_back(tmp);
    }
    
    va.push_back(vb[0]);
    for(int i = 0; i < n-2; i++) {
        va.push_back(min(vb[i], vb[i+1]));
    }
    va.push_back(vb[n-2]);
    
    //vecprint(va);
    
    ll ans = 0;
    for(auto x : va) {
        ans += x;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int A = sc.nextInt();
    int B = sc.nextInt();
    System.out.println(Math.abs(A-B)%2 == 0 ? "Alice" : "Borys");
  }
}

Measured memory_bytes: 21972
#include <iostream>
#include <vector>

using namespace std;

int main(){

   int h, w;
   vector<int> v_h, v_w;

   cin >> h >> w;

   while(h != 0 && w != 0){
      v_h.push_back(h);
      v_w.push_back(w);

      cin >> h >> w;
   }

   for(int i = 0; i < v_h.size(); i++){
      for(int j = 0; j < v_h[i]; j++){
         for(int k = 0; k < v_w[i]; k++){
            cout << "#";
         }
         cout << endl;
      }
      cout << endl;
   }

   return 0;
}


Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define mod 1000000007
#define pb push_back
#define inf 1000000000000000000
#define ff first
#define ss second
void checkpoint1()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif*/
}
void printString(ll n) 
{ 
    string str=""; // To store result (Excel column name) 
    ll i = 0; // To store current index in str which is result 
  
    while (n > 0) { 
        // Find remainder 
        int rem = n % 26; 
  
        // If remainder is 0, then a 'Z' must be there in output 
        if (rem == 0) { 
            str+= 'z'; 
            n = (n / 26) - 1; 
        } 
        else // If remainder is non-zero 
        { 
            str+= (rem - 1) + 'a'; 
            n = n / 26; 
        } 
    } 
  
    // Reverse the string and print result 
    reverse(str.begin(),str.end()); 
    cout << str << "\n"; 
  
    return; 
} 
int main()
{
	checkpoint1();
	ll n;
	cin>>n;
	printString(n);
	return 0;
}

Measured memory_bytes: 3600
# -*- coding: utf-8 -*-

import sys
from bisect import bisect_right
from itertools import accumulate

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
A = sorted(LIST())
B = sorted(LIST())
C = sorted(LIST())

dp1 = [1] * (N+1)
dp2 = [0] * (N+1)
dp3 = [0] * (N+1)

for i1, a in enumerate(A):
    i2 = bisect_right(B, a)
    dp2[i2] += dp1[i1]
dp2 = list(accumulate(dp2))
for i2, b in enumerate(B):
    i3 = bisect_right(C, b)
    dp3[i3] += dp2[i2]
dp3 = list(accumulate(dp3))
print(sum(dp3[:N]))


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


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

    string s;
    cin>>s;
    for(int i=0;i<4;i++){
        cout<<s[i];
    }
    cout<<" ";
    for(int i=4;i<s.size();i++){
        cout<<s[i];
    }
    cout<<endl;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<ll>::iterator sit;
typedef map<ll,ll>::iterator mit;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll n,k; cin>>n>>k; n++;
	ll ans=0;
	for(ll b=1;b<=n-1;b++)
	{
		if(k>b-1) continue;
		ll tmp = (n/b)*(b - k);
		tmp += max(0LL, n%b - k);
		ans+=tmp;
		if(k==0) ans--;
	}
	cout<<ans<<'\n';
}


Measured memory_bytes: 256
N=int(input())
s,t=list(),list()
for i in range(N):
  a,b=input().split()
  s.append(a)
  t.append(int(b))
X=input()
m = N
result = 0
for n in range(N):
  if X == s[n]:
    m = n
  if m < n:
    result += t[n]
print(result)

Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String string=scanner.next();
        int a=0;
        int c=0;
        if(!string.startsWith("A")){
            System.out.println("WA");
            return;
        }
        boolean flag=false;
        for(int i=2;i<string.length()-1;i++){
            if(string.charAt(i)=='C') {
                if(!flag){
                    c=i;
                    flag=true;
                }else{
                    System.out.println("WA");
                    return;
                }
            }
        }
        if(!flag){
            System.out.println("WA");
            return;
        }
        for(int i=0;i<string.length();i++){
            if(i==a||i==c) continue;
            char ch=string.charAt(i);
            if(Character.isUpperCase(ch)){
                System.out.println("WA");
                return;
            }
        }
        System.out.println("AC");



    }
}


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

typedef long long ll;

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

	ll t=1;
	//cin >> t;

	for(ll i=1;i<=t;i++){
		ll x;
		cin >> x;

		if(x>=30)
			cout << "Yes" << "\n";
		else
			cout << "No" << "\n";
 	}
}

Measured memory_bytes: 3644
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int d = sc.nextInt();
        int [][] x = new int [n][d];
        for(int i = 0; i < n ; i++) {
            for(int j = 0; j < d ; j++) {
                x[i][j] = sc.nextInt();
            }
        }
        
        int ans = 0;
        for(int a = 0; a < n ; a++) {
            for(int b = a+1; b < n ; b++) {
                int distSq = 0;
                for(int c = 0; c < d ; c++) {
                    int tmp = x[a][c] - x[b][c];
                    distSq += (tmp*tmp);
                }
                if(judge(distSq)) ans++;
            }
        }
        System.out.println(ans);
    }
    
    static boolean judge(int num) {
        int tmp = (int) Math.sqrt(num);
        if(tmp*tmp == num) {
            return true;
        }
        tmp++;
        if(tmp*tmp == num) {
            return true;
        }
        return false;
    }
}

Measured memory_bytes: 21204
//#pragma comment(linker,"/STACK:16777216") /*16Mb*/
#pragma comment(linker,"/STACK:33554432") /*32Mb*/

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <stack>
#include <cmath>
#include <list>
#include <iomanip>
#include <set>
#include <map>
#include <sstream>
using namespace std;

typedef  long long LL;
typedef  unsigned long long ULL;
typedef  long double LD;
typedef  pair<int, int> PII;
typedef vector<int> VI;
#define For(i,a,b) for(int (i)=(a);i<(b);++(i))
#define FoR(i,a,b) for(int (i)=(a)-1;(i)>=(b);--(i)) 
#define MP make_pair
#define MOD 1000000007
#define INF 1000000000
#define PB push_back
#define y0 kihrbdb
#define y1 ugvrrtgtrg
#define eps 1e-5
#define X first
#define Y second


int main()
{
	cout.setf(ios::fixed, ios::floatfield);
	cout.precision(4);

	LL n;
	cin >> n;
	LL n1 = n / (6 + 5);
	n1 *= 2;
	LL nn1 = n % (6 + 5);
	if (nn1 > 0 && nn1 <= 6) n1++;
	else if (nn1 > 6) n1 += 2;

	cout << n1 << endl;

	return 0;
}

Measured memory_bytes: 256
using System;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var A = new int[3, 3] ;
            var atari = new bool[3, 3];

            for (var i = 0; i < 3; i++)
            {
                var input = Console.ReadLine().Trim().Split(' ');
                for (var j = 0; j < 3; j++)
                {
                    A[i, j] = int.Parse(input[j]);
                    atari[i, j] = false;
                }
            }
            var N = int.Parse(Console.ReadLine());
            for (var i = 0; i < N; i++)
            {
                var b = int.Parse(Console.ReadLine());
                for (var j = 0; j < 3; j++)
                {
                    for (var k = 0; k < 3; k++)
                    {
                        if (A[j, k] == b)
                        {
                            atari[j, k] = true;
                        }
                    }
                }
            }
            for (var i = 0; i < 3; i++)
            {
                if (atari[i, 0] && atari[i, 1] && atari[i, 2])
                {
                    Console.WriteLine("Yes");
                    return;
                }
                if (atari[0, i] && atari[1, i] && atari[2, i])
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
            if (atari[0, 0] && atari[1, 1] && atari[2, 2])
            {
                Console.WriteLine("Yes");
                return;
            }
            if (atari[0, 2] && atari[1, 1] && atari[2, 0])
            {
                Console.WriteLine("Yes");
                return;
            }
            Console.WriteLine("No");
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using in6 = int64_t;
using ind = double;
using pii = pair<int,int>;
using psi = pair<string,int>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

void yes() {
  cout << "Yes";
}

void no() {
  cout << "No";
}

int main() {
  kyun;
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  while(1) {
    c -= b;
    if(c <= 0) {
      yes();
      break;
    }
    a -= d;
    if(a <= 0) {
      no();
      break;
    }
  }
  hinata;
}

Measured memory_bytes: 3640
h,w = map(int, input().split())
s = [input() for _ in range(h)]

ans = "Yes"

for i in range(1,h-1):
  
  for j in range(1,w-1):
    if s[i][j] == "#":
      if s[i-1][j] == "." and s[i+1][j] == "." and s[i][j-1] == "." and s[i][j+1] == ".":
        ans = "No"
        break
        
if s[0][0] == "#":
  if s[0][1] == "." and s[1][0] == ".":
    ans = "No"
if s[0][w-1] == "#":
  if s[0][w-2] == "." and s[1][w-1] == ".":
    ans = "No"
if s[h-1][0] == "#":
  if s[h-2][0] == "." and s[h-1][1] == ".":
    ans = "No"
if s[h-1][w-1] == "#":
  if s[h-2][w-1] == "." and s[h-1][w-1] == ".":
    ans = "No"

for i in range(1,h-1):
  if s[i][0] == "#":
    if s[i-1][0] == "." and s[i+1][0] == "." and s[i][1] == ".":
      ans = "No"
  if s[i][w-1] == "#":
    if s[i-1][w-1] == "." and s[i+1][w-1] == "." and s[i][w-2] == ".":
      ans = "No"
for i in range(1,w-1):
  if s[0][i] == "#":
    if s[0][i-1] == "." and s[0][i+1] == "." and s[1][i] == ".":
      ans = "No"
  if s[h-1][i] == "#":
    if s[h-1][i-1] == "." and s[h-1][i+1] == "." and s[h-2][i] == ".":
      ans = "No"
print(ans)

Measured memory_bytes: 3192
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long l;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL); 
    int n,m;
    cin>>n>>m;
    if(n>=m)
    {
        for(int i = 0;i<n;i++)cout<<m;
    }
    else
    {
        for(int i = 0;i<m;i++)cout<<n;
    }
    return 0;
}


Measured memory_bytes: 3620
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;


int main(){
  string S;cin >> S;
  int K;cin >> K;
  int t = 0;
  for(int i = 0; i < S.size(); i++){
    if(S[i] == '1')t++;
    else break;
  }
  int ans = 0;
  if(t == 0) ans = S[0] - '0';
  else{
    if(K <= t)ans = 1;
    else ans = S[t] - '0';
  }
  cout << ans <<endl;
}



Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String args[] ) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		List<Integer> resultListA = new ArrayList<Integer>();
		List<Integer> resultListB = new ArrayList<Integer>();
		int resultCount = 0;
		while (true) {
			int n = Integer.parseInt(sc.nextLine());			
			if (n == 0) {
				break;
			}
			
			int aPoint = 0;
			int bPoint = 0;
			for (int i = 0; i < n; i++) {
				String[] input = sc.nextLine().split(" ");
				int a = Integer.parseInt(input[0]);
				int b = Integer.parseInt(input[1]);
				
				if (a > b) {
					aPoint += (a + b);
				} else if (a < b) {
					bPoint += (a + b);
				} else {
					aPoint += a;
					bPoint += b;
				}
			}
			resultListA.add(aPoint);
			resultListB.add(bPoint);
			resultCount++;
		}
		
		for (int j = 0; j < resultCount; j++) {
			System.out.println(resultListA.get(j) + " " + resultListB.get(j));	
		}
	}
}

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


void solve(long long D){
    if(D==25){printf("Christmas\n");}
    else if(D==24){printf("Christmas Eve\n");}
    else if(D==23){printf("Christmas Eve Eve\n");}
    else if(D==22){printf("Christmas Eve Eve Eve\n");}
}


int main(){
    long long D;
    scanf("%lld",&D);
    solve(D);
    return 0;
}


Measured memory_bytes: 256
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n").map(Number);
while(true){
   var n=Arr.shift();
   if(n==0)break;
   var AB=[[],[]];
   for(var i=0;i<n;i++){
      var v=Arr.shift();
      AB[0].push(v);
   }
   AB[0].sort(function(a,b){return a-b;});
   for(var i=1;i<=n*2;i++){
      if(AB[0].indexOf(i)==-1)AB[1].push(i);
   }
   var now=0;
   var x=0;
   while(true){
      var one=0;
         AB[x]=AB[x].filter(function(v,index){
            if(v>now && one==0){one=1;now=v;return false;}
            else {return true;}
         });
      if(AB[x].length==0)break;
      if(one==0)now=0;
      x=1-x;
      }
      console.log(AB[1].length);
      console.log(AB[0].length);
}

Measured memory_bytes: 9764
#include <iostream>

using namespace std;

int main() {
    long int q, h, s, d;
    cin >> q >> h >> s >> d;

    long int quarterL = q;
    long int halfL = (quarterL * 2) < h ? quarterL * 2 : h;
    long int oneL = (halfL * 2) < s ? halfL * 2 : s;
    long int twoL = (oneL * 2 < d) ? oneL * 2 : d;

    int n;
    cin >> n;

    int twoNum = 0;
    int firstDiv = n / 2;
    int twoRem = n % 2;
    long int yen = firstDiv * twoL;

    if (twoRem != 0){
        yen += twoRem * oneL;
    }
    cout << yen << endl;
}


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

long mod = 1000000007;
long dp[101][8] = {};
int H, W;
vector<vector<int>> v;  // 横棒のパターン
int bit[8] = {};

void addBit() {
  int l = W - 1;
  for (int i = 1; i < l; i++) {
    if (bit[i - 1] == 1 && bit[i] == 1) return;
  }
  vector<int> tmp(l);
  for (int i = 0; i < l; i++) {
    tmp[i] = bit[i];
  }
  v.push_back(tmp);
}

void makeBit(int k) {
  if (k == W - 1) {
    addBit();
    return;
  }
  makeBit(k + 1);
  bit[k] = 1;
  makeBit(k + 1);
  bit[k] = 0;
}

void swap(long a[], vector<int> b, long c[]) {
  for (int i = 0; i < W - 1; i++) {
    if (b[i] == 1) {
      c[i] = a[i + 1];
      c[i + 1] = a[i];
    } 
  }
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int K;
  cin >> H >> W >> K;
  
  if (W == 1) {
    if (K == 1) cout << "1\n";
    else cout << "0\n";
    return 0;
  }
 
  dp[0][0] = 1;
  makeBit(0);

  int l = v.size();
  for (int i = 1; i <= H; i++) {
    for (int j = 0; j < l; j++) {
      long* c = new long[W]();
      for (int k = 0; k < W; k++) {
        c[k] = dp[i - 1][k];
      }
      swap(dp[i - 1], v[j], c);
      for (int k = 0; k < W; k++) {
        dp[i][k] += c[k];
        dp[i][k] %= mod;
      }
    }
  }
  cout << dp[H][K - 1] << "\n";
  return 0;
}

Measured memory_bytes: 512
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			BigInteger b = sc.nextBigInteger();
			if(b.intValue()==-1)break;
			System.out.println(b.toString(4));
		}
	}
}

Measured memory_bytes: 23496
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*構造体の宣言*/
typedef struct Tree
{
  int parent;
  int l;
  int right;
}tree;

tree T[100000];
int n;

/*PrintChild関数*/
void PrintChild(int i)
{
  int brother;
  
  if(T[i].l  != -1){
    printf("%d", T[i].l);
    brother = T[i].l;
    while(1){
      if(T[brother].right == -1)break;
      printf(", %d", T[brother].right);
      brother = T[brother].right;
    }
  }
}

/*judge関数*/
void judge(int i)
{
  if(T[i].l == -1 && T[i].parent != -1)
    printf("leaf,");
  else if(T[i].parent == -1)
    printf("root,");
  //
  else
    printf("internal node,");
}

/*depth関数*/
int depth(int i)
{
  int count = 0, parent_i;
  parent_i = i;
  while(1){
    if(T[parent_i].parent == -1)
      break;
    parent_i = T[parent_i].parent;
    count++;
  }
  return count;
}

/*ここからがmain関数*/
int main()
{
  int count, j, node, degree, child, left;

  scanf("%d",&n);

  for(count = 0; count < n; count++){
    T[count].parent = -1;
    T[count].l = -1;
    T[count].right = -1;
  }
  for(count = 0; count < n; count++){
    scanf("%d%d", &node, &degree);
    for(j = 0; j < degree; j++){
      scanf("%d", &child);
      if(j == 0){
	T[node].l = child;
	T[child].parent = node;
      }   
      else{
	T[left].right = child;
	T[child].parent = node;
      }
      left = child;
    }
  }
  for(count = 0; count < n; count++){
    printf("node %d: parent = %d, depth = %d, ", count, T[count].parent, depth(count));
    judge(count);

    printf(" [");
    PrintChild(count);
    printf("]\n");    
  }

  return 0;
}





Measured memory_bytes: 2904
#include <cstdio>
#include <cstring>
#include <algorithm>
#define MOD 924844033
 
using namespace std;
 
typedef long long ll;
 
ll pow_mod(ll x,int k) {
ll ans=1;
while (k) {
if (k&1) ans=ans*x%MOD;
x=x*x%MOD;
k>>=1;
}
return ans;
}
 
ll a[1<<19],b[1<<19];
 
void rev(ll *p,int len) {
int j=len>>1;
for(int i=1;i<len-1;i++) {
if (i<j) swap(p[i],p[j]);
int k=len>>1;
while (j>=k) {
j-=k;
k>>=1;
}
if (j<k) j+=k;
}
}
 
void ntt(ll *p,int len,int check) {
rev(p,len);
for(int i=2;i<=len;i<<=1) {
ll wn=pow_mod(5,(MOD-1)/i);
for(int j=0;j<len;j+=i) {
ll w=1;
for(int k=j;k<j+(i>>1);k++) {
ll u=p[k];
ll v=w*p[k+(i>>1)]%MOD;
p[k]=(u+v)%MOD;
p[k+(i>>1)]=(u-v+MOD)%MOD;
w=w*wn%MOD;
}
}
}
if (check==-1) {
reverse(p+1,p+len);
ll nev=pow_mod(len,MOD-2);
for(int i=0;i<len;i++) p[i]=p[i]*nev%MOD;
}
}
 
struct Edge {
int t,next;
Edge() {}
Edge(int a,int b):t(a),next(b) {}
};
 
Edge e[400005];
int head[200005],num[200005],n;
 
int size[200005];
 
void dfs(int x,int fa) {
size[x]=1;
for(int i=head[x];i;i=e[i].next)
if (e[i].t!=fa) {
int u=e[i].t;
dfs(u,x);
size[x]+=size[u];
num[n-size[u]]++;
num[size[u]]++;
}
}
 
ll facd[200005],facv[200005];
 
void pre(int n) {
facd[0]=1;
for(int i=1;i<=n;i++) facd[i]=facd[i-1]*i%MOD;
facv[n]=pow_mod(facd[n],MOD-2);
for(int i=n-1;i>=0;i--) facv[i]=facv[i+1]*(i+1)%MOD;
}
 
int main() {
scanf("%d",&n);
pre(n);
for(int i=1;i<n;i++) {
int x,y;
scanf("%d%d",&x,&y);
e[2*i-1]=Edge(y,head[x]);
head[x]=2*i-1;
e[2*i]=Edge(x,head[y]);
head[y]=2*i;
}
dfs(1,0);
int len=1;
while (len<((n+1)<<1)) len<<=1;
for(int i=0;i<n;i++) {
a[i]=num[i]*facd[n-i]%MOD;
b[i]=facv[i];
}
ntt(a,len,1);ntt(b,len,1);
for(int i=0;i<len;i++) a[i]=a[i]*b[i]%MOD;
ntt(a,len,-1);
for(int i=1;i<=n;i++) {
ll s1=facd[n]*facv[i]%MOD*facv[n-i]%MOD*n%MOD;
ll s2=a[n-i]*facv[i]%MOD;
printf("%lld\n",(s1-s2+MOD)%MOD);
}
return 0;
}


Measured memory_bytes: 26880
#include <stdio.h>
int main(void)
{
    
    int W,H,x,y,r;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
    
    if((r<=x && x<=W-r) && (r<=y && y<=H-r))
        printf("Yes\n");
    else
        printf("No\n");
    return 0;

}



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

int main() {
  int A,B,C,K;
  cin >> A >> B >> C >> K;
  int count =0;
  bool ans = false;
  
  if(B>A && C>B) ans = true;
  if(B<=A) {
    for(int i=0; i<K; i++) {
      B *= 2;
      count++;
      if(B>A && count<=K) break;
    }
  }
  int dan = count;
  if(C<=B) {
    for(int i=0; i<K-dan; i++) {
      C *= 2;
      count++;
      if(C>B) ans = true;
    }
  }
  if(ans == true) cout << "Yes" << endl;
  if(ans == false) cout << "No" << endl;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long m,temp=100,cnt=0;
	cin>>m;
	while (1)
	{
		if (temp>=m)   break;
		temp+=temp/100;
		cnt++;
	}
	cout<<cnt;
	return 0;
} 

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std ;
int main()
{
  int i,a,b,n,c=0;
    cin>>n;
    cin>>a>>b;
    for(i=a;i<=b;i++){
    if(i%n==0)
    {
      c++;
    }
    }
    if(c>=1)
        cout<<"OK"<<endl;
    else
        cout<<"NG"<<endl;
 
 
}


Measured memory_bytes: 3580
/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>

#define all(x) (x).begin(),(x).end()
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}
 
ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------
int main(void){
    int n;
    cin >> n;
    string s;
    cin >> s;
    int q;
    cin >> q;
    vector<int> K(q);
    for(int i = 0; i < q; i++) cin >> K[i];
    for(int i = 0; i < q; i++){
        int k = K[i];
        int r = 0;
        ll dcnt = 0;
        ll dmcnt = 0;
        ll dmccnt = 0;
        ll mcnt = 0;
        for(int l = 0; l < n; l++){
            while(r < n && r - l < k){
                if(s[r] == 'D'){
                    dcnt++;
                } else if(s[r] == 'M'){
                    dmcnt += dcnt;
                    mcnt++;
                } else if(s[r] == 'C') {
                    dmccnt += dmcnt;
                }
                r++;
            }

            //cout << l <<" " << r << " " << dcnt << " " << dmcnt << " " << dmccnt << endl;

            //if(r == l) r++;

            if(s[l] == 'D'){
                dmcnt -= mcnt;
                dcnt--;
            }

            if(s[l] == 'M') mcnt--;
        }
        cout << max(0LL,dmccnt) << endl;
    }
}   

Measured memory_bytes: 1412
a1, a2, a3 = gets.split.map(&:to_i)
a4, a5, a6 = gets.split.map(&:to_i)
a7, a8, a9 = gets.split.map(&:to_i)
N = gets.to_i
b = N.times.map{gets.to_i}

ret = Array.new(9, false)

[a1, a2, a3, a4, a5, a6, a7, a8, a9].each_with_index do |a, index|
  ret[index] = true if b.include?(a)
end

if (ret[0] && ret[1] && ret[2]) || (ret[3] && ret[4] && ret[5]) || (ret[6] && ret[7] && ret[8]) || (ret[0] && ret[3] && ret[6]) || (ret[1] && ret[4] && ret[7]) || (ret[2] && ret[5] && ret[8]) || (ret[0] && ret[4] && ret[8]) || (ret[2] && ret[4] && ret[6])
  puts 'Yes'
else
  puts 'No'
end
  

Measured memory_bytes: 1788
#include<bits/stdc++.h>
#define int long long
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1e6+3;
typedef long long ll;
int modpow(int x,int y,int md=mod){if(y==0)return 1;int ret=modpow(x,y>>1,md);ret=(ll)ret*ret%md;if(y&1)ret=(ll)ret*x%md;return ret;}
int q;
inline int inv(int x){
	return modpow(x,mod-2,mod);
}
int Mul[1000004];
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	cin>>q;//1*2*...*(1e6+2)=1e6+2
	Mul[1]=1;
	for(int i=2;i<=1000002;i++){
		Mul[i]=Mul[i-1]*i%mod;
	}
	while(q--){
		int x,d,n;
		cin>>x>>d>>n;
		if(d==0){
			cout<<modpow(x,n)<<endl;
			continue;
		}
		int ans=modpow(d,n);
		x=x*inv(d)%mod;
		if(!x){
			cout<<"0\n";
			continue;
		}
		if(x+n-1>=1e6+3){
			cout<<"0\n";
			continue;
		}
		cout<<ans*Mul[x+n-1]%mod*inv(Mul[x-1])%mod<<endl;
	}
	return 0;
}

Measured memory_bytes: 8704
# Setup
import sys
sys.setrecursionlimit(4100000)

a, b = [int(i) for i in input().split()]
c = [b-int(i) for i in input().split()]
import fractions
if a >= 2:
  temp = fractions.gcd(c[1],c[0])
  for i in range(2,a):
      temp = fractions.gcd(temp,c[i])
  print(abs(temp))
else:
  print(abs(c[0]))

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

using namespace std;

typedef long long LL;

const int N = 100010;

char str[N];
bool st[N];

int main()
{
    scanf("%s", str);

    int len = strlen(str);
    for(int i = 0; i < len; i++)
        st[str[i] - 'a'] = 1;

    for(int i = 0; i < 26; i++)
        if(!st[i])
        {
            printf("%c\n", i + 'a');
            return 0;
        }
    puts("None");

    return 0;
}


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

int main(){
	int n, q;
	cin >> n;
	int S[n];
	for(int i = 0; i < n; i++){
		cin >> S[i];
	}
	cin >> q;
	int T[q];
	for(int i = 0; i < q; i++){
		cin >> T[i];
	}
	int count = 0;
	for(int i = 0; i < q; i++){
		for(int j = n - 1; j >= 0; j--){
			if(T[i] >= S[j]){
				if(T[i] == S[j]){
					count++;
				}
				break;
			}
		}
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 3692
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

int main () {
   
    
    int n;
    
    scanf("%d", &n);
    int sum = 0;
    int i;
    for (i = 1; sum < n; i++) {
        sum += i;
    }
    
    printf("%d", i - 1);
}






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

using namespace std;

int main(void) {
  int X, Y; cin >> X >> Y;

  if (Y%2 == 0 && 2*X <= Y && Y <= 4*X) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}

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

using namespace std;

int n;
int main()
{
    cin >> n;
    vector<vector<int>> a(n, vector<int> (n - 1));
    for(int i = 0; i < n; i ++)
        for(int j = 0; j < n - 1; j ++)
            cin >> a[i][j], a[i][j] --;
    vector<int> q1;
    vector<int> c(n, 0);
    for(int i = 0; i < n; i ++){
        int x = a[i][0];
        if(a[x][0] == i) q1.push_back(i);
    }
    int res = 0;
    while(!q1.empty()){
        res ++;
        vector<int> q2;
        for(auto x: q1){
            c[x] ++;
            if(c[x] < n - 1){
                int y = a[x][c[x]];
                if(a[y][c[y]] == x){
                    q2.push_back(x);
                    q2.push_back(y);
                }
            }
        }
        q1 = q2;
    }
    for(int i = 0; i < n; i ++){
        if(c[i] < n - 1) res = -1;
    }
    cout << res << "\n";
}


Measured memory_bytes: 4224
#include <bits/stdc++.h>
//　各変数を定義
double t;
double a,b,x;
// 方程式を定義する。
#define f(t)(a*a*b-(a*a*a*tan(t)/2)-x)
// f(t)をtで微分
#define g(t)(-a*a*a/(2*cos(t)*cos(t)))
#define h(t)(a*b*b-x*2*tan(t))
#define q(t)(-2*x/(cos(t)*cos(t)))
using namespace std;
int main(){
cout << fixed << setprecision(10);
double t,dt,a,b,x;cin>>a>>b>>x;
double acc = 1e-10; 
double pi=3.141592653589;// 打ち切り精度
if(a*a*b/2>=x){
t=atan(a*b*b/(2*x));
double c=180*t/pi;
cout<<c<<endl;}
else if(a*a*b/2<x){
t=atan(2*(a*a*b-x)/(a*a*a));
double c=180*t/pi;
cout<<c<<endl;}
    
return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef vector<pii> vpii;

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

  vi A(N - 1), B(N - 1);
  for (ll i = 0; i < N - 1; i++) {
    cin >> A[i] >> B[i];
    A[i] -= 1;
    B[i] -= 1;
  }

  vvi G(N);
  for (ll i = 0; i < N - 1; i++) {
    G[A[i]].push_back(B[i]);
    G[B[i]].push_back(A[i]);
  }

  ll ans = 1ll << 30;

  if (K % 2 == 0) {
    for (ll i = 0; i < N; i++) {
      unordered_map<ll, ll> dist;
      queue<ll> q;
      q.push(i);
      dist[i] = 0;
      while (q.size()) {
        ll fr = q.front();
        q.pop();
        for (ll to: G[fr]) {
          if (dist.find(to) == dist.end()) {
            dist[to] = dist[fr] + 1;
            q.push(to);
          }
        }
      }
      ll cnt = 0;
      for (auto p: dist) {
        if (p.second > K / 2) {
          cnt += 1;
        }
      }
      ans = min(cnt, ans);
    }
  } else {
    for (ll i = 0; i < N - 1; i++) {
      unordered_map<ll, ll> dist;
      queue<ll> q;
      q.push(A[i]);
      q.push(B[i]);
      dist[A[i]] = 0;
      dist[B[i]] = 0;
      while (q.size()) {
        ll fr = q.front();
        q.pop();
        for (ll to: G[fr]) {
          if (dist.find(to) == dist.end()) {
            dist[to] = dist[fr] + 1;
            q.push(to);
          }
        }
      }
      ll cnt = 0;
      for (auto p: dist) {
        if (p.second > K / 2) {
          cnt += 1;
        }
      }
      ans = min(cnt, ans);
    }
  }

  cout << ans << endl;
}

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

map <int,int> asd;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	int z;
	cin>>z;
	int a;
	int ans=0;
	for(int q=1;q<=z;q++)
	{
		cin>>a;
		if(asd[a]==0)asd[a]=1,ans++;
		else asd[a]=0,ans--;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 4992
#include <iostream>
#include <string>
#include <algorithm>

int main(){
    int tes=0;
    std::string str,g,h;
    std::cin >> g;
    while(true){
        std::cin >> h;
        if(h=="END_OF_TEXT")break;
        std::transform(h.begin(), h.end(), h.begin(), ::tolower);
        if(g==h)tes++;
    }
    std::cout << tes << std::endl;
    return 0;
}

Measured memory_bytes: 3172