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

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REP1(i, n) for(ll i = 1;i < n;i++)
#define REPR(i, n) for(ll i = n-1;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)

#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())

#define ll long long
#define ALL(a)  (a).begin(),(a).end()

#define pb(a) push_back(a)

ll m,n;


int main(){
  ll ans=0;
  cin >> n >> m;
  vector<ll> a(n),b(n);
  REP(i,n) cin>>a[i]>>b[i];
  vector<ll> c(n);
  REP(i,n)c[i]=a[i]*(65536LL*65536LL)+b[i];
  sort(c.begin(), c.end());
  REP(i,n){
    a[i]=c[i]/(65536LL*65536LL);
    b[i]=c[i]%(65536LL*65536LL);
    
  }
  
  
  REP(i,n){
    if (b[i]<m){
      ans+=a[i]*b[i];
      m-=b[i];
    }else{
      ans+=a[i]*m;
      m-=m;
      break;
    }
  }
  
  
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 2560
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//                       _oo0oo_                         //
//                      o8888888o                        //
//                      88" . "88      ------ hzt1       //
//                      (| -_- |)                        //
//                      0\  =  /0                        //
//                    ___/`---'\___                      //
//                  .' \|     |// '.                     //
//                 / \|||  :  |||// \                    //
//                / _||||| -:- |||||- \                  //
//               |   | \  -  /// |     |                 //
//               | \_|  ''\---/''  |_/ |                 //
//               \  .-\__  '-'  ___/-. /                 //
//             ___'. .'  /--.--\  `. .'___               //
//          ."" '<  `.___\_<|>_/___.' >' "".             //
//         | | :  `- \`.;`\ _ /`;.`/ - ` : | |           //
//         \  \ `_.   \_ __\ /__ _/   .-` /  /           //
//     =====`-.____`.___ \_____/___.-`___.-'=====        //
//                       `=---='                         //
//                                                       //
//                                                       //
//     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       //
//                                                       //
//                 God-He Bless All.                     //
//           This Code Will Never Explode.               //
//                                                       //
//                                                       //
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
#include<cstdio>
#include<cstring>
#include<cctype>
#include<algorithm>
#define rep(i,a,b) for(int i=(a),i##_end_=(b);i<=i##_end_;i++)
#define dwn(i,a,b) for(int i=(a),i##_end_=(b);i>=i##_end_;i--)
using namespace std;
const int Size=1<<16;
char buffer[Size],*head,*tail;
inline char Getchar() {
    if(head==tail) {
        int l=fread(buffer,1,Size,stdin);
        tail=(head=buffer)+l;
    }
    if(head==tail) return -1;
    return *head++;
}
inline int read() {
    int x=0,f=1;char c=Getchar();
    for(;!isdigit(c);c=Getchar()) if(c=='-') f=-1;
    for(;isdigit(c);c=Getchar()) x=x*10+c-'0';
    return x*f;
}
typedef long long ll;
const int maxn=200010;
int n,first[maxn],to[maxn],nxt[maxn],deg[maxn],e;
void AddEdge(int u,int v) {
	to[++e]=v;nxt[e]=first[u];first[u]=e;
	to[++e]=u;nxt[e]=first[v];first[v]=e;
}
int f[maxn],g[maxn]; 
void dp(int x,int fa) {
	f[x]=1;g[x]=0;
	for(int i=first[x];i;i=nxt[i]) if(to[i]!=fa) {
		dp(to[i],x);
		f[x]+=g[to[i]];
		g[x]+=max(f[to[i]],g[to[i]]);
	}
}
int main() {
	n=read();
	rep(i,2,n) AddEdge(read(),read());
	if(n&1) puts("First");
	else {
		dp(1,0);
		puts(max(f[1],g[1])==n/2?"Second":"First");
	}
	return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include <bits/stdc++.h>
#include <math.h>

using namespace std;

int main(){
    int n;
    cin>>n;
    vector<int> q(n);
    for(int i=0;i<n;i++) cin>>q.at(i);
    int m;
    cin>>m;
    
    for(int i=0;i<m;i++){
        int p,x;
        cin>>p>>x;
        vector<int> hoge=q;
        hoge.at(p-1)=x;
        int ans=0;
        
        for(auto a:hoge) ans+=a;
        
        cout<<ans<<endl;
    }
    
    return 0;
}

Measured memory_bytes: 256
S = list(input())
N = len(S)

if S[0] == 'A':
    ac = 1
else:
    ac = 0

ans = 0
for i in range(1,N):
    if S[i] == 'A':
        if S[i-1] != 'A':
            ac = 1
        else:
            ac += 1
    elif S[i] == 'B':
        if S[i-1] != 'A':
            ac = 0
    else:
        if S[i-1] == 'B':
            ans += ac
            S[i] = 'A'
        else:
            ac = 0

print(ans)



Measured memory_bytes: 4840
#include<bits/stdc++.h>
//#include<unordered_map>
#define mem(a,b) memset(a,b,sizeof(a))
#define rep(i,a,n) for(int i=a; i<n; ++i)
#define rep1(i,a,n) for(int i=n-1; i>=a; --i)
#define sd(a) scanf("%d",&a)
#define sf(a) scanf("%lf",&a)
#define sll(a) scanf("%lld",&a)
#define test(a) cout<<a<<endl
#define test2(a,b) cout<<a<<" "<<b<<endl
#define inf(a) memset(a,0x3f,sizeof(a))
#define While(a) for(;a;)
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;
const int N=1e5+10;
const ll  MAXN=1e18;
const int MAX=1e5+10;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3f;
const double eps=1e-7;


inline void solve(){
    int n;
    sd(n);
    int ans=0;
    rep(i,0,n){
        int temp;
        sd(temp);
        ans+=temp-1;
    }
    printf("%d\n",ans);
    return ;
}
//int t=1;
int main(){
#ifdef local
    freopen("in.txt","r",stdin);
//    freopen("in.txt","w",stdout);
#endif
    int casen=1;
//    IOS;
//    cin >> casen;
//    sd(casen);
//    init();
    int t=1;
//    init();
    While(casen--){
//        printf("Case %d: ",t++);
//          cout << "Case "<< t++ << ": ";
//        test(qpow(2,10));
        solve();
    }
    fclose(stdin);
    return 0;
}


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

int main()
{
	int H,n;
	cin>>H>>n;
	int a[n],sum=0;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		sum+=a[i];
	}
	if(sum>=H)
		cout<<"Yes\n";
	else
		cout<<"No\n";
	return 0;
}

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

int main() {
  int D,N;
  cin >> D >> N;
 
  if (D == 0){
    if (N == 100){
      cout << 101 << endl;
    }
    else {
      cout << N << endl;
    }
  }
 
  else if (D == 1){
    if (N == 100){
      cout << 10100 << endl;
    }
    else {
      cout << 100 * N << endl;
    }
  }
  else {
    if (N == 100){
      cout << 1010000 << endl;
    }
    else {
      cout << 10000 * N << endl;
    }
  }
}

Measured memory_bytes: 3568
#include<stdio.h>

#include<string.h>

#include<math.h>
long long sum(long long x){
return x*(x+1)/2;}


int main(){

long long n,k;

scanf("%lld%lld",&n,&k);


long long a,b=n,c,d=0,maxsum=0,minsum=0,ans=0;
for(a=k;a<=n;a++){
 maxsum=sum(n)-sum(n-a);
 minsum=sum(a-1);
 ans+=maxsum-minsum+1;
 b=n;d=0;maxsum=0,minsum=0;
}

printf("%lld\n",(ans+1)%1000000007);



return 0;}

Measured memory_bytes: 1732
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}

