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

typedef long long ll;
typedef vector <bool> v_bool;
typedef vector <ll> v_ll;
typedef vector <vector <ll> > vv_ll;
typedef vector < pair <ll,ll> > vp_ll;
typedef pair <ll,ll> p_ll;

bool TEST=false;
ll MOD = 1000000007;

void show(){if (TEST){cout << endl;}}
void show(string x){if (TEST){cout << x;}}
void show(string x,bool enter){
  if (TEST){if (enter) cout << "<#> " << x << endl;else cout << x;}
}
void show(ll x){if (TEST){cout << x;}}
void show(ll x,bool enter){
  if (TEST){if (enter) cout << "<#> " << x << endl;else cout << x;}
}
void show(p_ll p){
  if (TEST){cout << "{ ";show(p.first);cout << " ";show(p.second);cout << " }";}
}
void show(v_ll v){
  if (TEST){
    cout << "<begin> ";
    for (ll i=0;i<v.size();i++){show(v[i]); cout << " ";}cout <<"<end>"<< endl;
}}
void show(vv_ll v){
  if (TEST){
    cout << "//////////" << endl;
    for (ll i=0;i<v.size();i++){
      show(v[i]); cout << endl;
}}}
void show(vp_ll v){
  if (TEST){
    cout << "//////////" << endl;
    for (ll i=0;i<v.size();i++){
      show(v[i]); cout << endl;
}}}

ll mod(ll x){
  ll n=MOD;
  ll ret=x%n;
  if (ret<0)ret+=n;
  return ret;
}
void mod_self(ll &x){
  x=mod(x);
}
ll mod_inv(ll x){
  ll n=MOD;
  ll y = x,z = n-2, ret=1;
  y=mod(y);
  while (z>0){
    if(z%2==1) ret=mod(ret*y);
    y=mod(y*y);
    z/=2;
  }
  return ret;
}
ll mod_pow(ll x,ll a){
  ll y = x,z = a,ret=1;
  y=mod(y);
  if (z<0)z=-z;
  while (z>0){
    if(z%2==1) ret=mod(ret*y);
    y=mod(y*y);
    z/=2;
  }
  if (a<0) ret=mod_inv(ret);
  return ret;
}
v_ll mod_nck(ll n){
  v_ll nck(n+1,0);
  nck[0]=1;
  for (ll i=1;i<=n;i++){
    nck[i]=mod(nck[i-1]*(n+1-i));
    nck[i]=mod(nck[i]*mod_inv(i));
  }
  return nck;
}
v_ll mod_factorial(ll n){
  v_ll fct(n+1,0);
  fct[0]=1;
  for (ll i=1;i<=n;i++){
    fct[i]=mod(fct[i-1]*i);
  }
  return fct;
}

ll N,M;
v_ll A;
int main(){
  priority_queue<ll> que;
  cin >> N >> M;
  A.assign(N+10,0);
  for (ll i=1;i<=N;i++){
    cin >> A[i];
  }
  for (ll i=1;i<=N;i++){
    que.push(A[i]);
  }
  for (ll i=1;i<=M;i++){
    ll t =que.top();
    que.pop();
    que.push(t/2);
  }
  ll ans=0;
  for (ll i=1;i<=N;i++){
    ans+=que.top();
    que.pop();
  }
  cout << ans << endl;
}


Measured memory_bytes: 2168
#include <iostream>

int main() {
  int a = 0;
  int b = 0;
  std::cin >> a>>b;
  //std::cin >> b;
  if (b % a == 0) {
    std::cout << a + b << std::endl;
  } else {
    std::cout << b - a << std::endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int n ,cnt=0;
  while( scanf( "%d",&n ) != EOF ){
    if( n == 0 ){
      break;
    }
    
    while( n != 1 ){
      if( n % 2 == 0 ){
	n = n / 2;
	cnt++;
      }
      else{
	n = n * 3;
	n++;
	cnt++;
      }
    }
    
    printf( "%d\n",cnt );
    cnt = 0;
  }

  return 0;
}

Measured memory_bytes: 596
# -*- coding:utf-8 -*-

def solve():
    N, M = list(map(int, input().split()))
    A = {}
    for i in range(1, N+1):
        A[i] = True  # 踏める
    for i in range(M):
        a = int(input())
        A[a] = False  # 踏めない
    MOD = 10**9+7

    # dp[i] := i段目までの場合の数
    dp = [0] * (N+1)
    dp[0] = 1

    for i in range(1, N+1):
        if A[i] is False: continue

        dp[i] += dp[i-1]
        if i-2 >= 0:
            dp[i] += dp[i-2]
        dp[i] %= MOD
    
    print(dp[N]%MOD)


if __name__ == "__main__":
    solve()


Measured memory_bytes: 16184
#include <bits/stdc++.h>
using namespace std;
#define ll          long long
#define mp	    make_pair
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define MOD        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define gcd(a,b)    __gcd((a),(b))
#define lcm(a,b)    ((a)*(b)) / gcd((a),(b))
#define rep(i,a,b)  for(int i=a;i<b;i++)
ll mult(ll a,ll b, ll p=MOD){return ((a%p)*(b%p))%p;}
ll multbig(ll a,ll b,ll mod){
    if(a==0 or b==0) return 0;
    if(a==1 or b==1) return (a*b)%mod;
    ll cur=multbig(a,b/2,mod);
    cur=(2*cur)%mod;
    if(b%2) cur=(cur+a)%mod;
    return cur;
}
ll add(ll a, ll b, ll p=MOD){return (a%p + b%p)%p;}
ll fpow(ll n, ll k, ll p = MOD) {ll r = 1; for (; k; k >>= 1LL) {if (k & 1LL) r = mult(r,n,p); n = mult(n,n,p);} return r;}
ll inv(ll a, ll p = MOD) {return fpow(a, p - 2, p);}
ll inv_euclid(ll a, ll m = MOD){ll m0 = m;ll y = 0, x = 1;if (m == 1)return 0;while (a > 1){ll q = a / m;ll t = m;m = a % m, a = t;t = y;y = x - q * y;x = t;}if (x < 0)x += m0;return x;}

#define 	N 1
map<ll, ll>m;
void solve(){
	int n, p = 0;
	cin>>n;
	rep(i,0,n){
		ll t;
		cin>>t;
		m[t]++;
	}
	ll t= 0, ans;
	for(auto it = m.rbegin(); it != m.rend(); it++){
		if(t== 0 && it->y >= 4){
			cout << it->x * it->x << endl;
			return;
		}
		if(it->y >= 2){
			t++;
			if(t == 1) ans = it->x;
			if(t == 2){
				cout << ans*it->x << endl;
				return;
			}
		}
	}	
	cout << ans << endl;
}
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    t =1;
//     cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


Measured memory_bytes: 6528
#pragma comment(linker, "/stack:200000000")

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

#define int long long
#define ull unsigned long long
#define ld long double
#define sz(a) (int)a.size()
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp(a, b) make_pair(a, b)
#define ret(a) return cout<<a,0;

using namespace std;

const int N = 1e5 + 123;
int n ,dp[N][4];
main(){
	scanf("%lld" , &n);
	for(int i = 1 ; i <= n ; i++){
		int a , b , c ;
		scanf("%lld%lld%lld" , &a , &b , &c);
		dp[i][0] = max(dp[i - 1][1] , dp[i - 1][2]) + a;
		dp[i][1] = max(dp[i - 1][0] , dp[i - 1][2]) + b;
		dp[i][2] = max(dp[i - 1][1] , dp[i - 1][0]) + c;
	}
	printf("%lld" , max(dp[n][0] , max(dp[n][1],dp[n][2])));
}

Measured memory_bytes: 3328
program main
implicit None
	integer::x1,y1,x2,y2,x3,y3,x4,y4
	complex::p1,p2,p3,p4,j
	
	read *,x1,y1,x2,y2
	p1 = cmplx(x1,y1)
	p2 = cmplx(x2,y2)
	
	j = (0,-1)
	p3 = p2 + (p1 - p2)*j
	
	j = (0,1)
	p4 = p1 + (p2 - p1)*j
	
	x3 = int(real(p3))
	y3 = int(aimag(p3))
	x4 = int(real(p4))
	y4 = int(aimag(p4))
	
	print 101,x3,y3,x4,y4
	
101 format(i0,1x,i0,1x,i0,1x,i0)
end program main

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}

