akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
//using namespace boost::multiprecision;
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> P;
#define PI 3.141592653589793
#define MOD 1000000007
//#define MOD 998244353
#define ALL(obj) (obj).begin(),(obj).end()
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;}
const ll INF = 1LL << 60;

//四方向への移動ベクトル
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

struct edge{//グラフに使うヤツ
    ll from,to,cost;
};

typedef vector<vector<edge> > G;
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}

int main() {
    ll h,w,cx,cy,dx,dy;
    cin >> h >> w >> cx >> cy >> dx >> dy;
    cx--;
    cy--;
    dx--;
    dy--;
    string s[h];
    for (ll i=0;i<h;i++)cin >> s[i];
    deque<P> que;

    que.push_back(P(cx,cy));
    bool visited[h][w];
    ll d[h][w];
    for (ll i=0;i<h;i++){
        fill(visited[i],visited[i]+w,false);
        fill(d[i],d[i]+w,INF);
    }
    d[cx][cy]=0;
    visited[cx][cy]=true;

    while(!que.empty()){
        P p=que.front();
        ll X=p.first,Y=p.second;
        if (X==dx and Y==dy){
            cout << d[X][Y] << endl;
            return 0;
        }
        visited[X][Y]=true;
        que.pop_front();
        for (ll i=-2;i<3;i++){
            for (ll j=-2;j<3;j++){
                ll x=X+i,y=Y+j;
                if (x<h and x>=0 and y<w and y>=0 and s[x][y]=='.'){
                    if (visited[x][y])continue;
                    if (abs(i)+abs(j)<2){
                        que.push_front(P(x,y));
                        d[x][y]=d[X][Y];
                        visited[i][j]=true;
                    }else{
                        if (d[X][Y]+1<d[x][y]){
                            d[x][y]=d[X][Y]+1;
                            que.push_back(P(x,y));
                        }
                    }
                }
            }
        }

    }
    cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 14536
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()		//sort(all(vi S)) sort(all(string S))
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }

using P = pair<int, int>;		//P.first, P.second
typedef long long ll;
typedef vector<int> vi;
typedef set<int> seti;
typedef vector<string> vs;

const int MOD = 1e9+7;
const int INF = 1e9;

int main() {
	ll A,B,C;
	cin>>A>>B>>C;
	ll AA,BB,CC;
	ll ans = 0;
	ll A1 = A,B1 = B,C1 = C;
	while(A%2 == 0 && B%2 == 0 && C%2 == 0){
		AA = A/2;
		BB = B/2;
		CC = C/2;
		A = BB+CC;
		B = CC+AA;
		C = AA+BB;
		if(A==A1&&B==B1&&C==C1){
			cout<<-1<<endl;
			return 0;
		}
		ans++;
	}
	cout<<ans<<endl;
}

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

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

    int H[N + 1];
    for (int i = 1; i <= N; i++) {
        cin >> H[i];
    }

    bool good[N + 1];
    for (int i = 0; i <= N; i++) good[i] = true;

    int A, B;
    for (int i = 1; i <= M; i++) {
        cin >> A >> B;
        if (H[A] > H[B]) {
            good[B] = false;
        }
        else if (H[A] < H[B]) {
            good[A] = false;
        }
        else {
            good[A] = false;
            good[B] = false;
        }
    }

    int ans = 0;
    for (int i = 1; i <= N; i++) {
        if (good[i]) ans++;
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4084
import java.io.PrintWriter
val pw = PrintWriter(System.out)

fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    val n = nextInt()
    val hh = listOfInt()

    var max = 0
    var count = 0

    hh.forEach {
        if (it >= max) count++
        if (it > max) max = it
    }

    println(count)
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { it.toInt() }

fun println(value : Any) {
    pw.println(value)
}

Measured memory_bytes: 36040
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A,B,C,D = map(int, readline().split())


while True:
  C -= B
  if C <= 0:
    print('Yes')
    break
  A -= D
  if A <= 0:
    print('No')
    break


Measured memory_bytes: 9156
#include <bits/stdc++.h>
#include<cmath>
#define N 100005
#define A 1000005
#define MOD 998244353 //1000000007 // //100000000
#define INF 1000000000000000000
#define ll long long
//#define M_PI 3.141592653589793238463

using namespace std;

#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#define sd second
#define pb push_back
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n-1; i >= 0; i--)
#define itr(it, x) for(auto it = x.begin(); it != x.end(); it++)
#define mem(a, b) memset(a, (ll)b, sizeof(a))
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define edge(v, x, y) v[x].pb(y); v[y].pb(x);
#define popcount __builtin_popcount
#define ANS(s) {cout << s << "\n"; return;}

//~~~~~~fancy print~~~~~~~//
#define printpii(a) cout << a.ft << " " << a.sd << endl;
#define printpiii(a) cout << a.ft << " " << a.sd.ft << " " << a.sd.sd << endl;
#define print(a, n) rep(i, n) cout << a[i] << " "; cout << endl;
#define printv(v) for(auto x: v)cout << x << " "; cout << endl;
#define printm(a, n, m) rep(i, n) { rep(j, m) cout << a[i][j] << "\t"; cout << endl;}

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

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout << setprecision(12) << fixed;}


