akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define rng(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define se second
#define fi first
#define prev            :oyhhhhhhyo:    
#define next         .sdNNNmNNNNNNNmds. 
#define y0          -hNNNNy`yNNNNNN`/Nh-
#define y1          mNNNNNd+dNNNNNN+sNNm
#define yn          mNNNNNNNNy--:smNNNms
#define tm          .+oooooosyysooooo+- 
#define read               :yhy/        
#define rank              :mNmo         
#define index              ... 
#define pb push_back
#define pcnt __builtin_popcountll
#define rrep(i,a,b) for(int i = (b); i >= (a); i--)
#define rall(x,a) for(auto x : a)
#define MOD 1000000007
#define endl "\n"
#define int long long
typedef long long ll;
using namespace std;

const int N = 2222;
int a[N], cnt[N];
int n, k;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> k;
    int inv = 0;
    rep(i, 1, n) {
        cin >> a[i];
        cnt[a[i]]++;
    }
    rep(i, 1, n) {
        rep(j, i + 1, n) {
            inv += a[i] > a[j];
        }
    }
    int invo = 0, sm = 0;
    rep(x, 0, 2000) {
        invo = (invo + sm * cnt[x]) % MOD;
        sm += cnt[x];
    }
    int ans = k * inv % MOD;
    int add = k * (k - 1) / 2 % MOD * invo % MOD;
    ans = (ans + add) % MOD;
    cout << ans << endl;
    return 0;
}


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

int calc(int n){
  int total=1;
  if(n==1){
    return total;
  }else{
    for(int i=1;i<n;i++){
      total = total+pow(10,i);
    }
  }
  return total;
}

int main(void){
  int a, b;
  int cmp;
  scanf("%d %d", &a, &b);
  if(a>=b){
    cmp = b*calc(a);
  }else{
    cmp = a*calc(b);
  }
  printf("%d", cmp);
  return 0;
}

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

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

    if (a + b == c || b + c == a || c + a == b){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }

    return 0;
}



Measured memory_bytes: 3644
s = input()
t = input()

d = {}
for si,ti in zip(s,t):
    if not si in d:
        d[si] = ti
    else:
        if d[si] != ti:
            print('No')
            break
else:
    sset = set()
    for v in d.values():
        if v in sset:
            print('No')
            break
        sset.add(v)
    else:
        print('Yes')

Measured memory_bytes: 74008
import java.util.*;
import static java.lang.System.*;

public class Main {

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

		String s = sc.next();
		boolean flag = false;
		char c = ' ';
		for(c = 'a'; c <= 'z'; c++) {
			if (s.indexOf(c) == -1) {
				flag = true;
				break;
			}
		}
		if (flag) System.out.println(c);
		else System.out.println("None");
		
	}
}

