akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
#define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , 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; }

struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};



void solve(){
    ll a,b;
    cin>>a>>b;
    if((a*b)%2==1) cout<<"Odd"<<endl;
    else cout<<"Even"<<endl;
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
    
    solve();

    return 0;
}


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

int main(void) {
	int n, d;
	cin >> n >> d;
	int ans = 0;
	while (n > 0) {
		n -= d + d + 1;
		ans++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define FAST ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

int32_t main(){ 
    FAST
    int n;cin>>n;
    map<int,int> mp;
    for(int i=1;i<105;i++){
        for(int j=1;j<105;j++){
            for(int k=1;k<105;k++){
                int curr=i*i+j*j+k*k+i*j+i*k+j*k;
                mp[curr]++;
            }
        }
    }

    for(int i=1;i<=n;i++){
        if(mp.count(i)!=0) cout<<mp[i]<<"\n";
        else cout<<0<<"\n";
    }

    return 0;
}

Measured memory_bytes: 6232
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 99940000
#define mod 1000000007
#define pi 3.141592653589793238
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define in3(a,b,c) cin>>a>>b>>c
#define vll vector<ll>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define endl '\n'
#define sp ' '
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
ll power(ll x,ll y){
    ll ret=1;
    while(y>0){
        if(y&1)
            ret=(ret*x);
        y/=2;
        x=(x*x);
    }
    return ret;
}
string rot(string s){
	string ret="";
	ll i;
	for(i=1;s[i];i++){
		ret+=s[i];
	}
	ret+=s[0];
	return ret;
}
ll power(ll x,ll y,ll p)
{
	ll ret=1;
	while(y>0)
	{
		if(y&1)
			ret=(ret*x)%p;
		y/=2;
		x=(x*x)%p;
	}
	return ret%p;
}
void solve(){
	ll x,y,i;
	cin>>x>>y;
	nfl(i,x+1){
		ll k=i;
		ll rem=x-i;
		if(k*2+rem*4==y){
			cout<<"Yes"<<endl;
			return;
		}
	}
	cout<<"No"<<endl;
}	
int main(){
	gear_change;
	ll test=1;
	// in(test);
	while(test--){
		solve();
	}
}	


Measured memory_bytes: 3640
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
const int MAXN=3000;
const int MOD=1e9+7;
void A(int& a,int b){a+=b;if(a>=MOD)a-=MOD;}
int n,m,r[MAXN+10],f[MAXN+10][MAXN+10],sm[MAXN+10];
char s[MAXN+10];
int main()
{
	scanf("%d%d%s",&n,&m,s+1);
	for(int i=1;i<=n;++i)sm[i]=sm[i-1]+s[i]-'0',r[i]=i;
	for(int i=1,a,b;i<=m;++i)
	{
		scanf("%d%d",&a,&b);
		r[a]=max(r[a],b);
	}
	for(int i=1;i<=n;++i)r[i]=max(r[i],r[i-1]);
	f[1][sm[r[1]]]=1;
	for(int i=1;i<n;++i)
	{
		for(int j=0;j<=n;++j)
		{
			if(!f[i][j])continue;
			int k=sm[r[i+1]]-sm[r[i]];
			if(j<r[i]-i+1&&j+k<=r[i+1]-i)A(f[i+1][j+k],f[i][j]);
			if(j>0&&j+k-1<=r[i+1]-i)A(f[i+1][j+k-1],f[i][j]);
		}
	}
	int ans=f[n][0];A(ans,f[n][1]);
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 33920
import heapq

X, Y, Z, K = map(int, input().split())
A = sorted([int(i) for i in input().split()], reverse=True)
B = sorted([int(i) for i in input().split()], reverse=True)
C = sorted([int(i) for i in input().split()], reverse=True)

heap = []
heapq.heappush(heap, (-(A[0] + B[0] + C[0]), 0, 0, 0))
added = set([(0, 0, 0)])
for _ in range(K):
    p, i, j, k = heapq.heappop(heap)
    if (i + 1, j, k) not in added and i + 1 < X:
        heapq.heappush(heap, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))
        added.add((i + 1, j, k))
    if (i, j + 1, k) not in added and j + 1 < Y:
        heapq.heappush(heap, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))
        added.add((i, j + 1, k))
    if (i, j, k + 1) not in added and k + 1 < Z:
        heapq.heappush(heap, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))
        added.add((i, j, k + 1))
    print(-p)

Measured memory_bytes: 4852
#include<bits/stdc++.h>
#define INF (1e9)
#define MAX_V 305
using namespace std;
typedef pair<int,int> P;
//????????¨????§???????(???????????????????????????)
struct edge{int to, cap, rev;};

vector<edge> G[MAX_V]; //??°???????????£??\?????????
bool used[MAX_V];      //DFS??§?????§??????????????????????????°

//from??????to??????????????????cap???????????°?????????????????????
void add_edge(int from,int to,int cap){
  G[from].push_back((edge){to,cap,G[to].size()});
  G[to].push_back((edge){from,cap,G[from].size()-1});
}

