akhauriyash/Code-Regression huggingface dataset:
a, b = map(int, input().split())
c = [0] * b
for i in range(a):
    d = list(map(int, input().split()))
    for j in range(1, len(d)):
        c[d[j]-1] += 1
print(sum(1 if c[i] == a else 0 for i in range(b)))



Measured memory_bytes: 3060
#include<cstdio>
#include<cmath>
#include<vector>


using namespace std;
using vi=vector<int>;
using vvi=vector<vi>;


void vi_rot(vi&a)
{
	a.push_back(a.front());
	a.erase(a.begin());
}


int main(void)
{
	int n;

	while(scanf("%d", &n)==1)
	{
		int a=int(-1+sqrt(1.001+8.0*n))/2;
		int b=n*2/a;
		vvi ans(b);
		int last=0;

		if(a*a+a!=2*n)
		{
			printf("No\n");
			continue;
		}

		printf("Yes\n%d\n", b);
		for(int i=0;i<b;i++)
		{
			for(;ans[i].size()<a-i;)
			{
				ans[i].push_back(++last);
			}
			for(int j=0;j<i;j++)
			{
				ans[i].push_back(ans[j].front());
				vi_rot(ans[j]);
			}
		}
		for(auto&ma:ans)
		{
			printf("%d %d", a, ma[0]);
			for(int i=1;i<a;i++) printf(" %d", ma[i]);
			printf("\n");
		}
	}

	return 0;
}


Measured memory_bytes: 2304
import sys
N=int(input())
data = [[] for _ in range(N)]
for i in range(N):
  cnt = int(input())
  for _ in range(cnt):
    x,y=map(int,sys.stdin.readline().rstrip().split())
    data[i].append((x-1,y))
res = 0
for bit in range(1 << N):
  count = 0
  flag = True
  for i in range(N):
    if bit & (1 << i):
      count += 1
      for xy in data[i]:
        x, y = xy
        if y ==1 and (not(bit & (1 << x))):
          flag = False
          break
        if y == 0 and (bit & (1 << x)):
          flag = False
          break
    if not flag:
      break
  if flag:
    res = max(res, count)
print(res)

Measured memory_bytes: 3064
#include<stdio.h>
#include<utility>
using namespace std;

int main(void){
  int n;
  scanf("%d",&n);
  int a[n];
  int b[n];
  for(int i = 0;i < n;i++){
    int p;
    scanf("%d",&p);
    a[i] = p;
  }
  int left = n/2-1;
  int right = n/2;
  int right1 = n/2+1;
  for(int i = 0;i <= n/2;i++){
    if(n%2 == 0){
      b[left] = a[2*i+1];
      b[right] = a[2*i];
      right++;
      left--;
    }
    else{
      b[right] = a[0];
      b[left] = a[2*i+2];
      b[right1] = a[2*i+1];
      right1++;
      left--;
    }
  }
  for(int i = 0;i < n;i++){
    int p = b[i];
    printf("%d ",p);

  }
}


Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = INT64_MAX;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;
using Vi = vector<long long int>;
typedef pair<int, int> P; typedef pair<ll, ll> PLL;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rep(i,N) for(ll i=0;i<N;i++)
auto max(auto x,auto y){if(x>y){return x;}else{return y;}}
auto min(auto x,auto y){if(x>y){return y;}else{return x;}}
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
typedef vector<vector<ll> > matrix;
void princ(auto x){cout<<x<<" ";}; void print(auto x){cout<<x<<"\n";};
///////////////////////////////////////////////////////////////////////////////////

string s;

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    cin>>s;
    bool flg = false;
    rep(i,2){
        if(s[i]!=s[i+1])flg = true;
    }
    if(flg)print("Yes");
    else print("No");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ld double
#define ull unsigned long long
#define ll long long
#define pii pair <int, int>
#define iiii pair <int, pii >
#define mp make_pair
#define INF 1000000000
#define rep(i, x) for(int (i) = 0; (i) < (x); (i)++)
#define complex hhcom
inline int getint() {
  int x = 0, p = 1; char c = getchar();
  while (c <= 32) c = getchar();
  if (c == 45) p = -p, c = getchar();
  while (c > 32) x = x * 10 + c - 48, c = getchar();
  return x * p;
}
using namespace std;
const int mod = 200003;
const int gg = 2;
inline void reduce(int &x) { x += x >> 31 & mod; }
inline int mul(int x, int y) { return 1ll * x * y % mod; }
//ruogu_alter
const double pi = acos(-1);
struct complex {
  double x, y;
  inline complex operator + (const complex &b) const {
    return (complex){x + b.x, y + b.y};
  }
  inline complex operator - (const complex &b) const {
    return (complex){x - b.x, y - b.y};
  }
  inline complex operator * (const complex &b) const {
    return (complex) {
      x * b.x - y * b.y,
      y * b.x + x * b.y
    };
  }
};
const int N = 10e5 + 5;
complex f[N];

int to[N], oto[N], rev[N];
int n;
//
inline void getrev(int len) {
  rep(i, len) rev[i] = (rev[i >> 1] >> 1) | ((i & 1) * len / 2);
}
void fft(complex *f, int len, int dft) {
  rep(i, len) if (i < rev[i]) swap(f[i], f[rev[i]]);
  for (int step = 1; step < len; step <<= 1) {
    complex wn = (complex){cos(pi / step), sin(dft * pi / step)};
    for (int i = 0; i < len; i += step << 1) {
      complex wnk = (complex){1, 0};
      for (int j = i; j < i + step; j++) {
        complex x = f[j], y = f[j + step] * wnk;
        f[j] = x + y; f[j + step] = x - y;
        wnk = wnk * wn;
      }
    }
  }
  if (dft == -1) rep(i, len) f[i].x /= len;
}
int main() {
  n = getint();
  for (int i = 0, j = 1; i < mod - 1; i++, j = mul(j, gg)) {
    to[j] = i; oto[i] = j;
  }
  ll res = 0;
  rep(i, n) {
    int x = getint();
    if (x) {
      res -= mul(x, x);
      ++f[to[x]].x;
    }
  }
  int len = 1;
  while (len < mod + mod - 3) len <<= 1;
  getrev(len);
  fft(f, len, 1);
  rep(i, len) f[i] = f[i] * f[i];
  fft(f, len, -1);
  rep(i, len) {
    res += 1ll * oto[i % (mod - 1)] * (ll)(f[i].x + 0.5);
  }
  cout << res / 2 << endl;
  return 0;
}


