akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 9999999999
#define m0(x) memset(x,0,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define p(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
//#define int long long


using namespace std;


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




ll gcd(ll x, ll y) {
	ll m = max(x, y), n = min(x, y);
	if (m%n == 0)return n;
	else return gcd(m%n, n);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}

ll myPow(ll x, ll n, ll m) {
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return myPow(x * x % m, n / 2, m);
	else
		return x * myPow(x, n - 1, m) % m;
}

ll pow2(ll a, ll n) {//aのn乗を計算します。
	ll x = 1;
	while (n > 0) {//全てのbitが捨てられるまで。
		if (n & 1) {//1番右のbitが1のとき。
			x = x * a;
		}
		a = a * a;
		n >>= 1;//bit全体を右に1つシフトして一番右を捨てる。
	}
	return x;
}

long long nCr(int n, int r) {
	if (r > n / 2) r = n - r; // because C(n, r) == C(n, n - r)
	long long ans = 1;
	int i;

	for (i = 1; i <= r; i++) {
		ans *= n - r + i;
		ans /= i;
	}

	return ans;
}


const int MOD = 1000000007;

bool arr[1050000];
int sosuu[100010];
void Eratosthenes() {
	ll N = 1050000;
	int c = 0;
	for (int i = 0; i < N; i++) {
		arr[i] = 1;
	}
	for (int i = 2; i < sqrt(N); i++) {
		if (arr[i]) {
			for (int j = 0; i * (j + 2) < N; j++) {
				arr[i *(j + 2)] = 0;
			}
		}
	}

	for (int i = 2; i < N; i++) {
		if (arr[i]) {
			sosuu[c] = i;
			//cout << sosuu[c] << " ";
			c++;
		}
	}
	//cout << endl;
	//cout << c << endl;
}

bool A[100010];
int B[100010];
vector<int>graph[100010];
int main() {
	m0(A);m0(B);
	int N,M;
	cin>>N>>M;
	bool exist=0;
	REP(i,M){
		int a,b;
		cin>>a>>b;
		a--;b--;
		A[a]=true;
		graph[a].pb(b);
	}
	REP(i,N){
		if(A[i]){
			VSORT(graph[i]);
			B[graph[i][0]]++;
		}
	}
	ll ans=0;
	ll cnt=0;
	REP(i,N){
		if(exist){
			if(B[i]>0){
				for(int j=cnt;j<i;j++)if(A[j])B[graph[j][0]]--;
				ans++;
				exist=false;
				cnt=i;
			}
		}
		if(A[i])exist=true;
	}
	p(ans);
}


Measured memory_bytes: 7424
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
//    String s=sc.next();
//    int x=sc.nextInt();
//    int a=sc.nextInt();
//    int b=sc.nextInt();
    int[] a={sc.nextInt(),sc.nextInt(),sc.nextInt()};
    Arrays.sort(a);
    System.out.println(a[2]-a[0]);
  }
}

Measured memory_bytes: 23764
using System;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int A = int.Parse(input[0]);
            int B = int.Parse(input[1]);
            int C = int.Parse(input[2]);
            int result = 0;
           
            if (A >= B && A >= C)
            {
                if (B >= C)
                {
                    result = (10*A + B) + C;
                }
                else
                {
                    result = (10 * A + C) + B;
                }
            }

            if (B >= A && B >= C)
            {
                if (A >= C)
                {
                    result = (10*B + A) + C;
                }
                else
                {
                    result = (10 * B + C) + A;
                }
            }

            if (C >= A && C >= B)
            {
                if (A >= B)
                {
                    result = (10*C + A) + B;
                }
                else
                {
                    result = (10*C + B) + A;
                } 
            }

            Console.WriteLine(result);
        }
    }
}

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

ll A[100000];
ll dp[65][2];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	ll N, K;
	cin >> N >> K;

	for(int i = 0; i < N; i++){
		cin >> A[i];
	}

	for(int i = 0; i < 62; i++){
		int b = K >> i & 1;
		for(int j = 0; j < 2; j++){
			for(int k = 0; k < 2; k++){
				ll sum = 0;
				for(int l = 0; l < N; l++){
					if(k == 0){
						sum += (A[l] & (1LL << i));
					}
					else{
						sum += (A[l] & (1LL << i)) ^ (1LL << i);
					}
				}
				if(j == 0 && b >= k || j == 1 && b > k){
					dp[i + 1][0] = max(dp[i + 1][0], dp[i][j] + sum);
				}
				else{
					dp[i + 1][1] = max(dp[i + 1][1], dp[i][j] + sum);
				}
			}
		}
	}
	cout << dp[62][0] << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define ss second
#define ff first

 using namespace std;
 
 const ll MOD = 1000000007LL;
 
ll ar[500056],br[500056];


vector<ll> pec;
set<ll> st;
map<ll,ll> has,mark;


vector<pair<ll,ll> > vp;
ll maxi;



