akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define FOR(i, l, r) for(int i = (l); i <= (r); ++i)
#define REP(i, n) FOR(i, 0, (n) - 1)
#ifdef DEBUG
  template<class A, class B> ostream& operator<<(ostream &out, const pair<A, B> &p) {
	  return out << '(' << p.first << ", " << p.second << ')';
  }
  template<class T> auto operator<<(ostream &out, T &&x) -> decltype(x.begin(), out) {
	  out << '{';
	  for(auto it = x.begin(); it != x.end(); ++it)
		  out << *it << (it == --x.end() ? "" : ", ");
	  return out << '}';
  }
  void dump() {}
  template<class T, class... Args> void dump(T &&x, Args... args) {
	  cerr << x << ";  ";
	  dump(args...);
  }
  const int seed = 1;
  struct Nl{~Nl(){cerr << '\n';}};
# define debug(x...) cerr << (#x != "" ? #x ":  " : ""), dump(x), Nl(), cerr
#else
  const int seed = chrono::system_clock::now().time_since_epoch().count();
# define debug(...) 0 && cerr
#endif
mt19937_64 rng(seed);
int rd(int l, int r) {
	return uniform_int_distribution<int>(l, r)(rng);
}
template<class T> int size(T a) { return a.size(); }

LL mod = 1e9 + 7;

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

	LL n, h, d;
	cin >> n >> h >> d;

	vector<LL> dp(h + 1);

	LL f = 1;
	LL sum = 1;
	for(LL i = 1; i <= n; i++)
	{
		f = (f * i) % mod;
		sum = (sum + f) % mod;
	}

	debug(f, sum);

	dp[0] = 1;
	dp[1] = f;
	for(int i = 2; i <= d && i <= h; i++)
	{
		dp[i] = (dp[i - 1] * sum) % mod;
		debug(i, dp[i]);
	}

	if(h <= d)
	{
		cout << dp[h] << "\n";
		return 0;
	}

	LL last_d = 0;
	for(int i = 1; i <= d; i++)
		last_d = (last_d + dp[i]) % mod;

	sum = (sum - 1 + mod) % mod;
	for(int i = d + 1; i <= h; i++)
	{
		debug(i, dp[i], last_d);
		dp[i] = (last_d * sum) % mod;
		last_d = (last_d + dp[i] - dp[i - d] + mod) % mod;
	}

	cout << dp[h] << "\n";

}



Measured memory_bytes: 8064
import Control.Monad
import Data.List

comp x y 
  | length x == length y = EQ
  | length x < length y = GT
  | otherwise = LT
p  x = sortBy comp $ group $ sort  x

solve x = let lp = p x
              max = length $ head lp
          in  head <$> takeWhile ((== max) . length) lp

main = do
  n <- readLn
  xs <- replicateM n getLine
  putStr $ unlines $ solve xs


Measured memory_bytes: 174076
import java.util.Scanner;

class Main {
	public static void main(String args[]){	

		Scanner scan = new Scanner(System.in);

		int n;
		while(true){
			n = scan.nextInt();
			if(n == 0)break;
			double sum = 0;
			double ave = 0;
			double var = 0;
		
			int a[];
			a = new int[n];
	
			for(int i = 0;i < n;i++){
				a[i] = scan.nextInt();
			}
		
			for(int i = 0; i < n; i++){
				sum += a[i];
			}
		
			ave = sum / n;
		
			for(int i = 0; i < n; i++){
				var += Math.pow((a[i] - ave),2);
			}
		
			System.out.println(Math.sqrt(var/n));
		}
	}
	
}

Measured memory_bytes: 31656
#include<iostream>
using namespace std;
int main()
{
	int a,b,c,min,t,max;
	while(cin>>a>>b>>c)
	{
		t=(a<b)?a:b;
		max=(a>b)?a:b;
		min=(max<c)?max:c;
		//cout<<t<<" "<<min<<endl;
		cout<<t+min<<endl;
	}
	
} 

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

int main(){
    int n, mm;
    cin >> n >> mm;
    // n = 11;
    // mm = 3;

    map<long, long> m;
    int a;
    for (int i = 0; i < n; i++){
        cin >> a;
        if (m.count(a) == 0){
            m[a] = 1;
        }
        else{
            m[a]++;
        }
    }
    // m[1] = 11;
    // m[1] = 1;
    // m[4] = 1;

    vector<int> v;
    for (auto vv : m){
        v.push_back(vv.first);
    }

    int b, c;
    int card_num, min_value;
    int erase_num = 0;
    // vector<int> d1{3, 4, 3};
    // vector<long> d2{1000000000, 1000000000, 1000000000};

    int pass_number;
    for (int i = 0; i < mm; i++){
        cin >> b >> c;
        if (m.count(c) == 0){
            m[c] = b;
        }
        else{
            m[c] += b;
        }
    }

    long ret = 0;
    vector<int> keys;
    for (auto vv:m){
        keys.push_back(vv.first);
    }

    long num;
    long maisuu = 0;
    while(1){
        num = m[keys.back()];
        if ((n - maisuu) >= num){
            ret += num * keys.back();
            maisuu += num;
            keys.pop_back();
        }
        else{
            ret += (n - maisuu) * keys.back();
            break;
        }
    }
    cout << ret << endl;
    return 0;
}

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

int main() {
    string s;
    cin >> s;
    int q;
    cin >> q;
    bool dir = true;
    vector<char> a, b;
    for (int i = 0; i < q; i++) {
        int t;
        cin >> t;
        if (t == 1) {
            dir = (dir ? false : true);
        }
        if (t == 2) {
            int f;
            char c;
            cin >> f >> c;
            if (f == 1) {
                if (dir) a.push_back(c);
                else b.push_back(c);
            }
            if (f == 2) {
                if (dir) b.push_back(c);
                else a.push_back(c);
            }
        }
    }
    if (dir) {
        for (int i = a.size() - 1; i >= 0; i--) {
            cout << a[i];
        }
        cout << s;
        for (int i = 0; i < b.size(); i++) {
            cout << b[i];
        }
    } else {
        for (int i = b.size() - 1; i >= 0; i--) {
            cout << b[i];
        }
        for (int i = s.length() - 1; i >= 0; i--) {
            cout << s[i];
        }
        for (int i = 0; i < a.size(); i++) {
            cout <<  a[i];
        }
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		
		while(true){
			String str=scan.next();
			if(str.equals("0"))break;
			
			int cnt=0;
			for(int i=0;i<str.length();i++)
				cnt+=(str.charAt(i)-'0');
			
			System.out.println(cnt);
			
		}
		
	}
}


