akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main(){
  int N;
  ll a[SIZE], b[SIZE] = {}, sum = 0;

  scanf("%d", &N);

  for(int i=0; i<N; i++) {
    scanf("%lld", a+i);
    b[i] = a[i];
    sum ^= a[i];
  }

  N = max(N, 61);


  for(int i=0; i<=60; i++) {
    if(sum & (1LL << i)) {
      b[N++] = 1LL << i;
    }
  }


  for(int i=0; i<=60; i++) {
    int id = -1;

    for(int j=0; j<N; j++) {
      if (b[j] < (1LL << ((60-i)+1)) && (1LL << (60-i)) & b[j]) {
        id = j;
        break;
      }
    }

    if (id == -1) continue;

    swap(b[i], b[id]);

    for(int j=0; j<N; j++) {
      if (j == i) continue;
      if((1LL << (60-i)) & b[j]) b[j] ^= b[i];
    }
  }

  for(int i=0; i<N; i++) {
    debug(b[i]);
  }

  ll ans = 0;

  for(int i=0; i<=60; i++) {
    if(!((1LL << (60-i)) & sum)) {
      ans ^= b[i];
      sum ^= b[i];
    }
  }

  cout << ans + sum << endl;

  return 0;
}


Measured memory_bytes: 3328
#include "bits/stdc++.h"
using namespace std;

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

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

    int n,m,q;cin>>n>>m;
    vector<int> g[111111];
    for(int i=0;i<m;i++){
        int a,b;cin>>a>>b;a--;b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    cin>>q;
    vector<P> res(n,P(0,-1));
    vector<int> v(q),d(q),c(q);
    for(int i=0;i<q;i++){
        cin>>v[i]>>d[i]>>c[i];
        v[i]--;
    }
    for(int i=q-1;i>=0;i--){
        queue<P> que;//(頂点, 距離)
        que.push(P(v[i],d[i]));
        while(!que.empty()){
            P p=que.front();que.pop();
            P st=res[p.first]; // 調べる頂点の(色、距離) 
            if(st.second >= p.second) continue;
            if(st.first==0) res[p.first].first=c[i];
            res[p.first].second=p.second;
            for(int j=0;j<(int)g[p.first].size();j++){
                int next=g[p.first][j];
                if(res[next].second>=p.second-1) continue;
                if(p.second==0) continue;
                que.push(P(next,p.second-1));
            }
        }
    }
    for(int i=0;i<n;i++){
        cout<<res[i].first<<endl;
    }
}


Measured memory_bytes: 10804
#include<bits/stdc++.h>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

typedef long long LL;

const int maxn=2e5+5;

int n,cnt[26];
char S[maxn];

int main()
{
	scanf("%s",S+1);
	n=strlen(S+1);
	
	LL ans=1;
	fd(i,n,1)
	{
		if (i<n) ans+=n-i-cnt[S[i]-'a'];
		cnt[S[i]-'a']++;
	}
	
	printf("%lld\n",ans);
}

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

using namespace std;
using ll = long long;
using vl = vector<ll>;
using pll = pair<ll, ll>;

#define rep(i, n) for (ll i = 0, xxx_rep_end = (n); i < xxx_rep_end; ++i)
#define all(x) (x).begin(), (x).end()

template <class T1, class T2>
inline void chmax(T1 &a, const T2 &b)
{
    if (a < b)
    {
        a = b;
    }
}
template <class T1, class T2>
inline void chmin(T1 &a, const T2 &b)
{
    if (a > b)
    {
        a = b;
    }
}

constexpr ll INF = 0x3f3f3f3f3f3f3f3fLL;

