akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define RSORT(obj) sort((obj).begin(), (obj).end(), greater<>())


ll  x , y , a , b , c;


main( ) {
	cin >> x >> y >> a >> b >> c;
	vector<int> r( a ) , g( b ) , rg( c );
	rep( i , a )cin >> r[ i ];
	rep( i , b )cin >> g[ i ];
	rep( i , c )cin >> rg[ i ];
	RSORT( r );
	RSORT( g );
	rep( i , x ) rg.push_back( r[ i ] );
	rep( i , y ) rg.push_back( g[ i ] );
	RSORT( rg );
	ll ans=0;
	rep( i , x + y )ans += rg[ i ];
	cout << ans;

}


Measured memory_bytes: 2552
A,B=input().split()
a=int(A)
b=int(B)
am=a/0.08
aM=(a+1)/0.08
bm=b/0.1
bM=(b+1)/0.1
import math
am=math.ceil(am)
aMx=math.floor(aM)
if aMx==aM:
  aM=aMx-1
else:
  aM=aMx
bm=math.ceil(bm)
bMx=math.floor(bM)
if bMx==bM:
  bM=bMx-1
else:
  bM=bMx

if am<=bm:
  if bm<=aM:
    x=bm
  else:
    x=-1
else:
  if am<=bM:
    x=am
  else:
    x=-1
print(x)

Measured memory_bytes: 3064
#include <stdio.h>

int main(void) {
    double r,are,circ,x=3.141592653589;
        scanf("%lf",&r);
    are=r*r*x;
    circ=2*r*x;
    
    printf("%f %f \n",are,circ);
    
   
    
    return 0;
}

Measured memory_bytes: 1076
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

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

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100;

int main() {
	int n;cin>>n;
	if (n/100==n%10) cout << "Yes" << endl;
	else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
using ll = long long;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n-1); }

#ifdef LOCAL
#define show(x) cerr << "LINE" << __LINE__ << " : " << #x << " = " << (x) << endl
#define dump(x) cerr << "LINE" << __LINE__ << " : " << #x << " = {";  \
	for(auto v: x) cerr << v << ","; cerr << "}" << endl;
#else
#define show(x) true
#define dump(x) true
#endif

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);		//DON'T USE scanf/printf/puts !!
	cout << fixed << setprecision(20);
	
	int N; cin >> N;
	map<int,int> mp;
	rep(i,N){
		int x;
		cin >> x;
		mp[x]++;
	}
	V<ll> n(N+1),s(N+1);
	for(auto it: mp){
		int num = it.sc;
		n[num]++;
		s[num] += num;
	}
	rep(i,N){
		n[i+1] += n[i];
		s[i+1] += s[i];
	}
	V<int> ans(N+1);
	rep1(t,N){
		int sum = s[t] + (n[N]-n[t]) * t;
		int k = sum/t;
		chmax(ans[k],t);
	}
	for(int i=N;i>0;i--) chmax(ans[i-1],ans[i]);
	rep1(i,N) cout << ans[i] << endl;
}


Measured memory_bytes: 20096
#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
char str[110];
char w[5]="AOX";
int at[20];
int var[20];
int pow3[20];
int cur;
int expr(){
	if(str[cur]=='('){
		cur++;
		int L=expr();
		char ex=str[cur++];
		int R=expr();
		cur++;
		if(ex=='A')return L&R;
		if(ex=='X')return L^R;
		return L|R;
	}else{
		return var[str[cur++]-'1'];
	}
}
int main(){
	pow3[0]=1;
	for(int i=1;i<20;i++)pow3[i]=pow3[i-1]*3;
	while(1){
		gets(str);
		if(str[0]=='E')return 0;
		int sz=0;
		for(int i=0;str[i];i++)if(str[i]==' '){
			at[sz++]=i;
		}
		int n;scanf("%d",&n);
		for(int i=0;i<n;i++){
			var[i]=0;
			for(int j=0;j<4;j++){
				int p;scanf("%d",&p);
				if(p)var[i]+=(1<<j);
			}
		}
		int ret=0;
		for(int i=0;i<pow3[sz];i++){
			for(int j=0;j<sz;j++){
				str[at[j]]=w[i%pow3[j+1]/pow3[j]];
			}
		//	printf("%s\n",str);
			cur=0;
			if(expr()==15)ret++;
		}
		printf("%d\n",ret);gets(str);
	}
}

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