//?¢?????????????DFS??§??¢???
int dfs(int v,int t,int f){
  if(v == t)return f;
  used[v]=true;
  for(int i=0; i<G[v].size() ;i++){
    edge &e = G[v][i];
    if(!used[e.to] && e.cap > 0){
      int d = dfs(e.to ,t , min(f,e.cap));
      if(d > 0){
	e.cap -= d;
	G[e.to][e.rev].cap += d;
	return d;
      }
    }
  }
  return 0;
}

//s??????t???????????§???????±???????
int max_flow(int s,int t){
  int flow = 0;
  for(;;){
    memset(used,0,sizeof(used));
    int f = dfs(s, t, INF);
    if(f == 0)return flow;
    flow += f;
  }
}

map<P,int> A;

int main(){
  int n,m,a,b,s,t;
  cin>>n>>m;
  for(int i=0;i<m;i++){
    cin>>a>>b;
    a--,b--;
    add_edge(a,b,1);
    A[P(a,b)]=i;
  }
  cin>>s>>t;
  s--,t--;
  int ans=max_flow(s,t);
  vector<int> ans2;
  for(int i=0;i<n;i++)
    for(int j=0;j<G[i].size();j++){
      int from=i,to=G[i][j].to;
      if(A.count(P(from,to))&&G[i][j].cap==2)
	ans2.push_back(A[P(from,to)]);
    }
  cout<<ans<<endl;
  sort(ans2.begin(),ans2.end());
  cout<<ans2.size()<<endl;
  for(int i=0;i<ans2.size();i++)cout<<ans2[i]+1<<endl;
  return 0;
}

Measured memory_bytes: 3208
N = int(input())
S = [input() for i in range(N)]

table = {}
for Si in S:
    table[Si] = 1 if table.get(Si) is None else table.get(Si) + 1

maximum = max(table.values())

foo = lambda item: item[1] == maximum
filtered = filter(foo, table.items())
filtered = dict(filtered)
bar = list(filtered.keys())
bar.sort()

answer = "\n".join(bar)

print(answer)


Measured memory_bytes: 53520
import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws FileNotFoundException {

		Scanner scan = new Scanner(System.in);
		// Scanner scan = new Scanner(new
		// File("D:\\UserArea\\J0124567\\Downloads\\0531-input.txt"));

		while (scan.hasNext()) {

			int n = 3;
			for (int i = 0; i < n; i++) {
				int h = scan.nextInt();
				int m = scan.nextInt();
				int s = scan.nextInt();
				int eh = scan.nextInt();
				int em = scan.nextInt();
				int es = scan.nextInt();

				run(h, m, s, eh, em, es);
			}
			scan.close();
			System.exit(0);
		}
	}

	private static void run(int h, int m, int s, int eh, int em, int es) {
		int w = (((eh * 60) + em) * 60 + es) - (((h * 60) + m) * 60 + s);
		System.out.println(w / 3600 + " " + w % 3600 / 60 + " " + w % 60);
	}

}

Measured memory_bytes: 26160
n,a,b=[int(x) for x in input().split()]
v=sorted([int(x) for x in input().split()],reverse=True)
from collections import Counter
c=Counter(v)
aveMax=0
avelist=[]
for i in range(a,b+1):
    avetmp=sum(v[:i])/i
    if avetmp>=aveMax:
        aveMax=avetmp
        avelist.append(Counter(v[:i]))
from math import factorial
def nCm(n,m):
    return factorial(n)//factorial(m)//factorial(n-m)
ans=0    
for i in avelist:
    multi=1
    for j in i:
        multi=multi*nCm(c[j],i[j])
    ans+=multi
print("{:.6f}".format(aveMax))
print(ans)

Measured memory_bytes: 39280
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,ans=0;
	cin>>a>>b;
	for(int c=1;c<=max(a,b);c++){
		if((a*b*c)%2!=0) ans++;
	}
	if(ans!=0) cout<<"Yes";
	if(ans==0) cout<<"No";
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define mod 1000000009
#define mk make_pair
#define f first
#define s second
using namespace std;
int main(int argc, char const *argv[])
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	long long a;
	long double b;
	cin>>a>>b;
	long double ans = a*b;
	cout<<(long long) ans<<endl;
	return 0;
}

Measured memory_bytes: 3744
import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		if(A < B && B < C) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 26200
n, m = map(int, input().split())
a = list(map(int, input().split()))

s = [0]#s[i]はaからi個取った累積和
for i in range(len(a)):
    s.append((s[i] + a[i]) % m)

ans = 0
d = dict()
for i in range(len(s)):
    t = d.get(s[i], 0)
    ans += t
    d[s[i]] = t + 1
print(ans)

Measured memory_bytes: 16300
#include<bits/stdc++.h>
using namespace std;
#define debug(x)        cout<<#x<<" :"<<x<<endl;
#define ff              first
#define ar              array
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define f(i,n)          for(int i=0;i<n;i++)
#define MOD             1000000007
#define pi              3.14159265
#define umii            unordered_map<int,int>
#define umci            unordered_map<char,int>
#define umsi            unordered_map<string,int>

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

