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

bool cmp(int a,int b){
    return a>b;
}
int main(){
    int n, k, x;
    cin>>n>>k;
    
    int a[200000+5]={0};
    
    for (int i=0;i<n;i++)
	{
        cin>>x;
        a[x]++;
    }
    
	sort(a+1,a+200000+1,cmp);
    
	int count=0;
    
	for(int i=k+1;i<=200000;i++)count+=a[i];
    
	cout<<count<<endl;
    return 0;
}

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


int main() {
  int N,A,B;
  long ans = 0;
  cin >> N >> A >> B;
  for(int i=1;i<=N;++i){
    int sum = 0;
    string s;
    s = to_string(i);
    for(int j=0;j<s.size();++j){
      sum += s.at(j) - '0';
    }
    if(sum >= A && sum <= B) ans += i;
  }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3656
#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
using namespace std;
 
#define DEBUG(x) cerr << #x << " = " << x << endl
 
const int INF = (int)1e9;
 
struct SegmentTree {
  int N;
  vector<vector<int>> data;
  SegmentTree(const vector<int> &X) {
    N = 1;
    while(N < (int)X.size()) N *= 2;
    data.resize(2*N - 1);
    for(int i = 0; i < (int)X.size(); ++i) {
      data[N - 1 + i].push_back(X[i]);
    }
    for(int i = (int)X.size(); i < N; ++i) {
      data[N - 1 + i].push_back(INF);
    }
    for(int i = N - 2; i >= 0; --i) {
      merge(data[2*i+1].begin(), data[2*i+1].end(), data[2*i+2].begin(), data[2*i+2].end(), back_inserter(data[i]));
    }
  }
  int query(int a, int b, int lower, int upper, int k, int l, int r) {
    if(r <= a || b <= l) return 0;
    if(a <= l && r <= b) {
      int ans = 0;
      ans += lower_bound(data[k].begin(), data[k].end(), lower) - data[k].begin();
      ans += data[k].end() - upper_bound(data[k].begin(), data[k].end(), upper);
      return ans;
    }
    return query(a, b, lower, upper, 2 * k + 1, l, (l + r) / 2) +
      query(a, b, lower, upper, 2 * k + 2, (l + r) / 2, r);
  }
};
 
int main() {
  int D; cin >> D;
  vector<int> X(D);
  for(int i = 0; i < D; ++i) {
    cin >> X[i];
  }
  SegmentTree S(X);
  int Q; cin >> Q;
  while(Q--) {
    int l, r, e;
    cin >> l >> r >> e;
    l--; r--;
    int a = min(X[l], X[r]) - e;
    int b = max(X[l], X[r]) + e;
    cout << S.query(l, r, a, b, 0, 0, S.N) << endl;
  }
}

Measured memory_bytes: 23276
#include <stdio.h>
#include <math.h>
int main()
{
	long long int s=0,i,n,d,tmpx,tmpy;
	scanf("%lld%lld",&n,&d);
	for(i=0;i<n;++i)
	{
		scanf("%lld%lld",&tmpx,&tmpy);
		if(sqrt(tmpx*tmpx+tmpy*tmpy)<=d)
		{
			s++;
		}
	}
	printf("%lld",s);
	return 0;
}


Measured memory_bytes: 2124
import sys
sys.setrecursionlimit(110000) #再帰上限はデフォルトで1000回までなので，増やす。

N, M = map(int, input().split())

graph = [[] for _ in range(110000)]

for _ in range(M):
    x, y = map(int, input().split())

    graph[x].append(y)

dp_memo = [-1] * 110000

def dp(v):
    if dp_memo[v] != -1:
        return dp_memo[v]

    ret = 0
    for item in graph[v]:
        ret = max(ret, dp(item) + 1)

    dp_memo[v] = ret
    return ret

ans = 0

for i in range(1, N+1):
    ans = max(ans, dp(i))

print(ans)

Measured memory_bytes: 61952
import sys
import bisect
n = int(sys.stdin.readline().strip())
s = list(sys.stdin.readline().strip())
alpha = "abcdefghijklmnopqrstuvwxyz"
dict = {i:[] for i in alpha}
for i, _s in enumerate(s):
    dict[_s].append(i)
q = int(sys.stdin.readline().strip())
for i in range(q):
    type, first, last = [i for i in sys.stdin.readline().split()]
    if type == "2":
        first = int(first)
        last = int(last)
        first -= 1
        last -= 1
        cnt = 0
        for ls in dict.values():
            if bisect.bisect_left(ls, first) != bisect.bisect_right(ls, last):
                cnt += 1
        print(cnt)
    else:
        first = int(first)
        first -= 1
        _s = s[first]
        if _s == last:
            continue
        del dict[_s][(bisect.bisect_left(dict[_s], first))]
        s[first] = last
        bisect.insort_left(dict[last], first)

Measured memory_bytes: 94500
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
template <typename T>
using V = std::vector<T>;
#define REP(i, n) for (int i = 0; (i64)(i) < (i64)(n); ++i)

#ifdef ENABLE_DEBUG
template <typename T>
void debug(T value) {
  cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  cerr << value << ", ";
  debug(args...);
}
#define DEBUG(...)                              \
  do {                                          \
    cerr << " \033[33m (L" << __LINE__ << ") "; \
    cerr << #__VA_ARGS__ << ":\033[0m ";        \
    debug(__VA_ARGS__);                         \
    cerr << endl;                               \
  } while (0)
#else
#define debug(...)
#define DEBUG(...)
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  V<i64> ans(N + 1);
  for (i64 x = 1; x * x <= N; ++x) {
    for (i64 y = 1; x * x + y * y + x * y <= N; ++y) {
      for (i64 z = 1;; ++z) {
        i64 v = x * x + y * y + z * z + x * y + y * z + z * x;
        if (v > N) break;
        ans[v]++;
      }
    }
  }
  for (int i = 1; i <= N; ++i) {
    cout << ans[i] << '\n';
  }
}


