akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

class Dice {
    int dice[6];
public:
    void input() {
        for(int i=0; i<6; ++i) cin >> dice[i];
    }
    void output() {
        cout << dice[0];
        for(int i=1; i<6; ++i) cout << ' ' << dice[i];
        cout << endl;
    }
    void move(string state) {
        for(int i=0; i<state.length(); ++i) {
            switch(state[i]) {
                case 'N':
                    swap(dice[0], dice[1]);
                    swap(dice[1], dice[5]);
                    swap(dice[5], dice[4]);
                    break;
                case 'S':
                    swap(dice[0], dice[4]);
                    swap(dice[4], dice[5]);
                    swap(dice[5], dice[1]);
                    break;
                case 'E':
                    swap(dice[0], dice[3]);
                    swap(dice[3], dice[5]);
                    swap(dice[5], dice[2]);
                    break;
                case 'W':
                    swap(dice[0], dice[2]);
                    swap(dice[2], dice[5]);
                    swap(dice[5], dice[3]);
                    break;
                default:
                    break;
            }
        }
    }
    int getTopside(string state) {
        move(state);
        return dice[0];
    }
    int index_of(int x) {
        for(int i=0; i<6; ++i) {
            if(dice[i] == x) return i;
        }
        return -1;
    }
    int getRightside(int top, int front) {
        int ind;
        ind = index_of(top);
        if(ind < 0) return -1;
        switch(ind) {
            case 0:
                break;
            case 1:
                move("N");
                break;
            case 2:
                move("W");
                break;
            case 3:
                move("E");
                break;
            case 4:
                move("S");
                break;
            case 5:
                move("NN");
                break;
            default:
                break;
        }
        ind = index_of(front);
        switch(ind) {
            case 0:
                break;
            case 1:
                break;
            case 2:
                move("NWS");
                break;
            case 3:
                move("NES");
                break;
            case 4:
                move("NWWS");
                break;
            case 5:
                break;
            default:
                break;
        }
        return dice[2];
    }
    int getPip(int ind) {
        return dice[ind];
    }
    bool checkDice(Dice cdice) {
        for(int i=0; i<6; ++i)
            if(dice[i] != cdice.getPip(i)) return false;
        return true;
    }
};

int main() {
    int i, j, n;
    cin >> n;
    Dice d[n];

    for(i=0; i<n; ++i) d[i].input();

    for(i=0; i<n-1; ++i) {
        for(j=i+1; j<n; ++j) {
            d[j].getRightside(d[i].getPip(0), d[i].getPip(1));
            if(d[i].checkDice(d[j])) {
                cout << "No" << endl;
                return 0;
            }
        }
    }

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

Measured memory_bytes: 3228
#include<stdio.h>
main(){
    int a,b;
      
    scanf("%d %d\n",&a,&b);
    if(a > b){
        printf("a > b\n");
    }
        else if(a < b){
            printf("a < b\n");
        }
        else if(a == b){
            printf("a == b\n");
        }
            
}


Measured memory_bytes: 2688
//2019.8.22 by ljz
//email 573902690@qq.com
//if you find any bug in my code
//please tell me
#include<bits/stdc++.h>
using namespace std;
#define res register int
#define LL long long
#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f
#define unl __int128
#define eps 5.6e-8
#define RG register
#define db double
#define pc(x) __builtin_popcount(x)
typedef pair<int,int> Pair;
#define mp make_pair
#define fi first
#define se second
#define pi acos(-1.0)
#define pb push_back
#define ull unsigned LL
#define gc getchar
//inline char gc() {
//    static char buf[100000],*p1,*p2;
//    return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
//}
inline int read() {
    res s=0,ch=gc();
    while(ch<'0'||ch>'9')ch=gc();
    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
    return s;
}
//inline int read() {
//    res s=0,ch=gc(),w=1;
//    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=gc();}
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s*w;
//}
//inline LL Read() {
//    RG LL s=0;
//    res ch=gc();
//    while(ch<'0'||ch>'9')ch=gc();
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s;
//}
//inline LL Read() {
//    RG LL s=0;
//    res ch=gc(),w=1;
//    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=gc();}
//    while(ch>='0'&&ch<='9')s=s*10+ch-'0',ch=gc();
//    return s*w;
//}
//inline void write(RG unl x){
//    if(x>10)write(x/10);
//    putchar(int(x%10)+'0');
//}
inline void swap(res &x,res &y) {
    x^=y^=x^=y;
}
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//clock_t start=clock();
//inline void ck(){
//    if(1.0*(clock()-start)/CLOCKS_PER_SEC>0.1)exit(0);
//}
const int N=1e4+10;
namespace MAIN{
    int n,k;
    char str[N];
    char mn='z',mx='a',ans[N],tmp[N];
    inline void solve(RG char *s,res k){
        res now=n,len=0;
        while(now&&s[now]==mn)now--,len++;
        while(k&&len<n)len<<=1,--k;
        if(len>=n){
            for(res i=1;i<=n;i++)ans[i]=mn;
            printf("%s\n",ans+1);exit(0);
        }
        for(res i=1;i<=len;i++)tmp[i]=mn;
        for(res i=len+1;i<=n;i++)tmp[i]=s[now--];
        for(res i=1;i<=n;i++){
            if(ans[i]!=tmp[i]){
                if(ans[i]>tmp[i]){
                    for(res j=1;j<=n;j++)ans[j]=tmp[j];
                }
                break;
            }
        }
    }
    inline void MAIN(){
        n=read(),k=read(),scanf("%s",str+1);
        for(res i=1;i<=n;i++)mn=min(mn,str[i]),mx=max(mx,str[i]),ans[i]='z',str[(n<<1)-i+1]=str[i];
        if(mn==mx){printf("%s\n",str+1);return;}
        if(str[n]==mn)solve(str,k);
        for(res i=n;i<=n<<1;i++)if(str[i]==mn)solve(str+i-n,k-1);
        printf("%s\n",ans+1);
    }
}
int main(){
//    srand(19260817);
//    freopen("signin.in","r",stdin);
//    freopen("signin.out","w",stdout);
    MAIN::MAIN();
    return 0;
}

Measured memory_bytes: 384
import java.util.*;
import java.math.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int res = Math.max(0, Math.min(b,d)-Math.max(a,c));
        System.out.println(res);
        sc.close();
    }
}