void solve(){
    string s;
    map<ll, ll> mp;
    ll n;
    cin >> n >> s;
    ll ans = 0, l = 0;
    rep(i, s.size())
    {
        if(s[i] == 'I'){
            l++; ans = max(ans, l);
        }
        else l--;
    }
    cout << ans;
}
main(){
    fast();
    ll t = 1; //cin >> t;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 256
N=int(input())
H=[int(i) for i in input().split()]
A=1
if N>1:
    for i in range(N-1):
        if H[-(i+1)-1] <= H[-(i+1)]:
            A+=1
        elif H[-(i+1)-1]-1 == H[-(i+1)]:
            A+=1
            H[-(i+1)-1]-=1
    if A==N:
        print('Yes')
    else:
        print('No')
elif N==1:
    print('Yes')

Measured memory_bytes: 14352
n = int(input())
a = [int(i) for i in input().split()]
t = 1
while a[0]%(t*2)==0:
    t *= 2
for k in range(1,n):
    while a[k]%t != 0:
        t = t//2
r = 0
while t != 1:
    t = t//2
    r += 1
print(r)

Measured memory_bytes: 3060
from sys import exit
N = int(input())
s = [int(input()) for _ in range(N)]
result = sum(s)
if result % 10 != 0:
  print(result)
  exit()
t = [i for i in s if i % 10 != 0]
if len(t) == 0:
  print(0)
else:
  result -= min(t)
  print(result)


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

int main() {
    string s;
    cin >> s;
    auto u = (int)s.size();
    char a, b, c;
    a = s[0];
    b = s[1];
    if (u == 2 || a == b) {
        puts(a == b ? "1 2" : "-1 -1");
        return 0;
    }
    for (int i = 2; i < u; i++) {
        c = s[i];
        if (a == c) {
            printf("%d %d\n", i - 1, i + 1);
            return 0;
        } else if (b == c) {
            printf("%d %d\n", i, i + 1);
            return 0;
        }
        a = b;
        b = c;
    }
    puts("-1 -1");
}


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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

int main(void) {
    ll A, B;
    char op;
    cin >> A >> op >> B;
    if(op == '+') cout << A + B;
    else cout << A - B;
    cout << endl;
    return 0;
}


Measured memory_bytes: 3624
import sys
input = sys.stdin.readline
X = int(input())
x = int(X ** (1/2))
ans = 1
for i in range(2,x+1) :
    a = 1
    e = 0
    while a == 1 :
        k = i ** e
        if k > X :
            k = i ** (e-1)
            a = 0
            break
        e+=1
    ans = max(ans,k)
print(ans)

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

typedef long long ll;

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

    ll a,b;
    cin >> a >> b;
    cout << max(a+b,max(a-b,a*b)) << endl;
    return 0;
}

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define For(i, a, b) for(int i = (a); i < (b); ++i)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
typedef vector<long long> vlint;
typedef vector<string> vstr;
typedef vector<char> vchar;
typedef vector<vector<long long>> vlint2;

const lint M = 998244353;

vector<lint> fac(300001); //n!(mod M)
vector<lint> ifac(300001); //k!^{M-2} (mod M)
//a,bの範囲的にこれだけ配列を用意していけば十分

lint mpow(lint x, lint n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    lint ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % M;
        x = x*x % M;
        n = n >> 1;
    }
    return ans;
}

lint comb(lint a, lint b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    lint tmp = ifac[a-b]* ifac[b] % M;
    return tmp * fac[a] % M;
}

int main() {
  fac[0] = 1;
    ifac[0] = 1;
    for(lint i = 0; i<300000; i++){
        fac[i+1] = fac[i]*(i+1) % M; // n!(mod M)
        ifac[i+1] = ifac[i]*mpow(i+1, M-2) % M; // k!^{M-2} (mod M) ←累乗にmpowを採用
    }

  int n, m, K;
  cin >> n >> m >> K;
  lint mod = 998244353;
  lint ans = 0;
  rep(k, K+1){
    ans += (m % mod * mpow(m-1, n-1-k) % mod * comb(n-1, k) % mod) % mod;
    ans %= mod;
  }
  cout << ans << endl;
}




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

using namespace std;

int main() {
	int N;
	vector<int> rabbits;
	cin >> N;
	for (int i = 0; i < N; i++) {
		int buff;
		cin >> buff;
		rabbits.push_back(buff);
	}
	int answer = 0;
	for (int i = 0; i < rabbits.size(); i++) {
		if (rabbits[rabbits[i]-1] == i+1) {
			answer++;
		}
	}
	answer /= 2;
	cout << answer << endl;
}

