akhauriyash/Code-Regression huggingface dataset:
#if !defined(__clang__) && defined(__GNUC__)
#include <bits/stdc++.h>
#else
#include <cstdlib>
#include <climits>
#include <iostream>
#include <cstdint>
#include <vector>
#include <string>
#include <complex>
#include <bitset>
#include <queue>
#include <deque>
#include <stack>
#include <utility>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <regex>
#endif //  !defined(__clang__) && defined(__GNUG__)
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/math/common_factor_rt.hpp>  // https://boostjp.github.io/tips/math.html
#include <boost/dynamic_bitset.hpp>  // https://boostjp.github.io/tips/dynamic_bitset.html

constexpr int64_t DIV1097 = 1000000007LL;

using namespace std;

int main()
{
    int64_t N;
    std::cin >> N;

    int64_t T, A;
    T = A = 1;
    for (decltype(N) i = 0; i < N; ++i) {
        int t, a;
        std::cin >> t >> a;

        int64_t k;
        k = std::max(T/t, A/a);
        for (;; ++k) {
            if (k*t >= T && k*a >= A) {
                T = k*t;
                A = k*a;
                break;
            }
        }
    }

    std::cout << T + A << std::endl;

    return 0;
}


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

#define MAXN 200005
#define MAXB 21

using namespace std;

const int INF = 1e9 + 2e6;
int v[MAXN], n, m;
int d[MAXN], up[MAXN][MAXB], down[MAXN][MAXB], pre[1 << MAXB], suf[1 << MAXB];
int visit[MAXN];

int read() {
    char c = getchar();
    int x = 0, s = 1;
    while (!isdigit(c)) {
        if (c == '-')
            s = -1;
        c = getchar();
    }
    while (isdigit(c)) {
        x = (x << 3) + (x << 1) + c - '0';
        c = getchar();
    }
    return x * s;
}

void init() {
    while (v[++m] >= 1)
        v[m + 1] = v[m] >> 1;
    d[0] = -INF;
    d[n + 1] = INF;
    for (int j = 1; j <= m; ++j) {
        for (int i = 1; i <= n; ++i)
            if (d[i] - d[i - 1] <= v[j])
                up[i][j] = up[i - 1][j];
            else
                up[i][j] = i;
        for (int i = n; i >= 1; --i)
            if (d[i + 1] - d[i] <= v[j])
                down[i][j] = down[i + 1][j];
            else
                down[i][j] = i;
    }
}

void solve() {
    memset(suf, 0x3f, sizeof(suf));
    memset(pre, -0x3f, sizeof(pre));
    suf[0] = n + 1;
    pre[0] = 0;
    int limit = (1 << m) - 1;
    for (int s = 0; s <= limit; ++s) {
        for (int i = 1; i <= m; ++i) {
            if (s >> (i - 1) & 1)
                continue;
            int t = s | (1 << (i - 1));
            if (pre[s] >= 0)
                pre[t] = max(pre[t], down[pre[s] + 1][i]);
            if (suf[s] <= n + 1)
                suf[t] = min(suf[t], up[suf[s] - 1][i]);
        }
    }
    for (int s = 1; s < limit; ++s) {
        if (s & 1)
            continue;
        int t = limit ^ s;
        t ^= 1;
        if (suf[t] - pre[s] <= 2) {
            ++visit[1];
            --visit[n + 1];
        }
        if (down[pre[s] + 1][1] >= suf[t] - 1) {
            ++visit[up[pre[s] + 1][1]];
            --visit[down[pre[s] + 1][1] + 1];
        }
    }
    for (int i = 1; i <= n; ++i)
        visit[i] = visit[i - 1] + visit[i];
    for (int i = 1; i <= n; ++i)
        if (visit[i])
            puts("Possible");
        else
            puts("Impossible");
}

int main() {
    n = read();
    v[1] = read();
    for (int i = 1; i <= n; ++i)
        d[i] = read();
    init();
    solve();
}




Measured memory_bytes: 53632
import os
import sys
import numpy as np

def solve(H, W, AB):
    dp = np.zeros((H, W, 13000), dtype=np.int8)
    dp[0, 0, AB[0, 0]] = True
    dp[0, 0, -AB[0, 0]] = True
    for y in range(H):
        for x in range(W):
            ref = dp[y-1][x] | dp[y][x-1]
            ab = AB[y, x]
            for i in range(-6500, 6500):
                if ref[i+ab] or ref[i-ab]:
                    dp[y][x][i] = True
    ans = 1<<60
    for i in range(-6500, 6500):
        if dp[H-1, W-1, i]:
            a = abs(i)
            if a < ans:
                ans = a
    return ans

# >>> numba compile >>>
numba_config = [
    [solve, "i8(i8,i8,i8[:,:])"],
]
if sys.argv[-1] == "ONLINE_JUDGE":
    from numba import njit
    from numba.pycc import CC
    cc = CC("my_module")
    for func, signature in numba_config:
        vars()[func.__name__] = njit(signature)(func)
        cc.export(func.__name__, signature)(func)
    cc.compile()
    exit()
elif os.name == "posix":
    exec(f"from my_module import {','.join(func.__name__ for func, _ in numba_config)}")
else:
    from numba import njit
    for func, signature in numba_config:
        vars()[func.__name__] = njit(signature, cache=True)(func)
    print("compiled!", file=sys.stderr)
# <<< numba compile <<<


H, W = map(int, input().split())
AB = np.array(sys.stdin.read().split(), dtype=np.int64).reshape(H*2, W)
AB = AB[:H] - AB[H:]
print(solve(H, W, AB))


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

