akhauriyash/Code-Regression huggingface dataset:
import sys
input = sys.stdin.readline
a,b,k = input().split()
a = int(a)
b = int(b)
k = int(k)
i = 0
if a > b:
    c = b
else:
    c = a
while i < k:
    if a % c == 0 and b % c == 0:
        i += 1
    c -= 1
print(c+1)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define MAX_N 100001
#define INF_INT 2147483647
#define INF_LL 9223372036854775807
#define REP(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
int main()
{
  int A,B,C;
  cin >> A >> B >> C;
  cout << max(max(A*10+B+C,B*10+A+C),B+C*10+A) << endl;
  return 0;
}



Measured memory_bytes: 256
import sys
readline = sys.stdin.readline

def main():
    N = readline().rstrip()
    if N[-1] in ['2', '4', '5', '7', '9']:
        print('hon')
    elif N[-1] in ['0', '1', '6', '8']:
        print('pon')
    else:
        print('bon')


if __name__ == '__main__':
    main()

Measured memory_bytes: 9116
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
        if(a==1){a=14;}
        int b = sc.nextInt();
        if(b==1){b=14;}
		String s = "Draw";
        if(a>b){s="Alice";}
        if(a<b){s="Bob";}
		System.out.println(s);
	}
}


Measured memory_bytes: 23764
for i in range ( int ( input ( ) ) ):
    a,b,c = map(int, input().split())
    if a == 0 and b == 0: break
    if a*a+b*b==c*c or b*b+c*c==a*a or c*c+a*a==b*b :
        print('YES')
    else:
        print("NO")


Measured memory_bytes: 5596
#include <stdio.h>

#define MAX_NUM 200000

int main(void){
    int A[MAX_NUM];
    int max_len =0;
    int N;
    int i=0;
    long sum =0;
    scanf("%d",&N);
    //入力 処理
    for(i=0;i<N;i++){
        scanf("%d",&A[i]);
        //最大値更新
        if(max_len > A[i]){
            sum = sum + (max_len - A[i]);
        }
        if(A[i] > max_len)  max_len = A[i];
    }
    printf("%ld",sum);
    return 0;

}

Measured memory_bytes: 2508
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 10000000
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wt = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}

func lowerBound(a []int, key int) int {
	l, r := 0, len(a)-1
	for l <= r {
		mid := (l + r) / 2
		if a[mid] < key {
			l = mid + 1
		} else {
			r = mid - 1
		}
	}
	return l
}

func min(nums ...int) int {
	ret := nums[0]
	for _, v := range nums {
		if v < ret {
			ret = v
		}
	}
	return ret
}

func max(nums ...int) int {
	ret := nums[0]
	for _, v := range nums {
		if v > ret {
			ret = v
		}
	}
	return ret
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, initialBufSize), maxBufSize)
	defer wt.Flush()

	const inf = 1 << 60

	a, b, q := nextInt(), nextInt(), nextInt()
	s, t := make([]int, a+2), make([]int, b+2)
	s[0], s[a+1], t[0], t[b+1] = -inf, inf, -inf, inf
	for i := 1; i <= a; i++ {
		s[i] = nextInt()
	}
	for i := 1; i <= b; i++ {
		t[i] = nextInt()
	}

	for i := 0; i < q; i++ {
		x := nextInt()
		sr, tr := lowerBound(s, x), lowerBound(t, x)
		sl, tl := sr, tr
		if s[sl] != x {
			sl--
		}
		if t[tl] != x {
			tl--
		}
		ans := min(
			max(x-s[sl], x-t[tl]),
			max(s[sr]-x, t[tr]-x),
			max(0, 2*(x-s[sl])+t[tr]-x),
			max(0, 2*(t[tr]-x)+x-s[sl]),
			max(0, 2*(s[sr]-x)+x-t[tl]),
			max(0, 2*(x-t[tl])+s[sr]-x),
		)
		puts(ans)
	}
}


Measured memory_bytes: 6528
#include <stdio.h>
#include <iostream>
#include <queue>
#include <string>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <vector>
#include <map>
#include <ctime>
#include <cmath>
#include <string.h>
#define inf 0x7fffffff
using namespace std;
struct I
{
    int x,y;
};


int a,b,c,k,n,m,i,d,e[4010][4005],o[410200],l[212000],dx[20]={1,-1},dy[20]={0,0,1,-1},dz[20]={1,-1};
long long x,y[200],z[200];
//map <string,int> m;
int j[1060][20];

stack<int> s;
char r1[5500];
//deque<int> d;
struct P
{
    int x,y;
    /*bool operator<(const P &a)const
    {

        return max(x,-x)<=max(a.x,-a.x);
    }*/
};
double u;
//P u[500000];
vector <int> v[211010];
queue<int> q;
string r;

//A==65
//Z==90

//a==97

bool sdf(P a,P b)
{
    return a.x<b.x;
}



int main()
{
    scanf("%lld",&x);
    for(long long t=1;t<=x;t++)
    {
        scanf("%lld",&z[t]);
    }
    long long k=0;
    for(;;)
    {
        int i=0;
        for(long long t=1;t<=x;t++)
        {
            if(z[t]+k-y[t]>=x)
            {
                long long a=(z[t]+k-y[t])%x;//z[t]
                long long b=(z[t]+k-y[t])/x;//k
                k+=b;
                y[t]+=b;
                z[t]=a-k+y[t];


                i=1;
            }
        }

        if(!i) break;
    }
printf("%lld\n",k);
}


