akhauriyash/Code-Regression huggingface dataset:
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <cmath>
using namespace std;

#define int long long
#define endl "\n"
#define all(v)  v.begin(),v.end()
#define fir first
#define sec second
#define m_p make_pair
#define rep(i,n)  for(int i=0; i<(int) (n); i++)
#define vecin(v) for(int i=0; i<(int)v.size(); i++)cin>>v[i];
#define vecout(v,n) for(int i=0; i<n; i++)cout<<v[i]<<" "; cout<<endl;

const int mod = 1000000007;
const int INF = 2000000015;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
int jousu(int x00, int y00) {
	int z00 = 1;
	for (int i = 0; i < y00; i++) {
		z00 *= x00;
	}
	return z00;
}
int keta(int x00) {
	int z00 = x00;
	int w00 = 0;
	while (z00 != 0) {
		z00 /= 10;
		w00++;
	}
	return w00;
}
int krag(double xx) {
	return INF - (int)(INF - xx);
}


int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
int com(int xx, int yy) {
	int zz = 1;
	for (int i = xx; i > xx - yy; i--) {
		zz *= i;
		zz %= mod;
	}
	for (int i = 1; i <= yy; i++) {
		zz *= modinv(i, mod);
		zz %= mod;
	}
	return zz;
}
int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	int a = xx;
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}
 

signed main() {
	int a, b, n;
	cin >> a >> b >> n;
	if (n < b) {
		if (b - 1 > a&& n% b == 0) {
			cout << (a * (((n - 1) % b) + 0.0) / b) - (((a * (n - 1)) % b) / (b+0.0)) << endl;
		}
		else {
			cout << (a * ((n % b) + 0.0) / b) - (((a * n) % b) / (b+0.0)) << endl;
		}
	}
	else {
		cout << (a * (((b-1) % b) + 0.0) / b) - ((a * (b-1) % b) / (b+0.0)) << endl;
	}
}



Measured memory_bytes: 3796
/*Remember: The Struggle is Important*/

//CF,CC,AtC,SPOJ: hp1999
//HE: hemant269
//HR: hemant2132

#include<bits/stdc++.h>
using namespace std;

#define     int          long long int
#define     ld           long double
#define     fast()       ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define     all(x)       x.begin(),x.end()
#define     mem(a,b)     memset(a,b,sizeof(a))
#define     gcd(a,b)     (__gcd((a),(b)))
#define     lcm(a,b)     (((a)*(b))/gcd((a),(b)))
#define     pb           push_back
#define     ins          insert
#define     pii          pair<int,int>
#define     F            first
#define     S            second
#define     show(x)      for(auto c:x)cout<<c<<" ";cout<<"\n";
#define     show2(x)     for(auto c:x)cout<<c.F<<" "<<c.S<<"\n";

const int inf=1e18,M=1e9+7;
const int N=1;

void solve()
{
    int n;
    cin>>n;

    map<string,int> mp;
    vector<string> v;
    string s;
    int mx=0;
    for(int i=0;i<n;++i)
    {
        cin>>s;
        mx=max(mx,++mp[s]);
    }

    for(auto c:mp)
    {
        if(c.S==mx)
            v.pb(c.F);
    }

    sort(all(v));
    for(auto c:v)
        cout<<c<<"\n";
}

int32_t main()
{
    fast();

    int t=1;
    //cin>>t;
    while(t--)
    {
        solve();
        //cout<<"\n";
    }

    return 0;
}




Measured memory_bytes: 25584
L = [int(input()) for i in range(5)]
k = int(input())
c = 0
for i in range(5):
    for j in range(5):
        if i != j and abs(L[i]-L[j]) > k:
            c = 1
if c == 1:
    print(':(')
else:
    print('Yay!')


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

int main()
{
	int n;
	string lottery[200000];

	cin >> n;
	for (int a = 0; a < n; a++)
	{
		cin >> lottery[a];
	}

	sort(lottery, lottery + n);

	int counter = 0;
	for (int i = 0; i < n; i++)
	{
		if (lottery[i] != lottery[i - 1])
		{
			counter++;
		}
	}

	cout << counter << endl;
}

//tle:
/*#include <iostream>
#include <vector>
using namespace std;

int main()
{
	int n;
	vector<string> lottery;

	cin >> n;
	for (int a = 0; a < n; a++)
	{
		string s;
		cin >> s;
		lottery.push_back(s);
	}

	vector<string> used;
	int counter = 0;
	int j = 0;
	for (int i = 0; i < n; i++) //check every draw
	{
		int flag = 1;
		for (int k = 0; k < j; k++)
		{
			if (lottery[i] == used[k])
			{
				flag = 0;
			}
		}

		if (flag)
		{
			used.push_back(lottery[i]);
			counter++;
			j++;
		}
	}

	cout << counter << endl;
}*/

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

#define ll long long
#define llu unsigned long long
#define ld long double
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define pf push_front
#define pii pair<int, int>
#define pll pair<ll, ll>
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'
#define vvi(v, n, m) vector<vi> v(n, vi(m))
#define vvll(v, n, m) vector<vll> v(n, vll(m))
#define all(x) (x).begin(), (x).end()
#define present(v,x) (v).find(x) != (v).end()
#define cpresent(v,x) (find(all(v),x) != (v).end())
#define mset(x,v) memset(x, v, sizeof(x))
#define sz(x) (int)x.size()

