akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define vll vector<ll>
#define vvll vector<vll>
#define mll map<ll,ll>
#define f(i,m,n) for(i=m;i<n;i++)
#define ee endl
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define take(v,n) for(i=0;i<n;i++) cin>>v[i];
#define NO() cout<<"IMPOSSIBLE"<<endl
#define YES() cout<<"Yes"<<endl
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sot(v) sort(v.begin(),v.end());
ll mod =1000000007;  
bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
  
    // This is checked so that we can skip  
    // middle five numbers in below loop 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}

ll powe(ll x, ll y){
    ll res = 1;
    while (y > 0){
        if (y & 1) res = (res*x%mod);
        y = y>>1;
        x = (x*x)%mod;
    }
    return res;
}
vvll adj(200001);
mll m;
map<pair<ll,ll> ,ll> cnt;
ll ans=0;
void DFS(ll n)
{
    ans++;
    m[n]++;
    ll i,j,k;
    j=adj[n].size();
    for(i=0;i<j;i++)
    {
        k=adj[n][i];
        if(!m[k]) DFS(k);
    }
}

void solve()
{
    ll i,j,n,k,w,q;
    cin>>n>>k;
    while(k--)
    {
        cin>>i>>j;
        if(!cnt[{i,j}])
        {
            cnt[{i,j}]++;
            adj[i].pb(j);
            adj[j].pb(i);
        }
    }
    ll sum=-1;
    for(i=1;i<=n;i++)
    {
        if(!m[i])
        {
            ans=0;
            DFS(i);
            sum=max(sum,ans);
        }
    }
    cout<<sum<<ee;
    
}
int main() {
    fast;
    ll i,j,l,k,t,n;
    t=1;
    for(i=1;i<=t;i++)
    {
        // cout<<"Case #"<<i<<": ";
        solve();
    }
}

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

using namespace std;

int nums[105];

void trace(int n) {
    for (int i = 0; i < n - 1; ++i) {
        printf("%d ", nums[i]);
    }
    printf("%d\n", nums[n - 1]);
}

int cnt;

void bubble_sort(int n) {
    bool flag = false;
    int begin = 0;
    for (int j = 0; j < n - 1; ++j) {
        for (int i = n - 1; i > begin; --i) {
            if (nums[i] < nums[i - 1]) {
                int tmp = nums[i];
                nums[i] = nums[i - 1];
                nums[i - 1] = tmp;
                ++cnt;
            }
        }
        ++begin;
    }
}

int main() {
#ifdef TEST
    freopen("input", "r", stdin);
#endif
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> nums[i];
    }
    if(1 == n) {
        printf("%d\n", nums[0]);
        cout << "0" << endl;
    } else {
        bubble_sort(n);
        trace(n);
        cout << cnt << endl;
    }

    return 0;
}



Measured memory_bytes: 3228
#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <random>
#include <string>
#include <bitset>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <cstring>
#include <cstdlib>
#include <cctype>

#define REP(i, n) for(int i = 0; i < n; ++i)
#define REPR(i, n) for(int i = n; i >= 0; --i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define FORR(i, m, n) for(int i = m; i >= n; --i)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define INF 999999999

using namespace std;

typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

llong pow(int x, int n) {
    llong ans = x;
    if (n == 0) return 1;

    for(int i = 0; i < n - 1; i++) {
        ans *= x;
    }

    return ans;
}

void swap(int *X, int *Y){
    int t = *X; *X = *Y; *Y = t;
}

const static int MAX = 8 + 1;

string judge(int A, int B) {
    if (A == B) return "Draw";
    else if ((A != 1 && B != 1) && A > B) return "Alice";
    else if ((A != 1 && B != 1) && B > A) return "Bob";
    else return (A == 1) ? "Alice" : "Bob";
}

int main() {
    int a, b;
    cin >> a >> b;

    cout << judge(a, b) << endl;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int i, j;
  int n, m, sum, a[10000];
  sum = 0;
  
  scanf("%d%d", &n, &m);
  for(i = 0; i < m; i++){
    scanf("%d", &a[i]);
    sum += a[i];
  }
  if(sum <= n){
    printf("%d\n", n - sum);
  }else{
    printf("-1\n");
  }
  
  return 0;
}

Measured memory_bytes: 1716
#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 <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 <bits/stdc++.h>

#define ll long long int
#define pb push_back
#define llu unsigned long long int
#define fo(i,n) for(int i=0;i<n;i++)
#define eb emplace_back
#define M 1000000007
#define vi vector<int>
#define vlli vector<lli>
#define pi pair<int,int>
#define mp make_pair
#define mapi map<int,int>

using namespace std;
int min(int x,int y)
{
	if(x<y)
		return x;
	return y;
}
int max(int x,int y)
{
	if(x>y)
		return x;
	return y;
}
string toLower(string s)
{
	int len = s.length();
	for(int i=0;i<len;i++)
	{
		if(s[i]<91)
		{
			s[i] += 32;
		}
	}
	return s;
}
int main()
{
	//ios::sync_with_stdio(false);
    //cin.tie(0);
    //cout.tie(0);
	//cin.ignore(numeric_limits<streamsize>::max(),'\n');
	//const unsigned int M=1000000007;
	char c;
	cin >> c;
	if(c < 96)
		cout << "A";
	else
		cout << "a";
    return 0;
}

