akhauriyash/Code-Regression huggingface dataset:
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,n) for(ll i##_len=(n) ,i=i##_len-1;i>=0;--i)
#define repi(i,a,b) for(ll i=ll(a);i<=ll(b);++i)
#define ALL(f,x,...) ([&](decltype((x)) xxxx) { return (f)(begin(xxxx), end(xxxx), ## __VA_ARGS__); })(x)
#define lim 1000000007ll
#include<bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = std::pair<ll,ll>;
using namespace std;
template<class T>T 
chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T>T 
chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template <class T> T 
gcd(T a, T b){if (a < b) {a ^= b;b ^= a;a ^= b;} return b ? gcd(b, a % b) : a;}
template <class T> T 
lcm(T a, T b){return a * b / gcd(a, b);}
vector<char> 
string_to_vector_char(const string& input){vector<char> out(input.length());rep(i,input.length()){out[i]=input[i];}return out;}
map<char,int> 
count_same_elements(const vector<char>& v){map<char,int>cmap; for_each(v.begin(),v.end(),[&cmap](int x){cmap[x]++;}); return cmap; }
template<class A,class B> vector<B> 
mapf(const vector<A>& v,const function<B(A)>& func){vector<B> v_(v.size());rep(i,v.size()){ v_[i]=func(v[i]); }return v_;}
template<class A,class B> vector<B> 
adjacent_map(const vector<A>& v,const function<B(A,A)>& func){vector<B> v_(v.size()-1);rep(i,v.size()-1){ v_[i]=func(v[i+1],v[i]); }return v_;}
template<class A> bool
all_of(const vector<A>& v){bool flag=true;rep(i,v.size()){ if(v[i]<1){flag=false;}; }return flag;}
template<class A> bool
any_of(const vector<A>& v){bool flag=false;rep(i,v.size()){ if(v[i]>0){flag=true; break;}; }return flag;}
template<class A> bool
none_of(const vector<A>& v){bool flag=true;rep(i,v.size()){ if(v[i]>0){flag=false;}; }return flag;}
template<class T,class U>
void msg_with_compare(T A,T B,U A_greater_B,U A_eq_B,U A_less_B){
    if(A==B){cout<<A_eq_B<<"\n";}else if(A>B){cout<<A_greater_B<<"\n";}else{cout<<A_less_B<<"\n";}}
template<class B,class T>
void msg_with_boolean(B A,T true_msg,T false_msg){cout<< ( A? true_msg:false_msg);}
template<class B,class T>
void msg_with_boolean(B A1,B A2,T both_true_msg,T true_false_msg,T false_true_msg,T both_false_msg){
    if(A1){if(A2){cout<<both_true_msg;}else{cout<<true_false_msg;}
    }else{if(A2){cout<<false_true_msg;}else{cout<<both_false_msg;}}
}
template<class T>
void scan_vector(long long size,vector<T>& vector){
    vector.resize(size);
    for(long long i=0;i<size;++i){
        cin>>vector[i];
    }
}

ll n;
vector<ll> v;
string s;
void input(){
    cin>>n;
    cin>>s;
}
void src(){
    int max=0;
    rep(i,n){
        int count=0;
        string s1 = s.substr(0,i);
        string s2 = s.substr(i,s.length()-i);
        for(auto i:"abcdefghijklnmopqrstuvwxyz"){
            if(s1.find(i)!=string::npos and s2.find(i)!=string::npos){count++;}
        }
        chmax(max,count);
    }
    cout<<max;
}   

int main(int argc,char* argv[]){
    ios::sync_with_stdio(false);
 //   ifstream in( argv[1] ); cin.rdbuf(in.rdbuf());
    input();
    src();    
    return 0;
}

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

using namespace std;

#define all(x) (x).begin(),(x).end()

using ll = long long;
using P = pair<int,int>;
using mp =  map<int,int>;

const int MOD = 1e9 + 7;
const int INF = 1001001001;


int main(void){

    int n, k;
    cin >> n >> k;

    vector<int> a(n);
    int amax = 0;
    for(int i = 0; i < n; ++i){
        cin >> a[i];
        amax = max(a[i], amax);
    }

    int left = 0, right = amax + 1, mid = 0;
    while (left + 1 < right) {
        mid = (left + right) / 2;

        int cnt = 0;
        for(int i = 0; i < n; ++i){
            cnt += (a[i] - 1) / mid;
        }

        if(cnt <= k){
            right = mid;
        }else{
            left = mid;
        }
    }

    cout << right << "\n";


    return 0;
}


Measured memory_bytes: 4028
from collections import Counter

# print('input >>')
N = input()
As = list(map(int,(input().split())))
Q = int(input())
BCs = []
for _ in range(Q):
    BCs.append(tuple(map(int,(input().split()))))

counter = dict(Counter(As))
sum_ = sum(As)

for BC in BCs:
    if not BC[0] in counter:
        counter[BC[0]] = 0
    if not BC[1] in counter:
        counter[BC[1]] = 0
    sa = BC[1] - BC[0]
    sum_ += counter[BC[0]] * sa
    counter[BC[1]] = counter[BC[1]] + counter[BC[0]]
    counter[BC[0]] = 0
    # print(counter)
    print(sum_)

Measured memory_bytes: 35472
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[allow(dead_code)]
fn readu() -> usize {
    read::<usize>()
}

#[allow(dead_code)]
fn readi() -> i32 {
    read::<i32>()
}

fn main() {
    input! {
        a: usize,
        b: usize,
        c: usize,
    }

    println!("{}", std::cmp::min(b / a, c));
}


Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <complex>

using namespace std;
typedef complex<double> C;
typedef vector<C> VC;
typedef vector<VC> VVC;

void fft(VC &f, int n, int dir) {
	if (n == 1) return;
	VC f0, f1;
	for(int i = 0; i < n; i++) {
		if (i % 2 == 0) {
			f0.push_back(f[i]);
		} else {
			f1.push_back(f[i]);
		}
	}
	fft(f0, n / 2, dir);
	fft(f1, n / 2, dir);
	C zeta = polar(1.0, 2 * M_PI * dir / n);
	C now = C(1.0);
	for(int i = 0; i < n; i++) {
		f[i] = f0[i % (n / 2)] + now * f1[i % (n / 2)];
		now *= zeta;
	}
}

inline int getMinimumPowerOf2(int size) {
	int n = 1;
	while(n < size) n <<= 1;
	return n;
}

void fft2d(VVC &A, int dir = 1) {
	for(int i = 0; i < A.size(); i++) {
		VC f;
		for(int j = 0; j < A[i].size(); j++) {
			f.push_back(A[i][j]);
		}
		fft(f, f.size(), dir);
		for (int j = 0; j < f.size(); j++) {
			A[i][j] = f[j];
		}
	}
	for(int j = 0; j < A[0].size(); j++) {
		VC f;
		for(int i = 0; i < A.size(); i++) {
			f.push_back(A[i][j]);
		}
		fft(f, f.size(), dir);
		for (int i = 0; i < f.size(); i++) {
			A[i][j] = f[i];
		}
	}
}

VVC comb2d(VVC A, VVC B) {
	int n = getMinimumPowerOf2(A.size() + B.size()), m = getMinimumPowerOf2(A[0].size() + B[0].size());
	A.resize(n);
	B.resize(n);
	for (int i = 0; i < A.size(); i++) {
		A[i].resize(m);
	}
	for (int i = 0; i < B.size(); i++) {
		B[i].resize(m);
	}
	fft2d(A);
	fft2d(B);
	VVC ret(n, VC(m, 0));
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < m; j++) {
			ret[i][j] = A[i][j] * B[i][j];
		}
	}
	fft2d(ret, -1);
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < m; j++) {
			ret[i][j] /= n * m;
		}
	}
	return ret;
}


