akhauriyash/Code-Regression huggingface dataset:
// finish date: 2018/07/25
#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<double> vd;
typedef vector<vector<double>> vvd;
typedef vector<vector<vector<double>>> vvvd;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, pair<int, int>> plii;
const int bigmod = 1000000007;
const int INF = 1050000000;
const long long INFll = 100000000000000000;


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

    double w;
    FOR(i, 1, 3501) {
        FOR(j, 1, 3501) {
            if(4 * i * j - N * (i + j)==0) continue;
            w = ((ll) i * j * N) / (4 * i * j - N * (i + j));
//            if (i == 3498 && j == 3498) {
//                cout << 1.0 / i + 1.0 / j + 1.0 / w << endl;
//            }
            if ((double) ((ll) i * j * N) / (4 * i * j - N * (i + j)) - w == 0 && w > 0) {
//                cout << (double) (i * j * N) / (4 * i * j - N * (i + j)) << endl;
//                cout << 1.0 / i + 1.0 / j + 1.0 / w << " " << 4.0 / N << endl;
                printf("%d %d %d\n", i, j, (int)w);
                return 0;
            }
        }
    }

    return 0;
}



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

int main() {
	int n;
  	cin>>n;
  	float a[n];
  	for(int i=0;i<n;i++) cin>>a[i];
  	float ans=0;
  	for(int i=0;i<n;i++) ans+=1/a[i];
  	cout<<1/ans<<endl;
}


Measured memory_bytes: 256
S = input()

def next_tasai(S):
  if S == 'zyxwvutsrqponmlkjihgfedcba':
    return -1
  
  A = 'abcdefghijklmnopqrstuvwxyz'
  Aset = set([a for a in A])
  Sset = set([s for s in S])
  
  if (Aset-Sset):
    l = min(Aset-Sset)
    answer = S+l
    return answer
  else:
    i=-1
    while True:
      if S[i] < S[i-1]:
        i-=1
      else:
        key = min([s for s in S[i-1:] if s>S[i-1]])
        return S[:i-1] + key
      
print(next_tasai(S))

Measured memory_bytes: 3064
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    else:
        for t in range(h):
            if 0 < t < h - 1:
                for y in range(w):
                    if 0 < y < w - 1:
                        print(".",end="")
                    else:
                        print("#",end="")
                print()
            else:
                for y in range(w):
                    print("#",end="")
                print()
        print()


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

int main() {
    string S;
    cin >> S;
    int cnt = 0;
    for (int i = 0; i < S.size() / 2; i++) {
        if (S[i] != S[S.size() - i - 1]) cnt++;
    }
    cout << cnt << endl;
    return (0);
}


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

int main()
{

    int a;
    int b;
    scanf("%d %d", &a,&b);
    int c;
    int sum=0;
    for (int i = 0; i < b; i++)
    {
        scanf("%d", &c);
        sum = c + sum;
    }

    if(sum>a)
        printf("-1");
    else
        printf("%d", a - sum);
    printf("\n");
}

Measured memory_bytes: 2152
#include<bits/stdc++.h>
using namespace std;
#define ll long long                                    // long long省略
#define pb push_back                                    // push_back省略
#define mp make_pair                                    // make_pair省略
#define fi first                                        // first省略
#define se second                                       // second省略
#define itn int                                         // int誤字保険
#define count cout                                      // cout誤字保険
#define vecotr vector                                   // vector誤字保険
#define ednl endl                                       // endl誤字保険
#define opt() cin.tie(0); ios::sync_with_stdio(false)   // 入出力速度改善

#define rep(i,l,r) for(ll i=(l);i<(r);i++)               // 範囲[l, r)で刻み1のfor文(順方向)
#define repp(i,l,r,k) for(ll i=(l);i<(r);i+=(k))         // 範囲[l, r)で刻みkのfor文(順方向)
#define rrep(i,l,r) for(ll i=(r-1);i>=(l);i--)           // 範囲[l, r)で刻み1のfor文(逆方向)
#define rrepp(i,l,r,k) for(ll i=(r-1);i>=(l);i-=(k))     // 範囲[l, r)で刻みkのfor文(逆方向)
#define all(x) (x).begin(), (x).end()                   // vectorのポインタ位置指定用
#define max(p,q)((p)>(q)?(p):(q))                       // max拡張
#define min(p,q)((p)<(q)?(p):(q))                       // min拡張
#define bit(n,m)(((n)>>(m))&1)                          // 変数nのm番目のbitを取り出す

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

int dy[]={0, 1, 0, -1};                                 // 4方向近傍
int dx[]={1, 0, -1, 0};                                 // 4方向近傍


int main(){
	ll n,t;cin>>n>>t;
    ll c[n],u[n];rep(i,0,n)cin>>c[i]>>u[i];
    ll ans=100000000;
    rep(i,0,n)if(t>=u[i] && ans>c[i]) ans=c[i];
    if(ans==100000000) cout<<"TLE"<<ednl;
  	else cout<<ans<<ednl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
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++)

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

  int max = 1;

  int power;
  int power_of;
  for (int i = 1; i < 35; i++)
  {
    power_of = 2;
    if (i == 1){
      continue;
    }
    while(N >= pow(i, power_of)){
      if (max < pow(i, power_of)){
        max = pow(i, power_of);
      }
      power_of += 1;
    }
  }

  cout << max << endl;
  
}

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

#define rep(i,a,b) for(int i=a;i<(b);i++)
#define trav(a,x) for(auto & a :x)
#define all(x) begin(x),end(x)
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define vpii vector<pii>
#define F first
#define S second

typedef long long ll;
typedef vector<int> vi;


const int M=1e9+7;

