akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define INF 1<<30
#define endl '\n'
#define maxn 100005
#define tc printf("Case %d: ", cs)
#define tcn printf("Case %d:\n", cs);
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
typedef long long ll;
const double PI = acos(-1.0);
#define dbg(x) cerr << #x << " = " << x << endl;
#define dbg2(x, y) cerr << #x << " = " << x << ", " << #y << " = " << y << endl;
#define dbg3(x, y, z) cerr << #x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;
#define dbg4(w,x, y, z) cerr << #w << " = " << w << ", " <<#x << " = " << x << ", " << #y << " = " << y << ", " << #z << " = " << z << endl;

double dp[310][310][310];

int sushi[4];
int N;

double solve(int a, int b, int c)
{
    if (a + b + c == 0) return 0.0;
    if (dp[a][b][c] > -0.5) return dp[a][b][c];

    double ks = (double) N / (a + b + c);
    double ret = 0.0;

    if (a) ret += (solve(a - 1, b, c) + ks) * a / (a + b + c);
    if (b) ret += (solve(a + 1, b - 1, c) + ks) * b / (a + b + c);
    if (c) ret += (solve(a, b + 1, c - 1) + ks) * c / (a + b + c);

    return dp[a][b][c] = ret;
}

int main()
{
    //FASTIO
    /*
    //double start_time = clock();
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif
//*/
    int n;
    scanf("%d", &n);
    N = n;
    for (int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        sushi[x]++;
    }

    for (int i = 0; i <= n; i++)
        for (int j = 0; j <= n; j++)
            for (int k = 0; k <= n; k++)
                dp[i][j][k] = -1;

    double ans = solve(sushi[1], sushi[2], sushi[3]);
    printf("%.12lf\n", ans);

    //double end_time = clock();
    //printf( "Time = %lf ms\n", ( (end_time - start_time) / CLOCKS_PER_SEC)*1000);
    return 0;
}

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