char v[6][6];
int main()
{
    ll H, W, K;
    cin >> H >> W >> K;

    rep(i, H)
    {
        string c;
        cin >> c;
        rep(j, W)
        {
            v[i][j] = c[j];
        }
    }
    ll ans = 0;

    for (ll i = 0, end_i = 1 << H; i < end_i; ++i)
    {
        for (ll j = 0, end_j = 1 << W; j < end_j; ++j)
        {
            ll black = 0;
            rep(x, H)
            {
                rep(y, W)
                {
                    // (x, y)が赤で塗りつぶされていないか
                    if ((((i >> x) & 1) == 0) && (((j >> y) & 1) == 0))
                    {
                        if (v[x][y] == '#')
                        {
                            ++black;
                        }
                    }
                }
            }
            if (black == K)
            {
                ++ans;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3620
function main(input) {
    var lines = input.split('\n');
    var line0 = lines[0].split(' ');
    var n = parseInt(line0[0]);
    var a = parseInt(line0[1]);
    var b = parseInt(line0[2]);
    var x = lines[1].split(' ').map(t => parseInt(t));

    var ans = 0;
    for (var i = 0; i < n - 1; i++) {
        ans += Math.min(a * (x[i + 1] - x[i]), b);
    }
    console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

#define speed ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define test ll t; cin>>t; while(t--)
#define ub(a,x) upper_bound(a.begin(),a.end(),x)-a.begin()
#define lb(a,x) lower_bound(a.begin(),a.end(),x)-a.begin()
#define ll long long
#define endl "\n"
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define pb push_back
#define PI 3.1415926535897932384626
#define inf 1e18
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define MOD 1000000007

int main()
{
    speed;
    //test{}
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	ll dp[n] = {0};
    	forn(i,n)
    		cin>>a[i];
    	dp[1]=abs(a[1]-a[0]);
    	for(ll i=2;i<n;++i)
    	{
    		ll k = abs(a[i]-a[i-1]);
    		ll b = abs(a[i]-a[i-2]);
    		dp[i] = min(dp[i-1]+k,dp[i-2]+b);
    	}
    	cout<<dp[n-1]<<endl;
    }
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }
template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; }

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

  ll h, n;
  cin >> h >> n;
  vl a(n);
  ll sum = 0;
  rep(i, n) {
    cin >> a[i];
    sum += a[i];
  }

  if (h <= sum) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> oset;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
using ll = long long;

void test_case(){
	int a , b , c ,d ;
	cin >> a >> b >> c >> d;
	int x = (a+d-1)/d;
	int y = (c+b-1)/b;
	if(x >= y)
		cout<<"Yes\n";
	else
		cout<<"No\n";
}
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int T=1;
	//~ cin >> T;
	while(T--){
		test_case();
	}
	return 0;
}


Measured memory_bytes: 3656
N,K=map(int,input().split())
h=[int(i) for i in input().split()] + [0 for i in range(K)]

ans=[10**20 for i in range(N+K)]
ans[0]=0

for i in range(N):
    for j in range(1,K+1):
        ans[i+j]=min(ans[i+j],ans[i]+abs(h[i]-h[i+j]))

print(ans[N-1])


Measured memory_bytes: 57312
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int top,S[1000];

void push(int x){
	S[++top]=x;
}
int pop(){
	top--;
	return S[top+1];
}
int main(){
	int a,b;
	top=0;
	char s[100];
	while(scanf("%s",s)!=EOF){
		if(s[0]=='+'){
			a=pop();
			b=pop();
			push(a+b);
		}
		else if(s[0]=='-'){
			b=pop();
			a=pop();
			push(a-b);
		}
		else if(s[0]=='*'){
			a=pop();
			b=pop();
			push(a*b);
		}
		else{
			push(atoi(s));
		}
	}
	printf("%d\n",pop());
	}

Measured memory_bytes: 2664
#include <stdio.h>
 
using namespace std;
 
int main(){
    int W,H,x,y,r;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
    if((x >= r && x <= W-r) && (y >= r && y <= H-r))
        printf("Yes\n");
    else{
        printf("No\n");
    }
}


Measured memory_bytes: 2692
/**************
*	Shell Sort
*************/

#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>	//??£?¨?
using namespace std;

void insertionSort(vector<int>* A, int g, int* cnt  ){

	for(unsigned int i=g ; i<(A->size()); i++){
		int v = (*A)[i];
		int j = i-g;
		while(j>=0 && (*A)[j]>v){
			(*A)[j+g] = (*A)[j];
			j = j-g;
			(*cnt)++;
		}
		(*A)[j+g] =v;
	}
	return ;
}
//---------------------------------------------------------
void shellSort(vector<int>* A, vector<int>* G, int* cnt){
//	*cnt =0;
//	int m = A->size();
//	vector<int> G(1,m);
	for(unsigned int i=0; i<(G->size()); i++){
		insertionSort(A, (*G)[i], cnt);
	}

	return;
}
//--<<???????????¢??°>>-------------------------------------------------------
int main(){

	//??\???
	int n;
	cin >> n;
	vector<int> A;
	A.resize(n);
	for(unsigned int i=0; i< A.size(); i++){
		cin >> A[i];
	}

	//??????
// 	vector<int> G(1,1);
	vector<int> G;
// 	for(int i= n; i!=0; --i){
// 	    G.push_back(i) ;
// 	}
vector<int> Temp;
int sum=0;
for(int i=0; sum <n ; ++i){
    //sum += pow(3,i);
	sum *= 3;
	sum++;
    Temp.push_back(sum);
}
//   for(int i=0; i<Temp.size();i++){cout <<Temp[i] << endl;}

for(int j=0; Temp[j]<=n; j++){
    G.push_back(Temp[j]);
}
//  for(int i=0; i<G.size();i++){cout <<G[i] << endl;}

 reverse(G.begin(), G.end());

	int cnt = 0;
	shellSort(&A, &G, &cnt);

	//??????
	cout << G.size() << endl;
	for(unsigned int i=0; i<(G.size()); i++){
		cout << G[i];
		if(i!=(G.size()-1)){
			 cout <<" " ;
		}
	}
	cout << endl;
	cout << cnt << endl;
	for(int i=0; i< n; i++){
		cout << A[i]<< endl;
	}

	return 0;
}
//-----------------------------------------------

Measured memory_bytes: 6752
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static List<Edge>[] tree;
    static bool[] ans;
    static void Main()
    {
        var N = int.Parse(ReadLine());
        var u = new int[N - 1];
        var v = new int[N - 1];
        var w = new int[N - 1];
        for (int i = 0; i < N - 1; i++)
        {
            var line = ReadLine().Split(' ');
            u[i] = int.Parse(line[0]) - 1;
            v[i] = int.Parse(line[1]) - 1;
            w[i] = int.Parse(line[2]);
        }

        tree = new List<Edge>[N];
        for (int i = 0; i < tree.Length; i++) tree[i] = new List<Edge>();
        for (int i = 0; i < N - 1; i++)
        {
            tree[u[i]].Add(new Edge { to = v[i], dist = w[i] });
            tree[v[i]].Add(new Edge { to = u[i], dist = w[i] });
        }

        ans = new bool[N];
        DFS(0, -1, false);
        foreach (var c in ans) WriteLine(c ? "1" : "0");
    }

    static void DFS(int v, int p, bool c)
    {
        ans[v] = c;
        foreach (var a in tree[v]) if (a.to != p) DFS(a.to, v, a.dist % 2 == 0 ? c : !c);
    }
}

struct Edge
{
    public int to;
    public int dist;
}


Measured memory_bytes: 33528
#include<bits/stdc++.h>
using namespace std;
#define S second
#define F first
#define MP make_pair
const int Maxn=2e5+100;
long long n,b,a[Maxn],ans,r,l,mid;
set <pair<int,int> > st;
bool valid(int x){
	st.insert(MP(0,0));
	for(int i=1;i<n;i++){
		if(a[i]>a[i-1]){
			if(st.rbegin()->S!=0)
				st.insert(MP(a[i-1]+1,0));
		}
		else{
			while(st.rbegin()->F>a[i])
				st.erase(*st.rbegin());
			if(st.rbegin()->S!=x){
				int c=st.rbegin()->S;
				if(st.rbegin()->F==a[i])
					st.erase(*st.rbegin());
				if(st.empty() || (!st.empty() && st.rbegin()->S!=c+1))
					st.insert(MP(a[i],c+1));
			}
			else{
				int t=st.rbegin()->F;
				if(t==0)
					return false;
				st.erase(*st.rbegin());
				int c=st.rbegin()->S;
				if(st.rbegin()->F==t-1)
					st.erase(*st.rbegin());
				if(st.empty() || (!st.empty() && st.rbegin()->S!=c+1))
					st.insert(MP(t-1,c+1));
				st.insert(MP(t,0));
			}
		}/*
		for(set <pair<int,int> > ::iterator it=st.begin();it!=st.end();++it){
			cout<<it->F<<" "<<it->S<<endl;
		}
		cout<<"________"<<endl;*/
	}
	return true;
}
int main(){
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i],a[i]--;
	l=-1,r=n+1;
	while(r-l>1){
		int mid=(l+r)/2;
		st.clear();
		if(valid(mid))
			r=mid;
		else
			l=mid;
	}
	cout<<r+1;
}