Measured memory_bytes: 6400
d = {'R': 1, 'G': 2, 'B': 4}
MOD = 998244353
n = int(input())
s = input()
dp = [0] * 8
ans = 1
for c in s:
    m = d[c]
    p = 0b111 ^ m
    if dp[p]:
        ans = ans * dp[p] % MOD
        dp[p] -= 1
        continue
    for q in (1, 2, 4):
        if m == q:
            continue
        if dp[q]:
            ans = ans * dp[q] % MOD
            dp[q] -= 1
            dp[q + m] += 1
            break
    else:
        dp[m] += 1

for i in range(2, n + 1):
    ans = ans * i % MOD
print(ans)


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

const int nm = 2e5, mod = 1e9 + 7;
int n, a[nm], c[nm + 1];
ll ans = 0;

int main() {
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
		c[i + 1] = (c[i] + a[i]) % mod;
	}

	for (int i = 1; i < n; ++i) {
		ans = ((ll) a[i] * c[i] + ans) % mod;
	}
	cout << ans << endl;
}


Measured memory_bytes: 5184
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>

#define                           int                         long long
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<int,int>
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);




using namespace std;

const int inf=1e18;
const int mod=1e9+7;
const int M=100009;
inline int bigmod(int B,int P){int R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}

int a[M+3];

 main()

{
    fast
    int n;
    cin>>n;
    int ses=0;
    int last=0;
    int sum=0;
    f(i,1,n)
    {
        cin>>a[i];
        if(a[i]==0)
        {
            ses+=(sum/2);
            sum=0;
        }
        else
        {
            sum+=a[i];
        }
    }
    ses+=(sum/2);
    cout<<ses<<endl;
    return 0;

}













Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
int main(){
  vector<int> x={0,1,0,-1},y={1,0,-1,0};
  int H,W;
  cin>>H>>W;
  vector<string> A(H+2,"");
  for(int i=0;i<W+2;i++){
    A[0]+="#";
    A[H+1]+="#";
  }
  for(int i=1;i<=H;i++){
    string S;
    cin>>S;
    A[i]="#"+S+"#";
  }
  int l=0;
  for(int i=1;i<=H;i++)
    for(int j=1;j<=W;j++)
      if(A[i][j]=='.'){
        queue<pair<int,int>> B;
        B.push(make_pair(i,j));
        vector<vector<int>> C(H+2,vector<int>(W+2,-1));
        C[i][j]=0;
        int k=0;
        while(true){
          int xx=B.front().first,yy=B.front().second;
          B.pop();
          for(int i=0;i<4;i++)
            if(A[xx+x[i]][yy+y[i]]=='.' && C[xx+x[i]][yy+y[i]]==-1){
              C[xx+x[i]][yy+y[i]]=C[xx][yy]+1;
              k=max(k,C[xx][yy]+1);
              B.push(make_pair(xx+x[i],yy+y[i]));
            }
          if(B.empty())
            break;
        }
        l=max(k,l);
      }
  cout<<l<<endl;
}

Measured memory_bytes: 3588
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cmath>
#include <functional>
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
using namespace std;
typedef long long ll;
const ll INF = 9223372036854775807-1;
const int inf = 2147483647-1;
ll minl(ll a[],int n){
    ll rtn = a[0];
    REP(i,n){
        if(rtn>a[i])rtn=a[i];
    }
    return rtn;
}
ll maxl(ll a[],int n){
    ll rtn = a[0];
    REP(i,n){
        if(rtn<a[i])rtn=a[i];
    }
    return rtn;
}

int main() {
    string s;
    int w;
    cin >> s >> w;
    string res = "";
    for(int i=0;i<s.size();i+=w){
        res += s[i];
    }
    put(res);
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
  long long n,ans=0;
  cin>>n;
  for(int i=1;i<=n;i++)
  {
    if(!(i%3==0||i%5==0))
    {
      ans+=i;
    }
  }
  cout<<ans;
  return 0;
}

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

