akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
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;}
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    REP(i, 1, 100000) {
        int t = i * 1.08;
        if (t == n) {
            cout << i << endl;
            return 0;
        }
    }
    cout << ":(" << endl;
    return 0;
}


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

ll N;

int Main() {
    cin >> N;
    ll sum = 0;
    reps(i, N) {
        reps(j, N) {
            reps(k, N) {
                sum += gcd(i,gcd(j,k));
            }
        }
    }
    
    cout << sum << endl;
    return 0;
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 3652
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}
#define N 41
map<vector<int>, ll> d[N];
int n, x, y, z, s, mx;
ll ten[N];
void trim(vector<int> &v){
	bool cont = true;
	while(cont){
		cont = false;
		bool bx = false, by = false, bz = false;
		int sum = 0;
		for(auto &&f: v){
			sum += f;
			bx |= sum==x;
			if(sum>x && !bx){
				v.erase(v.begin());
				cont = true;
				break;
			}
			by |= sum==x+y;
			if(sum>x+y && !by){
				v.erase(v.begin());
				cont = true;
				break;
			}
			bz |= sum==x+y+z;
			if(sum>x+y+z && !by){
				v.erase(v.begin());
				cont = true;
				break;
			}
		}
	}
}
int main(){
	cin>>n>>x>>y>>z;
	ten[0] = 1;
	rep(i, n-1) ten[i+1] = ten[i]*10%mod;
	s = x+y+z;
	mx = max(x, max(y, z));
	d[0][vector<int>()] = 1;
	ll res = 0;
	rep(i, n){
		for(auto &&e: d[i]){
			auto v(e.fst);
			ll t = 0;
			for(auto &&f: v) t += f;
			for(int j = 1; j <= mx; j++){
				auto v2(v);
				if(t+j<s){
					v2.push_back(j);
					trim(v2);
					d[i+1][v2] += e.snd;
					if(d[i+1][v2]>mod) d[i+1][v2] -= mod;
					v2.pop_back();
				} else {
					int t2 = t+j;
					while(!v2.empty() && (t2>s || v2[0]>x)){
						t2 -= v2[0];
						v2.erase(v2.begin());
					}
					v2.push_back(j);
					trim(v2);
					t2 = 0;
					for(auto &&f: v2) t2 += f;
					if(t2==s) {
						(res+=e.snd*ten[n-i-1])%=mod;
						continue;
					}
					d[i+1][v2] += e.snd;
					if(d[i+1][v2]>mod) d[i+1][v2] -= mod;
				}
			}
			d[i+1][vector<int>()] += e.snd*(10-mx);
			d[i+1][vector<int>()] %= mod;
		}
		d[i].clear();
	}
	cout<<res<<endl;
	return 0;
}


Measured memory_bytes: 4736
object Main {
  def main(args: Array[String]): Unit = {
    val n = io.StdIn.readLine().toInt
    var i = 1
    var x = i
    do {
      x = i
      if(x % 3 == 0) {
        print(" " + i)
      } else {
        do {
          if(x % 10 == 3) {
            print(" " + i)
            x = 0
          }
          x = x / 10
        } while(x != 0)
      }
      i = i + 1
    } while(i <= n)
    println()
  }
}


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

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

typedef long long LL;
const LL mod=1000000007;
#define MAX 10000
#define NIL -1
const double PI  = acos(-1.0);
const int INF = 1e9 + 7;
//-------------------------------------------


int N;

LL d, add ,del;


int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> N;
    LL a[N+1];
    a[0] = 0;
    a[N+1] = 0;

    for( int i = 1; i <= N; i++){
        cin >> a[i];
        d += abs(a[i-1] - a[i]);
    }
    d += abs(a[N]);

    for( int i = 1; i <= N; i++){
        del = 0;
        add = 0;
        del = abs(a[i-1] - a[i]) + abs( a[i] - a[i+1]);
        add = abs( a[i-1] - a[i + 1]);

        cout << d - del + add << endl;
    }

    return 0;
}


Measured memory_bytes: 2048
using System;

public class UnionFind
{
    private int[] data;
    public UnionFind(int size)
    {
        data = new int[size];
        for (int i = 0; i < size; i++) data[i] = -1;
    }
    public bool Unite(int x, int y)
    {
        x = Root(x);
        y = Root(y);
        if (x != y)
        {
            if (data[y] < data[x])
            {
                var tmp = y;
                y = x;
                x = tmp;
            }
            data[x] += data[y];
            data[y] = x;
        }
        return x != y;
    }
    public bool IsSameGroup(int x, int y) => Root(x) == Root(y);
    public int Root(int x) => data[x] < 0 ? x : data[x] = Root(data[x]);
}

