akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<stdint.h>
#include<inttypes.h>

int main(void)
{
    int_fast32_t stack[100];
    int_fast8_t  index = 0 ;
    char         element[8];

    scanf("%"SCNdFAST32, &stack[index]);
    ++index;
    scanf("%"SCNdFAST32, &stack[index]);
    ++index;

    while(EOF != scanf(" %s", element))
        if      ('+' == element[0]){
            --index;
            stack[index-1] += stack[index];
        }else if('-' == element[0]){
            --index;
            stack[index-1] -= stack[index];
        }else if('*' == element[0]){
            --index;
            stack[index-1] *= stack[index];
        }else                      {
            sscanf(element, "%"SCNdFAST32, &stack[index]);
            ++index;
        }

    printf("%"PRIdFAST32"\n", stack[0]);

    return 0;
}

Measured memory_bytes: 1836
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))

typedef long long ll;
typedef __int128_t lll;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
void dout(double d){printf("%.12f\n",d);}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5+1;
int n, k;
V<int> a;
bool DP[N];
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> k;
  FOR(i, 0, n){
    int aa;
    cin >> aa;
    a.pb(aa);
  }
  sort(all(a));
  FOR(i, 1, k+1) for(int j: a){
    if(j > i) break;
    if(!DP[i-j]){
      DP[i] = true;
      break;
    }
  }
  cout << (DP[k] ? "First" : "Second") << endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll; 
typedef pair<int, int> pii; 
typedef pair<ll, ll> pll; 
typedef pair<string, string> pss; 
typedef vector<int> vi; 
typedef vector<vi> vvi; 
typedef vector<pii> vii; 
typedef vector<pll> vll; 
typedef vector<ll> vl; 
typedef vector<vl> vvl; 
int main() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout); 
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL) ; cout.tie(NULL);
    int n,x,t;
    cin>>n>>x>>t;
    int count;
    if(n%x==0)count=n/x;
    else count=1+(n/x);
    cout<<count*t<<endl;
    return 0;
}

Measured memory_bytes: 3648
#include<iostream>
#include<string>
#include<vector>

using namespace std;

int main(){
  string s;
  
  while(getline(cin,s)){
    if(s=="END OF INPUT")
      break;
    
    int res=0;
    vector<int> result;
    
    for(int i=0;i<s.length();++i){
      
      if(s[i]==' '){
	cout<<res;
	res=0;
      }
      else
	res++;
    }
    
  cout<<res<<endl;
    
  }
}

Measured memory_bytes: 2980
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  if(a!=b&&b!=c&&c!=a){
    cout<<"3"<<endl;
  }else if(a==b&&b==c){
    cout<<"1"<<endl;
  }else{
    cout<<"2"<<endl;
  }
}

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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
    ll n;cin >>n;
    vector<ll>a(n);
    vector<ll>sum(n+1,0);
    for (int i = 0; i < n; ++i) {
        cin >>a[i];
        sum[i+1]=sum[i]+a[i];
    }
    ll d=INFll;
    for (int i = 1; i <n; ++i) {
        d=min(abs(2*sum[i]-sum[n]),d);
    }
    cout <<d<<endl;
    return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <cstring>
using namespace std;
int main(int argc, char *argv[])
{	int c=0,f=0;
	char a[15];
	cin>>a;
	int n=strlen(a);
	for(int i=0;i<n;i++){
		if(i>1&&i<n-1)
		{if(a[i]=='C')c++;}
	 if(a[i]>='A'&&a[i]<='Z')f++;	
	}
	if(c==1&&f==2&&a[0]=='A')cout<<"AC\n";
	else cout<<"WA\n";	
	return 0;
}

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

int count(int n,int x){
    int m=0;
    for(int i=1;i<=n-2;i++){
        for(int j=i+1;j<=n-1;j++){
            for(int k=j+1;k<=n;k++){
                if(i+j+k==x)m+=1;
            }
        }
    }
    return m;
}

int main(){
    int n,x;
    while(1){
        cin>>n>>x;
        if(n==0&&x==0)break;
        cout<<count(n,x)<<endl;
    }
    return 0;
}


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

const int MAXN = 2010;
char mat[MAXN][MAXN];
bool arr[MAXN][MAXN];
int up[MAXN][MAXN];
int n, m;
int ans;
int st[MAXN], at[MAXN], top;
void pop(int x) {
	ans = std::max((st[top] + 1) * (x - at[top] + 1), ans);
	--top;
}
int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> n >> m; ans = std::max(n, m);
	for (int i = 1; i <= n; ++i) {
		std::cin >> mat[i] + 1;
		for (int j = 1; j <= m; ++j) mat[i][j] = mat[i][j] == '.';
	}
	for (int i = 1; i < n; ++i)
		for (int j = 1; j < m; ++j) {
			arr[i][j] = (mat[i][j] + mat[i][j + 1] + mat[i + 1][j] + mat[i + 1][j + 1]) % 2 == 0;
			up[i][j] = arr[i][j] ? up[i - 1][j] + 1 : 0;
		}
	for (int i = 1; i < n; ++i) {
		for (int j = 1; j < m; ++j) {
			int t = up[i][j], an = j;
			while (t < st[top]) an = std::min(an, at[top]), pop(j);
			if (t != st[top]) st[++top] = t, at[top] = an;
		}
		while (top) pop(m);
	}
	std::cout << ans << std::endl;
	return 0;
}