constexpr char chars[] = {'#', '.'};
constexpr int num_chars = sizeof(chars);

int main() {
	int N, M;
	cin >> N >> M;
	vector<string> A(N), B(M);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	for (int i = 0; i < M; i++) {
		cin >> B[i];
	}
	int n = getMinimumPowerOf2(N + M);
	VVC score(n, VC(n, C(0)));
	for (int c = 0; c < num_chars; c++) {
		VVC cA, cB;
		for (int i = 0; i < N; i++) {
			cA.push_back(VC());
			for (int j = 0; j < N; j++) {
				cA[i].push_back(C(A[i][j] == chars[c]));
			}
		}
		for (int i = 0; i < M; i++) {
			cB.push_back(VC());
			for (int j = 0; j < M; j++) {
				cB[i].push_back(C(B[i][j] == chars[c]));
			}
		}
		VVC ret = comb2d(cA, cB);
		for (int i = 0; i < score.size(); i++) {
			for (int j = 0; j < score[0].size(); j++) {
				score[i][j] += ret[i][j];
			}
		}
	}
	bool flag = false;
	for (int i = 0; i < score.size(); i++) {
		for (int j = 0; j < score[0].size(); j++) {
			if ((int)(real(score[i][j]) + 0.1) == M * M) {
				flag = true;
				break;
			}
		}
		if (flag) break;
	}

	if (flag) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

	return 0;
}





Measured memory_bytes: 1416
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
#include <string.h>
#include <numeric>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

//typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;



int T;
string s;

signed main() {
	cin >> T;
	while (T--) {
		cin >> s;
		bool f = 1;
		while (s.size()>1) {
			string t = to_string(s[0]-'0' + s[1]-'0');
			s = t + s.substr(2);
			f ^= 1;
		}
		cout << (f ? "Audrey" : "Fabre") << ' ' << "wins." << endl;
	}
}


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

#define REP(i, start, count) for (int i = (start); i < (int)(count); ++i)
#define rep(i, count) REP(i, 0, count)
#define ALLOF(c) (c).begin(), (c).end()

