akhauriyash/Code-Regression huggingface dataset:
// import chie template :) {{{
import std.stdio, std.algorithm, std.array, std.string, std.math, std.conv,
  std.range, std.container, std.bigint, std.ascii, std.typecons, std.format, std.bitmanip, std.numeric;

// }}}
// nep.scanner {{{
class Scanner {
  import std.stdio : File, stdin;
  import std.conv : to;
  import std.array : split;
  import std.string;
  import std.traits : isSomeString;

  private File file;
  private char[][] str;
  private size_t idx;

  this(File file = stdin) {
    this.file = file;
    this.idx = 0;
  }

  this(StrType)(StrType s, File file = stdin) if (isSomeString!(StrType)) {
    this.file = file;
    this.idx = 0;
    fromString(s);
  }

  private char[] next() {
    if (idx < str.length) {
      return str[idx++];
    }

    char[] s;
    while (s.length == 0) {
      s = file.readln.strip.to!(char[]);
    }

    str = s.split;
    idx = 0;

    return str[idx++];
  }

  T next(T)() {
    return next.to!(T);
  }

  T[] nextArray(T)(size_t len) {
    T[] ret = new T[len];

    foreach (ref c; ret) {
      c = next!(T);
    }

    return ret;
  }

  void scan()() {
  }

  void scan(T, S...)(ref T x, ref S args) {
    x = next!(T);
    scan(args);
  }

  void fromString(StrType)(StrType s) if (isSomeString!(StrType)) {
    str ~= s.to!(char[]).strip.split;
  }
}
// }}}

void main() {
  auto cin = new Scanner;
  long k;
  cin.scan(k);

  long res;
  foreach (i; 1 .. k + 1) {
    foreach (j; 1 .. k + 1) {
      foreach (l; 1 .. k + 1) {
        res += gcd(gcd(i, j), l);
      }
    }
  }
  writeln(res);
}


Measured memory_bytes: 3224
import std.stdio, std.conv, std.array, std.string, std.algorithm, std.container, std.range, core.stdc.stdlib, std.math, std.typecons;
T[][] combinations(T)(T[] s, in int m) {   if (!m) return [[]];   if (s.empty) return [];   return s[1 .. $].combinations(m - 1).map!(x => s[0] ~ x).array ~ s[1 .. $].combinations(m); }

void main() {
  auto N = readln.chomp.to!(long);
  auto X = readln.split.to!(long[]).sort();

  ulong solve() {
    ulong candidate = ulong.max;
    foreach(p; X[0]..X[$-1]+1) {
      auto sum = X.map!(x => p - x).map!(x => x*x).reduce!((a, b) => a + b);
      if (candidate > sum) candidate = sum;
    }

    return candidate;
  }

  solve().writeln;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
using pqueg = priority_queue<int, vector<int>, greater<int>>;
using pquel = priority_queue<int, vector<int>, less<int>>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
int lcm(int a, int b){
  return a / __gcd(a, b) * b;
}
int r_int(int a, int b){
  return rand() % b + a;
}
const lint mod=1e9+7;



int main()
{
  set<int> num;
  REP(i,3){
    int tmp;
    cin >> tmp;
    num.insert(tmp);
  }


  cout << (num.size() == 2 ? "Yes" : "No") << "\n";
  return 0;
}


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

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

Measured memory_bytes: 256
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<bitset>
#include<math.h>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int N=100000;
const ll lim=3234566667ll;
const db pi=acos(-1.0);
#define lowbit(x) (x)&(-x)
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define go(u,i) for (register int i=head[u];i;i=sq[i].nxt)
#define fir first
#define sec second
#define mp make_pair
#define pb push_back
#define maxd 998244353
#define eps 1e-8
inline int read()
{
    int x=0,f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

namespace My_Math{
	#define N 100000

	int fac[N+100],invfac[N+100];

	int add(int x,int y) {return x+y>=maxd?x+y-maxd:x+y;}
	int dec(int x,int y) {return x<y?x-y+maxd:x-y;}
	int mul(int x,int y) {return 1ll*x*y%maxd;}
	ll qpow(ll x,int y)
	{
		ll ans=1;
		while (y)
		{
			if (y&1) ans=mul(ans,x);
			x=mul(x,x);y>>=1;
		}
		return ans;
	}
	int Inv(int x) {return qpow(x,maxd-2);}

	int C(int n,int m)
	{
		if ((n<m) || (n<0) || (m<0)) return 0;
		return mul(mul(fac[n],invfac[m]),invfac[n-m]);
	}

	void math_init()
	{
		fac[0]=invfac[0]=1;
		rep(i,1,N) fac[i]=mul(fac[i-1],i);
		invfac[N]=Inv(fac[N]);
		per(i,N-1,1) invfac[i]=mul(invfac[i+1],i+1);
	}
	#undef N
}
using namespace My_Math;

ll a[N<<1];
int x[20],tot=0;

void dfs(int dep,int lst,int goal)
{
	x[dep]=lst;
	if (dep==goal)
	{
		ll ans=0;
		rep(i,1,dep) ans=ans*10+x[i];
		if ((ans) && (ans<=lim)) a[++tot]=ans;
		return;
	}
	dfs(dep+1,lst,goal);
	if (lst!=9) dfs(dep+1,lst+1,goal);
	if (lst!=0) dfs(dep+1,lst-1,goal);
}

int main()
{
	rep(len,1,10)
	{
		int up;
		if (len==10) up=3;else up=9;
		rep(i,1,9) 
		{
			//cout << i << " " << len << endl;
			dfs(1,i,len);
		} 
	}
	sort(a+1,a+1+N);
	int n=read();
	cout << a[n];
	return 0;
}





Measured memory_bytes: 1024
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        new Thread(null, new MyRunnable(), "", 1 << 26).start();
    }
}


