akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
typedef long long ll;
template <typename T> void chkmax(T &x, T y) {x = max(x, y); }
template <typename T> void chkmin(T &x, T y) {x = min(x, y); } 
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
namespace NetworkFlow {
	const int INF = 2e9;
	const int MAXP = 2e5 + 5;
	struct edge {
		int dest, flow;
		unsigned pos;
	};
	vector <edge> a[MAXP];
	int tot, s, t, dist[MAXP];
	unsigned curr[MAXP];
	void addedge(int x, int y, int z) {
		a[x].push_back((edge) {y, z, a[y].size()});
		a[y].push_back((edge) {x, 0, a[x].size() - 1});
	}
	int dinic(int pos, int limit) {
		if (pos == t) return limit;
		int used = 0, tmp;
		for (unsigned &i = curr[pos]; i < a[pos].size(); i++)
			if (a[pos][i].flow != 0 && dist[pos] + 1 == dist[a[pos][i].dest] && (tmp = dinic(a[pos][i].dest, min(limit - used, a[pos][i].flow)))) {
				used += tmp;
				a[pos][i].flow -= tmp;
				a[a[pos][i].dest][a[pos][i].pos].flow += tmp;
				if (used == limit) return used;
			}
		return used;
	}
	bool bfs() {
		static int q[MAXP];
		int l = 0, r = 0;
		memset(dist, 0, sizeof(dist));
		dist[s] = 1, q[0] = s;
		while (l <= r) {
			int tmp = q[l];
			for (unsigned i = 0; i < a[tmp].size(); i++)
				if (dist[a[tmp][i].dest] == 0 && a[tmp][i].flow != 0) {
					q[++r] = a[tmp][i].dest;
					dist[q[r]] = dist[tmp] + 1;
				}
			l++;
		}
		return dist[t] != 0;
	}
	int flow() {
		int ans = 0;
		while (bfs()) {
			memset(curr, 0, sizeof(curr));
			ans += dinic(s, INF);
		}
		return ans;
	}
	void getmatch(int n, int *match) {
		for (int i = 2; i <= n; i++) {
			for (auto x : a[i])
				if (x.dest > n && x.flow == 0) {
					match[i] = x.dest - n;
					break;
				}
		}
	}
}
bool vis[MAXN], used[MAXN];
int n, match[MAXN];
pair <int, int> ans[MAXN];
vector <int> a[MAXN], b[MAXN];
int main() {
	read(n);
	NetworkFlow :: s = 1;
	NetworkFlow :: t = n * 2 + 1;
	for (int i = 2; i <= n; i++) {
		int k; read(k);
		NetworkFlow :: addedge(1, i, 1);
		while (k--) {
			int x; read(x);
			a[i].push_back(x);
			b[x].push_back(i);
			NetworkFlow :: addedge(i, x + n, 1);
		}
	}
	for (int i = 1; i <= n; i++)
		NetworkFlow :: addedge(i + n, n * 2 + 1, 1);
	if (NetworkFlow :: flow() < n - 1) {
		puts("-1");
		return 0;
	}
	NetworkFlow :: getmatch(n, match);
	for (int i = 1; i <= n; i++)
		vis[i] = true;
	for (int i = 2; i <= n; i++)
		vis[match[i]] = false;
	queue <int> q;
	for (int i = 1; i <= n; i++)
		if (vis[i]) {
			for (auto x : b[i]) {
				q.push(x);
				used[x] = true;
			}
		}
	while (!q.empty()) {
		int tmp = q.front();
		for (auto x : a[tmp])
			if (vis[x]) {
				ans[tmp] = make_pair(x, match[tmp]);
				break;
			}
		vis[match[tmp]] = true;
		for (auto x : b[match[tmp]])
			if (!used[x]) {
				q.push(x);
				used[x] = true;
			}
		q.pop();
	}
	for (int i = 2; i <= n; i++)
		if (ans[i].first == 0) {
			puts("-1");
			return 0;
		}
	for (int i = 2; i <= n; i++)
		printf("%d %d\n", ans[i].first, ans[i].second);
	return 0;
}

Measured memory_bytes: 38708
n = int(input())
a = [0] + list(map(int,input().split()))
def heapSort(a, i):
    global n
    l = 2 * i
    r = 2 * i + 1
    largest = l if l <= n and a[l] > a[i] else i
    if r <= n and a[r] > a[largest]:
        largest = r
    if largest != i:
        a[largest], a[i] = a[i], a[largest]
        heapSort(a, largest)

for i in range(int( n / 2 ), 0, -1):
    heapSort(a, i)
print(" "+" ".join(map(str,a[1:])))



Measured memory_bytes: 64172
S=input()
cnt=0
cnt2=0
for i in range(len(S)):
    if i%2==0:
        if S[i]=='0':
            continue
        else:
            cnt+=1
    else:
        if S[i]=='1':
            continue
        else:
            cnt+=1
for t in range(len(S)):
    if t%2==0:
        if S[t]=='1':
            continue
        else:
            cnt2+=1
    else:
        if S[t]=='0':
            continue
        else:
            cnt2+=1
print(min(cnt,cnt2))

Measured memory_bytes: 3188
n = int(input())
s = list(input())
num = 0