/*
ll powermod(ll x, ll y, ll p)  
{  
    ll res = 1;    
    x = x % p; // Update x if it is more than or  
                // equal to p 
   
    if (x == 0) return 0; // In case x is divisible by p; 
  
    while (y > 0)  
    {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}  
*/


void solve()
{ 

int n;
cin>>n;

int a;

unordered_map<int,int> m;
ll sum=0;
for(int i=0;i<n;i++)
{
cin>>a;
m[a]++;
sum+=a;
}
int q;
cin>>q;

int  x,y;

for(int i=0;i<q;i++)
{
	cin>>x>>y;
	
 if(m.find(x)!=m.end())
 {
 	auto itr=m.find(x);
      
	if(itr->first<y)
	
	sum+=itr->second*(y-itr->first);
	
	else
	
	sum-=itr->second*(itr->first-y);
	
	m[y]+=itr->second;
	
	m.erase(x);
	 	
 }	
 cout<<sum<<"\n";
}

}

int main() 
{   
    ios::sync_with_stdio(0);
	cin.tie(0);
  
   int test=1;
   //cin>>test;
   while(test--)
    {
	  solve();
	  cout<<"\n";
    }
  return 0;
}

Measured memory_bytes: 6660
#include <bits/stdc++.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
using namespace std;
 