Measured memory_bytes: 15896
#include <iostream>

using namespace std;

int main(){
	int i,n;
	long long ans=0;
	cin >> n;
	long long a[100010],b[100010];
	for(i=0;i<n;i++){
		cin >> a[i];
		b[i] = 0;
	}
	
	for(i=0;i<n;i++){
		ans += (a[i]+b[i])/2;
		if(a[i]!=0){
			b[i+1] = (a[i]+b[i])%2;
		}
	}
	cout << ans << endl;
}

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

int main()
{long long n,k,counter=0;
cin >> n >> k;
long long arr[n];
for (int i=0; i<n; i++)
{
    cin >> arr[i];
}
sort (arr,arr+n);
if (k>=n)
{
    cout << "0";
}
else
{
    for (int i=0; i<(n-k); i++)
    {
        counter=counter+arr[i];
    }
    cout << counter;
}
    return 0;
}

Measured memory_bytes: 1792
use proconio::input;

// x ** n % mods を求める
pub fn mod_pow(x: i64, n: i64, mods: i64) -> i64 {
    if n == 0 {
        return 1;
    }
    let mut res = mod_pow(x * x % mods, n / 2, mods);
    if n % 2 == 1 {
        res = res * x % mods;
    }
    return res;
}

// (1/n) % mods を求める
pub fn mod_inv(n: i64, mods: i64) -> i64 {
    return mod_pow(n, mods-2, mods);
}

// nCk % mods を求める
pub fn mod_comb(n: i64, k: i64, mods: i64) -> i64 {
    let sum1 = (n-k+1..n+1).fold(1, |ac, x| ac * x % mods);
    let sum2 = (1..k+1).fold(1, |ac, x| ac * x % mods);
    return sum1 * mod_inv(sum2, mods) % mods;
}

// nCk の組み合わせを列挙する
pub fn combination(n: usize, k: usize) -> Vec<Vec<usize>> {
    let mut ans = Vec::new();
    if k == 1 {
        for i in 1..n+1 {
            let mut tmp = Vec::new();
            tmp.push(i);
            ans.push(tmp);
        }
    }
    else {
        for iter in combination(n-1, k-1) {
            let max = iter.iter().max().unwrap();
            for j in *max+1..n+1 {
                let mut tmp = iter.clone();
                tmp.push(j);
                ans.push(tmp);
            }
        }
    }
    ans
}


fn main() {
    input!{
        n: usize,
        x: usize,
        t: usize,
    }
    if n % x == 0 {
        println!("{}", (n / x) * t);
    }
    else {
        println!("{}", (n / x + 1) * t);
    }
}


Measured memory_bytes: 2152
class Main{
    public static void main(String[] a){
    	for(int i = 1; i < 10; i++){
    		for(int j = 1; j < 10; j++){
    			System.out.print(i);
    			System.out.print("x");
    			System.out.print(j);
    			System.out.print("=");
    			System.out.println(i*j);
    		}
    	}
    }
}

Measured memory_bytes: 16872
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#define ll long long
using namespace std;
const ll inf=1e11+10;
ll minn=inf;
ll h,w;
int main()
{
    scanf("%lld%lld",&h,&w);
    ll mins,maxs;
    ll temp1,temp2,temp3;
    ll pos;
    for(int i=1;i<h;i++)
    {
        temp1=i*w;
        pos=(h-i)/2;
        temp2=pos*w;
        temp3=(h-i-pos)*w;
        mins=min(min(temp1,temp2),temp3);
        maxs=max(max(temp1,temp2),temp3);
        minn=min(minn,maxs-mins);

        temp1=i*w;
        pos=w/2;
        temp2=(h-i)*pos;
        temp3=(h-i)*(w-pos);
        mins=min(min(temp1,temp2),temp3);
        maxs=max(max(temp1,temp2),temp3);
        minn=min(minn,maxs-mins);
    }

    for(int i=1;i<w;i++)
    {
        temp1=i*h;
        pos=(w-i)/2;
        temp2=pos*h;
        temp3=(w-i-pos)*h;
        mins=min(min(temp1,temp2),temp3);
        maxs=max(max(temp1,temp2),temp3);
        minn=min(minn,maxs-mins);

        temp1=i*h;
        pos=h/2;
        temp2=(w-i)*pos;
        temp3=(w-i)*(h-pos);
        mins=min(min(temp1,temp2),temp3);
        maxs=max(max(temp1,temp2),temp3);
        minn=min(minn,maxs-mins);
    }
    printf("%lld\n",minn);
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
				
		Scanner stdIn = new Scanner(System.in);
		int width = stdIn.nextInt();
		int height = stdIn.nextInt();
		int x = stdIn.nextInt();
		int y = stdIn.nextInt();
		int r = stdIn.nextInt();
		
		if (x < -100 || y < -100 || x > 100 || y > 100) {
			System.out.printf("Err!%n");
			return;
		} else if (width < 1 || height < 1 || r < 1 || width > 100 || height > 100 || r > 100) {
			System.out.printf("Err!%n");
			return;
		}
		if ((x + r <= width) && (y + r <= height) && (x - r >= 0) && (y - r >= 0)) {
			System.out.printf("Yes%n");
		} else {
			System.out.printf("No%n");
		}; 
		
	}
}