public class hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var m = int.Parse(line[1]);
        var uf = new UnionFind(n);
        for (int i = 0; i < m; i++)
        {
            line = Console.ReadLine().Trim().Split(' ');
            var s = int.Parse(line[0]);
            var t = int.Parse(line[1]);
            uf.Unite(s, t);
        }
        var q = int.Parse(Console.ReadLine().Trim());
        for (int i = 0; i < q; i++)
        {
            line = Console.ReadLine().Trim().Split(' ');
            var s = int.Parse(line[0]);
            var t = int.Parse(line[1]);
            Console.WriteLine(uf.IsSameGroup(s, t) ? "yes" : "no");
        }
    }
}




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

using i64 = int64_t;

int main(){
    int n;
    while(cin >> n, n != 0){
        int ans = 0;
        for(int i=0;i*i<=n;++i){
            for(int j=i;j*j<=n;++j){
                for(int k=j;k*k<=n;++k){
                    for(int l=k;l*l<=n;++l){
                        if(i*i+j*j+k*k+l*l == n)
                            ans++;
                    }
                }
            }
        }
        cout << ans << endl;
    }

    return 0;
}



Measured memory_bytes: 3084
#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
        }
    };
    (;;$n:expr) => {
        {
            (0..$n).map(|_| scan!()).collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let (a, b) = scan!(usize, usize);
    println!(
        "{}",
        if a >= 13 {
            b
        } else if a >= 6 {
            b / 2
        } else {
            0
        }
    )
}


Measured memory_bytes: 4352
#include <iostream>
using namespace std;
int main(void){
    int H,W,x,y,r;
    cin>>W;
    cin>>H;
    cin>>x;
    cin>>y;
    cin>>r;
    if(x-r<0||x+r>W)
    cout<<"No";
    else if(y-r<0||y+r>H)   cout<<"No";
    else    cout<<"Yes";
    cout<<endl;
}



Measured memory_bytes: 3092
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    int n, r; cin>>n>>r;
    if (n>=10) {
        cout << r << '\n';
    }
    else {
        cout << r+(100*(10-n)) << '\n';
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long H, W;
    cin >> H >> W;
    if(H == 1 || W == 1){
        cout << 1 << endl;
        return 0;
    }
    else if(H % 2 == 1 && W % 2 == 1){
        cout << H*W / 2 + 1 << endl;
        return 0;
    }
    cout << H * W / 2 << endl;

}

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

int main(){
    long long N, K;
    std::cin >> N >> K;
    std::vector<int> A(N);
    for (int i = 0; i < N; ++i) {
        std::cin >> A[i];
    }
    for (int j = K; j < N; ++j) {
        if (A[j-K] < A[j]){
            std::cout << "Yes" << std::endl;
            continue;
        }
        std::cout << "No" << std::endl;
    }
    return 0;
}

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

int main() {
  int a, b;
  cin >> a >> b;
  int ans = -1;
  for(int i = 0; i < 2000; i++){
    if((int)(i * 0.08) == a && (int)(i * 0.1) == b){
      ans = i;
      break;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//typedef
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a;
    cin>>a;
    PUTS(3*a*a);
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string.h>
#include <stack>
#include <queue>
#include <algorithm>
#include <climits>
#include <cmath>
#include <map>
#include <set>
#include <assert.h>
#define REP(i,n) for(ll i=0;i<(n);i++)
#define MOD 1000000007
#define int long long
#ifdef int
const long long INF = LLONG_MAX / 10;
#else
const int INF = 1010101010;
#endif
using namespace std;
typedef long long ll;
typedef vector<vector<ll> > mat;
typedef pair<int, int> P;
//typedef pair<double, double> P;
const int dx[9] = {-1, 0, 0, 1, -1, -1, 1, 1, 0};
const int dy[9] = {0, -1, 1, 0, -1, 1, -1, 1, 0};
 
char grid[110][110];
 
signed main() {
  int w, b;
  cin >> w >> b;

  REP(i,50) REP(j,100) grid[i][j] = '#';
  REP(i,50) REP(j,100) grid[50+i][j] = '.';

  w--;
  b--;

  int r = 0;
  int c = 0;
  while (w--) {
    grid[r][c] = '.';
    c += 2;
    if (100 <= c) {
      r+=2;
      c = 0;
    }
  }

  r = 99;
  c = 0;
  while (b--) {
    grid[r][c] = '#';
    c += 2;
    if (100 <= c) {
      r-=2;
      c = 0;
    }
  }

  cout << "100 100" << endl;
  REP(i,100) {
    REP(j,100) {
      cout << grid[i][j];
    }
    cout << endl;
  }
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1e9+1)
//#define INF (1LL<<59)


int main(){
	int n;
	cin>>n;
	vector<int> a(n);
	rep(i,n)cin>>a[i];
	
	int ans=0;
	rep(i,n){
		if(a[a[i-1]-1]==i)ans++;
	}
	cout<<ans/2<<endl;
}

Measured memory_bytes: 640
import java.util.*;
    public class Main {
     
    	public static void main(String[] args) {
    			
    		Scanner scan=new Scanner(System.in);
    		String a=scan.next();
    		String b=scan.next();
    		if (a.contentEquals(b)) {
    			System.out.print("H");
    		}else {
    			System.out.print("D");
    		}
    	
  
    				
    	}
     
    }

Measured memory_bytes: 21716
# 解説を参考に作成

# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
import math
# from decorator import stop_watch
#
#
# @stop_watch
def solve(N, K, As):
    ans = max(As)
    l, r = 1, ans
    for _ in range(30):
        m = (l + r) // 2
        if m <= 0:
            break
        cnt = 0
        for A in As:
            cnt += math.ceil(A / m) - 1
        if cnt <= K:
            ans = min(ans, m)
            r = m - 1
        else:
            l = m + 1
    print(ans)


if __name__ == '__main__':
    # S = input()
    # N = int(input())
    N, K = map(int, input().split())
    As = [int(i) for i in input().split()]
    # Bs = [int(i) for i in input().split()]
    solve(N, K, As)


Measured memory_bytes: 31644
bus = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in xrange(input()):
    s, t = map(int, raw_input().split())
    if s>5:
        print " ".join(map(str, bus[s:bus.index(t, s)+1]))
    else:
        if s<t:
            print " ".join(map(str, xrange(s, t+1)))
        else:
            print " ".join(map(str, xrange(s, t-1, -1)))
            

Measured memory_bytes: 4236
package main

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

var nextString func() string

func init() {
	nextString = newReadString(os.Stdin)
}

func main() {
	var (
		a = nextString()
		b = nextString()
	)
	fmt.Println([]string{"GREATER", "LESS", "EQUAL"}[judge(a, b)])
}

func judge(a, b string) int {
	switch {
	case len(a) > len(b):
		return 0
	case len(b) > len(a):
		return 1
	default:
		for i := range a {
			if a[i] > b[i] {
				return 0
			}
			if b[i] > a[i] {
				return 1
			}
		}
	}
	return 2
}

func nextInt() (result int) {
	result, _ = strconv.Atoi(nextString())
	return
}

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

	return func() string {
		if !r.Scan() {
		}
		return r.Text()
	}
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <iomanip>
#include <bitset>
#include <string>
#include <stdlib.h>
using namespace std;
//cout <<  << endl;
typedef long long int ll;
typedef long double ld;

int main(){
    ll a,b;
    cin >> a >> b;
    if (a%b==0){
        cout << -1 << endl;
        return 0;
    }
    cout << a << endl;
    return 0;
}


Measured memory_bytes: 256
n=gets.to_i
as=gets.split.map(&:to_i)
bs=gets.split.map(&:to_i)

ans=0
n.times do |i|
  power=bs[i]
  if power>as[i]
    ans+=as[i]
    power-=as[i]
    if power>=as[i+1]
      ans+=as[i+1]
      as[i+1]=0
    else
      ans+=power
      as[i+1]-=power
    end
  else
    ans+=power
  end
end
puts ans


Measured memory_bytes: 15508
def prime(n, p):
  cnt = 0
  for i in range(n+1):
    if(p[i]):
      cnt += 1
  return cnt
  
p = [True for i in range(1000001)]
p[0] = False
p[1] = False
for i in range(2, 500001):
  for j in range(2, 1000000//i + 1):
    p[i * j] = False

while True:
  try:
    n = int(input())
  except EOFError:
    break
  print(prime(n, p))


Measured memory_bytes: 13512
#include <string>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int n,h[100005];
ll dp[100005];
#define ALL(v)  (v).begin(),(v).end()
std::set<int> st;
//#define MAX(a,b) if(a>b)
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))

    /*  ペア関連
    //vector<pair<long long, long long> > pairs(N);
    for(long long i=0; i<N; i++){
        long long a, b;
        cin >> a >> b;
        pairs[i] = make_pair(a, b);
    }
    
    //sort(pairs.begin(), pairs.end(),greater<pair<int,int> >());
	sort(pairs.begin(), pairs.end());
    */

 	//stack<int> sta;   
    //queue<int> que;


int main(){
	
	long long N,M,K;
	string s;
    
	//std::cin >> N;
    std::cin >> N >> M;
    //std::cin >> N >> M >> K;
    
	//std::vector<long long> v(N);
	//std::vector<long long> w(N);
    //std::cin >> s;
    
    
    // 配列入力
    /*
    for(long long i=0; i<N; i++){
		std::cin >> v[i];
	}
	*/
	/*
	for(long long i=0; i<N; i++){
		std::cin >> w[i];
	}
	*/
    
    long long sum,sum1;
	sum=0;
	sum1=0;
	int flg,flg1,cnt,cnt1;
	flg=0;
	flg1=0;
	cnt=0;
	cnt1=0;
	long long max;
	int max1;
	max=0;
	max1=0;
	int min;
	int min1;
	min=INF;
	min1=INF;

	int work1,work2,work3,work4;
	work1=0;
	work2=0;
	work3=0;
	work4=0;
	
	//通常
	/*
    for(long long i=0; i<N; i++){
		
	}
	*/
	

	//文字列入力
	/*
	for(long long i=0; i<s.length(); i++){
		
		if(s[i]!='1'){
	}
	*/

	
	
	//ソート
    //std::sort(v.begin(),v.end());//昇順ソート
    //std::sort(v.begin(),v.end(),std::greater<long long>());//降順ソート
    //std::sort(w.begin(),w.end());//昇順ソート
    //std::sort(w.begin(),w.end(),std::greater<long long>());//降順ソート
    /*
    
    //S.substr(i, 5);
    //S.size();
    
    for(long long i=0; i<N; i++){
		std::cin >> v[i];
		if(st.find(v[i])==st.end()){
			st.insert(v[i]);
		}
		else{
			st.erase(v[i]);
		}
	}
	*/


	/*
	int a[4];
	int value;
	value=0;
	
	a[0] = (value % 10); 
	value /= 10;// 1桁目を取り出す
	a[1] = (value % 10); 
	value /= 10;// 2桁目を取り出す
	a[2] = (value % 10); 
	value /= 10;// 3桁目を取り出す
	a[3] = (value % 10); 
	value /= 10;// 4桁目を取り出す
    work1=a[0]+10*a[1];
    work2=a[2]+10*a[3];
    */
	
	
    if(1){
    	printf("%d",(N*3+M)/2);
    	//printf("%lld",N);
    	//puts("Yes");
    	//printf("%d",st.size());
    	//文字列の出力
    	//std::cout << s << std::endl;
    	//printf("%.12f\n",ret);
    	//cout << sum << endl;
	}
	else{
		printf("%d",N*3);
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
using ll=long long;
constexpr ll mod=1000000007;
constexpr int inf=1000000000;
constexpr ll linf=1000000000000000000;

int main(){
    ll n;
    cin>>n;
    int ans=0;
    for(ll i=2;i*i<=n;++i){
        if(n%i!=0)continue;
        int cnt=0;
        while(n%i==0){
            n/=i;
            ++cnt;
        }
        for(int j=2;;++j){
            if(j*(j+1)/2>cnt){
                ans+=j-1;
                break;
            }
        }
    }
    if(n!=1)++ans;
    cout<<ans<<endl;
}


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

int main() {
  long long x;
  cin >> x;
  long long cnt = 0;

  if (x < 7) {
    cnt = 1;
  } else if (x < 12){
    cnt = 2;
  } else {
    cnt = 2*(x/11);
    if (x%11 > 0) {
      if (x%11 < 7) {
        cnt++;
      } else {
        cnt+=2;
      }
    }
  }

  cout << cnt << endl;
}


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

int main(void){
    int K,N;
    cin>>K>>N;
    vector<int> a;
    if(K%2==0){
        a = vector<int>(N,K);
        a[0] = K/2;
    }else{
        a = vector<int>(N,(K+1)/2);
        rep(i,N/2){
            if(a.back()==1) a.pop_back();
            else{
                a.back()--;
                while(int(a.size())<N)a.push_back(K);
            }
        }
    }
    rep(i,int(a.size())-1){
        cout<<a[i]<<" ";
    }
    cout<<a.back()<<endl;
    return 0;
}


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

int main()
{
	int a[5];
	for(int i = 0;i<5;i++)
	{
		cin >> a[i];
	}
	int mn = a[3]+a[2]*60-a[0]*60-a[1];
	cout<<mn-a[4]<<endl;
}

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

int main() {
  long long x;
  cin >> x;
  int s = 0;
  for (int i = -200; i < 200; i++) {
    for (int j = -200; j < 200; j++) {
      if (x == 1) {
        cout << 0 << " " << -1 <<endl;
        s++;
        break;
      }
      else if (i*i*i*i*i-j*j*j*j*j == x) {
        cout << i << " " <<j <<endl;
        s++;
        break;
      }
    }
    if (s == 1) {
     break;
    }
  }
}


Measured memory_bytes: 3636
N,M=list(map(int,input().split()))
A=[list(map(int,input().split())) for _ in range(M)]
ans=-1

x=1 if N==1 else 0
for i in range(10**(N-1)-x,10**N):
  tmp=[]
  for m in range(M):
    tmp.append(True if int(list(str(i))[A[m][0]-1])==A[m][1] else False)

  if all(tmp)==True:
    if int(list(str(i))[0])!=0 or N==1:
      ans=i
    break
  
if M==0 and N==1:
    ans=0
    
print(ans)
      

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define srt(i) sort(i.begin(), i.end())
#define rvt(i) sort(i.begin(), i.end(), greater<int>())
 
int main() {
  int N;
  cin >> N;
 
  int64_t l0 = 2, l1 = 1;

  for(int i=0; i<N; i++){ 
    int64_t val = l0+l1;
    l0=l1;
    l1=val;
  }

  cout << l0 << endl;
}

Measured memory_bytes: 256
fh = int(input())
h = int(input())
f = int(input())
p = int(input())

ans = 0
for i in range(fh + 1):
  for j in range(h + 1):
    for k in range(f + 1):
      if 500 * i + 100 * j + 50 * k == p:
        ans += 1
print(ans)

Measured memory_bytes: 3060
import sys
input = sys.stdin.readline
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
ans = 0
for i in range(N) :
    sA = A[i] + A[i+1]
    if sA >= B[i] :
        d = B[i] - A[i]
        if d >= 0:
            A[i] = 0
            A[i+1] -= d
        else :
            A[i] -= B[i]
        ans += B[i]
    else :
        A[i] = 0
        A[i+1] = 0
        ans += sA
print(ans)

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

int main(){
  int x;
  cin>>x;
  int maxi(0);
  for (int i(1);i<=1000;i++){
    for (int j(2);j<=1000;j++){
      if ((int)pow(i,j)<=x){
        maxi=max(maxi,(int)pow(i,j));
      }
    }
  }
  cout << maxi << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
    vector<int> a(3);
    cin >> a[0] >> a[1] >> a[2];
    sort(a.begin(),a.end());
    cout<< a[0]<< " "<<a[1] <<" " << a[2]<< endl;
    


}


Measured memory_bytes: 3128
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

LL X;

int main(void) {
    cin >> X;
    LL now = 0;
    LL cnt = 0;
    while (now < X) {
        now += ++cnt;
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	reader := bufio.NewReader(os.Stdin)
	strByte := make([]byte, 100000)
	readLen, _ := reader.Read(strByte)
	for i := 0; i < readLen; i += 2 {
		fmt.Printf("%c", strByte[i])
	}
}

Measured memory_bytes: 768
#include<stdio.h>
#include<string.h>
int main(void){
    char s[256];
    char s1[256];
    char p[256];
    scanf("%s",s);
    scanf("%s",p);
    strcpy(s1,s);
    strcat(s,s1);
    if(strstr(s,p) != 0)printf("Yes\n");
    else printf("No\n");
    return 0;
}

Measured memory_bytes: 540
import java.util.*;

public class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    Set<Integer> member = new HashSet<Integer>();
    for(int i = 0 ; i < K ; i++){
      int d = sc.nextInt();
      for(int j = 0 ; j < d ; j++){
        int candy = sc.nextInt();
        member.add(candy);
      }
    }
        System.out.println(N - member.size());
	}
}


Measured memory_bytes: 46128
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
#include<numeric>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;


int main(){
    int n; cin >> n;
    vector<int> a(n),b(n);
    rep(i,n) cin >> a[i];
    rep(i,n) cin >> b[i];
    sort(b.rbegin(),b.rend());
    int left = 0;
    int right = n-1;
    rep(i,n){
        if(a[i] == b[i]){
            if((b[left] == b[i] || a[left] == b[i]) && (b[right] == b[i] || a[right] == b[i])){
                cout << "No" << endl;
                return 0;
            }
            if(b[left] != b[i] && a[left] != b[i]){
                swap(b[left],b[i]);
                left++;
            }
            else if(b[right] != b[i] && a[right] != b[i]){
                swap(b[right],b[i]);
                right--;
            }
        }
    }
    cout << "Yes" << endl;
    rep(i,n) cout << b[i] << " ";
    cout << endl;
}



Measured memory_bytes: 4792
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using ld = long double;

int d(int a) {
	int s = 0;
	while (a) {
		s += a % 10;
		a /= 10;
	}
	return s;
}

int main() {
#ifdef LC
	assert(freopen("input.txt", "r", stdin));
#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n;
	cin >> n;
	int ans = 1e9;
	for (int a = 1; a < n; ++a) {
		int b  = n - a;
		ans = min(ans, d(a) + d(b));
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <iterator>
#include <map>
#include <set>
#include <iomanip>
#include <vector>
#include <cstdint>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Graph = vector<vector<int>>;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
#define rep(i, N) for(int i = 0; i < N; i++)
#define rep2(i, l, r) for (ll i = (ll)l; i < (ll)(r); i++)
#define INF 1000000000000000
#define MAX 200001

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
const ll MOD = 998244353;

template <typename T > inline string toString(const T &a) {ostringstream oss; oss << a; return oss.str();};

int main(){
    ll N, X, M;
    cin >> N >> X >> M;
    ll ans = 0;
    if(X == 0) cout << 0 << endl;
    else if(N <= M){
        rep(i,N){
            ans += X;
            X *= X;
            X %= M;
        }
        cout << ans << endl;
    }
    else{
        map<ll,ll> m;
        bool flag = false;
        ll cnt = M-1;
        m[X] = 1;
        rep(i,M-1){
            ans += X;
            X *= X;
            X %= M;
            if(m[X] > 0){
                N-=m[X]-1;
                cnt = i+1 - m[X] + 1;
                break;
            }
            m[X] = i+2;
            if(X == 0) flag = true;
        }
        if(flag) cout << ans << endl;
        else{
            ll original = X;
            ll res = 0;
            while(true){
                X *= X;
                X %= M;
                res += X;
                if(X == original) break;
            }
            ans -= res;
            ans += res * (N / cnt);
            N %= cnt;
            rep(i,N){
                ans += X;
                X *= X;
                X %= M;
            }
            cout << ans << endl;
        }
    }
}

Measured memory_bytes: 6736
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


class BIT:
    def __init__(self, n):
        self.n = n
        self.data = [0] * (n + 1)

    def add(self, i, x=1):
        i += 1
        while i <= self.n:
            self.data[i] += x
            i += i & -i

    def get_sum(self, i):
        i += 1
        x = 0
        while i > 0:
            x += self.data[i]
            i -= i & -i
        return x

    # Return sum for [l, r)
    def get_sum_range(self, l, r):
        return self.get_sum(r - 1) - self.get_sum(l - 1)


def main():
    N, Q = map(int, readline().split())
    C = list(map(int, readline().split()))
    LR = map(int, read().split())

    prev = [-1] * (N + 1)
    ps = [[] for _ in range(N)]
    for i, c in enumerate(C):
        if prev[c] != -1:
            ps[prev[c]].append(i)
        prev[c] = i

    qs = [[] for _ in range(N + 1)]
    for i, (l, r) in enumerate(zip(*[iter(LR)] * 2)):
        l -= 1
        r -= 1
        qs[l].append((r, i))

    ans = [0] * Q
    bit = BIT(N)

    for l in range(N - 1, -1, -1):
        for r in ps[l]:
            bit.add(r)
        for r, i in qs[l]:
            ans[i] = (r - l + 1) - bit.get_sum(r)

    print(*ans, sep='\n')

    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 267648
#include <stdio.h>

int main(){
	int a, b;
	char op;
	while( scanf("%d %c %d", &a, &op, &b) != EOF)
	
	switch(op){
		case '+':
			printf("%d\n", a + b);
			break;
		case '-':
			printf("%d\n", a - b);
			break;
		case '*':
			printf("%d\n", a * b);
			break;
		case '/':
			printf("%d\n", (int)(a / b));
			break;
		case '?':
		default: break;
	}
	
	return 0;
}

Measured memory_bytes: 600
n=int(input())
h=list(map(int,input().split()))
res=0
while True:
  if max(h)==0:
    break

  else:
    i=0
    while i<n:
      if h[i]==0:
        i+=1

      else:
        res+=1
        while i<n and h[i]>0:
          h[i]-=1
          i+=1


print(res)

    
  

Measured memory_bytes: 9180
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define per(i, a, b) for (int i = a; i >= b; i--)
using namespace std;
 
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef long long ll;
 
template <typename _T>
inline void read(_T &f) {
	f = 0; _T fu = 1; char c = getchar();
	while (c < '0' || c > '9') { if (c == '-') { fu = -1; } c = getchar(); }
	while (c >= '0' && c <= '9') { f = (f << 3) + (f << 1) + (c & 15); c = getchar(); }
	f *= fu;
}
 
template <typename T>
void print(T x) {
	if (x < 0) putchar('-'), x = -x;
	if (x < 10) putchar(x + 48);
	else print(x / 10), putchar(x % 10 + 48);
}
 
template <typename T>
void print(T x, char t) {
	print(x); putchar(t);
}

const int N = 505;
const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, 1, -1};

struct ele {
	int x, y;
	ele (int a = 0, int b = 0) : x(a), y(b) {}
};

queue <ele> q;
int a[N][N], dis[N][N];
int n, ans;

int main() {
	read(n);
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			dis[i][j] = min(min(i, j), min(n - i + 1, n - j + 1));
			a[i][j] = 1;
		}
	}
	for (int i = 1; i <= n * n; i++) {
		int v, x, y; read(v);
		x = (v - 1) / n + 1; y = (v - 1) % n + 1;
		--dis[x][y]; a[x][y] = 0; ans += dis[x][y]; q.push(ele(x, y));
		while (!q.empty()) {
			ele u = q.front(); q.pop();
			for (int j = 0; j < 4; j++) {
				int _x = u.x + dx[j], _y = u.y + dy[j];
				if (dis[_x][_y] > dis[u.x][u.y] + a[_x][_y]) {
					dis[_x][_y] = dis[u.x][u.y] + a[_x][_y];
					q.push(ele(_x, _y));
				}
			}
		}
	}
	print(ans, '\n');
	return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;
typedef vector<pdd> vdd;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mem(a,b) memset(a, b, sizeof(a) )
#define all(x) (x).begin(),(x).end()
#define INF 1000000000000
#define MOD 1000000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll n,a,b;
    cin>>n>>a>>b;
    ll c=modPow(2,n);
    ll d=1;
    rep(i,a){
        d=d*modInverse(a-i);
        d%=MOD;
    }
    rep(i,a){
        d=d*(n-i);
        d%=MOD;
    }
    ll e=1;
    rep(i,b){
        e=e*modInverse(b-i);
        e%=MOD;
    }
    rep(i,b){
        e=e*(n-i);
        e%=MOD;
    }
    ll ans=c-d-e-1;
    while(ans<0){ans+=MOD;}
    cout<<ans%MOD;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    ll r, d, y;
    cin >> r >> d >> y;

    vl x(11);
    x[0] = y;
    exrep(i, 1, 10) {
        x[i] = r*x[i-1] - d;
        out(x[i]);
    }
    
    re0;
}

Measured memory_bytes: 256
import math

def length(xa, ya, xb, yb):
  return math.sqrt((xa - xb)**2 + (ya - yb)**2)

n = int(raw_input())
for s in range(0, n):
  xa, ya, ra, xb, yb, rb = map(float, raw_input().split(' '))
  d = length(xa, ya, xb, yb)

  if ra > rb + d:
    print 2
  elif rb > ra + d:
    print -2
  elif d > ra + rb:
    print 0
  else:
    print 1

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

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> a;

    for (int i = 0; i < n; i++) {
        int tmp;
        cin >> tmp;
        a.push_back(tmp);
    }

    for (int i = n - 1; i >= 0; i--) {
        cout << a.at(i);
        if (i == 0) {
            cout << endl;
        } else {
            cout << " ";
        }
    }

    return 0;
}


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

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

  if (1200 > r) {
    cout << "ABC" << endl;

  } else if (2800 > r) {
    cout << "ARC" << endl;

  } else {
    cout << "AGC" << endl;
  }
}

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

// #define int ll
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using si = set<int>;
using ii = pair<int, int>;
using vii = vector<ii>;

#define rep(i, n) for (int i = 0; i < n; i++)
#define dotc()    int tcs; if (cin >> tcs) rep(tc, tcs)
#define sz(x)     (int)x.size()
#define eb        emplace_back
#define pb        push_back
#define mp        make_pair
#define all(x)    x.begin(), x.end()
#define rall(x)   x.rbegin(), x.rend()
#define fi        first
#define se        second

int inf(0x3fffffff);
int mod(1000000007);
double pi(acos(-1.0));

int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
#ifdef LOCAL
  freopen("io\\in.txt", "r", stdin);
  freopen("io\\out.txt", "w", stdout);
#endif

  ll n;
  cin >> n;

  string s;
  while (n) {
    s += char('a' + (n - 1) % 26);
    n = (n - 1) / 26;
  }

  while (!s.empty()) {
    cout << s.back();
    s.pop_back();
  }

  return 0;
}


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

