akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> void pr_vec(vector<T> &v, char ep=' '){int n=v.size();REP(ni,n){cout<<v[ni];if(ni!=n-1)cout<<ep;}cout<<endl;};
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void)
{
    string S,T;
    cin >> S >> T;
    int n = S.size();
    Yes(S==T.substr(0,n));
}

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

// Shrotening
#define fst first
#define snd second
#define pb push_back

// Loop
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define RFOR(i,a,b) for(long i=(a);i>=(b);--i)

#define REP(i,a) for(long i=0;i<(a);++i)
#define RREP(i,a) for(long i=(a);i>=0;--i)

#define EACH(i,a) for(auto (i)=(a).begin(),_END=(a).end();i!=_END;++i)
#define REACH(i,a) for(auto (i)=(a).rbegin(),_END=(a).rend();i!=_END;++i)

//Algorithm
#define ALL(a) (a).begin(), a.end()
#define RALL(a) (a).rbegin(), a.rend()
#define EXIST(a,x) ((a).find(x)!=(a).end())
#define SORT(a) std::sort((a).begin(), (a).end())
#define UNIQUE(a) std::sort((a).begin(), a.end()), a.erase(std::unique((a).begin(), a.end()), a.end());
#define SUM(a) std::accumulate((a).begin(), (a).end(), 0);

//Setting
#define OPT std::cin.tie(0);std::ios::sync_with_stdio(false);

//debug message
bool debug = true;
#define MSG(s)   if(debug){std::cout << s << std::endl;}
#define DEBUG(x) if(debug){std::cout << "debug(" << #x << "): " << x << std::endl;}

//alias
typedef long long LL;
typedef std::vector<char> VC;
typedef std::vector<int>  VI;
typedef std::vector<long> VL;
typedef std::vector<long long> VLL;

typedef std::vector< VC > VC2;
typedef std::vector< VI > VI2;
typedef std::vector< VL > VL2;
typedef std::vector< VLL > VLL2;

typedef std::pair<int,int> PII;

int N;
VI A, B, C;
int main() {
    std::cin >> N;
    A.resize(N);
    B.resize(N);
    C.resize(N);
    REP(i, N) {
        std::cin >> A[i];
    }
    REP(i, N) {
        std::cin >> B[i];
    }
    REP(i, N) {
        std::cin >> C[i];
    }

    SORT(A);
    SORT(B);
    SORT(C);

    auto _BGN_A = A.begin();
    auto _END_A = A.end();
    auto _BGN_B = B.begin();
    auto _END_B = B.end();
    auto _BGN_C = C.begin();
    auto _END_C = C.end();

    LL res = 0;
    auto bit = _BGN_B;
    while(bit != _END_B) {
        int b = *bit;

        auto bnext = std::upper_bound(ALL(B), b);
        LL bn = (int)(bnext - bit);

        auto ait = std::lower_bound(ALL(A), b);
        if(ait == _BGN_A) {
            bit = bnext;
            continue;
        }
        LL an = ait - _BGN_A;

        auto cit = std::upper_bound(ALL(C), b);
        if(cit == _END_C) {
            bit = bnext;
            continue;
        }
        LL cn = _END_C - cit;

        res += (an*bn*cn);

        bit = bnext;
    }

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

Measured memory_bytes: 1408
N, T = map(int, input().split())
root = [list(map(int, input().split())) for i in range(N)]
minc = 1001
for c, t in root:
    if t <= T:
        if c <= minc:
            minc = c
if minc == 1001:
    minc = 'TLE'
print(minc)

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

#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define EPS (1e-7)
#define INF 1e9

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int vx[]={0,1,0,-1};
int vy[]={1,0,-1,0};

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

const ll mod=1000000000+7;
const int MAX_N=50;

int N,K;
ll x[MAX_N];
ll y[MAX_N];

int main(){
	cin>>N>>K;
	pll p[N];
	REP(i,N){
		cin>>x[i]>>y[i];
		p[i]=pll(x[i],y[i]);
	}
	ll minS=LLONG_MAX;
	REP(i,N){
		REP(j,N){
			REP(k,N){
				REP(l,N){
					ll tx[4];
					ll ty[4];

					tx[0]=p[i].first;
					ty[0]=p[i].second;
					tx[1]=p[j].first;
					ty[1]=p[j].second;
					tx[2]=p[k].first;
					ty[2]=p[k].second;
					tx[3]=p[l].first;
					ty[3]=p[l].second;

					ll maxx=-LLONG_MAX,minx=LLONG_MAX,maxy=-LLONG_MAX,miny=LLONG_MAX;

					REP(t,4){
						if(tx[t]>maxx)maxx=tx[t];
						if(tx[t]<minx)minx=tx[t];
						if(ty[t]>maxy)maxy=ty[t];
						if(ty[t]<miny)miny=ty[t];
					}

					int count=0;
					REP(t,N){
						if(p[t].first>=minx && p[t].first<=maxx &&
							p[t].second>=miny && p[t].second<=maxy){
							count++;
						}
					}
					if(count>=K)minS=min(minS,(maxx-minx)*(maxy-miny));
				}
			}
		}
	}
	cout<<minS<<endl;
	return 0;
}

Measured memory_bytes: 256
#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>;

int N;
int A[100100];
std::map<int, int> ma2;

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

    std::cin >> N;

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

    for(int i=1;i<N;++i){
        int a = A[0], b = A[i], c = a ^ b;
        std::map<int, int> ma;

        ma[a] = N / 3;
        ma[b] += N / 3 + (N % 3 >= 1);
        ma[c] += N / 3 + (N % 3 >= 2);

        if(ma[a] <= ma2[a] &&
           ma[b] <= ma2[b] &&
           ma[c] <= ma2[c]){
            std::cout << "Yes" << std::endl;
            return 0;
        }
    }

    std::cout << "No" << std::endl;
}


Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,W;
    cin>>n>>W;
    vector <int> weight(n);
    vector <int> value(n);
    for(int i=0;i<n;i++){
        cin>>weight[i]>>value[i];
    }
    vector <vector <long long> > dp(n+1,vector <long long > (W+1,0));
   
    for(int i=0;i<n;i++){
        for(int j=0;j<=W;j++){
            dp[i+1][j]=max(dp[i][j],dp[i+1][j]);
            if(j+weight[i]<=W)
                dp[i+1][j+weight[i]]=max(dp[i+1][j+weight[i]],dp[i][j]+value[i]);
        }
    }
   cout<<dp[n][W]<<endl;
}

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

