akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
//#define int long long

using namespace std;
using LL = long long;
using P = pair<int, int>;

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

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e18;
const int MOD = 1e9 + 7;

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

    int n;
    cin >> n;
    vector<int> v(n);
    REP(i, n) cin >> v[i];

    map<int, int> mp1, mp2;
    REP(i, n){
        if(i % 2 == 0){
            mp1[v[i]]++;
        }else{
            mp2[v[i]]++;
        }
    }

    int max1 = 0, max2 = 0;
    int num1 = 0, num2 = 0;
    
    vector<pair<int, int>> a, b;
    for(auto x : mp1) a.pb(make_pair(x.second, x.first));
    for(auto x : mp2) b.pb(make_pair(x.second, x.first));

    sort(all(a)), sort(all(b));
    reverse(all(a)), reverse(all(b));
    
    a.pb(make_pair(0, -1)), b.pb(make_pair(0, -1));
    if(a[0].second != b[0].second){
        cout << n - a[0].first - b[0].first << endl;
    }else{
        cout << min(n - a[0].first - b[1].first, n - a[1].first - b[0].first) << endl;
    }
/*
    for(auto x : mp1){
        a.pb(x);
        if(x.second > max1) num1 = x.first;
        max1 = max(max1, x.second);
        
    }
    for(auto x : mp2){
        if(x.second > max2 && num1 != x.first) num2 = x.first, max2 = max(max2, x.second);
    }
    int ans = n - max1 - max2;

    for(auto x : mp2){
        if(x.second > max1) num1 = x.first;
        max1 = max(max1, x.second);
        
    }
    for(auto x : mp1){
        if(x.second > max2 && num1 != x.first) num2 = x.first, max2 = max(max2, x.second);
    }

    cout << min(ans, n - max1 - max2) << endl;
*/
}


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