Measured memory_bytes: 3048
# -*- coding: utf-8 -*-
import sys

n = int(input())
s = [int(c) for c in input().split(' ')]

if len(s) % 2 == 1:
    print(0)
    exit()

s_sorted = sorted(s)

#print(s_sorted[n//2-1], s_sorted[n//2],\
#    s_sorted[n//2] - s_sorted[n//2-1])
print(s_sorted[n//2] - s_sorted[n//2-1])

Measured memory_bytes: 14120
#include <bits/stdc++.h>
#define mod 1000000007
#define ll unsigned long long
using namespace std;
ll po(ll a,ll n){
    ll res=1;
    a%=mod;
    while(n){
        if(n&1)res=(res*a)%mod;
        n>>=1;
        a=(a*a)%mod;
    }
    return res;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long n;
    cin>>n;
    unsigned long long a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    unsigned long long su=0,su1=0;
    for(int i=0;i<n;i++){
        if(a[i]==0){
            continue;
        }
        su+=a[i];
        su%=mod;
        a[i]*=a[i];
        a[i]%=mod;
        su1+=a[i];
        su1%=mod;
    }
    su=((su%mod)*(su%mod))%mod;
    su=((su-su1+mod)*((po(2,mod-2))%mod))%mod;
    cout<<su;
    
}

Measured memory_bytes: 5212
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL)
typedef long long ll;
typedef long double ld;
#define trace(x)  cerr << #x << ": " << x << endl;
const ll N=1e5+5;
int main()
{
	fast;ll n;cin>>n;ll a[n];ll x=0;
	for(ll i=0;i<n;i++)
	{
		cin>>a[i];x^=a[i];
	}
	for(ll i=0;i<n;i++)
	{
		cout<<(x^a[i])<<" ";
	}
}

Measured memory_bytes: 5168
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;

    // 整数スキャン（複数）
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&z);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s;
    cin >> s;
    */

    // n個の文字列スキャン
    /*
    vector<string> slist;
    rep(i,n){
        string s;
        cin >> s;
        slist.push_back(s);
    }
    */

int main() {
    ll n,k;
    scanf("%lld%lld",&n,&k);


    ll ans = 0;
    if(k==0){
        ans=n*n;
        cout << ans << endl;
        return 0;
    }

    srep(i,1,n+1){
        if(i-1<k){
            continue;
        }else{
            ans += (n/i)*(i-k);
            if(n%i>=k){
                ans+=(n%i)-(k-1);
            }
        }
    }
    
    cout << ans << endl;
    return 0;
}
 
 


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

int main()
{
    string s,a,e;
    int c,d,j;
    cin>>s>>a>>e;
    c = s.size();
    d = a.size();
    j = e.size();
    if(s[c-1]==a[0]&&a[d-1]==e[0])
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;

}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>    
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <cstring>
#include <cmath>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long LL;
typedef long double LD;
typedef unsigned int uii;
typedef pair<int,int> pii;
typedef unsigned long long uLL; 
typedef vector<int> vii; 
//__int128
const int maxn = 3e5;
char s[maxn];
char c[maxn];
int a[maxn];

int main(int argc, char const *argv[])
{
	int n, Q;
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> Q >> s;
	int L = 0, R = n - 1;
	for(int i = 0; i < Q; ++i){
		char ch;
		cin >> c[i] >> ch;
		if(ch == 'L') a[i] = -1;
		else a[i] = 1;
	}
	int r1 = -1;
	while(L <= R){
		int m = (L + R) / 2;
		char cur = s[m];
		int pos = m;
		int ok = 0;
		for(int i = 0; i < Q; ++i){
			if(c[i] == cur){
				pos += a[i];
				if(pos < 0){
					ok = 1;
					break;
				} else if(pos >= n){
					break;
				}
				cur = s[pos];
			}
		}
		if(ok){
			L = m + 1;
			r1 = m;
		} else {
			R = m - 1;
		}
	}
	// cout << r1 << endl;
	L = 0, R = n - 1;
	int r2 = n;
	while(L <= R){
		int m = (L + R) / 2;
		char cur = s[m];
		int pos = m;
		int ok = 0;
		for(int i = 0; i < Q; ++i){
			if(c[i] == cur){
				pos += a[i];
				if(pos >= n){
					ok = 1;
					break;
				} else if(pos < 0){
					break;
				}
				cur = s[pos];
			}
		}
		if(ok){
			R = m - 1;
			r2 = m;
		} else {
			L = m + 1;
		}
	}
	// cout << r2 << endl;
	int res = r1 + 1 + n - r2;
	cout << n - res << endl;
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex<ll> point;
#define F first
#define S second



int main()
{
	#ifdef DGC
		//freopen("a.txt", "r", stdin);
		//freopen("b.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(0), cin.tie(0);

	ll a, b;
	cin >> a >> b;

	if (a == b)
		cout << "0\n";
	else
	{
		ll k = (a+b) / 2;
		if (abs(a-k) == abs(b-k))
			cout << k << "\n";
		else
			cout << "IMPOSSIBLE\n";
	}

	return 0;
}


Measured memory_bytes: 256
x, y = gets.split.map(&:to_i)
kame = ( y - x * 2 )/2
turu = ( x * 4 - y) / 2

if y%2 == 0 and kame + turu == x and kame > -1 and turu > -1
  puts 'Yes'
else
  puts 'No'
end




Measured memory_bytes: 14336
#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 K;
  cin >> K;

    // quereを用いて、
    // *{1, 2, 3, 4, 5, 6, 7, 8, 9}
    // 1 <- {2, 3, 4, 5, 6, 7, 8, 9}
    // {2, 3, 4, 5, 6, 7, 8, 9} <- 10, 11, 12
    // *{2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
    // という要領で付け加えていく
  queue<ll> q;
  
  for (int i = 1; i <= 9; i++) q.push(i);
  if (K <= 9) {
    cout << K << endl;
    return 0;
  }
 
  int count = q.size();
  
  while (true) {
    ll now = q.front();
    q.pop();
    for (int i = -1; i <= 1; i++) {
      int d = now % 10 + i;
      if (d < 0 || 9 < d) continue;
      ll next = now * 10 + d;
      q.push(next);
      count++;
      if (count == K) {
        cout << next << endl;
        return 0;
      }
    }
  }
}