int main(){
    int h,w;
    cin>>h>>w;
    char v[50][50]={};
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cin>>v[i][j];
        }
    }
    bool isno=false;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(v[i][j]=='.'){continue;}
            if((j<w-1 && v[i][j+1]=='#') || (j>0 && v[i][j-1]=='#') || (i<h-1 && v[i+1][j]=='#') || (i>0 && v[i-1][j]=='#')){
                isno=false;
            }
            else{
                isno=true;
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;          
    return 0;
} 


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define getcx getchar_unlocked
#define MSV(A,a) memset(A, a, sizeof(A))
#define MP make_pair
#define PB push_back
#define INF (int(1e9))
#define INFL (LL(1e18))
#define EPS 1e-12
#define chkbit(s, b) (s & (1<<b))
#define setbit(s, b) (s |= (1<<b))
#define chk(a) cerr << endl << #a << " : " << a << endl
#define chk2(a,b) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << endl
#define chk3(a,b,c) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << endl
#define chk4(a,b,c,d) cerr << endl << #a << " : " << a << "\t" << #b << " : " << b << "\t" << #c << " : " << c << "\t" << #d << " : " << d << endl
#define rep(i, a, n) for(i=a;i<n;i++)
#define rev(i, a, n) for(i=a;i>=n;i--)
#define rep_itr(itr, c) for(itr = (c).begin(); itr != (c).end(); itr++)
#define MOD 1000000007
#define MAX 100005
#define in(x) scanf("%d", &x)
#define inl(x) scanf("%lld", &x)
#define in2(x, y) scanf("%d %d", &x, &y)
#define inl2(x, y) scanf("%lld %lld", &x, &y)
typedef pair<int, int> pi;
typedef pair<LL, LL> pl;
const char en = '\n';

vector<int> vec[MAX];
int visited[MAX];

void dfs(int curr) {

	visited[curr] = 1;
	int i;

	for(i = 0; i < vec[curr].size(); i++) {
		if(!visited[vec[curr][i]]) dfs(vec[curr][i]);
	}
}

int main() {

	int n, m,a,b,i, j, indeg[MAX], ans = 0;

	cin>>n>>m;

	while(m--) {
		cin>>a>>b;
		vec[a].PB(b);
		vec[b].PB(a);
	}

	for(i = 1; i <= n; i++) {
		if(!visited[i]) {
			ans++;
			dfs(i);
		}
	}

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

Measured memory_bytes: 9964
#include<bits/stdc++.h>
using namespace std ;
#define int long long
#define pb push_back
#define mp make_pair
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define sorta(v) stable_sort(v.begin(),v.end())
#define sortd(v) stable_sort(v.begin(),v.end(),greater <> ())
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define I(a) insert(a)
#define F first
#define S second
const int N=1e9+7;

int power(int x, int y){ 
    int res = 1; 
    while (y > 0){
        if (y & 1) 
            res = ((res) * (x));
        res %= N; 
        y = y >> 1; 
        x = ((x) * (x)); 
    }
    return res; 
}

int powmod(int a,int b,int n){
    int x=1, y=a; 
    while (b > 0) {
        if (b%2 == 1) {
            x = (x*y) % n;
        }
        y = (y*y) % n; 
        b /= 2;
    
    }
    return x % n;
}

int32_t main(){
    fastIO
    int t=1;
    //cin>>t;
    while(t--){
        int n;
        cin >> n;
     
        vector<double> p(n);
        for(int i=0; i<n; i++){
            cin >> p[i];
        }
     
        vector<vector<double>> dp(n+1 ,vector<double>(n+1));
        dp[0][0] = 1;
        for(int i=0; i<n; i++){
            for(int j=0; j<=i+1; j++){
                if(j >= 1) dp[i+1][j] += dp[i][j-1] * p[i];
                dp[i+1][j] += dp[i][j] * (1 - p[i]);
            }
        }
     
        double ans = 0;
        for(int i=n/2+1; i<=n; i++){
            ans += dp[n][i];
        }
        cout << fixed << setprecision(12) << ans;
    }
    return 0;
}

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

#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
using namespace std;

int main(){
	int n, x, y;	cin >> n >> x >> y;
	int d[n][n];
	int ans[n - 1] = {0};

	x--;
	y--;

	for( int i = 0; i < n; i++ ){
		for( int j = i + 1; j < n; j++ ){
			d[i][j] = min( j - i, abs( x - i ) + abs( y - j ) + 1 );
		}
	}

	for( int i = 0; i < n; i++ ){
		for( int j = i + 1; j < n; j++ ){
			ans[ d[i][j]-1 ]++;
		}
	}

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

	return 0;
}


Measured memory_bytes: 17328
loop do
  n = gets.to_i
  break if n == 0

  arr = gets.split(' ').map(&:to_i)
  _q = gets.to_i
  q_arr = gets.split(' ').map(&:to_i)

  count = 0
  q_arr.each do |a|
    count += 1 if arr.include?(a)
  end
  puts count
end

Measured memory_bytes: 8952
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

def main():
    N, M = map(int, input().split())
    u = UnionFind(N)

    for _ in range(M):
        a, b = map(int, input().split())
        u.union(a-1, b-1)

    res = 0
    for i in range(N):
        s = u.size(i)
        if res < s:
            res = s

    print(res)


if __name__ == "__main__":
    main()

Measured memory_bytes: 77940
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);cout.tie(0);
  string input;
  cin >> input;
  int cnt = 0;
  for(int i=0;i<input.length()/2;i++){
    if(input.at(i)!=input.at(input.length()-1-i)){
      cnt++;
    }
  }
  cout << cnt;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;


