akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#include<assert.h>
#include<chrono>
#include<random>
#include<iostream>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define VI vector<int>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    int top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
template<typename T>inline void chkmin(T &x,T y){x=x<y?x:y;}
template<typename T>inline void chkmax(T &x,T y){x=x>y?x:y;}
const int MAXN=5005;
const int mod=1e9+7;
void ad(int &x,int y){x+=y;if(x>=mod)x-=mod;}
int f[MAXN][MAXN],n,m,bin[MAXN];
int main()
{
	#ifdef Rose
		double BeginJudgeTime=clock();
	#endif
	bin[0]=1;for(int i=1;i<MAXN;i++)bin[i]=(bin[i-1]<<1)%mod;
	n=read();m=read();
	for(int i=1;i<=m;i++)f[1][i]=bin[i];
	for(int i=2;i<=n;i++)
	{
		int S=0;
		for(int j=1;j<=m;j++)
		{
			S=2LL*S%mod;ad(S,1LL*f[i-1][j-1]*(j-1)%mod);
			f[i][j]=S;ad(f[i][j],1LL*f[i-1][j]*(j+1)%mod);
		}
	}pr2(f[n][m]);
	return 0;
	#ifdef Rose
		double EndJudgeTime=clock();
		cerr<<"JudgeTime is"<<" ";
		cerr<<(EndJudgeTime-BeginJudgeTime)/CLOCKS_PER_SEC<<endl;
	#endif
	return 0;
}


Measured memory_bytes: 101388
using System;

namespace ALDS1_10_C_LongestCommonSubsequence
{
	class Program
	{
		static void Main ( string[] args )
		{
			int dataCount = int.Parse (Console.ReadLine ());

			for (int lp = 0; lp < dataCount; lp++)
			{
				string inputStr1 = " " + Console.ReadLine ();
				string inputStr2 = " " + Console.ReadLine ();

				int[,] stringLength = new int[inputStr1.Length + 1, inputStr2.Length + 1];
				int maxLength = 0;

				for (int index1 = 1; index1 < inputStr1.Length; index1++)
				{
					for (int index2 = 1; index2 < inputStr2.Length; index2++)
					{
						if (inputStr1[index1] == inputStr2[index2])
						{
							stringLength[index1, index2] = stringLength[index1 - 1, index2 - 1] + 1;
						}
						else
						{
							stringLength[index1, index2] = Math.Max (stringLength[index1 - 1, index2], stringLength[index1, index2 - 1]);
						}

						maxLength = Math.Max (maxLength, stringLength[index1, index2]);
					}
				}

				Console.WriteLine (maxLength);
			}
		}
	}
}

Measured memory_bytes: 18300
#include <stdio.h>
using namespace std;
long long n,a[10000010],ans=0;
int main () {
  scanf ("%lld",&n);
  for (int i=1;i<=n;i++)
    scanf ("%lld",&a[i]);
  for (int i=1;i<n;i++) 
    if (a[i]>a[i+1]) {
      ans+=a[i]-a[i+1];
      a[i+1]=a[i];
    }
    printf ("%lld\n",ans);
}

Measured memory_bytes: 3272
N = int(input())
input_list = [int(i) for i in input().split()]
four_count = 0
two_count = 0

for i in input_list:
    if i % 4 == 0:
        four_count += 1
    elif i % 2 == 0:
        two_count += 1

others_count = N - four_count - two_count

if two_count:
    if others_count <= four_count:
        print("Yes")
    else:
        print("No")
else:
    if others_count <= four_count + 1:
        print("Yes")
    else:
        print("No")
    

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

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

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

int main() {
	int n; int m; string s;
	while (cin >> n, n) {
		cin >> m >> s;
		int c = 0, res = 0;
		for (int i=0; i<m; ++i) {
			if (i == 0 || s[i-1] == s[i]) {
				c = s[i] == 'I';
			} else if (s[i] == 'I') {
				res += n < ++c;
			}
		}
		cout << res << endl;
	}
}

Measured memory_bytes: 2104
n = gets.to_i
arr = Array.new(n) { gets.chomp}
m = arr.count{|name| name[0,1] == "M" }
a = arr.count{|name| name[0,1] == "A" }
r = arr.count{|name| name[0,1] == "R" }
c = arr.count{|name| name[0,1] == "C" }
h = arr.count{|name| name[0,1] == "H" }

puts m*a*r + m*a*c + m*a*h + m*r*c + m*r*h + m*c*h + a*r*c + a*r*h + a*c*h + r*c*h

Measured memory_bytes: 9876
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

vector<char> station(26*2);
void init(){
    iota(station.begin(),station.begin()+26,0);
    for(int i = 0; i < 26;i++) station[i] += 'a';
    iota(station.begin()+26,station.end(),0);
    for(int i = 0; i < 26;i++) station[i+26] += 'A';
}
string solve(ll n){
    vector<int> k(n); for(auto& in:k) cin >> in;
    string s; cin >> s;
    for(int i = 0; i < s.length();i++){
        auto it = find(station.begin(),station.end(),s[i]);
        s[i] = station[((it-station.begin()) + 52*100 - k[i%n])%52];
    }
    return s;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    ll n;
    init();
    while(cin >> n,n){
        cout << solve(n) << endl;
    }
    return 0;
}