char a, b;
int main(){
	scanf(" %c %c", &a, &b);
	if(a > b) printf(">\n");
	else if(a < b) printf("<\n");
	else if(a == b) printf("=\n");
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int lint
typedef long long lint;
typedef pair<int ,int> P;
const int    INF=(int)1e9;
const int    MOD=(int)1e9+7;
const double EPS=(double)1e-10;
struct Accelerate_Cin{
    Accelerate_Cin(){
        cin.tie(0); ios::sync_with_stdio(0);cout<<fixed<<setprecision(20);
    };
};

int N,K;
int D[20];

bool calc(int n){
  while(n>0){
    int temp=n%10;
    for(int t=1;t<=K;t++){
      if(temp==D[t])return false;
    }
    n/=10;
  }
  return true;
}

signed main(){
  cin>>N>>K;
  for(int t=1;t<=K;t++)cin>>D[t];

  for(int t=N;;t++){
    if(calc(t)==true){
      cout<<t<<endl;
      return 0;
    }
  }
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<vector>
#include<tuple>
#include<queue>
#include<set>
#include<algorithm>
#include<string>
#include<math.h>

using namespace std;

int main(int argc, char* argv[]){
  long long int N, K;
  long long int ans = 0;
  scanf("%lld %lld", &N, &K);

  if(N < K){
    long long int a = K - N;
    if(a < N){
      ans = a;
    } else {
    ans = N;
    }
  } else if(N == K){
    ans = 0;
  }
  else {
    long long int a = N % K;
    long long int b = a - K;
    if (b < 0) b *= (-1);
    if(a <= b) {
      ans = a;
    } else {
      ans = b;
    }
  }
  printf("%lld\n", ans);

  return 0;
}


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

int n, k, h, ans;
int32_t main() {
	cin >> n >> k;
	ans = 0;
	for(int i = 0; i < n; ++i) {
		cin >> h;
		if (h >= k) ++ans;
	}
	cout << ans;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
char ch;
long long ara[200004];
int main()
{
    long long n,k,i,ans=0;
    cin>>n>>k;
    for(i=0;i<n;i++) cin>>ara[i];
    sort(ara,ara+n);
    for(i=0;i<k;i++) ans+=ara[i];
    cout<<ans<<endl;
}



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

void solve(double px, double py, double qx, double qy, int n) {
  if (n == 0) return;

  double sx, sy, tx, ty, ux, uy;
  sx = px + (qx-px)/3; sy = py + (qy-py)/3;
  tx = px + 2*((qx-px)/3); ty = py + 2*((qy-py)/3);

  ux = (tx-sx)*cos(M_PI/3) - (ty-sy)*sin(M_PI/3) + sx;
  uy = (tx-sx)*sin(M_PI/3) + (ty-sy)*cos(M_PI/3) + sy;

  solve(px, py, sx, sy, n-1);
  cout << sx << " " << sy << endl;
  solve(sx, sy, ux, uy, n-1);
  cout << ux << " " << uy << endl;
  solve(ux, uy, tx, ty, n-1);
  cout << tx << " " << ty << endl;
  solve(tx, ty, qx, qy, n-1);
}

int main() {
  int n; cin >> n;
  double px, qx; px = 0.0; qx = 100.0;
  double py, qy; py = 0.0; qy = 0.0;
  cout << px << " " << py << endl;
  solve(px, py, qx, qy, n);
  cout << qx << " " << qy << endl;
}



Measured memory_bytes: 3240
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vvin=vector<vin>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vst=vector<string>;
using P = pair<ll,ll>;
const int inf=1e9+7;
const ll INF=9e18;
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b;return true;}return false;}
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b;return true;}return false;}
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };

ll pat[55];
ll siz[55];


ll count(ll a,ll b){//aバーガーの下からb層に含まれるpの数
  if(a==0)return (b>0 ? 1: 0);
  if(siz[a]/2>=b) return count(a-1,b-1);
  else{
    return 1+pat[a-1]+count(a-1,b-2-siz[a-1]);
  }
}

int main(){cout<<fixed<<setprecision(20);
		   //a[n+1]=2a[n]+3
           //a[n]=2^(n+2)-3
           //p[n+1]=2p[n]+1
           //p[n]=2^(n)-1
           ll n,x;
           pat[0]=1;
           siz[0]=1;
           rep(i,1,55){
            pat[i]=2*pat[i-1]+1;
            siz[i]=siz[i-1]*2+3;
           }
             
           cin>>n>>x;
           //if(n==1&&x==1)return 0;
           cout<<count(n,x)<<endl;
           
}

Measured memory_bytes: 3556
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007



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

  vector<long long> A(N);
  long long minus = 0,mini = 1LL<<30,sum = 0;
  for(int i = 0;i < N;i++) {
    cin >> A.at(i);
    if(A.at(i) <= 0) minus++;
    mini = min(mini,abs(A.at(i)));
    sum += abs(A.at(i));
  }


  if(minus % 2 == 0) {
    cout << sum << endl;
  }else {
    cout << sum - 2*mini << endl;
  }

  
}




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