Measured memory_bytes: 1792
#include <math.h>
#include <stdio.h>
#define INF 1001001001
int min(int x, int y) {
	return x < y ? x : y;
}
int main() {
	int n, k, h[100000];
	int dp[101000];
	scanf("%d%d", &n, &k);
	for (int i = 0; i < n; i++) {
		scanf("%d", &h[i]);
		dp[i] = INF;
	}
	dp[0] = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 1; j <= k; j++) {
			dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i + j]));
		}
	}
	printf("%d\n", dp[n - 1]);
	return 0;
}

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

using ll = long long;
#define int long long

// [a -> b-1]
#define reps(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
// [0 -> a-1]
#define rep(i, a) reps(i, 0, (a))
// [a-1 -> b]
#define rreps(i, a, b) for (int i = (int)((a)-1); i >= (int)(b); i--)
// [a-1 -> 0]
#define rrep(i, a) rreps(i, a, 0)
#define all(v) (v).begin(), (v).end()
// next_permutation(all(v))
#define PERM(v) next_permutation(all(v))
/*sort(all(v));
 * (v).erase(unique(all(v)), v.end())*/
#define UNIQUE(v)\
	sort(all(v));\
	(v).erase(unique(all(v)), v.end())
#define MINV(v) min_element(all(v))
#define MAXV(v) max_element(all(v))
#define MIN3(a, b, c) min(min(a, b), c)
#define MIN4(a, b, c, d) min(MIN3(a, b, c), d)
#define MIN5(a, b, c, d, e) min(MIN4(a, b, c, d), e)
#define MIN6(a, b, c, d, e, f) min(MIN5(a, b, c, d, e), f)
#define MAX3(a, b, c) max(max(a, b), c)
#define MAX4(a, b, c, d) max(MAX3(a, b, c), d)
#define MAX5(a, b, c, d, e) max(MAX4(a, b, c, d), e)
#define MAX6(a, b, c, d, e, f) max(MAX5(a, b, c, d, e), f)
// b is [a, c)
#define RANGE(a, b, c) ((a) <= (b) && (b) < (c))
// c is [a, e) && d is [b, f)
#define RANGE2D(a, b, c, d, e, f) (RANGE((a), (c), (e)) && RANGE((b), (d), (f)))
#define chmin(a, b) a = min(a, (b))
#define chmin3(a, b, c) a = MIN3(a, (b), (c))
#define chmin4(a, b, c, d) a = MIN4(a, (b), (c), (d))
#define chmin5(a, b, c, d, e) a = MIN5(a, (b), (c), (d), (e))
#define chmin6(a, b, c, d, e, f) a = MIN6(a, (b), (c), (d), (e), (f))
#define chmax(a, b) a = max(a, (b))
#define chmax3(a, b, c) a = MAX3(a, (b), (c))
#define chmax4(a, b, c, d) a = MAX4(a, (b), (c), (d))
#define chmax5(a, b, c, d, e) a = MAX5(a, (b), (c), (d), (e))
#define chmax6(a, b, c, d, e, f) a = MAX6(a, (b), (c), (d), (e), (f))
#define fcout cout << fixed << setprecision(15)
#define YES(f) cout << ((f) ? YES_STR : NO_STR) << endl;

