akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
using namespace std;

int main(){
	string s;int i;
	while(cin>>s){
		for(i=0;i<s.size()-1;i++)if(s[i]=='A'&&s[i+1]=='C')break;
		cout<<(i==s.size()-1?"No\n":"Yes\n");
	}
}


Measured memory_bytes: 256
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

    for  i in range(a[0]):
        s=input()
        list = s.split(" ", )
        if "snuke" in list:
            print(chr(65+list.index("snuke")) + str(i+1))



Measured memory_bytes: 3828
mod=10**9+7
l=input()
bit=[int(i) for i in l]
m=len(bit)
#num1=sum(bit)
#print(bit)
#print(m)
#print(num1)
#ans=0
#ans+=(pow(3,m-1,mod))
#最上位bitの時
#ans+=(2*pow(2,num1-1,mod))
#print(ans%mod)

#適当にやりすぎたけど、桁DPジャン
#小さい方と同じ方
dp=[[0,0] for i in range(m)]
dp[0]=[1,2]
for i in range(m-1):
    dp[i+1][0]=3*dp[i][0]%mod
    if bit[i+1]==0:
        dp[i+1][1]+=dp[i][1]
        dp[i+1][1]%=mod
    else:
        dp[i+1][0]+=dp[i][1]
        dp[i+1][1]+=(2*dp[i][1])
        dp[i+1][0]%=mod
        dp[i+1][1]%=mod
print(sum(dp[m-1])%mod)

Measured memory_bytes: 24948
#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
#define int int64
#define rep(i, n) for(int i=0; i<n; i++)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define SORT(x) sort(x.begin(), x.end())
#define GSORT(x) sort(x.begin(), x.end(), greater<int>())
#define mk make_pair
#define fi first
#define se second
#define pb push_back
#define ALL(x) x.begin(), x.end()
#define V(T) vector<T>
typedef pair<int, int> P;
typedef pair<P, P> PP;
typedef vector<int> vi;
typedef vector<vi> vvi;
int max(int a, int b) {if(b>a) return b; else return a;}
int min(int a, int b) {if(b<a) return b; else return a;}


signed main() {
    int A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;
 
    int sum=-1, salt=0;
    for(int a=0; 100*a<=F; a+=A) {
        for(int b=0; 100*(a+b)<=F; b+=B) {
            for(int c=0; 100*(a+b)+c<=F; c+=C) {
                for(int d=0; 100*(a+b)+c+d<=F; d+=D) {
                    int s = c+d;
                    int tsum = 100*(a+b)+s;

                    //(a/b < c/d) -> (a*d < c*b)
                    if(s<=(a+b)*E && tsum>0 && (sum<0 || salt*tsum<s*sum)) {
                        sum = tsum;
                        salt = s;
                    }
                }
            }
        }
    }

    cout << sum << " " << salt << endl;
    
    return 0;
}

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

int main() {
  int n;
  cin >> n;
  int ans = (n * (n+1)) / 2;
  cout << ans << endl;
}

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

using namespace std;
#define rep(i, n) for(int i = 0 ; i < (int)(n) ; i++)
typedef long long ll;
typedef long double Double;

#ifndef INPUTS_DIR
#define INPUTS_DIR "./"
#endif


void solve(ll A, ll B) {
    if (A <= 8 && B <= 8) cout << "Yay!" << endl;
    else cout << ":(" << endl;
}


void main_(istream &cin) {
    ll B;
    ll A;
    cin >> A;
    cin >> B;
    solve(A, B);
}

int main() {
#ifdef INTELLIJ
    ifstream ifs(string(INPUTS_DIR) + "in_1.txt");
    if (ifs.is_open()) {
        main_(ifs);
        ifs.close();
    } else {
        cerr << "Error: no input." << endl;
    }
#else
    ios::sync_with_stdio(false);
    cin.tie(0);
    main_(cin);
#endif
}





Measured memory_bytes: 256
import collections
import sys

def primes(n):
  is_prime=[True]*(n+1)
  is_prime[0]=False
  is_prime[1]=False
  for i in range(2,int(n**0.5)+1):
    if not is_prime[i]:
      continue
    for j in range(i*2,n+1,i):
      is_prime[j]=False
  return [i for i in range(n+1) if is_prime[i]]

def fact(n):
  l=primes(int(n**0.5)+1)
  L=[]
  for i in range(len(l)):
    while n%l[i]==0:
      n=n//l[i]
      L.append(l[i])
    if n==1:
      break
  if n!=1:
    L.append(n)
  return L

def cmb(n,r,mod):
  if r<0 or r>n:
    return 0
  r=min(r,n-r)
  return g1[n]*g2[r]*g2[n-r]%mod

n,M=map(int,input().split())
if M==1:
  print(1)
  sys.exit()
m=10**9+7
x=list(collections.Counter(fact(M)).values())

g1=[1,1]
g2=[1,1]
inverse=[0,1]