int main(){
    ll N;
    string S,T;
    cin >> S >> T;
    N = S.size();
    //map<ll,ll>mp[26], trans;
    vector<ll> v(26,-1), u(26,-1);
    rep(i,N){
        ll s = S[i] - 'a';
        ll t = T[i] - 'a';
        if(v[s] != -1 || u[t] != -1){
            if(v[s] != t || u[t] != s){
                cout << "No" << endl;
                return 0;
            }
        }else{
            v[s] = t;
            u[t] = s;
        }
        //if(S[i] != T[i]){
        //mp[S[i]-'a'][T[i]-'a']++; 
        //mp[T[i]-'a'][S[i]-'a']++;
            //trans[S[i]] = T[i];
            //trans[T[i]] = S[i];
        //}
    }
    /*bool flag = true;
    rep(i,26){
        if(mp[i].size() > 1){
            flag = false;
            break;
        }
    }
    /*
    if(flag){
        rep(i,N){
            S[i] = trans[S[i]];
        }
    }
    flag = (S == T);*/

    cout << "Yes" << endl;
}

Measured memory_bytes: 776
#include <bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(), (v).end()

string s,t;
 
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
 
	cin>>s>>t;
	reverse(ALL(t));
	if(s==t) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
 
	return 0;
}

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

signed main(){
    // cout << fixed << setprecision(10) << flush;

    int n;
    cin >> n; 

    int prod = 1;
    vector<int> a(n);
    for(int i=0; i<n; i++){
        cin >> a[i];
        if(a[i] == 0){
            cout << 0 << endl;
            return 0;
        }
    }
    for(int i=0; i<n; i++){
        if(log10(prod) + log10(a[i]) >= 18.01){
            cout << -1 << endl;
            return 0;
        }
        else if(prod * a[i] > 1000000000000000000){
            cout << -1 << endl;
            return 0;
        }
        else{
            prod *= a[i];
        }
    }
    cout << prod << endl;

    return 0;
}

Measured memory_bytes: 4040
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <utility>
#include <vector>
#include <list>
#include <algorithm>
using namespace std;