Measured memory_bytes: 892
#include <iostream>
using namespace std;
int main(){
  int a,b,c,x,y;cin>>a>>b>>c>>x>>y;
  if(a+b < c*2){
    cout << a*x+b*y << endl;
    return 0;
  }
  int ans = 0;
  ans += min(x,y)*2*c;
  if(x > y){
    ans+= min(a,c*2)*(x-y);
  }else if (x < y){
    ans+= min(b,c*2)*(y-x);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
from heapq import heappop,heappush

n = int(input())
p = []
for i in range(n):
    x,y = map(int,input().split())
    p.append((i,x,y))

e = [[] for _ in range(n)]

p = sorted(p,key=lambda x:x[1])
n0,x0,y0 = p[0]
for i in range(n-1):
    n1,x1,y1 = p[i+1]
    e[n0].append((min(abs(x1-x0),abs(y1-y0)),n1))
    e[n1].append((min(abs(x1-x0),abs(y1-y0)),n0))
    n0,x0,y0 = n1,x1,y1

p = sorted(p,key=lambda x:x[2])
n0,x0,y0 = p[0]
for i in range(n-1):
    n1,x1,y1 = p[i+1]
    e[n0].append((min(abs(x1-x0),abs(y1-y0)),n1))
    e[n1].append((min(abs(x1-x0),abs(y1-y0)),n0))
    n0,x0,y0 = n1,x1,y1

def Prim(n,edge):
    #edge[source] = [(cost_1,target_1),(cost_2,target_2),...]
    used = [False] * n
    q = []
    #e = [cost,target]
    for e in edge[0]:
        heappush(q,e)
    used[0] = True
    res = 0
    while q:
        c,v = heappop(q)
        if used[v]:
            continue
        used[v] = True
        for e in edge[v]:
            if not used[e[1]]:
                heappush(q,e)
        res += c
    return res

print(Prim(n,e))

Measured memory_bytes: 123224
// abc129d.cpp : Lamp
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define rp(i,n) for(int i=0;i<(n);i++)
#define irp(i,n) for(int i=(n);i>=0;i--)

int main(){
	int h,w; cin>>h>>w;

	vector<string> s(h);
	vector<vi> U(h,vi(w)), L(h,vi(w));

	rp(i,h) cin>>s[i];

	rp(i,h)
		rp(j,w){
			if(i>0 && s[i][j]=='.' && s[i-1][j]=='.') U[i][j] = U[i-1][j] + 1;
			if(j>0 && s[i][j]=='.' && s[i][j-1]=='.') L[i][j] = L[i][j-1] + 1;
		}

	irp(i,h-1)
		irp(j,w-1){
			if(i<h-1 && s[i][j]=='.' && s[i+1][j]=='.') U[i][j] = U[i+1][j];
			if(j<w-1 && s[i][j]=='.' && s[i][j+1]=='.') L[i][j] = L[i][j+1];
		}

	int ans = 0;
	rp(i,h)
		rp(j,w)
			if(s[i][j]=='.'){
				int s = U[i][j] + L[i][j] + 1;
				if(ans<s) ans = s;
			}

	cout<< ans <<endl;
}

Measured memory_bytes: 35840
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int maxm=2e5+5;
const int mod=1e9+7;
int a[maxm];
int b[maxm];
int n;
signed main(){
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    multiset<int>s;
    s.insert(a[1]);
    for(int i=2;i<=n;i++){
        auto it=s.lower_bound(a[i]);//>=a[i]
        if(it==s.begin()){
            s.insert(a[i]);
        }else{
            it--;
            s.erase(it);
            s.insert(a[i]);
        }
//        cout<<i<<": ";
//        for(auto x:s){
//            cout<<x<<' ';
//        }
//        cout<<endl;
    }
    cout<<s.size()<<endl;
    return 0;
}
/*

*/


Measured memory_bytes: 9052
N, K=map(int, input().split())  #「A B」みたいなスペース空いた入力のとき

# N体分
enemy = list(map(int,input().split()))

enemy.sort()

if N <= K:
    print("0")
    # exit()
else:
    if K == 0:
        ans = sum(enemy[:])
    else:
        ans = sum(enemy[:-K])
    print(ans)


Measured memory_bytes: 26024
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template<size_t I,class H,class...T>struct TupleReaderWriter{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple_cat(tuple<H>(v),TupleReaderWriter<sizeof...(T)-1,T...>::r(i));}static void w(ostream&o,tuple<H,T...>&t,string d){TupleReaderWriter<I-1,H,T...>::w(o,t,d);o<<d<<get<I>(t);}};
template<class H,class...T>struct TupleReaderWriter<0,H,T...>{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple<H>(v);}static void w(ostream&o,tuple<H,T...>&t,string d){o<<get<0>(t);}};
template<class...T>istream&operator>>(istream&i,tuple<T...>&t){t=TupleReaderWriter<sizeof...(T),T...>::r(i);return i;}
template<class...T>ostream&operator<<(ostream&o,tuple<T...>&t){string delim=" ";TupleReaderWriter<sizeof...(T)-1,T...>::w(o,t,delim);return o;}
template<class T>istream&operator>>(istream&i,vector<T>&v){for(auto&x:v)i>>x;return i;}
template<class T>ostream&operator<<(ostream&o,vector<T>&v){string delim="";for(auto&x:v)o<<delim<<x,delim=" ";return o;}
template<class T>using rev_priority_queue=priority_queue<T,vector<T>,greater<T>>;
template<class T>using vector2d=vector<vector<T>>;
struct fixprec{int x;fixprec(int d):x(d){}};
ostream&operator<<(ostream&o,fixprec f){return o<<fixed<<setprecision(f.x);}
void R_YESNO(bool p) { cout << (p ? "YES" : "NO") << endl; }
void R_YesNo(bool p) { cout << (p ? "Yes" : "No") << endl; }

int main() {
    int N, u, v;
    cin >> N >> u >> v;
    u--, v--;
    vector2d<int> edge(N);
    for(int i = 0; i < N - 1; i++) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }
    // u, vからの距離
    vector<int> depth_u(N), depth_v(N);
    auto dfs = [&](int s, vector<int> &d) {
        queue<pair<int, int>> q;
        q.push({s, -1});
        while (q.size()) {
            int cur, prev;
            tie(cur, prev) = q.front();
            q.pop();
            for (int nxt : edge[cur]) {
                if (nxt == prev) continue;
                q.push({nxt, cur});
                d[nxt] = d[cur] + 1;
            }
        }
    };
    dfs(u, depth_u), dfs(v, depth_v);
    int ans = 0;
    for(int i = 0; i < N; i++) {
        if(depth_u[i] >= depth_v[i]) continue; // 枝に入る前に追い付かれる
        ans = max(ans, depth_v[i] - 1);
    }
    cout << ans << endl;
}