#ifndef ONLINE_JUDGE
	freopen("ip1.txt", "r", stdin);
	freopen("op1.txt", "w", stdout);
#endif
}
bool sortbysec(const pair<int, int> &a,
               const pair<int, int> &b);
int gcd(int a, int b) ;
int prime(int n);
int power(int x, int y);
int lcm(int a, int b);
int32_t main()
{
	k_007();
	int n;
	cin >> n;
	string ans = "";
	while (n > 0)
	{
		n--;
		char c = (char)(n % 26 + 'a');
		ans += c;
		n /= 26;
	}

	reverse(ans.begin(), ans.end());
	cout << ans << endl;
}
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b)
{
	return (a.second < b.second);
}
int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int prime(int n) {
	int flag = 1;
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0) {flag = 0; break;}
	}
	return flag;
}
int power(int x, int y)
{
	if (y == 0)
		return 1;
	else if (y % 2 == 0)
		return ((power(x, y / 2) % MOD) * ( power(x, y / 2) % MOD)) % MOD;
	else
		return ((x % MOD) * (power(x, y / 2) % MOD) * (power(x, y / 2) % MOD)) % MOD;
}
int lcm(int a, int b)
{
	return (a * b) / gcd(a, b);
}

Measured memory_bytes: 3632
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;

using namespace std;

const long long MOD = 1000000007;

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

	int n, k;
	cin >> n >> k;
	ll* p;
	p = new ll[n];
	rep(i, n) cin >> p[i];
	
	ll ans;
	ll sum = 0;
	rep(i, k) sum += p[i];
	ans = sum;
	REP(i, k, n) {
		sum = sum + p[i] - p[i - k];
		ans = max(ans, sum);
	}

	cout << setprecision(10) << double(ans + k) / double(2) << "\n";

	return 0;
}


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

int main() {
	string S;
	char now=' ';
	int count=-1;
	cin>>S;
	for(int i=0;i<S.size();i++){
		if(S[i]!=now){
			now=S[i];
			count++;
		}
	}
	cout<<count<<endl;
	return 0;
}

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

#define MAX 6
typedef pair<int, int> Pos;
typedef vector<vector<char>> Field;

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

int N;
int n2;
Field field;

bool WithinRange(int y, int x) {
  if (y < 0 || N <= y) return false;
  if (x < 0 || N <= x) return false;
  return true;
}

int CalcHash(Field &field) {
  int ret = 0;
  int bit = 0;
  for (int i=0; i<N; i++) {
    for (int j=0; j<N; j++) {
      bit <<= 1;
      if (field[i][j] == '#') bit |= 1;
      else if (field[i][j] == '@') {
        ret = i*N + j;
      } else assert(field[i][j] == '.');
    }
  }

  return bit*n2 + ret;
}

bool IsWall(int hash, int y, int x) {
  int idx = y*N + x;
  if (hash%n2 == idx) return true;
  hash /= n2;
  return (hash >> (n2-1-idx) & 1);
}

void Print(int g, int d) {
  printf("d[%x]: %d\n", g, d);
  int hash = g/n2;
  int _ = g%n2;
  int y = _/N;
  int x = _%N;
  printf("(%d, %d)\n", y, x);
  for (int i=0; i<N; i++) {
    for (int j=0; j<N; j++) {
      if (i == y && j == x) {
        printf("@");
        assert ((hash >> (n2-1-i*N-j) & 1) == 0);
      }
      else printf("%01d", hash >> (n2-1-i*N-j) & 1);
    }
    puts("");
  }
}

int main() {
  while (1) {
    scanf("%d", &N);
    if (N == 0) return 0;

    n2 = N*N;
    field.resize(N, vector<char>(N));
    for (int i=0; i<N; i++) {
      for (int j=0; j<N; j++) {
        scanf(" %c", &field[i][j]);
      }
    }

    queue<int> q;
    map<int, int> d;
    set<int> calced;
    int t = CalcHash(field);
    if (t/n2 == 0) {
      puts("0");
      continue;
    }

    d[t] = 0;
    q.push(t);
    while (!q.empty()) { 
      int g = q.front(); q.pop();
      if (calced.count(g)) continue;
      calced.insert(g);
      //Print(g, d[g]);
      int _ = g%n2;
      int y = _/N;
      int x = _%N;
      for (int k=0; k<8; k++) {
        int newy = y + dy[k];
        int newx = x + dx[k];
        if (!WithinRange(newy, newx)) continue;
        if (IsWall(g, newy, newx)) continue;
        int newg = g/n2*n2 + newy*N + newx;
        int nhash = 0;
        for (int i=0; i<N; i++) {
          for (int j=0; j<N; j++) {
            nhash <<= 1;
            if (i == newy && j == newx) continue;

            int cnt = 0;
            for (int l=0; l<8; l++) {
              int y = i + dy[l];
              int x = j + dx[l];
              if (!WithinRange(y, x)) continue;
              if (IsWall(newg, y, x)) cnt++;
            }

            if (IsWall(newg, i, j)) {
              if (2 <= cnt && cnt <= 3) nhash |= 1;
            } else if (cnt == 3) nhash |= 1;
          }
        }
        newg = nhash*n2 + newy*N + newx;
        if (d.count(newg)) continue;
        d[newg] = d[g]+1;
        if (newg/n2 == 0) {
          printf("%d\n", d[newg]);
          goto L_END;
        }
        q.push(newg);
      }
    }

    puts("-1");
L_END:
    continue;
  }
}

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

