akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define int ll
//#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define all(c) (c).begin(), (c).end()
#define loop(i,a,b) for(ll i=a; i<ll(b); i++)
#define rep(i,b) loop(i,0,b)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
template<class T> ostream & operator<<(ostream & os, vector<T> const &);
template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple<T...> const &){}
template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple<T...> const & t){ os << (n==0?"":" ") << get<n>(t); _ot<n+1>(os, t); }
template<class...T> ostream & operator<<(ostream & os, tuple<T...> const & t){ _ot<0>(os, t); return os; }
template<class T, class U> ostream & operator<<(ostream & os, pair<T,U> const & p){ return os << "(" << p.first << ", " << p.second << ") "; }
template<class T> ostream & operator<<(ostream & os, vector<T> const & v){ rep(i,v.size()) os << v[i] << (i+1==(int)v.size()?"":" "); return os; }
template<class T> inline bool chmax(T & x, T const & y){ return x<y ? x=y,true : false; }
template<class T> inline bool chmin(T & x, T const & y){ return x>y ? x=y,true : false; }
#ifdef DEBUG
#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<mt(__VA_ARGS__)<<" ["<<__LINE__<<"]"<<endl)
#else
#define dump(...)
#endif
// ll const mod = 1000000007;
// ll const inf = 1LL<<60;

// m^n
int m,n;

signed main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    while(cin >> m >> n && m){
        int d[20] = {};
        d[0] = 1;
        rep(i,n){
            rep(j,20){
                d[j] *= m;
            }
            rep(j,20){
                if(d[j] >= 10000){
                    d[j+1] += d[j]/10000;
                    d[j] %= 10000;
                }
            }
        }
        char u[20][4] = {
            "",
            "Man",
            "Oku",
            "Cho",
            "Kei",
            "Gai",
            "Jo",
            "Jou",
            "Ko",
            "Kan",
            "Sei",
            "Sai",
            "Gok",
            "Ggs",
            "Asg",
            "Nyt",
            "Fks",
            "Mts"
        };
        for(int i=19;i>=0;i--){
            if(d[i]){
                cout << d[i] << u[i];
            }
        }
        cout << endl;
    }
}

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

using namespace std;
typedef long long ll;

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

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

ll sum1[200000] = {}, sum2[200000] = {};
ll ar[200000];