typedef long long int lli;
typedef pair<int, int> ii;
typedef pair<int, lli> il;
template<class T>bool chmax(T &a, const T &b) { if( a < b ) { a = b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) { if( b < a ) { a = b; return 1; } return 0;}
 
#ifdef LOCAL
	#define eprintf(...) printf(__VA_ARGS__)
#else 
	#define eprintf(...) 1
#endif
 
#define ROUNDUP(a, b) 		( ((a) + ((b) - 1) ) / b)
#define SET_ZERO(a)	 		( memset((a), 0, sizeof(a)))
#define SET_NUM_ARRAY(a,b)	( memset((a), b, sizeof(a)))
 
int main() {
	int N, M;
	scanf("%d %d", &N, &M);
 
	int a[2000], b[2000];
	lli c[2000];
 
	for (int i = 0; i < M; i++) {
		scanf("%d %d %lld", &a[i], &b[i], &c[i]);
		c[i] = -c[i];
	}
 
	lli dist[1000];
	for (int i = 0;i < N; i++) {
		dist[i] = 1LL << 50;
	}
 
	dist[0] = 0;
	for (int loop = 0; loop < N - 1; loop++) {
		for (int i = 0; i < M; i++) {
			if (dist[a[i] - 1] == 1LL << 50) continue;
 
			if (dist[b[i] - 1] > dist[a[i] - 1] + c[i]) {
				dist[b[i] - 1] = dist[a[i] - 1] + c[i];
			}
		}
	}
	lli ans = dist[N - 1];
 
	bool ne[1000];
	for (int i = 0; i < N; i++) {
		ne[i] = false;
	}
 
	for (int loop = 0; loop < N; loop++) {
		for (int i = 0; i < M; i++) {
			if (dist[a[i] - 1] == 1LL << 50) continue;
 
			if (dist[b[i] - 1] > dist[a[i] - 1] + c[i]) {
				dist[b[i] - 1] = dist[a[i] - 1] + c[i];
				ne[b[i] - 1] = true;
			}
 
			if (ne[a[i] - 1]) {
				ne[b[i] - 1] = true;
			}
		}
	}
 
	if (ne[N - 1]) printf("inf\n");
	else printf("%lld\n", -ans);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double PI = acos(-1.0);
const double EPS = 1e-10;

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; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};


void solve(){
    string S;
    cin >> S;
    bool A = false; bool B = false;
    REP(i,3){
        if(S[i] == 'A') A = true;
        else B = true;
    }
    if(A && B) cout << "Yes" << endl;
    else cout << "No" << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    // int T; cin >> T; REP(t,T) solve();
}


Measured memory_bytes: 256
from collections import Counter
N, K = map(int, input().split())
A = list(map(int,input().split()))
C = Counter(A)
C = list(reversed(sorted(C.items(), key=lambda x: x[1])))

if len(C)<=K:
    print(0)
    exit(0)

ans = 0
for k in range(K,len(C)):
    ans += C[k][1]
print(ans) 

Measured memory_bytes: 40856
#include<bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=100000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};


int main() {

	ll n;
	ll a[101];
	ll b=0,c=0,d=0,e=0,f=0,g=0,h=0,m=0,o1=0,o2=0;
	ll total1=0;
	ll total2=0;
	ll total3=0;

	cin>>n;

	rep(i,n){
		cin>>a[i];
		if(a[i]<=399){
			b=1;
		}else if(a[i]<=799){
			c=1;
		}else if(a[i]<=1199){
			d=1;
		}else if(a[i]<=1599){
			e=1;
		}else if(a[i]<=1999){
			f=1;
		}else if(a[i]<=2399){
			g=1;
		}else if(a[i]<=2799){
			h=1;
		}else if(a[i]<=3199){
			m=1;
		}
		if(a[i]>=3200){
			if(n==1){
				o2=1;
			}
			o1++;
		}
	}

	total2=b+c+d+e+f+g+h+m;
	total3=b+c+d+e+f+g+h+m+o1;
	if(total2==0){
		o2=1;
	}
	total1=b+c+d+e+f+g+h+m+o2;

	cout<<total1<<" "<<total3<<endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back
 
typedef long long ll;
typedef pair<ll, int> ll_i;

ll med3(ll x, ll y, ll z) {
    if (x < y) {
        if (y < z) return y; else if (z < x) return x; else return z;
    } else {
        if (z < y) return y; else if (x < z) return x; else return z;
    }
}

void quicksort(ll a[], int left, int right) {
    if (left < right) {
        int i = left, j = right;
        ll tmp, pivot = med3(a[i], a[i + (j - i) / 2], a[j]);
        while (1) { 
            while (a[i] < pivot) i++;
            while (pivot < a[j]) j--;
            if (i >= j) break;
            tmp = a[i]; a[i] = a[j]; a[j] = tmp;
            i++; j--;
        }
        quicksort(a, left, i - 1);
        quicksort(a, j + 1, right);
    }
}

ll median(ll a[], ll N) {
    quicksort(a, 0, N-1);
    if (N % 2 == 1) {
        return a[(N - 1) / 2];
    } else {
        return (a[(N / 2) - 1] + a[N / 2]) / 2;
    }
}

int main() {
    ll N, ans = 0;
    cin >> N;
    ll a[N], b[N];
    rep(i, N){
        cin>>a[i];
        b[i] = a[i] - (i+1);
    }
    ll bb = median(b, N);
    rep(i, N){
        ans += abs(b[i] - bb);
    }
    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

bool comp_year (vector <int> a, vector <int> b, bool flag)
{
	int size = a.size();
	int i;

	for (i = 0; i < size; ++i){
		if (a[i] != b[i] ){
			return a[i] < b[i];
		} // end if
	} // end for

	if (flag ){
		return true;
	} // end if

	return false;
}
	
int main()
{
	const int ad[][3] = { {INT_MIN, INT_MIN, INT_MIN },
				{ 1868,  9, 8  },
				{ 1912,  7, 30 },
				{ 1926, 12, 25 },
				{ 1989,  1,  8 },
				{INT_MAX, INT_MAX, INT_MAX }
			};

	const string gengo[] = {
					"pre-meiji",
					"meiji",
					"taisho",
					"showa",
					"heisei"
			};

	int size = sizeof(ad)/sizeof(ad[0]);
	int len  = sizeof(ad[0])/sizeof(ad[0][0]);
	vector < vector <int> > years (size, vector <int> (len, 0 ) ); 
	string str = "";
	int i,j;
	
	for (i = 0; i < size; ++i){
		for (j = 0; j < len; ++j){
			years[i][j] = ad[i][j];
		} // end for
	} // end for

	while (getline (cin, str ) ){

		vector<int> curr (len, 0 );	// year, month, day order
		stringstream ss(str);

		for (i = 0; i < len; ++i){
			ss >> curr[i];
		} // end for
		
		int match = -1;

		for (i = 0; i < size - 1; ++i ){
			if (comp_year (years[i], curr, true) && comp_year (curr, years[i+1], false ) ){
				match = i;
				break;
			} // end if
		} // end for

		if (match == 0){
			cout << gengo[0] << endl;
		}else{
			int g = curr[0] - years[match][0] + 1;
			cout << gengo[match] << ' ' << g << ' ' << curr[1] << ' ' << curr[2] << endl;
		} // end if

	} // end loop

	return 0;
}

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

int main() {
	int sum=0, n;
	for (int i = 0; i < 4; i++) {
		cin >> n;
		sum = sum + n;
	}
	cout << sum / 60 << endl;
	cout << sum - sum / 60 * 60 << endl;
	return 0;
}

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

int main() {
    int a[1000]{};
    int b[1000]{};
    int N, M;
    cin >> N >> M;
    while (N != 0 && M != 0) {
        for (int i = 0; i < N; i++) {
            cin >> a[i + 1];
        }
        for (int i = 0; i < M; i++) {
            cin >> b[i];
        }
        int t = 1;
        for (int i = 0; i < M; i++) {
            t += b[i];
            if (t >= N || t + a[t] >= N) {
                cout << i + 1 << "\n";
                break;
            }
            t += a[t];
        }
        
        cin >> N >> M;
    }    
    return 0;
}


Measured memory_bytes: 3024
void main()
{
    long n = rdElem;
    long[] a = new long[n], b = new long[n];
    foreach (i; 0 .. n)
    {
        rdVals(a[i], b[i]);
    }

    a.sort!"a < b";
    b.sort!"a < b";

    long h = n >> 1;
    if (n & 1) writeln(b[h] - a[h] + 1);
    else writeln(b[h] + b[h-1] - a[h] - a[h-1] + 1);
}

enum long mod = 10L^^9 + 7;
enum long inf = 1L << 60;
enum double eps = 1.0e-9;

T rdElem(T = long)()
if (!is(T == struct))
{
    return readln.chomp.to!T;
}

alias rdStr = rdElem!string;
alias rdDchar = rdElem!(dchar[]);

T rdElem(T)()
if (is(T == struct))
{
    T result;
    string[] input = rdRow!string;
    assert(T.tupleof.length == input.length);
    foreach (i, ref x; result.tupleof)
    {
        x = input[i].to!(typeof(x));
    }
    return result;
}

T[] rdRow(T = long)()
{
    return readln.split.to!(T[]);
}

T[] rdCol(T = long)(long col)
{
    return iota(col).map!(x => rdElem!T).array;
}

T[][] rdMat(T = long)(long col)
{
    return iota(col).map!(x => rdRow!T).array;
}

void rdVals(T...)(ref T data)
{
    string[] input = rdRow!string;
    assert(data.length == input.length);
    foreach (i, ref x; data)
    {
        x = input[i].to!(typeof(x));
    }
}

void wrMat(T = long)(T[][] mat)
{
    foreach (row; mat)
    {
        foreach (j, compo; row)
        {
            compo.write;
            if (j == row.length - 1) writeln;
            else " ".write;
        }
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.mathspecial;
import std.traits;
import std.container;
import std.functional;
import std.typecons;
import std.ascii;
import std.uni;
import core.bitop;

Measured memory_bytes: 14116
#include <stdio.h>
int main(void)
{
	int A;
	int B;
	int C;
	
	scanf("%d %d %d",&A,&B,&C);
	
	if(1 <= A && B <= 500 && 1 <= C <= 1000){
	if(C <= B + A){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	}
	return(0);
}

Measured memory_bytes: 128
from collections import defaultdict

def t():
    return 0

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

for i in range(int(input())):
    d[input()] += 1
# print(d)

print('AC x', d['AC'])
print('WA x', d['WA'])
print('TLE x', d['TLE'])
print('RE x', d['RE'])

Measured memory_bytes: 69844
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define MOD (1000000007l)
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)

using namespace std;

ll A[25][25];

void solve() {
  ll N;
  cin >> N;
  rep (i, N) rep (j, N) cin >> A[i][j];
  vector<ll> count(2097152);
  count[0] = 1;
  rep (i, N) {
    vector<ll> aaa(2097152);
    rep (it, 2097152) {
      if (count[it] == 0) continue;
      ll tmp = it;
      rep (j, N) {
        if (A[i][j] and ((tmp >> j) & 1) == 0) {
          ll foo = tmp;
          foo += 1 << j;
          aaa[foo] += count[it];
          aaa[foo] %= MOD;
        }
      }
    }
    count = aaa;
  }
  ll a = 1;
  a <<= N;
  a -= 1;
  cout << count[a] << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  cout << fixed;
  solve();
  return 0;
}


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

int main(){
    string s;
    cin >> s;
    string t = "CODEFESTIVAL2016";
    int ans = 0;
    for (int i = 0; i < 16; i++) {
        if (s[i] != t[i]) ans++;
    }
    cout << ans << endl;
}

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

int main() {
  string str;
  cin >> str;
  
  string reverse_str = "";
  for (int i = 0; i < str.size(); i++) {
    reverse_str += str.at(str.size() - (i + 1));
  }
  
  // 条件1の判定
  int str_size1 = str.size() - 1;
  int loop1 = str.size() / 2, match_cnt1 = 0;
  for (int i = 0; i < loop1; i++) {
    if (str.at(i) == str.at(str_size1 - i)) {
      match_cnt1++;
    }
  }
  if (loop1 != match_cnt1) {
    //cout << "1" << endl;
    cout << "No" << endl;
    return 0;
  }
  
  // 条件2の判定
  if (str.size() > 3) {
    int str_size2 = (str.size() - 1) / 2;
    int loop2 = str_size2 - 1, match_cnt2 = 0;
    for (int i = 0; i < loop2; i++) {
      if (str.at(i) == str.at(str_size2 - (i + 1))) {
        match_cnt2++;
      }
    }
    if (loop2 != match_cnt2) {
      //cout << "2" << endl;
      cout << "No" << endl;
      return 0;
    }
  }
  
  // 条件3の判定  
  if (str.size() > 3) {
    int str_size3 = (str.size() - 1) / 2;
    int loop3 = str_size3 - 1, match_cnt3 = 0;
    
    for (int i = 0; i < loop3; i++) {
      if (reverse_str.at(i) == reverse_str.at(str_size3 - (i + 1))) {
        match_cnt3++;
      }
    }
    if (loop3 != match_cnt3) {
      //cout << "3" << endl;
      cout << "No" << endl;
      return 0;
    }
  }
  
  cout << "Yes" << endl;
}

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

const ll MOD=1e9+7;
ll mod(ll x){
    ll res=x%MOD;
    return res+(res<0?MOD:0);
}
vector<ll> pows(ll a,int x){
    vector<ll> res(x+1);
    res[0]=1;
    a=mod(a);
    for(ll i=1; i<=x; i++)res[i]=mod(a*res[i-1]);
    return res;
}

int main(){
    string l;
    cin>>l;
    ll ans=1;
    int sz=l.size();
    vector<ll> dp1(sz),dp2(sz);//1:1-used
    dp1[0]=1;
    dp2[0]=2;
    for(int i=1; i<l.size(); i++){
        if(l[i]=='0'){
            dp1[i]=mod(3*dp1[i-1]);
            dp2[i]=dp2[i-1];
        }
        else{
            dp1[i]=mod(3*dp1[i-1]+dp2[i-1]);
            dp2[i]=mod(2*dp2[i-1]);
        }
    }
    cout<<mod(dp1[sz-1]+dp2[sz-1]);
    return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF INT_MAX/3

ll n;
ll a[101010],b[101010],c[101010];
ll cntb[101010];

int main(){
  cin>>n;
  rep(i,n)cin>>a[i];
  rep(i,n)cin>>b[i];
  rep(i,n)cin>>c[i];
  sort(a,a+n); sort(b,b+n); sort(c,c+n);
  rep(i,n){
    ll idx=upper_bound(c,c+n,b[i])-c;
    cntb[i]=n-idx;
  }
  for(ll i=n-1;i>=0;i--){
    cntb[i]+=cntb[i+1];
  }
  ll res=0;
  rep(i,n){
    ll idx=upper_bound(b,b+n,a[i])-b;
    res+=cntb[idx];
  }
  cout<<res<<endl;
	return 0;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
ll n,p[5001],c[5001],k,muchie[5001],maxim=-1e9;
vector<ll> ciclu;
void dfs(int nod)
{
    if(ciclu.empty())
        ciclu.push_back(muchie[nod]);
    else
    {
        if(muchie[nod]==ciclu.front())
            return;
        ciclu.push_back(muchie[nod]);
    }
    dfs(muchie[nod]);
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        cin>>p[i];
        muchie[i]=p[i];
    }
    int pozitiv=0;
    for(int i=1;i<=n;i++)
    {
        cin>>c[i];
        if(c[i]>0)
            pozitiv=1;
    }
    if(!pozitiv)
    {
        for(int i=1;i<=n;i++)
            maxim=max(maxim,c[i]);
        cout<<maxim;
        return 0;
    }
    for(int i=1;i<=n;i++)
    {
        ciclu.clear();
        dfs(i);
        ll suma=0;
        ll maxsum=0;
        for(auto j:ciclu)
            suma+=c[j];
        int nrop=0;
        ll s=0;
        for(int j=0;j<ciclu.size();j++)
            {
                ll sum=0;
                s+=c[ciclu[j]];
                nrop=j+1;
                if(k>=nrop)
                {
                    sum=s;
                    if(suma>0)
                        sum+=((k-nrop)/ciclu.size())*suma;
                    maxim=max(maxim,sum);
                }
                else
                    break;
            }
    }
    cout<<maxim;
    return 0;
}


Measured memory_bytes: 3876
//#pragma GCC optimize("-O3")
/*
				C++
				encoding: UTF-8
				Last Modified: 28/Dec/19 06:08:37 PM
*/

#include <bits/stdc++.h>
#ifdef H4wk3ye
#	include <prettypr.hpp>
#endif

using namespace std;

// clang-format off

#define		int                    long long
#define		ve                     vector
#define		pb                     push_back
#define		endl                   "\n"
#define		ff                     first
#define		ss                     second
#define		pii                    pair<int, int>
#define		len(v)                 (int)v.size()
#define		all(v)                 v.begin(), v.end()
#define		reset(a, b)            memset(a, b, sizeof(a));
#define		fr(i, s, n)            for (int i = s ; i < n ; ++i)
#define		dfr(i, s, n)           for (int i = s ; i > n ; --i)

template < typename T > void pr (const T& t) {
    cout << t << "\n";
}

template < typename T, typename U, typename... ARGS >
void pr (const T& t, const U& u, const ARGS&... args) {
    cout << t << " ";
    pr (u, args...);
}

// clang-format on


signed main () {
	ios_base::sync_with_stdio (false), cin.tie (nullptr);
	int n, a, b;
	cin >> n >> a >> b;
	int ans = 2e18;
	if ((a & 1) == (b & 1)) {
		ans = abs (a - b) / 2;
	} else {
		int y = min (a, b);
		ans = y + abs (abs (y - max (a, b)) - 1) / 2;

		y = max (a, b);

		ans = min (ans, (n - y + 1) + (abs (abs ((n - y) + min (a, b)) - n)) / 2);
	}
	int p = n - a;
	int q = n - b;

	int x = min (max (p, q), max (a - 1, b - 1));

	ans = min (ans, x);
	pr (ans);

	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int n = sc.nextInt();
        int count = 0;
        int[] arr = new int[n + 1];
        int[][][] dp = new int[101][101][101];
        for(int i = 1; i < 101; i++){
            for(int j = 1; j < 101; j++){
                for(int k = 1; k < 101; k++){
                    int curr = i * i + j * j + k * k + i * j + j * k + i * k;
                    dp[i][j][k] = curr;
                    if(curr <= n)
                        arr[curr]++;
                }
            }
        }
        for(int i = 1; i <= n; i++)
            System.out.println(arr[i]);
    }
}

Measured memory_bytes: 43216
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Scanner;

public class Main{
	static Scanner sc;

	static String S;

	public static void main(String[] args) throws Exception {
		//InputStream in = new FileInputStream("src/input.txt");
		InputStream in = System.in;
		//PrintStream out = new PrintStream("src/output.txt");

		//System.setOut(out);

		sc = new Scanner(in);

		S = sc.next();

		int answer = 0;
		for(int i = 0; i < S.length(); i++){
			if(S.charAt(i) == '1'){
				answer++;
			}
		}

		System.out.println(answer);
	}
}

Measured memory_bytes: 21716
import sys
from bisect import *
from collections import *
from copy import deepcopy
from heapq import *
from itertools import *
from math import *
from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

def main():
    """ main """
    W,H,x,y = map(int, input().split())
    a = W*H/2
    b = 0
    if x*2 == W and y*2 == H:
        b = 1
    print(a,b)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3828
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 100000000000000000
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template
struct edge {int to; ll cost;};
struct node {int pos; ll cost;};
bool operator < (const node &a, const node &b){
    return a.cost > b.cost;
}

vector<ll> dijkstra(vector<vector<edge>> &G, int root){
    vector<ll> ret(G.size(), inf);
    priority_queue<node> pq;
    pq.push({root, 0});
    while (!pq.empty()) {
        node t = pq.top();
        pq.pop();
        
        if (ret[t.pos] == inf) ret[t.pos] = t.cost;
        else continue;
        
        for (edge e : G[t.pos]) {
            pq.push({e.to, t.cost + e.cost});
        }
    }
    return ret;
}


int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N;
    cin >> N;
    vector<vector<edge>> G(N);
    rep(i, N - 1){
        int a, b; ll c;
        cin >> a >> b >> c;
        a--, b--;
        G[a].pb({b, c});
        G[b].pb({a, c});
    }
    int Q, K;
    cin >> Q >> K;
    K--;
    auto D = dijkstra(G, K);
    rep(i, Q){
        int x, y;
        cin >> x >> y;
        x--, y--;
        output(D[x] + D[y]);
    }
    
    return 0;
}

Measured memory_bytes: 11120
#include <bits/stdc++.h>
using namespace std;
void print() {
    cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail) != 0)
        cout << " ";
    print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
    for (auto &a : vec) {
        cout << a;
        if (&a != &vec.back())
            cout << " ";
    }
    cout << endl;
}
template <class T>
void print(vector<vector<T>> &df) {
    for (auto &vec : df) {
        print(vec);
    }
}
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define xrep(i, a, b) for (int i = int(a); i < int(b); ++i)
using ll = long long;
const int INF = 1001001001;

int main() {
    int N, K;
    cin >> N >> K;
    int h;
    int cnt = 0;
    rep(i, N) {
        cin >> h;
        if (h>=K) ++cnt;
    }
    cout << cnt << endl;




    return 0;
}

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

int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i, n) cin >> v[i];
  sort(v.begin(), v.end());
  double cur = v[0];
  for (int i = 1; i < n; i++) {
    cur = (cur+v[i]) / 2;
  }
  printf("%.7f", cur);
  return 0;
}

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