using namespace std;

bool solve(int n) {
	vector<vector<int>> mapv(21, vector<int>(21));
	rep(i, n) {
		int x, y; cin >> x >> y; mapv[x][y] = 1;
	}
	map<char, int> dir;
	dir['N'] = 0;
	dir['E'] = 1;
	dir['S'] = 2;
	dir['W'] = 3;
	int dy[] = {1, 0, -1,  0};
	int dx[] = {0, 1,  0, -1};
	int m; cin >> m;
	int res = n;
	int x = 10, y = 10;
	rep(i, m) {
		char c; cin >> c;
		int d = dir[c];
		int l; cin >> l;
		rep(i, l) {
			x += dx[d];
			y += dy[d];
			if (mapv[x][y]) {
				mapv[x][y]--; res--;
			}
		}
	}
	return res == 0;
}

signed main() {
	int n;
	while (cin >> n, n) cout << (solve(n) ? "Yes" : "No") << endl;
}




Measured memory_bytes: 3168
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <map>
#include <algorithm>
#include <utility>
#include <cstring>
#include <sstream>
#include <string>
#include <iostream>
using namespace std;
 
typedef pair<int,int> pii;
 
inline int dist(const pii &p, const pii &q){
    return abs(p.first - q.first) + abs(p.second - q.second);
}
 
void input(int &w, int &h, vector<vector<int> > &v){
    string s;
    v.clear();
    v.resize(h);
    for(int i = 0; i < h; ++i){
        vector<int> &t = v[i];
        getline(cin, s);
        stringstream ss(s);
        while(ss >> s){
            if(s[0] == '.'){
                t.push_back(-1);
            }
            else if(s[0] == 'S'){
                t.push_back(-2);
            }
            else if(s[0] == 'G'){
                t.push_back(-3);
            }
            else{
                t.push_back(strtol(s.c_str(), 0, 10));
            }
        }
 
        if(t.size() != w){
            if(1 || i != 0){
                throw 0;
            }
            swap(h, w);
            v.resize(h);
        }
    }
}
 
int main(){
    const int INF = 1000000000;
    int w, h, x;
    char ch;
    vector<vector<int> > in;
    string str;
    while(getline(cin, str) && sscanf(str.c_str(), "%d%d", &w, &h) == 2 && w){
        map<int,vector<pii> > mp;
        map<int,vector<pii> >::iterator it1, it2;
        input(w, h, in);
        for(int i = 0; i < h; ++i){
            for(int j = 0; j < w; ++j){
                if(in[i][j] >= 0){
                    mp[in[i][j]].push_back(pii(i, j));
                }
                else if(in[i][j] == -2){
                    mp[0].push_back(pii(i, j));
                }
                else if(in[i][j] == -3){
                    mp[INF].push_back(pii(i, j));
                }
            }
        }
 
        vector<int> dp1(1, 0), dp2;
        it1 = it2 = mp.begin();
        while(++it2 != mp.end()){
            dp2.assign(it2->second.size(), INF);
            for(int i = 0; i < it1->second.size(); ++i){
                pii p1 = it1->second[i];
                for(int j = 0; j < it2->second.size(); ++j){
                    pii p2 = it2->second[j];
                    dp2[j] = min(dp2[j], dp1[i] + dist(p1, p2));
                }
            }
            dp1.swap(dp2);
            ++it1;
        }
        printf("%d\n", dp1[0]);
    }
}

Measured memory_bytes: 1536
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
using namespace std;
#define ll long long
#define inf 0x7fffffff
int n,l,r;
ll ans;
bool check(int x)
{
	int X=x,cnt=0;
	while(X){cnt+=X%10;X/=10;}
	return cnt>=l&&cnt<=r;
}
int main()
{
	cin>>n>>l>>r;
	for(int i=1;i<=n;i++) if(check(i)) ans+=i;
	cout<<ans;
}

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

public class Solution
{
    public static void Main()
    {
        var N = int.Parse(Console.ReadLine());
        var y = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();

        var x = new long[N];
        {
            var i = 0;
            var sum = 0L;
            var count = 0;
            for (int j = i; j < N; j++)
            {
                if ((count++) % 2 == 0)
                {
                    sum += y[j];
                }
                else
                {
                    sum -= y[j];
                }
            }
            for (int j = 0; j < i; j++)
            {
                if ((count++) % 2 == 0)
                {
                    sum += y[j];
                }
                else
                {
                    sum -= y[j];
                }
            }
            x[i] = sum;
        }
        x[0] /= 2;

        for (int i = N - 1; i > 0; i--)
        {
            x[i] = y[i] - x[(i + 1) % N];
        }

        x = x.Select(v => v * 2).ToArray();

        Console.WriteLine(string.Join(" ", x));
    }
}

Measured memory_bytes: 35296
#include<stdio.h>
#define MAX 100000
int A[MAX],n;

int Partition(int p,int r){
  int x,i,j,k=0;
  
  x = A[r];
  i = p-1;
  for(j=p;j<r;j++){
    if(A[j]<=x){
      i++;
      k=A[i];
      A[i]=A[j];
      A[j]=k;
    }
  }
  k=A[i+1];
  A[i+1]=A[r];
  A[r]=k;
  return i+1;
}