if n%2 == 1:
  print("No")
  exit(0)

for i in range(int(n/2)):
  if s[i] == s[i+int(n/2)]:
    num += 1
    
if num == int(n/2):
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
  string a, b, c;
  cin >> a >> b >> c;
  
  if(a[a.size()-1]==b[0] && b[b.size()-1]==c[0]){
    cout << "YES" << endl;
  }
  
  else{
    cout << "NO" << endl;
  }
}


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
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    def bfs(s,g,n):
        bfs_map = [-1 for i in range(n)]
        bfs_map[s] = 0
        q = deque()
        q.append(s)
        fin = False
        while q:
            x = q.popleft()
            for y in range(n):
                if c[x][y] > 0 and bfs_map[y] < 0:
                    bfs_map[y] = bfs_map[x]+1
                    if y == g:
                        fin = True
                        break
                    q.append(y)
            if fin:
                break

        if bfs_map[g] == -1:
            return [None,0]
        path = [None for i in range(bfs_map[g]+1)]
        m = float("inf")
        path[bfs_map[g]] = g
        y = g
        for i in range(bfs_map[g])[::-1]:
            for x in range(n+1):
                if c[x][y] > 0 and bfs_map[x] == bfs_map[y]-1:
                    path[i] = x
                    if c[x][y] < m:
                        m = c[x][y]
                    y = x
                    break
        return [path,m]

    def ford_fulkerson(s,g,c,n):
        while 1:
            p,m = bfs(s,g,n)
            if not m:break
            for i in range(len(p)-1):
                c[p[i]][p[i+1]] -= m
                c[p[i+1]][p[i]] += m
        return sum(c[g])
    h,w = LI()
    a = SR(h)
    c = [[0 for i in range(h+w+2)] for j in range(h+w+2)]
    for y in range(h):
        for x in range(w):
            if a[y][x] == "S":
                c[0][y+1] = float("inf")
                c[0][h+x+1] = float("inf")
            if a[y][x] == "T":
                c[y+1][h+w+1] = float("inf")
                c[h+x+1][h+w+1] = float("inf")
            if a[y][x] == "o":
                c[y+1][h+x+1] = 1
                c[h+x+1][y+1] = 1
    ans = ford_fulkerson(0,h+w+1,c,h+w+2)
    if ans == float("inf"):
        print(-1)
    else:
        print(ans)
#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    F()


Measured memory_bytes: 4212
#include<iostream>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= end; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return 0;}
template<typename T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return 0;}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> A = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int K;
    cin >> K;
    cout << A[K - 1] << endl;
    return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()

	var a []int
	for i := 0; i < n; i++ {

		tmp := nextInt()
		if len(a) == 0 {
			a = append(a, tmp)
			continue
		}

		// skip same value
		if tmp == a[len(a)-1] {
			continue
		}
		a = append(a, tmp)
	}

	var tani []int
	var yama []int
	for i := 0; i < len(a); i++ {
		if len(tani) == 0 {

			if i == len(a)-1 {
				// ずっと下がってるもしくは、変化ないケース
				continue
			}

			if a[i] > a[i+1] {
				//下がってたら除外
				continue
			}
			// 最初の底
			tani = append(tani, a[i])
			continue
		}
		if i == len(a)-1 {
			if a[i-1] > a[i] {
				tani = append(tani, a[i])
			} else {
				yama = append(yama, a[i])
			}
			continue
		}

		if a[i-1] < a[i] && a[i] > a[i+1] {
			yama = append(yama, a[i])
			continue
		}

		if a[i-1] > a[i] && a[i] < a[i+1] {
			tani = append(tani, a[i])
			continue
		}

	}
	//fmt.Println(tani)
	//fmt.Println(yama)
	money := 1000
	for i := 0; i < len(yama); i++ {
		kabu := money / tani[i]
		money = money % tani[i]

		money += kabu * yama[i]
	}

	fmt.Println(money)
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}


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

int main(){
	int n;
	while(cin >> n){
		long long int res = 0;
		for(int i = 0;i <= 1000;i++){
			for(int j = 0;j <= 1000;j++){
				if(n - i - j <= 1000) res += max(0,n - i - j + 1);
				else res += max(0,2001 - (n - i - j));
			}
		}
		cout << res << endl;
	}
	return 0;
}

Measured memory_bytes: 3092
n = int(input())
li = list(map(int, input().split()))
dd = {}
for i in range(1, n+1):
    dd[i] = 0
for i in range(n):
    dd[li[i]] += i+1

an = []
for i in range(1, n+1):
        an.append(str(dd[i]))

ans = ' '.join(an)
print(ans)

Measured memory_bytes: 68832
n = gets.to_i
numbers = []

n.times do
  numbers << gets.to_i
end

def insertionSort(a, n, g, cnt)
  for i in (g..(n-1))
    v = a[i]
    j = i - g
    while j >= 0 && a[j] > v
      a[j+g] = a[j]
      j -= g
      cnt += 1
    end
    a[j+g] = v
  end
  return cnt
end

def shellSort(numbers, n)
  garray = g(n)
  m = garray.length
  cnt =	0
  for i in (0..(m-1))
    cnt = insertionSort(numbers, n, garray[i], cnt)
  end
  puts m
  puts garray.join(" ")
  puts cnt
  puts numbers