int main(){
  int A,B; cin >>A>>B;
  
  int ans;
  if(A>=13){
    ans = B;
  }else if(5<A && A<13){
    ans = B/2;
  }else{
    ans = 0;
  }
  
  cout << ans <<endl;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
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;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> l_l;
typedef pair<int,int> i_i;
const ll MOD=1e9+7;
const int INF=1<<30;

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

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

ll cnt2(ll num){
  ll cnt=0;
  while(num%2==0){
    num/=2;
    cnt++;
  }
  return cnt;
}

int main(){
  ll N; cin >> N;
  ll M; cin >> M;
  vector<ll> v(N);
  ll x; cin >> x;
  ll res=cnt2(x);
  v[0]=(x>>res);
  for(int i=1;i<N;i++){
    ll y; cin >> y;
    if(cnt2(y)!=res){
      cout << 0 << endl;
      return 0;
    }
    else{
      v[i]=(y>>res);
    }
  }
  ll LCM=1;
  rep(i,N){
    LCM=lcm(LCM,v[i]);
    if(LCM>M){
      cout << 0 << endl;
      return 0;
    }
  }
  ll LCM0=LCM*(1<<res)/2;
  if(LCM0<=M){
    ll ans=(M-LCM0)/(LCM0*2)+1;
    cout << ans << endl;
  }
  else{
    cout << 0 << endl;
  }
  
} 

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

int func(std::vector<int>& v, int len)
{
    int max = -1e9;
    int min = v[0];
    for(int j=1;j<len;++j)
    {
    	max = max<v[j]-min?v[j]-min:max;
    	if(v[j]<min)
		{
			min = v[j];
		}
    }
    return max;
}
int main()
{
    std::vector<int> v;
    int len;
    int value;
    std::cin >> len;
    for(int i=0;i<len;++i)
    {
        std::cin >> value;
        v.push_back(value);
    }
    std::cout << func(v, len);
    std::cout << '\n';
    return 0;
}


Measured memory_bytes: 3816
S = input().split(" ")
N = int(S[0])
M = int(S[1])


def C(m, n):
    t = m
    s1 = 1
    while t > (m - n):
        s1 = s1 * t
        t = t - 1

    s2 = 1

    t = n
    while t >= 1:
        s2 = s2 * t
        t = t - 1

    return int(s1 / s2)


def A(m, n):
    s = 1
    t = m

    while t > m - n:
        s = (s * t) % 1000000007
        t = t - 1

    return s


def calculate(maxValue, minValue):
    if maxValue > minValue + 1:
        return 0

    if maxValue == minValue:
        S = A(maxValue,maxValue)
        return  2 * S * S

    return A(maxValue,maxValue) * A(minValue,minValue)

result = calculate(max(N,M),min(N,M))

print(result % 1000000007)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define f(i,a,b) for(i=a;i<b;i++)
#define fr(i,a,b) for(i=a;i>b;i--)
#define endl '\n'
#define ll long long int
#define ff first
#define ss second
#define pb push_back
using namespace std;


int val[100000][3];
int dp[100000][3];

int solve(int n,int j)
{
    if(n==0)
        return dp[n][j]=val[0][j];
    if(dp[n][j]!=-1)
        return dp[n][j];
    else
    {
        dp[n][j]=val[n][j]+max(solve(n-1,(j+1)%3),solve(n-1,(j+2)%3));
        return dp[n][j];
    }
}

int main()
{
    int n,i,j,ans=0;
    cin>>n;
    f(i,0,n)
        f(j,0,3)
        {
            cin>>val[i][j];
            dp[i][j]=-1;
        }
    ans=max(ans,solve(n-1,0));
    ans=max(ans,solve(n-1,1));
    ans=max(ans,solve(n-1,2));
    cout<<ans;
}

Measured memory_bytes: 8832
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(v) (v).begin(),(v).end()
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;

ll gcd(ll x, ll y) {
    if (y == 0) return x;
    return gcd(y,x%y);
    }

vector<pair<ll,int>> factorize(ll n) {
  vector<pair<ll,int>> res;
  for (ll i = 2; i*i <= n; ++i) {
    if (n%i) continue;
    res.emplace_back(i,0);
    while (n%i == 0) {
      n /= i;
      res.back().second++;
    }
  }
  if (n != 1) res.emplace_back(n,1);
  return res;
}

int main() {
	ll a,b;
	cin >> a >> b;
	ll g = gcd(a,b);
    auto f = factorize(g);
    int ans = f.size() + 1;
    cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int n,x;
  scanf("%d",&n);
  x=n/1.08;
  if(x*1.08-n<1 && x*1.08-n>=0){
    printf("%d\n",x);
  }
  else if((x+1)*1.08-n<1 && (x+1)*1.08-n>=0){
    printf("%d\n",x+1);
  }
  else{
    printf(":(\n");
  }
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
// vector<int> vec(3); = vector<int> vec={0,0,0}
// vec.at()
// sort(num.begin(),num.end(), greater<int>());
// reverse(num.begin(),num.end());
 
// 切り上げ　a/b+1
//  1からNの総和　N*(N+1)/2
 
int main() {
  int A, B;
  cin >> A >> B;

  if(A == 1 || B == 1){
  	if(A == B){
    	cout << "Draw" << endl;
    }else if(A == 1){
    	cout << "Alice" << endl;
    }else{
    	cout << "Bob" << endl;
    }
  }else {
   if(A == B){
  	cout << "Draw" << endl;
  }else if(A>B){
    cout << "Alice" << endl;
  }else{
  	cout << "Bob" << endl;
  }
  }
}

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

string t[100][100];
int H,W;

int main(){
  cin>>H>>W;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      cin>>t[i][j];
      if(t[i][j]=="snuke"){
        char ch = 'A'+j;
        cout<<ch;
        cout<<i+1<<endl;
        return 0;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 892
#include<stdio.h>
#include<stdlib.h>

#define N 100000

typedef struct{
  char name[10];
  int time;
} ps;


int main(){
  ps dat[N];
  int i=0,j,x,y,head=0,tail,t=0;

  scanf("%d%d",&x,&y);
  
  tail = x-1;
  
  for(i = 0; i < x; i++){
    scanf("%s%d",dat[i].name,&dat[i].time);
  }


  for(i = 0;; i++){

    if(i == N)i = head;
    dat[i].time -= y;

    if(dat[i].time > 0){
      tail++;
      if(tail == N)tail = 0;
      dat[tail] = dat[head];
      t += y;

    }

    else if(dat[i].time <= 0){
      t += y + dat[i].time;
      
      printf("%s %d\n",dat[i].name,t);

      if(head == tail)break;

    }

    head ++;

    if(head == N)head = 0;
    
  }

  return 0;
}



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

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> h(n), ans(n, 1);
    for(int i = 0; i < n; i++){
        cin >> h[i];
    }
    for(int i = 0; i < m; i++){
        int a, b;
        cin >> a >> b, a--, b--;
        if(h[a] > h[b]) ans[b] = 0;
        else if(h[a] < h[b]) ans[a] = 0;
        else{
            ans[a] = 0;
            ans[b] = 0;
        }
    }
    cout << accumulate(begin(ans), end(ans), 0) << endl;
    return 0;
}

Measured memory_bytes: 4052
n = input()
a = []
for i in range(n):
    t = map(int, raw_input().split())
    t.sort()
    if t[2] ** 2 == t[0] ** 2 + t[1] ** 2:
        a.append("YES")
    else:
        a.append("NO")
for j in a:
    print(j)

Measured memory_bytes: 4228
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = (0); i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define DEBUG(val) cout << #val << " : " << val << endl
#define MOD 1000000007

int main() {
  int x;
  cin >> x;
  if (x >= 30) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3588
def bfs(start, vertices, watcher)
  watcher[start] = 0
  store = [start]
  while !store.empty? do
    v = store.shift
    vertices[v].each do |i|
      if watcher[i] < 0 then
        watcher[i] = watcher[v] + 1
        store << i
      end
    end
  end
end

# main
n = gets.chomp.to_i
vertices = {}
watcher = {}
(n).times do
  inputs = gets.chomp.split.map(&:to_i)
  neighbors = (inputs[1] > 0) ? inputs[2..-1] : []
  vertices[inputs[0]] = neighbors
  watcher[inputs[0]] = -1
end

bfs(1, vertices, watcher)
watcher.each do |key, val|
  puts "#{key} #{val}"
end

Measured memory_bytes: 8744
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
#define REP(i,N) for(int i=0;i<N;i++)
int main(){
    int a,b,t; cin>>a>>b>>t;
    int k = (t*2+1)/a/2;
    cout<<k*b<<endl;
    return 0;
}

Measured memory_bytes: 256
n = gets.to_i
button = []
result = 0
possible = false
n.times do
	button.push(gets.to_i)
end

flag = button[0]
button.length.times do
	result += 1
	if flag == 2
		possible = true
		break
	end
	flag = button[flag-1]
end

if possible
	puts result
else
	puts -1
end


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

using namespace std;

using ll = long long;

int main() {
   ios_base::sync_with_stdio(false); cin.tie(nullptr);
   int N; cin >> N;
   vector<ll> A(N + 1);
   for (int i = 0; i <= N; ++i) cin >> A[i];
   auto finish = [&](ll ans) {
      cout << ans << "\n";
      exit(0);
   };
   if (N == 0) {
      if (A[0] == 1) finish(1);
      else finish(-1);
   }
   if (A[0]) finish(-1);
   vector<ll> limit(N + 1);
   limit[0] = 1;
   for (int i = 0; i < N; ++i) {
      if (limit[i] < A[i]) finish(-1);
      limit[i + 1] = min(ll(1e18), 2 * (limit[i] - A[i]));
   }
   if (limit[N] < A[N]) finish(-1);
   ll ans = A[N];
   ll cur = A[N];
   for (int i = N - 1; i >= 0; --i) {
      cur = min(limit[i], cur + A[i]);
      ans += cur;
   }
   finish(ans);
}


Measured memory_bytes: 5216
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

int main()
{
	int N, Y;
	cin >> N >> Y;
	for (int i = 0; i <= N; i++) {
		for (int j = 0; j <= N - i; j++) {
			int num = Y - (10000 * i + 5000 * j);
			if (num % 1000 == 0) {
				if (num / 1000 + i + j == N) {
					cout << i << " " << j << " " << N - i - j << endl;
					return 0;
				}
			}
		}
	}
	cout << -1 << " " << -1 << " " << -1 << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i, j) for (int i = 0; i < j; i++)
using namespace std;
using ll = long long;

int gcd(int x, int y);

const int INF = 1001001001;

/*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 { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a; }
};
istream& operator>>(istream & is, const mint & a) { return is >> a.x; }
ostream& operator<<(ostream & os, const mint & a) { return os << a.x; }*/


int main() {
    ll a, b, k;
    cin >> a >> b >> k;
    vector<int> num(0);

    for (int i = a; i <= a + k - 1; i++) {
        if (b < i)
            break;
        cout << i << endl;
        num.emplace_back(i);
    }

    for (int i = b - k + 1; i <= b; i++) {
        if (a > i)
            continue;
        int flag = 0;
        rep(j, num.size())
            if (i == num[j]) {
                flag = 1;
                continue;
            }
        if (flag == 1) continue;
        cout << i << endl;
    }

    return 0;
}

/*���C�u�����ő����*/
//���[�O���b�h�̌ݏ��@
int gcd(int x, int y) {
    int num[3];
    num[0] = (x > y) ? x : y;
    num[1] = (x <= y) ? x : y;
    num[2] = num[0] % num[1];

    while (num[2]) {
        num[0] = num[1];
        num[1] = num[2];
        num[2] = num[0] % num[1];
    }

    return num[1];
}

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

int main() {
	int N, A, B;
	cin >> N;
	int total = 0;
	string S;
	for (int i = 0; i < N; i++) {
		cin >> A >> B;
		if (A == B && total != 2 && i + 1 < N) {
			total++;
		}
		else if (A == B && total == 2) {
			S = "Yes";
		}
		else if (A != B && i + 1 != N) {
			total = 0;
		}
		else if (i + 1 == N && S != "Yes") {
			S = "No";
		}
	}
	cout << S << endl;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define int long long
using namespace std;

bool check(int x, int P, int N){
  
  while(N--){
    
    if( P % x == 0 ) P /= x;
    else return false;    
    
  }
      
  return true;
}

signed main(){
  
  int N, P;
  cin>>N>>P;
  
  int ans = 1;
  
  vector<int> A;
  
  for(int i=2;i*i<=P;i++){
    
    if( P % i == 0 ){
      A.push_back(i);
    }
    
  }
  
  A.push_back(P);
  
  sort(A.begin(),A.end(),greater<int>());
  
  for(int i : A){

    if( check( i, P, N ) ){
      cout<<i<<endl;
      return 0;
    }
    
  }

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


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
d = {}
for c in a:
    if c in d.keys():
        d[c] += 1
    else:
        d.setdefault(c, 1)
ans = 0
for indx, cnt in d.items():
    if indx < cnt:
        ans += cnt - indx
    elif indx > cnt:
        ans += cnt
print(ans)

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

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < n; i++)
#define Rep(i, n) for(int i = 1; i < n; i++)
#define In(vec) rep(i, n) cin>>vec[i];
#define ANS(s) cout << s << endl
#define inc(a, b) cin >> a >> b;

const int mod = 1000000007;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<pair<int, int>> vii;

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; }

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
int round_int(int a, int b) { return (a + (b - 1)) / b; }


// 4,8方向に探索する際に用いる配列
//int dx[4] = { 0,  0, 1, -1 };
//int dy[4] = { 1, -1, 0,  0 };
int dx[8] = { 1, 0, -1,  0, 1, -1, -1,  1 };
int dy[8] = { 0, 1,  0, -1, 1,  1, -1, -1 };

constexpr auto MAX = 100010;

// ────────────────────────────────────────────────────

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

	vl ryuka;
	ryuka.push_back(2);
	ryuka.push_back(1);

	for (int i = 0; i < n - 1; i++) {
		ryuka.push_back(ryuka[i] + ryuka[i + 1]);
	}
	cout << ryuka[n] << endl;
}

Measured memory_bytes: 384
# -*- coding: utf-8 -*-
import sys
# from collections import defaultdict, deque
# from math import sqrt, gcd, factorial, tan, pi, sin, cos
def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline()[:-1]

MOD = 998244353

def solve():
    n = int(input())
    d = [int(x) for x in input().split()]
    f = [0] * n
    for e in d:
        f[e] += 1
    
    ok = f[0] == 1 and d[0] == 0
    z = 0
    ans = 1
    for i in range(1, n):
        if (f[i] == 0): z = 1
        if (z and f[i]): ok = 0
        ans *= pow(f[i-1], f[i], MOD)
        ans %= MOD
    print(ans * ok)




t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()



"""
1 -> (1, 2) -> (2 ** 3, 3) -> (3, 1)

"""



Measured memory_bytes: 14396
{-# LANGUAGE BangPatterns #-}

import Data.Bits
import Data.List
import Data.IntMap.Strict (IntMap)
import qualified Data.IntMap.Strict as IntMap
import qualified Data.ByteString.Char8 as BS
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import Control.Monad
import Control.Applicative
import Data.Maybe
import Data.Tuple
import Data.Ord
import Data.Coerce

newtype BitFlag = BF Int

initFlag :: BitFlag
initFlag = BF (bit 3 .|. bit 5 .|. bit 7)

{-# INLINE lenFlag #-}
lenFlag :: BitFlag -> Int
lenFlag = coerce (popCount :: Int -> Int)

{-# INLINE testFlag #-}
testFlag :: Int -> BitFlag -> Bool
testFlag = coerce (flip testBit :: Int -> Int -> Bool)

{-# INLINE killFlag #-}
killFlag :: Int -> BitFlag -> BitFlag
killFlag = coerce (flip clearBit :: Int -> Int -> Int)
  
gen :: Int -> BitFlag -> Int -> Int -> (Int,Bool)
gen 0 !xs till acc
  | acc <= till = (1,True)
  | otherwise   = (0,False)
gen n !xs till !acc = foldr count out [3,5..7] 0
  where
    count | lenFlag xs < n
            = \ !k cont !left ->
                let (!now, hasMore)
                      = gen (n-1) (killFlag k xs) till (10*acc + k) 
                in if hasMore then
                     cont (left + now)
                   else
                     (left + now, False)
          | otherwise
            = \ !k cont !left ->
              if not (testFlag k xs) then
                cont left
              else let (!now,hasMore)
                         = gen (n-1) (killFlag k xs) till (10*acc + k)
                   in if hasMore then
                        cont (left + now)
                      else
                        (left + now, False)
    out !left = (left, True)
  
cNum :: Int -> Int
cNum !till = foldr count out [3,4..9] 0
  where
    count !n cont !left = if hasMore then
                            cont (left + now)
                          else
                            left + now
      where
        (!now, hasMore) = gen n initFlag till 0
    out = id

main :: IO ()
main = getLine >>= print . cNum . read 


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

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

  for (int i = 1; i <= 9; i++) {
    for (int j = 1; j <= 9; j++) {
      if (i * j == N) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }

  cout << "No" << endl;
  return 0;
}

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

int main ()
{

	double r, S, l;

	cin >> r;

	l = 2 * 3.141592653589 * r;

	S = r * r * 3.141592653589;

	cout << fixed << setprecision(6) <<  S << " " << l << endl;


	return 0;
}


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

void Main()
{
    long n, d;
    cin >> n >> d;
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        long x, y;
        cin >> x >> y;
        if(x*x + y*y <= d*d) ans++;
    }
    
    cout << ans << endl;
}

int main(int argc, char **argv)
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    Main();
    return 0;
}


Measured memory_bytes: 3652
import java.util.Scanner;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();
        while(H!=0||W!=0){
            for(int i=0;i<H;i++){
                if(i==0||i==H-1){
                    for(int j=0;j<W;j++) System.out.print("#");
                }else{
                    for(int j=0;j<W;j++){ 
                    if(j==0||j==W-1) System.out.print("#");
                    else             System.out.print(".");
                    }
                }
                System.out.println("");
            }
            System.out.println("");
            H = sc.nextInt();
            W = sc.nextInt();
        }
    }
}


Measured memory_bytes: 32492
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>

using namespace std;

int main()
{
	int x;
	cin >> x;
	if (x < 1200) {
		cout << "ABC" << endl;
	}
	else {
		cout << "ARC" << endl;
	}
	return 0;
}



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

using ll = long long;

using namespace std;

using P = pair<long, int>;
#define MAX_N 1000010
#define INF 1000000000

int main() {
    int n;
    cin >> n;
    int zip[n][n], cnt=0;
    for (int i=0; i<n; i++) {
        for (int j=i+1; j<n; j++) {
            zip[i][j] = zip[j][i] = cnt;
            cnt++;
        }
    }
    int ins[cnt];
    vector<int> G[cnt];
    fill(ins, ins + cnt, 0);
    for (int i=0; i<n; i++) {
        int a;
        cin >> a;
        a--;
        int prev = zip[i][a];
        for (int j=0; j<n-2; j++) {
            cin >> a;
            a--;
            G[prev].push_back(zip[i][a]);
            prev = zip[i][a];
            ins[prev]++;
        }
    }
    int acnt=0;
    queue<int> zeros;
    for (int i=0; i<cnt; i++) if (ins[i] == 0) {
        acnt++;
        zeros.push(i);
    }
    int d[cnt], maxd=1;
    fill(d, d+cnt, 1);
    while (!zeros.empty()) {
        int i = zeros.front(); zeros.pop();
        for (auto &g:G[i]) {
            //cerr << i << ' ' << g << ' ' << ins[g] << endl;
            ins[g]--;
            d[g] = max(d[i]+1, d[g]);
            maxd = max(d[g], maxd);
            if (ins[g] == 0) {
                zeros.push(g);
                acnt++;
            }
        }
    }
    if (acnt < cnt) {
        cout << -1 << '\n';
        return 0;
    }
    cout << maxd << '\n';
    return 0;
}

Measured memory_bytes: 35328
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;

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

	int ans = -1;
	if (x < 600) {
		ans = 8;
	} else if (x < 800) {
		ans = 7;
	} else if (x < 1000) {
		ans = 6;
	} else if (x < 1200) {
		ans = 5;
	} else if (x < 1400) {
		ans = 4;
	} else if (x < 1600) {
		ans = 3;
	} else if (x < 1800) {
		ans = 2;
	} else {
		ans = 1;
	}

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


Measured memory_bytes: 3176
N = int(input())

arr = [(i, N-i) for i in range(1, int(N/2))]
minn = N
for i, j in arr:
    temp = sum(list(map(int, list(str(i))))) + sum(list(map(int, list(str(j)))))
    minn = min(temp, minn)

print(minn)


Measured memory_bytes: 9880
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
#define EPS 1e-9
#define DEBUG 0
#define ll long long
#define Pll pair<ll, ll>
#define Pii pair<int, int>
 
using namespace std;
struct edge{int from, to; ll cost;};

int n;
vector< pair<ll, Pll> > v;

signed main(){
    ios::sync_with_stdio(0); cin.tie(0);
    cin >> n;
    ll h,p,max_h;
    rep(n){
        cin >> h >> p;
        max_h = max(max_h, h);
        v.emplace_back(h+p, Pll(h, p));
    }
    sort(all(v));
    
    vector< vector<ll> > dp(n+1, vector<ll>(n+1, 10LL*(ll)INF));
    dp[0][0] = 0;
    dp[0][1] = v[0].second.second;
    repp(i, n){
        repp(j, i+1){
            dp[i+1][j] = min(dp[i+1][j], dp[i][j]);
            if(dp[i][j] <= v[i].second.first)
                dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j] + v[i].second.second);      
        }
    }
    
    int ans = n;
    while(dp[n][ans] == 10LL*(ll)INF) ans--;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 196032
#ifdef ConanYu
#include "E:\yuzining\code\local.hpp"
#else
#pragma GCC optimize("-O3")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define debug(...) do { } while(false)
void Main();
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie();
  Main();
  return 0;
}
#endif

vector<ll> res;

void chk(ll i, ll n) {
  if(i == 1) return;
  while(n % i == 0) n /= i;
  if(n % i == 1) res.push_back(i);
}

void Main() {
  ll n; cin >> n;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      chk(i, n);
      chk(n / i, n);
    }
  }
  for(ll i = 1; i * i <= (n - 1); i++) {
    if((n - 1) % i == 0) {
      chk(i, n);
      chk((n - 1) / i, n);
    }
  }
  sort(res.begin(), res.end());
  res.erase(unique(res.begin(), res.end()), res.end());
  cout << res.size() << '\n';
}