Measured memory_bytes: 23936
from itertools import *

n,m,q=map(int,input().split())

aaa=[]
for i in range(m):
    aaa.append(i+1)

l=[]
for i in range(q):
    a=list(map(int,input().split()))
    l.append(a)

a=list(combinations_with_replacement(aaa,n))
ans=0
for i in a:
    aa=0
    for j in l:
        if i[j[1]-1]-i[j[0]-1]==j[2]:
            aa+=j[3]
    if aa>ans:
        ans=aa
print(ans)

Measured memory_bytes: 21568
'use strict';
 
function Main(input) {
  const A = Number(input.split(" ")[0])
  const B = Number(input.split(" ")[1])
  const T = Number(input.split(" ")[2])
 
  const time = T + 0.5
  console.log(Math.floor(time / A) * B)
 
};
 
Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());

Measured memory_bytes: 21192
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Kein Yukiyoshi
 */

#include "bits/stdc++.h"
#define int long long
#define rep(i, n)           for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b)        for (int i = (int)(a); i < (int)(b); i++)
#define FOR(i, a)           for (auto &i : a)
#define ALL(obj)            begin(obj), end(obj)
#define MAX(x)              *max_element(ALL(x))
#define MIN(x)              *min_element(ALL(x))
#define SUM(x)              accumulate(ALL(x), 0LL)
#define LOWER_BOUND(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define UPPER_BOUND(A, key) distance(A.begin(), upper_bound(ALL(A), key))

using namespace std;
const int MOD    = (int)(1e9 + 7);
const int INF    = (int)(1e13 + 7);
const double EPS = 1e-14;
const double PI  = acos(-1);

int CEIL(int a, int b) { return (a >= 0 ? (a + (b - 1)) / b : (a - (b - 1)) / b); } //ceil() for int
int mod(int a, int b) { return a >= 0 ? a % b : a - (b * CEIL(a, b)); }             //always return positive num
int bpm(int a, int b) {                                                             //return x^y in order(log(y))
  int res = 1;
  for (a %= MOD; b; a = a * a % MOD, b >>= 1)
    if (b & 1) res = res * a % MOD;
  return res;
}

class ALphabet {
public:
  static void solve(istream &cin, ostream &cout) {
    char a;
    cin >> a;
    string temp1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    FOR(i, temp1) {
      if (i == a) {
        cout << "A" << endl;
        return;
      }
    }
    cout << 'a' << endl;
  }
};


signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
  ALphabet solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}


Measured memory_bytes: 3584
#include<bits/stdc++.h>
#define ll long long
#define loop(a,b) for(ll i=a;i<b;i++)
#define iloop(a,b) for(int i=a;i<b;i++)
#define it(c) for(auto it=c.begin();it!=c.end();it++)
#define M 1000000007

using namespace std;

void Thai_Jase() {
    ll n;
    cin>>n;
    ll a[n],sum=0,ans=0;
    loop(0,n) {
        cin>>a[i];
        sum+=a[i];
    }
    for(ll i=0;i<n-1;i++) {
        ll temp=(sum-a[i])%M;
        ans+=(a[i]*temp)%M;
        sum-=a[i];
    }
    cout<<ans%M;
}

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

    int ts=1;
    while(ts--) {
      Thai_Jase();
    }
    return 0;
}

Measured memory_bytes: 5168
from collections import deque

H, W = map(int, input().split())
S = tuple(map(lambda x:int(x)-1, input().split()))
G = tuple(map(lambda x:int(x)-1, input().split()))
field = []
for _ in range(H):
    field.append(input())

cost = [[-1] * W for _ in range(H)]

def can_go(pos):
    if pos[0] >= 0 and pos[0] < H and pos[1] >= 0 and pos[1] < W:
        if field[pos[0]][pos[1]] == '.' and cost[pos[0]][pos[1]] == -1:
            return True
        else:
            return False
    else:
        return False

def recursive_walk(pos):
    dests = set()
    stack = [pos]
    while stack:
        pos = stack.pop()
        if pos in dests:
            continue
        dests.add(pos)
        stack += walk(pos)
    return dests

def walk(pos):
    dests = []
    for d in [(0, 1), (0, -1), (1, 0), (-1, 0)]:
        new_pos = (pos[0]+d[0], pos[1]+d[1])
        if can_go(new_pos):
            dests.append(new_pos)
    return dests

def warp(pos):
    dests = []
    for dy in range(-2, 3):
        for dx in range(-2, 3):
            new_pos = (pos[0]+dy, pos[1]+dx)
            if can_go(new_pos):
                dests.append(new_pos)
    return dests

q = deque()
q.append([S, 0])

while q:
    pos, c = q.popleft()
    if cost[pos[0]][pos[1]] != -1:
        continue
    cost[pos[0]][pos[1]] = c
    if pos == G:
        break
    warp_from = [pos]
    for dest in recursive_walk(pos):
        if cost[dest[0]][dest[1]] == -1:
            cost[dest[0]][dest[1]] = c
            warp_from.append(dest)
    warp_to = set()
    for fr in warp_from:
        for dest in warp(fr):
            if cost[dest[0]][dest[1]] == -1:
                warp_to.add(dest)
    for dest in warp_to:
        q.append((dest, c+1))