Measured memory_bytes: 26508
#include "bits/stdc++.h"
#define _USE_MATH_DEFINES
#include <math.h>
 
using namespace std;
 
using LL = long long;
using VLL = std::vector<LL>;
using VVLL = std::vector<VLL>;
using VVVLL = std::vector<VVLL>;
using LD = long double;
using VLD = std::vector<LD>;
using VVLD = std::vector<VLD>;
using VVVLD = std::vector<VVLD>;
 
template<class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; }return false; }
template<class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; }return false; }

//template<class T=LL> inline vector<T> cinv(LL N){ vector<T> v(N); REP(i, N)cin>>v[i]; return move(v);}
//template<class T=LL> inline vector<T> cinv(LL N){ vector<T> v(N); REP(i, N)cin>>v[i]; return move(v);}
#define REP(i,n) for(LL (i)=0;(i)<(n);(i)++)
#define ALL(v) v.begin(), v.end()
#define PRINTLN(v) {LL i=0; for(auto (a): v ){   cerr <<i << " : "<<  a << endl; i++;}}
#define PRINTSP(v) for(auto (a): v ) {cerr << a << " ";} cerr << endl
#define cmax(a,b) {if(a<b){a=b;}}
#define cmin(a,b) {if(a>b){a=b;}}
#define EACH(a,A) for(auto a: A)
//#define cmax(a,b) a = (a>b ? a:b)
//#define cmin(a,b) a = (a<b ? a:b) 
//cin,cout高速化のおまじない＋桁数指定
inline VLL cinvll(LL N){
  VLL A(N);
  REP(i,N){
    cin >> A[i];
  }
  return move(A);
}
struct Fast{
	Fast(){
		cin.tie(0);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(std::numeric_limits<double>::max_digits10);
	}
} fast;



void func(){
  LL A1,A2,A3;
  cin >> A1;
  cin >> A2;
  cin >> A3;
  LL A=A1+A2+A3;

  if(A>=22){
    cout << "bust";
  }  
  else{
    cout << "win";
  }


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

Measured memory_bytes: 256
#include<cstdio>

char ar[110];

int main(){
	
	int n;
	scanf("%d %s",&n,ar+1);
	
	if(n & 1){
		puts("No");
		return 0;
	}
	
	bool flag = 1;
	
	int m = n >> 1;
	
	for(int i = 1; i <= m; i++)
		if(ar[i] != ar[i+m]){
			flag = 0;
		}
	
	if(flag)
		puts("Yes");
	else puts("No");
	return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)(n);i++)

typedef long long ll;

const int INF = 1e9;

int main(){
  string s;
  cin >> s;
  int N = s.length();

  int res = 0;
  int tmp = 0;
  REP(i,N) {
    if(s[i] == 'g') {
      if(tmp > 0) {
        ++res;
        --tmp;
      }else{
        ++tmp;
      }
    }else if(s[i] == 'p'){
      if(tmp > 0) {
        --tmp;
      }else{
        ++tmp;
        --res;
      }
    }
  }
  cout << res << endl;
  return 0;
}


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

int main(){
	int n;
	long b, c, t;
	cin >> n;
	vector<long> a(n+1);

	for (int i = 0; i < n+1; ++i) cin >> a[i];
	c = 0;
	for (int i = 0; i < n; ++i){
		cin >> b;
		t = min(b, a[i] + a[i+1]);
		c += t;
		a[i+1] -= t - min(b, a[i]);
	}
	cout << c;
}

Measured memory_bytes: 1024
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "iomanip"
#include "cmath"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;


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

	string s, t;
	cin >> s >> t;
	if (s > t) {
		cout << ">\n";
	}
	else if (s < t) {
		cout << "<\n";
	}
	else {
		cout << "=\n";
	}
	return 0;
}

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

public class Main {
	static class Island {
		Island parent;
		
		Island () {
			this.parent = this;
		}
	}

	static class Bridge implements Comparable<Bridge>{
		int number;
		int cost;
		Island v1, v2;

		Bridge (int number, int cost, Island v1, Island v2) {
			this.number = number;
			this.cost = cost;
			this.v1 = v1;
			this.v2 = v2;
		}

		public int compareTo(Bridge o) {
			return this.cost - o.cost;
		}
	}

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n, m;
		Island island[];
		Bridge bridge[];
		int sum;

		while (true) {
			n = sc.nextInt();
			m = sc.nextInt();
			if ((n | m) == 0) {
				break;
			}
			
			island = new Island[n];
			bridge = new Bridge[m];
			sum = 0;
			for (int i = 0; i < n; i++) {
				island[i] = new Island();
			}
			for (int i = 0; i < m; i++) {
				int v1 = sc.nextInt();
				int v2 = sc.nextInt();
				int cost = sc.nextInt();
				bridge[i] = new Bridge(i, cost, island[v1], island[v2]);
			}
			Arrays.sort(bridge);
			for (int i = 0; i < m; i++) {
				if (!find(bridge[i].v1).equals(find(bridge[i].v2))) {
					sum += bridge[i].cost;
					union(bridge[i].v1, bridge[i].v2);
				}
			}
			System.out.println(sum);
		}
	}
	
	public static Island find(Island v) {
		if (v.parent.equals(v)) {
			return v;
		}
		return find(v.parent);
	}
	
	public static void union(Island v1, Island v2) {
		Island v3 = find(v1);
		Island v4 = find(v2);
		
		v3.parent = v4;
	}
}

Measured memory_bytes: 12000
#Nは頂点数, Mは辺数(2 <= N <= 1000, 1 <= M <= min(N(N-1, 2000)))
#頂点1から頂点Nに移動して、移動スコアを最大にする
#->移動スコアを正負反転させれば最短経路問題
#->負閉路を考慮してベルマンフォード法を利用
INF = 1 << 50

N,M = map(int,input().split())

#辺を登録
Sides = []
for i in range (M):
    Side = list(map(int,input().split()))
    Sides.append(Side)
#コストを反転
    Sides[i][2] = Sides[i][2] * (-1)