end

def g(n)
  x = 1
  g = []
  while true
    g << x
    x = 3 * x + 1
    if n <= x
      break
    end
  end
  g.reverse
end

shellSort(numbers, n)


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define ll long long
static const int MAX = 10000;
static const ll INFTY = 1e12;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const ll MRINF = 5000000000000000;

int main() {

  int N, D, X;
  cin >> N >> D >> X;
  vector<int> A(N);
  REP(i, N)cin >> A[i];
  ll ans = 0;
  REP(j, N){
    for(int i = 1; i <= D;){
      i += A[j];
      ans++;
    }
  }
  cout << ans+X << endl;
    

}
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//cout << fixed << setprecision(17) << res << endl;
 
int main() {
    ll n;
    cin >> n;
    vector<ll> C(n, 0);
    vector<ll> A(n-1);
    for (auto & a : A) cin >> a;

    for (ll i = 0; i < n-1; ++i) {
        C[A[i]-1]++;
    }

    for (auto & c : C) cout << c << endl;
}


Measured memory_bytes: 6428
#include<stdio.h>
#include<string.h>
#include<math.h>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define lln long long int

int main(){
	int n,s[102];
	int min = 101, sum = 0;
	scanf("%d",&n);
	FOR(i,0,n){
		scanf("%d",&s[i]);
		sum += s[i];
		if(min > s[i] && s[i] % 10 != 0) min = s[i];
	}

	if(sum % 10 != 0) printf("%d\n",sum);
	else if(min > 100) printf("0\n");
	else printf("%d\n",sum - min);
}

Measured memory_bytes: 128
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cerr<<*i<<" "; cerr<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