Measured memory_bytes: 256
open Batteries

let solve s t =
  let ss = String.to_list s |> List.sort compare |> String.of_list in
  let st = String.to_list t |> List.sort (fun a b -> compare b a) |> String.of_list in
  let sorted = List.sort compare [ss; st] in
  let answer = (ss <> st) && (List.hd sorted = ss) in
  print_string @@ if answer then "Yes" else "No" 

let () = Scanf.scanf "%s\n%s" solve 

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

int main() {
	int n;
	scanf("%d", &n);
	int a, b, c, A = 0, B = 0, C = 0;
	while (n--) {
		scanf("%d %d %d", &a, &b, &c);
		int AA = max(B, C) + a;
		int BB = max(A, C) + b;
		int CC = max(A, B) + c;
		A = AA, B = BB, C = CC;
	}
	printf("%d", max(max(A, B), C));
}

Measured memory_bytes: 256
let S: String = readLine()!
let T: String = readLine()!
var res: Int = 0
var idx: String.Index = S.startIndex

for _ in 1...S.count {
    if S[idx] != T[idx] { res += 1 }
    idx = S.index(after: idx)
}
print(res)	// (๑•ૅㅁ•๑)

Measured memory_bytes: 8368
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    cout << min(a, b) << ' ' << max(a + b - n, 0) << endl;

    return 0;
}

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