#各頂点の最短距離を初期化
Vertexes = [INF]*(N+1)
Vertexes[1] = 0

#負閉路のチェック用
negative = [False] * (N+1)

#ベルマンフォード法による最短距離探索
for count in range(N):
    for i in range(M):
        from_v = Sides[i][0]
        to_v = Sides[i][1]
        cost = Sides[i][2]
        if (Vertexes[to_v] > Vertexes[from_v]+cost):
            if(count==N-1):
                negative[to_v] = True
            else:
                Vertexes[to_v] = Vertexes[from_v]+cost

#負閉路の確認
for count in range(N-1):
    flag = 0
    for i in range(M):
        from_v = Sides[i][0]
        to_v = Sides[i][1]
        if negative[from_v] :
            negative[to_v] = True
            flag = 1
    #if flag ==0:
     #   break

if negative[N]:
    print('inf')
else:
    print(-Vertexes[N])

Measured memory_bytes: 3572
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>

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

typedef long long lint;

using namespace std;

int main(){
  int N,M;
  cin>>N>>M;
  priority_queue<lint> q;
  REP(i,N){
    lint A;
    cin>>A;
    q.push(A);
  }
  REP(i,M){
    lint p=q.top();
    q.pop();
    q.push(p/2);
  }
  lint ans=0;
  REP(i,N){
    ans+=q.top();
    q.pop();
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 1528
struct MP<T: std::cmp::PartialEq> {
    pi: Vec<i32>,
    s: Vec<T>,
}

impl<T: std::cmp::PartialEq> MP<T> {
    fn new(s: Vec<T>) -> MP<T> {
        let mut pi = vec![0; s.len() + 1];
        pi[0] = -1;
        let mut j = -1;
        for i in 0..s.len() {
            while j >= 0 && s[i] != s[j as usize] {
                j = pi[j as usize];
            }
            j += 1;
            pi[i + 1] = j;
        }
        MP { pi: pi, s: s }
    }

    fn matched_indexes(&self, t: &Vec<T>) -> Vec<usize> {
        let mut j = 0;
        let mut res = vec![];
        for i in 0..t.len() {
            while j >= 0 && self.s[j as usize] != t[i] {
                j = self.pi[j as usize];
            }
            j += 1;
            if j as usize == self.s.len() {
                res.push(1 + i - j as usize);
                j = self.pi[j as usize];
            }
        }
        res
    }
}

fn reduce(a: &Vec<u32>) -> Vec<u32> {
    let mut res = vec![0; a.len() - 1];
    for i in 0..a.len() - 1 {
        res[i] = a[i] ^ a[i + 1];
    }
    res
}

fn main() {
    let n = read::<usize>();
    let mut org_a = read_vec::<u32>();
    let org_b = read_vec::<u32>();
    let mut a_clone = org_a.clone();
    org_a.append(&mut a_clone);
    let a = reduce(&org_a);
    let b = reduce(&org_b);

    let mp = MP::new(b);
    let indexes = mp.matched_indexes(&a);
    for k in indexes {
        if k == n {
            break;
        }
        let x = org_a[k] ^ org_b[0];
        println!("{} {}", k, x);
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 19436
#include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
string A[3],B[10];
int x[3],y[10];
string solve(){
	if (x[1]==0&&x[2]==0){
		string ans="";
		for (int i=1;i<=x[0];i++) ans=ans+A[0];
		return ans;
	}
	memset(y,0x00,sizeof y);
	int num=x[2]/x[0];
	for (int i=1;i<=num;i++) A[0]=A[0]+A[2];
	A[2]=A[0]+A[2];
	int ne=x[2]%x[0]; x[0]-=ne; x[2]=ne;
	num=x[1]/x[0];
	for (int i=1;i<=num;i++) A[0]=A[0]+A[1];
	A[1]=A[0]+A[1];
	ne=x[1]%x[0]; x[0]-=ne; x[1]=ne;
	return solve();
}
int main(){
	for (int i=0;i<3;i++) scanf("%d",&x[i]); 
	A[0]='a'; A[1]='b'; A[2]='c';
	if (x[0]==0){
		x[0]=x[1]; x[1]=x[2];
		A[0]=A[1]; A[1]=A[2];
		x[2]=0;
	}
	if (x[0]==0){
		x[0]=x[1]; x[1]=x[2];
		A[0]=A[1]; A[1]=A[2];
		x[2]=0;
	}
	cout<<solve()<<endl;
}

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

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

typedef long long int ll;

const ll INF=(ll)1e19;
//const int INF=(1<<30);


int main(){
  int M;
  cin >> M;
  cout << 48 - M << endl;

}





Measured memory_bytes: 256
def main():
    H, W, N = map(int, input().split())
    s = set()
    for _ in range(N):
        a, b = map(int, input().split())
        s.add((a,b))
    u = set()
    r = [0] * 10
    def search(ii, jj):
        t = 0
        for x in range(-1, 2):
            for y in range(-1, 2):
                xt = x + ii
                yt = y + jj
                if (x+ii, y+jj) in s:
                    t += 1
        r[t] += 1
    for t in s:
        for x in range(-1, 2):
            for y in range(-1, 2):
                xt = x + t[0]
                yt = y + t[1]
                if xt < 2 or yt < 2 or xt > H-1 or yt > W-1:
                    continue
                if (xt, yt) in u:
                    continue
                u.add((xt, yt))
                search(xt, yt)
    r[0] = (H-2) * (W-2) - len(u)
    for i in range(10):
        print(r[i])
main()


Measured memory_bytes: 226924
import java.io.*;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner inputs = new Scanner(System.in);
		int X = inputs.nextInt();
		int N = inputs.nextInt();
		int[] list = new int[N];
		for(int i=0;i<N;i++) {
			list[i] = inputs.nextInt();
		}
		int left=X;
		while(true) {
			boolean huh = true;
			for(int i=0;i<N;i++) {
				if(list[i]==left) {
					huh = false;
				}
			}
			if(!huh) {
				left--;
			}
			else {
				break;
			}
		}
		int right=X;
		while(true) {
			boolean huh = true;
			for(int i=0;i<N;i++) {
				if(list[i]==right) {
					huh = false;
				}
			}
			if(!huh) {
				right++;
			}
			else {
				break;
			}
		}
		if(X-left<=right-X) {
			System.out.println(left);
		}
		else {
			System.out.println(right);
		}
	}

}


Measured memory_bytes: 35884
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

N=gets.to_i
ab=array(N)
N.times do|i|
  ab[i]=get_i
end
ab.sort!{|x,y| y[0]+y[1]<=>x[0]+x[1]}
ans=0
N.times do|i|
  if i.even?
      ans+=ab[i][0]
  else
      ans-=ab[i][1]
  end
end
puts ans

Measured memory_bytes: 21948
#include<iostream>
using namespace std;
int main()
{
	int w,a,b,sum=0;
	cin>>w>>a>>b;
	sum=a+w;
	if(sum<=b&&b>a)
	cout<<(b-sum);
	else if(b<a&&(b+w)<a)
	cout<<(a-(b+w));
	else
	cout<<0;
	

}

Measured memory_bytes: 256
N, M = map(int, input().split())
broken = [int(input()) for i in range(M)]
broken.append(N+1)
safe = []
i = 0
j = 0
temp = 0

def fb(num):
    a, b = 1, 0
    for _ in range(num):
        a, b = a + b, a
    return b

while i != N+2:
    if i < broken[j]:
        temp += 1
        i += 1
    else:
        safe.append(temp)
        temp = 0
        i += 1
        if j < len(broken)-1:
            j += 1
        else:
            break
     

ans = 1
i = 0
for i in range(len(safe)):
    ans = ans * fb(safe[i])

safe2 = [str(i) for i in safe]

if safe2.count('0') != 0:
    print(0)
else:
    print(ans%1000000007)

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

int main(){
    int n;
    cin >> n;
    vector<long long> a(n), numbers(n + 1, 0);
    for(int i = 0; i < n; i++){
        int tmp;
        cin >> tmp;
        a[i] = tmp;
        numbers[tmp]++;
    }

    long long ans = 0;
    for(auto x:numbers){
        ans += x * (x - 1) / 2;
    }
    for(int k = 0; k < n; k++){
        long long ansOfk = ans;
        ansOfk -= numbers[a[k]] - 1;
        cout << ansOfk << endl;
    }

    return 0;
}

Measured memory_bytes: 5760
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String ret;
        switch (sc.next()) {
            case "Sunny":
                ret = "Cloudy";
                break;
            case "Cloudy":
                ret = "Rainy";
                break;
            default:
                ret = "Sunny";
                break;
        }
        System.out.println(ret);
    }
}