Measured memory_bytes: 6784
#include<bits/stdc++.h>
#define inf 1000000000
#define mod 1000000007
#define pb push_back
#define sz(v) (v).size()
#define all(v) (v).begin(),(v).end()
#define mp make_pair
#define fi first
#define se second
using namespace std;
template <class T> void chmax(T &x,T y){x=x>y?x:y;return;}
template <class T> void chmin(T &x,T y){x=x<y?x:y;return;}
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pi;

string s;

int main()
{
	cin>>s;
	if(s[2]==s[3]&&s[4]==s[5]) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 3624
#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;

int main() {
  int N;
  cin >> N;
  vi A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vi v(A);
  sort(v.begin(), v.end());
  int x = v[v.size() - 1];
  int y = v[v.size() - 2];

  for (int i = 0; i < N; i++) {
    if (x == A[i]) cout << y << endl;
    else cout << x << endl;
  }
}


Measured memory_bytes: 4736
unittest
{
	assert( [ "4", "3" ].parse.expand.solve == 10 );
	assert( [ "10", "10" ].parse.expand.solve == 76 );
}



import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.strip.to!( long );
	input.popFront;
	auto k = input.front.strip.to!( long );
	return tuple( n, k );
}

auto solve( long n, long k )
{
	auto x = 1L;
	
	foreach( i; 0 .. n )
	{
		if( x < k ) x *= 2;
		else        x += k;
	}
	
	return x;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fastio() ios::sync_with_stdio(0),cin.tie(0);

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i <= n; i += 4)
		for(int j=0;i+j<=n;j+=7)
			if (i + j == n)
			{
				puts("Yes");
				return 0;
			}
	puts("No");
	return 0;
}

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