int main()
{
    long long int N;
    scanf("%lld", &N);

    long long int N1 = N;
    long long int d = 1;
    long long int sum = 0;
    while (N1 > 0)
    {
        long long int x = (N1 / d) % 10;
        N1 -= x * d;
        sum += x;
        d *= 10;
    }

    if (N % sum == 0)
        printf("Yes");
    else
        printf("No");
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template<size_t I,class H,class...T>struct TupleReaderWriter{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple_cat(tuple<H>(v),TupleReaderWriter<sizeof...(T)-1,T...>::r(i));}static void w(ostream&o,tuple<H,T...>&t,string d){TupleReaderWriter<I-1,H,T...>::w(o,t,d);o<<d<<get<I>(t);}};
template<class H,class...T>struct TupleReaderWriter<0,H,T...>{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple<H>(v);}static void w(ostream&o,tuple<H,T...>&t,string d){o<<get<0>(t);}};
template<class...T>istream&operator>>(istream&i,tuple<T...>&t){t=TupleReaderWriter<sizeof...(T),T...>::r(i);return i;}
template<class...T>ostream&operator<<(ostream&o,tuple<T...>&t){string delim=" ";TupleReaderWriter<sizeof...(T)-1,T...>::w(o,t,delim);return o;}
template<class T>istream&operator>>(istream&i,vector<T>&v){for(auto&x:v)i>>x;return i;}
template<class T>ostream&operator<<(ostream&o,vector<T>&v){string delim="";for(auto&x:v)o<<delim<<x,delim=" ";return o;}
template<class T>using rev_priority_queue=priority_queue<T,vector<T>,greater<T>>;
template<class T>using vector2d=vector<vector<T>>;
struct fixprec{int x;fixprec(int d):x(d){}};
ostream&operator<<(ostream&o,fixprec f){return o<<fixed<<setprecision(f.x);}
void R_YESNO(bool p) { cout << (p ? "YES" : "NO") << endl; }
void R_YesNo(bool p) { cout << (p ? "Yes" : "No") << endl; }
int main() {
    i64 N, K;
    cin >> N >> K;
    vector<i64> A(N), S(N + 1);
    for(auto &x : A) {
        cin >> x;
        x = (x - 1 + K) % K;
    }
    S[0] = 0;
    for(int i = 1; i <= N; i++) {
        S[i] = (A[i - 1] + S[i - 1]) % K;
    }
    i64 ans = 0;
    map<int, int> m;
    queue<i64> q;
    for(int i = 0; i <= N; i++) {
        q.push(S[i]);
        ans += m[S[i]];
        m[S[i]]++;
        if(q.size() >= K) {
            m[q.front()]--;
            q.pop();
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 14336
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const ll INF = 1e14;
const ll MOD = 1000000007;
const double PI = 3.1415926535897;

signed main() {
    int N;
    cin >> N;
    vector<string> vec(N);
    for(int i = 0;i < N;i++) {
        cin >> vec.at(i);
    }
    int ret = 0;
    for(int i = 0;i < N;i++) {
        if(vec.at(i) == "E869120") {
            ret++;
        }
    }
    cout << ret << endl;
}


Measured memory_bytes: 3284
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  int h,w,hd,wd;
  cin >> h >> w >> hd >> wd;
  cout << ((h-hd)*(w-wd)) << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int ap[100005];
int main()
{
    ios_base::sync_with_stdio(false);
    int n,i,a,m1=0,ma;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>a;
        if(a==0)
        {
            m1++;
            ap[0]++;
            ap[1]++;
        }
        else
        {
            ap[a-1]++;
            ap[a]++;
            ap[a+1]++;
        }
    }
    ma=m1;
    for(i=0;i<=100000;i++)
        if(ap[i]>ma)
            ma=ap[i];
    cout<<ma;
    return 0;
}


Measured memory_bytes: 640
/*بسم الله الرحمن الرحيم*/
/*“Dengan menyebut nama Allah yang Maha Pengasih lagi Maha Penyayang”*/
/*“In the name of Allah, Most Gracious, Most Merciful”*/
/********************************************************************************************************\__
                                                                                                          |
        author  :   Althafa Dhia Syauqi   ||    email   :    daltafa@gmail.com                              ||
        SMAN 10 Samarinda, Kalimantan Timur.                                                    ||
                                                                                                          ||
/********************************************************************************************************/
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define rep_k(i,n) for(int x=i;x<n;x++)
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep_n(i,n) for(int i=1;i<=(n);i++)
#define rep_all(k) for(auto x:k)
#define endl '\n'
#define mod 1e9+7
#define pb push_back
#define READ(f)         freopen(f, "r", stdin)
#define WRITE(f)        freopen(f, "w", stdout)
#define maxSort         sort(all(v),greater<int>())
#define rSort           sort(v.rbegin(),v.rend())
#define FOREACH(i,c) for (typeof((c).end()) i = (c).begin(); i != (c).end(); ++i)
#define RESET(c,v) memset(c, v, sizeof(c))
#define sqr(x)          ((x)*(x))
#define qube(x)         ((x)*(x)*(x))
using namespace std;
void optimization()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
string a;
ll ans=0;
int main()
{
	optimization();
        cin >> a;
rep(i,a.length())
{
   if(a[i]=='2')
     ans++;
}
  cout <<ans<<endl;
	return 0;
}

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

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

template<class T> vector<T> make_vec(size_t a) { return vector<T>(a); }
template<class T, class... Ts> auto make_vec(size_t a, Ts... ts) {
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template<class T, class V>
typename enable_if<is_class<T>::value == 0>::type fill(T &t, const V &v) {
    t = v;
}
template<class T, class V>
typename enable_if<is_class<T>::value != 0>::type fill(T &t, const V &v){
    for (auto &e : t) fill(e, v);
}

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }

#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }


int N;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    while (cin >> N) {
        vector<pair<pair<string,int>, int> > v(N);
        for (int i = 0; i < N; ++i) {
            string a;
            int b;
            cin >> a >> b;
            v[i] = make_pair(make_pair(a, -b), i);
        }
        sort(v.begin(), v.end());

        for (int i = 0; i < N; ++i) {
            cout << v[i].second + 1 << endl;
        }
    }
                          
                                              
    
}


















Measured memory_bytes: 256
n =int(input())
a = list(map(int, input().split()))
b = 1
if 0 in a:
  print(0)
else:
  for i in range(0,n):
    b *= a[i]
    if b > 10**18:
      print(-1)
      break
  if b <= 10**18:
    print(b)


Measured memory_bytes: 21768
#include<cstdio>
long long num[100500],L;
int n;
int main(){
	scanf("%d%lld",&n,&L);
	for(int i=1;i<=n;i++)
		scanf("%lld",&num[i]);
	for(int i=1;i<n;i++)
		if(num[i]+num[i+1]>=L){
			puts("Possible");
			for(int j=1;j<=i-1;j++)
				printf("%d\n",j);
			for(int j=n-1;j>=i+1;j--)
				printf("%d\n",j);
			printf("%d\n",i);
			return 0;
		}
	puts("Impossible");
}

Measured memory_bytes: 1536
import sys
input = sys.stdin.readline
sys.setrecursionlimit(200000)


def read():
    A, B, C, K = map(int, input().strip().split())
    return A, B, C, K


def solve(A, B, C, K):
    score = 0
    if K <= A:
        return K
    score = A
    K -= A
    if K <= B:
        return A
    K -= B
    return score - K


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


Measured memory_bytes: 9224
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int p = sc.nextInt();
		boolean bruh = false;
		for (int i = 1 ; i <= 9 ; i ++) {
			if (bruh) { break;}
			for (int q = 1 ; q <= 9 ; q++) {
				if (p == (i*q)) {
					System.out.println("Yes");
					bruh = true;
					break;
				}
			}
		}
		if (false == bruh){
		System.out.println("No");
		}
	}
}