Measured memory_bytes: 3216
#include <bits/stdc++.h>
using namespace std;
int N; 
long long A[100010]; 
vector<int> E[100010];  
long long up[100010]; // その頂点から上に出る回数
bool ok = true; 
void dfs(int now, int parent){
	if(E[now].size() == 1){
		up[now] = A[now]; return; 
	}
	long long m = 0; long long sum = 0;
	for(int i = 0; i < E[now].size(); i++){
		if(E[now].at(i) == parent) continue; 
		dfs(E[now].at(i), now); 
		m = max(m, up[E[now].at(i)]); 
		sum += up[E[now].at(i)];
	}
	if(A[now] > sum || A[now] < m || A[now] < (sum + 1)/2){
		ok = false; return; 
	}
	up[now] = 2 * A[now] - sum; 
}
int main(){
	cin >> N; 
	for(int i = 0; i < N; i++) cin >> A[i];
	if(N == 2){
		cout << (A[0] == A[1] ? "YES" : "NO") << endl;
		return 0; 
	}
	for(int i = 0; i < N-1; i++){
		int a, b; cin >> a >> b; 
		a--; b--; 
		E[a].push_back(b); E[b].push_back(a); 
	}	
	int idx = -1; 
	for(int i = 0; i < N; i++){
		if(E[i].size() > 1){
			idx = i; break; 
		}
	}
	E[N].push_back(idx); E[idx].push_back(N); 
	dfs(idx, N); 
	cout << ((ok && up[idx] == 0)? "YES" : "NO") << endl;  
}

Measured memory_bytes: 13952
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		boolean flag = false;
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		Arrays.sort(a);
		int p = -1;
		for (int tmp : a) {
			if (p == tmp) {
				flag = true;
				break;
			}
			p = tmp;
		}
		if (flag) {
			System.out.println("NO");
		} else {
			System.out.println("YES");
		}
	}
}


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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};



int main()
{
  int a, b; cin >> a >> b;
  for(int i = 1; i <= 2000; ++i) {
    if((i*108)/100 == i+a && (i*110)/100 == i+b) {
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}

Measured memory_bytes: 3588
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <vector>
#include <iterator>
#include <algorithm>
#include <cmath>
#include <limits>
#include <numeric>

using namespace std;

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

int main(){
	uint32_t N,D;
    int32_t X[10][10];
    cin >> N >> D;
    for(uint32_t i = 0;i < N;i++){
        for(uint32_t j = 0; j < D;j++){
            cin >> X[i][j];
        }
    }
    uint32_t res = 0;
    double tmp;
    for(uint32_t i = 0;i < N - 1 ;++i){
        for(uint32_t j = i + 1;j < N;j++){
            tmp = 0;
            for(uint32_t d = 0;d < D;d++){  
                tmp += (X[j][d] - X[i][d]) * (X[j][d] - X[i][d]);
            }
            tmp = sqrt(tmp);
            if(tmp == (int32_t) tmp){
                ++res;
            }
        }
    }

    cout << res << endl;

	return 0;
}



Measured memory_bytes: 256
#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; }

void func(long long n) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    // cout << fixed << setprecision(5);

    ll ans = n * (n - 1) / 2;
    cout << ans << endl;
}

int main() {
    long long N;
    scanf("%lld", &N);

    func(N);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define mfill(x,y) memset(x,y,sizeof(x))
#ifdef LOCAL
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#else
#define eprintf(...) 42
#endif
#define y0 y12345
#define y1 y54321
typedef unsigned long ul;
typedef long long ll;
//typedef pair<int, int> mpair;
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(a>b){a=b;return 1;}return 0;}
using namespace std;

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
   	int h, w;
	cin>>h>>w;
	string s[h];
	int p[h][w];
	int q[h][w];
	rep(i, h){rep(j, w){p[i][j] = 0;q[i][j] = 0;}}
	rep(i, h){
		cin>>s[i];
	}
	rep(i, h){
		int st = 0;
		bool wall = true;

		rep(j, w){
			if(s[i][j] == '.'){
				if(wall){
					st = j;
					wall = false;
				}
			}else{
				if(!wall){
					for(int k = st;k < j;k++){
						p[i][k] = j-st;
					}
				}else{
					
				}
				wall = true;
			}
		}
		if(!wall){
			for(int k = st;k < w;k++){p[i][k]=w-st;}
		}
		
	}/*
	rep(i, h){
		rep(j, w){
			cout << p[i][j];
		}
		cout << endl;
	}*/

	rep(j, w){
		int st = 0;
		bool wall = true;

		rep(i, h){
			if(s[i][j] == '.'){
				if(wall){
					st = i;
					wall = false;
				}
			}else{
				if(!wall){
					for(int k = st;k < i;k++){
						q[k][j] = i-st;
					}
				}else{
					
				}
				wall = true;
			}
		}
		if(!wall){
			for(int k = st;k < h;k++){q[k][j]=h-st;}
		}
		
	}
	/*
	cout << endl;
	rep(i, h){
		rep(j, w){
			cout << q[i][j];
		}
		cout << endl;
	}*/
	int mi = 0;
	rep(i, h){
		rep(j, w){
			chmax(mi, p[i][j]+q[i][j]);
		}
	}
	cout << mi -1<< endl;
	return 0;
}


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