//main code

int main(int argc, char const* argv[])
{
	int n,l;
	cin >> n >> l;
	int m = 0;
	for (int i = 0; i < n; i++) {
		m += l+i;
	}
	if (l <= 0 and l + n - 1 >= 0) {
		cout << m << endl;
	}
	else if (l < 0) {
		cout << m - (l+n-1) << endl;
	}
	else {
		cout << m - l << endl;
	}
	return 0;
}


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

int main()
{
  int N; cin>>N;
  vector<long long> luca(N+1);
  luca[0]=2; luca[1]=1;
  for(int i=2; i<=N; i++)
    luca[i]=luca[i-1]+luca[i-2];
  cout<<luca[N]<<endl;
  return 0;
}


Measured memory_bytes: 256
// Author : Sarthak Kapoor
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define rep(i,n) for(int i=0;i<n;++i)
#define repa(i,a,n) for(int i=a;i<n;++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define repba(i,b,a) for(int i=b;i>=a;--i)
#define repab(i,a,b) for(int i=a;i<b;++i)
#define ll long long
#define pi pair<int,int> 
#define pii pair<pi,int>
#define ull unsigned long long
#define vi vector<int>
#define viip vector<pair<int,pair<int,int> > > 
#define mp make_pair
#define vip vector<pair<int,int> >
#define pb push_back 
#define fi first
#define sec second
#define all(v) v.begin(),v.end()
#define s(v) v.size()
ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());//use rng()%n for numbers in range [0,n-1]
ll gcd(ll a,ll b){
	if(b==0)return a;
	return gcd(b,a%b);
}
ll fastexp(ll x,ll a){
    ll res = 1;
    while(a>0){
        if(a&1){
            res = (res*x)%mod;
        }
        a=a>>1;
        x=(x*x)%mod;
    }
    return res;
}
ll inverse(ll n){
    return fastexp(n,mod-2);
}
template <typename T>
void add(T &a, T b){
	a += b;
	if(a >= mod)a -= mod;
}
template <typename T>
void sub(T &a, T b){
	a -= b;
	if(a < 0)a += mod;
}
template <typename T>
void mul(T &a, T b){
	a *= b;
	if(a >= mod)a %= mod;
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int n,a[3];
	string res;
	cin>>n>>a[0]>>a[1]>>a[2];
	string r[n];
	rep(i,n){
		cin>>r[i];
	}
	rep(i,n){
		string s;
		s = r[i];
		int a1 = s[0]-'A';
		int a2 = s[1]-'A';
		int a3 = 3-a1-a2;
		if(a[a1] > a[a2]){
			swap(a1,a2);
		}
		else if(a[a1] == a[a2] && a[a1] == 1 && a[a3] == 0 && i != n-1){
			string c = r[i+1];
			int c1 = c[0]-'A';
			int c2 = c[1]-'A';
			if(c1 == a1 || c1 == a2){
				int temp;
				if(c1==a1)temp=a2;
				else temp = a1;
				a[c1]++;
				a[temp]--;
				res.pb('A'+c1);
			}
			else{
				int temp;
				if(c2==a1)temp=a2;
				else temp = a1;
				a[c2]++;
				a[temp]--;
				res.pb('A'+c2);
			}
			continue;
		}
		if(a[a2] == 0){
			cout<<"No";
			return 0;
		}
		res.pb('A'+a1);
		a[a2]--;
		a[a1]++;
	}
	cout<<"Yes\n";
	rep(i,n){
		cout<<res[i]<<"\n";
	}
	return 0;
}