int main() {
  vector<int> in(3);
  rep(i, 3) cin >> in[i];
  sort(in.begin(), in.end());
  
  cout << in[2] - in[0] << endl;
  
  
  return 0;
}


Measured memory_bytes: 256
//{{{
#include<algorithm>
#include<cmath>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printw) FUNC(printwe) FUNC(printb) FUNC(printbe) FUNC(printd) FUNC(printde) FUNC(printdu);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ return in >> p.first >> p.second; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }
//}}}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> ps(n); cin >> ps;
    int ans = 0;
    for(int i = 1; i < n - 1; i++){
        ans += (ps[i - 1] < ps[i] && ps[i] < ps[i + 1]);
        ans += (ps[i - 1] > ps[i] && ps[i] > ps[i + 1]);
    }
    cout << ans << '\n';
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int main()
{
	fast;
	char a;
  cin>>a;
  if(isupper(a))
    cout<<"A"<<endl;
  else
    cout<<"a"<<endl;

	return 0;
}

Measured memory_bytes: 3636
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cstring>
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const long double EPS = 1e-9;
const ll mod = 1e9 + 7;
const ll INF = 1e9;

#define rep(i, n) for(ll i = 0; i < n ; i++ )
#define For(i, a, b) for(ll i = (a); i < (b) ; i++ )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

const ll MAX_N = 100000;