int main(void){
  int a,b;
  cin >> a >> b;
  int larger = max(a,b);
  int smaller = min(a,b);
  int k;
  cin >> k;
  vector<int> ret;

  for(int i = 1; i*i <= smaller; i++){
    if(smaller%i == 0){
      ret.push_back(i);
      if(i*i != smaller){
	ret.push_back(smaller/i);
      }
    }
  }
  // int length = ret.size();
  sort(ret.begin(), ret.end(), greater<int>());
  // for(int i = 0; i < ret.size(); i++){
  //   cout << ret[i] << endl;
  // }


  int counter = 0;
  int num = 0;
  while(counter < k){
    if(larger%ret[num] == 0){
      num++;
      counter++;
    } else {
      num++;
    }
  }

  cout << ret[num-1] << endl;
  return 0;
}

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

int main() {
  long ct;
  ct = 0;

  int N;
  cin >> N;
  vector <int> L(N);
  for (int i=0; i<N; i++) {
    cin >> L.at(i); 
  }

  sort(L.begin(), L.end());
  
  for (int i=0; i<N-2; i++) {
    for (int j=i+1; j<N-1; j++) {
      for (int k=j+1; k<N; k++) {
        if (L.at(i) + L.at(j) > L.at(k)){
          ct ++;
        }
      }
    }
  }
  cout << ct << endl;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
	"strings"
)

func main() {
	var intNum int
	fmt.Scanf("%d", &intNum)
	var textArr string
	fmt.Scanf("%s", &textArr)
	var arrA []string
	for _, a := range textArr {
		total := int(a) + intNum
		var tmpInt int
		switch {
		case total > 90:
			diff := total - 90
			if diff > 26 {
				surplus := diff % 26
				tmpInt = 64 + surplus
			} else {
				tmpInt = 64 + diff
			}
		default:
			tmpInt = total
		}
		arrA = append(arrA, string(tmpInt))
	}
	output := strings.Join(arrA, "")
	fmt.Println(output)
}


Measured memory_bytes: 1664
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    
    int g[102][102];
    int d[102];
    for(int i=1; i<=n; i++){
        for(int j=1; j<=n; j++){
            g[i][j] = 0;
        }
        d[i] = -1;
    }
    
    int u,k;
    for(int i=0; i<n; i++){
        cin>>u>>k;
        for(int j=0; j<k; j++){
            int v;
            cin>>v;
            g[u][v] = 1;
        }
    }

    int q[102];
    int h = 0, t = h + 1;
    q[h] = 1;
    d[ q[h] ] = 0;
    while(h != t){
        u = q[h++];
        for(int i=1; i<=n; i++){
            if(g[u][i] == 1 && d[i] == -1){
                g[u][i] = 0;
                d[i] = d[u]+1; 
                q[t++] = i;
              
            }
        }
    }
    
    for(int i=1; i<=n; i++){
        cout<< i << " " << d[i] << endl;
    }
    
    return 0;
}

Measured memory_bytes: 1196
#include <string>
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cmath>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
int main()
{
    int k;
    cin >> k;
    vector<int> table(k);
    rep(i,k) table[i] = -1;
    int next = 7 % k;
    int cnt = 1;
    while(table[next] == -1){
        if(next == 0){
            cout << cnt << endl;
            return 0;
        }
        table[next] = cnt;
        cnt++;
        next = (next * 10 + 7) % k;

    }
    cout << "-1" << endl;
}

Measured memory_bytes: 7164
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define mp make_pair
#define ff first
#define ss second
#define MAXN  1000005
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n,a,b;
    cin>>n>>a>>b;
    ll c=abs(a-b);
    if(c%2==0)
        cout<<"Alice";
    else cout<<"Borys";


    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
using namespace std;

class dictionary {

private:
	string* hashtable;
	long long table_size;
	int el_num;
	long long hash1(string);
	long long hash2(string);
	long long str_n(string);
public:
	dictionary(int n);
	void insert(string);
	bool find(string);
};
inline dictionary::dictionary(int n)
{
	hashtable= new string[n];
	if( !hashtable ){
		cout<<"Allocation Error"<<endl;
		abort();
	}

	table_size=n;
	el_num=0;
}
inline long long dictionary::hash1( string str )
{
	return str_n(str) % table_size;
}
inline long long dictionary::hash2( string str )
{
	return 1 + (str_n(str) % (table_size - 1));
}