class MyRunnable implements Runnable {
    @Override
    public void run() {
        int n;
        int k;
        List<Integer> as = new ArrayList<>();
        try (Scanner sc = new Scanner(System.in)) {
            n = sc.nextInt();
            k = sc.nextInt();
            for (int i = 0; i < n; i++) {
                as.add(sc.nextInt() - 1);
            }
        }
        System.out.println(new Calculator(n, k, as).calculate());
    }
}

class Calculator {
    private int k;
    private int answer = 0;
    private boolean isCalculate = false;
    private List<List<Integer>> lists = new ArrayList<>();

    Calculator(int n, int k, List<Integer> as) {
        this.k = k;
        for (int i = 0; i < n; i++) {
            this.lists.add(new ArrayList<>());
        }
        for (int i = 0; i < n; i++) {
            int j = as.get(i);
            if (0 < i) {
                this.lists.get(j).add(i);
            } else if (0 < j) {
                this.answer++;
            }
        }
    }

    int calculate() {
        if (!this.isCalculate) {
            this.dfs(0, 0);
            this.isCalculate = true;
        }
        return this.answer;
    }

    private int dfs(int a, int pre) {
        int h = 0;
        for (int i : this.lists.get(a)) {
            h = Math.max(h, this.dfs(i, a));
        }
        if (0 < pre && h == this.k - 1) {
            h = 0;
            this.answer++;
        } else {
            h++;
        }
        return h;
    }
}

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