struct UnionFind {
  vector<int> data;
  UnionFind(int N) : data(N, -1) { }
  bool uni(int x, int y) {
    x = root(x); y = root(y);
    if (x != y) {
      if (data[x] > data[y]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  bool find(int x, int y) {
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  int size(int x) {
    return -data[root(x)];
  }
};

struct edge{
  int src, dst, cost;
  edge(int s, int d, int c) : src(s), dst(d), cost(c) {}
  edge() {}
  bool operator< (const edge& e) const {
    return cost < e.cost;
  }
};

int main(){
  int N;
  cin>>N;
  vector<edge> v(N - 1);
  REP(i, N - 1){
    int a, b, c;
    cin>>a>>b>>c;
    v[i] = edge(a, b, c);
  }
  UnionFind uf(N);
  sort(v.begin(), v.end());
  ll ans = 0;
  REP(i, N - 1){
    ans += (ll)uf.size(v[i].src) * uf.size(v[i].dst) * v[i].cost;
    uf.uni(v[i].src, v[i].dst);
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 4172
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "C:\Users\navodit\Desktop\mycodes\pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  

const int N = 1e5+5;
vi g[N+1];
void solve(){
	int n, m ;
	cin >> n >> m; 
	rep(i,0,n){
		int a , b;
		cin >> a >> b; 
		if(a<=m){
			g[a].pb(b);
		}
	}
	priority_queue<int>pq;
	int ans = 0 ;
	fr(i,1,m){
		trav(j,g[i]){
			pq.push(j);
		}
		if(sz(pq)){
			int val = pq.top();
			pq.pop();
			ans+=val;
		}
	}
	cout << ans << endl;
	
}  

signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


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

int main() {
  int H, W;
  cin >> H >> W;
  
  for (int i = 0; i < W + 2; i++) cout << "#";
  cout << endl;
  
  for (int i = 0; i < H; i++) {
    string a;
    cin >> a;
    cout << "#" << a << "#" << endl;
  }

  for (int i = 0; i < W + 2; i++) cout << "#";
  cout << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <set>
#include <queue>
#include <stack>
#include <map>

using namespace std;
typedef int status;
typedef long long LL;
const int INF = int(1e9);
const int MAX = 400002;

char a[MAX];
int b[4] = {0} ;

int main()
{

    cin>>a;
    int len = strlen(a);

    for(int i = 0;i<len;i++)
    {
        b[a[i]-'a'+1]++;
    }
    int x,y,z;

    if(b[1]<=b[2]&&b[1]<=b[3])
    {
        x = b[1],y = b[2],z = b[3];
    }
    if(b[2]<=b[1]&&b[2]<=b[3])
    {
        x = b[2],y = b[1],z = b[3];
    }
    if(b[3]<=b[1]&&b[3]<=b[2])
    {
        x = b[3],y = b[2],z = b[1];
    }
    if(y-x<=1&&z-x<=1)
    {
        cout<<"YES"<<endl;
    }
    else
    {
        cout<<"NO"<<endl;
    }


    return 0;
}


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

int main(){
  int h,w;

  while(1){
    cin>>h>>w;

    if (h==0 && w==0) break;

    for(int i=0;i<h;i++){
      for (int j=0;j<w;j++){
        if ((i+j)%2==0) cout<<"#";
        else cout<<".";
      }
      cout<<endl;
    }
    cout<<endl;
  }
  return 0;
}


Measured memory_bytes: 3092
#include <iostream>
#include <sstream>
using namespace std;
int main() {
    int H,W,i;
    string tpbtmF,mdlF;
    while(cin>>H>>W && (H!=0 || W!=0)){
        tpbtmF = string(W,'#');
        stringstream ss;
        ss << "#";
        if (W>2) ss << string(W-2,'.');
        if (W>=2) ss << "#";
        mdlF = ss.str();

        cout << tpbtmF << endl;
        for (i=1;i<H-1;i++) {
            cout << mdlF << endl;
        }
        if (H>=2) cout << tpbtmF << endl;
        cout << endl;
    }
    return 0;
}

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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int main() {
  in(int, n);
  out((n + 999) / 1000 * 1000 - n);
}


Measured memory_bytes: 3636
#include<stdio.h>
int main()
{
    int x;
    scanf("%d", &x);
    if(x >= 400 && x <= 599)
        printf("8\n");
    else if(x >= 600 && x <= 799)
        printf("7\n");
    else if(x >= 800 && x <= 999)
        printf("6\n");
    else if(x >= 1000 && x <= 1199)
        printf("5\n");
    else if(x >= 1200 && x <= 1399)
        printf("4\n");
   else  if(x >= 1400 && x <= 1599)
        printf("3\n");
   else  if(x >= 1600 && x <= 1799)
        printf("2\n");
   else
        printf("1\n");
    return 0;
}


Measured memory_bytes: 1612
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>

#include <iomanip>

#include <algorithm>

#include <vector>

#include <stack>

#include <queue>

#include <cmath>

#include <set>

#include <map>

#include <string>

#include <numeric>

#include <cstdio>

#include <cstdlib>

#include <ctime>

#include <iterator>

#include <cstring>

using namespace std;


const int INF = 10000000;

typedef pair<int, int> P;
typedef long long ll;
#define PB push_back
#define rep(i, a) for (int i = 0; i < (a); i++)

//char maze[100][101];

ll n, m;

int sx, sy;

int gx, gy;

int qqq;

//各座標までの最短距離

int d[100][100];


//移動方向のベクトル

int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };

int ans = 0;
pair<int, int> red[101], blue[101];
//ll a[200000], b[20000];

//ユークリッドの互除法
ll gcd(ll x, ll y) {
	if (x < y) swap(x, y);
	if (y == 0) return x;
	return gcd(y, x%y);
}

int isPrime(int x) {
	int i;
	if (x < 2) return 0;
	else if (x == 2) return 1;
	if (x % 2 == 0) return 0;
	for (int i = 3; i*i <= x; i += 2)
		if (x%i == 0) return 0;
	return 1;
}

int v_find(std::vector<int> vec, int number) {
	auto itr = std::find(vec.begin(), vec.end(), number);
	if (itr != vec.end()) { // 発見できたとき
		return 1;
	}
	else { // 発見できなかったとき
		return 0;
	}
}

int ok = 1000; //解が存在する値
int ng = -1;   //解が存在しない値

ll BIG = 10000000000;

ll POW(ll a, ll b) {
	if (b == 0) return 1;
	return (a*POW(a, b - 1)) % BIG;
}

int Kaijou(int a) {
	if (a < 2) return 1;
	return a * Kaijou(a - 1);
}


ll aa[51];

int main() {
	cin >> n;
	int sum = 0;
	int po[19999] = { 0 };
	int k = 0;
	for (int i = 0; i < n - 1;++i) {
		if (i == 0) k = 2;
		else if (i == 1) k = 3;
		else {
			k = po[i-1]+1;
			while (gcd(k, po[i - 2]) == 1) {
				k++;
			}
		}
		po[i] = k;
		cout << po[i] << " ";
		sum += k;
	}
	int mod[20000] = { 0 };
	k = 0;
	ans = 2;
	int yo[20000] = { 0 };
	for (int i = 0; i < n - 1; ++i) {
		int j = po[i];
		for (int s = j / 2; s > 1; --s) {
			if (j%s == 0) {
				j /= s;
				break;
			}
		}
		mod[i] = (sum - j) % j ;
		yo[i] = j;
	}
	int f = 1;
	while (1) {
		f = 1;
		for (int i = 0; i < n - 1; ++i) {
			if ((ans % yo[i] + mod[i]) % (yo[i])||(ans==po[i])) {
				f = 0;
				break;
			}
		}
		if (gcd(ans, sum) == 1) f = 0;
		if (f) {
			break;
		}
		else {
			ans++;
		}
		if (ans > 30000) {
			cout << "Error";
			break;
		}
	}
	cout <<ans<<endl;
	cin >> qqq;
   return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<iomanip>
#include<string>
#include<set>
#include<vector>
#include<utility>
#include<algorithm>

using namespace std;

#define LL long long
string s;
int x;

int main() {
	cin >> x;
	cout << x * x * x << endl;
	return 0;
}


Measured memory_bytes: 3148
#include <bits/stdc++.h>
  using namespace std;
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) int ab;cin>>ab;(p).push_back(ab);
#define vecpl2(p) long long ab;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define set0(k,n) for(int nn=0;nn<(n);nn++){ (k).push_back(0); }
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define vecsize(b,size) vector<int> (b)((size));
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsl(s) vector<pair<ll,ll>> (s);
#define pairss(s) vector<pair<string,string>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairspl(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsps(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define pairsREV(s) (s).push_back(make_pair(bb,aa));
#define pairslREV(s) (s).push_back(make_pair(bb,aa));
#define pairssREV(s) (s).push_back(make_pair(bb,aa));
#define MOD 1000000007

int main() {
	
	int X,Y,Z;
	cin>>X>>Y>>Z;
	int A=(X-Z*2)/(Y+Z);
	if((X-A*(Y+Z)-Z*2)/Y>0&&(X-A*(Y+Z)-Z*2)>0){A++;}
	ce(A)
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <map>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;

int main(void) {
	int n,temp,ans=0;
	cin >> n;
	for(int i=0; i<n; i++){
		cin >> temp;
		ans+=temp-1;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int ara[210000];
int main(){

    int n,x,i;
    cin>>n;
    for(i=1;i<n;i++){
        cin>>x;
        ara[x]++;
    }
    for(i=1;i<=n;i++){
        cout<<ara[i]<<endl;
    }

}



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

#define pb push_back
#define ff first
#define ss second

typedef long long ll;
typedef pair<int, int> pii;

int n, a;
vector<int> v;
vector<int> ans;

int main() {
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> a, v.pb(a);
	while (v.size()) {
		vector<int> tmp;
		int ind = -1;
		for (int i = 0; i < v.size(); i++)
			if ((ind == -1 || v[ind] <= v[i]) && i + 1 == v[i])
				ind = i;
		if (ind == -1)
			return cout << -1 << endl, 0;
		for (int i = 0; i < v.size(); i++)
			if (i != ind)
				tmp.pb(v[i]);
		ans.pb(ind + 1);
		swap(v, tmp);
	}
	reverse(ans.begin(), ans.end());
	for (auto i : ans)
		cout << i << endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
		}
        sc.close();

        Arrays.sort(a);
        Arrays.sort(b);
        if (n % 2 == 1) {
        	System.out.println(b[n / 2] - a[n / 2] + 1);
        } else {
        	System.out.println((b[n / 2 - 1] + b[n / 2]) - (a[n / 2 - 1] + a[n / 2]) + 1);
        }
	}
}


Measured memory_bytes: 62560
// Problem : B - Minor Change
// Contest : AtCoder - AtCoder Beginner Contest 172
// URL : https://atcoder.jp/contests/abc172/tasks/abc172_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sort(a) sort(all(a))
#define ff first
#define ss second
#define vi vector<int>
#define pii pair<int, int>
#define vll vector<ll>
#define pll pair<ll,ll>
#define mod (int)1e9+7
#define FAST std::ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define repf(i,a,b) for(i=a;i<b;i++)
#define repb(i,a,b) for(i=a;i>=b;i--)
#define N 100005
int main()
{
	FAST
    int t=1;
    // cin>>t;
    while(t--)
    {
    	int i;
		string s1,s2;
		cin>>s1>>s2;
		int ans=0;
		repf(i,0,s1.size())
		{
			if(s1[i]!=s2[i]) ans++;
		}
		cout<<ans;
    }
    return 0;
} 


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

int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int stime = max(a, c);
  int ftime = min(b, d);
  
  int ans = 0;
  ans = max(0, ftime - stime);
  cout << ans << endl;
  return 0;
}

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

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    ll sum = 0;
    for(int i = 1; i < n; i++){
        if(a[i] < a[i-1]){
            sum += a[i-1] - a[i];
            a[i] = a[i-1];
        }
    }
    cout << sum << endl;
    return 0;
}

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

int main(){
    double a,b,c,d,e,f,tem,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        tem=a*e-b*d;
        x=(c*e-b*f)/tem;
        y=(a*f-c*d)/tem;
        if(x==0)x=0;
        if(y==0)y=0;
        printf("%.3f %.3f\n",x,y);
    }
}

Measured memory_bytes: 3108
#include<iostream>
#include<fstream>
#include<sstream>
#include<algorithm>
#include<cstdio>
#include<cassert>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<deque>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<iomanip>
#include<utility>
#include<functional>
using namespace std;
int n,m;
int d[60][105];
int ans;
int prime[60];
int main()
{
	cin>>n;
	for(int i=2;i<=n;i++)
	{
		int t=i;
		for(int j=0;j<m;j++)
		{
			int p=prime[j];
			while(t%p==0)
			{
				t=t/p;
				d[j][i]++;
			}
		}
		if(t==i)
		{
			prime[m]=i;
			d[m][i]++;
			m++;
		}
	}
	for(int i=1;i<=n;i++)
		for(int j=0;j<m;j++)
			d[j][i]+=d[j][i-1];
	//1
	for(int j1=0;j1<m;j1++)
		if(d[j1][n]>=74)
			ans++;
	//2,3
	for(int j1=0;j1<m;j1++)
		for(int j2=0;j2<m;j2++)
		{
			if(j1!=j2&&d[j1][n]>=2&&d[j2][n]>=24)
				ans++;
			if(j1!=j2&&d[j1][n]>=4&&d[j2][n]>=14)
				ans++;
		}
	//4
	for(int j1=0;j1<m;j1++)
		for(int j2=0;j2<m;j2++)
			for(int j3=j2;j3<m;j3++)
				if(j1!=j2&&j2!=j3&&j1!=j3&&d[j1][n]>=2&&d[j2][n]>=4&&d[j3][n]>=4)
					ans++;
	cout<<ans<<endl;
	return 0;
}



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

typedef long long ll;
#define ar array
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define fork(i, n) for (ll i = 0; i < (n); i++)
#define forn for (ll i = 0; i < (n); i++)
#define fori(i, k, n) for (ll i = k; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define en '\n'
#define FILL(x, v) memset(x, v, sizeof(x))
#define pb push_back
#define fast                     \
	ios::sync_with_stdio(false); \
	cin.tie(NULL);               \
	cout.tie(NULL);

template <typename A, typename B>
inline void chmin(A &a, B b)
{
	if (a > b)
		a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b)
{
	if (a < b)
		a = b;
}
template <typename T>
void print(vector<T> &a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}
template <typename T>
void print(deque<T> &a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
	cout << en;
}
template <typename T>
void print(vector<vector<T>> &a)
{
	for (int i = 0; i < a.size(); i++)
	{
		for (int j = 0; j < a[i].size(); j++)
			cout << a[i][j] << ' ';
		cout << en;
	}
}

int main()
{
	fast;
	string s, t;
	cin >> s >> t;
	int n = s.size();
	int ans = 0;
	for (int i = 0; i < n; i++)
		if (s[i] != t[i])
			ans++;
	cout << ans << en;
}

Measured memory_bytes: 3764
#include <iostream>
#define N 505

char red[N][N], blue[N][N], buffer[N];

int main()
{
	int n, m; scanf("%d%d", &n, &m);
	for(int i = 0; i < n; i++)
	{
		std::fill(red[i], red[i] + m, i&1 ? '#' : '.');
		std::fill(blue[i], blue[i] + m, i&1 ? '.' : '#');
		red[i][0] = blue[i][m-1] = '#';
		red[i][m-1] = blue[i][0] = '.';
		scanf("%s", buffer);
		for(int j = 0; j < m; ++j)
			if(buffer[j] == '#') red[i][j] = blue[i][j] = '#';
	}

	for(int i = 0; i < n; ++i)
		printf("%s\n", red[i]);

	printf("\n");

	for(int i = 0; i < n; ++i)
		printf("%s\n", blue[i]);
	return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
typedef long double lb;
typedef vector<int,vector<int>> vvec;
typedef long double ld;

//----***Like a Pythonista***----
#define REP(i,j,n) for (ll i=j;i<(n);i++)
#define RREP(i,n,j) for (ll i = n; j<i;i--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(all(__VA_ARGS__),0LL)
#define dsum(...) accumulate(all(__VA_ARGS__),0.0L)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(all(a)); }
template<class T> inline auto min(const T& a){ return *min_element(all(a)); }
inline ll gcd(ll a, ll b){ while(b){ ll c = b; b = a % b; a = c; } return a; }
inline ll lcm(ll a, ll b){ if(!a || !b) return 0; return a * b / gcd(a, b); }

//----***定数***----
const int MOD=1000000007;
#define INF 1e9;
#define EPS 1e-9;

//----***入出力***----
#define print(out) cout<< out  << "\n";
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
#define HERE  cout<<"Here"<<endl;

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}initial_;

int N,K,a;
string S;
signed main(){
  cin>>K>>N;
  vector<int> A(N);
  A[0]=0;
  REP(i,0,N){
    cin>>A[i];
  }
  int max_d=-1,dist;

  vector<int> dist1(N+1);
  REP(i,1,N){
    dist=A[i]-A[i-1];
    max_d=max(max_d,dist);
  }
  max_d=max(abs(A[N-1]-(K+A[0])),max_d);
  print((K-max_d))
  
}


Measured memory_bytes: 3328
#include <iostream>
using namespace std;
int main() {
  string s;
  cin >> s;
  int counter = 700;
  if (s.at(0) == 'o') counter += 100;
  if (s.at(1) == 'o') counter += 100;
  if (s.at(2) == 'o') counter += 100;
  
  cout << counter << endl;
}


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

int main(){
	int r, g, b;

	cin >> r >> g >> b;

	int num = 100 * r + 10 * g + b;
	if(num % 4 == 0){
		cout << "YES";
	} else {
		cout << "NO";
	}

}


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

using namespace std;
using ll = long long;

#define rep(i, a) for (int i = 0; (i) < (int) (a); (i)++)
#define reps(i, a, b) for (int i = (int) (a); (i) < (int) (b); (i)++)
#define rrep(i, a) for (int i = (int) a-1; (i) >= 0; (i)--)
#define rreps(i, a, b) for (int i = (int) (a)-1; (i) >= (int) (b); (i)--)
#define MP(a, b) make_pair((a), (b))
#define PB(a) push_back((a))
#define all(v) (v).begin(), (v).end()
#define PERM(v) next_permutation(all(v))
#define UNIQUE(v) sort(all(v));(v).erase(unique(all(v)), v.end())
#define CIN(type, x) type x;cin >> x
#define TRUE__  "Yes"
#define FALSE__ "No"
#define PRINT(f) if((f)){cout << (TRUE__) << endl;}else{cout << FALSE__ << endl;}
#define RS(N) resize(N)
#define CINV(v, N) do {\
	v.RS(N);\
	rep(i, N) cin >> v[i];\
} while (0);
#define RCINV(v, N) do {\
	v.RS(N);\
	rrep(i, N) cin >> v[i];\
} while (0);

#define MOD 1000000007

void init();
void solve();

signed main()
{
	init();
	solve();
}

void init()
{
	int n, a;
	cin >> n >> a;
	cout << n - a + 1 << endl;
	
}

void solve()
{

}





Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		int ans = 0;
		Scanner scan = new Scanner(System.in);
		int W = scan.nextInt();
		int a = scan.nextInt();
		int b = scan.nextInt();
		if(a < b) {
			ans = b - (a + W);
		}else {
			ans = a - (b + W);
		}
		if(ans < 0) ans = 0;
		System.out.println(ans);
		scan.close();
	}
}


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