print(cost[G[0]][G[1]])




Measured memory_bytes: 112028
import math
N, D = map(int, input().split())

l = []

for i in range(N):
    l.append(list(map(int, input().split())))

ans = 0
for i in range(N-1):
    for j in range(i+1, N):
        sumx = 0
        for k in range(D):
            sumx += (l[i][k] - l[j][k]) ** 2
        sum_sqrt = math.sqrt(sumx)
        if sum_sqrt.is_integer():
            ans += 1

print(ans)


Measured memory_bytes: 3064
sx, sy, tx, ty = map(int, input().split())

dx = tx - sx
dy = ty - sy

mx = ["R", "L"]
my = ["U", "D"]

ans = mx[0]*dx + my[0]*dy
ans = ans + mx[1]*dx + my[1]*dy
ans = ans + my[1] + mx[0]*(dx + 1) + my[0]*(dy + 1) + mx[1]
ans = ans + my[0] + mx[1]*(dx + 1) + my[1]*(dy + 1) + mx[0]

print(ans)

Measured memory_bytes: 9092
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000001
using namespace std;

int W,H,changed_W,changed_H;

struct Info{
	void set(int arg_left,int arg_right,int arg_top,int arg_bottom){
		left = arg_left;
		right = arg_right;
		top = arg_top;
		bottom = arg_bottom;
	}
	int left,right,top,bottom;
};

struct Data{
	Data(int arg_row,int arg_col){
		row = arg_row;
		col = arg_col;
	}

	int row,col;
};

bool rangeCheck(int row,int col){
	if(row >= 0 && row <= changed_H-1 && col >= 0 && col <= changed_W-1)return true;
	else{
		return false;
	}
}


int main(){

	int N,x_1,y_1,x_2,y_2,pre,new_num,ans,diff_row[4] = {-1,0,0,1},diff_col[4] = {0,-1,1,0},next_row,next_col;

	int** map = new int*[2050];
	for(int i = 0; i < 2050; i++)map[i] = new int[2050];

	int* code_table_X = new int[1000001];
	int* code_table_Y = new int[1000001];

	Info info[1000];

	vector<int> X,Y;

	while(true){
		scanf("%d %d",&W,&H);
		if(W == 0 && H == 0)break;

		X.clear();
		Y.clear();

		X.push_back(W);
		Y.push_back(H);

		scanf("%d",&N);

		for(int i = 0; i < N; i++){
			scanf("%d %d %d %d",&x_1,&y_1,&x_2,&y_2);
			info[i].set(x_1,x_2,y_2,y_1);
			X.push_back(x_1);
			X.push_back(x_2);
			Y.push_back(y_1);
			Y.push_back(y_2);
		}

		sort(X.begin(),X.end());
		sort(Y.begin(),Y.end());

		new_num = 1;
		pre = X[0];
		if(pre != 0){
			code_table_X[pre] = new_num;
			new_num++;
		}

		for(int i = 1; i < X.size(); i++){
			if(pre == X[i]){
				//Do nothing
			}else{
				code_table_X[X[i]] = new_num;
				new_num++;
			}
			pre = X[i];
		}

		new_num = 1;
		pre = Y[0];
		if(pre != 0){
			code_table_Y[pre] = new_num;
			new_num++;
		}

		for(int i = 1; i < Y.size(); i++){
			if(pre == Y[i]){
				//Do nothing
			}else{
				code_table_Y[Y[i]] = new_num;
				new_num++;
			}
			pre = Y[i];
		}

		for(int i = 0; i < N; i++){
			info[i].set(code_table_X[info[i].left],code_table_X[info[i].right],code_table_Y[info[i].top],code_table_Y[info[i].bottom]);
		}

		changed_W = code_table_X[W];
		changed_H = code_table_Y[H];

		for(int row = 0; row < changed_H; row++){
			for(int col = 0; col < changed_W; col++){
				map[row][col] = 0;
			}
		}

		for(int i = 0; i < N; i++){
			for(int row = info[i].bottom; row < info[i].top; row++){
				for(int col = info[i].left; col < info[i].right;col++)map[row][col] = 1;
			}
		}

		ans = 0;

		for(int row = 0; row < changed_H; row++){
			for(int col = 0; col < changed_W; col++){
				if(map[row][col] == 0){
					map[row][col] = 1;
					ans++;

					queue<Data> Q;

					Q.push(Data(row,col));

					while(!Q.empty()){

						for(int i = 0; i < 4; i++){
							next_row = Q.front().row + diff_row[i];
							next_col = Q.front().col + diff_col[i];

							if(rangeCheck(next_row,next_col) == true && map[next_row][next_col] == 0){
								map[next_row][next_col] = 1;
								Q.push(Data(next_row,next_col));
							}
						}
						Q.pop();
					}
				}
			}
		}

		printf("%d\n",ans);

	}

	return 0;
}

Measured memory_bytes: 12180
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,j,k,x,y,ans=0,curr;
    scanf("%d %d",&n,&k);
  	ans = n+k;
  	if(ans >= 24){
      curr = ans/24;
      printf("%d\n",ans-(24*curr));
  	}
  	else
      printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n, a, b = LI()
    print(min(n * a, b))
    return

