akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = ((n)-1); i >= 0; --i)

using namespace std;

using i32 = int;
using i64 = long long;
using u32 = unsigned;
using u64 = unsigned long long;

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

	i32 N, L;
	cin >> N >> L;

	i32 all = 0;
	rep(i, N) {
		all += (L + i);
	}

	vector<i32> aji(N);
	vector<i32> diff(N);
	rep(i, N) {
		i32 s = 0;
		rep(j, N) {
			if (i == j) continue;
			s += (L + j);
		}
		aji[i] = s;
		diff[i] = abs(all - s);
	}
	auto m = min_element(diff.begin(), diff.end());
	auto res = (aji[m - diff.begin()]);
	printf("%d\n", res);

	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int x,y;
  int i,j,k;
  scanf("%d %d",&x,&y);
  int a[x][y];
  int b[y];
  int sum[x];
  for(i=0;i<x;i++){
    sum[i]=0;
    for(j=0;j<y;j++){
        scanf("%d",&a[i][j]);
    }
  }
  for(j=0;j<y;j++){
    scanf("%d",&b[j]);
    for(i=0;i<x;i++){
      sum[i] += a[i][j]*b[j];
    }
  }
  for(i=0;i<x;i++){
    printf("%d\n",sum[i]);
  }
  return 0;
}

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

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

    int sc[n];
    for (int i = 0; i < n; i++){
        sc[i] = k-q;
    }

    int a[q];

    for (int i = 0; i < q; i++){
        cin >> a[i];
        ++sc[a[i]-1];
    }

    for (int i = 0; i < n; i++){
        if (sc[i] > 0){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }

    return 0;
}

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

int main()
{
	int a, b, c,x;
	int cnt = 0;
	cin >> a >> b >> c>>x;
	for (int i = 0; i <= a; i++) {
		for (int j = 0; j <= b; j++) {
			for (int k = 0; k <= c; k++) {
				if (500 * i + 100 * j + 50 * k == x)
					cnt++;
			}
		}
	}
	cout << cnt << endl;
}

Measured memory_bytes: 384
package main

import "fmt"

func main() {
	var A, B int
	fmt.Scanf("%d %d", &A, &B)

	mul := A * B
	// gcd(A, B)
	if A > B {
		A, B = B, A
	}
	for A != 0 {
		A, B = B%A, A
	}

	fmt.Println(mul / B)

}


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