using ll = long long;
using ull = unsigned long long;
using veci = vector<int>;
using vecll = vector<ll>;
using vecull = vector<ull>;

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

    vecll A;
    rep(i, N) {
        ll a;
        cin >> a;
        A.emplace_back(a);
    }
    sort(ALLOF(A));

    ll Amax = A[N - 1];
    vector<bool> dp(Amax + 1, true);
    vector<bool> dirty(Amax + 1, false);

    for (int i = 0; i < N; ++i)
    {
        ll n = A[i];
        if (dirty[n]) {
            dp[n] = false;
            continue;
        }

        if (dp[n]) {
            ll j = n + n;
            while (j <= Amax)
            {
                dp[j] = false;
                j += n;
            }
        }

        dirty[n] = true;
    }

    ll ans = 0;
    rep(i, N) {
        if (dp[A[i]]) ans++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 5368
// In The Name Of God
/*
ID: alimora2
LANG: C++11
TASK: PROB
*/
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	int n, ans = 0;
	cin >> n;
	for (int i = 0, l, r; i < n; i++) {
		cin >> l >> r;
		ans += r - l + 1;
	}
	return cout << ans << endl, 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string.h>
using namespace std;

const int MAX = 300000;

bool check(int *a, int l, int r, int X) {
	if (r - l == 1) return a[l] >= X; // 1個しか残っていないならそれを取る
	if (a[l] < X || a[l + 1] < a[l]) { // a[l+1]を取らない
		a[l + 2] += a[l] - a[l + 1];
		return check(a, l + 2, r, X);
	}
	
	return check(a, l + 2, r, X); // a[l+1]を取る
}

int main() {
	int N;
	static int a[MAX], cpy[MAX]; // cpyはaをコピーして使う用
	cin >> N;
	for (int i = 0;i < N;i ++) cin >> a[i];
	
	int sum[2] = {0, 0}; // sum[0]はoddSum、sum[1]はevenSum
	for (int i = 0;i < N;i ++) {
		sum[i & 1] += a[i];
	}
	
	if ((N & 1) == 0) { // Nが偶数
		if (sum[0] < sum[1]) cout << sum[1] << ' ' << sum[0];
		else cout << sum[0] << ' ' << sum[1];
		return 0;
	} // Nが奇数
	
	int ans = 0;
	for (int ng = sum[0] + sum[1], mid = (ng >> 1);ng - ans > 1;mid = ans + ((ng - ans) >> 1)) { // 二分探索
		memcpy(cpy, a, sizeof(int) * N);
		if (check(cpy, 0, N, mid)) ans = mid; // midについて、evenSumを省いた値を最大化するように探索
		else ng = mid;
	}
	
	cout << sum[1] + ans << ' ' << sum[0] - ans;
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり
また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー

解説ACなので何も無いです、解説読んでね
*/

Measured memory_bytes: 2560
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define INF 1000000007
#define LINF 9223372036854775807
#define MOD 1000000007
//#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
//typedef long long int ll;


signed main(){
	int n;
	cin>>n;
	int sum=0,ke;
	for(int i=1;i<=n;i++){
		sum+=i;
		if(sum>=n){
			ke=sum-n;
			n=i+1;
			break;
		}
	}
	for(int i=1;i<n;i++){
		if(i!=ke)cout<<i<<endl;
	}

}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector< vector<int> > VVI;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()

int main(){
  int H,W;
  cin>>H>>W;
  string A[H];
  rep(i,H) cin>>A[i];
  VI HH(H),WW(W);
  rep(i,H){
    int cnt=0;
    rep(j,W) if(A[i][j]=='.') cnt++;
    if(cnt==W) HH[i]++;
  }
  rep(i,W){
    int cnt=0;
    rep(j,H) if(A[j][i]=='.') cnt++;
    if(cnt==H) WW[i]++;
  }
  rep(i,H){
    rep(j,W) if(HH[i]==0&&WW[j]==0) cout<<A[i][j];
    if(HH[i]==0) cout<<endl;
  }
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int>>;
using dou =long double;
string Yes="Yes";
string YES="YES";
string NO="NO";
string No="No";
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; }
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(int i = m; i < (int)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define res resize
#define as assign
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
 
typedef long long ll;
const int INF = 2000000000;
const ll INF64 = 922337203685477580ll;
const int mod = 1000000007ll;
const ll  MOD = 1000000007LL;
const double pi=3.1415926535897932384626;
int main(){
    int n,m;
    std::cin >> n>>m;
    vvector(a,int,n,m,0);
    rep(i,m){
        int k;
        std::cin >> k;
        rep(j,k){
            int d;
            std::cin >> d;
            a[d-1][i]=1;
        }
    }
    std::vector<int> p(m);
    rep(i,m)std::cin >> p[i];
    int ans=0;
    brep(n){
        std::vector<int> c(m);
        rep(i,n){
            //if(bit&(1<<i))std::cout << i << ' ';
            rep(j,m){
                if((bit&(1<<i))&&a[i][j]){
                   // std::cout <<i<<" "<< j << std::endl;
                    c[j]++;
                }
            }
        }
        //std::cout << std::endl;
        int cnt=0;
        rep(i,m){
            if(c[i]%2==p[i])cnt++;
        }
     //   std::cout << cnt << std::endl;
        if(cnt==m)ans++;
    }
    std::cout << ans << std::endl;
}

Measured memory_bytes: 256
#include<stdio.h>
main(){
  int n;
  int a,b,c,d;
  int ans;

  while(scanf("%d",&n) != EOF){

    ans=0;

    for(a=0;a<=9;a++){
      for(b=0;b<=9;b++){
	for(c=0;c<=9;c++){
	  for(d=0;d<=9;d++){
	    if(a+b+c+d == n) ans++;
	  }
	}
      }
    }

    printf("%d\n",ans);

  }

  return 0;

}

Measured memory_bytes: 596
//
//  CPlibrary
//
//  Created by Tanmay Singh on 3/03/2020.
// INDIAN INSTITUTE OF TECHNOLOGY (BHU) , VARANASI
//  Copyright © 2020 Tanmay Singh. All rights reserved.
//#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
 
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <climits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <ratio>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
 
#define FAST(); ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl "\n"
#define mod 1000000007
typedef long long int  bigint ;
typedef std::vector< int > vi;
typedef std::vector< long long int > vll;
typedef std::vector< vi > vvi;
 
using namespace std;
vi prime ;
bool primes[1000001] ;
void makeSieve(){
    memset(primes, 1, sizeof(primes)) ;
    for( int i = 2 ; i * i < 1000001 ; i++ ){
        if( primes[i] )
            for( int j = i * i ; j < 1000001 ; j += i )
                primes[j] = false;
    }
    prime.push_back(2) ;
    for( int i = 3 ; i < 1000001 ; i += 2 )
        if( primes[i] )
            prime.push_back(i) ;
}

int main(){
    FAST() ;
    makeSieve() ;
    int N ; cin >> N ;
    cout << *lower_bound(prime.begin(), prime.end(), N ) << endl ;
    return 0 ;
}


Measured memory_bytes: 1916
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define MAX_V 1500
#define INF 10000000000000000
struct edge{double cost;int to;};
typedef pair<double,int>P;//firstは最短距離、secondは頂点の番号
int V;
vector<edge>G[MAX_V];
double d[MAX_V];

void dijkstra(int s){
   //greater<P>を指定することでfirstが小さい順に取り出せるようになる
   priority_queue<P,vector<P>,greater<P> >que;
   fill(d,d+V,INF);
   //cout<<d[0]<<endl;
   d[s] = 0;
   que.push(P(0,s));
   while(!que.empty()){
      P p = que.top(); que.pop();
      int v = p.second;
      if(d[v] < p.first) continue;
     // cout<<v<<endl;
      REP(i,G[v].size()){
          edge e = G[v][i];
          if(d[e.to] > d[v] + e.cost){
             d[e.to] = d[v] + e.cost;
             que.push(P(d[e.to],e.to));
          }
      }
   }
}

long long X[1500];
long long Y[1500];
long long R[1500];
int main(){
	long long xs,ys,xt,yt;
	int N;
	cin>>xs>>ys>>xt>>yt;
	X[0]=xs;
	Y[0]=ys;
	R[0]=0;
	cin>>N;
	REP(i,N){
	    cin>>X[i+1]>>Y[i+1]>>R[i+1];
	}
	X[N+1]=xt;
	Y[N+1]=yt;
	R[N+1]=0;
	REP(i,N+2){
	    REP(j,N+2){
	       if(i==j)continue;
	       double c=sqrt((X[i]-X[j])*(X[i]-X[j])+(Y[i]-Y[j])*(Y[i]-Y[j]));
	       c -=(R[i]+R[j]);
	       if(c<0)c=0;
	       edge e;
	       e.cost=c;
	       e.to=j;
	       G[i].push_back(e);
	    }
	}
	//cout<<"a";
	V=N+2;
	dijkstra(0);
        cout<<fixed<<setprecision(12)<<d[N+1]<<endl;
	return(0);
}

Measured memory_bytes: 20592
use std::io::Read;

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

    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut iter = buf.split_whitespace();

    let a: usize = iter.next().unwrap().parse().unwrap();
    let s: String = iter.next().unwrap().parse().unwrap();

    if a >= 3200 {
        println!("{}", s);
    } else {
        println!("red");
    }

}

Measured memory_bytes: 4352
import java.util.Scanner;

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



Measured memory_bytes: 41688
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
template<class T>void chmax(T &a,T b){if(a<b)a=b;}
template<class T>void chmin(T &a,T b){if(a>b)a=b;}
constexpr int INF=1000000000000000000;
constexpr int mod=1000000007;
constexpr double eps=1e-8;
const double pi=acos(-1);
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int Random(int mi,int ma){
    random_device rnd;
    mt19937 mt(rnd());//32bit
    //[mi,ma]
    uniform_int_distribution<int>engine(mi,ma);
    return engine(mt);
}
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
int modpow(int a,int b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%mod;
    int memo=modpow(a,b/2);
    return memo*memo%mod;
}
vector<int>kaijo,invkaijo;
void init_fact(int n){
    kaijo.resize(n+1);
    invkaijo.resize(n+1);
    kaijo[0]=1;
    for(int i=1;i<=n;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=mod;
    }
    rep(i,n+1)invkaijo[i]=modpow(kaijo[i],mod-2);
}
int comb(int a,int b){
    if(a<b)return 0;
    if(a<0||b<0)return 0;
    return kaijo[a]*modpow(kaijo[a-b],mod-2)%mod*modpow(kaijo[b],mod-2)%mod;
}
int inv(int x){
    x=modpow(x,mod-2);
    return x;
}
signed main(){
    cin.tie(0);ios::sync_with_stdio(false);
    vector<int>f={1,1};
    while(f.back()<1e18){
        f.pb(f[f.size()-1]+f[f.size()-2]);
    }
    int n=f.size();
    vector<P>v[n];
    v[2]={{2,3},{3,4}};
    for(int i=3;i<n;i++){
        for(P p:v[i-1]){
            v[i].pb({p.se,p.fi+p.se});
        }
        int a=v[i-1][0].fi,b=v[i-1][0].se;
        v[i].pb({a+b,2*a+b});
    }
    int q;
    cin>>q;
    while(q--){
        int x,y;
        cin>>x>>y;
        if(x>y)swap(x,y);
        int t=-1;
        for(int i=n-2;i>=0;i--){
            if(f[i]<=x&&f[i+1]<=y){
                t=i;
                break;
            }
        }
        if(t<=1){
            cout<<1<<" "<<x*y%mod<<endl;
            continue;
        }
        int ans=0;
        for(P p:v[t]){
            rep(i,2){
                swap(x,y);
                int a=p.fi,b=p.se;
                if(a>x)continue;
                if(y>=b)ans+=(y-b)/a+1;
                ans%=mod;
            }
        }
        cout<<t<<" "<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 4428
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            StringBuilder sb = new StringBuilder();

            string input;

            while (!string.IsNullOrEmpty(input = Console.ReadLine()))
            {
                char[] txt = input.ToCharArray();
                bool isOriginal = false;

                while (!isOriginal)
                {
                    for (int i = 0; i < txt.Length; i++)
                    {
                        if (txt[i] >= 'a' && txt[i] <= 'z')
                        {
                            txt[i] = ChangeChar(txt[i]);
                        }
                    }

                    string s = new string(txt);

                    if (s.Contains("the") || s.Contains("this") || s.Contains("that"))
                    {
                        isOriginal = true;
                        sb.AppendLine(s);
                    }
                }
            }
            Console.Write(sb);
        }

        static char ChangeChar(char ch)
        {
            char ret = ++ch;

            if (ret > 'z') ret = 'a';

            return ret;
        }
    }
}

Measured memory_bytes: 9752
#include <bits/stdc++.h>
using namespace std;
int s[4][3][10];
int main(){
	int n, b, f, r, v;
	cin >> n;
	memset(s, 0, sizeof(s));
	for(int i=1; i<=n; i++){
		cin >> b >> f >> r >> v;
		if(v>0)
			s[b-1][f-1][r-1] += v;
		else
			s[b-1][f-1][r-1] = max(0, s[b-1][f-1][r-1]+v);
	}
	for(int i=0; i<4; i++){
		for(int j=0; j<3; j++){
			for(int k=0; k<10; k++)
				cout << " " << s[i][j][k];
			cout << endl;
		}
		if(i<3){
			for(int j=1; j<=20; j++)
				cout << "#";
			cout << endl;
		}	
	}
	return 0;
}


Measured memory_bytes: 3096
H, W = map(int, input().split())
Ss = []
for i in range(H):
  S = input()
  Ss.append(S)
Ns = [[0]*W for i in range(H)]
for i in range(H):
  for j in range(W):
    if Ss[i][j] == "#":
      Ns[i][j] = "#"
    else:
      r = 0
      for p in range(max(0, i-1), min(H-1, i+1)+1):
        for q in range(max(0, j-1), min(W-1, j+1)+1):
          if Ss[p][q] == "#":
            r += 1
      Ns[i][j] = r
for i in range(H):
  N = Ns[i]
  print("".join(map(str, N)))


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

#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define vld vector<ld>
#define pll pair<ll,ll> 
#define pld pair<ld,ld> 
#define vpll vector<pll>
#define vpld vector<pld>
#define all(X) X.begin(),X.end()
#define endl "\n"
#define sz(x) ((ll)((x).size()))
const ll N=1e5+5,inf=1e18;

int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	ll x;
	cin >> x;
	ll val=100;
	ll c=0;
	while(val<x)
	{
		val=val+val/100;
		c++;
	}	    
	cout<<c<<endl;
	return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int n,a,b;
  cin>>n>>a>>b;
  vector<Int> s(n);
  for(Int i=0;i<n;i++) cin>>s[i];

  if(a==b){
    Int res=0;
    for(Int i=0;i<n;i++)
      res^=s[i]%(a+1);
    
    cout<<(res?"Hanako":"Jiro")<<endl;
    return 0;
  }
  if(a<b){    
    Int res=0,flg=0;
    for(Int i=0;i<n;i++){
      res^=s[i]%(a+1);
      flg+=s[i]>a;
    }
    if(!flg){
      cout<<(res?"Hanako":"Jiro")<<endl;
      return 0;
    }
    if(flg>=2){
      cout<<"Jiro"<<endl;
      return 0;
    }
    for(Int i=0;i<n;i++){
      if(s[i]<=a) continue;
      res^=s[i]%(a+1);
      if(res<=a&&res<s[i]&&(s[i]-res)<=a){
        cout<<"Hanako"<<endl;
        return 0;
      }
    }
    cout<<"Jiro"<<endl;
    return 0;
  }
  if(a>b){    
    Int res=0,flg=0;
    for(Int i=0;i<n;i++){
      res^=s[i]%(b+1);
      flg+=s[i]>b;
    }
    if(flg){
      cout<<"Hanako"<<endl;
      return 0;
    }
    cout<<(res?"Hanako":"Jiro")<<endl;    
    return 0;
  }
  return 0;
}