int main() {
    int n;
    cin>>n;
    long long k;
    cin>>k;
    long long val;
    vector<long long>a(n+1);
    for(int i=0;i<n;i++){
        cin>>val;
        a[i+1]=a[i]+val;
    }
    long long maxi=-1;
    for(int i=k;i<=n;i++){
        maxi=max(maxi,a[i]-a[i-k]);
    }
    cout<<fixed<<setprecision(9)<<(double)(maxi+k)/(2.0);
	return 0;
}

Measured memory_bytes: 1792
import math
N = int(input())
p = list(map(int, input().split()))
tf = [p[i] == i + 1 for i in range(N)]
prev = False
c = []
for i in tf:
    if not prev and i:
        c.append(1)
    elif prev and i:
        c[-1] += 1
    prev = i
print(sum([math.ceil(_c/2) for _c in c]))

Measured memory_bytes: 13812
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(10)

using namespace std;

int dp[100005][31];

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int N, K;
    cin >> N >> K;

    vector<int> A(N);
    vector<int> B(N);
    REP(i, N) cin >> A[i] >> B[i];

    REP(i, N) {
        if ((K | A[i]) == K) {
            dp[i + 1][0] = dp[i][0] + B[i];
        }
        else {
            dp[i + 1][0] = dp[i][0];
        }
        FOR(j, 1, 30) {
            if ((K & (1 << j)) == 0) continue;
            int t = K;
            t ^= 1 << j;
            t |= (1 << j) - 1;
            if ((t | A[i]) == t) {
                dp[i+1][j] = dp[i][j] + B[i];
            } else {
                dp[i+1][j] = dp[i][j];
            }
        }
    }

    int ans = 0;
    REP(j, 31) {
        ans = max(ans, dp[N][j]);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 26112
#include <iostream>
#include <string>
#include <map>

using namespace std;

typedef pair<char, char> PCC;
typedef map<char, char> MCC;

int main()
{
	MCC m_map;
	int n, m;
	char ch, ch1, ch2;

	while(scanf("%d\n", &n), n)
	{
		m_map.clear();
		for(int i=0; i<n; i++)
		{
			scanf("%c %c\n", &ch1, &ch2);
			m_map[ch1] = ch2;
		}

		scanf("%d\n", &m);
		for(int i=0; i<m; i++)
		{
			scanf("%c\n", &ch);
			putchar(m_map[ch] ? m_map[ch] : ch);
		}
		putchar('\n');
	}
	
	return 0;
}

Measured memory_bytes: 0
n,q=map(int,input().split());s="_"+input()+"_";l,r=0,n+1
for(m,h)in[input().split()for i in range(q)][::-1]:
    L=h=="L";R=h=="R";
    l+=(m==s[l+1]and L)-(m==s[l]and R)
    r+=(m==s[r]and L)-(m==s[r-1]and R)
print(max(0,r-l-1))

Measured memory_bytes: 40892
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <climits>
#include <memory>
#include <sstream>
#include <iomanip>
#include <cstdio>

using namespace std;

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);
	int abc[5];
	cin >> abc[0];
	cin >> abc[1];
	cin >> abc[2];
	cin >> abc[3];
	cin >> abc[4];
	int min = INT_MAX;
	for (int i = 0; i < 5; i++) {
		int tmp = abc[i] % 10;
		if(tmp != 0)min = std::min(min, tmp);
		abc[i] = abc[i] / 10;
		if (tmp != 0)abc[i]++;
		abc[i] *= 10;
	}

	int ans = 0;
	for (int i = 0; i < 5; i++) {
		ans += abc[i];
	}
	if(min!= INT_MAX)ans += min - 10;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define me(a,b) memset(a,b,sizeof(a))
#define INIT() std::ios::sync_with_stdio(false)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int>P;
const int MAX_N=10+5;
const int MAX_M=100000+5;
const int INF=0x7fffffff;
const int inf=1000000000;
const double EPS=1e-6;
const ull base=123;
const ll mod=1e9+7;
const double pi=4*atan(1.0);
int main()
{
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<max(a*c,max(a*d,max(b*c,b*d)))<<endl;
	//system("pause");
}

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


#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}

// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
  long i,sq;
  if(a%2==0){ //偶数の場合
    factors.push_back(2);
    primeFactorization(a/2,factors); //2で割った値で再帰
    return;
  }
  sq = sqrt(a);
  for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
	if(a%i==0){
	  factors.push_back(i);
      primeFactorization(a/i,factors); //割れた値で再帰
      return;
	}
  }
  //偶数でも3以上√a以下の奇数の場合でも割り切れない場合
  if(a!=1){ //aが1でないなら、a自身は素数
    factors.push_back(a);
  }
}