int digit(int n){
  int ans = 0;
  while(n != 0){
    ans += n%10;
    n = n / 10;
  }
  return ans;
}
int main(){
  int n;
  cin >> n;
  if (n % digit(n) == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

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

struct node{
  struct node *r,*l,*p;
  int key;
};

typedef struct node * Node;

Node root, NIL;

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

void insert(int k)
{
  int H;
  Node x,y,z;

  x = root;
  y = NIL;
  z = malloc(sizeof(struct node));

  z->key = k;
  z->l = NIL;
  z->r = NIL;

  while(x != NIL){
    y = x;
    if(z->key < x->key)
      x = x->l;
    else
      x = x->r;
  }

  z->p = y;

  if(y == NIL)
    root = z;
  else{
    if(z->key < y->key)
      y->l = z;
    else
      y->r = z;
  }
}

void inorder(Node u)
{
  if(u == NIL)
    return;

  inorder(u->l);

  printf(" %d",u->key);

  inorder(u->r);
}

void preorder(Node u)
{
  if(u == NIL)
    return;

  printf(" %d",u->key);

  preorder(u->l);

  preorder(u->r);
}

int main()
{
  int n,i,a;
  char C[20];

  scanf("%d",&n);

  for(i=0; i<n; i++){
    scanf("%s",C);

    if(C[0] == 'f'){
      scanf("%d",&a);

      Node t = treeSearch(root, a);

      if(t != NIL)
        printf("yes\n");
      else
        printf("no\n");
    }

    else if(C[0] == 'i'){
      scanf("%d",&a);
      insert(a);
    }

    else if(C[0] == 'p'){

      inorder(root);

      printf("\n");

      preorder(root);

      printf("\n");
    }

  }

  return 0;
}


Measured memory_bytes: 20440
from math import sqrt, ceil
from collections import defaultdict
def prime(N):
    temp = [True]*(N+1)
    temp[0] = temp[1] = False
    for i in range(2, ceil(sqrt(N+1))):
        if temp[i]:
            temp[i+i::i] = [False]*(len(temp[i+i::i]))                            
    primes = [ n for n in range(N+1) if temp[n] ]
    return primes
n = int(input())
dic = defaultdict(lambda:0)
p = prime(n)
for i in range(1,n+1):
    for j in p:
        while i % j == 0:
            i //= j
            dic[j] += 1
        if i == 1:
            break
a = 0 #75
b = 0 #25
c = 0 #15
d = 0 #5
e = 0 #3
for i in dic.keys():
    if dic[i] >= 74:
        a += 1
    if dic[i] >= 24:
        b += 1
    if dic[i] >= 14:
        c += 1
    if dic[i] >= 4:
        d += 1
    if dic[i] >= 2:
        e += 1
ans = 0
ans += a
ans += b*(e-1)
ans += c*(d-1)
ans += d*(d-1)*(e-2)//2
print(ans)

Measured memory_bytes: 38644
const int isDebugMode = 0;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
struct edge{long long to,cost;};
const int inf = 1 << 27;
const long long INF = 1LL << 60;
const int COMBMAX = 1001001;
const long long MOD = 1000000007;
const long long dy[] = {-1, 0, 0, 1};
const long long dx[] = {0, -1, 1, 0};
string abc = "abcdefghijklmnopqrstuvwxyz";
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define eachdo(v, e) for (const auto &e : (v))
#define all(v) (v).begin(), (v).end()
#define lower_index(v, e) (long long)distance((v).begin(), lower_bound((v).begin(), (v).end(), e))
#define upper_index(v, e) (long long)distance((v).begin(), upper_bound((v).begin(), (v).end(), e))
long long mpow(long long a, long long n, long long mod = MOD){long long res = 1; while(n > 0){if(n & 1)res = res * a % mod; a = a * a % mod; n >>= 1;} return res;}
void pt(){cout << endl; return;}
template<class Head> void pt(Head&& head){cout << head; pt(); return;}
template<class Head, class... Tail> void pt(Head&& head, Tail&&... tail){cout << head << " "; pt(forward<Tail>(tail)...);}
void dpt(){if(!isDebugMode) return; cout << endl; return;}
template<class Head> void dpt(Head&& head){if(!isDebugMode) return; cout << head; pt(); return;}
template<class Head, class... Tail> void dpt(Head&& head, Tail&&... tail){if(!isDebugMode) return; cout << head << " "; pt(forward<Tail>(tail)...);}
template<class T> void debug(T v){if(!isDebugMode) return; rep(i, v.size()) cout << v[i] << " " ; cout << endl;}
template<class T> void debug2(T v){if(!isDebugMode) return; rep(i, v.size()){rep(j, v[i].size()) cout << v[i][j] << " " ; cout << endl;}}
template<class T1, class T2> inline bool chmin(T1 &a, T2 b){if(a > b){a = b; return true;} return false;}
template<class T1, class T2> inline bool chmax(T1 &a, T2 b){if(a < b){a = b; return true;} return false;}
template<class T1, class T2> long long gcd(T1 a, T2 b){return a % b ? gcd(b , a % b) : b;}
template<class T1, class T2> void reduce(T1 &a, T2 &b){ll g = gcd(a, b); a /= g; b /= g; return;}
bool valid(long long H, long long W, long long h, long long w) { return 0 <= h && h < H && 0 <= w && w < W; }

int main(){
    ll N; cin >> N;
    vector<ll> a(N), b(N), d(N);
    rep(i, N){
        cin >> a[i];
    }
    rep(i, N){
        cin >> b[i];
    }
    rep(i, N) d[i] = a[i] - b[i];
    dpt(accumulate(all(d), 0LL));
    if(accumulate(all(d), 0LL) < 0){
        pt(-1);
        return 0;
    }
    sort(all(d));
    auto itr = find_if(all(d), [](ll e){return e >= 0;});
    ll neg = accumulate(d.begin(), itr, 0LL) * (-1);
    reverse(itr, d.end());
    itr = find_if(all(d), [](ll e){return e >= 0;});
    debug(d);
    for(ll i = 0; ; i++){
        if(neg <= 0){
            pt((ll)distance(d.begin(), itr) + i);
            return 0; 
        }
        neg -= *(itr + i);
        if(itr + i == d.end()){
            pt((ll)distance(d.begin(), itr) + i + 1);
            return 0;
        }
    }
    // dpt(neg);
    return 0;
}

Measured memory_bytes: 3328
//Don't give up too easy bhai
#pragma GCC optimize("O3")
 
#include<bits/stdc++.h>
using namespace std;
 
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
 
#define forall(i,a,n) for(ll i=a;i<n;i++)
#define pb push_back
#define fs first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define all(v) v.begin(),v.end()
#define minv(a) *min_element(all(a))
#define maxv(a) *max_element(all(a))
#define vll vector<ll>
#define vld vector<ld>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define mod 1000000007
#define br cout<<"\n"
#define whatis(x) cerr << ">"<<#x << " ==> " << x << endl;
#define inputv(a) forall(i,0,a.size()) cin>>a[i]
#define outputv(a) for(auto i:a) cout<<i<<" ";br;
#define T ll __t;cin>>__t;while(__t--)
#define int long long int
ll here = 1e15 + 1;

vll fil;

int power(int x, unsigned int y)
{  
    int res = 1;     // Initialize result  
  
    x = x;// Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x);  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x);
    }  
    return res;  
}  


string alpha = "abcdefghijklmnopqrstuvwxyz";
signed main()
{
	fast;
	
	ll n;cin>>n;
	string ans = "";

	while(n)
	{
		ll x = ((n%26 -1) + 26)%26;
		ans = ans + alpha[x];
		n-=x;
		n = n/26;
	}

	string b(ans.rbegin(),ans.rend());
	cout<<b; 

	return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

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> vector<T> make_vec(size_t a) { return vector<T>(a); }
template<class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template<class T, class V>
typename enable_if<is_class<T>::value == 0>::type fill(T &t, const V &v) {
    t = v;
}
template<class T, class V>
typename enable_if<is_class<T>::value != 0>::type fill(T &t, const V &v){
    for (auto &e : t) fill(e, v);
}

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }

#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }




int N;
string S, T;

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

    while (cin >> N >> S >> T) {
        for (int i = 0; i < N; ++i) cout << S[i] << T[i];
        cout << endl;
    }
}


















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