int main() {
// 変数の宣言
    string str;

// 入力受付
    cin >> str;

// 7であるかどうか判定
    if (str[0] == '7') { /* 1文字目を判定 */
        cout << "Yes" << endl;
    }
    else if (str[1] == '7') { /* 2文字目を判定 */
        cout << "Yes" << endl;
    }
    else if (str[2] == '7') { /* 3文字目を判定 */
        cout << "Yes" << endl;
    }
    else{ /* 7が含まれない場合「No」と出力 */
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3604
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

template <typename TYPE>
void print_vec(const vector<TYPE>& v){
	for(int i=0; i<v.size(); i++){
		cout << v[i] << " ";
	}
	cout << endl;
}

template <typename TYPE>
void print_vec2(const vector<vector<TYPE>>& v){
  cout << endl; cout << "       ";
  for(int i=0; i<v[0].size(); i++) cout << i << "   "; 
  cout << endl;
	for(int i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(int j=0; j<v[i].size(); j++){
			if(v[i][j] == 0) cout << "\x1B[0m" << v[i][j] << "   ";
      else cout << "\x1B[31m" << v[i][j] << "   ";//https://stackoverrun.com/ja/q/12618775
		}
		cout << "\x1B[0m" << endl;
	}
}


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

	ll num = 0;
	ll yen = 1000;
	
	for(int i=0; i<N; i++){
		if(i!=N-1 && A[i] > A[i+1]){
			yen += num * A[i];
			num = 0;
		}
		if(i!=N-1 && A[i] < A[i+1]){
			num += yen /A[i];
			yen -= yen/A[i] * A[i];
		}
		if(i==N-1) yen += num * A[i];
		// cout << " i : "<< i << " yen: " << yen << " num : " << num << endl;
	}

	cout << yen << endl;

	return 0;
}



Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define ll long long int
#define M 1000000007
#define mod 998244353
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pi pair<ll,ll>
using namespace std;
const ll N=500010;

ll sgt[4*N];

void update(ll st,ll en,ll pos,ll idx,ll val)
{
    if(st==en)
    {
        sgt[pos]=val;
        return;
    }
    ll mid=(st+en)/2;
    if(idx>=st&&idx<=mid){update(st,mid,2*pos+1,idx,val);}
    else{update(mid+1,en,2*pos+2,idx,val);}
    sgt[pos]=max(sgt[2*pos+1],sgt[2*pos+2]);
}

ll range(ll st,ll en,ll pos,ll l,ll r)
{
    if(st>r||en<l){return INT_MIN;}
    if(st>=l&&en<=r){return sgt[pos];}
    ll mid=(st+en)/2;
    return max(range(st,mid,2*pos+1,l,r),range(mid+1,en,2*pos+2,l,r));
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	ll n;
	cin>>n;
	vector<pi> ar;
	for(ll i=0;i<n;++i)
    {
        ll x,d;
        cin>>x>>d;
        ar.pb(mp(x,x+d-1));
    }
    sort(ar.begin(),ar.end());

    ll dp[n+1];
    dp[n]=1;

    ll l[n],r[n];
    for(ll i=0;i<n;++i){
        l[i]=ar[i].first;
        r[i]=ar[i].second;
    }

    ll idx[n];
    for(ll i=n-1;i>=0;--i)
    {
        ll ii=upper_bound(l,l+n,r[i])-l;
        idx[i]=max(i,range(0,n-1,0,i+1,ii-1));
        update(0,n-1,0,i,idx[i]);
    }
    for(ll i=n-1;i>=0;--i)
    {
        dp[i]=(dp[i+1]+dp[idx[i]+1])%mod;
    }

    cout<<dp[0];

	return(0);
}


Measured memory_bytes: 16876
N = int(input())
S = input()
ans = 0
for i in range(N - 1):
    count = 0
    table = {}
    for s in S[:i]:
        if s in S[i:]:
            table[s] = 1
    ans = max(ans, sum([1 for _ in table.keys()]))
print(ans)

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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

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

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    int N;
    cin >> N;
    map<int, int> mp;
    set<int> st;
    vector<int> v(N);
    for(int i = 0; i < N; ++i) {
        cin >> v[i];
        ++mp[v[i]];
        st.insert(v[i]);
    }

    LL sum = 0;
    for(auto it = st.begin(); it != st.end(); ++it) {
        LL t = mp[*it];
        sum += t * (t - 1) / 2;

    }

    for(int i = 0; i < N; ++i) {
        cout << sum - mp[v[i]] + 1 << endl;

    }
    return 0;
}



