akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
int C[202020];
vector<pair<int,int>> cand[202020];
vector<int> E[202020];
int L[202020],R[202020],id;
int rem[201010];

int pr[202020];
vector<int> hist[202020];


template<class V, int ME> class BIT {
public:
	V bit[1<<ME];
	V operator()(int e) {if(e<0) return 0;V s=0;e++;while(e) s+=bit[e-1],e-=e&-e; return s;}
	void add(int e,V v) { e++; while(e<=1<<ME) bit[e-1]+=v,e+=e&-e;}
};
BIT<ll,20> bt;

void dfs(int cur,int pre) {
	if(hist[C[cur]].size()) pr[cur]=hist[C[cur]].back();
	
	L[cur]=id++;
	cand[C[cur]].push_back({L[cur],cur});
	FORR(e,E[cur]) {
		hist[C[cur]].push_back(e);
		if(e!=pre) dfs(e,cur);
		hist[C[cur]].pop_back();
	}
	R[cur]=id;
	bt.add(L[cur],N-(R[cur]-L[cur]));
	bt.add(L[cur]+1,-(N-(R[cur]-L[cur])));
	
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	
	cin>>N;
	FOR(i,N) {
		cin>>C[i];
		C[i]--;
	}
	FOR(i,N-1) {
		cin>>x>>y;
		E[x-1].push_back(y-1);
		E[y-1].push_back(x-1);
	}
	dfs(0,0);
	
	FOR(i,N) {
		ll ret=0;
		sort(ALL(cand[i]));
		FORR(c,cand[i]) {
			x=c.second;
			int num=bt(L[x])+1;
			ret+=num;
			FORR(e,E[x]) if(L[e]>L[x]) {
				ret+=1LL*num*(R[e]-L[e]);
				num+=(R[e]-L[e]);
			}
			//cout<<x<<" "<<ret<<endl;
			FORR(e,E[x]) if(L[e]>L[x]) {
				bt.add(L[e],-(num-(R[e]-L[e])));
				bt.add(R[e],num-(R[e]-L[e]));
			}
			y=pr[x];
			bt.add(L[y],-(R[x]-L[x]));
			bt.add(L[x],(R[x]-L[x]));
			bt.add(R[x],-(R[x]-L[x]));
			bt.add(R[y],(R[x]-L[x]));
			rem[x]=num;
		}
		FORR(c,cand[i]) {
			x=c.second;
			FORR(e,E[x]) if(L[e]>L[x]) {
				bt.add(L[e],(rem[x]-(R[e]-L[e])));
				bt.add(R[e],-(rem[x]-(R[e]-L[e])));
			}
			y=pr[x];
			bt.add(L[y],(R[x]-L[x]));
			bt.add(L[x],-(R[x]-L[x]));
			bt.add(R[x],(R[x]-L[x]));
			bt.add(R[y],-(R[x]-L[x]));
		}
		cout<<ret<<endl;
	}
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 62672
#include <bits/stdc++.h>
using namespace std;
#define MAX_N 100000
#define MAX_M 100000
#define vec vector<int>
#define vecst vector<string>
#define vecch vector<char>
#define vecf vector<float>
#define vecvec vector<vector<int>>
#define vecHvec vector<vector<char>>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int INF = 1e9;
#define PI 3.141592653589793
// cout << setprecision(15) << std::fixed;

int ctoi(char c) {
	switch (c) {
		case '0': return 0;
		case '1': return 1;
		case '2': return 2;
		case '3': return 3;
		case '4': return 4;
		case '5': return 5;
		case '6': return 6;
		case '7': return 7;
		case '8': return 8;
		case '9': return 9;
		default: return -123;
	}
}

int main(){
  int n,g,ans=INF;
  cin>>n>>g;
  int A[n];
  int B[n];
  for(int i=0;i<n;i++){
    cin>>A[i]>>B[i];
  }
  for(int s=0;s<(1<<n);++s){
    int cou=0,sco=0,maxi=-1;
    for(int i=0;i<n;++i){
      if(s>>i&1){
        sco+=(i+1)*A[i]*100+B[i];
        cou+=A[i];
      }
      else{
        maxi=i;
      }
    }
    if(sco<g){
      int ss=100*(maxi+1);
      int sp=(g-sco+ss-1)/ss;
      if(sp>=A[maxi]) continue;
      cou+=sp;
    }
    ans=min(ans,cou);
  }
  cout<<ans<<endl;
}


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

int main()
{

	int A, B;
	cin >> A >> B;

	if (A >= 13) {
		cout << B << endl;
	}
	else if (6 <= A && A <= 12) {
		cout << B / 2 << endl;
	}
	else {
		cout << 0 << endl;
	}
}






Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
typedef unsigned long long ull;
typedef long long ll;
typedef double db;
#define pii pair<int,int>
#define pll pair<long long,long long>
#define usi unordered_set<int>
#define usl unordered_set<long long>
#define umii unordered_map<int,int>
#define umsi unordered_map<string,int>
#define umll unordered_map<long long,long long>
#define fi first
#define sec second
#define pub push_back
#define pob pop_back
#define B begin
#define E end
#define mp make_pair
#define vi vector<int>
#define vl vector<long long>
#define vii vector<pii>
#define vll vector<pll>
#define deb(x) cout<<#x<<": "<<x<<"\n"
#define endl '\n'
#define PIE 3.141592653
#define MOD 1000000007
#define f(i,a,b,c) for(ll i=a;i<=b;i+=c)
#define frev(i,n,b,c)  for(ll i=n;i>=b;i-=c)
const ll inf = 1000000000000000000;
using namespace std;
 
//            < = = = = =    GCD     = = = = = >
 
ll gcd(ll a,ll b)
{
	if(a<b)	gcd(b,a);
	if(b==0)	return a;
	return gcd(b,a%b);
}
 
//            < = = = = =    LCM     = = = = = >
 
ll lcm(ll a,ll b) 
{ 
	ll x=(a/gcd(a,b))*b; 
	return x;
}
 
//            < = = = = =    power  x^n     = = = = = >
 
ll power(ll x , ll n , ll m=inf){
	if(x==0){
		return 0;
	}
	if(n==0){
		return 1;
	}
	ll ans;
	if(n%2==0){
		ll smallAns = power(x,n/2,m);
		ans = (smallAns*smallAns)%m;		
	} else {
		ll smallAns = power(x,n-1,m);
		ans = x;
		ans = (ans*smallAns)%m;
	}
	// for negative values also
	return (ans+m)%m;
	
}
 
//            < = = = = =    CHECK FOR PRIME     = = = = = >
 
bool isprime(int n){
   if(n==2){
        return true;
    }
    else if(n%2==0){
        return false;
    }
    else{
        for(int i=3;i*i<=n;i+=2){
            if(n%i==0){
                return false;
            }
        }
        return true;
    }
}
 
//            < = = = = =    SOLVE    = = = = = >
 
// bool cmp(pll x, pll y){
//     ll dx = min(2*(x.first),x.second)-min(x.first,x.second);
//     ll dy = min(2*(y.first),y.second)-min(y.first,y.second);
//     return dx>dy;
// }
 
// void rec(int n){
//     if(){
//         return;
//     }
    
//     return;
// }
 
int solve() {fastio
    
    double d,t,s;
    cin>>d>>t>>s;
    double tc = d/s;
    if(tc<=t)cout<<"Yes";
    else cout<<"No";
    
    return 0;
}
 
//            < = = = = =    MAIN     = = = = = >
 
int main() {fastio
    
 	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
    
    int t=1;
     // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 3736
n = int(input())
a = list(map(int, input().split()))

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

gl = [a[0]]
for i in range(1, n):
    gl.append(gcd(gl[i-1], a[i]))
gr = [a[n-1]]
for i in range(1, n):
    gr.append(gcd(gr[i-1], a[n-i-1]))

ans = max(gl[n-2], gr[n-2])
for i in range(1, n-1):
    ans = max(ans, gcd(gl[i-1], gr[n-2-i]))

print(ans)

Measured memory_bytes: 14400
//
//  main.cpp
//  CoderProj
//
//  Created by Minoru Hayashi on 2020/03/12.
//  Copyright © 2020 Minoru Hayashi. All rights reserved.
//
//
//  
//

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

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

using ll = long long;

template<class T> inline bool chmin(T& a, T b){ if(a>b){a=b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b){ if(a<b){a=b; return 1;} return 0;}

// const ll INF = 1LL<<60;
// const int INF = 1<<29;
// const ll MOD = 1000000007;

//#define __DBG__



void solve(void){
  
  int N;
  
  cin >> N;
  
  vector<int> X(N);
  vector<int> Y(N);
  vector<ll> S;
  vector<int> NN(N);
  vector<vector<int>> G(N, vector<int>(N,0));
  
  REP(i,N){
    cin >> X[i] >> Y[i];
    NN[i]=i;
  }
  
  double T=0;
  
  do{
    for(int i=0; i<N-1; i++){
//      cout << NN[i] << " " << NN[i+1] << "  ";
      G[NN[i]][NN[i+1]]++;
    }
//    cout << endl;
  }while(next_permutation(ALL(NN)));
    
  REP(i,N){
    REP(j,N){
      if(i==j){continue;}
      ll DX = X[i]-X[j];
      ll DY = Y[i]-Y[j];
      ll Z = (DX*DX + DY*DY) * G[i][j] * G[i][j];
      T += G[i][j];
      S.push_back(Z);
 //     cout << i << ":" << j << " " << Z << endl;
    }
  }
  
  double A=0;
  
  for(auto z:S){
    A += sqrt(z);
  }
  A *= (N-1);
    cout.precision(12);
    cout << A/(double)T << endl;


  return;
   
}


int main(int argc, const char * argv[]) {

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

    solve();
 
    return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/abc141/tasks/abc141_a
#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
using ll = long long;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    if (s == "Sunny") {
        cout << "Cloudy\n";
    } else if (s == "Cloudy") {
        cout << "Rainy\n";
    } else {
        cout << "Sunny\n";
    }
    return 0;
}

Measured memory_bytes: 256
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]
K = int(input())
print(A[K - 1])


Measured memory_bytes: 2940
#pragma GCC optimize("O2,Ofast,inline,unroll-all-loops,-ffast-math")
using namespace std;
#include <bits/stdc++.h>
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb(X) push_back(X)
#define x first
#define y second
#define all(x) (x).begin(), (x).end()
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
typedef long long ll;
typedef vector<int> VI;
typedef vector<long long> VL;
typedef pair<int, int> pii;
//ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/__gcd(a,b);}
#define MAXN 123
int k;
int DP[MAXN][MAXN];

void IN() {
	cin >> k;
}
queue<int> ans;
void OUT() {
	 while(!ans.empty()){
        int now=ans.front();
        cout << now;
        ans.pop();
    }
}
int main(){
    INIT
    cin >> k;
    fill(DP[0], DP[0] + MAXN * MAXN, 0);
	//memset(DP,0, sizeof(DP));
    for (int k = 0; k <=9 ; ++k) {
        DP[1][k]=1;
    }
    for (int i = 2; i <=10 ; ++i) {
        for (int j = 0; j <=9 ; ++j) {
            DP[i][j]=DP[i-1][j]+DP[i-1][j-1]+DP[i-1][j+1];
        }
    }
    int l=0, r = 0,fl=0;
    for (int j = 1; j <=10 ; ++j) {
    	int flag = false;
        for (int i = 1; i <=9 ; ++i) {
            if(k<=DP[j][i]){
                l=j;
                r=i;
                fl=1;
                break;
            }
            k-=DP[j][i];
        }
        if(fl==1)break;
        if (flag == true) {
        	break;
		}
    }
    l--;
    int cntt = 0;
    rep (i, 0, 4) {
    	rep (j, 0, 3) {
    		cntt++;
		}
	}
    ans.push(r);
    VI A(4);
    while(l!=0){
        if(k<=DP[l][r-1]){
            r--;
            ans.push(r);
        }else{
            k-=DP[l][r-1];
            if(k<=DP[l][r]){
                ans.push(r);
            }else{
                k-=DP[l][r];
                r++;
                ans.push(r);
            }
        }
        l--;
    }
    OUT();
    return 0 ;
}

Measured memory_bytes: 384
const int LG = 21;
const int FN = 400005;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;

#include <bits/stdc++.h>

using namespace std;
#define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;

#define forn(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define fi first
#define se second
#define re return
#define pb push_back
#define uniq(x) sort(all(x)); (x).resize(unique(all(x)) - (x).begin())

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " " << #x << " " << x << endl
#define ln cerr << __LINE__ << endl
#else
#define dbg(x) void(0)
#define ln void(0)
#endif // LOCAL

int cx[4] = {-1, 0, 1, 0};
int cy[4] = {0, -1, 0, 1};
string Yes[2] = {"No", "Yes"};
string YES[2] = {"NO", "YES"};

ll inq(ll x, ll y)
{
    if (!y) re 1 % MOD;
    ll l = inq(x, y / 2);
    if (y % 2) re l * l % MOD * x % MOD;
    re l * l % MOD;
}

ll rev(ll x)
{
    return inq(x, MOD - 2);
}

bool __precomputed_combinatorics = 0;
vector<ll> __fact, __ufact, __rev;

void __precompute_combinatorics()
{
    __precomputed_combinatorics = 1;
    __fact.resize(FN);
    __ufact.resize(FN);
    __rev.resize(FN);
    __rev[1] = 1;
    for (int i = 2; i < FN; i++) __rev[i] = MOD - __rev[MOD % i] * (MOD / i) % MOD;
    __fact[0] = 1, __ufact[0] = 1;
    for (int i = 1; i < FN; i++) __fact[i] = __fact[i - 1] * i % MOD, __ufact[i] = __ufact[i - 1] * __rev[i] % MOD;
}

ll fact(int x)
{
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[x];
}

ll cnk(int n, int k)
{
    if (k < 0 || k > n) return 0;
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[n] * __ufact[n - k] % MOD * __ufact[k] % MOD;
}

int Root(int x, vector<int> &root)
{
    if (x == root[x]) return x;
    return root[x] = Root(root[x], root);
}

void Merge(int v, int u, vector<int> &root, vector<int> &sz)
{
    v = Root(v, root), u = Root(u, root);
    if (v == u) return;
    if (sz[v] < sz[u])
    {
        sz[u] += sz[v];
        root[v] = u;
    }
    else
    {
        sz[v] += sz[u];
        root[u] = v;
    }
}

int ok(int x, int n)
{
    return 0 <= x && x < n;
}

void bfs(int v, vi &dist, vector<vi> &graph)
{
    fill(all(dist), -1);
    dist[v] = 0;
    vi q = {v};
    for (int i = 0; i < q.size(); i++)
    {
        for (auto u : graph[q[i]])
        {
            if (dist[u] == -1)
            {
                dist[u] = dist[q[i]] + 1;
                q.push_back(u);
            }
        }
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin >> s;
    cout << accumulate(all(s), -6 * '0');
}

/* Note:
Check constants at the beginning of the code.
    N is set to 4e5 but be careful in problems with large constant factor.
    Setting N in every problem is more effective.
Check corner cases.
    N = 1
No def int long long for now.
Add something here.
*/


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;

int main()
{
    cin.tie(0);
    int n;
    int64_t h;
    cin >> n >> h;
    vector<pair<int64_t, int64_t>> vs(n);

    int64_t maxatk = 0;
    for (auto& p : vs) {
        cin >> p.second >> p.first;
        maxatk = max(maxatk, p.second);
    }

    sort(vs.rbegin(), vs.rend());

    int64_t ans = h;
    int64_t sum = 0;
    for (int tc = 0; tc <= n; tc++) {
        int64_t cur = sum >= h ? tc : (h - sum + maxatk - 1) / maxatk + tc;

        ans = min(ans, cur);
        if (tc < n)
            sum += vs[tc].first;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1792
from collections import deque

H, W = map(int, input().split())
s = ['#' * (W + 2)] + [('#' + input() + '#') for _ in range(H)] + ['#' * (W + 2)]
Q = deque()
Q.append((1, 1))
M = [[-1 for _ in range(W + 2)] for _ in range(H + 2)]
L = [[1, 0], [-1, 0], [0, -1], [0, 1]]
c = 0
for i in range(H + 1):
    for j in range(W + 1):
        if s[i][j] == '.':
            c += 1
M[1][1] = 1
while Q:
    y, x = Q.popleft()
    if y == H and x == W:
        print(c - M[H][W])
        exit()
    else:
        for i, j in L:
            if M[y + i][x + j] == -1 and s[y + i][x + j] == '.':
                Q.append((y + i, x + j))
                M[y + i][x + j] = M[y][x] + 1

print(-1)


Measured memory_bytes: 3820
import java.lang.reflect.Array;
import java.util.*;
import java.io.*;
import java.lang.*;

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

        int r = sc.nextInt();

        System.out.println ((r*r*r)+(r*r)+(r));
    }
}


Measured memory_bytes: 35720
#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){
    int n;
    string s;
    cin>>n;
    cin>>s;
    for(int i=0;i<s.size();i++){
        s[i]=52+(s[i]+n)%26;
        if((s[i]+n)%26<0){
            s[i]+=26;
        }
        if(s[i]<65){
            s[i]+=26;
        }
    }
    cout<<s;
    return 0;
}


Measured memory_bytes: 888
#include<stdio.h>
int b[1000];
int main()
{
    int i,a[100],j,k,ans=0,max=0,chk=0;
    for(i=1; i<=5; i++)
    {
        scanf("%d",&a[i]);
        if(a[i]%10==0)
        {
            ans=ans+a[i];
            a[i]=0;
        }
        if(a[i]%10!=0)
        {
            j=a[i]/10;
            k=(j+1)*10-a[i];
            ans=ans+k+a[i];
            if(k>max)
            {
                max=k;
                chk=a[i];
            }
        }
    }
    printf("%d\n",ans-max);
    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<math.h>
#include<assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr int INFI = 1000000007;
const int mod = 1000000007;
int main(){
    string s;
    cin>>s;
    vector<string>a;
    a={"dream","dreamer","erase","eraser"};
    int cnt=0;
    reverse(s.begin(),s.end());
    for(int i=0;i<4;i++){
        reverse(a[i].begin(),a[i].end());
    }
    while(1){
        bool judge=false;
        for(int i=0;i<4;i++){
        if(s.substr(cnt,a[i].size())==a[i]){
            cnt+=a[i].size();
            judge=true;
        }
        }
     if(judge==false){
         cout<<"NO"<<endl;
         break;
     }
     if(cnt==s.size()){
         cout<<"YES"<<endl;
         break;
     }
    }
}

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

const int N = 100005;

int n, k, a[N];
vector<int> g[N];

pair<int, int> dfs(int v, int par = 0) {
    pair<int, int> result = {0, 0};
    for (auto& to : g[v]) {
        auto cur = dfs(to, v);
        result.first += cur.first;
        result.second = max(result.second, cur.second + 1);
    }
    if (result.second == k - 1 && par > 0) {
        ++result.first;
        result.second = -1;
    }
    return result;
}

int main() {
    scanf("%d %d", &n, &k);
    int result = 0;
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
        --a[i];
        if (i == 0 && a[i] != 0) {
            ++result;
            a[i] = 0;
        }
        if (i != a[i])
            g[a[i]].push_back(i);
    }
    result += dfs(0).first;
    printf("%d\n", result);
    return 0;
}


Measured memory_bytes: 12288
//naveen mall
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb               push_back
#define sz(c)            (int)c.size()
#define len(c)           (int)c.length()
#define vec              vector
#define int              long long int
#define all(c)           c.begin(), c.end()
#define rall(c)          c.rbegin(), c.rend()
#define trav(a,i)        for(auto i: a)
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define invect(v,n)       for(int i=0;i<n;i++ ){int arb;cin>>arb;v.pb(arb);}
#define inset(s,n)        fl(i,0,n){int aset;cin>>aset;s.insert(aset);}
#define display(c)        trav(c,i) cout<<i<<" ";cout<<"\n";
#define F                 first
#define S                 second
#define pii               pair<int,int>
#define PB                pop_back
#define endl              "\n"
#define what(x) cerr <<  #x << " is " << x << endl;
int sum() { return 0; }template<typename T,typename... Args>T sum(T a, Args... args) { return a + sum(args...); }

 #define pi 3.14159265
 
void solve()
{  
  int r;
  cin>>r;
   float ans=2*pi*r;
   cout<<ans;
 
}
signed main()
{fast
    int t;
 t=1;
  //cin>>t;
  while(t--)
     {
      solve();
     }
 
 
 
}


Measured memory_bytes: 3804
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		
		int A_temp;
		boolean ans = false;
		for(int i=1; i<=B; i++){
			A_temp = A * i;
			if(A_temp%B==C){
				ans = true;
				break;
			}
		}
		
		if(ans==true){
			System.out.print("YES");
		}else{
			System.out.print("NO");
		}

	}

}


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

