akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;

void solve(std::vector<long long> A){
    sort(A.begin(), A.end());
    int ans = abs(A[0] - A[1]) + abs(A[1] - A[2]);
    cout << ans << '\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::vector<long long> A(3);
    for(int i = 0 ; i < 3 ; i++){
        scanf("%lld",&A[i]);
    }
    solve(std::move(A));
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repn(i,a,n) for(int i=a;i<=n;i++)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define ar array
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
const ll mod=1000000007;
ll gcd(ll a,ll b){ return b?gcd(b,a%b):a; }

bool isprime(int n) {
	if(n == 2) return true;
	if(n < 2 || n & 1 ^ 1) return false;

	for(int d = 3; d * d <= n; d += 2)
		if(!(n % d))
			return false;
	return true;
}

int next_prime(int n) {
	for(n++; !isprime(n); n++);
	return n;
}

int main() {
	int x;
	scanf("%d", &x);

	if(isprime(x))
		printf("%d\n", x);
	else 
		printf("%d\n", next_prime(x));
    return 0;
}



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


int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	long long int n, a;
	cin >> n;
	vector<long long int> arr;
	for(long long int i = 0; i < n; i++) {
		cin >> a;
		arr.push_back(a);
	}
	long long int ans = 0;
	long long int sum = arr[n - 1];
	for(long long int i = n - 2; i >= 0; i--) {
		ans += (arr[i] * sum);
		ans %= 1000000007;
		sum += arr[i];
		sum %= 1000000007;
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 5320
#include <iostream>

int main()
{
    int x[10000];
    int y[10000];
    int i = 0;

    while (1){
    std::cin >> x[i] >> y[i];
    if (x[i] == 0 && y[i] == 0)
    {
        break;
    }
    
    if ( x[i] > y[i]){
        int z = x[i];
        x[i] = y[i];
        y[i] = z;
        }
        ++i;
    }
    for (i = 0; !(x[i] == 0 && y[i] == 0); ++i){
    std::cout << x[i] << " " << y[i]<< "\n";
    }

    return 0;
}



Measured memory_bytes: 3136
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//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; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
*/

int main(){
    int N, M; cin >> N >> M;

    vector<pair<int, int>> ba(M);
    for(int i=0; i<M; i++){
        int a, b; cin >> a >> b;
        ba[i] = {b, a};
    }

    sort(ba.begin(), ba.end());
    int ans = 1;
    int tmp = ba[0].first;
    for(int i=1; i<M; i++){
        if(tmp <= ba[i].second){
            ans++;
            tmp = ba[i].first;
        }
    }
    cout << ans << endl;
}

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

#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define MP make_pair
#define test cout<<"test"<<endl;
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
void chmin(ll &a,ll b){if(a>b)a=b;}
void chmax(ll &a,ll b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void ans(bool x,ll y,ll z){if(x)cout<<y<<endl;else cout<<z<<endl;}
void ans(bool x,string y,string z){if(x)cout<<y<<endl;else cout<<z<<endl;}   
void debug(vector<vector<ll>>v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j]<<" ";cout<<endl;}};
ll gcd(ll x,ll y){ll r;while((r=x%y)!=0){x=y;y=r;}return y;}
//m.emplace(x,0).fi->second++;

int main(){
  ll i,j,o;
  ll res=0,res1=INF,res2=-INF,buf=0;
  bool judge = true;
  ll n;cin>>n;
  vector<ll>a(n);
  for(i=0;i<n;i++)cin>>a[i];
  multiset<ll,greater<ll>> s;
  for(i=0;i<n;i++){
    auto itr=s.upper_bound(a[i]);
    if(itr==s.end())s.insert(a[i]);
    else{
      s.erase(itr);
      s.insert(a[i]);
    }
  }
  cout<<s.size()<<endl;
  
  


  return 0;
}

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

using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;

void solve()
{
	string s;
  cin >> s;
  if(s[2] == s[3] && s[4] == s[5])
  {
    cout << "Yes\n";
  }
  else cout <<"No\n";
}

int main()
{
	int t = 1;
	//cin >> t;
	while(t--)
	{
		solve();
	}
	return 0;
}



Measured memory_bytes: 256
#![allow(non_snake_case)]
use proconio::input;
use std::collections::HashMap;
const M: i64 = 1000000007_i64;
fn main() {
    input! {
        n:usize,
        ab:[(i64,i64);n]
    }
    // 鰯(Ai,Bi)と(Aj,Bj)について、Ai*Aj + Bi*Bj =0になる組み合わせは不可。
    // (0,0)の鰯の数を x とすると、これらは一匹のみの場合のみ追加可能。
    // 両辺を Aj * Bi で割ると、Ai/Bi + Bj/Aj = 0となる。
    // 逆数にして -1 をかけた鰯とは組み合わせられないが、他ならOK。
    // 鰯について、既約分数で表現すれば、Ai/Biは一意に定まる。
    let ab: Vec<(i64, i64)> = ab.into_iter().filter(|&(a, b)| a != 0 || b != 0).collect();
    let zero = (n - ab.len()) as i64;
    let ab: Vec<(i64, i64)> = ab
        .into_iter()
        .map(|(a, b)| {
            let g = num::integer::gcd(a, b);
            (a / g, b / g)
        })
        .collect();
    // modPow(2,x)
    let mut mp2 = vec![1i64; n + 1];
    for i in 0..n {
        mp2[i + 1] = mp2[i] * 2 % M;
    }
    let mut group1 = HashMap::new();
    ab.iter().for_each(|&x| {
        let count = group1.entry(x).or_insert(0);
        *count += 1;
    });

    let mut get_pararell = |a: i64, b: i64| {
        let mut res = 0;
        if let Some(v) = group1.get(&(a, b)) {
            res += v;
            group1.remove(&(a, b));
        }
        if let Some(v) = group1.get(&(-a, -b)) {
            res += v;
            group1.remove(&(-a, -b));
        }
        res
    };
    //    println!("{:?}", group1);
    let mut ans = 1;
    for &(a, b) in &ab {
        let pararells = get_pararell(a, b);
        let crosses = get_pararell(b, -a);
        // println!("({},{}), p:{}, c:{}", a, b, pararells, crosses);
        ans = ans * ((mp2[pararells] + mp2[crosses] - 1) % M) % M;
    }
    ans = (ans + zero - 1) % M;
    ans = (ans % M + M) % M;
    println!("{}", ans);
}

// また、bの符号に一致する様に計算する。

//fn yakubun(a: i64, b: i64) -> (i64, i64) {
//    if b == 0 {
//        return (-1, 0);
//    }
//    if a == 0 {
//        return (0, 1);
//    }
//    let x = if b > 0 { gcd(a, b) } else { -gcd(a, b) };
//    return (a / x, b / x);
//}
//
//fn modPow(x: i64, a: i64, mp2: &Vec<i64>) -> i64 {
//    if x == 2 && (a as usize) < mp2.len() {
//        return mp2[a as usize];
//    }
//    if a == 1 {
//        x
//    } else {
//        if a % 2 != 0 {
//            (modPow(x, a - 1, &mp2) * x) % M
//        } else {
//            let t = modPow(x, a / 2, &mp2);
//            t * t % M
//        }
//    }
//}
////fn modInv(x: i64) -> i64 {
////    modPow(x, M - 2)
//}


Measured memory_bytes: 26992
#include <bits/stdc++.h>
#include<math.h>
#include<queue>
#include<cstdio>
#include<set>
#include<map>
using namespace std;
using ll = long long;

int main(){
    int N,X,T;
    cin >> N >> X >> T;
    int a=N/X;
    if(N%X!=0) a=a+1;
    cout << a*T << endl;
    return 0;
}

Measured memory_bytes: 3592
#include <cstdio>
using namespace std;

int main() {
  int n;
  char s[110], t[110];
  scanf("%d", &n);
  scanf("%s", s);
  scanf("%s", t);
  for (int i = 0; i < n; i++) {
    printf("%c%c", s[i], t[i]);
  }
  printf("\n");
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    long long int n,k,q;
    std::cin >> n >>k >>q;
    long long int a[100001];
    
    for (int i = 1; i <= n; i++) {
        a[i]=0;
    }
    for (int i = 0; i < q; i++) {
        int t;
        std::cin >> t;
        a[t]++;
    }
    
    for (int i = 0; i < n; i++) {
        if(a[i+1]+k-q>0){
            std::cout << "Yes" << std::endl;
        }else{
            std::cout << "No" << std::endl;
        }
    }
    
    
    
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
#define rep(i, N) for(int i=0; i<(N); i++)
#define reps(i, N) for(int i=1; i<=(N); i++)
#define rrep(i, N) for(int i=(N)-1; i>=0; i--)
#define rreps(i, N) for(int i=(N); i>=1; i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
template<class T>bool amax(T &a, const T &b) { if (a<b) {a=b; return true;} return false; }
template<class T>bool amin(T &a, const T &b) { if (a>b) {a=b; return true;} return false; }
using ll = long long;
using namespace std;
constexpr int inf = 1e9;
constexpr int mod = 1e9+7;
ll gcd(ll a, ll b) { return b? gcd(b, a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a, b)*b;}

ll a, b, c, d;

ll nndiv(ll x) {
    return x - x/c - x/d + x/lcm(c, d);
}

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

    cin >> a >> b >> c >> d;
    ll ans = nndiv(b) - nndiv(a - 1);
    cout << ans << endl;
    return 0;
}


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

#define LL long long
#define LD long double
#define SC(t,x) static_cast<t>(x)
#define AR(t) vector < t >
#define PII pair < int, int >
#define PLL pair < LL, LL >
#define PIL pair < int, LL >
#define PLI pair < LL, int >
#define MP make_pair
#define PB push_back
#define PF push_front
#define POB pop_back
#define POF pop_front
#define PRF first
#define PRS second
#define INIT(ar,val) memset ( ar, val, sizeof ( ar ) )
#define lp(loop,start,end) for ( int loop = start; loop < end; ++loop )
#define lpd(loop,start,end) for ( int loop = start; loop > end; --loop )
#define lpi(loop,start,end) for ( int loop = start; loop <= end; ++loop )
#define lpdi(loop,start,end) for ( int loop = start; loop >= end; --loop )
#define qmax(a,b) (((a)>(b))?(a):(b))
#define qmin(a,b) (((a)<(b))?(a):(b))
#define qabs(a) (((a)>=0)?(a):(-(a)))

const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 507;

int n;
char g[MAXN][MAXN];
bool a[MAXN][MAXN];
bool okr[MAXN], okc[MAXN];
//bool na[MAXN][MAXN];

void init ();
void input ();
void work ();

int check ( int r, int c );



int main()
{
	init();
	input();
	work();
}



void init ()
{
	// Init Everything Here
	
	ios::sync_with_stdio ( false );
}

void input ()
{
	// input method

	scanf ( "%d", &n );
	lpi ( i, 1, n ) scanf ( "%s", g[i]+1 );
}

void work ()
{
	// main work

	lpi ( i, 1, n ) lpi ( j, 1, n ) a[i][j] = ( g[i][j] == '#' );

	bool empty = true;
	lpi ( i, 1, n ) lpi ( j, 1, n ) if ( a[i][j] ) empty = false;
	if ( empty ){
		printf ( "-1\n" );
		return;
	}

	int nc = 0;
	lpi ( i, 1, n ){
		okc[i] = true;
		lpi ( j, 1, n ){
			if ( !a[j][i] ){
				okc[i] = false;
				break;
			}
		}
		if ( !okc[i] ) ++nc;
	}
	lpi ( i, 1, n ){
		okr[i] = true;
		lpi ( j, 1, n ){
			if ( !a[i][j] ){
				okr[i] = false;
				break;
			}
		}

		if ( okr[i] ){
			int ans = 0;
			lpi ( j, 1, n ){
				ans += !okc[j];
			}
			printf ( "%d\n", ans );
			return;
		}
	}

	int mini = INF, now;
	lpi ( i, 1, n ){
//		if ( okr[i] ){
//			now = check ( i, i );
//			mini = qmin ( mini, now );
//		}
		lpi ( j, 1, n ){
			if ( a[j][i] ){
				now = check ( i, j );
				mini = qmin ( mini, now );
			}else{
				now = check ( i, j );
				mini = qmin ( mini, now+1 );
			}
		}
	}

/*	int mini = INF, cc;
	lpi ( i, 1, n ){
		cc = 0;
		lpi ( j, 1, n ) if ( !a[i][j] ) ++cc;
		mini = qmin ( mini, cc+nc );
	}*/

	printf ( "%d\n", mini );
}



int check ( int r, int c )
{
	int need = 0;
	lpi ( i, 1, n ) need += !a[r][i];

	lpi ( i, 1, n ){
//		if ( okc[i] ) continue;
		if ( !a[r][i] ) need += !okr[c];
		else need += !okc[i];
	}

	return need;
}

Measured memory_bytes: 768
import java.io.IOException; 
import java.io.InputStream; 
import java.io.PrintWriter; 

class Main{ 

	static void solve(){ 
		String s = ns();
		int w = ni();
		StringBuilder sb = new StringBuilder();
		for(int i=0;i<s.length();i+=w)sb.append(s.charAt(i));
		out.println(sb.toString());
	} 
 
 
 
 
	public static void main(String[] args){ 
		 solve(); 
		 out.flush(); 
	 } 
	 private static InputStream in = System.in; 
	 private static PrintWriter out = new PrintWriter(System.out); 
 
	 private static final byte[] buffer = new byte[1<<15]; 
	 private static int ptr = 0; 
	 private static int buflen = 0; 
	 private static boolean hasNextByte(){ 
		 if(ptr<buflen)return true; 
		 ptr = 0; 
		 try{ 
			 buflen = in.read(buffer); 
		 } catch (IOException e){ 
			 e.printStackTrace(); 
		 } 
		 return buflen>0; 
	 } 
	 private static int readByte(){ if(hasNextByte()) return buffer[ptr++]; else return -1;} 
	 private static boolean isSpaceChar(int c){ return !(33<=c && c<=126);} 
	 private static int skip(){int res; while((res=readByte())!=-1 && isSpaceChar(res)); return res;} 
 
	 private static double nd(){ return Double.parseDouble(ns()); } 
	 private static char nc(){ return (char)skip(); } 
	 private static String ns(){ 
		 StringBuilder sb = new StringBuilder(); 
		 for(int b=skip();!isSpaceChar(b);b=readByte())sb.append((char)b); 
		 return sb.toString(); 
	 } 
	 private static int[] nia(int n){ 
		 int[] res = new int[n]; 
		 for(int i=0;i<n;++i)res[i]=ni(); 
		 return res; 
	 } 
	 private static long[] nla(int n){ 
		 long[] res = new long[n]; 
		 for(int i=0;i<n;++i)res[i]=nl(); 
		 return res; 
	 } 
	 private static int ni(){ 
		 int res=0,b; 
		 boolean minus=false; 
		 while((b=readByte())!=-1 && !((b>='0'&&b<='9') || b=='-')); 
		 if(b=='-'){ 
			 minus=true; 
			 b=readByte(); 
		 } 
		 for(;'0'<=b&&b<='9';b=readByte())res=res*10+(b-'0'); 
		 return minus ? -res:res; 
	 } 
	 private static long nl(){ 
		 long res=0,b; 
		 boolean minus=false; 
		 while((b=readByte())!=-1 && !((b>='0'&&b<='9') || b=='-')); 
		 if(b=='-'){ 
			 minus=true; 
			 b=readByte(); 
		 } 
		 for(;'0'<=b&&b<='9';b=readByte())res=res*10+(b-'0'); 
		 return minus ? -res:res; 
	} 
} 



Measured memory_bytes: 23124
#include <iostream>

using namespace std;

int main()
{

    int a;
    int b;
    cin >> a;
    cin >>b;
    if (b%2==0){
            if(a>=13){
    cout << b<< endl;
   } else if (a<13 & a>=6) {
       
        b=b/2;
        cout<<b<<endl;
        
    }else {
        cout<<"0"<<endl;
    }}
    else{
        cout<<"error"<< endl;
    }




return 0;
}


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

int main() {
    ll n, k;
    cin >> n >> k;
    const ll m = n*(n+1)/2;

    vl a(n);
    rep(i, n) {
        cin >> a[i];
    }

    vl rui(n+1);
    rep(i, n) {
        rui[i+1] = rui[i] + a[i];
    }

    vl v;
    rep(i, n) {
        exrep(j, i+1, n) {
            v.pb(rui[j] - rui[i]);
        }
    }

    ll ans = 0;
    vl dame(m);
    for(ll d = 60; d >= 0; d--) {
        ll cnt = 0;
        rep(i, m) {
            if(dame[i]) {
                continue;
            }
            if(v[i] & (1LL<<d)) {
                cnt++;
            }
        }
        if(cnt >= k) {
            ans += (1LL<<d);
            rep(i, m) {
                if(!(v[i] & (1LL<<d))) {
                    dame[i] = 1;
                }
            }
        }
    }

    out(ans);
    re0;
}

Measured memory_bytes: 8176
n = int(input())

ans = 'No'  #初期値 

i = 1
j = 1
for i in range(10):
    for j in range(10):
        if n == i * j:
            ans = 'Yes'
            print(ans)
            exit()
    j = j +1
i = i + 1

print(ans)

Measured memory_bytes: 38384
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string T = Console.ReadLine();
            string P = Console.ReadLine();

            StringBuilder sb = new StringBuilder();

            int index = T.IndexOf(P);

            while (index != -1)
            {
                sb.AppendLine(index.ToString());

                index = T.IndexOf(P, index + 1);
            }
            Console.Write(sb);
        }
    }
}

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

typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector <ll> vi;
typedef vector <pi> vpi;
#define f first
#define s second
#define FOR(i,s,e) for(ll i=s;i<=ll(e);++i)
#define DEC(i,s,e) for(ll i=s;i>=ll(e);--i)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
#define aFOR(i,x) for (auto i: x)
#define mem(x,i) memset(x,i,sizeof x)
#define fast ios_base::sync_with_stdio(false),cin.tie(0)
#define maxn 1001
#define int ll
#define INF (ll)1e9
int N;
int A[maxn];

int32_t main(){
	fast;

	
	cin>>N;
	
	FOR(i,0,N-1){
		cin>>A[i];
	}
	vi an[2];
	int num[2];
	int res = 0;
	FOR(par,0,1){
		res = 0;
		FOR(i,0,N-1){
			if (i % 2 != par) continue;
			if (A[i] < 0) continue;
			an[par].pb(i);
			res += A[i];
		}
		num[par] = res;
	}
	
	vi ans;

	if (num[0] > num[1]){
		res = num[0];
		ans = an[0];
	}else{
		res = num[1];
		ans = an[1];
	}
	
	if (ans.empty()){
		
		int lans = A[0],idx = 0;
		
		FOR(i,1,N-1){
			if (lans < A[i]) lans = A[i], idx = i;
		}
		
		cout<<lans<<'\n'<<N-1<<'\n';
		FOR(i,0,idx-1) cout<<"1\n";
		int sz = N - idx - 1;
		
		DEC(i,sz,1) cout<<i + 1<<'\n';
		
		
		
		return 0;
	}
	
	cout<<res<<'\n';
	
	vi moves;
	int prev = 0;
	
	FOR(i,0,ans[0] - 1){
		moves.pb(0); //0-indexed
		prev++;
	}
	
	FOR(i,0,ans.size() - 2){
		int mid = (ans[i + 1] - prev + ans[i] - prev) / 2;
		//cout<<mid<<'\n';
		DEC(j,mid,ans[i] + 1 - prev) moves.pb(j);
		prev += ans[i+1] - ans[i];
	}
	

	int sz = N - ans.back() - 1;

	DEC(i,sz,1) moves.pb(i);
		
	cout<<moves.size()<<'\n';
	aFOR(i,moves) cout<<i + 1<<'\n';
	
	
	
		
		
		
	
	
}

				




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int v[10];
int main() {
	int n,k;
	scanf("%d %d",&n,&k);
	for (int i=0;i<k;i++) {
		int x;
		scanf("%d",&x);
		v[x] = true;
	}
	for (int i=n;i<=99999;i++) {
		int t = i;
		bool ok = true;
		while (t > 0) {
			if (v[t % 10]) ok = false;
			t /= 10;
		}
		if (ok) {
			printf("%d",i);
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define ph push
#define ptc putchar
#define enter putchar('\n')
#define mod 998244353
using namespace std;
typedef pair<int,int> pii;
typedef double db;
typedef long double ldb;
typedef long long ll;
typedef long long lnt;
inline int read(){
	int x = 0;char c = getchar();
	while (!isdigit(c)) c = getchar();
	while (isdigit(c)) x = (x << 1) + (x << 3) + c - '0' , c = getchar();
	return x;
}
inline void write(int x){
	if (!x){
       ptc('0');
       return;
	}
	int dg[20] , len = 0;
	while (x) dg[len++] = x % 10 , x /= 10;
	while (len--) ptc(dg[len]+'0');
}
inline void writeln(int x){
	write(x);
	ptc('\n');
}
inline int add(int x,int y){
	x += y;if (x >= mod) x -= mod;
	return x;
}
inline int sub(int x,int y){
	x -= y;if (x < 0) x += mod;
	return x;
}
inline int qpow(int x,int y){
	int res = 1;
	while (y){
		if (y & 1) res = 1ll * res * x % mod;
		x = 1ll * x * x % mod;y >>= 1;
	}
	return res;
}

const int N = 2e5 + 10;

vector <int> G[N];
set<pii> s;
int n , m , col[N] , d[N][2] , typ[N] , died[N];
char t[N];
int main(){
	scanf("%d%d",&n,&m);
	scanf("%s",t + 1);
	for (int i = 1;i <= n;i++){
		col[i] = t[i] - 'A';
	}
	for (int i = 1;i <= m;i++){
		int u , v;scanf("%d%d",&u,&v);
		G[u].pb(v);G[v].pb(u);
		d[u][col[v]]++;
		d[v][col[u]]++;
	}
	
	for (int i = 1;i <= n;i++){
		typ[i] = (d[i][0] ? 1 : 0) + (d[i][1] ? 2 : 0);
		s.insert(mp(typ[i] , i));
	}
	
	while (s.size() && (*s.begin()).first != 3){
		pii cur = *s.begin();s.erase(s.begin());
		died[cur.second] = 1;
		
		for (int u : G[cur.second]){
			if (!died[u]){
				d[u][col[cur.second]]--;
				if (!d[u][col[cur.second]]){
					s.erase(s.find(mp(typ[u] , u)));
					typ[u] -= 1 << col[cur.second];
				
					s.insert(mp(typ[u] , u));
				}
				
			}
		}
	}
	for (int i = 1;i <= n;i++) if (!died[i]) return puts("Yes") , 0;
	puts("No");
	return 0;
}


Measured memory_bytes: 23168
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM = 1000000000;
#define mod = MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int main(){
    int n,k; cin >> n >> k;
    if(n >= 2*k-1) cout << "YES" << endl;
    else cout << "NO" << endl;
}

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

#define int long long

#define x first
#define y second
#define pb push_back
#define mp make_pair

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

const int M = 1e9 + 7;
const int N = 5e5 + 7;

int f[N];

int pw(int a, int n) {
    int b = 1;
    while (n > 0) {
        if (n & 1) b = b * a % M;
        a = a * a % M;
        n /= 2;
    }
    return b;
}

int cnk(int n, int k) {
    return f[n] * pw(f[k], M - 2) % M * pw(f[n - k], M - 2) % M;
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    f[0] = 1;
    for (int i = 1; i < N; i++) f[i] = f[i - 1] * i % M;
    int n, m;
    cin >> n >> m;
    int ans = cnk(m, n) * f[n] % M * cnk(m, n) % M * f[n] % M;
    ans %= M;
    int bad = 0;
    for (int i = 1; i <= n; i++) {
        int ways = cnk(n, i);
        ways *= cnk(m, i);
        ways %= M;
        ways *= f[i];
        ways %= M;
        ways *= cnk(m - i, n - i);
        ways %= M;
        ways *= f[n - i];
        ways %= M;
        ways *= cnk(m - i, n - i);
        ways %= M;
        ways *= f[n - i];
        ways %= M;
        if (i & 1) {
            bad += ways;
            if (bad >= M) bad -= M;
        } else {
            bad -= ways;
            if (bad < 0) bad += M;
        }
    }
    ans -= bad;
    if (ans < 0) ans += M;
    cout << ans;
    return 0;
}


Measured memory_bytes: 7452
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] d = new int[n];
		for(int i=0; i<n; i++){
			d[i] = sc.nextInt();
		}
		Arrays.sort(d);
		int dan = 1;
		for(int i=0; i<n-1; i++){
			if(d[i]<d[i+1])dan++;
		}
		System.out.println(dan);
	}
}

