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

typedef long long ll;

using namespace std;

#define swap(a, b)    do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while(0)
#define repd(i, a, b) for(typeof(b) i = a; i < (b); ++i)
#define rep(i, n)     repd(i, 0, n)
#define dump(x)       cerr << #x << " = " << (x) << endl
#define debug(x)      cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl
#define YesNo(x) cout << ((x) ? "Yes" : "No") << endl
#define YESNO(x) cout << ((x) ? "YES" : "NO") << endl
#define absi(a) (((a) >= 0) ? (a) : (-(a))) 

struct city {
	ll p;
	ll y;
	ll n;
	ll x;
};

bool f(city a, city b) {
	if(a.p == b.p) {
		return a.y < b.y;
	} else {
		return a.p < b.p;
	}
}

bool g(city a, city b) {
	return a.n < b.n;
}

int main(int argc, const char* argv[]) {
	ll n, m;
	cin >> n >> m;

	vector<city> a(m);

	rep(i, m) {
		cin >> a[i].p >> a[i].y;
		a[i].n = i;
	}

	sort(a.begin(), a.end(), f);

	ll prevp = 0;
	ll prevx = 0;
	rep(i, m) {
		if(a[i].p == prevp) {
			a[i].x = ++prevx;
		} else {
			a[i].x = prevx = 1;
			prevp = a[i].p;
		}
	}
	
	sort(a.begin(), a.end(), g);

	rep(i, m) {
		cout << setw(6) << setfill('0') << a[i].p << setw(6) << setfill('0') << a[i].x << endl;
	}


	return 0;
}


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