int main() {
  int x;
  cin >> x;
  
  vector<bool> expo(x+1,false);
  expo[1] = true;
  for (int i=2; i<=x; i++) {
    int v = i*i;
    while (v<=x) {
      expo[v] = true;
      v *= i;
    }
  }
  
  for (int i=x; i>=1; i--) {
    if (expo[i]) {
      cout << i << endl;
      return 0;
    }
  }
}

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

#define pp push_back
#define pf push_front
#define mp make_pair
#define fs first
#define sc second
#define sf scanf

typedef long long ll;
typedef unsigned long long ull;

using namespace std;

const int N = (int) 1e9;

int main(int argc, char *argv[])
{
	// ios_base::sync_with_stdio(false);
	// cin.tie(NULL);

	int n, m;
	sf("%d %d", &n, &m);
	pair<int, int> a[m];
	for (int i = 0; i < m; ++i) {
		int x, y;
		sf("%d %d", &x, &y);
		a[i] = mp(x, y);
	}
	sort(a, a + m);

	int ans = 1;
	for (int i = 1; i < m; ++i) {
		if (a[i].fs >= a[i-1].sc) {
			++ans;
		}
		else {
			a[i].sc = min(a[i-1].sc, a[i].sc);
		}
	}
	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 1024
from sys import stdin
import math

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])

    return arr