inline long long dictionary::str_n( string str )
{

	long long str_n=0;

	for( unsigned int i=0; i<str.size(); i++ ){
		str_n = str_n * 5 + (long long)str[i] ; // str_n += (int)str[i] ?????????????????????????????????????????£???
	}
	return str_n;
}

		

inline void dictionary::insert( string str )
{
/*
	if( el_num >= table_size ){
		cout<<"????????\????????????????????????"<<endl;
		abort();
	}
	long long hash_v;
	int coltimes=0;
	do{
		hash_v = ( hash1(str) + hash2(str)*coltimes )%table_size ;
//		printf("I ( hash1, hash2, hash )(coltimes) = ( %d, %d, %d)(%d)\n", hash1(str), hash2(str), hash_v, coltimes );
	}while( (hashtable[ hash_v ].size() && hashtable[ hash_v ]!=str), coltimes++ );

	hashtable[ hash_v ]=str;
*/
	long long hash_v;

	for( int i=0; ; i++ ){
		hash_v= (hash1(str) + hash2(str)*i) % table_size;
		if( hashtable[ hash_v ] == str ){
			return;
		}else if( !hashtable[ hash_v ].size() ){
			hashtable[ hash_v ]=str;
			return;
		}
	}
}
inline bool dictionary::find( string str )
{
	long long hash_v;
	for( int i=0; ; i++ ){
		hash_v=(hash1(str) + hash2(str)*i) % table_size;
		if( hashtable[ hash_v ] == str ){
			return true;
		}else if( !hashtable[ hash_v ].size() ){
			return false;
		}
	}
}

int main()
{
	int n;
	scanf("%d", &n);
	char command[7], str[13];
	dictionary dic(1046527);

	for( int i=0; i<n; i++ ){
		scanf("%s %s", command, str);

		if( !strcmp(command, "insert") ){
			dic.insert(str);
		}else if ( !strcmp(command, "find") ){
			cout<<( dic.find(str)? "yes" : "no" )<<endl;
		}
	}
}

Measured memory_bytes: 22320
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define each(i, a) for(auto &i : a)
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x) ((y) < 0 || h <= (y) || (x) < 0 || w <= (x))
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause") //comment out this on AOJ.
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& elemnt : v)is >> elemnt; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }

int main() {
    init();

    ll x; cin >> x;
    cout << (x / 500LL) * 1000LL + ((x % 500LL) / 5LL) * 5LL << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define _GLIBCXX_DEBUG
int main()
{
    int n;
    cin>>n;
    vin h(n);
    rep(i,n)cin>>h[i];
    int sum=1;
    rep2(i,1,n){
        bool can=true;
        rep(j,i){
            if(h[j]>h[i]){
                can=false;
                break;
            }
        }
        if(can)sum++;
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cmath>
#include<string>
#include<algorithm>
#include<map>
#include<utility>
#include<cstdio>
#include<bits/stdc++.h>

using namespace std;
using ll = long long;
const long long INF = 1LL<<60;

typedef pair<ll,ll> Pair;

int main(){

ll N;
ll ans = 0;

cin >> N;

vector<ll> a(N+1);

for(ll i = 1;i <= N;++i) cin >> a[i];

for(ll i = 1;i <= N;++i){

if(i%2 == 1 && a[i]%2 == 1) ans++;

}

cout << ans << endl;

return 0;

}


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

int main()
{
  int x1,x2,x3,x4,x5;
  x1=1;
  x2=2;
  x3=3;
  x4=4;
  x5=5;
  int X1,X2,X3,X4,X5;
  cin >> X1 >> X2 >> X3 >> X4 >> X5;
  
  if(x1!=X1)
    cout << 1 << endl;
  if(x2!=X2)
    cout << 2 << endl;
  if(x3!=X3)
    cout << 3 << endl;
  if(x4!=X4)
    cout << 4 << endl;
  if(x5!=X5)
    cout << 5 << endl;
  
  return 0;
}

Measured memory_bytes: 3596
n = int(input())
pricies = list(map(int, input().split()))
m = 1000
stocks = 0
ask = 0

for i in range(n):
    price = pricies[i]
    isHigher = False
    isLower = False

    if stocks > 0:
        if price >= ask:
            m += price * stocks
            stocks = 0

    for j in range(i+1, n):
        if pricies[j] >= price:
            isHigher = True
            break
        else:
            isLower = True

    if isHigher and not isLower:
        stocks, m = stocks + m // price, m % price
        ask = price

print(m)

Measured memory_bytes: 9104
#include <stdio.h>
typedef long long ll;

int main(void) {
  ll n, l, ans;
  scanf("%lld%lld", &n, &l);
  ans = (l - 1) * n + n * (n + 1) / 2;
  if(l + n - 1 < 0) ans -= l + n - 1;
  else if(l > 0) ans -= l;
  printf("%lld", ans);
  return 0;
}

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


using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)
typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

const int  INF = 1 << 29;
const ll INFL = 1LL << 60;
const ll mod = 998244353;






int main() {

	string s;
	cin >> s;
	VS v = { "SUN","MON","TUE","WED","THU","FRI","SAT" };

	REP(i, 8) {
		if (s == v[i]) {
			cout << 7 - i << endl;
			return 0;
		}
	}

	
}

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

using ull = unsigned long long;
struct RollingHash_Mersenne {
	const ull MASK30 = (1ULL << 30) - 1;
	const ull MASK31 = (1ULL << 31) - 1;
	const ull MASK61 = (1ULL << 61) - 1;
	const ull MOD = MASK61;
	const ull POSITIVIZER = MOD << 2;
	vector<ull> hash, power;

	RollingHash_Mersenne(const string &s, ull base = 10007) {
		int sz = (int)s.size();
		hash.assign(sz + 1, 0);
		power.assign(sz + 1, 0);
		power[0] = 1;
		for(int i = 0; i < sz; i++) {
			power[i + 1] = CalcMod(Mul(power[i], base));
			hash[i + 1] = CalcMod(Mul(hash[i], base) + s[i]);
		}
	}

	template <class T>
	RollingHash_Mersenne(const vector<T> &v, ull base = 10007) {
		int sz = (int)v.size();
		hash.assign(sz + 1, 0);
		power.assign(sz + 1, 0);
		power[0] = 1;
		for(int i = 0; i < sz; i++) {
			power[i + 1] = CalcMod(Mul(power[i], base));
			hash[i + 1] = CalcMod(Mul(hash[i], base) + v[i]);
		}
	}

	// a * b と mod が等しい数を返す
	// 結果は (1UL << 63) + 3 - (1UL << 31) * 3 以下
	ull Mul(ull a, ull b) const {
		ull au = a >> 31;
		ull ad = a & MASK31;
		ull bu = b >> 31;
		ull bd = b & MASK31;
		ull mid = ad * bu + au * bd;
		ull midu = mid >> 30;
		ull midd = mid & MASK30;
		return au * bu * 2 + midu + (midd << 31) + ad * bd;
	}

	// mod 2^61-1を計算する
	ull CalcMod(ull x) const {
		ull xu = x >> 61;
		ull xd = x & MASK61;
		ull res = xu + xd;
		if(res >= MOD) res -= MOD;
		return res;
	}

	ull get(int l, int r) const { return CalcMod(hash[r] + POSITIVIZER - Mul(hash[l], power[r - l])); }

	ull connect(ull h1, ull h2, ull h2len) const { return CalcMod(Mul(h1, power[h2len]) + h2); }

	// Longest Common Prefix
	int LCP(int l_this, int r_this, RollingHash_Mersenne &other, int l_other, int r_other) {
		int len = min(r_this - l_this, r_other - l_other);
		int low = 0, high = len + 1;
		while(high - low > 1) {
			int mid = (low + high) / 2;
			if(get(l_this, l_this + mid) == other.get(l_other, l_other + mid))
				low = mid;
			else
				high = mid;
		}
		return low;
	}
};

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

int main() {
	int n;
	string s;
	cin >> n >> s;

	RollingHash_Mersenne rh(s, rand() % 10007 + 3);
	int res = 0;
	rep(i, n) {
		rep(j, n) {
			if(j <= i) continue;
			int a = rh.LCP(i, n, rh, j, n);
			//	cout << a << endl;
			res = max(res, min(a, j - i));
		}
	}
	cout << res << endl;
}

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

struct BipartiteGraph
{
	vector<int> leftMatch, rightMatch, lab, seen;
	vector<vector <int>> a;
	int m, n;

	BipartiteGraph() {}
	BipartiteGraph(int m, int n)
	{
		this -> m = m;
		this -> n = n;
		a = vector<vector<int>>(m);
		leftMatch = vector<int>(n, -1);
		rightMatch = vector<int>(m, -1);
		lab = vector<int>(m, -1);
		seen = vector<int>(n, 0);
	}

	void addEdge(int x, int y)
	{
		a[x].push_back(y);
	}

	int findMatch(int x)
	{
		for (int i = 0; i < int(a[x].size()); i++)
		{
			int y = a[x][i];
			if (seen[y]) continue;
			seen[y] = 1;
			if (leftMatch[y] < 0 || findMatch(leftMatch[y]))
			{
				leftMatch[y] = x; rightMatch[x] = y;
				return 1;
			}
		}
		return 0;
	}

	int maxMatching()
	{
		for (int i = 0; i < m; i++) lab[i] = i;
		while (1)
		{
			int lastM = m;
			for (int i = 0; i < n; i++) seen[i] = 0;
			for (int i = m - 1; i >= 0; i--)
				if (findMatch(lab[i])) lab[i] = lab[--m];
			if (lastM == m) break;
		}
		int match = 0;
		for (int i = 0; i < n; i++) match += (leftMatch[i] >= 0);
		return match;
	}
};

int main()
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int m, n, a[100][100], b[100][100];
  cin >> m >> n;
  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++)
    {
      cin >> a[i][j];
      --a[i][j];
    }

  for (int col = 0; col < n; col++)
  {
    BipartiteGraph g(m, m);
    for (int i = 0; i < m; i++)
      for (int j = 0; j < n; j++)
        if (a[i][j] >= 0)
          g.addEdge(i, a[i][j] / n);

    assert(g.maxMatching() == m);
    for (int i = 0; i < m; i++)
      for (int j = 0; j < n; j++)
        if (a[i][j] >= 0 && a[i][j] / n == g.rightMatch[i])
        {
          b[i][col] = a[i][j];
          a[i][j] = -1;
          break;
        }
  }

  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++)
      cout << b[i][j] + 1 << " \n"[j == n - 1];

  for (int j = 0; j < n; j++)
    for (int i = 0; i < m; i++)
      for (int ii = i + 1; ii < m; ii++)
        if (b[i][j] > b[ii][j])
          swap(b[i][j], b[ii][j]);

  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++)
      cout << b[i][j] + 1 << " \n"[j == n - 1];
}