Measured memory_bytes: 23892
def main():
    N=int(input())
    p_list=[int(input()) for i in range(N)]

    most_price = 0
    most_index = 0
    for i in range(len(p_list)):
        if p_list[i] > most_price:
            most_index = i
            most_price = p_list[i]
    
    result_price = 0
    for i in range(len(p_list)):
        if i == most_index:
            result_price = result_price + round(p_list[i]/2)
        else:
            result_price = result_price + p_list[i]

    print(result_price)

if __name__ == "__main__":
    main()

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

// boost
#include <boost/multiprecision/cpp_int.hpp>
using boost::multiprecision::cpp_int;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;
using vld = vector<ld>;
using vvld = vector<vld>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

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

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T& a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T& a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
// #define mod (998244353ll)

const long long INF = 1LL << 60;

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  ll n;
  cin >> n;

  multiset<ll> a;
  rep(i, n) {
    ll tmp;
    cin >> tmp;
    a.insert(tmp);
  }

  ll ans = 0;

  while (a.size() >= 2) {
    ll mx = *a.rbegin();
    ll p2 = 2;
    while (p2 <= mx)
      p2 *= 2;
    if (p2 == mx - p2) {
      a.erase(a.lower_bound(mx));
      auto itr = a.lower_bound(mx);
      if (itr != a.end()) {
        a.erase(itr);
        ans++;
      }
    } else {
      a.erase(a.lower_bound(mx));
      auto itr = a.lower_bound(p2 - mx);
      if (*itr == p2 - mx) {
        ans++;
        a.erase(itr);
      }
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 12976
#include<bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
using namespace std;
const ll N = 1e6 + 5;
const ll maxn = 5005;
ll m, n, t, T, k, a[N], b[N];
string s, ss;
struct dang
{
    ll pos, val, mn, mx, vtri;
};
bool so(const dang& x, const dang& y)
{
    return (x.val < y.val) || (x.val == y.val && x.pos < y.pos);
}
void sol()
{
    cin >> n;
    if(n >= 30)
    cout << "Yes";
    else cout << "No";
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cin >> T; while(T -- > 0)
    sol();
}


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

using namespace std;
using ll = long long;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << #x << ": " << x << endl;
#define popcnt __builtin_popcount


int main() {
    int N;
    cin >> N;
    vector<int> a(N);
    for(int i = 0; i < N; i++)
    {
        cin >> a[i];
    }

    sort(all(a));
    cout << a[N - 1] - a[0] << endl;

    return 0;
}

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

using namespace std;

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

#define pi 3.14159265358979

bool p(int x){
	if(x==1)  return false;
	else{
		for(int i=1;i*i<=x;i++){
		if(i!=1 && x%i==0){ return false; break;}
	}
		return true;
	}
}

int main(void){

	int n;
	vector<int>a,b;
	while(cin >> n){
	rep(i,n){
		a.push_back(i+1);
	    b.push_back(n-i);
	}

	int c=0;
	rep(i,n)
	if(p(a[i]) && p(b[i])) c++;

	cout << c << endl;

	a.clear(); b.clear();

	}

	return 0;
}

Measured memory_bytes: 1344
#!/usr/bin/env python3

from collections import defaultdict
from heapq import heappush, heappop
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = 10 ** 9 + 1  # sys.maxsize # float("inf")


def debug(*x):
    print(*x)


def solve(N, W, WV):
    "void()"
    values = [0] * (W + 1)
    for i in range(N):
        next_values = values[:]
        weight, value = WV[i]
        for j in range(W - weight + 1):
            next_values[j + weight] = max(
                values[j + weight],
                values[j] + value)
        values = next_values
    return max(values)


T1 = """
3 8
3 30
4 50
5 60
"""


def main():
    N, W = map(int, input().split())
    WV = [
        list(map(int, input().split()))
        for i in range(N)
    ]
    print(solve(N, W, WV))


def _test():
    """
    >>> as_input(T1)
    >>> main()
    90
    """
    import doctest
    doctest.testmod()


def as_input(s):
    "use in test, use given string as input file"
    import io
    global read, input
    f = io.StringIO(s.strip())
    input = f.readline
    read = f.read


USE_NUMBA = False
if (USE_NUMBA and sys.argv[-1] == 'ONLINE_JUDGE') or sys.argv[-1] == '-c':
    print("compiling")
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', solve.__doc__.strip().split()[0])(solve)
    cc.compile()
    exit()
else:
    input = sys.stdin.buffer.readline
    read = sys.stdin.buffer.read

    if (USE_NUMBA and sys.argv[-1] != '-p') or sys.argv[-1] == "--numba":
        # -p: pure python mode
        # if not -p, import compiled module
        from my_module import solve  # pylint: disable=all
    elif sys.argv[-1] == "-t":
        _test()
        sys.exit()
    elif sys.argv[-1] != '-p' and len(sys.argv) == 2:
        # input given as file
        input_as_file = open(sys.argv[1])
        input = input_as_file.buffer.readline
        read = input_as_file.buffer.read

    main()


Measured memory_bytes: 147964
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define f(k,n) for(auto i =k; i<n; i++)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie();
#define test ll t; cin>>t;

int main(){
    IOS
    int n , m , s,c; 
    cin>>n>>m;
    vector<int> num(n,-1);
    while(m--){
        cin>>s>>c;
        if (num[--s] != -1 && num[s] != c || n > 1 && !s && !c) {
        cout << -1 << '\n';
        return 0;
        }
        num[s] = c;
        }
       for (int i = 0; i < n; ++i){
          if(num[i] == -1) cout<<(n>1 && !i);
          else{
              cout<<num[i];
          }
       }
    return 0 ;
}


Measured memory_bytes: 384
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Jaynil
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ATheNumberOfEvenPairs solver = new ATheNumberOfEvenPairs();
        solver.solve(1, in, out);
        out.close();
    }

    static class ATheNumberOfEvenPairs {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int m = in.nextInt();
            long ans = (n * (n - 1)) / 2;
            ans += (m * (m - 1)) / 2;
            out.println(ans);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }
}