class io {
    public static void br() {
        System.out.println("");
    }

    public static void YesNo(boolean f) {
        System.out.println(f ? "Yes" : "No");
    }

    public static void YESNO(boolean f) {
        System.out.println(f ? "YES" : "NO");
    }

}

class Algo {
    public static boolean isOdd(int n) {
        return n % 2 == 1;
    }

    public static boolean isEven(int n) {
        return n % 2 == 0;
    }


}



Measured memory_bytes: 23508
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    ab, bc, ca = nm()
    print(ab * bc // 2)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9096
import java.util.Scanner;

//20180510
//04

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

		while (scanner.hasNext()) {
			String str = scanner.nextLine();
			char[] cha = str.toCharArray();
			int sum = 0;

			if(str.equals("0")) {
				break;
			}

			for(int i = 0;i < cha.length;i++) {

				sum += Character.getNumericValue(cha[i]);
			}

			System.out.println(sum);
		}

		scanner.close();
    }
}


Measured memory_bytes: 26612
"use strict";
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill(0).map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill(0).map(x=>"+r+")";return eval(r);}

var mod = 998244353;
function mul(){for(var a=arguments,r=a[0],i=a.length;--i;)r=((r>>16)*a[i]%mod*65536+(r&65535)*a[i])%mod;return r;}
var fac=[],finv=[],invs=[];
function fset(n){
  fac.length=n+1,fac[0]=fac[1]=1;
  for(var i=2;i<=n;)fac[i]=mul(fac[i-1],i++);
  //finv.length=n+1,finv[0]=finv[1]=1,finv[n]=inv(fac[n]);
  //for(i=n;2<i;)finv[i-1]=mul(finv[i],i--);
  //invs.length=n+1,invs[0]=invs[1]=1;
  //for(i=2;i<=n;)invs[i]=mul(fac[i-1],finv[i++]);
}
function inv(b){for(var a=mod,u=0,v=1,t;b;v=t)t=a/b|0,a-=t*b,u-=t*v,t=a,a=b,b=t,t=u,u=v;u%=mod;return u<0?u+mod:u;}
function pow(a,n){for(var r=1;n;a=mul(a,a),n>>=1)if(n&1)r=mul(a,r);return r;}
function ncr(n,r){return mul(fac[n],finv[r],finv[n-r]);}
function npr(n,r){return mul(fac[n],finv[r]);}

console.log(main());
function main(){
  var n = o.a();
  var d = o.l();
  if(d[0] > 0)return 0;
  if(n === 1)return 1;
  var map = xArray(0,n);
  for(var i = 1; i < n; i++){
    if(d[i] === 0)return 0;
    map[d[i]]++;
  }
  var ans = 1;
  fset(n+1);
  for(var i = 2; i < n; i++){
    if(map[i-1] === 0 && map[i])return 0;
    ans = mul(ans, pow(map[i-1],map[i]));
  }
  return ans;
}

Measured memory_bytes: 41808
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
  
if __FILE__ == $0
  while line = STDIN.gets
    tokens = line.chomp!.split.map!(&:to_i)
    a, b, c = tokens[0], tokens[1], tokens[2]
    if a < b && b < c
      puts "Yes"
    else
      puts "No"
    end
  end
end

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