int main() 
{
	
//freopen("input.in","r",stdin);
//freopen("output.out","w",stdout);
    
    ll n,p,t,j,a,x,y=0,k,l,m,z,b,c,e,f,q,s,flag=0,sum=0,res=0,num,g,h;
	ll i,u,v,w,ans,maxm=-1,r,minm=999999999999;
	bool fl=0;
	ll d;
	string str;
	
	c=0;
	
	cin>>n;
	
	for(i=1;i<=n;i++)
	cin>>ar[i];
	
	while(1)
	{
		flag=0;
		for(i=1;i<=n;i++)
		{
			if(ar[i]%2==0)
			{
				ar[i]/=2;
			}
			else
			{
				flag=1;
				break;
			}
		}
		
		if(flag==0)
		c++;
		else
		break;
	}
	
	cout<<c;
	
	
	
    return 0;
}    




Measured memory_bytes: 2304
int main(void){
  int n,a[100000],b[100000]={};
  
  scanf("%d",&n);
  
  for(int i = 0; i < n; i++){
    scanf("%d",&a[i]);
    b[a[i]-1] = i+1;
  }
   
  for(int i = 0; i < n; i++)
    printf("%d ",b[i]);
  
  return 0;
}
   
   
  
  

Measured memory_bytes: 1536
//#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
//<DEFINE>
void Fast() {
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
}
void File() {
#ifndef ONLINE_JUDGE
	freopen("Input.txt", "r", stdin);
	freopen("Output.txt", "w", stdout);
#endif
}
#define ll long long
#define ull unsigned long long
#define mod 1000000007
ll gcd(ll a, ll b) {
	return!b ? a : gcd(b, a % b);
}
#define fix(n) cout << fixed << setprecision(n);
#define numOfOnes(n) __builtin_popcount(n)
#define all(a) a.begin(), a.end()
#define skip continue
#define stop(n) return cout<<n,0
#define pi  acos(-1)
#define endl "\n"
#define ceil(x,y) (x+y-1)/y
//</DEFINE>

//<FUNCTIONS>
//</FUNCTIONS>		
int main() {
	Fast()/*, File()*/;
	int x, y, a, b, c;
	cin >> x >> y >> a >> b >> c;
	vector<int>va(a), vb(b), vc(c);
	for (int i = 0; i < a; i++)cin >> va[i];
	for (int i = 0; i < b; i++)cin >> vb[i];
	for (int i = 0; i < c; i++)cin >> vc[i];
	sort(all(va)), sort(all(vb)), sort(all(vc));
	reverse(all(va)), reverse(all(vb)), reverse(all(vc));
	int ita = x - 1, itb = y - 1, itc = 0;
	ll res = 0;
	while ((x || y) && itc < c && ((itb >= 0 && vc[itc] > vb[itb]) || (ita >= 0 && vc[itc] > va[ita]))) {
		res += vc[itc], itc++;
		if (x && (itb < 0 || (ita >= 0 && va[ita] < vb[itb]))) {
			ita--, x--;
		}
		else if (y) {
			y--, itb--;
		}
		else break;
	}
	for (int i = ita; i >= 0; i--)res += va[i];
	for (int i = itb; i >= 0; i--)res += vb[i];
	cout << res << endl;
}


Measured memory_bytes: 1408
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

class mint:
    def __init__(self, x):
        self.__x = x % md

    def __str__(self):
        return str(self.__x)

    def __add__(self, other):
        if isinstance(other, mint): other = other.__x
        return mint(self.__x + other)

    def __sub__(self, other):
        if isinstance(other, mint): other = other.__x
        return mint(self.__x - other)

    def __rsub__(self, other):
        return mint(other - self.__x)

    def __mul__(self, other):
        if isinstance(other, mint): other = other.__x
        return mint(self.__x * other)

    __radd__ = __add__
    __rmul__ = __mul__

    def __truediv__(self, other):
        if isinstance(other, mint): other = other.__x
        return mint(self.__x * pow(other, md - 2, md))

    def __rtruediv__(self, other):
        return mint(other * pow(self.__x, md - 2, md))

    def __pow__(self, power, modulo=None):
        return mint(pow(self.__x, power, md))

md = 10**9+7
def nCr(com_n, com_r):
    if com_n < com_r: return 0
    return fac[com_n] * ifac[com_r] * ifac[com_n - com_r]

def nHr(hn,hr):return nCr(hn+hr-1,hr)

n_max = 200005
fac = [mint(1)]
for i in range(1, n_max + 1): fac.append(fac[-1] * i)
ifac = [mint(1)] * (n_max + 1)
ifac[n_max] /= fac[n_max]
for i in range(n_max - 1, 1, -1): ifac[i] = ifac[i + 1] * (i + 1)

def main():
    n,k=MI()
    ans=mint(0)
    for v in range(min(k+1,n)):
        ans+=nCr(n,v)*nHr(n-v,v)
    print(ans)

main()

Measured memory_bytes: 87288
# coding: utf-8

"""
20191116
"""

N = int(input())
h = list(map(int, input().split()))

cost = [0, abs(h[1]-h[0])] + [None for _ in range(N-2)]

for i in range(2, N):
    cost[i] = min(cost[i-1] + abs(h[i]-h[i-1]), cost[i-2] + abs(h[i]-h[i-2]))

print(cost[N-1])