int main(){
    int a,b;
    cin >> a >> b;
    int ans;
    
    ans = a*b;
    
    if(a<10 && b<10){
        cout << ans << endl;
    }else{
        cout << -1 << 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 = 1; i <= (n); ++i)
#define ll long long
#define pp pair<int,int> 
#define v(T) vector<T>
#define all(x) (x).begin(), (x).end()
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
const int INF = 1001001001;
//int 2×10の9乗
//vector<vector<int>> a(n, vector<int>(m));
  //rep(i,n) rep(j,m) cin >> a[i][j]; 
//cout << fixed << setprecision(10);
//int gcd(int x, int y){
  //if(y==0) return x;
  //return gcd(y, x%y);
//}
//sort小さい順(昇順)
 
int main() {
  string s;
  cin>>s;
  rep(i,s.size()){
    if(i%2==0 && s[i]=='L'){
      No;
      return 0;
    }
    if(i%2!=0 && s[i]=='R'){
      No;
      return 0;
    }
  }
  Yes;
}  

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<stack>
#include<bitset>
#include<ext/pb_ds/priority_queue.hpp>
using namespace std;

#define fr first
#define sc second
#define mp(a,b) (make_pair((a),(b)))

const int maxn = 1E5 + 10;
typedef pair <int,int> pr;

int n,cnt,du[maxn];
bool vis[maxn];

queue <pr> Q;
map <pr,int> E;

vector <int> v[maxn];

inline void Add(int x,int y)
{
	if (x > y) swap(x,y);
	pr now = mp(x,y); ++E[now];
	if (E[now] > 1) Q.push(now);
	++du[x]; v[x].push_back(y);
	++du[y]; v[y].push_back(x);
}

int main()
{
	#ifdef DMC
		freopen("DMC.txt","r",stdin);
	#endif
	
	cin >> n;
	for (int i = 1; i < n; i++)
	{
		int x,y; scanf("%d%d",&x,&y);
		if (x > y) swap(x,y); ++du[x]; ++du[y];
		++E[mp(x,y)]; v[x].push_back(y); v[y].push_back(x);
	}
	for (int i = 1; i < n; i++)
	{
		int x,y; scanf("%d%d",&x,&y);
		if (x > y) swap(x,y); ++du[x]; ++du[y];
		++E[mp(x,y)]; v[x].push_back(y); v[y].push_back(x);
	}
	for (int i = 1; i <= n; i++)
		for (int j = 0; j < v[i].size(); j++)
		{
			pr now = mp(i,v[i][j]);
			if (E[now] > 1) Q.push(now);
		}
	while (!Q.empty())
	{
		pr k = Q.front(); Q.pop();
		if (vis[k.fr] || vis[k.sc]) continue;
		int x = k.fr,y = k.sc; ++cnt;
		if (du[x] < du[y]) swap(x,y); vis[y] = 1;
		for (int i = 0; i < v[y].size(); i++)
			if (v[y][i] != x && !vis[v[y][i]]) Add(x,v[y][i]);
	}
	puts(cnt == n - 1 ? "YES" : "NO");
	return 0;
}

Measured memory_bytes: 41332
#include<iostream>
#include<queue>
#include<vector>
#define f first
#define s second
using namespace std;
vector<int>v[500005];
int visit[500005];
queue<int>q;
int n,a,b;
int main(){
	cin>>n;
	int m=n-1;
	while(m--){
		cin>>a>>b;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	q.push(1);
	q.push(1);
	q.push(n);
	q.push(2);
	while(!q.empty())
	{
		pair<int,int> now;
		now.f=q.front();q.pop();
		now.s=q.front();q.pop();
		if(visit[now.f])continue;
		visit[now.f]=now.s;
		for(int i=0;i<v[now.f].size();i++)
		{
			if(!visit[v[now.f][i]])
			{
				q.push(v[now.f][i]);
				q.push(now.s);
			}
		}
	}
	int black=0,white=0;
	for(int i=1;i<=n;i++){
		if(visit[i]==1)black++;
		else white++;
	}
	if(black>white)cout<<"Fennec\n";
	else cout<<"Snuke\n";
	return 0;
}

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

using namespace std;

int main(){
	string str,str1; cin >> str >> str1;
	for(int i = 0 ; i < str.size(); i++){
		if(str[i] != str1[str.size() -1 -i]){
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}



Measured memory_bytes: 256
import java.util.*;

public class Main {

	static class Unionfind {
		// 基本的にマイナスのサイズを持つ
		// 根でなければ非負のおやのIDを持つ
		private int d[];

		public Unionfind(int n) {
			d = new int[n + 1];
			// 初めは全員根でサイズは１なので-1で初期化
			for (int i = 0; i <= n; ++i)
				d[i] = -1;
		}

		public int root(int x) {
			if (d[x] < 0)
				return x;
			return d[x] = root(d[x]);
		}

		public boolean unite(final int x, final int y) {
			int rx = root(x);
			int ry = root(y);
			if (rx == ry)
				return false;
			// もしrxのグループのほうがサイズが小さければrxの親をryとしなければいけないので入れ替える。
			if (d[rx] > d[ry]) {
				int tmp = rx;
				rx = ry;
				ry = tmp;
			}
			// ryの親をrxにするのでIDrxのグループのサイズがd[ry]だけ増える
			d[rx] += d[ry];
			d[ry] = rx;
			return true;
		}

		public boolean isSame(int x, int y) {
			int rx = root(x);
			int ry = root(y);
			return rx == ry;
		}

		public int size(int x) {
			int rx = root(x);
			return -d[rx];
		}
	}

	static Unionfind uniontree;

	public static class Graph {
		List<Integer> friend = new ArrayList<Integer>();
		List<Integer> block = new ArrayList<Integer>();
		int number;

		public Graph(int num) {
			number = num;
		}

		public void addfriend(int b) {
			friend.add(b);
		}

		public void addblock(int b) {
			if (uniontree.isSame(number, b))
				block.add(b);
		}
	}

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), m = sc.nextInt(), k = sc.nextInt();
		Graph graph[] = new Graph[n + 1];
		uniontree = new Unionfind(n);
		for (int i = 0; i <= n; ++i)
			graph[i] = new Graph(i);
		for (int i = 0; i < m; ++i) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			graph[a].addfriend(b);
			graph[b].addfriend(a);
			uniontree.unite(a, b);
		}
		for (int i = 0; i < k; ++i) {
			int c = sc.nextInt();
			int d = sc.nextInt();
			graph[c].addblock(d);
			graph[d].addblock(c);
		}
		sc.close();
		for (int i = 1; i <= n; ++i) {
			int num = uniontree.size(i) - (graph[i].friend.size() + graph[i].block.size()) - 1;
			// int num = uniontree.size(i);
			System.out.print(num + " ");
		}
	}
}


Measured memory_bytes: 153468
<?php
  
fscanf(STDIN, "%d %d %d %d", $T_HP, $T_ATK, $A_HP, $A_ATK);

for(;;){
  
  $A_HP = $A_HP - $T_ATK;
  if($A_HP <= 0) {
    echo "Yes\n";
    break;
  }
  
  $T_HP = $T_HP - $A_ATK; 
  if($T_HP <= 0) {
    echo "No\n";
    break;
  }
}

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

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> p(N);
  for (int i = 0; i < N; i++) {
    cin >> p.at(i);
  }
  vector<int> s(N - K + 1);
  for (int i = 0; i < K; i++) {
    s.at(0) += p.at(i);
  }
  for (int i = 1; i < N - K + 1; i++) {
    s.at(i) = s.at(i - 1) - p.at(i - 1) + p.at(i + K - 1);
  }
  int M = 0;
  for (int i = 0; i < N - K + 1; i++) {
    if (s.at(i) > M) {
      M = s.at(i);
    }
  }
  double ans;
  ans = (M + K) * 0.5;
  cout << std::fixed << std::setprecision(15) << ans << endl;
}