Measured memory_bytes: 19668
#include<stdio.h>
int main(){
  int a[51]={0},b,c;
  scanf("%d %d",&b,&c);
  for(int i=0; i<c; i++){
    int d,e;
    scanf("%d %d",&d,&e);
    a[d]++;a[e]++;
  }
  for(int i=1; i<=b; i++){
    printf("%d\n",a[i]);
  }
  return 0;}

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

using namespace std;


int main() {
	int N, P;
	cin >> N >> P;
	long long int A, B;
	A = 1; B = 0;
	for( size_t i = 0; i < N; i++ ) {
		int a;
		cin >> a;
		if( a % 2 ) {
			long long int C = B;
			B += A;
			A += C;
		} else {
			A *= 2;
			B *= 2;
		}
	}

	if( P ) {
		cout << B << endl;
	} else {
		cout << A << endl;
	}
}

Measured memory_bytes: 256
require 'prime'
include Math
define_method :max, 			-> (a,b) { a > b ? a : b }
define_method :min, 			-> (a,b) { a < b ?  a : b }
define_method :swap, 			-> (a,b) { a, b = b, a }
define_method :gi, 				-> () { gets.split.map(&:to_i) }
define_method :gs, 				-> () { gets.chomp }
define_method :gc,				-> () { gets.chomp.split('') }
define_method :gif, 			-> () { gets.to_i }
define_method :pr,				-> (num) { num.prime_division }
define_method :darray,		-> (size1, size2, init = nil) { Array.new(size1){Array.new(size2){init}} }
define_method :array,			-> (size,init = nil) { Array.new(size){init} }
define_method :putall, 		-> (obj) { obj.each { |o| puts o } }
define_method :repl, 			-> (st,en, &block) { st.upto en do |i| block.call(i) end }
	define_method :rep, 		-> (num, &block) { num.times do |i| block.call(i) end }

		puts eval gs


Measured memory_bytes: 2044
#pragma region ヘッダー
#define _CRT_SECURE_NO_WARNINGS

#ifdef _____MY_DEBUG_____
#define VS_ENDPAUSE()	(system("pause"))
#define DEBUG_OUT(...)  (printf(__VA_ARGS__))
#else
#define VS_ENDPAUSE()
#define DEBUG_OUT(...)
#endif

#include <stdio.h>
#include <string.h>
#include <iostream>
#include <math.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;
typedef signed char int8;
typedef signed short int16;
typedef signed int int32;
typedef signed long long int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;
#define int int64

#ifndef INT8_MIN
#define INT8_MIN	(-127)
#endif
#ifndef INT8_MAX
#define INT8_MAX	( 128)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX	( 255)
#endif
#ifndef INT16_MIN
#define INT16_MIN	(-32768)
#endif
#ifndef INT16_MAX
#define INT16_MAX	( 32767)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX	( 65535)
#endif
#ifndef INT32_MIN
#define INT32_MIN	(-2147483648)	// -2 * 10^9
#endif
#ifndef INT32_MAX
#define INT32_MAX	( 2147483647)	//  2 * 10^9
#endif
#ifndef UINT32_MAX
#define UINT32_MAX	( 4294967295)	//  4 * 10^9
#endif
#ifndef INT64_MIN
#define INT64_MIN	(-9223372036854775808)	// -9 * 10^18
#endif
#ifndef INT64_MAX
#define INT64_MAX	( 9223372036854775807)	//  9 * 10^18
#endif
#ifndef UINT64_MAX
#define UINT64_MAX	( 18446744073709551615)	// 18 * 10^18
#endif

void func(void);
#pragma endregion

int32 main(void)
{
    func();
    VS_ENDPAUSE();
    return 0;
}