Measured memory_bytes: 768
#include<cstdio>
#include<cstring>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#define reg register
#define ll long long
using namespace std;
const int N=1e5+5;
int n,a[N];
inline int read()
{
	int x=0,w=1;
	char c=getchar();
	while (!isdigit(c)&&c!='-') c=getchar();
	if (c=='-') c=getchar(),w=-1;
	while (isdigit(c))
	{
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return x*w;
}
int main()
{
	n=read();
	for (reg int i=1;i<=n;a[i++]=read());
	ll sum=abs(a[n]);
	for (reg int i=1;i<=n;i++)
	  sum+=abs(a[i]-a[i-1]);
	for (reg int i=1;i<=n;i++)
	{
		ll res=sum-abs(a[i]-a[i-1])-abs(a[i+1]-a[i])+abs(a[i+1]-a[i-1]);
		printf("%lld\n",res);
	}
	return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
typedef pair<ll,ll> Pair;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define ALL(x) (x).begin(), (x).end()
#define inputv(v,n) rep(i,n){\
    ll x;\
    cin>>x;\
    v.push_back(x);\
    }

const ll INF=99999999999999;
const ll MOD=1000000007;
 
int main() {
  ll n,k;
  cin >> n >> k;
  vl a;
  inputv(a,n);
  vector<vl> dp(100,vl(2,-1));
  dp[0][0] = 0;
  rep(d,50){
    ll x = 1LL << (49-d); //d桁目だけ1
    
    ll num = 0;
    rep(i,n) if(a[i] & x) num++; //A[i]のうちd桁目が1であるようなものの個数
    
    ll score0 = x*num; //d桁目を0にしたときのスコア
    ll score1 = x*(n-num); //d桁目を1にしたときのスコア
    
    if(dp[d][1] != -1){
      dp[d+1][1] = max(dp[d+1][1], dp[d][1] + max(score0,score1));
    }
    
    if(dp[d][0] != -1){
      if(k & x){
        dp[d+1][1] = max(dp[d+1][1],dp[d][0]+score0);
      }
    }
    
    if(dp[d][0] != -1){
      if(k & x) dp[d+1][0] = max(dp[d+1][0], dp[d][0]+score1);
      else dp[d+1][0] = max(dp[d+1][0], dp[d][0] + score0);
    }
  }
  cout << max(dp[50][0],dp[50][1]);
  
 return 0;
}

Measured memory_bytes: 1400
#include<stdio.h>

static const int N=100;

int min(int a,int b){
if(a>b){
  return b;
 }
 else return a;
}

int main(){
  int i,j,k,l,n,p[N],m[N][N];

  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d%d",&p[i-1],&p[i]);
  }

  for(i=1;i<=n;i++){
    m[i][i]=0;
  }
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      m[i][j]=(1<<21);
      for(k=i;k<=j-1;k++){
	m[i][j]=min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
      }
    }
  }

  printf("%d\n",m[1][n]);

  return 0;
}
  



Measured memory_bytes: 2104
#include <stdio.h>

#define N 10000
#define Q 500

int main(void){
    int i,j,n,q,S[N],T[Q],cnt=0;
    
    scanf("%d",&n);
    if(n>10000) exit(1);
    for(i=0;i<n;i++){
        scanf("%d",&S[i]); 
    }
    
    scanf("%d",&q);
    if(q>500) exit(1);
    for(i=0;i<q;i++){
        scanf("%d",&T[i]);
    }
    
    for(i=0;i<q;i++){
        for(j=0;j<n;j++){
	  if(T[i]==S[j]){
	    cnt++;
	    break;
	  }
        }
    }
    
    printf("%d\n",cnt);
    
    return 0;
}



Measured memory_bytes: 2108
// atcoder/abc082/D/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