Measured memory_bytes: 23764
import java.util.Scanner;

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

        Scanner sc = new Scanner(System.in);
        int[] m, f, r;
        int i, k;

        m = new int[50];
        f = new int[50];
        r = new int[50];

        i=0;
        while(true){
            if(i == 50){break;}

            m[i] = sc.nextInt();
            f[i] = sc.nextInt();
            r[i] = sc.nextInt();

            if(m[i] == -1 && f[i] == -1 && r[i] == -1){break;}

            i++;
        }

        for(k=0;k<i;k++){
            if(m[k] == -1 || f[k] == -1){
                System.out.println("F");
            }else if( m[k]+f[k] >= 80 ){
                System.out.println("A");
            }else if( m[k]+f[k] >= 65 ){
                System.out.println("B");
            }else if( m[k]+f[k] >= 50 ){
                System.out.println("C");
            }else if( m[k]+f[k] >= 30 ){
                if(r[k] >= 50){
                    System.out.println("C");
                }else{
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            }
        }
    }
}



Measured memory_bytes: 26156
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,sum=0,ma=0;
    cin>>n;
    int a;
    for(int i=0;i<n;i++){
        cin>>a;
        sum+=a;
        ma=max(ma,a);
    }
    if(sum-ma>ma){
        cout << "Yes"<<endl;
    }
    else{
        cout << "No"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(signed i=0;i<n;++i)
#define repi(n) rep(i,n)
#define int long long
#define str string
#define vint vector<int>
#define pint pair<int,int>
#define pb(a) push_back(a)
#define all(v) v.begin(),v.end()
#define yn(b) cout<<((b)?"Yes":"No")<<endl
#define YN(b) cout<<((b)?"YES":"NO")<<endl
#define call(a) for(auto t:a)cout<<t<<" ";cout<<endl
#define ENDL printf("\n");
#define debg(a) cout<<#a<<":"<<a<<endl;
#define SORT(a) sort(all(a));
#define INF 1LL<<60
#define out(i) cout<<i<<endl;

signed main(){
  int n,k;
  cin>>n>>k;
  vector<pair<int,int>> ab(n);
  repi(n)cin>>ab[i].first>>ab[i].second;
  SORT(ab);
  rep(i,n){
    k-=ab[i].second;
    if(k<=0){cout<<ab[i].first<<endl;return 0;}
  }

  return 0;
}



Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define int long long
using namespace std;
struct UnionFind{
  vector<int> par,rank;
  UnionFind(int N){
    par.resize(N);
    rank.resize(N);
    for(int i=0;i<N;i++){
      par[i]=i;
      rank[i]=1;
    }
  }
  int find(int x){
    if(par[x]==x)
      return x;
    else{
      int y=find(par[x]);
      par[x]=y;
      return y;
    }
  }
  void unite(int x,int y){
    int x2=find(x),y2=find(y);
    if(x2==y2)
      return;
    if(rank[x2]>=rank[y2])
      par[y2]=x2,rank[x2]=max(rank[x2],rank[y2]+1);
    else
      par[x2]=y2;
  }
  bool same(int x,int y){
    return find(x)==find(y);
  }
};
signed main(){
  int N,M;
  cin>>N>>M;
  vector<vector<int>> A(M);
  for(int i=0;i<N;i++){
    int K;
    cin>>K;
    for(int j=0;j<K;j++){
      int L;
      cin>>L;
      A[L-1].push_back(i);
    }
  }
  UnionFind B(N);
  for(int i=0;i<M;i++)
    for(int j=1;j<A[i].size();j++)
      B.unite(A[i][j-1],A[i][j]);
  int cnt=0;
  for(int i=0;i<N;i++)
    if(B.par[i]==i)
      cnt++;
  cout<<(cnt==1?"YES":"NO")<<endl;
}

Measured memory_bytes: 8160
#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 KnightX[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
int KnightY[] = { 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=3e5+10,oo=0x3f3f3f3f,MOD=100000000;
const long double PI = acos(-1),eps=1.0e-14;

void solve(){
    int a,b;
    cin>>a>>b;
    cout<<(a+b)%24;
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast();
    solve();
}


Measured memory_bytes: 3596
import math

N = int(input())

n = math.floor(N **(1/2))
list =[]

for a in range(1,n+1):
    if N % a  != 0:
        pass
    else:
        b = int(N/a)
        #print(a,b)
        m = max( len(str(a)), len(str(b)) )
        list.append(m)

#print(list)
print(min(list))

Measured memory_bytes: 3188
while True:
    n,x = map(int, input().split())
    if n == 0 and x == 0:
        break
    c = 0
    for i in range(1, n+1):
        for j in range(i+1, n+1):
            if x-i-j <= j:
                break
            if x-i-j > n:
                continue
            c += 1
    print(c)

Measured memory_bytes: 7576
#include<bits/stdc++.h>
#include <ext/pb_ds/detail/standard_policies.hpp>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define int long long
#define pb push_back 
#define ins insert
#define rs resize
#define br break;
#define cont continue;
#define vi vector<ll>
#define vll vector<long long>
#define si set<ll>
#define sll set<long long>
#define pii pair<ll,ll>
#define pll pair<long long, long long>
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);
#define vec vector
#define cend cout<<endl;
#define sc second
#define fr first
#define retz return 0;
#define ll_MAX (ll)(1e9*1e9)
#define ll_MIN (ll)(-1e9*1e9)
#define lb lower_bound
#define ub upper_bound
#define rep(i,a,b)  for(int i=a; i<=b; i++)
#define repd(i,a,b) for(int i=a; i>=b; i--)
#define ps(arr, n) for(int i=1; i<n; i++)arr[i]+=arr[i-1];
#define inp(arr, n)for(int i=0; i<n; i++)cin>>arr[i];
#define out(arr, n)for(int i=0; i<n; i++)cout<<arr[i];
#define inp1(arr,n,m)for(int i=0; i<n; i++)for(int j=0;j<m;j++)cin>>arr[i][j];
#define out1(arr,n,m)for(int i=0; i<n; i++)for(int j=0;j<m;j++)cin>>arr[i][j];
#define loop(q) for(auto it:q)
#define loop1(q) for(auto&it:q)
#define db1 cout << "*" << endl
#define db2 cout << "YES" << endl
using namespace std;
using namespace __gnu_pbds; 
#define oset(X) tree<X,null_type,less<X>, rb_tree_tag, tree_order_statistics_node_update> 
#define roset(X) tree<X,null_type,greater<X>, rb_tree_tag, tree_order_statistics_node_update>  
#define okey order_of_key //lower_bound_set
#define ofind find_by_order
#define cyes cout << "Yes" << endl;
#define cno cout << "No" << endl;
#define mod 1000000007
#define mod2 998244353
#define INT_MAX1 900000000
//////////////////////////////////////////////////////////////////////////////////////////////

int n;
int arr[3001];
int dp[3001][3001][2];
bool v[3001][3001][2];

int s1(int i, int j, bool turn)
{
    if(i==j)
        if(turn)
            return -1*arr[i];
        else
            return arr[i];
    if(v[i][j][turn])
        return dp[i][j][turn];
    v[i][j][turn] = 1;
    if(!turn)
    {
        dp[i][j][turn] = max(arr[i]+s1(i+1,j,!turn),arr[j]+s1(i,j-1,!turn));
    }
    else
    {
        dp[i][j][turn] = min(-1*arr[i]+s1(i+1,j,!turn),-1*arr[j]+s1(i,j-1,!turn));
    }

    return dp[i][j][turn];

}

void solve()
{
    cin >> n;
    inp(arr,n);
    cout << s1(0,n-1,0);
}

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

Measured memory_bytes: 158208
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define mod 1000000007
#define ff first
#define ss second
#define INF (int)1e9+1
#define INFLL (int)1e18+1
#define sz(bb) (int)bb.size()
#define all(qq) qq.begin(), qq.end() 
#define Max(a, b, c) max(a, max(b, c))
#define Min(a, b, c) min(a, min(b, c))
const double PI=acos(-1);
// #define int unsigned long long int//used when x<2^64-1 && x>0
#define int long long//used when x<2^63-1
//bool cmp if returns true it keeps 1st as first else swaps
typedef long long  ll;

const int N=1000001;
void solve()
{
    int n;
    cin>>n;
    string ans="";
    while(n)
    {
        n--;
        int cur=n%26;
        ans=(char)(cur+'a')+ans;
        n/=26;
    }
    cout<<ans<<"\n";
}
int32_t main()
{
    IOS;
    int t;
    // cin>>t;
    t=1;
    while(t--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3656
import std.conv, std.functional, std.range, std.stdio, std.string;
import std.algorithm, std.array, std.bigint, std.complex, std.container, std.math, std.numeric, std.regex, std.typecons;
import core.bitop;

class EOFException : Throwable { this() { super("EOF"); } }
string[] tokens;
string readToken() { for (; tokens.empty; ) { if (stdin.eof) { throw new EOFException; } tokens = readln.split; } auto token = tokens.front; tokens.popFront; return token; }
int readInt() { return readToken.to!int; }
long readLong() { return readToken.to!long; }
real readReal() { return readToken.to!real; }

bool chmin(T)(ref T t, in T f) { if (t > f) { t = f; return true; } else { return false; } }
bool chmax(T)(ref T t, in T f) { if (t < f) { t = f; return true; } else { return false; } }

int binarySearch(alias pred, T)(in T[] as) { int lo = -1, hi = cast(int)(as.length); for (; lo + 1 < hi; ) { const mid = (lo + hi) >> 1; (unaryFun!pred(as[mid]) ? hi : lo) = mid; } return hi; }
int lowerBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a >= val)); }
int upperBound(T)(in T[] as, T val) { return as.binarySearch!(a => (a > val)); }