int main() {
  vector<int> xs(3);
  for (auto& x : xs) cin >> x;
  sort(xs.begin(), xs.end());
  for (int i = 1; i < xs.size(); ++i) {
    if (xs[i - 1] == xs[i])
      xs[i - 1] = xs[i] = -101;
  }
  for (const auto& x : xs) {
    if (x != -101)
      cout << x << endl;
  }
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    string S;
    cin >> S;
    ll M = 2019;
    ll amari = 0;
    vector<int> mods(S.size());
    ll keta = 1;
    map<int, ll> mp;
    ll res = 0;
    mp[0]++;
    for(int i = S.size() - 1; i >= 0; i--) {
        amari += keta * (S[i] - '0');
        amari %= M;
        keta = keta * 10 % M;
        mods[i] = amari;
        res += mp[amari];
        mp[amari]++;
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 4276
#include<stdio.h>
#include<stdlib.h>
#define nil NULL 
struct node{
  struct node *left;
  struct node *right;
  struct node *pmid;
  int key;
};
 
typedef struct node * Node;
 
Node root;
 
void DefPre(Node t){

  printf(" %d",t->key);
  if(t != nil){
    if(t->left != nil) DefPre(t->left);
    if(t->right != nil) DefPre(t->right);
  }
}
 
void DefIn(Node t){
   
  if(t != nil){
    if(t->left != nil){
      DefIn(t->left);
      }

    printf(" %d",t->key);
     
    if(t->right != nil){
      DefIn(t->right);
      }

  }

}
 
void Defin(int numk){
  Node y = nil;
  Node x = root;
  Node numz;
 
  numz = malloc(sizeof(struct node));
  numz->key = numk;
  numz->left = nil;
  numz->right = nil;
   
  while(x != nil){
    y = x;
 
    if(numz->key<x->key) x = x->left;
    else x = x->right;
  }
  numz->pmid = y;
   
  if(y == nil) root = numz;
  else if(numz->key<y->key) y->left = numz;
  else y->right = numz;
}
 
Node Search(Node numt,int numk){
  if(numt == nil || numk == numt->key) return numt;

  if(numk<numt->key) return Search(numt->left,numk);

  else return Search(numt->right,numk);
}
 
Node Minimum(Node numt){
  while(numt->left != nil){

    numt = numt->left;

  }
  return numt;
}
 
Node Successor(Node numt){
  if(numt->right != nil)return Minimum(numt->right);
  Node y = numt->pmid;
  while(y != nil && numt == y->right){
    numt = y;
    y = y->pmid;
  }
  return y;
}
 
void Delete(Node numz){

  Node numy;

  Node numx;
 
  if(numz->left == nil || numz->right == nil) 
    numy = numz;
  else numy = Successor(numz);
 
  if(numy->left!=nil) 
    numx = numy->left;
  else numx = numy->right;
 
  if(numx != nil)
    numx->pmid = numy->pmid;
 
  if(numy->pmid == nil)
    root = numx;
  else if(numy == numy->pmid->left)
    numy->pmid->left = numx;
  else 
    numy->pmid->right = numx;
 
  if(numy != numz)
    numz->key = numy->key;
}
 
 
int main(){
  int n, j, x;
  char array[20];
   
  scanf("%d",&n);
 
  for (j = 0; j < n; j++ ){
    scanf("%s",array);
 
    if(array[0]=='i'){

      scanf("%d",&x);

      Defin(x);
    } 
    else if(array[0]=='p'){
      DefIn(root);
      printf("\n");
       
      DefPre(root);
      printf("\n");
    }
    else if(array[0]=='f'){

      scanf("%d",&x);

      Node s=Search(root,x);

      if (s!= nil ) printf("yes\n");
      else printf("no\n");
    }
    else if(array[0]=='d'){

      scanf("%d",&x);

      Delete(Search(root, x));
    }
  }
  return 0;
}

Measured memory_bytes: 19364
/*input
20 100000
14309 -32939
-56855 100340
151364 25430
103789 -113141
147404 -136977
-37006 -30929
188810 -49557
13419 70401
-88280 165170
-196399 137941
-176527 -61904
46659 115261
-153551 114185
98784 -6820
94111 -86268
-30401 61477
-55056 7872
5901 -163796
138819 -185986
-69848 -96669
*/

// Nihesh Anderson - knandy

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; // find_by_order, order_of_key
ll MOD=1000000007;

#define endl '\n'
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
ll INF = 2000000000000000001;
long double EPS = 1e-9;
ll power(ll a, ll n, ll md){if(n==0){return 1;}else{ll res=power(a,n/2,md);res=(res*res)%md;if(n%2!=0){res=(res*a)%md;}return res;}}
random_device rndm;
mt19937 grndm(rndm());
void mix(ll* a, ll* b){shuffle(a,b,grndm);}

int main(){
	fast_cin();
	// freopen("input.in","r",stdin);
	// freopen("output.out","w",stdout);
	ll n, d; cin >> n >> d;
	d = d * d;
	ll cnt = 0;
	for(ll i = 0; i < n; i++) {
		ll x, y; cin >> x >> y;
		if(x * x + y * y <= d) {
			cnt++;
		}
	}
	cout << cnt << endl;
	return 0;
}




















Measured memory_bytes: 3656
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main() {
	int n,a=1,b=1,c=1;
	fscanf(stdin,"%d", &n);
	while (n >= 2) {
		c = a + b;
		a = b;
		b = c;
		n--;
	}
	fprintf(stdout,"%d\n",c);
	return 0;
}

Measured memory_bytes: 600
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

constexpr int cm = 1<<17;
char cn[cm], *ci = cn + cm, ct;

inline char readchar() {
	if (ci - cn == cm) {
    fread(cn, 1, cm, stdin); 
    ci = cn;
  }
	return *ci++;
}
inline int readint() {
	int ret = 0;
	if (ci - cn + 16 > cm) {
    while ((ct = readchar()) >= '0') {
      ret = (ret<<3) + (ret<<1) + ct - '0';
    }
  } else {
    while ((ct = *ci++) >= '0') {
      ret = (ret<<3) + (ret<<1) + ct - '0';
    }
  }
	return ret;
}

int cnt[202020];
template<typename T> void fastout(T &n) {
  T N = n, rev, count = 0;
  rev = N;
  if (N == 0) {
    putchar_unlocked('0');
    putchar_unlocked('\n');
    return;
  }
  while ((rev % 10) == 0) { 
    ++count; rev /= 10;
  }
  rev = 0;
  while (N != 0) { 
    rev = (rev << 3) + (rev << 1) + N % 10;
    N /= 10;
  }
  while (rev != 0) { 
    putchar_unlocked(rev % 10 + '0');
    rev /= 10;
  }
  while (count--) putchar_unlocked('0');
  putchar_unlocked('\n');
}
int main(){;
  int n = readint(); int k = readint();
  
  for (int i = 0; i < n; ++i) {
    int x = readint();
    ++cnt[x];
  }

  sort(cnt, cnt + n + 1 , greater<int>());

  n -= accumulate(cnt, cnt + k, int());

  fastout(n);

  return 0;
}


Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

ll N, cnt[26];
string s;

int main(){
    cin >> s; N = s.size();

    for(char c : s) cnt[c-'a']++;

    ll ans = N * (N-1) / 2 + 1;
    for(ll d : cnt) ans -= d * (d-1) / 2;

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


Measured memory_bytes: 640
#include<iostream>
using namespace std;
using lint = long long;
int main(){
  lint N,T; cin>>N>>T;
  lint ans=N*T,ol=0,pt=0;
  for(int i=0;i<N;i++){
    lint t; cin>>t;
    if(t-pt<T) ol+=T-(t-pt);
    pt=t;
  }
  cout<<ans-ol+T<<endl;  
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int Q = sc.nextInt();
		long s[] = new long[A];
		long t[] = new long[B];
		long x[] = new long[Q];
		
		for(int i = 0; i < A; i++) {
			s[i] = sc.nextLong();
		}
		for(int i = 0; i < B; i++) {
			t[i] = sc.nextLong();
		}
		
		for(int i = 0; i < Q; i++) {
			x[i] = sc.nextLong();
			int su = lowerbound(s, x[i]);
			if(su >= A) su = A - 1;
			int sd = Math.max(su - 1, 0);
			int tu = lowerbound(t, x[i]);
			if(tu >= B) tu = B - 1;
			int td = Math.max(tu - 1, 0);
			long min = Long.MAX_VALUE;
			min = Math.min(min, Math.abs(x[i] - s[sd]) + Math.abs(s[sd] - t[td]));
			min = Math.min(min, Math.abs(x[i] - s[sd]) + Math.abs(s[sd] - t[tu]));
			min = Math.min(min, Math.abs(s[su] - x[i]) + Math.abs(s[su] - t[td]));
			min = Math.min(min, Math.abs(s[su] - x[i]) + Math.abs(s[su] - t[tu]));
			min = Math.min(min, Math.abs(x[i] - t[td]) + Math.abs(t[td] - s[sd]));
			min = Math.min(min, Math.abs(x[i] - t[td]) + Math.abs(t[td] - s[su]));
			min = Math.min(min, Math.abs(t[tu] - x[i]) + Math.abs(t[tu] - s[sd]));
			min = Math.min(min, Math.abs(t[tu] - x[i]) + Math.abs(t[tu] - s[su]));
			System.out.println(min);
		}
	}
	
public static int upperbound(long[] a, long v){ return upperbound(a, 0, a.length, v + 1); }
    public static int upperbound(long[] a, int l, int r, long v)
    {
        if(l > r || l < 0 || r > a.length)throw new IllegalArgumentException();
        int low = l-1, high = r;
        while(high-low > 1){
            int h = high+low>>>1;
            if(a[h] >= v){
                high = h;
            }else{
                low = h;
            }
        }
        return low;
    }
    
public static int lowerbound(long[] a, long v){ return lowerbound(a, 0, a.length, v - 1); }
    public static int lowerbound(long[] a, int l, int r, long v)
    {
        if(l > r || l < 0 || r > a.length)throw new IllegalArgumentException();
        int low = l-1, high = r;
        while(high-low > 1){
            int h = high+low>>>1;
            if(a[h] <= v){
                low = h;
            }else{
                high = h;
            }
        }
        return high;
    }
}


Measured memory_bytes: 101188
while True:
  try:
    lst = list(map(int, input().split(",")))
    v2 = lst.pop()
    v1 = lst.pop()

    cum_sum = [0]
    acc = 0

    for l in lst:
      acc += l
      cum_sum.append(acc)

    cross = acc * v1 / (v1 + v2)

    for i in range(1, 11):
      if cross <= cum_sum[i]:
        print(i)
        break

  except EOFError:
    break


Measured memory_bytes: 5600
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int main(void){
   string a, b;
   int c;
   cin >> a >> b;
   a += b;
   c = stoi(a);
   if((int)sqrt(c) * (int)sqrt(c) == c) cout<<"Yes";
   else cout<< "No";
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;
//https://qiita.com/tubo28/items/e6076e9040da57368845
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n: usize = read();
    let mut a: Vec<u64> = (0..n).map(|_| read()).collect();
    a.sort();

    let mut x = 0;
    let mut size = a[0];
    for i in 1..n {
        if size * 2 < a[i] {
            x = i;
        }
        size += a[i];
    }
    println!("{}", n - x);
}


Measured memory_bytes: 3036
#define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <set>
#include <array>
#include <stdio.h>
#include <string.h>
#include <random>
using ll = long long;
using ull = unsigned long long;
using namespace std;
#define int long long
#define CONTAINS_VEC(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define ARY_REVERSE(v,a) (reverse((v), (v)+(a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define REPE(i, n) for (int (i)=0; (i) <= (n); (i)++)
#define CONTAINS_MAP(m, a) ((m).find((a)) != m.end())
#define CONTAINS_SET(m, a) ((m).find((a)) != m.end())
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }


signed main()
{
	int x, y, z;
	cin >> x >> y >> z;

	int n = x - z;
	cout << (n / (y + z)) << endl;
}



Measured memory_bytes: 3532
#include<bits/stdc++.h>
#define MAX 10005
using namespace std;
 
int main(){
  int d, g, p[10], c[10], i, j, ans = 1005, cnt, scr, b;
  scanf("%d%d", &d, &g);
  g /= 100;
  for(i = 0; i < d; i++){
    scanf("%d%d", &p[i], &c[i]);
    c[i] /= 100;
  }
  for(i = 0; i < 1<<d; i++){
    cnt = 0; scr = 0; b = 0;
    for(j = 0; j < d; j++){
      if(i&(1<<j)){
        scr += (j+1)*p[j] + c[j];
        cnt += p[j];
      }else b = j;
    }
    if(scr < g){
      if(scr + (b+1)*(p[b]-1) < g) continue;
      cnt += (g - scr - 1) / (b+1) +1;
    }
    ans = min(cnt, ans);
  }
  printf("%d\n", ans);
}

Measured memory_bytes: 256
n = int(input())
f = [list(input().split()) for _ in range(n)]
p = [list(map(int, input().split())) for _ in range(n)]

result = []
for i in range(1, 2**10):
    b = format(i, "010b")
    r = 0
    for j in range(n):
        c = [1 for I in range(10) if b[I]==f[j][I]=="1"]
        r += p[j][len(c)]
    result.append(r)
print(max(result))

Measured memory_bytes: 3064
X = [list(map(int, input().split())) for j in range(3)]
N = int(input())
b = []
for i in range(N):
    b.append(int(input()))

lis_bingo = (
    [X[0], X[1], X[2], 
    [X[0][0], X[1][0], X[2][0]], 
    [X[0][1], X[1][1], X[2][1]], 
    [X[0][2], X[1][2], X[2][2]], 
    [X[0][0], X[1][1], X[2][2]], 
    [X[0][2], X[1][1], X[2][0]]]
)

n = 0
while n <= 7:
    ans_bool = set(lis_bingo[n]) <= set(b)
    if ans_bool:
        break
    n += 1

if ans_bool:
    print('Yes')
else :
    print("No")


Measured memory_bytes: 3064
#include<iostream>
#include<vector>
using namespace std;
typedef pair<int,int> P;
int main(){
	int n,k;
	cin >> n>> k;
	string s;
	cin >> s;
	vector<P> num;
	int zsize=0;
	for(int i=0;i<n;i++){
		int j=i;
		while(s[i]==s[j]) j++;
		if(s[i]=='0') {
			num.push_back(P(j-i,0));
			zsize++;
		}
		else num.push_back(P(j-i,1));
		i=j-1;
	}
	if(zsize<=k){
		cout << n << endl;
		return 0;
	}
	int ans=0;
	int cur=0;
	int index=0;
	for(P v:num){
		if(v.second==0) cur++;
		if(cur==k+1) break;
		ans+=v.first;
		index++;
	}
	int pretmp=ans;
	cur=0;
	while(index<num.size()){
		int tmp=pretmp;
		tmp+=num[index].first;
		index++;
		if(index<num.size()){
			tmp+=num[index].first;
			index++;
		}
		if(num[cur].second==1) tmp-=num[cur].first,cur++;
		tmp-=num[cur].first,cur++;
		ans=max(ans,tmp);
		pretmp=tmp;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1528
#include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <queue>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <cstdio>
#include <complex>
#include <cstdint>
#include <tuple>

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

const int N = 2005;

LL dp[N][N];
LL dw[2 * N][N];
LL db[2 * N][N];
char c[2 * N][2];
int a[2 * N];
int bidx[N];
int widx[N];

int main() {
	int n;
	scanf("%d", &n);
	int b = 0, w = 0;
	REP(i, 2 * n) {
		scanf("%s%d", c[i], &a[i]);
		if (c[i][0] == 'B')bidx[a[i]] = i;
		else widx[a[i]] = i;
	}
	REP(i, 2 * n) {
		REP(j, n) {
			db[i + 1][j] = db[i][j] + ((a[i] > j) && (c[i][0] == 'B'));
			dw[i + 1][j] = dw[i][j] + ((a[i] > j) && (c[i][0] == 'W'));
		}
	}
	memset(dp, 0x7f, sizeof(dp));
	dp[0][0] = 0;
	REP(i, n + 1) {
		REP(j, n + 1) {
			if (i != 0) dp[i][j] = min(dp[i][j], dp[i - 1][j] + db[bidx[i]][i] + dw[bidx[i]][j]);
			if (j != 0) dp[i][j] = min(dp[i][j], dp[i][j-1] + db[widx[j]][i] + dw[widx[j]][j]);
		}
	}
	cout << dp[n][n] << endl;
	return 0;
}

Measured memory_bytes: 157312
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define debug(x) cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl
#define YN(x) cout << ((x) ? "YES" : "NO") << endl
#define Yn(x) cout << ((x) ? "Yes" : "No") << endl
#define yn(x) cout << ((x) ? "yes" : "no") << endl
#define absi(x) (((x) >= 0) ? (x) : (-(x)))
#define debugvec(v)                                                            \
    rep(i, v.size()) cerr << "L" << __LINE__ << ": " << #v << "[" << i         \
                          << "] = " << v[i] << endl;
#define debugvec2(v)                                                           \
    cerr << "L" << __LINE__ << ": " << #v << " = { ";                          \
    rep(i, v.size()) cerr << v[i] << (i + 1 == v.size() ? "" : ", ");          \
    cerr << " }" << endl;
typedef long long ll; // 10^18 くらいまでいける

// for DP
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;

int main() {

    int n;
    cin >> n;

    vector<int> a(n);
    rep(i, n) cin >> a[i];

    for(int i = 0; i < n; i++) {
        if(a[i] % 2 == 0) {
            if(a[i] % 3 == 0 || a[i] % 5 == 0) {
                continue;
            } else {
                cout << "DENIED" << endl;
                return 0;
            }
        }
    }

    cout << "APPROVED" << endl;

    return 0;
}


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

using namespace std;

int main(void){
    double w, h, x, y;
    cin >> w >> h >> x >> y;
    double ans = w * h * 0.5;
    cout << fixed << setprecision(10) << ans << " ";
    if(x == w/2 && y == h / 2){
        cout << 1 << endl;
    }else{
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<deque>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#include<regex>
#include<bitset>
#include<complex>
#include<chrono>
#include<random>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

ll gcd(ll n, ll m) {
	ll tmp;
	while (m!=0) {
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m) {
	return abs(n * m) / gcd(n, m);//gl=xy
}
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
using namespace std;
//ここから

void solve(){
  int n;
  cin>>n;
  vector<int>p(n);
  rep(i,n)cin>>p[i];
  vector<int>v;
  rep(i,n){
    if(i+1==p[i])v.pb(i);
  }
  int m=v.size();
  int ans=0;
  rep(i,m){
    ++ans;
    if(i<m-1&&v[i]+1==v[i+1])i++;
  }
  cout<<ans;
}

int main(){
	ios::sync_with_stdio(false);
  cin.tie(0);
	cout<<fixed<<setprecision(15);
  solve();
	return 0;
}


Measured memory_bytes: 1276
n,m=[int(x) for x in input().split()]
right=[0]*(n+1)
wrong=[0]*(n+1)
d=dict()
pnt=0
crt=0
for i in range(0,m):
    a,v=[x for x in input().split()]
    a=int(a)
    if right[a]==0:
        if v=='AC':
            right[a]=1
            pnt+=wrong[a]
            crt+=1
        else:
            wrong[a]+=1

print(crt,pnt)
    


Measured memory_bytes: 4596
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*float n乗*/ll floatpow(float x,ll n){ll i;float ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
double ans=0;llfor;///////////////////////////////////////////////////////////
int main(){
 char s[1000010];sc(s);
 ll len=strlen(s);
 char ans1[1000010] ="KIHABARA";
 char ans2[1000010] ="AKIHBARA";
 char ans3[1000010] ="AKIHABRA";
 char ans4[1000010] ="AKIHABAR";
 char ans5[1000010] ="KIHBARA";
 char ans6[1000010] ="KIHABRA";
 char ans7[1000010] ="KIHABAR";
 char ans8[1000010] ="AKIHBRA";
 char ans9[1000010] ="AKIHBAR";
 char ans10[1000010]="AKIHABR";
 char ans11[1000010]="AKIHABARA";
 char ans12[1000010]="KIHBRA";
 char ans13[1000010]="KIHBAR";
 char ans14[1000010]="KIHABR";
 char ans15[1000010]="AKIHBR";
 char ans16[1000010]="KIHBR";
 if(!strcmp(ans1,s)){pY;return 0;}
 if(!strcmp(ans2,s)){pY;return 0;}
 if(!strcmp(ans3,s)){pY;return 0;}
 if(!strcmp(ans4,s)){pY;return 0;}
 if(!strcmp(ans5,s)){pY;return 0;}
 if(!strcmp(ans6,s)){pY;return 0;}
 if(!strcmp(ans7,s)){pY;return 0;}
 if(!strcmp(ans8,s)){pY;return 0;}
 if(!strcmp(ans9,s)){pY;return 0;}
 if(!strcmp(ans10,s)){pY;return 0;}
 if(!strcmp(ans11,s)){pY;return 0;}
 if(!strcmp(ans12,s)){pY;return 0;}
 if(!strcmp(ans13,s)){pY;return 0;}
 if(!strcmp(ans14,s)){pY;return 0;}
 if(!strcmp(ans15,s)){pY;return 0;}
 if(!strcmp(ans16,s)){pY;return 0;}
 pN;
return 0;}

Measured memory_bytes: 19216
/* basic header */
#include <bits/stdc++.h>
/* define */
#define ll long long
#define pb emplace_back
#define mp make_pair
#define eps 1e-8
#define lson (curpos<<1)
#define rson (curpos<<1|1)
/* namespace */
using namespace std;
/* header end */

int n, k;

int main() {
    cin >> n >> k;
    int ans = 0;
    while (n) {
        ans++;
        n /= k;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FAST       			ios_base :: sync_with_stdio(false); cin.tie(NULL);

int main() {
  FAST;
  int A, B;
  cin >> A >> B;
  int result = -1;
  for (int i = 1; i < 10000; i++) {
    if (i * 8 / 100 == A && i / 10 == B) {
      result = i;
      break;
    }
  }
  cout << result << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3

import itertools
import numpy as np

h, w, k = list(map(int, input().split()))

c = [list(str(input())) for _ in range(h)]
# print(c)

c = np.array(c)

ans = 0
for h_flag in itertools.product([0, 1], repeat=h):
    h_flag = [i for i, j in enumerate(h_flag) if j == 1]
    for w_flag in itertools.product([0, 1], repeat=w):
        w_flag = [i for i, j in enumerate(w_flag) if j == 1]
        # print()
        c_ = c[:]
        c_ = np.take(c_, h_flag, axis=0)
        # print(c_)
        c_ = np.take(c_, w_flag, axis=1)
        # print(c_)

        if np.sum(c_ == "#") == k:
            ans += 1

print(ans)


Measured memory_bytes: 27200
n, m = map(int, input().split())
h = list(map(int, input().split()))
ki = [[] for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    ki[a-1].append(b-1)
    ki[b-1].append(a-1)

ans = 0
for i in range(len(ki)):
    if len(ki[i]) == 0:
        ans += 1
    else:
        ans1 = 0
        for j in range(len(ki[i])):
            if h[i] > h[ki[i][j]]:
                ans1 += 1
                if ans1 == len(ki[i]):
                    ans += 1
                
print(ans)

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};

int main()
{
  string s;
  ll k;
  cin >> s >> k;
  int n = s.size();

  rep(i, n-1) {
    if(s[i] == 'a') continue;
    int d = 'z'-s[i]+1;
    if(d <= k) {
      s[i] = 'a';
      k -= d;
    }
  }
  int last = s[n-1]-'a';
  last += k%26;
  last %= 26;
  s[n-1] = 'a'+last;
  cout << s << endl;
}

Measured memory_bytes: 3640
fun main(args: Array<String>) {
    val chars = charArrayOf('M', 'A', 'R', 'C', 'H')
    val n = readLine()!!.toInt()
    val cm = hashMapOf<Char, Long>()
    repeat(n) {
        val c = readLine()!!.first()
        if (c in chars) cm[c] = (cm.getOrElse(c) {0L}) + 1L
    }
    if (cm.size < 3) {
        println(0)
        return
    }
    val cnt = cm.values.toList()
    var ans = 0L
    for (i in 0 until cnt.size - 2) {
        for (j in i + 1 until cnt.size - 1) {
            for (k in j + 1 until cnt.size) {
                ans += cnt[i] * cnt[j] * cnt[k]
            }
        }
    }
    println(ans)
}


Measured memory_bytes: 39652
#include<cstdio>
#include<cstring>
#include<algorithm>
#define maxn 200005
#define INF 2147483640
#define LL long long
using namespace std;
int n,sum,l[maxn],r[maxn],mx[maxn],sx[maxn],siz[maxn];
LL ans;
char s[maxn];
struct node { int v; node *nxt; } edge[maxn*2],*head[maxn],*ncnt;
void addedge(int u,int v)
{
	ncnt++;
	ncnt->v=v,ncnt->nxt=head[u];
	head[u]=ncnt;
}
void dfs1(int u,int fa)
{
	siz[u]=s[u]-'0';
	for(node *p=head[u];p;p=p->nxt)
	{
		int v=p->v;
		if(v==fa) continue;
		dfs1(v,u);
		siz[u]+=siz[v];
		if(mx[v]+1>mx[u]) sx[u]=mx[u],mx[u]=mx[v]+1;
		else if(mx[v]+1>sx[u]) sx[u]=mx[v]+1;
	}
}
void dfs2(int u,int fa,int len)
{
	r[u]=len>mx[u]?mx[u]:max(len,sx[u]);
	l[u]=s[u]-'0'?0:(sum-siz[u]?len:INF);
	if(fa)
	{
		if(len-1==mx[u]) ans++;
		else if(len-1<mx[u]) ans+=siz[u]<sum;
		else ans+=siz[u]>0;
	}
	for(node *p=head[u];p;p=p->nxt)
	{
		int v=p->v;
		if(v==fa) continue;
		if(siz[v]) l[u]=min(l[u],mx[v]+1);
		if(mx[u]==mx[v]+1) dfs2(v,u,max(len,sx[u])+1);
		else dfs2(v,u,max(len,mx[u])+1);
	}
}
int main()
{
	scanf("%d",&n);
	ncnt=&edge[0];
	for(int i=1;i<n;i++)
	{
		int u,v;
		scanf("%d%d",&u,&v);
		addedge(u,v); addedge(v,u);
	}
	scanf("%s",s+1);
	for(int i=1;i<=n;i++) sum+=s[i]-'0';
	dfs1(1,0); dfs2(1,0,0);
	for(int i=1;i<=n;i++)
		if(l[i]<=r[i]) ans+=1ll*(r[i]-l[i]+1);
	printf("%lld\n",ans);
}


Measured memory_bytes: 19200
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <ctime>

#define inf 0x3f3f3f3f
#define Inf 0x3FFFFFFFFFFFFFFFLL
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Rep(i, n) for (int i = 1; i <= (n); ++i)
#define clr(x, a) memset(x, (a), sizeof x)
using namespace std;
typedef long long ll;

int main() {
  char s[111];
  scanf("%s", s);
  int t =0 ;
  rep(i, 3) {
    if(s[i]=='A')t|=1;else t|=2;
  }
  if(t==3)puts("Yes");else puts("No");
  return 0;
}



Measured memory_bytes: 256
<?php
fscanf(STDIN,"%d",$n);
$w = explode(' ',trim(fgets(STDIN)));

$s = 0;
$min = 100000;
for ($i = 0; $i < $n; $i++) {
// var_dump($w[$i]);
$s += $w[$i];
$result = abs(array_sum($w)-$s*2);
$min = min($result,$min);
}
echo $min;


Measured memory_bytes: 4728
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long int ll;
typedef vector<int > vecint;
typedef vector<bool > vecbool;
typedef vector<string > vecstr;
typedef vector<vector<int > > vec2int;
typedef vector<vector<bool > > vec2bool;
int dx[4] {-1,+1, 0, 0};
int dy[4] { 0, 0,-1,+1};
int main()
{
  int n;
  cin >> n;
  vector<pair<int, int>> p(n) ;
  int x, l;
  REP(i,n){
    cin >> x >>l;
    p[i].first = x + l; 
    p[i].second = x - l; 
  }
  sort(all(p));
  // REP(i,n){
  //   cout << p[i].first << " " << p[i].second << endl;
  // }
  // cout << endl;
  int ans = 0;
  int t = -1e9;
  REP(i,n){
    if(t <= p[i].second){
      ans ++;
      t = p[i].first;
      // cout << t << endl;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 1024
#include <stdio.h>

int main(void){
    int n, m, x, a[100], i, fcount = 0, bcount = 0;
    
    scanf("%d %d %d", &n, &m, &x);
    for(i = 0; i<m; i++){
        scanf("%d", &a[i]);
    }
    
    for(i = 0; i<m; i++){
        if(a[i]>0 && a[i]<x){
            bcount++;
        }
        else{
            fcount++;
        }
    }
    if(fcount<=bcount){
        printf("%d\n", fcount);
    }
    else{
        printf("%d\n", bcount);
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
 
using namespace std;
 
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define vvi vector<vector<int> >
#define ss second
#define ff first
#define ll long long
#define mod (1000*1000*1000+7)
#define pq priority_queue< int >
#define endl '\n'
#define int ll
// #define gcd __gcd
#define popcount(x) __builtin_popcountll(x)
#define fill(x, y) memset(x, y, sizeof(x))
#define search(arr, c) binary_search(arr.begin(), arr.end(), c)
// default binary search returns a bool
 
// int dx[]={1,0,-1,0}; 
// int dy[]={0,1,0,-1}; //4 Direction 
 
// int dx[]={1,1,0,-1,-1,-1,0,1}; 
// int dy[]={0,1,1,1,0,-1,-1,-1};  // 8D

void solve(){

    int n , x, t;
    cin >> n >> x >> t;
    int temp = (n+x-1)/x;
    cout << t*temp << endl;
}

 
int32_t main(){

    #ifndef ONLINE_JUDGE 
  
    freopen("input.txt", "r", stdin); 
  
    // freopen("output.txt", "w", stdout); 
  
    #endif 
 
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cerr.tie(nullptr);
 
 
    int t = 1;
    // cin >> t;
    for (int tt = 0 ; tt < t ; tt++){
        
        // cout << "Case " << (tt+1) <<": " << endl;
        solve();
    }
    
}

Measured memory_bytes: 3608
// C.

#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <cstring>

using namespace std;
typedef long long LL;

int main(int argc, char *argv[])
{
	string s;
	cin >> s;
	int N = s.length();
	LL ans = 0;
	for (int i = 0; i < N; ++i) {
		LL a = 0;
		for (int j = 1; i + j <= N; ++j) {
			a = (a * 10) + s[i + j - 1] - '0';
			int b = max(0, i - 1) + max(0, N - i - j - 1);
			ans += a * (1 << b);
		}
	}
	cout << ans << endl;
	return 0;
}


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

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

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define int ll

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

  int N;
  cin>>N;
  vector<int>A(N),B(N);
  for(int i=0;i<N;i++)cin>>A[i];
  for(int i=0;i<N;i++)cin>>B[i];
  priority_queue<pii>q;
  for(int i=0;i<N;i++)q.push({B[i],i});
  int ans=0;
  while(q.size()){
    int num=q.top().first;
    int now=q.top().second;
    q.pop();
    int sum=0;
    if(B[now]==A[now])continue;
    if(now==0)sum=B[1]+B[N-1];
    else if(now==N-1)sum=B[0]+B[N-2];
    else sum=B[now-1]+B[now+1];
    int time=(B[now]-A[now])/sum;
    ans+=time;
    if(time==0){
      cout<<-1<<endl;
      return 0;
    }
    B[now]-=time*sum;
    if(A[now]!=B[now])q.push({B[now],now});
  }
  bool ok=true;
  for(int i=0;i<N;i++)if(A[i]!=B[i])ok=false;
  if(ok)cout<<ans<<endl;
  else cout<<-1<<endl;
  return 0;
}


Measured memory_bytes: 5620
#include <bits/stdc++.h>
using namespace	std;
int main() {
  int a, b;
  char op;
  cin >> a >> op >> b;
  if(op=='+') {
    cout << a+b	<< endl;
  }else{
    cout << a-b	<< endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <iostream>

using namespace std;

int main() {
    int N;
    cin >> N;
    int a[N];
    int count = 0;
    for(int i = 0; i < N; i++) {
        for(cin >> a[i]; (a[i] & 1) != 1  ;a[i] = a[i] >> 1){
            count++;
        }
    }
    cout << count <<endl;
    return 0;
}

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


#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}

// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
  long i,sq;
  if(a%2==0){ //偶数の場合
    factors.push_back(2);
    primeFactorization(a/2,factors); //2で割った値で再帰
    return;
  }
  sq = sqrt(a);
  for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
	if(a%i==0){
	  factors.push_back(i);
      primeFactorization(a/i,factors); //割れた値で再帰
      return;
	}
  }
  //偶数でも3以上√a以下の奇数の場合でも割り切れない場合
  if(a!=1){ //aが1でないなら、a自身は素数
    factors.push_back(a);
  }
}

// 円周率
// M_PI

// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;

// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;

signed main() {
  double r;
  cin >> r;
  
  cout << fixed << setprecision(10) << M_PI*r*2.0 << endl;
  
  return 0;
}

Measured memory_bytes: 3872
import java.util.*;

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

        //ArrayList<Integer> list = new ArrayList<Integer>();
        int dp[] = new int[3];
        
        for(int i=0;i<N;i++){
          if (i==0){
            dp[0] = sc.nextInt();
            dp[1] = sc.nextInt();
            dp[2] = sc.nextInt();
          }
          else{
            int a = sc.nextInt();
            int b = sc.nextInt();
            int c = sc.nextInt();
            int yesta = dp[0];
            int yestb = dp[1];
            int yestc = dp[2];
            dp[0] = Math.max(yestb+a,yestc+a);
            dp[1] = Math.max(yesta+b,yestc+b);
            dp[2] = Math.max(yesta+c,yestb+c);
          }
         
        }
        System.out.println(Math.max(Math.max(dp[0],dp[1]),dp[2]));
    }
}

Measured memory_bytes: 89588
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define mod 1000000007
#define MAX 1000000000000000
#define all(v) v.begin(),v.end()
#define rep(i,a,b) for(i=(ll)a;i<(ll)b;i++)
#define revrep(i,a,b) for(i=(ll)a;i>=(ll)b;i--)
#define ii pair<ll,ll>
#define MP make_pair
#define pb push_back
#define f first
#define se second
#define ll long long int
#define vi vector<ll>
ll modexp(ll a,ll b){ ll res = 1; while(b > 0){  if(b & 1) res = (res * a)%mod;  a = (a * a)%mod;  b/=2;  }  return res; }
#define rs resize
typedef tree< ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update > OST;
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 << endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

const ll N = 1e5 + 2;
ll i,n,k,q,a;
ll f[N];
int main()
{
    std::ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin>>n>>k>>q;
    rep(i,1,q + 1){
        cin>>a;
        f[a] += 1;
    }
    rep(i,1,n + 1) cout<<(k <= q - f[i] ? "No" : "Yes")<<endl; 
    return 0;
}

Measured memory_bytes: 1408
#include "bits/stdc++.h"
using namespace std;

int main() {
	int N, K, A[100];
	bool DP[100010] = {};
	cin >> N >> K;
	for (int i = 0; i < N; i++) cin >> A[i];
	for (int i = 1; i <= K; i++) {
		for (int j = 0; j < N; j++) {
			if (A[j] <= i) {
				if (!DP[i - A[j]]) DP[i] = true;
			}
		}
	}
	if (DP[K]) cout << "First" << endl;
	else cout << "Second" << endl;
}

Measured memory_bytes: 384
#pragma region Preparation
/* competitive programming */
#include "bits/stdc++.h"
using namespace std;

/* using */
// long
using ll = long long;
using ld = long double;
// vector
using vi = vector<int>;
using vd = vector<double>;
using vll = vector<ll>;
using vld = vector<ld>;
using vs = vector<string>;
using vi2 = vector<vector<int>>;
using vll2 = vector<vector<ll>>;

/* define */
// array
#define ari(x) array<int, x>
#define ard(x) array<double, x>
#define arll(x) array<ll, x>
#define arld(x) array<ld, x>
#define ars(x) array<string, x>
#define ari2(x, y) array<array<int, y>, x>
#define arll2(x, y) array<array<ll, y>, x>
// int -> ll
#define int ll // int -> ll
// push_back系
#define pb(x) push_back(x)    // push_back
#define eb(x) emplace_back(x) // emplace_back
// all range
#define all(x) x.begin(), x.end() // all_range
// gcd, lcm
#define gcd(x, y) __gcd(x, y)         // gcd
#define lcm(x, y) (x / gcd(x, y) * y) // lcm
// PI
#define PI M_PI // PI
// 大文字・小文字変換
#define cup(x) toupper(x)                                              // char_toupper
#define clow(x) tolower(x)                                             // char_tolower
#define strup(x) *transform(x.begin(), x.end(), x.begin(), ToUpper())  // string_toupper
#define strlow(x) *transform(x.begin(), x.end(), x.begin(), ToLower()) // string_tolower
// debug methods
// usage: debug(x,y);
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define debug_1(x1) cout << #x1 << ": " << x1 << endl
#define debug_2(x1, x2) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl
#define debug_3(x1, x2, x3) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << endl
#define debug_4(x1, x2, x3, x4) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << endl
#define debug_5(x1, x2, x3, x4, x5) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << ", " #x5 << ": " << x5 << endl
#ifdef _DEBUG
#define debug(...)                                                        \
    CHOOSE((__VA_ARGS__, debug_5, debug_4, debug_3, debug_2, debug_1, ~)) \
    (__VA_ARGS__)
#else
#define debug(...)
#endif

// 大文字・小文字変換
struct ToUpper
{
    char operator()(char c) { return toupper(c); }
};
struct ToLower
{
    char operator()(char c) { return tolower(c); }
};
#pragma endregion

#pragma region External variables
/* A・B問題用外部変数 */
ll a, b, c; // 基本変数
ll n, k;    // 範囲・長さ・整数用
ll L, R;    // 左、右
string s;   // 文字列用
#pragma endregion

/* main */
void Main(void)
{
    cin >> a;
    if (a == 1)
    {
        cout << 0 << endl;
    }
    else
    {
        cout << 1 << endl;
    }
}

#pragma region main
signed main(void)
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0LL;
}
#pragma endregion


Measured memory_bytes: 3664
from collections import Counter


def prime_factorize(n):
    b = 2
    fct = []
    while n >= b ** 2:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct


N, P = map(int, input().split())


prime_count_list = prime_factorize(P)

prime_count_dict = Counter(prime_count_list)


ans = 1
for p, k in prime_count_dict.items():
    ans *= (p ** int(k/N))

print(ans)


Measured memory_bytes: 3316
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}

	void solve() {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		sc.close();
		String res = "TBD";
		if(s.substring(5, 7).equals("04")||s.substring(5, 7).equals("03")
				||s.substring(5, 7).equals("02")||s.substring(5, 7).equals("01")) {
			res = "Heisei";
		}
		System.out.println(res);
	}
}



Measured memory_bytes: 22612
#include <bits/stdc++.h>
using namespace std;
signed main(){
	int a,b;
  	string s,t,u;
  	cin>>s;
  	cin>>t;
  	cin>>a>>b;
  	cin>>u;
  	if(s == u){
      a--;
    } 
  	if(t == u){
      b--;
    }
	cout<<a<<' '<<b<<endl;
  	return(0);
}

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

int h, w;

int main() {
	cin >> h >> w;
	string s[h];
	for (int i = 0; i < h; i++) {
		cin >> s[i];
	}
	vector<vector<int>> l(h, vector<int>(w)), r(h, vector<int>(w)), u(h,
			vector<int>(w)), d(h, vector<int>(w));

	for (int i = 0; i < h; i++) {
		for (int j = 1; j < w; j++)
			if (s[i][j - 1] == '.')
				l[i][j] = l[i][j - 1] + 1;

		for (int j = w - 2; j >= 0; j--)
			if (s[i][j + 1] == '.')
				r[i][j] = r[i][j + 1] + 1;

	}

	for (int j = 0; j < w; j++) {
		for (int i = 1; i < h; i++)
			if (s[i - 1][j] == '.')
				u[i][j] = u[i - 1][j] + 1;

		for (int i = h - 2; i >= 0; i--)
			if (s[i + 1][j] == '.')
				d[i][j] = d[i + 1][j] + 1;

	}

	int max = 0;
	for (int i = 0, num; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (s[i][j] == '.') {
				num = l[i][j] + r[i][j] + u[i][j] + d[i][j] + 1;
				if (num > max)
					max = num;
			}
		}
	}
	cout << max << endl;
}


Measured memory_bytes: 67200
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define INF INT_MAX
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
 #define int long long
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a * b / gcd(a, b);};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
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;};

bool IsPrime(int num){
  if (num < 2) return false;
  else if (num == 2) return true;
  else if (num % 2 == 0) return false;

  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}

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

  int n;
  cin >> n;
  int res = n;
  for(int i = 1; i <= sqrt(n) + 5; i++) {
    if(n % i == 0) {

      chmin(res, i + n / i - 2);
    }
  }
  cout << res << endl;
  return 0;
}


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

int gcd(int A, int B) {
  int a = A, b = B, r;
  while (b) {
    r = a % b; a = b; b = r;
  }
  return a;
}

long A, B;

long div_n(long d) {
  return B/d - (A-1)/d;
}

int main() {
  int C, D; cin >> A >> B >> C >> D;
  cout <<
    div_n(1) - div_n(C) -
    div_n(D) + div_n((long)C*D/gcd(C,D)) << endl;
}

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

int main(void){
	int D;
	std::string N;
	std::cin>>D>>N;

	if(N == "100"){
		N = "101";
	}

	for(int i=0;i<D;i++){
		N = N + "00";
	}

	std::cout<<N<<std::endl;
	return 0;
}


Measured memory_bytes: 256