int main(){
  char a;
  cin >> a;
  if(a=='9'){
    cout << "Yes" << endl;
  }
  else{
    cin >> a;
    if(a=='9'){
      cout << "Yes" << endl;
    }
    else{
      cout << "No" << endl;
    }
  }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<stdlib.h>

typedef struct pp{
	char name[10];
	int time;
	int next;
	int last;
}P;

int main() {
	int n,q;
	int counter = 0;
	P val[100000];
	
	int totaltime = 0;
	int usetime = 0;
	
	scanf("%d", &n); //count
	scanf("%d", &q); //quontime
	
	for(int i = 0; i < n; i++){
		scanf("%s", val[i].name);
		scanf("%d", &val[i].time);
		totaltime += val[i].time;
		val[i].next = i + 1;
		val[i].last = i - 1;
	}
	val[n - 1].next = 0;
	val[0].last = n - 1;
	
	int memo_a = -1; //firstplace
	int memo_b = -1; //lastplace
	for(int i = 0;totaltime > usetime;i = val[i % n].next) {
		if(val[i % n].time <= 0){

		}else if(val[i % n].time > q){
			val[i % n].time -= q;
			usetime += q;
		}else{
			usetime += val[i % n].time;
			val[i % n].time = 0;
			val[val[i % n].next].last = val[i % n].last;
			val[val[i % n].last].next = val[i % n].next;
			printf("%s %d\n",val[i%n].name,usetime);
		}
/*		if(i % n == n - 1){
			printf("-----------%d-------------(%d)\n",i,i%n);
			for(int v = 0; v < n; v++){
				printf("%s %d\n",val[v].name,val[v].time);
			}
		printf("memo_a = %d, memo_b = %d\n",memo_a,memo_b);
			printf("-----------%d-------------\n",i);
		}
		if(i > 50){
			break;
		}*/
	}
	return 0;
}


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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  int n, m, c;
  cin >> n >> m >> c;
  vector<int> b(m);
  vector<vector<int>> a(m, vector<int>(n));

  rep(i, m) cin >> b[i];
  rep(i, n) rep(j, m) cin >> a[j][i];

  int ans = 0;
  rep(i, n) {
    int tmptot = 0;
    rep(j, m) { tmptot += a[j][i] * b[j]; }
      tmptot += c;
    if (tmptot > 0) ans++;
  }

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


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
using namespace std;
#define i64  long long
// #define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807
#define MOD 1000000007



void solve()
{
  int N;
  int proc_time;
  cin>>N>>proc_time;
  queue<int> time;
  queue<string> opname;

  for (int i = 0; i < N; i++)
  {
    string A;
    int B;

    cin>>A;
    cin>>B;
    opname.push(A);
    time.push(B);
  }
  
  int Alltime = 0;

  while(!time.empty())
  {
    int T;
    string Name;
    T = time.front();
    time.pop();
    Name = opname.front();
    opname.pop();
    T = T -proc_time;
    Alltime += min(proc_time,T + proc_time);

    if(T <= 0)
    {
      cout<<Name<<" "<<Alltime<<endl;
    }
    else
    {
      time.push(T);
      opname.push(Name);
    }
    
  }
  
  
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  solve();
 
  return 0;
}


Measured memory_bytes: 5700
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <iomanip>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define All(v) (v).begin(),(v).end()
typedef long long ll;

const int MOD = 1e9+7;

int main(){
    ll N;
    string S;
    cin >> N >> S;
    int ok = 1;
    vector<ll> A(2*N);
    A[0]=1;
    //L==1,R==0
    for(int i=1;i<2*N;i++){
        if(S[i]!=S[i-1])A[i]=A[i-1];
        else A[i]=1-A[i-1];
    }
    if(A[2*N-1]==1)ok = 0;
    if(S[0]=='W'&&S[2*N-1]=='W')ok=0;
    int num = 0;
    ll res = 1;
    for(int i=2*N-1;i>=0;i--){
        if(A[i]==0)num++;
        else{
            res*=num;
            res%=MOD;
            num--;
        }
    }
    if(num!=0)ok=0;
    ll facN = 1;
    for(int i=1;i<=N;i++){
        facN*=i;
        facN%=MOD;
    }
    if(ok)cout << (res*facN)%MOD << endl;
    else cout << 0 << endl;
    return 0;
}

Measured memory_bytes: 2180
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using ld = long double;
template<typename T> using V = vector<T>;
template<typename T> using VV = vector<vector<T>>;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,a,n) for(ll i=a;i<(ll)(n);++i)
#define repr(i,a,n) for(ll i=n-1;(ll)a<=i;--i)
#define ENDL '\n'
typedef pair<int,int> Pi;
typedef pair<ll,ll> PL;
constexpr ll mod = 998244353;
constexpr ll INF = 1000000099;
constexpr ll LINF = (ll)(1e18 +99);
const vector<ll> dx={-1,1,0,0},dy={0,0,-1,1};
template<typename T,typename U> inline bool chmin(T& t, const U& u){if(t>u){t=u;return 1;}return 0;}
template<typename T,typename U> inline bool chmax(T& t, const U& u){if(t<u){t=u;return 1;}return 0;}
template<typename T> inline T gcd(T a,T b){return b?gcd(b,a%b):a;}

template<typename T,typename Y> inline T mpow(T a, Y n) {
  T res = 1;
  for(;n;n>>=1) {
    if (n & 1) res = res * a;
    a = a * a;
  }
  return res;
}

template<typename T,typename Y>
ostream& operator<<(ostream& os,const pair<T,Y>& p){
   return os<<"{"<<p.fs<<","<<p.sc<<"}";
}
template<typename T> ostream& operator<<(ostream& os,const V<T>& v){
   os<<"{";
  for(auto e:v)os<<e<<",";
  return os<<"}";
}
template<typename ...Args>
void debug(Args&... args){
  for(auto const& x:{args...}){
    cerr<<x<<' ';
  }
  cerr<<ENDL;
}

const int MAX = 200010;//設定して

long long fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod / i) % mod;
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}

long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

long long modpow(long long a, long long n, long long MOD) {//a^n(MOD)を求める
    long long res = 1%MOD;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;//次の準備
        n >>= 1;
    }
    return res;
}

signed main(){
  cin.tie(0);ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);
  ll n,m,k;cin>>n>>m>>k;
  COMinit();

  ll ans=0;

  rep(i,0,k+1){
    ll res=COM(n-1,i);
    res*=m;
    res%=mod;
    res*=modpow(m-1,n-i-1,mod);
    res%=mod;
    ans+=res;
    ans%=mod;
  }
  cout<<ans<<ENDL;
}
//! ( . _ . ) ! 
//CHECK overflow,vector_size,what to output?

Measured memory_bytes: 8360
#include<bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;

#define endl            "\n"
#define forn(i,x,n)     for(int i=x; i<n; i++)
#define forit(it, m)    for(decltype(m)::iterator it = m.begin(); it!=m.end(); ++it)
#define ff              first
#define ss              second
#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 inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void zeus()
{
    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
}