Measured memory_bytes: 3652
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define uLL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

using namespace std;

int main(void){
  int A,B;
  int cnt=0;
  cin>>A;
  cin>>B;

  string inputStr;
  FORQ(i,A,B){
    inputStr =  to_string(i);
    if(inputStr[0]==inputStr[4] && inputStr[1]==inputStr[3]){
      cnt++;
    }
  }

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



Measured memory_bytes: 256
s = input()
k = int(input())
n = len(s)

if len(set(s)) == 1:
    print(n*k//2)
    exit()

ss = s + s
cnts = 0
now = s[0]
temp = 1
for i in range(1, n):
    if s[i] == now:
        temp += 1
    else:
        cnts += temp // 2
        temp = 1
        now = s[i]
cnts += temp // 2

cntss = 0
now = ss[0]
temp = 1
for i in range(1, 2*n):
    if ss[i] == now:
        temp += 1
    else:
        cntss += temp // 2
        temp = 1
        now = ss[i]
cntss += temp // 2

kousa = cntss - cnts
print(cnts + kousa*(k-1))

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

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

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

class UnionFind
{
  public:
    UnionFind(int n)
        : mN(n)
    {
        REP(i, n)
        {
            mNodeTbl.push_back(i);
            mWaightTbl.push_back(0);
        }
    }

    int find(int x)
    {
        if (x == mNodeTbl[x])
            return x;

        int par = mNodeTbl[x];
        mNodeTbl[x] = find(mNodeTbl[x]);
        mWaightTbl[x] += mWaightTbl[par];
        return mNodeTbl[x];
    }
    bool same(int x, int y)
    {
        return find(x) == find(y);
    }

    ll waight(int x)
    {
        int y = find(x);
        return mWaightTbl[x] - mWaightTbl[y];
    }

    //! y bigger than x
    void unit(int x, int y, ll w)
    {
        int ox = x, oy = y;
        x = find(x);
        y = find(y);
        ll wx = mWaightTbl[ox];
        ll wy = mWaightTbl[oy];
        if (x == y)
            return;
        w = w + wx - wy;
        if (w < 0)
        {
            //! xにyをつなぐ
            mNodeTbl[y] = x;
            mWaightTbl[y] = mWaightTbl[x] - abs(w);
        }
        else
        {
            //! yにxをつなぐ
            mNodeTbl[x] = y;
            mWaightTbl[x] = mWaightTbl[y] - abs(w);
        }
    }

  private:
    int mN;
    vector<int> mNodeTbl;
    vector<ll> mWaightTbl;
};

int main()
{
    ll N, Q;
    cin >> N >> Q;
    UnionFind uf(N);
    REP(i, Q)
    {
        int c;
        cin >> c;
        if (c == 0)
        {
            ll x, y, z;
            cin >> x >> y >> z;
            uf.unit(x, y, z);
        }
        else if (c == 1)
        {
            ll x, y;
            cin >> x >> y;
            if (uf.same(x, y))
                cout << uf.waight(y) - uf.waight(x) << endl;
            else
                cout << '?' << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 5220
#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, f = 0, t = 0, o = 0;
    cin >> n;
    rep(i,n){
        int a;
        cin >> a;
        if (a % 4 == 0) f ++;
        else if (a % 2 == 0) t ++;
        else o ++;
    }
    if (t == 0){
        if (f >= o - 1) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    else {
        if (f >= o) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

Measured memory_bytes: 256
H, W = map(int, input().split())
a = [input() for _ in range(H)]
h = [True for _ in range(H)]
w = [True for _ in range(W)]

for i in range(H):
  if a[i].count(".") == W:
    h[i] = False

for i in range(W):
  cnt = 0
  for j in range(H):
    if a[j][i] == ".":
      cnt += 1
  if cnt == H:
    w[i] = False

for i in range(H):
  for j in range(W):
    if h[i] and w[j]:
      print(a[i][j], end = "")
  if h[i]:
    print("")

Measured memory_bytes: 4468
// g++ macro.cpp -std=c++14
#include <bits/stdc++.h> //STL include
typedef long long ll;// long long int
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;//namespace

#define dump(x)  cout << #x << " = " << (x) << endl;// debug cout
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define SANKOU(n,a,b) cout << ((n) ? (a) : (b) ) << endl;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)// for macro
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);// warshall-floyd

#define CIN(x) int x;cin>>x;
#define COUT(x) cout<<(x)<<endl;
#define SCOUT(x) cout<<(x)<<" ";
#define ENDL cout<<endl;

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_;
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl;

#define ALL(obj) (obj).begin(),(obj).end()// iterator

#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end());

#define P pair<int,int>
#define V vector<int>
#define M map<int,int>

#define pb(a) push_back(a)//push_back
#define mp make_pair// make_pair


int main(){

    string s;
    cin>>s;
    Yes(s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I');

    return 0;
}


Measured memory_bytes: 256
package main

import "fmt"

func gcd(a, b int) int {
	for b != 0 {
		c := a % b
		a, b = b, c
	}
	return a
}

func nextInt() int {
	var x int
	fmt.Scan(&x)
	return x
}

func main() {
	n := nextInt()

	var ans int
	for i := range make([]struct{}, n) {
		a := nextInt()
		if i == 0 {
			ans = a
		}
		ans = gcd(ans, a)
	}
	fmt.Println(ans)
}


Measured memory_bytes: 5504
ABCDE = [int(input()) for _ in range(5)]
k = int(input())

ans = 0
for i in range(4):
  for j in range(i + 1, 5):
    ans += int(abs(ABCDE[i] - ABCDE[j]) > k)
    
if ans > 0:
  print(":(")
else:
  print("Yay!")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
int main(){
  ll a,b,q;cin>>a>>b>>q;
  vector<pll> v;vector<ll> va,vb;
  va.push_back(-100000000000000);
  vb.push_back(-100000000000000);
  for(ll i=0;i<a;i++){
    ll s;cin>>s;
    va.push_back(s);
    v.push_back(make_pair(s,0));
  }
  for(ll i=0;i<b;i++){
    ll s;cin>>s;
    vb.push_back(s);
    v.push_back(make_pair(s,0));
  }
  va.push_back(10000000000000000);
  vb.push_back(10000000000000000);
  sort(v.begin(),v.end());
  for(ll i=0;i<q;i++){
    ll x;cin>>x;
    ll a1=lower_bound(va.begin(),va.end(),x)-va.begin();
    ll b1=lower_bound(vb.begin(),vb.end(),x)-vb.begin();
    ll k1=max(va[a1],vb[b1])-x;
    ll k2=va[a1]-vb[b1-1]+min(va[a1]-x,x-vb[b1-1]);
    ll k3=vb[b1]-va[a1-1]+min(vb[b1]-x,x-va[a1-1]);
    ll k4=x-min(va[a1-1],vb[b1-1]);
    ll ans=min(k1,k2);
    ans=min(ans,k3);
    cout<<min(ans,k4)<<endl;
  }
}

Measured memory_bytes: 7908
n, k = map(int, input().split())
p_ls = list(map(int, input().split()))
ave_ls = []
'''
if n == 1:
    ave_ls.append(p_ls[0]*0.5+1)
elif n == 2:
    ave_ls.append((p_ls[0]+p_ls[1])*0.5+1)
else:
    for i in range(n-2):
        ave_ls.append((p_ls[i]+p_ls[i+1]+p_ls[i+2])*0.5+1)
'''
now_ave = 0
for i in range(k):
    now_ave +=p_ls[i]
ave_ls.append(now_ave*0.5+0.5*k)
for i in range(n-k):
    #print(now_ave)
    now_ave -=p_ls[i]
    now_ave+=p_ls[i+k]
    #print("p_ls[i]",p_ls[i],"p_ls[i+k-1]",p_ls[i+k-1])
    ave_ls.append(now_ave*0.5+0.5*k)
print(max(ave_ls))


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

using namespace std;
using ll = long long;
using pii = pair<int, int>;

ll gcd(ll a, ll b) {
  return b == 0 ? a : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int a, b;
  while (cin >> a >> b) {
    cout << gcd(a, b) << " " << lcm(a, b) << endl;
  }

  return 0;
}


Measured memory_bytes: 3088
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase

/*
cout<<fixed<<setprecision(20);
cin.tie(0);
ios::sync_with_stdio(false);
*/
const llint mod=1000000007;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}

int main(void) {
	int n,Q,i;cin>>n>>Q;
	vector<llint>A(n);
	for(i=0;i<n;i++){cin>>A[i];}
	vector<llint>hwa(n+1);
	for(i=1;i<=n;i++){hwa[i]=hwa[i-1]+A[n-i];}
	vector<llint>twa(n);
	twa[0]=A[0];twa[1]=A[1];
	for(i=2;i<n;i++){twa[i]=twa[i-2]+A[i];}
	twa.insert(twa.begin(),0);
	twa.insert(twa.begin(),0);
	while(Q--){
		llint X;cin>>X;
		llint bmax=(n+3)/2,bmin=1;
		//bmin枚以上は上からとれる
		while(bmax-bmin>1){
			//cerr<<"d";
			llint bgen=(bmax+bmin)/2;
			llint Y=A[n-bgen];
			if(n-bgen-LBI(A,X+X-Y)+1>=bgen){bmin=bgen;}
			else{bmax=bgen;}
		}
		//cerr<<"bmin="<<bmin<<endl;
		cout<<hwa[bmin]+twa[n-bmin-bmin+1]<<endl;
	}
}

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

int N, Q, A[100001];
int64_t S[100001], Sdiv[100001];
int X[100000];
int64_t ans[100000];

int main(){
    cin >> N >> Q;
    for(int i=1; i<=N; i++){
        cin >> A[i];
        S[i] = S[i-1] + A[i];
        Sdiv[i] = A[i];
        if(i-2 > 0) Sdiv[i] += Sdiv[i-2];
    }
    for(int i=0; i<Q; i++) cin >> X[i];

    for(int q=0; q<Q; q++){
        int ng = 0;
        int ok = N;
        while(ok-ng>1){
            int mid = (ng+ok)/2;
            if(A[mid] < X[q]){
                ng = mid;
            }else{
                int upper = N - mid + 1;
                int lower = mid - (lower_bound(A, A+N+1, max(1, 2*X[q]-A[mid])) - A) + 1;
                (upper > lower ? ng : ok) = mid;
            }
        }

        int64_t result = S[N] - S[ok-1];
        int t_first = N - (N-ok+1)*2;
        if(t_first > 0) result += Sdiv[t_first];
        ans[q] = result;
    }
    for(int i=0; i<Q; i++) cout << ans[i] << endl;
    return 0;
}

Measured memory_bytes: 4864
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

n, k = inm()
H = inl()
H.sort()


def solve():
    if k >= n:
        return 0
    return sum(H[: n - k])


print(solve())


Measured memory_bytes: 31616
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using static kyoupuro.Input;
using static kyoupuro.MyMath;

namespace kyoupuro {

    class MainClass {

        public static void Main() {
            var N = NextLong();
            var X = NextLong();
            var list = LongList();

            Console.WriteLine(list.Aggregate(Math.Abs(list.First() - X), (prev, now) => Gcd(prev, Math.Abs(now - X))));
        }
    }

    class MyMath {
        public static long Gcd(long a, long b) {
            return b == 0 ? a : Gcd(b, a % b);
        }
    }

    class Input {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line() {
            return Console.ReadLine();
        }

        public static int NextInt() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return int.Parse(enumerator.Current);
        }

        public static long NextLong() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return long.Parse(enumerator.Current);
        }

        public static string[] StrArr() {
            return Line().Split(' ');
        }

        public static List<int> IntList() {
            return StrArr().Select(int.Parse).ToList();
        }

        public static List<long> LongList() {
            return StrArr().Select(long.Parse).ToList();
        }

        public static void Skip(int line = 1) {
            enumerator.Reset();
            for (int i = 0; i < line; i++) Console.ReadLine();
        }

        public static void Reset() {
            enumerator.Reset();
        }
    }
}

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

#define all(x) x.begin(),x.end()
#define pb(x) emplace_back(x)
#define forn(i,N) for(int i=0;i<N;i++)

using namespace std;
using ll=long long int;
using ld=long double;
using vi=vector<int>;

int main() {
//freopen("input.txt","rt",stdin);
ios::sync_with_stdio(false);
cin.tie(nullptr);

ll N;
cin>>N;
cout<<N*(N+1)/2<<endl;
return 0;
}


Measured memory_bytes: 3640
#include <iostream>

using namespace std;

int main()
{
  int number = 0, return_num = 0;
  cin >> number;
  if(number >= 105 && number < 135)
  {
    return_num = 1;
  }
  else if(number >= 135 && number < 165)
  {
    return_num = 2;
  }
  else if(number >= 165 && number < 189)
  {
    return_num = 3;
  }
  else if(number >= 189 && number < 195)
  {
    return_num = 4;
  }
  else if(number >= 195)
  {
    return_num = 5;
  }
  cout << return_num << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
# define mod 1000000007
# define INF (1 << 29)
# define MAX_N 1000010
/* ACはうれCすぎてうれD */


int main(void){ 
    int n,k;
    cin >> n >> k;
    string s;
    cin >> s;

    vector<int> v; // 0 か 1 の先頭のidxが入る
    v.push_back(0);
    for(int i=1; i<n; i++){
        if(s.length() > 1 && s[i] != s[i-1]){
            v.push_back(i);
        }
    }
    v.push_back(n);


    // 各 v の要素が先頭だとした時に
    // いくつの 1 を連続させることができるか数える
    // k 個 先をみることができる
    // 区間の長さは idx どうしの差として取得可能

    int ans = 0;
    for(int i=0; i<v.size(); i++){
        if(s[v[i]] == '0' && v[i] != n){
            if(i + 2*k < v.size()){
                int tmp_ans = v[i + 2*k] - v[i];
                if(tmp_ans > ans) ans = tmp_ans;
            }
            else{
                int tmp_ans = n - v[i];
                if(tmp_ans > ans) ans = tmp_ans;
            }

        }
        else if(s[v[i]] == '1' && v[i] != n) {
            if(i + 2*k + 1 < v.size()){
                int tmp_ans = v[i + 2*k + 1] - v[i];
                if(tmp_ans > ans) ans = tmp_ans;
            }
            else{
                int tmp_ans = n - v[i];
                if(tmp_ans > ans) ans = tmp_ans;
            }
        }
    }

    cout << ans;
    return 0;
}


Measured memory_bytes: 1020
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;



int main() {
    int n, x;
    cin >> n >> x;

    

    if(x == 1 || x == 2*n-1) {
        cout << "No" << endl;
    } else {
        cout << "Yes" << endl;
        if(n == 2) {
            rep(i, 3) {
                cout << i+1 << endl;
            }
            return 0;
        }
        vi vec(2*n-1);
        rep(i, 2*n-1) {
            vec[i] = i+1;
        }
        swap(vec[x-1], vec[n-1]);
        swap(vec[0], vec[n-2]);
        if(vec[n-3] < x) {
            swap(vec[n-3], vec[2*n-2]);
        } 
        if(x>n) swap(vec[n-2], vec[n-3]);
        rep(i, 2*n-1) {
            cout << vec[i] << '\n';
        }
    }
}

Measured memory_bytes: 2304
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i=(a) ; i<=(b) ; ++i)
#define mp make_pair
#define pii pair<int, int>
#define PB push_back
#define F first
#define S second
#define Task ""
using namespace std;
const int N=100005;
const int mod=1000000007;
int dp[105][N], n, k, a[N];
long long sum[N];

void setup() {
    cin >> n >> k;
    rep(i, 1, n) {
        cin >> a[i];
        sum[i]=sum[i-1]+a[i];
    }
}

void add(int &a, int b) {
    a+=b;
    if(a>=mod) a-=mod;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen(Task".inp", "r", stdin);
    //freopen(Task".out", "w", stdout);
    setup();
    rep(i, 0, min(a[1], k)) dp[1][i]=i+1;
    rep(i, min(a[1], k)+1, k) dp[1][i]=dp[1][i-1];

    rep(i, 2, n) {
        dp[i][0]=1;
        rep(j, 1, min(sum[i], k*1ll)) {
            if(j<=a[i]) add(dp[i][j], dp[i-1][j]);
            else add(dp[i][j], (0ll+dp[i-1][j]-dp[i-1][j-a[i]-1]+mod)%mod);
            add(dp[i][j], dp[i][j-1]);
        }
        rep(j, min(sum[i], k*1ll)+1, k) dp[i][j]=dp[i][j-1];
    }
    int ans=dp[n][k];
    if(k) ans=(0ll+ans-dp[n][k-1]+mod)%mod;
    cout << ans;
    return 0;
}


Measured memory_bytes: 39680
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include<fstream>
#include <unordered_map>  
using namespace std;
#define eps 0.00000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define f(n) for(int i=0;i<n;++i)
#define REP(i,n) for(long long i = 0;i < n;++i)
int person_club[200000] = {};
int union_finding[200000] = {};
pair<int,int> union_find(int now){
	if(union_finding[now] != now){
		pair<int,int> wow = union_find(union_finding[now]);
		union_finding[now] = wow.second;
		return wow;
	}else{
		return pair<int,int>(person_club[now],now);
	}
}
int main(){
	int n,m,k;
	cin >> n >> m >> k;
	for(int i = 1;i <= n;++i){
		person_club[i] = -1;
	}
	for(int i = 1;i <= n;++i){
		union_finding[i] = i;
	}
	for(int i = 0;i < k;++i){
		int a,b,c;
		cin >> a >> b >> c;
		if(a == 1){
			pair<int,int> d = union_find(b),e = union_find(c);
			if(d.first == -1){
				union_finding[d.second] = e.second;
			}else if(e.first == -1){
				union_finding[e.second] = d.second;
			}else{
				if(d.first == e.first){
					union_finding[e.second] = d.second;
				}else{
					cout << i+1 << endl;
					return 0;
				}
			}
		}else{
			pair<int,int> wow = union_find(b);
			if(wow.first == -1){
				person_club[wow.second] =c; 
			}else{
				if(wow.first != c){
					cout << i+1 << endl;
					return 0;
				}
			}
		}
	}
	cout << 0 << endl;
	return 0;
}


Measured memory_bytes: 3884
#include <iostream>
#include <array>
#include <algorithm>

using namespace std;

using ll = long long int;

int main(){
    
    ll N, C, K;
    array<ll, 100000> T;
    
    cin >> N >> C >> K;
    for(ll i = 0; i < N; ++i){
        cin >> T[i];
    }
    
    sort(T.begin(), T.begin() + N);
    
    ll p = 0;
    ll sum = 0;
    ll lasti = 0;
    for(ll i = 0; i < N; ++i){
        if(p > 0){
            if(T[i] > T[lasti] + K){
                p = 0;
                sum += 1;
                lasti = i;
            }
        }else{
            lasti = i;
        }
        p += 1;
        if(T[i] >= T[lasti] + K || p >= C || i == N - 1){
            sum += 1;
            p = 0;
        }
    }
    
    cout << sum << endl;
    
    return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)

const int INF = 1 << 24;
const int dx[4] = {0, 0, 1, -1}, dy[4] = {1, -1, 0, 0};

typedef unsigned long long ull;

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

    std::vector<int> A, B;
    REP(i, N){
        int a;
        std::cin >> a;
        
        A.push_back(a);
    }

    REP(j, M){
        int b;
        std::cin >> b;
        
        B.push_back(b);
    }

    int vote[1010];
    std::fill(vote, vote+1010, 0);
    
    REP(i, M){
        REP(j, N){
            if(B[i] >= A[j]){
                vote[j]++;
                break;
            }
        }
    }

    int u = 0, v = 0;
    REP(i, N){
        if(v <= vote[i]){
            u = i;
            v = vote[i];
        }
    }
    
    std::cout << (u + 1) << std::endl;
}

Measured memory_bytes: 1232
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,f,g,h,i;
int main()
{
	cin>>a>>b>>e;
    c=3*e-a-b;
	h=2*e-b;
	f=2*a-h;
	i=3*e-c-f;
	d=2*e-f;
	g=3*e-h-i;
    printf("%d %d %d\n%d %d %d\n%d %d %d\n",a,b,c,d,e,f,g,h,i);
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
    public static void main(final String[] args) {
        final FastScanner scanner = new FastScanner(System.in);
        final int r = scanner.nextInt();
        final int c = scanner.nextInt();
        final int k = scanner.nextInt();

        final int[][] values = new int[r + 1][c + 1];
        for (int i = 0; i < k; i++) {
            final int x = scanner.nextInt();
            final int y = scanner.nextInt();
            final int v = scanner.nextInt();
            values[x][y] = v;
        }

        final long[][][] dp = new long[r + 1][c + 1][4];
        for (int i = 1; i <= r; i++) {
            for (int j = 1; j <= c; j++) {
                final int aboveValue = values[i - 1][j];
                final int leftValue = values[i][j - 1];
                final long maxAbove = max(dp[i - 1][j][0], dp[i - 1][j][1], dp[i - 1][j][2]);
                dp[i][j][0] = max(dp[i][j - 1][0], maxAbove + aboveValue, dp[i - 1][j][3]);
                dp[i][j][1] = max(dp[i][j - 1][0] + leftValue, dp[i][j - 1][1]);
                dp[i][j][2] = max(dp[i][j - 1][1] + leftValue, dp[i][j - 1][2]);
                dp[i][j][3] = max(dp[i][j - 1][2] + leftValue, dp[i][j - 1][3]);
            }
        }

        System.out.println(max(dp[r][c][0]+values[r][c], dp[r][c][1]+values[r][c], dp[r][c][2]+values[r][c], dp[r][c][3]));
    }

    private static long max(final long... values) {
        Arrays.sort(values);
        return values[values.length - 1];
    }

    private static class FastScanner {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(final InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (final IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

int main(){
    int a,b;
    cin>>a>>b;
    int q=a+b;
    int w=a-b;
    int e=a*b;
    int r=max({q,w,e});
    cout<<r<<endl;
    return(0);
}

Measured memory_bytes: 3592
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>

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

typedef int long long ll;
using namespace std;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const ll MOD = 1e9 + 7;
static const int MAX = 100;
static const int INF = (1 << 23);

int main() {
int n;
cin>>n;
int v[n],c[n];
rep(i,n)cin>>v[i];
rep(i,n)cin>>c[i];
int maxv=0;
for(int i=0;i<(1<<n);i++) {
    int x = 0;
    int y = 0;
    for (int j = 0; j < n; j++) {
        if ((i >> j & 1)) {
            x += v[j];
            y += c[j];
        }
    }
    maxv = max(maxv, x - y);

}
cout<<maxv<<endl;


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int lint;

#define PI acos(-1)
#define INF64 1LL << 60
#define INF32 1 << 29
#define LIMIT(d_in, d_min, d_max) max(d_min, min(d_max, d_in))
#define all(a) (a).begin(), (a).end()
#define INV ((long long int)1000000007)

using namespace std;

void execute()
{
	int N;
	cin >> N;

	set<int> flag;

	for (int i = 0; i < N; i++)
	{
		int tmp;
		cin >> tmp;
		if (flag.count(tmp) == 0)
			flag.insert(tmp);
		else
			flag.erase(tmp);
	}

	cout << flag.size() << endl;

	return;
}

int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	execute();

	int stop;
	cin >> stop;

	return 0;
}

Measured memory_bytes: 4992
S = input()
s = []
a = 1000
for i in range(len(S) - 2):
    s.append(S[i] + S[i + 1] + S[i + 2])
for j in range(len(s)):
    if a > abs(int(s[j]) - 753):
        a = abs(int(s[j]) - 753)
print(a)

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

int main()
{
    long long X;
    cin >> X;

    vector<bool> prime(1e5 + 9, true);
    prime[0] = false;
    prime[1] = false;
    for (int i = 2; i * i <= 1e5 + 9; i++)
    {
        int j = 2;
        while (i * j <= 1e5 + 9)
        {
            prime[i * j] = false;
            j++;
        }
    }

    for (int i = X; i <= 1e5 + 9; i++)
    {
        if (prime[i])
        {
            cout << i << endl;
            return 0;
        }
    }
}


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

using namespace std;

int main(){
    int n, m;
    int cityRoadNum[50] = {0};

    cin >> n >> m;

    int temp;
    for(int i = 0; i < 2 * m; i++){
        cin >> temp;
        cityRoadNum[temp - 1]++;
    }

    for(int i = 0; i < n; i++){
        cout << cityRoadNum[i] << endl;
    }


    return 0;
}


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

int main()
{
  
  ll n;cin>>n;
  ll arr[10001]; memset(arr,0,sizeof arr);
  for(ll x=1;x<=sqrt(n);x++)
  {
    for(ll y=1;y<=n;y++)
    {
      if(x*x + y*y + x*y >n) break;
      for(ll z=1;z<=n;z++)
      {
        if(x*x + y*y + z*z + x*y + y*z + x*z >n) break;
        arr[x*x + y*y + z*z + x*y + y*z + x*z]++;
      }
    }
  }
  for(ll i=1;i<=n;i++) cout<<arr[i]<<endl;
}

Measured memory_bytes: 3592
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

std::string solve(int a, int b, int c, int k)
{
  int count = 0;
  while (a >= b) {
    b *= 2;
    ++count;
  }
  if (count > k) return "No";

  while (b >= c) {
    c *= 2;
    ++count;
  }
  return count <= k ? "Yes" : "No";
}

int main()
{
  int a, b, c, k;
  std::cin >> a >> b >> c >> k;

  std::cout << std::setprecision(20);
  std::cout << solve(a, b, c, k) << std::endl;
}


Measured memory_bytes: 3624
# include <bits/stdc++.h>
# define int long long
# define endl "\n"
using namespace std;

void solve() {

	int n;
	cin >> n;

	map <int, int> m;
	for (int i = 0; i < n; i++) {
		int ele;
		cin >> ele;
		m[ele]++;
	}
	int size = 1e6;
	vector <int> arr(size + 1, false);
	for (auto it : m) {
		if (!arr[it.first]) {
			for (int j = 2 * it.first; j <= size; j += it.first) {
				arr[j] = true;
			}
		}
	}
	int count = 0;
	for (auto it : m) {
		if (arr[it.first] || it.second > 1) {
			continue;
		}
		else {
			count++;
		}
	}
	cout << count << endl;
	return;
}

signed main() {

	ios_base::sync_with_stdio(0);
	cin.tie(0);

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

	solve();

	return 0;
}

Measured memory_bytes: 23488
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int X = sc.nextInt();
        int Y = sc.nextInt();
        for(int tsuru=0; tsuru<=X; tsuru++) {
            int kame = X - tsuru;
            int leg = kame * 4 + tsuru *2;
            if(leg==Y) {
                System.out.println("Yes");
                return;
            }
        }
        System.out.printf("No");
    }
}


Measured memory_bytes: 35760
#include <iostream>
#include<stdio.h>
using namespace std;
///Case x: N
int main()
{
    int i=1,n;
    for(;;)
    {
        cin>>n;
        if(n==0)
        {
            return 0;
        }
        cout<< "Case "<<i<<": "<<n<<endl;
        i++;
    }

    return 0;
}



Measured memory_bytes: 3000
N,L=map(int,input().split())
MM=200

A=[0]*N
B=[0]*N

for i in range(N):
  A[i]=L+i
  B[i]=abs(L+i)
  if MM>abs(A[i]):
    MM=A[i]
  
#print(A)  
#print(min(B))

if MM>0:
  print(sum(A)-min(B))
else:
  print(sum(A)+min(B))

Measured memory_bytes: 3064
/**
*    created: 14.05.2020 10:29:06
**/
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;

signed main() {

    cin.tie(0);
    ios_base::sync_with_stdio(false);

    int n; cin >> n;
    vector<int> v(n);
    vector<int> c(n);
    rep(i,n) cin >> v[i];
    rep(i,n) cin >> c[i];
    int ans = -1000000000000000000;
    for (int bit = 0; bit < (1 << n); bit++) {
        int vsum = 0, csum = 0;
        rep(i,n) {
            if ((bit >> i) & 1) {
                vsum += v[i];
                csum += c[i];
            }
        }
        ans = max(vsum - csum, ans);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
#define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
int main()
{
    int n, y;
    cin >> n >> y;
    for (int i = 0; i <= n && i * 10000 <= y; i++)
    {
        for (int j = 0; j + i <= n && i * 10000 + j * 5000 <= y; j++)
        {
            if ((y - i * 10000 - j * 5000) / 1000 == n - i - j)
            {
                cout << i << " " << j << " " << n - i - j << endl;
                return 0;
            }
        }
    }
    cout << "-1 -1 -1" << endl;
    return 0;
}

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

using namespace std;

int main(int argc, char const *argv[]) {
  string sd, t;
  cin >> sd >> t;
  int ls = sd.size(), lt = t.size(), idx=sd.size();

  vector<string> ans;

  for (size_t i = 0; i < ls - lt + 1; i++) {
    string sbsd = sd.substr(i,lt);
    bool checker = true;
    for (size_t j = 0; j < lt and checker; j++) {
      if (sbsd[j] == t[j] or sbsd[j] == '?') ;
      else checker = false;
    }
    if (checker) {
      string stemp = sd;
      string s = stemp.replace(i, lt, t);
      for (size_t j = 0; j < ls; j++) {
        if (s[j] == '?') s[j] = 'a';
      }
      ans.push_back(s);
    }
  }

  sort(ans.begin(), ans.end());
  ans.push_back("UNRESTORABLE");


  cout << ans[0] << endl;

  return 0;
}


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


int main() {

    long double a,b,c;
    cin >> a >> b >> c;
    if(a+b+2*sqrt(a*b)<c){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(150) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,R) vector<vector<L>> K(N, vector<L>(M,R))
#define pint pair<lli,lli>
#define Lower(v,X) lower_bound(v.begin(),v.end(),X)-v.begin();
#define mod 1000000007
#define MAX 5100000
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main(){
  lli A,B,C,D,E,L,R,X,Y,W,H,N,M,K,sum=0,num=0,flag=0;string S,T;
  cin >> N;
  Vec(Q,lli,N,0);
  rep(i,0,N)cin >> Q[i];
  flag++;
  if(Q[0]){
    Out(-1);flag=0;
  }
  if(flag){
    rep(i,1,N)if(Q[i]-Q[i-1]>1){
      Out(-1);flag=0;break;
    }
  }
  if(flag){
    rep(i,1,N){
      if(Q[i]<=Q[i-1])sum+=Q[i];
      else if(Q[i])sum++;
    }
    Out(sum);
  }
}

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

using namespace std;

multiset <int> st;
int u[10001];
int a[100001];

int main () {
	ios_base::sync_with_stdio (0);
	cin.tie (0), cout.tie (0);
	int n;
	cin >> n;
	int mx = 0;
	for (int i = 1;i <= n;i ++) {
		cin >> a[i];
		st.insert (a[i]);
		u[a[i]] ++;
		mx = max (mx, a[i]);
	}
	int id = 1;
	mx ++;
	while (id <= mx) {
		int k = mx;
		if (id <= mx / 2) {
			k = mx - id;
		}
		else k = id - 1;  
		if (!u[k]) {
			cout << "Impossible";
			return 0;
		}
		u[k] --;
		st.erase (st.find (k));
		id ++;
	}
	int left = n - 1 - mx;
	for (auto it : st) {
		if (it < (mx + 2) / 2) {
			cout << "Impossible";
			return 0;
		}
	}
	cout << "Possible";
	return 0;
}

Measured memory_bytes: 256
$%=1e9+7;
$N=<>-3;
@$_=1for@_=glob'{A,C,G,T}'x3;
@AGC=0;@ACG=0;@GAC=0;
for$i(1..$N){
	for$j(@_){
		for(A,C,G,T){
			if("$j$_"!~/ACG|A.*G.*C|GAC/){
				$j=~/./;
				(${$'.$_}[$i]+=$$j[$i-1])%=$%
			}
		}
	}
}
$x=($x+$$_[$N])%$%for@_;
print$x,$/


Measured memory_bytes: 1024
#include<stdio.h>
#define N 1010
#define M 35

int main(void){
  int i,num,j,k;
  char ch[N][M],chm[N];
  char lng[M],ll,llp,count,maxcount=0,mcp,cc;

  for(i=0;scanf("%s",&ch[i])==1;i++){}
  num=i;
  for(i=0;i<num;i++){
    for(j=0;j<M;j++){
      if(ch[i][j]==0){
        break;
      }else{
        if(ll<j){
          ll=j;
          llp=i;
        }
      }
    }
    for(j=i+1,count=0;j<num-1;j++){
      for(k=0,cc=0;ch[i][k]!=0 || ch[j][k]!=0;k++){
        if(ch[i][k]==ch[j][k]){
          cc++;
        }
      }
      if(cc==k){
        count++;
      }
    }
    if(count>maxcount){
      maxcount=count;
      mcp=i;
    }
  }
  printf("%s ",ch[mcp]);
  printf("%s\n",ch[llp]);
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cmath>
#define F first
#define S second

using namespace std;

long long sum , x , y;
pair < int , bool > a[10000000];

int main()
{
    int n , m;
    cin >> n >> m;
    a[1].first = a[1].second = 1;
    for ( int i = 2 ; i <= n ; i++)
    {
        a[i].first = 1;
    }
    for ( int i = 1 ; i <= m ; i++)
    {
        cin >> x >> y;
        if(a[x].second && a[x].first > 1)
        {
            a[y].F++;
            a[y].S = true;
            a[x].F--;
            continue;
        }
        else {
            if(a[x].second && a[x].first == 1)
            {
                a[y].F++;
                a[y].S = true;
                a[x].F--;
                a[x].S = false;
                continue;
            }
            else if(!a[x].S)
            {
                a[y].F++;
                a[x].F--;
                continue;
            }
        }
    }
    for ( int i = 1 ; i <= n ; i++)
        if(a[i].S)sum++;
    cout << sum;
    return 0;
}


Measured memory_bytes: 1024
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0047
Cup Game
"""
import sys


def main(args):
    ball_position = 'A'  # ?????¨??????????????\??£???????????????????????????
    for line in sys.stdin:
        exchanged_cups = line.strip().split(',')
        if ball_position in exchanged_cups:  # ??????????????\??£???????????????????????\?????????????±??????????????????´???
            exchanged_cups.remove(ball_position)  # ??\?????????????±???????????????????????????????????????\??£?????????????????????????¶????
            ball_position = exchanged_cups[0]  # ????????¨??????????????§????????????????????£??????????????????=??????????????????(?????????[0]??????)????????????????§???? 
    print(ball_position)  # ????????????????????¨?????????


if __name__ == '__main__':
    main(sys.argv[1:])

Measured memory_bytes: 7348
import java.util.*;
public class Main{   
    public static void main(String[] args){
      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();
      for(int i = 0;i < n;i++)b[i]=sc.nextInt();
      int[] cnt = new int[n];
      int max = 0;
      for(int i = 0;i < n;i++){
      	for(int j = 0;j <= i;j++)cnt[i]+=a[j];
        for(int j = i;j < n;j++)cnt[i]+=b[j];
        max = Math.max(max,cnt[i]);
      }
      System.out.println(max);
    }
    public static int lcm(int x, int y){
      return x*y/gcd(x,y);
    }
    public static int gcd(int x, int y){
      if(x < y)return gcd(y,x);
      if(y==0)return x;
      return gcd(y,x%y);
    }
}

Measured memory_bytes: 21844
#include <stdio.h>
#include <vector>
#include <math.h>
typedef long long ll;
using namespace std;

int main(void) {
  ll i, j, k, n, now = 0, cnt = 1;
  scanf("%lld", &n);
  double ans = 1.0 + (double)n * 8.0;
  if(sqrt(ans) != (int)sqrt(ans)) {
    printf("No");
    return 0;
  }
  now = (int)((1.0 + sqrt(ans)) / 2.0);
  printf("Yes\n%lld\n", now);
  vector<ll> vec[now];
  for(i = 0; i < now; ++i) {
    for(j = i + 1; j < now; ++j) vec[i].push_back(cnt), vec[j].push_back(cnt), cnt++;
  }
  for(i = 0; i < now; ++i) {
    printf("%lld", 2 * n / now);
    for(j = 0; j < 2 * n / now; ++j) printf(" %lld", vec[i][j]);
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 3200
n,m = map(int, input().split())
c = []
d = []
for i in range(n):
    arr = input().split()
    c.append(arr)
for j in range(m):
    d.append(int(input()))
for i in range(n):
    sum = 0
    for j in range(m):
        sum += int(c[i][j])*d[j]
    print(sum)

Measured memory_bytes: 8312
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

int main(){
    int n,ai;
    cin>>n;
    int cnt=0;
    rep(i,n){
        cin>>ai;
        bool flag=true;
        for(int i=2;i*i<=ai;++i)if(ai%i==0) flag=false;
        if(flag) ++cnt;
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 3084
#pragma GCC optimize("O3", "unroll-loops")

// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <limits>
#include <ext/rope>

using namespace std;
using namespace __gnu_cxx;

const int inf = (1 << 30) + 9e8;
const int MAXN = 1e5;
const int MAXN2 = 1e4;
const int P = 131;
const long long MOD = 1000000007;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef vector<vll> vvll;
typedef vector<bool> vb;

#define FAST ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define all(a) a.begin(), a.end()
#define pb push_back
#define files(in, out) freopen(in, "r", stdin); freopen(out, "w", stdout)
#define ppb pop_back
#define ppf pop_front
#define fs first
#define sd second
#define eb emplace_back

template<class T> inline void sort(T &a) { sort(all(a)); }
template<class T> inline istream& operator>>(istream& str, vector<T> &a) { for (auto &i : a) str >> i; return str; }
std::mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

void solve() {
    int n, W;
    cin >> n >> W;
    vll m(n + 1), v(n + 1);
    vvll dp(n + 1, vll(100001, inf));
    for (int i = 1; i <= n; ++i) {
        cin >> m[i] >> v[i];
    }
    dp[0][0] = 0;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j <= 100000; ++j) {
            dp[i][j] = min(dp[i - 1][j], dp[i][j]);
            if (v[i] <= j) {
                if (dp[i - 1][j - v[i]] + m[i] <= W)
                    dp[i][j] = min(dp[i][j], dp[i - 1][j - v[i]] + m[i]);
            }
        }
    }
    ll mn = inf, mi = 0;
    for (int i = 100000; i >= 0; --i) {
        if (dp[n][i] != inf) {
            cout << i;
            return;
        }
    }
}

signed main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    FAST;
    int q = 1;
    // cin >> q;
    // int st = clock();
    while (q--) {
        solve();
    }
    // int en = clock();
    // cout << en - st << "ms.";
    return 0;
}


Measured memory_bytes: 83188
a=input().split(' ')
X=int(a[0])
N=int(a[1])

if N!=0:
  Ls=input().split(' ')
  L=[]
  for i in range(N):
    L.append(int(Ls[i]))
  for i in range (N+1):
    if X-i in L and X+i in L:
      pass
    elif X-i not in L:
      s=X-i
      break
    elif X-i in L and X+i not in L:
      s=X+i
      break
else:
  s=X


print(s)

Measured memory_bytes: 9204