#ifdef LOCAL
#include "../debug.h"
#else
#define debug(x...) 141
#endif
#define forn(i,x,n) for(int i = x; i < n; ++i)
#define forit(it, m) for(auto it = m.begin(); it!=m.end(); ++it)
typedef long long ll;

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll a,bb;
    double b;
    {
        cin>>a>>b;
        bb=(ll)(b*100+0.01);
        cout<<a*bb/100<<'\n';
    }
    return 0;
}


Measured memory_bytes: 3716
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define int long long
typedef long long ll;
using namespace std;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

vector<int> init(int size){
  vector<int> par(size,-1);
  return par;
}

int root(int x, vector<int>& par){
  if(par[x] < 0){
    return x;
  }else{
    return par[x] = root(par[x],par);
  }
}

bool same(int x, int y, vector<int>& par){
  return root(x, par) == root(y, par);
}

void unite(int x, int y, vector<int>& par){
  x = root(x, par), y = root(y, par);
  if(same(x,y, par))return;
  par[x] += par[y];
  par[y] = x;
}

int size(int x, vector<int>& par){
  return -par[root(x, par)];
}

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


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string s; cin >> s;
	int ans = 0, ans2 = 0;
	for (int i = 0; i < (int)s.length(); i++) {
		if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
			ans++;
		}
		else {
			ans2 = max(ans, ans2);
			ans = 0;
		}
		ans2 = max(ans, ans2);
	}
	cout << ans2 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <cstdlib> //abs(int)