Measured memory_bytes: 1792
#include <iostream>
#include <stdio.h>
#include <algorithm>
 
using namespace std;
 
int main(void) {
    int n;
    long long x;
    cin >> n >> x;
    unsigned long a[n];
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    sort(a, a + (sizeof(a)/sizeof(a[0])));
    int i;
    for(i = 0; i < n - 1; i++){
        if(x >= a[i]){
            x = x - a[i];
        }else{
            break;
        }
    }
    if(i == n - 1){
        if(x == a[n - 1]){
            i++;
        }
    }
    cout << i << endl;
    return 0;
}

Measured memory_bytes: 256
(let* ((k (read))
       (n (read))
       (as (coerce (loop repeat n collect (read)) 'vector))
       (max-distance 0)
       (total-distance (loop for i from 0 below n
                             for d = (mod (+ k (- (aref as (mod (+ i 1) n)) (aref as i))) k)
                             when (> d max-distance) do (setf max-distance d)
                             summing d)))
  (format t "~a~%" (- total-distance max-distance)))


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

void ioThings() {
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("err.txt", "w", stderr);
#endif
}

using   ll        = long long;
#define debug(x)    cerr << #x << ": <" << x << ">\n"
#define dotc()      int tcs; if (cin >> tcs) for (int tc = 0; tc < tcs; tc++)
#define sz(x)       (int)x.size()
#define eb          emplace_back
#define pb          push_back
#define all(x)      x.begin(), x.end()
#define rall(x)     x.rbegin(), x.rend()
#define fi          first
#define se          second
#define mod         1000000007

int main() {
    ioThings();

    string a, b; cin >> a >> b;
    int ca, cb; cin >> ca >> cb;
    string u; cin >> u;
    if (u == a)
        ca--;
    else
        cb--;
    cout << ca << ' ' << cb;

    return 0;
}


Measured memory_bytes: 256
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 1
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}

	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	k := getNextInt64(scanner)
	dbl := makeInts(64, n)
	for i := 0; i < n; i++ {
		dbl[0][i] = getNextInt(scanner) - 1
	}

	for i := 1; i < 64; i++ {
		for j := 0; j < n; j++ {
			dbl[i][j] = dbl[i-1][dbl[i-1][j]]
		}
	}
	ans := 0
	for i := 62; i >= 0; i-- {
		if k>>uint(i)%2 == 0 {
			continue
		}
		ans = dbl[i][ans]
	}
	fmt.Fprintln(writer, ans+1)
}