Measured memory_bytes: 3632
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
#include <tuple>
#include <array>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)


typedef long long int ll;
typedef double D;      // ??§?¨?????????????double???long double?????????
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;


const int INF = (1<<30) - 1;
const D EPS = 1e-9;

#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

int M, N;
vector<string> field;

int dh[] = {-1, 1, 0, 0};
int dw[] = {0, 0, 1, -1};

inline bool in_field(int h, int w){
    return 0<=h&&h<M && 0<=w&&w<N;
}

void solve(){
    bool updated = true;
    int count = 0;
    while (updated) {
        updated = false;
        for(int i=0; i<M; i++){
            for(int j=0; j<N; j++) if(field[i][j] == '.'){
                vector<tuple<char, int, int>> colors;
                
                for(int d=0; d<4; d++){
                    int l = 0;
                    while(in_field(i+dh[d]*l, j+dw[d]*l) && field[i+dh[d]*l][j+dw[d]*l] == '.') l++;
                    
                    if(!in_field(i+dh[d]*l, j+dw[d]*l)) continue;
                    
                    colors.push_back(tuple<char, int, int>(field[i+dh[d]*l][j+dw[d]*l], i+dh[d]*l, j+dw[d]*l));
                }
                
                for(int i=0; i<colors.size(); i++){
                    for(int j=i+1; j<colors.size(); j++){
                        char c1, c2;
                        int h1, w1, h2, w2;
                        tie(c1, h1, w1) = colors[i];
                        tie(c2, h2, w2) = colors[j];
                        if(c1 == c2){
                            field[h1][w1] = field[h2][w2] = '.';
                            count += 2;
                            updated = true;
                        }
                    }
                }
            }
        }
    }
    cout << count << endl;
}