Measured memory_bytes: 22740
#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<x<<endl
using namespace std;
using ll = long long;
const ll MOD = 1e9+7;
const ll LINF = LLONG_MAX;
const int INF = INT_MAX;
const double PI=acos(-1);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
	string s; cin>>s;
	if(s=="SSS") cout<<0<<endl;
	if(s=="RSS" or s=="SRS" or s=="SSR" or s=="RSR") cout<<1<<endl;
	if(s=="RRS" or s=="SRR") cout<<2<<endl;
	if(s=="RRR") cout<<3<<endl;
}

Measured memory_bytes: 3620
#pragma comment (linker, "/STACK:526000000")
#define  _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-11L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL

#define MOD 998244353LL
#define seg_size 262144
#define pb push_back
#define mp make_pair
typedef long long ll;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

void init() {
	iostream::sync_with_stdio(false);
	cout << fixed << setprecision(100);
}

void solve(){
	int n;
	cin >> n;
	set<int> go;
	REP(i, n) {
		int a;
		cin >> a;
		if (go.find(a) != go.end()) {
			cout << "NO" << endl;
			return;
		}
		go.insert(a);
	}
	cout << "YES" << endl;
}

int main() {
	init();
	solve();
}

Measured memory_bytes: 9600
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
int main() {
    int a, b; cin >> a >> b;
    int h[1000] = {0};
    rrep(i, 1, 1000) {
        h[i] = h[i - 1];
        h[i] += i;
    }
    //cout << h[b - a] << endl;
    cout << h[b - a] - b << endl;
}


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