Measured memory_bytes: 26488
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.15f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
T[] RDA(T = long)(T fix = 0) { auto r = readln.chomp.split.to!(T[]); r[] += fix; return r; }
T[][] RDA2(T = long)(size_t n, T[] fix = []) { auto r = new T[][](n); foreach (i; 0..n) { r[i] = readln.chomp.split.to!(T[]); foreach (j, e; fix) r[i][j] += e; } return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto N = RD;
	auto A = RDA(-1);
	auto B = RDA;
	auto C = RDA;

	long ans = B.sum;
	foreach (i; 1..N)
	{
		if (A[i]-1 == A[i-1])
			ans += C[A[i-1]];
	}

	writeln(ans);
	stdout.flush();
	debug readln();
}

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

int main(){
    char b;
    cin>>b;
    if(b=='A'){
      cout<<'T'<<endl;
    }else if(b=='T'){
      cout<<'A'<<endl;
    }else if(b=='C'){
      cout<<'G'<<endl;
    }else{
      cout<<'C'<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll n;cin>>n;
    ll arr[n+1];
    map<ll,ll>mp;
    ll ans=0;
    for(ll i=1;i<=n;i++)
    {
        cin>>arr[i];
        mp[arr[i]]++;

    }
     for(auto it:mp)
      {
          if(it.second>=2)
          {
              ans+=(it.second*(it.second-1))/2;

          }
      }
    for(ll i=1;i<=n;i++)
    {
      ll x=0,y=0,z=0,w=0;
      if(mp[arr[i]]>=2)
      {
          x=mp[arr[i]];

          z=(x*(x-1))/2;
      }
      y=mp[arr[i]]-1;
      if(y>=2)
      {
          w=(y*(y-1))/2;
      }
      cout<<(ans-z+w)<<endl;
    }
}


Measured memory_bytes: 11776
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#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(a) (a).begin(),(a).end()
#define bit(k) (1LL<<(k))
#define SUM(v) accumulate(all(v), 0LL)

typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
struct fast_ios{ fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; }fast_ios_;

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 TOSTRING(x) string(#x)
template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (T &x : vec) is >> x; return is; }
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) { os  << "["; for(auto _: v) os << _ << ", "; os << "]"; return os; };
template <typename T> ostream &operator<<(ostream &os, set<T> &st) { os << "("; for(auto _: st) { os << _ << ", "; } 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, typename U> ostream &operator<<(ostream &os, const map<T, U> &mp){ os << "["; for(auto _: mp){ os << _ << ", "; } os << "]" << endl; return os; }

#define DUMPOUT cerr
void dump_func(){ DUMPOUT << endl; }
template <class Head, class... Tail> void dump_func(Head &&head, Tail &&... tail) { DUMPOUT << head; if (sizeof...(Tail) > 0) { DUMPOUT << ", "; } dump_func(std::move(tail)...); }

#ifdef DEBUG
#define dbg(...) dump_func(__VA_ARGS__)
#define dump(...) DUMPOUT << string(#__VA_ARGS__) << ": "; dump_func(__VA_ARGS__)
#else
#define dbg(...)
#define dump(...)
#endif

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const long double PI = acos(-1.0);

/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/


int D[111][2];
int main() {
    int N;
    cin >> N;
    bool ok = false;
    rep(i,N){
        cin >> D[i][0] >> D[i][1];
    }
    rep(i,N-2){
        if(D[i][0] == D[i][1]){
            if(D[i+1][1] == D[i+1][0]){
                if(D[i+2][0] == D[i+2][1]){
                    ok = true;
                }
            }
        }
    }
    if(ok)cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 3652
/*
ID: wangjun30
LANG: C++11
TASK:
*/
#include<iostream>
#include<algorithm>
#include<array>
#include<unordered_map>
#include<map>
#include<set>
#include<list>
#include<stack>
#include<unordered_set>
#include<vector>
#include<bitset>
#include<queue>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<climits>
//#include<fstream>
#define int long long
using namespace std;
//ifstream cin(".in");
//ofstream cout(".out");
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	if(a==0)
		cout<<1;
	if(b==0)
		cout<<2;
	if(c==0)
		cout<<3;
	if(d==0)
		cout<<4;
	if(e==0)
		cout<<5;
	return 0;
}

Measured memory_bytes: 3636
import math
while True:
    n = int(input())
    if n == 0:
        break
    arr = list(map(int, input().split()))
    m = sum(arr) / n
    acum = 0
    for x in arr:
        acum += pow(x-m, 2)
    print(f'{math.sqrt(acum/n)}')


Measured memory_bytes: 5704
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cout<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}


typedef long long int64;


int main() {
    int n,k,s;
    cin >> n >> k >> s;
    vector<int64> a(n);
    for (int i=0; i<k; i++) {
        a[i] = s;
    }

    int si = (s==1? s+1 : s-1);
    for (int i=k; i<n; i++) {
        a[i] = si;
    }

    for (auto ai : a) cout << ai << " ";
    cout << endl;
}

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

long long N, mod, x[1 << 18], y[1 << 18], dp[1 << 18], ans[1 << 18];
vector<int>X[1 << 18], Y[1 << 18]; bool used[1 << 18];

void dfs(int pos) {
	used[pos] = true;
	long long V = 1;
	for (int i = 0; i < X[pos].size(); i++) {
		if (used[X[pos][i]] == true) continue;
		Y[pos].push_back(X[pos][i]);
		dfs(X[pos][i]);
		V *= (dp[X[pos][i]] + 1); V %= mod;
	}
	dp[pos] = V;
}