int main() {
	int a;
	cin >> a;
	for (int i = 0; i < a; i++) {
		cin >> ar[i];
	}
	sum1[0] = ar[0];
	for (int i = 1; i < a; i++) {
		sum1[i] = gcd(sum1[i - 1], ar[i]);
	}
	sum2[a - 1] = ar[a - 1];
	for (int i = a - 2; i >= 0; i--) {
		sum2[i] = gcd(sum2[i + 1], ar[i]);
	}
	ll ans = 0;
	
	for (int i = 0; i < a; i++) {
		if (i == 0) {
			ans = max(ans, sum2[1]);
		}
		else if (i == a - 1) {
			ans = max(ans, sum1[a - 2]);
		}
		else {
			ans = max(ans, gcd(sum1[i - 1], sum2[i + 1]));
		}
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;
 
#define rep(i,k,n) for(i=k;i<n;i++)
#define repr(i,k,n) for(i=k;i>=n;i--)
#define ll long long
#define pb(i) push_back(i)
 
int main(void)
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	/*ll t;
	cin >> t;
	while(t--)
	{*/
		ll n,m,countn=0,countm=0;
		cin >> n>>m;
		if(n<2)
			countn=0;
		else
			countn=(n*(n-1))/2;
		
		if(m<2)
			countm=0;
		else
			countm=(m*(m-1))/2;
		
		cout << countn+countm;

		
	//}

}

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

int main()
{
  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(ALL(A));
  sort(ALL(B));
  sort(ALL(C));

  ll sum = 0;
  for (int i = 0; i < N; ++i) {
    ll a = lower_bound(ALL(A), B[i])-A.begin();
    ll c = N-(upper_bound(ALL(C), B[i])-C.begin());
    sum += a*c;
  }

  cout << sum << endl;
}

Measured memory_bytes: 1408
#include "bits/stdc++.h"
using namespace std;
int main() {
	long long A, B, C;
	cin >> A >> B >> C;
	long long tmp = C - A - B;
	if (tmp > 0) {
		if (tmp * tmp > 4 * A * B) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	else cout << "No" << endl;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
p = list( map(int, input().split()))
ans = 0
for i in range(k):
    ans += (1+p[i])*p[i]/2/p[i]

ans_ = ans

for left in range(1,n-k+1):
    ans_ -= (1+p[left-1])*p[left-1]/2/p[left-1]
    ans_ += (1+p[left+k-1])*p[left+k-1]/2/p[left+k-1]
    ans = max(ans, ans_)


print(ans)

Measured memory_bytes: 25060
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int A, B;
    cin >> A >> B;
    int socket = 1;
    int cnt = 0;
    
    while (socket < B) {
        socket = socket - 1 + A;
        cnt++;
    }
    
    cout << cnt << endl;
    
    //getline(cin, str);
    //vector < vector < int > > A(x, vector(y, 0));
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
void put(int,int);
int h,w;
int x,y;
int flag=0;
char tile[1111][1111];
int main(){
  while(1){
    cin >> h >> w;
    if(h==0 && w==0)break;
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
	cin >> tile[i][j];
      }
    }
    put(0,0);
    if(flag==1){
      cout << y << ' ' << x << endl;
    }
    if(flag==2){
      cout << "LOOP" << endl;
    }
  }
}

void put(int a,int b){
  
  if(tile[a][b]=='.'){
    x=a;
    y=b;
    flag=1;
    return;
  }
  if(tile[a][b]==-1){
    flag=2;
    return;
  }
  if(tile[a][b]=='>'){
    tile[a][b]=-1;
    put(a,b+1);
  }
  if(tile[a][b]=='<'){
    tile[a][b]=-1;
    put(a,b-1);
  }
  if(tile[a][b]=='^'){
    tile[a][b]=-1;
    put(a-1,b);
  }
  if(tile[a][b]=='v'){
    tile[a][b]=-1;
    put(a+1,b);
  }
  return;
}

Measured memory_bytes: 1300
x=int(input())

dp = [False for _ in range(x+1)]
dp[0] = True 
for i in range(x+1):
    if i >= 100:
        dp[i] = dp[i] or dp[i-100]
    if i >= 101:
        dp[i] = dp[i] or dp[i-101]
    if i >= 102:
        dp[i] = dp[i] or dp[i-102]
    if i >= 103:
        dp[i] = dp[i] or dp[i-103]
    if i >= 104:
        dp[i] = dp[i] or dp[i-104]
    if i >= 105:
        dp[i] = dp[i] or dp[i-105]

if dp[x]:print(1)
else:print(0)

Measured memory_bytes: 45040
#include <bits/stdc++.h>
#include <algorithm>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ll long long 
#define pb push_back
#define mk make_pair
#define mod 1e9+7
using namespace std;

ll gcd(ll a, ll b){
    return __gcd(a,b);
}

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

bool isPrime(ll n){
    for(ll i=2; i<=sqrt(n); i++){
        if(n%i == 0){
            return false;
        }
    }
    return true;
}


void solve(){
    ll n,k;
    cin >> n >> k;
    ll a[n];
    for(ll i=0; i<n; i++) cin >> a[i];
    sort(a,a+n);
    ll res = 0;
    for(ll i=0; i<k; i++) res += a[i];
    cout << res << endl;
}

int main() {
    fast;
    solve();
	//ll t; cin >> t; while(t--){ solve(); }
	return 0;
}

Measured memory_bytes: 3616
using System;

class Program
{
    static void Main()
    {

        bool[] n = new bool[1000000];

        for (int i = 0; i < 1000000; i++)
        {
            n[i] = true;
        }

        n[0] = false;
        n[1] = false;

        for (int i = 2; i < 1000; i++)
        {
            if (n[i] == true)
            {
                for (int j = i * 2; j < 1000000; j += i)
                {
                    n[j] = false;
                }
            }
        }


        while (true)
        {
            int count = 0;
            string input = Console.ReadLine();
            if (input == null) return;

            int x = int.Parse(input);

            for (int m = x; m > 1; m--)
            {

                if (n[m] == true)
                { count = count + 1; }
            }
            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 10036
s=input()

if s==s[::-1]:
  print(0)
else:
  ss=s.replace("x","",10**5)
  if ss!=ss[::-1]:
    print(-1)
  else:
    x=[0]*(len(ss)+1)
    j=0
    for i in range(len(s)):
      if s[i]=="x":
        x[j]+=1
      else:
        j+=1
    for i in range(len(x)):
      x[i],x[-1-i]=x[i]-min(x[i],x[-1-i]),x[-i-1]-min(x[i],x[-1-i])
    print(sum(x))

Measured memory_bytes: 3700
#include<bits/stdc++.h> 
using namespace std;
typedef long long int ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pii;
#define fo(i,s,e_ex) for(i=s;i<e_ex;i++)
#define Fo(i,k,n) for(i=k;k<n?i<=n:i>=n;k<n?i+=1:i-=1)
#define endl '\n'
#define MOD 1000000007//998244353
#define pbb push_back
#define mpp make_pair
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define mset(arr,val) memset(arr,val,sizeof(arr))
ll dp[25][2100000];
bool mat[25][25];
unsigned long long int popcount(unsigned long long int n){
    if(n==0) return 0;
    return 1+popcount(n&(n-1));
}
void solve(ll caseno){
	ll i,j,k,n;
    mset(mat,0);
    cin>>n;
    for(i=1;i<=n;i++){
        for(j=0;j<n;j++) cin>>mat[i][j];
    }
    const ll MX = pow(2,n)-1;
    for(i=0;i<=MX;i++) dp[0][i]=0;
    dp[0][0]=1;
    for(i=1;i<=n;i++){
        //i is the man
        for(j=0;j<=MX;j++){
            //j is the mask
            dp[i][j]=0;
            ll ppc=popcount(j);
            //cout<<j<<' '<<ppc<<endl;
            if(ppc==i){
                for(k=0;k<n;k++){
                    //k is the woman to be matched
                    if( (j&(1<<k)) && mat[i][k]) dp[i][j]+=dp[i-1][j^(1<<k)];
                    dp[i][j]%=MOD;
                }
            }
            //cout<<i<<' '<<j<<' '<<dp[i][j]<<endl;
        }
    }
    cout<<dp[n][MX];
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	ll t=1;
	//cin>>t;
	for(ll i=1;i<=t;i++){
		solve(i);
	}
	return 0;
}


Measured memory_bytes: 364560
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass


def comb(n: int, r: int):
    if r > n - r:
        return comb(n, n - r)
    p = q = 1
    for i in range(r):
        p *= n - i
        q *= i + 1
    return p // q


def solve(N: int, A: int, B: int, v: "List[int]"):
    v.sort(reverse=True)
    sl = v[:A]
    print(sum(sl) / A)
    if len(set(sl)) == 1:
        m = sl[0]
        cm = v.count(m)
        ans = 0
        for z in range(A, min(cm, B) + 1):
            ans += comb(cm, z)
        print(ans)
    else:
        m = sl[-1]
        cm = v.count(m)
        print(comb(cm, sl.count(m)))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    v = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A, B, v)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <cstdio>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <queue>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define ll long long
#define fr(i,k,N) for(ll i=k; i<N;i++)
#define rep(i,N) for(ll i=0; i<N;i++)
#define alll(v) v.begin(),v.end()
using namespace std;
template <class X> void pr(X test){cout<<test<<endl;}
template <class X> void prr(X test){for(auto it:test){cout<<it<<endl;}cout<<endl;}

int main() {
    ll h,w,n;

    cin>>n>>h;
    pr(n - h + 1);
    
    return 0;
}

class UF { // union find from https://github.com/kartikkukreja/blog-codes (MIT)
    // [usage]
    // auto uf = new UF(n);
    // uf->merge(a, b);
    // ...
public:
    int *id; // inner id
    int cnt; // number of all vartices
    int *sz; // sz[i] means size of i's set
    UF(int N)   {
        cnt = N;
        id = new int[N];
        sz = new int[N];
        for(int i=0; i<N; i++) {
            id[i] = i;
            sz[i] = 1;
        }
    }
    ~UF() {
        delete [] id;
        delete [] sz;
    }
    int find(int p) {
        int root = p;
        while (root != id[root]) root = id[root];
        while (p != root) {
            int newp = id[p];
            id[p] = root;
            p = newp;
        }
        return root;
    }
    void merge(int x, int y) {
        int i = find(x);
        int j = find(y);
        if (i == j) return;
        
        if (sz[i] < sz[j]) {
            id[i] = j;
            sz[j] += sz[i];
        } else {
            id[j] = i;
            sz[i] += sz[j];
        }
        cnt--;
    }
    bool connected(int x, int y) {
        return find(x) == find(y);
    }
    int count() {
        return cnt;
    }
};

Measured memory_bytes: 888
/*
    ALWAYS REMMEMBER:
        NEVER GIVE UP !
        DON'T MESS WITH ME !!!
        "" THE EXPERT IN ANYTHING WAS ONCE A BEGINNER ""
*/

#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define f(i,a,b) for(ll i=a; i<=b; i++)
#define fi(i,a,b) for(ll i=a; i>=b; i--)
#define fa(x,b) for(auto x:b)
#define TC ll test_case; cin>>test_case; for(ll number=1 ; number <= test_case ; number ++ )
#define vll vector<ll>
#define pb push_back
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (ll)(a).size()
#define sp(x) cout << fixed << setprecision(x);
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
#define endl "\n"

const ld pi = acos(-1);
const ll M=1e9+7,N=1e7+5,INF=1e18;

void solve()
{
    ll n,r;
    cin >> n >> r;
    if(n>=10)
        cout << r;
    else
    {
        cout << r + 100 *(10-n) ;
    }
    
}

int32_t main()
{
    FIO
    solve();
    return 0;
}

Measured memory_bytes: 256
N = input()
alist = list(map(int, input().split()))
alist.sort(reverse = True)
AliSc = 0
BobSc = 0

while alist != []:
    AliSc += alist[0]
    del alist[0]
    if alist != []:
        BobSc += alist[0]
        del alist[0]
    else:
        break

print(AliSc - BobSc)


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

int main(){
	int inputnum=3;
	int input[inputnum];
	for(int i=0;i<inputnum;i++){
		cin >> input[i];
	}
	if(input[1] > input[0]){
		if(input[2] >= input[0] & input[2] <= input[1]){
			cout << "Yes";
		}else{
			cout << "No";
		}
	}else{
		if(input[2] >= input[1] & input[2] <= input[0]){
			cout << "Yes";
		}else{
			cout << "No";
		}
	}
	return 0;
}

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

int main(int argc, const char * argv[]) {
    int a, b;
    scanf("%d%d", &a, &b);
    switch(signbit(a - b)) {
        case 0:
            if(a == b){
                printf("a == b\n");
            }else{
                printf("a > b\n");
            }
            break;
         default:
            printf("a < b\n");
    }
    return 0;
}

Measured memory_bytes: 580
//------------------------------------------------------------------------------MANAS UNIYAL---------------------------------------------------------
//																				NEVER GIVE UP
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);	cin.tie(NULL);	cout.tie(NULL);
#define ll long long
#define pb push_back
#define fi first
#define se second
#define pii pair<ll,ll>
#define INF 0x3f3f3f3f
#define mod 100000007
#define testcases() ll t; cin>>t; while(t--)
#define debug1(x) cout<<#x<<" "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<"\n";
#define rep(i,start,end) for(ll i=start;i<end;i++)
 
//----------------------------------------------------------------------------------------------------------------------------------------------------

int main()
{
	fast;
	int n,k,q,x;
	cin>>n>>k>>q;
	vector<int> v(n,0);
	for(int i=0;i<q;i++)
	{
		cin>>x;
		--x;
		v[x]++;
	}
	for(int i=0;i<n;i++)
		(k-q+v[i]>0)?cout<<"Yes\n":cout<<"No\n";
	return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;
import java.io.*;
 
class Main {
    public static void main(String[] args)throws IOException{ 
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(in);
                                                              
        String W = reader.readLine();
        String Tall = "";
         
        while(true){
        String T = reader.readLine();
        //String low_T = T.toLowerCase();
        if(T.equals("END_OF_TEXT")){
            break;
        }
        else{
        Tall = Tall+" " + T; 
        }
        }
        String low_T = Tall.toLowerCase();
        int sum = 0;
         
         
        String [] item = low_T.split(" ");
         
         
        for(int itemNum = 0; itemNum < (item.length); itemNum++){
            if(item [itemNum].equals(W)){
            sum++;
            }
            else{
            }
        }
        System.out.println(sum);
    }
}

Measured memory_bytes: 24144
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
using namespace std;

int main(){
    string s,t;
    int n;
    while(cin>>s>>n&&n!=0){
        map<string,int>mp;
        int cnt = 0;
        while((int)s.size()!=n){
            s.push_back('0');
        }
        mp[s] = 0;
        string z;
        for(int i=0;i<n;i++){
            z.push_back('0');
        }
        while(1){
            sort(s.begin(),s.end());
            int mi=0;
            int ma=0;
            for(int i=0;i<n;i++){
                mi*=10;
                mi+=s[i]-'0';
            }
            for(int i=n-1;i>=0;i--){
                ma*=10;
                ma+=s[i]-'0';
            }
            t = to_string(ma-mi);
            while((int)t.size()!=n){
                t = "0" +t;
            }
            cnt++;
            if(mp.find(t)!=mp.end()){
                cout << mp[t] << " ";
                bool flag = 1;
                if(t!=z){
                for(int i=0;i<t.size();i++){
                    if(flag){
                        if(t[i]!='0'){
                            flag = 0;
                            cout << t[i];
                        }
                    }else{
                        cout << t[i];
                    }
                }
                }else{
                    cout << "0";
                }
                cout << " " << cnt-mp[t] << endl;
                break;
            }else{
                s = t;
                mp[s] = cnt;
            }
        }
    }
    return 0;
}


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

int main() {
  int x, y;
  cin >> x >> y;
  int a, b, c;
  cin >> a >> b >> c;
  vector<int> p(a), q(b), r(c);
  rep(i,a) cin >> p[i];
  rep(i,b) cin >> q[i];
  rep(i,c) cin >> r[i];
  sort(p.rbegin(), p.rend());
  sort(q.rbegin(), q.rend());
  vector<int> d;
  rep(i,x) d.push_back(p[i]);
  rep(i,y) d.push_back(q[i]);
  rep(i,c) d.push_back(r[i]);
  sort(d.rbegin(), d.rend());
  ll ans = 0;
  rep(i,x+y) ans += d[i];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3572
#include<iostream>
#include<vector>
using namespace std;
int gcd(int a, int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
int main()
{
	int k;
	cin>>k;
	long long int sum =0;
	for(int i =1;i<=k;i++)
	{
		for(int j = 1;j<=k;j++)
		{
			for(int l = 1;l<=k;l++)
			{
				sum+=gcd(i,gcd(j,l));
			}
		}
	}
	
cout<<sum;
return 0;

}


Measured memory_bytes: 3636
#define _CRT_SECURE_NO_WARNINGS


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <iomanip>
#include <map>
#include <stack>
#include <bitset>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <random>
#include <cassert>

using namespace std;

//#define FAST_ALLOCATOR_MEMORY 1e8
#undef LOCAL
//#include "optimization.h"

int main() {
	iostream::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n;
	cin >> n;
	vector< pair<int, int> > a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i].first;
		a[i].second = i;
	}
	sort(a.begin(), a.end());
	vector<int> ans(n);
	for (int i = 0; i < n; i++) {
		if (i < n / 2)
			ans[a[i].second] = a[(n / 2)].first;
		else
			ans[a[i].second] = a[(n / 2) - 1].first;
	}
	for (int i : ans)
		cout << i << '\n';
	
	return 0;
}

Measured memory_bytes: 4608
<?php

$inputs = [];
for ($i = 0; $i < 5; ++$i) {
    $inputs[] = trim(fgets(STDIN));
}

$min1 = substr($inputs[0], -1);
$min_index = 0;
for ($i = 1; $i < 5; ++$i) {
    $last = substr($inputs[$i], -1);
    if ($last != 0 && $last < $min1) {
        $min1 = $last;
        $min_index = $i;
    }
}

$result = 0;
for ($i = 0; $i < 5; ++$i) {
    if ($i === $min_index) {
        continue;
    }
    $result += ceil($inputs[$i] / 10) * 10;

}
$result += $inputs[$min_index];

echo $result;


Measured memory_bytes: 4604
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
    cin.tie(NULL); cout.tie(NULL);
    ios_base:: sync_with_stdio(false);
    ll n,a,b;cin>>n>>a>>b;
    ll mx = min(a,b);
    ll mn = max(0ll , a+b - n );
    cout<<mx<<" "<<mn;
}

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

#define MAX_DATA 1000000

typedef struct Queue {
    int machi[MAX_DATA];
    int first;
    int last;
} queue;

void *init_queue(queue *a) {
    for (int i=0; i<MAX_DATA; i++) {
        a->machi[i] = 0;
    }
    a->first = 0;
    a->last = 0;
    return a;
}

int enq(queue *que, int input) {
    if (que->last+1 > MAX_DATA) {
        return -1;
    }
    else {
        que->machi[que->last] = input;
        que->last++;
        return 0;
    }
}

int deq(queue *que) {
    if (que->first == que->last) {
        return -1;
    }
    else {
        que->first++;
        return que->machi[que->first-1];
    }
}
 
int main() {
    int h = 0, w = 0;
    scanf("%d %d\n", &h, &w);
    char map[h][w+2];
    int check[h][w];
    queue *que = (queue *)malloc(sizeof(queue));
    init_queue(que);
    for (int i=0; i<h; i++) {
        fgets(map[i], w+2, stdin);
        for (int j=0; j<w; j++) {
            if (map[i][j] == '#') {
                check[i][j] = 0;
                enq(que, i*w+j);
            }
            else {
                check[i][j] = -1;
            }
        }
    }
    int now = 0;
    int h_now = 0, w_now = 0;
    int gene = 0;
    while ((now = deq(que)) != -1) {
        h_now = now / w;
        w_now = now % w;
        gene = check[h_now][w_now];
        if (h_now-1 >= 0) {
            if (check[h_now-1][w_now] < 0) {
                check[h_now-1][w_now] = gene + 1;
                enq(que, (h_now-1)*w+w_now);
            }
        }
        if (w_now-1 >= 0) {
            if (check[h_now][w_now-1] < 0) {
                check[h_now][w_now-1] = gene + 1;
                enq(que, h_now*w+w_now-1);
            }
        }
        if (w_now+1 < w) {
            if (check[h_now][w_now+1] < 0) {
                check[h_now][w_now+1] = gene + 1;
                enq(que, h_now*w+w_now+1);
            }
        }
        if (h_now+1 < h) {
            if (check[h_now+1][w_now] < 0) {
                check[h_now+1][w_now] = gene + 1;
                enq(que, (h_now+1)*w+w_now);
            }
        }
    }
    printf("%d\n", gene);
    free(que);
    return 0;
}


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

int main()
{
  // data input
  int N;
  cin>>N;
  vector<string> v(N);
  for(int i=0; i<N; i++){
    cin>>v.at(i);
  }
  
  sort(v.begin(),v.end()); // 辞書式に整列
  int k=0;
  vector<int> a(N);		// 出現回数記録
  vector<string> b(N);	// 出現単語記録
  
  b.at(0)=v.at(0);
  a.at(0)=1;
  for(int i=1; i<N; i++){
    if(v.at(i)==v.at(i-1)){
      a.at(k)++;
    }
    else{
      k++;				// 未記録の単語が登場したらデータ更新
      b.at(k)=v.at(i);
      a.at(k)++;
    }
  }
  
  // 登場回数の最大値
  int max=a.at(0);
  for(int i=1; i<=k; i++){
    if(a.at(i)>max) max=a.at(i);
  }
  
  // 登場回数最多の単語を出力
  for(int i=0; i<=k; i++){
    if(a.at(i)==max){
      cout<<b.at(i)<<endl;
    }
  }
}

Measured memory_bytes: 16640
# B Digital Gifts
N = int(input())
X = [list(map(str, input().split())) for _ in range(N)]
gifts = 0
for i in range(N):
    if X[i][1] == 'JPY':
        gifts += int(X[i][0])
    else:
        gifts += float(X[i][0]) * 380000
print(gifts)


Measured memory_bytes: 9176
import std.functional,
       std.algorithm,
       std.container,
       std.typetuple,
       std.typecons,
       std.bigint,
       std.string,
       std.traits,
       std.array,
       std.range,
       std.stdio,
       std.conv,
       std.format,
       std.math;

void main()
{
	auto s = readln.chomp;
	auto t = readln.chomp;
	int a;
	foreach(i; 0..s.length){
		if(s == t){
			a = 1;
			break;
		}else{
			s ~= s.front;
			s.popFront();
		}
	}
	if(a == 1) writeln("Yes");
	else writeln("No");
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T> void DEBUG(string str, T e){if(DEBUG_OUT == false)return;std::cout <<str<<" ";DEBUG(e);};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> void SORT_(vector<int>& v,bool GREATER = 0){if(GREATER == 0)sort(v.begin(),v.end());else{sort(v.begin(),v.end(),std::greater<T>());}}

//CODE
void solve(void)
{
  string str;
  cin>>str;
  bool check = false;
  for (int i = 0; i < str.size(); i++)//num of erase
  {
    for (int k = 0; k <= str.size()-i; k++)//initial position to erace
    {
       string comstr;
       for (int j = 0; j < str.size(); j++)
       {
         if((k <= j)&&(j<i+k))
         {
           //NOP
         }
         else
         {
           comstr += str[j];
         }
         
       }
       if(comstr == "keyence")check = 1;
      //  DEBUG(comstr);
    }
  }
  if(check == true)
  {
    cout<<"YES"<<endl;
  }
  else
  {
    cout<<"NO"<<endl;
  }
  
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <algorithm>
#include <set>
#include <map>
#include <queue>

#define endl "\n"

using namespace std;

template<typename T>
void printArray(T a) {
    for(auto i : a)
        cout << i << " ";

    cout << endl;
}

template<typename T>
void print2DArray(T a) {
    for(auto i : a) {
        for(auto j : i)
            cout << j << " ";

        cout << endl;
    }
    cout << endl;
}

int main(int argc, char *argv[])
{
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);

    string s = "";
    string t = "";

    cin >> s >> t;

    int acc = 0;
    for (int i = 0; i < 3; i++) {
        if (s[i] == t[i]) {
            acc++;
        }
    }

    cout << acc << endl;

    return 0;
}


Measured memory_bytes: 256
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
N,K = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
ans = 0
for i in range(K):
    ans += p[i]
print(ans)

Measured memory_bytes: 10668
def solve1():
    for i in range(N-1):
        ans.append((i+1,i+2))
        A[i+1]+=A[i]
def solve2():
    for i in reversed(range(1,N)):
        ans.append((i+1,i))
        A[i-1]+=A[i]

N=int(input())
A=list(map(int,input().split()))
l=min(A);r=max(A)
wl=A.index(l);wr=A.index(r)

ans=[]
if l>=0:
    solve1()
elif r<0:
    solve2()
else:
    if abs(l)>abs(r):
        for i in range(N):
            if A[i]>0:
                ans.append((wl+1,i+1))
                A[i]+=l
        solve2()
    else:
        for i in range(N):
            if A[i]<0:
                ans.append((wr+1,i+1))
                A[i]+=r
        solve1()
print(len(ans))
for x,y in ans:
    print(x,y)

Measured memory_bytes: 62484
// author - shreyanshjn (Shreyansh Jain)
#include <bits/stdc++.h>
using namespace std; 
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair <int,int> PII;
typedef pair <ll, ll> PLL;
typedef pair <int,string> PIS;
typedef vector <int> vec;
typedef priority_queue<int> PQ;
/* #define input 1 */
#define INF 100000000000000000
#define endl '\n'
#define debug(x) cout<<#x<<": "<<x<<endl
#define pi 3.141592653589793
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(ar) ar.begin(), ar.end()
#define sz(x) (int)(x).size()
#define len(x) (int)x.length()
#define rep(a,b,c) for(int a=b; a<c; a++)
#define fori(z,n)  for(int i=z;i<n;i++)
#define fork(z,n)  for(int k=z;k<n;k++)
#define forii(z,n) for(int i=z;i<=n;i++)
#define forkk(z,n) for(int k=z;k<=n;k++)
const int mod = 1e9 + 7;
int powm(int a, int b) {
    int res=1;
    while(b) {
        if(b&1)
            res=(res*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}
string trim(const string& str) {
    size_t first = str.find_first_not_of(' ');
    if (string::npos == first)
    {
        return str;
    }
    int last = str.find_last_not_of(' ');
    return str.substr(first, (last - first + 1));
}
int main() { 
    #ifdef input
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cout.precision(15);
    int n; cin >> n;
    double arr[n + 1];
    fori(1, n + 1) {
        cin >> arr[i];
    }
    double dp[n + 1][n + 1];
    dp[0][0] = 1;
    for(int i = 1; i < n + 1; i++) {
        dp[0][i] = 0;
    }
    for(int i = 1; i < n + 1; i++) {
        dp[i][0] = dp[i - 1][0] * (1 - arr[i]);
    }
    double ans = 0.0;
    fori(1, n + 1) {
        fork(1, n + 1) {
            dp[i][k] = arr[i] * (dp[i - 1][k - 1]) + ((1 - arr[i]) * dp[i - 1][k]);
            if(i == n and k >= (n + 1) / 2) {
                ans += dp[i][k];
            }
        }
    }
    cout << ans << endl;
    cerr<<"Time elapsed"<<1.0*clock()/CLOCKS_PER_SEC<<"s\n";
    return 0;
}

Measured memory_bytes: 74104
n = int(input())

l = len(str(n))

ans=0

if l==1:
    ans=n
elif l==2:
    ans=9
elif l==3:
    ans=n-90
elif l==4:
    ans=909
elif l==5:
    ans=n-9090
elif l==6:
    ans=90909
    

print(ans)

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

using namespace std;

#define REP(i, a, b) for ( LL i = (a), _end_ = (b); i <= _end_; ++ i )
#define mem(a) memset ( (a), 0, sizeof ( a ) )
#define str(a) strlen ( a )
typedef unsigned long long LL;

const LL Mod = 1e9 + 7;

LL L, R, ans;

inline LL Get(LL x)
{
  	if ( x <= 0 ) return 0;
    if ( x == 1 ) return 1;
    if ( x == 2 ) return 3;
    if ( x % 2 == 0 ) return (Get(x / 2LL) * 3LL) % Mod;
    LL sum = (Get(x / 2LL) * 3LL) % Mod, y = -1;
    REP(i, 0, 63) if ( (x >> i) & 1LL ) ++ y; 
    if ( y == -1 ) return sum;
    return (sum + ((1LL << y) % Mod)) % Mod;
}

int main()
{
    cin >> L >> R;
    LL x = 1, sum = 1;
    while ( x * 2 < L ) 
    {
        x *= 2; sum = (sum * 3LL) % Mod;       
    }
    if ( x <= L && R < x * 2 )
    {
        REP(i, L, R) REP(j, i, R) if ( j % i == (j ^ i) ) ++ ans;
        // ans = Get(x * 2 - R + 1) - Get(x * 2 - L);
        // ans = ((ans % Mod) + Mod) % Mod;
        cout << ans % Mod << endl; return 0;
    }
    x *= 2;
    ans += Get(x - L);
    while ( x * 2 - 1 <= R ) 
    {
        x *= 2; 
        sum = (sum * 3LL) % Mod;
        ans = (ans + sum) % Mod;
    }
    ans = (ans + Get(R - x + 1)) % Mod;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	long N,h[100000];
	cin>>N;
	for(int i=0;i<N;i++)cin>>h[i];
	for(int i=N-1;i>0;i--){
		if(h[i-1]-1>h[i]){cout<<"No";return 0;}
		else if(h[i-1]-1==h[i])h[i-1]--;
	}
	cout<<"Yes";
	return 0;
}

Measured memory_bytes: 1024
import math
import itertools
a,b,n = map(int,input().split())
pnt = 0
maxi = 0
if n>b:
    x = b-1
elif n ==b:
    x = n-1
else:
    x = n

#for x in range(1,n+1):
pnt = math.floor(a*x/b) - a*math.floor(x/b)
print(pnt)
#    if pnt > maxi:
#        maxi = pnt
#print(maxi)



Measured memory_bytes: 9180
#include<stdio.h>
int main(void){
   int h,m,s,x;
   scanf("%d",&x);
   h = x / 3600;
   m = (x - (h * 3600)) / 60;
   s = (x - (h * 3600) - (m * 60));
   
   printf("%d:%d:%d\n",h,m,s);
   return 0;
}


Measured memory_bytes: 2104
/*
    AUTHOR : TANMAY SINHA
    INORMATION TECHNOLOGY
    BIT MESRA ,RANCHI
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ld long double
#define ull unsigned long long int
#define ll long long int
#define pb(x) push_back(x)
#define eb(x) emplace_back(x)
#define mp make_pair
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define rep(j,L,R) for(j=L;j<R;j++)
#define per(i,L,R) for(i=L;i>= R;i--)
#define all(con) (con).begin(),(con).end()
#define fi first
#define se second
#define foreach(iter,con) for(auto iter=(con).begin(); iter!=(con).end(); iter++)
#define DEBUG
#ifdef DEBUG
#define deb2(args...) {dbg,args; cerr<<endl;}
#else
#define deb2(args...)
#endif
struct debb{template<typename T> debb& operator,(const T &v){cerr<<v<<" ";return *this;}}dbg;
#define deb1(args...) do {cerr << #args << " : "; dbg,args; cerr << "\n";} while(0)
#define printa(a,L,R) rep(i,L,R) cout << a[i] <<' ';cout<<"\n";
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pl;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
template<typename T>T gcd(T a,T b){if(b==0)return a;else return gcd(b,a%b);}
template<typename T>T lcm(T a,T b){return a/gcd(a,b)*b;}
ll power(ll x,ll y,ll p){ll res=1;x=x%p;while(y>0){if(y&1)res=((res%p)*(x%p))%p;y=y>>1;x=(x*x)%p;}return res;}
ll power1(ll x,ll y){ll res=1;while(y>0){if(y&1)res=(res*x);y=y>>1;x=x*x;}return res;}

int main()
{
   SPEED
   ll n,wt;
   cin>>n>>wt;
   ll i,j,w[n],v[n],dp[n+1][wt+1];
   rep(i,0,n)
   cin>>w[i]>>v[i];

   for(i=0;i<=n;i++)
   {
       for(j=0;j<=wt;j++)
       {
           if(i==0||j==0)
            dp[i][j]=0;
           else if(w[i-1]<=j)
            dp[i][j]= max(v[i-1]+dp[i-1][j-w[i-1]],dp[i-1][j]);
           else
            dp[i][j]=dp[i-1][j];
       }
   }
   cout<<dp[n][wt];
}







Measured memory_bytes: 79232
//#i#include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <limits.h>
#include <string>
#include <stack>
#include <deque>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <time.h>
#include <stdio.h>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define mapa make_pair
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<typename T>
inline bool chmax(T &a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
template<typename T>
inline bool chmin(T &a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}

template<typename T>
std::vector<T> vec(int len, T elem) { return std::vector<T>(len, elem); }
template<typename T>
void vdeb(std::vector<T> &da) {
	for (int i = 0;i < da.size();i++) {
		if (i == da.size() - 1) std::cout << da[i];
		else std::cout << da[i] << ' ';
	}
	std::cout << std::endl;
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
	for (int i = 0;i < da.size();i++) vdeb(da[i]);
	std::cout << std::endl;
}

using namespace std;

bool ch(vector<int> di, int x){
	int su = 0;
	bitset<8000> bs;
	bs[0] = 1;
	int m = di.size();
	rip(i,m,0){
		su += di[i];
		bs = (bs << di[i])|bs;
	}
	if(su < x) return false;
	if((su+x)%2) return false;
	else return bs[(su-x)/2];
}

int main(){
	string s;
	int x,y;
	cin >> s >> x >> y;
	s += 'T';
	vector<vector<int>> di(2,vector<int>(0));
	int wi = 1, n = s.size();
	bool ju = true;
	int co = 0;
	rip(i,n,0){
		if(ju){
			if(s[i] == 'F'){
				x--;
			}
			else ju = false;
			continue;
		}
		if(s[i] == 'F'){
			co++;
		}
		else{
			di[wi].push_back(co);
			co= 0;
			wi=1-wi;
		}
	}
	printf((ch(di[0], x) && ch(di[1], y))?"Yes\n":"No\n");
}

Measured memory_bytes: 384
#include <iostream>

using namespace std;

int main(){
  double x[10],y[10];
  while(cin >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3] >> x[4] >> y[4]){
    if((x[4]-x[3])*(x[2]-x[1])+(y[4]-y[3])*(y[2]-y[1]) == 0){
      cout << "YES"<< endl;
    }
    else{
      cout << "NO" << endl;
    }
    
  }
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <climits>

using namespace std;

/*******  All Required define Pre-Processors and typedef Constants *******/
#define scn(t) scanf("%d", &t)
#define scnld(t) scanf("%ld", &t)
#define scnlld(t) scanf("%lld", &t)
#define scnc(t) scanf("%c", &t)
#define scns(t) scanf("%s", t)
#define scnf(t) scanf("%f", &t)
#define scnlf(t) scanf("%lf", &t)
#define mem(a, b) memset(a, (b), sizeof(a))
#define nloop(i, j, k, in) for (int i = j; i < k; i += in)
#define rloop(i, j, k, in) for (int i = j; i >= k; i -= in)
#define rep(i, j) nloop(i, 0, j, 1)
#define rrep(i, j) rloop(i, j, 0, 1)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define foreach(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define IN(A, B, C) assert(B <= A && A <= C)
#define MP make_pair
#define PB push_back
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define fast  \
    ios_base::sync_with_stdio(false);\
    cin.tie(NULL);
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define read(type) readInt<type>()
#define test  \
    int t;    \
    cin >> t; \
    while (t--)
const double pi = acos(-1.0);
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<PII> VII;
typedef vector<VI> VVI;
typedef map<int, int> MPII;
typedef set<int> SETI;
typedef multiset<int> MSETI;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int uint64;

int main()
{
    fast
    int r;
    cin>>r;
    cout<<2*PI*r;
    return 0;
}

Measured memory_bytes: 3796
#include <bits/stdc++.h>
using namespace std;
typedef long long int  ll;
const int mod=1e9+7;
ll  inv(ll a, ll b) {return 1 < a ? b - inv(b % a, a) * b / a : 1;}

int main()
{
    int n,a[10005];
    ll lcm=1,ans=0;
    map<int,int>cnt,freq;
    cin>>n;
    for(int i=0;i<n;i++){ 
        cin>>a[i];
        int x=a[i];
        cnt.clear();
        for(int j=2;j*j<=x;j++){ 
            while(x%j==0){ 
                cnt[j]++;
                x=x/j;
            } 
        }
        if(x!=1)cnt[x]++; 
        for(auto j:cnt){ 
         freq[j.first]=max(freq[j.first],j.second);
        } 
    } 
    for(auto i:freq){ 
        for(int j=1;j<=i.second;j++) lcm=(lcm*i.first)%mod;
    } 
    
    //cout<<lcm<<'\n';
    for(int i=0;i<n;i++){ 
        ans+=lcm*inv(a[i],mod)%mod;
        ans%=mod;
    } 
    cout<<ans<<'\n';
        

    return 0;
}


Measured memory_bytes: 768
#include <iostream>

using namespace std;

int main()
{
    int a,b;
    cin >> a >> b;
    if(a <= 5)
    {
        cout << "0\n";
    }
    else if(a <= 12)
    {
        cout << b/2 << '\n';
    }
    else
    {
        cout << b << '\n';
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")

using namespace std;

typedef long long ll;

//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>pb_ds;

#define IN freopen("in.txt","r",stdin)
#define OUT freopen("out.txt","w",stdout)
#define pi pair<int,int>
#define F first
#define S second
#define pb push_back
#define pp pop_back
#define mod 1000000007
#define pai acos(-1)
#define N 100005

int ar[N][3],dp[N][3];

int main ()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   int n;cin>>n;
   for(int i=1;i<=n;i++) cin>>ar[i][0]>>ar[i][1]>>ar[i][2];
   for(int i=n;i>=1;i--){
      dp[i][0]=max(dp[i+1][1],dp[i+1][2])+ar[i][0];
      dp[i][1]=max(dp[i+1][0],dp[i+1][2])+ar[i][1];
      dp[i][2]=max(dp[i+1][0],dp[i+1][1])+ar[i][2];
   }
   cout<<max(dp[1][0],max(dp[1][1],dp[1][2]))<<"\n";
   return 0;
}



Measured memory_bytes: 5968
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;

int N;
vector<ll> t;
map<ll, int> mp;

ll Gcd(ll b, ll d){
  	if (d == 0) return b;
 	else return Gcd(d, b % d);
}

ll Lcm(ll m, ll n){
    if ((0 == m) || (0 == n)) return 0;
    return ((m / Gcd(m, n)) * n);
}

int main(void){
	
	scanf("%d", &N);
	for(int i = 0; i < N; ++i){
	    ll a; scanf("%lld", &a);
	    auto itr = mp.find(a);
	    if(itr == mp.end()) t.push_back(a);
	    ++mp[a];
	}
	
	ll ans = 1;
	for(int i = 0; i < t.size(); ++i) ans = Lcm(ans, t[i]);
	printf("%lld\n", ans);
	
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
// #include "prettyprint.hpp"

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

  int count = 0;
  for (int i = 1; i < n - 1; i++) {
    if (p[i] < p[i + 1] && p[i] > p[i - 1]) {
      count += 1;
    } else if (p[i] > p[i + 1] && p[i] < p[i - 1]) {
      count += 1;
    }
  }

  cout << count << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI = 3.141592653589793238462643383279;
ll getDigit(ll x) {
  return x == 0 ? 1 : log10(x) + 1;
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

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

template <typename T>
void debugV(const vector<T> v) {
#ifdef _DEBUG
  rep(i, v.size()) {
    cout << i << ":" << v[i] << " ";
  }
  cout << endl;
#else
  (void)v;
#endif
}

signed main() {
  string S;
  cin >> S;

  ll count0 = 0;
  rep(i, S.size()) {
    if (S[i] == '0') {
      count0++;
    }
  }

  ll count1 = (ll)S.size() - count0;

  COUT(2 * min(count1, count0));
  return 0;
}

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

long double a, b;

int main() {
  cin >> a >> b;
  cout << (ll)floor(a*b) << endl;
  return 0;
}


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

#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pb push_back
#define pf push_front
#define pof pop_front
#define pob pop_back
#define ull unsigned long long
#define ll long long
#define sz(a) a.size()
#define all(s) s.begin(), s.end()
#define rall(s, n) s, s + n
#define x first
#define y second
#define mp make_pair
#define ub upper_bound
#define lb lower_bound
#define pii pair <int, int>
#define pll pair <ll, ll>
#define INF 1000000000
#define mod 1000000007
#define reset(a, nilai) memset(a, nilai, sizeof(a))
using namespace std;

int n, m;
int main () {
	IOS;

	cin >> n >> m;
	int arr[n], sum = 0, s = m;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
		sum += arr[i];
	}
	for (int i = 0; i < n; i++) {
		if (m == 0) {
			break;
		}
		if (arr[i] * 4 * s >= sum) m--;
	}
	cout << (m == 0 ? "Yes" : "No") << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {

    int n; 
    cin >> n;

    vector<int> d(n);

    for(int i = 0; i < n; ++i){
        cin >> d.at(i);
    }
sort(d.begin(), d.end());
reverse(d.begin(), d.end());
int ans = 1;
    for(int i = 1; i < n; ++i){
        if(d.at(i) < d.at(i-1)){
            ++ans;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256