Measured memory_bytes: 24092
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {
    n:i64,m:i64,
     }
    println!("{}", n * (n - 1) / 2 + m * (m - 1) / 2);
}


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

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

  if (
       (N % 1000)/100 == (N % 100)/10
     ) 
  {
    if (
         (N % 1000)/100 == N/1000 || 
         (N % 100)/10 == N % 10
       ) 
    {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
from math import *

def cin(): # To take limited number of inputs
    return map(int,input().split())

def cins(): # To take space sepreated strings
    return input.split()

def cino(test=False): # To take individual int input (test = False)
    if not test:
        return int(input())
    else: # To take string input (test = True)
        return input()

def cina(): # array input
  return list(map(int,input().split()))

def ssplit(): # multiple string input
    return list(input().split())

def printlist(l): # To print space seperated array
    for i in l:
        print(i,end=" ")

def main():
    s = input()
    s = list(s)
    init = -1
    end = len(s)
    for i in range(len(s)):
        if s[i]=='A' and init==-1:
            init = i
        if s[i]=='Z':
            end = i
    print(end-init+1)


if __name__ == '__main__':
    main()

Measured memory_bytes: 4964
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7
a, b = rm()
print(10 if a >= b else 0)
















Measured memory_bytes: 27080
function Main(input) {
    input = input.split("\n");
    N = Number(input[0])
    tmp = input[1].split(" ");
    an = 0;
    for(i = 0; i < N; i++){
        tmp.push(Number(tmp[0]));
        tmp.shift();
    }
    for(j = 1; j <= N; j++){
        inj = tmp[j-1];
        if(inj == j) continue;
        tmp = swap(tmp,inj-1,j-1);
        an++;
    }
    console.log((an < 2) ? "YES" : "NO");
}
function swap(a,x,y){
    a[x]=[a[y],a[y]=a[x]][0];
    return a;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

int main() {
  string S;
  cin >>S;
  
  for(int i=0;i<3;i++){
    if(S.at(i)==S.at(i+1)){
      cout <<"Bad" <<endl;
      break;
      }
    else{
      if(i==2){
        cout <<"Good" <<endl;
      }
      else{
      continue;
      }
    }
  }       
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<set>
#include<functional>

#define LLI long long int

using namespace std;

int main(){
	int H,W;cin>>H>>W;
	vector<string>S(H);
	for(int i=0;i<H;i++)cin>>S[i];
	vector<vector<int> >L(H,vector<int>(W,0));
	char stat;
	int num;
	for(int i=0;i<H;i++){
			stat='#';
			num=0;
			for(int j=0;j<W;j++){
				if(stat=='#'){
					if(S[i][j]=='.'){
							stat='.';
							num++;
					}
				}else if(stat=='.'){
					if(S[i][j]=='.'){
						num++;
					}else{
						for(int k=0;k<num;k++){
							L[i][j-k-1]+=num;
						}
						stat='#';
						num=0;
					}
				}

			}
			if(stat=='.'){
					for(int k=0;k<num;k++){
							L[i][W-k-1]+=num;
					}
			}
	}
	/*
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
				cout<<L[i][j]<<" ";
		}
		cout<<endl;
	}
	*/
	for(int j=0;j<W;j++){
		stat='#';
		num=0;
		for(int i=0;i<H;i++){
			if(stat=='#'){
				if(S[i][j]=='.'){
					stat='.';
					num++;
				}
			}else if(stat=='.'){
				if(S[i][j]=='.'){
					num++;
				}else{
					for(int k=0;k<num;k++){
							L[i-k-1][j]+=num-1;
					}
					stat='#';
					num=0;
				}
			}
		}
		if(stat=='.'){
				for(int k=0;k<num;k++){
						L[H-k-1][j]+=num-1;
				}
		}
	}
	/*
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
				cout<<L[i][j]<<" ";
		}
		cout<<endl;
	}
	*/
	int ans=0;
	for(int i=0;i<H;i++)for(int j=0;j<W;j++)ans=max(ans,L[i][j]);
	cout<<ans<<endl;


	return 0;
}



Measured memory_bytes: 20096
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(i=a;i<b;i++)
#define rloop(i,a,b) for(i=a;i>=b;i--)
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
const int inf=1000000001;
const ll INF=1e16;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846

int main(){
	string o,e;
	int i;
	cin>>o>>e;
	if(o.size()-e.size()==0){
		loop(i,0,o.size()){
			cout<<o[i]<<e[i];
		}
	}else{
		loop(i,0,e.size()){
			cout<<o[i]<<e[i];
		}
		cout<<o[i];
	}
	cout<<endl;
}

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

int main(void){
	char c;
	rep(i,4){
		c=getchar();
		cout<<c;
	}
	cout<<" ";
	rep(i,9){
		c=getchar();
		cout<<c;
	}

	return 0;
}


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

#define rep(i, n) for(int i=0; i<(n); ++i)
#define max  200001

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
    
    int x;
    int ans=INT_MIN, tmp;
    
    scanf("%d", &x);
    
    for (int i=1; i<=32; i++) {
        for (int j=2; j<=10; j++) {
            tmp=pow(i, j);
            if (ans<tmp&&tmp<=x) {
                ans=tmp;
            }
        }
    }
    
    printf("%d", ans);
    
    return 0;
}


Measured memory_bytes: 2452
A, B, C, X = int(input()), int(input()), int(input()), int(input())

answer = 0
for a in range(A + 1):
  for b in range(B + 1):
    for c in range(C + 1):
      if a * 500 + b * 100 + c * 50 == X:
        answer += 1

print(answer)

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <functional>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;

int main()
{
    ll n, k;
    vector<ll> p(1010, 1001);
    cin >> n >> k;
    rep(i, n)
    {
        cin >> p[i];
    }
    sort(p.begin(), p.end());
    auto sum = accumulate(p.begin(), p.begin() + k, 0);
    cout << sum << endl;
}

Measured memory_bytes: 3172
#include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <cstdio>
#include <cctype>
#include <queue>
#include <complex>
#include <climits>
#include <cstring>

typedef long long ll;

using namespace std;

int isPrime[1 << 16];

int main(void){
	int n;
	
	for(int i=0; i<1<<16; ++i){
		isPrime[i] = 1;
	}

	isPrime[0] = isPrime[1] = 0;

	for(int i=0; i*i<=(1<<16); ++i){
		if(isPrime[i] == 0) continue;
		for(int j=2*i; j<1<<16; j+=i){
			isPrime[j] = 0;
		}
	}

	while(cin >> n){
		int res = 0;
		if(!n) break;
		for(int i=0; i<=n/2; ++i){
			if(isPrime[i] == 1 && isPrime[n-i] == 1) res++;
		}
		cout << res << endl;
	}

	return 0;
}

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

int main() {
    int n, a, b, c, x;
    while (cin >> n >> a >> b >> c >> x, n) {
        vector <int> y(n);
        rep (i, n) cin >> y[i];

        int nowFrame = 0, cnt = 0, ans = -1;
        while (nowFrame <= 10001) {
            if (cnt == n) {
                ans = nowFrame - 1;
                break;
            }
            if (y[cnt] == x) {
                cnt++;
                x = (a * x + b) % c;
                nowFrame++;
                continue;
            }

            x = (a * x + b) % c;
            nowFrame++;
        }

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


Measured memory_bytes: 3084
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
const int maxn=1500032;

int mm[maxn*4];
int aa[maxn];
int S, inf, L, r1, c1, r2, c2;
void init(int s, int x, int l, int r)
{
	if (s==0) if (s+x>S) S=s+x;
	if (l==r) { mm[s+x]=aa[l]; //printf("ll %d %d \n", l, aa[l]); 
	return ; }
    int m=(l+r)>>1;
	init(s, x*2, l, m); init(s, x*2+1, m+1, r);
	mm[s+x]=min(mm[s+x*2], mm[s+x*2+1]);
    //printf("nb %d %d\n", s+x, mm[s+x]);
}

int query(int s, int x, int l, int r, int L, int R)
{
	if (L<=l && r<=R) return  mm[s+x];
	int m=(l+r)>>1;
	int ans=inf;
	if (L<=m) ans=min(ans, query(s, 2*x, l, m, L, R));
	if (R>=m+1) ans=min(ans, query(s, 2*x+1, m+1, r, L, R)); 
    return ans;
}

int r, c, q;
int main() 
{
    while (scanf("%d %d %d", &r, &c, &q)!=-1)
	{
		if (r==0 && c==0 && q==0) break;
	    for (int i=0; i<r; i++) 
			for (int j=0; j<c; j++)
		if (r<=c) scanf("%d", &aa[i*c+j+1]); else scanf("%d", &aa[j*r+i+1]); 
		//puts("aa");
        inf=0;
		for (int i=1; i<=r*c; i++) 
		{
			inf=max(inf, aa[i]);
		    //printf("list %d %d\n", i, aa[i]);
		}
		if (r<=c)
		{
			S=0;
			L=c;
			init(0, 1, 1, c);
			//printf("%d %d\n", mm[1], S);
            for (int i=2; i<=r; i++)
			{
				init(S*(i-1), 1, 1+(i-1)*L, i*L);
		        //printf("%d\n", mm[S*(i-1)+1]);
            }
		} else
		{
			S=0;
			L=r;
			init(0, 1, 1, r);
			for (int i=2; i<=c; i++)
			{
				init(S*(i-1), 1, 1+(i-1)*L, i*L);
			}
		}
        //puts("bb");
	    while (q--)
		{
			scanf("%d %d %d %d", &r1, &c1, &r2, &c2);
            r1++; r2++; c1++; c2++;
			//printf("%d %d %d %d\n", r1, c1, r2, c2);
			int ans=inf;
			if (r<=c)
			{
				for (int i=r1; i<=r2; i++)
				{
					ans=min(ans, query(S*(i-1), 1, 1+(i-1)*L, i*L, c1+(i-1)*L, c2+(i-1)*L));  
				//    printf("%d\n", ans);
				}
				printf("%d\n", ans);
			} else
			{
				for (int i=c1; i<=c2; i++)
				{
					//for (int j=r1+(i-1)*L; j<=r2+(i-1)*L; j++)
					//	printf("%d %d\n", j, aa[j]); 
					ans=min(ans, query(S*(i-1), 1, 1+(i-1)*L, i*L, r1+(i-1)*L, r2+(i-1)*L));  
				    //printf("eee %d\n", query(S*(i-1), 1, 1+(i-1)*L, i*L, r1+(i-1)*L, r2+(i-1)*L));  
				    //printf("%d\n", ans);
				}
				printf("%d\n", ans);
			}
		}
	}
	return 0;
}
/*
4 2 10
1 2
2 1
0 7
1 2
1 0 2 1
*/

Measured memory_bytes: 17000
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define REP(i,n) for(int i = 0;i < (int)(n);++i)
#define RREP(i,n) for(int i = (int)n-1;i >= 0;--i)
#define FOR(i,s,n) for(int i = s;i < (int)n;++i)
#define RFOR(i,s,n) for(int i = (int)n-1;i >= s;--i)
#define ALL(a) a.begin(),a.end()
#define IN(a, x, b) (a<=x && x<b)
template<class T>inline void out(T t){cout<<t<<"\n";}
template<class T,class... Ts>inline void out(T t,Ts... ts){cout<<t<<" ";out(ts...);}
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;}
constexpr long long INF = 1e18;

signed main(){
	int flg = 1;
	int N;
	cin >> N;
	vector<int>a(N);
	REP(i,N)cin >> a[i];
	REP(i,N){
		if(a[i]&1)continue;
		if(a[i]%3&&a[i]%5)flg=0;
	}
	if(flg)cout<<"APPROVED"<<endl;
	else cout<<"DENIED"<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int i,j,n,m,x;
int main()
{
    std::cin.sync_with_stdio(false);
    std::cin.tie(0);
    cin >> n;
    m=n;
    while (m>0)
    {
        x+=m%10;
        m/=10;
    }
    if (n%x==0)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }
    return 0;
}


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

int main(){
    long long s;
    cin >> s;

    vector<long long> a(1000001);
    a[0] = s;

    for(long long i = 1; i <= 1000000; i++){
        if(a[i-1] % 2 == 0) a[i] = a[i-1]/2;
        else a[i] = 3*a[i-1]+1;
    }

    set<long long> T;

    for(long long i = 0; i <= 1000000; i++){
        if(T.find(a[i]) == T.end()) T.insert(a[i]);
        else{
            printf("%lld\n", i+1);
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 11192
#include<bits/stdc++.h>
#define ll long long
#define PI 3.14159265
using namespace std;
void solve(){
	ll n,w;
	cin>>n>>w;
	ll a[n][2];
	for(ll i=0; i<n; ++i){
		cin>>a[i][0]>>a[i][1];
	}
	cout<<endl;
	ll dp[n+1][w+1];
	
	for(ll i=0; i<=n; i++){
		for(ll j=0; j<=w; ++j){
			if(i==0 || j==0){
				dp[i][j] = 0;
				
			}else if(a[i-1][0] <= j){
				dp[i][j] = max(dp[i-1][j - a[i-1][0]] + a[i-1][1],dp[i-1][j]);
			}else{
				dp[i][j] = dp[i-1][j];
			}
		}
	}
	// for(ll i=1; i<=n; i++){
		// for(ll j=1; j<=w; ++j){
			// cout<<dp[i][j]<<" ";
		// }
		// cout<<"\n";
	// }
	
	cout<<dp[n][w]<<"\n";
	
	
}
int main(){
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int t;
    t = 1;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 79232
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int a[n+2];
	a[0]=0;
	a[n+1]=0;
	for(int i=1;i<=n;i++)
	cin>>a[i];
	sort(a+1,a+n+1);
	int s=0;
	for(int i=n;i>=1;i-=2)
	{
		s+=a[i]-a[i-1];
	}
	cout<<s;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> l(n);
  rep(i, n) cin >> l[i];

  sort(l.begin(), l.end(), greater<int>());
  int ans = 0;
  rep(i, k) ans += l[i];
  cout << ans << endl;


  
  return 0;
}

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

using namespace std;

const int maxn = 100100;

int n,A,B,mid,dp[maxn];
vector<int> g[maxn];

bool visit(int u,int pa) {
    vector<int> temp;
  //  cout<<u<<endl;
    if (g[u].size()%2) temp.push_back(-1);
    for (int j=0;j<g[u].size();j++) {
        int v = g[u][j];
        if (v!=pa) {
            if (!visit(v,u)) return false;
            if (dp[v]!=-1) temp.push_back(dp[v]);
        }
    }
    sort(temp.begin(),temp.end());
   // cout<<u<<" "<<temp.size()<<endl;
   // if (temp.size()>0) for (int i=0;i<temp.size();i++) cout<<temp[i]<<" ";
   // cout<<endl;
  //  cout<<"-------------"<<endl;
    if (temp.size()%2) {
        int ll=-1,rr=temp.size();
        while (ll+1<rr) {
            int x = (ll+rr)/2;
            bool ok = true;
            int p1=0,p2=temp.size()-1;
           // cout<<x<<endl;
            while (p1<p2) {
                if (p1==x) p1++;
                if (p2==x) p2--;
                if (temp[p1] + temp[p2] + 2 > mid) {
                    ok = false;
                    break;
                }
                p1++;
                p2--;
            }
            if (ok) {
                rr = x;
            }
            else ll = x;
        }
       // cout<<rr<<endl;
        if (rr==temp.size()) return false;
        dp[u] = temp[rr] + 1;
        return true;
    }
    else {
        for (int i=0;i<temp.size();i++)
            if (temp[i] + temp[temp.size()-i-1] + 2 > mid) return false;
        dp[u]=-1;
        return true;
    }
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
  //  freopen("inp.txt","r",stdin);
    cin>>n;
    for (int i=1;i<n;i++) {
        int a,b;
        cin>>a>>b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    A=0;
    for (int i=1;i<=n;i++) A+=g[i].size()%2;
    cout<<A/2<<" ";
    int l=0,r=n;
    while (l<=r) {
        mid = (l+r)/2;
        if (visit(1,-1)) {
            B = mid;
            r = mid-1;
        } else l = mid+1;
    }
    cout<<B;
}



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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

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

template<typename T, typename U>
void print1(T Array, U size) {
  for (int i = 0; i < size; i++) {
    cout << Array[i] << " ";
  }
  cout << endl;
}

template<typename T>
void print(T Array, int height, int width) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      cout << " " << Array[i][j];
    }
    cout << endl;
  }
}

// ------------------------------------------------------------------------------------------

signed main() {
  string s;
  cin >> s;
  int sum = 0;
  for (char c : s) {
    sum += (c - '0');
  }
  int n = stoi(s);

  puts(n%sum ? "No" : "Yes");

  return 0;
}

Measured memory_bytes: 764
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <iomanip>
#include <cmath>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
#define rep(i,a,b) for(int i=a;i<(b);++i)
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
using ll = long long;
constexpr ll INF = 1LL << 60;
constexpr ll MOD = 1e9 + 7;

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    int a,b; cin >> a >> b;
    if(a <= b) cout << a << endl;
    else cout << a-1 << endl;
    return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
#from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi
#from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [LI()for i in range(n)]
inf = 10**17
mod = 10**9 + 7

s=input()
u=list(s)
u[3]="8"
k="".join(u)
print(k)

Measured memory_bytes: 38384
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	ans := 0
	for i := 1; i*i <= n; i++ {
		if n%i != 0 {
			continue
		}
		v := n/i - 1
		if 0 < v && n/v == n%v {
			ans += v
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define LOCAL 1

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#define dbg(...) cout<<#__VA_ARGS__ ": ["; for(auto e: __VA_ARGS__){cout<<e<<", ";} cout<<"]\n"
#define dbg1(...) cout<<#__VA_ARGS__ " "<< __VA_ARGS__ 
#else
#define dbg(...) 1;
#define dbg1(...) 1;
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
constexpr ll R=3e5+69, INF=2e9+6969;

int n,A[R],k,t[R*4],N = 1, M = 1;

void insert(int g, int p, int k, int x, int w)
{
	if(p == x && k == x)
	{
		t[g] = w;
		return;
	}
	int s = p + (k-p)/2;
	if(x<=s) insert(g*2,p,s,x,w);
	else insert(g*2+1,s+1,k,x,w);
	t[g] = max(t[g*2],t[g*2+1]);
}
int query(int g, int p, int k, int x, int y)
{
	if(x <= p && k <= y) 
	{
		return t[g];
	}
	int s = p + (k - p)/2;
	int w = 0;
	if(x <= s) w = query(g*2,p,s,x,y);
	if(y > s) w = max(w,query(g*2+1,s+1,k,x,y));
	return w;
}
void show()
{
	for(int i=1;i<16;++i) 
	{
		printf("%d ", t[i]);
		if((i&(i+1)) == 0) puts("");
	}
}

int main()
{
	scanf("%d%d", &n, &k);
	for(int i=0;i<n;++i)
	{
		scanf("%d", &A[i]);
		A[i]++;
		M = max(M,A[i]);
	}
	while(N < M) N <<= 1;
	//  printf("%d\n", N);
	//  for(int i=1;i <= N*2; ++i) t[i] = 1;
	for(int i=0;i<n;++i)
	{
		//  puts("xd");
		int best = query(1,1,N,max(1,A[i]-k),min(N,A[i]+k));
		insert(1,1,N,A[i],best+1);
		//  printf("beset : %d\n", best);
		//  show();
		//  puts("");
	}
	printf("%d\n", query(1,1,N,1,N));
	return 0;
}


Measured memory_bytes: 7356
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	ll a,b,k;cin>>a>>b>>k;
	for(int i = 0; i < k; i++) {
		if(i % 2 == 0){
			if (a % 2 == 1){
				a--;
			}
			a /= 2;
			b += a;
		}
		else{
			if(b % 2 == 1){
				b--;
			}
			b /= 2;
			a += b;
		}
	}
	cout << a << " " << b << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rrep(i,n) for(int (i) = (n) - 1; (i) >= 0; --(i)) //Reversi rep
#define nfor(i,a,b) for(int (i) = (a); (i) < (b); ++(i)) //Natural for
#define rfor(i,a,b) for(int (i) = (b); (i) >= (a); --(i)) //Reversi for
#define mod (1000000007)
#define YES cout << "YES" << endl;
#define Yes cout << "Yes" << endl;
#define NO cout << "NO" << endl;
#define No cout << "No" << endl;

int asc(const void *a, const void *b) {
    return *(int *)a - *(int *)b;
}

int desc(const void *a, const void *b) {
    return *(int *)b - *(int *)a;
}

int main()
{
    int a,x;
    cin >> x >> a;
    if (x < a) {
        cout << 0 << endl;
    }else{
        cout << 10 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#import math
#import bisect
#import numpy as np
#import itertools
#import copy
import sys

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    n = int(input())
    a = [0] * n

    for i in range(n):
        a[i] = int(input())

    a_lmax = [0] * n
    a_rmax = [0] * n
    a_lmax[0] = 0
    a_rmax[-1] = 0

    for i in range(1, n):
        a_lmax[i] = max(a_lmax[i-1],a[i-1])
        a_rmax[-1-i] = max(a_rmax[-i], a[-i])

    for i in range(n):
        print(max(a_lmax[i], a_rmax[i]))


if __name__ == '__main__':
    main()

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

int main() {

  while(1) {
  int n,k;
  cin >> n >> k;
  if(n==0 && k==0) break;

  int a[100001] = {};

  for(int i=0;i<n;i++) cin >> a[i];

 
  int maxsum = 0;
  int sum;
  for(int i=0;i<k;i++) maxsum += a[i];

  sum = maxsum;
  for(int i=k;i<n;i++) {
    sum =sum + a[i] - a[i-k];
      if(sum > maxsum) maxsum = sum;
  }

  cout << maxsum <<endl;
  }

  return 0;
}

Measured memory_bytes: 1556
#include<stdio.h>

int main() {
	int i, n, max, min, a[10001];
	long sum = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	min = a[0];
	for (i = 1; i < n; i++) {
		if (min > a[i]) {
			min = a[i];
		}
	}
	max = a[0];
	for (i = 1; i < n; i++) {
		if (max < a[i]) {
			max = a[i];
		}
	}
	for (i = 0; i < n; i++) {
		sum += a[i];
	}
	printf("%d %d %ld\n", min, max, sum);
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
long long n,sum,Mod=1e9+7,k,a[3001],dp[101][100001];
int main()
{
    cin >> n >> k;
    for(int i=1; i<=n; i++) cin >> a[i];
    sort(a+1,a+n+1);
    for(int i=1; i<=n; i++) dp[i][0] = 1; 
    for(int i=1; i<=n; i++)
    {
        sum += a[i];
        for(int j=1; j<=k; j++)
        {
            if(sum < j) break;
            if(j - 1 - a[i] >= 0) 
                dp[i][j] = (dp[i][j-1] + dp[i-1][j] - dp[i-1][j-1-a[i]]) % Mod;
            else 
                dp[i][j] = (dp[i][j-1] + dp[i-1][j]) % Mod;
            //cout << i << " " << j << " " << dp[i][j] << endl;
        }
    }
    cout << (dp[n][k] + Mod) % Mod << endl;
}

Measured memory_bytes: 78336
import sys
input = sys.stdin.readline
n = int(input())
if n == 1:
  print(1)
  exit()
  
chk = []
for i in range(n):
  a = int(input())
  chk.append((i,a))
  
from bisect import bisect_left,insort_left
from collections import deque
ans = 1

c = deque([])
for j in chk:
  i,a = j
  if i == 0:
    c.append((a,n-i))
  else:
    ind = bisect_left(c,(a,n-i))
    if ind == 0:
      ans += 1
      c.appendleft((a,n-i))
    else:
      c[ind-1] = (a,n-i)
      
print(ans)

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

const int MAXN = 1e6+5;
const ll p = 1e9+7, x = 12345678;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> Tree;
Tree t;

vector<int> f[MAXN];
ll fact[MAXN], invfact[MAXN], inv[MAXN], n, m;
ll perm[MAXN];
ll ans = 0;
ll g[MAXN];

ll comb(int x, int y) {
	if (x < 0 || y < 0 || x < y)
		return 0;
	return fact[x]*invfact[y]%p*invfact[x-y]%p;
}

ll exp(ll x, ll k) {
	if (k == 0)
		return 1;
	ll y = exp(x, k/2);
	return (k%2 == 0) ? y*y%p : y*y%p*x%p;
}

ll inve(ll x) { return exp(x, p-2); }

void init() {
	inv[1] = fact[0] = fact[1] = invfact[0] = invfact[1] = 1;
	for (int i = 2; i < MAXN; ++i) {
		inv[i] = (p - (p/i) * inv[p%i] % p) % p;
		fact[i] = i*fact[i-1]%p;
		invfact[i] = inv[i]*invfact[i-1]%p;
	}
}

int main() {
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> perm[i];
		m += (perm[i] == 0);
		if (perm[i] != 0)
			g[perm[i]+1]++;
		if (perm[i] != 0)
			t.insert(perm[i]);
	}
	for (int i = 1; i <= n; ++i)
		g[i] += g[i-1];
	for (int i = 1; i <= n; ++i)
		g[i] = i-1-g[i];
	
	init();
	ll unt = m;

	for (int i = 0; i < n; ++i) {
		ll x = 0;
		if (perm[i] != 0) {
			x += g[perm[i]]*unt%p*inv[m]%p*fact[m]%p;
			x %= p;
			x += fact[m]*(t.order_of_key(perm[i]));
			x %= p;
			t.erase(perm[i]);
		} else {
			x += (unt-1)*m%p*((p+1)/2)%p*fact[m-1]%p;
			x %= p;
		}

		ans = (ans + x*fact[n-1-i])%p;
		if (perm[i] == 0)
			unt--;
	}

	ll tot = 0, tot1 = 0;
	for (int i = 0; i < n; ++i) {
		if (perm[i] == 0) {
			tot = tot + fact[n-1-i];
			tot %= p;
			continue;
		}
		ans += (tot*(m-g[perm[i]])%p*fact[m]%p*inv[m]%p);
		ans %= p;
	}

	cout << (ans + fact[m])%p << endl;
}

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

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

inline bool is_valid(int i, int j) {
    return j >= 0 && i/2 - 1 <= j && j <= (i+1) / 2;
}

int main() {
    int N; cin >> N;
    vector<int> A(N);
    REP(i, N) cin >> A[i];

    vector<vector<int64_t>> dp(3, vector<int64_t>((N+1)/2 + 1));
    dp[1][0] = 0;
    dp[1][1] = A[0];
    for (int i = 2; i <= N; ++i) {
        for (int j = i/2 - 1; j <= (i+1) / 2; ++j) {
            int64_t v1 = is_valid(i-2, j-1) ? dp[(i-2)%3][j-1] + A[i-1]
                                            : numeric_limits<int64_t>::min();
            int64_t v2 = is_valid(i-1, j) ? dp[(i-1)%3][j]
                                          : numeric_limits<int64_t>::min();
            dp[i%3][j] = max(v1, v2);
        }
    }
    cout << dp[N%3][N/2] << '\n';
}


Measured memory_bytes: 7192
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fill fill_n
#define pf push_front
#define pb push_back
#define FOR(i,l,r) for(int i=l;i<r;i++)
#define ROF(i,r,l) for(int i=r;i>=l;i--)
#define comp(v) (v).begin(),(v).end()
#define ff first
#define ss second
#define infile freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
typedef vector<int> vi;
typedef vector<ll> vli;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvli;
const int M = 1e9+7;
const int N = 2e5;
ll po(int,int);


void solve(){
 int a,b,c,d;
 cin>>a>>b>>c>>d;
 bool vis[6]={0};
 vis[a]=vis[b]=vis[c]=vis[d]=1;
 FOR(i,1,6){
     if(!vis[i]){
         cout<<i;
         break;
     }
 }
  
    
} 





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


ll po(int a,int b){
    if(b==0) return 1;
    ll ans=1;
    if(b%2==0){
        ans = po(a,b/2)%M;
        ans=(ans%M * ans%M)%M;
    }
    else{
        ans = po(a,(b-1)/2)%M;
        ans = (ans%M * ans%M * a)%M;
    }
    return ans%M;
}


Measured memory_bytes: 3600
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

const long long INF = 1LL << 32;

const int MAX_D = 1000005;

vector<long long> dp(vector<pair<long long, long long>>& a){
	vector<long long> res(MAX_D, INF);
	res[0] = 0;
	rep(i,MAX_D){
		rep(j,a.size()){
			int idx = min<int>(i + a[j].second, MAX_D - 1);
			res[idx] = min(res[idx], res[i] + a[j].first);
		}
	}

	return res;
}

int main(){
	int n;
	while(cin >> n,n){
		vector<long long> h(n);
		rep(i,n){
			cin >> h[i];
		}

		int m;
		cin >> m;
		vector<pair<long long,long long>> s, a; // first MP, second damage
		rep(i,m){
			long long MP, damage;
			string target;
			cin >> target >> MP >> target >> damage;
			(target  == "Single" ? s : a).emplace_back(MP, damage);
		}

		vector<long long> al = dp(a);
		vector<long long> si = dp(s);

		for (int i = MAX_D - 1; i > 0; i--) {
			si[i - 1] = min(si[i - 1], si[i]);
		}

		long long ans = al[*max_element(all(h))];
		rep(i,MAX_D){
			if(al[i] == INF) continue;
			long long sum = al[i];
			rep(j,n){
				sum += si[max(h[j] - i, 0LL)];
			}
			ans = min(ans, sum);
		}
		cout << ans << endl;
	}
}



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

#define SZ(a) int((a).size())

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, M;
    cin >> N >> M;
    vector<int> A0, A1;
    for (int i = 0; i < M; ++i) {
        int A;
        cin >> A;
        if (A&1) A1.push_back(A); else A0.push_back(A);
    }
    if (SZ(A1) > 2) {
        cout << "Impossible\n";
        return 0;
    }
    vector<int> A;
    if (!A1.empty()) A.push_back(A1[0]);
    for (int x: A0) A.push_back(x);
    if (SZ(A1) >= 2) A.push_back(A1[1]);
    vector<int> B;
    if (SZ(A) == 1) {
        if (A[0] == 1) B = {1}; else B = {A[0]-1, 1};
    } else {
        B.push_back(A[0]+1);
        for (int i = 1; i < SZ(A); ++i) B.push_back(A[i]-!!(i+1 == SZ(A)));
        if (B.back() == 0) B.pop_back();
    }
    for (int i = 0; i < SZ(A); ++i) cout << A[i] << " "[i+1 == SZ(A)];
    cout << '\n' << SZ(B) << '\n';
    for (int i = 0; i < SZ(B); ++i) cout << B[i] << " "[i+1 == SZ(B)];
    cout << '\n';
    return 0;
}


Measured memory_bytes: 3616
#include<iostream>

using namespace std;


int main()
{
  int P, Q, R;
  cin >> P >> Q >> R;

  int sum;

  sum = P+Q;

  if(sum >= P+R)  sum = P+R;
  if(sum >= Q+R)  sum = Q+R;

  cout << sum << endl;

  return 0;
}


Measured memory_bytes: 256
//#pragma GCC optimize(2)
// Happy TLE and WA every day!
// by: zxb the vegetable chicken
#include<bits/stdc++.h>
#define mp              make_pair
#define rep(i,n)        for(int i = 0; i < n; i++)
#define foreach(i,c)    for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define BINF            0x7fffffff
#define INF             0x3f3f3f3f
#define LINF            4557430888798830399
#define pb              push_back
#define F               first
#define S               second
#define Time            clock()/CLOCKS_PER_SEC
//#define usingFiles
using namespace std;

typedef unsigned int ui;
typedef pair<int, int> pii;
typedef long long ll;

inline bool Read(int& x){
	x = 0;
	int c;
	int sign = 1;
	while( (c = getchar()) < '0' || c > '9' ) if(c == '-') sign = -1;
	x = c ^ '0';
	while( (c = getchar()) >= '0' && c <= '9' ) x = (x<<3) + (x<<1) + (c ^ '0');
	x *= sign;
	return 1;
}

inline bool Write(int x){
	if(x >= 10) Write(x / 10);
	putchar(x % 10 + '0');
	return 1;
}

const int rp = 666666;
const bool debug = 1;
const bool I_good_vegetable_a = 1;

int n;
int a[3030];
ll dp[3030][3030];

ll dfs(int l, int r){
	if(dp[l][r] != -LINF) return dp[l][r];
	return dp[l][r] = max(a[l] - dfs(l + 1, r), a[r] - dfs(l, r - 1));
}

signed main(){
	ios::sync_with_stdio(false);
	#ifdef usingFiles
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	cin >> n;
	rep(i, n){
		rep(j, n){
			dp[i][j] = -LINF;
		}
	}
	rep(i, n){
		cin >> a[i];
		dp[i][i] = a[i];
	}
	cout << dfs(0, n - 1);
	return 0;
}

Measured memory_bytes: 72192
N=int(input())
A=list(map(int,input().split()))
ans=float("inf")
for i in range(N):
    a=A[i]
    cnt=0
    while a%2==0:
        cnt+=1
        a//=2
        if a==0:
            break
    ans=min(ans,cnt)
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <numeric>
using namespace std;

int abs(int num){
   if (num > 0)
      return num;
   else
      return -num;
}

int main(){
  int X,A,B;
  cin >> X >> A >> B;
  X = X - A;
  while(X >= B){
    X = X - B;
    //cout << X << endl;
  }
  cout << X << endl;
}

Measured memory_bytes: 256
N = int(input())
An = list(map(int,input().split(' ')))

dp = {}
for a in An:
    if not a in dp:
        dp[a] = 1
    else:
        dp[a] += 1
count = 0
for v in dp.values():
    if v > 1:
        count += v*(v-1)//2
for a in An:
    v = dp[a] 
    diff = 0
    if dp[a] > 1:
        diff = (v*(v-1)//2) - ((v-1)*(v-2)//2)
    print(count-diff)

Measured memory_bytes: 87656
#include <stdio.h>
#include <string.h>
#include <algorithm>
#define Maxn 500005
char s[Maxn];
int n, ans, fail1[Maxn], fail2[Maxn];
void buildFail(char *s, int *fail) {
	int j = fail[0] = -1;
	for (int i = 1; i <= n; ++ i) {
		while (j >= 0 && s[j] != s[i - 1]) j = fail[j];
		fail[i] = ++ j;
	}
}
int main() {
	scanf("%s", s); n = strlen(s);
	buildFail(s, fail1);
	int len = n % (n - fail1[n]) == 0 && (n - fail1[n] <= n / 2) ? n - fail1[n] : -1;
	if (len == -1) return puts("1\n1") & 0;
	if (len == 1) return printf("%d\n1\n", n) & 0;
	puts("2"); std :: reverse(s, s + n);
	buildFail(s, fail2); for (int i = 1; i < n; ++ i)
		if ((!fail1[i] || i % (i - fail1[i])) && (!fail2[n - i] || (n - i) % ((n - i) - fail2[n - i]))) ++ ans;
	printf("%d\n", ans);
	return 0;
}

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

typedef unsigned long long ull;
ull a,b;
string s;

int main(){

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

    cin>>a>>s;
    b=(s[0]-'0')*100+(s[2]-'0')*10+s[3]-'0';
    cout<<a*b/100<<endl;

    return 0;
}

Measured memory_bytes: 3672
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <cstdint>
#include <chrono>

using namespace std;
#define     loop(n,i,a)     for(ll i=a;i<n;i++)
#define     loopR(n,i,a)    for(ll i=a-1;i>=n;i--)
#define     all(arr,n)      arr,arr+n
#define     allv(v)         (v).begin(),(v).end()
#define     rallv(v)        (v).rbegin(),(v).rend()
#define     m_p             make_pair
#define     ll              long long
#define     pii             pair<ll,ll>
#define     vi              vector<int>
#define     vll             vector<ll>
#define     vii             vector<pii>
#define     sz(x)           (int)x.size()
#define     pb              push_back
#define     endl            "\n"
#define     Endl            "\n"
#define     f               first
#define     s               second
#define     mem(dp,n)       memset(dp,n,sizeof dp)
template<typename T>void max_self(T &a,T b){a=max(a,b);}
template<typename T>void min_self(T &a,T b){a=min(a,b);}
int dx[] = { 1 , 0 ,-1 , 0 ,-1 ,-1 , 1 , 1 };
int dy[] = { 0 , 1 , 0 ,-1 ,-1 , 1 ,-1 , 1 };
int KnightI[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
int KnightJ[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
void fast(){
    std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
const ll mxN=1e5+10,oo=0x3f3f3f3f,MOD=998244353;
const long double PI = acos(-1),eps=1.0e-14;

void solve(){
    int n,k;
    cin>>n>>k;
    int res=0;
    loop(n,i,0){
        int x;
        cin>>x;
        res+=(x>=k);
    }
    cout<<res<<endl;
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast();
    solve();

}


Measured memory_bytes: 3652
n, k = map(int, input().split())
di = {}
for _ in range(n):
    a, b = map(int, input().split())
    if a in di:
        di[a] += b
    else:
        di[a] = b
di = list(di.items())
di.sort()
s = 0
for a, b in di:
    if s+b>=k:
        print(a)
        break
    s += b

Measured memory_bytes: 14560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const double PI = acos(-1);  

int main(){
  int n, x; cin >> n >> x;
  vector<ll> a(n);
  ll cnt = 0;

  for(int i=0; i<n; i++)  cin >> a.at(i);
  for(int i=0; i<n-1; i++){
    if(a[i]+a[i+1]<=x) continue;
    cnt += a[i+1]+a[i]-x;
    a[i+1] = max(0LL, x-a[i]);
  }
  cout << cnt << endl;
}


Measured memory_bytes: 1024
def readinput():
    h,w=map(int,input().split())
    smat=[]
    for _ in range(h):
        smat.append(input())
    return h,w,smat

def main(h,w,smat):
    tmat=[]
    for _ in range(h):
        t=[0 for tt in range(w)]
        tmat.append(t)
    #print(tmat)
    for i in range(h):
        s=smat[i]
        l=0
        r=s.find('#',l)
        #print(i,l,r)
        while(r>=0):
            for k in range(l,r):
                tmat[i][k]=r-l
            l=r+1
            if (l>=w):
                break
            r=s.find('#',l)
            #print(i,l,r)
        else:
            for k in range(l,w):
                tmat[i][k]=w-l
        #print(tmat[i])
    maxt=0
    for j in range(w):
        u=0
        b=u
        while b<h:
            #print(b,j)
            while b<h and smat[b][j]=='.':
                b+=1
            for k in range(u,b):
                maxt=max(maxt, tmat[k][j]+b-u-1)
            u=b+1
            b=u

    return maxt

def main2(h,w,smat):
    l=[]
    r=[]
    u=[]
    d=[]
    for _ in range(h):
        l.append([0]*w)
        r.append([0]*w)
        u.append([0]*w)
        d.append([0]*w)

    for i in range(h):
        for j in range(w):
            if smat[i][j]=='.':
                if j==0:
                    l[i][j]=1
                else:
                    l[i][j]=l[i][j-1]+1
        for j in range(w-1,-1,-1):
            if smat[i][j]=='.':
                if j==w-1:
                    r[i][j]=1
                else:
                    r[i][j]=r[i][j+1]+1
    for j in range(w):
        for i in range(h):
            if smat[i][j]=='.':
                if i==0:
                    u[i][j]=1
                else:
                    u[i][j]=u[i-1][j]+1
        for i in range(h-1,-1,-1):
            if smat[i][j]=='.':
                if i==h-1:
                    d[i][j]=1
                else:
                    d[i][j]=d[i+1][j]+1
    
    maxt=0
    for i in range(h):
        for j in range(w):
            maxt=max(maxt, l[i][j]+r[i][j]+u[i][j]+d[i][j]-3)
    return maxt

if __name__=='__main__':
    h,w,smat=readinput()
    ans=main2(h,w,smat)
    print(ans)


Measured memory_bytes: 205896
// 基本テンプレート
 
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
using namespace std;
 
#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
 
signed main() {
    int A, B; cin >> A >> B;
    if(A <= B) cout << A << endl;
    else cout << A - 1 << endl;
    return 0;
}

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

int main(){
  string s;
  cin >> s;
  bool before = false;
  int counter = 0;
  for (int i=0;i<3;i++){
    if(s[i] == 'R') counter += 1;
  }
  if(counter == 2 && s[1] == 'S'){
  	cout << 1 << endl;
  }else{
    cout << counter << endl;
  }
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
using namespace std;
  
vector<int>a;
int main(){
  a.resize(3);
cin>>a.at(0)>>a.at(1)>>a.at(2);
  sort(a.begin(),a.end());
  if(a.at(0)==5 && a.at(1)==5 && a.at(2)==7)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.Arrays;


public class Main {
	public static void main(String [] args) throws IOException
	  {
	    InputStreamReader ir=new InputStreamReader(System.in);
	    BufferedReader br=new BufferedReader(ir);
	    int n=Integer.parseInt(br.readLine());
	    String [] s=br.readLine().split(" ");
	    int arr[]=new int[n];
	    for(int i=0;i<n;i++)
	    {
	    	arr[i]=Integer.parseInt(s[i]);
	    }
	    Arrays.sort(arr);
	    double value=arr[0];
	    for(int i=1;i<n;i++)
	    {
	    	value=((double)value+arr[i])/2;
	    }
	    System.out.println(value);
	  }
}


Measured memory_bytes: 21712
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>

using namespace std;

long long MOD = 1000000007;

template<typename T>
void cout_vec(vector<T> &vec){
    for(int i=0; i<vec.size(); i++){
        if (i!=0){
            cout << ' ';
        }
        cout << vec[i];
    }
    cout << endl;
}

int main(){
    long long K;
    cin >> K;

    long long q=K/50;
    long long r=K%50;

    vector<long long> ans(50,0);
    for(int i=0; i<50; i++){
        if(i<r){
            ans[i]=49+51*(K/50+1)-K;
        }else{
            ans[i]=49+51*(K/50)-K;
        }
    }
    cout << 50 << endl;
    cout_vec(ans);
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
 
int main() {
  int N, K, m;
  cin >> N >> K;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end() );
  m = 0;
  for (int i = 0; i < K; i++) {
    m = m + vec.at(i);
  }
  cout << m << endl;
}

Measured memory_bytes: 3604
#include <cctype>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <cmath>
#define pk putchar(' ')
#define ph puts("")
typedef long long ll;
using namespace std;
template <class T>
void rd(T &x)
{
    x = 0;
    int f = 1;
    char c = getchar();
    while (!isdigit(c)) {if (c == '-') f = -1; c = getchar();}
    while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
    x *= f;
}
template <class T>
void pt(T x)
{
    if (x < 0)
        putchar('-'), x = (~x) + 1;
    if (x > 9)
        pt(x / 10);
    putchar(x % 10 ^ 48);
}
int k, n, m;
int main() 
{
	rd(k), rd(n), rd(m);
	if (n > m)
		swap(n, m);
	if (n % k == 0 || m % k == 0)
		puts("OK");
	else if (k * (n / k + 1) < m)
		puts("OK");
	else
		puts("NG");
    return 0;
}

Measured memory_bytes: 1480