int main()
{
  long N;
  cin >> N;
  long a[N];
  unordered_map<int,int> mp;
  for (int i = 0; i < N; i++)
    cin >> a[i];
  
  for (int i = 0; i < N; i++) {
    auto itr = mp.find(a[i]);
    if (itr != mp.end()) {
      mp[a[i]] += 1;
    } else {
      mp[a[i]] = 1;
    }
  }
//  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
//    cout << itr->first << ": " << itr->second << endl;
//  }
  int num = 0;
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    if (itr->first != itr->second) {
      if (itr->first > itr->second) {
        num += itr->second;
      } else {
        num += itr->second - itr->first;
      }
    }
  }
  cout << num << endl;


}


Measured memory_bytes: 5028
n = int(input())
b = list(map(int,input().split()))
b.append(b[-1])
ans = [0] * n
ans[0] = b[0]
for i in range(1,n):
    if(i == n-1):
        continue
    ans[i] = min(b[i-1], b[i])
ans[n-1] = b[n-1]
print(sum(ans))

Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int main(){

	int H,W,j,i;
	for(;;){
		int x=0;
		cin>>H>>W;
		if(H==0 && W==0){
			break;
		}
		for(j=1;j<=H;j++){
			for(i=1;i<=W;i++){
				if((j/2*2!=j && i/2*2!=i)||(j/2*2==j && i/2*2==i)){
					cout<<"#";
				}else{
					cout<<".";
				}
			}
			cout<<endl;
		}
		cout<<endl;
	}
	return 0;

}