int main(void){
    ll N;
    ll t[MAX_N], x[MAX_N], y[MAX_N];

    cin >> N;
    rep(i, N) cin >> t[i] >> x[i] >> y[i];

    rep(i, N){
        ll d;
        if (i == 0) d = t[i] - x[i] - y[i];
        else d = t[i] - t[i - 1] - abs(x[i] - x[i - 1]) - abs(y[i] - y[i - 1]);
        if (d < 0 || d % 2 == 1){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 2560
a = input()
b = input()
mini = len(b)
if a == b:
  print(0)
  exit(0)
for s in range(len(a) - len(b) + 1):
  c = 0
  for i, j in zip(a[s:s + len(b)], b):
    if i != j:
      c += 1
  mini = min([mini, c])
print(mini)



Measured memory_bytes: 9112
main = getLine >>= print.f1

f1 l
  | l == [] = 0
  | otherwise = max (f2 l) (f1 $ tail l)

f2 l
  | l == [] = 0
  | (head l) == 'A' || (head l) == 'T' || (head l) == 'G' || (head l) == 'C' = (+) 1 $ f2 (tail l)
  | otherwise = 0

Measured memory_bytes: 380
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use itertools::Itertools;
use std::process::exit;
use std::cmp::*;
use num::*;
use num::integer::Roots;

fn main() {
    input! {
    a:String,
    b:usize,
    }
    let mut a=a.chars().collect_vec();
    let mut v:Vec<char>=Vec::new();
    for i in 0..a.len() {
        if i%b==0{v.push(a[i])}
    }
    let v:String=v.iter().collect();
    println!("{}",v)
}

Measured memory_bytes: 2164
#include <bits/stdc++.h>
#include <algorithm>
typedef long long int lli;
using namespace std;
 int main(){
    string s;
	cin >> s;
	sort(s.begin(), s.end());
	
	string t;
	cin >> t;
	sort(t.begin(), t.end());
	reverse(t.begin(), t.end());
	
	if (s < t) cout << "Yes" << endl;
	else cout << "No" << endl;

     return 0;
 }

Measured memory_bytes: 3588
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections;

class Program
{
    static void Main(string[] args)
    {
        var sol = new Solve();
        sol.Exec();
    }
}

class Solve
{
    public void Exec()
    {
        var array = new int[] { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };
        Console.WriteLine(array[int.Parse(Console.ReadLine())-1]);
    }
}


Measured memory_bytes: 13140
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define MP make_pair
#define sz(v) (in((v).size()))
#define forn(i,n) for(in i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
using namespace std;
typedef long long in;
typedef vector<in> VI;
typedef vector<VI> VVI;
vector<string> bd;
VVI v;
const in inf=1e18;
in bst=inf;
in h,w,k;
queue<in> q;
VVI d={{0,1},{1,0},{0,-1},{-1,0}};
in ad(in x, in y){
  in mn=inf;
  mn=min(mn,x);
  mn=min(mn,y);
  mn=min(mn,h-1-x);
  mn=min(mn,w-1-y);
  return (mn+k-1)/k;
}
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin>>h>>w>>k;
  bd.resize(h);
  in sx=-1;
  in sy=-1;
  forn(i,h){
    cin>>bd[i];
    forn(j,w){
      if(bd[i][j]=='S'){
	bd[i][j]='.';
	sx=i;
	sy=j;
      }
    }
  }
  bst=min(bst,ad(sx,sy));
  v.resize(h,VI(w,inf));
  v[sx][sy]=0;
  q.push(sx);
  q.push(sy);
  in x,y;
  while(!q.empty()){
    sx=q.front();
    q.pop();
    sy=q.front();
    q.pop();
    forn(i,4){
      x=sx+d[i][0];
      y=sy+d[i][1];
      if(x<0 || y<0 || x>=h || y>=w)
	continue;
      if(bd[x][y]=='#')
	continue;
      if(v[x][y]!=inf)
	continue;
      v[x][y]=v[sx][sy]+1;
      bst=min(bst,ad(x,y));
      if(v[x][y]==k)
	continue;
      q.push(x);
      q.push(y);
    }
  }
  cout<<bst+1<<endl;
  return 0;
}

Measured memory_bytes: 6016
package main

import (
	"bufio"
	"fmt"
	"io"
	"log"
	"os"

	"sort"
	"strconv"
)

func solve(in io.Reader, out io.Writer) error {
	sc := bufio.NewScanner(in)
	sc.Split(bufio.ScanWords)

	a, b, c := nextInt(sc), nextInt(sc), nextInt(sc)
	l := []int{a, b, c}
	sort.Ints(l)

	d0 := l[2] - l[0]
	d1 := l[2] - l[1]

	if d0%2 == d1%2 {
		fmt.Fprintln(out, d0/2+d1/2+d0%2)
	} else {
		fmt.Fprintln(out, d0/2+d1/2+2)
	}

	return nil
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func main() {
	err := solve(os.Stdin, os.Stdout)
	if err != nil {
		log.Fatal(err)
	}
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
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; }
template<class T> inline istream& operator>>(istream& input, vector<T>& v) { for (auto& elemnt : v)input >> elemnt; return input; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); /*ios::sync_with_stdio(false);*/ cout << fixed << setprecision(15); }

int main() {
    init();

    int n; cin >> n;

    vector<string> s(n);
    cout << "0\n"; 
    fflush(stdout);
    cin >> s[0];
    if (s[0] == "Vacant")return 0;

    int l = 1, r = n;
    while (1) {
        int mid = (l + r) / 2;
        cout << mid << "\n";
        fflush(stdout);
        cin >> s[mid];
        if (s[mid] == "Vacant")return 0;

        if ((mid % 2 == 0 && s[0] == s[mid]) || (mid % 2 == 1 && s[0] != s[mid]))l = mid + 1;
        else r = mid;
    }
}


Measured memory_bytes: 1620
N,K = map(int,input().split())

ans=0
MOD=10**9+7

cnt=[0]*(K+1)
for x in reversed(range(1,K+1)):
    t = K//x
    cnt_tmp = pow(t,N,MOD)
    t=1
    while (t+1)*x<=K:
        t+=1
        cnt_tmp -= cnt[x*t]
    g = x*cnt_tmp %MOD
    cnt[x]+=cnt_tmp
    ans +=g
    ans%=MOD
print(ans)


Measured memory_bytes: 11248
#include <iostream>
#include <vector>
#include <queue>
using namespace std;

#define FOR(i,s,e) for(int i = (s);i <= (e);i++)

vector<int> V[55];

int N;
int M;

bool visited[55];

int main()
{
    cin >> N >> M;
    int a,b;
    FOR(i,0,M - 1)
    {
        cin >> a >> b;
        V[a].push_back(b);
        V[b].push_back(a);
    }
    int res = 0;
    FOR(i,1,N)
    {
        int siz = static_cast<int>(V[i].size());
        FOR(j,0,siz - 1)
        {
            int from = i;
            int to = V[i][j];
            FOR(k,0,54)
            {
                visited[k] = false;
            }

            queue<int> q;
            q.push(from);


            while(!q.empty())
            {
                int x = q.front();
                q.pop();
                visited[x] = true;
                if(x == to)
                {
                    res++;
                    break;
                }
                int v_siz = static_cast<int>(V[x].size());
                FOR(k,0,v_siz - 1)
                {
                    if(visited[V[x][k]] == false)
                    {
                        if(x == from && V[x][k] == to) continue;
                        q.push(V[x][k]);
                    }
                }
            }
        }

    }
     cout << M - res / 2 << endl;
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int d(int n){
	int ans=0;
  	do{
    	ans+=n%10;
    }while(n/=10);
  	return ans;
}
int main(){
	int n;cin>>n;
  	if(n%d(n)) cout<<"No";
  	else cout<<"Yes";
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>
#include <cassert>

using namespace std;

using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;

void debug_out() { cout << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cout << "debug: "; debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define Rep(i, n) for (long long i = 0; i< (long long)(n); i++)
#define RRep(i,n) for (long long i = ((long long)(n)-1); i>=0; i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

struct Edge{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w){ }
};

struct edge{
    int from;
    int to;
    int weight;
    edge(int f,int t,int w) : from(f), to(t), weight(w){ }
};


using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;
using edges = vector<edge>;

template <class T>
inline bool chmin(T &a, T b){
    if (a > b){
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b){
    if (a < b){
        a = b;
        return true;
    }
    return false;
}

template <class T>
T gcd(T a, T b){
    if( b==0 ) return a;
    return gcd(b, a%b);
}

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

bool isPalindrome(string s){
    string t = s;
    reverse(all(t));
    return s==t;
}

constexpr ll INF = 1e9+7;

vector<int> dx = {-1,0,1,0};
vector<int> dy = {0,-1,0,1};

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    ll ans = 0ll;
    ll flag = 0;
    rrep(i,n){
        if(a[i]>flag && i>=a[i]){
            flag = a[i]-1ll;
            ans += a[i];
        }
        else if(flag==a[i]){
            flag--;
        }
        else{
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1792
N, M = map(int, input().split())
dic = {}
cnt = [1]*N
for m in range(M):
  dic[m] = list(map(int, input().split()))
l = sorted([d for d in dic.items()], key=lambda x:x[1][1])
for m in range(len(l)):
  l[m][1].append(cnt[l[m][1][0]-1])
  cnt[l[m][1][0]-1] += 1
for d in dic.values():
  print("{:06d}{:06d}".format(d[0], d[2]))

Measured memory_bytes: 50576
#include<iostream>
using namespace std;
const long long mod = 1000000007;

int main(void){
    long long n, k, res = 0, min, max, count;
    cin >> n >> k;
    if(k == n+1){
        cout << 1 << endl;
        return 0;
    }
    for(long long i = k; i < n+2; ++i){
        min = ((i-1) * i) / 2;
        // max = (((n * (n+1)) - ((n-i) * (n-i+1))) / 2) % mod;
        max = i * (2*n - (i-1)) / 2;
        // if(max - min < 0){
        //     count = (max - min + mod + 1);
        // }else{
        //     count = (max - min + 1) % mod;
        // }
        // count = (max-min+1)%mod;
        res += (max-min+1)%mod;
        // res += count;
        // res %= mod;
    }
    cout << (res % mod) << endl;
    return 0;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int arr[100005];
    int n,i;
    long long int l=0,b=0,area=0;
    cin>>n;
    for(i=0;i<n;i++) cin>>arr[i];
    sort(arr,arr+n);
    for(i=n-1;i>0;i--) {
        if(arr[i]==arr[i-1] && l==0) {
            l=arr[i];
            i=i-2;
        }
        if(l!=0 && arr[i]==arr[i-1]) {
            b=arr[i];
            break;
        }
    }
    area=l*b;
    printf("%lld\n",area);
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>

using namespace std;

int main()
{
	int ss;
	cin >> ss;

	int h = (ss / 3600);
	int m = (ss % 3600) / 60;
	int s = (ss % 60);
	cout << h << ":" << m << ":" << s << endl;
	return 0;
}



Measured memory_bytes: 3088
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int nmax=200005;
vector<ll> c(nmax);
vector<vector<ll>> ad(nmax);
vector<bool> vis(nmax);
ll n;
void dfs(ll s){
  stack<int> st;
  st.push(s);
  vis[s]=true;
  while(!st.empty()){
    int p=st.top();
    st.pop();
    for(auto x:ad[p]){
      if(!vis[x]){
        c[x]+=c[p];
        st.push(x);
        vis[x]=true;
      }
    }
  }
}
int main(){
  ll n,q;cin >> n >> q;
  for(int i=0;i<n-1;i++){
    int a,b;cin >> a >> b;
    a--,b--;
    ad[a].push_back(b);
    ad[b].push_back(a);
  }
  for(int i=0;i<q;i++){
    int p,x;cin >> p >> x;
    p--;
    c[p]+=x;
  }
  dfs(0);
  for(int i=0;i<n;i++){
    cout << c[i] << " ";
  }
  cout << endl;
}

Measured memory_bytes: 17136
#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio (false) ;cin.tie(NULL);
#define tc  int t;cin>>t;for(int i=0;i<t;i++)
#define ll long long int
#define forn(i,n) for(int i=0;i<n;i++)
#define forn1(i,a,b) for(int i=a;i<=b;i++)
#define pb push_back
#define um(a,b) unordered_map<a,b>
#define vv(a) vector<a>
#define pp(a,b) pair<a,b>
#define imax 2000005
ll temp[imax];
ll power(ll a,ll b,ll mod){
   ll ans=1;
   while(b>0){
      if(b&1){
        ans=ans*a;
        ans=ans%mod;
      }
      b=b/2;
      a=a*a;
      a=a%mod;
   }
   return ans;

}
void pre(ll mod){
    temp[0]=1;
    for(ll i=1;i<imax;i++){
        temp[i]=temp[i-1]*i;
        temp[i]%=mod;
    }
}
ll nCr(ll n,ll r,ll mod){
 ll a=temp[n];
  ll b=temp[r];
  ll c=temp[n-r];
  ll d=(b*c)%mod;
  d=power(d,mod-2,mod);
  ll ans=(a*d)%mod;
   return ans;
}

int main() {
    ll mod=1000000007;
    pre(mod);
   ll n;
   cin>>n;

   string s;
   cin>>s;
   ll k=s.length();
   n=n+k;
   ll ans=0;
   for(ll i=0;i<=(n-k);i++){
    ll d=nCr(n,i+k,mod);
     ll e=power(25,n-k-i,mod);
     ll c=(d*e)%mod;
     ans=ans+c;
     ans=ans%mod;
    }
    cout<<ans<<endl;


}


Measured memory_bytes: 20896
n, t = map(int, input().split())
a = list(map(int, input().split()))
max_value = [0] * n #a[i]以降の最大値
max_value[-1] = a[-1]
for i in range(-2, -n - 1, -1):
    max_value[i] = max(max_value[i + 1], a[i])
max_profit = 0
for i in range(n - 1):
    max_profit = max(max_profit, max_value[i] - a[i])
ans = 0
for i in range(n - 1):
    if max_value[i] - a[i] == max_profit: ans += 1
print(ans)

Measured memory_bytes: 15020
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pi pair<int,int>
#define ff first
#define ss second
#define boost ios::sync_with_stdio(false);cin.tie(nullptr)
#include "string"
#define int long long

const int inf = 4*1e18;

int32_t main() { 
    boost;
    int t;
    cin>>t;
    while(t--){
        int n,a,b,c,d;
        cin>>n>>a>>b>>c>>d;
        map<int,int>mp;
        mp[0] = 0;
        mp[1] = d;
        function<int (int)> dfs = [&]( int n ) {
            if( mp.find(n) != mp.end() )
                return mp[n];
            int ans = inf;
            if((long double)n*(long double)d < inf)
                ans = n*d;
            ans = min(ans , dfs(n/2) + a + d*(n%2));
            if( n%2 != 0 )
                ans = min(ans,dfs(n/2 + 1) + a + d*(2 - n%2));
            ans = min(ans , dfs(n/3) + b + d*(n%3));
            if( n % 3 != 0 )
                ans = min(ans,dfs(n/3 + 1) + b + d*(3 - n%3));
            ans = min(ans , dfs(n/5) + c + d*(n%5));
            if( n % 5 != 0)
                ans = min(ans,dfs(n/5 + 1) + c + d*(5 - n%5));

            return mp[n] = ans;
        };

        int ans = dfs(n);
        cout<<ans<<endl;
    }
}  


Measured memory_bytes: 4428
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<complex>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;
using namespace std;

int main(){
	int n,mini=mod;
	cin>>n;
	lol(i,n){
		int a;cin>>a;
		int cnt=0;
		while(a%2==0){
			cnt++;
			a/=2;
		}
		mini=min(mini,cnt);
	}
	cout<<mini<<endl;
	return 0;
}


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

using namespace std;

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

#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl;

template<class T>
ostream &operator<<(ostream &os, const vector <T> &v) {
    os << "[";
    REP(i, SZ(v)) {
        if (i) os << ", ";
        os << v[i];
    }
    return os << "]";
}

template<class T, class U>
ostream &operator<<(ostream &os, const pair <T, U> &p) {
    return os << "(" << p.first << " " << p.second << ")";
}

template<class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;

const ll MOD = 1e9 + 7;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
const ld eps = 1e-9;

struct UnionFind
{
  vector<int> par, sz;
  UnionFind(int n) : par(n), sz(n, 1) {
    for (int i = 0; i < n; ++i) par[i] = i;
  }
  int root(int x) {
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  void merge(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return;
    if (sz[x] < sz[y]) swap(x, y);
    par[y] = x;
    sz[x] += sz[y];
    sz[y] = 0;
  }
  bool issame(int x, int y) {
    return root(x) == root(y);
  }
  int size(int x) {
    return sz[root(x)];
  }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    int n, m; cin >> n >> m;
    UnionFind uf(n);
    REP(i, m) {
      int a, b; cin >> a >> b;
      a--; b--;
      uf.merge(a, b);
    }

    set<int> st;
    REP(i, n) {
      st.insert(uf.root(i));
    }

    cout << SZ(st) - 1 << endl;




    return 0;
}

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;


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

    li all = 0;
    li gaijin = 0;
    rin{
        if (s[i] == 'a') {
            if (all < a + b) {
                puts("Yes");
                all++;
            } else {
                puts("No");
            }
        } else if (s[i] == 'b') {
            if (gaijin < b && all < a + b) {
                puts("Yes");
                all++;
                gaijin++;
            } else {
                puts("No");
            }
        } else{
            puts("No");
        }
    }

    return 0;
}

Measured memory_bytes: 896
# -*- coding: utf-8 -*-
n, m, k = map(int, input().split())

alist = input().split()
blist = input().split()

work = k
acount = 0
while (acount < n) and (work >= int(alist[acount])):
    work -= int(alist[acount])
    acount += 1

bCount = 0
work2 = work
while (bCount < m) and (work2 >= int(blist[bCount])):
        work2 -= int(blist[bCount])
        bCount += 1


maxCount = acount + bCount
bCount = 0
for num in range(0, acount):
    work += int(alist[acount-num-1])

    while (bCount < m) and (work >= int(blist[bCount])):
        work -= int(blist[bCount])
        bCount += 1
    maxCount = max(maxCount, acount-num-1+bCount)


print(maxCount)

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

int main() {
  long long A, B, C;
  cin >> A >> B >> C;
  
  long long min_ = 1000000000000000000;
  if (A % 2 == 0) min_ = 0;
  else min_ = min(min_, B * C);
  if (B % 2 == 0) min_ = 0;
  else min_ = min(min_, A * C);
  if (C % 2 == 0) min_ = 0;
  else min_ = min(min_, A * B);
  
  cout << min_ << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(ll i = (begin); i < (end); i++)
#define rep(i, n) FOR(i, 0, n)
using ll = long long; using ull = unsigned long long;
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>;
template<typename T, typename U> static void chmin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void chmax(T &x, U y) { if (x < y) x = y; }

signed main() {
    int x, y, a, b;
    cin>>x>>y;
    if (y%2==1) {
        cout<<"No";
        return 0;
    }
    y /= 2;
    b = y - x;
    a = x - b;
    if (a >=0 && b >= 0) {
        cout<<"Yes";
    } else {
        cout<<"No";
    }
    return 0;
}

Measured memory_bytes: 3616
N = int(input())
if 1800 <= N:
    print(1)
elif 1600 <= N:
    print(2)
elif 1400 <= N:
    print(3)
elif 1200 <= N:
    print(4)
elif 1000 <= N:
    print(5)
elif 800 <= N:
    print(6)
elif 600 <= N:
    print(7)
elif 400 <= N:
    print(8)


Measured memory_bytes: 61604
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<fstream>       //ファイルストリーム（標準入力変更用）
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

//名前
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef map<string, int> msi;
typedef map<string, ll> msll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pllll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;

//定数
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;

//マクロ
#define rep(i,n) for(int i=0;i<n;i++)
#define reps(i,s,e) for(int i=s;i<e;i++)
#define repse(i,s,e) for(int i=s;i<=e;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define in(x1) cin >> x1
#define in2(x1, x2) cin >> x1 >> x2
#define in3(x1, x2, x3) cin >> x1 >> x2 >> x3
#define inN(x, N) rep(i, N) in(x[i])
#define outl(x) cout << x << endl
#define out2l(x, y) cout << x << " " << y << endl 

//よく使う関数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

    //標準入力をファイルに変更
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    string N;
    in(N);

    ll ans = 0;

    rep(i, N.size())
    {
        ans += N[i] - '0';
        ans %= 9;
    }

    if (ans == 0)
        outl("Yes");
    else
        outl("No");

    return 0;
}

Measured memory_bytes: 3752
l = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]
h, w = map(int, input().split())
for i in range(h):
  s = list(map(str, input().split()))
  if "snuke" in s:
    print(l[s.index("snuke")] + str(i+1))
    break

Measured memory_bytes: 3064
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a=[0]
b=[0]

for i in range(N):
  a.append(a[i] + A[i])

for i in range(M):
  b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)


Measured memory_bytes: 47440
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) (ll)(a.size())
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	string s;
	cin>>s;
	int n = sz(s);
	if(s[n-1]!='s')
		s += "s";
	else
		s += "es";
	cout<<s<<"\n";
	return 0;
}

Measured memory_bytes: 3660
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
typedef long long ll;
#define all(x) (x).begin(), (x).end()  // sortなどの引数を省略
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)

#ifdef LOCAL  //デバッグ出力
#define dout cout
#define debug() if (true)
#else
#define dout \
  if (false) cout
#define debug() if (false)
#endif

using namespace std;
int main() {
  int a,b;
  cin >> a >> b;
  a = max(0,a-2*b);
  cout <<a;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	int A;
	int B;
	int C;
	int X;
	public void run() {
		Scanner sc = new Scanner(System.in);
		A = sc.nextInt();
		B = sc.nextInt();
		C = sc.nextInt();
		X = sc.nextInt();
		int cnt=0;
		for(int i=0; i<=A; i++) {
			for(int j=0; j<=B; j++) {
				for(int k=0; k<=C; k++) {
					if(500*i + 100*j + 50*k == X) cnt++;
				}
			}
		}
		System.out.println(cnt);
		sc.close();
	}
}


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

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

const double PI = acos(-1);
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9+7;

#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
#define REP(i,n) for (int i = 0; i<n; i++)
#define ALL(a) begin(a), end(a)

int main (void) {
    string s;
    cin>>s;
    cout<<s[0]<<s.size()-2<<s[s.size()-1]<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long long n,m,i,c;
int main(){
  cin>>n>>m;
  vector<pair<long long,long long>> x(n);
  for(;i<n;i++)cin>>x[i].first,cin>>x[i].second;
  sort(x.begin(),x.end());
  for(i=0;i<n;i++){
    if(x[i].second>m){c+=x[i].first*m;break;}
    else c+=x[i].second*x[i].first,m-=x[i].second;
  }
  cout<<c<<endl;
}

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int a; cin >> a;
  cout << a + a * a + a * a * a << '\n';
  return 0;
}


Measured memory_bytes: 3620