int32_t main() {

    zeus();

    int n; cin >> n;

    int a[n];

    forn(i, 0, n) {
        cin >> a[i];
    }

    sort(a, a + n);

    int ans = 0;
    ans += a[n - 1];

    forn(i, 0, n - 2) {
        int x = i / 2;
        ans += a[n - 2 - x];
    }

    cout << ans << endl;


}

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

#define pb push_back
#define rep(i, a, n) for(int (i)=a; (i)<(n); (i)++)
#define FOR(i, n) rep(i, 0, n)
#define F(n) FOR(i, n)
#define FF(n) FOR(j, n)
#define repi(i, a, n) for(int (i)=a; (i)<=(n); (i)++)
#define FORI(i, n) repi(i, 1, n)
#define FI(n) FORI(i, n)
#define FFI(n) FORI(j, n)
#define IN(x) int x; cin>>(x);
#define SIN(x) string x; cin>>x;
#define INN(x, y) int x, y; cin>>(x)>>(y);
#define INFO(a) cout<<"info "<<a<<endl
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int, int>
#define vpii vector<pair<int, int> >
#define sortv(x) sort((x).begin(), (x).end())
#define sortvd(x) sort((x).begin(), (x).end(), greater<int>())
#define lboundv(x,v) lower_bound((x).begin(),(x).end(),(v))-(x).begin();
#define uboundv(x,v) upper_bound((x).begin(),(x).end(),(v))-(x).begin();
#define ite iterator
#define fi first
#define se second
#define mems(a, v) memset((a), (v), sizeof((a)))
#define lmid(l, r) ((l)+(r)-1)/2
#define rmid(l, r) ((l)+(r))/2+1
#define mp make_pair

typedef long long ll;
typedef long double LD;

using namespace std;

string s, t;
int ls, lt;
bool match(int i) {
	//cout<<"ca "<<i<<endl;
	if(ls-i<lt) return false;
	for(int j=i; j<lt+i; j++) if(s[j]!='?' && s[j]^t[j-i]) return false;
	return true;
}

int main() {
	ios::sync_with_stdio(0);
	cin>>s>>t;
	ls = s.size();
	lt = t.size();
	for(int i=ls-lt; i>=0; i--) {
		if(match(i)) {
			for(int j=0; j<ls; j++) if(s[j]=='?') s[j]='a';
			for(int j=i; j<lt+i; j++) s[j] = t[j-i];
			cout<<s<<endl;
			return 0;
		}
	}
	cout<<"UNRESTORABLE"<<endl;
	return 0;
}

Measured memory_bytes: 256
import           Control.Applicative
import           Control.Monad
import           Data.List

main :: IO ()
main = do
  a:b:c:_ <- (map read . words) <$> getLine
  putStrLn $ compareThreeNumbers a b c

compareThreeNumbers :: Int -> Int -> Int -> String
compareThreeNumbers x y z =
  if x < y && y < z
    then "Yes"
    else "No"

Measured memory_bytes: 3608
N, A, B, C = map(int, input().split())
L = [int(input()) for _ in range(N)]
inf = 10 ** 9

def dfs(cur, a, b, c):
    if cur == N:
        return abs(a-A)+abs(b-B)+abs(c-C)-30 if min(a,b,c)>0 else inf
    non_marge = dfs(cur+1, a, b, c)
    marge_a = dfs(cur+1, a+L[cur], b, c) + 10
    marge_b = dfs(cur+1, a, b+L[cur], c) + 10
    marge_c = dfs(cur+1, a, b, c+L[cur]) + 10
    return min(non_marge, marge_a, marge_b, marge_c)

print(dfs(0, 0, 0, 0))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<queue>
#include<cmath>
#include<algorithm>
#include<map>
#define debug1 cout<<"?"<<endl;
#define debug2 cout<<"?"<<i<<endl;
#define PII pair<int,int>
#define PIB pair<int,bool>
typedef long long ll;
using namespace std;
const int maxn=1e5+9;
const double pi=acos(-1);
const int mod=1e9+7;
const int INF=1e9;
const double ep=1e-10;
int main()
{
	ll n;
	scanf("%lld",&n);
	ll ans=(n/500)*1000;
	n%=500;
	ans+=(n/5)*5;
	printf("%lld\n",ans);
}

Measured memory_bytes: 256
import operator
from functools import reduce

def main():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1
    if 0 in A:
        print("0")
        exit()
    
    for i in A:
        ans *= i
        if ans > 10 ** 18:
            print(-1)
            exit()

    
    print(ans)
    
if __name__ == "__main__":
    main()


Measured memory_bytes: 22612
def main():
    SA = list(input())
    SB = list(input())
    SC = list(input())

    SA.reverse()
    SB.reverse()
    SC.reverse()

    turn = 'a'
    for i in range(400):
        if turn == 'a':
            if len(SA) == 0:
                print('A')
                return
            turn = SA.pop()
        elif turn == 'b':
            if len(SB) == 0:
                print('B')
                return
            turn = SB.pop()
        else:
            if len(SC) == 0:
                print('C')
                return
            turn = SC.pop()
 
if __name__ == "__main__":
    main()


Measured memory_bytes: 8876
N = input()
A = [0]+map(int, raw_input().split())+[0]
s = 0
for i in range(N+1):
  s += abs(A[i+1]-A[i])
for i in range(1,N+1):
  print s-abs(A[i]-A[i-1])-abs(A[i+1]-A[i])+abs(A[i+1]-A[i-1])