//g++ -std=c++0x -msse4.2 -O3
//#include <bits/stdc++.h>
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    //cout.precision(16);
    
    cin >> M >> N;
    field = vector<string>(M);
    for(int i=0; i<M; i++)
        cin >> field[i];
    
    solve();
    
    return 0;
}

Measured memory_bytes: 1348
// Problem : A - Serval vs Monster
// Contest : AtCoder Beginner Contest 153
// URL : https://atcoder.jp/contests/abc153/tasks/abc153_a
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/coder3101/cp-editor)

#include<bits/stdc++.h>
using namespace std;
int main()
{
        int n,a;
        cin >> n >> a;
        int ans=0;
        for(int i=0;;i++)
        {
                n-=a;
                ++ans;
                if(n<=0)
                break;
        }
        cout << ans << endl;
	return 0;
}

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

typedef pair<int, int> pi;
typedef vector<vector<int>> vv;

int32_t main() 
{ 
	int a, b;
	cin >> a >> b;

	string s = "";
	if(b > a){
		swap(a, b);
	}
	
	while(a--){
		s += (b + '0');
	}

	cout << s << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
#include <queue>
#include <set>
#include <cstdio>
#include <cmath>
#include <array>
#include <functional>
#include <sstream>
#include <list>
#include <set>
const int MOD=1000000007;
const int INF=1000000000;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const double eps=1e-9;
const double inf=1e12;
typedef pair<int,int> P;
struct Point
{
  double x,y;
  Point(){x=0;y=0;}
  Point(double d_x,double d_y){x=d_x,y=d_y;}
  double operator*(Point obj){return obj.x*x+obj.y*y;}
  double operator%(Point obj){return obj.y*x-obj.x*y;}
  Point operator*(double b){Point tmp;tmp.x=x*b;tmp.y=y*b;return tmp;}
  Point operator/(double b){Point tmp;tmp.x=x/b;tmp.y=y/b;return tmp;}
  Point operator+(Point obj){Point tmp;tmp.x=x+obj.x;tmp.y=y+obj.y;return tmp;}
  Point operator-(){Point tmp;tmp.x=-x;tmp.y=-y;return tmp;}
  Point operator-(Point obj){Point tmp;tmp.x=x-obj.x;tmp.y=y-obj.y;return tmp;}
  Point operator-=(Point obj){x-=obj.x;y-=obj.y;return *this;}
  Point operator+=(Point obj){x+=obj.x;y+=obj.y;return *this;}
  Point operator/=(double b){x=x/b;y=y/b;return *this;}
  Point operator*=(double b){x=x*b;y=y*b;return *this;}
  double size(){return hypot(x,y);}
  Point unit(){return Point(x/size(),y/size());}
  Point normal(){return Point(y,-x);}
  double atan(){return atan2(y,x);}
};

bool operator<(Point a,Point b){return a.x!=b.x?a.x<b.x:a.y<b.y;}
bool operator>(Point a,Point b){return b<a;}
bool operator<=(Point a,Point b){return !(b<a);}
bool operator>=(Point a,Point b){return !(a<b);}
bool operator==(Point a,Point b){return (a-b).size()<eps;}
bool operator!=(Point a,Point b){return !(a==b);}

bool equal(double a,double b){return abs(a-b)<eps;}
double cross(Point a,Point b){return a%b;}
double dot(Point a,Point b){return a*b;}

int ccw(Point a,Point b,Point c)
{
  b=b-a;
  c=c-a;
  if(b%c>0) return +1;
  else if(b%c<0)return -1;
  else if(b*c<0) return +2;
  else if(b.size()<c.size()) return -2;
  else return 0;
}

int main(int argc,char const* argv[])
{
  int n,m;
  while(1)
    {
      cin >> n;
      if(!n) break;
      Point a,b,c;
      cin >> m;
      vector<P> s1,s2;
      cin >> a.x >> a.y;
      cin >> b.x >> b.y;
      s1.push_back(P((int)(a-b).size()+eps,0));
      for(int i=2;i<m;i++)
	{
	  cin >> c.x >> c.y;
	  s1.push_back(P((int)((c-b).size()+eps),ccw(a,b,c)));
	  a=b,b=c;
	}
      s2.push_back(P(s1.back().first,0));
      for(int i=s1.size()-2;i>=0;i--)
	{
	  s2.push_back(P(s1[i].first,-s1[i+1].second));
	}
      for(int j=0;j<n;j++)
	{
	  vector<P> t;
	  cin >> m;
	  cin >> a.x >> a.y;
	  cin >> b.x >> b.y;
	  t.push_back(P((int)(a-b).size()+eps,0));
	  for(int i=2;i<m;i++)
	    {
	      cin >> c.x >> c.y;
	      t.push_back(P((int)((c-b).size()+eps),ccw(a,b,c)));
	      a=b,b=c;
	    }
	  if(t==s1 || t==s2)
	    {
	      cout << j+1 << endl;
	    }
	}
      cout << "+++++" << endl;
    }
  return 0;
}



Measured memory_bytes: 3076
lines = readlines
n = lines[0].chomp.to_i
arr = lines[1].chomp.split(" ").map {|aa| aa.to_i}

result = 0

arr.each_with_index do |a, i|
  counter = 0
  if i > 0 && a > arr[i-1]
    for j in i..(n-2)
      if arr[j] >= arr[j+1]
        counter += 1
      else
        break
      end
    end
  elsif i == 0
    for j in i..(n-2)
      if arr[j] >= arr[j+1]
        counter += 1
      else
        break
      end
    end
  end

  if counter > result
    result = counter
  end

end

p result

Measured memory_bytes: 12044
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <queue>
#define MAXn 102
#define MAXm 1000010
using namespace std;

int main()
{
    int x1,y1,x2,y2,i;
    scanf("%d %d %d %d",&x1,&y1,&x2,&y2);
    for(i=0; i<y2-y1; i++)
        printf("U");
    for(i=0; i<x2-x1; i++)
        printf("R");

    for(i=0; i<y2-y1; i++)
        printf("D");
    for(i=0; i<x2-x1; i++)
        printf("L");

    printf("L");
    for(i=0; i<=y2-y1; i++)
        printf("U");
    for(i=0; i<=x2-x1; i++)
        printf("R");
    printf("D");

    printf("R");
    for(i=0; i<=y2-y1; i++)
        printf("D");
    for(i=0; i<=x2-x1; i++)
        printf("L");
    printf("U");

    return 0;
}

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

void solveA(){
  int H,W,h,w;
  cin >> H >> W >> h >> w;

  cout << H*W- (h*W+w*H) + h*w << endl;
}
void solveB(){

}
void solveC(){
}

void solveD(){
}

int main(){
  solveA();
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long a = sc.nextLong();
        long b = sc.nextLong();

        if(a+b==0){
            System.out.println(0);
            return;
        }

        long rem = n % (a+b);
        n -= rem;
        System.out.println(n/(a+b)*a + Math.min(rem,a));
    }
}