Measured memory_bytes: 512
#include <stdio.h>

int main(void)
{
	int count=0,a,b,c;
	
	scanf("%d %d %d",&a,&b,&c);
	
	count += 3;
	if(a==b)
	{
		count--;
	}
	if(a==c)
	{
		count--;
	}
	if(b==c)
	{
		count--;
	}
	if(count==0)
	{
		count++;
	}
	printf("%d",count);
	
	return 0;
}

Measured memory_bytes: 128
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

//scanf("%d",&x);
//printf("%d",x);
//for(i=0;i<N;i++){  }
//if( == ){  }else{  }

int main()
{
	int n;

	scanf("%d", &n);
	
	int c = 1110 - n;
	

	
		printf("%d",c);
	

	






}


Measured memory_bytes: 128
#include <stdio.h>
int main(void){

  int n;
  int s[1000];
  int i;
  int score;
  int min;
  int max;
  while(1){

    score = 0;
    min = 1000;
    max = 0;

    scanf("%d",&n);
    if( n == 0 )break;
    
    for( i = 0 ; i < n ; i++ ){
      scanf("%d",&s[i]);
      if( min > s[i] ) min = s[i];
      if( max < s[i] ) max = s[i];
      score += s[i]; 
    }
    score = score - min - max;
    score = score / ( n - 2 );
    printf("%d\n", score); 
  }
  return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#define INF (1LL<<50)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
ll h[100005];
ll ans[100005];

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%lld",&h[i]);
	}
	int ans=1;
	int now=1;
	for(int i=n-2;i>=0;i--){
		if(h[i]>=h[i+1]){
			now++;
		}else{
			now=1;
		}
		ans=max(ans,now);
	}
	printf("%d\n",ans-1);
	return 0;
}


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

#define I inline
#define fi first
#define se second
#define R register
#define LL long long
#define mp make_pair
#define reg register int
#define pii pair<int,int>
#define fo(i, a, b) for(reg i = a; i <= b; i++)
#define fd(i, a, b) for(reg i = a; i >= b; i--)
#define cr const reg&
using namespace std;
const int inf = 2147483647;
const int N = 1e5 + 1;

I int _max(cr x, cr y) {return x > y ? x : y;}
I int _min(cr x, cr y) {return x < y ? x : y;}
I int read() {
	reg x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9') {if(ch == '-') f = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
	return x * f;
}
I void ptt(cr x) {if(x >= 10) ptt(x / 10); putchar(x % 10 + '0');}
I void put(cr x) {x < 0 ? putchar('-'), ptt(-x) : ptt(x);}
I void pr1(cr x) {put(x), putchar(' ');}
I void pr2(cr x) {put(x), puts("");}

bool ok[N];int cnt[N];
    int main()
	{
        int n=read(),m=read();
        int A=0,B=0;
        while(m--)
        {
            int now=read();string s;cin>>s;
            if(s=="AC")
            {
                if(!ok[now]) {ok[now]=1,A++,B+=cnt[now];}
            }
            else
            {
                cnt[now]++;
            }
        }pr1(A),pr2(B);
	}



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

using namespace std;