int main(){
    long long n, k;
    cin >> n >> k;

    long long count = 0;
    for(long long b = k + 1; b <= n; b++){
        long long pivot = b - k;
        count += (n/b)*pivot;
        if(k >= 1 and n%b != 0 and n%b >= k){
            count += n%b - k + 1;
        }
        if(k == 0 and n%b != 0 and n%b >= k){
            count += n%b - k;
        }
        //printf("b %lld count %lld\n", b, count);
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3628
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T, class U>bool chmax(T& a, U&& b) { return a < b ? a = b, 1 : 0; }
template<class T, class U>bool chmin(T& a, U&& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int main() {
    int N;
    cin >> N;
    vector<string> A(N);
    rep(i, N) cin >> A[i];

    bool aw = true;
    rep(i, N) {
        if (A[i] != string(N, '.')) aw = false;
    }
    if (aw) {
        write(-1);
        return 0;
    }

    int bc = 0;
    rep(j, N) {
        bool ng = false;
        rep(i, N) ng |= A[i][j] == '.';
        bc += !ng;
    }

    rep(i, N) {
        if (A[i] == string(N, '#')) {
            write(N - bc);
            return 0;
        }
    }

    int ans = INF;
    rep(i, N) {
        int k = 0;
        for (; k < N; ++k) {
            if (A[k][i] == '#') break;
        }

        int pc = k == N;
        rep(j, N) {
            pc += A[i][j] == '.';
        }
        ans = min(ans, pc + N - bc);
    }

    write(ans);
}

Measured memory_bytes: 512
#include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
using namespace std;
using ll = long long;
//typedef pair<string,string> P;
//double dat[100][100];
//int dp[6][1010];//動的計画法
//int prime[10000001];
//char str[1010][1010];
//vector<pair<int,int> > pc[100001];
//int ABS(int a){return max(a,-a);}
//long long num[100000];
ll gcd(ll a,ll b){
  if(b==0) return a;
  return gcd(b,a%b);
}
ll lcm(ll a,ll b){
  ll g=gcd(a,b);
  return a/g*b;
}
int main(){
	ll n,m;
	string s,t;
	cin>>n>>m;
	cin>>s;
	cin>>t;
	ll lm,lg,tn=0,tm=0;
	lg=lcm(n,m);
	lm=gcd(n,m);
	ll p,q;
	p=lg/n;
	q=lg/m;
	if(lm==1) {
		if(s[0]!=t[0])cout<<-1<<endl;
		else cout<<lg<<endl;
		return 0;
	}
	if(n==m){
		for(int i=0;i<n;i++){
			if(s[i]!=t[i]){
				cout<<-1<<endl;
				return 0;
			}
		}
	}else{
		ll g=lcm(p,q);
		ll k=0,j=0,o=0;
		while(o<=lg){
			if(s[k]!=t[j]){
				cout<<-1<<endl;
				return 0;
			}
			k+=(g/p);
			j+=(g/q);
			o+=g;
		}
	}
	cout<<lg<<endl;
	return 0;
}

Measured memory_bytes: 512
def main():
    sx, sy, tx, ty = map(int, input().split())
    vert = ty - sy
    hor = tx - sx
    ans = 'U'*vert + 'R'*hor + 'D'*vert + 'L'*hor
    ans += 'L' + 'U'*(vert+1) + 'R'*(hor+1) + 'D'
    ans += 'R' + 'D'*(vert+1) + 'L'*(hor+1) + 'U'
    print(ans)
main()

Measured memory_bytes: 3060
# https://atcoder.jp/contests/abc127/tasks/abc127_e
# 自分の計算画像を参考に
# ポイントは二点
# 1. 通りを決定してからpairwiseの和→pairを先に決定してから条件を満たす通りを加算 というΣの入れ替え
# 2. 二点の全通りの差を加算は無理→二点の差は何回現れるか を加算


class ModInt:
    def __init__(self, x, MOD=10 ** 9 + 7):
        '''
        pypyじゃないと地獄みたいな遅さなので注意
        '''
        self.mod = MOD
        self.x = x % MOD

    def __str__(self):
        return str(self.x)

    __repr__ = __str__

    def __add__(self, other):
        if isinstance(other, ModInt):
            return ModInt(self.x + other.x, self.mod)
        else:
            return ModInt(self.x + other, self.mod)

    def __sub__(self, other):
        if isinstance(other, ModInt):
            return ModInt(self.x - other.x, self.mod)
        else:
            return ModInt(self.x - other, self.mod)

    def __mul__(self, other):
        if isinstance(other, ModInt):
            return ModInt(self.x * other.x, self.mod)
        else:
            return ModInt(self.x * other, self.mod)

    def __truediv__(self, other):
        if isinstance(other, ModInt):
            return ModInt(self.x * pow(other.x, self.mod - 2, self.mod), self.mod)
        else:
            return ModInt(self.x * pow(other, self.mod - 2, self.mod), self.mod)

    def __pow__(self, other):
        if isinstance(other, ModInt):
            return ModInt(pow(self.x, other.x, self.mod), self.mod)
        else:
            return ModInt(pow(self.x, other, self.mod), self.mod)

    __radd__ = __add__

    def __rsub__(self, other):  # 演算の順序が逆
        if isinstance(other, ModInt):
            return ModInt(other.x - self.x, self.mod)
        else:
            return ModInt(other - self.x, self.mod)

    __rmul__ = __mul__

    def __rtruediv__(self, other):
        if isinstance(other, ModInt):
            return ModInt(other.x * pow(self.x, self.mod - 2, self.mod), self.mod)
        else:
            return ModInt(other * pow(self.x, self.mod - 2, self.mod), self.mod)

    def __rpow__(self, other):
        if isinstance(other, ModInt):
            return ModInt(pow(other.x, self.x, self.mod), self.mod)
        else:
            return ModInt(pow(other, self.x, self.mod), self.mod)


def combination(n, r):
    # 上記のModIntを用いた通りの数の実装
    if r > n:
        return 0  # このような通りの数は無いため便宜上こう定義する
    r = min(r, n - r)
    nf = rf = ModInt(1)
    for i in range(r):
        nf = nf * (n - i)
        rf = rf * (i + 1)
    return nf / rf


N, M, K = map(int, input().split())
C = combination(N * M - 2, K - 2)
x_term = ModInt(0)
for dx in range(1, N):
    x_term += (N - dx) * dx
x_term *= M**2

y_term = ModInt(0)
for dy in range(1, M):
    y_term += (M - dy) * dy
y_term *= N**2

print(C * (x_term + y_term))


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

const int MAX = 110;

int f[MAX][MAX];
string g[MAX][MAX];
string s;
int n;

string makeBrackets(){
	stack<char> st;
	for (int i = 0; i < n; i++){
		if (s[i] == '(')
			st.push('(');
		else
			if (st.empty() || st.top() == ')')
				st.push(')');
			else
				st.pop();
	}
	while (!st.empty()){
		if (st.top() == ')')
			s = "(" + s;
		else
			s = s + ")";
		st.pop();
	}
	return s;
}

int main(){
	ios::sync_with_stdio(false);
	cin >> n >> s;
	for (int i = 0; i < n; i++)
		s[i] = s[i] == '(' ? '(' : ')';
	memset(f, -1, sizeof(f));
	cout << makeBrackets();

	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int N;

    cin >> N;
    int p[N];
    int q[N];

    for ( int i = 0; i < N; i ++ ) {
        cin >> p[i];
        q[i] = p[i];
    }

    sort( p, p+N );


    int count = 0;
    for ( int i = 0; i < N; i ++ ) {
        if ( q[i] != p[i] ) count ++;
    }
    if ( count == 2 || count == 0 ) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;

    
}

Measured memory_bytes: 256
from sys import stdin
import math

a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans = 0
for i in range(a+1):
    for j in range(b+1):
        r=(x-500*i-100*j)//50
        if(0<=r and r<=c):
            ans=ans+1

print(ans)

Measured memory_bytes: 38768
#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
N, = getIntList()
#print(N)
re = 0
def check(now, d):
    global re
    if now >N: return
    if d[0]>0 and d[1]>0 and d[2]>0:
        re+=1
    now*=10
    d[0]+=1
    check( now+ 7, d)
    d[0]-=1
    d[1]+=1
    check( now+ 5, d)
    d[1]-=1
    d[2]+=1
    check( now+ 3, d)
    d[2]-=1
check(0, [0,0,0])    
print(re)





Measured memory_bytes: 43244
// Aizu Vol-5 0501: Data Conversion
// 2017.8.30 bal4u@uu

#include <stdio.h>
#include <string.h>

char t[128];

int main()
{
	int n, i;
	char b1[10], b2[10];

	while (scanf("%d", &n) && n) {
		for (i = 0; i < 128; i++) t[i] = i;
		while (n-- > 0) {
			scanf("%s%s", b1, b2);
			t[*b1] = *b2;
		}
		scanf("%d", &n);
		while (n-- > 0) {
			scanf("%s", b1);
			putchar(t[*b1]);
		}
		putchar('\n');
	}
	return 0;
}

Measured memory_bytes: 576
def examA():
    N = I()
    L = LI()
    L.sort()
    ans = sum(L[::2])
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examA()

"""

"""

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

int town[100000];
int dis[100000];
int p_max=0;
int price=0;
int N;
int apple;
int ans;

int main() {
	cin >> N >> apple;
	for (int i = 0; i < N; i++) {
		cin >> town[i];
	}
	for (int i = N - 1; i >= 0; i--) {
		dis[i] = p_max - town[i];
		if (p_max < town[i])p_max = town[i];
	}
	for (int i = 0; i < N; i++) {
		if (price < dis[i])price = dis[i];
	}
	for (int i = 0; i < N; i++) {
		if (dis[i] == price)ans++;
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <sstream>
#include <memory>

int max_num(const int n, const int k, int const* w, const int p) 
{
    int j = 0;
    int track = p;
    int i = 0;
    for (; i < n;) {
        if (track >= w[i]) {
            track -= w[i];
            ++i;
        }
        else {
            ++j;
            track = p;
            if (j == k) {
                break;
            }
        }
    }

    return i;
}

int half(int n) 
{
    return n >> 1;
}

int solve(const int n, const int k, int const* w, const int l, const int r)
{
    const int m = half(l + r);
    if (l == m) {
        return r;
    }
    enum class Pos {
        Left,
        Right
    };
    const Pos p = max_num(n, k, w, m) < n ? Pos::Right : Pos::Left;
    return solve(
        n,
        k,
        w,
        p == Pos::Left ? l : m,
        p == Pos::Right ? r : m);
}


int solve(const int n, const int k, int const* w) 
{
    return solve(n, k, w, 0, 10000 * 100000);
}

void split(int* ret, const std::string& data)
{
    std::stringstream stream;
    stream << data;
    std::string buf;
    for (int i = 0; getline(stream, buf, ' '); ++i) {
        ret[i] = std::stoi(buf);
    }
    return;
}

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

    int tmp[2];
    {
        std::string buf;
        getline(std::cin, buf);
        split(tmp, buf);
    }
    const int n = tmp[0];
    const int k = tmp[1];

    int w[100000];
    for (int i = 0; i < n; ++i) {
        std::cin >> w[i];
        std::cin.ignore();
    }

    std::cout << solve(n, k, w) << std::endl;

    return 0;
}

Measured memory_bytes: 3612
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <stdio.h>
using namespace std;

int main(){

	double x,y;
	double a,b,c;
	bool flag;

	while(cin>>x>>y){

		flag = true;

		a=max(x,y);
		b=min(x,y);

		while(flag){

			c=abs(a-b);
			a=b;b=c;
			if(a==b)flag=false;

		}

		printf("%d %d\n",static_cast<int>(a),static_cast<int>((x*y)/a));
//		cout<<setprecision(0)<<a<<" "<<(x*y)/a;

	}

	return 0;
}

Measured memory_bytes: 1200
#include<stdio.h>

int main(void){
    int N;
    int x,y,i,j;
    int flag=0,ans=0;

    scanf("%d",&N);
    for(i =0;i < N;i++){
        scanf("%d%d",&x,&y);
        if(x == y){
            flag++;
            if(flag==3){
                ans=1;
            }
        }
        else{
            flag=0;
        }
    }
    if(ans==1){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    return 0;
}

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

#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}

ll conbinationMemo[100][100];

void cmemoInit(){
    rep(i, 100){
        rep(j, 100){
            conbinationMemo[i][j] = -1;
        }
    }
}
 
ll nCr(ll n, ll r){
    if(conbinationMemo[n][r] != -1) return conbinationMemo[n][r];
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return conbinationMemo[n][r] = (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
//-----------------------ここから-----------
int main(void){
    ll a, b, c, d;
    cin >> a >> b >> c >> d;

    cout << max({a * c, a * d, b * c, b * d}) << endl;

}


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

int main() {
    int num[3];
    for (int i = 0; i < 3; i++) {
        cin >> num[i];
    }
    sort(num, num + 3);
    if (num[0] != num[1]) {
        cout << num[0] << endl;
    } else {
        cout << num[2] << endl;
    }
    return 0;
}

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

int main(){
	long long L,R;
	cin >> L >> R;
	bool flag=false;
	
	if(L%2019==0)flag=true;
	if((R%2019)<=(L%2019))flag=true;
	if(R-L>=2019)flag=true;
	
	if(flag){
		cout << "0" << endl;
		return 0;
	}
	
	long long ans=9999999999999LL;
	for(long long i=L;i<R;i++)for(long long j=i+1;j<=R;j++){
		ans=min(ans,((i%2019)*(j%2019))%2019);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,cnt=0;
  cin >> n;
  int p[n],m=(1<<30);
  for(int i=0;i<n;i++){
    cin >> p[i];
    if(m>p[i]){
      cnt++;
      m=min(m,p[i]);
    }
  }
  cout << cnt << endl;
}


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

li a[100100];
li sum[100100];

int main() {
    li n;
    cin >> n;
    sum[0] = 0;
    rin{
        cin >> a[i];
    }
    sort(a, a + n);
    rin{
        sum[i + 1] = sum[i] + a[i];
    }

    li res = 1;
    repp(i, 1, n) {
        if (a[n - i] <= sum[n - i] * 2 ) {
            ++res;
        } else {
            break;
        }
    }
    cout << res << endl;

    return 0;
}

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

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;

    vector<bool> broken(n + 1, false);
    for (int i = 0; i < m; ++i) {
        int a;
        cin >> a;
        broken[a] = true;
    }

    vector<int> dp(n + 1, 0);
    dp[0] = 1;
    if (!broken[1])
        dp[1] = 1;
    for (int i = 2; i <= n; ++i) {
        if (!broken[i - 1])
            dp[i] += dp[i - 1];
        if (!broken[i - 2])
            dp[i] += dp[i - 2];
        dp[i] = dp[i] % 1000000007;
    }

    cout << dp[n] << '\n';
}


Measured memory_bytes: 640
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int n, q;
int A[20], m[200];

bool solve(int i, int m)
{
    if(m == 0)
        return true;
    if(i >= n)
        return false;

    return solve(i+1, m-A[i]) ||solve(i+1, m);
}

void func(vector<int> *S, int i, int x)
{
    if (i == n - 1)
    {
        (*S).push_back(x + A[i]);
        (*S).push_back(x);
    }
    else
    {
        func(S, i + 1, x + A[i]);
        func(S, i + 1, x);
    }

    return;
}

int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> A[i];
    cin >> q;
    for (int i = 0; i < q; i++)
        cin >> m[i];
    vector<int> S;
    for(int i = 0; i < q; i++)
    {
        if(solve(0,m[i]))
            cout << "yes\n";
        else
            cout << "no\n";
    }
//    func(&S, 0, 0);

//    for (int i = 0; i < q; i++)
//    {
//        vector<int>::iterator itr = S.begin();
//        bool flag = false;
//        while (itr != S.end())
//        {
//            if (m[i] == *itr)
//            {
//                flag = true;
//                break;
//            }
//            itr++;
//        }
//        if (flag)
//            cout << "yes\n";
//        else
//            cout << "no\n";
//    }

    return 0;
}


Measured memory_bytes: 2996
import java.io.*;
import java.nio.CharBuffer;
import java.util.NoSuchElementException;

public class Main {

    public static void main(String[] args) {
        SimpleScanner scanner = new SimpleScanner(System.in);
        PrintWriter writer = new PrintWriter(System.out);

        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();
        int n = scanner.nextInt();
        long ans = 0;
        for (int i = 0; i <= n / a; ++i) {
            for (int j = 0; j <= (n - a * i) / b; ++j) {
                if ((n - a * i - b * j) % c == 0) {
                    ++ans;
                }
            }
        }
        writer.println(ans);

        writer.close();
    }

    private static class SimpleScanner {

        private static final int BUFFER_SIZE = 10240;

        private Readable in;
        private CharBuffer buffer;
        private boolean eof;

        SimpleScanner(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
            buffer = CharBuffer.allocate(BUFFER_SIZE);
            buffer.limit(0);
            eof = false;
        }


        private char read() {
            if (!buffer.hasRemaining()) {
                buffer.clear();
                int n;
                try {
                    n = in.read(buffer);
                } catch (IOException e) {
                    n = -1;
                }
                if (n <= 0) {
                    eof = true;
                    return '\0';
                }
                buffer.flip();
            }
            return buffer.get();
        }

        void checkEof() {
            if (eof)
                throw new NoSuchElementException();
        }

        char nextChar() {
            checkEof();
            char b = read();
            checkEof();
            return b;
        }

        String next() {
            char b;
            do {
                b = read();
                checkEof();
            } while (Character.isWhitespace(b));
            StringBuilder sb = new StringBuilder();
            do {
                sb.append(b);
                b = read();
            } while (!eof && !Character.isWhitespace(b));
            return sb.toString();
        }

        int nextInt() {
            return Integer.valueOf(next());
        }

        long nextLong() {
            return Long.valueOf(next());
        }

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

Measured memory_bytes: 22996
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int a=scan.nextInt();
int b=scan.nextInt();
int c=scan.nextInt();
if(a<b){
	if(b<c){
		System.out.println("Yes");
	}
	else{
		System.out.println("No");
	}
}
else{
	System.out.println("No");
}

	}

}

Measured memory_bytes: 26248
N, K = map(int,input().split())
d = []
A = []
for i in range(K):
  d.append(int(input()))
  A.append(list(map(int,input().split())))
  
sunuke = [0] * N
for i in range(K):
  for j in range(len(A[i])):
  	sunuke[A[i][j]-1] += 1

ans = 0
for i in sunuke:
  if i == 0:
  	ans += 1
  	
print(ans)

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

void lcs(string s,string t,int m,int n)
{

	int dp[m+1][n+1];

	for(int i=0;i<=m;i++)
	{
		for(int j=0;j<=n;j++)
		{
			if(i==0 || j==0)
				dp[i][j]=0;

			else if(s[i-1]==t[j-1])
				dp[i][j]=dp[i-1][j-1]+1;

			else 
				dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
		}
	}
	int index = dp[m][n]; 
   char lcs[index+1]; 
   lcs[index] = '\0'; 
   int i = m, j = n; 
   while (i > 0 && j > 0) 
   { 
      
      if (s[i-1] == t[j-1]) 
      { 
          lcs[index-1] = s[i-1];  
          i--; j--; index--;     
      } 
  
      
      else if (dp[i-1][j] > dp[i][j-1]) 
         i--; 
      else
         j--; 
   } 
  
   
   cout << lcs<<endl; 
} 


int main()
{

	string s,t;

	cin >> s;
	cin >> t;

	 int m = s.length();  
    int n =t.length();  
      
    lcs(s,t,m,n);  
   
      
    return 0;
}


Measured memory_bytes: 35456
#include <iostream>
#include <vector>
#include <math.h>
#include <iomanip>
#include <set>
#include <map>
using ll = long long;
using namespace std;

int main(void){
    ll n,a,sum=0,one=0;
    map<ll,ll> m,m2;
    vector<int> v;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a;
        v.push_back(a);
        m[a]++;
    }
    
    for(auto j=m.begin();j!=m.end();j++){
        one+=(m[j->first]*((m[j->first])-1))/2;
    }
    
    for(int i=0;i<n;i++){
        sum=0;
        //m2=m;
        m[v[i]]--;
    cout<<one-m[v[i]]<<endl;
      m[v[i]]++;
    }
}


Measured memory_bytes: 10228
{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import           Control.Monad (replicateM)

main :: IO ()
main = do
  [n, a, b, c] <- map read . words <$> getLine
  ls <- replicateM n readLn
  print $ solve n a b c ls

solve :: Int -> Int -> Int -> Int -> [Int] -> Int
solve _ a b c = dfs 0 0 0
  where
    dfs x y z []
      | x == 0 || y == 0 || z == 0 = inf
      | otherwise = abs (x - a) + abs (y - b) + abs (z - c) - 30
    dfs x y z (l:ls) = minimum [d1, d2, d3, d4]
      where
        d1 = dfs x y z ls
        d2 = dfs (x + l) y z ls + 10
        d3 = dfs x (y + l) z ls + 10
        d4 = dfs x y (z + l) ls + 10

inf :: Int
inf = 10 ^ 10


Measured memory_bytes: 1020
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
#include<cfloat>
using namespace std;
int mod = 1e9+7;
long long int inf = 1e18;

int main() {
  long long int n, m;
  cin >> n >> m;
  if( n > m ) swap(n, m);

  if( n >= 3 && m >= 3 ){
    cout << (n-2) * (m-2) << endl;
  }else if( n == 2 || m == 2){
    cout << 0 << endl;
  }else if( n == 1 && m >= 2 ){
    cout << m-2 << endl;
  }else if( n == 1 && m == 1 ){
    cout << 1 << endl;
  }

  return 0;
}

//


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

signed main(){
  int N,M;
  cin>>N>>M;
  std::vector<int> v(N);
  for(int i=0;i<N;i++)cin>>v[i];
  std::vector<int> a(N);
  a[0]=v[0]%M;
  for(int i=1;i<N;i++)a[i]=(a[i-1]+v[i])%M;
  sort(a.begin(),a.end());
  int ans=0;
  int k=1;
  for(int i=1;i<N;i++){
    if(a[i]==a[i-1]&&a[i]!=0)k++;
    else{
      ans+=(k*(k-1))/2;
      k=1;
    }
  }
  ans+=(k*(k-1))/2;
  k=0;
  for(int i=0;i<N;i++)if(a[i]==0)k++;
  ans+=(k*(k+1))/2;
  cout<<ans<<endl;
}


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

int GCD(int a, int b){
    if(a > b){
       return GCD(b, a);
    }

    while(b != 0){
            int rem = a % b;
            a = b;
            b = rem;
    }
 
    return a;
}

int gcd(int a, int b, int c){
    int num = GCD(a,b);
    return GCD(num,c);    
}



int main(void)
{
    int K;
    cin >> K;
    int i,j,k;
    int sum = 0;

    for(i=1;i<=K;i++){
        for(j=1;j<=K;j++){
            for(k=1;k<=K;k++){
                sum = sum + gcd(i,j,k);
                //cout << gcd(i,j,k) << endl;
            }
        }
        
    }

    cout << sum << endl;

    return 0;

}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define fi first
#define se second
#define inf (INT_MAX/2-1)
#define infl (1LL<<62)
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define sz(a) (int)(a).size()
#define all(a) begin(a),end(a)
#define y0 y5656
#define y1 y7878
#define aaa system("pause");
#define dbg(x) cerr<<(#x)<<": "<<(x)<<'\n',aaa
#define dbga(x,n) cerr<<(#x)<<"[]: ";for(int _=0;_<n;_++)cerr<<x[_]<<' ';cerr<<'\n',aaa
#define dbgs(x) cerr<<(#x)<<"[stl]: ";for(auto _:x)cerr<<_<<' ';cerr<<'\n',aaa
#define dbgp(x) cerr<<(#x)<<": "<<x.fi<<' '<<x.se<<'\n',aaa

using namespace std;

const ll mod = 1000000007;

ll lgput (ll a, ll b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  ll c = lgput(a, b/2);
  c = c*c%mod;
  if (b&1) c = c*a%mod;
  return c;
}

int main () {
  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  ll n; cin >> n;
  ll a = lgput(10, n), b = 2*lgput(9,n)%mod, c = lgput(8, n);
  cout << ((a-b+mod)%mod+c)%mod;
  return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;

int main()
{
    long long N;
    scanf("%lld", &N);
    long long ans = ((N - 1) * N )/ 2;
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>

int main() {
  int n;
  std::cin >> n;
  int prev_t = 0;
  int prev_x = 0;
  int prev_y = 0;
  for (int ni = 0; ni < n; ++ni) {
    int t, x, y;
    std::cin >> t >> x >> y;
    int dx = std::abs(x - prev_x);
    int dy = std::abs(y - prev_y);
    int dt = t - prev_t;
    if (dx + dy > dt or (dx + dy) % 2 != dt % 2) {
      std::cout << "No" << std::endl;
      return 0;
    }
    prev_t = t;
    prev_x = x;
    prev_y = y;
  }
  std::cout << "Yes" << std::endl;
  return 0;
}

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

int main() {
    while (true) {
        int a, b, v;
        char op;
        cin >> a >> op >> b;
        if (op == '?') {
            break;
        }
        if (op == '+') {
            v = a + b;
        } else if (op == '-') {
            v = a - b;
        } else if (op == '*') {
            v = a * b;
        } else {
            v = a / b;
        }
        cout << v << endl;
    }
    return 0;
}


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

int main()
{
	int i = 1, n = 0;
	cin >> n;
	while(++i<=n){
		int x = i;

		if (x % 3 == 0) {
			cout << ' ' << i;
		}
		else {
		      while (x > 0) {
				     if (x % 10 == 3) {
					cout << ' ' << i;
					break;
				      }
				     else {
					    x /= 10;
				         }
			}
		}
	}
	cout << endl;
}

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

int main(){
  string a, b ,c;
  cin >> a >> b >> c;
  if(a[a.size()-1] == b[0] && b[b.size()-1] == c[0]) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 256
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    import math
    #from math import gcd

    #inf = 10**17
    #mod = 10**9 + 7

    n,m = map(int, input().split())
    adj = [[] for _ in range(n)] #頂点数, 場合によって変える
    for _ in range(m):
        a,b = map(int, input().split())
        adj[a-1].append(b-1)

    # 始点, 今回見る点
    def dfs(s, v):
        for nv in adj[v]:
            if nv == s:
                return [v]
            if visited[nv] == 1:
                continue
            visited[nv] = 1
            res = dfs(s, nv)
            if res != -1:
                res.append(v)
                return res
        return -1


    for s in range(n):
        visited = [0]*n
        visited[s] = 1
        heiro = dfs(s, s)
        if heiro != -1:
            break
    else:
        print(-1)
        exit()
    heiro = heiro[::-1]

    def graph(s, g):
        res = [s]
        d = deque([s])
        for i in range(len(heiro)):
            if heiro[i] == s:
                idx = i
                break
        while d:
            v = d.popleft()
            for nv in adj[v]:
                if visited[nv] == 1 and nv == g:
                    res.append(nv)
                    return res
            d.append(heiro[idx+1])
            res.append(heiro[idx+1])
            idx += 1
            if idx == len(heiro)-2:
                idx = -1
            #ここ
            if res[-1] == heiro[heiro.index(s)-1]:
                return res

    while True:
        heiro.append(heiro[0])
        visited = [0]*n
        f = 0
        for i in heiro:
            visited[i] = 1
        new_heiro = [heiro[0]]
        for i in range(len(heiro)-1):
            for nv in adj[heiro[i]]:
                if visited[nv] == 1 and nv != heiro[i+1]:
                    new_heiro = graph(nv, heiro[i])
                    f = 1
                    break
            else:
                new_heiro.append(heiro[len(new_heiro)])
            if f:
                heiro = new_heiro
                break
        else:
            break

    print(len(heiro)-1)
    for i in heiro[:-1]:
        print(i+1)

if __name__ == '__main__':
    main()

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

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

    int out = 0;
    int minp = 10000000;
    for (int i = 0; i < n; i++) {
        int p; cin >> p;
        if (p <= minp) ++out;
        minp = min(minp, p);
    }

    cout << out << endl;

    return 0;
}


Measured memory_bytes: 256
parseInt(x::String) = parse(Int, x)
parseInt(x::SubString{String}) = parse(Int, x)
parseInt(x::Char) = parse(Int, x)
parseInt(x::Float64) = trunc(Int, x)
parseFloat(x::String) = parse(Float64, x)
parseFloat(x::Int) = trunc(Float64, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    n=parseInt(readline())
    ans=""
    if n==0
        ans="0"
    end
    while n!=0
        if n%-2==0
            ans="0"*ans
        else
            ans="1"*ans
            n-=1
        end
        n=div(n,-2)
    end
    println(ans)
end
main()

Measured memory_bytes: 158772
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[] ans = new int[3];

      int anss = -201;

      ans[0] = a + b;
      ans[1] = a - b;
      ans[2] = a * b;

      for(int j=0;j<3;j++){
        if(ans[j]>anss){
          anss=ans[j];
        }
      }



      System.out.println(anss);

    }
}


Measured memory_bytes: 21844
#include <stdio.h>

int main(void) {
  int n, b, f, r, v;
  int res[4][3][10] = {0}; // res[b][f][r]

  scanf("%d", &n);

  for (; n--;) {
    scanf("%d %d %d %d", &b, &f, &r, &v);
    res[b - 1][f - 1][r - 1] += v;
  }

  for (b = 0; b < 4; b++) {
    for (f = 0; f < 3; f++) {
      for (r = 0; r < 10; r++) {
        printf(" %d", res[b][f][r]);
      }

      if (b != 3 || f != 2) {
        putchar('\n');
      }
    }

    puts(b == 3 ? "" : "####################");
  }

  return 0;
}

Measured memory_bytes: 612
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;


int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    deque<string> de;
    de.push_back(s);
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == '(') {
            cnt++;
        } else {
            cnt--;
        }
        if (cnt < 0) {
            de.push_front("(");
            cnt++;
        }
    }
    for (int i = 0; i < cnt; i++) {
        de.push_back(")");
    }
    for (int i = 0; i < de.size(); i++) {
        cout << de.at(i);
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
	int l, n, i, d, min, temp;
	char s[10];
	while(~scanf("%s", s))
	{
		l=strlen(s);
		min = 10000;
		for(i=2; i<l; i++)
		{
			n = 100*(s[i-2]-48)+10*(s[i-1]-48)+(s[i]-48);
			d = abs(753-n);
			if(d<min) min = d;
		}
		printf("%d\n", min);
	}
	return 0;
}

Measured memory_bytes: 504
//
// Created by yozaam on 12/06/20.
//

//
// Created by yozaam on 04/06/20.
//



/********   All Required Header Files ********/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <unordered_map>
#include <unordered_set>

using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define PI 3.1415926535897932384626
typedef pair<int, int>  pii;
typedef vector<int>     vi;
typedef vector<pii>     vpii;
typedef vector<vi>      vvi;
//=======================
const int MOD = 1000000007;
const int N = 2e6+13, M = N;
//=======================
vi g[N];
int a[N];
int n, x,t,i;
//=======================

void solve() {
    string num; 

    cin>>num;

    int mod = 0;

    for(char c : num){
        mod  = (mod + (c-'0')%9)%9;
    }

    if(mod)cout<<"No";else cout<<"Yes";
}

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

    int t = 1;
    // cin >> t;
    while(t--) {
      solve();
    }

    return 0;
}

Measured memory_bytes: 50236
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);i++)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;i--)
#define lb lower_bound
#define ub upper_bound
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
const ll LINF = (ll)(1e18 +99);
vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> void chmin(T& t, const U& u){if(t>u)t=u;}
template<typename T,typename U> void chmax(T& t, const U& u){if(t<u)t=u;}
template<typename T>T gcd(T a,T b){return b?gcd(b,a%b):a;}
template<typename T>T mpow(T a, T n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}



signed main(){
  cin.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
   int x,y,ans=0;cin>>x>>y;
   vector<int> v(100000,0);
   v[1]=300000;
   v[2]=200000;
   v[3]=100000;
   ans+=v[x];ans+=v[y];
   if(x==y && x==1)ans+=400000;
   cout<<ans<<endl;
}
//( ・ __ ・ ) KEEP BEING ORGANIZED
//CHECK overflow,vector_size,what to output?

Measured memory_bytes: 640
#include<stdio.h>
long GCDisGOD(long a,long b){
  long p = a;
  long q = b;
  long c=0;
  long hoge = 0;
  long i = 0;
  for(i=0;i<10;i++){
    c = p%q;
    if(c == 0){
      return q;
    }else{
      hoge = p;
      p = q;
      q = c;
    }
    //printf("%d %d %d#",p,q,c);
  }
}
    
int main(){
  long n = 0;
  long k = 0;
  int i = 0;
  long a[100000] = {};
  int success = -1;
  long gcd = 0;
  long max = 0;
  scanf("%ld %ld",&n,&k);
  for(i=0;i<n;i++){
    scanf("%ld",&a[i]);
  }
    gcd = a[0];
    for(i=0;i<n;i++){
        gcd = GCDisGOD(gcd,a[i]);
        if(a[i] > max){
          max = a[i];
        }
      }
  
    //printf("%ld#",gcd);
    if((k % gcd == 0  && max >= k)){
      success = 1;
    }else{
      success = 0;
    }
  
  if(success){
    printf("POSSIBLE");
  }else{
    printf("IMPOSSIBLE");
  }
  
      
  return 0;
}
         
  

Measured memory_bytes: 896
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};

ll x[100001]={};
int a;
int b;
int main() {

	int n;
	ll k;
	int r=0,o=0;

	cin>>n>>k;

	rep(i,n){
		cin>>a>>b;
		x[a]+=b;
		r=max(r,a);
		o=min(o,a);
	}
	for(int i=o; i<r+1; i++){
		if(x[i]>=k){
			cout<<i<<endl;
			return 0;
		}
		k-=x[i];
	}

	return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main() {
    int a, b;
    cin >> a >> b;
    if (a == b) {
        cout << a * 2;
    } else {
        if (a > b) {
            cout << a + (a - 1);
        } else if (a < b) {
            cout << b + (b - 1);
        }
    }
}

Measured memory_bytes: 256