Measured memory_bytes: 1152
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <map>
const int MOD = 1e9+7;
using namespace std;


int main(){
	int n, ans = 0;
	string s;
	cin >> n >> s;
	for (int i = 0; i < s.length()-2; i++){
		if (s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C'){
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
 
#define lli long long int
#define endl "\n"
 
using namespace std;
 
typedef long long int LLI;
typedef double DB;
 
void fastio()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
}
 
 
bool comparator(pair<lli,lli> a,pair<lli,lli> b)
{
    if(a.first>b.first)
        return true;
    else if (a.first==b.second)
    {
        if(a.second>=b.second)
            return false;
        return true;
    }
    return false;
}
 
int mods(int x)
{
    if(x>0)
        return x;
    return -x;
}
 
lli gcd(lli a,lli b)
{
    return __gcd(a,b);
}
 
lli lcm(lli x,lli y,lli z)
{
    lli j=gcd(x,y);
    lli k=gcd(y*x/j,z);
    return (((x*y)/j)*z)/k;
} 

int arr[3][3];
bool vis[3][3]={0};

int main()
{
    fastio();
    int n; cin>>n;
    int k=1;
    for(;;)
    {
        k<<=1;
        if(k>n) {cout<<k/2; return 0;}
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define ll long long
#define ull unsigned long long
#define dd double
#define oo 1001007000
#define ff float
#define ooo 1000000100000000000
#define iii pair<ll,ll>
#define vii vector<ll>
#define viii vector<iii>
#define sss pair<str,str>
#define str string
#define sii set<ll>
#define siii set<iii>
#define st size_t
#define r0 return 0
#define pb push_back
#define sz size
using namespace std;

const char E='\n';
const int N=6005;
const int NN=1000000;
const ll md=998244353;

ll gcd(ll a,ll b){
    while (a>0 && b>0){
        if (a>b)a%=b;else b%=a;
    }
    return a+b;
}

int main(){
    cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
    ll n;
    cin >> n;
    str s;
    cin >> s;
    int a[N]={0};
    for (int i=1;i<=n;i++){
        if (s[i-1]=='R')a[i]=1;
        if (s[i-1]=='G')a[i]=2;
        if (s[i-1]=='B')a[i]=3;
    }
    int kl[4][N]={0};
    for (int i=n;i>=1;i--){
        kl[1][i]=kl[1][i+1];
        kl[2][i]=kl[2][i+1];
        kl[3][i]=kl[3][i+1];
        kl[a[i]][i]++;
    }
    ll ans=0;
    for (int i=1;i<=n;i++){
        for (int j=i+1;j<=n;j++){
            if (a[i]!=a[j]){
                ans+=kl[6-a[i]-a[j]][j];
                if (a[j+(j-i)]==6-a[i]-a[j]){
                    ans--;
                }
            }
        }
    }
    cout << ans << E;
    r0;
}
/*














*/


Measured memory_bytes: 3784
n,m=map(int,input().split())
x = list(map(int,input().split()))

x = x[::-1]
d = dict()
m = x.pop()
M = -1
while x:
    t = x.pop()
    if M < t-m:
        M = t-m
        d[M] = 1
    elif M == t-m:
        d[M] +=1
    m = min(m,t)
print(d[M])

Measured memory_bytes: 18256
#include<iostream>
#include<string>
using namespace std;
int main() {
	string a,b;
	int ans = 0;
	int x;
	while (cin >> a) {
		b = "";
		x = 0;
		for (int i = a.size() - 1; i >=0 ; i--) {
			b = b+a[i];
		}
		if (a == b) {
			ans = ans + 1;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3180
def insertionSort(a,n,g):
    global cnt
    for i in range(g,n):
        v = a[i]
        j = i-g
        while j>=0 and a[j]>v:
            a[j+g] = a[j]
            j = j-g
            cnt+=1
        a[j+g] = v

def shellSort(a,n):
    global m
    global g
    h = 1
    while True:
        if h>n:
            break
        g.append(h)
        h = 3*h+1
    m = len(g)
    g.reverse()
    for i in range(m):
        insertionSort(a,n,g[i])

n = int(input())
a = [int(input()) for i in range(n)]
g = []
cnt = 0
m = 0
shellSort(a,n)
print(m)
print(*g)
print(cnt)
for i in range(n):
    print(a[i])



Measured memory_bytes: 45508
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

int main(){
  int D, T, S; cin >> D >> T >> S;
  if(S*T>=D) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define Abs(x)((x) < 0 ? (x) * -1 : (x))

#define rep(x, y) for ((x) = 0; (x) < (y); (x)++)
#define repin(x, y) for ((x) = 0; (x) <= (y); (x)++)
#define nep(x, y) for ((x) = (y) - 1; 0 <= (x); (x)--)
#define nepi(x, y, z) for ((x) = (y) - 1; (z) <= (x); (x)--)
#define repi(x, y, z) for ((x) = (z); (x) < (y); (x)++)
#define repiin(x, y, z) for ((x) = (z); (x) <= (y); (x)++)
#define reps(x, y, z) for ((x) = 0; (x) < (y); (x) += (z))
#define repis(x, y, z, s) for ((x) = (z); (x) < (y); (x) += (s))
#define repiins(x, y, z, s) for ((x) = (z); (x) <= (y); (x) += (s))
#define repit(x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define nepit(x) for (__typeof((x).rbegin()) it = (x).rbegin(); it != (x).rend(); it++)

#define All(x) (x).begin(),(x).end()

#define Mem0(x) memset(x, 0, sizeof(x))
#define Mem1(x) memset(x, -1, sizeof(x))

#define Unique(v) v.resize(unique(All(v)) - v.begin())

#define peq(p0, p1)(p0.first == p1.first && p0.second == p1.second)

#define End '\n'
#define Out(x) cout<<(x)<<End
#define OutP(p, sep, end) cout<<p.first<<sep<<p.second<<end

template<typename T> inline bool Max(T &x, const T &y) { return x < y ? x = y, 1 : 0; }
template<typename T> inline bool Min(T &x, const T &y) { return x > y ? x = y, 1 : 0; }
template<typename T> using V = vector<T>;
template<typename T> using VV = V<V<T> >;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define lb std::lower_bound
#define ub std::upper_bound

#define lbi(v, x) lb(All(v), (x))-v.begin()
#define ubi(v, x) ub(All(v), (x))-v.begin()

static const ll MOD = 1e9 + 7;
static const double PI = 3.141592653589793;

#define LOCAL 0

int main()
{
#if LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#endif

    cin.tie(0);
    ios::sync_with_stdio(false);
	//std::cout.precision(18);

    int a, b, c;

	cin >> a >> b >> c;

	Out(min(c, b / a));
	
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(){
    int W,H,x,y,r;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
	if(x+r<=W&&x>=r&&y+r<=H&&y>=r){
	printf("Yes\n");
}
	else{
	printf("No\n");
}
    return 0;
}


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

using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define vp vector<pair<int, int>>
#define vll vector<long long>
#define inf 1000000100
#define infll 1LL << 50

int main()
{
    int h, w;
    int n;
    cin >> h >> w >> n;

    vi data(n+1);

    for(int i = 1; i <= n; ++i)
    {
        cin >> data[i];
    }

    vector<vi> grid(h, vi(w));
    int color = 1;
    for(int j = 0; j < w; ++j)
    {
        if(j%2 == 0)
        {
            for(int i = 0; i < h; ++i)
            {
                if(data[color] == 0)
                {
                    ++color;
                }
                grid[i][j] = color;
                data[color]--;

            }
        }
        else
        {
            for(int i = h-1; i >= 0; --i)
            {
                if(data[color] == 0)
                {
                    ++color;
                }
                grid[i][j] = color;
                data[color]--;
            }
        }
    }

    for(int i = 0; i < h; ++i)
    {
        for(int j = 0; j < w; ++j)
        {
            cout << grid[i][j] << " ";
        }
        cout << endl;
    }

}


Measured memory_bytes: 384
// 

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <map>
#include <cmath>
#include <stack>

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

using namespace std;

int main(){
  int d, n;
  cin >> d >> n;
  int ans = pow(100, d) * n;
  if(n == 100) ans += pow(100, d);
/*  if(d == 0) cout << n << endl;
  else if(d == 1) cout << n << "00" << endl;
  else cout << n << "0000" << endl;*/
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 384
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#define swap(type,a,b) { type temp = a; a = b; b = temp; }
int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}

int main(void) {
	// your code goes here
	int a,b,c,max,mid;
	scanf("%d %d %d",&a,&b,&c);
	if(a<b) swap(int,a,b);
	if(b<c) swap(int,b,c);
	if(a<b) swap(int,a,b);
	printf("%d\n",10*a+b+c);
	return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

std::string N;

int main()
{
	in >> N;
	if (N[0] == N[2]) { out << "Yes" << std::endl; }
	else { out << "No" << std::endl; }
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    int k, q;
    cin >> k >> q;

    vector<int> d(k);
    for (int i = 0; i < k; i++) {
        cin >> d[i];
    }

    vector<int> a(k + 1);
    for (int h = 0; h < q; h++) {
        int n, x, m;
        cin >> n >> x >> m;
        n--;
        x %= m;

        int r = 0;

        a[0] = x;
        int c = k;
        for (int i = 0; i < k; i++) {
            a[i + 1] = (a[i] + d[i]) % m;
            if (a[i] == a[i + 1]) c--;
        }

        ll s = 0;
        for (int i = 0; i < k; i++) {
            s += d[i] % m;
        }

        ll a1 = x + s * (n / k);
        int a2 = a1 % m;
        r += c * (n / k) - a1 / m;

        a[0] = a2;
        for (int i = 0; i < n % k; i++) {
            a[i + 1] = (a[i] + d[i]) % m;
            if (a[i] < a[i + 1]) r++;
        }

        //int y = n % k; n -= y;
        //a[0] = x % m;
        //for (int i = 0; i <= y; i++) {
        //    a[i + 1] = (a[i] + d[i]) % m;
        //    if (a[i] < a[i + 1]) r++;
        //}

        //a[0] = a[y] % m;
        //int z = k;
        //for (int i = 0; i < k; i++) {
        //    int i1 = i + y; if (i1 >= k) i1 -= k;
        //    a[i + 1] = (a[i] + d[i1]) % m;
        //    if (a[i] == a[i + 1]) z--;
        //}

        //ll s1 = s * (n / k);
        //int z2 = z * (n / k);
        //int sm = s1 % m;
        //r += z2 - s1 / m;
        //if (a[0] < sm) r--;

        //for (int i = 0; i < k; i++) {
        //    int d = a[i + 1] - a[i];
        //    if (d < 0) d += m;
        //    if (d == 0) {
        //        b0[i] = b1[i] = 0;
        //    } else {
        //        b0[i] = -a[i]; if (b0[i] < 0) b0[i] += m;
        //        b1[i] = b0[i] + (m - d);
        //    }
        //}
        //int o = 0, l = a[k] - a[0]; if (l < 0) l += m;
        //for (int j = 0; j < n; j += k) {
        //    
        //    o += l; if (o < 0) o += m;
        //}

        cout << r << '\n';
    }

    //mがでかいので厄介
    //k個のペアそれぞれについて右が大きくなるオフセットの範囲を求める
    //kが小さいときのこと忘れてた

    return 0;
}

Measured memory_bytes: 384
import sys
from itertools import combinations

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


def main():
    N, K, *A = map(int, read().split())

    ans = INF
    for comb in combinations(range(1, N), K - 1):
        included = set(comb)
        total = 0
        max_height = A[0]
        for i, a in enumerate(A[1:], 1):
            if a <= max_height:
                if i in included:
                    total += max_height - a + 1
                    max_height += 1
            else:
                max_height = a

        if ans > total:
            ans = total

    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 40176