int main(){
	int N;
	cin >> N;
	int i;
	char s[N];
	for(i=0; i<N; i++){
		cin >> s[i];
	}
	
	if(N%2==1){
		cout << "No" << endl;
		return 0;
	}
	
	for(i=0; i<N/2; i++){
		if(s[i]!=s[N/2+i]){
			cout << "No" << endl;
			return 0;
		}
	}
	
	cout << "Yes" << endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main{
    public static void main(String[] arg){

        Scanner in = new Scanner(System.in);

        String input = in.nextLine();
        String [] param_line = input.split(" ", 0);
        int [] dice_no = new int[6];
        for(int i=0; i<dice_no.length; i++)
            dice_no[i] = Integer.parseInt(param_line[i]);

        // create dice class instance
        Dice dice = new Dice(dice_no);

        //System.out.println(dice);


        // dice operation
        input = in.nextLine();
        for(int i=0; i<input.length(); i++){
            switch(input.charAt(i)){
                case 'W':
                    dice.toW();
                    break;
                case 'E':
                    dice.toE();
                    break;
                case 'S':
                    dice.toS();
                    break;
                case 'N':
                    dice.toN();
                    break;
            }
            //System.out.println(dice);
            //System.out.println(input.charAt(i));
        }

        System.out.println(dice.get(0));

    }


}

class Dice{
    int [] page_no;
    int [] tmp;

    Dice(int [] a){
        page_no = a.clone();
        tmp = new int[page_no.length];
    }

    void toW(){
        // 3 2 6 1 5 4
        tmp[0] = page_no[2];
        tmp[1] = page_no[1];
        tmp[2] = page_no[5];
        tmp[3] = page_no[0];
        tmp[4] = page_no[4];
        tmp[5] = page_no[3];
        array_restore();
    }

    void toE(){
        // 4 2 1 6 5 3
        tmp[0] = page_no[3];
        tmp[1] = page_no[1];
        tmp[2] = page_no[0];
        tmp[3] = page_no[5];
        tmp[4] = page_no[4];
        tmp[5] = page_no[2];
        array_restore();
    }

    void toS(){
        // 5 1 3 4 6 2
        tmp[0] = page_no[4];
        tmp[1] = page_no[0];
        tmp[2] = page_no[2];
        tmp[3] = page_no[3];
        tmp[4] = page_no[5];
        tmp[5] = page_no[1];
        array_restore();
    }

    void toN(){
        // 2 6 3 4 1 5
        tmp[0] = page_no[1];
        tmp[1] = page_no[5];
        tmp[2] = page_no[2];
        tmp[3] = page_no[3];
        tmp[4] = page_no[0];
        tmp[5] = page_no[4];
        array_restore();
    }

    private void array_restore(){
        for(int i=0; i<page_no.length; i++)
            page_no[i] = tmp[i];
    }

    int get(int index){
        return page_no[index];
    }


    @Override
    public String toString(){
        String str = "";
        for(int i=0; i<page_no.length-1; i++)
            str += page_no[i] + ", ";
        str += page_no[page_no.length-1];
        return str;
    }
}

Measured memory_bytes: 26232
N = int(input())
A = [input().split() for l in range(2)]

sum_list = []

for i in range(N):
  sum = 0
  for j in range(N):
    if i >= j:
      sum += int(A[0][j])
    if i <= j:
      sum += int(A[1][j])
  sum_list.append(sum)
print(max(sum_list))

Measured memory_bytes: 3060
n, m = map(int, input().split())
ls = sorted(map(int, input().split()))
ls2 = [list(map(int, input().split())) for _ in range(m)]
ls2.sort(key=lambda x: (x[1], x[0]), reverse=True)
left = 0
right = 0
index = 0
res = 0
while left < n:
    if index == len(ls2):
        break
    b, c = ls2[index]
    if c <= ls[left]:
        break
    right = left + 1
    while right <= n:
        if right == n:
            res += c * (right - left)
            break
        if ls[right] <= c and right - left < b:
            right += 1
        else:
            res += c * (right - left)
            break
    left = right
    index += 1

print(res + sum(ls[left:]))

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

int main(){
	int t[102]={},tmp,k = 0,i;
	while(cin>>tmp){
		t[tmp+1]++;
		if(t[tmp+1]>k){
			k = t[tmp+1];
		}
	}
	for(i = 1;i <= 102;i++){
		if(t[i] == k){
			cout<<i-1<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>

int main(void){

    int S, h, m, s;
    scanf("%d", &S);

    h = S / 3600;
    m = (S % 3600) / 60;
    s = (S % 3600) % 60;

    printf("%d:%d:%d\n", h, m, s);

    return 0;
}


Measured memory_bytes: 2124
/****Author: Barish Namazov****/
#include <bits/stdc++.h>

using namespace std;

/***TEMPLATE***/
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

#define F first
#define S second
#define pb push_back

#define endl '\n'

const int max4 = 10004;
const int maxx = 100005;
const int max6 = 1000006;
const int lg5 = 17;

const int INF = 2 * 1000000007;
const long long INFLL = 4LL * 1000000000 * 1000000000;

/***************/

int powmod (int a, int b, int mod) {
    int res = 1; a %= mod;
    for (; b; b >>= 1) {
        if (b & 1) {
            res = 1LL * res * a % mod;
        }
        a = 1LL * a * a % mod;
    }
    return res;
}

int gcd (int a, int b) {
    while (b > 0) {
        int t = a % b;
        a = b, b = t;
    }
    return a;
}

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

int is_prime (int n) {
    if (n <= 1 || n > 3 && (n % 2 == 0 || n % 3 == 0))
        return 0;
    for (int i = 5, t = 2; i * i <= n; i += t, t = 6 - t)
        if (n % i == 0)
            return 0;
    return 1;
}

/******Don't forget to use long long when needed!!******/

int S(long long x) {
    int res = 0;
    while (x > 0) res += x % 10, x /= 10;
    return res;
}

int check(long long a, long long b) {
    return a * S(b) < b * S(a);
}

int main() {
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    ios_base :: sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int k;
    cin >> k;
    long long n = 1;
    while (k --) {
        cout << n++ << endl;
        for (int i = 0; i <= 16; i++) {
            long long pw = ceil(pow(10, i));
            if (check(n / pw * pw + pw - 1, n) == 1) {
                n = n / pw * pw + pw - 1;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr<<"!"<<" "<<(hoge)<<endl;
#define DBG cerr<<"!"<<endl;
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;
ll dist[1111][1111];
ll dist2[1111][1111];
bool used[1111][1111];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      cin>>dist[i][j];
      dist2[i][j]=dist[i][j];
    }
  }
  for(int k=0;k<n;k++){
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	dist2[i][j]=min(dist2[i][j],dist[i][k]+dist[k][j]);
      }
    }
  }
  bool fl=true;
  for(int i=0;i<n;i++)
    for(int j=0;j<n;j++)
      if(dist[i][j]!=dist2[i][j])fl=false;
  if(fl){
    ll ans=0;
    for(int k=0;k<n;k++){
      for(int i=0;i<n;i++){
	for(int j=i+1;j<n;j++){
	  if(i!=k&&j!=k)
	    if(dist[i][j] == dist[i][k]+dist[k][j])
	      used[i][j]=true;
	}
      }
    }
  
    for(int i=0;i<n;i++)
      for(int j=i+1;j<n;j++)
	if(used[i][j]==false){
	  //cout<<dist[i][j]<<endl;
	  ans+=dist[i][j];
	}
    cout<<ans<<endl;
  }else{
    cout<<-1<<endl;
  }
  return 0;
}

Measured memory_bytes: 7296
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " : " << x << '\n'

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const ll Mod = 1000000007LL;
const int Maxn = 2e5 + 10;
const ll Inf = 2242545357980376863LL;
const ll Log = 30;

ll a[Maxn], b[Maxn];
ll dp[(1<<18)+10][52];

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	ll n, k, s;
	cin >> n;
	for(int i = 0; i < n; i++) cin >> a[i];
	for(int i = 0; i < n; i++) cin >> b[i];
	memset(dp, 31, sizeof dp);
	dp[0][0] = 0;
	
	int co, tt;
	for(int mk = 0; mk < (1 << n); mk++){
		for(int la = 0; la <= 50; la ++){
			int iv = 0;
			for(int ad = n - 1; ad >= 0; ad --){
				if(mk >> ad & 1){
					iv ++;
					continue;
				}
				co = ( (__builtin_popcount(mk) % 2) == (ad % 2) ? a[ad] : b[ad]);
				
				if(co < la) continue;
				dp[mk | (1 << ad)][co] = min(dp[mk][la] + iv, dp[mk | (1 << ad)][co]);
			}
		}
	}
	
	
	ll ans = Inf;
	for(int i = 0; i <= 50; i++) ans = min(ans, dp[(1 << n) - 1][i]);
	cout << (ans > n*n ? -1 : ans) << '\n';
	return 0;
}



Measured memory_bytes: 108928
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

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

    int a = 7, b = 4;
    for (int i = 0; i < 15; i++) {
        for (int j = 0; j < 25; j++) {
            if (a * i + b * j == n) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }

    cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

  public static void main(String[] args) throws IOException {
    
    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      int[] arrayS = new int[n];
      int i=0;
      for (String val : br.readLine().split(" ")) {
        arrayS[i++] = Integer.parseInt(val);
      }

      MergeSort merge = new MergeSort(arrayS);
      int cnt = merge.mergeSort(0, n);

      merge.dispIntArray();
      System.out.println(cnt);
    }
  }
}

class MergeSort {

  static private final int SENTINEL = Integer.MAX_VALUE;

  private int[] target;
  private int[] bufL;
  private int[] bufR;

  public MergeSort(int[] target) {
    this.target = target;
    bufL = new int[target.length/2+2];
    bufR = new int[target.length/2+2];

  }

  public int mergeSort(int left, int right) {
    int cnt =0;

    if(left+1 < right){
      int mid = (left + right) / 2;
      cnt += mergeSort(left, mid);
      cnt += mergeSort(mid, right);
      cnt += merge(left, mid, right);
    }

    return cnt;
  }

  private int merge(int left, int mid, int right) {
    int cnt = 0;
    int n1 = mid - left;
    int n2 = right - mid;
    
    for(int i=0; i<n1; i++)
      bufL[i] = target[left+i];
    bufL[n1] = MergeSort.SENTINEL;

    for(int i=0; i<n2; i++)
      bufR[i] = target[mid+i];
    bufR[n2] = MergeSort.SENTINEL;

    for(int i=0,j=0,k=left; k<right; k++) {
      if(bufL[i] <= bufR[j])
        target[k] = bufL[i++];
      else
        target[k] = bufR[j++];
      cnt++;
    }

    return cnt;
  }

  public int[] getArray() {
    return target;
  }

  public void dispIntArray() {
    StringBuilder s = new StringBuilder();

    for (int i : target) { s.append(i).append(" "); }
    s.setLength(s.length()-1);

    System.out.println(s);
  }
}


Measured memory_bytes: 152496
#include <iostream>
#include <iomanip>
#include <vector>
#include <valarray>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <bitset>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <complex>
#include <string>
#include <sstream>

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cmath>

using namespace std;

#define all(c) c.begin(),c.end()
#define repeat(i,n) for(int i=0;i<static_cast<int>(n);i++)
#define debug(x) #x << "=" << (x)
#define dump(x) cerr << debug(x) << " (L:" << __LINE__ << ")"<< endl

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<string> vs;

template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec){
    os << "[";
    for(int i = 0; i < vec.size(); i++){
        os << vec[i] << ",";
    }
    os << "]";
    return os;
}