int main(){
  int i,q;

  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d",&A[i]);
  
  q=Partition(0,n-1);
  
  for(i=0;i<n;i++){
    if(i)printf(" ");
    if(i==q)printf("[");
    printf("%d",A[i]);
    if(i==q)printf("]");
  }
  printf("\n");
  
  return 0;
}

Measured memory_bytes: 992
#include <iostream>

using namespace std;

long long N;
long long A[2 * 100000] = {0};
long long cnt = 0;

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    if (A[N-1] > N-1) {
        cout << -1 << endl;
        return 0;
    }
    cnt += A[N-1];
    for (int i = N-2; i >= 0; i--) {
        if (A[i] > i || A[i+1] > A[i] + 1) {
            cout << -1 << endl;
            return 0;
        } else if (A[i] + 1 == A[i+1]) {
            continue;
        } else {
            cnt += A[i];
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int main()
{
	int a[3];
	cin >> a[0] >> a[1] >> a[2];
	int sum;
	int sum2;
	int sum3;

	sum = a[0] + a[1];
	sum2 = a[0] + a[2];
	sum3 = a[1] + a[2];

	if (sum <= sum2)
	{
		if (sum <= sum3) cout << sum;
		else if (sum > sum3) cout << sum3;
	}
	else if (sum >= sum2)
	{
		if (sum2 <= sum3)cout << sum2;
		else if (sum2 > sum3)cout << sum3;
	}

}

Measured memory_bytes: 764
N = int(input())
testcase = [input()for i in range (N)]

AC = 0
WA = 0
TLE = 0
RE = 0

for t in  testcase:
    if t == "AC":
        AC += 1
    elif t == "WA":
        WA += 1
    elif t == "TLE":
        TLE += 1
    elif t == "RE":
        RE += 1
    else:
        continue
        
print("AC x "+str(AC))
print("WA x "+str(WA))
print("TLE x "+str(TLE))
print("RE x "+str(RE))

Measured memory_bytes: 16324
#include<bits/stdc++.h>
using namespace std;
int main(){
  int k,a,b; cin >> k; cin >> a >> b;
  bool flg = false;
  for(int i=a;i<=b;i++){
   	if(i%k==0){ flg = true; break;} 
  }
  if(flg) cout << "OK";
  else cout << "NG";
  
  return 0;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	int n;
	cin>>n;
	string s;
	cin>>s;
	int cnt=0;
	for(int i=0; i<n-2; i++){
		string t=s.substr(i,3);
		if(t=="ABC")
		 cnt++;
	}
	cout<<cnt;
	return 0;
	
}

Measured memory_bytes: 3640
using System;
using System.Linq;
using System.Collections.Generic;
using System.IO;


class Program
{
    public static long Read()
    {
        return long.Parse(Console.ReadLine());
    }

    public static long[] Reads()
    {
        return Console.ReadLine().Split().Select(long.Parse).ToArray();
    }


    public static void Main()
    {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);

        var a = Read();
        var b = Read();
        var c = Read();
        var d = Read();
        var e = Read();
        var k = Read();
        if (k < e - a)
            Console.WriteLine(":(");
        else
            Console.WriteLine("Yay!");
                




        Console.Out.Flush();
    }
}

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

int main(){
	int a[5];
	int k;
	int i, j;

	for(i = 0; i < 5;i++){
		cin >> a[i];
	}
	cin >> k;


	for(i = 0; i < 5; i++){
		for(j = i+1; j < 5; j++){
			if(a[j] - a[i] > k){
				cout << ":(";
				return 0;
			}
		}
	}

	cout << "Yay!";
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		String str=scan.next();
		int C[]=new int[a];
		int s=0;
		for(int i=1;i<a;i++) {
			char o=str.charAt(i-1);
			char t=str.charAt(i);
			if(o=='A'&&t=='C') {
				s++;
			}
			C[i]=s;
		}
		for(int i=0;i<b;i++) {
			int c=scan.nextInt();
			int d=scan.nextInt();
			System.out.println(C[d-1]-C[c-1]);
		}
	}
}

Measured memory_bytes: 69120
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public final class Main {

    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int x = in.nextInt();
        int t = 0;
        final Map<Long, Integer> map = new HashMap<>();
        while (Math.pow(t, 5) < 1e18) {
            map.put((long) Math.pow(t, 5), t);
            map.put((long) Math.pow(-t, 5), -t);
            t++;
        }
        twoSum(x, map);
    }

    public static void twoSum(int target, Map<Long, Integer> map) {
        for (Map.Entry<Long, Integer> entry : map.entrySet()) {
            final long num = entry.getKey();
            if (map.containsKey(target + num)) {
                System.out.println(map.get(target + num) + " " + entry.getValue());
                return;
            }
        }
    }
}


Measured memory_bytes: 40772
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,n,s) for(int i = s; i < (n); ++i)
#define rsrep(i,n,s) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<x<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;