Measured memory_bytes: 6888
#include<iostream>
using namespace std;
typedef long long ll;
signed main(){
  ll a,b,c,k,tmp;
  cin >> a >> b>> c >>k;
  tmp = (k%2==0)?a-b:b-a;
  if(abs(tmp)>=1e18){
    cout <<"Unfair\n";
  }else{
    cout << tmp<<endl;
  }
}


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

int n, k, ar[1000005], dp[1000005];
int main () {
	ios_base::sync_with_stdio (0);
  	cin.tie (0);
  	cin >> n >> k;
  	for (int i = 1; i <= n; i++) {
      cin >> ar[i];
      dp[i] = 1000000000;
    }
  	dp[1] = 0;
    for (int i = 2; i <= n; i++) {
    	for (int j = max (i - k, 1); j < i; j++) {
        	dp[i] = min (dp[i], abs (ar[i] - ar[j]) + dp[j]);
        }
    }
  	cout << dp[n] << '\n';
}


Measured memory_bytes: 4736
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <valarray>
#include <utility>
#include <set>

using namespace std;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define REP2(i,m,n) for(int i=m+1;i<=(int)(n);i++)
#define REP3(i,m,n) for(int i=m;i<=(int)(n);i++)
#define INF 500000000  //
#define INFLL 1000000000000000000  //
#define MOD (1e9)+7

typedef long long int ll;

// a 0x61  z 0x7a  0 0x30

int main() {
    ll n, m;
    cin >> n >> m;
    ll t = 1900 * m + 100 * (n - m);
    ll p = (ll) pow(2, m);
    cout << t * p << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from collections import deque

h,w = map(int,readline().split())
#壁を作りたいから、行と列に２ずつ足していく。
h += 2;w += 2
#壁を作成
grid = '#' * w
#_はとくに気にしなくてもいい　iと一緒
for _ in range(h - 2):
    #rstrip()末尾の空白を削除する
    grid += '#' + readline().rstrip().decode() + '#'
    #一列に壁と情報を足している
grid += "#" * w

def bfs(start):
    INF = 10**9
    dist = [INF] * ( h * w )
    dist[start] = 0
    queue = deque([start])
    while queue:
        v = queue.popleft()
        dv = dist[v]
        for move in (-1,1,w,-w):
            W = v + move
            if grid[W] == "#":
                continue
            dw = dv + 1
            if dw >= dist[W]:
                continue
            dist[W] = dw
            queue.append(W)
    return max(x for x in dist if x < INF)

#スタート位置をbfsに入れている
answer = max(bfs(v) for v in range(h*w) if grid[v] != "#")
print(answer)


Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=3e5+5;
const ll mod=1e9+7;
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}
ll n,ans=0,mx=0,a[N],num[100]={0},cnt[100]={0};
void split(ll x){
    ll p=0;
    while(x){
        if(x%2) cnt[p]++;
        p++;
        x/=2;
    }
    mx=max(mx,p);
}
int main(){
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i],split(a[i]);
    for(int i=1;i<=n;i++){
        for(ll j=0;j<mx;j++){
            if(a[i]&(1LL<<j)) num[j]+=n-cnt[j];
            else num[j]+=cnt[j];
        }
    }
    for(ll i=0;i<100;i++){
        num[i+1]+=num[i]/2;
        if(num[i]%2) ans=(ans+power(2,i))%mod;
    }
    cout<<ans*power(2,mod-2)%mod;
    return 0;
}


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

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

int main(){

    ll n,s;
    cin >> n >> s;
    ll mod = 998244353;

    vector<ll> a(n);
    rep(i,n) cin >> a[i];

    vector<vector<ll>> dp(n+5, vector<ll>(s+5,0));
    dp[0][0] = 1;

    for(ll i = 0; i < n; i++){
        for(ll j = 0; j <= s; j++){
            dp[i+1][j] += dp[i][j]*2;
            dp[i+1][j] %= mod;
            if(j+a[i] <= s){
                dp[i+1][j+a[i]] += dp[i][j];
                dp[i+1][j+a[i]] %= mod;
            }
        }
    }

    cout << dp[n][s] << endl;


    return 0;
}

Measured memory_bytes: 74004
#include <stdio.h>
int main(void)
{
	int n,i=0,c=0;
	char s[100000];
	scanf("%d",&n);
	scanf("%s",s);
	while(i<=n){
		if(s[i]=='O'&&s[i+1]=='X'||s[i]=='X'&&s[i+1]=='O'){
			i+=2;
			c++;
		}
		else i++;
	}
	printf("%d\n",c);
	return 0;
}


Measured memory_bytes: 2104
#include <iostream>

int main(){
    int A, B;
    std::cin >> A >> B;
    A -= B;
    if(A <= 0){
        std::cout << 0 <<std::endl;
        return 0;
        }
        A -= B;
    if(A <= 0){
        std::cout << 0 <<std::endl;
        return 0;
        }else{
            std::cout << A << std::endl;
        }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

typedef long long ll;
#define MAXN 86

using namespace std;

ll L[MAXN+1];

ll lucas ( int n )
{
  if ( L[n] > 0 ) return L[n];

  return L[n] = lucas(n-1)+lucas(n-2);
}

int main()
{
  int n;

  cin >> n;

  L[0] = 2;
  L[1] = 1;

  cout << lucas(n) << "\n";
}


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

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

    int m = 1000000000, M = 0;

    for (int i = 0; i < N; i++)
    {
        cin >> n;
        if (n < m)
            m = n;

        if (n > M)
            M = n;
    }

    cout << M - m << endl;
}


Measured memory_bytes: 256
use std::io::Read;
use std::cmp;

fn main() {
    let mut s = String::new();

    std::io::stdin().read_line(&mut s).unwrap();

    let vecs: Vec<char> = s.chars().collect();

    let mut isNotInputtable: bool = false;
    
    for i in 0..(vecs.len() - 1) {
        if vecs[i] == vecs[i + 1] {
            isNotInputtable = true;
        }
    }
    
    if isNotInputtable {
        println!("{}", "Bad");
    } else {
        println!("{}", "Good");
    }

}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i,n) for(int i = 0;i < n;++i)
using namespace std;