// 最大公約数
uint64 gcd(uint64 a, uint64 b)
{
    uint64 tmp;
    if(b > a){ swap(a, b); }
    while(b > 0){ tmp = a % b; a = b; b = tmp; }
    return a;
}
// 最小公倍数
uint64 lcm(uint64 a, uint64 b)
{
    if(b>a){ swap(a, b); }
    return a/gcd(a,b) * b;
}

void func(void)
{
//DEBUG_OUT("----\n");
    int N;
    cin >> N;

    uint64 ans = 1;
    for(int i=0; i<N; i++){
        int tmp;
        cin >> tmp;
        ans = lcm(ans, tmp);
    }

DEBUG_OUT("-----\n");
    cout << ans << endl;
    
    return;
}



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

int main()
{
  int N, K;
  cin >> N >> K;
  int sum = 0;
  double half = K / 2.0;
  for (int i = 0; i < N; i++)
  {
    int x;
    cin >> x;
    sum += (x > half ? K - x : x) * 2;
  }

  cout << sum << endl;
}


Measured memory_bytes: 256
import java.util.*;

//update 2020/1/1 23:01

public class Main{

  static Scanner sc = new Scanner(System.in);
  static StringBuilder sb = new StringBuilder();

  public static void main(String[] args) {

    double L = nextDouble();

    System.out.println(Math.pow((L/3),3));

  }

  static int lcm(int a,int b){
    return a*b*gcd(a,b);
  }

  static int gcd(int a,int b){
    if(a%b!=0){
      return gcd(b,a%b);
    }
    else{
      return b;
    }
  }

  /*
    static String toSmall(String s){
      char c = s.charAt(0);
      //if(Character.isUpperCase(c)){
      if(c<=90){
        c += 32;
      }
      return String.valueOf(c);
    }
    static String toBig(String s){
      char c = s.charAt(0);
      //if(Character.isLowerCase(c)){
      if(c>=97){
        c -= 32;
      }
      return String.valueOf(c);
    }
  */

  static String toSmall(String s){
    return s.toLowerCase();
  }

  static String toBig(String s){
    return s.toUpperCase();
  }

  static String next(){
    return sc.next();
  }

  static int nextInt(){
    return Integer.parseInt(sc.next());
  }

  static long nextLong(){
    return Long.parseLong(sc.next());
  }

  static double nextDouble(){
    return Double.parseDouble(sc.next());
  }

  static String[] splitString(String s){
    return s.split("");
  }

  static char[] splitChar(String s){
    return s.toCharArray();
  }

  static int charToInt(char a){
    return a - 48;
  }

////////////////////////////////////////////
  public static int max(int[] a){
    int lng = a.length;
    int max = a[0];
    for(int i=1;i<lng;i++){
      max = Math.max(max,a[i]);
    }
    return max;
  }
  public static long max(long[] a){
    int lng = a.length;
    long max = a[0];
    for(int i=1;i<lng;i++){
      max = Math.max(max,a[i]);
    }
    return max;
  }
////////////////////////////////////////////

////////////////////////////////////////////
  public static int min(int[] a){
    int lng = a.length;
    int min = a[0];
    for(int i=1;i<lng;i++){
      min = Math.min(min,a[i]);
    }
    return min;
  }
  public static long min(long[] a){
    int lng = a.length;
    long min = a[0];
    for(int i=1;i<lng;i++){
      min = Math.min(min,a[i]);
    }
    return min;
  }
////////////////////////////////////////////

}


Measured memory_bytes: 21716
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;
#define fi first
#define se second
#define all(v) (v).begin(),v.end()
set<string> c;
const ll mod=1000000007;
const ll mod2=998244353;
const ll inf=100000000000000000;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
vector<int> dy={-1,0,1,0},dx={0,-1,0,1};
int main(){
int n;
cin>>n;
vector<ll> a(n),b(n);
for(int i=0;i<n;i++)cin>>a.at(i);
for(int i=0;i<n;i++)cin>>b.at(i);
int i=0;
bool check=true;
ll cnt=0;
while(1){
if(b.at(i)-((i>0?b.at(i-1):b.at(n-1))+(i<n-1?b.at(i+1):b.at(0)))>=a.at(i)){
/* for(int i=0;i<n;i++)cout<<b.at(i)<<" ";
cout<<endl;*/
check=false;
ll nowcnt,bet;
bet=((i>0?b.at(i-1):b.at(n-1))+(i<n-1?b.at(i+1):b.at(0)));
nowcnt=((b.at(i)-a.at(i))/bet);
cnt+=nowcnt;
b.at(i)-=nowcnt*bet;
}
if(i==n-1&&!check)check=true;
else if(i==n-1&&check){
  for(int i=0;i<n;i++){
      if(a.at(i)!=b.at(i)){cout<<-1<<endl;return 0;}
  }
  cout<<cnt<<endl;
  return 0;
}
i++;
i%=n;
}

}



Measured memory_bytes: 3328
import java.util.Scanner;

public class Main {
    public static final int BIG_NUM = 200000000;
    public static final int MOD     = 100000007;
    
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int y = scanner.nextInt();
        
        System.out.println(gcd(Math.max(x, y), Math.min(x, y)));
    }
    
    public static int gcd(int x, int y) {
        if(y == 0) {
            return x;
        }else {
            return gcd(y, x % y);
        }
    }
}


Measured memory_bytes: 26144
#include<bits/stdc++.h>
using namespace std;
int main(){
  int p,q,r;cin>>p>>q>>r;
  int ans=100000000000;
  ans=min(ans,p+q);
  ans=min(ans,q+r);
  ans=min(ans,r+p);
  cout<<ans<<endl;
}
  

Measured memory_bytes: 256
def inpl(): return list(map(int, input().split()))

K, T = inpl()
A = inpl()
ans = K

if T == 1:
    print(K-1)
    exit()

for i in range(T):
    tmp = max(A[i]-(K-A[i]+1), 0)
    OK = False
    for k in range(T):
        if i == k:
            continue
        if (K-A[k]-1) <= 0:
            continue
        OK = True
        tmp = max(tmp, A[k]-(K-A[k]-1))
    if OK:
        ans = min(tmp, ans)

for i in range(T):
    for j in range(i+1, T):
        tmp = max(A[i]-(K-A[i]), 0)
        tmp = max(tmp, A[j]-(K-A[j]))
        OK = False
        for k in range(T):
            if (i == k) or (j == k):
                continue
            if (K-A[k]-1) <= 0:
                continue
            OK = True
            tmp = max(tmp, A[k]-(K-A[k]-1))
        if OK:
            ans = min(tmp, ans)