Measured memory_bytes: 11132
#include<iostream>
#include<algorithm>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

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

    if(c >= a && c <= b) puts("Yes");
    else puts("No");

}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC130B
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int N = int.Parse(input[0]);
            int X = int.Parse(input[1]);

            string[] input2 = Console.ReadLine().Split();
            int[] L = new int[N + 1];
            L[0] = 0;
            for (int i = 1; i <= N; i++)
            {
                L[i] = int.Parse(input2[i - 1]);
            }
            //累積を計算して、座標を求める
            //Dは2～（N＋1）まで計算される
            int[] D = new int[N + 2];
            D[0] = 0;
            int count = 0;
            for (int i = 1; i <= N+1; i++)
            {
                D[i] = D[i - 1] + L[i - 1];
                if (D[i]<=X)
                {
                    count++;//もし座標がX以下だったらカウントを1増やす
                }
                else
                {
                    break;//もし座標がXを超えたら終わる
                }
            }
            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 13140
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		sc.close();
		int r = A - (B + C);
		System.out.println(r > 0 ? 0 : r * -1);
	}
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int N,M; cin>>N>>M;
    int t=1900*M+100*(N-M);
    cout<<t*(1<<M)<<endl;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(A: int, B: int):
    return NO if (A * B) % 2 == 0 else YES


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    result = solve(A, B)
    print(result)

if __name__ == '__main__':
    main()


Measured memory_bytes: 5140
#include<bits/stdc++.h>
using namespace std;
const int DN=1e5+5;
int n,a[DN],dp[DN];
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    for(int i=2;i<=n;i++)
    {
        dp[i]=dp[i-1]+abs(a[i]-a[i-1]);
        if(i>2)
            dp[i]=min(dp[i],dp[i-2]+abs(a[i]-a[i-2]));
    }
    cout<<dp[n];
}


Measured memory_bytes: 1024
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int X = reader.nextInt();
		int[] M = new int[N];
		int ans = N;
		for (int i = 0; i < N; i++) {
			M[i] = reader.nextInt();
			X -= M[i];
		}
		Arrays.sort(M);
		ans += X / M[0];
		reader.close();
		System.out.print(ans);
	}
}



Measured memory_bytes: 23380
import java.util.Scanner;

public class Main {

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

		int a = sc.nextInt();
		int b = sc.nextInt();
		int d = 0;
		int r = 0;
		double f;

		d = a / b;
		r = a % b;
		f = (double)a / b;
		

		//System.out.println(d + " " + r + " " + f);
		System.out.printf(d + " " + r + " " +"%.7f \n",f);
	}

}



Measured memory_bytes: 26528
while 1:
    x,y = list(map(int, input().split()))
    if x == 0: break
    c = [list(map(int, input().split())) for _ in range(y)]
    c.append([0]*x)
    c.append([0]*x)
    dp = [[0]*x for _ in range(y+2)]
    for i in range(x):
        if c[0][i] == 0: dp[0][i] = 1
    for i in range(y):
        for j in range(x):
            if c[i][j] == 0:
                if i != y-1:
                    if j != 0 and c[i+1][j-1] == 0:
                        dp[i+1][j-1] += dp[i][j]
                    if j != x-1 and c[i+1][j+1] == 0:
                        dp[i+1][j+1] += dp[i][j]
                    if c[i+1][j] != 1:
                        dp[i+1][j] += dp[i][j]
            elif c[i][j] == 2:
                if c[i+2][j] != 1:
                    dp[i+2][j] += dp[i][j]
    ans = 0
    for i in dp[y-1:y+1]:
        ans += sum(i)
    print(ans)
"""
while 1:
    x,y = list(map(int, input().split()))
    if x == 0: break
    c = [list(map(int, input().split())) for _ in range(y)]
    dp = [[0]*x for _ in range(y+1)]
    for i in range(x):
        if c[0][i] == 0: dp[0][i] = 1
    for i in range(1,y):
        for j in range(x):
            if c[i][j] == 0:
                if i >= 2 and c[i-2][j] == 2:
                    dp[i][j] += dp[i-2][j]
                if j != 0   and c[i-1][j-1] == 0:dp[i][j] += dp[i-1][j-1]
                if j != x-1 and c[i-1][j+1] == 0:dp[i][j] += dp[i-1][j+1]
                if c[i-1][j] != 1: dp[i][j] += dp[i-1][j]
            elif c[i][j] == 2:
                dp[i][j] += dp[i-1][j]
                if i >= 2 and c[i-2][j] == 2:
                    dp[i][j] += dp[i-2][j]
    for i in dp:
        print(i)
    ans = 0
    for i in range(x):
        ans += dp[y-1][i]
        if y >= 2 and c[y-2][i] == 2:
            ans += dp[y-2][j]
    print(ans)
"""


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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)
#define PI 3.14159265358979

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

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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, a[202020], d[202020];
P p[202020];
void solve(){
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		p[i] = {a[i],i};
	}
	sort(p,p+n);
	
	for(int i = 0; i < n; i++){
		if(i < n/2) d[p[i].second] = p[n/2].first;
		else d[p[i].second] = p[n/2-1].first;
	}
	for(int i = 0; i < n; i++){
		cout << d[i] << endl;
	}
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 6912
#include <iostream>
#include <vector>
#include <unordered_map>
#include <map>
#include <algorithm>
#include <set>
#include <unordered_set>
#include <deque>
#include <cmath>
#include <stack>
#include <queue>
#include <string>
#include <iomanip>
#include <cstring>
#include <climits>
#include <cstdio> 