Measured memory_bytes: 15872
#include<iostream>
#include<string>
using namespace std;
int main(){
	int n,s[12],c[12];
	while(true){
	cin>>n;
	if(n==0)
		break;
	for(int i=0;i<n;i++)
		c[i]=1;
	for(int i=0;i<n;i++){
		cin>>s[i];
		for(int j=0;j<i;j++){
			if(s[i]==s[j])
				c[i]++,c[j]++;
		}
	}
	int ans=0;
	while(true){
		bool t=true;
		for(int i=0;i<n;i++){
			if(s[i]!=c[i])
				t=false;
			s[i]=c[i];
			c[i]=1;
		}
		if(t==true)
			break;
		for(int i=0;i<n;i++){
		    for(int j=0;j<i;j++){
			    if(s[i]==s[j])
				    c[i]++,c[j]++;
		    }
	    }
		ans++;
	}
	cout<<ans<<endl;
	cout<<s[0];
	for(int i=1;i<n;i++)
		cout<<" "<<s[i];
	cout<<endl;
	}
	return 0;
}

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

int main()
{
    int n, m;
    string cipher[256], t;
    bool b = 0;

    cin >> n;

    for( int i = 0; i < n; i++ )
        cin >> cipher[i];

    cin >> m;

    for( int i = 0; i < m; i++ )
    {
        cin >> t;
        bool judge = false;
        for( int j = 0; j < n; j++ )
            if( t == cipher[j] )
            {
                if( b == 0 )
                    cout << "Opened by " << t << endl;
                else
                    cout << "Closed by " << t << endl;
                b = !b;
                judge = true;
            }
        if( !judge )
            cout << "Unknown " << t << endl;
    }
    
    return 0;
}