print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int N;
int A[100010];
int B[100010];

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    B[A[i]]++;
  }
  int even = 0, ans = 0;
  for (int i = 0; i < 100010; i++) {
    if (B[i] == 0) continue;
    if (B[i] % 2 == 0) even++;
    ans++;
  }
  cout << ans - (even % 2 == 1) << endl;

  return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int x,a;
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>x>>a;
	if(x<a)
		cout<<0<<endl;
	else
		cout<<10<<endl;
	return 0;
}


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

int32_t main(){
	
	int a,b,c,d;
	cin >> a >> b >> c >> d;
	
	int ans = a*c;
	ans = max(ans,a*d);
	ans = max(ans,b*c);
	ans = max(ans,b*d);
	
	cout<<ans<<'\n';
}


Measured memory_bytes: 3564
//hinagata.cpp
/*includes*/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <stdio.h>
#include <numeric>
#include <iomanip>
#include <limits>
/*namespace*/
using namespace std;
using ll= long long;
/*define macro*/
#define REP(i,n) for(int i=0;i<(n);i++)
#define REPi(i,a,b) for(int i=(a);i<(b);i++)
#define REPRi(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(x) (x).begin(),(x).end()

int main(){
    int T,X;
    cin>>T>>X;
    double ans;
    ans=double(T)/X;
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;

int n;
#define ll long long
const int N = 1e5+7;

struct node{
	int a,b;
}f[N];

bool cmp(node a,node b){
	return a.b < b.b;
}

int main(){
	int m;
	cin >> n >> m;
	int ans = 1;
	for(int i = 1; i <= m; i++) cin >> f[i].a >> f[i].b;
	sort(f+1,f+1+m,cmp);
	int x = f[1].b-1;
	for(int i = 2; i <= m; i++){
		if(f[i].a <= x) continue;
		else ans++,x = f[i].b-1;
	}
		
	cout << ans;
} 

Measured memory_bytes: 1152
package main

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

func main() {
	sc := NewScanner(os.Stdin)
	s, _ := sc.NextString()
	k, _ := sc.NextInt()
	ans := solve(s, k)
	fmt.Println(ans)
}

const mod = 998244353

func solve(s string, m int) (ans int) {
	count := countOnes(s)
	n := len(count)
	sum := 0
	for _, v := range count {
		sum += v
	}
	m = Min(m, sum)
	dp := initDp(m)
	dp[0][0] = 1
	for i := 0; i < n; i++ {
		tmp := initDp(m)
		for j := 0; j <= m; j++ {
			for k := 0; k <= m; k++ {
				// do nothing
				tmp[j][k] += dp[j][k]
				tmp[j][k] %= mod
				// move from stock
				for l := 1; l <= k; l++ {
					tmp[j][k-l] += dp[j][k]
					tmp[j][k-l] %= mod
				}
				// move to stock
				for l := 1; l <= count[n-1-i] && j+l <= m && k+l <= m; l++ {
					tmp[j+l][k+l] += dp[j][k]
					tmp[j+l][k+l] %= mod
				}
			}
		}
		copy(dp, tmp)
	}
	for j := range dp {
		ans += dp[j][0]
		ans %= mod
	}
	return ans
}

func countOnes(s string) []int {
	ret := []int{}
	count := 0
	for _, c := range s {
		if c == '1' {
			count++
			continue
		}
		ret = append(ret, count)
		count = 0
	}
	ret = append(ret, count)
	return ret
}

func initDp(m int) [][]int {
	dp := make([][]int, m+1)
	for i := range dp {
		dp[i] = make([]int, m+1)
	}
	return dp
}

// Scanner is a wrapper of bufio.Scanner which is customized for competitive programing.
type Scanner struct {
	bufio.Scanner
}

// NewScanner is a constructor for Scanner.
func NewScanner(r io.Reader) *Scanner {
	sc := Scanner{*bufio.NewScanner(r)}
	sc.Buffer([]byte{}, math.MaxInt64)
	sc.Split(bufio.ScanWords)
	return &sc
}

// NextInt reads a integer from io stream.
func (sc *Scanner) NextInt() (int, error) {
	if !sc.Scan() {
		return -1, errors.New("failed to scan")
	}
	return strconv.Atoi(sc.Text())
}

// NextString reads a string from io stream
func (sc *Scanner) NextString() (string, error) {
	if !sc.Scan() {
		return "", errors.New("failed to scan")
	}
	return sc.Text(), nil
}

// Min returns minimum value of inputs
func Min(a ...int) (min int) {
	for i, ai := range a {
		if i == 0 || ai < min {
			min = ai
		}
	}
	return min
}


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

int main()
{
    int N, X;
    int ans = 100;

    cin >> N;

    for(int i = 0; i < N; i++)
    {
        int k = 0;
        cin >> X;
        while (X % 2 == 0)
        {
            X /= 2;
            k++;
        }
        ans = min(k, ans);
    }
    cout << ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a>b?a:b
#define REP(i,x,n) for(int i=x;i<n;i++)
#define REPR(i,x,n) for(int i=n-1;i>=x;i--)
#define pb  push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLr(obj) (obj).rbegin(), (obj).rend()
#define endl "\n"
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;


int main() {
  bool f[101010]={};
  int n,m;
  int wa[101010]={},ac=0;
  cin>>n>>m;
  rep(i,m){
    int a;string b;
    cin>>a>>b;
    if(b=="AC"){
      if(!f[a]){
        ac++;
        f[a]=1;
      }
    }else{
      if(!f[a]){
        wa[a]++;
      }
    }
  }
  int an=0;
  rep(i,n+1){
    if(f[i]){
      an+=wa[i];
    }
  }
  cout<<ac<<" "<<an<<endl;
}


Measured memory_bytes: 768
using System;

namespace ITP1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            double a = double.Parse(input[0]);
            double b = double.Parse(input[1]);
            double C = double.Parse(input[2]);
            
            double S = 0.5*a*b*Math.Sin(C*Math.PI/180);
            Console.WriteLine(S.ToString("f4"));
            double c = Math.Sqrt(a * a + b * b - 2 * a * b * Math.Cos(C * Math.PI / 180));
            double L = (a + b +c);
            Console.WriteLine(L.ToString("f4"));
            double h = 2 * S / a;
            Console.WriteLine(h.ToString("f4")); 
        }
    }
}