int main() {
    int n;
    cin >> n;
    vint a(n);
    rep(i, n) cin >> a[i];

    ll ans = accumulate(all(a), -n);

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

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
def solve():
  n = int(input())
  query = []
  candi = []
  for i in range(n):
    x,y,h = (int(i) for i in input().split())
    query.append((x,y,h))
  if n == 1:
    print(*[x,y,h])
    exit()
  for cx in range(0,101):
    for cy in range(0,101):
      judge = True
      for j in range(n):
        x,y,h = query[j]
        if not h == 0:
          karih = h +abs(cx-x)+abs(cy-y)
          karih2 = 0
      for i in range(n):
        nx,ny,nh = query[i]
        if nh == max(karih-abs(nx-cx)-abs(ny-cy),0):
          pass
        else:
          judge = False
      if judge:
        candi.append((cx,cy,karih))
        
      judge = True 
      for i in range(n-1):
        nx,ny,nh = query[i+1]
        if nh == max(karih2-abs(nx-cx)-abs(ny-cy),0):
          pass
        else:
          judge = False
      if judge:
        candi.append((cx,cy,karih2))
  print(*candi[0])
        
          
      
      
solve()

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 30;
int a[100010]; 
int main() {
  int n, k;
  cin >> n >> k;
  rep(i,n) cin >> a[i];

  int cnt = 0;

  n -= k; cnt++;
  cnt += (n / (k-1));
  if (n % (k-1) > 0) cnt++;
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 3940
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
#define MOD @
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

int K;
bool vis[101010];

int main()
{
	scanf("%d", &K);

	deque<pair<int, int> > Q;
	Q.push_back({ 1, 1 });
	while (!Q.empty()) {
		auto top = Q.front(); Q.pop_front();
		if (vis[top.first]) continue;
		vis[top.first] = true;
		if (top.first == 0) {
			printf("%d\n", top.second);
			break;
		}

		int cost = top.second;
		int v = top.first;

		Q.push_back({ (v + 1) % K, cost + 1 });
		Q.push_front({ (v * 10) % K, cost });
	}

	return 0;
}


Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false)
#define ll long long
string s;
int vs[200000];
int main()
{
        IO;
        int i, j=0, n, m, k=1, l=0, r, t,x,y,mx; ll sum=1;
        cin>>n>>m;
        for(i=1; i<=m; i++){
            cin>>k;
            while(k--){
                cin>>j; vs[j]=1;
            }
        }
        for(i=1; i<=n; i++)
            if(vs[i]==0) l++;
        cout<<l<<endl;
    return 0;
}


Measured memory_bytes: 3648
#include <iostream>
#include <string> 
#include <vector> 
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include<math.h>
using namespace std;

#define int long long
#define endl "\n"
#define fir first
#define sec second
#define fro front
#define m_p make_pair
#define mod 1000000007
#define rep(i,n)  for(int i=0; i<(int) (n); i++)
#define all(v)  v.begin(),v.end()
#define vecin(v) for(int i=0; i<(int)v.size(); i++)cin>>v[i];
using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}

int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res* a% mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	int a = xx;
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}
int com(int xx, int yy) {
	int zz = 1;
	for (int i = xx; i > xx - yy; i--) {
		zz *= i;
		zz %= mod;
	}
	for (int i = 1; i <= yy; i++) {
		zz *= modinv(i, mod);
		zz %= mod;
	}
	return zz;
}



signed main() {
	int a, b = 0, n, x, y;
	cin >> n >> x >> y;
	vector<vector<int>>vec(n);
	vector<int>vec2(n), vec4(n);
	queue<int>que;
	for (int i = 1; i < n - 1; i++) {
		vec[i].push_back(i - 1);
		vec[i].push_back(i + 1);
	}
	vec[0].push_back(1);
	vec[n - 1].push_back(n - 2);
	vec[x - 1].push_back(y - 1);
	vec[y - 1].push_back(x - 1);
	rep(i, n) {
		que.push(i);
		vector<int>vec2(n);
		b = 0;
		vec2[i] = 1;
		while (!que.empty()) {
			a = que.size();
			b++;
			rep(j, a) {
				rep(k, vec[que.front()].size()) {
					if (vec2[vec[que.front()][k]] == 0) {
						if (vec[que.front()][k] >= i ) {
							que.push(vec[que.front()][k]);
							vec2[vec[que.front()][k]] = 1;
							vec4[b]++;
						}
						else {
							que.push(vec[que.front()][k]);
							vec2[vec[que.front()][k]] = 1;
						}
					}
				}
				que.pop();
			}
		}
	}
	for (int i = 1; i < n; i++) {
		cout << vec4[i] << endl;
	}
}



Measured memory_bytes: 384
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;

int main(){
    int n;
    double x[101], y[101], p, p1 = 0, p2 = 0, p3 = 0, pinf = 0;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> x[i];
    }
    for(int i = 0; i < n; i++){
        cin >> y[i];
    }
    for(int i = 0; i < n; i++){
        p = fabs(x[i] - y[i]);
        p1 += p;
        p2 += p*p;
        p3 += p*p*p;
        pinf = max(pinf, p);
    }
    printf("%.8f\n%.8f\n%.8f\n%.8f\n", p1, sqrt(p2), cbrt(p3), pinf);
    return 0;
}


Measured memory_bytes: 3408
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
cnt = 0
for i in range(n):
    a = list(map(int,input().split()))
    tmp = 0
    for j in range(m):
        tmp += a[j]*b[j]
    tmp += c
    if tmp > 0:
        cnt += 1
print(cnt)

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

int main()
{
  string a;

  cin >> a;

  int sum = 0;
  for (int i = 0; i < a.length(); i++)
  {
    sum += a[i] - '0';
  }

  if (sum % 9 == 0)
    cout << "Yes";
  else
    cout<<"No";

  return 0;
}