#define int long long

using namespace std;
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
static const ll maxLL = (ll)1 << 62;
const ll MOD=1000000007,INF=1e18;
int dy[]={-1,0,1,0};
int dx[]={0,1,0,-1};

int a[3];

signed main(){
    cin>>a[0]>>a[1]>>a[2];
sort(a,a+3);
int ans=0;
ans+=a[2]*10+a[1]+a[0];
cout<<ans<<endl;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

Measured memory_bytes: 256
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
  x = input()
  if (x == "AC"):
    ac = ac + 1
  elif (x == "WA"):
    wa = wa + 1
  elif (x == "TLE"):
    tle = tle + 1
  else:
    re = re + 1
print("AC", "x", ac)
print("WA", "x", wa)
print("TLE", "x", tle)
print("RE", "x", re)

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

int n;
int h[100000];
int main() {

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

    int max_cnt = 0;
    int prev = h[0];
    int cnt=0;
    for( int i = 1 ; i < n ; i++ ) {
        if(prev >= h[i]) {
            cnt++;
            if(max_cnt < cnt) max_cnt = cnt;
            prev = h[i];
        } else {
            if(max_cnt < cnt) max_cnt = cnt;
            cnt=0;
            prev = h[i];
        }
    }


    cout << max_cnt << endl;

    return 0;
}

Measured memory_bytes: 640
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	ok := true
	for i := 0; i < n; i++ {
		a := nextInt()
		if a%2 == 0 && a%3 != 0 && a%5 != 0 {
			ok = false
		}
	}
	if ok {
		puts("APPROVED")
	} else {
		puts("DENIED")
	}
	wt.Flush()
}