int main(){
    string s;
    cin >> s;
    if(s.size()%2){
        cout << "No" << endl;
        return 0;
    }
    for(int i=0; i<s.size(); i++){
        if(i%2==0 && s[i]!='h'){
            cout << "No" << endl;
            return 0;
        }
        if(i%2==1 && s[i]!='i'){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}


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

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()
#define dump(x) cout << #x << " = " << (x) << endl

double dp[310][310][310];
bool vis[310][310][310];
int N;

double calc(int p, int q, int r) {
	if (vis[p][q][r]) {
		return dp[p][q][r];
	}
	vis[p][q][r] = true;
	if (p + q + r == 0) {
		return dp[p][q][r] = 0.0;
	}
	double t = 0.0;
	if (p > 0) {
		t = t + calc(p-1, q, r) * p;
	}
	if (q > 0) {
		t = t + calc(p+1, q-1, r) * q;
	}
	if (r > 0) {
		t = t + calc(p, q+1, r-1) * r;
	}
	t = t / (p + q + r);
	return dp[p][q][r] = t + (double)N / (p + q + r);
}

int main() {
	cin >> N;
	int p = 0, q = 0, r = 0;

	rep(i, N) {
		int a; cin >> a;
		if (a == 1) {
			++p;
		} else if (a == 2) {
			++q;
		} else {
			++r;
		}
	}
	printf("%.10f\n", calc(p, q, r));
	return 0;
}

Measured memory_bytes: 256256
//author: dazhong_feliks

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

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

   vector<int> vec(N);
     for (int x = 0; x < N; x++){
     cin >> vec.at(x);
   }
   
   sort(vec.begin(), vec.end());
   
   int ans = 1;

   for(int i = 0; i < N - 1; i++){
     if (vec.at(i) != vec.at(i + 1)){
         ans++;
     }
  }
   cout << ans << endl;
}

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

using namespace std;

int main(){
int arr[1010];
    int N, K;
    cin >> N >> K;
    for (int i = 0; i < N; i++)
    {
        scanf("%d", &arr[i]);
    }
    sort(arr, arr + N);
    int ans = 0;
    for (int i = 0; i < K; i++)
    {
        ans += arr[i];
    }
    printf("%d", ans);
}

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

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> inline T gcd(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<class T> inline T lcm(T a,T b){return a*b/gcd(a,b);}

const ll INF = 1LL << 60;


int main(){
  int a,b;
  int x;
  cin >> a >> b;
  if(a>=0)x=0;
  else if(b<0){
    x=(b-a+1)%2;
  }else{
    x=2;
  }
  if(x==1){
    cout << "Negative" << endl;
  }else if(x==0){
    cout << "Positive" << endl;
  }else{
    cout << "Zero" << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>
#include<bitset>
#include<cassert>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;



void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(vector<long long int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}


int main(){
	int n, k;
	cin >> n >> k;
	double ans = 0;
	rep2(i, 1, n + 1)
	{
		int j = 0;
		double t = 1.0 / n;
		for (int j = i; j < k; j *= 2){
			t /= 2;
		}
		ans += t;
	}
	cout << fixed << setprecision(10) <<min(ans, 1.0) << endl;
}

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

const int N=200005;
int n;
long long a[N],ans=1ll<<60;

int main()
{
	scanf("%d",&n);
	int i;
	for(i=1;i<=n;i++)
	    scanf("%lld",&a[i]),a[i]+=a[i-1];
	for(i=1;i<n;i++)
	    ans=min(ans,abs(a[n]-a[i]-a[i]));
	printf("%d",ans);
}


Measured memory_bytes: 1792
n = int(input())
A = list(map(int,input().split()))
count = 0

for i in range(n):
    minj = i
    for j in range(i,n):
        if A[j] < A[minj]:
            minj = j
    if minj != i:
        count += 1
        a = A[i]
        A[i] = A[minj]
        A[minj] = a

print(' '.join(map(str,A)))
print(count)


Measured memory_bytes: 5596
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<map>
#include<set>
#include<queue>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repn(i, n) for(int i = 1; i <= n; i++)
#define repr(i, n) for(int i = (n-1); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define lint long long

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

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

using namespace std;

using int64 = long long;
const int INF = 1 << 30;

struct edge
{
  int to, cost;
};

int N;
vector< edge > g[100000];
int subtree[100000], childmax[100000];

void dfs(int idx, int par)
{
  subtree[idx] = 1;
  for(auto &e : g[idx]) {
    if(e.to == par) continue;
    dfs(e.to, idx);
    subtree[idx] += subtree[e.to];
  }
}

void dfs2(int idx, int par)
{
  childmax[idx] = max(childmax[idx], N - subtree[idx]);
  for(auto &e : g[idx]) {
    if(e.to == par) continue;
    dfs2(e.to, idx);
    childmax[idx] = max(childmax[idx], subtree[e.to]);
  }
}

int64 dfs3(int idx, int64 dist, int par)
{
  int64 ret = 2 * dist;
  for(auto &e : g[idx]) {
    if(e.to == par) continue;
    ret += dfs3(e.to, dist + e.cost, idx);
  }
  return (ret);
}

int main()
{
  cin >> N;
  for(int i = 0; i < N - 1; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    --a, --b;
    g[a].emplace_back((edge) {b, c});
    g[b].emplace_back((edge) {a, c});
  }

  dfs(0, -1);
  dfs2(0, -1);
  int centroidsz = *min_element(childmax, childmax + N);
  vector< int > centroid;
  for(int i = 0; i < N; i++) {
    if(childmax[i] == centroidsz) {
      centroid.push_back(i);
    }
  }
  assert(centroid.size() <= 2);

  int64 ans = dfs3(centroid[0], 0, -1);

  if(centroid.size() == 1) {
    int mx = INF;
    for(auto &e : g[centroid[0]]) mx = min(mx, e.cost);
    ans -= mx;
  } else {
    for(auto &e : g[centroid[0]]) {
      if(e.to == centroid[1]) ans -= e.cost;
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 10496
#include<bits/stdc++.h>
#include <unistd.h>
using namespace std;
#define nl cout<<"\n"
#define pb push_back
#define se second
#define fi first
#define int long long 
#define pi pair<int,int>
#define vpi vector<pi>
#define vvpi vector<vpi>
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define For(i,n) for(int i=0;i<n;i++)
#define Forn(i,a,n) for(int i=a;i<n;i++)
#define pie =3.14159265358979323846264338327950;
const int mod= 998244353;



void solve(){
	fio;
	string s;
	cin>>s;
	if(s=="RRR"){
		cout<<3<<endl;
	}
	else if(s=="RRS" || s=="SRR"){
		cout<<2<<endl;
	}
	else if(s=="RSR" || s=="RSS" || s=="SRS" || s=="SSR"){
		cout<<1<<endl;
	}
	else cout<<0<<endl;
}


int32_t main(){
	fio;
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int t=1;
	//cin>>t;
	for(int i=1;i<=t;i++){ 
		//cout<<"Case #"<<i<<":\n";
		solve();
	}
	return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <string>
#include <iomanip>
#include <math.h>
#include <vector>
#include <map>

using namespace std;

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

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

  int min_diff = sum_W, sum_Left = 0,sum_Right=0;
  for (int i = 0; i < N / 2; ++i)
  {
    sum_Left += W[i];
    sum_Right += W[N - 1 - i];

    if (min_diff > abs(sum_W - 2 * sum_Left))  min_diff = abs(sum_W - 2 * sum_Left);
    if (min_diff > abs(sum_W - 2 * sum_Right)) min_diff = abs(sum_W - 2 * sum_Right);
  }
  cout << min_diff << endl;
}

Measured memory_bytes: 256
n,m = map(int,input().split())
par = [-1]*(n+1)
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x]) #経路圧縮
        return par[x]
def same(x,y):
    return find(x) == find(y)
def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return 0
    else:
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
def size(x):
    return -par[find(x)]
mx = 0
for _ in range(m):
    s,t = map(int,input().split())
    unite(s,t)
for i in range(1,n+1):
    ans = size(i)
    if ans > mx:
        mx = ans
print(mx)

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

#define rep(i,cc,n) for(int i=cc;i<n;++i)

struct UnionFind {
    vector<int> par;
    
    UnionFind(int n) : par(n, -1) { }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    bool issame(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x) {
        return -par[root(x)];
    }
};

using pint = pair<int,int>;
int main () {
    int N, M;
    cin >> N >> M;
    vector<set<int> > dame(N);
    UnionFind uf(N);
    for (int i = 0; i < M; ++i) {
        int a, b; cin >> a >> b; --a, --b;
        dame[a].insert(b);
        dame[b].insert(a);
        uf.merge(a, b);
    }
    int ans = 0;
    rep(i, 0, N){
        ans = max(uf.size(i),ans);
    }
    cout << ans << endl;
}

Measured memory_bytes: 32276
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#include<cmath>
#include<cstdint>


     
#define INF 1e9
#define LINF 1e19
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
     
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<ll, ll>;
     
const ll MOD = 1e9 + 7;
//最大公約数
ll gcd(ll a, ll b){
  if(b == 0)return a;
  else return gcd(b, a % b);
}


int dp[100][2];
int main(){
    int n, m;
    cin >> n >> m;
    vector<ll> x(n), y(n), z(n);
    rep(i, n)cin >> x[i] >> y[i] >> z[i];
    vector<vector<ll>> d(8, vector<ll>(n, - INF * INF));
    rep(i, n){
        int cnt = 0;
        rep(xx, 2){
            rep(yy, 2){
                rep(zz, 2){
                    d[cnt][i] = pow(-1, xx) * x[i] + pow(-1, yy) * y[i] + pow(-1, zz) * z[i];
                    cnt++;
                }
            }
        }
    }
    
    rep(i, 8)sort(ALL(d[i]), greater<ll>());
    ll res = 0;
    rep(i, 8){
        ll sum = 0;
        rep(j, m){
            sum += d[i][j];
        }
      //cout << sum << endl;
        chmax(res, sum);
    }
    cout << res << endl;
  //rep(i, 8){rep(j, n)cout << d[i][j] << " ";cout << endl;}
}





Measured memory_bytes: 3280
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair< int,int > ii;
typedef pair< long long int ,long long int > iil;
typedef long long ll;
typedef vector< ll > vl;
typedef vector< vl > vvl;
const ll MAX = 1e5+5;
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for( auto i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define EE '\n'
#define ll long long int
#define forn(i,j,n) for ( auto i=j ; i<n ; i++ )
#define fornd(i,j,n) for ( auto i=j ; i>n ; i-- )
#define PI 3.14159265
#define g(a,b) a>b?a:b
#define l(a,b) a<b?a:b
#define SOT(A) sort(A.begin(),A.end())
#define SOTR(A) sort(A.rbegin(),A.rend())

const int N = 200043;
const int MOD = 998244353;
//////////////// ncr ///////////////////////
int mul(int x, int y) {return (x * 1ll * y) % MOD;}
int binpow(int x, int y){
    int z = 1;
    while(y){
        if(y & 1) z = mul(z, x);
        x = mul(x, x);
        y >>= 1;
    }
    return z;
}
int inv(int x) {return binpow(x, MOD - 2);}
int divide(int x, int y) {return mul(x, inv(y));}
int fact[N];
void precalc(){
    fact[0] = 1;
    for(int i = 1; i < N; i++) fact[i] = mul(fact[i - 1], i);
}
int C(int n, int k)  {return divide(fact[n], mul(fact[k], fact[n - k]));}

/////////////// ncr  ///////////////////////


//////////////////Sieve////////////////////
vector<bool> is_prime(MAX+1, true);
void Sieve(){
	is_prime[0] = is_prime[1] = false;
	int i,j;
	for (i = 2; i*i <= MAX; i++) {
    	if (is_prime[i]) {
        	for (j = i * i; j <= MAX; j += i)
            	is_prime[j] = false;
    	}
	}
}
//////////////////Sieve////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


int main()
{
	string s;
	cin>>s;
	string vb,ve;
	int q;
	cin>>q;
	int tool=0;
	while(q--)
	{
		int ti;
		cin>>ti;
		if(ti==1)
		{
			tool^=1;
		}
		else
		{
			int fi;
			char ci;
			cin>>fi>>ci;
			if(fi==1)
			{
				if(tool==0)
				{
					vb.push_back(ci);
				}
				else ve.push_back(ci);
			}
			else
			{
				if(tool==0)
				{
					ve.push_back(ci);
				}
				else vb.push_back(ci);
			}
		}
	}
	reverse(vb.begin(),vb.end());
	//cout<<vb<<" "<<ve<<endl;
	vb+=s;
	vb+=ve;
	if(tool==1) reverse(vb.begin(),vb.end());
	cout<<vb<<endl;
}		

Measured memory_bytes: 1348
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<algorithm>

using namespace std;

typedef long long int Int;

int main(void) {
    int N;
    cin>>N;
    vector<int> A(N),B(N),C(N);

    for(int i = 0;i < N;i++) {
        cin>>A[i];
    }
    for(int i = 0;i < N;i++) {
        cin>>B[i];
    }
    for(int i = 0;i < N;i++) {
        cin>>C[i];
    }
    sort(A.begin(),A.end());
    sort(B.begin(),B.end());
    sort(C.begin(),C.end());

    Int sum = 0;
    for(int i = 0;i < N;i++) {
        Int temp1 = (lower_bound(A.begin(),A.end(),B[i])-A.begin());
        Int temp2 = (C.end() - upper_bound(C.begin(),C.end(),B[i]));
        sum += temp1*temp2;
    }

    cout<<sum<<endl;

    return 0;
}



Measured memory_bytes: 1408
#include <iostream>
using namespace std;
int main() {
  int N;
  cin >> N;
  int cnt = 0;
  if(N >= 105) cnt++;
  if(N >= 135) cnt++;
  if(N >= 165) cnt++;
  if(N >= 195) cnt++;
  if(N >= 189) cnt++;
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

    private static final long MOD = 1_000_000_000 + 7;

    private static void solve(Scanner in) {
        int N = in.nextInt();
        boolean isNEven = N % 2 == 0;
        int[] count = new int[N];
        for (int i = 0; i < N; i++) {
            int A = in.nextInt();
            boolean isAEven = A % 2 == 0;
            if (isNEven && isAEven || //
                    !isNEven && !isAEven) {
                System.out.println(0);
                return;
            }
            count[A]++;
        }
        if (isNEven) {
            for (int i = 1; i < N; i += 2) {
                if (count[i] != 2) {
                    System.out.println(0);
                    return;
                }
            }
        } else {
            if (count[0] != 1) {
                System.out.println(0);
                return;
            }
            for (int i = 2; i < N; i += 2) {
                if (count[i] != 2) {
                    System.out.println(0);
                    return;
                }
            }
        }
        long ans = 1;
        for (int i = 0; i < N / 2; i++) {
            ans = (ans * 2) % MOD;
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 31616
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;
//const double pi = 3.14159265358979323846;

void	solve()
{
	string s;
	cin >> s;
	cout << s.substr(0, 3) << endl;
}

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

	solve();
}


Measured memory_bytes: 3656
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int d = sc.nextInt();
        int cnt=0;
        int now = 0;
        while(now<n) {
            now += 2*d+1;
            cnt++;
        }

        System.out.println(cnt);
    }
}

Measured memory_bytes: 21716
// #include <bits/stdc++.h>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
using namespace std;
#define ll long long
#define pi pair<int,int>
#define vi vector<int>
char solve(){
    char c;
    cin>>c;
    return (c>='A'&&c<='Z')?'A':'a';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << solve() << "\n";
  return 0;
} 

Measured memory_bytes: 3620
"use strict";

const main = arg => {
    const inputList = arg.trim().split("\n");
    // 回答を記述
    const A = inputList[0].split(" ")[0];
    const B = inputList[0].split(" ")[1];

    console.log(parseInt(A) * parseInt(B));

}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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


namespace radius
{
    class Program
    {
        static void Main(string[] args)
        {
            double r, area, circumference; 
             r = double.Parse(Console.ReadLine());
             area = r * r * Math.PI;
            circumference = 2 * Math.PI * r;
            Console.WriteLine("{0:f6} {1:f6}", area, circumference);

        }
    }
}

Measured memory_bytes: 20112
#!/usr/bin/env python3
import sys


def solve(N: int, M: int, A: "List[int]"):
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N, M = map(int,input().split())
    a = list(map(int,input().split()))

    sum = 0
    for i in range(M):
        sum += a[i]
    left = N - sum
    if left >= 0:
        print(left)
    else:
        print(-1)

if __name__ == '__main__':
    main()



Measured memory_bytes: 10192
#!/usr/bin/env python3
from itertools import product, permutations, combinations
N=int(input())
dp = [N for i in range(N+1)]
dp[0] = 0
for i in range(1, N+1):
    power = 1
    while power <= i:
        dp[i] = min(dp[i], dp[i-power] + 1)
        power *= 6
    power = 1
    while power <= i:
        dp[i] = min(dp[i], dp[i-power] + 1)
        power *= 9
print(dp[N])

Measured memory_bytes: 3864
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define pb push_back
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int kaijo[2000010];
struct edge{int to,cost;};
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
void init_fact(){
    kaijo[0]=1;
    for(int i=1;i<=2000000;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=MOD;
    }
}
int modpow(int a,int b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%MOD;
    int memo=modpow(a,b/2);
    return memo*memo%MOD;
}
int comb(int a,int b){
    if(!kaijo[0])init_fact();
    return kaijo[a]*modpow(kaijo[a-b],MOD-2)%MOD*modpow(kaijo[b],MOD-2)%MOD;
}
int inv(int x){
    x=modpow(x,MOD-2);
    return x;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){
    double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
    double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
    double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
    double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
    return tc*td<0&&ta*tb<0;
}
double dist(double ax,double ay,double bx,double by){
    return sqrt((bx-ax)*(bx-ax)+(ay-by)*(ay-by));
}
int n,m,L=1;
int cnt;
signed main(){
    cin>>n>>m;
    rep(i,n){
        int a;
        cin>>a;
        a/=2;
        L=lcm(L,a);
        int c=0;
        while(a%2==0){
            a/=2;
            c++;
        }
        if(i==0)cnt=c;
        else{
            if(cnt!=c){
                cout<<0<<endl;
                return 0;
            }
        }
        if(L>m){
            cout<<0<<endl;
            return 0;
        }
    }
    cout<<(m/L+1)/2<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <numeric>
#include <string>

using namespace std;

int main(void){
    long long N;
    vector<long long> A(5);
    cin>>N;
    for(int i=0;i<5;i++){
        cin>>A[i];
    }

    long long mincap=*min_element(A.begin(),A.end());

    long long ans=0;

    ans=N/mincap;
    if(N%mincap!=0){ans++;}

    ans+=4;

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define reps(i,s,n) for(int i=s, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
const char sp = ' ';


using namespace std;

int main(void){
    ll count=0;
    ll M, D;
    cin>>M>>D;
    rep1(i, M) reps(j, 10, D+1){
        if(j%10>=2 && j/10>=2 && (j%10)*(j/10)==i) count++;
    }
    cout<<count<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define SZ(a) ((int)(a).size())
typedef long long int64;
int64 dp[3333][3333][4],v[3333][3333];
int main(){
#ifdef LOCAL
  freopen(".a.in", "r", stdin);
#endif
  ios_base::sync_with_stdio(false),cout.tie(0),cin.tie(0);
  int n,m,k;cin>>n>>m>>k;
  for(int i=0;i<k;++i){
    int x,y;cin>>x>>y;
    cin>>v[x][y];
  }
  for(int i=1;i<=n;++i){
    for(int j=1;j<=m;++j){
      if(v[i][j]){
        for(int a=3;a;--a)dp[i][j][a]=max(dp[i][j][a-1]+v[i][j],dp[i][j][a]);
      }
      for(int a=0;a<=3;++a)dp[i+1][j][0]=max(dp[i][j][a],dp[i+1][j][0]);
      for(int a=0;a<=3;++a)dp[i][j+1][a]=max(dp[i][j][a],dp[i][j+1][a]);
    }
  }
  int64 res=dp[n][m][0];
  for(int a=0;a<=3;++a)res=max(res,dp[n][m][a]);
  cout<<res<<'\n';
  return 0;
}
//2020.08.15 21:02:54


Measured memory_bytes: 374672
#include <iostream>
#include<algorithm>
#include<string>
#include<vector>

using namespace std;
int main()
{
	int A,B,C,D;
	cin >> A >> B >> C >> D;
	cout << (A + B <= C + D ? (A+B == C+D ? "Balanced" : "Right") : "Left") << endl;
}

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

struct Node {
  Node *left, *right;
  
  Node() : left(NULL), right(NULL) {}
  
  ~Node() {
    delete left;
    delete right;
  }
};

const char *p;

Node *parse(){ 
  Node *ret = new Node;
  
  if(*++p == '(') {
    ret->left = parse();
  }
  if(*++p == '(') {
    ret->right = parse();
  }
  ++p;
  
  return ret;
}

Node *child(Node *node, string op) {
  return node ? ( op == "l" ? node->left : node->right ) : NULL;
}

Node *traverse(string op, Node *node1, Node *node2) {
  Node *ret = NULL;
  
  if(op == "i") {
    if(node1 && node2) {
      ret = new Node;
    }
  } else {
    if(node1 || node2) {
      ret = new Node;
    }
  }
  
  if(ret != NULL) {
    ret->left = traverse(op, child(node1, "l"), child(node2, "l"));
    ret->right = traverse(op, child(node1, "r"), child(node2, "r"));
  }
  
  return ret;
}

string tostr(Node *node) {
  if(node == NULL) return "";
  return '('  + tostr(node->left) + ',' + tostr(node->right) + ')';
}

int main() {
  
  string op, str1, str2;
  
  while(cin >> op >> str1 >> str2) {
    Node *root1, *root2, *res;
    p = str1.c_str();
    root1 = parse();
    p = str2.c_str();
    root2 = parse();

    res = traverse(op, root1, root2);
    string out;
    out = tostr(res);
    cout << out << endl;
    
    delete root1;
    delete root2;
    delete res;
  }
  
  return 0;
}

Measured memory_bytes: 1200
#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
using namespace std;
const int MAXN=1e2+10;
int n,m,dp[MAXN][MAXN];
char mp[MAXN][MAXN];
int main(){
    while(~scanf("%d %d",&n,&m)){
        for(int i=1;i<=n;i++) scanf("%s",mp[i]+1);
        if(mp[1][1]=='#') dp[1][1]=1;
        else dp[1][1]=0;
        for(int i=2;i<=n;i++){
            if(mp[i][1]=='.'||mp[i][1]==mp[i-1][1]) dp[i][1]=dp[i-1][1];
            else dp[i][1]=dp[i-1][1]+1;
        }
        for(int i=2;i<=m;i++){
            if(mp[1][i]=='.'||mp[1][i]==mp[1][i-1]) dp[1][i]=dp[1][i-1];
            else dp[1][i]=dp[1][i-1]+1;
        }
        for(int i=2;i<=n;i++){
            for(int j=2;j<=m;j++){
                int r1,r2;
                if(mp[i][j]=='.'||mp[i][j]==mp[i-1][j]) r1=dp[i-1][j];
                else r1=dp[i-1][j]+1;
                if(mp[i][j]=='.'||mp[i][j]==mp[i][j-1]) r2=dp[i][j-1];
                else r2=dp[i][j-1]+1;
                dp[i][j]=min(r1,r2);
            }
        }
        printf("%d\n",dp[n][m]);
    }
    return 0;
}


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

using namespace std;
typedef long long ll;
const int N = 1e5 + 5;

int bxs[N];
map<int, bool> isRed;
int main()
{
    ios_base::sync_with_stdio(false);
    int n, m; cin >> n >> m;

    fill(bxs, bxs + N, 1);
    isRed[1] = true;
    for(int i=0; i<m; i++) {
        int b1, b2; cin >> b1 >> b2;
        bxs[b1]--;
        bxs[b2]++;
        if(isRed[b1]) isRed[b2] = true;
        if(bxs[b1] == 0) isRed[b1] = false;
    }
    int total = 0;
    for(int i=1; i<=n; i++) {
        if(isRed[i]) total++;
    }
    cout << total << "\n";
    return 0;
}


Measured memory_bytes: 5376
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, money; cin >> n >> money;
    for(int i = 0; i <= n; i++)
    {
        for(int j = 0; j <= n; j++)
        {
            int sum = 10000 * i + 5000 * j; 
            if(sum > money) break;
            int k = (money - sum) / 1000;
            if(sum + k * 1000 == money && i + j + k == n)
            {
                cout << i << " " << j << " " << k << endl;
                return 0;
            }
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;
    return 0;
}



Measured memory_bytes: 256
//的場梨沙★担当
//結城晴★副担当
//日野茜★副担当
#include <vector>
#include <list>
#include <map>
#include <climits>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string.h>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <cctype>
#include <complex>
#include <regex>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <stdio.h>


using namespace std;

int main(void) {
    int N,X;
    cin>>N>>X;
    vector<int>A(N+1);
    A[0]=0;
    for(int i=0;i<N;i++){
        int x;cin>>x;
        A[i+1]=A[i]+x;
    }
    int ans=0;
    for(int i=0;i<=N;i++){
        if(A[i]<=X){
            ans++;
        }
    }

    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define MOD 1000000007 //10^9+7
#define INF 1000000000 //10^9

pair<double, double>equ2(int a,int b,int c,int d,int e,int f);

pair<double, double>equ2(int a,int b,int c,int d,int e,int f){
    double det=1.0/(a*e-b*d);
    double x=(double)(c*e-b*f)*det;
    double y=(double)(a*f-c*d)*det;
    if (x==-0) x=0;if (y==-0) y=0;
    return pair<double, double>(x,y);
}



int main ()
{
    int a,b,c,d,e,f;
    while (cin>>a>>b>>c>>d>>e>>f) {
        pair<double,double> ans=equ2(a,b,c,d,e,f);
        
        printf("%.3f %.3f\n",ans.first,ans.second);
    }
    return 0;
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

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


Measured memory_bytes: 256
N = int(input())
X = input()
ans = [1 for _ in range(N)]

if N == 1:
  if X[0] == '1':
    print(0)
    exit()
  else:
    print(1)
    exit()
 
l = 0
for k in range(N):
  if X[k] == '1':
    l+=1

if l == 0:
  for _ in range(N):
    print(1)
  exit()
if l == 1:
  if X[-1] == '1':
    for _ in range(N-1):
      ans[_] = 2
  else:
    ans[-1] = 2 
  for k in range(N):
    if X[k] =='1':
      ans[k] = 0 
  for _ in range(N):
    print(ans[_])
  exit()
 
 
intN = int(X, 2)
N1 = intN %(l-1)
N0 = intN %(l+1)


start = []
s1 = 1
s0 = 1
for k in range(N-1, -1, -1):
  if X[k] == '1':      
    ia = (N1 - s1)%(l-1)
  else:
    ia = (N0 + s0)%(l+1)
  start.append(ia)
  s1 = s1*2%(l-1)
  s0 = s0*2%(l+1)
start = start[::-1]

ml = len(bin(l+1))-2
poplist = [[] for _ in range(ml)]
poplist[0] = [0,1]
for k in range(1, ml):
  for m in range(k):
    poplist[k] += poplist[m]
  for m in range(len(poplist[k])):
    poplist[k][m] += 1
newpoplist = []
for _ in range(len(poplist)):
  newpoplist += poplist[_] 


for k in range(len(start)):
  for count in range(10*5):
    if start[k] == 0:
      ans[k] += count
      break
    else:
      start[k] = start[k] % newpoplist[start[k]]
 
for k in range(N):
  print(ans[k])

Measured memory_bytes: 20604
#include <stdio.h>

int main(void){

  int x,y;

  printf("");
  scanf("%d %d",&x,&y);

  if (x<y){
    
    printf("a < b\n");
    
  } else if (x>y){
    
    printf("a > b\n");
    
  } else if (x==y){
    
    printf("a == b\n");
    
  }

      return 0; 
  }

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

namespace AGC002
{
    public class B
    {
        private void Run()
        {
            var input = Console.ReadLine().Trim().Split();
            var N = int.Parse(input[0]);
            var M = int.Parse(input[1]);

            var can = new bool[N];
            can[0] = true;
            var count = Enumerable.Repeat(1, N).ToArray();
            while (M-- > 0)
            {
                input = Console.ReadLine().Trim().Split();
                var x = int.Parse(input[0]) - 1;
                var y = int.Parse(input[1]) - 1;
                if (can[x]) { can[y] = true; }
                count[x]--;
                count[y]++;
                if (count[x] == 0) { can[x] = false; }
            }
            Console.WriteLine(can.Count(b => b));
        }

        public static void Main()
        {
            var old = Console.Out;
            using (var writer = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false })
            {
                Console.SetOut(writer);
                new B().Run();
                Console.Out.Flush();
                Console.SetOut(old);
            }
        }
    }
}


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

using namespace std;

int mergeSort(int left, int right)
{
  if(left + 1 < right) {
    int mid = (left + right) >> 1;
    return (mergeSort(left, mid) + mergeSort(mid, right) + right - left);
  } else {
    return (0);
  }
}

int main()
{
  int N, A[500000];
  scanf("%d", &N);
  for(int i = 0; i < N; i++) scanf("%d", &A[i]);
  sort(A, A + N);
  for(int i = 0; i < N; i++) {
    if(i > 0) putchar(' ');
    printf("%d", A[i]);
  }
  putchar('\n');
  printf("%d\n", mergeSort(0, N));
}



Measured memory_bytes: 5240
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

struct fast_io {
	fast_io(){
		std::cin.tie(nullptr);
		std::ios::sync_with_stdio(false);
	};
} fio;

signed main(){
	cout<<fixed<<setprecision(10);
	
	int N, M, sum = 0;
	vector<int> A;
	
	cin>>N>>M;
	
	A.resize(M);
	
	for(int i = 0; i < M; i++){
		cin>>A[i];
		sum += A[i];
	}
	
	if(sum > N) cout<<-1<<endl;
	else cout<<N - sum<<endl;
	
	
	return 0;
}

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

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


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

int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

signed main() {
  int N;
  cin >> N;
  int sum = 0;
  
  for (int i = 1; i <= N; i++){
    for (int j = 1; j <= N; j++){
      for (int k = 1; k <= N; k++){
        sum += gcd(gcd(i, j), k);
      }
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 3632
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n,k,s = readInts()
    ans = []
    for i in range(k):
        ans.append(s)
    for i in range(k,n):
        if s >= 100:
            ans.append(s-1)
        else:
            ans.append(s+1)
    print(*ans)
if __name__ == '__main__':
  main()


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

int main() {
	// your code goes here
	int n, k;
	string str;
	
	cin >> n;
	cin >> str;
	cin >> k;
	
	char key = str[k-1];
	
	for(int i=0 ; i<n; i++) {
		if(str[i] != key) {
			str[i] = '*';
		}
	}
	
	cout << str << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;
using ll = long long;
using ld = long double;

#define ALL(x) begin(x), end(x)
#define REP(i, n) for (size_t i = 0, i##_len = (n); i < i##_len; ++i)

void solve(ll X, ll Y, ll Z) {
  cout << (X-Z)/(Y+Z) << endl;
}

int main() {
  ll X;
  cin >> X;
  ll Y;
  cin >> Y;
  ll Z;
  cin >> Z;
  solve(X, Y, Z);
  return 0;
}


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

int main() {
  int n,m;
  cin>>n>>m;
  vector<vector<long>> a(n, vector<long>(2));
  for(int i=0;i<n;i++){
    for(int j=0;j<2;j++) cin>>a[i][j];
  }
    sort(a.begin(),a.end());
  //cout<<a[0][0]<<" "<<a[0][1]<<endl;
  //cout<<a[1][0]<<" "<<a[1][1]<<endl;
  int i=0;
  long ans=0;
  while(m>0){
    if(a[i][1]>m){
      ans += a[i][0]*m;
      m -= m;
    }
    else{
      ans += a[i][0]*a[i][1];
      m -= a[i][1];
    }
    //cout<<ans<<endl;
    i++;
  }
  cout<<ans<<endl;
  }


Measured memory_bytes: 5760
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
typedef long long int ll;
typedef unsigned long long int sll;
typedef  double ld;
#define A 1000000007ll
#define D 1000000000ll
#define B 998244353ll
#define C 1000000000000000000ll
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define oset tree<pair<ll,ll>, null_type,less<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> 
#define pb push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define br break
#define PI 3.14159265358979323
#define subt cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n"

int main() 
{
    FAST;
    ll n;
    cin>>n;
    ll ans=0;
    ll x=10,y=50;
    ans+=(n/10);
    while(y<=C)
    {
        ans+=(n/y);
        y=y*5;
    }
    if(n%2==0)
        cout<<ans;
    else
        cout<<0;
    subt;   
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
////////////////////////////

int main(){
    ll a,b,c,d;cin>>a>>b>>c>>d;
    if(b<=c || d<=a){
        cout<<0<<endl;
    }else if(b<=d){
        cout<<min(b-a,b-c)<<endl;
    }else{
        cout<<min(d-c,d-a)<<endl;
    }
    
    
    return 0;
}


Measured memory_bytes: 256
from sys import stdin
import math


def main():
    _in = [_.rstrip() for _ in stdin.readlines()]
    N, D = list(map(int, _in[0].split(' ')))  # type:list(int)
    X_Y_arr = []
    for i in range(N):
        _ = list(map(int, _in[i+1].split(' ')))  # type:list(int)
        X_Y_arr.append(_)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    ans = 0
    for x,y in X_Y_arr:
        if math.sqrt(x**2+y**2)<=D:
            ans += 1
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 130624
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

N = i_i()

arr = [[] for _ in range(N)]
for i in range(N):
    A = i_i()
    for _ in range(A):
        x, y = i_l()
        arr[i].append((x-1, y))

ans = 0
for i in range(1, 1<<N):
    ok = True
    for j in range(N):
        if not i>>j&1:
            continue
        for x, y in arr[j]:
            if (i >> x) & 1 != y:
                ok = False
                break
        if not ok:
            break
    if ok:
        ans = max(ans, bin(i)[2:].count('1'))

print(ans)

Measured memory_bytes: 3064
#include <stdio.h>
#define N_MAX 100000
#define A_MAX (1e9+1)

int main() {
    int i, n, m, a[N_MAX];
    scanf("%d", &n);
    for (i=0; i<n; i++) a[i] = A_MAX;
    while (~scanf("%d", &m)) {
        int x = 0, y = n - 1;
        while (x != y) {
            int z = (x + y) / 2;
            if (m > a[z]) x = z + 1;
            else if (m <= a[z]) y = z;
        }
        a[x] = m;
    }
    for (i=n-1; a[i]==A_MAX; i--);
    printf("%d\n", i+1);
}



Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
  int a, b, c;
  cin >> a >> b >> c;
  
  if ((a * b) > c) {
    cout << c << endl;
  } else if ((a * b) < c) {
    cout << a * b << endl;
  } else {
    cout << c << endl;
  }
}

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

using namespace std;

int main(){
  int i, j, n, m, count=0, data[5];
  string abacus[10];

  abacus[0] = "* = ****";
  abacus[1] = "* =* ***";
  abacus[2] = "* =** **";
  abacus[3] = "* =*** *";
  abacus[4] = "* =**** ";
  abacus[5] = " *= ****";
  abacus[6] = " *=* ***";
  abacus[7] = " *=** **";
  abacus[8] = " *=*** *";
  abacus[9] = " *=**** ";

  while(cin >> n){
    if(count != 0)
      cout << endl;

    for(i=0, j=10000; i<5; ++i, j/=10){
      m = n/j;
      n = n - m*j;
      data[i] = m;
    }

    for(i=0; i<8; ++i){
      for(j=0; j<5; ++j){
	cout << abacus[data[j]][i];
      }
      cout << endl;
    }
    ++count;
  }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (ll i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (ll i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,x) for (ll i = 0; i < x.size(); i++)
#define RREPALL(i,x) for (ll i = x.size()-1; i >= 0; i--)
#define REPITR(itr,x) for (auto itr = (x).begin(); itr != (x).end(); itr++)
#define ALL(x) (x).begin(), (x).end()
#define SORT(x) sort(ALL(x))
#define MIN_ELEMENT(x) min_element(ALL(x))
#define MAX_ELEMENT(x) max_element(ALL(x))
#define COUNT(x,num) count(ALL(x), num)
#define MEMSET(x,val) memset(x, val, sizeof(x))
#define CHMAX(a,b) a = max(a,b)
#define CHMIN(a,b) a = min(a,b)
#define debug(x) cerr<<__LINE__<<": "<<(#x)<<" = "<<(x)<<endl;
void YES(bool flag) {cout<<(flag ? "YES" : "NO")<<endl;}
void Yes(bool flag) {cout<<(flag ? "Yes" : "No")<<endl;}
void yes(bool flag) {cout<<(flag ? "yes" : "no")<<endl;}
#define e1 first
#define e2 second
#define newline putchar('\n')
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef vector<ll> VLL;
typedef vector<vector<ll>> VVLL;
const int INF = 1e7;
const ll MOD = 1e9 + 7;
const double pi = 3.141592653589793;
const VI dx = {1, 0, -1, 0};
const VI dy = {0, 1, 0, -1};

int main()
{
    ll a, v, b, w, t;
    cin>>a>>v>>b>>w>>t;
    YES(v * t - w * t >= abs(a-b));

    return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <functional>
#include <map>
#include <set>
#include <stack>
#include <deque>
#include <queue>

//#define INF 1000000000;
#define MOD 1000000007;
#define LIMIT 1000000000000000000;
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

int main() {
    ll x; cin >> x;
    ll rem = x % 11;
    ll tmp;
    if (rem == 0) tmp = 0;
    else if (0 < rem && rem <= 6) tmp = 1;
    else if (6 < rem && rem <= 11) tmp = 2;
    ll ans = (x / 11) * 2 + tmp;
    cout << ans << endl;
}

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

main()
{
    int k; cin>>k; k%=10;
    if(k==3) cout << "bon" << "\n";
    else if(k==0 or k==1 or k==6 or k==8) cout << "pon" << "\n";
    else cout << "hon" << "\n";
    return 0;

    string s; cin>>s;
    if(s.size()>k)
    {
        cout << s.substr(0,k)+"..." << "\n";
    }
    else
    {
        cout << s << "\n";
    }
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <set>
#include <queue>
#include <deque>
#include <map>
using namespace std;

#define mod 1000000007
#define ten5 100005
#define ten52 200005
#define ten6 1000005
#define PI 3.1415926
#define pb(x) push_back(x)
#define all(x) x.begin(),x.end()

typedef long long int ll;

//ll num[50];
//ll num2[50];
ll num[10];
//set<ll> sll;
//map<string,ll> mp,mp1;
//map<string,ll>::iterator iter;
//deque<char> deq;

int main(void)
{
    //double ans=0.0,d,d1,d2;
    //float f,g,h;
    long long int m,n,i,j,k=1;
    long long int a,a1=0,a2=0,a3=0;
    string s;
    char c,c1;
    a=a1=a2=a3=0;
    cin>>s;
    if(s.size()%2==1)
    {
        cout<<"No";
        return 0;
    }
    for(i=0;i<s.size()-1;i++)
    {
        if(s[i]!='h')
        {
            cout<<"No";
            return 0;
        }
        else
        {
            i++;
            if(s[i]!='i')
            {
                cout<<"No";
                return 0;
            }
        }
    }
    cout<<"Yes";
    return 0;
}





Measured memory_bytes: 256