Measured memory_bytes: 3240
def d_disjoint_set_of_common_divisors():
    A, B = [int(i) for i in input().split()]
    if A == 1 or B == 1:
        return 1

    def prime_factorization_dict(n):
        """nを素因数分解したときの素数の辞書"""
        from collections import defaultdict
        if n == 1:
            return {2: 0}  # 1は素数の0乗の積とみなす
        i, table = 2, defaultdict(int)
        while i**2 <= n:
            while n % i == 0:
                table[i] += 1
                n //= i
            i += 1
        if n > 1:
            table[n] = 1
        return set(table.keys())
    a_primekey = prime_factorization_dict(A)
    b_primekey = prime_factorization_dict(B)
    ans = []
    for a in a_primekey:
        if a in b_primekey:
            ans.append(a)
    return len(ans) + 1

print(d_disjoint_set_of_common_divisors())

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

using namespace std;

#define mx 200005
#define int long long
#define pii pair <int, int>
#define piii pair <int, pii>
#define f first
#define s second
#define mod 1000000007

int ara[mx], vis[mx];

int32_t main(){
    //freopen("in.txt", "r", stdin);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, k;
    while(cin >> n >> k){
        memset(ara, 0, sizeof ara);
        memset(vis, 0, sizeof vis);
        for(int i=1;i<=n;i++){
            ara[i%k]++;
        }
        int ans = 0;
        for(int i=1;i<=n;i++){
            if(vis[i%k]) continue;
            vis[i%k] = 1;
            int a = i%k;
            int b = k - a;
            if(b==k) b = 0;
            if(a!=b) continue;
            ans += ara[a]*ara[a]*ara[b];
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3328
use std::io;
use std::str::FromStr;

fn main() {
    let stdin = io::stdin();

    let mut buf = String::new();
    stdin.read_line(&mut buf).ok();

    let mut it = buf.split_whitespace().map(|n| i64::from_str(n).unwrap());
    let a = it.next().unwrap();

    let mut buf = String::new();
    stdin.read_line(&mut buf).ok();

    let mut it = buf.split_whitespace().map(|n| i64::from_str(n).unwrap());
    let b = it.next().unwrap();

    let mut buf = String::new();
    stdin.read_line(&mut buf).ok();

    let mut it = buf.split_whitespace().map(|n| i64::from_str(n).unwrap());
    let c = it.next().unwrap();


    println!("{}", (a + b) * c / 2);
}


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

int main() {
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    while(a>=b){
        b <<= 1;
        k--;
    }
    while(b>=c){
        c <<= 1;
        k--;
    }
    if (k >= 0) puts("Yes");
    else
        puts("No");
}


Measured memory_bytes: 3552
N=int(input())
L=[N]
i=2
while True :
    if L[i-2] %2 == 0 :
        A=L[i-2]/2
    elif L[i-2] %2 == 1 :
        A=L[i-2]*3+1
    
    
    if A in L :
        print(i)
        break
    L.append(A)
    i+=1

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

namespace AtCoder_ABC089_A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int a = int.Parse(str[0]);
            int b = int.Parse(str[1]);
            int x = int.Parse(str[2]);

            Console.WriteLine((a <= x && x <= a + b)? "YES" : "NO");
        }
    }
}