#define nl '\n'

using namespace std;

string s;

int main(){

    cin >> s;

    if(s[2] == s[3] && s[4] == s[5]) {
        cout << "Yes";
        return 0;
    } 
    cout << "No";
}
 
//g++ -std=c++14 comp.cpp -o c && c.exe
//g++ -std=c++14 comp.cpp -o c; ./c.exe
//g++ -std=c++14 comp.cpp && ./a.out


//Surely this is going to AC

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)

using namespace std;
using ll = long long;
using P = pair<int, int>;
using LP = pair<ll, ll>;

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

    int N;
    double W;
    cin>>N>>W;
    vector<vector<double>> fvw(N, vector<double>(3));
    rep(i, N) {
        double v, w, f;
        cin>>v>>w;
        f = v / w;
        fvw[i][0] = f;
        fvw[i][1] = v;
        fvw[i][2] = w;
    }
    sort(fvw.begin(), fvw.end());
    reverse(fvw.begin(), fvw.end());

    double ans = 0;
    for (auto item : fvw) {
        double v = item[1];
        double w = item[2];
        if (W < w) {
            ans += v * W / w;
            W = 0;
            break;
        }
        ans += v;
        W -= w;
    }
    cout<<fixed<<setprecision(10)<<ans<<endl;
}


Measured memory_bytes: 8420
#include <stdio.h>
#include <iostream>

using namespace std;

const int INDEFINITE = -1;

template<class T> inline T pow(T base, T exponent) {
    if (exponent == 0) return 1;

    if (exponent % 2 == 1) {
        return base * pow(base, exponent - 1);
    } else {
        T tmp = pow(base, exponent / 2);
        return tmp * tmp;
    }
}

int dp(int N, int m[]) {
    if (m[N] != INDEFINITE) {
        return m[N];
    }

    if (6 > N) {
        m[N] = N;
    } else {
        m[N] = N;
        for (int i = 6; i <= N; i *= 6) {
            m[N] = min(m[N], dp(N - i, m) + 1);
        }
        for (int i = 9; i <= N; i *= 9) {
            m[N] = min(m[N], dp(N - i, m) + 1);
        }
    }

    return m[N];
}

int main() {
    int N; cin >> N;
    int m[N + 1];
    for (int i = 0; i <= N; ++i) {
        m[i] = INDEFINITE;
    }

    cout << dp(N, m) << endl;

    return 0;
}