void dfs2(int pos, long long ret) {
	vector<long long>L(Y[pos].size(), 0), R(Y[pos].size(), 0);
	for (int i = 0; i < Y[pos].size(); i++) { L[i] = 0; R[i] = 0; }
	long long V1 = 1;
	for (int i = 0; i < Y[pos].size(); i++) {
		V1 *= (dp[Y[pos][i]] + 1LL); V1 %= mod;
		L[i] = V1;
	}
	long long V2 = 1;
	for (int i = Y[pos].size() - 1; i >= 0; i--) {
		V2 *= (dp[Y[pos][i]] + 1LL); V2 %= mod;
		R[i] = V2;
	}
	
	for (int i = 0; i < Y[pos].size(); i++) {
		long long G1 = 1; if (i >= 1) G1 = L[i - 1];
		long long G2 = 1; if (i < (int)Y[pos].size() - 1) G2 = R[i + 1];
		ans[Y[pos][i]] = (((G1 * G2) % mod) * ret + 1); ans[Y[pos][i]] %= mod;
	}
	for (int i = 0; i < Y[pos].size(); i++) dfs2(Y[pos][i], ans[Y[pos][i]]);
}

int main() {
	cin >> N >> mod;
	for (int i = 1; i <= N - 1; i++) {
		cin >> x[i] >> y[i];
		X[x[i]].push_back(y[i]);
		X[y[i]].push_back(x[i]);
	}
	dfs(1); ans[1] = 1;
	dfs2(1, 1);
	for (int i = 1; i <= N; i++) cout << (dp[i] * ans[i]) % mod << endl;
	return 0;
}

Measured memory_bytes: 37504
/*input
3
21 -11
81234 94124 52141


*/
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char const *argv[]) {
  int n, t, a;
  scanf("%d%d%d", &n, &t, &a);

  double min_dt = DBL_MAX;
  int min_id = 0;
  for (int i = 0; i < n; ++i) {
    int h;
    scanf("%d", &h);
    double dt = fabs((t - h * 0.006) - a);
    if (dt < min_dt) {
      min_dt = dt;
      min_id = i;
    }
  }

  printf("%d\n", min_id + 1);

  return 0;
}

Measured memory_bytes: 256
// * Act locally, think globally.

#include <bits/stdc++.h>

using namespace std;

#define fastio ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

signed main()
{
    set<string> st;
    int n;
    cin >> n;
    string s;
    while (cin >> s)
    {
        st.insert(s);
    }
    cout << st.size();
    return 0;
}

Measured memory_bytes: 19224
import java.util.*;
import java.lang.*;

import static java.lang.StrictMath.abs;

class Main {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String b = sc.next();
        String c = sc.next();
        String a2 = a.substring(0,1);
        String b2 = b.substring(0,1);
        String c2 = c.substring(0,1);
        System.out.println(a2.toUpperCase() + b2.toUpperCase() + c2.toUpperCase());
//        char[] a3 = a2.toCharArray();
//        char[] b3 = b2.toCharArray();
//        char[] c3 = c2.toCharArray();
//        System.out.print(a3[0] + 32 );
//        System.out.print(b3[0] +32);
//        System.out.println(c3[0] + 32);




    }
}

Measured memory_bytes: 21588
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0;i < n;i++)
#define rev(i, n) for(int i = n;i >= 0;i--)
#define repeat(i, m, n) for(int i = m;i < n;i++)
#define repeatrev(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define itn int

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
typedef priority_queue<int> Pr;

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int x, y;
    cin >> x >> y;
    cout << x + y /2 << endl;

}

Measured memory_bytes: 256
D[13][3]={{1,0,0},{0,1,0},{0,0,1},{1,1,0},{1,0,1},{0,1,1},{1,-1,0},{1,0,-1},{0,1,-1},{1,1,1},{-1,1,1},{1,-1,1},{1,1,-1}};
M[9][9][9],q[2];main(n,m,p,I,x,y,i,j,c,d){for(;scanf("%d%d%d",&n,&m,&p),n;){
	for(memset(M,0,sizeof(M)),c=1,I=0;I<p;c*=-1){
		scanf("%d%d",&x,&y),I++;
		for(i=1;;i++)if(!M[x][y][i]){M[x][y][i]=c;break;}
		for(d=0;d<13;d++){
			for(j=0;j<2;j++)for(q[j]=0;q[j]<m;q[j]+=2*j-1)if(M[x+D[d][0]*q[j]][y+D[d][1]*q[j]][i+D[d][2]*q[j]]!=c)break;
			if(q[1]-q[0]-1>=m){printf("%s %d\n",c==1?"Black":"White",I);goto next;}
		}
	}
	puts("Draw");
next:
	for(;I<p;I++)scanf("%d%d",&x,&y);
}exit(0);}

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

string a;
int cd,zt;