Measured memory_bytes: 11092
N = int(input())
con = [input() for i in range(N)]
C = [0,0,0,0]
for s in con:
    if(s == "AC"):
        C[0] +=1
    if(s == "WA"):
        C[1] +=1
    if(s == "TLE"):
        C[2] +=1
    if(s == "RE"):
        C[3] +=1
print("AC x",C[0])
print("WA x",C[1])
print("TLE x",C[2])
print("RE x",C[3])
 

Measured memory_bytes: 16244
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;
typedef long long ll;
typedef pair<int, int> Pint;
typedef pair<ll, ll> Pll;
#define rep(begin, i, end) for (ll i = begin; i < (ll)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 998244353;

int main()
{
    ll W, H, N;
    cin >> W >> H >> N;
    vector<vector<ll>> grid(H, vector<ll>(W, 1));
    ll x, y, a;
    rep(0, i, N)
    {
        cin >> x >> y >> a;
        if (a == 1)
        {
            ll s = 0, g = x;
            rep(0, i, H)
            {
                rep(s, j, g)
                {
                    grid.at(i).at(j) = 0;
                }
            }
        }
        if (a == 2)
        {
            ll s = x, g = W;
            rep(0, i, H)
            {
                rep(s, j, g)
                {
                    grid.at(i).at(j) = 0;
                }
            }
        }
        if (a == 3)
        {
            ll s = 0, g = y;
            rep(s, i, g)
            {
                rep(0, j, W)
                {
                    grid.at(i).at(j) = 0;
                }
            }
        }
        if (a == 4)
        {
            ll s = y, g = H;
            rep(s, i, g)
            {
                rep(0, j, W)
                {
                    grid.at(i).at(j) = 0;
                }
            }
        }
    }

    ll ans = 0;
    rep(0, i, H)
    {
        rep(0, j, W)
        {
            ans += grid.at(i).at(j);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 3696
#include <iostream>
using namespace std;
typedef long long ll;
#define MAX_N 110000
#define MAX_M 110000
#define DIV 1000000007

int main() {
  ll N, M;
  cin >> N >> M;
  if (abs(N - M) >= 2) {
    cout << 0 << endl;
    return 0;
  }

  ll FacN[MAX_N], FacM[MAX_M];
  if (N < M) M = N + 1;
  FacN[0] = 1, FacN[1] = 1;
  FacM[0] = 1, FacM[1] = 1;
  for (ll i = 2; i <= N; i++) {
    FacN[i] = FacN[i - 1] * i % DIV;
  }

  for (ll i = 2; i <= M; i++) {
    FacM[i] = FacM[i - 1] * i % DIV;
  }

  if (abs(N - M) == 1)
    cout << FacN[N] * FacM[M] % DIV << endl;
  else if (N == M)
    cout << ((FacN[N] * FacM[M] % DIV) * 2) % DIV << endl;

  return 0;
}

Measured memory_bytes: 1792
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int min=0,max=0,n,num;
    long sum=0L;
    n = sc.nextInt();
    for(int i=1;i <= n;i++){
      num = sc.nextInt();
      if(i == 1){
        min = num;
        max = num;
      }else{
        if(num < min)min = num;
        if(num > max)max = num;
      }
      sum += num;
    }
    System.out.println(min + " " + max + " " + sum);
    sc.close();
  }
}



Measured memory_bytes: 42104
#include<cstdio>
#include<iostream>
#include<ctime>
#include<string.h>
#include<algorithm>
#include<cmath>
using namespace std;
int cnt[100005];
int main()
{
	int n,ans=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		int t;
		scanf("%d",&t);
		if(t==0)
		{
			cnt[1]++;
			cnt[0]++;
		}
		else
		{
			cnt[t+1]++;
			cnt[t]++;
			cnt[t-1]++;
		}
	}
	for(int i=0;i<100005;i++)
	{
		if(ans<cnt[i])
		{
			ans=cnt[i];
		}
	}
	printf("%d",ans);
}


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

