akhauriyash/Code-Regression huggingface dataset:
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		// スペース区切りの整数の入力
		int b = sc.nextInt();
                int c = a+b;
                if(c>=10){
                    System.out.println( "error");
                } else {
		// 出力
		System.out.println(c);
                }
	}
}

Measured memory_bytes: 21972
#import"bits/stdc++.h"
using namespace std;
#define o bool
#define l int
#define v vector<l>
l n;o h(v a,v b){o r=1;for(l i=0;i<n;i++)r&=(a[i]!=b[i]);return r;}void f(o g,v a){cout<<(g?"Yes\n":"No\n");if(g)for(l e:a)cout<<e<<'\n';exit(0);}l main(){cin>>n;v a(n),b(n),c;for(l&e:a)cin>>e;for(l&e:b)cin>>e;c=b;reverse(begin(b),end(b));rotate(begin(c),begin(c)+(n/2),end(c));if(h(a,b))f(1,b);if(h(a,c))f(1,c);f(0,a);}

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

int head(int base, int k) {
    int dst = 0;
    while(base < k) {
        base *= 2;
        dst++;
    }
    return dst;
}

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> heads(n);
    ll sum = 0;
    int p = head(1,k);
    rep(i,n) sum += 1<<(p-head(i+1,k));
    ll d = (1<<p) * n;

    cout << std::fixed << std::setprecision(15) << (double) sum/d << endl;
    return 0;
}

Measured memory_bytes: 3736
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

const int N = 210;
int n, dist[N];
VI e[N];

void dfs(int now, int past){
    for (int next : e[now]){
        if (next == past) continue;
        if (dist[next] != -1) continue;
        dist[next] = dist[now] + 1;
        dfs(next, now);
    }
}