string to_string(string s) { return '"' + s + '"';}
string to_string(char s) { return string(1, s);}
string to_string(const char* s) { return to_string((string) s);}
string to_string(bool b) { return (b ? "true" : "false");}
void debug_out() { cout << ""; }
template <typename A> string to_string(A);
template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}
template <typename A> string to_string(A v) {bool f = 1; string r = "{"; for (const auto &x : v) {if (!f)r += ", "; f = 0; r += to_string(x);} return r + "}";}
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {cout << " " << to_string(H); debug_out(T...);}
#define pr(v, n) {for(int j=0; j<n; j++){debug_out(v[j]); if(j<n-1) cout<<",";}}
#define dbg(...) cout << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__); { cout << endl; }
#define dbg1d(v, n) cout << "[" << #v << "]: {"; pr(v, n); {cout << " }" << endl;}
#define dbg2d(v, n, m) cout<<"["<<#v<<"]:"<<endl;{for(int i=0; i<n; i++){cout<<right<<setw(10)<<"["+to_string(i)+"] {";pr(v[i],m);{cout<<" }"<<endl;}}}
#define shout()  {cout << "I'm Here...!!!" << endl;}

inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}
inline int addmod(int a, int val, int p = MOD) {{if ((a = (a + val)) >= p) a -= p;} return a;}
inline int submod(int a, int val, int p = MOD) {{if ((a = (a - val)) < 0) a += p;}return a;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}

#define MAXN 100005
vector<int> adj[MAXN];
vector<int> dpw(MAXN, 1), dpb(MAXN, 1);

void __DFS(int v, vector<bool> &visited){
    visited[v] = true;
    for(int u: adj[v])
        if(!visited[u]){
            __DFS(u, visited);
            dpb[v] = mult(dpb[v], dpw[u]);
            dpw[v] = mult(dpw[v], addmod(dpb[u], dpw[u]));
        }
}

int DFS(int n){
    vector<bool> visited(n+1);
    __DFS(1, visited);
    return addmod(dpw[1], dpb[1]);
}

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

	int n;
	cin >> n;
	for(int i=0; i<n-1; i++){
		int x, y;
		cin >> x >> y;
		adj[x].pb(y);
		adj[y].pb(x);
	}

	cout << DFS(n) << endl;

	return 0;
}

Measured memory_bytes: 12032
using System;
using System.Text;

namespace ALDS1_9_B {
    class Problem {
        private int _H;
        private int[] _A;

        public void Run() {
            Read();

            for (int i = _H / 2; i > 0; i--)
                MaxHeapify(i);

            StringBuilder sb = new StringBuilder();
            for (int i = 1; i <= _H; i++)
                sb.Append(" " + _A[i]);
            Console.WriteLine(sb);
        }

        private void Read() {
            _H = int.Parse(Console.ReadLine());
            _A = new int[_H + 1];
            string[] input = Console.ReadLine().Split(' ');
            for (int i = 1; i <= _H; i++)
                _A[i] = int.Parse(input[i - 1]);
        }

        private void MaxHeapify(int i) {
            int l = 2 * i;
            int r = 2 * i + 1;
            int largest = (l <= _H && _A[l] > _A[i]) ? l : i;
            if (r <= _H && _A[r] > _A[largest])
                largest = r;

            if (largest != i) {
                Swap(i, largest);
                MaxHeapify(largest);
            }
        }

        private void Swap(int a,int b) {
            int temp = _A[a];
            _A[a] = _A[b];
            _A[b] = temp;
        }
    }
    
    class Program {
        static void Main(string[] args) {
            Problem p = new Problem();
            p.Run();
        }
    }
}

Measured memory_bytes: 48460
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

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

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

signed main(){
	int n,a[100],sum = 0;
	string s[100],x;
	cin >> n;
	for(int i = 0;i < n;i++) cin >> s[i] >> a[i];
	cin >> x;
	bool isSleep = false;
	for(int i = 0;i < n;i++){
		if(isSleep) sum += a[i];
		if(s[i] == x) isSleep = true;
	}
	cout << sum << endl;
}

Measured memory_bytes: 256
#include <iostream>
    #include <math.h>
    #include <vector>
    #include <string>
    using namespace std;
    int main() {
        int n,m,ans=0;cin >>n>>m;
        vector<int> cnt(m,0);
        for(int i=0;i<n;i++){
            int k;cin>>k;
            for (int j=0;j<k;j++){
                int ind;cin>>ind;
                cnt[ind-1]+=1;
            }
        }
        for(int p=0;p<cnt.size();p++){
            if(cnt[p] == n) ans++;
        }
        cout << ans << endl;
    }

Measured memory_bytes: 256
def main():
    a, b, c, d = [int(e) for e in input().split()]

    if d <= a or b <= c:
        print(0)
    elif a <= c and d <= b:
        print(d - c)
    elif c <= a and d <= b:
        print(d - a)
    elif a <= c and b <= d:
        print(b - c)
    elif c <= a and b <= d:
        print(b - a)


if __name__ == "__main__":
    main()


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

#define int long long

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a, i##_len=(b); i<i##_len; i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

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

using namespace std;

using P = pair<int,int>;
using ll = long long;

const long long INF = LLONG_MAX/3;

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

