akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#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>
#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 STLL(s) strtoll(s.c_str(), NULL, 10)
#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;
#define endl '\n';
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;



int main() {
    
    int n,m;
    cin>>n>>m;
    int l=0,r=n;
    rep(i,m){
        int a,b;
        cin>>a>>b;
        r=min(r,b);
        l=max(l,a);
        if(l>r){
            fin(0);
            return 0;
        }
    }
    fin(r-l+1);


}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;


void solve(long long N, long long K, std::vector<long long> p){
    vll s(N+1, 0);
    REP(i, N) s[i+1] = s[i] + p[i];
    ll ans = 0;
    for(ll i=0; i<= N-K; i++){
        ans = max(ans, s[i+K]-s[i]);
    }
    ans += K;
    if(ans % 2 == 0)
        cout<<ans/2<<endl;
    else{
        double x = ans/2;
        x += 0.5;
        cout<<setprecision(15)<<x<<endl;
    }
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<long long> p(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&p[i]);
    }
    solve(N, K, std::move(p));
    return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include <vector>
using namespace std;
int main() {
	int N;
	long long K;
	cin >> N >> K;
	vector<int> A(N), B(N, -1);
	for (int i = 0; i < N; i++) {
		int a;
		cin >> a;
		A[i] = a - 1;
	}
	int idx = 0, now = 0;
	while (B[idx] < 0) {
		B[idx] = now;
		now++;
		idx = A[idx];
	}
	int amari = B[idx], shuki = now - B[idx];
	int X;
	if (K < amari) X = K;
	else {
		X = (K - amari) % shuki;
		X += B[idx];
	}
	for (int i = 0; i < N; i++) if (B[i] == X) cout << i + 1 << endl;
	return 0;
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++) 
#define ll long long
#define ld long double
#define repl(i, n) for (ll i = 0; i < (ll)(n); i++)  
#define outdeb(fir, sec, thr) cout << fir << ":" << sec << ":" << thr << endl
#define DEV_VAL 1000000007

int main()
{
  ll a,b,c,k;
  cin >> a >> b >> c >> k;

  ll time = 0;
  while(a >= b)
  {
    b *= 2;
    time++;
  }
  while(b >= c)
  {
    c *= 2;
    time++;
  }

  cout << fixed << (time <= k ? "Yes" : "No") << endl;

  return 0;
}

Measured memory_bytes: 3516
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <set>
#include <queue>
#include <string>
#include <string.h>
#include <deque>
#include <functional>
#include <tuple>
#include <stdio.h>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vec;
typedef vector<vec> vec2;

//for文
#define FOR(i,a,b) for(ll i = (ll)a;i < (ll)b;i++)
#define FORE(i,a,b) for(ll i = (ll) a;i <= (ll) b;i++ )
#define REP(i,size_of_array)  for(ll i =(ll)0;i<size_of_array;i++)
#define REPE(i,size_of_array)  for(ll i =(ll)0;i<=size_of_array;i++)
#define REPR(i,size_of_array)  for(ll i =(ll)size_of_array;i>=0;i--)

//ソート
#define ALL(vec) (vec).begin(),(vec).end()
#define SORT(vec) sort(ALL(vec))
#define INVSORT(vec) sort((vec).rbegin(),(vec).rend())

//最大値最小値
#define MAX(vec) *max_element(ALL(vec))
#define UNIQ(vec) SORT(vec);vec.erase(unique(ALL(vec)),vec.end())
#define MIN(vec) *min_element(ALL(vec))

//表示
#define printl(a) cout << a << endl
#define print(a) cout << a
#define SP cout << " "

//入力
#define inputV(vec) REP(i,vec.size()){cin >> vec[i];}
#define input(a) cin >> a

//型
#define float ld
#define double ld
#define P pair<ll,ll>
#define vp vector<P>
#define F first
#define S second

//特殊
#define int ll
#define DEBUG(x) cerr << #x << ":" << x<<endl
#define  DEBUGV(V) REP(i,V.size()){cerr << #V[i] << ":" << V[i]<<endl;}

template<class T> inline void umax(T &a,const T &b) { if(a < b) a = b; }
template<class T> inline void uhmin(T &a,const T &b) { if(a > b) a = b; }

const ll INF = 1ll << 60;
const ld EPS = 1e-8;

signed main(){
    ll N;
    input(N);
    vec A(N);
    inputV(A);
    ll cnt = 0;
    bool dec = false;
    bool inc = false;
    FOR(i,1,A.size()){
        if(A[i-1] > A[i]) dec = true;
        else if(A[i-1] < A[i] ) inc = true;

        if(dec and inc){
            dec = false;
            inc = false;
            cnt++;
        }
        //DEBUG(cnt);
    }

    print(++cnt);
}




Measured memory_bytes: 1024
import java.io.*;
import java.util.*;
import java.math.*;

public class Main {
	public void run(){
		Scanner sc = new Scanner(System.in);
		for(;;){
			int n = sc.nextInt();
			int m = sc.nextInt();
			if((n|m)==0){
				break;
			}
			int taro []= new int[n];
			int hana [] = new int [m];
			int tsum = 0;
			int hsum = 0;
			for(int i = 0 ; i < n ; i++)
			{
				taro[i] = sc.nextInt();
				tsum += taro[i];
			}
			for(int i = 0 ; i < m ; i++){
				hana[i] = sc.nextInt();
				hsum += hana[i];
			}
			
			int T=0;
			int H=0;
			int minTH=-1;
			for(int i = 0 ; i < n ; i++){
				for(int j = 0; j < m; j++){
					if(tsum - hsum == (taro[i] - hana[j])*2){
						if(minTH == -1 || minTH > taro[i]+hana[j]){
							T = taro[i];
							H = hana[j];
							minTH = T+H;
						}
					}
				}				
			}
			System.out.println(minTH==-1?-1:(T + " " + H));
		}
		
	}
	public static void main(String[] Aregs){
		Main a = new Main();
		a.run();
	}
}