int main() {
    cin >> n;
    REP(i,n){
        string s;
        cin >> s;
        REP(j,n){
            if (s[j] == '1') e[i].push_back(j);
        }
    }

    REP(i,n) dist[i] = -1;
    dist[0] = 0;
    dfs(0, -1);

    REP(i,n){
        for (int j : e[i]){
            if (abs(dist[i] - dist[j]) % 2 == 0){
                cout << -1 << endl;
                return 0;
            }
        }
    }

    int ans = 0;
    REP(i,n){
        REP(j,n) dist[j] = -1;
        dist[i] = 0;
        queue<int> que;
        que.push(i);
        while (!que.empty()){
            int now = que.front();
            que.pop();
            for (int next : e[now]){
                if (dist[next] != -1) continue;
                dist[next] = dist[now] + 1;
                que.push(next);
            }
        }
        int ma = 0;
        REP(j,n) chmax(ma, dist[j]);
        chmax(ans, ma + 1);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 512
#include <stdio.h>
#include<stdlib.h>
#define Maxnumber 36

int N;

typedef struct{
  int value;
char C;
}Tra;
void isStable(Tra in[], Tra out[]);

int main(){
  int i,con=0,j,flag,minj;
 Tra C[36],tmp,kame1[36],kame2[36];
 char temps[128];
 scanf("%s",temps);

 N = atoi(temps);
 
 for (i = 0; i < N; i++){
   scanf("%s",temps);
   C[i].C = temps[0];
   C[i].value = atoi(&temps[1]);
   kame1[i] = C[i];
   kame2[i] = C[i];
  }

 // Bubble
  for (i = 0 ;i <= N-1;i++){
    for (j = N-1;  j >= i+1;j--){
      if (kame1[j].value < kame1[j-1].value){
	tmp = 	kame1[j];
	kame1[j] = kame1[j-1];
	kame1[j-1] =  tmp;
      }
    }
  }
  
  // Selection
  for (i = 0; i <= N-1;i++){
    minj = i;
       for (j = i;j <=  N-1;j++){
	 if (kame2[j].value < kame2[minj].value){
	   minj = j;
	 }
       }
	tmp = kame2[i];
	kame2[i] = kame2[minj];
	kame2[minj] = tmp;
  }
  
  for (i = 0; i < N-1;i++){
    printf("%c%d ",kame1[i].C,kame1[i].value);
  }
    printf("%c%d\n",kame1[N-1].C,kame1[N-1].value);
  
    isStable(C,kame1);

    for (i = 0; i < N-1;i++){
      printf("%c%d ",kame2[i].C,kame2[i].value);
    }
    printf("%c%d\n",kame2[N-1].C,kame2[N-1].value);
  
    isStable(C,kame2);
  

  
    return 0;
}
void isStable(Tra in[], Tra out[])
{
  int i,j,a,b;
  for (i = 0;i <= N-1;i++){
    for (j = i+1 ;j <= N-1; j++){
      for (a = 0;a <= N-1;a++){
	for (b = a+1;b <= N-1;b++){
	  if (in[i].value == in[j].value  &&
	      in[i].value == out[b].value &&
	      in[i].C == out[b].C &&
	      in[j].value == out[a].value &&
	      in[j].C == out[a].C){
	    printf("Not stable\n");
	    return;
	  }
	}
      }
    }
  }
  printf("Stable\n"); 
}
        
      

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

using namespace std;

//using ll = long long int;

int main()
{
  int n;
  cin>>n;
  int a=0,b=0;
  int p[102],q[102]={0};
  for(int i=0;i<n;++i){
    int buf;
    cin>>buf;
    a+=buf;
    p[i]=a;
  }
  for(int i=1;i<=n;++i){
    int buf;
    cin>>buf;
    b+=buf;
    q[i]=b;
  }
  int ans=0;
  for(int i=0;i<n;++i){
    ans=max(ans,p[i]+b-q[i]);
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
    //freopen("a.in","r",stdin);
    int n;
    scanf("%d",&n);
    bool flag=false;
    while (n>0)
    {
        if (n%10==9) flag=true;
        n/=10;
    }
    printf(flag?"Yes\n":"No\n");
    return 0;
}


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

int main(){
	int n;
	cin>>n;
	int d[n];
	rep(i,n) cin>>d[i];
	sort(d,d+n);
	cout << d[n/2]-d[n/2-1] << endl;
}

Measured memory_bytes: 640
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = scanInt()
	}
	return a
}

func debug(a ...interface{}) {
	if os.Getenv("ONLINE_JUDGE") == "false" {
		fmt.Fprintln(os.Stderr, a...)
	}
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n, q := scanInt(), scanInt()
	a := scanInts(n)
	seg := newSegmentTree(n, max, 0)
	seg.build(a)
	for i := 0; i < q; i++ {
		t := scanInt()
		if t == 1 {
			x, v := scanInt()-1, scanInt()
			seg.update(x, v)
		} else if t == 2 {
			l, r := scanInt()-1, scanInt()
			fmt.Fprintln(wr, seg.query(l, r))
		} else {
			x, a := scanInt()-1, scanInt()
			fmt.Fprintln(wr, seg.find(x, func(v int) bool { return v < a })+1)
		}
	}
}

type segmentTree struct {
	d  []int
	e  int
	n  int
	sz int
	op func(a, b int) int
}

func newSegmentTree(n int, f func(a, b int) int, e int) *segmentTree {
	sz := 1
	for sz < n {
		sz <<= 1
	}
	seg := segmentTree{make([]int, 2*sz), e, n, sz, f}
	for i := 0; i < 2*sz; i++ {
		seg.d[i] = e
	}
	return &seg
}

func (seg segmentTree) build(d []int) {
	for i := 0; i < len(d); i++ {
		seg.d[i+seg.sz] = d[i]
	}
	for i := seg.sz - 1; i > 0; i-- {
		seg.d[i] = seg.op(seg.d[2*i], seg.d[2*i+1])
	}
}

func (seg segmentTree) get(i int) int {
	return seg.d[i+seg.sz]
}

func (seg segmentTree) update(i, a int) {
	i += seg.sz
	seg.d[i] = a
	for i >>= 1; i > 0; i >>= 1 {
		seg.d[i] = seg.op(seg.d[2*i], seg.d[2*i+1])
	}
}

func (seg segmentTree) query(a, b int) int {
	vl, vr := seg.e, seg.e
	a += seg.sz
	b += seg.sz
	for a < b {
		if a&1 == 1 {
			vl = seg.op(vl, seg.d[a])
			a++
		}
		if b&1 == 1 {
			b--
			vr = seg.op(seg.d[b], vr)
		}
		a >>= 1
		b >>= 1
	}
	return seg.op(vl, vr)
}

func (seg segmentTree) find(l int, f func(v int) bool) int {
	if l == seg.n {
		return seg.n
	}
	v := seg.e
	l += seg.sz
	for {
		for l&1 == 0 {
			l >>= 1
		}
		if !f(seg.op(v, seg.d[l])) {
			for l < seg.sz {
				l <<= 1
				if f(seg.op(v, seg.d[l])) {
					v = seg.op(v, seg.d[l])
					l++
				}
			}
			return l - seg.sz
		}
		v = seg.op(v, seg.d[l])
		l++
		if l&-l == l {
			break
		}
	}
	return seg.n
}


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

int main() {
	int num; cin>>num;
	
	vector<vector<int>> matrix(num,vector<int>(3,0));
	for(int i=0;i<num;i++){
	    for(int j=0;j<3;j++){
	        int t; cin>>t;
	        matrix[i][j] = t;
	    }
	}
	
	
	for(int i=1;i<num;i++){
	    for(int j=0;j<3;j++){
	        if(j==0){
	            matrix[i][j] = max(matrix[i-1][1]+matrix[i][j],matrix[i-1][2]+matrix[i][j]);
	        }else if(j==1){
	            matrix[i][j] = max(matrix[i-1][0]+matrix[i][j],matrix[i-1][2]+matrix[i][j]);
	        }else{
	            matrix[i][j] = max(matrix[i-1][0]+matrix[i][j],matrix[i-1][1]+matrix[i][j]);
	        }
	    }
	}
	
	int sol=0;
	for(int j=0;j<3;j++){
	    sol = max(sol,matrix[num-1][j]);
	}
	cout<<sol;
	return 0;
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
#define lowbit(a) ((a)&(-(a)))
using namespace std;

long long a[100000 + 5];

int main()
{
	int n;
	cin >> n;
	bool flag = 1;
	long long sum = 0;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
		a[i] *= 2;
		if (flag)sum += a[i];
		else sum -= a[i];
		flag ^= 1;
	}
	sum /= 2;
	for (int i = 1; i <= n; i++)
	{
		printf("%lld%c", sum, i == n ? '\n' : ' ');
		sum = a[i] - sum;
	}
	return 0;
}

Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define sz(x) int(x.size())
#define pb push_back
#define eb emplace_back
using ll=long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
const ll MOD=1000000007,MOD2=998244353;



int main() {
    int a,b;
    cin>>a>>b;
    cout<<a*b<<endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
int main(int argc, char* argv[]) {
    string s;
    cin >> s;
    int count =0;
    rep(i,4){
        if(s[0]==s[i]) count ++;
        if(s[1]==s[i]) count ++;
        if(s[2]==s[i]) count ++;
        if(s[3]==s[i]) count ++;
    }
    if (count == 8)cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=310;
int n,minl[N][N];
bool imp[N][N];
ll ans;
int main(){
	scanf("%d",&n);
	for(int i=0;i<n;i++)
		for(int j=0;j<n;j++)
			scanf("%d",&minl[i][j]);
	for(int k=0;k<n;k++)
		for(int i=0;i<n;i++)
			for(int j=0;j<n;j++){
				if(minl[i][k]+minl[k][j]<minl[i][j]){
//					cout<<i<<" "<<j<<" "<<k<<endl;
					puts("-1\n");
					return 0;
				}
				if(i==j||i==k||j==k) continue;
				if(minl[i][k]+minl[k][j]==minl[i][j]) imp[i][j]=1; 
			}
	for(int i=0;i<n;i++)
		for(int j=i+1;j<n;j++) if(!imp[i][j]) ans+=minl[i][j];
	cout<<ans<<endl;
}

Measured memory_bytes: 768
// cand <genesis?>
#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll base = 7;
const ll N = 2e5 + 9;
const ll mod = 998244353;
typedef pair<ll,ll> LL;

ll n,m,k,fac[N];
ll bpow(ll a,ll b){
    if (b == 0) return 1;
    ll t = bpow(a,b/2);
    if (b%2 == 0) return (t%mod * t%mod)%mod;
    return (t%mod * t%mod * a%mod)%mod;
}
ll mul(ll a,ll b){
    if (b == 0) return 0;
    ll t = mul(a,b/2);
    if (b%2 == 0) return (t%mod + t%mod)%mod;
    return (t%mod + t%mod + a%mod)%mod;
}
ll rev(ll x){
    return bpow(x,mod - 2);
}
ll C(ll k,ll n){
    ll p = rev(mul(fac[k],fac[n - k]));
    return mul(fac[n],p);
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    //freopen("test.INP", "r", stdin);
    cin>>n>>m>>k;
    fac[0] = 1;
    for (ll i = 1;i < N;i++) fac[i] = (fac[i - 1]*i)%mod;
    ll ans = 0;

    for (ll i = 0;i <= k;i++){
        ans += mul(mul(m,C(i,n - 1)),bpow(m - 1,n - i - 1));
        ans %= mod;
    }
    cout<<ans;
}


Measured memory_bytes: 5188
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	cout << max(c - (a - b), 0) << endl;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define PB push_back
#define MP make_pair
#define MOD (LL)(1e9+7)

int main(){
	int N;
	cin >> N;
	int ans = 0;
	for(int i=1; i<=N; i++){
		string S = to_string(i);
		if(S.size()%2 == 1) ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
import std.stdio, std.conv, std.string, std.algorithm,
       std.math, std.array, std.container, std.typecons;

long mod = 1000000007;

long modinv(long a) {
  long b=mod, u=1, v=0;
  while(b>0) {
    long t=a/b;
    a -= t*b; swap(a,b);
    u -= t*v; swap(u,v);
  }
  u %= mod;
  if(u<0) u+=mod;
  return u;
}

void main() {
  long x = readln.chomp.to!long;
  long n = 100;
  int count = 0;
  while(n<x) {
    n = n + n/100;
    count++;
  }
  writeln(count);
}


Measured memory_bytes: 2724
#include <bits/stdc++.h>
#define ll long long
#define max(a,b) (a>b?a:b)
using namespace std;
const int N=200050;
int gi(){
    char ch=getchar(); int x=0,q=0;
    while(ch<'0'||ch>'9') q=ch=='-'?1:q,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return q?-x:x;
}
int n,v[N];
ll s[N],x[N],C,ans;
int main(){
    int n=gi(); cin>>C;
    for (int i=1; i<=n; ++i) scanf("%lld",&x[i]),x[i+n]=x[i],v[i]=v[i+n]=gi();
    for (int i=n+1; i<=2*n; ++i) s[i]=s[i-1]+v[i];
    for (int i=n+1; i<=2*n; ++i) s[i]-=x[i];
    for (int i=n+1; i<=2*n; ++i) s[i]=max(s[i],s[i-1]);
    ll sum=0;
    for (int i=n; i>=1; --i){
	sum+=v[i];
	ans=max(ans,sum-C+x[i]);
	ans=max(ans,sum-2*(C-x[i])+s[i+n-1]);
    }
    memset(s,0,sizeof(s));
    reverse(x+1,x+2*n+1),reverse(v+1,v+2*n+1);
    for (int i=n+1; i<=2*n; ++i) s[i]=s[i-1]+v[i];
    for (int i=n+1; i<=2*n; ++i) s[i]-=C-x[i];
    for (int i=n+1; i<=2*n; ++i) s[i]=max(s[i],s[i-1]);
    sum=0;
    for (int i=n; i>=1; --i){
	sum+=v[i];
	ans=max(ans,sum-x[i]);
	ans=max(ans,sum-2*x[i]+s[i+n-1]);
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 4096
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
#define vvec vector<vector<ll>>
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const int mod = 998244353;
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll c(ll n, ll k) { ll a = 1; rep(i, 1, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }

int main(void) {
	ll s, i;
	cin >> s;
	int a, b, c, d;
	i = (ll)(sqrt(s));
	if (i * i == s) {
		a = d = i;
		b = 0, c = 0;
	}
	else {
		i++;
		a = d = i;
		b = 1, c = i * i - s;
	}
	printf("0 0 %d %d %d %d\n", a, b, c, d);
	return 0;
}


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

int main(){
    int n,m;
    ll ans=0;
    cin >> n >> m;
    vector<ll> x(n),y(n),z(n);
    for(int i=0;i<n;i++) cin >> x[i] >> y[i] >> z[i];
    for(int bit=0;bit<8;bit++){
        vector<ll> v;
        ll score=0;
        int a=((1<<0)&bit)?-1:1,b=((1<<1)&bit)?-1:1,c=((1<<2)&bit)?-1:1;
        for(int i=0;i<n;i++) v.push_back(x[i]*a+y[i]*b+z[i]*c);
        sort(v.begin(),v.end(),greater<ll>());
        for(int i=0;i<m;i++) score+=v[i];
        ans=max(ans,score);
    }
    cout << ans << endl;

    return 0;
}


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

using namespace std;
typedef long long ll;

int main()
{
    string s;
    cin >> s;
    bool ok=0;
    for(char c:s) if(c=='7') ok=1;
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
#define int long long
#define ull unsigned long long
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) for(int i=(b); i<((int)(a)); i++)
#define rep3(i,b,a) for(int i=(b); i>=((int)(a)); i--)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define sz(a) ((int)a.size())
#define pow2(x) (1ll<<(x))
#define ceiling(a,b) (((a)+(b)-1)/(b))
#define print0(a) cout << (a) << ' '
#define print1(a) cout << (a) << '\n'
#define print2(a,b) cout << (a) << ' ',print1(b)
#define print3(a,b,c) cout << (a) << ' ',print2(b,c)
#define print4(a,b,c,d) cout << (a) << ' ',print3(b,c,d)
#ifdef i_am_noob
#define debug(a) print2(#a,a)
#else
#define debug(a) 
#endif
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
 
using namespace std;
using namespace __gnu_pbds;
 
const int Mod=1000000007,Mod2=998244353;
const int MOD=Mod2;
 
inline int add(int a, int b){return (a+b>=MOD?a+b-MOD:a+b);}
inline int sub(int a, int b){return (a+MOD-b>=MOD?a-b:a+MOD-b);}
int Pow(int a, int b){
	if(!b) return 1;
	int tmp=Pow(a*a%MOD,b>>1);
	return (b&1?tmp*a%MOD:tmp);
}
inline int inverse(int n){return Pow(n,MOD-2);}

const int maxn=100005;
//i_am_noob
int n;

signed main(){
	ios_base::sync_with_stdio(0),cin.tie(0);
	cin >> n;
	rep2(i,1,10){
		if(111*i>=n){
			print1(111*i);
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int dfs(vector<int> v, int joint) {
  if ((int) v.size() < 3) return 1 << 30;
  int res = 1 << 30;
  for (int i = 0; i < (int) v.size(); i++) {
    for (int j = 0; j < (int) v.size(); j++) {
      for (int k = 0; k < (int) v.size(); k++) {
        if (i == j || j == k || k == i) continue;
        res = min(res, abs(v[i] - a) + abs(v[j] - b) + abs(v[k] - c) + joint);
      }
    }
  }
  for (int i = 0; i < (int) v.size(); i++) {
    for (int j = i + 1; j < (int) v.size(); j++) {
      vector<int> tmp = v;
      tmp[i] += tmp[j];
      tmp.erase(tmp.begin() + j);
      res = min(res, dfs(tmp, joint + 10));
    }
  }
  /*for (int i = 0; i < (int) v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl << res << endl;*/
  return res;
}
signed main() {
	ios::sync_with_stdio(false); cin.tie(0);
  int n;
  cin >> n >> a >> b >> c;
  vector<int> in(n);
  for (int i = 0; i < n; i++) {
    cin >> in[i];
  }
  cout << dfs(in, 0) << endl;
  return 0;	 
}

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

int main(void){
    int a,b;
    cin >> a >> b;
    cout << (b%a==0?a+b:b-a) << endl;
    return 0;
}


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

int main() {
  string S;
  cin >> S;
  
  int ans = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] != 'A' && S[i] != 'C' && S[i] != 'G' && S[i] != 'T') {
      continue;
    }
    int cnt = 1;
    for (int j = i + 1; j < S.size(); j++) {
      if (S[j] == 'A' || S[j] == 'C' || S[j] == 'G' || S[j] == 'T') {
        cnt++;
      } else {
        break;
      }
    }
    ans = max(ans, cnt);
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
a = []
b = []
for i in range(n):
    a += [list(map(int, input().split()))]
    a[i] += [sum(a[i])]
for i in range(m+1):
    b += [sum(x[i] for x in a)]
a += [b]
for i in range(n+1):
    print(*a[i])


Measured memory_bytes: 6236
#include <iostream>
using namespace std;
using ll = long long;

int calc_digit(ll N) {
  int res = 0;
  while (N) {
    ++res;
    N /= 10;
  }
  return res;
}

int main() {
  ll N;
  cin >> N;
  int res = (1 << 29);  // 十分大きい値で初期化
  for (ll A = 1; A * A <= N; ++A) {
    if (N % A == 0) {
      ll B = N / A;
      int F = max(calc_digit(A), calc_digit(B));
      res = min(res, F);
    }
  }
  cout << res << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
using Graph=vector<vector<int>>;

int main(){
    int n;
    cin>>n;
    vector<long long> t(n);
    for (int i=0; i<n; i++){
        cin>>t[i];
    }
    long long ans=(t[0]/ __gcd(t[0], t[n-1]))*t[n-1];
    for (long long i=1; i<n-1; i++){
        if(ans%t[i]==0)continue;
        ans=(ans/ __gcd(ans,t[i]))*t[i];
    }
    cout<<ans;
    return 0;
}



Measured memory_bytes: 256
//prepared by dumb
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define llu unsigned long long int
#define scll(x) scanf("%lld",&x)
#define scld(x) scanf("%lf",&x)
#define scull(x) scanf("%llu",&x)
#define scch(x) scanf(" %c",&x)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define ppb() pop_back()
#define ppf() pop_front()
#define Pi acos(-1.0)
#define INF 1e18
#define ff first
#define ss second
#define mpr make_pair
ll  _xor(ll a,ll b){return a^b;}
ll _and(ll a,ll b){return a&b;}
ll _or(ll a,ll b){return a|b;}
ll _not(ll a){ return ~a;}
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
           #ifndef ONLINE_JUDGE 
         freopen("input.txt","r",stdin);
         freopen("output.txt","w",stdout);
         #endif
    ll b,c,d,e,f,g,h,i,j,k,l1,l2,l3,t,a,m,n,p,q,r,s,u,v,x,y,c2,c3;
  double a1,b1,c1,d1,l;
        cin>>a1>>b1>>c1>>d1;
        l=abs((360/60.0)*d1-((360/12.0)*(c1+d1/60.0)));
       l=min(l,360-l);
      cout<<fixed<<setprecision(10)<<sqrt(b1*b1+a1*a1-2*a1*b1*cos((l*Pi)/180));

return 0;
}

Measured memory_bytes: 4244
#include<iostream>
using namespace std;
int main(){
    int x,y,z;
    cin>>x>>y>>z;
    int tmp=0,count=0,Yaju=114514;
    while(Yaju){
        tmp+=z;
        tmp+=y;
        if(tmp<x)count++;
        else{
            if(tmp-y>x){
                count--;
                Yaju-=114514;
            }else{
                Yaju-=114514;
            }
        }
    }
    cout<<count<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(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 RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//const ll INF = 1LL << 60;
//const int INF = 1001001001;

int main(void){
    int n,m;
    cin >> n >> m;
    cout << n*(n-1)/2 + m*(m-1)/2 ;

    return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

const int MAX_N=500;

struct edge{
    int to,cap,rev;
};

vector<edge> G[MAX_N];
vector<int> check(MAX_N,0);

int dfs(int v,int t, int f ){
    if(v==t){return f;}
    check[v]=1;
    for(int i=0;i<G[v].size();i++){
        if(check[G[v][i].to]==0 && G[v][i].cap > 0){
            int ff =dfs(G[v][i].to,t,min(f,G[v][i].cap));
            if(ff>0){
                G[v][i].cap -= ff;
                G[G[v][i].to][G[v][i].rev].cap += ff;
                return ff;
            }
        }
    }
    return 0;
}

int maxflow(int s,int t){
    int flow = 0;
    while(1){
        fill(check.begin(),check.end(),0);
        int f = dfs(s,t,INT_MAX);
        if(f==0){return flow;}
        flow += f;
    }
}

int bipartite_matching_flow(int X, int Y, vector<pii> &edge_list){
    for(int i=0;i<edge_list.size();i++){
        int s = edge_list[i].first;
        int t = edge_list[i].second;
        G[s].push_back((edge){X+t,1,G[X+t].size()});
        G[X+t].push_back((edge){s,0,G[s].size()-1});
    }

    for(int i=0;i<X;i++){
        G[X+Y].push_back((edge){i,1,G[i].size()});
        G[i].push_back((edge){X+Y,0,G[X+Y].size()-1});
    }

    for(int i=X;i<X+Y;i++){
        G[i].push_back((edge){X+Y+1,1,G[X+Y+1].size()});
        G[X+Y+1].push_back((edge){i,0,G[i].size()-1});
    }
    return maxflow(X+Y,X+Y+1);
}

int main(){
	int N;
	cin >> N;
	vector<int> a(N), b(N), c(N), d(N);
	REP(i, N) cin >> a[i] >> b[i];
	REP(i, N) cin >> c[i] >> d[i];

	vector<pii> edges;
	REP(i, N){
		REP(j, N){
			if (a[i]<c[j] && b[i]<d[j]){
				edges.push_back(make_pair(i, j));
			}
		}
	}
	cout << bipartite_matching_flow(N, N, edges) << endl;
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <math.h>
#include <bitset>
#include <cmath>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <vector>
#include <random>
using namespace std;

/////////////////////////////////////////////////////////////////////////////////////////////
using namespace std;
typedef long long  ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)

int main()
{
    ll x, y, z; cin >> x >> y >> z;
    cout << z << " " << x << " " << y << endl;

    return 0;
}


Measured memory_bytes: 384
#include <stdio.h>
#include <string.h>
int main(){
    char t[200002],s[200002];
    int n,contador=0;

    scanf("%s ",s);
    scanf(" %s ",t);

    n = strlen(s);

    for(int i=0;i<n;i++){
        if(s[i]!=t[i]){
            contador++;
        }
    }
    printf("%d\n",contador);

    return 0;
}


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

int main() {
    int n, ans = 1;
    string s;
    cin >> s;
    n = s.size();
    bool f = true;
    for(int i=1;i<n;i++){
        if(s[i-1]==s[i] && f){
            if(i+1<n){
                i++;
                ans++;
            }
            f = false;
        }
        else{
            ans++;
            f = true;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f
#define re register
#define N 3010
#define id(x,y) (y?102+x:1+x)
using namespace std;

inline int read(){
	int x=0,w=0;char ch=getchar();
	while (!isdigit(ch))w|=ch=='-',ch=getchar();
	while (isdigit(ch))x=(x<<1)+(x<<3)+ch-'0',ch=getchar();
	return w?-x:x;
}
int n,m,d[N][N],f[N][N];
signed main(){
	n=read(),m=read();
	for (int i=1;i<=n;++i)	
		for (int j=1;j<=m;++j)
			d[i][j]=read();
	for (int i=0;i<=100;++i)
		for (int j=0;j<=100;++j)
			for (int x=1;x<=n;++x)
				for (int y=1;y<=m;++y)
					f[i][j]=max(f[i][j],d[x][y]-i*x-j*y);
	for (int x=1;x<=n;++x)
		for (int y=1;y<=m;++y){
			int mn=inf;
			for (int i=0;i<=100;++i)
				for (int j=0;j<=100;++j)
					mn=min(mn,f[i][j]+i*x+j*y);
			if (mn!=d[x][y]){puts("Impossible");return 0;}
		}
	puts("Possible");
	printf("%d %d\n",id(100,1),10401);
	for (int i=1;i<=100;++i)printf("%d %d X\n",id(i-1,0),id(i,0));
	for (int i=1;i<=100;++i)printf("%d %d Y\n",id(i-1,1),id(i,1));
	for (int i=0;i<=100;++i)
		for (int j=0;j<=100;++j)
			printf("%d %d %d\n",id(i,0),id(100-j,1),f[i][j]);
	printf("%d %d\n",1,id(100,1));
	return 0;
}


Measured memory_bytes: 2816
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        C solver = new C();
        solver.solve(1, in, out);
        out.close();
    }

    static class C {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int A = in.nextInt();
            int B = in.nextInt();
            out.println(lcm(A, B));
        }

        long gcd(long a, long b) {
            return b == 0 ? a : gcd(b, a % b);
        }

        long lcm(long a, long b) {
            return a / gcd(a, b) * b;
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

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

    }
}



Measured memory_bytes: 22356
H, W, K = map(int, input().split())
S = [list(input()) for _ in range(H)]

res = 10**9

for i in range(2**(H-1)):
    yoko = []
    for j in range(H-1):
        if (i>>j) & 1:
            yoko.append(j+1)
    yoko.append(H)
    
    sen = len(yoko)-1

    rS = [[0]*W for _ in range(sen+1)]

    flag = False

    for w in range(W):
        b = 0
        for j in range(sen+1):
            t = b
            b = yoko[j]
            for h in range(t, b):
                if S[h][w] == "1":
                    rS[j][w] += 1
            if rS[j][w] > K:
                flag = True
                break
        if flag:
            break
    
    if flag:
        continue
    
    x = [r[0] for r in rS]
    for w in range(1, W):
        for h in range(len(yoko)):
            x[h] += rS[h][w]
            if x[h] > K:
                x = [r[w] for r in rS]
                sen += 1
                break
    
    res = min(sen, res)
    if res == 0:
        break

print(res)

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

std::string s;

int res;

int main(){

    std::cin>>s;

    for(int i=0;i<s.size();i++){
        if(i%2==s[i]-'0')
        res++;
    }

    res=res<s.size()-res?res:s.size()-res;

    std::cout<<res<<std::endl;

    return 0;

}

Measured memory_bytes: 512
<?php

$n = fgets(STDIN);
$input = explode(" ", fgets(STDIN));

$cntr = array_fill(0, 13, 0);
$rslt = 0;
$max = 0;

foreach($input as $v){
    $cntr[intval(floor((int)$v / 400))] += 1;
}
for($i = 0; $i < 8; $i++) if($cntr[$i] > 0) $rslt++;
for($i = 8; $i < 12; $i++) $cntr[12] += $cntr[$i];

$max = $rslt + $cntr[12];
$rslt = $rslt == 0 ? 1 : $rslt;

echo $rslt, " ", $max;


Measured memory_bytes: 4604
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define FOR(i, a, b) for(ll i = a; i < b; i++)
#define FORR(i, a, b)   for(ll i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()
#define MOD1 1000000007
#define MOD2 998244353
#define IOS std::ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define print(a) for(auto x : a)    cout<<x<<" "; cout<<"\n";
using namespace std;

void OFFLINE(){ 
    #ifndef ONLINE_JUDGE 
        freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); 
    #endif
}

int main(){

    IOS;
    // OFFLINE();
    //check for corner test cases

    int n, x, ans = 0;
    cin >> n;

    for(int i = 1; i <= n; i++){
        cin >> x;
        ans += ((x % 2) && (i % 2));
    }

    cout<<ans<<"\n";
    //check for corner test cases
    return 0;
}


Measured memory_bytes: 3608
N, M = map(int, input().split())
A = [0]*M
B = [0]*M
for i in range(M):
  A[i], B[i] = map(int, input().split())
a = max(A)
b = min(B)
if a <= b:
  print(b+1-a)
else:
  print(0)
  
  


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

using namespace std;

const int maxn = 100000;
int arr[maxn];
int main()
{
	int a;
	cin >> a;
	int res = 0;
	int b = 0;
	for(int i = 0 ; i < 2 * a ; i++)
	{
		cin >> arr[i];
	}
	while(a!=0)
	{
		sort(arr , arr+2*a);
		res += arr[(2*a)-2];
 		a--;
	}
	
	cout << res;
	return 0;
}


Measured memory_bytes: 256
n = int(input())
rate = list(map(int,input().split()))
ratecolor = 0
free = 0
ratecolor = 0
color = [0]*9
for i in range(n):
    if(rate[i] >= 3200):
        free += 1
    else:
        for j in range(9):
            if(rate[i] < j*400 + 400):
                if(color[j] == 0):
                    color[j] += 1
                    ratecolor += 1
                break
print(ratecolor if ratecolor != 0 else 1,ratecolor+free)



Measured memory_bytes: 8960
"use strict";
main(require("fs").readFileSync("/dev/stdin", "UTF-8"));

function main(input) {
  let s = input.split("\n").shift();
  let result = null;
  const weather = ["Sunny", "Cloudy", "Rainy"];
  weather.forEach((w, i) => {
    if (w === s) {
      result = i;
    }
  });
  console.log(weather[result + 1 !== weather.length ? result + 1 : 0]);
}


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

#define int long long
#define INF 1e18

signed main() {
    string s; cin >> s;
    string t = "";
    t += s[0];
    t += to_string(s.size() - 2);
    t += s[s.size() - 1];
    cout << t << endl;
}


Measured memory_bytes: 256
import sys

def main():

    # sys.stdin = open('input155a.txt')

    a, b, c = map(int, input().split())

    answer = 'Yes' if check(a, b, c) else 'No'
    print(answer)

def check(a, b, c):

    for _ in range(3):
        a, b, c = b, c, a
        if a == b != c:
            return True

    return False


if __name__ == '__main__':
    main()


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

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;
using lint=long long;

template<class T> using wgraph=vector<vector<pair<int,T>>>;

template<class T>
vector<T> Bellman_Ford(const wgraph<T>& G,int s){
	const T INF=numeric_limits<T>::max();

	int n=G.size();
	vector<T> d(n,INF);
	d[s]=0;
	rep(_,n-1){
		bool upd=false;
		rep(u,n) if(d[u]<INF) for(const auto& e:G[u]) {
			int v=e.first;
			T wt=e.second;
			if(d[v]>d[u]+wt) d[v]=d[u]+wt, upd=true;
		}
		if(!upd) return d;
	}

	queue<int> Q;
	rep(u,n) if(d[u]<INF) Q.emplace(u);
	while(!Q.empty()){
		int u=Q.front(); Q.pop();
		for(const auto& e:G[u]){
			int v=e.first;
			T wt=e.second;
			if(d[v]>-INF && (d[u]==-INF || d[v]>d[u]+wt)) d[v]=-INF, Q.emplace(v);
		}
	}
	return d;
}

int main(){
	int n,m; scanf("%d%d",&n,&m);
	wgraph<lint> G(n);
	rep(i,m){
		int u,v;
		lint c; scanf("%d%d%lld",&u,&v,&c); u--; v--;
		G[u].emplace_back(v,-c);
	}

	lint ans=Bellman_Ford(G,0)[n-1];

	if(ans>-LLONG_MAX) cout<<-ans<<endl;
	else               cout<<"inf"<<endl;

	return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

const double INF = 1e9;
using P = pair<double, double>;
int n;
P v[500010];

double closest_pair(P *a, int n) {
  if (n <= 1) return INF;
  int m = n / 2;
  double x = a[m].first;
  double d = min(closest_pair(a, m), closest_pair(a + m, n - m));
  inplace_merge(a, a + m, a + n, [&](P p, P q) {
    return p.second < q.second;
  });
  vector<P> b;
  for (int i = 0; i < n; i++) {
    if (fabs(a[i].first - x) >= d) continue;
    for (int j = 0; j < int(b.size()); j++) {
      double dx = a[i].first - b[b.size() - j - 1].first;
      double dy = a[i].second - b[b.size() - j - 1].second;
      if (dy >= d) break;
      d = min(d, sqrt(dx * dx + dy * dy));
    }
    b.emplace_back(a[i]);
  }
  return d;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
  }
  sort(v, v + n);
  double d = closest_pair(v, n);
  cout << ll(d * d + 1e-10) << endl;

  return 0;
}


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

int main() {
	int a, b;
	cin >> a >> b;
	if(a < b) {
		cout << "a < b" << endl; 
	} else if (a > b) {
		cout << "a > b" << endl;
	} else {
		cout << "a == b" << endl;
	}
}



Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N,K;
  int res=0;
  cin >> N >> K;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  } 
  
  for (int i = 0; i < N; i++){
          if(A.at(i) >= K) res++;
  }
  cout << res << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i,n,m) for(ll i=(n);i<(m);i++)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) for(ll i=(n);i>=0;i--)
#define all(vec) vec.begin(),vec.end()
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<ll,ll>;
using PP=pair<ll,P>;
using vp=vector<P>;
using vpp=vector<PP>;
using vs=vector<string>;
#define fi first
#define se second
#define pb push_back
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
const ll MOD=1000000007LL;
const int INF=1<<30;
const ll LINF=1LL<<60;
int main(){
    string st;
    cin>>st;
    do{
        st.pop_back();
        if(st.size()%2==0){
            if(st.substr(0,st.size()/2)==st.substr(st.size()/2,st.size()/2)){
                cout<<st.size()<<endl;
                return 0;
            }
        }
    }while(st.size());
    return 0;
}

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

#define cn count
#define pb push_back
#define in insert
#define fs first
#define sc second
#define sz size
#define len length
#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define forni(i, n) for (ll i = 1; i < (ll) (n); ++i)
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;
using ll = long long;
const ll inf = 1e9+7; 
const double PI =  3.141592653589793;

int main(){
	IO;
	ll n,k;
	cin>>n>>k;
	ll h[n];
	forn(i,n)cin>>h[i];
	sort(h,h+n);
	ll ans = 0;
	forn(i,n-k){
		ans+=h[i];
	}
	cout<<ans<<"\n";
	return 0;
}


// _   .-')                .-. .-')                 .-')                                               
//( '.( OO )_              \  ( OO )               ( OO ).                                             
// ,--.   ,--.).-'),-----. ,--. ,--.  .-'),-----. (_)---\_) ,--. ,--.     .-----.  ,-.-')  .-'),-----. 
// |   `.'   |( OO'  .-.  '|  .'   / ( OO'  .-.  '/    _ |  |  | |  |    '  .--./  |  |OO)( OO'  .-.  '
// |         |/   |  | |  ||      /, /   |  | |  |\  :` `.  |  | | .-')  |  |('-.  |  |  \/   |  | |  |
// |  |'.'|  |\_) |  |\|  ||     ' _)\_) |  |\|  | '..`''.) |  |_|( OO )/_) |OO  ) |  |(_/\_) |  |\|  |
// |  |   |  |  \ |  | |  ||  .   \    \ |  | |  |.-._)   \ |  | | `-' /||  |`-'| ,|  |_.'  \ |  | |  |
// |  |   |  |   `'  '-'  '|  |\   \    `'  '-'  '\       /('  '-'(_.-'(_'  '--'\(_|  |      `'  '-'  '
// """    """     """""""" """  """"      """""""  """""""  """"""""      """"""   """         """""""
 


Measured memory_bytes: 5036
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    int K, S;
    int ans = 0;
    cin >> K >> S;
    for(int x = 0; x <= K; x++) {
        for(int y = 0; y <= K; y++) {
            int z = S - x - y;
            if(0 <= z && z <= K) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>

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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define REPO(i, n) for(int i = 1;i <= n;i++)
#define ll long long
#define INF 1999999999
#define MINF -1999999999
#define INF64 1999999999999999999
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007

ll a, b,ans = INF;
bool c, d;
int main(){
	cin >> a >> b;
	if (a >= 0)c = true;
	if (b >= 0)d = true;
	if (a < b) {
		if (!c and d) {
			ans = min(b - a,abs(abs(b) - abs(a)) + 1);
			ans = min(ans, b - a);
		}
		else ans = b - a;
	}
	else {
		if (c and d) ans = min(b - (0 - a) + 1, a - b + 2);
		else if (!c) ans = a - b + 2;
		else ans = abs(abs(b) - abs(a)) + 1;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"

using namespace std;

typedef long int li;
typedef long double ld;
typedef long long ll;
typedef pair<ll, ll> pt;

#define fi first
#define se second
#define lson (p<<1)+1
#define rson (p<<1)+2
#define dump(x) cout << #x << " = " << x << endl
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);


string s, t;

int main () {
    fastIO;
    cin >> s >> t;
    cout << t << s;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SZ(c)       int(c.size())
#define FOR(i,a,b)  for (int i=a; i<(b); ++i)
#define DOWN(i,a,b) for (int i=(a)-1; i>=(b); --i)
using namespace std;
using i64 = long long;

const int MAXN=200020;

int n,k;
int cnt[MAXN];
vector<int> a;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout<<fixed<<setprecision(10);

  cin>>n>>k;
  
  FOR(i,0,n) {
    int x;
    cin>>x;
    cnt[x]+=1;
  }
  FOR(i,1,n+1) if (cnt[i]>0) a.push_back(cnt[i]);
  sort(a.begin(),a.end());

  int res=accumulate(a.begin(),a.begin()+max(0,SZ(a)-k),0);
  cout<<res<<endl;

  return 0;
}


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

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> A(n);
  rep(i, n) { cin >> A[i]; }
  rep(i, k) {
    vector<int>  B(n + 1);
    rep(j, n) {
      int l = max(0, (j - A[j]));
      int r = min(j + A[j] + 1, n);
      B[l]++; B[r]--;
    }
    rep(j, n) B[j+1] += B[j];
    B.pop_back();
    if (A == B) break;
    A = B;
  }
  rep(i, n) {
    cout << A[i];
    if(i != n) cout << ' ';
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 4832
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N; cin >> N;
    int digit; digit = 0;
    while (true) {
        digit += 1;
        double divider = pow(10.0, static_cast<double>(digit));
        if ((N / (int)divider) == 0) break;
    }
    int ans; ans = 0;

    if (1 == digit) {
        ans += N;
    } else if (2 == digit) {
        ans += 9;
    } else if (3 == digit) {
        ans += 9;
        ans += N - 99;
    } else if (4 == digit) {
        ans += 9;
        ans += 900;
    } else if (5 == digit) {
        ans += 9;
        ans += 900;
        ans += N - 9999;
    } else if (6 == digit) {
        ans += 9;
        ans += 900;
        ans += 90000;
    }
 
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

int main() {
	int k, x; cin >> k >> x;
	if(k * 500 >= x) cout << "Yes" << '\n';
	else cout << "No" << '\n';
	return 0;
}

Measured memory_bytes: 256
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する 
  return bool ? y : n 
end 
def array(size,n=1,init=nil) #nに配列の次元数、sizeに配列の大きさ、initに初期値を投げることでその配列を返す 
  if n==1
    return Array.new(size){init}
  else
    return Array.new(n).map{Array.new(size){init}}
  end
end

class UnionFindTree
  attr_accessor:par,:rank,:size
  def initialize(n)
    @par=Array.new(n){|i| i}
    @rank=array(n,1,0)
    @size=array(n,1,1)
  end

  def find(x)
    return x if @par[x]==x
    @par[x]=find(@par[x])
    return @par[x]
  end

  def union(x,y)
    x=find(x)
    y=find(y)
    return if x==y
    if @rank[x]<@rank[y]
      @par[x]=y
      @size[y]+=@size[x]
    else
      @par[y]=x
      @size[x]+=@size[y]
      @rank[x]+=1 if @rank[x]==@rank[y]
    end
  end

  def same?(x,y)
    return find(x)==find(y)
  end

  def size(x)
    return @size[find(@par[x])]
  end
end

n,m,k=get_i
uft=UnionFindTree.new(n)
friends=array(n,1,0)
blocks=array(n,1,0)
ans=[]
m.times do|i|
  a,b=get_i
  a-=1
  b-=1
  uft.union(a,b)
  friends[a]+=1
  friends[b]+=1
end
k.times do|i|
  c,d=get_i
  c-=1
  d-=1
  #uft.union(c,d)
  if uft.same?(c,d)
    blocks[c]+=1
    blocks[d]+=1
  end
end
n.times do|i|
  ans.push(uft.size(i)-1-friends[i]-blocks[i])
end
puts ans.join(" ")

Measured memory_bytes: 9084
#include <iostream>
#include <cstdio>
#include <string>
#include <map>
#include <queue>
using namespace std;

int main() {
	map<string,int>map;
	queue<string>q;
	int n,cont=0;
	string s,a;
	scanf("%d", &n);
	for (int t = 1; t <=n; t++) {
		cin>>s;
		if (s=="insert") {
			cin>>a;
			map[a] = 1;
		}
		else if(s=="find"){
			cin>>a;
			if (map.count(a)==1) {
				q.push("yes");
				cont++;
			}
			else if(map.count(a)==0) {
				q.push("no");
				cont++;
			}
		}
	}

	for (int t = 0; t < cont; t++) {
		cout << q.front() << "\n";
		q.pop();
	}

	return 0;
}



Measured memory_bytes: 60620