bool fn(int x, vector<int>& v)
{
  const int N = (8000 + 2) * 2;
  static bool dp[2][N];
  fill(&dp[0][0], &dp[2 - 1][N - 1] + 1, false);
  const int M = 8001;
  dp[0][v[0] + M] = true;
  v.erase(v.begin());
  for (int i = 0; i < v.size(); ++i) {
    const int curr = i % 2;
    const int next = (i + 1) % 2;
    for (int j = 0; j < N; ++j) {
      dp[next][j] = false;
    }
    for (int j = 0; j < N; ++j) {
      if (0 <= j - v[i]) dp[next][j] |= dp[curr][j - v[i]];
      if (j + v[i] < N)  dp[next][j] |= dp[curr][j + v[i]];
    }
  }
  return dp[v.size() % 2][x + M];
}

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  string s;
  int x, y;
  while (cin >> s >> x >> y) {
    vector<string> v;
    string t;
    s += 'T';
    each (c, s) {
      if (c == 'T') {
        v.push_back(t);
        t = "";
      } else {
        t += c;
      }
    }

    vector<int> a, b;
    b.push_back(0);
    for (int i = 0; i < v.size(); ++i) {
      if (i % 2) b.push_back(v[i].size());
      else a.push_back(v[i].size());
    }
    cout << (fn(x, a) && fn(y, b) ? "Yes" : "No") << endl;
  }

  return 0;
}


Measured memory_bytes: 640
#include<cstdio>
#include<algorithm>
using namespace std;

int main(){
  int n,cnt=1;
  long a[100000],t,maxa[100000],sa[100000];
  scanf("%d %ld",&n,&t);
  for(int i=0;i<n;i++){
    scanf("%ld",&a[i]);
  }
  for(int i=n-1;i>=0;i--){
    if(i==n-1)
      maxa[i]=a[i];
    else
      maxa[i]=max(maxa[i+1],a[i]);
  }
  for(int i=0;i<n;i++)
    sa[i]=a[i]-maxa[i];
  sort(sa,sa+n);
  for(int i=1;i<n;i++){
    //printf("%ld\n",sa[i]);
    if(sa[i]==sa[i-1])
      cnt++;
    else
      break;
  }
  printf("%d\n",cnt);
}

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

int main()
{
    vector<int> v;
    int i, num;
    for (i=0; i < 3; i++) {
        cin >> num;
        v.push_back(num);
    }
    
    sort(v.begin(), v.end());
    num = v[0]+v[1]+v[2]*10;
    cout << num << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <math.h>
#include <unordered_map>
#include <cstring>
#include <algorithm>
#include <set>
#include <climits>
#include <numeric>

//usings
using namespace std;

//type def
typedef long long int64;
typedef pair<int, int> ii;

//consts
const int mod = 1e9 + 7;

//methods
template<typename T>
bool chmax(T& source, const T& compare_to) {
    if(source < compare_to) {
        source = compare_to;
        return true;
    }
    return false;
}

int modpow(int64 base, int n) {
    int64 ret = 1;
    while(n) {
        if(n & 1) ret = ret * base % mod;
        base = base * base % mod;
        n >>= 1;
    }
    return ret;
}

class Solution {
private:
public:
    string solve(int h1, int a1, int h2, int a2) {
        while(h2 > 0 && h1 > 0) {
            h2 -= a1;
            if(h2 <= 0) break;
            h1 -= a2;
        }
        return h1 > 0 ? "Yes" : "No";
    }
};

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    Solution sol;
    auto ret = sol.solve(a, b, c, d);
    cout << ret << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
string n;
bool rec(int val){
	int cur = val*9;
	int up = 0;
	for(int i=0;i<n.size();i++){
		if(i==n.size()-1){
			return (up+cur>=n[i]-'0');
		}
		else{
			int target = n[i]-'0';
			target -= up;
			target = (target%10+10)%10;
			while(1){
				if(cur%10==target) break;
				else if(cur==0) return 0;
				cur--;
			}
			up = (cur+up)/10;
		}
	}
}
int main(){
	cin>>n; reverse(n.begin(),n.end());
	int lb = 0,ub = 500005;
	while(ub-lb>1){
		ll mid = (lb+ub)/2;
		if(rec(mid)) ub=mid;
		else lb=mid;
	}
	cout<<ub<<endl;
}

Measured memory_bytes: 900
# すべての頂点が入力に現れる回数が偶数であればOK 奇数回の頂点が一つでもあればNO
from collections import defaultdict as d

N,M = map(int,input().split())
E = d(int)

for i in range(M):
  a,b = map(int,input().split())
  E[a] ^= 1
  E[b] ^= 1

print(("YES","NO")[sorted(E.values())[-1]])


Measured memory_bytes: 9940
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
const int DX[8]={-1,0,1,0,-1,-1,1,1},DY[8]={0,-1,0,1,-1,1,-1,1};


int main(){
	while(1){
		int tmp,n,m,k;
		cin>>tmp>>n>>m>>k;
		if(tmp==0) break;
		vip a(n);
		vvi b(n,vi(m));
		for(int i=0;i<n;i++) a[i].second=-i-1;
		for(int i=0;i<k;i++){
			int x,y,z,w;
			cin>>x>>y>>z>>w;
			y--;z--;
			if(w!=0) b[y][z]++;
			else{
				a[y].first.first--;
				a[y].first.second+=b[y][z]*20+x;
			}
		}
		sort(a.begin(),a.end());
		for(int i=0;i<n;i++){
			if(i){
				if(a[i-1].first==a[i].first) cout<<'=';
				else cout<<',';
			}
			cout<<-a[i].second;
		}
		cout<<endl;
	}
}


Measured memory_bytes: 3080
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>
#include <cstring>
#include <cassert>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int,int> P;
typedef std::pair<int,P> State;

const int INF = 1001001001;

// S N E W(南北東西)
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

int N, M; // N: x, M: y
int map[102][102];
bool used[1000][102][102];

int main(){
    while(std::cin >> N >> M, N){
        memset(used, 0, sizeof(used));
        memset(map, 0, sizeof(map));

        FOR(i, 1, M+1){
            FOR(j, 1, N+1){
                char c;
                std::cin >> c;
                if(c == '.'){map[i][j] = 0;}
                else if(c == '#'){map[i][j] = -1;}
                else{map[i][j] = 1;}
            }
        }
    
        std::priority_queue<State,std::vector<State>,std::greater<State>> q;
        REP(i, N+2){
            q.push(mp(0, mp(0, i)));
            q.push(mp(0, mp(M+1, i)));
        }

        REP(i, M+2){
            q.push(mp(0, mp(i, 0)));
            q.push(mp(0, mp(i, N+1)));
        }

        int res = -1;
        while(!q.empty()){
            State s = q.top(); q.pop();
            int t = s.first, y = s.second.first, x = s.second.second;

            if(t >= 1000){continue;}
            if(map[y][x] == 1){res = t; break;}
            if(used[t][y][x]){continue;}

            used[t][y][x] = true;
        
            REP(i, 4){
                int nx = x + dx[i], ny = y + dy[i];
                if(0 <= nx && nx <= N+1 &&
                   0 <= ny && ny <= M+1){
                    if(map[y][x] == 0 && map[ny][nx] == -1){
                        if(!used[t+1][ny][nx]){
                            q.push(mp(t+1, mp(ny, nx)));
                        }
                    }else{
                        q.push(mp(t, mp(ny, nx)));
                    }
                }
            }
        }

        assert(res != -1);
        std::cout << res << std::endl;
    }
}

Measured memory_bytes: 11628
//package com.company;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int N = sc.nextInt();
        ArrayList<Integer> a = new ArrayList<>(N);
        for (int i = 0; i < N; i++) {
            int val;
            val = sc.nextInt();
            a.add(val);
        }
        for (int i = 0; i < N; i++) {
            H -= a.get(i);
        }
        if (H <= 0)
            System.out.println("Yes");
        else
            System.out.println("No");
    }
}