int main( void )
{
    int x, t;
    cin >> x >> t;
    if ( ( x - t ) > 0 )
    {
        cout << x - t << endl;
    }
    else
    {
        cout << 0 << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n ;
long long h[300005] , a[300005];
struct node{
	long long rmq;
	node *left ,*right;
}; 
node * root;


void update(int x , long long vl , int l, int r  , node * & tree){
	int mid = (l+r)/2;
	if(l == r){
		if(tree->rmq < vl)
		tree->rmq = vl;
		return ;
	}
	if(x <= mid){
		if(tree->left == NULL) tree->left = new node();
		update(x,vl,l,mid,tree->left);
	}
	else{
		if(tree->right == NULL) tree->right = new node();
		update(x,vl,mid+1,r,tree->right);
	}
	if(tree->left != NULL && tree->right != NULL){
		if(tree->left->rmq >= tree->right->rmq){
			tree->rmq = tree->left->rmq;
		}
		else{
			tree->rmq = tree->right->rmq;
		}
	}
	else{
		if(tree->right == NULL){
			tree->rmq = tree->left->rmq;
		}
		else{
			tree->rmq = tree->right->rmq;
		}
	}
} 


long long query(int x , int y , int l , int r , node * tree){
	int mid = (l+r)/2;
	if(x == l && y == r){
		return tree->rmq;
	}
	if(y <= mid){
		if(tree->left == NULL) return 0;
		return query(x,y,l,mid,tree->left);
	}
	else if(x > mid){
		if(tree->right == NULL) return 0;
		return query(x,y,mid+1,r,tree->right);
	}
	else{
		long long P = 0;
		if(tree->left != NULL) P = max(P , query(x,mid,l,mid,tree->left));
		if(tree->right != NULL) P = max(P , query(mid+1,y,mid+1,r,tree->right));
		return P;
	}
}


int32_t main(){
	scanf("%d" , &n);
	root = new node();
	for(int i = 1 ; i <= n; i ++){
		scanf("%lld" , &h[i]);
	}
	for(int i = 1 ; i <= n; i ++){
		scanf("%lld" , &a[i]);
	}
	for(int i = 1 ; i <= n; i ++){
		long long U = query(0 , h[i] - 1 , 0 , 300005 , root);
		update(h[i] , U + a[i] ,0 ,300005 , root );
	}
	printf("%lld\n" , root->rmq);
}

Measured memory_bytes: 16384
#include <bits/stdc++.h>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
#define MOD 1000000007LL
#define endl "\n"
#define fst first
#define snd second
const ll UNDEF = -1;
const ll INF=1e18;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;
typedef vector<ll> vll;

void solve(vector<long long> a){
	sort(a.begin(),a.end());
	printf("%lld\n",a[2]-a[0]);
}

int main(){	
	ios_base::sync_with_stdio(false); cin.tie(0);
	vector<long long> A(3-1+1);
	for(int i = 0 ; i <= 3-1 ; i++){
		scanf("%lld",&A[i]);
	}
	solve(A);
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <array>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>

using namespace std;
using lli = long long int;

int main() {

    int A, B, K;
    cin >> A >> B >> K;

    int counter = 0;
    for (int i = 100; i <= 100; --i) {
        if (A % i == 0 && B % i == 0) {
            ++counter;
            if (counter == K) {
                cout << i << endl;
                return 0;
            }
        }
    }
}

Measured memory_bytes: 256
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
# include <cstdlib>
# include <tuple>
# include <array>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define RALL(qpqpq)           (qpqpq).rbegin(),(qpqpq).rend()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define RFOR(i,tptpt,ypypy)  for(LL i=(tptpt);i>=(ypypy);i--)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int n;

int main() {
	cin >> n;
	vector<int> l(n), r(n);
	REP(i, n) {
		cin >> l[i] >> r[i];
	}
	sort(RALL(l));
	sort(ALL(r));
	LL ans = 0;
	LL tmp = 0;
	REP(i, n) {
		tmp += l[i]; ans = max(ans, tmp);
		tmp -= r[i]; ans = max(ans, tmp);
	}
	tmp = 0;
	REP(i, n) {
		tmp -= r[i]; ans = max(ans, tmp);
		tmp += l[i]; ans = max(ans, tmp);
	}
	cout << ans * 2 << endl;
}

Measured memory_bytes: 1024
n = int(input())                                                                                                                          
a = [0]                                                              
a.extend(list(map(int, input().split())))                            
a.append(0)                                                                                                                               
s = 0                                                                
for i in range(len(a) - 1):                                              
	s += abs(a[i] - a[i + 1])                                                                                                             
for i in range(n):                                                       
	si = s + abs(a[i + 2] - a[i]) - (abs(a[i] - a[i + 1]) + abs(a[i + 1] - a[i + 2]))                                                         
	print(si)

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

void solve() {
    int N, M;
    cin >> N >> M;
    long long x[1000][3];
    rep(i,N) rep(j,3) cin >> x[i][j];
    long long ans;
    rep(i,8) {
        vector<long long> y(N);
        rep(j,N) {
            y[j] = 0;
            rep(k,3) y[j] += x[j][k] * (((i >> k) & 1) * 2 - 1);
        }
        sort(y.begin(), y.end());
        long long sum = 0;
        rep(j,M) sum += y[N - 1 - j];
        ans = max(ans, sum);
        //cout << i << " " << sum << endl;
    }
    cout << ans << endl;
    return;
}

int main() {
    solve();
}

Measured memory_bytes: 256
import sys
import bisect
import math
input = sys.stdin.readline

n = int(input())
l = list(map(int, input().split()))

m = {}
for v in l:
    if m.get(v) != None:
        m[v] += 1
    else:
        m[v] = 1
        
c = 0
for num, count in m.items():
    if num > count:
        c += count
    elif num < count:
        c += count - num
        
print(c)

Measured memory_bytes: 17828
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iomanip>
using namespace std;
 
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
typedef long long ll;

int cnt[100010];

int main() {

	int N; cin >> N;
	vector<int> a(N);
	REP(i,N) cin >> a[i];

	REP(i,100010) cnt[i] = 0;

	REP(i,a.size()) cnt[a[i]]++;

	int ans = 0;
	for (int i = 0; i <= 100000; i++) {
		if (i == 0) {
			ans = max(ans, cnt[i] + cnt[i + 1]);
		} else {
			ans = max(ans, cnt[i] + cnt[i + 1] + cnt[i - 1]);
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int64_t MOD=1000000007;
const long long INF = 1LL<<60;

int main() {
  int64_t N,K; cin>>N>>K;
  vector<int64_t> A(N),S;
  rep(i,N){
    cin>>A.at(i);
    A.at(i)--;
  }
  
  vector<bool> seen(N,true);
  int64_t k=0,l=0;
  
  while(seen.at(k)){
    seen.at(k)=false;
    S.push_back(k);
    k=A.at(k);
  }
  while(S.at(l)!=k) l++;
  if(K<=l) cout<<S.at(K)+1;
  else{
    K-=l;
  int64_t t=S.size()-l,q=K%t;
  cout<<S.at(q+l)+1;
  }
}


Measured memory_bytes: 6960
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main(){
    string s,t;
    cin>>s>>t;
    int n=s.length();
    int m=t.length();
    int dp[n+1][m+1];
    for(int i=0;i<=n;i++){
        for(int j=0;j<=m;j++){
            if(i==0 || j==0){dp[i][j] = 0;}
            else if(s[i-1] == t[j-1]){dp[i][j] = 1+dp[i-1][j-1];}
            else{dp[i][j] = max(dp[i-1][j],dp[i][j-1]);}


        }
    }
    int i = n,j = m;
    string st="";
    while(i>0 && j>0){
        if(s[i-1] == t[j-1]){ 
            st=s[i-1] + st;
            i--;
            j--;
            }
            else{
                if(dp[i-1][j]>dp[i][j-1]){
                    i--;
                }
                else{
                    j--;
                }
            }


    }
    cout<<st;

} 

Measured memory_bytes: 73992
#include <iostream>
#include <string>

using namespace std;

string S;

int main(void)
{
	cin >> S;
	
	if(S[0] == S[1] && S[1] == S[2]) cout << "Yes" << endl;
	else if(S[1] == S[2] && S[2] == S[3]) cout << "Yes" << endl;
	else cout << "No" << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cctype>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<cctype>
#include<cstring>
#include<utility>
#include<cmath>
const int inf=0x7fffffff;
typedef long long int ll;
using namespace std;
int main()
{
//#ifdef DEBUG
//	freopen("in", "r", stdin);
////	freopen("out", "w", stdout);
//#endif
	
	double x,y,x2,y2;
	//cout<<sizeof(double);
	scanf("%lf%lf%lf%lf", &x,&y,&x2,&y2);
	printf("%f\n",hypot(x-x2,y-y2));
	//insert code above
	return 0;
}
//aoj1_10_a.cc

Measured memory_bytes: 1248
# include <stdio.h>
int a[103], b[103];
int main()
{    
int p1=0, p2=0, m=100;    
long long n;    
scanf("%lld",&n);    
++n;    
while(n > 1)    
{        
if(n&1) 
a[++p1] = m--, --n;        
else b[++p2] = m--, n>>=1;    
}    
printf("%d\n",p1+p2<<1);    
for(int i=1; i<=p1; ++i)        
printf("%d ",a[i]);    
for(int i=p2; i>=1; --i)        
printf("%d ",b[i]);    
for(int i=101-p1-p2; i<=100; ++i)        
printf("%d ",i);   
return 0;}


Measured memory_bytes: 128
using System;
class Program
{
  static void Main(string[] args)
  {
    string[] line = Console.ReadLine().Split(' ');
    int a = int.Parse(line[0]);
    int b = int.Parse(line[1]);
    int max = 0;
    max = a + b;
    if(a - b > max)
    {
      max = a - b;
    }
    if(a * b > max)
    {
      max = a * b;
    }
    Console.WriteLine(max);
  }
}


Measured memory_bytes: 13140
#include <stdio.h>

int N, A;
int x[55];

typedef long long ll;

ll dp[55][55][2510];

int main() {

	int i, j, k;

	scanf("%d %d",&N,&A);

	int ma = 0;

	for (i = 0; i < N; i++) {
		scanf(" %d",&x[i]);
		ma += x[i];
	}

	dp[0][0][0] = 1ll;

	for (i = 0; i < 55; i++) {
		dp[i][0][0] = 1ll;
	}

	for (i = 0; i < N; i++) {
		for (j = 1; j <= N; j++) {
			for (k = 1; k <= ma; k++) {
				if (k - x[i] >= 0) {
					dp[i + 1][j][k] = dp[i][j][k] + dp[i][j - 1][k - x[i]];
				}
				else {
					dp[i + 1][j][k] = dp[i][j][k];
				}
			}
		}
	}

	ll ans = 0;
	for (i = 1; i <= N; i++) {
		ans += dp[N][i][A*i];
	}
	printf("%lld\n",ans);
	return 0;
}

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

import static java.lang.Math.*;

public class Main {
    class Reader {
        BufferedReader in;

        Reader() throws IOException {
            in = new BufferedReader(new InputStreamReader(System.in));
        }

        Reader(String name) throws IOException {
            in = new BufferedReader(new FileReader(name));
        }

        StringTokenizer tokin = new StringTokenizer("");

        String next() throws IOException {
            if (!tokin.hasMoreTokens()) {
                tokin = new StringTokenizer(in.readLine());
            }
            return tokin.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        boolean hasNext() throws IOException {
            if (tokin.hasMoreTokens()) {
                return true;
            } else {
                String s = in.readLine();
                while (s != null && s.length() == 0) {
                    s = in.readLine();
                }
                if (s == null) {
                    return false;
                } else {
                    tokin = new StringTokenizer(s);
                    return true;
                }
            }
        }
    }

    class Writer {
        PrintWriter cout;

        Writer() throws IOException {
            cout = new PrintWriter(System.out);
        }

        Writer(String name) throws IOException {
            cout = new PrintWriter(new FileWriter(name));
        }

        StringBuilder out = new StringBuilder();

        void print(Object a) {
            out.append(a);
        }

        void close() {
            cout.print(out.toString());
            cout.close();
        }
    }

    ArrayList<Long> primes = new ArrayList<>();
    int n;

    boolean isPrime(long n) {
        for (int i = 0; i < primes.size() && primes.get(i) * primes.get(i) <= n; i++) {
            if (n % primes.get(i) == 0) {
                return false;
            }
        }
        return true;
    }


    long count[];

    void calck(long n1, int i) {
        for (int j = i; j < primes.size() && primes.get(j) * n1 <= n; j++) {
            long p = primes.get(j);
            for (long n2 = n1 * p, mul = 2; n2 <= n; n2 *= p, mul++) {
                count[(int) n2] = count[(int) n1] * mul;
                calck(n2, i + 1);
            }
        }
    }

    void run() throws Exception {
        Reader in = new Reader();
        Writer out = new Writer();
        int N = in.nextInt();
        n = N - 1;
        for (long i = 2; i <= n; i++) {
            if (isPrime(i)) {
                primes.add(i);
            }
        }
        count = new long[n + 1];
        count[1] = 1;
        calck(1, 0);
        long sum = 0;
        for (int i = 1; i < N; i++) {
            sum += count[i];
        }
        out.print(sum);
        out.close();
    }

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


Measured memory_bytes: 45224
def f(s,i,m):
    m = m%26
    if ord(s[i])+m <= 122:
        s[i] = chr(ord(s[i])+m)
    else:
        t = ord(s[i])+m-122
        s[i] = chr(96+t)
    return s

def judge(c,n):
    if ord(c)+n > 122:
        return (123 - ord(c))%26
    else:
        return 0
        
s = list(input())
n = int(input())
l = len(s)

for i in range(0,l):
    if i == l-1:
        s = f(s,i,n)
    else:
        d = judge(s[i],n)
        s = f(s,i,d)
        n = n - d

print(''.join(s))

Measured memory_bytes: 4276
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] x = new int[m];
		for(int i = 0; i < m; i ++) {
			x[i] = sc.nextInt();
		}
		sc.close();
		Arrays.sort(x);
		int[] y = new int[m-1];
		for(int i = 0; i < m-1; i ++) {
			y[i] = x[i + 1] - x[i];
		}
		Arrays.sort(y);
		int sum = 0;
		for(int i = 0; i < m-n; i ++) {
			sum += y[i];
		}
		System.out.println(sum);
	}
}


Measured memory_bytes: 51168
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define downque(que) priority_queue<ll> que;
#define upque(que) priority_queue<ll, vector<int>, greater<int>> que;
typedef long long ll;
typedef vector<vector<int>> Matrix;
const int MOD = 1e9 + 7;
const int MAX = 1e7;
const int INF = numeric_limits<int>::max();



int main(){
  char c; cin>>c;
  char res=c+1;

	cout<<res<<endl;

  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rept(i,x,y) for(int i=x;i<=y;i++)
#define per(i,x,y) for(int i=y;i>=x;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define pii pair<int,int>
//	ios::sync_with_stdio(false);
//	cin.tie(0);
const int maxx = 1e6+7;
const int maxn = 1e9+7;
typedef long long ll;
using namespace std;
inline int read(){
   int s=0,w=1;
   char ch=getchar();
   while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
   while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
   return s*w;
}
ll t,n;
int a[maxx];
int main(){
		ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n;
	ll sum=0;
	rept(i,1,n){
		if(i%5==0||i%3==0)continue;
		else sum+=i;
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b)  for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;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(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>using P=pair<T,Y>;
template<class T,class Y>ostream& operator<<(ostream&o,P<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o<<endl;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}

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 modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
//V<ll>F,R;void setF(int n,int mod){F=R=V<ll>(++n);F[0]=1;FOR(i,1,n)F[i]=F[i-1]*i%mod;R[n-1]=modInv(F[n-1],mod);FORR(i,n-1,1)R[i-1]=R[i]*i%mod;}
//ll comb(int a,int b,int m){return a<b||b<0?0:F[a]*R[b]%m*R[a-b]%m;}

const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7; //998244353;
const int N = 500;
int n;
string s;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> s;
  FOR(i, 0, sz(s)) cout << char('A'+(s[i]-'A'+n)%26);
  cout << endl;
}

Measured memory_bytes: 256
#include<cstdio>

int main()
{
	int max = 0, sum = 0;
	int input;
	int i, n;

	scanf("%d", &n);

	for (i = 0; i < n; i++)
	{
		scanf("%d", &input);

		if (input > max)
		{
			max = input;
		}

		sum += input;
	}

	if (max >= sum - max)
	{
		printf("No\n");
	}

	else
	{
		printf("Yes\n");
	}

	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
  int N, M, C;
  cin >> N >> M >> C;
  int B[M];
  for (int i = 0; i < M; i++)
    cin >> B[i];
  int A[N][M];
  for (int i = 0; i < N; i++)
  {
    for (int j = 0; j < M; j++)
      cin >> A[i][j];
  }
  int ans = 0;
  for (int i = 0; i < N; i++)
  {
    int sum = 0;
    for (int j = 0; j < M; j++)
      sum += A[i][j] * B[j];
    if (sum > -1 * C)
      ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
//#include <boost/multiprecision/cpp_dec_float.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#include <algorithm>
#include <bitset>
#include <iomanip>
using namespace std;
//namespace mp = boost::multiprecision;
//using llll = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
//using Real = mp::number<mp::cpp_dec_float<1024>>;
using ll = long long;
const double EPS = 1e-10;
const ll MOD = 7+(1e+9);

int main(){
  //cout<<fixed<<setprecision(10);
  ll n,ans=1;
  cin>>n;
  vector<ll>v(n,0);
  for(ll i=0;i<n;i++){
    cin>>v[i];
  }
  vector<ll>a(3,0);
  for(ll i=0;i<n;i++){
    ll t=0;
    for(ll j=0;j<3;j++){
      if(a[j]==v[i])t++;
    }
    ans=ans*t%MOD;
    for(ll j=0;j<3;j++){
      if(a[j]==v[i]){
        a[j]++;
        break;
      }
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 1152
//
// Created by watemus on 08.09.2020.
//

#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
#define FF first
#define SS second

using ll = long long;
using ld = long double;

#define int ll

template<typename T>
using vec = std::vector<T>;

template<typename T>
using uset = std::unordered_set<T>;

template<typename T1, typename T2>
using umap = std::unordered_map<T1, T2>;

constexpr ll INFL = 1'000'000'000'000'000'228;
constexpr int INFI = 1'000'000'228;
const ld PI = acos(-1);

#ifdef LOCAL
std::mt19937 rnd(228);
#else
std::mt19937 rnd(std::chrono::steady_clock::now().time_since_epoch().count());
#endif

vec<pair<int, int>> DD = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};

/*
template<class... Args>
auto Vec(size_t n, Args&&... args) {
  if constexpr(sizeof...(args) == 1)
    return vector(n, args...);
  else
    return vector(n, Vec(args...));
}*/

#ifdef LOCAL
#else
#endif

const int MAXN = 1e7 + 10;

int t[MAXN], ans[MAXN], sm[MAXN];



void run() {
  int n;
  cin >> n;
  memset(t, 0, sizeof t);
  for (int i = 2; i < MAXN; i++) {
    if (t[i] == 0) {
      for (int j = i; j < MAXN; j += i) {
        if (t[j] == 0) {
          t[j] = t[j / i] + 1;
          sm[j] = i;
        }
      }
    }
  }
  ans[1] = 1;
  int ansik = 1;
  for (int i = 2; i < MAXN; i++) {
    ans[i] = ans[i / sm[i]] / t[i] * (t[i] + 1);
  }
  for (int i = 2; i <= n; i++) {
    ansik += i * ans[i];
  }
  cout << ansik << '\n';
}

signed main() {
#ifdef LOCAL
  std::freopen("input.txt", "r", stdin);
#else
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
#endif
  int t = 1;
  //cin >> t;
  while (t--) {
    run();
  }
  return 0;
}




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

using namespace std;

string S,T;
int main()
{   int flag = 0;
    cin >>S>>T;
    int l = S.length();
    for(int i = 0;i < l;i++)
    {
        if(S[i]!=T[i]) {
            flag = 1;
            break;
        }
    }
    if(flag ==1) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
    return 0;
}


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

vector<int> w(100010);
int n, k;

int num_of_load(long long P){
    int count_sum = 0;
    for (int j=0;j<k;j++){
        long long count_load = 0;
        while (count_load + w[count_sum] <= P){
            count_load += w[count_sum];
            count_sum++;
            if (count_sum == n) return n;
        }
    }
    return count_sum;
}

int solve(){
    long long left = 0;
    long long right = 10000 * 100000;
    long long mid;
    while(right - left > 1){
        mid = (left + right) / 2;
        int v = num_of_load(mid);
        if (v >= n) right = mid;
        else left = mid;
    }
    return right;
}

int main(){
    cin >> n >> k;
    for (int i=0;i<n;i++) cin >> w[i];
    long long ans = solve();
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 3116
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
using namespace std;
typedef long long ll;
typedef pair<int, int> P; 
const int inf = 1<<21;
const ll INF = 1LL << 60;
const ll mod = 1e9+7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main() {
    int a, b, q;
    cin >> a >> b >> q;
    vector<ll> s(a+2), t(b+2);
    rep(i, a) cin >> s[i+1];
    rep(i, b) cin >> t[i+1];
    s[0] = -INF, t[0] = -INF;
    s[a+1] = INF, t[b+1] = INF;

    rep(i, q){
        ll x;
        cin >> x;
        auto siter = lower_bound(s.begin(), s.end(), x);
        auto titer = lower_bound(t.begin(), t.end(), x);
        ll s1 = s[siter - s.begin()], s2 = s[siter - s.begin() - 1];
        ll t1 = t[titer - t.begin()], t2 = t[titer - t.begin() - 1];

        ll ans = INF;

        // if (s1==s2 and t1==t2){
        //     if ((s1>x and t1>x) or (s1<=x and t1<=x)){
        //         chmin(ans, max(abs(s1-x), abs(t1-x)));
        //     }else{
        //         chmin(ans, abs(s1-t1) + min(abs(s1-x), abs(t1-x)));
        //     }
        // }else if (s1==s2) {
        //     if (s1>x){
        //         chmin(ans, max(s1-x, t1-x));
        //         chmin(ans, s1-t2 + min(s1-x, x-t2));
        //     }else{
        //         chmin(ans, max(abs(s1-x), abs(t2-x)));
        //         chmin(ans, t1-s1 + min(abs(s1-x), abs(t1-x)));
        //     }
        // }else if (t1==t2){
        //     if (t1>x){
        //         chmin(ans, max(s1-x, t1-x));
        //         chmin(ans, t1-s2 + min(t1-x, x-s2));
        //     }else{
        //         chmin(ans, max(abs(t1-x), abs(s2-x)));
        //         chmin(ans, s1-t1 + min(abs(s1-x), abs(t1-x)));
        //     }
        // }else{
        //     chmin(ans, max(s1-x, t1-x));
        //     chmin(ans, max(abs(s2-x), abs(t2-x)));
        //     chmin(ans, s1-t2 + min(abs(s1-x), abs(x-t2)));
        //     chmin(ans, t1-s2 + min(abs(t1-x), abs(s2-x)));
        // }

        chmin(ans, max(s1-x, t1-x));
        chmin(ans, max(abs(s2-x), abs(t2-x)));
        chmin(ans, s1-t2 + min(abs(s1-x), abs(x-t2)));
        chmin(ans, t1-s2 + min(abs(t1-x), abs(s2-x)));
        cout << ans << endl;
    }
    return 0;
}

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

int main() {
  int N;
  double A;
  cin >> N;
  
  for( int i=0; i<N; i++){
    cin >> A;
    if ( A/2 == int(A/2) ) {
      if( (A/3 != int(A/3)) && (A/5 != int(A/5)) ) {
        cout << "DENIED";
        return 0;
      }
    }
  }
  cout << "APPROVED";
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
struct Pair2{
	int a, b;
	bool operator < (const Pair2 &c){
		return a > c.a;
	}
};
Pair2 obj[112345];
int main(){
	int n, m; scanf("%d%d", &n, &m);
	for(int i(1); i <= n; ++i){
		scanf("%d%d", &obj[i].a, &obj[i].b);
		obj[i].a = m - obj[i].a + 1;
	}
	sort(obj + 1, obj + n + 1);
	int ans(0), pos(1);
	priority_queue<int> heap;
	for(int i(m); i; --i){
		while(pos <= n && obj[pos].a >= i){
			heap.push(obj[pos].b);
			++pos;
		}
		if(!heap.empty()){
			ans += heap.top(); heap.pop();	
		}
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 1660
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
#include <deque>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

ll n, i, dd, bit;
deque<int> val;


int main()
{
  //  freopen("test.in","r",stdin);

    scanf("%lld", &n); n++;
    for (bit = 1; (bit << 1) <= n; bit <<= 1);

    //val.push_back(++dd);
    for (bit >>= 1; bit > 0; bit >>= 1) {
        val.push_back(++dd);
        if (n & bit) val.push_front(++dd);
    }

    printf("%lld\n", 2 * dd);
    while (!val.empty()) {
        printf("%d ", val.front());
        val.pop_front();
    }

    for (i = 1; i <= dd; i++) printf("%lld ", i);



    return 0;
}


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

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

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

    UnionFind tree(N);

    for(int i = 0; i < M; i++) {
        int  x, y,z;
        cin >> x >> y>>z;
        tree.unite(x-1, y-1); // xの木とyの木を併合する
    }

    int cnt=0;
    for(int i=0;i<N;i++){
        if(!tree.same(0,i)){
            tree.unite(0, i);
            cnt++;
        }
    }

    cout << cnt+1 << endl;
    return 0;
}


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

#define FOR(i, a, b) for(long long int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;



int main(void) {
	
	while (1) {
		int e;
		bool flag = true;
		int mini = INF;

		cin >> e;
		if (e == 0) {
			break;
		}
		RFOR(z, cbrt(e)+1, 0) {
			if (pow(z, 3) > e) {
				continue;
			}
			RFOR(y, sqrt(e-pow(z,3))+1, 0) {
				if (pow(y, 2) > e - pow(z, 3)) {
					continue;
				}
				
					if (mini > z + y + e - pow(z, 3) - pow(y, 2)) {
						mini = z + y + e - pow(z, 3) - pow(y, 2);
					}
					break;
				
			}
		}
		cout << mini << endl;
	}

}


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

int countmenu(int* data,int length)
{
	int* menus = (int*)malloc(sizeof(int)*9);
	int i;
	for(i = 0;i < 9;i++)
	{
		menus[i] = 0;
	}
	int flug = (data[0] << 2) | data[1];
	switch(flug)
	{
		case 0:
			for(i = 0;i < 9;i++)
			{
				menus[i] = 1;
			}
			break;
		case 1:
			menus[0] = 1;
			menus[3] = 1;
			menus[6] = 1;
			break;
		case 2:
			menus[1] = 1;
			menus[4] = 1;
			menus[7] = 1;
			break;
		case 3:
			menus[2] = 1;
			menus[5] = 1;
			menus[8] = 1;
			break;
		case 4:
			menus[0] = 1;
			menus[1] = 1;
			menus[2] = 1;
			break;
		case 5:
			menus[0] = 1;
			break;
		case 6:
			menus[1] = 1;
			break;
		case 7:
			menus[2] = 1;
			break;
		case 8:
			menus[3] = 1;
			menus[4] = 1;
			menus[5] = 1;
			break;
		case 9:
			menus[3] = 1;
			break;
		case 10:
			menus[4] = 1;
			break;
		case 11:
			menus[5] = 1;
			break;
		case 12:
			menus[6] = 1;
			menus[7] = 1;
			menus[8] = 1;
			break;
		case 13:
			menus[6] = 1;
			break;
		case 14:
			menus[7] = 1;
			break;
		case 15:
			menus[8] = 1;
			break;
	}
	for(i = 0;i < length-2;i++)
	{
		int submenus[9];
		int j;
		for(j = 0;j < 9;j++)
		{
			submenus[j] = menus[j];
			menus[j] = 0;
		}
		switch(data[i+2])
		{
			case 0:
				menus[0] = (submenus[3] + submenus[6]) % 10000;
				menus[1] = (submenus[0] + submenus[3] + submenus[6]) % 10000;
				menus[2] = (submenus[0] + submenus[3] + submenus[6]) % 10000;
				menus[3] = (submenus[1] + submenus[4] + submenus[7]) % 10000;
				menus[4] = (submenus[1] + submenus[7]) % 10000;
				menus[5] = (submenus[1] + submenus[4] + submenus[7]) % 10000;
				menus[6] = (submenus[2] + submenus[5] + submenus[8]) % 10000;
				menus[7] = (submenus[2] + submenus[5] + submenus[8]) % 10000;
				menus[8] = (submenus[2] + submenus[5]) % 10000;
				break;
			case 1:
				menus[0] = (submenus[3] + submenus[6]) % 10000;
				menus[3] = (submenus[1] + submenus[4] + submenus[7]) % 10000;
				menus[6] = (submenus[2] + submenus[5] + submenus[8]) % 10000;
				break;
			case 2:
				menus[1] = (submenus[0] + submenus[3] + submenus[6]) % 10000;
				menus[4] = (submenus[1] + submenus[7]) % 10000;
				menus[7] = (submenus[2] + submenus[5] + submenus[8]) % 10000;
				break;
			case 3:
				menus[2] = (submenus[0] + submenus[3] + submenus[6]) % 10000;
				menus[5] = (submenus[1] + submenus[4] + submenus[7]) % 10000;
				menus[8] = (submenus[2] + submenus[5]) % 10000;
				break;
		}
	}
	int sum = 0;
	for(i = 0;i < 9;i++)
	{
		sum += menus[i];
	}
	sum %= 10000;
	return sum;
}

int main()
{
	int n,k,i;
	int* data;
	scanf("%d %d",&n,&k);
	data = (int*)malloc(sizeof(int)*n);
	for (i = 0; i < n; i++)
	{
		data[i] = 0;
	}
	for (i = 0; i < k; i++)
	{
		int day,menu;
		scanf("%d %d",&day,&menu);
		data[day-1] = menu;
	}
	printf("%d\n",countmenu(data,n));
	return 0;
}

Measured memory_bytes: 0
n, m, q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(q)]

ans = 0
for a in range(1, m + 1):
    for b in range(a, m + 1):
        for c in range(b, m + 1):
            for d in range(c, m + 1):
                for e in range(d, m + 1):
                    for f in range(e, m + 1):
                        for g in range(f, m + 1):
                            for h in range(g, m + 1):
                                for i in range(h, m + 1):
                                    for j in range(i, m + 1):
                                        s = [0, a, b, c, d, e, f, g, h, i, j]
                                        cnt = 0
                                        for w, x, y, z in abcd:
                                            if s[x] - s[w] == y:
                                                cnt += z
                                        ans = max(cnt, ans)
print(ans)

Measured memory_bytes: 9256
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int MOD = 1e9+7;
using ll = long long;
using vi = vector<int>;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(x) x.begin(), x.end();
int main() {
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  cout << max(min(b,d)-max(a,c),0);
}

Measured memory_bytes: 3624
import sys
#input = sys.stdin.buffer.readline

def main():
    N = int(input())
    S = input()
    lc,rc = 0,0
    for s in S:
        if s == "(":
            rc += 1
        else:
            if rc <= 0:
                lc += 1
            else:
                rc -= 1
    
    print("("*lc+S+")"*rc)            
    
if __name__ == "__main__":
    main()


Measured memory_bytes: 2940
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int r;
  cin >> r;
  if (r < 1200) {
    cout << "ABC" << endl;
  } else if (r < 2800) {
    cout << "ARC" << endl;
  } else {
    cout << "AGC" << endl;
  }
  return 0;
}

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


int main()
{
  int k,n,a,b;
  cin>>k;
  cin>>a>>b;
  for(int i=a;i<=b;i++){
    if(i%k==0){
      cout<<"OK";
      return 0;
    }
  }
  cout<<"NG";
  
    return 0;
}


Measured memory_bytes: 3600
package main
 
import (
	"fmt"
  "bufio"
  "os"
	"strings"
  "strconv"
)
 
var sc = bufio.NewScanner(os.Stdin)
func main() {

  var n int
  fmt.Scanf("%d", &n)

  var ws []string
  if sc.Scan() {
    ws = strings.Split(sc.Text(), " ")
  }

  var sum float64
  sumSeq := [] float64{}
  for i:=0; i<n; i++ {
    welem, _ := strconv.ParseFloat(ws[i],64)
    sum = sum + welem
    sumSeq = append(sumSeq, sum)
  }
  sum_half := sum/2

  var diff_prev float64
  var diff float64
  var result float64
  for i:=0; i<n; i++ {
    diff = sum_half - sumSeq[i]
    if diff < 0 {
      if (i == 0) {
        result = -diff
      } else {
        if (-diff < diff_prev) {
          result = -diff
        } else {
          result = diff_prev
        }
      }
      break
    }
    diff_prev = diff
  }
  fmt.Println(result*2)
}




Measured memory_bytes: 640
x = list(map(int, input().split()))
n = x[0]
m = x[1]

ls = [[[]]for i in range(n)]

high = list(map(int, input().split()))
for i in range(m):
    tmp = list(map(int, input().split()))
    a = tmp[0]
    b = tmp[1]
    ls[a-1].append(b-1)
    ls[b-1].append(a-1)
cnt = 0
for i in range(n):
    judge = 0
    q = 1
    while judge == 0 and q < len(ls[i]):
        if high[i] <= high[ls[i][q]]:
            judge = 1
        q += 1
    if judge == 0:
        cnt += 1

print(cnt)

Measured memory_bytes: 39372
S=list(input())
N=len(S)
tsuyoikaibun=0
kaibun=0
for i in range((N-1)//2):
    if S[i]==S[(N-1)//2-i-1]and S[(N+1)//2+i]==S[N-i-1]: 
        tsuyoikaibun=tsuyoikaibun+1
    else:
        tsuyoikaibun=0
        break
for i in range (N):
    if S[i]==S[N-i-1]:
        kaibun=kaibun+1
    else:
        kaibun=0
        break

if kaibun==0 or tsuyoikaibun==0:
        print("No")
else:
        print("Yes")     



Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1000000007;



int main() {
    int N;
    cin >> N;
    //0~N-1の間に少なくとも1つ空席がある
    //s(i)!=s(i+2k)となるときには，どこかしらに空席がある。また，i=0,k=(N-1)/2とすると，必ずその様になる点が存在することが示せる。
    vector<string>res(N);
    cout << 0 << endl;
    cin >> res.at(0);
    if (res.at(0) == "Vacant")return 0;
    cout << N - 1 << endl;
    cin >> res.at(N - 1);
    if (res.at(N - 1) == "Vacant")return 0;
    int left = 0, right = N - 1,mid;
    for (size_t i = 0; i < 19; i++)
    {
        mid = left + (right - left) / 2;
        cout << mid << endl;
        cin >> res.at(mid);
        if (res.at(mid) == "Vacant")return 0;
        if ((res.at(mid) == res.at(0) && mid % 2 == 0) || (mid % 2 == 1 && res.at(mid) != res.at(0)))left = mid;
        else right = mid;
    }
    cout << "surrender";
}

Measured memory_bytes: 1620
#include<iostream>
#include<string>
int main(){
  int d;
  std::cin >> d;
  std::string s;
  if(d == 22){
    s = "Christmas Eve Eve Eve";
  }else if(d == 23){
    s = "Christmas Eve Eve";
  }else if(d == 24){
    s = "Christmas Eve";
  }else if(d == 25){
    s = "Christmas";
  }else{
    return 0;
  }
  std::cout << s << std::endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int ans = a - (2 * b);
		if(ans > 0){
			System.out.println(ans);
	}else{
		System.out.println("0");
	}
	}

	}

Measured memory_bytes: 25044
#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) begin(x), end(x)
#define debug(x) cout << #x " => " << (x) << endl
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
#endif
using lint = long long;
constexpr int MOD = (int)1e9 + 7;
constexpr double EPS = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

int main(void) {
  int h, w, n;
  cin >> h >> w >> n;
  cout << (n + max(h, w) - 1) / max(h, w) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <queue>
#include <string>

#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using vi = vector<int> ;
using vl = vector<ll>;

int main(){
    int n,k;
    cin >> n >> k;
    vi a(n);
    rep(i,n) cin >> a[i];

    rep(i,n-k){
    //    cout << a[i] << " " << a[k+i] << endl;
        if(a[i] < a[k+i]){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
    

    return 0;
}

Measured memory_bytes: 4052
/**
 * File              : d.cpp
 * Author            : recurze
 * Date              : 22:19 18.01.2019
 * Last Modified Date: 22:22 18.01.2019
 */

#include <stdio.h>
#include <algorithm>

void readInput();
void solve();
void printAns();

int main() {
    int t = 1;
    //scanf("%d", &t);

    for (int tc = 1; tc <= t; ++tc) {
        readInput();
        solve();
        printAns();
    }
}

const int N = 1010101;

int n = 0;
void readInput() {
    scanf("%d", &n);
}

int getPcountinNfact(int n, int p) {
    int ans = 0, po = p;
    while (po <= n) {
        ans += n/po;
        po *= p;
    }
    return ans;
}

int primes[25] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };
int pc[25];
void getPrimeCountInFactorial(int n) {
    int i = 0;
    for (int p: primes) {
        pc[i++] = getPcountinNfact(n, p);
    }
}

int ans = 0;
void solve() {
    getPrimeCountInFactorial(n);
    int x2 = (int) std::count_if(pc, pc + 25, [] (const int i) { return i >= 2; });
    int x4 = (int) std::count_if(pc, pc + 25, [] (const int i) { return i >= 4; });
    int x14 = (int) std::count_if(pc, pc + 25, [] (const int i) { return i >= 14; });
    int x24 = (int) std::count_if(pc, pc + 25, [] (const int i) { return i >= 24; });
    int x74 = (int) std::count_if(pc, pc + 25, [] (const int i) { return i >= 74; });
    ans =
        (x74) + 
        (x2*x24 - x24) + 
        ((x2 - 2) * ((x4*x4 - x4)>>1)) + 
        (x4*x14 - x14);
}

void printAns() {
    printf("%d\n", ans);
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <iomanip>
#include <set>
#include <sstream>
#include <queue>
using namespace std;
typedef long long ll;

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

  int ans = 0;
  for (int i = 0; i < s.size()-1; i++) {
    if (s[i] == s[i+1]) {
      if (s[i] == '0') {
        s[i+1] = '1';
      } else {
        s[i+1] = '0';
      }
      ans++;
    }
  }

  cout << ans << endl;
  return 0;
}

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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define fi first
#define se second
#define setpre(x) cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define out(x) cout << (x) << endl

inline void logger(){ cout << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , ";
    logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 100005;

/* ...o(^-^)o... */

int main(){
    string s; cin >> s;
    int res = 700; rep(i, 3) if(s[i] == 'o') res += 100; out(res);
}

Measured memory_bytes: 256
#include<iostream>
#include<string>

int hon[16]={0};

int n;
int a[16];
int x[16][16],y[16][16];

using namespace std;
void run(int i,const int flag,int *m)
{
	hon[i]=flag;
	if(i!=n)
	{
		run(i+1,1,m);
		run(i+1,0,m);
	}
	else
	{
		int num=0;
		int key=1;
		for(int j=1;j<=n;j++)
		if (hon[j]==1)
		{
			for(int k=1;k<=a[j];k++)
			{
				if (hon[x[j][k]]!=y[j][k])	key=0;	
			}
		}
		if(key==1)
		{
			for(int l=1;l<=n;l++)
			if(hon[l]==1)	
				num++;
			if(num>*m)	*m=num;
		}
	}
}

int main()
{
	int max=0;int *m=&max;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		for(int j=1;j<=a[i];j++)
			cin>>x[i][j]>>y[i][j];
	}
	/*-1不诚实,1诚实*/ 
	run(1,1,m); 
	run(1,0,m);
	cout<<max;
}

Measured memory_bytes: 256
fn read<T: std::str::FromStr>(
    stdin_lock: &mut std::io::StdinLock,
    buf: &mut Vec<u8>,
    delimiter: u8,
) -> T {
    buf.clear();
    let l = std::io::BufRead::read_until(stdin_lock, delimiter, buf).unwrap();
    buf.truncate(l - 1); // remove delimiter
    let s = unsafe { std::str::from_utf8_unchecked(&buf) };
    s.parse().unwrap_or_else(|_| panic!("read"))
}

fn main() {
    let stdin = std::io::stdin();
    let mut stdin_lock = stdin.lock();
    let mut buf: Vec<u8> = Vec::new();
    let a: i32 = read(&mut stdin_lock, &mut buf, b' ');
    let b: i32 = read(&mut stdin_lock, &mut buf, b'\n');

    let ans = if a > 9 || b > 9 {
        -1
    } else {
        a * b
    };
    println!("{}", ans);
}


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

const int mod = 1000000007;
typedef long long LL;
void reduce(int & x) { x += x >> 31 & mod; }
int mul(int a, int b) { return (LL) a * b % mod; }
int pow(int a, int b, int res = 1) {
	for (; b; b >>= 1, a = mul(a, a)) if (b & 1) res = mul(res, a);
	return res;
}
const int MAXN = 3010;
int A[MAXN], n, Q;
int f[MAXN][MAXN];
void eff(int & x, int & y) {
	x = y = mul(x + y, mod + 1 >> 1);
}
int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> n >> Q;
	for (int i = 1; i <= n; ++i) std::cin >> A[i];
	for (int i = 1; i <= n; ++i)
		for (int j = i + 1; j <= n; ++j) if (A[i] != A[j])
			A[i] < A[j] ? ++f[i][j] : ++f[j][i];
	for (int i = 1; i <= Q; ++i) {
		int x, y; std::cin >> x >> y;
		for (int j = 1; j <= n; ++j) if (j != x && j != y) {
			eff(f[x][j], f[y][j]);
			eff(f[j][x], f[j][y]);
		}
		eff(f[x][y], f[y][x]);
	}
	int ans = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j < i; ++j)
			reduce(ans += f[i][j] - mod);
	ans = pow(2, Q, ans);
	std::cout << ans << std::endl;
	return 0;
}


Measured memory_bytes: 35584