Measured memory_bytes: 9232
# define _CRT_SECUREj_NO_WARNINGS 1
# define _USE_MATH_DEFINES
# include <iostream>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <forward_list>
# include <map>
# include <stack>
using namespace std;
# define INF ((int)(1<<25))
# define REP(i,n) for(int i=0;i<(int)n;i++)
# define FOR(i,n) REP(i,n)
# define FORI(i,k,n) for(int i=k;i<(int)n;i++)
# define TORAD 2.0*M_PI/360.0
# define INT(x) int x;cin>>x;
# define ALL(x) (x).begin(),(x).end()
# define RALL(x) (x).rbegin(),(x).rend()
# define DEBUG(x) cout<<#x<<":"<<x<<endl;
# define EPS 1e-12
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
typedef long long lint;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
const int dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 };
template<class T> void debug(T a) { for (auto i : a)cout << i << endl; }

int main()
{
	int n;
	while (cin >> n&&n != -1)
	{
		stringstream ss;
		while (n)
		{
			ss << n % 4;
			n /= 4;
		}
		string ans = ss.str();
		reverse(ALL(ans));
		if (ans == "")ans = "0";
		cout << ans << endl;
	}
}

Measured memory_bytes: 3128
import java.util.Scanner;

public class Main{
  public static void main(String[] args){

	    Scanner sc = new Scanner(System.in);  //標準入力の宣言
      	String S = sc.next(); //入力数
       
        String S1 = S.substring(0,1);
        String S2 = S.substring(1,2);
        String S3 = S.substring(2,3);
        String S4 = S.substring(3,4);
    
        String kekka = "Good";
        
        if (S1.equals(S2) || S2.equals(S3) || S3.equals(S4)) {
          kekka = "Bad";
        }

        System.out.println(kekka); //入力数の確認

  }
}


Measured memory_bytes: 35416
#include<iostream>

template<typename T, int size>
struct PreCirclePond
{
    T ary[size + 1];
    static constexpr float pi = 3.141592653589793238;

    constexpr PreCirclePond() : ary() {
        for (int i = 0; i < size + 1; i++)
        {
            const int t = i * 2;
            ary[i] = t * pi;
        }
    }

    T take(int r) const {
        return ary[r];
    }
};

template<class R>
float ciclePondP(R r) {
    constexpr auto a = PreCirclePond<float, 100>();
    return a.take(r);
}

int main() {
    using namespace std;
    ios_base::sync_with_stdio(false);

    int R;
    cin >> R;

    cout << ciclePondP(R);
}

Measured memory_bytes: 3804
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;

bool solve(ll x, int K, const vector<ll>& v){
  if(x == 0) return false;
  int ret = 0;
  rep(i,v.size()){
    ret += (v[i]-1)/x;
  }
  return ret <= K;
}

int main(){
  int N;
  ll K;
  cin >> N >> K;
  vector<ll> v;
  rep(i,N){
    ll a;
    cin >> a;
    v.push_back(a);
  }

  ll lb = 0, ub = 1e15;
  while(ub-lb>1){
    ll m = (lb+ub)/2;

    if(solve(m, K, v)) ub = m;
    else lb = m;
  }

  cout << ub << endl;
  
  return 0;
}


Measured memory_bytes: 5356
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
using namespace std;

int main(){
	cout << fixed;
	cout << setprecision(10);
	while(1){
		int q;
		cin >> q;
		if(q == -1) break;
		
		double x = (double)q/2;
		while(abs(x*x*x -q) > 1e-5 *q){
			x = x - (x*x*x -q)/(3*x*x);
		}
		cout << x << endl;
	}
	return 0;
}


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

using namespace std;

#define INF 1e9

int N,t[20][20];
int dp[1<<16];

int solve(int S){
    if(S == (1<<N)-1) return 0;
    if(dp[S] >= 0) return dp[S];
    int res = INF;
    for(int i = 0 ; i < N ; i++){
        if(S >> i & 1) continue;
        res = min(res,solve(S|(1<<i))+t[i][0]);
        for(int j = 1 ; j < N+1 ; j++){
            if(S >> (j-1) & 1){
                res = min(res,solve(S|(1<<i))+t[i][j]);
            }
        }
    }
    return dp[S] = res;
}

int main(){
    while(cin >> N, N){
        for(int i = 0 ; i < N ; i++){
            for(int j = 0 ; j < N+1 ; j++){
                cin >> t[i][j];
            }
        }
        memset(dp,-1,sizeof(dp));
        cout << solve(0) << endl;
    }
    return 0;
}

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