int main()
{
	cin>>a;
	cd=a.size();
	for (int i=0;i<cd;i++)
	{
		if (a[i]=='C')
		zt=1;
		if (a[i]=='F'&&zt==1)
		{
			cout<<"Yes";
			return 0;
		}
	}
	cout<<"No";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define SORT(x) sort(x.begin(),x.end())
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
using Graph = vector<vector<ll>>;
int n;ll k;
vector<ll> color;
// 深さ優先探索
vector<bool> seen;
void dfs(const Graph &G, int v) {
    seen[v]=true; // v を訪問済にする
    ll c;
    if(v!=0){c=k-2;}else{c=k-1;}
    // v から行ける各頂点 next_v について
    int cc=0;
    for (int i=0;i<G[v].size();i++){ 
        int next_v=G[v][i];
        if (seen[next_v])continue;// next_v が探索済だったらスルー
        color[next_v]=c-cc;
        cc++;
        dfs(G, next_v); // 再帰的に探索
    }
}
int main(){
    cin>>n>>k;
    seen.resize(n);color.resize(n);Graph v(n);
    rep(i,n){seen[i]=false;color[i]=0;}
    rep(i,n-1){
        int a,b;cin>>a>>b;a--;b--;
        v[a].push_back(b);v[b].push_back(a);
    }
    color[0]=k;
    dfs(v,0);
    ll ans=1;
    rep(i,n){ans=(ans*color[i])%mod;}
    cout<<ans<<endl;
    return 0;
}


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

const double pi = 3.14159265;

void print(pair<double, double> p) {
    printf("%.8lf %.8lf\n", p.first, p.second);
}

void koch(int n, pair<double, double> p1, pair<double, double> p2) {
    if (n == 0) {
        pair<double, double> end = {100,0};
        print(p1);
        if (p2 == end) print(p2);
    } else {
        pair<double, double> s, t, u;
        s.first = (2 * p1.first + p2.first) / 3;
        s.second = (2 * p1.second + p2.second) / 3;
        t.first = (p1.first + 2 * p2.first) / 3;
        t.second = (p1.second + 2 * p2.second) / 3;
        u.first = (t.first - s.first) * cos(pi/3) - (t.second - s.second) * sin(pi/3) + s.first;
        u.second = (t.first - s.first) * sin(pi/3) + (t.second - s.second) * cos(pi/3) + s.second;
        koch(n-1, p1, s);
        koch(n-1, s, u);
        koch(n-1, u, t);
        koch(n-1, t, p2);
    }
}

int main() {
    int n;
    scanf("%d", &n);
    const pair<double, double> p1 = {0, 0}, p2 = {100, 0};
    koch(n, p1, p2);
}


Measured memory_bytes: 3164
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
  
n, k = map(int, input().split())

print(len(Base_10_to_n(n,k)))

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h,w;cin >> h >> w;
	vector<string> s(h+1);
	rep(i,h) cin >> s.at(i);
	rep(i,h){
		s[i]+='.';
	}
	rep(i,w+1){
		s[h]+='.';
	}
	int cnt=0,sum=1;
	rep(i,h){
		rep(j,w){
			if(s[i][j]=='#') cnt++;
		}
	}
	int i=0,j=0;
	bool ans=true;
	while(i!=h-1 || j!=w-1){
		if(s[i+1][j]=='#' && s[i][j+1]=='#'){
			ans=false;
			break;
		}
		else if(s[i+1][j]=='.' && s[i][j+1]=='.'){
			ans=false;
			break;
		}
		else if(s[i+1][j]=='#'){
			i++;
			sum++;
		}
		else{
			j++;
			sum++;
		}
	}
	if(ans && cnt==sum) cout << "Possible" << endl;
	else cout << "Impossible" << endl;
}

Measured memory_bytes: 256
// Created by Tanuj Jain
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int INF = 0x3f3f3f3f;
int knight_moves[8][2]={{-2,-1},{-1,-2},{1,-2},{2,-1},{-2,1},{-1,2},{1,2},{2,1}};
int moves[4][2]={{0,1},{0,-1},{1,0},{-1,0}};
int main()
{
	ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

	//#ifndef ONLINE_JUDGE
	//freopen("inputf.in","r",stdin);
	//freopen("outputf.in","w",stdout);
	//#endif

	int t;
	cin>>t;
	int n[5]={0};
	while(t--)
	{
		string st1;
		cin>>st1;
		if(st1=="AC")
			n[0]++;
		else if(st1=="WA")
			n[1]++;
		else if(st1=="TLE")
			n[2]++;
		else if(st1=="RE")
			n[3]++;

	}
	cout<<"AC x "<<n[0]<<endl;
	cout<<"WA x "<<n[1]<<endl;
	cout<<"TLE x "<<n[2]<<endl;
	cout<<"RE x "<<n[3]<<endl;
	
}	

Measured memory_bytes: 3656
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(obj) (obj).begin(),(obj).end()


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  string s,t;
  stringstream r;
  cin>>s>>t;
  rep(i,n)r<<s.at(i)<<t.at(i);
  cout<<r.str()<<endl;

   return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#define MAX 2000001
#define VMAX 10000

int main(){
  unsigned short *A, *B;

  int C[VMAX+1];
  int n, i ,j;
  scanf("%d", &n);

  A=malloc(sizeof(short)*n+1);
  B=malloc(sizeof(short)*n+1);

  for(i=0; i<=VMAX; i++)
    C[i]=0;

  for(i=0; i<n; i++)
  {
    scanf("%hu", &A[i+1]);
    C[A[i+1]]++;
  }

  for(i=1; i<=VMAX; i++)
    C[i]=C[i]+C[i-1];

  for(j=1; j<=n; j++)
  {
    B[C[A[j]]]=A[j];
    C[A[j]]--;
  }

  for(i=1; i<=n; i++)
  {
    if(i > 1)
    printf(" ");

    printf("%d",B[i]);
  }
  printf("\n");

  return 0;
}



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

pair<ll, ll> po[1 << 18];
ll a[1 << 18];

void update(P &p, ll a){
    if(p.first < a){
        p.second = p.first;
        p.first = a;
    }else if(p.second < a){
        p.second = a;
    }
}

void update(P &p1, P p2){
    vector<ll> v = {p1.first, p1.second};
    if(p1.first != p2.first && p1.second != p2.first) v.push_back(p2.first);
    if(p1.first != p2.second && p1.second != p2.second) v.push_back(p2.second);
    sort(v.begin(), v.end(), [](ll x, ll y){return a[x] > a[y];});
    p1.first = v[0];
    p1.second = v[1];
}

int main(){
    ll N;
    cin >> N;
    for(ll i = 0; i < (1 << N); i++) cin >> a[i];
    for(ll i = 0; i < (1 << N); i++) po[i].first = i;
    for(ll i = 0; i < N; i++) for(ll j = 0; j < (1 << N); j++) if(!((j >> i) & 1)) update(po[j | (1 << i)], po[j]);
    ll sum[1 << N] = {};
    for(ll i = 1; i < (1 << N); i++){
        sum[i] = max(sum[i - 1], a[po[i].first] + a[po[i].second]);
        cout << sum[i] << endl;
    }
    return 0;
}


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

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

	if (a > b) {
		cout << "a > b" << endl;
	}
	else if (a < b) {
		cout << "a < b" << endl;
	}
	else {
		cout << "a == b" << endl;
	}

	return 0;
}