Measured memory_bytes: 62684
import java.util.*;
class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
      	int M = sc.nextInt();
      	int total = 0;
      	for (int i = 0; i < M; i++) {
          total += sc.nextInt();
        }
      	System.out.println(N < total ? -1 : N-total);
	}
}

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

#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be() , (a).en()
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)        //repeat n times
#define REP2(i,s,n) for(int (i)=(s);(i)<(n);(i)++)   //repeat from s to n 
#define REPD(i,n) for(int (i)=(n);(i)>=0;(i)--)      //repeat from n to 0
#define REPD2(i,s,e) for(int (i)=(s);(i)>=(e);(i)--) //repeat from s to e
#define RANGE(i,v) for(auto &(i):v)                  //repeat range
#define ASIZE(a) (sizeof(a) / sizeof(a[0]))          //array size

using LL = long long;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<LL>;
using Vs = V<string>;

template<typename A>
void UNIQUE(vector< A > &a,int mode=0){
    if(mode==0){ sort(ALL(a),greater< A >());}else{ sort(ALL(a));}
    a.erase(unique(ALL(a)),a.en());
}

int main(){
    string s;
    cin>>s;
    
    Vs ACGT;
    REP(i,s.size()){
        REP2(j,1,s.size()-i+1){
            string sub = s.substr(i,j);
            sort(ALL(sub));
            sub.erase(unique(ALL(sub)),sub.en());
            bool flag = true;
            REP(k,sub.size()){
                if(    sub[k]!='A'  
                    && sub[k]!='G'
                    && sub[k]!='C'
                    && sub[k]!='T'){
                        flag = false;
                        break;
                    }
            }
            if(flag) ACGT.pb(s.substr(i,j));
        }
    }

    int ans = 0;
    REP(i,ACGT.size()){
        ans = max(ans,int(ACGT[i].size()));
    }

    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<vector>
#include<functional>
#include <random>

using namespace std;

int main(void) {
	int N, K;
	scanf("%d %d", &N, &K);
	if((N+1)/2 >= K){
		printf("YES\n");
	}else{
		printf("NO\n");
	}
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <limits>
#include <climits>
#include <utility>
#include <algorithm>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

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

    if ((W % 2 != 0) || (H % 2 != 0)) {
        cout << W*H/2.0 << " " << 0 << endl;
        return 0;
    }

    if (x == W/2 && y == H/2) {
        cout << W*H/2.0 << " " << 1 << endl;
    } else {
        cout << W*H/2.0 << " " << 0 << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int read()
{
	char ch=getchar();int f=0;
	while(ch<'0'||ch>'9') ch=getchar();
	while(ch>='0'&&ch<='9')
	{f=(f<<1)+(f<<3)+ch-'0';
	ch=getchar();}
	return f;
}
int a[5];
int main()
{
	a[1]=read();a[2]=read();a[3]=read();
	sort(a+1,a+4);
	cout<<a[1]+a[2];
}


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

int main() {
	ios_base::sync_with_stdio( false );

	array<int, 3> a;
	cin >> a[0] >> a[1] >> a[2];
	sort( a.begin(), a.end() );
	cout << a[0] * a[1] / 2 << endl;

	return 0;
}


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

using namespace std;

#define hash sodnf9843bsd
#define ll long long
#define INF (1<<29)
#define INFF 0x7fffffff
#define LINF (1ll<<60)
#define LINFF 0x7fffffffffffffff
#define PI 3.14159265359
#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define YESNO(ans) cout << (ans?"YES":"NO") << endl
#define prec(x) cout << fixed << setprecision(x)
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define endl '\n'
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

    int n;cin>>n;
    vector<int>h(n);
    _fi(n) cin>>h[i];

    ll dp[100005] = {};
    for(int i = 0;i < n;i++) dp[i] = LINF;

    dp[0] = 0;
    dp[1] = abs(h[0]-h[1]);
    for(int i = 2;i < n;i++){
        dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]));
    }

    cout << dp[n-1] << endl;

    return 0;
}