using namespace std;
int main(void){
  int a, b /*, c, d*/;
  cin >> a >> b /*>> c >> d*/;
  if(a % b == 0){
    cout << "0";
  } else {
    cout << "1";
  }
}

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

int main() {
  long k,ans1=2,ans2=2;
  cin >> k;
  vector<long> a(k);
  for(long i=0;i<k;i++) cin >> a[i];
  for(long i=k-1;i>=0;i--) {
    ans1=(ans1+a[i]-1)/a[i]*a[i];
    ans2=ans2/a[i]*a[i];
    if(ans1>ans2) {
      ans1=-1;
      break;
    }
    ans2=ans2+a[i]-1;
  }
  if(ans1!=-1) cout << ans1 << " " << ans2 << endl;
  else cout << -1 << endl;
}

Measured memory_bytes: 3968
#include <bits/stdc++.h>
#define INF 1e9
using namespace std;

#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()
#define endl "\n"

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
typedef long long ll;

void solve() {
    int X;
    cin >> X;
    X-=400;
    cout << 8-(X/200) << endl;
}

int main() {
    solve();
    return 0;
}

Measured memory_bytes: 3640
#include<stdio.h>
#define MAX 100
#define INF 1e8
#define WHITE 0
#define GRAY  1
#define BLACK 2