Measured memory_bytes: 12000
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;

int n,k1,d[2000][2000];
vector<int> g[2000];
bool f[2000];

int dfs(int u,int v){
	f[v]=true;
	if(d[u][v]>k1){
		return 0;
	}else if(d[u][v]==k1){
		return 1;
	}
	int r=1;
	for(int j=0;j<g[v].size();++j){
		int w=g[v][j];
		if(f[w]){
			continue;
		}
		d[u][w]=d[u][v]+1;
		r+=dfs(u,w);
	}
	return r;
}

int main(){
	int k,ans=1;
	cin>>n>>k;
	for(int j=0;j<n-1;++j){
		int a,b;
		cin>>a>>b;
		g[--a].push_back(--b);
		g[b].push_back(a);
	}
	if(k%2==0){
		k1=(k+1)/2;
		for(int v=0;v<n;++v){
			d[v][v]=0;
			fill(f,f+n,false);
			ans=max(ans,dfs(v,v));
		}
	}else{
		for(int v=0;v<n;++v){
			int a=0,b=0;
			vector<int> V;
			fill(f,f+n,false);
			f[v]=true;
			k1=(k-1)/2;
			for(int j=0;j<g[v].size();++j){
				d[v][g[v][j]]=1;
				V.push_back(dfs(v,g[v][j]));
				a+=V[j];
			}
			fill(f,f+n,false);
			f[v]=true;
			++k1;
			for(int j=0;j<g[v].size();++j){
				b=max(dfs(v,g[v][j])-V[j],b);
			}
			a+=(b+1);
			ans=max(ans,a);
		}
	}
	cout<<n-ans<<endl;
}

Measured memory_bytes: 16000
import math

N, D = map(int, input().split())
int_list = [list(map(int, input().split())) for i in range(N)]
count = 0

for i in range(0, N - 1):
    for j in range(i + 1, N):
        sss = 0
        for k in range(0, D):
            sss += (int_list[i][k] - int_list[j][k]) ** 2

        if math.sqrt(sss) % 1 == 0:
            count += 1

print(count)

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
  public static void Main() {
    int N = ReadInt();
    char[] S = ReadCharArray();
    // 左から、左(W)を向いている人を数え上げる
    // 右から、右(S)を向いている人を数え上げる
    int[] W = new int[N], E = new int[N];
    W[0] = (S[0] == 'W') ? 1 : 0;
    E[N-1] = (S[N-1] == 'E') ? 1 : 0;
    for (int i = 1; i < N; i++) {
      W[i] = W[i-1] + ((S[i] == 'W') ? 1 : 0);
      E[N-1-i] = E[N-i] + ((S[N-1-i] == 'E') ? 1 : 0);
    }

    int res = int.MaxValue;
    for (int i = 0; i < N; i++) {
      int temp = W[i] + E[i];
      res = (res > temp) ? temp : res;
    }
    Console.WriteLine(res-1);
  }

  private static string ReadLine() { return Console.ReadLine(); }
  private static int ReadInt() { return int.Parse(Console.ReadLine()); }
  private static double ReadDouble() { return double.Parse(Console.ReadLine()); }
  private static long ReadLong() { return long.Parse(Console.ReadLine()); }
  private static char ReadChar() { return Console.ReadLine()[0]; }
  private static string[] ReadStringArray() { return Console.ReadLine().Split(' '); }
  private static int[] ReadIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
  private static double[] ReadDoubleArray() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
  private static long[] ReadLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
  private static char[] ReadCharArray() { return Console.ReadLine().ToArray(); }
}


Measured memory_bytes: 16736
#include <stdio.h>

int main(void) {
    int h,w,n,a,ans,r;
    scanf("%d %d %d",&h,&w,&n);
    a=h;
    if(h<w) a=w;
    ans=n/a+((n%a)?1:0);
    printf("%d",ans);
	return 0;
}



Measured memory_bytes: 128
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        char[] c = sc.next().toCharArray();
        for(int i=0; i<n; i++) {
            if(c[i] == 'R') {
                a[i] = 0;
            } else if(c[i] == 'G') {
                a[i] = 1;
            } else {
                a[i] = 2;
            }
        }
        int[][] sum = new int[3][n+1];
        for(int i=0; i<n; i++) {
            sum[0][i+1] = sum[0][i];
            sum[1][i+1] = sum[1][i];
            sum[2][i+1] = sum[2][i];
            sum[a[i]][i+1] = sum[a[i]][i] + 1;
        }

        long res = 0;
        for(int i=0;i < n; i++) {
            for(int j=i+1; j<n; j++) {
                if(a[i] == a[j]) continue;
                int col = 3 - a[i] - a[j];
                res += sum[col][n]-sum[col][j+1];
                int q = j + j - i;
                if(q < n && a[q] == col) res--;
            }
        }
        System.out.println(res);
    }



}