struct UnionFind{
	std::vector<int> par,siz;
	void init(int n){
		par.resize(n);
		for(int i=0;i<n;i++)par[i]=i;
		siz.resize(n,1);
	}
	UnionFind(int n){
		init(n);
	}
	int root(int n){
		if(par[n]==n)return n;
		else return par[n]=root(par[n]);
	}
	bool issame(int x,int y){
		return (root(x)==root(y));
	}
	bool marge(int a,int b){
		if(issame(a,b))return false;
		else{
			a=root(a),b=root(b);
			if(siz[a]<siz[b])swap(a,b);
			siz[a]+=siz[b];
			par[a]=par[b];
			return true;
		}
	}
	int size(int n){
		return siz[root(n)];
	}
};

long long gcd(long long a,long long b){
    if(b==0)return a;
    return gcd(b,a%b);
}
long long lcm(long long i,long long j){
    return i*(j/gcd(i,j));
}

const int MOD=1e9+7;
long long fac[510000], finv[510000], inv[510000];
long long MAX=510000;
bool COMinited=false;
long long COM(int n, int k){
	if(COMinited==false){
		fac[0] = fac[1] = 1;
    	finv[0] = finv[1] = 1;
    	inv[1] = 1;
    	for (int i = 2; i < MAX; i++){
        	fac[i] = fac[i - 1] * i % MOD;
        	inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        	finv[i] = finv[i - 1] * inv[i] % MOD;
    	}
		COMinited=true;
	}
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}
int c(int s,int t){
	int a=1;
	for(int i=s;i>=s-t+1;i--){
		a*=i;
		a%=MOD;
	}
	int b=1;
	for(int i=1;i<=t;i++){
		b*=i;
		b%=MOD;
	}
	return a*modinv(b,MOD)%MOD;
}
signed main(){
	int n,k;
	cin>>n>>k;
	int ans=0;
	rep(i,min(k,n-1)+1){
		ans+=COM(n,i)*COM(n-1,n-i-1)%MOD;
		ans%=MOD;
	}
	cout<<ans<<endl;
}

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

#define FOR0(i,n) for (int i = 0; i < n; i++)
#define FOR(i,j, n) for (int i = j; i < n; i++)
// bool isEven(ll n) {return (n%2!=0)?false:true;};
#define INF 1000000000 // 1 billion, safer than 2B for Floyd Warshall’s

#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
// #define int ll

using namespace std;

//atcoder
//begineer contest 139
//d

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

    if(n==1)
    {
        cout<<0<<endl;
        return 0;
    }

    n--;

    long long ans = 1;

    if(n%2==0)
    {
        ans = ans*(n/2);

        cout<<ans*(n+1)<<endl;
    }
    else
    {
        ans = ans*((n+1)/2);

        cout<<ans*n<<endl;
    }
}

Measured memory_bytes: 256
#!/usr/bin/ruby

def solve(n, m, c, bs, ass)
  ass.select {|as| as.zip(bs).map {|a,b| a * b}.reduce(&:+) + c > 0}.size
end

def each_case(sin)
  n, m, c = sin.gets.chomp.split(" ").map(&:to_i)
  bs = sin.gets.chomp.split(" ").map(&:to_i)
  yield n, m, c, bs, (sin.each_line.map {|ln|
    ln.chomp.split(" ").map(&:to_i)
  })
end

each_case(STDIN) do |*args|
  puts solve(*args).to_s
end




Measured memory_bytes: 1788
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
   
int main(){
	string X, Y;
	cin >> X >> Y;
	if(X == Y){
		cout << "=" << endl;
	}else if(X > Y){
		cout << ">" << endl;
	}else{
		cout << "<" << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define REV(v) reverse(v.begin(), v.end());
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, start, stop) for (ll i = start; i < stop; i++)
#define FORR(i, start, stop) for (ll i = start; i > stop; i--)
#define SORT(v, n) sort(v, v + n);
#define SORTR(v, n) sort(v, v + n,greater<ll>());
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.begin(), v.end(),greater<ll>());
#define REMOVE(v,n) remove(vector<ll> v,v+v.size(),ll n)
#define ERASE(v,n) v.erase(v.begin()+n);
#define ull unsigned long long
#define pb(a) push_back(a)
#define INF 999999999
#define V(v,i,j) vector(v.begin() + i, v.begin() + j)
#define INSERT(va,vb) va.insert(va.end(), vb.begin(), vb.end())
using namespace std;
typedef vector<ll> vll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//string al="abcdefghijklmnopqrstuvwxyz";
//vector< vector<int> > v (size1, vector<int>(size2) );



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,M;cin>>N>>M;
    vector<ll> a(M);
    vector<ll> b(M);
    vector<ll> c(M);
    ll C;
    ll c_bit; //1 2 4 5(N=6) -> 011011
    FOR(i,0,M){
        cin>>a[i]>>b[i];
        c_bit=0;
        FOR(j,0,b[i]){
            cin>>C;C--;
            c_bit |= 1<<C;
        }
        c[i]=c_bit;
    }

    ll ans=1e9;
    vector< vector<ll> > dp (M+1, vector<ll>(1<<N,1e9) );
    FOR(i,0,M+1)dp[i][0]=0;
    
    FOR(i,0,M) {
        FOR(j,0,1<<N) {
            chmin(dp[i+1][j], dp[i][j]);
            
            int nj = j | c[i];
            chmin(dp[i+1][j | c[i]], dp[i][j] + a[i]);
        }
    }
 
    cout << (dp[M][(1<<N)-1] < INF ? dp[M][(1<<N)-1] : -1) << endl; 
}
//669

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

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >>d;
  int ans=0;
  if(abs(a-c)<=d) ans=1;
  if(abs(a-b)<=d&&abs(b-c)<=d)ans=1;
  if(ans) cout <<"Yes"<<endl;
  else cout <<"No"<<endl;
  return 0;
}


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