int main() {
    int N,K;
    int i = 0;
    vector<int> V;
    cin >> N >> K;
    V.pb(N);
    while(true){
        if(V[i]/K == 0) break;
        V.pb(V[i]/K);
        i++;
    }
    log(V.size());
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<(n);i++)
#define all(t) (t).begin(),(t).end()
#define MOD 1000000007
typedef long long ll;
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}else{return 0;}}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}else{return 0;}}
template <class T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <class T> inline T LCM(T a,T b){return a*b/GCD(a,b);}

int main(){
	int q;
	cin >> q;
	bool is_prime[100010];
	is_prime[1]=0;
	for(int i=2;i<=100010;i++){
		bool a=1;
		for(int j=2;j*j<=i;j++){
			if(i%j==0){
				a=0;
				break;
			}
		}
		if(a){
			is_prime[i]=1;
		}else{
			is_prime[i]=0;
		}
	}
	int sum[100010];
	FOR(i,100005)sum[i]=0;
	for(int i=3;i<=100000;i+=2){
		if(is_prime[i] && is_prime[(i+1)/2]){
			sum[i]=sum[i-2]+1;
		}else{
			sum[i]=sum[i-2];
		}
		sum[i+1]=sum[i];
	}
	int l,r;
	FOR(i,q){
		cin >> l >> r;
		cout << sum[r]-sum[l-1] << endl; 
	}

}

Measured memory_bytes: 1152
#include<iostream>
using namespace std;
int a,b;
int ji(int n){
    int s=0;
    while(n!=0){
        s+=n%10;
        n=n/10;
    }
    if(s>=a && s<=b) return true;
    else return false;
}
int main(){
    int n;
    cin>>n>>a>>b;
    int i,s=0;
    for(i=1;i<=n;i++){
        if(ji(i)) {
            s+=i;
            //cout<<i<<endl;
        }
    }
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 764
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	if (s == "ABC") cout << "ARC" << endl;
	else cout << "ABC" << endl;
	return 0;
}


Measured memory_bytes: 3612
h, w = map(int, input().split())
g = [[x for x in input()] for _ in range(h)]

dp = [[0 for _ in range(w)] for __ in range(h)]

dp[0][0] = 1

for i in range(h):
    for j in range(w):
        if g[i][j] == '#':
            continue
        if i != 0:
            dp[i][j] += dp[i-1][j]
            dp[i][j] %= 10**9+7
        if j != 0:
            dp[i][j] += dp[i][j-1]
            dp[i][j] %= 10**9+7

print(dp[h-1][w-1])