Measured memory_bytes: 3084
#include <bits/stdc++.h>
using namespace std;
int judge(int x, int y, int z){
    if (x != y & y != z & z != x){
        vector <int> v;
        v.push_back(x);
        v.push_back(y);
        v.push_back(z);
        sort(v.begin(), v.end());
        if (v[2] < v[0] + v[1]){
            return 1;
        }
        else {return 0;}
    }
    else {
        return 0;
    }
}

int main(){
    int n;
    cin >> n;
    vector <int> v;
    for (int i = 0; i < n; i++){
        int N;
        cin >> N;
        v.push_back(N);
    }
    int a = 0;
    for (int j = 0; j < n; j++){
        for (int k = 0; k < n; k++){
            for (int l = 0; l < n; l++){
                if (j != k & j != l & k != l){
                    a += judge(v[j], v[k], v[l]);
                }
            }
        }
    }
    int A = a / 6;
    cout << A << endl;
}

Measured memory_bytes: 3632
while True:
    x, y, s = map(int, input().split())
    
    if x==0 and y==0 and s==0:
        break
    
    List = list(range(1,s))
    
    if s%2==1:
        a = int((s-1)/2)
        c = s-1
        table = List[a:c]
        del(List[a:c])
    
    if s%2==0:
        b = int(s/2)
        c = s-1
        table = List[b:c]
        del(List[b:c])
    
    for i in range(len(table)-1,-1,-1):
        List.append(table[i])
    L = len(List)
    
    for i in range(L):
        p = List[i]/(1+(x/100))
        if p%1==0:
            List.pop(i)
            List.insert(i,int(p))
        if p%1>0 :
            q = int(p)+1
            if int((q*(100+x))//100) == int(List[i]) :
                List.pop(i)
                List.insert(i,q)
            else:
                List.pop(i)
                List.insert(i,0)
    if s%2==0:
        List.append(List[b-1])
    
    LIST = []
    
    if s%2==1:
        for i in range(a):
            if List[i]==0 or List[i+a]==0:
                continue
            else:
                sum = int((List[i]*(100+y))//100) + int((List[i+a]*(100+y))//100)
                LIST.append(sum)
    
    if s%2==0:
        for i in range(b):
            if List[i]==0 or List[i+b]==0:
                continue
            else:
                sum = int((List[i]*(100+y))//100) + int((List[i+b]*(100+y))//100)
                LIST.append(sum)
    print(max(LIST))


Measured memory_bytes: 5644
import java.util.Scanner;

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

		int n = scanner.nextInt();
		int k = scanner.nextInt();
		String s = scanner.next();

		char conv = Character.toLowerCase(s.charAt(k - 1));
		String pre = (k == 1 ? "" : s.substring(0, k - 1));
		String next = (k == n ? "" : s.substring(k));

		System.out.println(pre + conv + next);
	}
}

Measured memory_bytes: 22612
#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<iterator>
#include<math.h>

using namespace std;
#define int long long
/*                      */    //#undef int
#define INF 1000000009
#define INFL 1000000000000000018ll
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define mk(a, b) make_pair(a, b)
typedef pair<int, int> PA;
typedef priority_queue<int> PQ;
typedef priority_queue<PA, vector<PA>, greater<PA> >PQG;

int n, a[200005], ans = 1;

signed main()
{
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a[i];
    }
    int l = 0, r = 0;
    int bit = a[0];
    for(l = 0; l < n && l <= r; l++){
        while(r + 1 < n && !(bit & a[r + 1])){
            r++;
            bit |= a[r];
            ans += r - l + 1;
        }
        bit ^= a[l];
        if(l == r && r + 1 < n){
            r++;
            ans++;
            bit = a[r];
        }
    }
    cout << ans << endl;


    return 0;
}



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

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define _dec(i,N,j) for(int i = (N-1);i >= (j);i--)
#define _rec(i,N,j) for(int i = (N);i >=(j);i--)
#define ALL(x) x.begin(),x.end()
#define MEM(a,n) memset(a,n,sizeof(a))
#define fst first
#define scd second
#define PB push_back
#define MP make_pair

typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

int get_int(){int x;scanf("%d",&x);return x;}
LL get_ll(){LL x;scanf("%lld",&x);return x;}
double get_db(){double x;scanf("%lf",&x);return x;}

template<typename T> int chmin(T &a,T b){if(a > b){a = b;return 1;}else return 0;}
template<typename T> int chmax(T &a,T b){if(a < b){a = b;return 1;}else return 0;}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {_for(i,0,v.size()) os << v[i] << " ";return os;}
template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){for(auto a:v) os << a <<" ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& v){os << v.fst <<" "<<v.scd << " ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const map<T1,T2>& v){for(auto a:v) cout << a << endl;return os;}

static const int dx[8] = { -1,  0, 1, 0,  1, -1,  1, -1};
static const int dy[8] = {0,  1, 0,  -1,  1, -1, -1,  1};
const double pi  = acos(-1.0);
const double eps = 1e-8;
const LL  INF  = 0x3f3f3f3f3f3f3f3f;
const int inf  = 0x3f3f3f3f;


int main()
{
    int A,B,C;
    cin >> A >> B >> C;
    int ok = 1;
    if(A == B || B == C || A == C){
        ;
    }else{
        ok = 0;
    }
    if(A == B && B == C){
        ok = 0;
    }
    if(ok) cout <<"Yes"<<endl;
    else cout << "No"<<endl;


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,-1,sizeof(x))
const int INF = 1000000001;

int main(){
  int a;
  cin >> a;
  cout << "Christmas";
  rep(i, 25-a) cout << " Eve";
  cout <<endl;
}

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