Measured memory_bytes: 21972
#include<bits/stdc++.h>
using namespace std;
int n;
int a[2100000];
int l[2100000];
int r[2100000];
long long ans=0;
int main()
{
	scanf("%d",&n);
    r[0]=1;
    l[n+1]=n;
    for(int i=1;i<=n;i++)
    {
       	int x;
       	scanf("%d",&x);
        l[i]=i-1;
        r[i]=i+1;
        a[x]=i;
    }
    for(int i=n;i>=1;i--)
    {
        ans+=1LL*i*(a[i]-l[a[i]])*(r[a[i]]-a[i]);
        r[l[a[i]]]=r[a[i]];
		l[r[a[i]]]=l[a[i]];
    }
	printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 5120
import java.util.*;
import static java.lang.Math.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		// 計算
		//String result = "";
		int tmp = a;
		a = b;
		b = tmp;
		tmp = a;
		a = c;
		c = tmp;
		System.out.println(a + " " + b + " " + c);
		
		// 出力
		//System.out.println(result);
	}
}



Measured memory_bytes: 21972
#include<bits/stdc++.h>
#define N 300050
#define ll long long
#define pb push_back
#define x first
#define y second
#define all(v) v.begin(),v.end()
#define coffee prince
#define sz(a) (int)a.size()
#define ll long long
#define SIZE N
using namespace std;
int ispal(string s){
    int n= s.length();
    for(int i=0;i<n;i++){
        if(s[i]!=s[n-1-i])return 0;
    }
    return 1;
}
signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string a; cin>>a;
    string b = "";
  int n = a.length();
  for(int i=0;i<n/2;i++){
        b+=a[i];
    }
    if(ispal(a)&&ispal(b))cout<<"Yes";
    else cout<<"No";
        return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std; 

