akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
using namespace std;

#define vd vector<double>
 
typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
int dx[4] = { -1,0, 1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
// #define mp make_pair
//#define endl '\n'
 
int main() {
    int n;
    cin >> n;
    vd v(n);
    rep(i,n){
        cin >> v[i];
    }
    sort(all(v), greater<double>());
    double result = 0;
    double x = 1;
    rep(i,n-1){
        x *= 2;
        result = result + v[i] / x;
    }
    result = result + v[n-1] / x;
    cout << result << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll     = long long;
using pii    = pair<int, int>;
using pll    = pair<ll, ll>;
using vi     = vector<int>;
using vl     = vector<ll>;
using vvi    = vector<vi>;
using vvl    = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
template <class C>
void print(const C &c, std::ostream &os = std::cout) {
    std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, " "));
    os << std::endl;
}

int main() {
    int n;
    cin >> n;
    if (n == 3) {
        print(vi({2, 5, 63}));
        return 0;
    } else if (n == 4) {
        print(vi({2, 5, 20, 63}));
        return 0;
    } else if (n == 5) {
        print(vi({3, 4, 8, 12, 15}));
        return 0;
    }
    // sum is multiple of 6.
    // each number is multiple of 2 or 3.
    // 2 3 4 6 / 8 9 10 12 / .../ 29994 29996 29997 29998 30000
    vi ret;
    vi add = {2, 3, 4, 6};
    ll sum = 0;
    for (int i = 0; i < n; ++i) {
        int r = 6 * (i / 4) + add[i % 4];
        ret.push_back(r);
        sum += r;
        // if (sum % 6 == 1)
        //     cout << "!!!" << sum << "\n";
    }
    if (sum % 6 == 1) {
        assert(false);
    }
    if (sum % 6 == 2) {
        sum += 30000;
        sum -= 2;
        ret[0] = 30000;
    } else if (sum % 6 == 3) {
        sum += 30000;
        sum -= 3;
        ret[1] = 30000;
    } else if (sum % 6 == 4) {
        sum += 30000;
        sum -= 4;
        ret[2] = 30000;
    } else if (sum % 6 == 5) {
        sum += 29998;
        sum -= 3;
        ret[1] = 29998;
    }
    print(ret);
    cerr << sum << " " << sum % 6 << endl;
    return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define X real()
#define Y imag()
#define value(x,y,w,h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using comd = complex<double>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

template <typename T>
void out(deque < T > d)
{
  for(size_t i = 0; i < d.size(); i++)
  {
    debug(d[i]);
  }
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

int arr[1000010];
void SetHamming(int n,int k){
  if(n * k > 1000001) return ;
  if(arr[n*k] == 0){
    arr[n*k] = 1;
    SetHamming(n*k,2);
    SetHamming(n*k,3);
    SetHamming(n*k,5);
  }
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int m,n;
  SetHamming(1,1);
  while(1){
    cin >> m ;
    if(m == 0) break;
    cin >> n ;
    int ans = 0;
    REP(i,m,n+1){
      if(arr[i] == 1){
        ++ans;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

int main(){

	string str;
	getline(cin, str);

	for(int i = 0; i < str.length(); i++){
		if(islower(str[i])){
			str[i] = toupper(str[i]);
		}else if(isupper(str[i])){
			str[i] = tolower(str[i]);
		}
	}

	cout << str << endl;

	return 0;
}

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

using namespace std;

#define rep(a, b) for(int i = 0; i < n; i++)
typedef long long ll;
template<typename T> bool chmax(T &a, T b) {if(a <= b){a = b; return true;}return false;}
template<typename T> bool chmin(T &a, T b) {if(a >= b){a = b; return true;}return false;}

int main(void){
    int n, q;
    string s;
    cin >> n >> q >> s;
    vector<int> dp(n);
    for(int i = 1; i < n; i++){
        if(s[i-1] == 'A' && s[i] == 'C'){
            dp[i] = dp[i-1] + 1;
        }else{
            dp[i] = dp[i-1];
        }
    }
    while(q--){
        int l, r;
        cin >> l >> r;
        l--;r--;
        cout << dp[r] - dp[l] << endl;
    }
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define int long long
#define F first
#define S second
const ll INF = 1LL * 1000 * 1000 * 1000 * 1000 * 1000 * 1000;
const int inf = 1000 * 1000 * 1000;

// Bedone harf !

const int N = 55;
string a[N], b[N];

int32_t main(){
	ios::sync_with_stdio(false);cin.tie(0);	
	
	int n, m;
	cin >> n >> m;
	for(int i = 0; i < n; i++)
		cin >> a[i];
	for(int i = 0; i < m; i++)
		cin >> b[i];

	for(int i = 0; i + m - 1 < n; i++){
		for(int j = 0; j + m - 1 < n; j++){
			bool same = true;
			for(int x = 0; x < m; x++){
				if(same == false)
					break;
				for(int y = 0; y < m; y++){
//					cout << a[i + x][j + y] << ' ' << b[x][y] << '\n';
					if(a[i + x][j + y] != b[x][y]){
						same = false;
						break;
					}
				}
			}
			if(same){
//				cout << i << ' ' << j << '\n';
				cout << "Yes\n";
				return 0;
			}
		}
	}
	cout << "No\n";

	return 0;
}

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

int main() {
  int N;
  cin >> N;
  if (N%10==2 || N%10==4 || N%10==5 || N%10==7 || N%10==9) {
    cout << "hon" << endl;
  }
  else if (N%10==0 || N%10==1 || N%10==6 || N%10==8) {
    cout << "pon" << endl;
  }
  else {
    cout << "bon" << endl;
  }
}

Measured memory_bytes: 3580
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <utility>
#include <complex>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <tuple>
#include <bitset>
#include <limits>
#include <algorithm>
#include <array>
#include <random>
#include <complex>
#include <regex>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef complex<ld> compd;
#define quickIO()	{cin.tie(0);	cout.sync_with_stdio(false);}
#define reach(i,a)	for(auto i:a)
#define rep(i,n)	for(int i=0;i<((int)n);i++)
#define REP(i,n)	for(int i=0;i<=((int)n);i++)
#define srep(i,a,n)	for(int i=a;i<((int)n);i++)
#define SREP(i,a,n)	for(int i=a;i<=((int)n);i++)
#define rrep(i,n)	for(int i=n-1;i>=0;i--)
#define RREP(i,n)	for(int i=n;i>=0;i--)
#define all(a)	(a).begin(),(a).end()
#define mp(a,b)	make_pair(a,b)
#define mt	make_tuple
#define pb	push_back
int bitcnt(ll x) {
	x = ((x & 0xAAAAAAAAAAAAAAAA) >> 1) + (x & 0x5555555555555555);
	x = ((x & 0xCCCCCCCCCCCCCCCC) >> 2) + (x & 0x3333333333333333);
	x = ((x & 0xF0F0F0F0F0F0F0F0) >> 4) + (x & 0x0F0F0F0F0F0F0F0F);
	x = ((x & 0xFF00FF00FF00FF00) >> 8) + (x & 0x00FF00FF00FF00FF);
	x = ((x & 0xFFFF0000FFFF0000) >> 16) + (x & 0x0000FFFF0000FFFF);
	x = ((x & 0xFFFFFFFF00000000) >> 32) + (x & 0x00000000FFFFFFFF);
	return x;
}
int bitcnt(int x) {
	x = ((x & 0xAAAAAAAA) >> 1) + (x & 0x55555555);
	x = ((x & 0xCCCCCCCC) >> 2) + (x & 0x33333333);
	x = ((x & 0xF0F0F0F0) >> 4) + (x & 0x0F0F0F0F);
	x = ((x & 0xFF00FF00) >> 8) + (x & 0x00FF00FF);
	x = ((x & 0xFFFF0000) >> 16) + (x & 0x0000FFFF);
	return x;
}
ll sqrtll(ll x) {
	ll left = 0, right = x;
	rep(i, 100) {
		ll mid = (left + right) >> 1;
		if (mid*mid <= x)	left = mid;
		else	right = mid;
	}
	return left;
}
ll gcd(ll a, ll b) {
	return a % b == 0 ? b : gcd(b, a%b);
}
#define debug(x)	printf("Case #%d: ", x)
#define DEBUG 0
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ld eps = 1e-9;
const int dx[] = { 1,0,-1,0,0 };
const int dy[] = { 0,1,0,-1,0 };

int main() {
	int n;	cin >> n;
	string head = "MARCH";
	vector<ll> cnt(5);
	// 頭文字MARCHで始まる人数をそれぞれカウント
	rep(i, n) {
		string s;	cin >> s;
		rep(j, 5) {
			if (head[j] == s[0]) {
				cnt[j]++;
				break;
			}
		}
	}
	// 全探索
	ll ret = 0;
	rep(i, 5)	rep(j, i)	rep(k, j) {
		ret += cnt[i] * cnt[j] * cnt[k];
	}
	cout << ret << endl;
	return 0;
}

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

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<string>> mp(n + 1);
    for (int i = 0; i < m; i++) {
        int p;
        string s;
        cin >> p >> s;
        mp[p].emplace_back(s);
    }
    int ac = 0;
    int pen = 0;
    for (int i = 1; i <= n; i++) {
        bool c = false;
        int pc = 0;
        for (auto s: mp[i]) {
            if (s == "AC") {
                c = true;
            } else if (!c) {
                pc++;
            }
        }
        if (c) {
            ac++;
            pen += pc;
        }
    }
    cout << ac << " " << pen << endl;
    return 0;
}


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

int main(){
    unsigned long N;
    cin >> N;
    vector<unsigned long> A(N);
    unsigned long u;
    for(auto& i : A){
        long k;
        cin >> k;
        i = static_cast<unsigned long>(abs(k));
        u ^= k < 0;
    }
    cout << accumulate(A.begin(), A.end(), 0UL) - (u ? *min_element(A.begin(), A.end()) * 2 : 0) << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <numeric>
#include <bitset>
#include <vector>
#include <queue>

using namespace std;

typedef long long ll;
#define FOR(i,a,b)   for(ll i = (a); i < (b); i++ )
#define REP(i, n)    FOR(i,0,n)
typedef pair< ll, ll >   cp2;
typedef pair< ll, cp2 >   cp3;
#define fi first
#define se second
#define sec  se.fi
#define thr  se.se
const ll mod = 1000000007;
//              123456789

 
///////////////////////////////////////////////
//
//
///////////////////////////////////////////////

////////////////////////////////////////////////
////////////////////////////////////////////////

int ans;
int N;
int idx;
string S;

int sum;
int dp[1<<26];

int main(){
	
	cin>>S;
	N = S.size();

	fill( dp, dp+(1<<26), mod );
	
	dp[0] = 0;
	
	REP( i, N ){
		idx = S[i]-'a';
		sum ^= (1<<idx);
		
		REP( j, 26 ){
			dp[sum] = min( dp[sum], dp[sum^(1<<j)]+1 );
		}
	}
	
	cout<<max( 1, dp[sum] )<<endl;
	
	return 0;

}

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

int main() {
  int64_t M,a=0,b=0;
  cin>>M;
  for(int64_t i=0;i<M;i++){
    int64_t x,y;
    cin>>x>>y;
    a+=x*y;
    b+=y;
  }
  cout<<(a-1)/9+b-1<<endl;
}

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

N = int(input())
ans = [0, -1]
for i in range(1, N + 1):
    cnt = 0
    j = i
    while i % 2 == 0:
        cnt += 1
        i //= 2
    if cnt > ans[1]:
        ans = [j, cnt]
print(ans[0])

Measured memory_bytes: 3060
#include <iostream>

using namespace std;

int main()
{
    string s, t;
    cin >> s >> t;
    int cnt=0;
    for(int i=0; i<3; i++){
        if(s[i] == t[i]){ cnt++; }
    }
    
    cout << cnt;
    
    return 0;
}

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

signed main(){
    int N,K;
    cin>>N>>K;
    int ans=0;
    REP(i,N){
        int a;
        cin>>a;
        ans+=min(a,K-a)*2;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
int gcd( int x, int y ){ return y ? gcd(y, x%y) : x; }
signed main() {
int x=0,y=0,z=0,w=0,n=0,m=0;
int a=0,b=-1,c=0,d=0;
std::cin >> x;
if(x==1)std::cout << "Hello World" << '\n';
else {
  std::cin >> x>>y;
  std::cout << x+y << '\n';
}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
#define MOD 100000007
using namespace std;

int main(){
	int n, a, b;
	cin >> n >> a >> b;
	cout << min(a, b) << " " << max(a+b-n, 0) << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int c[3][3];
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3 ;j++) {
            std::cin >> c[i][j];
        }
    }
    
    int a[3],b[3];
    a[0]=0;
    b[0]=c[0][0]-a[0];
    b[1]=c[0][1]-a[0];
    b[2]=c[0][2]-a[0];
    
    a[1]=c[1][0]-b[0];
    a[2]=c[2][0]-b[0];
    
    
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3 ;j++) {
            if(c[i][j]!=a[i]+b[j]){
                std::cout << "No" << std::endl;
                return 0;
            }
        }
    }
    
    std::cout << "Yes" << std::endl;
    return 0;
    
    
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define taskname "A"
#define pb push_back
#define mp make_pair
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
const int maxn = 5e5 + 5;
const int logn = log2(maxn) + 1;
const int mod = 1e9 + 7;
int n , a[maxn];

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    if(fopen(taskname".INP", "r")) {
        freopen(taskname".INP", "r", stdin);
        freopen(taskname".OUT", "w", stdout);
    }
    string s;
    cin >> s;
    n = s.size();
    for(int i = 0 ; i < n ; ++i){
        if(i + 1 < n && s[i] == s[i + 1])return cout << i + 1 << " " << i + 2 , 0;
        if(i + 2 < n && s[i] == s[i + 2])return cout << i + 1 << " " << i + 3 , 0;
    }
    cout << -1 << " " << -1;
}


Measured memory_bytes: 512
import java.util.Scanner;

//77377
public class Main{

	int[] ref = {2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9};
	int n;
	String[] w, rep;
	String s;
	
	void dfs(int i, String r){
		if(i==s.length()){
			System.out.println(r.substring(1)+"."); return;
		}
		String sub = s.substring(i);
		for(int j=0;j<n;j++){
			if(!sub.startsWith(rep[j]))continue;
			dfs(i+rep[j].length(), r+" "+w[j]);
		}
	}
	
	void run(){
		Scanner sc = new Scanner(System.in);
		for(;;){
			n = sc.nextInt();
			if(n==0)break;
			w = new String[n]; rep = new String[n];
			for(int i=0;i<n;i++){
				w[i] = sc.next();
				String res = "";
				for(int j=0;j<w[i].length();j++)res+=ref[w[i].charAt(j)-'a'];
				rep[i] = res;
			}
			s = sc.next();
			dfs(0, "");
			System.out.println("--");
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 12000
using System;
using System.Linq;
class program{
  static void Main(){
    int n = int.Parse(Console.ReadLine());
    long[] a = Array.ConvertAll(Console.ReadLine().Split(' '),long.Parse);
    int[] table = new int[100001];
    for(int i = 0;i<n;i++){
      table[a[i]]++;
    }
    n = int.Parse(Console.ReadLine());
    long ans = a.Sum();
    for(int i = 0;i<n;i++){
      int[] bc = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);
      ans += (bc[1]-bc[0])*table[bc[0]];
      table[bc[1]] += table[bc[0]];
      table[bc[0]] = 0;
      Console.WriteLine(ans);
    }
  }
}

Measured memory_bytes: 50568
#include<stdio.h>
#define MAX_n 10000
#define MAX_q 500
#define max 1000000000
int main(void){

	int n, q;
	int S[MAX_n], T[MAX_q];
	int i, j;
	int count=0;
	scanf("%d", &n);
	for(i =0;i<n;i++){
		scanf("%d", &S[i]);
	}
	
	scanf("%d", &q);
	for(i =0;i<q;i++){
		scanf("%d", &T[i]);
	}
	
	for(i =0;i<q;i++){
		for(j = 0;j<n;j++){
			if(T[i] == S[j]){
				count++;
				break;
			}
		}
	}
	
	
	printf("%d\n", count);



}


Measured memory_bytes: 2108
#define DEBUG
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
using namespace std;
 
#define F first
#define S second 
#define pb push_back
#define endl "\n"

#define IOS { ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0); }

#ifdef DEBUG
    #define dbg(s) {s;}
#endif

#ifndef DEBUG
    #define dbg(s)
#endif

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int grand(int x) { // from [0, x-1]
    return uniform_int_distribution<int>(0, x - 1)(rng);
}

#define int ll
#define i32 int32_t

#define RBTTYPE int
#define ordered_set tree<RBTTYPE, null_type, less<RBTTYPE>, rb_tree_tag,tree_order_statistics_node_update> 

#define all(v) (v).begin(),(v).end()

typedef long long ll;
typedef long double ld;
typedef pair< int, int > pii;
typedef pair< ll, ll > pll;

int getInt () {
    bool minus = false;
    int result = 0;
    char ch;
    ch = getchar();
    while (true) {
        if (ch == '-') break;
        if (ch >= '0' && ch <= '9') break;
        ch = getchar();
    }
    if (ch == '-') minus = true; else result = ch-'0';
    while (true) {
        ch = getchar();
        if (ch < '0' || ch > '9') break;
        result = result*10 + (ch - '0');
    }
    if (minus)
        return -result;
    else
        return result;
}


ll gcd(ll x, ll y) {
    if (x < y) return gcd(y, x);
    if (y == 0) return x;
    return gcd(y, x % y);
} 

const ll mod = 1e9 + 7;

ll modexp(ll x, ll ex) {
    ll ans = 1ll;
    while (ex > 0) {
        if (ex & 1ll) ans = (ans * x) % mod;
        ex >>= 1ll;
        x = (x * x) % mod;
    }
    return ans;
}

const int maxn = 1e6 + 7;

const ll inf = 1e9 + 7;


i32 main() {
    //freopen("<file>.in", "r", stdin);
    //freopen("<file>.out", "w", stdout);

    IOS;
    
    int x;
    cin>>x;

    int y = 1;
    int cur = 100;

    int dif, maxi;
    while(cur<=x)
    {
        dif = x - cur;
        maxi = 5*y;
        
        if(dif<=maxi)
        {
            cout<<1<<endl;
            return 0;
        }

        y++;
        cur+=100;
    }

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





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

int main() {
    int N;
    cin >> N;
    vector<int> H(N);
    for (int i = 0; i < N; i++) {
        cin >> H[i];
    }
    int ans = 0;
    int cnt = 0;
    for (int i = 0; i < N-1; i++) {
        if (H[i] >= H[i+1]) {
            cnt += 1;
            if (ans < cnt) ans = cnt;
        }else{
            cnt = 0;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
// vvvvvvvvvvvv TEMPLATE vvvvvvvvvvvv
#include <bits/stdc++.h>
using namespace std; using ll = long long; using P = pair<ll, ll>;
const ll linf = 1e18; const double eps = 1e-12, pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define each(i,a) for (auto&& i : a)
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define eb emplace_back
#define all(a) begin(a),end(a)
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)
#define min(x,y) (x < y ? x : y)
#define max(x,y) (x < y ? y : x)
template<typename Head> void out(Head h) { cout << h << endl; } template<typename Head, typename... Tail>void out(Head h, Tail... t) { cout << h << " "; out(t...); }
template<typename T> istream& operator>>(istream& is, vector<T>& v) { each(x,v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) { rep(i,v.size()) { if (i) os << " "; os << v[i]; } return os; }
template<typename T> ostream& operator<<(ostream& os, const vector<string>& v) { rep(i,v.size()) { if (i) os << endl; os << v[i]; } return os; }
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) { rep(i,v.size()) { if (i) os << endl; os << v[i]; } return os; }
struct yes_no : std::numpunct<char> { string_type do_truename() const { return "Yes"; } string_type do_falsename() const { return "No"; } };
void solve(); int main() {
  ios::sync_with_stdio(false); cin.tie(0); locale loc(locale(), new yes_no); cout.imbue(loc); cout << fixed << setprecision(10) << boolalpha;
  solve();
}
// ^^^^^^^^^^^^ TEMPLATE ^^^^^^^^^^^^

void solve() {
  ll n, m; cin >> n >> m;
  vector<ll> a(n), b(m); cin >> a >> b;
  set<ll> s(all(b));
  vector<ll> ans1, ans2 = b;
  each(x, a) {
    if (s.count(x)) {
      ans1.pb(x);
    }
    else {
      ans2.pb(x);
    }
  }
  sort(all(ans1));
  sort(all(ans2));
  cout << ans1.size() << " " << ans2.size() << endl;
  each(x, ans1) cout << x << endl;
  each(x, ans2) cout << x << endl;
}



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

int main()
{
  string s;
  int ans = 0;
  cin >> s;
  for (int i = 0; i < 4; i++)
  {
    if (s[i] == '+')
      ans++;
    else
      ans--;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    char ch[200001];
    int i=0;
    long long int ans=0;

    scanf("%s",ch);

    while(ch[i] != '\0' ){
        ans += ((long long int)ch[i] - '0');
        i++;
    }

    if(ans % 9 == 0){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 1760
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
  ll n,sum=0;
  cin>>n;
  for(ll i =1;i<=n;i++)
  {
    sum=sum+(i*(n/i)*(n/i+1))/2;
  }
  cout<<sum<<endl;
}

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

int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++) cin >> a[i];
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
    long int x, y;
    bool h = false;
    for (int i = 1; i < N; i++) {
        if (a[i] != a[i-1]) continue;
        if (!h) {
            x = a[i];
            h = true;
            i++;}
        else {
            y = a[i];
            cout << x * y << endl;
            return 0;
        }
    }
    cout << "0\n";
}


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

using namespace std;

int main(void)
{
    int n, m;
    cin >> n >> m;
    vector<int> dp(m, 0);
    for (int i = 0; i < (int)n; i++) {
	int k, a;
	cin >> k;
	for (int j = 0; j < (int)k; j++) {
	    cin >> a;
	    a--;
	    dp[a]++;
	}
    }
    int c = 0;
    for (int i = 0; i < m; i++) if (dp[i] == n) c++;
    cout << c << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define for_int(i,a,b) for(int i=(a);i<=(b);++i)
#define rep_int(i,a,b) for(int i=(a);i>=(b);--i)
#define for_ll(i,a,b) for(ll i=(a);i<=(b);++i)
#define rep_ll(i,a,b) for(ll i=(a);i>=(b);--i)
#define ull unsigned long long
#define ll long long
#define db double
#define HPMAX 1005
#define KMP_MAX 1005
#define prime_MAX 1e6+5
#define quick_pow_mod 1e9+7
#define PII pair<int,int>
using namespace std;
//快读
int read() {
	char c = getchar();
	int x = 0, f = 1;
	for (; !isdigit(c); c = getchar())
		if (c == '-')
			f = -1;
	for (; isdigit(c); c = getchar())
		x = x * 10 + c - 48;
	return x * f;
}
int n;
const int N = 1e7 + 5;
int prime[N] ;  //素数表，存储找到的素数
int f[N];      //f[i]表示数字i的因数的个数
int cnt[N];    //cnt[i]表示数字i 最小质因数的幂次

void init() {
    for (int i = 2; i <= n; i++) {
        if (!prime[i]) {                //若数字i是素数
            prime[++prime[0]] = i;      //存放在prime数组中
            f[i] = 2;                   //素数的因数只有1和本身,所以f[i] = 2
            cnt[i] = 1;                 //i = 1 * i，所以最小质因数的幂次为1
        }
        for (int j = 1; j <= prime[0]; j++) {  //遍历之前找到的素数，若prime[j] 小于数字i的最小质因数，则我们标记prime[i * prime[j]] = 1
            if (i * prime[j] >n) break;  //我们只要在2到max_n范围内的素数，若超过max_n，此时直接跳出
            prime[i * prime[j]] = 1;
            if (i % prime[j] == 0) {
                //这部分解释见下文
                f[i * prime[j]] = f[i] / (cnt[i] + 1) * (cnt[i] + 2);
                cnt[i * prime[j]] = cnt[i] + 1;
                break;
            }
            else {  //prime[j]是素数，因此i和prime[j]的因数最多是1和prime[j]，又i % prime[j] != 0，所以i和prime[j]互素
                f[i * prime[j]] = f[i] * f[prime[j]];
                //两元素互素，因此他们的因数除1外没有交集，所以i * prime[j]的因数个数 = i的因数个数 * prime[j]的因数个数

                cnt[i * prime[j]] = 1;
                //因为从prime数组1号位开始向后遍历素数并且i % prime[j] != 0，所以prime[j]始终小于i的最小质因数，
                //所以i * prime[j]最小质因数的幂次为prime[j]的幂次，即为1
            }
        }
    }
    return;
}

int main() {
	n = read();
    init();
    f[1] = 1;
	ull res = 0;
	for_int(i, 1, n)
		res += (ull)i * f[i];

	cout << res << endl;
	return 0;
}

Measured memory_bytes: 120808
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

         int L = sc.nextInt();
         int R = sc.nextInt();
         int d = sc.nextInt(); 
         int count = 0;

         for(int i=L;i<=R;i++){
            if(i%d==0){
                count++;
            }
         }
      System.out.println(count);
    
    }
}


Measured memory_bytes: 35620
using System;
using System.Linq;

namespace arc099_a
{
    class Program
    {
        static void Main(string[] args)
        {
            var NK = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
            var K = NK[1];
            var al = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
            var N = al.Count();

            if (N <= K)
                Console.WriteLine(1);
            else
            {
                //単純に左右に伸ばした場合
                var i1 = al.IndexOf(1);
                decimal rm = func1(new int[2] { i1, N - i1 - 1 }, K);

                //またいでから伸ばした場合
                for(int i = 1; i <= K - 2; i++) 
                {
                    var lr = new int[2] {i1 - K + 1 + i, N - i1 - 1 - i };
                    var r = func1(lr, K) + 1;
                    if (rm > r) rm = r; 
                }

                Console.WriteLine(rm);

            }

            Console.ReadKey();

        }

        public static decimal func1(int[] lr, int K)
        {
            decimal r = 0;
            for (int i = 0; i <= 1; i++)
                if (lr[i] == 0)
                    continue;
                else if (lr[i] <= K - 1)
                    r += 1;
                else
                    r += Math.Ceiling((decimal)lr[i] / (K - 1));

            return r;
        }
    }
}


Measured memory_bytes: 20960
import numpy as np

N, M = map(int, input().split())
foods = np.zeros(M)
for i in range(N):
    a = list(map(int, input().split()))
    K = a[0]
    a = a[1:]
    for k in range(K):
      foods[a[k]-1] += 1

ans = np.count_nonzero(foods == N)
print(ans)

Measured memory_bytes: 12504
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;


int main() {
    int n;
    cin >> n;
    vector<int> v(n, 0);
    for (int i = 0; i < n; i++) {
    	cin >> v[i];
    }
    sort(v.begin(), v.end());
    cout << v.back() - v[0] << endl;
}


Measured memory_bytes: 3604
program test
implicit none
integer(8) :: n,a(200000),ruiseki(200000)=0,y(200000)=0.,t,x=0,i,j,k,l,combo
read(*,*) n

  read(*,*) (a(i),i=1,n)

ruiseki(1) = a(1)
 
do i=2,n
  ruiseki(i) = ruiseki(i-1) + a(i)
enddo


do i=1,n
  if(ruiseki(i) == 0) then
    x = x+1
  endif
enddo

y = ruiseki
 
l = n/2+1
k = n
do while(k /= 1)
  if(l > 1) then
    l = l-1
    t = y(l)
  else
    t = y(k)
    y(k) = y(1)
    k = k-1
    if(k == 1) then
      y(1) = t
      exit
    endif
  endif
  i = l
  j = l+l
  do while(j <= k)
    if(j < k) then
      if(y(j) < y(j+1)) j = j+1
    endif
    if (t < y(j)) then
      y(i) = y(j)
      i = j
      j = j+j
    else
      j = k+1
    endif
  enddo
  y(i) = t
enddo

combo = 1

do i = 2,n
  if(y(i) == y(i-1)) then
    combo = combo + 1
  else if (combo >= 2) then
    x = x + combo * (combo-1) /2 
    combo = 1
  else
    combo = 1
  endif
enddo

  if (combo >= 2) then
    x = x + combo * (combo-1) /2 
  endif

write(*,*) x


end program

Measured memory_bytes: 5504
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
#define P pair<ll, ll>

/* ---------- Constants  */
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;
// const double PI = acos(-1);
// const double EPS = 1e-10;
// mt19937 mert(LL(time(0)));

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */

signed main() {
    int N, K;
    cin >> N >> K;

    int h[N];
    for (int i = 0; i < N; i++) cin >> h[i];

    sort(h, h + N);

    int ret = INF;

    for (int i = 0; i + K - 1 < N; i++) {
        ret = min(ret, h[i+K-1] - h[i]);
    }

    cout << ret << endl;

    return 0;
}

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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}


typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
//const ll MOD = 1000000007;
const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { -1,0, 1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
// #define mp make_pair
//#define endl '\n'


int main() {
  string s;
  cin >> s;
  int n = s.size();
  int ans = n;
  rep (i, n - 1) {
    if (s[i] != s[i + 1]) {
      chmin(ans, max(i + 1, n - 1 - i));
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 512
n, m = map(int, input().split(" "))
a = set()
for i in range(m):
    a.add(int(input()))

waysFrom = {}
waysFrom[n - 1] = 0 if n - 1 in a else 1
waysFrom[n - 2] = 0 if n - 2 in a else 1 + waysFrom[n - 1]

for i in reversed(range(n - 2)):
    if i in a:
        waysFrom[i] = 0
    else:
        waysFrom[i] = waysFrom[i + 1] + waysFrom[i + 2]
        if waysFrom[i] == 0:
            waysFrom[0] = 0
            break

print(waysFrom[0] % 1000000007)


Measured memory_bytes: 468616
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1001001001;
const int MOD = 1000000007;

template <typename T>
void print(const T &v);

int main()
{
    int n;
    cin >> n;
    vector<P> c(n); // <縦，横>
    for (int i = 0; i < n; i++)
    {
        cin >> c[i].first >> c[i].second;
    }
    vector<int> nx = {0, 1, 2, 3, 4, 5, 6, 7};
    do
    {
        bool flag = true; // 固定されている駒が正しい位置にいるかを判定
        for (int i = 0; i < n && flag; i++)
        {
            int x = c[i].second;
            int y = c[i].first;
            if (nx[x] != y)
            {
                flag = false;
            }
        }
        if (!flag)
        {
            continue;
        }
        // ここより上は合っている
        bool debug = false;
        // if (nx[0] == 1 && nx[1] == 3 && nx[2] == 2 && nx[3] == 5)
        // {
        //     debug = true;
        // }
        vector<vector<int>> grid(8, vector<int>(8, 0));
        // 縦横に被りがないことは担保されている
        int p[4] = {-1, 1, 1, -1}; // x軸方向
        int q[4] = {-1, -1, 1, 1}; // y軸方向
        for (int i = 0; i < 8; i++)
        {
            int x = i;
            int y = nx[i];
            for (int j = 0; j < 4; j++)
            {
                for (int k = 1;; k++)
                {
                    int xx = x + (p[j] * k);
                    int yy = y + (q[j] * k);
                    if (xx < 0 || yy < 0 || xx >= 8 || yy >= 8)
                    {
                        if (debug)
                        {
                            cout << '!' << endl;
                        }
                        break;
                    }
                    if (debug)
                    {
                        cout << xx << ':' << yy << endl;
                    }
                    grid[yy][xx] = 1;
                }
            }
        }
        bool flag2 = true;
        for (int j = 0; j < 8 && flag2; j++)
        {
            if (grid[nx[j]][j] == 1)
            {
                flag2 = false;
            }
        }
        if (flag2)
        {
            for (int j = 0; j < 8; j++)
            {
                for (int k = 0; k < 8; k++)
                {
                    if (nx[k] == j)
                    {
                        cout << 'Q';
                    }
                    else
                    {
                        cout << '.';
                    }
                }
                cout << endl;
            }
            return 0;
        }
    } while (next_permutation(nx.begin(), nx.end()));
    cout << "error" << endl;
    return 0;
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}


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

int main() {
  int N; 
  cin >> N;
  vector<int> L(N);
  int sum = 0;
  for (int i = 0; i < N; i++) {
    cin >> L[i];
    sum += L[i];
  }
  
  int maxLength = *max_element(L.begin(), L.end());

  if (maxLength < sum-maxLength) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
s = list(input())

a = int(s[0] + s[1])
b = int(s[2] + s[3])

if (a > 12 and 1 <= b <= 12) or (a == 0 and 1 <= b <= 12):
    print("YYMM")
elif (1 <= a <= 12 and b > 12) or (1 <= a <= 12 and b == 0): 
    print("MMYY")
elif 1 <= a <= 12 and 1 <= b <= 12:
        print("AMBIGUOUS")
else:
    print("NA")




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

#define rep(i,b) for(long long i = 0; i < (b); i++)
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
using ll = long long;

ll lcm(ll a,ll b){
	
	return (a*b)/(__gcd(a,b));
}

void solve() 
{ 
int n;
cin>>n;
string a,b;
cin>>a>>b;
string out="";
int flag=0;
int i=0;
int j=0;
while(i<=n){
	if(flag==0){
		out=out+a[i];
		i++;
			flag=!flag;
	}
		else{
			out=out+b[j];
			j++;
			flag=!flag;
		}
}
out.resize(2*n);
cout<<out;
}
 

int main(){


		solve();
		cout<<endl;
	
	

					
}
		

	

		

 



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

using namespace std;

typedef long long ll;

const int INF = 1e9;

int cnt = 0;

void merge(vector<int>& A, int left, int mid, int right)
{
  int n1 = mid - left, n2 = right - mid;
  vector<int> L(n1 + 1, INF), R(n2 + 1, INF);
  for (int i = 0; i < n1; ++i) { L[i] = A[left + i]; }
  for (int i = 0; i < n2; ++i) { R[i] = A[mid + i]; }
  int i = 0, j = 0;
  for (int k = left; k < right; ++k) {
    ++cnt;
    if (L[i] <= R[j]) { A[k] = L[i]; ++i; }
    else { A[k] = R[j]; ++j; }
  }
}

void mergeSort(vector<int>& A, int left, int right)
{
  if (right - left > 1) {
    int mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}

int main()
{
  int n = 0;
  fscanf(stdin, "%d", &n);
  vector<int> S(n);
  for (int i = 0; i < n; ++i) {
    fscanf(stdin, "%d", &S[i]);
  }
  mergeSort(S, 0, n);
  for (int i = 0; i < n; ++i) {
    if (i) { fprintf(stdout, " "); }
    fprintf(stdout, "%d", S[i]);
  }
  fprintf(stdout, "\n");
  fprintf(stdout, "%d\n", cnt);
  return 0;
}

Measured memory_bytes: 5060
#include <iostream>
#include <queue>

using namespace std;
#define MAX 1000

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,q,command,t,x;
    priority_queue<int>queue[MAX];
    cin >> n >> q;

    for (int i = 0;i < q;++i) {
        cin >> command >> t;
        switch(command){
                // insert
            case 0:
                cin >> x;
                queue[t].push(x);
                break;
                // get max
            case 1:
                if(!queue[t].empty()){
                    cout << queue[t].top() << endl;
                }
                break;
                // delete max
            case 2:
                if(!queue[t].empty()){
                    queue[t].pop();
                }
                break;
        }
    }
}



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

int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  int p = min(a, min(b, c));
  int j = min(e, d);
  cout << p + j - 50 << endl;
  return 0;
}


Measured memory_bytes: 3084
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)

    var array = arrayOfNulls<Int>(3)

    for (i in array.indices) {
        array[i]= sc.nextInt()
    }

    if (array[0] == array[1]) {
        if (array[0] == array[2]) {
            println(1)
        } else {
            println(2)
        }
    } else if (array[1] == array[2] || array[0] == array[2]) {
        println(2)
    } else {
        println(3)
    }

}

Measured memory_bytes: 33988
#include<stdio.h>
int cnt[100000];
int main()
{
    int n,m,a,b,max=0,j,i;
    scanf("%d%d",&n,&m);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a);
        for(j=0;j<a;j++)
        {
            scanf("%d",&b);
            cnt[b]++;
            if(max<b)max=b;
        }
    }
    int sum=0;
    for(i=0;i<=max;i++)
    {
        if(cnt[i]==n)sum++;
    }
    printf("%d\n",sum);
    return 0;
}


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

#define ull unsigned long long
#define endl '\n'
#define ll int
const int N = 2e5 + 5;
void fs(int &x){
        register int c;
        x = 0;
        while ((c = getchar()) <= 47 || c >= 58);
        for (; (c > 47 && c < 58); c = getchar()){
                x = (x << 3) + (x << 1) + c - 48;
        }
}
ll par[N], sz[N], n, par1[N], sz1[N], ans[N];
map<pair<ll,ll>, bool> fuck;
void init(){
        for (int i = 1; i <= n; i++) {
                par[i] = i;
                sz[i] = 1;
                par1[i] = i;
                sz1[i] = 1;
                ans[i] = 1;
        }
}
ll find_set(ll u){
        if (u == par[u]) return u;
        return par[u] = find_set(par[u]);
}
ll find_set1(ll u){
        if (u == par1[u]) return u;
        return par1[u] = find_set1(par1[u]);
}
void dsu(ll u, ll v){
        u = find_set(u);
        v = find_set(v);
        if (u == v) return;
        if (sz[u] < sz[v]) swap(u, v);
        sz[u] += sz[v];
        par[v] = u;
}
void dsu1(ll u, ll v){
        u = find_set1(u);
        v = find_set1(v);
        if (u == v) return;
        if (sz1[u] < sz1[v]) swap(u, v);
        sz1[u] += sz1[v];
        par1[v] = u;
}
vector<ll> comproad[N], comprail[N];
void tt(ll u, ll v){
        vector<ll> mem;
        int l = 0, r = 0;
        while (l < (int)comproad[u].size() && r < (int)comprail[v].size()){
                if (comproad[u][l] == comprail[v][r]){
                        mem.push_back(comproad[u][l]);
                        l++;
                        r++;
                }
                else if (comproad[u][l] < comprail[v][r]){
                        l++;
                } else {
                        r++;
                }
        }
        for (auto j : mem){
                ans[j] = max(ans[j], (int)mem.size());
        }
}
int main(){
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        //freopen("test.txt", "r", stdin);
        fs(n);
        ll k, l;
        fs(k); fs(l);
        init();
        for (int i = 1; i <= k; i++){
                ll u, v;
                fs(u);fs(v);
                dsu(u, v);
        }
        for (int i = 1; i <= n; i++){
                comproad[find_set(i)].push_back(i);
        }
        for (int i = 1; i <= l; i++){
                ll u, v;
                fs(u); fs(v);
                dsu1(u, v);
        }
        for (int i = 1; i <= n; i++){
                comprail[find_set1(i)].push_back(i);
        }
        for (int i = 1; i <= n; i++){
                if (fuck[{find_set(i), find_set1(i)}] == 0){
                        fuck[{find_set(i), find_set1(i)}] = 1;
                        if (comproad[find_set(i)].size() == 1 || comprail[find_set1(i)].size() == 1) {
                                continue;
                        }
                        tt(find_set(i), find_set1(i));
                }
        }
        for (int i = 1; i <= n; i++) cout << ans[i] << " ";
}


Measured memory_bytes: 36864
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001001001001
#define mod 1000000007
#define mod2 998244353
#define pi acos(-1)
#define all(v) v.begin(),v.end()

int main(){
    int N;cin>>N;
    set<int>s;
    int a;
    bool flag=true;
    rep(i,N){
        cin>>a;
        if(s.count(a)){
            flag=false;
            break;
        }else{
            s.insert(a);
        }
    }
    if(flag){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
}

Measured memory_bytes: 12760
import sys

a, b = map(int, sys.stdin.readline().split())

def main(a, b):
    h = w = 100
    yield '{0} {1}'.format(h, w)

    if a >= b:
        c1 = '.'
        c2 = '#'
    else:
        a, b = b, a
        c1 = '#'
        c2 = '.'

    canvas = [[c2] * w for _ in range(h//2)] + [[c1] * w for _ in range(h//2)]
    a -= 1
    b -= 1

    i = 0
    j = 0
    while a:
        canvas[i][j] = c1
        a -= 1
        j += 2
        if j == 100:
            j = 0
            i += 2
    
    i = 51
    j = 0
    while b:
        canvas[i][j] = c2
        b -= 1
        j += 2
        if j == 100:
            j = 0
            i += 2
        
    for i in range(h):
        yield ''.join(canvas[i])

if __name__ == '__main__':
    ans = main(a, b)
    print(*ans, sep='\n')

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

int main() {
    int H, W, K;
    cin >> H >> W >> K;
    vector<string> S(H);
    for(auto &e : S) cin >> e;
    auto f = [&](auto &&f, int bit, int pos) -> int {
        if(pos < H - 1) return min(f(f, bit, pos + 1), f(f, bit | (1 << pos), pos + 1));
        int res = __builtin_popcount(bit);
        int N = res + 1;
        vector<int> cnt(N);
        for(int j = 0; j < W; ++j) {
            int now = 0, tmp = 0;
            for(int i = 0; i < H; ++i) {
                cnt[now] += S[i][j] == '1';
                tmp += S[i][j] == '1';
                if(tmp > K) return H + W;
                if(bit & (1 << i))
                    now++, tmp = 0;
            }
            if(*max_element(cnt.begin(), cnt.end()) > K)
                res++, j--, cnt.assign(N, 0);
        }
        return res;
    };
    cout << f(f, 0, 0) << '\n';
    return 0;
}


Measured memory_bytes: 256
n,m=map(int,input().split())
data=[1]*n
d=[1]+[0]*(n-1)
for i in range(m):
  x,y=map(int,input().split())
  data[x-1]-=1
  data[y-1]+=1
  if d[x-1]==1:
    d[y-1]=1
  if data[x-1]==0:
    d[x-1]=0
print(d.count(1))

Measured memory_bytes: 11060
n, m = map(int, input().split())
ST = [list(map(int, input().split())) for _ in range(n)]
CP = [list(map(int, input().split())) for _ in range(m)]

for a, b in ST:
    dif, pos = 1e20, 100
    for j, (c, d) in enumerate(CP):
        tmp = abs(a - c) + abs(b - d)
        if dif > tmp:
            dif, pos = tmp, j + 1
    print(pos)

Measured memory_bytes: 9088