Measured memory_bytes: 3688
import sys
input = sys.stdin.readline

def main():
    N, K = map(int,input().split())
    h = list(map(int,input().split()))
    
    dp = [0] * N
    
    for i in range(1, N):
        dp[i] = min(dp[j] + abs(h[i] - h[j]) for j in range(max(0, i - K), i))
    
    print(dp[-1])

if __name__ == '__main__':
    main()

Measured memory_bytes: 14016
s1= int(input())
s2= int(input())
s3= int(input())
s4= int(input())
s5= int(input())
s6= int(input())
s7= int(input())
s8= int(input())
s9= int(input())
s10= int(input())

print(s1+s2+s3+s4+s5+s6+s7+s8+s9+s10)


Measured memory_bytes: 5588
#include<iostream>
#include<cstdio>
using namespace std;
string s;
int flag;

int main(){
	cin>>s;
	for (int i=0;i<=s.length()-1;i++)
	{
		if (s[i]=='C')
		{
			for (int j=i;j<=s.length()-1;j++)
			{
				if (s[j]=='F')
				{
					flag=1;
					break;
				}
			}
		}
	}
	if (flag==1)
	{
		cout<<"Yes";
	}
	else 
	{
		cout<<"No";
	}
	return 0;
} 

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=105;
int a[N],n;
long long sum=1,odd=1;

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i)	scanf("%d",&a[i]);
	for(int i=1;i<=n;++i)
	{
		sum*=3;
		if((a[i]&1)==0)	odd<<=1;
	}
	sum-=odd;
	printf("%lld",sum);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
#define assign(x,val) memset(x,val,sizeof(x))
#define all(x) (x).begin(), (x).end()
#define for0(i,n) for(ll i=0;i<n;++i)
#define for1(i,n) for(ll i=1;i<=n;++i)
#define ford(i,n) for(ll i=n;i>=1;--i)
#define forg(i,a,b) for(ll i=a;i<b;++i)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpi;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpl;
long long mod = 1000000007;
const long double PI = (long double)(3.1415926535897932384626433832795);


void solve(){
  int a, b, c;cin>>a>>b>>c;
  cout<<(a+b+c>=22?"bust":"win")<<endl;
}

int main(){
	ll t = 1;
	//cin>>t;
	for0(i, t){
		solve();
	}
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define S 1000000
#define T 1000000
int s[S];
int t[T];
int main(){
  int key,right,mid,ave,left,i,j,n,q,count=0;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%d",&s[i]);
  }
  scanf("%d",&q);
  for(i = 0; i < q; i++){
    scanf("%d",&t[i]);
  }
  right = n;
  left = 0;
  mid =  (right+left)/2;
  key = t[0];
  i = 0;
  while(1){
    if(key == s[mid]){
      count++;
      i++;
      key = t[i];
      right = n;
      left = 0;
      mid =  (right+left)/2; 
    }
    if(left >= right){
      i++;
      key = t[i];
      right = n;
      left = 0;
      mid =  (right+left)/2;
    }
    if(i == q)break;
    if(s[mid] > key){
      right = mid;
      mid = (right + left)/2;
    }
    else if(s[mid] < key){
      left = mid+1;
      mid = (left + right)/2;
    }
  }
  printf("%d\n",count);
  return 0;
}

Measured memory_bytes: 4892
import java.io.IOException;
import java.util.InputMismatchException;

public class Main {
	public static void main(String[] args) {
		FasterScanner sc = new FasterScanner();

		int a = sc.nextInt();
		int b = sc.nextInt();

		System.out.println(a*b%2==1?"Yes":"No");

	}

	static int gcd(int a, int b) {
		int temp;
		while (b != 0) {
			temp = a % b;

			a = b;
			b = temp;
		}
		return a;
	}