int main(void) {
	int a[5];
	for (int i = 0; i < 5; ++i) {
		cin >> a[i];
	}
	int k;
	cin >> k;
	bool dis = false;
	for (int i = 0; i < 4; ++i) {
		for (int j = i+1; j < 5; ++j) {
			if (a[j]-a[i] > k) {
				dis = true;
			}
		}
	}
	if (dis) {
		cout << ":(" << endl;
	}
	else {
		cout << "Yay!" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{VecDeque, HashMap, BTreeMap, HashSet, BTreeSet};
#[allow(unused_imports)]
use std::{i32, i64, i128, u32, u64, u128, f64};
#[allow(unused_imports)]
use std::io::{stdout, Write, BufWriter};
#[allow(unused_imports)]
use std::mem::{swap};
#[allow(unused_imports)]
use proconio::marker::{Isize1, Usize1, Bytes, Chars};

#[proconio::fastout]
fn main() {
    proconio::input!{
        n: usize,
        a: [u64; n],
    }
    let mut ans = 1u64;
    if a.contains(&0) {
        println!("0");
        return;
    }
    for x in a {
        match ans.checked_mul(x) {
            Some(n) => {
                ans = n;
                if ans > 10u64.pow(18) {
                    println!("-1");
                    return;
                }
            },
            None => {
                println!("-1");
                return;
            },
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4532
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner inp = new Scanner(System.in);

        int a = inp.nextInt();
        String op = inp.next();
        int b = inp.nextInt();

        while (!op.equals("?")) {
            switch(op) {
                case "+":
                    System.out.println(a+b);
                    break;
                case "-":
                    System.out.println(a-b);
                    break;
                case "*":
                    System.out.println(a*b);
                    break;
                case "/":
                    System.out.println(a/b);
                    break;
            }

            a = inp.nextInt();
            op = inp.next();
            b = inp.nextInt();
        }
    }
}



Measured memory_bytes: 26332
N = int(input())

cnt = {"AC":0, "WA":0, "TLE":0, "RE": 0}
for i in range(N):
  s = input()
  cnt[s] += 1
  
print("AC x ", cnt["AC"])
print("WA x ", cnt["WA"])
print("TLE x ", cnt["TLE"])
print("RE x ", cnt["RE"])

Measured memory_bytes: 9144
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

typedef pair<int, int> pii;
typedef long long ll;

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

signed main() {
    int n; cin >> n;
    if(n == 0) cout << 1 << endl;
    else if(n == 1) cout << 2 << endl;
    else if(n == 2) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}

Measured memory_bytes: 3104
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<functional>
#include<set>
#include<numeric>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0LL,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,n) RFOR(i,0LL,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define COUNT(a,x,y) upper_bound(all(a), y) - lower_bound(all(a), x)
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end())
#define SUM(a) accumulate(all(a),0LL)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define pb push_back
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
const ll inf = 2222222222222222222LL;
const ll mod = 1000000007LL;

ll n = 0, m = 0, ans = 0, cnt = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok, flag;
ll dx[5] = { 1,-1,0,0,0 }, dy[5] = { 0,0,1,-1,0 };
ll ddx[9] = { 1,-1,0,0,1,1,-1,-1,0 }, ddy[9] = { 0,0,1,-1,1,-1,1,-1,0 };
#pragma endregion
#define MAX 111111



int main(void) {
  cin >> n >> m;
  n *= m;
  if (n % 2 == 1) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int k,b,a;
	cin>>k>>a>>b;
	for(int i=a;i<=b;++i)
	if(i%k==0)
	{
		cout<<"OK";
		return 0;
	}
	cout<<"NG";
	return 0;
}

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

ll INF=1000000000000000;
ll mod=1000000007;

ll i,j,k;

int main(){
    ll k,a,b;
    cin>>k>>a>>b;
    bool ok=false;
    for(i=a;i<=b;i++){
        if(i%k==0){ok=true;}
    }

    if(ok){cout<<"OK"<<endl;}
    else{cout<<"NG"<<endl;}
    return 0;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define maxn 100000
#define inf 0x3f3f3f3f
#define LL long long
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define mm(a,b) memset(a,b,sizeof(a))
#define mp(a,b) make_pair(a,b)
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
const LL mod=1e9+7;
const LL INF=(LL)1e18;
using namespace std;
LL gcd(LL a,LL b){return b==0?a:gcd(b,a%b);}
LL qpow(LL x,LL y){LL re=1,base=x%mod;while(y){if(y&1)re=(re*base)%mod;base=(base*base)%mod;y>>=1;}return re;}
int a[55];
int main(){	
//	freopen("input.txt","r",stdin);
//	freopen("ouput.txt","w",sdout);
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	int n,k;
	cin>>n>>k;
	for(int i=1;i<=n;i++) cin>>a[i];
	sort(a+1,a+1+n,greater<int>());
	int sum=0;
	for(int i=1;i<=k;i++) sum+=a[i];
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
  
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] A = new int[N];
    for (int i = 0; i < N; i++) {
      A[i] = sc.nextInt();
    }
    int a = 0;
    for (int i = 0; i < N ; i++) {
      if (i%2 == 0) {
        a += A[N-i-1];
      } else {
        a -= A[N-i-1];
      }
    }
    
    System.out.print(a + " ");
    for (int i = 0; i < N-1; i++) {
      a = 2*(A[i]-a/2);
      System.out.print(a + " ");
    }
  }  
}


Measured memory_bytes: 62708
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//#include <math.h>
#include <algorithm>
#include <vector>

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))