Measured memory_bytes: 36432
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main(void) {
	bool S[13] = { false }, H[13] = { false },
		C[13] = { false }, D[13] = { false };
	char c = 0;
	int n = 0, rank = 0;
	scanf("%d", &n);
	//printf("@@%d@@\n", n);
	for (int i = 0; i < n; i++) {
		scanf("%*c%c %d", &c, &rank);
		//printf("@c=%c@\n", c);
		switch (c) {
		case 'S':
			//printf("@S rank = %d\n",rank);
			S[rank-1] = true;
			break;
		case 'H':
			H[rank-1] = true;
			break;
		case 'C':
			C[rank-1] = true;
			break;
		case 'D':
			D[rank-1] = true;
			break;
		default:
			//printf("@defaul\n");
			break;
		}
	}
	for (int j = 0; j < 13; j++) {
		if (!S[j]) {
			printf("S %d\n", j + 1);
		}
	}

	for (int j = 0; j < 13; j++) {
		if (!H[j]) {
			printf("H %d\n", j + 1);
		}
	}

	for (int j = 0; j < 13; j++) {
		if (!C[j]) {
			printf("C %d\n", j + 1);
		}
	}

	for (int j = 0; j < 13; j++) {
		if (!D[j]) {
			printf("D %d\n", j + 1);
		}
	}

	return 0;
}

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

int main() {
  int A, B, K;
  cin >> A >> B >> K;
  if (B - A + 1 <= 2*K)
    for (int i=A; i<=B; i++)
      cout << i << endl;
  else {
    for (int i=A; i<A+K; i++)
      cout << i << endl;
    for (int i=B-K+1; i<=B; i++)
      cout << i << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#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 rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
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 (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};



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

	int a,b;
	cin >> a >> b;
	if(a<=8 && b<=8) cout << "Yay!" << endl;
	else cout << ":(" << endl;
	return 0;

}


Measured memory_bytes: 3636
# coding: utf-8
# Your code here!

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意


r,c,n = [int(i) for i in readline().split()]
#xyxy = [[int(i) for i in readline().split()] for _ in range(n)] 
#for i,(x1,y1,x2,y2) in enumerate(xyxy):

def addedge(x1,y1):
    if   y1 == 0:
        edge.append((x1,i))
    elif x1 == r:
        edge.append((r+y1,i))
    elif y1 == c:
        edge.append((r+c+(r-x1),i))
    else:
        edge.append((r+c+r+(c-y1),i))
    return 


edge = []
for i in range(n):
    x1,y1,x2,y2 = [int(i) for i in readline().split()]
    if (x1 not in (0,r) and y1 not in (0,c)) or (x2 not in (0,r) and y2 not in (0,c)):
        continue
    
    addedge(x1,y1)
    addedge(x2,y2)

        
edge.sort()
#print(edge)

ans = []
for d,i in edge:
    if ans and ans[-1] == i:
        ans.pop()
    else:
        ans.append(i)

if ans:
    print("NO")
else:
    print("YES")
    


    






Measured memory_bytes: 27724
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long double a,b,c;
    cin>>a>>b>>c;
    //long long int aa=a+b+2*((long double)sqrt(a*b));
    long double aa1=a+b+2*((long double)sqrt(a*b));
    //cout<<aa<<" "<<fixed<<setprecision(10)<<aa1;
    if(aa1<c)
        cout<<"Yes";
    else
        cout<<"No";
    return 0;
}


Measured memory_bytes: 256
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n, m = MAP()

l = [LIST() for i in range(m)]
p = LIST()

# bits全探索
bits = product([0, 1], repeat=n)
ans = 0
#print(list(bits))

for b in bits:
    light = 0
    for i, s_l in enumerate(l):
        on = 0
        for s in s_l[1:]:
            on += b[s-1]
        if on % 2 == p[i]:
            light += 1
    if light == m:
        ans += 1

print(ans)


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