using namespace std;
typedef long long ll;

int x[200001], y[200001];

int main(void) {
    int n;
    cin >> n;
    for(int i=1; i<=n; i++) {
        scanf("%d", x+i);
        y[i] = x[i];
    }
    sort(y, y+n+1);
    int half = n/2;
    for(int i=1; i<=n; i++) {
        if(x[i] <= y[half]) printf("%d\n", y[half+1]);
        else printf("%d\n", y[half]);
    }

    return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#include <string>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define pii pair<int, int>
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
//#define ordered_multiset tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define int long long
#define jai_shree_ram  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i, a, b, d) for (int i = a; i <= b; i += d)
#define brep(i, a, b, d) for (int i = a; i >= b; i -= d)
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl '\n'
int MAX = 1e5 + 5;
int MOD = 1e9 + 7;
////////////////////////////////
 
int n, a[105], dp[100005];
 
int32_t main(){
    jai_shree_ram 
    int k;
    cin >> n >> k;
    rep(i,1,n,1) cin >> a[i];
 
    rep(i,1,k,1){
        rep(j,1,n,1)
            if(i >= a[j]) 
                dp[i] |= (!dp[i-a[j]]);
    }
 
    if(dp[k]) cout << "First" <<endl;
    else cout << "Second" << endl;
    return 0; 
}

Measured memory_bytes: 1024
program prob66
    implicit none
    integer :: a,b
    read(*,*) a,b
    a = mod(a+11,13)
    b = mod(b+11,13)
    if(a > b) then
        write(*,*) "Alice"
    else if(a == b) then
        write(*,*) "Draw"
    else
        write(*,*) "Bob"
    end if

    stop
contains
end program prob66

Measured memory_bytes: 2860
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, a, b) for (int i = (a); i < (b); i++)

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

    int n;
    cin >> n;
    rep(i, 1, n) {
        rep(j, i + 1, n + 1) {
            int k = 0;
            while (!((i ^ j) & (1 << k)))
                k++;
            cout << k + 1 << ' ';
        }
        cout << endl;
    }

    return 0;
}