def main():
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    N_fac = factorization(N)
    cnt = 0
    if N == 1:
        pass
    else:
        for fac,power in N_fac:
            for i in range(power+10):
                if i*(i+1)/2 > power:
                    i -= 1
                    cnt += i
                    break
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)


if __name__ == "__main__":
    main()


Measured memory_bytes: 63604
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n, ans = 0;
  cin >> n;
  
  vector<int> d(n);
  
  for(int i = 0; i < n; i++){
    cin >> d.at(i);
  }
  
  for(int i = 0; i < n - 1; i++){
    for(int j = i + 1; j < n; j++){
      ans += d.at(i) * d.at(j);
    }
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 256
# coding: utf-8

N = input()
N = int(N)
Data = input().split(" ")
for i in range(N):
  Data[i] = int(Data[i])

LoopCount = 0
while(1):
  PerCount = 0
  tmp = [0 for i in range(N)]
  for i in range(N):
    if(Data[i] % 2 == 0):
      tmp[i] = int(Data[i]/2)
      PerCount = PerCount + 1
  if(PerCount == N):
    Data = tmp
    LoopCount = LoopCount + 1
  else:
    break
print(LoopCount)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
bool check(string s){
  int n=s.size();
  n/=2;
  bool ans=true;
  for(int i=0;i<n;i++){
    if(s[i]!=s[n+i]) ans=false;
  }
  return ans;
}
int main() {
  string s;
  cin>>s;
  int n=s.size();
  while(true){
    n-=2;
    s.erase(n);
    if(check(s)) break;
  }
  cout<<n<<endl;
}


Measured memory_bytes: 256
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
template <typename Q_type>
using smaller_queue = priority_queue<Q_type, vector<Q_type>, greater<Q_type>>;

constexpr int MOD_TYPE = 2;
constexpr ll MOD = (MOD_TYPE == 1 ? (ll)(1e9 + 7) : 998244353);
constexpr int INF = (int)1e9;
constexpr ll LINF = (ll)4e18;
constexpr ld PI = acos(-1.0);
constexpr ld EPS = 1e-11;
constexpr int Dx[] = {0, 0, -1, 1, -1, 1, -1, 1, 0};
constexpr int Dy[] = {1, -1, 0, 0, -1, -1, 1, 1, 0};

#define REP(i, m, n) for (ll i = m; i < (ll)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << "\n"
#define Yes(n) cout << ((n) ? "Yes" : "No") << "\n"
#define possible(n) cout << ((n) ? "possible" : "impossible") << "\n"
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << "\n"
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << "\n"
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x) cerr << #x << ":" << x << "\n";