// フェルマーの小定理
// mod. m での a の逆元 a^{-1} を計算する
// (a/b)%m = a*movinv(b,m)%m  
int64_t modinv(int64_t a, int64_t m) {
    int64_t b = m, u = 1, v = 0;
    while (b) {
        int64_t t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

// 円周率
// M_PI

// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;

// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;

signed main() {
  int64_t n,k,q;
  cin >> n >> k >> q;
  int64_t a;
  int64_t score[n] = {};
  for(int i=0;i<q;i++){
    cin >> a;
    score[a-1] += 1;
  }
  
  for(int i=0;i<n;i++){
    if(score[i]>(q-k)){
      cout << "Yes" << endl;
    }
    else{
      cout << "No" << endl;
    }
  }
  
  return 0;
}




Measured memory_bytes: 4436
/* ex4_2 KitamoriFumiya */
#include <stdio.h>
#include <math.h>
#define PI 3.14159265359
 
//  余弦定理で長針と短針の先端の距離を出力する関数
void cosine(double length_hour, double length_minute, double hour, double minute){
	double angle_hour, angle_minute, difference_angle; // angle_hour(長針の角度), angle_minute(短針の角度), difference_angle(長針と短針の角度の差)をdouble型の変数として宣言
	angle_hour = 360 * hour / 12 + 30 * minute / 60; // 長針の角度を計算
	angle_minute = 360 * minute / 60; // 短針の角度を計算
	difference_angle = angle_hour - angle_minute; // 長針と短針の角度の差を計算
	difference_angle = (difference_angle / 180) * PI ; // 角度の差を弧度法で表す
	double distance; // 長針と短針の先端の距離をdouble型の変数として宣言
	distance = length_hour * length_hour + length_minute * length_minute - 2 * length_hour * length_minute * cos(difference_angle); // 距離の2乗を余弦定理で求める
	distance = sqrt(distance); // 距離をルートに入れて戻す
	printf("%.10lf\n", distance); // 距離を少数第10位まで出力する
}
 
int main(void){
	double length_hour, length_minute, hour, minute; // length_hour(長針の長さ), length_minute(短針の長さ), hour(時間), minute(分数)をdouble型の変数として宣言
	scanf("%lf %lf %lf %lf", &length_hour, &length_minute, &hour, &minute); // length_hour, length_minute, hour, minuteを入力
	
	cosine(length_hour, length_minute, hour, minute); // 余弦定理で長針と短針の先端の距離を出力する関数を実行
	
	return 0;
}

Measured memory_bytes: 2568
from collections import defaultdict
import sys

sys.setrecursionlimit(10 ** 7)


def input():
    return sys.stdin.readline().strip()


def dfs(v):
    if dp[v] >= 0:
        return dp[v]
    res = 0
    for nv in g[v]:
        res = max(res, dfs(nv) + 1)
    dp[v] = res
    return res


n, m = map(int, input().split())
g = {i: set() for i in range(n)}
for _ in range(m):
    x, y = map(int, input().split())
    g[x - 1].add(y - 1)

dp = defaultdict(lambda: -1)
for v in g:
    dp[v] = max(dp[v], dfs(v))
print(max(dp.values()))


Measured memory_bytes: 85268
#include <bits/stdc++.h>
using namespace std;
#define e1 first
#define e2 second
#define pb push_back
#define mp make_pair
#define boost ios_base::sync_with_stdio(false)
#define eb emplace_back
#define OUT(x) {cout << x; exit(0); }
#define FOR(i, a, b) for(int i=(a); i<=(b); ++i)
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> PII;
typedef pair <ll, ll> PLL;
typedef pair <PLL, PLL> PP;
typedef unsigned int ui;
const int inf = 1e9+9;
const ll MOD = 1e9+696969;
const ll INF = 1e18;
#define maxn 1000100
int tab[maxn], m, mod;
ll n;
ll wyst[maxn];


void wyp(int s) {
	if (s == 0) cout << "First";
	else cout << "Second";
	exit(0);
}

bool getCorrectAnswer(int starter) {
	int nzm = 0;
	FOR(i, 1, n)
	if (tab[i] == 1) nzm = 1;
	//if first has the win, he can secure it
	ll sum = -n;
	FOR(i, 1, n) sum += tab[i];
	
	if (nzm) {
		if (sum & 1) wyp(starter);
		else wyp(1-starter);
		exit(0);
	}
	if (sum % 2 == 1) wyp(starter);
	
	//otherwise, the first one should change the sum
	int nparz = 0;
	FOR(i, 1, n)
	if (tab[i] % 2 == 1) ++nparz;
	if (nparz > 1) wyp(1 - starter);
	//jest dokladnie jedna nieparzysta liczba teraz :c
	
	FOR(i, 1, n)
	if (tab[i] % 2 == 1) tab[i]--;
	int g = tab[1];
	FOR(i, 1, n) g = __gcd(g, tab[i]);
	FOR(i, 1, n) tab[i] /= g;
	getCorrectAnswer(1 - starter);
	
}
int main()
{
	boost;
	cin >> n;
	FOR(i, 1, n) cin >> tab[i];
	if (n == 1) {
		if (tab[1] == 1) OUT("Second");
		OUT("First");
	}
	
	getCorrectAnswer(0);
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

struct Sieve {
    int n;
    vector<int> f, primes;
    Sieve(int n = 1) :n(n), f(n + 1) {
        f[0] = f[1] = -1;
        for (ll i = 2; i <= n; i++) {
            if (f[i]) {
                continue;
            }
            primes.push_back(i);
            f[i] = i;
            for (ll j = i * i; j <= n; j += i) {
                if (!f[j]) {
                    f[j] = i;
                }
            }
        }
    }

    bool isPrime(int x) {
        return f[x] == x;
    }

    vector<int> factorList(int x) {
        vector<int> res;
        while (x != 1) {
            res.push_back(f[x]);
            x /= f[x];
        }
        return res;
    }

    vector<P> factor(int x) {
        vector<int> fl = factorList(x);
        if (fl.size() == 0) {
            return {};
        }
        vector<P> res(1, P(fl[0], 0));
        for (int p : fl) {
            if (res.back().first == p) {
                res.back().second++;
            }
            else {
                res.emplace_back(p, 1);
            }
        }
        return res;
    }
};

int main() {
    int n;
    cin >> n;
    Sieve sieve(n);
    ll ans = 0;
    vector<ll> cnt(n+1, 1);
    for(ll p : sieve.primes){
        for(ll x = p; x <= n; x += p){
            ll y = x;
            ll c = 0;
            while(y % p == 0){
                y /= p;
                c++;
            }
            cnt[x] *= c + 1;
        }
    }
    for(ll i = 1; i <= n; i++){
        ans += i * cnt[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 123252
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;
using static System.Console;
using static System.Math;
using static System.Array;

class Program
{
	public static void Main()
	{
		var n = ReadLine().Split().Select(long.Parse).ToArray();
		var d = n[1] * n[1];
		var count = 0;
		for(int i = 0; i < n[0]; i++)
		{
			var a = ReadLine().Split().Select(long.Parse).ToArray();
			if(a[0] * a[0] + a[1] * a[1] <= d)
				count++;
		}
		WriteLine(count);
	}
}


Measured memory_bytes: 23096
#include <bits/stdc++.h> // only for GCC
using namespace std;

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

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

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

const double EPS = 1e-10;
const double PI  = acos(-1.0);

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

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

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

int main() {
  int n;
  VI v;

  cin >> n;  
  REP(i, n) {
    int x;
    cin >> x;
    v.PB(x);
  }
  sort(ALL(v));

  int max = v[n-1];
  for(int i = 1; i <= max; i++) {
    bool b = true;
    REP(j, n) {
      if(v[j] % i != 0) b = false;
    }
    if(b) cout << i << endl; 
  }
}

Measured memory_bytes: 1216
fun main() {
    val (H, W, K) = readLine()!!.split(" ").map { it.toInt() }
    val C = Array(H){ readLine()!!.toCharArray() }

    var ans = 0
    fun rec(s: String){
        if(s.length != (H+W)){
            rec(s+"0")
            rec(s+"1")
        }else{
            val hRed = s.slice(0 until H)
            val wRed = s.slice(H until H+W)
            var count = 0
            for(i in 0 until H){
                for(j in 0 until W){
                    if(C[i][j] == '#' && hRed[i] == '0' && wRed[j] == '0') count++
                }
            }
            if(count == K) ans++
        }
    }

    rec("")
    println(ans)
}

Measured memory_bytes: 41132
#include<iostream>
#include<string.h>
#include<ctype.h>
#include<string>
#include<math.h>
#define pi 3.141592653589
#include<iomanip>
using namespace std;

int main(){
     
    char c;
    
    cin>>c;
    if(c=='a'||c=='i'||c=='u'||c=='e'||c=='o')cout<<"vowel"<<endl;
    else cout<<"consonant"<<endl;
     
    return 0;
}
 

Measured memory_bytes: 256
package main

import (
	"fmt"
	"math"
)

type Gem struct {
	Cost  int
	Value int
}

func main() {
	var n int
	fmt.Scan(&n)

	var Gems = make([]Gem, n)

	for i := 0; i < n; i++ {
		var v int
		fmt.Scan(&v)
		Gems[i].Value = v
	}

	for i := 0; i < n; i++ {
		var c int
		fmt.Scan(&c)
		Gems[i].Cost = c
	}

	var bestBenefit = 0
	for i := 0; i < int(math.Pow(2.0, float64(n))); i++ {
		var j = 0
		var temp = i
		var sum = 0
		for temp > 0 {
			if temp%2 == 1 {
				sum += (Gems[j].Value - Gems[j].Cost)
			}
			j++
			temp = temp / 2
		}

		if bestBenefit < sum {
			bestBenefit = sum
		}
	}

	fmt.Println(bestBenefit)
}


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

int main() {
  string t;
  cin >> t;
  int i;
  for(i=0;i<(int)t.size();i++){
    if(t.at(i)=='?'){
      t.at(i)='D';
    }
  }
  cout << t << endl;
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */



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

	LL N; cin >> N;
	VL a(N);
	FOR(i, 0, N) {
		cin >> a[i];
	}
	auto f = [](const VL& a) {
		LL ret = 0;
		FOR(i, 0, SZ(a)) {
			if (a[i] == i + 1)ret++,i++;
		}
		return ret;
	};
	auto g = [](const VL& a) {
		LL ret = 0;
		FORR(i, SZ(a) - 1, 0 - 1) {
			if (a[i] == i + 1)ret++,i--;
		}
		return ret;
	};


	LL ans = min(f(a), g(a));
	cout << ans << endl;

	return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()

int r, d, x;

vi solve() {
    vi res;
    REP (i, 10) {
        x = r * x - d;
        res.push_back(x);
    }
    return res;
}

int main() {
    cin >> r >> d >> x;
    FORE (x, solve()) cout << x << endl;
}

Measured memory_bytes: 256
# 2019-11-15 13:51:51(JST)
import sys
# import collections
import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    n, d = [int(x) for x in sys.stdin.readline().split()]
    x = [tuple(int(x) for x in sys.stdin.readline().split()) for _ in range(n)]

    count = 0
    for i in range(n-1):
        for j in range(1, (n-1)-i+1):
            dist = sum([ (x[i+j][k] - x[i][k]) ** 2 for k in range(d)]) ** 0.5
            if dist == math.floor(dist):
                count += 1

    print(count)
    
if __name__ == "__main__":
    main()


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

struct card {char suit,value;};

void bubble(struct card a[],int n)
{
	for(int i=0;i<n;i++)
	{
		for(int j=n-1;j>=i+1;j--)
		{
			if(a[j].value<a[j-1].value)
			{
			card t=a[j-1];a[j-1]=a[j];a[j]=t;
		}
		}
	}
}
void selection(struct card a[],int n)
{
	for(int i=0;i<n;i++)
	{
		int minj=i;
		for(int j=i;j<n;j++)
		{
			if(a[j].value<a[minj].value)
			minj=j;
		}
		card t=a[i];a[i]=a[minj];a[minj]=t;
	}
}
void print(struct card a[],int n)
{
	for(int i=0;i<n;i++)
	{
	 if(i>0)cout<<" ";
	 cout<<a[i].suit<<a[i].value;
	}
	cout<<endl;
}
bool isStable(struct card c1[],struct card c2[],int n)
{
	for(int i=0;i<n;i++)
	{
		if(c1[i].suit!=c2[i].suit)
		return false;
	}
	return true;
}

int main()
{
	card c1[100],c2[100];
	int n;
	char ch;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>c1[i].suit>>c1[i].value;
	}
	for(int i=0;i<n;i++)
	c2[i]=c1[i];
	bubble(c1,n);
	selection(c2,n);
	
	print(c1,n);
	cout<<"Stable"<<endl;
	print(c2,n);
	if(isStable(c1,c2,n))
	{
		cout<<"Stable"<<endl;
	}
	else
	cout<<"Not stable"<<endl;
	return 0;
}


Measured memory_bytes: 3112
#include <stdio.h>

long long gcd(long long x,long long y)
{
	long long r;
	while ((r = x % y) != 0)
	{
		x = y;
		y = r;
	}
	return y;
}
long long lcm(long long x, long long y)
{
	long long a;
	a = x / gcd(x, y);
	return (a*y);
}
int main()
{
	long long n,z;
	long long a[100];
	scanf("%lld", &n);
	for (long long i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
		if (i == 0) {
			z = a[i];
			continue;
		}
		if(z>=a[i]){
			z = lcm(z, a[i]);
		}
		else {
			z = lcm(a[i], z);
		}
	}
	printf("%lld", z);
	return 0;
}

Measured memory_bytes: 128
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] A = new int[n+1];
        for(int i=1;i<=n;i++) A[i]=sc.nextInt();
        System.out.println(help(n,A));
    }
    static long help(int n,int[] A){
        for(int i=1;i<=n;i++){
            if(A[i]>i-1) return -1;
        }
        for(int i=1;i<=n-1;i++){
            if(A[i]<A[i+1]-1) return -1;
        }
        long ans = 0;
        ans += A[n];
        for(int i=n-1;i>=1;i--){
            if(A[i]+1==A[i+1]) continue;
            ans += A[i];
        }
        return ans;
    }
}


Measured memory_bytes: 87952
#include <iostream>
#include <algorithm>
#include <vector>
#define pb push_back

using namespace std;

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

int v[5];

int main()
{
    int n, m;

    cin >> n >> m;
    int poz, cif;
    for (int i=1;i<=n;i++)
        v[i] = -1;
    for (int i=1;i<=m;i++)
    {
        cin >> poz >> cif;
        if (poz == 1 && cif == 0 && n != 1)
        {
            cout << -1;
            return 0;
        }
        if (v[poz] == -1)
            v[poz] = cif;
        else
            if (v[poz] != cif)
            {
                cout << -1;
                return 0;
            }
    }
    for (int i=1;i<=n;i++)
    {
        if (v[i] == -1)
        {
            if (i == 1 && n != 1)
                v[i] = 1;
            else
            {
                v[i] = 0;
            }
        }
        cout << v[i];
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
  cin >> n;
vector<char>text(n);
  for(int i=0;i<n;i++){
cin >> text.at(i);}
for(int i=0;i<n;i++){
if(text.at(i)=='Y'){
  cout << "Four" <<endl;
  return 0;
  
                  }
}
  cout << "Three" <<endl;
}

Measured memory_bytes: 256
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define showa(v) for(int iii = 0; iii < v.size(); iii++){ cout << v[iii] << " ";} cout << endl;
#define show(iiii) cout << iiii << endl; 
#define shows(iiiii) cout << iiiii << " ";
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include <cmath>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <set>
#include <deque>
#include <numeric>
#include<tuple>
#include <utility>
#include <map>
#include <cassert>
using namespace std;
 
int main(){
    string t; 
    cin >> t;

    // bool nextp = false;
    // int pd = 0;
    rep(i,t.size()){
        if(t[i] == '?'){
            t[i] = 'D';
        }
    }
    cout << t << endl;

}

Measured memory_bytes: 3756
def fac(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

n = int(input())
result=0
flg=0
for i in range(len(fac(n))):
  target = fac(n)[i][1]
  if fac(n)[i][0] <= 1:
    flg=1
    break
  sikii=0
  for j in range(1,target+1):
    sikii += j
    if sikii <= target < (sikii+j+1):
      result += j
      break
if flg == 1:
  print('0')
else:
  print(result)


Measured memory_bytes: 9524
#include<bits/stdc++.h>
#define int long long
using namespace std;
typedef pair<int,int> ii;
vector<ii> vet, ind;

main(){
	int n,val, v1,v2,l=0, soma =0, r;
	cin >> n;
	
	for(int i= 0;i<n;i++){
		cin >> v1 >> v2;
		ind.push_back({v1,v2});
		vet.push_back({(v1+v2),i});
	
	}
	sort(vet.begin(),vet.end(),greater<ii>());
	for(int i= 0;i<n;i++){
		if(!(i&1))
			soma += ind[vet[i].second].first;
		else
			soma -= ind[vet[i].second].second;
	}
	
	
	cout<< soma;
	
	

}

Measured memory_bytes: 3564
def a():
    S = input()
    if(len(S) == 1):
        print("No")
        return

    s = list(S)
    s.sort()

    count = 0
    prec = 'A'
    for c in s:
        if(prec != c):
            prec = c
            if(count%2 == 1):
                print("No")
                return
            count = 0
        count += 1
    print("Yes")

a()

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

for i in range(h):
    for j in range(w):
        if s[i][j]=='snuke':
            row=i
            col=j
            break

def num2alpha(c):
    return chr(c+64+1)

print(num2alpha(col)+str(row+1))


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

int main(){
  int ABC[3];
  cin >> ABC[0] >> ABC[1] >> ABC[2];

  int mod2_sum = 0;
  for(int i = 0; i < 3; i++){
    mod2_sum += ABC[i] % 2;
  }

  int ans = 0;
  if(mod2_sum == 1){
    ans++;
    for(int i = 0; i < 3; i++){
      if(ABC[i] % 2 == 0){
        ABC[i]++;
      }
    }
  }else if(mod2_sum == 2){
    ans++;
    for(int i = 0; i < 3; i++){
      if(ABC[i] % 2 == 1){
        ABC[i]++;
      }
    }
  }

  int ABC_max = 0;
  for(int i = 0; i < 3; i++){
    ABC_max = max(ABC_max, ABC[i]);
  }

  for(int i = 0; i < 3; i++){
    ans += (ABC_max - ABC[i]) / 2;
  }
  cout << ans << endl;

  
}


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


ll power(ll a,ll n)
{
    ll res=1;
    while(n)
    {
        if(n&1)
            res=(res*a)%mod , n--;

        n=n/2;
        a=(a*a)%mod;
    }
    return res;
}

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

    ll n;
    cin>>n;

    if(n==1)cout<<0<<"\n";

    else
    {
        ll ans=power(10,n);
        ans=(ans-power(9,n))%mod;
        if(ans<0)ans+=mod;
        ans=(ans-power(9,n))%mod;
        if(ans<0)ans+=mod;
        ans=(ans+power(8,n))%mod;
        cout<<ans<<"\n";
    }
}


Measured memory_bytes: 3680
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <string>
#include <queue>
#include <numeric>
#include <ctype.h>
#include <limits>
#include <iomanip>

#define rep(i,n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
using namespace std;

typedef long long ll;

int main()
{
	int h, w, n;
	cin >> h >> w >> n;
	int m = max(h, w);
	int ans = (n + m - 1) / m;
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <algorithm>

typedef long long ll;

typedef struct {
  ll time;
  ll x;
  ll y;    
} S_Trip;

int main(int argc, char* argv[])
{
  int n;

  
  std::vector< S_Trip > vtrip;
  std::vector< S_Trip >::iterator it;
  std::cin >> n;

  S_Trip tmp_trip;
  tmp_trip.time = 0;
  tmp_trip.x    = 0;
  tmp_trip.y    = 0;

  vtrip.push_back(tmp_trip);

  for (int i = 0; i < n; i++) {
    std::cin >> tmp_trip.time;
    std::cin >> tmp_trip.x;
    std::cin >> tmp_trip.y;
    vtrip.push_back(tmp_trip);
  }

  bool judge = true;
  std::vector< S_Trip >::iterator pre_it;
  pre_it = vtrip.begin();
  it = vtrip.begin();
  it++;
  for (; it != vtrip.end(); it++, pre_it++) {
    if ((it->time - pre_it->time) < std::fabs(it->x - pre_it->x) + std::fabs(it->y - pre_it->y)) {
      judge = false;
    }

    ll tmp1 = (it->time - pre_it->time) % 2;
    ll tmp2 = ((ll)std::fabs(it->x - pre_it->x) + (ll)std::fabs(it->y - pre_it->y)) % 2;
    if (tmp1 != tmp2) {
      judge = false;
    }
  }

  if (judge) {
    std::cout << "Yes" << std::endl;
  } else {
    std::cout << "No" << std::endl;
  }
    
  return 0;
}


Measured memory_bytes: 4852
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            long total = 0;
            long cake = 0;
            long donut = 0;
            while (true)
            {
                if (cake * 4 > N)
                {
                    break;
                }
                donut = 0;
                while (true)
                {
                    total = cake * 4 + donut * 7;
                    if(total == N)
                    {
                        Console.WriteLine("Yes");
                        return;
                    }
                    else if(total > N)
                    {
                        break;
                    }
                    donut++;
                }
                cake++;
            }
            Console.WriteLine("No");
        }
    }
}
// 文字列の入力
//string s = Console.ReadLine();

// 整数の入力
//long n = long.Parse(Console.ReadLine());

// 文字列配列の入力
//string[] inputStrArray = Console.ReadLine().Split(' ');

// 整数配列の入力
//long[] inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();


Measured memory_bytes: 27484
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  while(getline(cin,s),s!="."){
    stack<char> a;
    bool flag=false;
    for(int i=0;i<s.size();++i){
      if(s[i]=='(') a.push(s[i]);
      else if(s[i]=='[') a.push(s[i]);
      else if(s[i]==')')
        if(a.empty() || a.top()!='(') flag=true;
        else a.pop();
      else if(s[i]==']')
        if(a.empty() || a.top()!='[') flag=true;
        else a.pop();
      if(flag) break;
    }
    if(flag || !a.empty()) cout<<"no\n";
    else cout<<"yes\n";
  }
 
  return 0;
}

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

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

const ll INF = 1LL << 60;
const int MOD = 1000000007;

int main() {
#ifdef MYLOCAL
    ifstream in("input.txt");
    cin.rdbuf(in.rdbuf());
#endif

    string s; cin >> s;
    int n = s.size() - 1;
    ll ans = 0;
    for(ll bit = 0; bit < (1 << n); ++bit){
        vector<string> num;
        int l = 0;
        int count = 1;
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) {
                string tmp = s.substr(l, count);
                num.push_back(tmp);
                l = i + 1;
                count = 1;
            }else{
                ++count;
            }
        }
        string tmp = s.substr(l, s.size() - l);
        num.push_back(tmp);
        for(int i = 0; i < num.size(); ++i){
            ans += stoll(num[i]);
        }
    }
    cout << ans << endl;
    return 0;
}



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

int main() {
  string w;
  cin >> w;
  bool ans = true;
  map<char, int> mp;
  rep(i, w.size()){
    mp[w[i]]++;
  }
  for (auto i :mp){
    if(i.second % 2 != 0){
      ans = false;
    }
  }
  cout << (ans ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
import sys
N = int(input())
points = sorted([list(map(int, input().split())) for _ in range(N)], key=lambda p: -p[2])
for c_x in range(101):
    for c_y in range(101):
        h = points[0][2] + abs(points[0][0] - c_x) + abs(points[0][1] - c_y)
        for point in points[1:]:
            if max(h - abs(point[0] - c_x) - abs(point[1] - c_y), 0) != point[2]:
                break
        else:
            print(c_x, c_y, h)
            sys.exit()


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

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

const ll MOD = 1e9 + 7;
const ll inf = 1LL<<60;
const int int_inf = 100000000;
const double eps = 1e-9;

const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    bool ok = false;
    for (int i = 0; i < 3; i++) {
        if (s[i] == '7') ok = true;
    }

    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}



Measured memory_bytes: 3640