var (
	sc  = bufio.NewScanner(os.Stdin)
	rdr = bufio.NewReaderSize(os.Stdin, 1000000)
	wt  = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func nextFloat64s(n int) []float64 {
	slice := make([]float64, n)
	for i := 0; i < n; i++ {
		slice[i] = nextFloat64()
	}
	return slice
}

func nextMega() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, _ := rdr.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func putf(format string, a ...interface{}) {
	fmt.Fprintf(wt, format, a...)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}


Measured memory_bytes: 640
import java.util.Scanner;

class Main {
	public static void main(String[] $) {
		Scanner sc = new Scanner(System.in);
		String s=sc.next();
		int count=0;
		for(int i=0;i<s.length();i++) {
			if(s.substring(i, i+1).equals("1"))count++;
		}
		System.out.println(count);
		
	}
}

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

int main(){
    
    unsigned long long int N, W;
    cin>>N>>W;
    
    vector <unsigned long long int> dp(W + 1, 0);
    dp[0] = 0;
    unsigned long long int w[N], v[N];
    
    for(unsigned long long int i = 0; i < N; i++){
        cin>>w[i]>>v[i];
        
    }
    
    for(unsigned long long int i = 0; i < N; i++){
        
        
        for(unsigned long long int j = W; j >= 1; j--){
            if( j >= w[i] ){
            dp[j] = max(dp[j], dp[j - w[i]] + v[i]);
                
            }
        }
        
        
    }
    
   
    cout<<dp[W];
    return 0;
}

Measured memory_bytes: 3996
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define BUF_SIZE 510000+50

// size: specify sizeof(str)
int get_str(char *str, int size) {
    if(!fgets(str, size, stdin)) return -1;
    return 0;
}

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

int get_int2(int *a1, int *a2) {
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return -1;
  sscanf(line, "%d %d", a1, a2);
#else
#error
#endif
  return 0;
}

int get_int3(int *a1, int *a2, char *a3) {
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return -1;
  sscanf(line, "%d %d %c", a1, a2, a3);
#else
#error
#endif
  return 0;
}

#define OFFSET 210000

enum COMMAND {
    NONE,
    REVERSE,
    ADD,
};

enum {
    UNDEF,
    HEAD,
    TAIL
};

int main(void) {
    static char buf[BUF_SIZE];
    get_str(&buf[OFFSET], BUF_SIZE-OFFSET);
    char *s = &buf[OFFSET];
    size_t len = strlen(s) - 1;
    int pos[3];
    int inc[3] = {0, -1, +1};
    pos[1] = OFFSET-1;
    pos[2] = OFFSET+len;

    int queries = get_int();
    int i;
    int dist = 1;
    for(i = 0; i < queries; i++) {
        int type, where; char ch;
        int idx;
        get_int3(&type, &where, &ch);
        where = (where == 1) ? 1 : -1;
        switch(type) {
            case REVERSE:
                dist = -dist;
                break;
            case ADD:
                idx = (where*dist==1) ? HEAD : TAIL;
                buf[pos[idx]] = ch;
                len++;
                pos[idx] += inc[idx];
                break;
            default:
                break;
        }
#ifdef DEBUG
        printf("%s\n", &buf[pos[1]+1]);
        printf("[%d] dist:%d -> len: %lu (%d, %d)\n", type, dist, len, pos[1], pos[2]);
#endif
    }
    if(dist==1) {
        int start = pos[1]+1;
        for(i = start; i < start+len; i++) {
            putchar(buf[i]);
        }
    } else {
        int start = pos[2]-1;
        for(i = start; i > start-len; i--) {
            putchar(buf[i]);
        }
    }
    putchar('\n');
    return 0;
}

Measured memory_bytes: 768
#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=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define itr(i,x) for(auto i=(x).begin();i!=(x).end();++i)
#define All(x) (x).begin(),(x).end()
#define gridif(a,x,b) if((a)<=(x)&&(x)<(b))

using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
const int mod=1000000007;

int digitsum(int n,int b){
	if(b<2) return -1;
	if(n<b) return n;
	return digitsum(n/b,b)+n%b;
}
int mpow(int a,int x);
int m_inv(int n);
vector<int> split(int n,int a);
string xal_number(int n,int x);
int gcd(int x,int y){return y?gcd(y,x%y):x;}
int lcm(int x,int y){return x*y/gcd(x,y);}
class Factorial{
private:
	vector<int> fac;
public:
	Factorial(int N){
		fac.push_back(1);
		rep(i,N) fac.push_back(fac[i]*(i+1)%mod);
	}
	int fact(int a){return fac[a];}
	int ifac(int a){return m_inv(fac[a]);}
	int cmb(int n,int r);
};
struct UnionFind {
    vector<int> par; // 親ノード
    UnionFind(int n = 1) { init(n);}
    void init(int n = 1) {
        par.resize(n);
        rep(i,n) par[i] = -1;
    }
    int root(int x) {
        if (par[x] <0) return x;
        else return par[x] = root(par[x]);      
    }
    int size(int x){ return -par[root(x)];}
    bool issame(int x, int y) {return root(x)==root(y);}
    bool connect(int x, int y);
};

signed main(){
	string s1,s2,s3;
    cin>>s1>>s2>>s3;
    int n=-32;
    string ans;
    ans+=(char)(s1[0]+n);
    ans+=(char)(s2[0]+n);
    ans+=(char)(s3[0]+n);
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>

class Point {
public:
  double x;
  double y;

  Point(double x=0.0, double y=0.0):
    x(x),
    y(y)
  {
  }

};

void showPoint(Point point) {
  std::cout << point.x << " " << point.y << std::endl;
}

void koch(int n, int k, Point left, Point right) {

  if (k > n) {
    return;
  }

  Point s, t, u;

  Point left_to_right(right.x - left.x, right.y - left.y);

  s.x = left.x + left_to_right.x / 3.0;
  s.y = left.y + left_to_right.y / 3.0;

  u.x = left.x + left_to_right.x * 2.0 / 3.0;
  u.y = left.y + left_to_right.y * 2.0 / 3.0;

  Point s_to_u(u.x - s.x, u.y - s.y);

  t.x = s.x + cos(M_PI/3) * s_to_u.x - sin(M_PI/3) * s_to_u.y;
  t.y = s.y + sin(M_PI/3) * s_to_u.x + cos(M_PI/3) * s_to_u.y;

  koch(n, k+1, left, s);
  showPoint(s);
  koch(n, k+1, s, t);
  showPoint(t);
  koch(n, k+1, t, u);
  showPoint(u);
  koch(n, k+1, u, right);

}

int main() {

  int n;
  std::cin >> n;

  Point left(0.0, 0.0), right(100.0, 0.0);
  showPoint(left);
  koch(n, 1, left, right);
  showPoint(right);

  return 0;
}



Measured memory_bytes: 3284
#include<iostream>
#include<stdio.h>
#include<cmath>
#include<string>
#include<string.h>
using namespace std;

class dice{
	public:
		int a[7];
		int b;
		void moveN(){
			b = a[1];
			a[1] = a[2];
			a[2] = a[6];
			a[6] = a[5];
			a[5] = b;
		}
		void moveE(){
			b = a[3];
			a[3] = a[1];
			a[1] = a[4];
			a[4] = a[6];
			a[6] = b;
		}
		void moveW(){
			b = a[1];
			a[1] = a[3];
			a[3] = a[6];
			a[6] = a[4];
			a[4] = b;
		}
		void moveS(){
			b = a[2];
			a[2] = a[1];
			a[1] = a[5];
			a[5] = a[6];
			a[6] = b;
		}
};
int main(){
	dice ans;
	string com;
	for (int i = 1; i < 7; i++){
		cin >> ans.a[i];
	}
	cin >> com;
	for (int i = 0; i <= com.size(); i++){
		if (com[i] == 'N')ans.moveN();
		else if (com[i] == 'E')ans.moveE();
		else if (com[i] == 'W')ans.moveW();
		else if (com[i] == 'S')ans.moveS();
	}
	cout << ans.a[1] << endl;
	return 0;
}


Measured memory_bytes: 3224
import sys
num = list(input().split(" "))
a = int(num[0])
b = int(num[1])
if b == 1:
  print(0)
  sys.exit()

count = 1

while True:
  if count == 1:
  	plug = a
  else:
    plug = plug + (a - 1) 
  if plug >= b:
    break
  count += 1

print(count)

Measured memory_bytes: 3064
import java.util.Deque;
import java.util.LinkedList;
import java.util.List;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

class Main {

	public static void main(String[] args) {
		int n,q;
		int time = 0;

		Input stdIn = new Input();
		List<Integer> firstline = stdIn.getLineInteger();
		n = firstline.get(0);
		q = firstline.get(1);

		Deque<Process> queue = new LinkedList<>();

		for(int i = 0; i < n; i++) {
			List<String> line = stdIn.getLineString();
			String name = line.get(0);
			int t = Integer.parseInt(line.get(1));
			queue.add(Process.createProcess(name, t));
		}

		while(queue.size() > 0) {
			Process temp = queue.pop();
			if(temp.time <= q) {
				time += temp.time;
				System.out.println(temp.name + " " + time);
			} else {
				time += q;
				temp.decTime(q);
				queue.add(temp);
			}
		}
	}
}

class Process {
	String name;
	int time;
	public Process(String name, int time) {
		this.name = name;
		this.time = time;
	}
	public static Process createProcess(String name, int time) {
		Process p = new Process(name, time);
		return p;
	}
	public void decTime(int q) {
		this.time -= q;
	}
}
class Input {

	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	Input() {
		super();
	}

	public Integer getLineValue() {
		try {
			String[] s = br.readLine().trim().split(" ");
			return Integer.parseInt(s[0]);
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	public List<Integer> getLineInteger() {
		List<Integer> values = new ArrayList<>();
		try {
			String[] s = br.readLine().trim().split(" ");
			for(int i = 0; i < s.length; i++) {
				values.add(Integer.parseInt(s[i]));
			}
			return values;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
	public List<String> getLineString() {
		try {
			String[] s = br.readLine().trim().split(" ");
			List<String> values = Arrays.asList(s);
			return values;
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}
}

Measured memory_bytes: 64252
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
#include <unordered_map>
#include <fstream>
#include <ctime>
#include <complex>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef pair<int,int> pii;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(int i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 510000;
ll dy[8] = {1,-1,0,0,1,-1,1,-1};
ll dx[8] = {0,0,1,-1,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T> inline void print(T &a){
    rep(i,a.size()) cout << a[i] << " ";
    cout << "\n";
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << "\n";}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << "\n";
}
ll pcount(ll x) {return __builtin_popcountll(x);}
//const int mod = 1e9 + 7;
const int mod = 998244353;

int main(){
	int n,m,p; cin >> n >> m >> p;
	vector<vpl> G(n);
	vvl rev(n);
	rep(i,m){
		ll a,b,c; cin >> a >> b >> c; a--; b--;
		c -= p; c = -c;
		G[a].emplace_back(b,c);
		rev[b].push_back(a);
	}
	vb visit1(n,false),visitn(n,false);
	function<void(int)> dfs1 = [&](int u){
		visit1[u] = true;
		for(auto v : G[u]){
			if(visit1[v.first]) continue;
			dfs1(v.first);
		}
	};
	function<void(int)> dfs2 = [&](int u){
		visitn[u] = true;
		for(auto v : rev[u]){
			if(visitn[v]) continue;
			dfs2(v);
		}
	};
	dfs1(0);
	dfs2(n-1);
	vl d(n,linf);
	d[0] = 0;
	rep(z,n+4){
		bool upd = false;
		rep(u,n){
			if(!visit1[u]) continue;
			for(auto v : G[u]){
				if(!visitn[v.first]) continue;
				if(d[v.first] > d[u] + v.second){
					d[v.first] = d[u] + v.second;
					upd = true;
				}
			}
		}
		if(!upd) break;
		if(z == n+2){
			puts("-1");
			return 0;
		}
	}
	cout << max(-d[n-1],0LL) << "\n";
}

Measured memory_bytes: 4036
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>

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

typedef long long lint;

using namespace std;

int main(){
  int N;
  cin>>N;
  vector<pair<int ,int> > c[N];
  REP(i,N-1){
    int u,v,w;
    cin>>u>>v>>w;
    u--;v--;
    c[u].push_back(make_pair(v,w));
    c[v].push_back(make_pair(u,w));
  }
  int ans[N];
  REP(i,N)ans[i]=-1;
  queue<int> q;
  q.push(0);
  ans[0]=0;
  while(!q.empty()){
    int p=q.front();
    q.pop();
    for(auto e:c[p]){
      int pp=e.first;
      int w=e.second;
      if(ans[pp]<0){
        q.push(pp);
        if(w%2==0)ans[pp]=ans[p];
        else ans[pp]=(ans[p]+1)%2;
      }
    }
  }
  REP(i,N)cout<<ans[i]<<endl;
  return 0;
}


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

struct RU {
	using t1 = int;
	using t2 = int;
	static t2 id2() { return -1; }
	static t1 op2(const t1& l, const t2& r) { return r == id2() ? l : r; }
	static t2 op3(const t2& l, const t2& r) { return r == id2() ? l : r; }
};

template <typename M>
class lazy_segment_tree {
	using T1 = typename M::t1;
	using T2 = typename M::t2;
	const int h, n;
	const vector<T1> data;
	vector<T2> lazy;
	void push(int node) {
		if (lazy[node] == M::id2()) return;
		lazy[node << 1] = M::op3(lazy[node << 1], lazy[node]);
		lazy[(node << 1) | 1] = M::op3(lazy[(node << 1) | 1], lazy[node]);
		lazy[node] = M::id2();
	}
public:
	lazy_segment_tree(int n_, T1 v1)
		: h(ceil(log2(n_))), n(1 << h), data(n_, v1), lazy(n << 1, M::id2()) {}
	lazy_segment_tree(const vector<T1>& data_)
		: h(ceil(log2(data_.size()))), n(1 << h), data(data_), lazy(n << 1, M::id2()) {}
	void update(int l, int r, T2 val) {
		l += n, r += n;
		for (int i = h; i > 0; i--) push(l >> i), push(r >> i);
		r++;
		while (l < r) {
			if (l & 1) lazy[l] = M::op3(lazy[l], val), l++;
			if (r & 1) r--, lazy[r] = M::op3(lazy[r], val);
			l >>= 1; r >>= 1;
		}
	}
	T1 find(int p) {
		T1 res = data[p]; p += n;
		while (p) res = M::op2(res, lazy[p]), p >>= 1;
		return res;
	}
};

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	int n, q;
	cin >> n >> q;
	lazy_segment_tree<RU> lst(n, INT_MAX);
	while (q--) {
		int com;
		cin >> com;
		if (com == 0) {
			int s, t, x;
			cin >> s >> t >> x;
			lst.update(s, t, x);
		}
		else {
			int p;
			cin >> p;
			printf("%d\n", lst.find(p));
		}
	}
	return 0;
}



Measured memory_bytes: 4616
n=int(input())
buff=[]
ans=1
for i in range(n):
    buff.append(input())

a=sorted(buff)

for i in range(1,n):
    if a[i] == a[i-1]:
        a[i-1]= -1
        a[i]= -1
        if ans>0:
            ans -= 1
    else:
        ans += 1

print(ans)


Measured memory_bytes: 11488
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

int main() {
  ll H, W;
  cin >> H >> W;

  vector<string> grid;

  for (int i = 0; i < H; i++) {
    string tmp;
    cin >> tmp;
    grid.emplace_back(tmp);
  }

  string ans = "Yes";
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      bool cond;
      cond = ((i == 0) || (grid[i - 1][j] == '.'));
      cond = ((i == H - 1) || (grid[i + 1][j] == '.')) && cond;
      cond = ((j == 0) || (grid[i][j - 1] == '.')) && cond;
      cond = ((j == W - 1) || (grid[i][j + 1] == '.')) && cond;
      if (grid[i][j] == '#' && cond) ans = "No";
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
//shan61916
#include <bits/stdc++.h>
  using namespace std;
typedef   long long ll;
typedef   unsigned long long ull ;
typedef   double dll ;

#define   mp make_pair
#define   pb push_back
#define   ff first 
#define   ss second
#define   IOS ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define   endl "\n" 
#define   pll pair<ll, ll>
#define   all(x) x.begin(), x.end()
#define   vll vector<ll> 

const ll inf = (ll)(1e17 + 17);
const ll mod = (ll)(1e9 + 7);


int main(){
 IOS
#ifdef SHAN
    freopen("input.txt" , "r" , stdin);  
#endif
  ll a, b;
  cin >> a >> b;
  if(a == b) {
    while(b--) cout << a;
  }
  else if(b > a) {
    while(b--) cout << a;
  } else {
    while(a--) cout << b;
  }
} //good night.

Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    s = rl().rstrip()
    t = s.replace('BC', 'D')
    
    cnt = 0
    i = 0
    ans = 0
    while i < len(t):
        if t[i] == 'B' or t[i] == 'C':
            cnt = 0
        elif t[i] == 'A':
            cnt += 1
        else:
            ans += cnt
        i += 1
    print(ans)


if __name__ == '__main__':
    solve()


Measured memory_bytes: 3500
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>

using namespace std;

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

    vector<int> ct(26, 0);
    for(int i = 0; i < s.size(); i++){
        ct[s[i]-'A']++;
    }

    int twoCt = 0;


    for(int i = 0; i < 36; i++){
        if(ct[i] == 2){
            twoCt++;
        }
    }
    if(twoCt == 2){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}

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

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

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

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;  cin >> n;
    string s;  cin >> s;
    int x = 0;
    int ans = x;
    rep (i, n) {
      if (s[i] == 'I') {
        ++x;
      } else {
        --x;
      }
      ans = max(ans, x);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
from bisect import bisect_right
from collections import defaultdict
import numpy as np


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


N = int(input())

if N == 1:
    print(0)
    exit()

primes = factorization(N)

A = np.arange(1, 100)
cumsum_A = A.cumsum()
# print(cumsum_A)

if len(primes) == 0:
    print(1)
    exit()

ans = 0
for _, value in primes:
    idx = bisect_right(cumsum_A, value)
    ans += idx
print(ans)


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

#define I 1
#define O 0
#define MAXNM 2001

using namespace std;

int lenS,lenT,S[MAXNM],T[MAXNM];
string buf;
int dp[MAXNM][MAXNM][2];//[S][T][IO]

int main(void)
{
	cin >> lenS >> lenT;
	cin >> buf;
	for(int i = 0;i < lenS;i++)
	{
		if(buf[(lenS - 1) - i] == 'I')
			S[i] = I;
		else
			S[i] = O;
	}
	cin >> buf;
	for(int i = 0;i < lenT;i++)
	{
		if(buf[(lenT - 1) - i] == 'I')
			T[i] = I;
		else
			T[i] = O;
	}
	int maxl = 0;
	int s = 0;
	int t = 0;
	for(int m = 1;m <= lenS+lenT;m++)
	{
		for(int n = 0;n <= m;n++)
		{
			s = n;
			t = m - n;
			if(s <= lenS && t <= lenT)
			{
				if(s > 0 && S[s-1] == I)
					dp[s][t][I] = dp[s-1][t][O] + 1;
				if(t > 0 && T[t-1] == I)
					dp[s][t][I] = max(dp[s][t][I],dp[s][t-1][O] + 1);
				if(s > 0 && S[s-1] == O && dp[s-1][t][I] != 0)
					dp[s][t][O] = dp[s-1][t][I] + 1;
				if(t > 0 && T[t-1] == O && dp[s][t-1][I] != 0)
					dp[s][t][O] = max(dp[s][t][O],dp[s][t-1][I] + 1);
				maxl = max(maxl,dp[s][t][I]);
			}
		}
	}
	cout << maxl << endl;
}

Measured memory_bytes: 34416
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <queue>
#include <queue>
#include <stack> 
#include <sstream>
#include <set>

typedef  long long ll;
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = { 0, 1, 0,-1};
const int INF = 1e9;
#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
int guki (int a){
    if(a%2==0) return 0;
    else return 1;
}
int gcd(int a, int b){
    if(a%b==0){
        return b;
    }else{
        return (gcd(b,a%b));
    }
}
int lcm(int a, int b){
    int x = gcd(a,b);
    return (a*b/x);
}

using namespace std;
ll k (ll a){
    a--;
    ll ans =0;
    while(a != 0){
        ans += a;
        a--;
        
    }
    return ans;
}


int main(){
    string s;
    cin >> s;
    int mm = -1;
    ll size = s.size();
    vector<ll> v(size+1);
    REP(i,size+1){
      v[i] = mm;
    }
    ll cnt = 0;
    REP(i,size){
      if(s[i] == '<'){
        v[i] = cnt;
        v[i+1] = ++cnt;
      }else{
        cnt = 0;
      }
    }
    
    cnt = 0;
    for(int i = size; 0<=i;i--){
      if(s[i-1]=='>'){
        v[i] = cnt;
        if(v[i-1] <= v[i]){
          v[i-1] = ++cnt;
        }else{
          continue;
        }
      }else{
        cnt = 0;
      }
    }
    ll ans = 0;
    REP(i,size+1){
      ans += v[i];
    }
    
    cout << ans <<endl;

    

}





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


class Program
{
    public void Proc()
    {
        Reader.IsDebug = false;
        string inpt = Reader.ReadLine();
        string ans = inpt.Substring(0, 4) + " " + inpt.Substring(4);
        Console.WriteLine(ans);

    }


    public class Reader
    {
        public static bool IsDebug = true;
        private static String PlainInput = @"

CODEFESTIVAL


";
        private static System.IO.StringReader Sr = null;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (Sr == null)
                {
                    Sr = new System.IO.StringReader(PlainInput.Trim());
                }
                return Sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
    }
    static void Main()
    {
        Program prg = new Program();
        prg.Proc();
    }
}

Measured memory_bytes: 2648
def insertion_sort(a, n):
    print(*a)
    for i in range(1, n):
        v = a[i]
        j = i - 1
        while j >= 0 and a[j] > v:
            a[j+1], a[j] = a[j], a[j+1]
            j -= 1
        print(*a)

n = int(input())
a = list(map(int, input().split()))

insertion_sort(a, n)


Measured memory_bytes: 5984
result = (0..9).to_a.repeated_permutation(4).map { |a| a.inject(:+) }.inject(Hash.new(0)) { |a, e| a[e] += 1; a }
STDIN.read.split("\n").map(&:chomp).map(&:to_i).each { |n| puts result[n] || 0 }

Measured memory_bytes: 8896
#include <iostream>
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	do{
		for(int i=1;i<=a;i++){
			for(int j=1;j<=b;j++){
				if ((i+j)%2==0)
					cout<<"#";
				else cout<<".";
				}
			cout<<endl;
			}
			cin>>a>>b;
			cout<<endl;
		}while (a!=0 || b!=0);
}


Measured memory_bytes: 3088