int main() {
	while(1){
	int a[17][17]={} ,x ,y ,n ,badpoint ,badpoint1;
	cin>>x>>y>>n;
	if(x==0&&y==0)
	break;
	for(int i=0;i<n;i++){
		cin>>badpoint>>badpoint1;
		a[badpoint][badpoint1]=-1;		
	}
	a[0][1]=1;
	for(int i=1;i<=x;i++){
		for(int j=1;j<=y;j++){
				if(a[i][j]==0)
				a[i][j]=a[i-1][j]+a[i][j-1];
				else
				a[i][j]=0;
			}
		}
		cout<<a[x][y]<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)
 
int main(void) {
  int a, b;cin>>a>>b;
  if(a>b) swap(a, b);
  fr(i, b) cout << a;



  return 0;
}

Measured memory_bytes: 256
from itertools import combinations


if __name__ == "__main__":
    bit = int(input())
    k, *E = map(lambda x: int(x), input().split())

    for d, ans in sorted([((sum([1 << cc for cc in c])), ' '.join(map(str, c)))
                         for i in range(k + 1) for c in combinations(E, i)]):
        if d:
            print(f"{d}: {ans}")
        else:
            print(f"0:")



Measured memory_bytes: 55304
#include<bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
#define repd(i,a,b) for (int i=(a);i<(b);i++)
typedef long long ll;
using namespace std;

int main() {
    int n, m; cin >> n >> m;
    vector<pair<ll,int>> v(n);
    rep(i,n)cin >> v[i].first >> v[i].second;
    ll money = 0;
    sort(v.begin(),v.end());
    rep(i,n){
        if(m <= 0)break;
        int num = min(m,v[i].second);
        m -= num;
        money += v[i].first * num;
    }
    cout << money << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    vector<string> ss;

    int N, L;
    cin >> N >> L;
    for (int i = 0; i < N; ++i) {
        string S;
        cin >> S;
        ss.push_back(S);
    }
    sort(ss.begin(), ss.end());
    for (string S:ss) {
        cout << S;
    }
    cout << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(a,b) for(int a=0;a<b;a++)
#define repd(a,b) for(int a=b;a>=0;a--)
signed main()
{
    int n;
    cin>>n;
    int a[n],b[n];
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    int ans1=0,ans2=0;
    string s1="",s2="",s3="",s4="";
    rep(i,n)s1+='0'+a[i];
    rep(i,n)s3+='0'+b[i];
    rep(i,n)s2+='0'+i+1;
    rep(i,n)s4+='0'+i+1;
    while(s1!=s2)
    {
        next_permutation(s2.begin(),s2.end());
        ans1++;
    }
    while(s3!=s4)
    {
        next_permutation(s4.begin(),s4.end());
        ans2++;
    }
    int ans = abs(ans1-ans2);
    cout<<ans<<"\n";
    
    
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <cstdint>
#include <istream>
#include <sstream>
#include <cctype>
#include <functional>
#include <iomanip>
#define fore(i,x,y) for(ll i=(x);i<(y);i++)
#define disp(a) cout << a << endl;
#define PI 3.14159265359
typedef long long ll;
using namespace std;
int main()
{
	ll N,ANS=1;
	cin>>N;
	for(int i=0;i<N;i++){
		ANS=(ANS*(i+1))%1000000007;
	}
	cout<<ANS<<endl;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;
constexpr int mod2 = 998244353;
template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

template<typename T>
vector<T> makeVector(size_t a, T b) { return (vector<T>(a, b)); }
template<typename... Ts>
auto makeVector(size_t a, Ts... ts) { 
	return (vector<decltype(makeVector(ts...))>(a, makeVector(ts...)));
}

template<typename T>
bool isin(T y, T x, T h, T w) { return (0 <= y && 0 <= x && y < h && x < w); }
template<typename T>
bool isin1(T y, T x, T h, T w) { return (0 < y && 0 < x && y <= h && x <= w); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	if (v.size()) {
		os << v[0];
		for (int i = 1; i < v.size(); i++) os << " " << v[i];
	}
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	priority_queue<Pl> d;
	int N; cin >> N;
	vll A(N), B(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i] >> B[i];
		d.emplace(A[i]+B[i], i);
	}

	bitset<100005> flag;
	ll point = 0;
	for (int i = 0; i < N; i++) {
		while (!d.empty() && flag[d.top().second]) d.pop();
		int idx = d.top().second; d.pop();
		flag[idx] = true;
		if (i&1) point -= B[idx];
		else point += A[idx];
	}
	cout << point << endl;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout << fixed << setprecision(20);
	Main();
	return (0);
}



Measured memory_bytes: 6836
import sys

s = input()
s = s[::-1]

d ='maerd'
dr = 'remaerd'
e = 'esare'
er = 'resare'

i = 0
while True:
    try:
        if s[i:i+5] == d or s[i:i+5] == e:
            i += 5
            if i == len(s):
                print('YES')
                sys.exit(0)
        
        elif s[i:i+6] == er:
            i += 6
            if i == len(s):
                print('YES')
                sys.exit(0)
        
        elif s[i:i+7] == dr:
            i += 7
            if i == len(s):
                print('YES')
                sys.exit(0)
            
        else:
            print('NO')
            sys.exit(0)
            
    except Exception as err:
        print('NO')
        sys.exit(0)

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

int main() {

  int a,b,i,c,e=0;
  cin>>a>>b;
  for(i=0;i<a;i++){
  	cin>>c;
    if(b-c>c){
      e+=c;
    }else{
      e+=b-c;
    }
  }
  cout<<e*2;
}


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

// using namespace std;

// const int T = 100;

// int main() {
// 	int n, m;
// 	cin >> n >> m;
	
// 	int sum = 0;
// 	vector<int> t(n), count(T + 1, 0);
// 	for (int i = 0; i < n; i++) {
// 		cin >> t[i];
// 	}
	
// 	for (int i = 0; i < n; i++) {
// 		int d = sum + t[i] - m, k = 0;
//         cout<<d<<" "<<sum<<"    ";
// 		if (d > 0) {
// 		    for (int j = T; j > 0; j--) {
// 				int x = j * count[j];
// 				if (d <= x) {
// 					k += (d + j - 1) / j;
// 					break;
// 				}
// 				k += count[j];
// 				d -= x;
// 			}
// 		}
// 		sum += t[i];
// 		count[t[i]]++;
// 		cout << k << " "<<endl;
// 	}
// }
#include<bits/stdc++.h>

// @author : sam000013

#define int long long
#define PI 3.14159265
#define fi(i,start,end) for(int i=0; i<n; i++)
#define pb(x) push_back(x)
#define int long long
#define PI 3.14159265
#define all(v) v.begin(), v.end()
#define endl cout<<"\n" 
#define ll long long
#define dbg(x) cout<<#x<<" "<<x;endl;
#define bye endl;return
using namespace std;
int mod = 1000000009;
template<typename T>

void debug(vector<T> x){
    for(auto e:x){
        cout<<e<<" ";
    }
    cout<<"\n";
}
/*
1
8 6
1 2 4 1 2 4 1 2

*/

void solve(int r){
    int d,t,s;
    cin>>d>>t>>s;
    int helper = d/s;
    if(helper < t){
        cout<<"Yes";bye;
    }else if(helper == t){
        if(d%s != 0){
            cout<<"No";bye;
        }else{
            cout<<"Yes";bye;
        }
    }else{
        cout<<"No";bye;
    }

}

signed main(){
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int t = 1;
    //cin>>t;
    for(int i=1; i<=t; i++){
        solve(i);
    }
    return 0;
}

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

int main() {
	int a, potongan ,harga, jadinya, cashback;
	cin >> a;
	potongan = a / 15;
	cashback = potongan * 200;
	harga = a* 800;
	jadinya = harga - cashback;
	cout << jadinya << endl;
	return 0;
}

Measured memory_bytes: 256