int n,M[MAX][MAX];

int prim(){
  int u,min,sum=0;
  int d[MAX],p[MAX],color[MAX];
  int i,v;

  //初期化
  for(i=0;i<n;i++){
    d[i] = INF;
    p[i] = -1;
    color[i] = WHITE;
  }
  d[0] = 0;

  
  while(1){
    min = INF;
    u = -1;
    
    //最小経路の保存
    for(i=0;i<n;i++){
      if(min > d[i] && color[i] != BLACK){
	u = i;
	min = d[i];
      }
    }
 
    if(u==-1) break;
    color[u] = BLACK;
    
    for(v=0;v<n;v++){
      if(color[v]!=BLACK && M[u][v]!=INF){
	if(d[v]>M[u][v]){
	  d[v] = M[u][v];
	  p[v] = u;
	  color[v] = GRAY;
	}
      }
    }
  }
  for(i=0;i<n;i++)
    if(p[i]!=-1) sum += M[i][p[i]];

  return sum;
}

int main(){
  int e;
  int i,j;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      scanf("%d",&e);
      M[i][j] = (e==-1) ? INF : e;
    }
  }
  printf("%d\n",prim());
  
  return 0;
}



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

int main(void) {
  vector<int> t(1000);
  t[1] = 1;
  for (int i=2; i<1000; i++) {
    t[i] = t[i-1] + i;
  }
  
  int a, b; cin >> a >> b;
  cout << t[b-a] - b << endl;
  return 0;
}