template<typename T>
T input(){
    T t;
    cin >> t;
    return t;
}

template<typename T>
vector<T> input(const int N){
    vector<T> v(N);
    repeat(i,N) cin >> v[i];
    return v;
}

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

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

long long mul(const long long& a, const long long& b, const long long& mod) {
    return ((a % mod) * (b % mod)) % mod;
}

long long power(const long long& x, const long long& y, const long long& mod) {
    if (y == 0) {
        return 1;
    } else if (y == 1) {
        return x % mod;
    } else {
        long long value = power(x, y / 2, mod);
        if (y % 2 == 0) {
            return mul(value, value, mod);
        } else {
            return mul(value, value, mod) * x % mod;
        }
    }
}

long long div(const long long& a, const long long& b, const long long& mod) {
    return mul(a, power(b, mod - 2, mod), mod);
}

map<long long, long long> factorials;
long long factorial(const long long& n, const long long& mod) {
    if (n == 0 || n == 1) {
        return 1;
    }
    if (factorials[n] != 0) {
        return factorials[n];
    }
    factorials[n] = n * factorial(n - 1, mod) % mod;
    return factorials[n] % mod;
}

long long combination(const long long& n, const long long& x, const long long& mod) {
    long long numerator = 1;
    long long denominator = 1;
    repeat(i, x) {
        numerator *= (n - i) % mod;
        numerator %= mod;
        denominator *= (i + 1) % mod;
        denominator %= mod;
    }
    return div(numerator, denominator, mod);
}

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

    if (a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0) {
        cout << "Possible" << endl;
    } else {
        cout << "Impossible" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define fr(i,a,n) for(i=a;i<n;i++)
#define vll vector<ll>
#define pll pair<ll,ll>
#define vp vector<pll>
#define ub upper_bound
#define lb lower_bound
//#define map map<ll,ll>
#define mapp map<pll,int>
#define mem(x,y) memset(x,y,sizeof(x))
#define all(v) v.begin(),v.end()
#define bs binary_search
#define qll queue<ll>
#define sll set<ll>
 
ll t;
void fast(){cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);}
//ll power(ll x,ll y,ll p){ll res = 1;x = x % p;if(x == 0)return 0;while (y > 0){if (y & 1)res = (res*x) % p;y = y>>1;x = (x*x) % p;}return res;}

int main(){
    fast();
    ll a,b,n,ans=0,val=0;
    cin>>a>>b>>n;
     if(n>=b-1)
     {
        n=b-1;
        ans = a*n/b;
    val=n/b;
    ans=ans-a*val;
     }
  else
  {
    ans = a*n/b;
    val=n/b;
    ans=ans-a*val;
  }
    cout<<ans;
   

}


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