for i in range(2,max(x)+n):
  g1.append((g1[-1]*i)%m)
  inverse.append((-inverse[m%i]*(m//i))%m)
  g2.append((g2[-1]*inverse[-1])%m)

ans=1

for i in range(len(x)):
  ans*=cmb(x[i]+n-1,x[i],m)
  ans%=m
print(ans)

Measured memory_bytes: 15380
//设a为横行移动，b为反向移动,n为移动次数(为x,y的正反半轴)
//a+b = nk , a - b = x+y , a = (n*k + x + y) /2 ,b = (n*k - x - y) /2;
// nk >= x + y  且 nk = x+y (mod 2)
#include <cstdio>
#include <algorithm>
using namespace std;
int fx,fy,n,x,y,nx,ny;
long long a,b,k;//
void dfs(int t)
{
	if(!t) return;
	if(b)	//	反向移动还没移动完
	{
		if(b >= k)
		{
			if(x - nx <= y - ny) nx -= k;	// 优先让差距小的反向移动
			else ny -=k;
		}
		else
		{
			if(x - nx <= y - ny)
			{
				nx -= b;
				ny += (k-b);
			}
			else
			{
				ny -=b;
				nx += (k-b);
			}
		}
		b = max(b-k,0ll);
	}
	else
	{
		if(nx < x)
		{
			if(x - nx >= k) nx+=k;
			else
			{
				ny += (k - (x -nx));
				nx = x;
			}
		}
		else
		{
			if(y - fy * ny >= k) ny += k;
			else ny = y;
		}
	}
	printf("%d %d\n",nx * fx, ny * fy);
	dfs(t-1);
}
int main()
{
	// freopen("a.in","r",stdin);
	// freopen("k.out","w",stdout);
	scanf("%lld %d %d",&k,&x,&y);
	fx = x<0?-1:1; fy = y<0?-1:1;
	x*=fx,y*=fy;
	if(k%2==0 && (x+y)&1)
	{
		printf("-1\n");
		return 0;
	}
	if(k == x+y) n=1;
	else
	{
		n = 2;
		while(n*k < x+y || (n*k - x - y)%2) ++n;
	}
	a = (n*k+x+y) >>1;
	b = (n*k-x-y) >>1;
	printf("%d\n",n);
	dfs(n);
	return 0;
}

Measured memory_bytes: 2304
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>


using namespace std;



int main() {

	pair <int, int> width;

	int N, M, x, y, ans;

	cin >> N >> M;

	width = { 0, N };

	for (int i = 0; i < M; i++) {
		cin >> x >> y;
		if(width.first < x) width.first = x;
		if(width.second > y) width.second = y;
	}
	ans = width.second - width.first + 1;
	if (ans >= 1) cout << ans;
	else cout << 0;

	return 0;

}

Measured memory_bytes: 256
n = int(input())
m = []
a = [[] for i in range(n)]
for i in range(n):
    tmp = int(input())
    m.append(tmp)
    for j in range(tmp):
        a[i].append(list(map(int,input().split())))
ans = 0
for i in range(2**n):
    cnt = 0
    for j in range(n):
        flg = True
        if i >> j & 1:
            cnt += 1
            for k in range(m[j]):
                kj = (i >> (a[j][k][0]-1)) & 1
                if a[j][k][1] != kj:
                    flg = False
                    break
            if not flg:
                break
    if flg:
        ans = max(ans, cnt)
            
print(ans)     

Measured memory_bytes: 68484
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n,m,p,f[2505],ans;
struct data{
	int x,y,v;
}a[5005];
void solve(){
	for(int i=0;i<n*2;i++)
		for(int j=1;j<=m;j++){
			int x=a[j].x,y=a[j].y,v=a[j].v;
			if(f[x]==-1e18)continue;
			if(f[x]+v>f[y])f[y]=i<n-1?f[x]+v:1e18;
		}
}
signed main(){
	scanf("%lld%lld%lld",&n,&m,&p);
	for(int i=1;i<n;i++)f[i]=-1e18;
	for(int i=1;i<=m;i++)scanf("%lld%lld%lld",&a[i].x,&a[i].y,&a[i].v),a[i].x--,a[i].y--,a[i].v-=p;
	solve();ans=f[n-1];
	printf("%lld\n",ans!=1e18?max(0ll,ans):-1);
	return 0;
}

Measured memory_bytes: 384
#include "bits/stdc++.h"
using namespace std;

int main(void){
	int n,a[65],i,mx=1;
	cin >> n;
	for(i=1; i<=n; i++){
		cin >> a[i];
		if(abs(a[i])>abs(a[mx])){
			mx = i;
		}
	}
	cout << (2*n-1) << endl;
	for(i=1; i<=n; i++){
		cout << mx << " " << i << endl;
	}
	if(a[mx]>=0){
		for(i=1; i<n; i++){
			cout << i << " " << (i+1) << endl;
		}
	}else{
		for(i=n; i>1; i--){
			cout << i << " " << (i-1) << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
from collections import deque

N,Q = map(int, input().split())
edge = [[] for _ in range(N)]
for _ in range(N - 1):
    a,b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)

cnt = [0] * N
for _ in range(Q):
    p,x = map(int, input().split())
    cnt[p - 1] += x

ans = [-1] * N
que = deque([0])
ans[0] = cnt[0]
while que:
    v = que.popleft()
    for w in edge[v]:
        if ans[w] < 0:
            ans[w] = ans[v] + cnt[w]
            que.append(w)

print(*ans)

Measured memory_bytes: 61976
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial
    from operator import itemgetter
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7
#main code here!
    n=I()
    ans=0
    for i in range(1,n+1):
        for j in range(1,n//i+1):
            if i*j<n:
                ans+=1
                #print(i,j)
    print(ans)

        
        
        
        



        
        
        
        
        
    
if __name__=="__main__":
    main()



Measured memory_bytes: 68244
#include <algorithm>
#include<stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stack>
#include <queue>
#include<map>
#include <set>
#include<math.h>
using namespace std;
#define int long long
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define Rep(i,n) for(ll i=1;i<=n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define elif else if
#define P pair<ll,ll>
#define prique priority_queue<ll>
#define all(a)  (a).begin(),(a).end()
const int mod = 1000000007;
const int mod2 = 998244353;
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2) * pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x,y)* mod_pow(kai(y,y), mod - 2, mod) % mod;
}
int per(int n, int r) {
	r = n - r;
	int sum = 1;
	int i;
	for (i = n; i >= r + 1; i--)sum *= i;
	return sum;
}
struct UnionFind {
	vector<int> par;

	UnionFind(int n) : par(n, -1) { }

	int root(int x) {
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y) {
		return root(x) == root(y);
	}

	bool merge(int x, int y) {
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x) {
		return -par[root(x)];
	}
};
signed main(){
	int n, a;
	cin >> n >> a;
	if (500 * n >= a)cout << "Yes" << endl;
	else cout << "No" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mod 1000000007
main()
{
    ll n,i,x,y,d,ans=0;
    cin>>n>>d;
    d=d*d;
    for(i=1;i<=n;i++)
    {
        cin>>x>>y;
        if(x*x+y*y<=d)ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3620
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  if(min(a,b)<=c && c<=max(a,b))cout << "Yes" << endl;
  else cout << "No" << endl;
return 0;}

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

using namespace std;

const int N = 10000;

int ten[6] = {1, 10, 100, 1000, 10000, 100000};

int getDigits(int a){
  if(a == 0) return 1;
  int res = 0;
  while(a != 0){
    res++;
    a /= 10;
  }
  return res;
}

int calc(int a, int b){
  int d = getDigits(b);
  return a * ten[d] + b;
}

main(){
  int n;
  int data[N+1];
  fill(data, data+N+1, 0);
  cin >> n;
  vector<int> vec;
  for(int i=0;i<n;i++){
    int in;
    cin >> in;
    assert(in <= ten[4]);
    assert(data[in] == 0);
    data[in]++;
    vec.push_back(in);
  }
  //int cnt = 0;
  /*for(int i=0;cnt<n&&cnt<4&&i<=N;i++){
    for(int j=0;cnt<n&&cnt<4&&j<data[i];j++){
      vec.push_back(i); cnt++;
    }
    }*/
  //for(int i=0;i<vec.size();i++) cout << vec[i] << ' '; cout << endl;
  //vector<int> ans;
  int m[3] = {200000000, 200000000, 200000000};
  for(int i=0;i<vec.size();i++){
    for(int j=0;j<vec.size();j++){
      if(i == j) continue;
      //ans.push_back(calc(vec[i], vec[j]));
      int t = calc(vec[i], vec[j]);
      if(t < m[0]){ m[2] = m[1]; m[1] = m[0]; m[0] = t; }
      else if(t < m[1]){ m[2] = m[1]; m[1] = t; }
      else if(t < m[2]){ m[2] = t; }
    }
  }
  //for(int i=0;i<ans.size();i++) cout << ans[i] << ' '; cout << endl;
  //sort(ans.begin(), ans.end());
  //cout << ans[2] << endl;
  cout << m[2] << endl;
}

Measured memory_bytes: 1316
def solve(n, x, y):
    ws = []
    S = set()
    for i in range(n):
        u = x[i] + y[i]
        v = x[i] - y[i]
        S.add(u % 2)
        if len(S) > 1:
            print(-1)
            return
        ds = [2**k for k in range(30, -1, -1)]
        if u % 2 == 0:
            ds.append(1)
        w = ""
        for d in ds:
            if (u >= 0) and (v >= 0):
                w += "R"
                u, v = u-d, v-d
            elif (u <= 0) and (v <= 0):
                w += "L"
                u, v = u+d, v+d
            elif (u >= 0) and (v <= 0):
                w += "U"
                u, v = u-d, v+d
            else: # (u < 0) and (v > 0)
                w += "D"
                u, v = u+d, v-d
        ws.append(w)
    print(len(ds)) # m
    print(" ".join(map(str, ds)))
    print("\n".join(ws))

n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
    x[i], y[i] = map(int, input().split())
solve(n, x, y)

Measured memory_bytes: 3316
// DP approach

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
using namespace std;
#define Fio                           \
    ios_base::sync_with_stdio(false); \
    cin.tie(nullptr);                 \
    cout.tie(nullptr)
#define f(i, n) for (long long int i = 0; i < n; i++)
#define ll long long int
#define fo(i, a, b) for (long long int i = a; i <= b; i++)
#define w(t)  \
    int t;    \
    cin >> t; \
    while (t--)
#define vi vector<int>
#define vl vector<long long int>
#define vvi vector<vector<int>>
#define vvl vector<vector<long long int>>
#define mii map<int, int>
#define umii unordered_map<int, int>
#define mll map<ll,ll>
#define umll unordered_map<ll,ll>
#define newl cout<<"\n"
#define pb push_back
#define mp make_pair
#define fi first
#define se second
const ll inf = 1e9 + 7;
const ll modc = 998244353;
#define MAX 200002

ll maxi(ll a,ll b){
	if(a>=b)return a;
	return b;
}

ll mini(ll a,ll b){
	if(a>=b)return b;
	return a;
}


ll binpow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res%inf * a%inf)%inf;
        a = (a%inf * a%inf)%inf;
        b >>= 1;
    }
    return res;
}

int main(){
    Fio;
    ll n;
    cin>>n;
    ll a = binpow(10,n),b = 2*(binpow(9,n)%inf)%inf,c = binpow(8,n); 
    cout<<(inf+a-b+c)%inf;
    return 0;
}

Measured memory_bytes: 3700
s = int(input())
ls = [s]
n = s
t = 0
while True:
    if n % 2 == 0:
        if (n/2) in ls:
            print(t+2)
            break
        ls.append(n/2)
        n = (n/2)
    else:
        if (3*n+1) in ls:
            print(t+2)
            break
        ls.append(3*n+1)
        n = (3*n+1)
    t += 1

Measured memory_bytes: 3060
n,k = map(int,input().split())
s = [" "]+list(input())+[" "]
tar = now = s[1]
cnt = 0
for i in range(1,n+1):
    if now != s[i]:
        now = s[i]
        if now != tar: cnt += 1
    if cnt > k: break
    s[i] = tar
ans = 0
for i in range(1,n+1):
    if s[i] == "L" and s[i-1] == "L": ans += 1
    if s[i] == "R" and s[i+1] == "R": ans += 1
print(ans)

Measured memory_bytes: 10544
import qualified Data.ByteString.Char8 as B
import Data.List
import qualified Data.Vector.Unboxed as V
import qualified Data.Vector.Unboxed.Mutable as MV
import Data.Monoid((<>))
import Data.Function hiding ((&))
import Data.Graph as G
import Data.Array
import Debug.Trace

(&) :: a -> (a -> b) -> b
(&) a b = b a

infixl 1 &

readIntPair :: B.ByteString -> (Int,Int)
readIntPair s = p
    where
    Just p = do
        (n1, s') <- B.readInt s
        (n2, _ ) <- B.readInt (B.tail s')
        return (n1,n2)

main :: IO ()
main = do
    (n,m) <- fmap readIntPair B.getLine
    es <- fmap (map readIntPair . B.lines) B.getContents
    let g = G.buildG (1, n) es
    dp <- MV.replicate n (-1)
    let go :: Int -> IO Int
        go v = memoize (v-1) $ do
                let nexts = g ! v
                ds <- mapM go (g ! v) 
                pure $ 1 + maximum (-1:ds)
        memoize key action = do
            d <- MV.read dp key
            if d >= 0 
                then pure d
                else do 
                    r <- action
                    MV.write dp key r
                    pure r
    ans <- fmap maximum $ mapM go [1..n]
    print ans
    


Measured memory_bytes: 17788
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

n=ip()
m=ip()
ans=0
for i in range(len(n)):
    if(n[i]!=m[i]):
        ans+=1
print(ans)    

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

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

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

int main()

{ 
ios_base::sync_with_stdio(false);

cin.tie(NULL);
ll n,k;
cin>>n>>k;
vi v(k);
forn(i,k) cin>>v[i];
while(1)
{
   ll u=n;
   ll found=1;
   while(u)
   {
       ll j=u%10;
       if(find(v.begin(),v.end(),j)!=v.end())
       {
           found=0;
           break;
       }
       u/=10;
   }
   if(found==0)
   {
       n++;
   }
    else {
        cout<<n;
        return 0;
    }
}

return 0;

}


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

const double PI = acos(-1);
const double EPS = 1e-15;
using ll = long long;
using ull = unsigned long long;
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9+7;
const ll MOD1 = 998244353;
typedef pair<ll,ll> P;

#define rep(i,a,b) for (int i = (a); i < (b); i++)
#define rrep(i,a,b) for (int i = (a); i >= (b); i--)
#define REP(i,n) rep(i,0,n)
#define RREP(i,n) rrep(i,n,0)
#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
//#define mp make_pair

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b;
  cin >> a >> b;
  cout << ((a * b)%2? "Odd":"Even") << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
const ll INF = 1LL<<60;
const ll MOD = 1e9+7;


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll a,b,c,k;cin>>a>>b>>c>>k;
    cout<<(a-b)*(1-k%2*2)<<endl;

    return 0;
}

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

typedef long long ll;
int x[101], y[101], h[101];

int main() {
    int n;
    cin >> n;
    tuple<ll, ll, ll> G = make_tuple(-1, -1, -1);
    for(int i=0; i<n; i++){
        cin >> x[i] >> y[i] >> h[i];
        if(h[i] >= 1) G = make_tuple(x[i], y[i], h[i]);
    }

    for(ll cx=0; cx<=100; cx++){
        for(ll cy=0; cy<=100; cy++){
            ll pred_h = get<2>(G) + abs(get<0>(G) - cx) + abs(get<1>(G) - cy);
            pred_h = max(pred_h, 0LL);
            bool flag = true;
            for(int i=0; i<n; i++){
                ll res = max(pred_h - abs(x[i] - cx) - abs(y[i] - cy), 0LL);
                if(h[i] != res) flag = false;
            }
            if(flag){
                cout << cx << " " << cy << " " << pred_h << endl;
                return 0;
            }
        }
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = int_fast64_t;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
struct FenwickTree {
  int N;
  vll bit;
  FenwickTree(int n) : N(n), bit(n+2, 0) {}
  void add(int i, ll a) {
    while(i <= N) {
      chmax(bit[i], a);
      i += (i & -i);
    }
  }
  ll sum(int i) {
    ll res = 0;
    while(i > 0) {
      chmax(res, bit[i]);
      i -= (i & -i);
    }
    return res;
  }
  int lower_bound(ll w) {
    int k = 1;
    while(k <= N) k *= 2;
    k /= 2;
    int x = 0;
    while(k > 0) {
      if(x+k <= N && bit[x+k] < w) {
        w -= bit[x+k];
        x += k;
      }
      k /= 2;
    }
    return x+1;
  }
};

void answer() {
  ll n; cin >> n;
  vector<ll> h(n), a(n);
  rep(i, n) cin >> h[i];
  rep(i, n) cin >> a[i];
  FenwickTree ft(n);
  ll maxv = 0;
  rep(i, n) {
    ll cur = ft.sum(h[i]-1) + a[i];
    ft.add(h[i], cur);
    chmax(maxv, cur);
  }
  cout << maxv << "\n";
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,p[10005],d1[10005],d2[10005],sum[10005];
  int max[55],max2[55],j=0;
  cin>>n;
  while(n!=0){
    max2[j]=0;
    for(int i=0;i<n;i++){
      cin>>p[i]>>d1[i]>>d2[i];
      sum[i]=d1[i]+d2[i];
      if(sum[i]>max2[j]){
	max2[j]=sum[i];
	max[j]=p[i];
      }
    }
    j++;
    cin>>n;
  }
  for(int i=0;i<j;i++){
    cout<<max[i]<<" "<<max2[i]<<"\n";
  }
  return 0;
}



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

#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define all(v) v.begin(),v.end()

bool solve(int N, int A, int B) {
    vector<int> As, Bs;
    if(A > N) return false;
    As.push_back(A);
    int sum = A;
    int nxt_a = A;
    int nxt_b = B - 1;    
    while(sum < N) {
        if(nxt_a == 0 and nxt_b == 0) return false;
        {
            int left = N - sum;
            int v = min(nxt_b, left);
            if(v > 0) {
                Bs.push_back(v);
                sum += v;
                nxt_a--;
            }
        }
        {
            int left = N - sum;        
            int v = min(nxt_a, left);
            if(v > 0) {
                As.push_back(v);
                sum += v;
                nxt_b--;
            }
        }
    }
    if(B > 1 and Bs.size() == 0) return false;
    if(B > 1 and Bs[0] != B - 1) return false;
    if(As.size() > B or Bs.size() > A) return false;
    vector<int> ans;
    int l = 1, r = N;
    rep(i, max(As.size(), Bs.size())) {
        if(i < As.size()) {
            for(int a = l + As[i] - 1; a >= l; a--) ans.push_back(a);
            l += As[i];
        }
        if(i < Bs.size()) {
            for(int b = r - Bs[i] + 1; b <= r; b++) ans.push_back(b);
            r -= Bs[i];
        }
    }
    reverse(all(ans));
    rep(i, ans.size()) {
        cout << ans[i] << (i == ans.size() - 1 ? "\n" : " ");
    }
    return true;
}

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

    int N, A, B; cin >> N >> A >> B;    

    if(not solve(N, A, B)) cout << -1 << endl;
    
    return 0;
}


Measured memory_bytes: 3440
#include <stdio.h>

int main()
{
  int i, r, tmp, x, y;

  scanf("%d%d",&x,&y);

  if(x < y) {
    tmp = x;
    x = y;
    y = tmp;
  }
  while(y > 0) {
    r = x % y;
    x = y;
    y = r;
  }
    
  printf("%d\n",x);

  return 0;
}




Measured memory_bytes: 2144
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    sort(all(s));
    if (s == "abc")
        cout << "Yes";
    else
        cout << "No";
}


Measured memory_bytes: 256
s=int(input())
def f(n):
    if n%2==0:
        return n//2
    else:
        return 3*n+1
cnt = 2
while True:
    if s in [1, 2, 4]:
        print(4)
        break
    s = f(s)
    if s == 4:
        print(cnt+3)
        break
    cnt+=1

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;

int main() {
    int A, B, C, X, Y;
    cin >> A >> B >> C >> X >> Y;
    int c1 = A*X+B*Y;
    int c2 = max(X,Y)*C*2;
    int c3;
    if(X>Y) c3=Y*C*2+(X-Y)*A;
    else c3=X*C*2+(Y-X)*B;
    cout << min({c1,c2,c3}) << endl;
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,w,i;
	cin>>n>>w;
	int wt[n],val[n];
	for(i=0;i<n;i++)
	{
		cin>>wt[i]>>val[i];
	}
	long long int dp[n+1][w+1];
	for(i=0;i<=n;i++)
	{
		for(int j=0;j<=w;j++)
		{
			if(i==0 || j==0)
				dp[i][j]=0;
			else if(wt[i-1]<=j)
				dp[i][j]=max(val[i-1]+dp[i-1][j-wt[i-1]],dp[i-1][j]);
			else
				dp[i][j]=dp[i-1][j];
		}
	}
	cout<<dp[n][w];
	return 0;
}

Measured memory_bytes: 82312
#include <stdio.h>

int main(void) {
    int numA;
    int numB;
    int numC;

  if(scanf("%d%d%d", &numA, &numB, &numC)!=1){
    
    if(numA==numB && numA==numC){
        printf("No");
    }else if(numA!=numB && numA!=numC && numB!=numC){
        printf("No");
    }else{
        printf("Yes");
    }
  }
    
    return 0;
}



Measured memory_bytes: 128
a = int(input())

if 400 <= a < 600:
  print(8)
elif 600 <= a < 800:
  print(7)
elif 800 <= a < 1000:
  print(6)
elif 1000 <= a < 1200:
  print(5)
elif 1200 <= a < 1400:
  print(4)
elif 1400<= a < 1600:
  print(3)
elif 1600 <= a < 1800:
  print(2)
elif 1800 <= a < 2000:
  print(1)

Measured memory_bytes: 9188
fun main(arr: Array<String>) {
    val n = readLine()!!.toInt()
    println(if(getAns(n)) "1" else "0")
}

val sinamono = (100..105).toList()

val dic = mutableMapOf<Int, Boolean>()
fun getAns(remain:Int):Boolean {
    if(remain % 100 == 0) {
        return true
    }
    if(remain < 100) {
        return false
    }

    dic[remain]?.let { return it }
    var ans = false
    if(remain % 100 >= 5) {
        ans = getAns(remain - 105)
    }
    if(remain % 100 >= 4) {
        ans = ans || getAns(remain - 104)
    }
    if(remain % 100 >= 3) {
        ans = ans || getAns(remain - 103)
    }
    if(remain % 100 >= 2) {
        ans = ans || getAns(remain - 102)
    }
    if(remain % 100 >= 1) {
        ans = ans || getAns(remain - 101)
    }
    dic[remain] = ans
    return ans
}

Measured memory_bytes: 35508
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
cnt=0
for i in range(n):
    if a[i]!=b[i]:
        cnt+=1
    if cnt==3:
        print("NO")
        exit()
if cnt==1:
    print("NO")
else:
    print("YES")

Measured memory_bytes: 38384
#include <iostream>  
#include <cstdio>  
#include <algorithm>  
#define F first  
#define S second  
  
using namespace std;  
  
typedef long long ll;  
  
ll n;  
pair<ll, ll> a[100005];  
ll ans;  
  
int main()  
{  
    scanf("%lld", &n);  
    for(ll i = 0; i < n; i++)  
    {  
        scanf("%lld", &a[i].F);  
        a[i].S = i;  
    }  
    sort(a, a + n);  
    for(ll i = 0; i < n; i++)  
    {  
        if(i % 2 != a[i].S % 2) ans++;  
    }  
    cout<<ans / 2<<endl;  
    return 0;  
}  



Measured memory_bytes: 1792
#include <stdio.h>

int main(void)
{
  int a, b;
  int r;
  int ans=0;
  int arr[5];

  scanf("%d %d", &a, &b);

  for (int i=a; i <= b; i++) {
    r = i;
    for (int j=0; j < 5; j++) {
      arr[j] = r%10;
      r /= 10;
    }
    if (arr[0] == arr[4] && arr[1] == arr[3]) {ans++;}

  }
  printf("%d\n", ans);
  return 0;
}


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

using namespace std;

const int N = 1e5+7;
const int MOD = 1e9+7;
typedef pair<int, int> pii;

template <int _MOD> struct Mint
{
    int v = 0;
    Mint() {}
    Mint(int _v) : v((_v%_MOD+_MOD)%_MOD) {}
    Mint(long long _v) : v(static_cast<int>((_v%_MOD+_MOD)%_MOD)) {}
    Mint operator = (const int &_v) { return *this = Mint(_v); }
    Mint operator = (const long long &_v) { return *this = Mint(_v); }
    bool operator ! () const { return !this->v; }
    bool operator < (const Mint &b) const { return v < b.v; }
    bool operator > (const Mint &b) const { return v > b.v; }
    bool operator == (const Mint &b) const { return v == b.v; }
    bool operator != (const Mint &b) const { return v != b.v; }
    bool operator <= (const Mint &b) const { return v < b.v || v == b.v; }
    bool operator >= (const Mint &b) const { return v > b.v || v == b.v; }
    Mint operator + (const Mint &b) const { return Mint(v+b.v); }
    Mint operator - (const Mint &b) const { return Mint(v-b.v); }
    Mint operator * (const Mint &b) const { return Mint(1ll*v*b.v); }
    Mint operator / (const Mint &b) const { return Mint(b.inv()*v); }
    Mint& operator += (const Mint &b) { return *this = *this+b; }
    Mint& operator -= (const Mint &b) { return *this = *this-b; }
    Mint& operator *= (const Mint &b) { return *this = *this*b; }
    Mint& operator /= (const Mint &b) { return *this = *this/b; }
    Mint operator - () const { return Mint(-v); }
    Mint& operator ++ () { return *this += 1; }
    Mint& operator -- () { return *this -= 1; }
    Mint operator ++ (int) { Mint tmp = *this; *this += 1; return tmp; }
    Mint operator -- (int) { Mint tmp = *this; *this -= 1; return tmp; }
    Mint pow(int p) const {
        Mint res(1), x(*this);
        while (p) {
            if (p&1) res = res*x;
            x *= x;
            p >>= 1;
        }
        return res;
    }
    Mint inv() const { return pow(_MOD-2); }
    friend istream& operator >> (istream &is, Mint &mt) { return is >> mt.v; }
    friend ostream& operator << (ostream &os, const Mint &mt) { return os << mt.v; }
};
using mint = Mint<MOD>;

int n, k;
int a[N];
mint A[N], C[N], sum[N];

inline void init()
{
    // A[i] = i!, C[i] = C_i^(k-2)
    A[0] = 1;
    for (int i = 1; i <= n; ++i) A[i] = A[i-1]*i;
    for (int i = k-2; i <= n-2; ++i) {
        C[i] = A[i]/A[k-2]/A[i-k+2];
        sum[i] = sum[i-1]+C[i];
    }
}

inline void solve()
{
    cin >> n >> k;
    for (int i = 1; i <= n; ++i) cin >> a[i];

    if (k == 1) { cout << 0 << endl; return; }
    init();
    sort(a+1, a+n+1);
    mint res = 0;
    for (int i = 2; i <= n; ++i)
        res += sum[i-2]*a[i];
    for (int i = 1; i < n; ++i)
        res -= sum[n-i-1]*a[i];
    cout << res << endl;
}

int main()
{
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int T = 1;
    while (T--) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 1792
from collections import deque


H, W = map(int, input().split())
m = [[0 if c == '#' else 3000 for c in input()] for _ in range(H)]
queue = deque()
for i, r in enumerate(m):
    for j, n in enumerate(r):
        if n == 0:
            queue.append((i, j))
while queue:
    p, q = queue.popleft()
    if 0 < p and m[p - 1][q] > m[p][q] + 1:
        m[p - 1][q] = m[p][q] + 1
        queue.append((p - 1, q))
    if 0 < q and m[p][q - 1] > m[p][q] + 1:
        m[p][q - 1] = m[p][q] + 1
        queue.append((p, q - 1))
    if p < H - 1 and m[p + 1][q] > m[p][q] + 1:
        m[p + 1][q] = m[p][q] + 1
        queue.append((p + 1, q))
    if q < W - 1 and m[p][q + 1] > m[p][q] + 1:
        m[p][q + 1] = m[p][q] + 1
        queue.append((p, q + 1))
_max = 0
for r in m:
    _max = max(_max, max(r))
print(_max)


Measured memory_bytes: 104156
import java.util.*;


class Main {
    public static void main(String[] args) {
   		Scanner sc=new Scanner(System.in);
   		int a=sc.nextInt(),b=sc.nextInt();
   		if(a<=8&&b<=8)System.out.println("Yay!");
   		else System.out.println(":(");
   		sc.close();
    }
}

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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

struct P
{
	int q, i, ans;
	P() :P(0,0,0) {}
	P(int q, int i, int ans) :q(q), i(i), ans(ans) {}
};

int A[100010];
P Q[100010];

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

	int N, M,q;
	int s = 0;
	cin >> N >> M;
	rep(i, 0, N)
	{
		cin >> A[i];
		if (N / 2 <= i)
		{
			s += A[i];
		}
	}
	rep(i, 0, M)
	{
		cin >> q;
		Q[i] = P(q, i, 0);
	}

	sort(Q, Q + M, [](const P& a, const P& b) {return a.q < b.q; });

	int l, r;
	if (N % 2 == 1)
	{
		l = 0;
		r = N / 2;
	}
	else
	{
		l = 1;
		r = N / 2;
	}

	int qi = 0;
	while (l < r)
	{
		int x = (A[r] + A[l]) / 2;
		while (qi < M&&Q[qi].q <= x)
		{
			Q[qi].ans = s;
			qi++;
		}
		s -= A[r] - A[l];
		l += 2;
		r++;
	}
	while (qi < M)
	{
		Q[qi].ans = s;
		qi++;
	}

	sort(Q, Q + M, [](const P& a, const P& b) {return a.i < b.i; });

	rep(i,0,M)
	{
		cout << Q[i].ans << endl;
	}

	return 0;
}

Measured memory_bytes: 4864
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
const ll MOD = 998244353;
int main() {
  int n, s;
  cin >> n >> s;
  vector<ll> a(n);
  for(int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<vector<ll>> dp(n + 5, vector<ll>(10000, 0));
  dp[0][0] = 1;
  for(int i = 0; i < n; i++) {
    for(int j = 0; j <= s; j++) {
      dp[i + 1][j] += 2 * dp[i][j];
      dp[i + 1][j] %= MOD;
      if(j + a[i] <= s) {
        dp[i + 1][j + a[i]] += dp[i][j];
        dp[i + 1][j + a[i]] %= MOD;
      }
    }
  }
  cout << dp[n][s] << endl;
  return 0;
}

Measured memory_bytes: 238160
#include <bits/stdc++.h>
#include <tr2/dynamic_bitset>

std::tr2::dynamic_bitset<> f, t;
int a[2001], n, sum;

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::cout.tie(NULL);
    f.resize(1, 1);
    std::cin >> n;
    for (int i = 1; i <= n; i++) {
        std::cin >> a[i];
        sum += a[i];
        f.resize(f.size() + a[i], 0);
        t = f;
        t <<= a[i];
        f |= t;
    }
    int i = (sum + 1) >> 1;
    for (; !f.test(i); i++)
        ;
    std::cout << i;
}

Measured memory_bytes: 2572
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef std::vector<vector<int> > vvi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pi> vpi;
#define debugone(x) cerr << #x << " " << x << "\n"; cerr.flush();
#define debugtwo(x) cerr << #x << "-------------" << "\n";for(auto &it: x) cerr << it << " ";cerr << "\n"; cerr.flush();
#define debugthree(x, i, j) cerr << #x << "------------" << "\n";cerr << "from " << i << " to " << j << "\n";for(ll k=i; k<=j; k++) cerr << x[k] << " ";cerr << "\n"; cerr.flush();
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
 
const ll mod = 1e9 + 7;
const ll inf = 1e11 + 5;
const int MaxN = 2e5 + 5;

int maxFrontMatch[MaxN], maxBackMatch[MaxN];

void findMaxFrontMatch(string &s, string &t){
	int n = (int)(s.length()), m = (int)(t.length());
	// vi res(n);
	if(s[1] == t[1]){
		maxFrontMatch[1] = 1;
	}
	else maxFrontMatch[1] = 0;

	int s_i = 1;
	while(s_i <= n){
		int m_i = maxFrontMatch[s_i - 1] + 1;
		if(m_i <= m){
			if(t[m_i] == s[s_i]){
				maxFrontMatch[s_i] = m_i;
			}
			else{
				maxFrontMatch[s_i] = m_i - 1;
			}
		}
		else{
			maxFrontMatch[s_i] = m_i - 1;
		}
		s_i++;
	}
	// return res;
}

void findMaxBackMatch(string &s, string &t){
	int n = (int)(s.length());
	int m = (int)(t.length());
	
	// vi maxBackMatch(n);
	if(s[n - 1] == t[m - 1]){
		maxBackMatch[n - 1] = m - 1;
	}
	else maxBackMatch[n - 1] = m;

	int si = n - 2;
	while(si >= 1){
		int mi = maxBackMatch[si + 1] - 1;
		if(mi >= 1){
			if(t[mi] == s[si]){
				maxBackMatch[si] = mi;
			}
			else{
				maxBackMatch[si] = mi + 1;
			}
		}
		else{
			maxBackMatch[si] = mi + 1;
		}
		si--;
	}

	// return maxBackMatch;
}

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

	int k, x;
	const int maxi = 1000000, mini = -1000000;
	cin >> k >> x;
	int start = max(mini, x - k + 1);
	for(int i = start; i < x; i++){
		cout << i << " ";
	}
  	cout << x << " ";
	for(int i = 1; x + i <= maxi && i <= k - 1; i++){
		cout << x + i << " ";
	}

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <memory>

//#define int long long

using namespace std;

void Main()
{
	int n, k;
	cin >> n >> k;

	int ans = 0;
	while (n > 0) {
		n /= k;
		ans++;
	}

	cout << ans << endl;
}

int32_t main()
{
	Main();
	return 0;
}



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

int main() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  
  long long count = 0;
  long long left = 0, right = N - 1;
  
  while (left < right){
    bool flag1 = false, flag2 = false;
    if (S[left] == 'W') flag1 = true;
    else left++;
    if (S[right] == 'R') flag2 = true;
    else right--;
    if (flag1 == true && flag2 == true){
      count++;
      left++;
      right--;
    }
  }
  
  cout << count << endl;
}

Measured memory_bytes: 3716
#include <iostream>

using namespace std;

int main()
{
    long long A, B, C, K;
    cin >> A >> B >> C >> K;

    if (A - K > 0)
    {
        std::cout << K << std::endl;
    }
    else if ((A - K == 0) || (A + B - K >= 0))
    {
        std::cout << A << std::endl;
    }
    else if (A + B - K < 0)
    {
        std::cout << A - (K - A - B) << std::endl;
    }
}

Measured memory_bytes: 3636
import java.util.*;
import java.io.*;
 
import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
 
public class Main{
    static final long mod=1000000007;
    
    public  static void main(String[] args)   throws Exception, IOException{
        Reader sc = new Reader(System.in);
        PrintWriter out=new PrintWriter(System.out);
        // int n=sc.nextInt();
        // char c[][] = new char[h][w];
        // char c[]=sc.nextString().toCharArray();
        // for(int i=0; i<n; i++) {d[i]=sc.nextInt();}

        int n=sc.nextInt();
        String ans="No";
        for (int i=0; i<=n; i+=7) {
            if(i==n || (n-i)%4==0)ans="Yes";
        }

        out.println(ans);
        out.flush();
    }


    static void db(Object... os){
        System.err.println(Arrays.deepToString(os));
    }  
}

class P implements Comparable<P>{
    int id, d;
    P(int  id, int d) {
        this.id=id;
        this.d=d;
    }
    public int compareTo(P p){
        return d-p.d; //des
    }
}

class Reader
{ 
    private BufferedReader x;
    private StringTokenizer st;
    
    public Reader(InputStream in)
    {
        x = new BufferedReader(new InputStreamReader(in));
        st = null;
    }
    public String nextString() throws IOException
    {
        while( st==null || !st.hasMoreTokens() )
            st = new StringTokenizer(x.readLine());
        return st.nextToken();
    }
    public int nextInt() throws IOException
    {
        return Integer.parseInt(nextString());
    }
    public long nextLong() throws IOException
    {
        return Long.parseLong(nextString());
    }
    public double nextDouble() throws IOException
    {
        return Double.parseDouble(nextString());
    }
}

Measured memory_bytes: 21460
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
using ll = long long;
using P = pair<int,int>;
void Yes() {
    cout << "Yes" << endl;
}
void No() {
    cout << "No" << endl;
}
int main(void) {
    int x, t; cin >> x >> t;
    cout << max(0, x - t);
}


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

int main(){
    int n ,m;
    cin >> n >> m;
    vector<ll> h(n);
    vector<bool> ok(n, true);
    for (int i = 0; i < n; ++i) cin >> h[i];

    for (int i = 0; i < m; ++i){
        ll a, b;
        cin >> a >> b;

        a -= 1; b -= 1;
        // --a; --b;
        if (h[a] < h[b]) ok[a] = false;
        else if (h[b] < h[a]) ok[b] = false;
        else{
            ok[a] = false;
            ok[b] = false;
        }
    }
    ll ans = 0;
    for (int i = 0; i < n; ++i){
        if (ok[i] == true) ans += 1;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4056
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*
cout<<setprecision(20)
cin.tie(0);
ios::sync_with_stdio(false);
*/
const llint mod=998244353;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int main(void){
	int n,ans=0;cin>>n;
	while(n--){int a;cin>>a;ans+=a;ans--;}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
// #include <atcoder/all>
#define ll long long int
#define ld long double
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, n) for (ll i = 1; i < (ll)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
// using namespace atcoder;



void Main()
{
    ll n;
    cin >> n;
    vector<ll> X(n), Y(n);
    rep(i, n) cin >> X[i] >> Y[i];
    
    rep(i, n-1) {
        if ((X[i] + Y[i] + (ll)1e10) % 2 != (X[i+1] + Y[i+1] + (ll)1e10) % 2) {
            put(-1);
            return;
        }
    }
    
    bool odd = (X[0] + Y[0] + (ll)1e10) % 2 == 0;
    vector<ll> d;
    if (odd) {
        d.push_back(1);
    }
    d.push_back(1);
    repi(i, 38) {
        ll di = 2 * d[d.size() - 1];
        if (di > 1e12) {
            break;
        }
        d.push_back(di);
    }
    put(d.size());
    rep(i, d.size()) cout << d[i] << (i == d.size() - 1 ? "" : " ");
    cout << endl;

    // 計算に使わないので消す
    if (odd) {
        d.erase(d.begin(), d.begin() + 1);
    }

    rep(i, n) {
        ll tx = X[i], ty = Y[i];

        string prefix = "";
        if (odd) {
            prefix = "L";
            tx++;
        }

        string res = "";
        for (int i = d.size() - 1; i >= 0; i--) {
            if (tx < ty && -tx < ty) {
                res = "U" + res;
                ty -= d[i];
            }
            else if (tx > ty && -tx < ty) {
                res = "R" + res;
                tx -= d[i];
            }
            else if (tx > ty && -tx > ty) {
                res = "D" + res;
                ty += d[i];
            }
            else if (tx < ty && -tx > ty) {
                res = "L" + res;
                tx += d[i];
            }
        }
        res = prefix + res;

        put(res);


        // ll x = 0, y = 0;
        // rep (i, res.size()) {
        //     ll di = d[i];
        //     if (odd) {
        //         di = i == 0 ? 1 : d[i - 1];
        //     }
        //     if (res[i] == 'U') {
        //         y += di;
        //     }
        //     if (res[i] == 'D') {
        //         y -= di;
        //     }
        //     if (res[i] == 'L') {
        //         x -= di;
        //     }
        //     if (res[i] == 'R') {
        //         x += di;
        //     }
        // }
        // if (x != X[i] || y != Y[i]) {
        //     put("fail")
        // }
    }


}
signed main(){ Main();return 0;}

Measured memory_bytes: 3632