enum MO = 10L^^9 + 7;

void main() {
  try {
    for (; ; ) {
      const N = readInt();
      const K = readLong();
      auto A = new int[N];
      foreach (i; 0 .. N) {
        A[i] = readInt();
      }
      
      long ans;
      
      long inside;
      foreach (i; 0 .. N) foreach (j; i + 1 .. N) {
        if (A[i] > A[j]) {
          ++inside;
        }
      }
      ans += inside * K;
      ans %= MO;
      
      foreach (i; 0 .. N) {
        long cnt;
        foreach (j; 0 .. N) {
          if (A[j] < A[i]) {
            ++cnt;
          }
        }
        ans += cnt * ((K * (K - 1) / 2) % MO);
        ans %= MO;
      }
      
      writeln(ans);
    }
  } catch (EOFException e) {
  }
}


Measured memory_bytes: 380
using System;
public class Hello{
    public static void Main(){
       string N = Console.ReadLine();
       if(N.Substring(0,1) == N.Substring(1,1) && N.Substring(1,1) == N.Substring(2,1)){
           Console.WriteLine("Yes");
       }else if(N.Substring(1,1) == N.Substring(2,1) && N.Substring(2,1) == N.Substring(3,1)){
           Console.WriteLine("Yes");
       }else{
           Console.WriteLine("No");
       }
    }
}

Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
#define SUM a*b*c