int main()
{
    int N, K;
    int p[1000];
    cin >> N >> K;
    for (int i = 0; i < N; i++)
    {
        cin >> p[i];
    }
    sort(p, p + N);
    int sum = 0;
    for (int i = 0; i < K; i++)
    {
        sum += p[i];
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3636
from collections import deque as dq
import sys
input = sys.stdin.readline


def main():
    n, m = map(int, input().split())
    lst = [[] for _ in range(n + 1)]
    ans = [0] * (n + 1)
    que = dq()
    for _ in range(m):
        a, b = map(int, input().split())
        lst[a].append(b)
        lst[b].append(a)

    limit = 10 ** 5
    d = {i: limit + 1 for i in range(1, n + 1)}
    d[1] = 0
    que.append(1)
    while que:
        visit = que.popleft()
        for next_v in lst[visit]:
            if d[next_v] > d[visit] + 1:
                d[next_v] = d[visit] + 1
                que.append(next_v)
                ans[next_v] = visit

    if all([i != 0 for i in ans[2:]]):
        print('Yes')
        print(*ans[2:], sep='\n')
    else:
        print('No')


if __name__ == '__main__':
    main()

Measured memory_bytes: 47336
#include<iostream>
#include<string>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
using namespace std;

string f(string s) {
  if (s[0] != 'A') return "WA";

  bool ok = false;
  rep(i,2,s.size()-2) {
    if (s[i] == 'C') {
      if (ok) {
        ok = false;
        break;
      } else {
        ok = true;
      }
    }
  }

  if (!ok) return "WA";

  for (char c:s) {
    if (c == 'A' || c == 'C') continue;
    if (c < 'a' || 'z' < c) return "WA";
  }

  return "AC";
}

int main() {
  string s;
  cin >> s;
  cout << f(s) << endl;
  return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
from collections import Counter


def read():
    N = int(input().strip())
    S = []
    for i in range(N):
        s = input().strip()
        S.append(s)
    return N, S


def solve(N, S):
    AC = "AC"
    WA = "WA"
    TLE = "TLE"
    RE = "RE"
    D = Counter(S)
    print(AC , "x", D[AC])
    print(WA , "x", D[WA])
    print(TLE , "x", D[TLE])
    print(RE , "x", D[RE])


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


Measured memory_bytes: 16612
N = int(input())
a = list(map(int, input().split()))

color = []
another = 0
for i in range(N):
  if a[i] <= 399: color.append("gray")
  elif a[i] <= 799: color.append("brown")
  elif a[i] <= 1199: color.append("green")
  elif a[i] <= 1599: color.append("wblue")
  elif a[i] <= 1999: color.append("blue")
  elif a[i] <= 2399: color.append("yellow")
  elif a[i] <= 2799: color.append("orange")
  elif a[i] <= 3199: color.append("red")
  else: another +=1
color = list(set(color))
ans = len(color)
if ans == 0 and another > 0:
  ans = 1
print(ans, len(color) + another)

Measured memory_bytes: 3064
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))

    ans = 0
    tmp = -100
    for a in A:
        ans += B[a-1]
        if a - tmp == 1:
            ans += C[tmp-1]
        
        tmp = a

    print(ans)


main()

Measured memory_bytes: 38484
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <utility>
#include <functional>

using namespace std;

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

	if (a[a.size() - 1] == b[0] && b[b.size() - 1] == c[0])
		cout << "YES\n";
	else
		cout << "NO\n";

	return 0;
}

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

using namespace std;

typedef complex<double> xy_t;
xy_t P[110];

int main (){
	int N;
	cin >> N;
	double x, y;
	int i = 0;
	while (i < N){
		cin >> x >> y;
		P[i++] = xy_t(x,y);
	}
	double sum = 0.0;
	for(int i = 0; i < N - 2; i++){
		xy_t a = P[0], b = P[(i+1) % N] , c = P[(i+2) % N];	
		sum += ((b.real()-a.real())*(c.imag()-a.imag()) - (b.imag()-a.imag())*(c.real()-a.real()));
	}
	printf("%.1f\n" , abs(sum)/2);
}

Measured memory_bytes: 1240
#include <iostream>

using namespace std;

int main(){
    int n;
    int v[50], c[50];

    cin >> n;
    for(int i=0; i<n; ++i) cin >> v[i];
    for(int i=0; i<n; ++i) cin >> c[i];

    int ans = 0;
    for(int i=0; i<n; ++i){
        int tmp = v[i] - c[i];
        if(tmp > 0){
            ans += tmp;
        }
    }
    cout << ans << endl;

    return 0;
}

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

using namespace std;

#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pow(x) x*x
#define ll long long

static const ll MAX = 1000000;
static const ll INFTY = 1e12;
static const ll MOD = 1000000007;

template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };

struct edge {
    ll to, cost;
};

using Graph = vector<vector<int>>;
using _Graph = vector<vector<edge>>;


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

// 深さ優先探索
vector<bool> seen;
vector<int> colors;

int H, W, N;
int sx, sy, gx, gy; 
vector<vector<char>> field;
vector<vector<int>> dist;
//vector<pair<int, int>> gx, gy;
deque<pair<int, int>> que;

typedef vector<vector<int> > Matrix;

const ll INF = 1e18;


int main() {

    ll N, X;
    cin >> N >> X;
    vector<ll> x(N);
    REP(i, N)cin >> x[i];
    x.push_back(X);
    sort(x.begin(), x.end());
    vector<ll> diff(N);
    REP(i, N){
        diff[i] = x[i+1]-x[i];
    }
    ll ans = diff[0];
    REP(i, N-1){
        ans = __gcd(ans, diff[i+1]);
    }

    cout << ans << endl;
 

}