int main() {
    lint T;
    cin >> T;

    while(T--) {
        lint A, B, C, D;
        cin >> A >> B >> C >> D;

        bool c0 = (A >= B);
        bool c1 = (B <= D);
        lint G = __gcd(B, D);
        lint mx = B + A%G - G;
        bool c2 = (B <= C || mx <= C);

        cout << (c0 && c1 && c2 ? "Yes" : "No") << endl;
    }
}

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

int main(){
    string S,T;
    cin >> S;
    cin >> T;
    int N = S.length();
    int t=1;
    for(int i=0;i<N;i++){
        if(S[i]!=T[i]){t=0;}
    }
    if(t){cout << "Yes" << endl;}
    else{cout << "No" << endl;}

    return 0;


}

Measured memory_bytes: 3632
#include<iostream>
#include<vector>

int main(){
	int card[201];
	int n, m;
	std::cin >> n >> m;
	for (int i = 1; i <= 2 * n; ++i)card[i - 1] = i;
	for (int i = 0; i < m; ++i){
		int k;
		std::cin >> k;
		if (k == 0){
			std::vector<int> pre(n), bac(n);
			for (int i = 0; i < n; ++i){
				pre[i] = card[i];
				bac[i] = card[i + n];
			}
			for (int i = 0; i < 2 * n; ++i){
				if (i % 2 == 0)card[i] = pre[i / 2];
				else card[i] = bac[i / 2];
			}
		}
		else{
			std::vector<int> pre(k), bac(2*n-k);
			for (int i = 0; i < k; ++i)pre[i] = card[i];
			for (int i = k; i < 2 * n; ++i)bac[i - k] = card[i];
			for (int i = 0; i < 2 * n; ++i){
				if (i < 2*n-k)card[i] = bac[i];
				else card[i] = pre[i - (2 * n - k)];
			}
		}
	}
	for (int i = 0; i < 2 * n; ++i){
		std::cout << card[i] << std::endl;
	}
	return 0;
}

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

int main() {
  char S;
  cin >> S;
  
  if(S=='A'){cout << 'T' <<endl;}
  else if(S=='T'){cout << 'A' <<endl;}
  else if(S=='G'){cout << 'C' <<endl;}
  else if(S=='C'){cout << 'G' <<endl;}
          
}

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

#define L(i) (i<<1)+1
#define R(i) (i+1)<<1

using namespace std;

vector<int> A;

vector<int> tree;

int gcd (int a, int b) {
	while (b) {
		a %= b;
        	swap(a, b);
   	}
    	return a;
}

void create(int i,int a,int b){
	if(a==b){
		tree[i]=A[a];
		return;
	}
	int m=(a+b)/2;
	create(L(i),a,m);
	create(R(i),m+1,b);
	tree[i]=gcd(tree[L(i)],tree[R(i)]);
}

int rmq(int i,int a,int b,int qa,int qb){
	if(qb < a || b < qa)return 0;
	if(qa <= a && b<=qb){
		return tree[i];
	}
	int m=(a+b)/2;
	int gL = rmq(L(i),a,m,qa,qb);
	int gR = rmq(R(i),m+1,b,qa,qb);
	return gcd(gL,gR);
}

void update(int i,int a,int b,int ua,int ub,int v){
	if(ub<a || b<ua)return;

	if(ua<=a && b<=ub){
		tree[i]=v;
		return;
	}
	int m=(a+b)/2;
	update(L(i),a,m,ua,ub,v);
	update(R(i),m+1,b,ua,ub,v);
	tree[i]=gcd(tree[L(i)],tree[R(i)]);
}