int main() {
    int digits[4];
    int v;

    cin >> v;
    for (int i = 3; i >= 0; i--) {
        digits[i] = v % 10;
        v /= 10;
    }

    for (int i = 0; i < 8; i++) {
        int result = digits[0];
        for (int j = 0; j < 3; j++) {
            if (i & (1<<j)) {
                result += digits[j+1];
            } else {
                result -= digits[j+1];
            }
        }
        if (result == 7) {
            string ans = "";
            ans += '0' + digits[0];
            for (int j = 0; j < 3; j++) {
                if (i & (1<<j)) {
                    ans += '+';
                } else {
                    ans += '-';
                }
                ans += '0' + digits[j+1];
            }
            ans += "=7";
            cout << ans << endl;
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast","unroll-loops")
#pragma GCC push_options
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
// #include <xmmintrin.h>
// #include <immintrin.h>
using namespace::std;
__attribute__((constructor))void init(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
// typedef mp::number<mp::cpp_dec_float<0>> cdouble;
// typedef mp::cpp_int cint;
template<typename T>using pbds=__gnu_pbds::tree<T,__gnu_pbds::null_type,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T>using pbds_map=__gnu_pbds::tree<T,T,less<T>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>;
template<typename T,typename E>using hash_map=__gnu_pbds::gp_hash_table<T,E>;
template<typename T>using pqueue =__gnu_pbds::priority_queue<T, less<T>,__gnu_pbds::rc_binomial_heap_tag>;
typedef long long lint;
#define INF (1LL<<60)
#define IINF (1<<30)
#define EPS (1e-10)
#define MOD 1000000007LL
typedef vector<lint> vec;
typedef vector<vector<lint>> mat;
typedef vector<string> svec;
typedef vector<vector<string>> smat;
template<typename T>inline void numout(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i<INF/2?i:"INF";f=1;}cout<<endl;}
template<typename T>inline void numout2(T t){for(auto i:t)numout(i);}
template<typename T>inline void output(T t){bool f=0;for(auto i:t){cout<<(f?" ":"")<<i;f=1;}cout<<endl;}
template<typename T>inline void output2(T t){for(auto i:t)output(i);}
template<typename T>inline void _output(T t){bool f=0;for(lint i=0;i<t.size();i++){cout<<f?"":" "<<t[i];f=1;}cout<<endl;}
template<typename T>inline void _output2(T t){for(lint i=0;i<t.size();i++)output(t[i]);}
#define rep(i,n) for(lint i=0;i<lint(n);++i)
#define repi(i,a,b) for(lint i=lint(a);i<(lint)(b);++i)
#define rrep(i,n) for(lint i=lint(n)-1;i>=0;--i)
#define rrepi(i,a,b) for(lint i=lint(b)-1;i>=lint(a);--i)
#define irep(i) for(lint i=0;;++i)
#define all(n) begin(n),end(n)
#define dist(a,b,c,d) sqrt(pow(a-c,2)+pow(b-d,2))
inline lint gcd(lint A,lint B){return B?gcd(B,A%B):A;}
inline lint lcm(lint A,lint B){return A/gcd(A,B)*B;}
// inline cint cgcd(cint A,cint B){return B?cgcd(B,A%B):A;}
// inline cint clcm(cint A,cint B){return A/cgcd(A,B)*B;}
inline bool chmin(auto& s,const auto& t){bool res=s>t;s=min(s,t);return res;}
inline bool chmax(auto& s,const auto& t){bool res=s<t;s=max(s,t);return res;}
const vector<lint> dx={1,0,-1,0,1,1,-1,-1};
const vector<lint> dy={0,1,0,-1,1,-1,1,-1};
#define SUM(v) accumulate(all(v),0LL)
auto call=[&](auto f,auto... args){return f(f,args...);};

int main(){
    lint h,n;
    cin>>h>>n;
    vec a(n);
    rep(i,n)cin>>a[i];
    if(SUM(a)>=h)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 1024
#include<stdio.h>
char s[2048];
int head[2048],last[4096],to[4096],cnt=0;
void add(int u,int v)
{
	cnt++;
	last[cnt]=head[u];
	head[u]=cnt;
	to[cnt]=v;
}
int f[2048],g[2048],size[2048];
void dfs(int u,int fa)
{
	f[u]=0;
	g[u]=0;
	size[u]=s[u]-'0';
	for(int i=head[u];i;i=last[i])
	{
		int v=to[i];
		if(v==fa)
		{
			continue;
		}
		dfs(v,u);
		size[u]+=size[v];
		int l1=f[v]+size[v];
		int r1=g[v]+size[v];
		int l2=f[u];
		int r2=g[u];
		g[u]=r1+r2;
		if(l2>r1)
		{
			f[u]=l2-r1;
		}
		else if(l1>r2)
		{
			f[u]=l1-r2;
		}
		else
		{
			f[u]=(g[u]&1);
		}
	}
}
int main()
{
	int n;
	scanf("%d",&n);
	scanf("%s",s+1);
	for(int i=1;i<n;i++)
	{
		int u,v;
		scanf("%d%d",&u,&v);
		add(u,v);
		add(v,u);
	}
	int ans=1000000000;
	for(int i=1;i<=n;i++)
	{
		dfs(i,0);
		if(f[i])
		{
			continue;
		}
		if(g[i]<ans)
		{
			ans=g[i];
		}
	}
	if(ans>100000000)
	{
		printf("-1\n");
		return 0;
	}
	printf("%d\n",ans>>1);
	return 0;
}

Measured memory_bytes: 256
from bisect import bisect_left

N = int(input())
*L, = map(int, input().split())
L.sort()

ans = 0
for i in range(N):
    for j in range(i+1, N):
        a, b = L[i], L[j]
        ans += (bisect_left(L, a+b)-(j+1))

print(ans)

Measured memory_bytes: 3188
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
    int i,j;
    char str1[101],str2[101],chold;

    scanf("%s",str1);
    scanf("%s",str2);

    for(i=0;i<=strlen(str1);i++){
        for(j=strlen(str1)-1;j>0;j--){
            chold=str1[j];
            str1[j]=str1[j-1];
            str1[j-1]=chold;
        }
        if(strcmp(str1,str2)==0){
            printf("Yes\n");
            exit(0);
        }
    }

    printf("No\n");

    return 0;
}





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

typedef long long ll;

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

    int g[10][10] = {};
    for(int i=0; i<M; i++) {
	int a,b;
	cin >> a >> b;
	g[a][b] = 1;
	g[b][a] = 1;
    }
    
    vector<int> a(N-1);
    for(int i=2; i<=N; i++) {
	a[i-2] = i;
    }

    ll ans = 0;
    do{
	int u=1,v = a[0];
	if( g[u][v] != 1 ) continue;
	bool f = true;
	for(int i=1; i<a.size(); i++) {
	    u = v; v = a[i];
	    if( g[u][v] != 1 ) f = false;
	}
	if(f){
	    ans++;
	}
    }while(next_permutation(a.begin(), a.end()));
    cout << ans << endl;
    
    
    
    return 0;
}


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

class Program
{
    static void Main(string[] args)
    {
        var input = Console.ReadLine();

        if(input == "ABC")
        {
            Console.WriteLine("ARC");
        }
        else
        {
            Console.WriteLine("ABC");
        }
        Console.ReadLine();

    }

}



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

int main(){
    
    int a, b, c;
    int ans = 0;
    int div;
    
    cin >> a >> b >> c;
    
    div = a;
    
    while( div <= b ){
        
        if( c % div == 0)
            ans++;
            
        div++;
        
    }
    
    cout << ans << endl;
    
    return 0;
    
}


Measured memory_bytes: 3112
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner cin = new Scanner(System.in);
		long X = cin.nextLong();
		long deposit = 100,count = 0;
		
		while(deposit<X) {
			deposit += deposit/100;
			count++;
		}
		
		System.out.println(count);
		return;
		
		
	}

}