Measured memory_bytes: 3592
from collections import Counter
def larger_nibeki(i):
    return 2 ** len(format(i, 'b'))
N, *A = map(int, open(0).read().split())
A.sort(reverse=True)
ans = 0
C = Counter(A)
for a in A:
    if C[a] == 0:
        continue
    C[a] -= 1
    if C[larger_nibeki(a) - a] > 0:
        ans += 1
        C[larger_nibeki(a) - a] -= 1
print(ans)

Measured memory_bytes: 33712
#include <bits/stdc++.h>
#define ALL(a) (a).begin(),(a).end()
#define N_MAX 1000
#define ll long long int
using namespace std;

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

	if (N & 1) {
		cout << "No" << endl;
		return 0;
	}
	else {
		for (int i = 0; i <= N / 2 - 1; i++) {
			if (S[i] == S[i + N / 2]) continue;
			else {
				cout << "No" << endl;
				return 0;
			}
		}
	}

	cout << "Yes" << endl;
}	

Measured memory_bytes: 256
#include <iostream>
typedef long long ll;
using namespace std;
int main() {
    ll n, a, m;
    cin >> n;
    for(int i=0; i<5; i++) {
        cin >> a;
        if(i==0) m=a;
        else if(m>a) m=a;
    }

    ll time;
    if(n%m) time = n/m + 1;
    else time = n/m;
    cout << time + 4 << endl;
    return 0;
}


Measured memory_bytes: 256