Measured memory_bytes: 1408
#include<cstdio>
#include<string>
#include<iostream>
using namespace std;
const int MAXN=101,MAXM=101;
int n,m;
bool bo,b[MAXN][MAXM];
string s[MAXN];
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;++i)
		cin>>s[i];
	for(int i=1;i<=n;++i)
	{
		for(int j=0;j<m;++j)
		if(s[i][j]!='.')
			bo=true;
		if(!bo)
			for(int j=0;j<m;++j)
			b[i][j]=true;
		bo=false;
	}
	for(int j=0;j<m;++j)
	{
		for(int i=1;i<=n;++i)
		if(s[i][j]!='.')
			bo=true;
		if(!bo)
			for(int i=1;i<=n;++i)
			b[i][j]=true;
		bo=false;
	}
	for(int i=1;i<=n;++i)
	{
		for(int j=0;j<m;++j)
		if(!b[i][j])
			cout<<s[i][j],bo=true;
		if(bo) printf("\n");
		bo=false;
	}
}

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

using namespace std;

int main()
{
	int h, w;
	char clowd[120][120];
	int cnt[120][120];
	
	scanf("%d %d", &h, &w);

	for (int i = 0; i < h; i++){
		for (int j = 0; j < w; j++){
			cnt[i][j] = -1;
		}
	}

	for (int i = 0; i < h; i++){
		scanf("%s", clowd[i]);
	}

	for (int i = 0; i < h; i++){
		for (int j = 0; j < w; j++){
			if (clowd[i][j] == 'c'){
				int tmp = 0;
				for (int k = j; k < w; k++){
					cnt[i][k] = tmp;
					tmp++;
				}
			}
		}
	}

	for (int i = 0; i < h; i++){
		for (int j = 0; j < w; j++){
			if (j == w - 1){
				cout << cnt[i][j] << endl;
			}
			else {
				cout << cnt[i][j] << " ";
			}
		}
	}

	return (0);
}

Measured memory_bytes: 1276
#include <iostream>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

int main(){
  string S,T; cin>>S>>T;
  if(S.size()<T.size()){
    cout<<"UNRESTORABLE"<<endl;
    return 0;
  }
  
  int a=-1;
  for(int i=0;i<=(S.size()-T.size());i++){
    for(int j=0;j<T.size();j++){
      if(S[i+j]!='?'&&S[i+j]!=T[j]) break;
      if(j==(T.size()-1)) a=i;
    }
  }
  if(a<0){
    cout<<"UNRESTORABLE"<<endl;
    return 0; 
  }
  S.replace(a,T.size(),T);

  for(int i=0;i<S.size();i++){
    if(S[i]=='?') cout<<'a';
    else cout<<S[i];
  }
  cout<<endl;

  return 0;
}



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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<int,ll> P;
typedef pair<ll,P> PP;

//-----------------------------------------------------------------------------

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

	int a,b;
	while(cin>>a>>b) {
		cout<<(int)log10(a+b)+1<<endl;
	}

	return 0;
}



Measured memory_bytes: 3452
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
else:
    ans = a[0]
    err = 0
    for i in a[1:n]:
        ans = ans * i
        if ans > 10 ** 18:
            err += 1
            break
        else:
            continue
    if err == 0:
        print(ans)
    else:
        print("-1")

Measured memory_bytes: 21480
#include<bits/stdc++.h>
using namespace std;
int main(){
	int i,j,c=0,n;
  cin>>n;
  n = n*2;
  int a[n];
  for(i=0;i<n;i++){
  cin>>a[i];
  }
  sort(a,a+n);
  for(i=0;i<n;i+=2){
  	c += a[i];
  }
  cout<<c;
}