#B
def B():
    n, d = LI()
    x = LIR(n)
    a = list(itertools.combinations(range(n), 2))
    ans = 0
    for a1,a2 in a:
        b = 0
        for bi in range(d):
            b += (x[a1][bi] - x[a2][bi])** 2
        if float.is_integer(math.sqrt(b)):
            ans += 1
    print(ans)
    return

#C
def C():
    l, r = LI()
    ans = 2018
    if l // 2019 == r // 2019:
        for i in range(l, r + 1):
            for k in range(i+1, r + 1):
                ans = min(ans, (i * k) % 2019)
        print(ans)
    else:
        print(0)
    return

#D
def D():
    n = II()
    a = LI()
    a = a + [a[0]]
    ans = [0] * n
    x = 0
    for i in range(1, n, 2):
        x = x + a[i + 1] - a[i]
    ans[1] = a[0] - x
    ans[0] = ans[1] + 2 * x
    for i in range(2, n):
        ans[i] = (a[i - 1] - ans[i - 1] // 2) * 2
    print(" ".join(map(str, ans)))

    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    D()


Measured memory_bytes: 81252
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace C
{
    public class Program
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var N = long.Parse(Console.ReadLine());
            var answer = "";
            while (N > 0)
            {
                var div = (N - 1) / 26L;
                var mod = (N - 1) % 26L;
                answer += (char)('a' + mod);
                N = div;
            }
            Console.WriteLine(string.Join("", answer.Reverse()));
        }
    }
}


Measured memory_bytes: 28284
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF LLONG_MAX/10
#define rep(i,n) for(int i=0;i<n;i++)
#define krep(i,k,n,m) for(int i=k;i<n;i+=m)
#define erep(i,k,n) for(int i=k;i<n;i++)
#define mod 1000000007
//最大公約数
int gcd(int s,int b){
    if(b==0)return s;
    return gcd(b,s%b);
}
signed main(){
    int n,k;
    cin>>n>>k;
    pair<int,int> kai[n];
    int ans=0;
    rep(i,n){
        cin>>kai[i].first>>kai[i].second;
    }
    sort(kai,kai+n);
    rep(i,n){
        if(ans+kai[i].second>=k){
            cout<<kai[i].first<<endl;
            return 0;
        }
        ans=ans+kai[i].second;
        
    }
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main(){
  int x,n; int a; cin>>x>>n;
  unordered_map<int,int> mp;
  for(int i=0;i<n;i++) { cin>>a; mp[a]=1;}
  int low,high; low=high=x;
  while(true){
    if(!mp[low]){ cout<<low<<endl; break;}
    else if(!mp[high]){cout<<high<<endl; break;}
    low--; high++;
  }
  return 0;
}

Measured memory_bytes: 3632
import sys

def check(n, a, b) :
    p = [] #plus
    z = [] #zero
    m = [] #minus
    for i in range(n) :
        d = a[i] - b[i]
        if d > 0 :
            p.append(d)
        elif d == 0 :
            z.append(d)
        else :
            m.append(d)

    new_p = sorted(p, reverse=True)

    m_sum = sum(m)
    p_sum = sum(p)

    if p_sum + m_sum < 0 :
        return -1

    if len(p) + len(z) == n :
        return 0

    count = 0
    tmp = 0
    for i, ele in enumerate(new_p) :
        count = count + 1
        tmp = tmp + ele

        if tmp + m_sum >= 0 :
            return (count + len(m))


if __name__ == '__main__' :

    n = int(sys.stdin.readline())
    a = [ int(i) for i in sys.stdin.readline().split( ) ]
    b = [ int(i) for i in sys.stdin.readline().split( ) ]

    print(check(n,a,b))


Measured memory_bytes: 18652
def judge(m, f, r):
    if m == -1 or f == -1:
        return "F"

    total = m + f
    if total >= 80:
        return "A"
    elif 65 <= total < 80:
        return "B"
    elif 50 <= total < 65:
        return "C"
    elif 30 <= total < 50:
        if 50 <= r:
            return "C"
        else:
            return "D"
    else:
        return "F"


while True:
    m, f, r = map(int, input().split())
    if m == f == r == -1:
        break
    else:
        print(judge(m, f, r))




Measured memory_bytes: 5600
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a = sc.nextInt();
		String s = sc.next();
		if(a < 3200)
			System.out.println("red");
		else
			System.out.println(s);
	}
}


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