Measured memory_bytes: 91228
#include<iostream>
using namespace std;
int main(){
	int n,a,b,c,x;
	while(cin>>n>>a>>b>>c>>x,n){
		int ans=0,cnt=0,d[n];
		for(int i=0;i<n;i++)
		cin>>d[i];
		while(ans<=10000){
			if(d[cnt]==x)
			cnt++;
			if(cnt==n)
			break;
			x=(a*x+b)%c;
			ans++;
		}
		if(ans<=10000)
		cout<<ans<<endl;
		else
		cout<<-1<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <cmath>
#include <random>
#include <iomanip>
#include <functional>
#include <list>
using namespace std;

int main()
{
	int N, K;
	cin >> N >> K;

	long long c = N / K;
	long long cnt = c * c * c;

	if (K % 2 == 0 && (K / 2 <= N))
	{
		c = (N - K / 2) / K;
		c = c < 0 ? 0 : c;
		c++;

		cnt += c * c * c;
	}

	cout << cnt;
}


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

int main(){
  int N,M;  cin >> N >> M;
  int a,b;
  map<int,int> city;
  for(int i = 0;i < M;i++){
    cin >> a >> b;
    city[a]++;
    city[b]++;
  }
  for(int i = 1;i <= N;i++){
    cout << city[i] << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define SZ(i) int(i.size())
#ifdef tmd
#define IOS()
#define debug(...) fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);_do(__VA_ARGS__);
template<typename T> void _do(T &&x){cerr<<x<<endl;}
template<typename T, typename ...S> void _do(T &&x, S &&...y){cerr<<x<<", ";_do(y...);}
#else
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define debug(...)
#endif

const int MAXN = 500005;
const ll MOD = 1000000007;

int a, b;
/*********************GoodLuck***********************/
int main () {
    IOS();

    cin >> a >> b;
    if (a<10 && b<10) {
        cout << a * b << endl;
    } else {
        cout << -1 << endl;
    }
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.InteropServices;
using System.Text;
using static System.Console;
using static System.Math;
class Simple {
    private int N;
    private int[] X;
    void Solve() {
        //in
        N = io.Int;
        X = new int[N];
        for(int i = 0; i < N; ++i) {
            X[i] = io.Int;            
        }
        //cal
        var vals = X.Clone() as int[];
        Array.Sort(vals);
        var midIdx = N / 2 - 1;
        var midVal = vals[midIdx];
        foreach(var v in X) {
            if(v <= midVal) {
                WriteLine(vals[midIdx + 1]);
            } else {
                WriteLine(vals[midIdx]);
            }
        }
    }
    SimpleIO io = new SimpleIO();
    public static void Main(string[] args) => new Simple().Stream();
    private void Stream() {
        //var exStdIn = new System.IO.StreamReader("stdin.txt");
        //SetIn(exStdIn);
        Solve();
        io.Flush();
    }
}
class SimpleIO {
    string[] _nextBuffer;
    int _bufferCnt;
    char[] cs = new char[] {' ', '"', ','};
    StreamWriter sw = new StreamWriter(OpenStandardOutput()) {
#if DEBUG
        AutoFlush = true
#else
        AutoFlush = false
#endif
    };
    public SimpleIO() {
        _nextBuffer = new string[0];
        _bufferCnt = 0;
        SetOut(sw);
    }
    string Next() {
        if(_bufferCnt < _nextBuffer.Length)
            return _nextBuffer[_bufferCnt++];
        var st = ReadLine();
        while(st == "")
            st = ReadLine();
        _nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        _bufferCnt = 0;
        return _nextBuffer[_bufferCnt++];
    }
    public string String => Next();
    public char Char => char.Parse(String);
    public int Int => int.Parse(String);
    public long Long => long.Parse(String);
    public double Double => double.Parse(String);
    public void Flush() => Out.Flush();
}


Measured memory_bytes: 32608
#include <bits/stdc++.h>
using namespace std;
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

const long double PI = 3.141592653589;

int main() {FIN

	int a, b, x;
	long double res;
	cin >> a >> b >> x;
	if (2 * x <= a * a * b)
		res = atan((1.0 * b * b * a) / (2.0 * x)) * 180 / PI;
	else
		res = atan((2.0 * (a * a * b - x)) / (a * a * a)) * 180 / PI;
	cout << fixed << setprecision(12) << res << "\n";
	return 0;
}

Measured memory_bytes: 256
N = int(input())
S = [input() for _ in range(N)]

res = {
    'AC': 0,
    'WA': 0,
    'TLE': 0,
    'RE': 0,
}

for s in S:
    res[s] += 1

print('AC x ' + str(res['AC']))
print('WA x ' + str(res['WA']))
print('TLE x ' + str(res['TLE']))
print('RE x ' + str(res['RE']))


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




template <int mod>
struct ModInt {
  int val;
  int trim(int x) const { return x >= mod ? x - mod : x < 0 ? x + mod : x; }
  ModInt(int v = 0) : val(trim(v % mod)) {}
  ModInt(long long v) : val(trim(v % mod)) {}
  ModInt &operator=(int v) { return val = trim(v % mod), *this; }
  ModInt &operator=(const ModInt &oth) { return val = oth.val, *this; }
  ModInt operator+(const ModInt &oth) const { return trim(val + oth.val); }
  ModInt operator-(const ModInt &oth) const { return trim(val - oth.val); }
  ModInt operator*(const ModInt &oth) const { return 1LL * val * oth.val % mod; }
  ModInt operator/(const ModInt &oth) const {
    function<int(int, int, int, int)> modinv = [&](int a, int b, int x, int y) {
      if (b == 0) return trim(x);
      return modinv(b, a - a / b * b, y, x - a / b * y);
    };
    return *this * modinv(oth.val, mod, 1, 0);
  }
  bool operator==(const ModInt &oth) const { return val == oth.val; }
  ModInt operator-() const { return trim(mod - val); }
  template<typename T> ModInt pow(T pw) {
    bool sgn = false;
    if (pw < 0) pw = -pw, sgn = true;
    ModInt ans = 1;
    for (ModInt cur = val; pw; pw >>= 1, cur = cur * cur) {
      if (pw&1) ans = ans * cur;
    }
    return sgn ? ModInt{1} / ans : ans;
  }
};
using mint = ModInt<int(1e9 + 7)>;

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);
  int n; cin >> n;
  vector<long long> A(n);
  vector<vector<int>> bts(2, vector<int>(60));
  for (int i = 0; i < n; ++i) {
    cin >> A[i];
    for (int j = 0; j < 60; ++j) {
      ++bts[A[i]>>j&1][j];
    }
  }
  mint ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 60; ++j) {
      ans = ans + mint((1ll<<j)) * bts[A[i]>>j&1^1][j];
    }
  }
  cout << (ans / 2).val << '\n';
}



Measured memory_bytes: 2560
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize ("Ofast")
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
using namespace __gnu_pbds;
using namespace std;
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<long long,long long> ii; 	
typedef complex<long double> com;

const ll mod = 1e9+7;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    ld pi = 3.141592653589793238462643383279502884;
	ld r;
    cin >> r;
    cout << fixed << setprecision(60) << ld(2)*pi*r << endl;
}

Measured memory_bytes: 3804
#include <bits/stdc++.h>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
using namespace std; 
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
const int INF = 1<<29;
typedef long long int ll;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n>>b)&1; }
inline void set_bit(int & n, int b) { n |= two(b); }
inline void unset_bit(int & n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) { int res = 0; while(n && ++res) n-=n&(-n); return res; }
template<class T> void chmax(T & a, const T & b) { a = max(a, b); }
template<class T> void chmin(T & a, const T & b) { a = min(a, b); }
const int MOD=1000000007;

bool isPowerOfTwo (ll x)  
{  
    return x && (!(x&(x-1)));  
}
bool isPrime(int n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
int highestPowerof2(unsigned int n) 
{ 
    // Invalid input 
    if (n < 1) 
        return 0; 
  
    int res = 1;
    for (int i=0; i<8*sizeof(unsigned int); i++) 
    { 
        int curr = 1 << i; 
        if (curr > n) 
           break; 
  
        res = curr; 
    } 
  
    return res; 
} 
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
/*lcm(gcd(N1, M), gcd(N2, M), ..., gcd(Nk, M)) = gcd(lcm(N1, ..., Nk), M)
gcd(lcm(N1, M), lcm(N2, M), ..., lcm(Nk, M)) = lcm(gcd(N1, ..., Nk), M).

If gcd(N1, N2) = 1, then
gcd(N1·N2, M) = gcd(N1, M)·gcd(N2, M)
lcm(N1·N2, M) = lcm(N1, M)·lcm(N2, M)/M.

lcm(M, N, P) · gcd(M, N) · gcd(N, P) · gcd(P, M) = NMP · gcd(N, M, P).
*/
////////////////////////////////////////////////////////////////////

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);  
  cout.tie(NULL);
  ll t=1;
  while(t--)
  {
    ll n,k,s;
    cin>>n>>k>>s;
    REP(i,n)
    {
        if(i<k)
        cout<<s<<" ";
        else
        {
            if(s==1000000000)
            cout<<s-1<<" ";
            else cout<<s+1<<" ";
        }
    }
  }  
  return 0;
}
/* Look for:
* the exact constraints (multiple sets are too slow for n=10^6 :( )
* special cases (n=1?)
* 1LL<<i and not 1<<i
* overflow (int vs ll?)
* array bounds
* if you have no idea just guess the appropriate well-known algo instead of doing nothing :/
*/

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