Measured memory_bytes: 512
a, b, c, d, e, f = map(int, input().split())

max_c = 0
max_w = 0
max_s = 0

# t  = (100*e)/(100+e)

for i in range(int((f//(100*a)+1))):
  for j in range(int((f-100*a*i)//(100*b)+1)):
    x = 100*a*i+100*b*j
    for k in range(int((f-x)//c+1)):
      for l in range(int((f-x-c*k)//d+1)):
        y = c*k+d*l
        if x+y == 0 or x+y > f:
          continue
        else:
          conc = (100*y)/(x+y)
          # print(conc)
          if max_c <= conc and y <= (x*e)/100:
            max_c = conc
            max_w = x
            max_s = y
print(int(max_w+max_s), int(max_s))

Measured memory_bytes: 42604
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        char[] A = sc.next().toCharArray();
        char[] B = sc.next().toCharArray();
        String ans = "EQUAL";
        
        if (A.length > B.length) {
            ans = "GREATER";
        } else if (A.length < B.length) {
            ans = "LESS";
        } else {
            for (int i = 0; i < A.length; i++) {
                if (A[i] > B[i]) {
                    ans = "GREATER";
                    break;
                } else if (A[i] < B[i]) {
                    ans = "LESS";
                    break;
                }
            }
        }
        
        out.println(ans);
        
        out.flush();
    }
}

Measured memory_bytes: 21844
#include "bits/stdc++.h"
#define FI first.first
#define SE first.second
#define TH second
#define fi first
#define se second
#define th second

using namespace std;

template<typename T>
string to_string(const vector<T>& vc, int w) {
	if(vc.empty()) return "";
	if(w + 1 == vc.size()) return to_string(vc[w]);
	return to_string(vc[w]) + "," + to_string(vc, w + 1);
}

template<typename T>
string to_string(const vector<T>& vc) {
	return "{" + to_string(vc, 0) + "}";
}

void debug_out() { cerr << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
 
#ifdef DEBUG
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

class DebugStream {}LOG;
template <typename T>DebugStream &operator<<(DebugStream &s, const T&) { return s; }
#ifdef DEBUG
#define LOG clog
#endif

typedef long long ll;
typedef pair<ll, ll> ii;
typedef long double ld;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

const int maxN = 1e5 + 9, maxV = 1e6 + 9, MOD = 1e9 + 7, SQ = 335, lg = 20, bs = 29;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	#ifdef DEBUG
	freopen("input.txt", "r", stdin);
	#endif

	int s;
	cin >> s;
	vector<ll> dp(s + 1);
	dp[s] = 1;
	for(int i = s - 1; i >= 0; i--)
		for(int j = i + 3; j <= s; j++)
			dp[i] = (dp[i] + dp[j]) % MOD;
	cout << dp[0] << '\n';
}



Measured memory_bytes: 3656
package main

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

var sc = bufio.NewScanner((os.Stdin))

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

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

func main() {
	sc.Split(bufio.ScanWords)
	N := nextInt()

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

// ABC139D ...
func ABC139D(N int) (res int) {
	return N * (N - 1) / 2
}


Measured memory_bytes: 1776
import numpy as np
N, M, C = map(int, input().split())
B = list(map(int, input().split()))

B = np.array(B).reshape(1, M)

count = 0

for i in range(N):
    A = list(map(int, input().split()))
    A = np.array(A).reshape(1, M)
    if np.dot(B, A.T)+C > 0:
        count = count + 1

print(count)


Measured memory_bytes: 12488
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
int n,s[maxn],top;
int main()
{
	scanf("%d%d",&n,&s[1]);
	top=1;
	for(register int i=2,x;i<=n;i++)
	{
		scanf("%d",&x);
		if(x>s[1])
			s[1]=x;
		else
			if(x<=s[top])
				s[++top]=x;
			else
			{
				int l=1,r=top;
				while(l<=r)
				{
					int mid=(l+r)>>1;
					if(s[mid]>=x)
						l=mid+1;
					else
						r=mid-1;
				}
				s[l]=x;
			}
	}
	printf("%d",top);
	return 0;
}

Measured memory_bytes: 640
N = int(input())
S = []

m = a = r = c = h = 0
for _ in range(N):
    s = input()[0]

    if s == "M":
        m += 1
    elif s == "A":
        a += 1
    elif s == "R":
        r += 1
    elif s == "C":
        c += 1
    elif s == "H":
        h += 1
ans = 0
ans += m * a * r
ans += m * a * c
ans += m * a * h
ans += m * r * c
ans += m * r * h
ans += m * c * h
ans += a * r * c
ans += a * r * h
ans += a * c * h
ans += r * c * h

print(ans)


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

using namespace std;

const int MAXN = 1e5 + 5;

vector < int > parent(MAXN), sz(MAXN);

void make_set(int u){
  parent[u] = u;
  sz[u] = 1;
}

int find_set(int u){
  if(u == parent[u]) return u;
  return parent[u] = find_set(parent[u]);
}

void union_sets(int u, int v){
  u = find_set(u);
  v = find_set(v);
  if(u != v){
    if(sz[u] > sz[v]) swap(u, v);
    parent[u] = v;
    sz[v] += sz[u];
  }
}

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

  int n, m;
  cin >> n >> m;
  vector < int > x(m), y(m), z(m);
  for(int i = 0; i < m; i++){
    cin >> x[i] >> y[i] >> z[i];
  }

  for(int i = 1; i <= n; i++) make_set(i);
  for(int i = 0; i < m; i++){
    union_sets(x[i], y[i]);
  }

  vector < bool > known(n + 1, false);
  int cnt = 0;
  for(int i = 1; i <= n; i++){
    if(!known[find_set(i)]){
      known[find_set(i)] = true;
      cnt++;
    }
  }

  cout << cnt << '\n';
}


Measured memory_bytes: 2176
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>

static const int INF = 1000000007;
using ll = long long;
using namespace std;


int main() {
    ll n, ans = 1;
    cin >> n;
    for (int i = 2; i <= n; ++i) {
        ans = (ans * i) % INF;
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#include<map>
#include<iostream>
#include<math.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
    ll N;
    cin >> N;
    ll ans = 0;
    for(ll i = 1; i < N + 1; i++){
        if(i % 3 == 0 || i % 5 == 0 || i % 15 == 0)continue;
        else ans += i;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) (a).size() 
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0;i<n;i++)
#define forn(i,n) for(int i=1;i<=n;i++)
#define ford(i,n) for(int i=n;i>=0;i--) 
#define REP(i,a,n) for(int i=a;i<n;i++)
#define foreach(c,itr) for(__typeof((c).begin(),(c).end())itr=c.begin();itr!=c.end();itr++) 
#define fill(a,b) memset(a,b,sizeof(a))
#define re return
#define INF 1e9
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi > vpi; 
int main(){
	int a,b;
	cin>>a>>b;
	if(a>9||b>9){
		cout<<"-1";
	} 
	else{
		cout<<a*b;
	}
	re 0;
}

Measured memory_bytes: 256
#include <stack>
#include <queue>
#include <cstdio>
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n0,n) for(int i=n0;i<n;i++)
#define Com(i,j,n) for(int i=0;i<n-1;i++)for(int j=i+1;j<n;j++)
const int INF =100100100;
const int MOD = (int)1e9+7;
const double EPS = 1e-9;
typedef long long ll;
typedef long li;
#define pb push_back 
#define mp make_pair

signed main (){	
	ll AA,BB,TT;
	cin >> AA >> BB >> TT;
  cout << ((TT - TT%AA)/AA) * BB << endl;
	return 0;
}


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

    #define int long long
    #define ci(m)     for(int i=0;i<m;i++)
    #define cj(m)     for(int j=0;j<m;j++)
    #define ck(m)     for(int k=0;k<m;k++)
    #define gcd            __gcd
    #define endl           "\n"
    #define pb             emplace_back
    #define setbits(x)     __builtin_popcountll(x)
    #define zrobits(x)     __builtin_ctzll(x)
    #define mod            1000000007
    #define mod2           998244353
    #define maxe           *max_element
    #define mine           *min_element
    #define inf            1e18
    #define deci(x, y)      fixed<<setprecision(y)<<x
    #define w(t)           int t; cin>>t; while(t--)
    #define nitin          ios_base::sync_with_stdio(false); cin.tie(NULL)
    #define PI             3.141592653589793238
    using namespace std;

    int32_t main() {
        nitin;
        int x;
        cin>>x;
        cout<<(x/500)*1000+((x%500)/5)*5<<endl;
        return 0;
    }

Measured memory_bytes: 3564
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);
    int k = sc.nextInt();
    int x = sc.nextInt();

    if (500 * k >= x) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}


Measured memory_bytes: 22228
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <stack>
#include <fstream>
#include <cstdint>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
#include <functional>

using namespace std;


typedef int64_t ll;


class rect{
    static const int inf = 100000;
public:
    int sx, sy; // 始点 左上
    int ex, ey; // 終点 右下
    rect() :sx(inf), sy(inf), ex(), ey() {}
    
    void modify(const int& i, const int& j){
        sx = min(i, sx);
        sy = min(j, sy);
        
        ex = max(i, ex);
        ey = max(j, ey);
    }
};

bool is_real_over(map<char, rect> shapes, vector<vector<char>>& v){
    vector<char> chs;
    for(auto && t : shapes){
        chs.push_back(t.first);
    }
    if(chs.size() == 0)
        return true;
    do{
        map<char, int> pos;
        for (int i = 0; i < chs.size(); ++i) {
            pos[chs[i]] = i;
        }
        bool do_next = [&]()
        {
            for(auto && rec_pair: shapes){
                auto && rec = rec_pair.second;
                auto && rec_name = rec_pair.first;
                for (int i = rec.sx; i <= rec.ex; ++i) {
                    for (int j = rec.sy; j <= rec.ey; ++j) {
                        auto&& this_char = v[i][j];
                        if(pos[this_char] > pos[rec_name]){
                            return true;
                        }
                    }
                }
            }
            return false;
        }();
        if(!do_next) return true;
    }while(next_permutation(chs.begin(), chs.end()));
    return false;
}


bool solve(){
    int h, w;
    cin >> h >> w;
    vector<vector<char>> v;
    map<char, rect> shapes;
    for (int i = 0; i < h; ++i) {
        v.push_back({});
        for (int j = 0; j < w; ++j) {
            char tmp;
            cin >> tmp;
            v[i].push_back(tmp);

            if(tmp != '.')
                shapes[tmp].modify(i, j);
        }
    }


    // 矩形調査 yz
    for(auto && rec_pair: shapes){
        auto && rec = rec_pair.second;
        auto && rec_name = rec_pair.first;
//        cerr << "NAME:" << rec_name << '\n';
        for (int i = rec.sx; i <= rec.ex; ++i) {
            for (int j = rec.sy; j <= rec.ey; ++j) {
                auto&& this_char = v[i][j];
                if(this_char != rec_name){
                    if(this_char == '.'){
//                        cerr << "SHAPE MISS\n";
                        return false;
                    }
                }
            }
        }
    }

    return is_real_over(shapes, v);
    
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cout << (!solve() ? "SUSPICIOUS" : "SAFE") << endl;
    }
}



Measured memory_bytes: 3244
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--) 
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define downque(que) priority_queue<ll> que;
#define upque(que) priority_queue<ll, vector<int>, greater<int>> que;
typedef long long ll;
typedef vector<vector<int>> Matrix;
const int MOD = 1e9 + 7;
const int MAX = 1e7;
const int INF = numeric_limits<int>::max();


int cnt_digits(ll N){
  int digits=0;

  while(N>0){
  N/=10;
  digits++;
  }

 return digits;
}


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

  int res = cnt_digits(n);

  for (ll i =1LL; i*i<=n;++i)
  {

    if(n%i!=0)continue;
    const ll j=n/i;//約数だけがのこる
    const int cur = max(cnt_digits(i), cnt_digits(j));
    if (res > cur)
      res = cur;
  }

  cout << res << endl;
}

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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define cey ce("Yes")
#define cen ce("No")
#define ceY ce("YES")
#define ceN ce("NO")

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

	map<int, int> K;
	set<int> G;
	ll j = 2;
	ll n = N;

	while (n != 1) {
		if (n % j == 0) {
			K[j]++;
			n /= j;
			G.insert(j);
		}
		else {
			j++;
		}

		if (j * j > N) {
			break;
		}

	}

	if (G.size() == 0) {
		if (N == 1) {
			ce(0)
		}
		else {
			ce(1)
		}
		return 0;
	}

	j = 2;
	ll k = n;
	while (k != 1) {
		if (k % j == 0) {
			K[j]++;
			k /= j;
			G.insert(j);
		}
		else {
			j++;
		}

		if (j * j > n) {
			break;
		}

	}
	if (k!=1) {
		K[k]++;
		G.insert(k);
	}


	ll ans = 0;
	for (auto g : G) {

		int i = 1;
		int k = K[g];
		while (i <= k) {
			ans++;
			k -= i;
			i++;

		}
	}
	ce(ans)


    return 0;
}



Measured memory_bytes: 3636
#include <stdio.h>
#define MAX 1000000001
int n,A[200000],Left[100001],Right[100001],i,j,k;
long long count=0;
void Merge(int left,int mid,int right){
  int n1=mid-left,n2=right-mid;
  for(i=0;i<n1;i++)
    Left[i]=A[left+i];
  for(i=0;i<n2;i++)
    Right[i]=A[mid+i];
  Left[n1]=MAX;
  Right[n2]=MAX;

  for(i=0,j=0,k=left;k<right;k++){
    if(Left[i]>Right[j]){
      A[k]=Right[j++];
      count+=n1-i;
    }
    else A[k]=Left[i++];
  }
}
void MergeSort(int left,int right){
  int mid;
  if(right-left>1){
    mid=(left+right)/2;
    MergeSort(left,mid);
    MergeSort(mid,right);
    Merge(left,mid,right);
  }
}
int main(void){
  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&A[i]);
  MergeSort(0,n);
  printf("%lld\n",count);
  return 0;
}