using namespace std;
vector<pair<int,int>>v;
int x[10];
int y[10];
int main()
{
//    string s;
//
//    int n;
//    scanf("%d",&n);
//    cin>>s;
//    int start = 0,end=s.size()/2;
//    if(s.size()%2==1)puts("No");
//    else{
//        bool flag = true;
//        while(start!=s.size()/2){
//            if(s[start++]!=s[end++]){
//                flag=false;
//                break;
//            }
//        }
//        if(!flag)puts("No");
//        else puts("Yes");
//    }
    int n;
    scanf("%d",&n);
    int a,b;
    for(int i=0;i<n;i++){
        scanf("%d %d",&x[i],&y[i]);
    }
    vector<int>pos;
    for(int i=0;i<n;i++){
        pos.push_back(i);
    }
    double ans = 0;
    int cnt=0;
    do{
        cnt++;
        for(int i=0;i<n-1;i++){
            ans+=(double)sqrt(((x[pos[i]]-x[pos[i+1]])*(x[pos[i]]-x[pos[i+1]]))+((y[pos[i]]-y[pos[i+1]])*(y[pos[i]]-y[pos[i+1]])));
        }
    }while(next_permutation(pos.begin(),pos.end()));
    printf("%.10lf",ans/(double)cnt);
    return 0;
}


Measured memory_bytes: 256
#include                        <bits/stdc++.h>
#include                        <ext/pb_ds/assoc_container.hpp>
#define lb                      lower_bound
#define ub                      upper_bound
#define fe(x)                   *(x.begin())
#define le(x)                   *(x.rbegin())
#define pb                      push_back
#define load(node,n)            bool operator < (const node &n) const
#define fbo(x)                  find_by_order(x)
#define ook(x)                  order_of_key(x)
#define all(x)                  (x).begin(),(x).end()
#define FOR(i,n)                for(int i = 1; i<=n; i++)
#define REP(i,n)                for(int i = 0; i<n;  i++)
#define TT                      int TC;  scanf("%d",&TC);  while(TC--)
#define read                    freopen("input.txt","r",stdin)
#define write                   freopen("output.txt","w",stdout)
#define dbg(...)                debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#define set(x)                  tree<x,null_type,less<x>,rb_tree_tag,tree_order_statistics_node_update>
using                           namespace __gnu_pbds;
using                           namespace std;
typedef                         long long ll;
typedef                         pair<ll,ll> pll;
typedef                         pair<int,int> pii;

vector<string> vec_splitter(string s){
    s += ','; vector<string> res;
    while(!s.empty()) res.push_back(s.substr(0,s.find(','))), s = s.substr(s.find(',') + 1);
    return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused))int idx,
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T){
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") "; stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str(); debug_out(args, idx + 1, LINE_NUM, T...);
}






main(){
//read;

double a;
cin>>a;
double pi = acos(-1);
double ans = 2*pi*a;
printf("%.6f",ans);






return 0;
}


Measured memory_bytes: 3824
#include <string>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string.h>
#include <utility>
#include <queue>
#include <stack>
#include <iomanip>
#include <ctype.h>
#include <map>
#include <set>
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <sstream>
#include <math.h>
#include <time.h>
#include <iostream>
#include <iomanip>
#include <unordered_set>
#include <unordered_map>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <tuple>
#include <cmath>
#include <stdio.h>      /* printf, fgets */
#include <stdlib.h>
#include <fstream>

using namespace std;

typedef long long LL;

#define FOR(i,n) for(int i = 0;i < n;i++)
#define MP make_pair
#define PB push_back
#define ALL(a) (a).begin(),(a).end()
#define PII pair<int, int>
#define PLL pair<long long, long long>
#define CLEAR(a) memset(a, 0, sizeof(a))
#define ERASE(a) memset(a, -1, sizeof(a))
#define INF 2000000007LL
#define y1 uu1
#define y2 uu2
const double EPS = 1E-12;
const double PI = acos(-1.0);
const LL mod = 1000000007;

using namespace std;

int n,x;
int c[3];

void solve() {
  cin >> n;
  LL ans = 1;
  FOR(i, n) {
    cin >> x;
    LL opt = 0;
    FOR(j, 3) {
      if (c[j] == x) {
        opt += 1;
      }
    }
    if (opt == 0) {
      cout << 0 << endl;
      return;
    }
    ans  = (ans * opt) % mod;
    FOR(j, 3) {
      if (c[j] == x) {
        c[j]++;
        break;
      }
    }
  }
  cout << ans << endl;
}

int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0);
  solve();
  return 0;
}


Measured memory_bytes: 256
### main

while true
  w = gets.strip.to_i
  break if w < 0

  level = []
  for i in (0..2)
    if w <= 10
      level[i] = w
      w = 0
    else
      level[i] = 10
      w -= 10
    end
  end
  level[3] = w

  fee = 1150 + level[1] * 125 + level[2] * 140 + level[3] * 160
  puts 4280 - fee
end

Measured memory_bytes: 6096
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define inf 1000000000
#define pb push_back
#define mp make_pair
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define yoi cout<<"yo"<<endl;
#define debug(i) cout<<i<<endl;
const int mod=1e9 +7;
int main(){
IOS;
int n,k,i;
cin>>n>>k;
string s;
cin>>s;
int a[n];
memset(a,0,sizeof(a));
for(i=0;i<n;i++){
    if(s[i]-48)
        a[i]=1;
}
int start=0;
vector<pair<int,int> > v;
for(i=0;i<n;i++){
    if(a[i]&&start<i){
        v.pb({start,i-1});
        start=i+1;
    }
    else if(a[i])
        start++;
}
if(start!=n)
    v.pb({start,n-1});
if(v.size()<=k){
    cout<<n<<endl;
    return 0;
}
int maxi=v[k].first;
for(i=k;i<v.size();i++){
    if(i!=v.size()-1)
    maxi=max(maxi,v[i+1].first-v[i-k].second-1);
    else maxi=max(maxi,n-1-v[i-k].second);
}
cout<<maxi<<endl;
}