int main(){
	int len;
	string s;
	cin >> s;
	
	long long x,ans=0;
	len=s.size();
	for(int i=0;i<1<<(len-1);i++){
		x=s[0]-'0';
		for(int j=0;j<len-1;j++){;
			if(i & (1<<j)){
				ans+=x;
				x=0;
			}
			x=x*10 + s[j+1]-'0';
		}
		ans+=x;
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> v(m);
    for (auto &&i : v) scanf("%d", &i);
    sort(v.begin(), v.end());
    vector<int> v2;
    v2.reserve(m - 1);
    for (int i = 0; i < m-1; ++i) {
        v2.emplace_back(v[i+1]-v[i]);
    }
    sort(v2.begin(), v2.end());
    int ans = 0;
    for (int i = 0; i < m-n; ++i) {
        ans += v2[i];
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SoundHound_Inc
{
    class Program
    {
        static void Main(string[] args)
        {
            int a, b, c, d, f;
            var word = Console.ReadLine().Split(' ');
            a = int.Parse(word[0]);
            b = int.Parse(word[1]);
            c = a + b;
            d = a * b;
            f = 15;

            if (!(c > f )&&( !(c < f)))
            {

                Console.WriteLine("+");
            }
            else if (!(d > f )&& (!(d < f)))
            {
                Console.WriteLine("*");
            }
            else
            {
                Console.WriteLine("x");
            }
            Console.ReadKey();

        }
    }
}



Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define CL(x) ((x) * (x))
#define CR(x) (((x) * (x)) + 1)
typedef long long cc;
typedef pair <int, int> pii;

int main() {
    //freopen("input.inp", "r", stdin);
    ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int n;
    int le = 1;
    int all = 1;
    cin >> n;
    while (n--) {
        int x; cin >> x;
        if (x % 2 == 0) le *= 2;
        all *= 3;
    }
    cout << all - le;
    return 0;
}


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

#define pi 3.14159265358979323846264

#define ll long long
#define fori(n) for(long long i=0;i<n;i++)
#define forj(n) for(long long j=0;j<n;j++)

#define sp(n) setprecision(n)
#define d7 1000000007
#define mkp make_pair
#define mkt make_tuple

using namespace std;

bool isPrime(long long k){
    if(k<=1){return false;}
    if(k==2){return true;}
    if(k%2==0){return false;}
    long long i = 3;
   while (i*i <= k) {if (k % i == 0) {return false;}i += 2;}
return true;
}

ll binomialCoeff(ll n, ll k){
    ll C[n + 1][k + 1];ll i, j;
    for (i = 0; i <= n; i++){
        for (j = 0; j <= min(i, k); j++)
        {if (j == 0 || j == i) C[i][j] = 1;
            else C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]);}}
    return C[n][k];
 }

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

ll srihrg(ll n,ll k,ll m){
    ll ans;
    ans=1;
    fori(k){
        ans=(ans*n)%m;
    }
    return ans;
}

ll kk=1;
void dfsi(vector<bool> &vis, vector<ll> adj1[], ll n, ll start, vector<ll> &pre, vector<ll> &pos){
    vis[start]=true;
    pre[start]=kk;kk++;
    for(ll i: adj1[start]){
        if(!vis[i]){
            vis[i]=true;
            dfsi(vis,adj1,n,i,pre,pos);
        }
    }
    pos[start]=kk;kk++;
}

void bfsi(vector<ll> &dis, vector<ll> adj[], ll s, vector<ll> &parent){
    dis[s]=-1;
    queue<ll> q;
    q.push(s);
    while(!q.empty()){
        ll z=q.front();
        q.pop();
        for(ll v:adj[z]){
            if(dis[v]==0){
            q.push(v);
            dis[v]=-dis[z];
                parent[v]=z;}
        }
    }
}

void make_set(ll v, vector<ll> &parent, vector<ll> &krank) {
    parent[v] = v;
    krank[v] = 0;
}

ll find_set(ll v,vector<ll> &parent, vector<ll> &krank) {
    if (v == parent[v])
        return v;
    return parent[v] = find_set(parent[v], parent, krank);
}

void union_sets(ll a, ll b,vector<ll> &parent, vector<ll> &krank) {
    a = find_set(a,parent,krank);
    b = find_set(b,parent,krank);
    if (a != b) {
        if (krank[a] < krank[b])
            swap(a, b);
        parent[b] = a;
        if (krank[a] == krank[b])
            krank[a]++;
    }
}

void dijkstra(ll s, vector<ll> &dist, vector<ll> &parent, ll n, vector<pair<ll,ll>> adj[]){
    dist[s]=0;
    vector<bool> u(n,false);
    fori(n){
        ll v=-1;
        forj(n){
            if(!u[j] &&(v==-1||(dist[j]<dist[v]))) v=j;
        }
        if(dist[v]==d7) break;
        u[v]=true;
        for(auto j:adj[v]){
            ll a,b;
            a=j.first;
            b=j.second;
            if(dist[v]+b<dist[a]){
                dist[a]=dist[v]+b;
                parent[a]=v;
            }
        }
    }
}


int main(int argc, const char * argv[]) {
 //cout<<"Om\n";
 //Praise to Lord
 //make cin/cout faster
 ios_base::sync_with_stdio(false);
 cin.tie(NULL);
// code now
   
    ll n,k;
    string s,t;
    map<string,ll> mp;
    cin>>s>>t;
    cin>>k>>n;
    mp[s]=k;mp[t]=n;
    string st;
    cin>>st;
    mp[st]--;
    cout<<mp[s]<<" "<<mp[t];
    
//code ends
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
long long int n,m,ans;
int main()
{    while(scanf("%lld%lld",&n,&m)!=EOF)
     {   long long int ans=0;
          
           if(n==1||m==1)
		    { ans=n*m-2;
			}
			else{  ans=n*m-(m+n)*2+4;
			}
			if(ans<0) ans=1;
			
         printf("%lld\n",ans);
	 }
	 return 0;
}

Measured memory_bytes: 128
import collections
N = int(input())
a = list(map(int, input().split()))
a_minus1 = [i-1 for i in a]
a_plus1 = [i+1 for i in a]
a_join = a + a_minus1 + a_plus1
c = collections.Counter(a_join)
print(max(list(c.values())))

Measured memory_bytes: 30024
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

signed main() {
    cin >> H >> W;
    vector<vector<char>> g(H + 2, vector<char>(W + 2, '#'));
    REP(h, H)
    REP(w, W) {
        char c;
        cin >> c;
        g[h + 1][w + 1] = c;
    }
    REP(h, H + 2) {
        REP(w, W + 2) {
            cout << g[h][w];
        }
        cout << endl;
    }
}

Measured memory_bytes: 3608
import java.util.*;
public class Main {
    public static void main(String args[]) {
     Scanner s=new Scanner(System.in);
  int n=s.nextInt();
  double d=s.nextDouble();
  int c=0;
  for(int i=0;i<n;i++)
  {
      int x=s.nextInt();
      int y=s.nextInt();
      long x1=x*x;
      long y1=y*y;
     double d1 = Math.hypot(x, y);
    
      if(d1<=d)
      {
      c++;
    // System.out.print(x+" "+y+"\n");
      }
  }
  System.out.println(c);
    }
}

Measured memory_bytes: 60700
#include<iostream>
#include<algorithm>
using namespace std;
int n,t;
struct node{
	int ca,ta;
}e[105];
bool cmp(node a,node b)
{
	if(a.ta!=b.ta) return a.ta<b.ta;
	else return a.ca<b.ca;
}
int main()
{
	cin>>n>>t;
	for(int i=0;i<n;i++) cin>>e[i].ca>>e[i].ta;
	sort(e,e+n,cmp);
	if(e[0].ta>t) { cout<<"TLE"<<endl; return 0;}
	int ans=1005;
	for(int i=0;i<n;i++)
	{
		if(e[i].ta<=t) ans=min(ans,e[i].ca);
	}
	
	cout<<ans<<endl;
	return 0;
 } 

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

#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, n, m) for(int (i) = (n); (i) < (m); ++(i))

constexpr int INF = 1e9;
//constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9+7;

int main(){
  int H, W, N;
  cin >> H >> W >> N;
  vector<int> a(N);
  REP(i, N){
    cin >> a[i];
  }
  int cnt = 0, idx = 0;
  vector<vector<int>> board(H, vector<int>(W));
  REP(i, H){
    if(i%2){
      REPR(j, W-1){
        board[i][j] = idx;
        cnt++;
        if(cnt >= a[idx]){
          cnt =0;
          idx++;
        }
      }
    }
    else{
      REP(j, W){
        board[i][j] = idx;
        cnt++;
        if(cnt >= a[idx]){
          cnt =0;
          idx++;
        }
      }
    }
  }
  REP(i, H){
    REP(j, W){
      cout << board[i][j] + 1 << " ";
    }
    cout << endl;
  }
  return 0;
}


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

#define Fast            ios_base::sync_with_stdio(false);cin.tie(nullptr);
#define LL              long long
#define ff              first
#define ss              second
#define pb              push_back
#define pii             pair<int,int>
#define all(a)          a.begin(),a.end()
#define FOR(i,a,b)      for(LL i=a;i<=b;i++)
#define ROF(i,a,b)      for(LL i=a;i>=b;i--)
#define REP(i,b)        for(LL i=0;i<b;i++)

const LL mod=1e9+7;
LL bigmod(LL b, LL p){
    LL ret=1;
    while(p){
        if(p & 1) ret=(ret*b)%mod;
        b=(b*b)%mod;
        p/=2;
    }
    return ret;
}

const LL N=200005;
LL fact[N];
void Fact(){
    fact[0]=1;
    FOR(i,1,N-1) fact[i]=(fact[i-1]*i)%mod;
}

LL nCr(LL n,LL r){
    LL up=fact[n];
    LL down=(fact[r]*fact[n-r])%mod;
    down=bigmod(down,mod-2);
    return (up*down)%mod;
}

int main()
{
    Fact();
    LL n,m;
    scanf("%lld %lld",&n,&m);
    LL ans=1;
    for(LL i=2;i*i<=m;i++){
        if(m%i==0){
            LL cnt=0;
            while(m%i==0){
                m/=i;
                cnt++;
            }
            ans=(ans*nCr(n+cnt-1,cnt))%mod;
        }
    }
    if(m>1) ans=(ans*nCr(n,1))%mod;
    printf("%lld",ans);
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define pb push_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
typedef long long ll;
typedef multiset<ll> S;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
bool chmin(auto &a,auto b){if(a>b){a=b;return true;}return false;}
bool chmax(auto &a,auto b){if(a<b){a=b;return true;}return false;}

int main(){
    int n;cin>>n;
    ll ans=0,m=inf;
    rep(i,n){
        int a,b;cin>>a>>b;
        if(a>b)chmin(m,b);
        ans+=b;
    }
  if(m==inf)cout<<0<<endl;
    else cout<<ans-m<<endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#include <numeric>
#include <iomanip>
#define ll long long
#define pi 3.14159265358979323846
using namespace std;
using p = pair<ll, ll>;
ll dx[4] = {-1, 0, 1, 0};
ll dy[4] = {0, 1, 0, -1};
/*　BFS
 vector<vector<ll>> g(n+1);
    for(ll i = 0; i < m; i++){
        ll a, b;
        cin >> a >> b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    vector<ll> dist(n+1, -1);
    queue<ll> que;
    que.push(1);
    dist[1] = 0;
    while(!que.empty()){
        ll v = que.front();
        que.pop();
        for(ll nv : g[v]){
            if(dist[nv]!=-1) continue;
            dist[nv] = dist[v]+1;
            que.push(nv);
        }
    }
*/

int main(){
    ll n, m;
    cin >> n >> m;
    ll a[n];
    map<ll, ll> I{};
    for(ll i = 0; i < n; i++){
        cin >> a[i];
        a[i] %= m;
        I[a[i]]++;
    }
    ll sum[n+1];
    sum[0] = a[0]%m;
    for(ll i = 1; i < n; i++){
        sum[i] = sum[i-1]+a[i];
        sum[i]%=m;
    }
    sort(sum, sum+n);
    sum[n] = -11111111111;
    ll ans = 0;
    ll count = 1;
    for(ll i = 0; i < n; i++){
       // cout << sum[i] << endl;
        if(sum[i]==0) ans++;
        if(sum[i]==sum[i+1]) count++;
        else {
            ans += count*(count-1)/2;
            count = 1;
        }
    }
    ans += count*(count-1)/2;
    cout << ans << endl;
    return 0;
}


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

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = long long;
using Graph = vector<vector<int>>;

int main(){
    ll N; cin>>N;
    vector<ll> A(N); rep(i,N)cin>>A.at(i);
    ll res = 0;
    int e = 0;//end
    ll sum = 0;
    for(int s = 0; s < N; s++){
        while(e < N && (sum ^ A.at(e)) == (sum + A.at(e))){
            sum += A.at(e);
            e++;
        }
        res += e - s;
        if(s == e) e++;
        else{
            sum -= A.at(s);
        }
    }
    cout<<res<<endl;
}


Measured memory_bytes: 1792
#include<stdio.h>
 
#define Z 251
 
 
int A[Z];
 
int main(){
  
  int n;
  int i;
 
  scanf("%d",&n);
  for(i = 1;i <= n;i++){
    scanf("%d",&A[i]);
  }
 
  for(i = 1;i <= n;i++){
    printf("node %d: key = %d, ",i,A[i]);
 
    if(i/2 != 0){
      printf("parent key = %d, ",A[i/2]);
    }
    if(2*i <= n){
      printf("left key = %d, ",A[2*i]);
    }
    if(2*i+1 <= n){
      printf("right key = %d, ",A[2*i+1]);
    }
    printf("\n");
  }
return 0;
}

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

int n,x,d;

void so(int &a,int &b){
  int g=__gcd(a,b);
  a/=g;b/=g;
}

int f(int y){
  int mx=(n-y+n-1)*y/2;
  int mn=y*(y-1)/2;
  return mx-mn+1;
}

int g(int y){
  int l1=((n-y)+(n-1))*y/2,
      l2=y*(y-1)/2,
      r1=((n-y-d)+(n-1))*(y+d)/2+x,
      r2=(y+d)*(y+d-1)/2+x;

  //[l1,l2]がy個の数字で作った時のdの個数の範囲
  //[r1,r2]がy+d個の数字で作った時のdの個数の範囲+x
  //二つの範囲の重なり部分が重複して数えられてるのでこれを引く

  return max(min(l1,r1)-max(l2,r2)+1,0LL);
}

template<typename T>
void fin(T a){
  cout<<a<<endl;
  exit(0);
}

signed main(){
  cin>>n>>x>>d;

  //コーナーケース潰し
  if(!d&&!x)fin(1);
  if(!d)fin(n+1);
  if(!x)fin(n*(n-1)/2+1);
  if(x<0)x*=-1,d*=-1;

  //互いに素にする
  so(x,d);

  int ans=0;

  for(int i=0;i<=n;i++)  //f(i)はi個で作れる数字の種類数
    ans+=f(i);

  for(int i=0;i<=n;i++)  //i個で作った数字と被るのは[i+d個で作った、dを取ってる個数がそれよりx個少ないやつ]だけ（ではないんだけど）なのでそれを引く
    if(i+d<=n&&i+d>=0)
      ans-=g(i);

  fin(ans);
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#define  N  110000
using  namespace  std;
int  n,a[N],what[N];
inline  bool  cmp(int  x,int  y){return  a[x]<a[y];}
int  main()
{
	scanf("%d",&n);
	for(int  i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);what[i]=i;
	}
	sort(what+1,what+n+1,cmp);//这个很类似我打的离散化呀
	for(int  i=1;i<n;i++)printf("%d ",what[i]);
	printf("%d\n",what[n]);
	return  0;
}

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (A + B > C + D) {
    cout << "Left" << endl;
  }
  else if (A + B == C + D) {
    cout << "Balanced" << endl;
  }
  else {
    cout << "Right" << endl;
  }
}


Measured memory_bytes: 256
s = input()
n = len(s)
rev = s[::-1]
hd = (n-1)//2
tl = (n+3)//2
if s==rev:
    s_hd = s[:hd] 
    s_tl = s[tl-1:]
    h_rev = s_hd[::-1]
    t_rev = s_tl[::-1]
    #print(s_hd)
    #print(s_tl)
    #print(h_rev)
    #print(t_rev)
    if s_hd==h_rev:
        if s_tl==t_rev:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Measured memory_bytes: 38256
using System;

namespace atcorder
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            atcorder.Strange_Bank.Run();
        }
    }
    public class Strange_Bank
    {
        public Strange_Bank()
        {
        }
        public static void Run(){
            int N = int.Parse(Console.ReadLine());
            //動的に考えよう
            int[] list = new int[100001];
            int[] pow9 = new int[6];
            int[] pow6 = new int[6];
            for (int i = 0; i < 6;i++){
                pow9[i] = (int)Math.Pow(9, i + 1);
                pow6[i] = (int)Math.Pow(6, i + 1);
            }
            list[1] = 1;
            for (int i = 2; i <= N;i++){
                int min = 100000;
                for (int j = 0; j < 6;j++){
                    if (i - pow9[j] >= 0){
                        if(min>list[i - pow9[j]])min = list[i - pow9[j]];
                    } 
                    else break;
                }
                for (int j = 0; j < 6; j++)
                {
                    if (i - pow6[j] >= 0){
                        if (min > list[i - pow6[j]]) min = list[i - pow6[j]];
                    } 
                    else break;
                }
                if (min > list[i - 1]) min = list[i - 1];
                list[i] = min + 1;
            }
            Console.WriteLine(list[N]);
        }
    }
}


Measured memory_bytes: 11360