int main(void){
    long long int a,b,c;
    cin >> a >> b >> c;
    long long int d[3] = {};
    d[0] = abs((a/2)*b*c - (SUM - ((a/2)*b*c)));
    d[1] = abs(a*(b/2)*c - (SUM - (a*(b/2)*c)));
    d[2] = abs(a*b*(c/2) - (SUM - (a*b*(c/2))));
    sort(d,d+3);
    cout << d[0];
}

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

// 割引率は1枚につき50%
// 品物を最も安く買える割引券の使い方を見つけたい
// ⇒ 割引券はできる限り割り引かれる値段が大きくなるように使われるはず
// ⇒ 1枚ずつ最も価格の大きな品物に適用していく
int main() {
  uint64_t N, M;
  std::cin >> N >> M;

  std::priority_queue<uint64_t> prices;
  for (uint64_t i = 0; i < N; ++i) {
    uint64_t price;
    std::cin >> price;
    prices.push(price);
  }

  // 割引券を1枚ずつ最も大きな価格の品物に適用する
  for (uint64_t i = 0; i < M; ++i) {
    const uint64_t price = prices.top() / 2;
    prices.pop();
    prices.push(price);
  }

  uint64_t result = 0;
  while (!prices.empty()) {
    result += prices.top();
    prices.pop();
  }

  std::cout << result;

  return 0;
}


Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define N 200100
#define pii pair<int,int>
#define rep(i,k,n) for(int i=k;i<n;i++)
#define vi vector<int>
#define inf 1e9
void solve(){
	
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	string s;
	cin>>s;
	int len=s.length();
	rep(i,0,len){
		cout<<"x";
	}
}

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

public class Main {	