int main() {
  char s;
  cin >> s;
  if(s == 'a' || s == 'e' || s == 'i' || s == 'o' || s == 'u'){
    cout << "vowel" <<endl;
  }
  else{
    cout << "consonant" << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;




int main(){

	int A,B;

	scanf("%d %d",&A,&B);

	if(B == 1){

		printf("0\n");
		return 0;
	}

	for(int i = 1;;i++){

		if(A*i-(i-1) >= B){

			printf("%d\n",i);
			return 0;
		}
	}

	return 0;
}


Measured memory_bytes: 256
import sys

while True:
    n = sys.stdin.readline()[:-1]

    if n == '-1 -1 -1':
        break

    marks = [ int(m) for m in n.split() ]

    mt_points,retest = marks[0] + marks[1],marks[2]

    if -1 in marks[:-1]:
        print('F')
        continue
    elif mt_points >= 80:
        print('A')
        continue
    elif mt_points >= 65 and 80 > mt_points:
        print('B')
        continue
    elif mt_points >= 50 and 65 > mt_points:
        print('C')
        continue
    elif mt_points >= 30 and 50 > mt_points:
        if retest >= 50:
            print('C')
            continue
        print('D')
        continue
    elif 30 > mt_points:
        print('F')



Measured memory_bytes: 5604
function main (s) {
	s=s.split(" ");
    for(var i=0;i<3;i++)s[i]=parseInt(s[i]);
	if(s[0]==s[1])console.log(s[2]);
	else if(s[0]==s[2])console.log(s[1]);
	else console.log(s[0]);
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
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;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 

vll dp(100100);

ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
 
#define comuse Comuse()
 
ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
 
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll a=1000000007;
  ll m,d;
  	ci(m>>d);
  ll ans=0;
  FOR(i,1,m+1){
    FOR(j,1,d+1){
      
      ll s=(j/10)*(j%10);
      if(j>9&&i==s&&j/10>1&&j%10>1){
        
        //co(i<<" "<<j<<" "<<s)
        ans++;
      }
    }
  }
  co(ans)
}

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

public class Main {
    public static void main(final String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final String a = scanner.next();
        final long[] count = new long[26];

        for (final char c : a.toCharArray()) {
            count[c - 'a']++;
        }

        final long length = a.length();
        final long base = length * (length - 1) / 2 + 1;
        final long answer = base - Arrays.stream(count)
                .map(l -> l * (l - 1) / 2)
                .sum();

        System.out.println(answer);
    }
}


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

template<class T> using pqueue = priority_queue<T, vector<T>, greater<T>>;
const int inf = 1e9;

int main() {
	int n, m;
	cin >> n >> m;

	vector<map<int, vector<int>>> g(1000000);
	vector<vector<int>> color(n);
	for (int i = 0; i < m; i++) {
		int p, q, c;
		scanf("%d %d %d", &p, &q, &c);
		p--; q--; c--;
		g[p][c].push_back(q);
		g[q][c].push_back(p);
	}

	vector<map<int, int>> dist(n);
	vector<queue<pair<int, int>>> q(101010);

	for (auto kv : g[0]) {
		dist[0][kv.first] = 1;
		q[1].emplace(0, kv.first);
	}

	for (int i = 1; i < 101010 - 1; i++) {
		queue<int> Q;
		while (!q[i].empty()) {
			int v, c;
			tie(v, c) = q[i].front(); q[i].pop();
			Q.push(v);
			for (auto u : g[v][c]) {
				if (dist[u].count(c) == 0) {
					dist[u][c] = i;
					q[i].emplace(u, c);
				}
			}
			g[v][c].clear();
		}
		while (!Q.empty()) {
			int v = Q.front(); Q.pop();
			for (auto kv : g[v]) {
				for (int u : kv.second) {
					if (dist[u].count(kv.first) == 0) {
						dist[u][kv.first] = i + 1;
						q[i + 1].emplace(u, kv.first);
					}
				}
			}
			g[v].clear();
		}
	}

	int ans = inf;

	for (auto kv : dist[n - 1]) {
		ans = min(ans, kv.second);
	}

	if (ans == inf) ans = -1;

	cout << ans << endl;
}

Measured memory_bytes: 175232
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;

#define lint long long
#define INF 1000000000000000
#define pii pair<long long,long long>
#define all(x) (x).begin(),(x).end

/* source code below */

int main() {

	int a, b; cin >> a >> b;
	int A = max(a, b);
	int B = min(a, b);
	if (A - B >= 2) {
		cout << 2* A -  1 << endl;
	}
	else if (A - B == 1) {
		cout << 2 * A - 1 << endl;
	}
	else {
		cout << 2 * A << endl;
	}

	return 0;
}
/* Don't forget to delete the header! */

Measured memory_bytes: 256
n = int(input())
a = [int(input()) for _ in range(n)]

cnt = 0
cur = 1

if a[0] == 2:
    print(1)
    exit()

else:
    for i in range(n):
        cnt += 1
        cur = a[cur - 1]
        if cur == 2:
            print(cnt)
            exit()

print(-1)


Measured memory_bytes: 7084
import fractions
a,b,c,d=map(int,input().split())

cc=b//c-(a-1)//c
dd=b//d-(a-1)//d
s=b//(c*d//fractions.gcd(c,d))-(a-1)//(c*d//fractions.gcd(c,d))


print((b-(a-1)-(cc+dd-s)))

Measured memory_bytes: 5048
//##Moh_K_Imar .......
//27/08/2020  ...  8.05
//Ya Rab....
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
int main(){
   char a;
   cin>>a;
   if(a>='A'&&a<='Z')cout<<'A'<<endl;
   else cout<<'a'<<endl;
   return 0;
}



Measured memory_bytes: 3588
using System;

class Program
{
    static void Main()
    {
        string[] example = { "a < b", "a > b", "a == b" };
        string result = string.Empty;
        string[] str = Console.ReadLine().Split(' ');
        int a = int.Parse(str[0]);
        int b = int.Parse(str[1]);

        if (a < b)
        {
            result = example[0];
        }
        else if (a > b)
        {
            result = example[1];
        }
        else if (a == b)
        {
            result = example[2];
        }

        Console.WriteLine("{0}", result);
    }
}

Measured memory_bytes: 8960
#include <bits/stdc++.h>
#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()
{
    ll n;
    cin >> n;
    ll sum = 0;
    for (ll i = 1; i <= n; i++) {
        if (i % 3 == 0 && i % 5 == 0) continue;
        else if (i % 3 == 0) continue;
        else if (i % 5 == 0) continue;
        else {
            sum += i;
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define tezi ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
typedef long long ll;

int main(){
    tezi;
    string s;
    cin >> s;
    if(s == "ABC") cout << "ARC\n";
    else cout << "ABC\n";
    return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std; 
#define int int64_t
#define itn int
#define fi first
#define se second 
signed main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,m,a;
  int dp[1000000]={};
  cin>>n>>m;
  dp[0]=1;
  dp[1]=1;
  for(int i=0;i<m;i++){
    cin>>a;
    dp[a]=-1;
  }
  for(int i=2;i<=n;i++){
    if(dp[i]!=-1){
      if(dp[i-1]!=-1) dp[i]+=dp[i-1];
      if(dp[i-2]!=-1) dp[i]+=dp[i-2];
      dp[i]%=1000000007;
    }
  }
  cout<<dp[n]<<"\n";
}


Measured memory_bytes: 11384
#include<bits/stdc++.h>
const int N=1e6+7;
char s1[N],s2[N];
int n,ms[N],mp=0,ans=0;
struct pos{
	int x,y;
}q[N];
int ql=1,qr=0,sx=0,at=0;
void maxs(int&a,int b){if(a<b)a=b;}
void ins(int l,int r,int p){
	int d=l-p+1;
	if(d>1)while(sx>d){
		if(sx-q[ql].x+1>=d)sx-=q[ql++].x-1,++q[ql].x;
		else q[ql].x-=sx-d,sx=d;
	}else ql=1,qr=0,sx=0;
	++at;
	d=r-l+(ql>qr);
	if(d)q[++qr]=(pos){d,1-at},sx+=d;
	maxs(ans,q[ql].y+at);
}
int main(){
	scanf("%d%s%s",&n,s1+1,s2+1);
	if(!strcmp(s1+1,s2+1))return puts("0"),0;
	for(int i=n,j,p=n;i;i=j-1){
		for(j=i;s2[i]==s2[j-1];--j);
		if(p>j)p=j;
		for(;p&&s1[p]!=s2[i];--p);
		if(!p)return puts("-1"),0;
		ms[++mp]=p;
	}
	for(int i=1,j,p;i<=n;i=j+1){
		for(j=i;s2[i]==s2[j+1];++j);
		p=ms[mp--];
		ins(i,j,p);
	}
	printf("%d\n",ans);
	return 0;
}

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

using i64 = long long int;

int main(){
    int n, m, x, y;
    cin >> n >> m >> x >> y;
    for(int i=0;i<n;++i){
        int tmp;
        cin >> tmp;
        x = max(x, tmp);
    }
    for(int i=0;i<m;++i){
        int tmp;
        cin >> tmp;
        y = min(y, tmp);
    }

    cout << (y-x > 0 ? "No War" : "War") << endl;

    return 0;
}


Measured memory_bytes: 256
M=10**9+7
f=->r,c{s=t=1
c.times{t=t*-~_1%M
s=s*(r+c-_1)%M}
s*t.pow(M-2,M)}
eval'A,B,C,D='+`tr ' ' ,`
p (f[A,B]-f[C+=1,B]-f[A,D+=1]+f[C,D])%M

Measured memory_bytes: 14328
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include <string.h>
#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define repn(i, x) for (int i = 1; i <= (int)(x); i++)
#define repr(i, x) for (int i = ((int)(x) - 1); i >= 0; i--)
#define reprn(i, x) for (int i = ((int)(x)); i > 0; i--)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
void solve() {
	int n; cin >> n;
	int k; cin >> k;
	vector<int> x(n);
	rep (i, n) {
		cin >> x[i];
	}
	vector<pair<int, int>> type_a(n);
	vector<pair<int, int>> type_b(n);
	vector<pair<int, int>> pos_ball(n);
	rep (i, n) {
		type_a[i] = make_pair(0, i);
		type_b[i] = make_pair(k, i);
		pos_ball[i] = make_pair(x[i], i);
	}
	int ans = 0;
	rep (i, n) {
		int distance_a = 0;
		int distance_b = 0;
		distance_a = abs(pos_ball[i].first - type_a[i].first) * 2;
		distance_b = abs(pos_ball[i].first - type_b[i].first) * 2;
		ans += min(distance_a, distance_b);
	}
	cout << ans << endl;
	return;
}

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

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
Created on Wed May  6 02:04:30 2020

@author: shinba
"""

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

N -= (N//K)*K

n= N-K

if abs(n) >= abs(N):
    print(abs(N))
else:
    print(abs(n))





Measured memory_bytes: 3060
"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]
"""

import math
import sys
import itertools
import queue
from fractions import gcd
from itertools import accumulate

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    s = sys.stdin.readline().rstrip()
    n0 = s.count("0")
    n1 = s.count("1")

    print(min(n0,n1)*2)

Measured memory_bytes: 5612
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int mod=1000000007;
#define pb  push_back
#define FOR(i,n) for(int i=0;i<(n);i++)
#define FORA(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define count_1(n)  __builtin_popcountll(n)
#define parity(n)   __builtin_parityll(n)   //Even parity 0 as output
void show    (int a[], int arraysize) { for (int i = 0; i < arraysize; ++i)  {cout << a[i] << " ";}	cout<<endl;}
int gcd(int a, int b) { if (b == 0) return a; return gcd(b, a % b);}
void sieve(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++)
       if (prime[p])
          cout << p << " ";
}
int main()
{FAST
int a[]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
int k;
cin>>k;
cout<<a[k-1]<<endl;
return  0;
}




Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<cstdlib>
#include<iostream>
#include<algorithm>
using namespace std;
int main (){
	int R,G,score;
	while((scanf("%d",&R)!=EOF)&&(scanf("%d",&G)!=EOF)){
		score=(2*G-R);
		printf("%d\n",score);
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <climits>
#include <numeric>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <unordered_set>
#include <string>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <tuple>
 
using namespace std;
 
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define cina(s, n, a) for(int i = s; i < n; i++) cin >> a[i]
#define couta(n, a) for(int i = 0; i < n; i++) cout << a[i] << ' '
#define copy(s, n, a, b) for(int i = s; i < n; i++) b[i] = a[i]
#define yesno(ok) cout << (ok ? "YES" : "NO")
#define mod(a, b) (b + (a % b)) % b
#define MOD (int)1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

void add_self (int& a, int b){ a += b; if(a >= MOD) a -= MOD; }
//-------------------------------------------------------------------------------------------------------//

void solve(){
    int n;
    cin >> n;
    while(n--){
        int x;
        cin >> x;
        if(x % 2 == 0 && x % 3 != 0 && x % 5 != 0){
            cout << "DENIED";
            return;
        }
    }
    cout << "APPROVED";
}
 
int main(){
    ios::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int q = 1;
    //cin >> q;
    for(int i = 1; i <= q; i++){
        solve();
    }
}


Measured memory_bytes: 256
process.stdin.resume();
process.stdin.setEncoding('utf8');
 
// inputに入力データ全体が入る
function Main(input) {
  // 1行目がline1, 2行目がline2, …に入る
  var tmp = input.split("\n");
  var line0 = tmp[0].split(" ");
  var line1 = tmp[1].split(" ");
  //var line2 = tmp[2].split(" ");
  //var line3 = tmp[3].split(" ");

  var n = Number(line0[0]);
  var k = Number(line1[0]);
//  var b = Number(line0[2]);

  var ans = 1;

  //console.log( n+" "+ k +" "+ " hoge ")
  
  for(var i=1; i <=n; i++){
    if(ans < k) ans *= 2;
    else ans += k;
  }

  console.log(ans);
  
  


}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7500
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define REP(i,s,n) for(int i = s; i < n; i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using Graph = vector<vector<int>>;
const int INF = 1000000007;
int main(){
  ll n;
  cin >> n;
  string s;
  cin >> s;
  int r = 0;
  rep(i,n)if(s[i] == 'R')r++;
  int ans = 0;
  rep(i,r){
    if(s[i] != 'R')ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3740
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,m;
	cin>>n>>m;
	int sum=0,sum1=0;
	for(int i=n-1;i>=0;i--)
	{
		sum+=i;
	}
	for(int j=m-1;j>=0;j--)
	{
		sum1+=j;
	}
		
	cout<<sum+sum1<<endl;
}


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

class Program {
    static void Main(string[] args) {
        int h = Cin.Ni();
        int w = Cin.Ni();
        char[,] field = new char[h, w];
        for (int y = 0; y < h; y++) {
            string s = Cin.Next();
            for (int x = 0; x < w; x++) {
                field[y, x] = s[x];
            }
        }
        for (int y = 0; y < h; y++) {
            for (int x = 0; x < w; x++) {
                if (field[y, x] == '.') {
                    int count = 0;
                    count += IsMine(y - 1, x - 1, h, w, field);
                    count += IsMine(y - 1, x, h, w, field);
                    count += IsMine(y - 1, x + 1, h, w, field);
                    count += IsMine(y, x - 1, h, w, field);
                    count += IsMine(y, x + 1, h, w, field);
                    count += IsMine(y + 1, x - 1, h, w, field);
                    count += IsMine(y + 1, x, h, w, field);
                    count += IsMine(y + 1, x + 1, h, w, field);
                    Console.Write(count);
                } else {
                    Console.Write(field[y, x]);
                }
            }
            Console.WriteLine();
        }
    }
    static int IsMine(int y, int x, int h, int w, char[,] field) {
        if (y < 0 || x < 0) return 0;
        if (y >= h || x >= w) return 0;
        if (field[y, x] != '#') return 0;
        return 1;
    }

}


public class Cin {
    private static string[] s = new string[0];
    private static int i = 0;

    private static char[] cs = new char[] { ' ' };

    public static string Next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        i = 0;
        return Next();
    }

    public static int Ni() {
        return int.Parse(Next());
    }

    public static long NextLong() {
        return long.Parse(Next());
    }

    public static double NextDouble() {
        return double.Parse(Next());
    }

}


Measured memory_bytes: 13140
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int a=s.nextInt();
		int b=s.nextInt();
		int c=s.nextInt();
		if(a%2==0 || b%2==0 || c%2==0){
			System.out.println("0");
		}	else {
			long l = Math.min((long)a*b,(long)b*c);
			l=Math.min(l, (long)c*a);
			System.out.println(l);
		}
		
	}
}

Measured memory_bytes: 9428
using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
	static void Main(string[] args)
	{			
		//文字列を読み込む
		int num = int.Parse(Console.ReadLine());
		string[] numbers = Console.ReadLine().Split(' ');
		
		//配列をソート
		Array.Sort(numbers, StringComparer.Ordinal);
		
		//判別する変数を定義
		bool distinct = true;
		
		for(int i=0; i<num-1; i++){
				if(numbers[i] == numbers[i+1]){
						distinct = false;
						break;
				}
		}
		
		//出力
		if(distinct){
				Console.WriteLine("YES");
		}else{
				Console.WriteLine("NO");
		}
	}
}



Measured memory_bytes: 30048
#include <iostream>
#include <stdio.h>
#include <ctype.h>

using namespace std;

int main() 
{
// your code goes here

int counts[30]={0};

char cs[1201];
while(scanf("%[^\n]\n",cs)!=EOF){
	for(int i=0;cs[i]!='\0';i++){
		if(isalpha(cs[i])){
			counts[tolower(cs[i])-'a']++;
		}
	}
}

for(char c='a';c<='z';c++){
	printf("%c : %d\n",c,counts[c-'a']);
}
return 0;
}


Measured memory_bytes: 3200
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <tuple>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<n; ++i)

int main() {
    int n;
    cin >> n;
    vector<int> A;
    for (int i=0; i<n; ++i) {
        int a;
        cin >> a;
        A.push_back(a);
    }
    long long yen=1000;
    long long nkabu=0;
    for (int i=0; i+1 < n; ++i) {
        long long price = A.at(i);
        if (nkabu == 0) {
            if (A.at(i) > A.at(i+1)) {
                continue;
            }
            nkabu = yen / price;
            yen -= price * nkabu;
        } else {
            if (A.at(i) < A.at(i+1)) {
                continue;
            }
            yen += price * nkabu;
            nkabu = 0;
        }
    }
    if (nkabu > 0) {
        long long price = A.back();
        yen += nkabu * price;
    }
    cout << yen << endl;
    return 0;
}


Measured memory_bytes: 3092
#include <stdio.h>
int max(int n,int m){
    if(n>m) return n;
    else return m;
}
int main(void){
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    printf("%d",max(c-(a-b),0));
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<utility>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

vector<P> get_path(vector<P> check_point, ll K) {
    vector<P> res;
    ll x = 0, y = 0, rest = K;
    for (int i = 0; i < check_point.size(); ++i) {
        ll check_point_x = check_point[i].first;
        ll check_point_y = check_point[i].second;
        while (x != check_point_x || y != check_point_y) {
            ll now_step;
            if (x < check_point_x) {
                now_step = min(check_point_x - x, rest);
                x += now_step;
            }
            else if (x > check_point_x) {
                now_step = min(x - check_point_x, rest);
                x -= now_step;
            }
            else if (y < check_point_y) {
                now_step = min(check_point_y - y, rest);
                y += now_step;
            }
            else if (y > check_point_y) {
                now_step = min(y - check_point_y, rest);
                y -= now_step;
            }
            rest -= now_step;
            if (rest == 0) {
                rest = K;
                res.push_back(P(x, y));
            }
        }
    }
    return res;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll K, X, Y;
    cin >> K >> X >> Y;
    // 前提としてX>=0かつY>=0かつX>=Yを成り立たせる.
    bool x_is_negative = X < 0;
    bool y_is_negative = Y < 0;
    bool x_lt_y = abs(X) < abs(Y);
    if (x_is_negative) X = -X;
    if (y_is_negative) Y = -Y;
    if (x_lt_y) swap(X, Y);
    ll D = X + Y;
    if (K % 2 == 0 && D % 2) {
        cout << -1 << endl;
        return 0;
    }
    ll n = (D + K - 1) / K;
    if (n == 1 && D % K == 0) {
        cout << 1 << endl;
        if (x_lt_y) swap(X, Y);
        if (x_is_negative) X *= -1;
        if (y_is_negative) Y *= -1;
        cout << X << ' ' << Y << endl;
        return 0;
    }
    if (n == 1) n++;
    if ((n * K - D) % 2) n++;
    vector<P> check_point;
    if ((D + K - 1) / K == 1 && n == 3) {
        // コーナーケース
        ll a = ((n * K - D) / 2) / 2;
        ll b = (n * K - D) / 2 - a;
        check_point.push_back(P(-b, 0));
        check_point.push_back(P(-b, Y + a));
        check_point.push_back(P(X, Y + a));
        check_point.push_back(P(X, Y));
    }
    else {
        ll a = (n * K - D) / 2;
        check_point.push_back(P(0, Y + a));
        check_point.push_back(P(X, Y + a));
        check_point.push_back(P(X, Y));
    }
    vector<P> ans = get_path(check_point, K);
    if (x_lt_y) {
        for (int i = 0; i < ans.size(); ++i) {
            swap(ans[i].first, ans[i].second);
        }
    }
    if (x_is_negative) {
        for (int i = 0; i < ans.size(); ++i) {
            ans[i].first *= -1;
        }
    }
    if (y_is_negative) {
        for (int i = 0; i < ans.size(); ++i) {
            ans[i].second *= -1;
        }
    }
    cout << ans.size() << endl;
    for (int i = 0; i < ans.size(); ++i) {
        cout << ans[i].first << ' ' << ans[i].second << endl;
    }
    return 0;
}

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

int main() {
    long long N; cin >> N;
    string ans="";
    while(N){
        N--;
        int r=N%26;
        N=N/26;
        ans+='a'+r;
    }
    reverse(ans.begin(),ans.end());
    cout << ans << endl;
}


Measured memory_bytes: 3520
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const ll MOD = 1000000007;
 
int main(){
  ll N,M,i,t=0;
  string S;
  cin >> N >> M >>S;
  vector<ll> ans(N);
  i=N;
  while(i>0){
    if(i-M<=0){
      ans.at(t)=i;
      t++;
      break;
    }
    ll x=M;
    while(S.at(i-x)=='1'){
      x--;
      if(x==0){
        cout << -1 << endl;
        return 0;
      }
    }
    ans.at(t)=x;
    i-=x;
    t++;
  }
  rep(j,t){
    cout << ans.at(t-j-1) << " ";
  }
  cout << endl;
}

Measured memory_bytes: 1408
#include <stdio.h>

int A[1000000], n;

// binary search
int binarySearch(int key)
{
    int left = 0;
    int right = n;
    int mid;
    while (left < right) {
        mid = (left + right) / 2;
        if (key == A[mid]) return 1;  // find the key
        if (key > A[mid]) left = mid + 1;  // search the second half
        else if (key < A[mid]) right = mid;  // search the first half
    }
    return 0;
}

int main()
{
    int i, q, k, sum = 0;

    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d", &A[i]);
    }

    scanf("%d", &q);
    for (i = 0; i < q; i++) {
        scanf("%d", &k);
        if (binarySearch(k)) sum++;
    }
    printf("%d\n", sum);

    return 0;
}


Measured memory_bytes: 2988
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
from math import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=input()
hon=[2,4,5,7,9]
pon=[0,1,6,8]
bon=[3]

if int(n[-1]) in hon:
    print("hon")
elif int(n[-1]) in pon:
    print("pon")
else:
    print("bon")

Measured memory_bytes: 68236
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline int my_getchar_unlocked(){
  static char buf[1048576];
  static int s = 1048576;
  static int e = 1048576;
  if(s == e && e == 1048576){
    e = fread_unlocked(buf, 1, 1048576, stdin);
    s = 0;
  }
  if(s == e){
    return EOF;
  }
  return buf[s++];
}
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = my_getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = my_getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline int rd_int(void){
  int x;
  rd(x);
  return x;
}
struct MY_WRITER{
  char buf[1048576];
  int s;
  int e;
  MY_WRITER(){
    s = 0;
    e = 1048576;
  }
  ~MY_WRITER(){
    if(s){
      fwrite_unlocked(buf, 1, s, stdout);
    }
  }
}
;
MY_WRITER MY_WRITER_VAR;
void my_putchar_unlocked(int a){
  if(MY_WRITER_VAR.s == MY_WRITER_VAR.e){
    fwrite_unlocked(MY_WRITER_VAR.buf, 1, MY_WRITER_VAR.s, stdout);
    MY_WRITER_VAR.s = 0;
  }
  MY_WRITER_VAR.buf[MY_WRITER_VAR.s++] = a;
}
inline void wt_L(char a){
  my_putchar_unlocked(a);
}
inline void wt_L(long long x){
  int s=0;
  int m=0;
  char f[20];
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    my_putchar_unlocked('-');
  }
  while(s--){
    my_putchar_unlocked(f[s]+'0');
  }
}
template<class T, class U> inline T GCD_L(T a, U b){
  T r;
  while(b){
    r=a;
    a=b;
    b=r%a;
  }
  return a;
}
int main(){
  int i;
  int K = rd_int();
  long long res = 0;
  for(i=(1);i<(K+1);i++){
    int j;
    for(j=(1);j<(K+1);j++){
      int k;
      for(k=(1);k<(K+1);k++){
        res +=GCD_L(GCD_L(i, j), k);
      }
    }
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20200418-1

// --- original code ---
// {
//   int K = rd_int();
//   ll res = 0;
//   rep(i,1,K+1) rep(j,1,K+1) rep(k,1,K+1) res += gcd(i,j,k);
//   wt(res);
// }


Measured memory_bytes: 3628
N = int(input())
ans = 0
for i in range(1, N + 1, 2):
    yaku_count = 0
    for k in range(1, i + 1):
        if i % k == 0:
            yaku_count += 1
    if yaku_count == 8:
        ans += 1
print(ans)

Measured memory_bytes: 2940