Measured memory_bytes: 1404
package main

import (
	"fmt"
	"io"
	"os"
	"sort"
)

func main() {
	solve(os.Stdin, os.Stdout)
}

func solve(in io.Reader, out io.Writer) {
	var n, k int
	fmt.Fscanf(in, "%d%d", &n, &k)

	h := make([]int, n)
	for i := range h {
		fmt.Fscanf(in, "%d", &h[i])
	}

	sort.Ints(h)

	ans := h[n-1] - h[0]

	for i := 0; i < n-k+1; i++ {
		d := h[i+k-1] - h[i]
		if d < ans {
			ans = d
		}
	}
	fmt.Fprintln(out, ans)
}

func abs(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

func gcd(a, b int64) int64 {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}


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

int main(){
  string S;
  cin >> S;
  int ans = 0;
  if (S.at(0) == '2') ans++;
  if (S.at(1) == '2') ans++;
  if (S.at(2) == '2') ans++;
  if (S.at(3) == '2') ans++;
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma once
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
#define int long long
#define double long double
#define endn "\n"
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 


////////////////////////////////////////////////////////////////////

int n,k;P p[110000];bool s[110000];
deque<int> deq;
signed main(){
  cin>>n>>k;
  rep(i,n){
    cin>>p[i].second>>p[i].first;
  }
  sort(p, p+n, greater<P>());
  int ans = 0, sum = 0, i = 0, v = 0;
  rep(j,k){
    sum += p[j].first;
    if(!s[p[j].second]){
      v++;
      s[p[j].second] = true;
    }else{
      deq.push_back(p[j].first);
    }
    i++;
  }
  ans = sum + v*v;
  while(i < n && !deq.empty()){
    if(!s[p[i].second]){
      sum -= deq.back();deq.pop_back();
      sum += p[i].first;
      s[p[i].second] = true;
      v++;
      chmax(ans, sum+v*v);
    }
    i++;
  }
  cout << ans << endl;
}



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

const int P = 1000000007;
int n, m, dp[200005], sum[2][200005];
char s[200005];

int main() {
	scanf("%d%d%s", &n, &m, s + 1);
	if (count(s + 1, s + 1 + m, s[1]) == m) {
		if (n == 1) return puts("1"), 0;
		int ans = 0;
		for (int c = 0; c < 2; ++c) {
			int dp[2] = {};
			dp[c] = 1;
			for (int i = 2; i <= n; ++i) {
				int t = dp[1];
				dp[1] = dp[0];
				dp[0] = (dp[0] + t) % P;
			}
			ans = (ans + dp[0]) % P;
			if (!c) ans = (ans + dp[1]) % P;
		}
		printf("%d\n", ans);
		return 0;
	}
	int lim = n - 1;
	for (int i = 1, j; i <= m; i = j) {
		for (j = i; j <= m && s[j] == s[i]; ++j);
		if (j > m || s[i] != s[1]) continue;
		if (j - i & 1)
			lim = min(lim, j - i);
		else if (i == 1)
			lim = min(lim, j - i + 1);
	}
	dp[0] = 1;
	sum[0][0] = sum[0][1] = 1;
	sum[1][0] = sum[1][1] = 0;
	for (int i = 2; i <= n; ++i) {
		int d = max(0, i - lim - 1);
		dp[i] = (sum[i & 1][i - 2] - (d == 0 ? 0 : sum[i & 1][d - 1])) % P;
		sum[0][i] = sum[0][i - 1];
		sum[1][i] = sum[1][i - 1];
		sum[i & 1][i] = (sum[i & 1][i] + dp[i]) % P;
	}
	long long ans = 0;
	for (int i = 0; i <= lim; ++i)
		ans += sum[n & 1][n - (i + 1)] - (n == lim + 1 ? 0 : sum[n & 1][n - (lim + 1) - 1]);
	printf("%lld\n", (ans % P + P) % P);
	return 0;
}


Measured memory_bytes: 2816
import sys,collections as cl,bisect as bs,random
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

d = onem()

c = l()

s = []
for i in range(d):
	s.append(l())
	s[-1] = [[s[-1][i],i+1] for i in range(26)]
	s[-1].sort(reverse = True)
	print(s[-1][random.randrange(1,10)-1][1])
day = [0 for i in range(26)]

c = [[c[i],i] for i in range(26)]
c.sort(reverse = True)

	


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

#solve
def solve():
    x, y = LI()
    a = [1, 3, 5, 7, 8, 10, 12]
    b = [4, 6, 9, 11]
    c = [2]
    if x in a and y in a:
        print("Yes")
        return
    if x in b and y in b:
        print ("Yes")
        return
    if x in c and y in c:
        print ("Yes")
        return
    print("No")
    return


#main
if __name__ == '__main__':
    solve()


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

int main(int argc, char const *argv[])
{
	int n; cin >> n;
	int x = (double)n / 1.08;
	for (int i = max(x - 10, 0); i < x + 10; i++) {
		if ((int)(1.08 * i) == n) {
			cout << i << endl;
			return 0;
		}
	}
	cout << ":(" << endl;
	return 0;
}


Measured memory_bytes: 256
#define _DEBUG 1
#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>
using namespace std;

using ll = long long;

#ifdef _DEBUG
#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define dump3(x, y, z)                                                     \
  cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z \
       << endl
#define check(s) cerr << s << endl
#else
#define dump(x)
#define dump2(x, y)
#define dump3(x, y, z)
#define check(s)
#endif

#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define unique(v) v.erase(unique(v.begin(), v.end()), v.end());

const ll LINF = 2e18;
const int INF = 1e9;

void solve(ll N, ll K) {
  int i = 0;
  while (true) {
    if (pow(K, i) > N) {
      break;
    }
    i++;
  }

  cout << i << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  ll N;
  scanf("%lld", &N);
  ll K;
  scanf("%lld", &K);
  solve(N, K);
  return 0;
}


Measured memory_bytes: 384
n=input()
if n==3:
	print '2 5 63'
	quit(0)
if n==4:
	print "2 5 20 63"
	exit(0)
for i in range(n/8):
	print i*12+2, i*12+3, i*12+4, i*12+6, i*12+8, i*12+9, i*12+10, i*12+12,
if n%8==1:
	print n/8*12+6,
if n%8==2:
	print n/8*12+2, n/8*12+4,
if n%8==3:
	print n/8*12+2, n/8*12+4, n/8*12+6,
if n%8==4:
	print n/8*12+2, n/8*12+4, n/8*12+6, n/8*12+12,
if n%8==5:
	print n/8*12+2, n/8*12+3, n/8*12+4, n/8*12+6, n/8*12+9, 
if n%8==6:
	print n/8*12+2, n/8*12+3, n/8*12+4, n/8*12+8, n/8*12+9, n/8*12+10,
if n%8==7:
	print n/8*12+2, n/8*12+3, n/8*12+4, n/8*12+6, n/8*12+8, n/8*12+9, n/8*12+10,
print


Measured memory_bytes: 2812
#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <numeric>
#include <queue>
#include <numeric>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <map>
#include <functional>
#include <limits>
#include <set>
#include <stack>
#include <cctype>
#define rep(i,a,b) for((i)=a;i<(int)(b);i++)

#define AAA (1000000007) 


using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pairII;


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

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
ll powD(ll a, ll b) {
	ll ans = 1;
	a %= AAA;
	for (int i = 0; i < b; i++)
	{
		ans *= a;
		ans %= AAA;
	}
	return ans;
}


int main() {
	int i, j, k;

	int N, M, K;

	int A[100003] = { 0 };

	cin >> N;
	rep(i, 0, N) {
		int a;
		cin >> a;
		if (a != 0) {
			A[a - 1]++;
		}
		A[a]++;
		A[a + 1]++;
	}
	int Max = 0;
	rep(i, 0, 100003) {
		Max = max(Max, A[i]);
	}
	cout << Max;
	return 0;
}

Measured memory_bytes: 640
import java.util.*;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int d = 0;
        for(int i=1; i<=n; i++){
            if(sc.nextInt()!=i){
              d++;
            }
        }
        System.out.println(d<=2 ? "YES" : "NO");
    }
}

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