/*
みんな、くるくるぱーにな〜れ
　∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/



Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
int main()
{
	 double res;
	int n;
	cin>>n;
	res=2.0*n*4*atan(1);
	printf("%.20lf\n",res);
	
	
	
	
	
	
	
	return 0;
}

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

using namespace std;

int n,k;
int a[200002];
int main() {
  cin >> n >> k;

  int j = 0;
  for(int i = 0; i < n; i++) {
    int s;
    cin >> s;
    if(a[s] == 0) j++;
    a[s]++;
  }

  sort(a,a+n+1);

  int ans = 0;

  int i = 0;
  while(j > k) {
    while(a[i] == 0) i++;
    ans += a[i];
    a[i] = 0;
    j--;
  }

  cout << ans << endl;
}
    
  


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

int main(int argc, char const *argv[])
{
    string num;
    cin>>num;
    int ans=0;
    
    if (num[0]=='1') {
        ans+=1;
    }
    if (num[1]=='1') {
        ans+=1;
    }
    if (num[2]=='1') {
        ans+=1;
    }
    cout<<ans<<endl;

    
    
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30)
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007
//ここから編集する


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

    int N;
    cin >> N;
    bitset<5000000> bits,tmp;

    bits.set(0);

    vector<int> v(N);
    int sum = 0;
    rep(i,0,N){
        cin >> v[i];
        sum += v[i];
    }
    rep(i,0,N){
        bits |= (bits << v[i]);
    }


    set<int> si;
    rep(i,0,sum+1){
        if(bits[i]){
           si.insert(i);
        }
    }
    cout << *si.lower_bound(sum/2 + sum % 2) <<endl;

    return 0;
}


Measured memory_bytes: 95232
#include <stdio.h>
#include <string.h>

int main() {

    int i;
    char s[100];
    int n;

    scanf("%s", s);
    n = strlen(s);

    for(i = 0; i < n / 2; i++) {
        if(s[i] != s[n-i-1]) {
            printf("No\n");
            return 0;
        }
    }
    for(i = 0; i < n / 4; i++) {
        if(s[i] != s[n/2-i-1]) {
            printf("No\n");
            return 0;
        }
    }

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

Measured memory_bytes: 128
import java.util.Scanner;

public class Main{
 public static void main(String[] args){
 Scanner sc = new Scanner(System.in);
 for(int i=1;;i++){
 int x = sc.nextInt();
 if(x==0){
 break;
}
 System.out.printf("Case %d: %d\n",i,x);
}
}
}

Measured memory_bytes: 66924
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author HossamDoma
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {


            int n = in.nextInt();
            int m = in.nextInt();

            int[][] a = new int[n][m];

            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < m; ++j) {
                    a[i][j] = in.nextInt();
                }
            }

            int bst = n;

            int[] nxt = new int[n];
            int[] sports = new int[m + 1];
            boolean[] blocked = new boolean[m + 1];

            myloop:
            while (true) {

                int mx_sport = 0;

                for (int i = 0; i < n; ++i) {
                    int x = nxt[i];
                    while (x < m && blocked[a[i][x]]) x++;
                    if (x >= m) break;
                    nxt[i] = x;
                    mx_sport = Math.max(++sports[a[i][nxt[i]]], mx_sport);
                }

                for (int i = 0; i < n; ++i) {
                    if (sports[a[i][nxt[i]]] == mx_sport) {
                        blocked[a[i][nxt[i]]] = true;
                    }
                }

                Arrays.fill(sports, 0);

                if (mx_sport > 0)
                    bst = Math.min(mx_sport, bst);
                else
                    break;
            }

            out.println(bst);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 32492
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <iomanip>

using namespace std;


double polygon[20][2];

double area(double a, double b, double c){
    double z = (a+b+c)/2;
    double s = sqrt(z*(z-a)*(z-b)*(z-c));
    return s;
}
double l(double x1, double y1, double x2, double y2){
    return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

int main(void)
{
    int n=0;
    double s=0.0;
    while(scanf("%lf,%lf",&polygon[n][0],&polygon[n][1]) != EOF){
        if(n>=2){
            double a,b,c;
            a=l(polygon[0][0], polygon[0][1], polygon[n][0], polygon[n][1]);
            b=l(polygon[0][0], polygon[0][1], polygon[n-1][0], polygon[n-1][1]);
            c=l(polygon[n-1][0], polygon[n-1][1], polygon[n][0], polygon[n][1]);
            s+=area(a,b,c);
        }
        n++;
    }
    
    cout<<setprecision(8)<<s<<endl;

    
}

Measured memory_bytes: 1288
import * as fs from 'fs';

//in
//
//out
//
const main = (inp: string) => {
    const [s, t]: string[] = inp.split('\n').map(String);
    let ans: number = 0;
    for (let i: number = 0; i < 3; i++) {
        if (s[i] === t[i]) {
            ans++;
        }
    }
    console.log(ans);
};

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

Measured memory_bytes: 7372
import java.util.*;


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

		int[] numArray = new int[n];

		for(int i = 0; i < n; i++){
			numArray[i] = sc.nextInt();
        }

        Arrays.sort(numArray);
        double value = (numArray[0] + numArray[1]) / 2.0;
        for(int i = 2; i < n; i++){
            value = (value + numArray[i]) / 2.0;
        }

        System.out.println(value);

	}
}

Measured memory_bytes: 23764