Measured memory_bytes: 27072
# AtCoder Beginner Contest 174



class Coodinate (object):
    """Coodinate object
    This class contains infomation about the coodinates.
    Each instance can have up to 3-dimensional(x,y,z) space coodinates.
    
    params
    ------------------------------
    x : int or floot ,default 0
    y : int or floot ,default 0
    z : int or floot ,default 0


    This class have following methods.
    ------------------------------
    distance : Calculate the straight-line distance between 2 points in Euclidean space.
    midpoint : Calculate the midpoint(halfway) between 2 points.
    manhattan_distance : Calculate the distance between 2 points that is sum of the absolute values their Cartesian coordinates.
    """

    def __init__(self,x=0,y=0,z=0):
        self.x=x
        self.y=y
        self.z=z


    def __str__(self):
        if self.z==0:
            if self.y==0:
                return "( {} )".format(self.x)
            else :
                return "( {} , {} )".format(self.x,self.y)
        else:
            return "( {} , {} , {} )".format(self.x,self.y,self.z)    


    def distance(self,other):
        """Calculate the straight-line distance between 2 points in Euclidean space.

        params
        ----------
        self : Coodinate object
        other : Coodinate object

        return
        ----------
        distance : floot

        """
        x_diff_sq=(self.x-other.x)**2
        y_diff_sq=(self.y-other.y)**2
        z_diff_sq=(self.z-other.z)**2
        return (x_diff_sq + y_diff_sq +z_diff_sq)**0.5
    

    def midpoint(self,other):
        """Calculate the midpoint(halfway) between 2 points.

        params
        ----------
        self : Coodinate object
        other : Coodinate object

        return
        ----------
        midpoint : tupul
        
        """
        x_midpoint=(self.x+other.x)/2
        y_midpoint=(self.y+other.y)/2
        z_midpoint=(self.z+other.z)/2
        if self.z == other.z ==0 :
            if self.y == other.y==0:
                return(x_midpoint)
            else:
                return(x_midpoint,y_midpoint) 
        return(x_midpoint,y_midpoint,z_midpoint)

    def manhattan_distance(self,other):
        """Calculate the distance between 2 points that is sum of the absolute values their Cartesian coordinates.

        params
        ----------
        self : Coodinate object
        other : Coodinate object

        return
        ----------
        manhattan_distance : floot

        """

        x_diff_abs=abs(self.x - other.x)
        y_diff_abs=abs(self.y - other.y)
        z_diff_abs=abs(self.z - other.z)
        return(x_diff_abs + y_diff_abs + z_diff_abs)


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

O=Coodinate()

ans=0

for i in range (N):
    x,y=map(int,input().split())
    p=Coodinate(x,y)
    if Coodinate.distance(O,p)<=D:
        ans+=1
    else:
        pass

print(ans)


Measured memory_bytes: 9768
#include<iostream>
#include<algorithm>
#define INF 210000
using namespace std;
int c[INF];
int main(){
    int n,a,b;
    for(int i=0;i<INF;i++)c[i]=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a>>b;
        c[a+b]++;
    }
    for(int i=0;i<INF-1;i++){
        c[i+1]+=c[i]/2;
        if(c[i]%2)cout<<i<<" 0"<<endl;
    }
    return 0;
}

Measured memory_bytes: 3856
n, m = map(int, input().split())
cakes = [list(map(int, input().split())) for _ in range(n)]

ans = 0
for i in range(8):
    a = []
    for x, y, z in cakes:
        if i & 1 << 0: x *= -1
        if i & 1 << 1: y *= -1
        if i & 1 << 2: z *= -1
        a.append(x + y + z)
    a.sort(reverse=True)
    ans = max(ans, sum(a[:m]))

print(ans)


Measured memory_bytes: 3316
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import java.util.StringTokenizer;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

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

        final List<Integer> list = IntStream.range(0, n)
            .mapToObj(i -> scanner.nextInt())
            .collect(Collectors.toList());

        final int sum = list.stream()
            .mapToInt(Integer::intValue)
            .sum();

        final List<Integer> dividable = IntStream.range(0, sum)
            .map(i -> sum - i)
            .filter(i -> sum % i == 0)
            .boxed().collect(Collectors.toList());

        for (final int value : dividable) {
            final List<Integer> mods = list.stream()
                .filter(i -> i % value != 0)
                .map(i -> i % value)
                .sorted()
                .collect(Collectors.toList());
            if (mods.size() == 0) {
                System.out.println(value);
                return;
            }

            final int[] fromLeft = new int[mods.size()];
            fromLeft[0] = mods.get(0);
            for (int i = 1; i < mods.size(); i++) {
                fromLeft[i] = fromLeft[i - 1] + mods.get(i);
            }

            final int[] fromRight = new int[mods.size()];
            fromRight[mods.size() - 1] = value - mods.get(mods.size() - 1);
            for (int i = mods.size() - 1; i > 0; i--) {
                fromRight[i - 1] = fromRight[i] + value - mods.get(i - 1);
            }

            for (int i = 0; i < mods.size() - 1; i++) {
                if (fromLeft[i] == fromRight[i + 1]) {
                    if (fromLeft[i] <= k) {
                        System.out.println(value);
                        return;
                    } else {
                        break;
                    }
                }
            }
        }
    }

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

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

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

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

Measured memory_bytes: 56492