int main(){
  	int W, H, N;
  	int A[100][100];
  	cin >> W >> H >> N;
  	
  	for(int x = 0; x < W; x++){
    	for(int y = 0; y < H; y++){
        	A[y][x] = 0;
        }
    }
  	
  	for(int i = 0; i < N; i++){
    	int x, y, a;
      	cin >> x >> y >> a;
      	if(a == 1){
        	for(int j = 0; j < H; j++){
            	for(int l = 0; l < x; l++){
                	A[j][l] = 1;
                }
            }
        }else if(a == 2){
        	for(int j = 0; j < H; j++){
            	for(int l = x; l < W; l++){
                	A[j][l] = 1;
                }
            }
        }else if(a == 3){
        	for(int j = 0; j < W; j++){
            	for(int l = 0; l < y; l++){
                	A[l][j] = 1;
                }
            }
        }else{
        	for(int j = 0; j < W; j++){
            	for(int l = y; l < H; l++){
                	A[l][j] = 1;
                }
            }
        }
    }
  	int count = 0;
  	for(int y = 0; y < H; y++){
    	for(int x = 0; x < W; x++){
        	if(A[y][x] == 0){
            	count++;
            }
          	//cout << A[y][x];
        }
      	//cout << endl;
    }
  	cout << count << endl;
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AthleteProgramming2
{
    class Program
    {
        static void Main()
        {
            int N = int.Parse(Console.ReadLine());
            int[] array = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int replacementCount = 0;
            replacementCount= BubbleSort(array, N);
            for(int i = 0; i < N - 1; i++)
            {
                Console.Write("{0} ",array[i]);
            }
            Console.WriteLine(array[N-1]);
            Console.WriteLine(replacementCount);
        }

        static int BubbleSort(int[] array,int N)
        {
            int replacementCount = 0;
            for(int i = N - 1; i >= 0; i--)
            {
                for(int j = 0; j < i; j++)
                {
                    if (array[j] > array[j + 1])
                    {
                        replacementCount++;
                        Swap(ref array[j], ref array[j + 1]);
                    }
                }
            }
            return replacementCount;
        }

        static void Swap(ref int a,ref int b)
        {
            int tmp = a;
            a = b;
            b = tmp;
        }

    }
}

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


int main(){
  int N;
  cin >> N;
  vector<int> v(N);
  for(int i=0; i<N; i++) cin >> v[i];
  sort(v.begin(), v.end());

  int count = 1;
  for(int i=1; i<N; i++){
    if(v[i] > v[i-1]) count++;
  }

  cout << count << endl;

  return 0;
}


Measured memory_bytes: 256
class stack:

    data = []

    def push(self, a):
        self.data.append(a)

    def pop(self):
        if len(self.data) > 0:
            top = self.data[-1]
            self.data = self.data[:-1]
            return top
        else:
            raise Exception('stack has no data.')

buf = stack()
op = ['+', '*', '-']

a = list(input().split())
for i in a:
    if i in op:
        op2 = int(buf.pop())
        op1 = int(buf.pop())
        if i == '+':
            buf.push(op1+op2)
        elif i == '*':
            buf.push(op1*op2)
        else:
            buf.push(op1-op2)
    else:
        buf.push(i)
result = buf.pop()
print(result)



Measured memory_bytes: 5600
#include <stdio.h>
#define ctoi(n) ((n)-'0')

int main(void)
{
	char sr[5],sa[5];
	scanf("%s %s",sr,sa);
	while (sr[1]) {
		char *pr, *pa;
		unsigned h = 0,b = 0;
		unsigned n[10] = {};
		pr = sr;
		pa = sa;
		do {
			if (*pr==*pa) {
				h++;
			}
			else {
				n[ctoi(*pr)]++;
			}
		} while (( *++pr && *++pa )) ;
		pa = sa;
		do {
			if (n[ctoi(*pa)]) {
				b++;
			}
		} while (*++pa) ;
		printf("%d %d\n", h, b);
		scanf("%s %s",sr,sa);
	}
	return 0;
}

Measured memory_bytes: 540
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);++i)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
  
const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
 
const int MAX=510000;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
   
  int n ,x,t;
  cin >> n >> x >> t;
  
  cout << ((n+x-1)/x)*t << endl;
  
  return 0;
}

Measured memory_bytes: 3632
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <iomanip>
#include <ctype.h>

using namespace std;
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;

#define TR ","
#define fi first
#define se second
#define rep(i,N) for(int i=0;i<(int)N;++i)
#define all(v) v.begin(), v.end()
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll lcm(ll x, ll y) {
    return x / gcd(x, y) * y;
}

ll waz = 76543217;

ll inv(ll x) {
    if (x == 1) { return 1; }
    if (x == 0) { return 0; }
    else {
        ll a = (waz - inv(waz % x) * (waz / x)) % waz;
        if (a >= 0) { return a; }
        else { return waz + a; }
    }
}

void printVector(const vector<int>& vec) {
    for (int value : vec) {
        cout << value << " ";
    }
    cout << endl;
}

vector<ll> p;

ll phi(ll x) {
    ll a = x;
    ll b = x;
    for (ll k = 0; k != p.size(); ++k) {
        if (a % p[k] == 0) {
            while (a % p[k] == 0) {
                a /= p[k];
            }
            b = b / p[k] * (p[k] - 1);
        }
        if (a == 1) { break; }
    }
    return b;
}

bool my_compare(pair<string, int> a, pair<string, int> b) {
    if (a.first != b.first) {
        return a.first < b.first;
    }

    if (a.second != b.second) {
        return a.second > b.second;
    }
    else {
        return true;
    }
}

int main()
{
    IO;

    int N; cin >> N;
    vector<int> A(N), B(N);
    vector<pair<int,int> > pa(N);
    rep(i,N) cin >> A[i];
    rep(i,N) pa[i] = make_pair(A[i], i+1);
    sort(pa.begin(), pa.end());
    rep(i, N) B[i] = pa[i].se;
    printVector(B);
}

Measured memory_bytes: 2432
#include <iostream>
#include <cmath>
#include <climits>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string.h>
#include <iomanip>
#include <ctype.h>