	public static class FasterScanner {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public int[] nextIntArray(int n, int offset) {
			int[] arr = new int[n + offset];
			for (int i = 0; i < n; i++) {
				arr[i + offset] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		public long[] nextLongArray(int n, int offset) {
			long[] arr = new long[n + offset];
			for (int i = 0; i < n; i++) {
				arr[i + offset] = nextLong();
			}
			return arr;
		}

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}
}

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

int main() {
  int a, b;
  cin >> a >> b;
  int c = a * b;

  if (c % 2 == 1) {
    cout << "Odd" << endl;
  }
  else {
    cout << "Even" << endl;
  }
}


Measured memory_bytes: 256
# AOJ 1119: Exploring Caves
# Python3 2018.7.14 bal4u

for _ in range(int(input())):
	ans = x = y = tx = ty = 0
	while True:
		dx, dy = map(int, input().split())
		if (dx | dy) == 0: break
		x += dx; y += dy
		d = x*x+y*y
		if d > ans: ans, tx, ty = d, x, y
		elif d == ans and tx < x: tx, ty = x, y
	print(tx, ty)



Measured memory_bytes: 5604
x,n = list(map(int,input().split()))
p = sorted(list(map(int,input().split())))

ab = 100
num = []
for i in range(102):
    if p.count(i)>0:
        continue
    abst = abs(i-x)
    if abst < ab:
        ab = abst
        num = [i]
    elif abst == ab:
        ab = abst
        num += [i]
print(min(num))

Measured memory_bytes: 9224
h, w = map(int, input().split())
a = [''] * h
b = [''] * (h * w)
cnt=0
for i in range(h):
	a[i] = list(map(int,input().split()))
for j in range(h):
	for k in range(w-1):
		if a[j][k]%2==1:
			a[j][k] -= 1
			a[j][k+1] += 1
			b[cnt]=str(j+1)+' '+str(k+1)+' '+str(j+1)+' '+str(k+2)
			cnt += 1
for l in range(h-1):
	if a[l][w-1]%2==1:
		a[l][w-1] -= 1
		a[l+1][w-1] += 1
		b[cnt]=str(l+1)+' '+str(w)+' '+str(l+2)+' '+str(w)
		cnt += 1
print(cnt)
for m in range(cnt):
	print(b[m])

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

#define int long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;
typedef vector<P> pvec;
typedef vector<vector<ll>> vvec;
typedef vector<vector<P>> pvvec;
typedef priority_queue<ll> PQI;
typedef priority_queue<P> PQP;
typedef priority_queue<ll,vector<ll>,greater<ll>> PQIG;
typedef priority_queue<P,vector<P>,greater<P>> PQPG;

const vector<int> dx = {0, -1, 0, 1, 1, 1, -1, -1};
const vector<int> dy = {1, 0, -1, 0, 1, -1, 1, -1};
constexpr int MOD = (1000000007);
// const int MOD = (998244353);
// const int INF = (1 << 30); // 1073741824
const int INF = (1LL << 60); // 1152921504606846976
const double EPS = (1 >> 30);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}
template<class T> inline T ceil(T a, T b) {return T((a + b - 1)/b);}
template< typename T1, typename T2 > istream &operator>>(istream &is, pair< T1, T2 > &p) { is >> p.first >> p.second; return is; }

int nmax=200000; // 2*(10^5)
vvec g(nmax);



signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int h,w;
    cin>>h>>w;
    map<char,int> mp;
    rep(i,h){
        rep(j,w){
            char x;
            cin>>x;
            mp[x]++;
        }
    }
    vec a(5);
    for(auto x:mp){
        if(x.sc%4==0) a[4]++;
        else if(x.sc%2==0) a[2]++;
        else if(x.sc%2==1) a[1]++;
    }
    if(w%2==0&&h%2==0){
        if(a[2]==0&&a[1]==0) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    else if(w%2==0){
        if(a[1]==0&&a[2]<=w/2) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    else if(h%2==0){
        if(a[1]==0&&a[2]<=h/2) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    else{
        if(a[1]<=1&&a[2]<=(h/2)+(w/2)) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}

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

int main (){
    int N;
    cin >> N;
    vector<int> A(N + 2);
    int sum = 0;
    for (int i = 1; i <= N; i++)
    {
        cin >> A[i];
        sum += abs(A[i] - A[i - 1]);
    }
    sum += abs(A[N]);
    vector<int> ans(N);
    for (int i = 1; i <= N; i++)
    {
        ans[i - 1] = sum - abs(A[i] - A[i - 1]) - abs(A[i + 1] - A[i]) + abs(A[i + 1] - A[i - 1]);
    }
    
    for (int i = 0; i < N; i++)
    {
        cout << ans[i] << endl;
    }
    

    return 0;
    
}

Measured memory_bytes: 2048
#include <bits/stdc++.h>
#include <stdlib.h>
#include <string>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define pi 3.141592653589793
ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    ll r=a%b;
    while(r!=0){
        a=b;
        b=r;
        r=a%b;
    }
    return b;
}

int main(){
    string s;
    int q;
    int x=inf;
    int count=0;
    cin >> s >> q;
    rep(i,q){
        int t;
        cin >> t;
        if(t==1){
            count++;
            if(x==1) x=inf;
            else if(x==inf) x=1;
            continue;
        }
        else if(t==2){
            if(x==inf){
                int f;
                string c;
                cin >> f >> c;
                if(f==1) s.insert(0,c);
                else if(f==2) s.append(c);
            }
            else if(x==1){
                int f;
                string c;
                cin >> f >> c;
                if(f==2) s.insert(0,c);
                else if(f==1) s.append(c);
            }

        }
    }
    if(count%2==1) reverse(s.begin(),s.end());
    cout << s << endl;

    return 0;
}

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

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

	long long int c;
	long long int Nmax;

	for (int l = 11; l > 0; l--) {
		Nmax = 0;
		if (l >= 2) {
			for (int j = 1; j < l; j++) {
				Nmax += pow(26, j);
			}
		}
		c = N - Nmax;
		if (c >= 0) {
			c /= pow(26, l-1);
			c = c % 26 + 'a';
			cout << (char)c;
		}
	}

	return 0;
}

Measured memory_bytes: 4016
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//-std=gnu++17
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a(n);
    map<int,int> m;
    rep(i, n)
    {
        cin >> a[i];
        m[a[i]]++;
    }
    sort(ALL(a));
    vector<bool> dp(1000001, false);
    int ans = 0;
    rep(i, n)
    {
        if (!dp[a[i]])
        {
            int j = 1;
            if (m[a[i]] < 2)
                ans++;
            while (a[i] * j <= 1000000)
            {
                dp[a[i] * j] = true;
                j++;
            }
        }
    }
    cout << ans << "\n";
}


Measured memory_bytes: 13724