	private static void solve(){
		//Implement solution here.
		int N = ni();
		int K = ni();
		long mod = 1000000007;
		long result = 0;
		for(int i = 0; i <= N + 1 - K; i++) {
			long num = (long)K + (long)i;
			long min = (num - 1) * num / 2;
			long max = (long)N * ((long)N + 1) / 2 - ((long)N - num) * ((long)N - num + 1) /2; 
			result = ((result % mod) + ((max - min + 1) % mod))%mod;
		}
		System.out.println(result);
	}
	
	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		boolean hasNext = true;
		while(hasNext){
			solve();	
			try{
				br.mark(1);
				if(br.read() > 0){
					br.reset();			
					System.out.println("---");
				} else {
					hasNext = false;
				}
			}catch(Exception e){
				throw new RuntimeException(e);
			} 
		}
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

Measured memory_bytes: 25848
import math

N = int(input())

if N % 1.08 == 0:
  print(N // 1.08)
else:
  X1 = math.floor(N / 1.08)
  X2 = X1 + 1
  Y1 = math.floor(X1 * 1.08)
  Y2 = math.floor(X2 * 1.08)
  if N == Y1:
    print(X1)
  elif N == Y2:
    print(X2)
  else:
    print(':(')

Measured memory_bytes: 3060
import scala.io.{StdIn => in}
import scala.collection.{mutable => mu}

object Main extends App {
  import MapHelper._
  val map = mu.HashMap.empty[Int,Int]
  val n = in.readInt
  in.readLine.split(" ").map(_.toInt)
    .foreach(i => map.addOrUpdate(i,1))

  val ans = map.keys./:(0L)((acc,i) => {
    if(map(i) >= i) acc + map(i) - i
    else acc + map(i)
  })

  println(ans)
  object MapHelper {
    implicit class AddOrUpdate[A](map:mu.HashMap[Int,Int]) {
      def addOrUpdate(key:Int, value:Int):mu.HashMap[Int,Int] =
      {
        if(map.contains(key)) map(key) += value
        else map += (key -> value)
        map
      }
    }
  }
}

Measured memory_bytes: 52792
import heapq
n = int(input())
v = list(map(int,input().split()))
heapq.heapify(v)
for _ in range(n-1):
    x = heapq.heappop(v)
    y = heapq.heappop(v)
    heapq.heappush(v,(x+y)/2)
print(v[0])

Measured memory_bytes: 3060
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define END {}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int,int> P;
struct edge{int to,cost;};
const int INF=100000000000000000;
const int INF2=9223372036854775807;
const int MOD=1000000007;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define min(X,Y) (((int)(X)<(int)(Y))?(X):(Y))
#define max(X,Y) (((int)(X)>(int)(Y))?(X):(Y))
#define MAX(X,Y) (*max_element(X,Y))
#define MIN(X,Y) (*min_element(X,Y))
#define NP(X,Y) next_permutation(X,Y)



signed main(){
	string S;
	cin>>S;
	int a=stoll(S.substr(0,2));
	int b=stoll(S.substr(2,2));
	if(1<=a&&a<=12&&1<=b&&b<=12){
		cout<<"AMBIGUOUS"<<endl;
	}
	else if(1<=b&&b<=12){
		cout<<"YYMM"<<endl;
	}
	else if(1<=a&&a<=12){
		cout<<"MMYY"<<endl;
	}
	else{
		cout<<"NA"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <set>
#define INF 1000000000
#define LLINF 2000000000000000
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define LOOP(i,N) for(int i=0;i<N;i++)
#define LOOP1(i,N) for(int i=1;i<=N;i++)
typedef pair<int,int> P;
typedef pair<int,pair<int,int> > PP;
// #define int long long

signed main(){
  int a,b;
  cin >> a >> b;
  cout << 6-a-b << endl;
}


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

const int MAX_W = 1e+5;

int main()
{
  int N, W;
  cin >> N >> W;
  int w[N + 1], v[N + 1];
  for (int i = 1; i <= N; i++)
  {
    cin >> w[i] >> v[i];
  }

  long long int dp[N + 1][W + 1];
  for (int i = 1; i <= N; i++)
  {
    for (int j = 0; j <= W; j++)
    {
      dp[i][j] = -1;
    }
  }

  dp[1][0] = 0;
  dp[1][w[1]] = v[1];

  for (int i = 1; i <= N - 1; i++)
  {
    for (int j = 0; j <= W; j++)
    {
      if (dp[i][j] != -1)
      {
        dp[i + 1][j] = max(dp[i][j], dp[i + 1][j]);
        if (j + w[i + 1] <= W)
        {
          dp[i + 1][j + w[i + 1]] =
              max(dp[i][j] + v[i + 1], dp[i + 1][j + w[i + 1]]);
        }
      }
    }
  }

  long long int max_v = 0;
  for (int j = 0; j <= W; j++)
  {
    max_v = max(max_v, dp[N][j]);
  }
  cout << max_v << endl;
  // for (int i = 1; i <= N; i++)
  // {
  //   for (int j = 0; j <= W; j++)
  //   {
  //     cout << dp[i][j] << " ";
  //   }
  //   cout << endl;
  // }
}

Measured memory_bytes: 78336
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ull B = 100000007;
int mod = 1000000007;

class Solution {
public:
    int res = 0;
    int lim;
    int n, m, k;
    vector<string> tb;
    int c(int n, int m, int k) {
        this->n = n; this->k = k; this->m = m;
        this->lim = n + m;
        tb.resize(n);
        for(int i = 0; i < n; ++i) {
            cin >> tb[i];
        }
        dfs(0);
        return res;
    }

    int getb() {
        int ret = 0;
        for(int i = 0; i < n; ++i) {
            for(int j = 0; j < m; ++j) {
                if(tb[i][j] == '#') {
                    ret++;
                }
            }
        }
        return ret;
    }

    void dfs(int st) {
        int c = getb();
        if(c < k) {
            return;
        }
        if(c == k) {
            res++;
            //return;
        }
        for(int i = st; i < lim; ++i) {
            string tmp = "";
            if(i < n) {
                tmp = tb[i];
                for(int i1 = 0; i1 < m; ++i1) {
                    tb[i][i1] = 'R';
                }
                dfs(i + 1);
                for(int i1 = 0; i1 < m; ++i1) {
                    tb[i][i1] = tmp[i1];
                }
            }
            else {
                for(int i1 = 0; i1 < n; ++i1) {
                    tmp += tb[i1][i - n];
                    tb[i1][i - n] = 'R';
                }
                dfs(i + 1);
                for(int i1 = 0; i1 < n; ++i1) {
                    tb[i1][i - n] = tmp[i1];
                }
            }
        }
    }

};

int main() {
    int n, m, k;
    cin >> n >> m >> k;
    Solution zhy;
    cout << zhy.c(n, m, k) << endl;
    return 0;
}

Measured memory_bytes: 3552
using System;

namespace ITP1_6_B
{
    class Program
    {
        static void Main(string[] args)
        {
            Trump[] trump = new Trump[4];
            trump[0] = new Trump('S');
            trump[1] = new Trump('H');
            trump[2] = new Trump('C');
            trump[3] = new Trump('D');

            int havenumber = int.Parse(Console.ReadLine());
            for(int i = 0; i < havenumber; i++)
            {
                string[] input = Console.ReadLine().Split(' ');
                int mark = -1;
                switch (input[0])
                {
                    case "S":mark = 0; break;
                    case "H":mark = 1; break;
                    case "C":mark = 2; break;
                    case "D":mark = 3; break;
                    default: break;                           
                }
                if (mark > -1) trump[mark].SearchShortage(Convert.ToInt32(input[1]));
            }
            foreach (var t in trump)
                t.ShowCards();            
        }
    }
    class Trump
    {
        public char Mark { get; set; }
        private bool[] card = new bool[13];

        public Trump(char mark) { Mark = mark; }

        public void SearchShortage(int x) { card[x - 1] = true; }              
        public void ShowCards()
        {
            int number = 1;
            foreach(var j in card)
            {
                if (!j) Console.WriteLine(Mark + " " + number);
                number++;
            }
        }
    }
}

Measured memory_bytes: 9228
def solve(n):
    if n % 2 == 1:
        return 0
    else:
        x = sum(n // (10**i) for i in range(1, 20))
        x += sum(n // ((5**i) * 10) for i in range(1, 100))
        x -= sum(n // ((10**i) * 10) for i in range(1, 100))
        return x

n = int(input())
print(solve(n))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a,b,c,d,e;
  
  cin >> a >> b >>c;
  e=c-a-b;
  d=e*e-4*a*b;
  
  if(e>=0 && d>0) cout << "Yes" << endl;
  else cout << "No"<< endl;
  
  return 0;
}

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

int main() {
  int n, l, ans = 0, temp = 1e7;

  cin >> n >> l;

  for (int i = 0; i < n; i++) {
    ans += l + i;
    if (abs(temp) > abs(l + i)) temp = l + i;
  }

  cout << ans - temp;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define w(t) int t;cin>>t;while(t--)
#define pb   push_back
#define mk   make_pair
#define u_s  unordered_set
#define endl "\n"
#define prDouble(x) cout<<fixed<<setprecision(10)<<x
#define ll long long int
#define ipair pair<int,int>
#define all(x) (x).begin(), (x).end()

const int mod=pow(10,9)+7;

bool compare(pair<int,int>p1,pair<int,int>p2){
    return p1.second<p2.first;
}
/*
  ll C(ll n,ll k){
  
  if(k>n)return 0;
  
  ll ans=1;

  if(k>n-k)
    k=n-k;
  for(ll i=1;i<=k;i++)
    ans*=(n-i+1),ans/=i;

  return ans;
  }
  unsigned long long fact(long long a)
  {
  unsigned long long res=1;
  for(long long i=a;i>0;i--)
    res*=i;
  return res;
  }
  unsigned long long comb(long long a,long long b)
  {
  if((a-b)<b) b=a-b;
  if(a<=19) return fact(a)/(fact(a-b)*fact(b));
  if(a==b||b==0) return 1;
  if(b==1) return a;
  return comb(a-1,b-1)+comb(a-1,b);
  }
*/
vector<int>tree[100005];
ll dp[100005];

ll dfs(int src){
  
    if(tree[src].size()==0)return 1;
  
    if(dp[src]!=-1)return 1+dp[src];
  
    for(int child:tree[src]){
        
        dp[src]=max( dp[src],dfs(child));  
        
    }
    return 1+dp[src];
}

void solve(){
  
  memset(dp,-1,sizeof dp);  
    int n,m; cin>>n>>m;

    for(int i=0;i<m;i++){

      int u,v; cin>>u>>v;
       tree[u].pb(v);    
    }
    for(int i=1;i<=n;i++)
    dfs(i);
  

    ll ans =*max_element(dp,dp+n+1);
  if(ans==-1)cout<<0;
  else
    cout<<ans<<endl;
 }
int main(){

 

    ios_base::sync_with_stdio(false); 
    cin.tie(nullptr); 
    cout.tie(nullptr);
        
    solve();

    return 0;  
    
}


Measured memory_bytes: 11832
# -*- coding: utf-8 -*-


def run_prime_factorization(max_number: int) -> dict:
    '''Run prime factorization.
    Args:
        max_number: Int of number (greater than 1).
    Returns:
        A dictionary's items ((base, exponent) pairs).
    Landau notation: O(log n)
    '''

    from math import sqrt

    ans = dict()
    remain = max_number

    for base in range(2, int(sqrt(max_number)) + 1):
        if remain % base == 0:
            exponent_count = 0

            while remain % base == 0:
                exponent_count += 1
                remain //= base

            ans[base] = exponent_count

    if remain != 1:
        ans[remain] = 1

    return ans


def main():
    import sys
    input = sys.stdin.readline
    n = int(input())

    p = run_prime_factorization(n)
    ans = 0

    for _, value in p.items():
        count = 0

        for i in range(1, 40):
            if (i * (i + 1)) <= 2 * value:
                count += 1

        ans += count

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9208
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
	int n,sum=0;
	cin>>n;
	int a[n];
	for(int i=0; i<n; i++)
	{
		cin>>a[i];
		sum+=a[i];
	}
	sum-=n;
	cout<<sum;
}


Measured memory_bytes: 256
#!/usr/bin/ruby
n,k=gets.split.map(&:to_i)
s=gets.chomp.chars.map{|c|c==?A ? 0 : 1}
f=false
i=0
while i<n&&k>0
	if (s[i]==0)^f
		s[i]=f ? 0 : 1
	else
		f^=true
		s[n+i]=f ? 1 : 0
		i+=1
	end
	k-=1
end
if 0<k
	if n%2>0
		print (s[i]==0)^f^(k%2>0) ? ?A : ?B
	end
	puts 'BA'*(n/2)
else
	puts s[i,n].map{|c|(c==0)^f ? ?A : ?B}*''
end


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

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

    for (int i = s.size()-2; i > 0; i -= 2) {
        int j;
        for (j = 0; j < i/2; j ++) {
            if (s.at(j) != s.at(j + i/2))
                break;
        }
        if (j == i/2) {
            cout << i << endl;
            return 0;
        }
    }
    puts("???");
    return 0;
}

Measured memory_bytes: 256