#pragma endregion

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(20) << setiosflags(ios::fixed);
  int a, b;
  cin >> a >> b;
  Yes(a % 2 == 1 && b % 2 == 1);

  return 0;
}


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

// Shortcut

#define int long long
#define ld long double
#define endl '\n'
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#define For(i, l, r) for (int i = l; i < r; i++)
#define ForE(i, l, r) for (int i = l; i <= r; i++)
#define Ford(i, r, l) for (int i = r; i > l; i--)
#define FordE(i, r, l) for (int i = r; i >= l; i--)
#define Fora(i, a) for (auto i : a)

// I/O & Debug

#define PrintV(a) for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
#define PrintVl(a) for (int i = 0; i < a.size(); i++) cout << a[i] << endl;
#define PrintA(a, n) for (int i = 0; i < n; i++) cout << a[i] << ' ';
#define PrintAl(a, n) for (int i = 0; i < n; i++) cout << a[i] << endl;
#define Ptest(x) return cout << x, 0;
#define gl(s) getline(cin, s);
#define setpre(x) fixed << setprecision(x)
#define debug(args...){ string _sDEB = #args; replace(_sDEB.begin(), _sDEB.end(), ',', ' '); stringstream _ssDEB(_sDEB); istream_iterator<string> _itDEB(_ssDEB); DEB(_itDEB, args); }
void DEB(istream_iterator<string> it) {}
template<typename T, typename... Args>
void DEB(istream_iterator<string> it, T a, Args... args){
	cout << *it << " = " << a << endl;
	DEB(++it, args...);
}