int main(){
	int n;
	cin >> n;
	A.resize(n);
	for(int i=0;i<n;i++){
		cin >> A[i];
	}
	
	tree.assign(4*n,0);
	create(0,0,n-1);

	int ans=0;

	for(int i=0;i<n;i++){
		update(0,0,n-1,i,i,0);
		ans=max(ans,rmq(0,0,n-1,0,n-1));
		//cerr << rmq(0,0,n-1,0,n-1) << endl;
		update(0,0,n-1,i,i,A[i]);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 2176
using System;
using System.Collections.Generic;
using System.Linq;
 
namespace abc047
{
    public class Program
    {
        public static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
 
            List<int> list = new List<int>();
            list.Add(Convert.ToInt32(str[0]));
            list.Add(Convert.ToInt32(str[1]));
            list.Add(Convert.ToInt32(str[2]));
 
            int avg = (from item in list select item).Sum() / 2;
 
            if (avg * 2 != (from item in list select item).Sum()) {
                Console.WriteLine("No");
            }
            else if ((from item in list where item == avg select item).Count() > 0)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}

Measured memory_bytes: 3288
#include <bits/stdc++.h>
#define ll long long
double rad(const double& a, const double& b)
{
    return std::pow(a * a + b * b, 0.5);
}


int main()
{
    int n;
    double d;
    ll ans = 0;
    //std::vector<std::array<ll, 2>> P;
    std::cin >> n >> d;
    for (int i = 0; i < n; ++i) {
        std::array<double, 2> temp;

        std::cin >> temp[0] >> temp[1];
        if (rad(temp[0], temp[1]) <= d) {
            ++ans;
        }
        //P.push_back(temp);
    }
    std::cout << ans << std::endl;
}

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

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))

#define INF 2e9
#define INF_LL 1LL<<60
#define ll long long

typedef pair<ll, ll> P;

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

    int a[n], b[n];
    REP(i, n) cin >> a[i];
    REP(i, n) cin >> b[i];

    int ans = 0;
    int tmp = 0;

    REP(i, n) {
        tmp = 0;
        REP(j, i+1) {
            tmp += a[j];
        }
        REPN(k, i, n) {
            tmp += b[k];
        }
        ans = max(ans, tmp);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <cstring>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-9;

signed main() {
    vi a(3), b(3), c(3);
    cin >> a[0] >> a[1] >> a[2];
    cin >> b[0] >> b[1] >> b[2];
    cin >> c[0] >> c[1] >> c[2];
    
    int n;
    cin >> n;
    vi d(n);
    rep (i, n) {
        cin >> d[i];
        rep (j, 3) {
            if (a[j] == d[i]) a[j] = -1;
            if (b[j] == d[i]) b[j] = -1;
            if (c[j] == d[i]) c[j] = -1;
        }
    }
    if ((a[0] == a[1] && a[0] == a[2]) || (b[0] == b[1] && b[0] == b[2]) || (c[0] == c[1] && c[0] == c[2])) {
        cout << "Yes";
        return 0;
    }
    if ((a[0] == b[0] && a[0] == c[0]) || (a[1] == b[1] && a[1] == c[1]) || (a[2] == b[2] && a[2] == c[2])) {
        cout << "Yes";
        return 0;
    }
    if ((a[0] == b[1] && a[0] == c[2]) || (a[2] == b[1] && a[2] == c[0])) {
        cout << "Yes";
        return 0;
    }
    
    cout << "No";
}


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

#define ll              long long int
#define ull             unsigned long long int
#define pii             pair < int, int>
#define pll             pair < ll, ll>
#define sc              scanf
#define scin(x)         sc("%d",&(x))
#define scln(x)         sc("%lld",&(x))
#define pf              printf
#define NL              pf("\n")
#define ms(a,b)         memset(a,b,sizeof(a))
#define pb(a)           push_back(a)
#define mp              make_pair
#define db              double
#define EPS             10E-10
#define ff              first
#define ss              second
#define sqr(x)          (x)*(x)
#define vi              vector< int >
#define vl              vector< ll >
#define vii             vector<vector< int > >
#define vll             vector<vector< ll > >
#define DBG             pf("HI\n")
#define MOD             1000000007
#define CIN             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define RUN_CASE(t,T)   for(__typeof(t) t=1;t<=T;t++)
#define CASE(t)         printf("Case %d: ",t)
#define CASEL(t)        printf("Case %d:\n",t)
#define intlimit        2147483648
#define longlimit       9223372036854775808
#define infinity        (1<<28)
#define gcd(a, b)       __gcd(a,b)
#define lcm(a, b)       ((a)*(b)/gcd(a,b))
#define mx              1234567899
#define TC              int t;scin(t);while(t--)
#define PI              2*acos(0.0)
#define rep(i,a,b)      for( i=a; i<=b; i++)
#define rev(i,a,b)      for( i=a; i>=b; i--)
#define file            freopen("E:\\file.txt", "r", stdin);ios_base::sync_with_stdio(false); cin.tie(NULL);
#define all(x)          x.begin(),x.end()
#define DEBUG(args...)    do {   cerr << #args << ' ' ;  print(args); } while(0); cerr<< endl ;
using namespace std;
int get(int n,int p){int res = 0;while(n>=p) res+=n/p,n/=p;return res;}
template<class T> T power(T N,T P){ return (P==0)?  1: N*power(N,P-1); }
void VC(vector<ll> &v){for(int i=0;i<v.size();i++) printf("%lld ", v[i]);printf("\n");}

template< typename T > void print(const T& v) {    cerr << v << ' ' ;}
template< typename T1, typename... T2 >
void print( const T1& first, const T2&... rest ){
    print(first);
    print(rest...) ;
}
///--------------Graph Moves--------------------------------------
///const int fx[] = {+1,-1,+0,+0};
///const int fy[] = {+0,+0,+1,-1};
///const int fx[] = {+0,+0,+1,-1,-1,+1,-1,+1}; ///King's move
///const int fy[] = {-1,+1,+0,+0,+1,+1,-1,-1}; ///king's Move
///const int fx[] = {-2,-2,-1,-1,+1,+1,+2,+2}; ///knight's move
///const int fy[] = {-1,+1,-2,+2,-2,+2,-1,+1}; ///knight's move
///---------------------------------------------------------------

long long BigMod(long long int a, long long int b, int M) { long long remainder, answer = 1;remainder = a%M; while(b!=0){if(b%2==1) answer = (answer*remainder)%M;remainder = (remainder*remainder)%M;b/=2;}return answer;}
bool cmp(int a,int b)
{
    return a>b;
}

int main()
{
    int n, m;
    cin >> n >> m;
    cout << (n*3 + m)/2 << endl;
    return 0;
}



Measured memory_bytes: 256
import numpy as np
N = int(input())
A = np.array(input().split(), dtype=np.int32)
B = np.array(input().split(), dtype=np.int32)
	
def f(t,A,B):
  power = 1<<t
  mask = (power<<1)-1
  AA = A & mask
  BB = B & mask
  AA.sort()
  BB.sort()

  x1,x2,x3 = (np.searchsorted(BB, v-AA).sum() for v in [power, 2*power, 3*power])
  zero_cnt = x1 + (x3-x2)
  return (N-zero_cnt)%2
  
answer = sum(f(t,A,B) << t for t in range(29))
print(answer)


Measured memory_bytes: 35924
N, K = map(int, input().split())
D = list(map(int, input().split()))

k = N
"""while k > 0:
    lst.append(k % 10)
    k //= 10
#lst.reverse()"""
#print(lst)

while 1:
    flg = True
    lst = []
    N = k
    while k > 0:
        lst.append(k % 10)
        k //= 10
    lst.reverse()
    # print(lst)
    for i in range(len(lst)):
        if lst[i] in D:
            flg = False
            break
    if flg == False:
        k = N
        k += 1
    else:
        break
print(N)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int a[200010];
int main()
{
	int n;
	scanf("%d",&n);
	int sum=0;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		sum^=a[i];
	}
	for(int i=1;i<=n;i++)
	printf("%d ",sum^a[i]);
}

Measured memory_bytes: 4524