Measured memory_bytes: 3584
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <algorithm>
#define N 1234
#define int long long
template<typename T> inline void read(T &x) {
	x = 0; char c = getchar(); bool flag = false;
	while (!isdigit(c)) { if (c == '-') flag = true; c = getchar(); }
	while (isdigit(c)) { x = (x << 1) + (x << 3) + (c ^ 48); c = getchar(); }
	if (flag)	x = -x;
}
using namespace std;
inline int F(int x) {
	return x < 0 ? -x : x;
}
int n;
int X[N], Y[N];
int d[43], dtot;
inline void work(int x, int y) {
	int nx = 0, ny = 0;
	for (int i = 1; i <= dtot; ++i) {
		int t = d[i];
		if (F(x - nx) > F(y - ny)) {
			if (x < nx)	putchar('L'), nx -= t;
			else	putchar('R'), nx += t;
		} else {
			if (y < ny)	putchar('D'), ny -= t;
			else putchar('U'), ny += t;
		}
	}
	putchar('\n');
}
signed main() {
	read(n);
	int type = -1;
	for (int i = 1; i <= n; ++i) {
		read(X[i]), read(Y[i]);
		int t = (X[i] + Y[i]) % 2;
		if (t < 0)	t += 2;
		if (type == -1)	type = t;
		else if (type != t) { puts("-1"); exit(0); }
	}
	if (type)	puts("31");
	else	puts("32");
	for (int i = 30; ~i; --i)	printf("%d ", 1 << i);
	if (type == 0)	puts("1");
	else	puts("");
	int nw = 30;
	if (type == 0) {
		for (int i = 0; i <= 30; ++i)	d[++dtot] = 1 << nw, --nw;
		d[++dtot] = 1;
	} else {
		for (int i = 0; i <= 30; ++i)	d[++dtot] = 1 << nw, --nw;
	}
	for (int i = 1; i <= n; ++i)	work(X[i], Y[i]);
	return 0;
}


Measured memory_bytes: 3212
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    vector<int>x;
    for(int i=n;i>=1;i--){
        for(int j=i*2;j<=n;j+=i)a[i-1]=(a[i-1]+a[j-1])%2;
        if(a[i-1])x.push_back(i);
    }
    cout<<x.size()<<endl;
    for(int i=x.size()-1;i>=0;i--)cout<<x[i]<<endl;
    return 0;
}

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

using namespace std;

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

    int sum = 0;
    int loss = 0;
    string str = to_string(N);
    for (int i = 0; i < str.length(); i++) {
        int n = str[i] - '0';
        sum += n;
        if (i > 0) loss += (9 - n);
    }

    if (loss == 0)
        cout << sum << endl;
    else
        cout << sum + loss - 1 << endl;

    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 rrep(i, n) for(int i = n-1; i >= 0; i--)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VP = vector<P>;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int t[505][505], c[505][505];

int main(){
    int n, m, q;
    cin >> n >> m >> q;
    rep(i,m){
        int l, r;
        cin >> l >> r;
        t[l][r]++;
    }

    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            c[i][j] = c[i][j-1] + t[i][j];
        }
    }

    rep(i,q){
        int l, r;
        cin >> l >> r;
        int ans = 0;
        for(int j = l; j <= r; j++){
            ans += c[j][r] - c[j][l-1];
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 5588
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		FastScanner fs = new FastScanner();
		int R = fs.nextInt();

		double x = R * 2.0 * Math.PI;

		System.out.println(x);
	}

}


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

using namespace std;

int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  std::array<int, 5> ps;
  int sum = 0;
  int m = 10;
  for (auto& p : ps) {
    std::cin >> p;
    if (p % 10) {
      m = std::min(p % 10, m);
    }
    p = ((p + 9) / 10) * 10;
    sum += p;
  }
  sum -= 10;
  sum += m;
  std::cout << sum << std::endl;
  return 0;
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	var n int
	var m int
	var k int
	var count int
	var countTmp int
	var tmp int
	var aArr []int
	var bArr []int

	sc.Split(bufio.ScanWords)
	n = nextInt()
	m = nextInt()
	k = nextInt()

	countTmp = 0
	aArr = append(aArr, countTmp)
	for i := 0; i < n; i++ {
		tmp = nextInt()
		countTmp = countTmp + tmp
		aArr = append(aArr, countTmp)
	}

	countTmp = 0
	bArr = append(bArr, countTmp)
	for i := 0; i < m; i++ {
		tmp = nextInt()
		countTmp = countTmp + tmp
		bArr = append(bArr, countTmp)
	}

	count = 0
	tmp = m
	for i := 0; i < n+1; i++ {
		if aArr[i] > k {
			break
		}
		for j := tmp; j >= 0; j-- {
			if aArr[i]+bArr[j] <= k {
				count = int(math.Max(float64(i+j), float64(count)))
				tmp = j
				break
			}
		}
	}

	fmt.Printf("%d\n", count)
}

Measured memory_bytes: 12272
#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
 
int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  
  int A, B, C;
  cin >> A >> B >> C;
  if(A+B < C){
    cout << B + A+B+1 << endl;
  }
  else{
    cout << B+C << endl;
  }
}


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

int c=0;
string n;
void a(string an){
    long long int tmp=atoll(n.c_str());
    long long int hoge = atoll(an.c_str());
    if(hoge>tmp)return;
    if(strstr(an.c_str(),"3")!=NULL&&strstr(an.c_str(),"5")!=NULL&&strstr(an.c_str(),"7")!=NULL){
        c++;
    }

    string an2=an+'3';
    string an3=an+'5';
    an+='7';

    a(an);
    a(an2);
    a(an3);
}