func makeInts(h, w int) [][]int {
	index := make([][]int, h, h)
	data := make([]int, h*w, h*w)
	for i := 0; i < h; i++ {
		index[i] = data[i*w : (i+1)*w]
	}
	return index
}


Measured memory_bytes: 107468
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int r,D,x,A;
  cin >> r >> D >> x;
  A = r*x-D;
  cout << A << endl;
    for ( int i = 1; i <= 9; i++ ){
    A = (A*r) - D;
    cout << A << endl;
  }
}

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

int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    mp[x] += 1;
  }
  vector<int> ans;
  for (auto p : mp) {
    if (p.second >= 4) {
      ans.push_back(p.first);
      ans.push_back(p.first);
    } else if (p.second >= 2) {
      ans.push_back(p.first);
    }
  }
  sort(ans.begin(), ans.end(), greater<int>());
  if (ans.size() < 2) {
    cout << 0 << endl;
  } else {
    cout << 1LL * ans[0] * ans[1] << endl;
  }
  return 0;
}


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

bool isinclde(string S, char c);

int main(){
    string S;
    cin >> S;

    string alphabets = "abcdefghijklmnopqrstuvwxyz";

    sort(S.begin(), S.end());

    int i=0;
    while(i<alphabets.size()){
        char target = alphabets[i];
        bool is_include = isinclde(S, target);
        if(is_include == false){
            cout << target <<endl;
            return 0;
        }
        i += 1;
    }

    cout << "None" << endl;
    return 0;

}

bool isinclde(string S, char c){
    for(int j=0; j<S.size(); j++){
        if(c == S[j]){
            return true;
        }
    }
    return false;
}

Measured memory_bytes: 3736
def comb(n,r)
	k=1
	r.times{|i|
		k=k*(n-i)/(i+1)
	}
	k
end
require 'prime'
N,M=gets.split.map &:to_i
r=1
M.prime_division.each{|n,k|
	r=r*comb(N+k-1,k)%(10**9+7)
}
p r

Measured memory_bytes: 2044
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
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);
	int n;
	string s, t;
	cin >> n >> s >> t;
	rep(i,n) cout << s[i] << t[i];
	cout << endl;
	return 0;
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

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

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<pair<T, T>>& vp) {
	for (int i = 0; i < vp.size(); ++i) {
		s << "(" << vp[i].first << "," << vp[i].second << ")" << ( i+1 == vp.size() ? "" : ",\t" );
	}
	return s;
}

// 多重vector
// auto dp=make_v<int>(4,h,w) みたいに使える
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

// 多重vectorのためのfill
// fill_v(dp,0) みたいに使える
template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

//main code

int main(int argc, char const* argv[])
{
	int n;
	string s;
	cin >> n >> s;
	string ss;
	if (n%2 == 1) {
		cout << "No" << endl;
		return 0;
	}
	for (int i = 0; i < n/2; i++) {
		ss.push_back(s[i]);
	}
	for (int i = n/2; i < n; i++) {
		if (ss[i-n/2] != s[i]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}


Measured memory_bytes: 256
using System;

class Program {
    static void Main(string[] args)
    {
        String line1 = Console.ReadLine();
        String line2 = Console.ReadLine();
        int num1 = int.Parse(line1);

        int startIdx = int.Parse(line1);
        startIdx = startIdx / 2;
        String str1 = line2.Substring(0, startIdx);
        String str2 = line2.Substring(startIdx);

        if (str1 == str2)
        {
            Console.WriteLine("Yes");
        } else
        {
            Console.WriteLine("No");
        }
    }
}

Measured memory_bytes: 11092
def solve(s):
    if s[2] == s[3] and s[4] == s[5]:
        return "Yes"
    else:
        return "No"


def main():
    s = input()
    res = solve(s)
    print(res)


def test():
    assert solve("sippuu") == "Yes"
    assert solve("iphone") == "No"
    assert solve("coffee") == "Yes"


if __name__ == "__main__":
    test()
    main()


Measured memory_bytes: 2940
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}



int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll N ; cin >> N ;
  vector<ll> A;  
  rep(i,N){
    ll  inp; cin >> inp;
    A.pb(inp);
  }

  ll cnt = 0 ;
  while(1){
    rep(i,N){
      if(A[i] % 2 != 0) {
	cout << cnt << endl;
	return 0;
      }
      A[i]/= 2;
    }
    cnt ++;
  }
  
  
  //cout << fixed << setprecision(16) << ans << endl;
  return 0;
}