#define ll          long long int
#define ull         unsigned long long int
#define pb          push_back
#define pii         pair<int,int>
#define F           first
#define S           second
#define vi          vector<int>
#define vli          vector<ll>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define M_PI        3.14159265358979323846
#define mp          make_pair
#define sz(x)       (int)x.size()
//#define hell        1000000007
#define matrix      vector<vector<ll>>
#define forn(i,a,b)  for(int i=a;i<b;i++)
#define eps 0.000000001
#define all(a)      (a).begin(),(a).end()
const long long INF = (long long) 1e7+1;
const long long mod = (long long) 998244353;
const long long hell = (long long) 1000000007;

using namespace std;
#include <stdio.h>
ll m;
ll power(ll x,ll y)
{
  ll res=1;
  while(y>0)
  {
    if(y%2) res=(x*res);
    x=(x*x);
    y=y/2;
  }
  return res;
}

ll modinv(ll x){
  return power(x,hell-2);
}

void solve();


void fastIO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

int main(){
   fastIO();
    solve();
}
//void sieve();
ll pw(ll k,ll x);
ll gcd(ll x,ll y);

/*
  For freq or prime factors

for(auto pri:prime){
  while(k%pri==0){
    pcnt[pri]++;
    k/=pri;
  }
}*/

bool issafe(int x,int y,int n,int m){
  return (x>=0 && y>=0 && x<n && y<m);
}

bool comp(pair<ll,ll> a,pair<ll,ll> b){
    if(a.F!=b.F)
    return a.F<b.F;
    else
    return a.S>b.S;
}

void solve(){
  int test;
  //cin>>test;
  test=1;
  
  while(test--){
        int n;
        cin>>n;
        
        vector<pair<ll,ll>> vec;
        forn(i,0,n){
            ll x,l;
            cin>>x>>l;
            vec.pb(mp(x-l,x+l));
        }
        sort(vec.begin(),vec.end(),comp);
        
        ll ed=vec[0].S;
        int ans=0;
        for(int i=1;i<n;i++){
            if(vec[i].F>=ed){
                ed=vec[i].S;
            }
            else{
                if(vec[i].S<=ed){
                    ed=vec[i].S;
                }
                ans++;
            }
        }
        cout<<n-ans;
  }    
}    

    




///Before submit=>
///    *check for integer overflow,array bounds
///    *check for n=1

ll gcd(ll x,ll y){
  if(x==0)
  return y;
  else
  return gcd(y%x,x);
}


ll pw(ll k,ll x){
  if(x==0)
  return 1;
  if(x&1)
  return ((pw(k,x-1))*k);
  else
  return ((pw(k,x/2))*(pw(k,x/2)));
}


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

using namespace std;

const int M = 1e5;
vector<int> adj[M];
int distU[M], distV[M];

void calc(int cur, int parent, int dist, int *distArr) {
    distArr[cur] = dist;
    for (int x : adj[cur])
        if (x != parent)
            calc(x, cur, dist + 1, distArr);
}

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

    int n, u, v, ans = 0;
    cin >> n >> u >> v;
    u--;
    v--;

    for (int i = 0; i < n - 1; i++) {
        int x, y;
        cin >> x >> y;
        x--;
        y--;
        adj[x].push_back(y);
        adj[y].push_back(x);
    }

    calc(u, -1, 0, distU);
    calc(v, -1, 0, distV);

    for (int i = 0; i < n; i++)
        if (distU[i] < distV[i])
            ans = max(ans, distV[i]);

    cout << ans - 1 << "\n";

    return 0;
}

Measured memory_bytes: 11648
while True:

    H,W = map(int,input().split())

    if H == 0 and W == 0:
        break
    
    A = ""
    B = ""

    for i in range(W):

        if i % 2 == 1:

            A += "."

            B += "#"

        else:

            A += "#"

            B += "."

    for i in range(H):

        if i % 2 == 0:

            print (A)
    
        else:

            print(B)

    print ("")



Measured memory_bytes: 5616
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 400010;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,W;
    cin >> n >> W;
    vector<ll> cnt(4,1);
    vector<vector<ll>> value(4);
    ll w,w0,v;
    rep(i,n){
        cin >> w >> v;
        if (i == 0) w0 = w;
        value[w-w0].push_back(v);
        cnt[w-w0]++;
    }
    rep(i,4){
        RSORT(value[i]);
        value[i].insert(value[i].begin(),0);
        rep(j,cnt[i]-1){
            value[i][j+1] += value[i][j];
        }
    }
    ll ans = 0;
    rep(a,cnt[0]){
        rep(b,cnt[1]){
            rep(c,cnt[2]){
                rep(d,cnt[3]){
                    if ((a+b+c+d)*w0+b+2*c+3*d > W) continue;
                    chmax(ans,value[0][a]+value[1][b]+value[2][c]+value[3][d]);
                }
            }
        }
    }
    PRINT(ans);
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>

using namespace std;

typedef long long ll;

int main(void) {
  int N; cin >> N;
  int C[500], S[500], F[500];
  for (int i = 0; i < N - 1; i++) {
    cin >> C[i] >> S[i] >> F[i];
  }

  for (int i = 0; i < N; i++) {
    int t = 0;
    // cout << C[i] << "," << S[i] << "," << F[i] << endl;
    for (int j = i; j < N - 1; j++) {
      if (t < S[j]) {
        t = S[j];
      } else if (t % F[j] == 0) {
        ;
      } else {
        t = t + F[j] - t % F[j];
      }
      t += C[j];
    }
    cout << t << endl;
  }
}