Measured memory_bytes: 13928
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <list>
#include <utility>
#include <tuple>
#include <cstdio>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <cmath>
#define _GLIBCXX_DEBUG
using namespace std;
const long long INF = 1LL << 60;
int main() {
    int A,B;
    cin >> A >> B;
    int ans;
    if( B==1){
        ans =0;
    }
    else{
        for(int i=1;i>0;i++){
            if((A-1)*(i-1)+A >= B){
                ans = i;
                break;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll t1,t2,t3;
const ll mod = 1000000007;
const int INF = 1e9;
const ll INFLONG = 1e18;



int main(){
  ll n,a,b,c;
  ll A,B,C;
  cin >> n >> A >> B >> C;
  a = A,b = B,c = C;
  vector<ll> vec(n);
  string s;
  bool can = true;
  vector<char> ans(n);
  vector<pair<string,ll>> str(n);
  rep(i,n){
    cin >> str[i].first;
  }
  s = "";
  ll cou = 0;
  rep_rev(i,n){
    if(s != str[i].first){
      cou=1;
    }else{
      cou++;
    }
    s = str[i].first;
    str[i].second = cou;
  }

  rep(i,n){
    s = str[i].first;
    if(s == "AB"){
      if(a == 0 && b == 0){
        can = false;
        break;
      }
      if(a == 0){
        a++;b--;
        ans[i] = 'A';
      }else if(b == 0){
        b++;a--;
        ans[i] = 'B';
      }else{
        t1 = i + str[i].second;
        if(t1 < n && str[t1].first == "BC"){
          a--;
          b++;
          ans[i] = 'B';
        }else{
          b--;
          a++;
          ans[i] = 'A';
        }
      }
    }else if(s == "BC"){
      if(b == 0 && c == 0){
        can = false;
        break;
      }
      if(b == 0){
        b++;c--;
        ans[i] = 'B';
      }else if(c == 0){
        c++;b--;
        ans[i] = 'C';
      }else{
        t1 = i + str[i].second;
        if(t1 < n && str[t1].first == "AC"){
          b--;
          c++;
          ans[i] = 'C';
        }else{
          c--;
          b++;
          ans[i] = 'B';
        }
      }
    }else{
      if(c == 0 && a == 0){
        can = false;
        break;
      }
      if(a == 0){
        a++;c--;
        ans[i] = 'A';
      }else if(c == 0){
        c++;a--;
        ans[i] = 'C';
      }else{
        t1 = i + str[i].second;
        if(t1 < n && str[t1].first == "AB"){
          c--;
          a++;
          ans[i] = 'A';
        }else{
          a--;
          c++;
          ans[i] = 'C';
        }
      }
    }
  }
  if(can){
    cout << "Yes" << endl;
    rep(i,n){
      cout << ans[i] << endl;
    }
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 8012
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a,x) for (auto& a : x)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
    int N, M; cin >> N >> M;

    ll K; cin >> K;
    ll A[N], B[M]; F0R(i, N) cin >> A[i];
    F0R(i, M) cin >> B[i];

    ll as = 0; F0R(i, N) as += A[i];
    ll bs = 0;
    int bp = 0;
    int ans = 0;
    F0Rd(i, N+1) {
        if (i < N) as -= A[i];
        if (as <= K) {
            while (bp < M && as + bs + B[bp] <= K) {
                 bs += B[bp]; bp++;
            }
            ckmax(ans, i + bp);
        }
//        cout << as << " " << bs << " " << bp << nl;
    }
    cout << ans << nl;
	
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343



Measured memory_bytes: 6780
while True:
    n, x = map(int, input().split())
    if n == 0:
        break
    ans = 0
    for i in range(1, n-1):
        for j in range(i+1, n):
            for k in range(j+1, n+1):
                if i + j + k == x:
                        ans += 1
    print(ans)


Measured memory_bytes: 5596
S = input()
N = len(S)
l = 0
r = N-1
ans = 0
while l < r:
    if S[l] == S[r]:
        l += 1
        r -= 1
    elif S[l] == 'x':
        l += 1
        ans += 1
    elif S[r] == 'x':
        r -= 1
        ans += 1
    else:
        print(-1)
        exit()
print(ans)



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

int main(){
    int h1,m1,h2,m2,k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    int ans;
    ans=(h2-h1)*60+(m2-m1)-k;

    cout << ans << endl;
    

    return 0;
}

Measured memory_bytes: 3636
#pragma once
#include <stdio.h>
#include <sstream>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <limits>
#include <iomanip>
#include <ctype.h>
#define _USE_MATH_DEFINES
#include <iostream>
#include <math.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define bit(x,v) ((ll)x << v)

const ll INF = 1000000007;
const int MAX = 210000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int pr[100010];
void uini(int n) {
	for (size_t i = 0; i <= n; i++)
	{
		pr[i] = i;
	}
}

int parent(int x) {
	if (x == pr[x]) return x;
	return pr[x] = parent(pr[x]);
}

bool unit(int x, int y) {
	int px = parent(x);
	int py = parent(y);

	if (px == py) return false;
	if (px < py) {
		pr[py] = px;
	}
	else {
		pr[px] = py;
	}
	return true;
}

ll bit[200010];
int max_n = 200000;
int pm = 0;
void add(int x) {

	while (max_n >= x)
	{
		bit[x]++;
		x += x & -x;
	}
}
void sub(int x) {
	while (max_n >= x)
	{
		bit[x]--;
		x += x & -x;
	}
}
int search(int x) {

	int k = 0;
	int p = 1;
	while (p * 2 <= max_n)
	{
		p *= 2;
	}
	for (int i = p; i > 0; i /= 2)
	{
		if (i + k < max_n && bit[i + k] < x) {
			x -= bit[i + k];
			k += i;
		}
	}
	return k + 1;
}
void solv() {

	double a, b, c;
	cin >> a >> b >> c ;
	double rad = (M_PI * c) / 180.0;
	double s = (a * b * sin(rad)) / 2;
	double d = sqrt(a * a + b * b - 2 * a * b * cos(rad));
	double l = a + b + d;
	double h = b * sin(rad);
	cout << fixed << setprecision(10);
	cout << s << endl;
	cout << l << endl;
	cout << h << endl;
}
int main() {
	//	COMinit();
	solv();
	return 0;
}



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

int main(void) {
    int N;
    cin >> N;
    int max_num = 0;
    int target = 1;
    for (int i = 0; i < N; i++) {
        int base = i + 1;
        int num  = base;
        for (int j = 0; j < 10; j++) {
            if (j > max_num) {
                max_num = j;
                target = base;
            }
            if (num%2) break;
            num /= 2;
        }
    }
    cout << target << endl;

}

Measured memory_bytes: 256
#include <iostream>
#include <bitset>
#include <vector>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;

int main(){
    int n,m; cin >> n >> m;
    vector<int> ac(n), pena(n);
    rep(i, m){
        int p;
        string s;
        cin >> p >> s;
        --p;
        if(ac[p]) continue;
        if(s == "AC"){
            ac[p] = 1;
        }else{
            pena[p]++;
        }
    }

    int AC = 0, PENA = 0;
    rep(i,n){
        AC += ac[i];
        if(ac[i]) PENA += pena[i];
    }
    cout << AC << ' ' << PENA;

}

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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

constexpr ll MOD = 1'000'000'007;
int N;
std::string S;
ll dp[2][3100];

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

    std::cin >> N >> S;

    if(S[0] == '<'){
        dp[0][0] = dp[0][1] = 1;
    }else{
        dp[0][0] = 1;
    }

    int prv = 0, nxt = 1;

    for(int i=1;i<N-1;++i){
        int n = i + 1;

        for(int lt=0;lt<=n;++lt){
            if(S[i] == '<'){
                dp[nxt][lt] = (dp[prv][0] + MOD - dp[prv][lt]) % MOD;
            }else{
                dp[nxt][lt] = (dp[prv][lt] + MOD - dp[prv][n]) % MOD;
            }
        }

        for(int lt=n-1;lt>=0;--lt){
            dp[nxt][lt] = (dp[nxt][lt] + dp[nxt][lt + 1]) % MOD;
        }

        std::swap(prv, nxt);
    }

    ll cnt = dp[prv][0];
    std::cout << cnt << std::endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#define N 100000
#define M 50000
main()
{
  int s[N],t[M],i,q,n,l=0,j,left,right,mid;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    
    scanf("%d",&s[i]);
    
  }
 
  scanf("%d",&q);
  
  for(i=0;i<q;i++){
    
    scanf("%d",&t[i]);
    
  }
  
  for(j=0;j<q;j++){
    left=0;
    right=n;
    while(left<right){
      mid=(left+right)/2;
      if(t[j]==s[mid]){
	l++;
	break;
      }
      if (t[j]>s[mid]){
	
	left=mid +1;
      }
      else if(t[j]<s[mid]){
	
	right=mid;
      }
    }
    
  }
  
  printf("%d\n",l);
  return 0;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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

#define ld long double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

ll dp[101][101][2];

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s; cin>>s;
    int sz = s.size();
    int k; cin>>k;
    dp[0][0][0] = 1;
    rep(i,sz)rep(j,sz+1){
        if (s[i]=='0'){
            dp[i+1][j][0] += dp[i][j][0];
            dp[i+1][j][1] += dp[i][j][1];
            dp[i+1][j+1][1] += 9*dp[i][j][1];
        }else{
            int c = s[i]-'0';
            dp[i+1][j+1][0] += dp[i][j][0];
            dp[i+1][j][1] += dp[i][j][0];
            dp[i+1][j+1][1] += (c-1)*dp[i][j][0];
            dp[i+1][j][1] += dp[i][j][1];
            dp[i+1][j+1][1] += 9*dp[i][j][1];
        }
    }

    cout<<dp[sz][k][0]+dp[sz][k][1]<<endl;
    return 0;
}


Measured memory_bytes: 384
from datetime import datetime

def measure(f):
    measure_start = datetime.now()
    v = f()
    print(datetime.now() - measure_start)
    return v

input = raw_input
range = xrange
    
def init():
    table = [True] * 1000001
    table[0] = False
    table[1] = False
    n = len(table)

    def prime(p):
        for i in range(p + p, n, p):
            table[i] = False
    prime(2)
    prime(3)
    prime(5)
    prime(7)
    prime(11)
    prime(13)
    
    for i in range(2, n):
        if (i % 2 != 0 and i % 3 != 0 and i % 5 != 0 and
            i % 7 != 0 and i % 11 != 0 and i % 13 != 0):
            for j in range(i + i, n, i):
                table[j] = False
    return table
    
def solve(price, ps, is_prime):
    dp = [0] * ((price >> 5) + 1)

    for i in range(0, price + 1,ps[0]):
        dp[i >> 5] |= 1 << (i & 31)
    dp[0] = 1
    
    for i in range(1, len(ps)):
        cur_p = ps[i]
        r = cur_p & 31
        rest = 0
        if cur_p >= 32:
            for p in range(cur_p, price + 1, 32):
                i1 = (p - cur_p) >> 5
                i2 = p >> 5
                v = dp[i1]
                dp[i2] |= (v << r) | rest
                rest = (v >> (32 - r)) & ((1 << r) - 1)
        else:
            for p in range(cur_p, price + 1):
                dp[p >> 5] |= (dp[(p - cur_p) >> 5] >> ((p - cur_p) & 31) & 1) << (p & 31)
            
    p = -1
    for i in range(0, price + 1):
        if is_prime[i] and (dp[i >> 5] >> (i & 31)) & 1 == 1:
            p = i
    if p == -1:
        print("NA")
    else:
        print(p)
    
def main():
    table = init()
    while True:
        n, price = map(int,input().split())
        if n == 0 and price == 0:
            return
        ps = []
        for i in range(n):
            ps.append(int(input()))
        solve(price, ps, table)

main()

Measured memory_bytes: 47196
#include <stdio.h>
   
   int main(void) {
   	int a,b,x;
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&x);
	if(a+b<x){
		printf("NO");	
	}else if(a>x){
		printf("NO");
	}else{
		printf("YES");
	}
	
	
	return 0;
   }

Measured memory_bytes: 128
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 5;
const int mod = 998244353;

inline ll pw(ll a,int b)
{
	ll res=1;
	while(b)
	{
		if(b&1) res=res*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return res;
}

ll fac[MAXN],inv[MAXN];
inline ll c(int n,int m)
{
	if(n<0||m<0||n<m) return 0;
	return fac[n] * inv[m] %mod * inv[n-m] %mod;
}

int main(void)
{
	fac[0]=1;
	for(int i=1; i<MAXN; ++i) fac[i] = fac[i-1]*i %mod;
	inv[MAXN-1] = pw(fac[MAXN-1], mod-2);
	for(int i=MAXN-2; i>=0; --i) inv[i] = inv[i+1]*(i+1) %mod;
	
	int n,m,d;
	scanf("%d%d%d",&n,&m,&d);
	
	ll ans=0;
	for(int i=0; i<=d; ++i)
	{
		ll now = c(n-1,i) * pw(m-1,n-i-1) %mod * m %mod;
		ans = (ans + now) %mod;
	}
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 4860
import java.util.*;
import java.io.*;
import static java.lang.System.*;

class FastScanner {
  private final InputStream in = System.in;
  private final byte[] buffer = new byte[1024];
  private int ptr = 0;
  private int buflen = 0;
  private boolean hasNextByte() {
      if (ptr < buflen) {
          return true;
      }else{
          ptr = 0;
          try {
              buflen = in.read(buffer);
          } catch (IOException e) {
              e.printStackTrace();
          }
          if (buflen <= 0) {
              return false;
          }
      }
      return true;
  }
  private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
  private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
  public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
  public String next() {
      if (!hasNext()) throw new NoSuchElementException();
      StringBuilder sb = new StringBuilder();
      int b = readByte();
      while(isPrintableChar(b)) {
          sb.appendCodePoint(b);
          b = readByte();
      }
      return sb.toString();
  }
  public long nextLong() {
      if (!hasNext()) throw new NoSuchElementException();
      long n = 0;
      boolean minus = false;
      int b = readByte();
      if (b == '-') {
          minus = true;
          b = readByte();
      }
      if (b < '0' || '9' < b) {
          throw new NumberFormatException();
      }
      while(true){
          if ('0' <= b && b <= '9') {
              n *= 10;
              n += b - '0';
          }else if(b == -1 || !isPrintableChar(b)){
              return minus ? -n : n;
          }else{
              throw new NumberFormatException();
          }
          b = readByte();
      }
  }
  public int nextInt() {
      long nl = nextLong();
      if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
      return (int) nl;
  }
  public double nextDouble() { return Double.parseDouble(next());}
}

class Main {
  public static final int MOD = 1000000007;
  public static final int INF = 1000000000;
  public static void main(String[] args) {
    FastScanner sc = new FastScanner();
    int N = sc.nextInt();
    int D = sc.nextInt();
    int X[][] = new int[N][D];
    for(int i=0; i<N; i++){
      for(int j=0; j<D; j++){
        X[i][j] = sc.nextInt();
      }
    }
    int ans = 0;
    for(int i=0; i<N; i++){
      for(int j=i+1; j<N; j++){
        double tmp = 0;
        for(int k=0; k<D; k++){
          tmp += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k]);
        }
        if(tmp / (int)Math.sqrt(tmp) == Math.sqrt(tmp) ) ans++;
      }
    }
        
    out.println(ans);
  }

  public static int gcd(int a, int b){
    if(b == 0) return a;
    return gcd(b, a%b);
  }
}

Measured memory_bytes: 22996
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int N,C;
const int MAX = 100010;
int cs[30][MAX];
int ss[MAX];

int main() {
  IOS;
  cin >> N >> C;
  REP(i,N) {
    int s,t,c;
    cin >> s >> t >> c;
    c--; s--;
    cs[c][s]++;
    cs[c][t]--;
  }

  REP(i,C) REP(j,MAX-1) cs[i][j+1] += cs[i][j];
  REP(i,C) REP(j,MAX) {
    if (cs[i][j]) ss[j]++;
  }

  int ans = 0;
  REP(i,MAX) { chmax(ans, ss[i]); }
  COUT(ans);

  return 0;
}


Measured memory_bytes: 15700
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define LINF 1000000000000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

typedef pair<int, int> P;
typedef pair<long long, long long> LLP;

int main() {

    int N, K;
    cin >> N >> K;

    long long ans = 1;
    rep(i,N) {
        if (ans < K) ans *= 2;
        else ans += K;
    }

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
using namespace std;

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;
 
const int INF=1e+9;
const double EPS=1e-9;
const int MOD=1000000007;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

signed main(){
	int n,ans = 0;
	map<int,bool> mp;
	cin >> n;
	for(int i = 0;i < n;i++){
		int a;
		cin >> a;
		if(!mp[a]) mp[a] = true;
		else mp[a] = false;
	}
	for(auto it = mp.begin();it != mp.end();it++){
		if(it->second) ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 6528
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
import java.lang.Math;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.ArrayDeque;

public class Main {
	public static void main(String[] args) {
		FS reader = new FS();
		// write reader
		int N = reader.nextInt();
		boolean isAllEven = true;
		for (int i=0; i<N; i++) {
		    if (reader.nextInt()%2 == 1) isAllEven = false;
		}
		if (isAllEven) System.out.println("second");
		else System.out.println("first");
	}
	
	public static void solver() {
		// write logic
	}
	
	// Read Class
	static class FS {
		private final InputStream in = System.in;
		private final byte[] buffer = new byte[1024];
		private int ptr = 0;
		private int buflen = 0;
		private boolean hasNextByte() {
			if (ptr < buflen) {
				return true;
			} else {
				ptr = 0;
				try {
					buflen = in.read(buffer);
				} catch (IOException e) {
					e.printStackTrace();
				}
				if (buflen <= 0) {
					return false;
				}
			}
			return true;
		}
	
		private int readByte() { return hasNextByte() ? buffer[ptr++] : -1;}
		private boolean isPrintableChar(int c) {return 33 <= c && c <= 126;}
		private void skipUnprintable() {while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
	
		public boolean hasNext() { skipUnprintable(); return hasNextByte();}
		public String next() {
			if (!hasNext()) throw new NoSuchElementException();
			StringBuilder sb = new StringBuilder();
			int b = readByte();
			while(isPrintableChar(b)) {
				sb.appendCodePoint(b);
				b = readByte();
			}
			return sb.toString();
		}
		public int nextInt() {
			return (int)nextLong();
		}
		public long nextLong() {
			if (!hasNext()) throw new NoSuchElementException();
			long n = 0;
			boolean minus = false;
			int b = readByte();
			if (b == '-') {
				minus = true;
				b = readByte();
			}
			if (b < '0' || '9' < b) {
				throw new NumberFormatException();
			}
			while(true) {
				if ('0' <= b && b <= '9') {
					n *= 10;
					n += b - '0';
				} else if(b == -1 || !isPrintableChar(b)) {
					return minus ? -n : n;
				} else {
					throw new NumberFormatException();
				}
				b = readByte();
			}
		}
	}
}


Measured memory_bytes: 22868
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite) for(auto ite=begin(que) ; ite!=end(que) ; ite++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1e17;
const int inf = 1e5;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return a ? gcd(b%a, a) : b; }
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
ll mo = 998244353;
struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }
};
struct SegmentTree{
  int N;
  vector<int> node;
  public :
    void intit(vector<int>v){
      int sz = v.size();
      N=1;
      while(N<sz) N*=2;
      node.resize(N);
      for(int i=0 ; i<sz ; i++) node[i+N-1] = v[i];
      for(int i=N-2 ; i>=0 ; i--) node[i] = min(node[i*2+1], node[i*2+2]);
    }
    void update(int x, int val){
      x += N-1;
      node[x+N-1] = val;
      while(x>0){
        x = (x-1)/2;
        node[x] = min(node[x*2+1], node[x*2+2]);
      }
    }
    int getmin(int a, int b, int k, int l, int r){
      if(b<=l || r<=a) return inf;
      else if(a<=l && r<=b) return node[k];
      else{
        int vl = getmin(a, b, 2*k+1, l, (l+r)/2);
        int vr = getmin(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
      }
    }
};
int main(){
  int h1,m1,h2,m2,k;
  cin>>h1>>m1>>h2>>m2>>k;
  int sum=h2*60+m2;
  sum -= (h1*60+m1);
  if(k<=sum){
    cout<<sum-k<<endl;
  }else{
    cout<<0<<endl;
  }
  return 0;
}


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

using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ull a, b, n;
    cin >> n >> a >> b;
    if(a == 0){
        cout << 0;
    }else{
        ull res = a*(n/(a+b));
        res += min((n % (a+b)), a);
        cout << res << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << (x) << endl
using namespace std;
const int N = 100005, Q = 100005;
int n, q, a[Q], b[Q], c[Q], fa[N];
long long m;
bool vis[N], flag = true;
int findroot (int u) {
	return fa[u] == u ? u : fa[u] = findroot(fa[u]);
}
int main () {
	scanf("%d%lld%d", &n, &m, &q);
	for (int i = 1; i <= n; i++) vis[i] = false;
	for (int i = 1; i <= q; i++) scanf("%d%d%d", &a[i], &b[i], &c[i]), a[i]++, b[i]++;
	for (int i = 1; i <= n; i++) fa[i] = i;
	for (int i = 1; i <= q; i++) {
		if (!c[i]) {
			vis[a[i]] = vis[b[i]] = true;
			fa[findroot(a[i])] = findroot(b[i]);
		}
	}
	if (m == n - 1) {
		for (int i = 1; i <= q; i++) {
			if (c[i]) flag = false;
		}
		printf(flag ? "Yes\n" : "No\n");
	}
	else {
		int comp = 0;
		for (int i = 1; i <= n; i++) {
			if (fa[i] == i) comp++;
		}
		if (n - comp + 1ll * comp * (comp - 1) / 2 < m) flag = false;
		for (int i = 1; i <= q; i++) {
			if (c[i] && findroot(a[i]) == findroot(b[i])) flag = false;
		}
		printf(flag ? "Yes\n" : "No\n");
	}
	return 0;
}

Measured memory_bytes: 1920
a=str(input())
b=str(input())
c=str(input())
d=str(input())
e=str(input())
L=[a,b,c,d,e]

a1=int(a[-1])
b1=int(b[-1])
c1=int(c[-1])
d1=int(d[-1])
e1=int(e[-1])
l1=[a1,b1,c1,d1,e1]

ans=0
flag=0
m=0
for i in range(5):
  if l1[i]==0:
    ans+=int(L[i])
  else:
    flag=1
    s=10-l1[i]
    ans+=int(L[i])+s
    if m<s:
      m=s
if flag==1:
  ans-=m
print(ans)

Measured memory_bytes: 3064
#include<iostream>
#include<cstring>
#include<vector>
using namespace std;
const int maxn = 1e5 + 10;
long long w[maxn];
long long v[maxn];
long long dp[maxn];
int main(){
	int n,V;
	long long ans = 0;
	scanf("%d%d",&n,&V);
    for(int i = 1;i<=n;i++) 
		scanf("%lld%lld",&v[i],&w[i]);
    memset(dp,0x3f,sizeof(dp));
    dp[0] = 0;
    for(int i = 1;i<=n;i++)
    {
        for(int j = 100000;j>=w[i];j--)
            dp[j] = min(dp[j],dp[j-w[i]]+v[i]);
    }
    for(int i = 1;i<=1e5;i++) 
	if(dp[i]<=V) 
		ans = max(ans,(long long)i);
    printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 4484
#include <stdio.h>

int main(){
    int matrix[101][101];
    int transpose_matrix[101][101];
    int r,c;
    int i,j;
    
    /*initialize matrix*/
    for(i=0; i<101; i++){
        for(j=0; j<101; j++){
            matrix[i][j] = 0;
            transpose_matrix[i][j] = 0;
        }
    }
    
    /*Input matrix*/
    scanf("%d %d", &r, &c);
    for(i=0; i<r; i++){
        getchar();
        for(j=0; j<c; j++){
            scanf("%d", &matrix[i][j]);
        }
    }
    for(i=0; i<r; i++){
        int sum_of_row = 0;
        for(j=0; j<c; j++){
            printf("%d ", matrix[i][j]);
            sum_of_row += matrix[i][j];
        }
        printf("%d\n", sum_of_row);
    }
    /*transpose of the matrix*/
    for(i=0; i<r; i++){
        for(j=0; j<c; j++){
            transpose_matrix[j][i] = matrix[i][j];
        }
    }
    /**/
    int sum_of_all = 0;
    for(i=0; i<c; i++){
        int sum_of_column = 0;
        for(j=0; j<r; j++){
            sum_of_column += transpose_matrix[i][j];
            //sum_of_all += sum_of_column;
        }
        sum_of_all += sum_of_column;
        printf("%d ", sum_of_column);
    }
    printf("%d\n",sum_of_all);
}



Measured memory_bytes: 2064
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define between(a,x,b) ((a)<=(x)&&(x)<=(b))
using namespace std;

int main(){
  int n;
  char tmp[64] ={"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"};
  while(scanf("%d", &n) && n){
    queue<int> key;
    int k;
    char str[128];
    rep(i, n){
      scanf("%d", &k);
      key.push(k);
    }
    scanf("%s", str);
    //    printf("finish input");
    rep(i, strlen(str)){
      k = key.front(); key.pop();
      int p = str[i]>96?str[i]-71:str[i]-65;
      if(p < k) p += 52 - k;
      else p -= k;
      str[i] = tmp[p];
      key.push(k);
    }
    puts(str);
  }
  return 0;
}

Measured memory_bytes: 1180
object Main extends App {
  val inputs: Seq[String] = scala.io.Source.stdin.getLines().toList
  val nums = inputs.head.split(" ").map(_.toInt)
  val a = nums(0)
  val b = nums(1)

  println(solve(a, b))

  private def solve(a: Int, b: Int): String = {
    (a + b) match {
      case v if 10 <= v => "error"
      case v => v.toString
    }
  }
}

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

int main() {
    long x, y, n, d;
    int count = 0;

    cin >> n >> d;
    d *= d;
    for (int i = 0; i < n; ++i) {
        cin >> x >> y;
        if (x * x + y * y <= d) {
            ++count;
        }
    }
    cout << count << endl;
}


Measured memory_bytes: 3484
using System;
using System.Linq;
using System.Collections.Generic;

class P
{
    static void Main()
    {
        //int[] NMA = Console.ReadLine().Split().Select(int.Parse).ToArray();
        string s = Console.ReadLine();
        string t = Console.ReadLine();
        string res = "";
        for (int i = 0; i < t.Length; i++)
        {
            res += $"{s[i]}{t[i]}";
        }
        if (s.Length != t.Length) res += s[s.Length - 1];
        Console.WriteLine(res);
    }
}

Measured memory_bytes: 13140
#define _USE_MATH_DEFINES
#include <iomanip>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <tuple>
#include <climits>
#include <algorithm>
#include <cmath>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<double> VD;
typedef vector<LL> VLL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef vector<vector<long long>> VVLL;
typedef vector<vector<bool>> VVB;
typedef vector<vector<double>> VVD;

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

const int MOD = 1000000007;

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

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

void debug(VI &arr){
	int n=arr.size();
	rep(i,n){
		cout<<arr.at(i)<<endl;
	}
}

void debug(VVI &board){
	int h = board.size();
	int w = board.at(0).size();
	rep(i,h){
		rep(j,w){
			cout << board.at(i).at(j) << " ";
		}
		cout<<endl;
	}
}

void debug(VVLL &board){
	int h = board.size();
	int w = board.size();
	rep(i,h){
		rep(j,w){
			cout<<board.at(i).at(j)<<" ";
		}
		cout<<endl;
	}
}

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

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

int main(){
	//cout<<fixed;
	//cout<<setprecision(9)<<...
	int n;cin>>n;
	for(int i=0;i<n+1;i++){
		if((int)(i*1.08) == n){
			cout<<i<<endl;
			return 0;
		}
	}
	cout<<":("<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

/* Macros reg. ends here */

const ll INF = 1LL << 50;

int main() {
  // ios_base::sync_with_stdio(0), c
  cout << fixed << setprecision(15);

  ll n;
  cin >> n;

  vll ans;
  ll par = 0;
  do {
    if(abs(n) & 1){
      ans.push_back(1);
      n -= par ? -1 : 1;
    } else {
      ans.push_back(0);
    }
    n /= 2;
    par = 1 - par;
  } while(n != 0);

  rep(i,(ll)ans.size()) cout << ans[ans.size()-1-i];
  cout << endl;

  return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main() {
    ll n, k; cin >> n >> k;
    if(n >= k) {
        n %= k;
        if(n!=0)
        k %= n;
        cout << min(k, n);
        return 0;
    }
    else {
        ll mi = min(n, k-n);
        cout << mi;
        return 0;
    }
}


Measured memory_bytes: 256
use proconio::fastout;
use proconio::input;

#[fastout]
fn main() {
    input! {
        a:i32,
        b:i32,
        c:i32,
        d:i32
    }

    let ans = if (a + d - 1) / d >= (c + b - 1) / b {
        "Yes"
    } else {
        "No"
    };

    println!("{}", ans);
}


Measured memory_bytes: 2152
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
#define vec(s) vector

#define vvec(s) vector<vector
>
typedef vector<lli> vi;
typedef vector<vi> vvi;
typedef pair<lli,lli> pii;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
#define YES(x) cout<<(x?"YES":"NO")<<endl;
#define out(s) cout<<s<<endl;
#define pb(s) push_back(s);
#define sp " " 
#define INF 10000000000
#define LINF 9000000000000000000
#define all(s) s.begin(),s.end()
void vout(vi v){
    for(lli i=0;i<v.size();i++)
    cout<<v.at(i)<<endl;
}
int main(){
    cout << std::fixed << std::setprecision(10);
    lli ans=LINF;
    lli n;
    cin>>n;
    rep(i,1000000){
        if ((i+1)*(i+1)>n) {
            out(ans-2);
            return 0;
        }
        if(n%(i+1)==0){ 
            ans=min(ans, n/(i+1)+(i+1));
        }
    }
    out(ans-2);
}

Measured memory_bytes: 3560
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if(a==b && b==c){
    cout << "No" << endl;
  }
  else if(a!=b && b!=c && c!=a){
    cout << "No" << endl;
  }
  else{
 cout << "Yes" << endl;
  }
}

Measured memory_bytes: 256