Measured memory_bytes: 256
function main(arg) {
  const lines = arg.trim().split('\n');
  const N = parseInt(lines[0]);
  const V = lines[1].split(' ').map((x) => parseInt(x));
  const C = lines[2].split(' ').map((x) => parseInt(x));
  let ans = 0;
  for (let i = 0; i < 2 ** N; i++) {
    let res = 0;
    for (let j = 0; j < N; j++) {
      if ((i >> j) & (1 === 1)) {
        res += V[j] - C[j];
      }
    }
    if (res > ans) {
      ans = res;
    }
  }
  console.log(ans);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 32252
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a;
	cin>>a;
	for(long long i=sqrt(a);i>=1;i--)
	{
		if(a%i==0)
		{
			long long b=a/i;
			cout<<b+i-2<<endl;
			return 0;
		}
	}
	return 0;
 } 

Measured memory_bytes: 256
import java.util.*;

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 = a + b;
            if(c % 2 == 0){
              System.out.println(c / 2);
            } else {
              System.out.println("IMPOSSIBLE");
            }
          }
}

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

int main(){
    int N;
    cin >> N;
    ll tempA[N+2];
    rep1(i, N) cin >> tempA[i];
    tempA[0] = 300;
    tempA[N+1] = 0;

    ll B[N+1];
    ll m = 1000;
    ll st = 0;

    ll A[N+2];
    int j = 0;
    for(int i = 0; i <= N+1; i++){
        if (tempA[i] != tempA[i+1]){
            A[j] = tempA[i];
            j++;
        }
    }

    rep1(i, j-2){
        if ( (A[i+1] > A[i]) && (A[i] < A[i-1]) ){
            B[i] = -1;
        }else if ( (A[i+1] < A[i]) && (A[i] > A[i-1]) ){
            B[i] = 1;
        }else{
            B[i] = 0;
        }
        // if ( (A[i+1] == A[i]) && (A[i] == A[i-1]) ){
        //     B[i] = 0;
        // }
    }

    rep1(i, j-2){
        if (B[i] == -1){
           st += m / A[i];
           m -= A[i] * st;
        }else if(B[i] == 1){
           m += A[i] * st;
           st = 0;
        }
        // cout << "day : " << i << ", action : " << B[i] << ", money : " << m << ", stock : " << st << endl;
    }

    cout << m << endl;

    return 0;
}

Measured memory_bytes: 3592
#[allow(unused_macros)]
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( stdin . lock ( ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , mut $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let mut $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }

fn main() {
    input! {
        n: usize, m: usize,
        ab: [(usize1, usize1); m]
    }

    let mut g = vec![vec![];n];
    for i in 0..ab.len() {
        let (a, b) = ab[i];
        g[a].push((1,b));
        g[b].push((1,a));
    }

    let ret = dijkstra(&g, 0);
    println!("{}", if ret[n-1] == 2 {"POSSIBLE"} else {"IMPOSSIBLE"});
}

#[doc = " s: start vertex, O(|E|log|V|)"]
pub fn dijkstra(graph: &[Vec<(u64, usize)>], s: usize) -> Vec<u64> {
    let n = graph.len();
    let mut d = vec![1u64 << 60; n];
    d[s] = 0;
    let mut heap = std::collections::BinaryHeap::new();
    heap.push(Rev((0, s)));
    while let Some(Rev((p_cost, p))) = heap.pop() {
        if d[p] < p_cost {
            continue;
        }
        for &(v_cost, v) in &graph[p] {
            if d[v] > d[p] + v_cost {
                d[v] = d[p] + v_cost;
                heap.push(Rev((d[v], v)));
            }
        }
    }
    d
}

#[derive(Eq, PartialEq, Clone, Debug)]
pub struct Rev<T>(pub T);
impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<std::cmp::Ordering> {
        other.0.partial_cmp(&self.0)
    }
}
impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> std::cmp::Ordering {
        other.0.cmp(&self.0)
    }
}

Measured memory_bytes: 35068
#include <iostream>
#include <math.h>
using namespace std;
int main(){
  int n,p;
  long long int e=0,o=0,ans;
  cin>> n >> p;
  int a;
  for(int i=0;i<n;i++) {
    cin >> a;
    if(a%2==0) e++;
    else o++;
  }
  if(o==0) {
    if(p==0) {
      ans=1;
      for(int i=0;i<n;i++) ans*=2;
      cout << ans<<endl;
    }
    else cout << 0<<endl;
  }
  else{
    ans=1;
    for(int i=0;i<n-1;i++) ans*=2;
    cout << ans<<endl;
  }
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), k = sc.nextInt();
		if(n % k == 0) {
			System.out.println(0);
		} else {
			System.out.println(1);
		}
	}
}


Measured memory_bytes: 21972