using namespace std;

#define MOD 1000000007


int main(int argc, char* argv[])
{
    long a[4];
    scanf("%ld %ld %ld %ld", &(a[0]), &(a[1]), &(a[2]), &(a[3]) );
    sort( a, a+4 );
    if(a[0]==1 && a[1]==4 && a[2]==7 && a[3]==9) {
        printf("YES\n");
    }
    else {
        printf("NO\n");
    }

    return 0;
}


Measured memory_bytes: 128
<?php

$s = trim(fgets(STDIN));
$a = ['A', 'C', 'G', 'T'];
$max = 0;

if (strlen($s)==1 && in_array($s,$a)) $max = 1;

for($i=0; $i<strlen($s)-1; $i++){
  $count = 0;
  
  $j = $i;
  while(true){
    if (in_array($s[$j], $a)){
      $count++;
    } else {
      break;
    }
    $j++;
  }
  
  if ($count > $max) $max = $count;
}

echo $max;

?>

Measured memory_bytes: 4856
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int n,i,j,pt=0;
int d[100];
bool tf;
for(i=0;i<100;i++)
{
d[i]=-1;
}
cin>>n;
for(i=0;i<n;i++)
{
cin>>d[pt];
tf=true;
for(j=0;j<pt;j++)
{
if(d[pt]==d[j])
{
tf=false;
break;
}
}
if(tf)
{
pt++;
}
else
{
d[pt]=-1;
}
}
cout<<pt;
return 0;
}


Measured memory_bytes: 256