int main(){
    cin>>n;
    a("3");
    a("5");
    a("7");
    cout<<c<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  ll x, n;
  cin >> x >> n;
  vector<ll> p;
  p.resize(n);
  for (ll i = 0; i < n; i++) {
    cin >> p[i];
  }
  sort(p.begin(), p.end());
  ll dis = -1;
  ll minnum = 0;
  for (ll i = 0; i <= 101; i++) {
    if (find_if(p.begin(), p.end(), [&i](ll &pp) { return pp == i; }) == p.end()) {
      if (dis == -1) {
        dis = abs(x - i);
        minnum = i;
      } else if (dis > abs(x - i)) {
        dis = abs(x - i);
        minnum = i;
      }
    }
  }
  cout << minnum << endl;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int n;
vector<long long> A(200200, 0);
vector<long long> sum(200200, 0);

int main() {
    cin >> n;
    for(int i = 0; i < n; ++i) cin >> A.at(i);

    sum.at(0) = A.at(0);
    for(int i = 1; i < n; ++i) {
        sum.at(i) += sum.at(i-1) + A.at(i);
    }

    long long cnt = 0;
    map<long long, long long> mp;
    for(int i = 0; i < n; ++i) {
        if(sum.at(i) == 0) cnt++;
        mp[sum.at(i)]++;
    }

    for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
        long long mcnt = itr->second;
        cnt += (mcnt*(mcnt-1)) / 2;
    }

    cout << cnt << endl;
}

Measured memory_bytes: 15872
n;char s[100001];i,r=1;

main(){
	scanf("%d\n",&n);
	gets(s);
	for(i=1;i<n;i++)
	  if(s[i-1]!=s[i]){
	//  	printf("'%c' '%c'\n",s[i-1],s[i]);
	  	r++;
	  }
	printf("%d\n",r);
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        String a = s.nextLine();
        int count = 0;

        if (a.equals("RRR"))
            count = 3;
        if (a.equals("RRS"))
            count = 2;
        if (a.equals("RSS"))
            count = 1;
        if (a.equals("SSS"))
            count = 0;
        if (a.equals("SSR"))
            count = 1;
        if (a.equals("SRR"))
            count = 2;
        if (a.equals("SRS"))
            count = 1;
        if (a.equals("RSR"))
            count = 1;

        System.out.println(count);

        s.close();
    }
}

Measured memory_bytes: 35612
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

namespace B_ABC144
{
    class MainClass
    {

        static int[] s;

        public static void Main(string[] args)
        {
            s = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);
            int u = s[0];
            for(int i=1;i<=9;i++){
                int t = u%i;
                if(t==0&&u/i<10){
                    WriteLine("Yes");
                    return;
                }
            }
            WriteLine("No");
        }
    }
}


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

int main(){
  long long n,a=2,b=1,c=3;
  cin>>n;
  if(n==1)cout << 1<< endl;
  else if(n==2)cout << 3 << endl;
  else{
  	for(int i=3;i<=n;++i){
  	a=b;
  	b=c;
  	c=a+b;
  }
  cout << c << endl;
  }
  return 0;
}

Measured memory_bytes: 256
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

a = list(input())
mx = 0
for i in range(len(a)):
    count = 0
    for j in range(i, len(a)):
        if a[j] == "A" or a[j] == "C" or a[j] == "G" or a[j] == "T":
            count += 1
        else:
            break
    mx = max(mx, count)
print(mx)

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

#define REPI(i, n) for(int i = 0; i < n; i++)
#define REPJ(j, n) for(int j = 0; j < n; j++)

using ll = long long;
using namespace std;

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

    char array[3]; REPI(i, 3) cin >> array[i];
    int ans = 0;
    REPI(i, 3){
        char c; cin >> c;
        if(array[i] == c) ans++;
    }cout << ans;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <climits>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <map>
#include <tuple>
#include <iostream>
#include <deque>
#include <array>
#include <set>
#include <functional>
#include <memory>


int main() {
	int n, a, b; std::cin >> n >> a >> b;
	std::cout << std::min(a * n, b) << std::endl;
}

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

    long long n,r;
    cin>>n;
    r=n%10;
    if(r==2||r==4||r==5||r==7||r==9)
    {
      cout<<"hon"<<endl;
    }else if(r==0||r==1||r==6||r==8)
    {
      cout<<"pon"<<endl;
    }else
    {
      cout<<"bon"<<endl;
    }

  
}

Measured memory_bytes: 3588
import java.util.*;

class Main
{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        String num = sc.next();
        
        if (num.length() == 4) {
            System.out.println("ABD");
        } else {
            System.out.println("ABC");
        }
    }
}

Measured memory_bytes: 35572
#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(),(obj).end()
#define SORTD(s) sort((s).rbegin(),(s).rend())
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
#define PI 3.14159265358979323846264338327950L
const int mod=1000000007,MAX=200005,INF=1<<30;

int main() {
	string s;
  	cin>>s;
  	
  	int p = s.size()-1;
  
  	if(s[p]=='s'){
    	cout<<s<<"es"<<endl;
    }
  
  	else{
    	cout<<s<<"s"<<endl;
    }
  
  	


}

Measured memory_bytes: 3612