Measured memory_bytes: 256
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;

class Solution {
public:

};

int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);

    long long a, b, c, k;
    cin >> a >> b >> c >> k;

    vector<int> sc{1, 0, -1};
    vector<long long> A{a, b, c};
    long long res = 0;
    for (int i = 0; i < 3; ++i) {
        long long cnt = min(A[i], k);
        res += cnt * sc[i];
        k -= cnt;
    }

    cout << res << '\n';

    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define nt _int128
#define mod 1000000007
double arr[3005],dp[3005][3005];
ll n;
double func(ll i,ll k)
{
    if(i==n+1)
    {
        if(k==0)
            return 1.0;
        else 
            return 0.0;
    }
    else if(dp[i][k]!=-1.0)
    {
        return dp[i][k];
    }

    double x=0;
    if(k>0)
        x+=arr[i]*func(i+1,k-1);
    x+=(1-arr[i])*func(i+1,k);
    return dp[i][k]=x;
}
int main()
{
// #ifndef ONLINE_JUDGE
//        freopen("input.txt","r",stdin);
//     freopen("output.txt","w",stdout);
// #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    // cin >> t;
    t  = 1;
    while(t--)
    {
        cin>>n;
        for(ll i=1;i<=n;i++)
            cin>>arr[i];
        double x=0;
        for(ll i=1;i<=3000;i++)
        {
            for(ll j=0;j<=3000;j++)
                dp[i][j]=-1.0;
        }
        for(ll i=n/2+1;i<=n;i++)
        {
            x+=func(1,i);
        }
        // for(ll i=1;i<=n;i++)
        // {
        //     for(ll j=0;j<=2;j++)
        //         cout<<dp[i][j]<<" ";
        //     cout<<endl;
        // }
        cout<<fixed<<setprecision(10)<<x;
    }
    return 0;
}

Measured memory_bytes: 71040
package main

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

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	aa := make([]int, n)
	for i := 1; i < n; i++ {
		a := getNextInt(scanner) - 1
		aa[a]++
	}
	for i := 0; i < n; i++ {
		fmt.Fprintln(writer, aa[i])
	}
}


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

using u32 = uint32_t;
using u64 = uint64_t;
using i32 = int32_t;
using i64 = int64_t;

int main()
{
    std::ios_base::sync_with_stdio(0);

    u32 N;
    std::cin >> N;

    constexpr double tax_ratio = 1.08;

    u32 result = (u32)(ceil((double)N / tax_ratio));

    if ((u32)(result * tax_ratio) == N)
        std::cout << result;
    else
        std::cout << ":(";

    return 0;
}


Measured memory_bytes: 256
def fun():
     print(11)
     print(22)
     print(33)
     print(22)
N=eval(input())
S=input()
ls=[0]
x=0
for i in S:
     if i=='I':
          x+=1
          ls.append(x)
     else:
          x-=1
          ls.append(x)
result=max(ls)
print(result)

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