#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define REP(i,n) FOR(i,0,n)
#define REPD(i,n) FOR(i,n-1,0)
#define PB push_back
#define mod 1000000007


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,m;
    cin>>n>>m;
    int a[n];
    float sum=0;
    REP(i,n)
    {
        cin>>a[i];
        sum+=a[i];
    }
    sum=sum/(4*m);
    int c=0;
    REP(i,n)
    {
        if(a[i]>=sum)
        ++c;
    }
    if(c>=m)
    cout<<"Yes";
    else
    cout<<"No";
    
    
    
    return 0;   
}

Measured memory_bytes: 3644
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;

int main(){
  int N;
  cin>>N;
  vector<ll> X(N),L(N);
  rep(i,N) cin>>X[i]>>L[i];

  vector<pair<ll,ll>> v;
  for(int i=0;i<N;i++) v.push_back(mkp(X[i]-L[i],X[i]+L[i]));
  sort(v.begin(),v.end());

  int ans=0;
  ll lef=v[0].first;
  ll rig=v[0].second;
  for(int i=1;i<N;i++){
    ll l=v[i].first;
    ll r=v[i].second;
    if(rig<=l){
      ans++;
      lef=l;
      rig=r;
    }else{
      if(r<rig) rig=r;
    }
  }

  ans++;

  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 3956
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;

class Myon
{
    public Myon() { }
    public static int Main()
    {
        new Myon().calc();
        return 0;
    }

    Scanner cin;
    Func cin2;
    void calc()
    {
        cin = new Scanner();
        cin2 = new Func();
        int N=cin.nextInt();
        if(N==2)
        {
          int A=cin.nextInt();
          int B=cin.nextInt();
          Console.WriteLine(A+B);
        }
        else Console.WriteLine("Hello World");
        
    }
}



class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Answer
{
    public static void Int2DArrayAns(int[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }//Answer.IntArrayAns(x);
    public static void Char2DArrayAns(char[,]x,char c)
    {
        for(int i=0;i<x.GetLength(0);i++)
        {
            for(int j=0;j<x.GetLength(1)-1;j++)
            {
                Console.Write(x[i,j]);
                Console.Write(c);
            }
            Console.WriteLine(x[i,x.GetLength(1)-1]);
        }
    }
}

class Func
{
    public long GCDLong(long a, long b)
    {
        while(a!=0)
        {
          long t=a;
          a=b%a;
          b= t;
        }
      
        return b;        
    }
}



Measured memory_bytes: 11092
#include <stdio.h>

int main(void)
{
	int a, b, c;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);

	if(a<b){
		if(b<c){
			printf("Yes\n");
		}else{
			printf("No\n");
		}
	}else{
		printf("No\n");
	}
}

Measured memory_bytes: 1812