Measured memory_bytes: 3416
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void _main()
{
    int N;
    cin >> N;
    vector<tuple<string, int, int>> a;
    rep(i, 0, N)
    {
        string S;
        int P;
        cin >> S >> P;
        a.push_back(make_tuple(S, -P, i + 1));
    }
    sort(a.begin(), a.end());
    for (const auto& t : a)
    {
        cout << get<2>(t) << endl;
    }
}


Measured memory_bytes: 256
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		for(int i = 0; i <= 1000; i++) {
			if(x >= 100*i && x <= (100*i)+(5*i)) {
				System.out.println(1);
				return;
			}
		}
		System.out.println(0);
	}
}

Measured memory_bytes: 22740
# 2019-11-24 20:41:45(JST)
import sys
from collections import deque 

def main():
    n, *b = map(int, sys.stdin.read().split())
    b = [None] + b

    for i in range(1, n+1):
        if b[i] > i:
            print(-1)
            exit()
    
    res = deque()
    while len(b) > 1:
        for i in range(len(b)-1, 0, -1):
            if b[i] == i:
                res.appendleft(b.pop(i))
                break
         
    print('\n'.join(map(str, res)))

if __name__ == '__main__':
    main()


Measured memory_bytes: 3316
#include<stdio.h>
int main()
{
    int a, b, i, c, d, e;
    char g[255];
    scanf("%d %d %d %d %d", &a, &b, &c, &d, &e);
    if (a == 0)
    {
        printf("1");
    }
    else if (b == 0)
    {
        printf("2");
    }
    else if (c == 0)
    {
        printf("3");
    }
    else if (d == 0)
    {
        printf("4");
    }
    else
    {
        printf("5");
    }
    
    return 0;
}

Measured memory_bytes: 1660
import math

n, k = map(int, input().split())

p = [0] * n

for _ in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for m in a:
        p[m-1] += 1

ans = 0

for l in p:
    if l == 0:
        ans += 1

print(ans)

Measured memory_bytes: 9200