int main(){
	int n,k;
	cin>>n>>k;
	int a[n+1];
	memset(a,0,sizeof(a));
	for(int i=1;i<=k;i++){
		int m;
		cin>>m;
		for(int j=1;j<=m;j++){
			int x;
			cin>>x;
			a[x]=1;
		}
	}
	int ans=n;
	for(int i=1;i<=n;i++){
		ans-=a[i];
	}
	cout<<ans<<endl;
	return 0;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;
constexpr int mod2 = 998244353;
template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

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

template<typename T>
bool isin(T y, T x, T h, T w) { return (0 <= y && 0 <= x && y < h && x < w); }
template<typename T>
bool isin1(T y, T x, T h, T w) { return (0 < y && 0 < x && y <= h && x <= w); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	if (v.size()) {
		os << v[0];
		for (int i = 1; i < v.size(); i++) os << " " << v[i];
	}
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	int N, K; cin >> N >> K;
	vint A(N); cin >> A;
	for (int i = 0; i < N-K; i++) {
		if (A[i] < A[i+K]) {
			cout << "Yes" << el;
		} else {
			cout << "No" << el;
		}
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout << fixed << setprecision(20);
	Main();
	return (0);
}


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

const int INF = 1001001001;

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

  if(n[0] == '7' || n[1] == '7' ||n[2] == '7') cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 3628
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String tmp = null;
		int cup = 0;
		int mun = 0;
		int ter = 0;
		String[] rrr;
		int st = 0,sr = 0;
		int mon = 0;
		int syo=0,hisi=0;
		
		
		while(true){
			
			try {
				tmp = br.readLine();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
			
			if(tmp == null){
				break;
			}
			
			if(tmp.equals("")){
				break;
			}
			
			rrr = tmp.split(",");
			int a = Integer.parseInt(rrr[0]);
			int b = Integer.parseInt(rrr[1]);
			int c = Integer.parseInt(rrr[2]);
			
			if(a == b){
				syo++;
			}
			if((a*a+b*b) == c*c){
				hisi++;
			}
		}
		System.out.println(hisi);
		System.out.println(syo);

	}

}

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

int main() {
    int N, X, total = 0;
    cin >> N >> X;

    int m[N];
    for (int i = 0; i < N; i++) {
        cin >> m[i];
        X -= m[i];
        total++;
    }

    sort(m, m + N, greater<int>());

    total += X / m[N -1];

    cout << total << endl;
}

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

int main()
{
  int W, H, N;
  cin >> W >> H >> N;
  int maxx, minx, maxy, miny;
  maxx = W;
  maxy = H;
  minx = miny = 0;
  for(int i = 0; i < N; i++){
    int x, y, a;
    cin >> x >> y >> a;
    if(a == 1){
      minx = max(minx, x);
    }else if(a == 2){
      maxx = min(maxx, x);
    }else if(a == 3){
      miny = max(miny, y);
    }else if(a == 4){
      maxy = min(maxy, y);
    }
  }
  int ans = (maxx-minx)*(maxy-miny);
  if(maxx-minx < 0 || maxy-miny < 0) ans = 0;
  cout << ans << endl;
}

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

long long int N, P, final_res = 1;
bool prime[1010101];

void solve(){
    for(int i=2;i<=1e6;i++){
        if(!prime[i]){

            int cnt = 0;
            while(P % i == 0){
                cnt++;
                P /= i;
            }
            cnt /= N;
            for(int k = 0; k < cnt; k++)final_res *= i;

            for(int j=2*i;j<=1e6;j+=i){
                prime[j] = 1;
            }
        }
    }
}
int main(){
    cin>>N>>P;
    if(N == 1)return cout<<P<<endl, 0;
    solve();
    cout<<final_res<<endl;
}


Measured memory_bytes: 1280
// 5/24
// 2-5-2 最短経路問題
// Saving Shunk
// https://atcoder.jp/contests/soundhound2018-summer-qual/tasks/soundhound2018_summer_qual_d
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using LLP = pair<ll, ll>;

struct Edge {
    int to;
    int cost_yen;
    int cost_snook;
    Edge(int t, int cy, int cs) : to(t), cost_yen(cy), cost_snook(cs) { }
};
using Graph = vector<vector<Edge>>;

int main() {
    int n, m, s, t;
    cin >> n >> m >> s >> t;
    s--; t--;

    Graph G(n);
    rep(i, m) {
        int u, v, a, b;
        cin >> u >> v >> a >> b;
        u--; v--;
        G[u].push_back(Edge(v, a, b));
        G[v].push_back(Edge(u, a, b));
    }

    vector<ll> dist_yen(n, 10000000000000000);  // 各都市までの利用金額の最小値。
    dist_yen[s] = 0;
    
    priority_queue<LLP, vector<LLP>, greater<LLP>> que;
    que.push(LLP(0, s));

    while (!que.empty()) {
        LLP p = que.top();
        que.pop();
        int v = p.second;

        if (dist_yen[v] < p.first) continue;

        for (auto ne : G[v]) {
            if (dist_yen[ne.to] > dist_yen[v] + ne.cost_yen) {
                dist_yen[ne.to] = dist_yen[v] + ne.cost_yen;
                que.emplace(LLP(dist_yen[ne.to], ne.to));
            }
        }
    }

    // cout << "dist_yen" << endl;
    // rep(i, n) {
    //     cout << dist_yen[i] << " ";
    // }
    // cout << endl;

    vector<ll> dist_snook(n, 10000000000000000);
    dist_snook[t] = 0;
    que.push(LLP(0, t));

    while (!que.empty()) {
        LLP p = que.top();
        que.pop();
        int v = p.second;

        if (dist_snook[v] < p.first) continue;

        for (auto ne : G[v]) {
            if (dist_snook[ne.to] > dist_snook[v] + ne.cost_snook) {
                dist_snook[ne.to] = dist_snook[v] + ne.cost_snook;
                que.emplace(LLP(dist_snook[ne.to], ne.to));
            }
        }
    }

    // cout << "dist_snook" << endl;
    // rep(i, n) {
    //     cout << dist_snook[i] << " ";
    // }
    // cout << endl;


    vector<ll> ans(n + 1, -1);

    for (int i = n - 1; i >= 0; i--) {
        // i番目の街で両替した場合の残金
        ll money = 1000000000000000 - dist_yen[i] - dist_snook[i];

        ans[i] = max(ans[i + 1], money);
    }

    rep(i, n) cout << ans[i] << endl;
}


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

char arr[1001][1001];

int main(){
	ll H,W;
	cin>>H>>W;
	for(int i = 0; i < H; ++i){
		for(int j = 0; j < W; ++j){
			cin>>arr[i][j];
		}
	}
	vector<vector<ll>>dp(H,vector<ll>(W,0));
	dp[0][0] = 1;

	for(int i = 1; i < W; ++i){
		if(arr[0][i] == '.'){
			dp[0][i] = 1;
		}
		else {
			break;
		}
	}

	for(int i = 1; i < H; ++i){
		if(arr[i][0] == '.'){
			dp[i][0] = 1;
		}
		else {
			break;
		}
	}

	for(int i = 1; i < H; ++i){
		for(int j = 1; j < W; ++j){
			if(arr[i][j] == '#'){
				dp[i][j] = 0;
			}
			else {
				dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % MOD;
			}
		}
	}
	cout<<dp[H-1][W-1]<<endl;
}

Measured memory_bytes: 12208