#define rep(a,b) for(int a = 0;a < b;a++)
#define REP(i, x, n) for(int i = x; i < n; i++)
#define P(a) cout << a << endl
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ssort(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define vP(v) for(int i = 0;i < v.size();i++){cout << v[i];if(i != v.size()-1)cout << endl;}
#define vcin(v,n) rep(i,n){int a;cin >> a;v.pb(a);}

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = { 1, -1 , 0 , 0 };
int dy[] = { 0,  0,  1, -1 };
ll MOD = 1000000007;

void solve(){
	int a,b;
	cin >> a >> b;
	if(a+b >= 10) P("error");
	else P(a+b);
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 256
N = int(input())
r = [list(map(int, input().split())) for _ in range(N)]
a = []
for i in r:
    a.append((i[0]+i[1],i[0]-i[1]))
a.sort()
ans = 0
cur = -float('inf')
for i in a:
    if i[1] < cur:
        continue
    ans += 1
    cur = i[0]
print(ans)

Measured memory_bytes: 41440
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(int i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
typedef long long ll;ll MM = 1000000000;ll mod = MM + 7;

int main() {
    int n; cin >> n;
    vector<int> l(n);
    rep(i, n) cin >> l[i];
    sort(all(l));
    ll ans = 0;
    rep(i, n-1) {
        Rep(j, i+1, n) {
            auto b = lower_bound(all(l), l[i]+l[j]);
            ans += b - (l.begin() + j + 1);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
S = input()


def is_month(num_char):
    if num_char in y:
        return True
    else:
        return False


first = S[0:2]
second = S[2:4]

y = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']


first_flag = is_month(first)
second_flag = is_month(second)


if first_flag and second_flag:
    print('AMBIGUOUS')
elif first_flag and second_flag == False:
    print('MMYY')
elif first_flag == False and second_flag:
    print('YYMM')
elif first_flag == False and second_flag == False:
    print('NA')


Measured memory_bytes: 3064
d=int(input())
a=[]
for x in range(d+1):
  b=list(map(int,input().split()))
  a.append(b)
nittei=[]
for x in range(d):
  nittei.append(int(input()))
  

sum1=sum(a[0][0:26])
ans=[0]*d
humann=a[0]*d
humann=humann+[0]*26



for n in range(d):
  date=nittei[n]
  ans[n]=(a[n+1][date-1])
  try:
    for z in range(26):
      humann[n*26+z]=int(humann[(n-1)*26+z])+int(humann[n*26+z])
  except:
    True
  humann[n*26+date-1]=0
  sum2=sum(humann[n*26+0:n*26+26])
  ans[n]=int(ans[n]) - int(sum2)
  
  
  try:
    ans[n]=ans[n]+ans[n-1]
  except:
    True
    
for y in range(d):
  print(ans[y])




Measured memory_bytes: 9668
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vpii;
#define MOD 1000000007
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define all(v) v.begin(), v.end()
#define FOR(i, n) for (int i = 0; i < n; i++)
#define rep(i, a, b) for (int i = a; i < b; i++)
#define input_arr(a, n) \
  for (int i = 0; i < n; i++) cin >> a[i];
#define print_arr(a, n) \
  for (int i = 0; i < n; i++) cout << a[i] << ;
#define deb(n) cerr << #n << "=" << n << \n;

int main() {
  int kyu;
  cin >> kyu;
  int answer;
  if (kyu >= 400 && kyu <= 599)
    answer = 8;
  else if (kyu >= 600 && kyu <= 799)
    answer = 7;
  else if (kyu >= 800 && kyu <= 999)
    answer = 6;
  else if (kyu >= 1000 && kyu <= 1199)
    answer = 5;
  else if (kyu >= 1200 && kyu <= 1399)
    answer = 4;
  else if (kyu >= 1400 && kyu <= 1599)
    answer = 3;
  else if (kyu >= 1600 && kyu <= 1799)
    answer = 2;
  else if (kyu >= 1800 && kyu <= 1999)
    answer = 1;

  cout << answer << endl;
}

Measured memory_bytes: 3640
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

#define REP(i,n) for(int i = 0; i < n; i++)
#define ll long long
#define PI M_PI
#define bf printf("\n");

int main(void){
    int N, ctr = 0; scanf("%d",&N);
    char s[N]; scanf("%s",s);
    
    REP(i,N-1){
        if(s[i] != s[i+1]) ctr++;
    }
    printf("%d",ctr+1);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define EPS (1e-10)
#define equals(a, b) (fabs((a)-(b)) < EPS)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int L;
  cin >> L;
  int N;
  {
    int k=1;
    N=0;
    while(k<=L) {
      k = k<<1;
      N++;
    }
  }
  v(vp) from(N);
  rep(i,N-1) {
    from[i].emplace_back(i+1,0);
    from[i].emplace_back(i+1,1<<i);
  }
  rep(i,N-1) {
    if((L>>(i))&1) {
      int k=L/(1<<(i));
      k--;
      from[i].emplace_back(N-1,k*(1<<(i)));
    }
  }
  int cnt=0;
  rep(i,N) {
    cnt += sz(from[i]);
  }
  cout << N << " " << cnt << endl;
  rep(i,N) {
    for(auto p:from[i]) {
      cout << i+1 << " " << p.first+1 << " " << p.second << endl;
    }
  }
  return 0;
}


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

int main(void){
    int N;
    cin >> N;
    int T[N];
    for(int i = 0; i < N; i++)
        cin >> T[i];
    int M;
    cin >> M;
    int check[M];
    int up[M];
    int sum = 0;
    int ans[M];
    for(int i = 0; i < M; i++){
        sum = 0;
        cin >> check[i] >> up[i];
        swap(T[check[i]-1], up[i]);
        for(int j = 0; j < N; j++){
            sum += T[j];
        }
        ans[i] = sum;
        swap(T[check[i]-1], up[i]);
    }
    for(int i = 0; i < M; i++)
        cout << ans[i] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
int main(void){
    long N = 0;
    scanf("%lld", &N);
    long max = 0;
    for(int i = 1; i <= sqrt(N); i++){
        long s = i * i;
        if(s <= N){
            if(max < s){
                max = s;
            }
        }
    }
    printf("%ld\n", max);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define fi first
#define se second
#define NAME ""
using namespace std;
typedef long long LL;
typedef double DB;
typedef pair <LL, LL> pLL;
typedef pair <int, int> pii;
const int NMAX = 1e5+3;

int n, pos;
double T, A, res;

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen(NAME".inp", "r", stdin);
    //freopen(NAME".out", "w", stdout);
    cin >> n;
    cin >> T >> A;
    res = double(1e18);
    for(int i = 1; i <= n; ++i) {
        double tmp;
        cin >> tmp;
        tmp = T - tmp * 0.006;
        if(abs(tmp-A) < res) {
            res = abs(tmp-A);
            pos = i;
        }
    }
    cout << pos;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5 + 5;
int a[N];
int main() {
    int n;
    scanf("%d", &n);
    for(int i = 1; i <= n; i++) {
        scanf("%d", &a[i]);
    }
    ll ans = 0;
    unordered_map<int, int> ma;
    for(int i = 1; i <= n; i++) {
        if(ma.count(i - a[i])) {
            ans += ma[i - a[i]];
        }
        ma[i + a[i]]++;
    }
    printf("%lld\n", ans);
    return 0;
}

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

#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define lli long long int
#define ll long int
#define FOR(i,n) for(i=0;i<n;i++)
#define FOR1(i,n) for(i=1;i<n;i++)
#define pb push_back

using namespace std;

int main() {
    
    fast()
    
    int n,i,j,k;
    ll days=1;
    int temp,temp1,temp2,cnt=0;
    bool finish=false;
    cin>>n;
    int arr[n][n-1];
    int head[n]={0};
    ll day[n]={0};
    int check[n]={0};
    //memset(day,-1,sizeof(day));
    //set<int> remain;

    FOR(i,n)FOR(j,n-1)cin>>arr[i][j];
    //FOR(i,n)if(head[i]!=(n-1))remain.insert(i);
    //k=remain.size();
    while(!finish){
        finish=true;
        FOR(i,n-1){
            temp=i;
            if(head[temp]==(n-1)) continue;
            temp1=arr[temp][head[temp]]-1;
            temp2=arr[temp1][head[temp1]]-1;
            if(temp2==temp && temp1>temp && day[temp]!=days && day[temp1]!=days){
                head[temp]++;
                head[temp1]++;
                day[temp]=days;
                day[temp1]=days;
                //cout<<temp+1<<" "<<head[temp]<<" "<<temp1+1<<" "<<head[temp1]<<endl;
                finish=false;
            }
        }
        //remain.clear();
        //FOR(i,n)if(head[i]!=(n-1))remain.pb(i);
        
        //k=remain.size();
        days++;
        //if(remain.size()==0)break;
        
    }
    finish=false;
    FOR(i,n)if(head[i]!=n-1)finish=true;
    if(finish) cout<<-1;
    else
    cout<<days-2;
    
}


Measured memory_bytes: 4224
#include<bits/stdc++.h>
using namespace std;
char c;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    while(cin>>c)
    	if(c=='9')
    	{
    		cout<<"Yes"<<endl;
    		return 0;
		}
	cout<<"No"<<endl;
}

Measured memory_bytes: 256
import sys
n,m,x,y = map(int,input().split())
x_li = list(map(int,input().split()))
y_li = list(map(int,input().split()))
for z in range(x+1,y+1):
    if z>x and z>max(x_li) and z<=y and z<=min(y_li):
        print('No War')
        sys.exit()
else:
    print('War')

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

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef pair<ll,ll> pll;
const ll INF = 2e18;
const int inf = 1e9+10;
const int maxN = 2e5 + 10;
const int maxD = 15;
const int maxH = 100; 
const int MOD = 998244353;


ll a[maxN];
ll power(ll x,ll p)
{
	if(p == 0)
	{
		return 1;
	}
	ll t = power(x,p/2);
	t = t*t % MOD;
	if(p&1)
	{
		t = t*x%MOD;
	}
	return t;
}
ll rev(ll x)
{
	return power(x,MOD-2);
}
ll C(ll n,ll m)
{
	ll ans =  a[n] * rev(a[m]) % MOD * rev(a[n-m])%MOD;
	return ans;
}
int main()
{
	
	int n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	a[0] = 1;
	for(int i=1;i<=n;i++)
	{
		a[i] = (a[i-1] * i)%MOD;
	}
	ll sum = 0;
	for(int i=0;i<=k;i++)
	{
		ll tmp = C(n-1,i) * m %MOD * power(m-1,n-i-1)%MOD;
		sum = (sum + tmp)%MOD;
	}
	cout<<sum<<endl;
	return 0;
}

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

int main() {
    int a, b;
    cin >> a >> b;
    if(a <= 5){
        cout << 0 << endl;
    }else if(a <= 12){
        cout << b / 2 << endl;
    }else{
        cout << b << endl;
    }
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};

template<typename T,bool directed>
struct FordFulkerson{
  struct edge{
    int to;
    T cap;
    int rev;
    edge(){}
    edge(int to,T cap,int rev):to(to),cap(cap),rev(rev){}
  };

  vector< vector<edge> > G;
  vector<int> used;

  FordFulkerson(){}
  FordFulkerson(int n):G(n),used(n){}

  void add_edge(int from,int to,T cap){
    G[from].emplace_back(to,cap,G[to].size());
    G[to].emplace_back(from,directed?0:cap,G[from].size()-1);
  }

  T dfs(int v,int t,T f){
    if(v==t) return f;
    used[v]=true;
    for(int i=0;i<(int)G[v].size();i++){
      edge &e=G[v][i];
      if(!used[e.to]&&e.cap>0){
        T d=dfs(e.to,t,min(f,e.cap));
        if(d==0) continue;
        e.cap-=d;
        G[e.to][e.rev].cap+=d;
        return d;
      }
    }
    return 0;
  }

  T flow(int s,int t,T lim){
    T fl=0;
    while(1){
      fill(used.begin(),used.end(),0);
      T f=dfs(s,t,lim);
      if(f==0) break;
      fl+=f;
      lim-=f;
    }
    return fl;
  }

  T flow(int s,int t){
    return flow(s,t,numeric_limits<T>::max()/2);
  }
};

int H, W;
char a[101][101];
int sx, sy, gx, gy;

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

  cin >> H >> W;
  for ( int i = 0; i < H; i++ ) {
    for ( int j = 0; j < W; j++ ) {
      cin >> a[i][j];
      if ( a[i][j] == 'S' ) {
	sx = j; sy = i;
	// a[i][j] = 'o';
      }
      if ( a[i][j] == 'T' ) {
	gx = j; gy = i;
	// a[i][j] = 'o';
      }
    }
  }

  const int INF = 1e15;  
  FordFulkerson<int, true> ff(2*H*W);
  for ( int i = 0; i < H; i++ ) {
    for ( int j = 0; j < W; j++ ) {
      if ( a[i][j] == 'o' ) ff.add_edge(i*W+j +H*W, i*W+j, 1);
    }
  }
  for ( int i = 0; i < H; i++ ) {
    for ( int j = 0; j < W; j++ ) {
      if ( a[i][j] == '.' ) continue;
      for ( int k = 0; k < 4; k++ ) {
	int nx = j, ny = i;
	while ( 1 ) {
	  nx += dx[k]; ny += dy[k];
	  if( nx < 0 || nx >= W || ny < 0 || ny >= H ) break;
	  if ( a[ny][nx] != '.' ) {
	    ff.add_edge(i*W+j, H*W + ny*W+nx, INF);
	    // cout << i << " " << j << " " << ny << " " << nx << endl;
	  }
	}
      } 
    }
  }

  int ans = ff.flow(sy*W+sx, H*W + gy*W+gx);
  if ( ans >= INF ) cout << -1 << endl;
  else cout << ans << endl;  

  return 0;
}


Measured memory_bytes: 124928
#include<iostream>
using namespace std;
int main() {
    bool cards[4][14];
    int n, rank;
    char suit;
     
    for (int s = 0; s < 4; s++) 
        for (int r = 1; r <= 13; r++) 
            cards[s][r] = 0;
     
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> suit >> rank;
        if(suit == 'S') cards[0][rank] = 1;
        if(suit == 'H') cards[1][rank] = 1;
        if(suit == 'C') cards[2][rank] = 1;
        if(suit == 'D') cards[3][rank] = 1;
    }
     
    for (int s = 0; s < 4; s++) {
        for(int r = 1; r <= 13; r++) {
            if(cards[s][r]) continue;
            if(s == 0) suit = 'S';
            if(s == 1) suit = 'H';
            if(s == 2) suit = 'C';
            if(s == 3) suit = 'D';
            cout << suit << " " << r << endl;
        }
    }
     
    return 0;
}



Measured memory_bytes: 3072
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')

# 素因数分解
def prime_factorization(n):
    fact=[]
    for i in range(2, int(sqrt(n)) + 1):
        while n % i == 0:
            n //= i
            fact.append(i)
    return fact
def main():
    X=I()
    while True:
        if not(prime_factorization(X)):
            print(X)
            return 
        X+=1

if __name__ == '__main__':
    main()

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

#define ll         long long int
#define pb         push_back
#define mk         make_pair
#define vec        vector<int>
#define iter       vector<int>:: iterator
#define f(n)       for(int i=0 ; i<n ; i++)
#define sz         size()
#define sort(v)    sort(v.begin() , v.end())

#define fast       ios_base::sync_with_stdio(false);cin.tie(NULL)

using namespace std;

int main(){

       fast;
       int n , a, b;
       cin>>n>>a>>b;

       cout<<min((n*a),b)<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <utility>
#include <map>
#include <cmath>
#include <string>
#include <stdio.h>
#include <sstream>

using namespace std;

int main(){
    int n;
    long long int h, tmp_max;
    bool ans=true;

    cin >> n;
    cin >> tmp_max;
    for(int i=1;i<n;i++){
        cin >> h;
        if(h < tmp_max-1){
            ans=false;
            break;
        }
        tmp_max = max(tmp_max, h);
        // cout << tmp_max;
    }

    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <cmath>
#include <stack>
#include <map>
#include <iomanip>
using namespace std;

int64_t min(int64_t a,int64_t b) {
    if (a > b)
    {
        return b ;
    }else
    {
        return a ;
    }
}


int main(){
    int n,m,x ;
    cin >> n >> m >> x ;
    vector<int> p(n) ;
    vector<vector<int> > a(n,vector<int>(m,0)) ;
    for (int i = 0; i < n; i++)
    {
        cin >> p.at(i) ;
        for (int j = 0; j < m; j++)
        {
            cin >> a.at(i).at(j) ;
        }
        
    }
    vector<int> M(m,0)  ;
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < m; j++)
        {
            M.at(j) += a.at(i).at(j) ;
        }
        
    }
    for (int i = 0; i < m; i++)
    {
        if (M.at(i) < x)
        {
            cout << -1 << endl ;
            return 0 ;
        }
        
    }
    
    int ans = accumulate(p.begin(),p.end(),0) ;  
    int pat = pow(2,n) ;
    for (int i = 0; i < pat; i++)
    {
        bool stop = 0 ;
        int temp = 0 ;
        vector<int> sum(m,0)  ;
        //各本に対して
        for (int j = 0; j < n; j++)
        {
            
            if (i & (1 << j))
            {
                temp += p.at(j) ;
                for (int k = 0; k < m; k++)
                {
                    sum.at(k) += a.at(j).at(k) ;
                }
                
            }
                        
        }
        for (size_t j = 0; j < m; j++)
        {
            if (sum.at(j) < x)
            {
                stop = 1 ;
                break ;
            }
            
        }
        if (stop == 0)
        {
            ans = min(ans,temp) ;
        }
        
        
    }
    


    cout << ans << endl ;
}

Measured memory_bytes: 4116
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
//#include<boost/multiprecision/cpp_int.hpp>
//#include<boost/multiprecision/cpp_dec_float.hpp>
//namespace mp=boost::multiprecision;
//#define mulint mp::cpp_int
//#define mulfloat mp::cpp_dec_float_100
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
//constexpr int MOD=1000000007;
constexpr int MOD=998244353;
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcountll(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
#define fi first
#define se second
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};
const int MAX_N=2e5+5;
//struct edge{lint to,num;};
//vector<int> bucket[MAX_N/1000];

int main(void){
    lint N,K,S;
    cin >> N >> K >> S;
    if(K==0){
        if(S==1000000000) rep(i,N) cout << S-1 << " ";
        else rep(i,N) cout << 1000000000 << " ";
        cout << endl;
        return 0;
    }
    else{
        rep(i,N){
            if(i<K) cout << S << " ";
            else{
                if(S==1000000000) cout << S-1 << " "; 
                else cout << 1000000000 << " ";
            }
        }
        cout << endl;
    }
}

Measured memory_bytes: 3624
#include<stdio.h>

int selectionsort(int *,int);
void swap(int *, int *);
int main(){
 int n,i,j;
  int A[100];//配列の宣言
  scanf("%d",&n);//数列の長さの入力
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);//配列の要素を入力
  }

    j=selectionsort(A,n);//並び換えを行う関数の呼出
  //交換した回数を変数jに保存
  
  //出力
  for(i=0;i<n;i++){
     if(i==n-1)
      printf("%d\n",A[i]);
      else{
      printf("%d ",A[i]);
      }
  }
  printf("%d\n",j);

  return 0;
}

int selectionsort(int *A,int n){
  int i,j,minj,count=0;
  for(i=0;i<=n-1;i++){
    minj=i;
    for(j=i;j<=n-1;j++){
      if(A[j]<A[minj]){
	minj=j;
      }
    }
   
    if(i!=minj){
     swap(&A[i],&A[minj]);
     count++;
    }
  }
  return count;
}

void swap(int *a,int *b){
  int temp;
  temp=*a;
  *a=*b;
  *b=temp;
 
}




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

void fastInputOutput(){ios_base::sync_with_stdio(false);cin.tie(NULL);}


ll GCD(ll a, ll b){ll gcd, g;g = __gcd(a, b);return g;}
ll LCM(ll a, ll b){ll gcd, g;g = __gcd(a, b);return (a/g)*b;}
ll POW(ll base, ll power){ll ans = 1;for(int i = 1; i <= power; i++){ans *= base;}return ans;}

const ll INF_LONG = 1LL<<61;
const unsigned int inf_int = 1<<31;
const ll mod = 1e9+7;
double phi = acos(-1);

int main()
{
    fastInputOutput();
    int n;
    cin >> n;
    int ar[n+5] = {};
    int mark[n+5] = {};
    for(int i = 1; i <= n-1; i++)
    {
        cin >> ar[i];
        mark[ar[i]]++;
    }
    for(int i = 1; i <= n; i++)
    {
        cout << mark[i] << endl;
    }
    return 0;
}


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

using namespace std;
using ll = long long;

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);

	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	for (auto &el : a) {
		cin >> el;
	}

	for (int i = k; i < n; i++) {
		cout << (a[i] > a[i - k] ? "Yes\n" : "No\n");
	}
}

Measured memory_bytes: 3988
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    A, B = map(int, input().split())

    if (A + B) % 2 == 0:
        ans = (A + B) // 2
    else:
        ans = 'IMPOSSIBLE'

    print(ans)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;

namespace mp = boost::multiprecision;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

const int MAX_N = 100005;
int N;
int A[MAX_N];
int B[MAX_N];

signed main()
{
  int sumA = 0, sumB = 0;
  cin >> N;
  REP(n,N) {
    cin >> A[n];
    sumA += A[n];
  }
  REP(n,N) {
    cin >> B[n];
    sumB += B[n];
  }

  int ans = 0;
  int sumC = 0;
  REP(n,N) {
    if(A[n] < B[n]) {
      ans++;
      A[n] = B[n];
    }
  }

  REP(n,N) {
    sumC += A[n];
  }

  vector<int> vec;

  REP(n,N) {
    vec.push_back(A[n] - B[n]);
  }

  sort(begin(vec), end(vec), greater<int>());

  for(int v : vec) {
    if(sumC <= sumA || v <= 0) {
      break;
    }
    ans++;
    sumC -= v;
  }

  // cerr << sumC << " " << sumA << endl;

  if(sumC <= sumA) {
    cout << ans << endl;
  } else {
    cout << -1 << endl;
  }

  return 0;
}

Measured memory_bytes: 2936
#include <iostream>
#include <iomanip>
#include <random>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <sstream>
#include <bitset>
#include <cassert>
#include <fstream>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <limits>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << '\n';
#define SAY(X) cout << (X) << '\n';
#else
#define DBG(X)
#define SAY(X)
#endif

#define M_PI       3.14159265358979323846

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

int solve()
{
    int N, K;
    std::cin >> N >> K;

    int RLCounter = 0;
    char prev = 'L';

    vector<char> s(N);
    for (int i = 0; i < N; ++i)
    {
        std::cin >> s[i];
        if (prev == 'R' && s[i] == 'L')
            ++RLCounter;

        prev = s[i];
    }

    if (N == 1) return 0;

    int bordersRLCounter = static_cast<int>(s[0] == 'L') + static_cast<int>(s.back() == 'R');
    int ans = 0;

    if (K <= RLCounter)
        ans =  N - (RLCounter - K) * 2 - bordersRLCounter;
    else
        ans = N - 1;

    return ans;
}

int main()
{
    std::cout << solve() << std::endl;

    return 0;
}


Measured memory_bytes: 384
from collections import defaultdict
import sys
import math
from datetime import datetime
import re
import math
def sol(S):
    sz = len(S)
    if sz == 0: return 0

    if sz % 2 == 0:
        l = (sz // 2) - 1
        r = (sz // 2)
    else:
        l = r = (sz //2)
    c = 0
    while l >= 0:
        if S[l] != S[r]:
            c += 1
        l -= 1
        r += 1
    return c




do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    # n = int(parsed_lines[0][0])
    # k = int(parsed_lines[0][1])
    S = parsed_lines[0][0]
    return S


if not do_submit:
    S = input_parse("""
    1905
    """)
    print(sol(S))

    S = input_parse("""
    0112
    """)
    print(sol(S))

    S = input_parse("""
    1700
    """)
    print(sol(S))

    S = input_parse("""
    0000
    """)
    print(sol(S))

    S = input_parse("""
    1001
    """)
    print(sol(S))



else:
    #A, B = list(map(int, input().split()))
    S = input()
    print(sol(S))

    # S = input().strip()
    # print(sol(S))


Measured memory_bytes: 3944