// Functions

#define bend(a) a.begin(),a.end()
#define mset(a) memset(a, 0, sizeof(a));
#define sortV(a) sort(bend(a));
#define sortA(a, n) sort(a, a + n);
#define rev(s) reverse(bend(a));

// Data Structure

#define pque priority_queue
#define mts multiset
typedef vector <int> vi;
typedef pair <int, int> ii;
typedef vector <vi > vvi;
typedef vector <ii > vii;

const int N = 1e5 + 5, mod = 1e9 + 7, inf = 1e18 + 7;

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int t, x;
    cin >> t >> x;
    cout << fixed << setprecision(9) << 1.0 * t / x;
}

/*
----------------------------------+
INPUT:                            |
==============================    |

==============================    |
----------------------------------+
OUTPUT:                           |
==============================    |

==============================    |
----------------------------------+
*/

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
using namespace std;
int main() {
	int D;
	scanf("%d", &D);
	int c[26], s[D][26], t[D], last[26], bst = -10000000, ans[D];
	for (int i = 0; i < 26; ++i) scanf("%d", &c[i]);
	for (int i = 0; i < D; ++i) {
		for (int j = 0; j < 26; ++j) scanf("%d", &s[i][j]);
	}
	for (int h = 0; h < 365; ++h) {
		fill_n(last, 26, -1);
		for (int i = 0; i < D; ++i) {
			int x = -10000000, opt = 0;
			for (int j = 0; j < 26; ++j) {
				if (c[j] * (i - last[j] + h) + s[i][j] > x) x = c[j] * (i - last[j] + h) + s[i][j], opt = j;
			}
			last[opt] = i;
			t[i] = opt;
		}
		fill_n(last, 26, -1);
		int sc = 0;
		for (int i = 0; i < D; ++i) {
			last[t[i]] = i;
			sc += s[i][t[i]];
			for (int j = 0; j < 26; ++j) sc -= c[j] * (i - last[j]);
		}
		if (sc > bst) {
			bst = sc;
			for (int i = 0; i < D; ++i) ans[i] = t[i];
		}
	}
	for (int i = 0; i < D; ++i) printf("%d\n", ans[i] + 1);
	return 0;
}

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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 60;
const int mod = 1000000007;
//const int mod = 998244353;
//const int mod = 100000;
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};

int main()
{
  vector<int> vec(3);
  rep(i, 3) cin >> vec[i];
  int max_x = *max_element(ALL(vec));
  rep(i, 3) vec[i] = max_x - vec[i];
  int odd = 0;
  rep(i, 3) if(vec[i]%2==1) ++odd;
  int ans = 0;
  rep(i, 3) ans += vec[i]/2;

  if(odd == 2) ++ans;
  else if(odd==1) ans += 2;

  cout << ans << endl;
}


Measured memory_bytes: 3628
#pragma region include
#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <tuple>
#include <bitset>

#include <queue>
#include <complex>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <fstream>
#include <random>
//#include <time.h>
#include <ctime>
#pragma endregion //#include
/////////
#define REP(i, x, n) for(int i = x; i < n; ++i)
#define rep(i,n) REP(i,0,n)
#define ALL(X) X.begin(), X.end()
/////////
#pragma region typedef
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef std::pair<LL,LL> PLL;//
typedef std::pair<int,int> PII;//
#pragma endregion //typedef
////定数
const int INF = (int)1e9;
const LL MOD = (LL)1e9+7;
const LL LINF = (LL)1e18+20;
const double PI = acos(-1.0);
const double EPS = 1e-9;
/////////
using namespace::std;

int isNo(int n){
	if( n== 2 ){
		return 0;
	}else if( n== 4 || n==6 || n==9 || n==11 ){
		return 1;
	}else{
		return 2;
	}
}

void solve(){
	int X,Y;
	cin >> X >> Y;
	if( isNo(X) == isNo(Y) ){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
}

#pragma region main
signed main(void){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}
#pragma endregion //main()

Measured memory_bytes: 256