int main()
{
  int A,B;
  cin >> A;
  cin >> B;
 
  int c = A+B;
  if(c==3){
    cout << 3 << endl;
  }
  else if(c==5){
    cout << 1 << endl;
  }
  else{
    cout << 2 << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  long long n=s.size();
  long long ans=0;
  long long cnt=0;
  for(long long i=0;i<n;i++){
    if(s[i]=='W'){
      ans+=cnt;
    }
    else{
      cnt++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define int long long
void run();
signed main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(13); run(); return 0; }
mt19937 rng(random_device{}());
const int mod = 1000000007;
int ppow(int a, int b) {
    if (b == 0)
        return 1;
    if (b % 2)
        return (a * ppow(a, b - 1)) % mod;
    else {
        int d = ppow(a, b/  2);
        return (d * d) % mod;
    }
}

int inv(int a) { return ppow(a, mod - 2); }

int c(int k, int n) {
    int ans = 1;
    for (int i = n; i > n - k; --i)
        ans = (ans * i) % mod;
    for (int i = 1; i <= k; ++i)
        ans = (ans * inv(i)) % mod;
    return ans;
}

void run() {
    int n, a, b;
    cin >> n >> a >> b;

    int ans = ppow(2, n) - 1 - c(a, n) - c(b, n);
    cout << ((ans % mod) + mod) % mod << endl;
}


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

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

  if (N[0] == N[1] && N[1] == N[2]) {
    cout << "Yes" << endl;
  } else if ((N[1] == N[2] && N[2] == N[3])) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

int main(){ 
    int a,b,c,d,n,cnt;

    while(cin>>n){
        cnt=0;  
        if(n<37){
            for(a=0;a<10;a++){
            for(b=0;b<10;b++){
            for(c=0;c<10;c++){
            for(d=0;d<10;d++){
                if(a+b+c+d==n)cnt++;
            }       
            }       
            }       
            }       
        }       
        cout<<cnt<<endl;
    }
    return 0;
}

Measured memory_bytes: 0
#https://qiita.com/minemine0505/items/9aeae0f651f19f2ac1e2
N = int(input())
S = input()
min = S[1:N].count("E") #最小値を保存しておく
now = S[1:N].count("E") #i-1 を見ているときのそっぽ向いてる子の数

for i in range (1,N):
    if S[i-1] == "E" and S[i] == "E":
        now -= 1
    if S[i-1] == "W" and S[i] == "W":
        now += 1
    if now < min:
        min = now
print(min)


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

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<endl

int main(){
    int n;
    cin >> n;
    map<int,int> mp;
    REP(i,n){
        int x;
        cin >> x;
        mp[x]++;
    }
    int ans = 0;
    for(const auto& i:mp){
        int tes = i.first;
        if(tes<mp[tes])ans+=mp[tes]-tes;
        else if(tes>mp[tes])ans+=mp[tes];
    }
    cout << ans << endl;
    return 0;
}   

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

//using int = long long int;
using ll = long long int;
using pii = pair < int, int >;

#define ff first
#define ss second
#define endl '\n'
#define pb push_back

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define rep(i, j, n)    for(int i = j; i < n; i++)
#define ren(i, j, n)    for(int i = n-1; i >= j; i--)

#define cerr cout
void _print() {cerr << "]\n";}
template <typename T, typename... V> void _print(T t, V... v) {
    cerr << t; if (sizeof...(v)) cerr << ", "; _print(v...);
}
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)

const int mod = 1000000007;

void io_set() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

vector < ll > g[100005];
bool vis[100005];

void dfs(int s){
    vis[s] = true;
    for(auto it : g[s]){
        if(!vis[it]){
            dfs(it);
        }
    }
}

void solve() {
    int n, m, u, v;
    cin >> n >> m;
    rep(i, 0, m){
        cin >> u >> v;
        u--, v--;
        g[u].pb(v), g[v].pb(u);
    }
    int c = 0;
    rep(i, 0, n){
        if(!vis[i]){
            c++;
            dfs(i);
        }
    }
    cout << c-1 << endl;
}

signed main(int argc, char **argv) {
    //io_set();
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    int tt = 1;
    //cin >> tt;
    while (tt--) {
        solve();
    }
    return 0;
}



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

int main() {
    int n;cin>>n;
    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    bool ok[1000001];
    fill(ok,ok+1000001,true);
    int ans=0;
    for (int i=0;i<n;i++)
        if (ok[a[i]]) {
            if (i+1==n||a[i]!=a[i+1])
                ans++;
            for (int j=a[i];j<=1000000;j+=a[i])
                ok[j]=false;
        }
    cout<<ans<<endl;
    return 0;
}

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

#define FORE(i, a) for (auto i = a.begin(); i != a.end(); ++i)
#define REPU(i, a, b) for (int i = (a); i < (b); ++i)
#define REPD(i, a, b) for (int i = (a); i > (b); --i)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())

vector<string> split(const string &s, char c) {
	vector<string> v; stringstream ss(s); string x;
	while (getline(ss, x, c)) v.push_back(x);
	return v;
}
#define DEBUG(args...) { vector<string> _v = split(#args, ','); err(_v.begin(), args); }
void err(vector<string>::iterator it) {}
template<typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
	cerr << "[DEBUG] " << it -> substr((*it)[0] == ' ', it -> length()) << " = " << a << '\n';
	err(++it, args...);
}

typedef long long ll;
const int MOD = 1000000007;

template<class T, class U> inline T tmin(T a, U b) { return (a < b) ? a : b; }
template<class T, class U> inline T tmax(T a, U b) { return (a > b) ? a : b; }
template<class T, class U> inline void amax(T &a, U b) { if (b > a) a = b; }
template<class T, class U> inline void amin(T &a, U b) { if (b < a) a = b; }
template<class T> T gcd(T a, T b) { while (b != 0) { T c = a; a = b; b = c % b; } return a; }

int main(int argc, char *argv[]) {
	ios_base::sync_with_stdio(false);

	int n; cin >> n;
	string s; cin >> s;
	REPU(it, 0, 4) {
		string ans(n, '?');
		if (it == 0) {
			ans[0] = ans[1] = 'S';
		}
		else if (it == 1) {
			ans[0] = 'S', ans[1] = 'W';
		}
		else if (it == 2) {
			ans[0] = 'W', ans[1] = 'S';
		}
		else {
			ans[0] = ans[1] = 'W';
		}
		bool ok(true);
		int idx = 1;
		REPU(i, 1, n + 5) {
			int pre = (idx - 1 + n) % n, nxt = (idx + 1) % n;
			if (ans[idx] == 'S') {
				if (s[idx] == 'o') {
					if (ans[pre] != '?' && ans[nxt] != '?') {
						if (ans[pre] != ans[nxt]) {
							ok = false; break;
						}
					}
					else if (ans[nxt] == '?') {
						ans[nxt] = ans[pre];
					}
					else {
						ans[pre] = ans[nxt];
					}
				}
				else {
					if (ans[pre] != '?' && ans[nxt] != '?') {
						if (ans[pre] == ans[nxt]) {
							ok = false; break;
						}
					}
					else if (ans[nxt] == '?') {
						ans[nxt] = 'S' + 'W' - ans[pre];
					}
					else {
						ans[pre] = 'S' + 'W' - ans[nxt];
					}
				}
			}
			else {
				if (s[idx] == 'o') {
					if (ans[pre] != '?' && ans[nxt] != '?') {
						if (ans[pre] == ans[nxt]) {
							ok = false; break;
						}
					}
					else if (ans[nxt] == '?') {
						ans[nxt] = 'S' + 'W' - ans[pre];
					}
					else {
						ans[pre] = 'S' + 'W' - ans[nxt];
					}
				}
				else {
					if (ans[pre] != '?' && ans[nxt] != '?') {
						if (ans[pre] != ans[nxt]) {
							ok = false; break;
						}
					}
					else if (ans[nxt] == '?') {
						ans[nxt] = ans[pre];
					}
					else {
						ans[pre] = ans[nxt];
					}
				}
			}
			idx = (idx + 1) % n;
		}
		if (ok) {
			printf("%s\n", ans.c_str());
			return 0;
		}
	}
	puts("-1");

	return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<deque>
using namespace std;

int main() {
  int N, X, Y; cin >> N >> X >> Y;
  X--; Y--;

  vector< vector<int> > dist(N, vector<int>(N, -1));
  for (int s = 0; s < N; s++) {
    dist[s][s] = 0;
    deque<int> q; 
    q.push_back(s);

    while (!q.empty()) {
      int curr = q.front();
      q.pop_front();
      vector<int> nexts;
      if (curr > 0) nexts.push_back(curr - 1);
      if (curr < N - 1) nexts.push_back(curr + 1);
      if (curr == X) nexts.push_back(Y);
      if (curr == Y) nexts.push_back(X);

      for (int next : nexts) {
        if (dist[s][next] != -1) continue;
        dist[s][next] = dist[s][curr] + 1;
        q.push_back(next);
      }
    }
  }

  vector<int> ans(N);
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      int d = dist[i][j];
      ans[d] += 1;
    }
  }
  for (int i = 1; i < N; i++) cout << ans[i] << endl;
}