Measured memory_bytes: 1408
;; -*- coding: utf-8 -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
  (defparameter OPT
    #+swank '(optimize (speed 3) (safety 2))
    #-swank '(optimize (speed 3) (safety 0) (debug 0)))
  #+swank (ql:quickload '(:cl-debug-print :fiveam))
  #-swank (set-dispatch-macro-character #\# #\> (lambda (s c p) (declare (ignore c p)) (read s nil (values) t))))
#+swank (cl-syntax:use-syntax cl-debug-print:debug-print-syntax)
#-swank (disable-debugger) ; for CS Academy

;; BEGIN_INSERTED_CONTENTS
(declaim (ftype (function * (values fixnum &optional)) read-fixnum))
(defun read-fixnum (&optional (in *standard-input*))
  (macrolet ((%read-byte ()
               `(the (unsigned-byte 8)
                     #+swank (char-code (read-char in nil #\Nul))
                     #-swank (sb-impl::ansi-stream-read-byte in nil #.(char-code #\Nul) nil))))
    (let* ((minus nil)
           (result (loop (let ((byte (%read-byte)))
                           (cond ((<= 48 byte 57)
                                  (return (- byte 48)))
                                 ((zerop byte) ; #\Nul
                                  (error "Read EOF or #\Nul."))
                                 ((= byte #.(char-code #\-))
                                  (setf minus t)))))))
      (declare ((integer 0 #.most-positive-fixnum) result))
      (loop
        (let* ((byte (%read-byte)))
          (if (<= 48 byte 57)
              (setq result (+ (- byte 48) (* 10 (the (integer 0 #.(floor most-positive-fixnum 10)) result))))
              (return (if minus (- result) result))))))))

(defmacro dbg (&rest forms)
  #+swank
  (if (= (length forms) 1)
      `(format *error-output* "~A => ~A~%" ',(car forms) ,(car forms))
      `(format *error-output* "~A => ~A~%" ',forms `(,,@forms)))
  #-swank (declare (ignore forms)))

(defmacro define-int-types (&rest bits)
  `(progn
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "UINT~A" b)) () '(unsigned-byte ,b))) bits)
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "INT~A" b)) () '(signed-byte ,b))) bits)))
(define-int-types 2 4 7 8 15 16 31 32 62 63 64)

(declaim (inline println))
(defun println (obj &optional (stream *standard-output*))
  (let ((*read-default-float-format* 'double-float))
    (prog1 (princ obj stream) (terpri stream))))

(defconstant +mod+ 1000000007)

;; Body

(defun calc-base (as)
  (declare ((simple-array uint32 (*)) as))
  (let ((n (length as))
        (res 0))
    (dotimes (i n)
      (loop for j from (+ i 1) below n
            do (when (> (aref as i) (aref as j))
                 (incf res))))
    res))

(defun main ()
  (let* ((n (read))
         (k (read))
         (as (make-array n :element-type 'uint32)))
    (dotimes (i n) (setf (aref as i) (read-fixnum)))
    (let ((base (* k (calc-base as)))
          (delta 0))
      #>base
      (dotimes (i n)
        (dotimes (j n)
          (when (> (aref as j) (aref as i))
            (incf delta))))
      #>delta
      (let ((res (* delta (floor (* k (- k 1)) 2))))
        (println (mod (+ res base) +mod+))))))

#-swank (main)


Measured memory_bytes: 24936
import java.util.Scanner;
public class Main{
	static int n;
	static int gx,ex;
	static int gy,ey;
	static int[][][] memo;
	public static void main(String[] args) { 
		Scanner sc = new Scanner(System.in);
		while(true){
			n =sc.nextInt();	
			if(n==0)break;
			String start=sc.next();
			String end=sc.next();
			String not=sc.next();
			int room[][][]=new int[n][2][2];
			int x=0,y=0;
			if(start.equals("B"))
				x=1;
			else if(start.equals("C"))
				x=2;
			else if(start.equals("D"))
				y=1;
			else if(start.equals("E")){
				x=1;y=1;
			}else if(start.equals("F")){
				x=2;y=1;
			}else if(start.equals("G"))
				y=2;
			else if(start.equals("H")){
				x=1;y=2;
			}else if(start.equals("I")){
				x=2;y=2;
			}
			gx=0;gy=0;
			if(end.equals("B"))
				gx=1;
			else if(end.equals("C"))
				gx=2;
			else if(end.equals("D"))
				gy=1;
			else if(end.equals("E")){
				gx=1;gy=1;
			}else if(end.equals("F")){
				gx=2;gy=1;
			}else if(end.equals("G"))
				gy=2;
			else if(end.equals("H")){
				gx=1;gy=2;
			}else if(end.equals("I")){
				gx=2;gy=2;
			}
			ex=0;ey=0;
			if(not.equals("B"))
				ex=1;
			else if(not.equals("C"))
				ex=2;
			else if(not.equals("D"))
				ey=1;
			else if(not.equals("E")){
				ex=1;ey=1;
			}else if(not.equals("F")){
				ex=2;ey=1;
			}else if(not.equals("G"))
				ey=2;
			else if(not.equals("H")){
				ex=1;ey=2;
			}else if(not.equals("I")){
				ex=2;ey=2;
			}
			memo=new int[3][3][n+1];
			System.out.printf("%.9f\n",(double)dfs(x,y,0)/Math.pow(4, n));
//			Math.pow(4, n)
			
		}
	}
	static int sx[]={1,0,-1,0};
	static int sy[]={0,1,0,-1};
	
	static int dfs(int x, int y, int battery){
//		System.out.println(x+" "+y+" "+battery);
		
		if(memo[x][y][battery]>0)return memo[x][y][battery];
		int result = 0;
		if(battery==n){
			if(gx==x&&gy==y)return 1;
			else return 0;
		}
		for(int i=0;i<4;i++){
			int nx=x+sx[i];int ny=y+sy[i];
			if(nx<0||nx>2||ny<0||ny>2||(nx==ex&&ny==ey))result+=dfs(x,y,battery+1);
			else result+=dfs(nx,ny,battery+1);
		}
		return memo[x][y][battery]=result;
	}
}

Measured memory_bytes: 23140
X,Y,A,B,C=map(int,input().split())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
r=list(map(int,input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

for i in range(1,A):
    p[i]+=p[i-1]
for i in range(1,B):
    q[i]+=q[i-1]
for i in range(1,C):
    r[i]+=r[i-1]
p.append(0)
q.append(0)

num1=X-1
num2=Y-1
ans=p[num1]+q[num2]

for i in range(min(X+Y,C)):
    if num1<0:
        num2-=1
        ans=max(ans,p[num1]+q[num2]+r[i])
    else:
        if num2<0:
            num1-=1
            ans=max(ans,p[num1]+q[num2]+r[i])
        else:
            if p[num1]-p[num1-1]<=q[num2]-q[num2-1]:
                num1-=1
                ans=max(ans,p[num1]+q[num2]+r[i])
            else:
                num2-=1
                ans=max(ans,p[num1]+q[num2]+r[i])
            
print(ans)    

Measured memory_bytes: 105444
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array;


void main() {
    iota(3).map!(i => readln.chomp[i]).writeln;
}


void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define INF 1000000021
#define MOD 1000000007
#define pb push_back
#define sqr(a) (a)*(a)
#define M(a, b) make_pair(a,b)
#define F first
#define S second
#define all(x) (x.begin(), x.end())
#define deb(x) cerr << #x << " = " << x << '\n'
#define N 222222

using namespace std;
using namespace __gnu_pbds;

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

const ld pi = 2 * acos(0.0);
template<class T> bool umin(T& a, T b){if(a>b){a=b;return 1;}return 0;}
template<class T> bool umax(T& a, T b){if(a<b){a=b;return 1;}return 0;}
template<class T, class TT> bool pal(T a, TT n){int k=0;for(int i=0;i<=n/2;i++){if(a[i]!=a[n-i-1]){k=1;break;}}return k?0:1;}

//int month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

ll dp[N][5];
int main()
{
	int n;
	cin >> n;
	for(int i = 1; i <= n; i ++)
	{
		ll a, b, c;
		cin >> a >> b >> c;
		dp[i][0] = a + max(dp[i - 1][1], dp[i - 1][2]);
		dp[i][1] = b + max(dp[i - 1][0], dp[i - 1][2]);
		dp[i][2] = c + max(dp[i - 1][0], dp[i - 1][1]);
	}
	cout << max(dp[n][0], max(dp[n][1], dp[n][2]));




	





	getchar();
	getchar();
	return 0;
	//ios::sync_with_stdio(false);
	//cin.tie(0);
}

Measured memory_bytes: 4352
#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
#include<map>
#include <queue>
typedef long long ll;
#define N 100010
using namespace std;
vector <int> tree[N],v;
int num[N];
bool flag[N];
struct A{
	int dep;
	int no;
};
queue <A> q;
void bfs()
{
	 while (!q.empty())
	 {
	 	A k=q.front();
	 	q.pop();
	 	while (!tree[k.no].empty())
	 	{
	 		int l=tree[k.no].back();
	 		tree[k.no].pop_back();
	 		if (flag[l])
	 			continue;
	 		flag[l]=true;
	 		A j;
	 		j.no=l,j.dep=k.no;
	 		num[l]=k.no;
	 		q.push(j);
		}
	 }
}

void solve()
{
	int n,m;
	cin>>n>>m;
	for (int i=1;i<=m;i++)
	{
		int a,b;
		cin>>a>>b;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	//memset(num,127,sizeof(num));	
	A a;
	a.dep=0;
	a.no=1;
	q.push(a);			
	bfs();
	bool flagt=true;
	for (int i=2;i<=n;i++)
		if (!num[i])
			flagt=false;
	if (!flagt)
	{
		cout<<"No"<<endl;
		return;
	}
	cout<<"Yes"<<endl;
	for (int i=2;i<=n;i++)
		cout<<num[i]<<endl;
}

int main() 
{
	ios::sync_with_stdio(false);
//	int t;
//	cin>>t;
//	while (t--) 
		solve();
	return 0;
}

Measured memory_bytes: 10832
#include <stdio.h>


int main(){
  int N;
  int i,j,k,v;
  int A[1001];
  
  
  
  
  scanf("%d",&N);
   
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  for(k=0;k<N;k++){
    if(k==N-1){
      printf("%d\n",A[k]);
    }else
      printf("%d ",A[k]);

  }
  
  for(i=1;i<=N-1;i++){
    v=A[i];
    j=i-1;
    
    while(j>=0&&A[j]>v){
      A[j+1]=A[j];
      j--;
    }
    A[j+1]=v;
    for(k=0;k<N;k++){
      if(k==N-1){
	printf("%d\n",A[k]);
      }else
	  printf("%d ",A[k]);
	
      }
    }
    
    return 0;
  }
  



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

int N;
vector<int> H;

int main() {
  cin >> N;
  H.resize(N);
  for (int i = 0; i < N; i++) cin >> H[i];


  int cnt = 1;
  int max = H[0];
  for (int i = 1; i < N; i++) {
    if (max <= H[i]) cnt++, max = H[i];
  }
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int n,i,a,b,x=0,y=1;
	scanf("%d",&n);
	for(i=n;i>0;i--){
		a=i;
		b=0;
		while(a%2==0){
			a=a/2;
			b++;
		}
		if(x<b){
			x=b;
			y=i;
		}
	}
	printf("%d\n",y);
	return 0;
}

Measured memory_bytes: 256
from collections import Counter
from functools import reduce
from itertools import combinations

import operator

GOOD_LETTERS = "MARCH"
PEOPLE = 3

n = int(input())
c = Counter()

for _ in range(n):
  first = input()[0]
  if first in GOOD_LETTERS:
    c.update(first)

ways = 0
for tup in combinations(GOOD_LETTERS, PEOPLE):
  ways += reduce(operator.mul, [c[ch] for ch in tup], 1)

print(ways)


Measured memory_bytes: 3572
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

int main(){
	int n,m;
	int i,j,k;
	long double a,b,c;
	long double da,db;
	cin>>a>>b>>da;
	long double pi     = 2.0 * asin(1.0);            /* πの値 */
	long double unit_r = 180.0 / pi;

	db=b*a*a/2.;
	if(db>=da){
		da/=b*b*a/2.;
		da=asin((long double)1.0)-atan(da);
	}else{
		da=b*a*a-da;
		da/=a*a*a/2.;
		da=atan(da);
	}
	cout<<fixed<<setprecision(10)<<da*unit_r<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>

typedef long long ll;
int main(void)
{
  ll x,a,b;
  scanf("%lld %lld %lld",&x,&a,&b);
  if(a>=b){
    puts("delicious");
  }else{
    if(b-a<=x){
      puts("safe");
    }else{
      puts("dangerous");
    }
  }
  return 0;
}


Measured memory_bytes: 1604
#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll LINF = (1LL << 60) - 1LL;
constexpr double eps = 1e-9;
constexpr ll MOD = 1000000007LL;
template <typename T> bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
};
template <typename T> bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
};
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
    for (int i = 0; i < v.size(); i++) {
        os << v[i] << (i + 1 == v.size() ? "\n" : " ");
    }
    return os;
}
template <typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) {
    t = v;
}
template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) {
    for (auto &e : t) {
        fill_v(e, v);
    }
};
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a(n + 1), b(n + 1);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    vector<int> v;
    for (int i = n / 2 + 1; i <= n; i++) {
        b[i] = a[i];
        if (b[i] > 0) {
            v.push_back(i);
        }
    }
    for (int i = n / 2; i >= 1; i--) {
        int c = 0;
        for (int j = i + i; j <= n; j += i) {
            c += b[j];
        }
        c %= 2;
        if (a[i] != c) {
            b[i] = 1;
            v.push_back(i);
        }
    }
    cout << v.size() << endl;
    cout << v;
}


Measured memory_bytes: 3704