int main() {
  int64_t A,B,K;
  cin>>A>>B>>K;
  
  if(K>=A+B) cout<<0<<" "<<0<<endl;
  else if(K<=A) cout<<A-K<<" "<<B<<endl;
  else cout<<0<<" "<<A+B-K<<endl;
    
  
  
 
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define dbg(x) cout<<#x<<" : "<<x<<endl;
#define dl(x) cout<<"LINE "<<__LINE__<<endl;
using namespace std;
int main(){
	int n;
	int a[9999];
	long long m=1000;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	vector<int>s;
	vector<int>t;
	int now=1;
	for(int i=1;i<n;i++){
		if(a[i]>a[i+1]){
			s.push_back(now);
			t.push_back(i);
			now=i+1;
		}
	}
	if(a[n]>=a[now]){
		s.push_back(now);
		t.push_back(n);
	}
	for(int i=0;i<s.size();i++){
		m+=floor(m/a[s[i]])*(a[t[i]]-a[s[i]]);
	}
	cout<<m<<endl;
	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <cstdlib>
#include <cmath>

using namespace std;

int main(){
  long long a,b,x;
  cin >> a >> b >> x;
  long long s=a/x,e=b/x,sl=a%x,el=b%x;
  if(s==e && sl!=0 && el!=0)  cout << 0 << endl;
  else if(s==e) cout << 1 << endl;
  else if(sl==0)  cout << e-s+1 << endl;
  else if(sl!=0) cout << e-s << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
int main(void) {
	int MAX=-1, RESULT=-1;
	while (1) {
		int NumberOfCases = 0;
		std::cin >> MAX >> RESULT;
		if (MAX == 0 && RESULT == 0) { break; }
		for (int i = MAX; i > 0; i--) {
			for (int j = i - 1; j > 0; j--) {
				for (int k = j - 1; k > 0; k--) {
					if (i + j + k == RESULT) { NumberOfCases++; }
				}
			}
		}
		std::cout << NumberOfCases << std::endl;
	}
//	system("pause");
	return 0;
}

Measured memory_bytes: 3080
object Main{
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)
    val a = sc.nextInt
    val b = sc.nextInt
    val c = sc.nextInt
    val x = sc.nextInt

    var count = 0

    for (i <- 0 to a) {
      for (j <- 0 to b) {
        for (k <- 0 to c) {
          if (i * 500 + j * 100 + k * 50 == x)
            count += 1
        }
      }
    }

    println(count)
  }
}


Measured memory_bytes: 28036
#include <stdio.h>

int main(void){
	int a, b, c;
	int tmp;

	scanf("%d %d %d", &a, &b, &c);
	
	if(a > b){
		tmp = a;
		a = b;
		b = tmp;
	}
	
	if(a > c){
		tmp = a;
		a = c;
		c = tmp;
	}
	
	if(b > c){
		tmp = b;
		b = c;
		c = tmp;
	}
	
	printf("%d %d %d\n", a, b, c);

	return 0;
}

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


int main() {
    int N;
    std::cin >> N;
    int cnt = 0;
    for (int i = 0; i < N; i++) {
        int val;
        std::cin >> val;
        if (i % 2 == 0 && val % 2 == 1) {
            cnt++;
        }
    }
    std::cout << cnt << std::endl;
}


Measured memory_bytes: 3632
// luogu-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1e9+7;
map<int,int>d;
inline int read() 
{
    char ch=getchar();
    int x=0,q=1;
    while(ch>'9' || ch<'0')q=ch==45?-1:q,ch=getchar();
    while(ch>='0' && ch<='9')x=(x<<1)+(x<<3)+(ch^'0'),ch=getchar();
    return x*q;
}
inline int solve(int x)
{
    if(d[x]!=0)
        return d[x];
    else
    return d[x]=((solve(x/2)+solve((x-1)/2)+solve((x-2)/2)))%mod;
}
signed main()
{
    d[0]=1;
    d[1]=2;  
    int n;
    n=read(); 
    int ans=solve(n);
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod 			1000000007
#define tc(t) 			int t;cin >> t;while(t--)
#define for0(i , n)		for(int i=0;i<n;i++)
#define loop(i , a, b)	for(int i=a;i<=b;i++)
#define endl 			'\n'
#define inf 			1e18
#define fi 				first
#define se 				second

int XX[8] = { +1, +1, +1, 0, 0, -1, -1, -1};
int YY[8] = { +1, 0, -1, +1, -1, +1, 0, -1};
int dx[4] = { -1, 1, 0, 0};
int dy[4] = {0, 0, 1, -1};



signed main() {

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

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

	int n, w;
	cin >> n >> w;
	int val[n], wt[n];

	for0(i, n) cin >> wt[i] >> val[i];

	vector<vector<int>> dp(n + 1, vector<int>(w + 1, 0));

	for (int i = 0; i <= n; i++) {
		for (int j = 0; j <= w; j++) {
			if (i == 0 or j == 0) {
				dp[i][j] = 0;
			} else if (wt[i - 1] <= j) {
				dp[i][j] = max(val[i - 1] + dp[i - 1][j - wt[i - 1]], dp[i - 1][j]);
			} else {
				dp[i][j] = dp[i - 1][j];
			}
		}
	}

	cout << dp[n][w] << endl;

	return 0;
}

Measured memory_bytes: 83160
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long
#define endl "\n"
#define print_array(name,n) for(ll o=0;o<n;o++) cout<<name[o]<<" "
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define inf 2e18
#define pll pair<ll,ll>
#define pii pair<int,int>
bool sortbysecond(const pair<int,int> &a,const pair<int,int> &b){
	return (a.ss>b.ss);
}
 
ll gcd(ll a,ll b){ if(b==0) return a; return gcd(b,a%b) ;} 

template <typename T>
string NumberTostring(T Number )
{
	ostringstream ss;
	ss<<Number;
	return ss.str();
}
 

 
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
 	string s,t;
 	cin>>s>>t;
 	int ans = 0;
 	for(int i=0;i<s.size();i++){
 		if(s[i]!=t[i]){
 			ans++;
 		}
 	}   
 	cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3884
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

func main() {
	n, k := readInt(), readInt()

	ans := 0
	for i := 0; i < n; i++ {
		if readInt() >= k {
			ans++
		}
	}

	fmt.Println(ans)
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

// -----------------------------------------------------------------

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


Measured memory_bytes: 896
N = int(input())
*A, = map(int, input().split())
X = [0]*N
X_total = sum(A)
A_odd = sum([A[i % N] for i in range(1, N, 2)])
A_even = sum([A[i % N] for i in range(2, N+1, 2)])
for i in range(N):
    X[i] = X_total - 2*(A_odd if i % 2 == 0 else A_even)
    if i % 2 == 0: A_odd += A[i] - A[(i+1) % N]
    else: A_even += A[i] - A[(i+1) % N]
print(*X)

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define MOD 1000000007
typedef long long ll;
typedef unsigned long long ull;

int main() {
  string s, t;
  cin >> s >> t;
  int res = 0;
  rep(i,3) {
    if (s.at(i) == t.at(i)) {
      res++;
    }
  }
  cout << res;
}

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

const int N = 100100;

int p[N];

int main(void) {
    int n;
    scanf("%d", &n);
    std::vector<int> res;
    for (int i = 0; i < n; ++i) {
        scanf("%d", &p[i]);
        if (p[i] == i + 1) {
            res.push_back(i);
        }
    }
    int answer = 0;
    std::sort(res.begin(), res.end());
    while (res.size() > 1) {
        if (res.back() == res[res.size() - 2] + 1) {
            res.pop_back();
            res.pop_back();
            ++answer;
        } else {
            res.pop_back();
            ++answer;
        }
    }
    answer += res.size();
    printf("%d\n", answer);
    return 0;
}

Measured memory_bytes: 1148
t=int(input())
for nt in range(t):
    n,a,b,c,d=[int(k) for k in input().strip().split(" ")]
    r={0:0}
    z=[0,0,a,b,0,c]
    steps=0
    def solve(k):
        #print("solving for",k)
        global r
     #   global steps
        if k in r:
            return r[k]
        else:
            res=k*d
            for i in [2,3,5]:
                if not k%i:
                    res=min(res,z[i]+solve(k//i))
                else:
                    res=min(res,solve(k//i)+z[i]+d*(k%i))
                    if (k//i+1)<k:
                        res=min(res,solve(k//i+1)+z[i]+d*(i-k%i))
     #   print("solved for",k,res)
     #   steps+=1
        r[k]=res
        return res
    print(solve(n))
    #print("steps",steps)

Measured memory_bytes: 11120
#include<cstdio>
 
#define rep(i,n) for(int i=0;i<(n);i++)
 
using namespace std;
 
int main(){
    int n,T,H,L; scanf("%d%d%d%d",&n,&T,&H,&L);
    int t[100],h[100];
    rep(i,n) scanf("%d%d",t+i,h+i);
 
    int yen=0;
    while(1){
        rep(i,n){
            if(t[i]>0){
                t[i]--;
                T++;
                yen+=10;
                if(T>L){ printf("%d\n",i+1); return 0; }
            if(yen==90){
                int back=yen-90;
                if(T<back/10){ printf("%d\n",i+1); return 0; }
                T-=back/10;
                //t[i]+=back/10;
                yen=0;
            }
            }
            else if(h[i]>0){
                h[i]--;
                H++;
                yen+=100;
            //if(yen>=90){
                int back=yen-90;
                if(T<back/10){ printf("%d\n",i+1); return 0; }
                T-=back/10;
                t[i]+=back/10;
                yen=0;
            //}
            }
            else{
                printf("%d\n",i+1);
                return 0;
            }
        }
    }
}

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

using namespace std;

int main()
{
    vector<int> X;
    vector<int> Y;
    for(;;){
        int x, y;
        cin >> x >> y;
        if(x == 0 && y == 0) break;
        X.push_back(x);
        Y.push_back(y);
    }

    for(int i = 0; i < X.size(); i++){
        int x = X.at(i), y = Y.at(i);
        cout << min(x, y) << " " << max(x, y) << endl;
    }

}



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

int main()
{
	while (true) {
		int N;

		cin >> N;

		if (N == 0) {
			break;
		}

		int map[21][21];

		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				map[i][j] = 0;
			}
		}

		for (int i = 0; i < N; i++) {
			int x, y;

			cin >> x >> y;

			map[x][y]++;
		}

		int M;
		int robox = 10;
		int roboy = 10;

		cin >> M;

		for (int i = 0; i < M; i++) {
			string str;
			int distance;

			cin >> str >> distance;

			if (str == "N") {
				for (int j = 0; j < distance; j++) {
					roboy++;
					map[robox][roboy] = 0;
				}
			}
			else if (str == "E") {
				for (int j = 0; j < distance; j++) {
					robox++;
					map[robox][roboy] = 0;
				}
			}
			else if (str == "S") {
				for (int j = 0; j < distance; j++) {
					roboy--;
					map[robox][roboy] = 0;
				}
			}
			else {
				for (int j = 0; j < distance; j++) {
					robox--;
					map[robox][roboy] = 0;
				}
			}
		}

		bool flag = true;

		for (int i = 0; i < 21; i++) {
			for (int j = 0; j < 21; j++) {
				if (map[i][j] != 0) {
					flag = false;
					goto Label;
				}
			}
		}

	Label:

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

	return 0;
}

Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
long long n,m;
int main(){
    cin>>n>>m;
    if(n==1||m==1) cout<<1;
    else{
        long long t=n*m;
        if(t%2){
            printf("%lld\n",t/2+1);
        }else{
            printf("%lld\n",t/2);
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int H,N,Ai,i;
	Ai=0;
	cin>>H>>N;
	for(int t=1;t<=N;t++)
	{
		cin>>i;
		Ai=Ai+i;
	}
	if(Ai>=H)
	cout<<"Yes";
	else
	cout<<"No"; 
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
typedef long long llong;
const int inf = 1 << 20;
const int mod = 1e9 + 7;

int main() {
   int l, r;
   cin >> l >> r;
   r = min(l + 2019 * 2, r);
   // i mod 2019 から小さいもの2つ選んでもi*jmod2019になるとは限らない.
   //単純にi*j mod2019の最小値を求める。
   llong ans = 2019;
   for (llong i = l; i <= r; i++) {
      for (llong j = i + 1; j <= r; j++) {
         ans = min(ans, (llong)(i * j) % 2019);
      }
   }
   cout << ans << endl;
   return 0;
}

Measured memory_bytes: 256
li=list(str(input()))
cnt=1
for l in li:
  if(cnt%2==0):
    if(l=="L" or l=="U" or l=="D"):
      cnt+=1
    else:
      print("No")
      break
  else:
    if(l=="R" or l=="U" or l=="D"):
      cnt+=1
    else:
      print("No")
      break
if(cnt==len(li)+1):
  print("Yes")

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

int main() {
  string s;
  cin >> s;
  
  auto f = [](string s) {
    for (auto &&c : s) {
      if ((c == 'A') || (c == 'C') || (c == 'G') || (c == 'T')) {
        continue;
      }
      return false;
    }
    return true;
  };
  
  string t = "";
  
  for (int64_t i = 0; i < s.size(); i++) {
    for (int64_t j = 1; i + j <= s.size(); j++) {
      if (f(s.substr(i, j)) && t.size() < j) {
        t = s.substr(i, j);
      }
    }
  }
  
  cout << t.size() << endl;
  
  return 0;
}

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

using namespace std;

int main() {

    int a, b, r, cost;
    cin >> a >> b;

    if(a >= 13) {

        cost = b;

    }else if(a >=6 && a<= 12) {

        cost = b/2;
    }else {

        cost = 0;

    }
          
    cout << cost << endl;
    
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

		int sx = sc.nextInt();
		int sy = sc.nextInt();
		int tx = sc.nextInt();
		int ty = sc.nextInt();

		StringBuffer command = new StringBuffer();

		//move 1
		for(int i = 0; i < ty - sy ; i++){
			command.append("U");
		}
		for(int i = 0; i < tx - sx ; i++){
			command.append("R");
		}
		//move2
		for(int i = 0; i < ty - sy ; i++){
			command.append("D");
		}
		for(int i = 0; i < tx - sx ; i++){
			command.append("L");
		}

		//move3
		command.append("L");
		for(int i = 0; i < ty - sy + 1 ; i++){
			command.append("U");
		}
		for(int i = 0; i < tx - sx + 1; i++){
			command.append("R");
		}
		command.append("D");

		//move4
		command.append("R");
		for(int i = 0; i < ty - sy + 1; i++){
			command.append("D");
		}
		for(int i = 0; i < tx - sx + 1; i++){
			command.append("L");
		}
		command.append("U");

		System.out.println(command);
    }
}

Measured memory_bytes: 23764
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>

using namespace std;

typedef long long ll;

const int maxn = 210;

int u[maxn], v[maxn], n;

vector<int> G[maxn];
ll dis[maxn], sz[maxn], tmp[maxn];
ll ans = 0x7fffffff, ttmp = 0;

void dfs(int u, int f) {
    int s = (int) G[u].size();
    for (int i = 0; i < s; i++) {
        int v = G[u][i];
        if(v == f) continue;
        dis[v] = dis[u] + 1;
        sz[u] ++;
        dfs(v, u);
    }
}

int main() {
    scanf("%d", &n);
    for (int i = 1; i < n; i++) {
        scanf("%d%d", &u[i], &v[i]);
        G[u[i]].push_back(v[i]);
        G[v[i]].push_back(u[i]);
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) dis[j] = sz[j] = 0;
        dis[i] = 1;
        dfs(i, 0);
        ll cur = 0, ttt = 1;
        for (int j = 1; j <= n; j++) {cur = max(cur, dis[j]); tmp[j] = 0;}
        for (int j = 1; j <= n; j++) tmp[dis[j]] = max(tmp[dis[j]], sz[j]);
        for (int j = 1; j < cur; j++) ttt *= tmp[j];
        if (cur < ans) {ans = cur; ttmp = ttt;}
        else if (cur == ans) ttmp = min(ttmp, ttt);
    }
    for (int i = 1; i < n; i++) {
        for (int j = 1; j <= n; j++) dis[j] = sz[j] = 0;
        dis[u[i]] = dis[v[i]] = 1;
        dfs(u[i], v[i]);
        dfs(v[i], u[i]);
        ll cur = 0, ttt = 2;
        for (int j = 1; j <= n; j++) cur = max(cur, dis[j]);
        for (int j = 1; j <= n; j++) tmp[j] = 0;
        for (int j = 1; j <= n; j++) tmp[dis[j]] = max(tmp[dis[j]], sz[j]);
        for (int j = 1; j < cur; j++) ttt *= tmp[j];
        if (cur < ans) {ans = cur; ttmp = ttt;}
        else if (cur == ans) ttmp = min(ttmp, ttt);
    }
    cout << ans << " " << ttmp << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1LL << 30;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, n) for (ll i = a; i < n; i++)
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll t, n, m;
    
    cin >> n;
    cout << (n-2)*180 << endl;
}

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

using namespace std;

int main() {
	int N, M;
	int sum = 0;

	cin >> N >> M;

	vector<int> A(N);

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

	int count = 0;
	for (int i = 0; i < N; i++)
	{
		if (A[i] >= (sum / (4.0 * M))) count++;
	}

	if (count >= M) cout << "Yes" << endl;
	else cout << "No" << endl;



	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,z,i;
  cin>>n;
  vector<pair<int,int>> x,y;
  for(i=0;i<n;i++){
    cin>>z;
    x.push_back(make_pair(z,i+1));
  }
  sort(x.begin(),x.end());
  for(i=1;i<=n;i++){
    if(i<=n/2) y.push_back(make_pair(x.at(i-1).second,x.at(n/2).first));
    else if(i>=n/2+1) y.push_back(make_pair(x.at(i-1).second,x.at(n/2-1).first));
  }
  sort(y.begin(),y.end());
  for(auto w:y) cout<<w.second<<endl;
}

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

using ll = long long;
using P = pair<ll, ll>;

const ll MOD = 1e9+7;
// const ll MOD = 998244353;
const ll INF = 1ll<<60;

#define FOR(i,a,b) for (ll i=(a);i<(ll)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

ll H, W, K;

int main(int argc, char **argv)
{
	cin >> H >> W >> K;
	vector<vector<ll>> dp(H+1, vector<ll>(W, 0));
	dp[0][0] = 1;
	REP(h, H)REP(w, W)
	{
		REP(bits, 1ll<<(W-1))
		{
			bool ok{true};
			REP(ww, W-2)
			{
				if ((bits & (1ll<<ww)) && (bits & (1ll<<(ww+1))))
					ok = false;
			}
			if (!ok) continue;

			if (w >= 1 && (bits & (1ll<<(w-1))))
			{
				(dp[h+1][w-1] += dp[h][w]) %= MOD;
			}
			else if (w <= W-2 && (bits & (1ll<<w)))
			{
				(dp[h+1][w+1] += dp[h][w]) %= MOD;
			}
			else
				(dp[h+1][w] += dp[h][w]) %= MOD;
		}
	}

	std::cout << dp[H][K-1] << std::endl;
	
}


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

int main() {
    int n;
    cin >> n;
    if(n >= 100)cout << "ABC" <<  n << endl;
    else if(n >= 10)cout << "ABC0" << n << endl;
    else cout << "ABC00" << n << endl;
    return 0;
}



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

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

#define mp make_pair
#define pb(x) push_back(x)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repp(i, s, e) for (int i = (s); i < (e); i++)
#define all(x) x.begin(), x.end()

#define INF 2123456789
#define IINF 9123456789123456789

void use_cio() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
}
// template <typename... Args>
// void dbg(Args... args) {
//     ((cout << args << " "), ...);
//     cout << endl;
// }

//--------------------------------------------------//
int _sum;
int main() {
    use_cio();
    int n;
    cin >> n;
    rep(i, n) {
        int a;
        cin >> a;
        _sum += a;
    }
    cout << _sum - n << endl;
}


Measured memory_bytes: 256
W,H,N = map(int,input().split())
src = [tuple(map(int,input().split())) for i in range(N)]
top,bottom,left,right = H,0,0,W

for x,y,a in src:
    if a == 1:
        left = max(left,x)
    elif a == 2:
        right = min(right,x)
    elif a == 3:
        bottom = max(bottom,y)
    else:
        top = min(top,y)
w = max(0, right-left)
h = max(0, top-bottom)
print(w*h)

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

int main() {
	// your code goes here


char A;

cin >> A;

if(A=='a'|| A=='i'||A=='u'||A=='e'||A=='o'){


cout << "vowel" << endl;

}


else {

cout << "consonant" << endl;

}
	return 0;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;

int64_t N;

void solve()
{
    std::cin >> N;

	std::vector<int64_t> P(N), Q(N);
	for (int64_t i = 0; i < N; i++)
	{
		std::cin >> P[i];
	}
	for (int64_t i = 0; i < N; i++)
	{
		std::cin >> Q[i];
	}

	// 回す数列の初期値
	std::vector<int64_t> R(N);
	for(int64_t i = 0; i < N; i++)
	{
		R[i] = i + 1; // 1-originに揃える
	}

	int64_t order_P, order_Q;
	int64_t iter = 1;

	do
	{
		if (R == P) order_P = iter;
		if (R == Q) order_Q = iter;
		iter++;
	} while (std::next_permutation(R.begin(), R.end()));
	
	int64_t ans = std::abs(order_P - order_Q);
	std::cout << ans << std::endl;
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	solve();
}


Measured memory_bytes: 3644
// see https://gist.github.com/LumaKernel/ff55d49ee1af69b7388f15b707e75c15
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <complex>
#include <random>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> VI;
typedef vector<P> VP;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define RREP(i,n) RFOR(i,0,n)

#define LFOR(i,a,b) for(ll i=(a);i<(b);++i)
#define RLFOR(i,b,a) for(ll i=(b)-1;i>=(a);--i)

#define ALL(a) (a).begin(),(a).end()
#define UNIQUE(a) (a).erase(unique((a).begin(),(a).end()),(a).end())
#define MP make_pair
#define PB push_back
#define EACH(i,c) REP(i,(int)(c).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define dump(x) cerr << "[L " << __LINE__ << "] " << #x << " = " << (x) << "\n";
#define dump2(x,y) cerr << "[L " << __LINE__ << "] " << #x << " = " << (x)\
			<< " , " << #y << " = " << (y) << "\n";

const int INF = 1e9;
const double EPS = 1e-10;

int n,m;
ll k;
string s;

int main() {
	omajinai;
	cin >> n >> m;
	int prev;
	cin >> prev;
	int ans = 0;
	REP(i, n-1){
		int x;
		cin >> x;
		if(prev + x >= m){
			ans = i;
			break;
		}
		if(i==n-2){
			cout << "Impossible" << endl;
			return 0;
		}
		prev = x;
	}



	cout << "Possible" << endl;

	REP(i, ans) cout << i+1 << endl;
	RFOR(i, ans + 1, n-1) cout << i+1 << endl;

	cout << ans + 1 << endl;
}


Measured memory_bytes: 896
N=int(input())
ans=float("Inf")
for i in range(N+1):
   k=N-i
   k2=i
   six=0
   nine=0
   while k2>0:
      six+=k2%6
      k2//=6
   while k>0:
      nine+=k%9
      k//=9
   ans=min(ans,six+nine)
print(ans)

Measured memory_bytes: 3064
n = int(input())
talk = []
ans = "YES"
for i in range(n):
        a = input()
        if i == 0:
                talk.append(a)
                continue
        if a == "A":
                if len(talk) != 0 and talk[-1] == "Un":
                        ans = "NO"
                talk.append(a)
        else:
                if len(talk) == 0 or talk.pop() != "A":
                        ans = "NO"

if len(talk) != 0:
        ans = "NO"
print(ans)



Measured memory_bytes: 5600
// includes {{{
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<random>
#include<cassert>
// #include<deque>
// #include<multiset>
// #include<bitset>
// #include<cstring>
// #include<bits/stdc++.h>
// }}}
using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int a ,b;
  cin >> a >> b;
  if(b % a == 0) cout << a + b << endl;
  else cout << b - a << endl;
  return 0;
}


Measured memory_bytes: 256
while True:
    lis = []
    N = int(raw_input())
    if N == 0: break
    for i in range(N):
        lis.append(int(raw_input()))
    else:
        lis.sort()
    ans = []
    w = 0
    for v in lis[:-1]:
        w += v
        ans.append(w)
    else:
        print sum(ans)

Measured memory_bytes: 4708
#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;
typedef long long ll;
typedef double db;
typedef vector <ll> vll;
typedef pair <ll, ll> pll;
#define pb push_back
#define mp make_pair
#define MAX 1000000
#define mod 1000000007
#define all(_) _.begin(), _.end()
#define F first
#define S second
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
ll cal(ll a, ll b, ll c)
{
    return b / c - (a - 1) / c;
}
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << (b - a + 1) - (cal(a, b, c) + cal(a, b, d) - cal(a, b, (c * d) / __gcd(c, d))) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<map>

using namespace std;

int main(){
int n; cin >> n;
  map<int,int> mp1,mp2;
  for(int i = 0; i < n; i++){
    int v; cin >> v;
    if( i % 2 == 0){ mp1[v]++;}
    else{mp2[v]++;}}
  
  int max_cnt1 = 0; int max_cnt2 = 0;
  int max_a = 0; int max_b = 0;
  int second_cnt1 = 0; int second_cnt2 = 0;
  
  for(auto q:mp1){
    pair<int,int> p = q;
    int s = p.first;
    int t = p.second;
    if( t > max_cnt1){ second_cnt1 = max_cnt1;max_cnt1 = t; max_a = s;}
    else if( t > second_cnt1){ second_cnt1 = t;}}
  
  for(auto q:mp2){
    pair<int,int> p = q;
    int s = p.first;
    int t = p.second;
    if( t > max_cnt2){ second_cnt2 = max_cnt2; max_cnt2 = t; max_b = s;}
    else if( t > second_cnt2){ second_cnt2 = t;}}
  
  if( max_a != max_b){ cout << n - max_cnt1 - max_cnt2 << endl;}
  else{
    cout <<min(n - max_cnt1 - second_cnt2, n - max_cnt2 - second_cnt1) << endl;}
  return 0;}
                      
    

Measured memory_bytes: 4992
import java.util.Scanner;

public class Main {

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

		    String s = sc.nextLine();
		    String t = sc.nextLine();
		    String[] s_s = s.split("");
		    String[] t_s = t.split("");
		    int cnt = 0;
		    for(int i=0;i<s_s.length;i++) {
		    	if(s_s[i].equals(t_s[i])) {
		    		cnt +=1;
		    	}
		    }
		    System.out.println(cnt);

		    sc.close();
	}
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define LOOP(n) for (int _i = 0; _i < (n); _i++)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, r, n) for (int i = (r); i < (n); ++i)
#define ALL(obj) begin(obj), end(obj)
using namespace std;
using ll = long long;
using ull = unsigned long long;

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

// 多次元 vector 生成
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

int N;

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

    cin >> N;
    vector<int> a(N);
    REP(i, N) { cin >> a.at(i); }

    int four = 0, two = 0;
    REP(i, N) {
        if (a[i] % 4 == 0) {
            four++;
        } else if (a[i] % 2 == 0) {
            two++;
        }
    }

    if (N - two / 2 * 2 <= (four * 2 + 1)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 640
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>


using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

class AHappyBirthday {
public:
void solve(std::istream& cin, std::ostream& cout) {
    int a,b;
    string ans;
    cin >> a >> b;
    if(a<=8 && b<=8){
        ans = "Yay!";
    } else{
        ans = ":(";
    }
    cout << ans << endl;
}
};


int main() {
	AHappyBirthday solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3596
#pragma GCC optimize "-O3"
#pragma GCC target ("avx")
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define inf (1ll<<60)
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())
signed gcd(int a, int b){return b?gcd(b,a%b):a;}
signed lcm(int a,int b){return a*b/gcd(a,b);}

using namespace std;

const int mod=1e9+7;

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int n;
    cin >> n;
    vi a(n);
    rep(i,n)cin >> a[i];
    int ans=a[0];
    for(int i=1;i<n;++i)
    {
        ans=ans^a[i];
    }
    if(ans==0)cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 1024