Measured memory_bytes: 16000
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os, const map<T,U>& mp){ os << "{"; for(auto& p : mp){ os << p << ","; } os << "}"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

int main(){
    string s; cin >> s;
    map<char,int> mp;
    for(int i=0;i<s.size();i++){
        mp[s[i]]++;
    }

    for(auto p : mp){
        if(p.second != 2){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 256
#[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")
    };
}

fn main() {
    input!{
        n:usize,
        k: i64,
        mut a: [i64;n],
    }
    a.sort();
    let mut acm = vec![0;n];
    acm[0]=a[0];
    for i in 1..n {
        acm[i]+=acm[i-1]+a[i];
    }
    let mut r = vec![(0,0);n];
    let mut ans = 1;
    let m = acm[n-1];
    let mut v = vec![];
    for i in 1..((m as f64).sqrt() as usize +1){
        if m%(i as i64)==0 {
            v.push(i);
            v.push((m/(i as i64)) as usize);
        }
    }
    // println!("{:?}", (m as f64).sqrt());
    for i in v {
        let i = i as i64;
        // println!("{}", i);
        for j in 0..n {
            r[j].0 = a[j]%i;
            r[j].1 = i - a[j]%i;
        }
        r.sort_by(|a,b| a.0.cmp(&b.0));
        // println!("{:?}", r);
        for j in 1..n {
            r[j].0 +=r[j-1].0;
        }
        for j in (1..n).rev() {
            r[j-1].1 += r[j].1;
        }
        // println!("{:?}", a);
        for j in 0..n-1 {
            if r[j].0 == r[j+1].1 && r[j].0 <= k {
                ans = std::cmp::max(ans, i);
            }
        }
    }
    println!("{}", ans);
}

Measured memory_bytes: 4352
h,w = map(int,input().split())
A = []
A.append('.'*(w+2))
for _ in range(h):
    A.append('.'+input()+'.')
A.append('.' * (w+2))
flag = 0
#枠
for i in range(h+2):
    for j in range(w+2):
        if A[i][j] == '#':
            if A[i][j -1] == '.' and A[i][j + 1] == '.' and A[i-1][j] == '.' and A[i+1][j] == '.':
                flag = 1
if flag == 0:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3064
#include <iostream>

using namespace std;



int main() {

	int a[100][100] = {{0}};

	int n;

	cin >> n;

	int u, k, v;

	for ( int i = 0; i < n; i++ ) {

		cin >> u >> k;

		for ( int j = 0; j < k; j++ ) {

			cin >> v;

			a[u - 1][v - 1] = 1;

		}

	}

	for ( int i = 0; i < n; i++ ) {

		for ( int j = 0; j < n; j++ ) {

			cout << a[i][j];

			if ( j != n - 1 ) cout << " ";

		}

		cout << endl;

	}

}

Measured memory_bytes: 1204
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main(){
    int x, y;
    cin >> x >> y;

    int ans = 0;
    if(x == 1) ans += 300000;
    if(x == 2) ans += 200000;
    if(x == 3) ans += 100000;
    if(y == 1) ans += 300000;
    if(y == 2) ans += 200000;
    if(y == 3) ans += 100000;
    if(x == 1 && y == 1) ans += 400000;

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

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  int n,i,j,k;
  int univ[4][3][10]={0};
  scanf("%d",&n);
  for(i=0;i<n;i++){
    int block,flour,room,v;
    scanf("%d%d%d%d",&block,&flour,&room,&v);
    univ[block-1][flour-1][room-1]+=v;
  }
  for(i=0;i<4;i++){
    for(j=0;j<3;j++){
      for(k=0;k<10;k++){
        printf(" %d",univ[i][j][k]);
      }
      printf("\n");
    }
    if(i!=3)
    printf("####################\n");
  }
  return 0;
}

Measured memory_bytes: 612
#include <cassert>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <queue>
/*
1 2 3
4 5 6
7 0 8
????????¶????????????????????????3???????????????
????????????8??????????????????1?????§??????

1 2 3
4 0 6
7 5 8
????????¶?????????5??????????????°1?????§??????????????¢????????????

*/
typedef long long int TBoard;
const static TBoard Answer = 123456780;
typedef std::vector<bool> TTable;
TBoard InputBoard(std::istream& in)
{
    TBoard Board = 0;
    for(int i = 8; i >= 0; --i){
        int n;
        std::cin >> n;
        Board += std::pow(10, i) * n;
    }
    return Board;
}
int Encode(const TBoard& Board)
{
    return Board / 10;
}
TBoard Decode(int Code)
{
    int n = 0;
    while(Code){
        n += Code % 10;
        Code /= 10;
    }
    int a = 36 - n;
    return Code * 10 + a;
    
}
std::vector<TBoard> GetMoved(const TBoard& Board)
{
    std::stringstream ss;
    ss << std::setfill('0') << std::setw(9) << Board;
    std::string s = ss.str();
    assert(s.length() == 9);
    int i = s.find('0');
    assert(i >= 0);
    assert(i <= 9);
    
    std::vector<TBoard> Result;
    if(i > 2){
        std::string copy = s;
        std::swap(copy[i], copy[i-3]);
        Result.push_back(std::atoi(copy.c_str()));
    }
    if(i < 6){
        std::string copy = s;
        std::swap(copy[i], copy[i+3]);
        Result.push_back(std::atoi(copy.c_str()));
    }
    if((i == 0 || i == 3 || i == 6) == false){
        std::string copy = s;
        std::swap(copy[i], copy[i-1]);
        Result.push_back(std::atoi(copy.c_str()));
    }
    if((i == 2 || i == 5 || i == 8) == false){
        std::string copy = s;
        std::swap(copy[i], copy[i+1]);
        Result.push_back(std::atoi(copy.c_str()));
    }

    return Result;
}
void Print(const TBoard& Board, char c)
{
    std::stringstream ss;
    ss << std::setfill('0') << std::setw(9) << Board;
    std::string s = ss.str();
    std::cerr << c << s[0] << " " << s[1] << " " << s[2] << std::endl;
    std::cerr << c << s[3] << " " << s[4] << " " << s[5] << std::endl;
    std::cerr << c << s[6] << " " << s[7] << " " << s[8] << std::endl;
    std::cerr << std::endl;
}
int Solve(const TBoard& Board)
{
    std::vector<bool> Table(87654321, false);
    int Cost = 0;
    std::queue<TBoard> q;
    q.push(Board);
    Table[Encode(Board)] = true;

    std::queue<TBoard> temp;
    while(!q.empty()){
        TBoard B = q.front();
        q.pop();
        // Print(B, ' ');
        if(B == Answer) return Cost;
        std::vector<TBoard> Boards = GetMoved(B);
        for(std::size_t i = 0; i < Boards.size(); ++i){
            if(Table[Encode(Boards[i])]) continue;
            temp.push(Boards[i]);
            Table[Encode(Boards[i])] = true;
            // Print(Boards[i], '\t');
        }
        if(q.empty()){
            std::swap(q, temp);
            ++Cost;
            // std::cerr << "Cost" << Cost << std::endl;
        }
    }
    assert(false);
}
int main()
{
    TBoard Board = InputBoard(std::cin);
    std::cout << Solve(Board) << std::endl;
    return 0;
}

Measured memory_bytes: 14408
N,Y  = (int(T) for T in input().split())
Flag = False
for Y10 in range(0,N+1):
    for Y5 in range(0,N+1-Y10):
        Y1 = N-(Y10+Y5)
        if 10*Y10+5*Y5+Y1==Y//1000:
            Flag = True
            Disp = [str(T) for T in [Y10,Y5,Y1]]
            break
    if Flag:
        break
if Flag:
    print(' '.join(Disp))
else:
    print('-1 -1 -1')

Measured memory_bytes: 9164
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<climits>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<numeric>
#include<map>
#include<set>
#include<bitset>
#define REP(i,m,n) for(int i = m; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define LL long long
template<class T> inline void chmax(T & a, T b) { if (a < b) { a = b; } }
template<class T> inline void chmin(T& a, T b) { if (a > b) { a = b; } }
using namespace std;

int main(void) {
	/*
	a1+b1 a1+b2 a1+b3 → 3a1+b1+b2+b3
	a2+b1 a2+b2 a2+b3 → 3a2+b1+b2+b3
	a3+b1 a3+b2 a3+b3 → 3a3+b1+b2+b3

	a1+a2+a3+b1+b2+b3 = sum/3
	サラスでsum/3になるかどうか確認する
	*/

	vector<vector<int> > matrix(3, vector<int>(3));
	rep(i, 3) {
		rep(j, 3) {
			cin >> matrix[i][j];
		}
	}

	int total = 0;
	rep(i, 3) {
		rep(j, 3) {
			total += matrix[i][j];
		}
	}
	total /= 3;

	//サラスの公式
	if (matrix[0][0]+ matrix[1][1]+ matrix[2][2] != total) {
		cout << "No" << endl;
		return 0;
	}
	if (matrix[1][0] + matrix[2][1] + matrix[0][2] != total) {
		cout << "No" << endl;
		return 0;
	}
	if (matrix[0][1] + matrix[1][2] + matrix[2][0] != total) {
		cout << "No" << endl;
		return 0;
	}

	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
    string S;
    cin >> S;

    int ans = 0;
    int total = 0;
    for(int i = 0; i < S.length(); i++)
    {
        /* code */
        if(S[i] == 'A'){
            ans++;
        }else if(S[i] == 'C'){
            ans++;
        }else if(S[i] == 'G'){
            ans++;
        }else if(S[i] == 'T'){
            ans++;
        }else{
            ans = 0;
        }
        if(ans > total){
            total = ans;
        }
    }
    cout << total << endl;
    
    


}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
 
typedef pair<ll,ll> pairs;
vector<pairs> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
#define MAX_N 1000100
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
 
ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

int main(){
    ll a,b;
    cin >>a>>b;
    
    cout << (a*b%2 == 1? "Odd" : "Even") << endl;
    
    return 0;
}



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

/*
探索っぽい。
DFS・BFSで展望をクラスタリングし、各クラスタごとにひとつ「良い」展望台があるという感じ？
と思いきや、一本の道しか使ってはいけないらしい。こうなるともう探索でもないか。

要素Nの配列Gを用意する。各要素はいい展望台かどうかを表す

M個の道をみていき、AとBを比べ、Gを更新。
最後にGにある「いい展望台」の数を数える。
O(N+M)
*/


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

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

    // いい展望台か否かを表す配列。最初はみんなTrue
    vector<bool> G(N, true);

    int A, B;
    for (int i = 0; i < M; i++)
    {
        cin >> A >> B;
        A--;
        B--;

        G[A] = G[A] * (H[A] > H[B]);
        G[B] = G[B] * (H[B] > H[A]);
    }

    int res = 0;
    for (int i = 0; i < N; i++)
    {
        if ( G[i] )
            res++;
    }
    cout << res << endl;
}

Measured memory_bytes: 3768
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
	//2^aのvector.sizeがKよりでかい→絞り込み

	int A;
	cin >> A;
	cout << (A + 1) / 2;
	//N^2logN;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
#define VEC vector
#define V VEC<ll>
signed main(){
  ll N,i,ans=0,SUM=0,B;cin>>N;
  V A(N);
  REP(i,N)cin>>A.at(i);
  REP(i,N){cin>>B;A.at(i)-=B;SUM+=A.at(i);}
  if(SUM>=0){
    sort(ALL(A));ll S=0;
    i=lower_bound(ALL(A),0)-A.begin();
    while(i<N){
      S+=A.at(i);i++;
      if(S<=SUM)ans++;
      else break;
    }
    ans=N-ans;
  }
  else ans=-1;
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<vector>
using namespace std;
int main(void){
	int n;
	cin>>n;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	int ans=0;
for(int i=0;i<n;i++){
	if(a[a[i]-1]==i+1){
		ans++;
	}
}
ans/=2;
cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 640
#include<cstdio>
#include<functional>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<string>
#include<cstdlib>
#include<cctype>
#define rep(i,a) for(i=0;i<a;i++)
#define rep2(i,a) for(i=1;i<a;i++)
#define TEI 1000
using namespace std;
int main(void)
{
	int h,w,i,j,k;
	char cloud[101][101];
	int flg[101][101];
	cin>>h>>w;
	rep(i,h)cin>>cloud[i];
	rep(i,h)rep(j,w) flg[i][j]=-2;
	rep(i,h)rep(j,w) if(cloud[i][j]=='c') flg[i][j]=TEI;
	int kami,cnt;
	rep(i,h) {
		kami=0;cnt=0;
		rep(j,w) {
			if(flg[i][j]==TEI || kami==1) {
				kami=1;
				if(flg[i][j]==-2) flg[i][j]=flg[i][j-1]+1;
			}
			else flg[i][j]=-1;
		}
	}
	rep(i,h){
		if(flg[i][0]>=1000) flg[i][0]-=1000;
		cout<<flg[i][0];
		rep2(j,w) {
			if(flg[i][j]>=1000) flg[i][j]-=1000;
			cout<<" "<<flg[i][j];
		}cout<<endl;
	}
	return 0;
}
		
	

Measured memory_bytes: 3132
//phoenix




#include <bits/stdc++.h>
using namespace std;


#define spdio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pp pop_back
#define mp make_pair
#define fr(i,j,n) for(ll i=j; i<n; i++)
#define rfr(i,j,n) for(ll i=n-1; i>=0; i--)
#define vsort(v) sort(v.begin(),v.end())
#define asort(a) sort(a,a+n);


typedef long double ld;
typedef long long int ll;


//getline(cin,string);
const ll inf = (ll) 1e18 + 19;



/*
ll solveDp(ll i,ll w[],ll v[],ll n,ll wt,map <ll,map <ll,ll> > &dp) {
    if(i>=n || wt<0)
        return 0;
    if(dp[wt][i])
        return dp[wt][i];
    else if(wt<w[i])
        return dp.insert(mp([wt][i]=solveDp(i+1,w,v,n,wt,dp);
    else
        return dp[wt][i]=max(solveDp(i+1,w,v,n,wt,dp),v[i]+solveDp(i+1,w,v,n,wt-w[i],dp));
}
*/



void bfs(ll k,bool vis[],ll n,vector <ll> v[]) {
    queue <ll> q;
    q.push(k);
    while(!q.empty()) {
        ll node=q.front();
        q.pop();
        cout<<node<<" ";
        vis[node-1]=true;
        fr(j,0,v[node-1].size()) {
            if(vis[v[node-1][j]-1]!=true)
                q.push(v[node-1][j]),vis[v[node-1][j]-1]=true;
        }
    }
}




void dfs(ll k,bool vis[],ll n,vector <ll> v[]) {
    cout<<k<<" ";
    vis[k-1]=true;
    fr(i,0,v[k-1].size()) {
        if(!vis[v[k-1][i]-1])
            dfs(v[k-1][i],vis,n,v);
    }
}




void cazz() {
    ll n,i,j,k,ans=0,f=0,b,wt,m;
    cin>>n;
    fr(i,1,n+1) {
        if(i%3!=0 && i%5!=0)
            ans+=i;
    }
    cout<<ans<<"\n";
    /*cin>>n>>m;
    vector <ll> v[n];
    fr(i,0,m) {
        cin>>j>>k;
        v[j-1].pb(k);
        v[k-1].pb(j);
    }
    cout<<"\n";
    fr(i,0,n) {
        cout<<i+1<<"\t";
        fr(j,0,v[i].size()) {
            cout<<v[i][j]<<" ";
        }cout<<"\n";
    }
    cout<<"\n";
    cin>>k;
    bool vis[n]={};
    bfs(k,vis,n,v);
    cout<<"\n";
    bool vi[n]={};
    dfs(k,vi,n,v);*/
}




int main() {
    spdio;
	cazz();
	return 0;
}



Measured memory_bytes: 3592
def main():
    a, b, c, d = map(int, input().split())
    dx, dy = (c - a), (d - b)
    print("L" + "U" * (dy + 1) + "R" * (dx + 1) + "D" + "L" * dx + "D" * dy + "D" + "R" * (dx + 1) + "U" * (dy + 1) + "L" + "D" * dy + "L" * dx)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,copy
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

#素因数分解
def prime_factorize(n):
    if n == 1:
        return [1]
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
n = inp()
if n == 1:
    print(0)
    quit()
c = Counter(prime_factorize(n))
res = 0
for key in list(c):
    va = c[key]
    cnt = 0
    for i in range(1,100000):
        cnt += i
        if va < cnt:
            res += i-1
            break
print(res)

Measured memory_bytes: 77344
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>

#define MIN(a, b) ((a < b ? a : b))

int main(void) {
	uint32_t A, B, C, D;

	scanf("%"PRIu32"\n%"PRIu32"\n%"PRIu32"\n%"PRIu32, &A, &B, &C, &D);

	printf("%"PRIu32, MIN(A, B) + MIN(C, D));

	return 0;
}


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

int main(){
    int N,q;
    cin >> N >> q;
    int Q1[100000]={};
    string Q2[100000]={};
    int T=0;
    int head=0;
    int tail=N;
    for(int i=0;i<N;i++){
        cin >> Q2[i] >> Q1[i];
    }
    while(head!=tail || Q1[head]!=0 || Q1[tail]!=0){
        if(Q1[head]<=q){
            T+=Q1[head];
            cout << Q2[head] << " " << T << endl;
            Q1[head]=0;
            Q2[head]=" ";
            if(head==N){
                head=0;
            }
            else{
                head++;
            }
        }
        else{
            T+=q;
            Q1[head]-=q;
            Q1[tail]=Q1[head];
            Q2[tail]=Q2[head];
            Q1[head]=0;
            Q2[head]=" ";
            if(tail==N){
                head++;
                tail=0;
            }
            else{
                 if(head==N){
                head=0;
            }
            else{
                head++;
            }
                tail++;
            }
        }
    }
}


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

typedef long long ll;
typedef unsigned long long ull;

#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(i,0,n)
#define RREP(i,n)   RFOR(i,0,n)
#define SORT(s) sort(s.begin(), s.end())
#define P pair<int, int>
#define mp make_pair
using namespace std;

template <typename _Ty>
ostream& operator << (ostream& ostr, const vector<_Ty>& v) {if (v.empty()) {ostr << "{ }"; return ostr;}
    ostr << "{" << v.front(); for (auto itr = ++v.begin(); itr != v.end(); itr++) {ostr << ", " << *itr;}
    ostr << "}";
    return ostr;}

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; }

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

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

vector<int> uniq(vector<int> vec){
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
  return vec;}

vector<ll> divisor(ll n) {
vector<ll> ret;
for(int64_t i = 1; i * i <= n; i++) {
  if(n % i == 0) {
    ret.push_back(i);
    if(i * i != n) ret.push_back(n / i);
  }
}
  sort(begin(ret), end(ret));
  return (ret);
}
void permu(int n){
  vector<int> perm(n);
  REP(i, n) perm[i] = i;
do{
  cout << perm  << endl;
}
while (next_permutation(perm.begin(), perm.end()));
return;}

vector<pair<ll, int>> prime_div(ll n){
  vector<pair<ll, int>> res;
  for (ll i=2; i*i <= n;i++){
    if (n%i == 0){
      int a = 0;
      while(n%i == 0){
        n /= i;
        a++;
      }
      pair<ll, int> tmp;
      tmp.first = i;
      tmp.second = a;
      res.push_back(tmp);
    }
  }
  if (n != 1){
    pair<ll, int> now;
    now.first = n;
    now.second = 1;
    res.push_back(now);}
  return res;
}


// printf("%.10f\n" , ans);
int main(void){
  ios::sync_with_stdio(false);
  ll a, b, c;
  cin >> a >> b >> c;
  int ans = 0;
  REP(i, 100000){
  if (a % 2 == 0 && b % 2 == 0 && c % 2 == 0){
    int tmp_a = a/2;
    int tmp_b = b/2;
    int tmp_c = c/2;
    a = tmp_b + tmp_c;
    b = tmp_a + tmp_c;
    c = tmp_a + tmp_b;
    ans += 1;
  }
  else break;
  }
  if (ans == 100000) cout << -1 << endl;
  else cout << ans << endl;
  return 0;
}



Measured memory_bytes: 3652
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define ll long long
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl;
#define WHITE 0
#define BLACK 2
#define GRAY 1
#define repi(start,end) for(int i=start; i<end; i++)
#define repj(start,end) for(int j=start; j<end; j++)
#define repk(start,end) for(int k=start; k<end; k++)
#define repl(start,end) for(int l=start; l<end; l++)
#define RE return 0;

#define MAX 100005

map<ll,int> mp;

int main()
{
  int n;
  scanf("%d",&n);
  ll ret=0,sum=0;
  mp[0]++;
  for(int i=0;i<n;i++)
  {
      ll a;
      scanf("%lld",&a);
      sum+=a;
      ret+=mp[sum];
      mp[sum]++;
  }
  printf("%lld\n",ret);
  return 0;
}

Measured memory_bytes: 12800
#include <stdio.h>


int main(void)
{
    int N;
    long double ans = 0;
    scanf("%d", &N);
    if (N%2 == 0) ans = 0.5;
    else
    {
        ans = 0.5 * (N+1) / N;
    }
    printf("%Lf\n", ans);
}

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

int v[55];

signed main()
{
  int n, m;

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

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

  return (0);
}

Measured memory_bytes: 256
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <set>

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())

using namespace std;
typedef long long ll;

int n;

bool check753(ll v)
{
    string str = to_string(v);
    bool find7 = false;
    bool find5 = false;
    bool find3 = false;
    for (int i = 0; i < str.size(); ++i)
    {
        if (str[i] == '7') find7 = true;
        if (str[i] == '5') find5 = true;
        if (str[i] == '3') find3 = true;
    }
    
    return (find7 && find5 && find3);
}

int dfs(ll v) // 文字列sで始まる七五三数の個数
{
    if (v > n) return 0;
    
    int ret;
    if (check753(v)) ret = 1;
    else ret = 0;
    
    ret += dfs(10 * v + 7);
    ret += dfs(10 * v + 5);
    ret += dfs(10 * v + 3);
    
    return ret;
}

int main(int argc, const char * argv[]) {
    //    ifstream in("input.txt");
    //    cin.rdbuf(in.rdbuf());
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    
    cin >> n;
    
    int ans = dfs(0);
    
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
//
// Created by misclicked on 3/7/20.
//

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

#define ONLINE_JUDGE
#ifdef ONLINE_JUDGE
#define cerr if (false) cerr
#endif

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#else
    ios_base::sync_with_stdio(false);
    cin.tie();
#endif
    string s;
    deque<char> vec;
    int state = 0;
    cin >> s;
    for (auto it:s)vec.push_back(it);
    int a, b;
    char c;
    int q;
    cin >> q;
    while (q--) {
        cin >> a;
        if (a == 1)state ^= 1;
        else {
            cin >> b >> c;
            if (b == 1) {
                if (!state) {
                    vec.push_front(c);
                } else {
                    vec.push_back(c);
                }
            } else {
                if (!state) {
                    vec.push_back(c);
                } else {
                    vec.push_front(c);
                }
            }
        }
    }
    if (state)reverse(vec.begin(), vec.end());
    for (auto it:vec)
        cout << it;
    cout << endl;
}

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

int main() { 
  int N, a, f;
  cin >> N;
  
  f = 0;
  for (int i=0; i<N; i++) {
    cin >> a;
    if ((i+1) % 2 != 0 && a % 2 != 0) f++;
  }
  
  cout << f << endl;
}


Measured memory_bytes: 3632
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(int x){
  char f[10];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class S, class T> inline S chmin(S &a, T b){
  if(a>b){
    a=b;
  }
  return a;
}
template<class S, class T> inline S chmax(S &a, T b){
  if(a<b){
    a=b;
  }
  return a;
}
int W;
int H;
int N;
int X[100];
int Y[100];
int A[100];
int main(){
  int i, res, x1, x2, y1, y2;
  rd(W);
  rd(H);
  rd(N);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<(N);Lj4PdHRW++){
      rd(X[Lj4PdHRW]);
      rd(Y[Lj4PdHRW]);
      rd(A[Lj4PdHRW]);
    }
  }
  x1 = y1 = 0;
  x2 = W;
  y2 = H;
  for(i=0;i<(N);i++){
    if(A[i]==1){
      chmax(x1, X[i]);
    }
    if(A[i]==2){
      chmin(x2, X[i]);
    }
    if(A[i]==3){
      chmax(y1, Y[i]);
    }
    if(A[i]==4){
      chmin(y2, Y[i]);
    }
  }
  res = (x2 - x1) * (y2 - y1);
  if(x1 > x2 || y1 > y2){
    res = 0;
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190822-2

// --- original code ---
// int W, H, N, X[100], Y[100], A[100];
// {
//   int x1, x2, y1, y2, res;
//   rd(W,H,N,(X,Y,A)(N));
//   x1 = y1 = 0;
//   x2 = W;
//   y2 = H;
//   rep(i,N){
//     if(A[i]==1) x1 >?= X[i];
//     if(A[i]==2) x2 <?= X[i];
//     if(A[i]==3) y1 >?= Y[i];
//     if(A[i]==4) y2 <?= Y[i];
//   }
//   res = (x2 - x1) * (y2 - y1);
//   if(x1 > x2 || y1 > y2) res = 0;
//   wt(res);
// }


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll                  long long
#define dl                 double
#define pb                push_back
#define F                  first
#define S                  second
#define endl              "\n"
#define rep(i,a,b)       for(i=a;i<b;i++)
#define all(v)             v.begin(),v.end()
#define allr(v)            v.rbegin(),v.rend()
#define mod              1000000007LL
#define CIN(V,s,n)      for(int i=s;i<n;i++){cin >> V[i];}
#define COUT(V,s,n)   {for(int i=s;i<n;i++){cout <<  V[i] << " "  ;} cout << endl;}
#define fast               ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define CLEAR(V);      for(ll i=0;i<V.size();i++) V[i] = 0;
#define N                  150
#define tmod             998244353LL
using namespace std;

bool sBs(const pair<int,int> &a,const pair<int,int> &b)
{   return (a.second < b.second);   }

ll SUMD(ll n);
ll BS(vector<pair< ll ,ll > > &PS,ll s,ll e,ll ser);
ll MI(ll a, ll m);
//bool P[N+1];
void Sieve(int n=N);
ll Powb(ll b,ll n,ll m);

int main()
{
fast;
ll q=1,t;
//cin >> q;
while(q--)
{
    ll i,j,n,m,k,l,r,a,b,c=0,d=0,e,g,p,q,u,v,w,x,y,flag=1;
    //n=m=k=i=j=l=r=a=b=c=d=u=v=w=p=x=y=0;
    cin >> n >> m;
    vector<vector<ll> > G(n+1);
    vector<ll> H(n+1);
    for(i=0;i<n;i++) cin >> H[i+1];
    for(i=1;i<=m;i++)
    {
        cin >> u >> v;
        G[u].pb(v); G[v].pb(u);
    }
    for(i=1;i<=n;i++)
    {
        flag = 1;
            for(auto it:G[i])
            {
                if(H[it]>=H[i])
                {
                    flag  = 0; break;
                }
            }
            if(flag ) c++;
    }
    cout << c;
}
    return 0;
}

//*****************************************************************************************************************************************

ll Powb(ll b,ll n,ll m)
{
    if(n==0) return 1LL;
    if(n==1) return b;
    ll temp = Powb(b,n/2,m);
    if(n%2==0){return (temp*temp)%m;}
    else{return (b*((temp*temp)%m))%m;}
}

ll SUMD(ll n)
{   ll sum=0;
    while(n>0){sum += n%10;n = n/10;}
    return sum;

}
ll BS(vector<pair<ll,ll> > &PS,ll s,ll e,ll ser)
{
    if(s>e)
        return s;
    ll mid = (s+e)/2;
    if(PS[mid].F==ser)
    {
        return mid;
    }
    else if(PS[mid].F > ser)
    {
        return BS(PS,s,mid-1,ser);
    }
    else
        return BS(PS,mid+1,e,ser);
}
ll MI(ll a, ll m)
{
    ll m0 = m;
    ll y = 0, x = 1;
    if (m == 1)
      return 0;
    while (a > 1)
    {
        ll q = a / m;
        ll t = m;
        m = a % m, a = t;
        t = y;
        y = x - q * y;
        x = t;
    }
    if (x < 0)
       x += m0;
    return x;
}
/*
void Sieve(int n)
{
    memset(P,true,sizeof(P));
    P[0] = false;
    P[1]= false;
    for(ll i=2;i*i<=n;i++)
    {
        if(P[i])
        {
            for(ll j=i*i;j<=n;j+=i)
            {
                P[j]=false;
            }
        }
    }

}

*/


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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q>
ostream& operator << (ostream& os, pair<P, Q> p)
{
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

struct K {
  string s, t;
  K(){}
  K(string _s, string _t) : s(_s), t(_t) {}
};

K operator + (const K& a, const K& b)
{
  K c;
  c.s = a.s + b.s;
  c.t = a.t + b.t;
  return c;
}

ostream& operator << (ostream& os, const K& k)
{
  os << k.s << endl;
  os << k.t << endl;
  return os;
}

int main(int argc, char *argv[])
{
  int n;
  while (cin >> n) {
    K a(".", ".");
    K b(".", "#");
    K c("#", ".");
    K d("#", "#");
    vector<K> v;
    {
      char x;
      cout << a << flush;
      cin >> x;
      if (x == 'T') v.push_back(a);

      cout << b << flush;
      cin >> x;
      if (x == 'T') v.push_back(b);

      cout << c << flush;
      cin >> x;
      if (x == 'T') v.push_back(c);

      cout << d << flush;
      cin >> x;
      if (x == 'T') v.push_back(d);
    }

    K ans = v[0];
    // right
    while (true) {
      bool f = false;
      each (k, v) {
        K n = ans + k;
        cout << n << flush;
        char c;
        cin >> c;
        if (c == 'e') exit(0);
        if (c == 'T') {
          f = true;
          ans = n;
          break;
        }
      }
      if (!f) break;
    }
    // left
    while (true) {
      bool f = false;
      each (k, v) {
        K n = k + ans;
        cout << n << flush;
        char c;
        cin >> c;
        if (c == 'e') exit(0);
        if (c == 'T') {
          f = true;
          ans = n;
          break;
        }
      }
      if (!f) break;
    }
  }
  return 0;
}


Measured memory_bytes: 596
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define str string
#define fi first
#define se second
#define pb push_back
#define SET(a, b) memset(a, b, sizeof(a))
#define eps 1e-6
#define pi atan(1) * 4
#define mod 1000000007
#define inf 1000000000
#define llinf 1000000000000000000
#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 FORl(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORDl(i, a, b) for (ll i = (a); i >= (b); i--)
using namespace std;
bool used[205];
int main () {
  int x, n;
  scanf("%d %d", &x, &n);
  FOR(i, 1, n) {
    int t;
    scanf("%d", &t);
    used[t] = 1;
  }
  for (int i = 0; ; ++i) {
    if (!used[x - i]) {
      printf("%d\n", x - i);
      return 0;
    }
    if (!used[x + i]) {
      printf("%d\n", x + i);
      return 0;
    }
  }
  return 0;
}

Measured memory_bytes: 3828