akhauriyash/Code-Regression huggingface dataset:
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <cstdint>
#include <chrono>

using namespace std;
#define     loop(n,i,a)     for(ll i=a;i<n;i++)
#define     loopR(n,i,a)    for(ll i=a-1;i>=n;i--)
#define     all(arr,n)      arr,arr+n
#define     allv(v)         (v).begin(),(v).end()
#define     rallv(v)        (v).rbegin(),(v).rend()
#define     m_p             make_pair
#define     ll              long long
#define     pii             pair<ll,ll>
#define     vi              vector<int>
#define     vll             vector<ll>
#define     vii             vector<pii>
#define     sz(x)           (int)x.size()
#define     pb              push_back
#define     endl            "\n"
#define     Endl            "\n"
#define     f               first
#define     s               second
#define     mem(dp,n)       memset(dp,n,sizeof dp)
template<typename T>void max_self(T &a,T b){a=max(a,b);}
template<typename T>void min_self(T &a,T b){a=min(a,b);}
int dx[] = { 1 , 0 ,-1 , 0 ,-1 ,-1 , 1 , 1 };
int dy[] = { 0 , 1 , 0 ,-1 ,-1 , 1 ,-1 , 1 };
int KnightI[] = { 2, 1, -1, -2, -2, -1, 1, 2 };
int KnightJ[] = { 1, 2, 2, 1, -1, -2, -2, -1 };
void fast(){
    std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
vector<string> vec_splitter(string s) {
    s += ',';
    vector<string> res;
    while(!s.empty()) {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(
        vector<string> __attribute__ ((unused)) args,
        __attribute__ ((unused)) int idx,
        __attribute__ ((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
    if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
const ll mxN=3e5+10,oo=0x3f3f3f3f,MOD=998244353;
const long double PI = acos(-1),eps=1.0e-14;

void solve(){
    int c[3][3];
    loop(3,i,0)
        loop(3,j,0)
            cin>>c[i][j];
    int a[3],b[3];
    a[0]=0;
    loop(3,i,0)
        b[i]=c[0][i];
    loop(3,i,1)
        a[i]=c[i][0]-b[0];
    loop(3,i,0){
        loop(3,j,0){
            if(c[i][j]!=a[i]+b[j]){
                cout<<"No\n";
                return;
            }
        }
    }
    cout<<"Yes\n";
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    fast();
    solve();

}


Measured memory_bytes: 3664
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal
from argparse import ArgumentParser

args=ArgumentParser()
args.add_argument('-loc', '--local', type=bool,default=False)
LOCAL=args.parse_args().local

def input(): 
    x=sys.stdin.readline(); 
    if x[-1]=="\n": 
        return x.rstrip() 
    return x
    
def printe(*x):_=print("## ",*x,file=sys.stderr) if LOCAL else 0
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f


def lcm(A,M,f=0):
    
    cur=A[0]
    for a in A[1:]:
        d=a//math.gcd(a,cur)
        cur=cur*d
        if cur>M:
            return -1
    
    for a in A:
        if cur//a%2==0:
            return -1
        

    return cur

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    N, M = map(int, input().split())
    A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

    m1=lcm(tuple(a//2 for a in A),M,1)
    if m1==-1:
        print(0)
        return
    m2=lcm(A,M)

    printe(m1,m2)
    if m2==-1:
        print(1)
        return
    ans=1+(M-m1)//m2
    print(ans)
    


if __name__ == "__main__":
    main()

Measured memory_bytes: 108408
/*
    @uthor: Amit Kumar
    user -->GitHub: drviruses ; CodeChef: dr_virus_ ; Codeforces,AtCoder,Hackerearth,Hakerrank: dr_virus;
*/
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
using namespace std::chrono;
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;
//#define ln mp::cpp_int;
#define ll    long long
#define ld    long double
#define ull   unsigned long long
#define endl "\n"
ll google_itr = 1;
#define google(x) cout<<"Case #"<<x<<":"
#define pi 3.14159265358979323846264338327950L

const ll mod = 1e9+7;
const ll inf = 1e18;

ll popcount(ll num){
    num = num - ((num >> 1) & 0x55555555);
    num = (num & 0x33333333) + ((num >> 2) & 0x33333333);
    return ((num + (num >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}

vector<pair<ll,ll>> factor_arr;

void myfactor(ll num){ 
    ll count = 0;   
    while (!(num % 2)) { 
        num >>= 1; count++; 
    }  
    if (count) factor_arr.push_back({2,count}); 
    for (auto i = 3; i <= sqrt(num); i += 2) { 
        count = 0; 
        while (num % i == 0) { 
            count++; 
            num /= i; 
        } 
        if (count) factor_arr.push_back({i,count}); 
    } 
    if (num > 2) factor_arr.push_back({num,1});
}

void virus(){
        ll len;
        cin>>len;
        string seq,ans="";
        cin>>seq;
        ans += seq[0];
        for(auto i=1; i<len; i++){
            if(ans.back() != seq[i]) ans += seq[i];
        }
        cout<<ans.size();
}


int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
  /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/

    ll t=1;
    //cin>>t;
    while(t--){
           auto start = high_resolution_clock::now();
           virus();
           auto stop = high_resolution_clock::now();
           auto duration = duration_cast<seconds>(stop - start);
         //cout << "Time: "<<duration.count()<<endl;
        //your code goes here
    }
    return 0;
}

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

#define PI 3.141592653589793238462643383279

#define EARTH_HANKEI 6378.1

int main(void) {
	double a,b,c,d;
	double ax1,ay1,ax2,ay2;
	double x1,y1,z1,x2,y2,z2;
	double cosine;
	double result;
	while(1) {
		scanf("%lf%lf%lf%lf",&a,&b,&c,&d);
		if(a==-1 && b==-1 && c==-1 && d==-1)break;
		ax1=b*PI/180;ay1=a*PI/180;
		ax2=d*PI/180;ay2=c*PI/180;
		y1=cos(ay1);z1=sin(ay1);
		x1=y1*sin(ax1);y1=y1*cos(ax1);
		y2=cos(ay2);z2=sin(ay2);
		x2=y2*sin(ax2);y2=y2*cos(ax2);
		cosine=x1*x2+y1*y2+z1*z2;
		result=EARTH_HANKEI*acos(cosine);
		printf("%d\n",(int)floor(result+0.5));
	}
	return 0;
}

Measured memory_bytes: 680
#include <iostream>
#include <string>
#include <utility>
#include <stack>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <climits>
#include <set>
#include <cmath>

using namespace std;

char flip(char c){
    if(c == 'S'){
        return 'W';
    }
    return 'S';
}

char next_char(char prev, char cur, char resp){
    if(resp == 'o' && cur == 'S'){
        return prev;
    } else if(resp == 'x' && cur == 'S'){
        return flip(prev);
    } else if(resp == 'o' && cur == 'W'){
        return flip(prev);
    } 
    return prev;
}

char sw[2] = {'S', 'W'};
int main(){
   int N;
   string s;
   cin >> N;
   cin >> s;

    bool possible = false;
   for(int i = 0; i < 2; i++){
       for(int j = 0; j < 2; j++){
           string tmp_ans;
           tmp_ans.push_back(sw[i]);
           tmp_ans.push_back(sw[j]);
           for(int k = 1; k < N - 1; k++){
               tmp_ans.push_back(next_char(tmp_ans[k - 1], tmp_ans[k], s[k]));
           }
           if(next_char(tmp_ans[N - 2], tmp_ans[N - 1], s[N - 1]) == tmp_ans[0] 
                && next_char(tmp_ans[N - 1], tmp_ans[0], s[0]) == tmp_ans[1]){
               cout << tmp_ans << endl;
               return 0;
           }
       }
   }

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


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

#define int long long int
#define endl '\n'
#define all(v) (v).begin(), (v).end()

void SolveTestCase()
{

	int x, k, d;
	cin >> x >> k >> d;
	x = abs(x);
	int res = (x/d);
	
	if(res > k){
		cout << x - (k * d * 1LL) << endl;
		return;
	}
	
	if((k-res)%2 == 0)
	{
		cout << (x%d) << endl;
	}
	else
		cout << abs((x%d)-d) << endl;
		
	
}

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	SolveTestCase();
	
	return 0;
}


Measured memory_bytes: 3652
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()


def main():
	n,a,b,k=MI()

	m=998244353

	C=[1]
	for i in range(n):
		t=C[-1]*(n-i)*pow(i+1,m-2,m)
		C.append(t%m)
	#print(C)

	ans=0

	for x in range(n+1):
		if (k-a*x)%b==0:
			y=(k-a*x)//b
			if 0<=y<=n:
				ans+=C[x]*C[y]
				ans%=m
	print(ans)

























if __name__ == "__main__":
	main()


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


typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

#define pb push_back
#define mp make_pair
#define snd second
#define fst first
#define debug printf("--%d--\n",__LINE__)
#define ll long long int

int N;
static ll a[262144];
static int idx[262144];

int main(void){
	cin >> N;
	for(int i=0;i<N;i++){
		cin >> a[i];
		//a[i] = i;
		idx[a[i]] = i;
	}
	ll ans = 0;
	
	set<int> s;
	for(int i=1;i<=N;i++){
		set<int>::iterator itr = s.insert(idx[i]).first;
		set<int>::iterator itr2 = itr, itr3 = itr;
		itr2--; itr3++;
		int left = ((itr==s.begin()) ? -1 : *itr2);
		int right = ((itr3==s.end()) ? N : *itr3);
		//cout << idx[i] << " " << left << " " << right << endl;
		ans += ((ll)i) * (idx[i]-left)*(right-idx[i]);
	}
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 11904
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		TreeSet<Integer> set=new TreeSet<>();
		int n=in.nextInt();
		for(int i=0;i<n;i++) {
			set.add(Integer.parseInt(in.next()));
		}
		
		int m=in.nextInt();
		
		for(int i=0;i<m;i++) {
			set.remove(Integer.parseInt(in.next()));
		}
		
		PrintWriter out=new PrintWriter(System.out);
		Iterator<Integer> itr=set.iterator();
		while(itr.hasNext()) {
			out.println(itr.next());
		}
		out.flush();
	}

}


Measured memory_bytes: 120124
#include<bits/stdc++.h>
#pragma optimize "O3"
#define endl '\n'
const int MAXN=400017;
const int MOD=998244353;
using namespace std;

int n, a, b, fact[MAXN], inv[MAXN];
long long ans, k;

int poww(int st, int p)
{
	if(p==0) return 1;
	int half=poww(st, p/2), all=(half*1ll*half)%MOD;
	if(p%2==0) return all;
	return (all*1ll*st)%MOD;
}
int c(int i, int j)
{
	int zn=(inv[j]*1ll*inv[i-j])%MOD;
	return (fact[i]*1ll*zn)%MOD;
}
void mainp()
{
    cin>>n>>a>>b>>k;
    fact[0]=1;
    for(int i=1; i<=n; i++) fact[i]=(fact[i-1]*1ll*i)%MOD;
    for(int i=0; i<=n; i++) inv[i]=poww(fact[i], MOD-2);
    
    for(int i=0; i<=n; i++)
    {
		long long aa=i, bb=(k-aa*1ll*a)/b;
		if(bb<0||bb>n||aa*1ll*a+bb*1ll*b!=k) continue;
		//cout<<aa<<" "<<bb<<endl;
		ans+=c(n, aa)*1ll*c(n, bb);
		ans%=MOD;
	}
	cout<<ans<<endl;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    mainp();
    return 0;
}


Measured memory_bytes: 2560
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { 0, -1, 1, 0 };
const ll dy[4] = { -1, 0, 0, 1 };
const int INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
///////////////////////////////////////

int main() {
	int N;
	int A[100100];
	cin >> N;
	for (int i = 0; i < N; ++i) {
		cin >> A[i];
	}
	int ans = 0;
	int i = 0;
	while(i<N){
		if (A[i] < A[i+1]) {
			while (A[i] <= A[i + 1]) {
				i++;
			}
			ans++;
			i++;
		}
		else if (A[i] > A[i + 1]) {
			while (A[i] >= A[i + 1]) {
				i++;
			}
			ans++;
			i++;
		}
		else {
			i++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 640
n,m=map(int,input().split())
a=list(map(int,input().split()))
s=0
for i in range(n):
  s+=a[i]
count=0
for i in range(n):
  if 4*m*a[i]>=s:
    count+=1
if m<=count:
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3064
N, M = map(int, input().split())
MOD = 10**9+7
a = [True] * (N+1)
for i in range(M):
    a[int(input())] = False

dp = [0] * (N+1)

dp[0] = 1

for i in range(N):
    for j in range(i+1, min(N, i+2)+1):
        if a[j]:
            dp[j] += dp[i]
            dp[j] %= MOD

print(dp[N])

Measured memory_bytes: 7700
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename X> ostream& operator << (ostream& x,const vector<X>& v){for(ll i=0;i<v.size();++i) x<<v[i]<<" ";return x;}
template <typename X> ostream& operator << (ostream& x,const set<X>& v){for(auto it:v) x<<it<<" ";return x;}
template <typename X, typename Y> ostream& operator << (ostream& x, const pair<X,Y>& v) {x<<v.ff<<" "<<v.ss;return x;}
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (auto it : v) os << it.first << "=>" << it.second << endl; return os; }
struct pair_hash {inline std::size_t operator()(const std::pair<ll, ll> & v) const {return v.first*31+v.second;}};
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL)
#define pb push_back
#define fr first
#define sc second
#define prnt(m) for(auto it = m.begin() ; it != m.end() ; ++it){cout<<*it<<endl;}
#define tra(it,m) for(auto it=m.begin();it!=m.end();++it)
#define DBG(x) cout<<"# # #     "<<x<<'\n';
#define fri(i,s,n) for(long long i=s;i<n;i++)
#define mod 1000000007LL
#define mod2 998244353
#define vct2 vector<vector<ll>>
#define vct vector<ll>
#define pll pair<ll,ll>
#define rz(n) resize(n)
#define all(v) v.begin(),v.end()
#define mkp make_pair
#define arrin(a,n) for(ll i = 0; i < n ; i++){cin>>a[i];}
#define arrout(a,n) for(ll i = 0;i < n; i++){cout<<a[i]<<" ";}
#define ex(s) cout<<s<<endl,exit(0);
#define infy 2e18
#define five 100005;
#define six 1000005;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
//___________________________________________________________________________________________________________________________________________________________
const int N = five;
ll dp[2][N];
int main()
{
       ll x;
       cin>>x;
       ll ans = 0 ;
       ans += (x/500)*1000;
       x %= 500;
       ans += (x/5)*5;
       cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll fac[2005];
const int mod=1e9+7;
ll inv(ll b){return b==1?1:(mod-mod/b)*inv(mod%b)%mod;}
ll c(int n,int r){
	if(r==0||r==n)
		return 1;
	if(n<r)
		return 0;
	return fac[n]*inv(fac[r])%mod*inv(fac[n-r])%mod;
}
int main(){
	fac[1]=1;
	fac[0]=1;
	for(int i=2;i<=2000;i++)
		fac[i]=fac[i-1]*i%mod;
	int n,k;
	scanf("%d%d",&n,&k);
	ll ans=1;
	for(int i=1;i<=k;i++){
		ll r,b;
		r=c(n-k+1,i);
		b=c(k-1,i-1);
		ans=r*b%mod;
		printf("%lld\n",ans);
	}
	return 0;
}

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



public class Main {

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


		int A = fs.nextInt();
		int B = fs.nextInt();



		int a1 = (100/8)*A;
		int b1 = (100/10)*B;

		int i = 0;
		if(a1 < b1) {
			i = a1;
		}else {
			i = b1;
		}
		while(true) {
			if((int)(i * 0.08) == A &&  (int)(i * 0.1)==B) {
				System.out.println(i);
				break;
			}else if((int)(i * 0.08) > A || (int)(i * 0.08) > B) {
				System.out.println(-1);
				break;
			}else {
				i++;
			}
		}

	}

}

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

Measured memory_bytes: 21204
import java.util.Scanner;

class Main{
        public static void main(String[] args){
                Scanner scan = new Scanner(System.in);
                int data=0;
                int top[] = new int[3];
                top[0]=0;
                top[1]=0;
                top[2]=0;
                for(int i=0;i<10;i++){
                        data=scan.nextInt();
                        if(data>top[2]){
                                if(data>top[1]){
                                        if(data>top[0]){
                                                top[2]=top[1];
                                                top[1]=top[0];
                                                top[0]=data;
                                                continue;
                                        }
                                        top[2]=top[1];
                                        top[1]=data;
                                        continue;
                                }
                                top[2]=data;
                                continue;
                        }
                }
                System.out.println(top[0]+"\n"+top[1]+"\n"+top[2]);
                
        }
}

Measured memory_bytes: 17176
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int n, W;
	cin >> n >> W;
	vector<long long> w(n), v(n), dp(W + 1, 0);
	for (int i = 0; i < n; ++i) {
		cin >> w[i] >> v[i];
	}
	long long ans = 0;
	for (int i = 0; i < n; ++i) {
		for (int j = W; j >= w[i]; --j) {
			dp[j] = max(dp[j], dp[j - w[i]] + v[i]);
			ans = max(dp[j], ans);
		}
	}

	cout << ans << endl;
	cin >> n;

}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int S;
  cin >> S;
  int a, b;
  a = S / 100;
  b = S - a * 100;
  bool aM, bM;
  if(a > 0 && a < 13){
    aM = true;
  } else {
    aM = false;
  }
  if(b > 0 && b < 13){
    bM = true;
  } else {
    bM = false;
  }
  if (aM && bM){
    cout << "AMBIGUOUS" << endl;
  } else if (aM && !bM){
    cout << "MMYY" << endl;
  } else if (!aM && bM){
    cout << "YYMM" << endl;
  } else {
    cout << "NA" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0

for i in range(a+1):
	for j in range(b+1):
		for k in range(c+1):
			ans = (i * 500) + (j * 100) + (k * 50) 
			if ans == x:
				count = count + 1
print(count)

Measured memory_bytes: 3064
a, b, k = gets.split.map(&:to_i)

def exchange(x, y)
  x -= 1 if x.odd?
  y += (x /= 2)
  [x, y]
end

k.times do |i|
  if i.even?
    a, b = exchange(a, b)
  else
    b, a = exchange(b, a)
  end
end

puts "#{a} #{b}"

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

int main() {
    /* 入力受け取り */
    int n, Q;
    cin >> n >> Q;
    vector<long long> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];

    /* Q 回分のクエリを処理 */
    for (int j = 0; j < Q; ++j) {
        long long x; cin >> x; // 各クエリ x

        /* 合計値 */
        long long res = 0;

        /* 区間の左端 left で場合分け */
        int right = 0;     // 毎回 right を使い回すようにする
        long long sum = 0; // sum も使い回す
        for (int left = 0; left < n; ++left) {
            /* sum に a[right] を加えても大丈夫なら right を動かす */
            while (right < n && sum + a[right] <= x) {
                sum += a[right];
                ++right;
            }

            /* break した状態で right は条件を満たす最大 */
            res += (right - left);

            /* left をインクリメントする準備 */
            if (right == left) ++right; // right が left に重なったら right も動かす
            else sum -= a[left]; // left のみがインクリメントされるので sum から a[left] を引く
        }

        cout << res << endl;
    }
}


Measured memory_bytes: 3544
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String str = sc.next();
        char c[] = str.toCharArray();
        
        // set: 英小文字の出現位置
        TreeSet[] set = new TreeSet[26];
        for (int i = 0; i < 26; i++) {
            set[i] = new TreeSet<Integer>();
        }
        for (int i = 0; i < n; i++) {
            char chr = c[i];
            set[chr - 'a'].add(i);
        }
        
        int query = sc.nextInt();
        
        while (query-- > 0) {
            int type = sc.nextInt();
            
            if (type == 1) {
                int index = sc.nextInt() - 1;
                char chr = c[index];
                char chr2 = (sc.next()).charAt(0);
                set[chr - 'a'].remove(index);
                set[chr2 - 'a'].add(index);
                c[index] = chr2;
            } else {
                int start = sc.nextInt() - 1;
                int end = sc.nextInt() - 1;
                
                // count: start - end区間内にある英小文字の種類数
                int count = 0;
                for (int i = 0; i < 26; i++) {
                    if (set[i].ceiling(start) == null) continue;
                    
                    if ((int)set[i].ceiling(start) <= end) {
                        count++;
                    }
                }
                System.out.println(count);
            }
        }
        
    }
}

Measured memory_bytes: 109652
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define INF 999999999
#define rep(i, n) for(int i = 0;i < n;i++)
#define pb(n) push_back(n)
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define Vecpr vector<pair<lli,lli>>
int main() {
  lli A,B,C,D;
  string a,b,c;
  cin >>A>>B>>C;
  Out((A+B)*C/2);
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <bitset>
#include<vector>
#include<cstdlib>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define rep(i,k) for(int i=0;i<k;i++)
ll n, m, i, j, k,o,l,z;
ll a[100005], b[100005],inf=1000000000000;
string s;
ll t[100005], xx[100005];
ll p[10], q[10], r[10] = {}, aa[10] = {};
ll tansaku(ll x,ll n,ll* s) {
	int max,min, mid ;
	min = 0; 	max = n + 1; 
	while (max - min > 1) {
		mid = (min + max) / 2;
		
		if (s[mid] > x) {
			max = mid;
		}
		else {
			min = mid;
		}
	//	cout << max << "\n";
	}	
	return max;

}

ll hikaku(ll* s, ll* t, ll o, ll p,ll k) {
	ll z = min((abs(s[o] - k) + abs(s[o] - t[p])), (abs(t[p] - k) + abs(s[o] - t[p])));
	ll zz = min((abs(s[o] - k) + abs(s[o] - t[p-1])), (abs(t[p-1] - k) + abs(s[o] - t[p-1])));
	ll za = min((abs(s[o - 1] - k) + abs(s[o - 1] - t[p])), (abs(t[p] - k) + abs(s[o - 1] - t[p])));
	ll zb = min((abs(s[o - 1] - k) + abs(s[o - 1] - t[p-1])), (abs(t[p-1] - k) + abs(s[o - 1] - t[p-1])));
	z = min(z, zz);
	return min(z, min(za, zb));
}


int main() {
	ll o,pp=1,qq=1;
	t[0] = 0;
	t[1] = 1;
	for (i = 2; i < 11; i++)t[i] = t[i - 1] * i;
	cin >> n ;
	rep(i, n)cin >> p[i ];
	rep(i, n)cin >> q[i ];
	rep(i, n) {
		o = p[i];
		aa[o]++;
		k = 0;
		for (j = 1; j <o; j++) {
			if (aa[j] == 0)k++;
		}
		
		pp += k * t[n - i - 1];
	}
	rep(i, n) {
		o = q[i];
		r[o]++;
		k = 0;
		for (j = 1; j < o; j++) {
			if (r[j] == 0)k++;
		}
		qq += k * t[n - i - 1];
	}
	cout << abs(qq-pp);
	return 0;
}

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

#define mod 1000000007
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define repx(i,x,n) for(int i=x;i<n;i++)

// int ans(vector<int>& a,int k){
    
// }

int main(){
    ll n;
    ll d;
    cin>>n>>d;
    ll x[n],y[n],cnt=0;
    rep(i,n){
        cin>>x[i]>>y[i];
        ll dis=x[i]*x[i]+y[i]*y[i];
        if(dis<=d*d)cnt++;
    }
    cout<<cnt;
}


Measured memory_bytes: 6716
//#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <string.h>
#include <stdio.h>
using namespace std;
const int MAXN = 100009;
struct node
{
    double x, y;
};
struct Point
{
    double x, y;
    Point(double x = 0, double y = 0) : x(x), y(y) {}
} P[MAXN];

typedef Point Vector;
Vector operator +(Vector A, Vector B)
{
    return Vector(A.x + B.x, A.y + B.y);
}
Vector operator -(Vector A, Vector B)
{
    return Vector(A.x - B.x, A.y - B.y);
}
Vector operator *(Vector A, double p)
{
    return Vector(A.x * p, A.y * p);
}
Vector operator /(Vector A, double p)
{
    return Vector(A.x / p, A.y / p);
}
Vector operator -(Vector A)
{
    return  Vector(-A.x, -A.y);
}

const double EPS = 1e-10;
int dcmp(double x)
{
    if(fabs(x) < EPS) return 0;
    else return x < 0 ? -1 : 1;
}

bool operator == (const Point &a, const Point &b)
{
    return dcmp(a.x - b.x) == 0 && dcmp(a.y - b.y);
}

//向量点积
double Dot(Vector A, Vector B)
{
    return A.x * B.x + A.y * B.y;
}

//向量长度
double Length(Vector A)
{
    return sqrt(Dot(A, A));
}

//向量叉积
double Cross(Vector A, Vector B)
{
    return A.x * B.y - A.y * B.x;
}

//判断点是否在点段上，不包含端点
bool OnSegment(Point P, Point a1, Point a2)
{
    return dcmp(Cross(a1 - P, a2 - P) == 0 && dcmp((Dot(a1 - P, a2 - P)) < 0));
}

//点到直线距离
double DistanceToLine(Point P, Point A, Point B) 
{
    Vector v1 = B - A, v2 = P - A;
    return fabs(Cross(v1, v2) / Length(v1)); //不取绝对值，得到的是有向距离
}

//点在多边形内的判定
int isPointInPolygon(Point p, Point *poly, int n)
{
    int wn = 0;
    for(int i = 0; i < n; i++)
    {
        if(OnSegment(p, poly[i], poly[(i + 1) % n])) return -1; //在边界上
        int k = dcmp(Cross(poly[(i + 1) % n] - poly[i], p - poly[i]));
        int d1 = dcmp(poly[i].y - p.y);
        int d2 = dcmp(poly[(i + 1) % n].y - p.y);
        if(k > 0 && d1 <= 0 && d2 > 0) wn++;
        if(k < 0 && d2 <= 0 && d1 > 0) wn++;
    }
    if(wn != 0) return 1;       //内部
    return 0;                   //外部
}

//判断是否为凸多边形
bool isConvex(Point *poly, int n)
{
    bool s[3];
    memset(s, false, sizeof s);
    for(int i = 0; i < n; i++)
    {
        s[dcmp( Cross((poly[(i + 1) % n] - poly[i]), (poly[(i + 2) % n] - poly[i])) ) + 1] = true;
        if(s[0] && s[2])  
            return false;
    }
    return true;
}

bool LengthLong(int n, Point pa, double r)//点到线距离的最小值
{
    double ans = DistanceToLine(pa, P[0], P[1]);
    for(int i = 1; i < n - 1; i++)
    {
        ans = min(ans, DistanceToLine(pa, P[i], P[i + 1]));
    }
    if(dcmp(r-ans)<=0)
            return 1;
    return 0;
}

//点在直线上的投影
Point GetLineProjection(Point P, Point A, Point B) {
    Vector v = B - A;
    return A+v*(Dot(v, P-A)/Dot(v, v));
}

int main()
{
    Point p1,p2;
    cin>>p1.x>>p1.y>>p2.x>>p2.y;
    int k;
    cin>>k;
    while(k--)
    {
        Point p;
        cin>>p.x>>p.y;
        Point P=GetLineProjection(p,p1,p2);
        printf("%.10f %.10f\n",P.x,P.y);
    }
    return 0;   
}



Measured memory_bytes: 4844
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
//const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

int main() {
    int n; cin >> n;
    int ans = 0;
    int mx = 0;
    rep(i,n){
        int a; cin >> a;
        if (a >= mx){
            ans++;
            mx = a;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define rev(r) reverse(r.begin(),r.end())
#define SORT(ar) sort(ar.begin(), ar.end())
#define sz(x) (int)(x).size()
#define len(x) (int)x.length()
#define in(a) scanf("%lld",&a)
#define pr(x) printf("%d ",x)
#define endl '\n'
#define read(v,n) for(int h=0;h<n;h++) cin>>v[h];
#define fo(i,a,b) for(i=a;i<b;i++)
#define fi(i,a,b) for(i=a;i>=b;i--)
#define mo 1000000007
#define N 200007
ll bit[N];

void update(ll j,ll x)
{
    for(;j<N;j+=j&(-j))
        bit[j]=max(bit[j],x);
}
ll query(ll j)
{
    ll x=INT_MIN;
    for(;j>0;j-=(j)&(-j))
        x=max(bit[j],x);
    return x;
}

int main()
{
    ll n,x,i,q,y;
    in(n);
    ll h[n+1],a[n+1];
    fo(i,1,n+1) in(h[i]);
    fo(i,1,n+1) in(a[i]);
    fo(i,1,n+1)
    {

        update(h[i],query(h[i])+a[i]);
    }
    cout<<query(n)<<endl;
}


Measured memory_bytes: 4992
#include<iostream>
using namespace std;
int main(){
	int a,b;
	cin >> a >> b;
	if(a==1 && b!=1) cout << "Alice" << endl;
	else if(a==1 && b==1) cout << "Draw" << endl;
	else if(a!=1 && b==1) cout << "Bob" << endl;
	else if(a>b) cout << "Alice" << endl;
	else if(a==b) cout << "Draw" << endl;
	else cout << "Bob" << endl;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstring>
//#include<bits/stdc++.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<stack>
#include<cstdio>
#include<map>
#include<set>
#define  si(a)       scanf("%d",&a)
#define  sl(a)       scanf("%lld",&a)
#define  sii(a,b)    scanf("%d%d",&a,&b)
#define  sll(a,b)    scanf("%lld%lld",&a,&b)
#define  queues      priority_queue
#define mod 998244353
#define mem(a)  memset(a,0,sizeof(a));
#define def(a) ((a)&(-a))
#define fi  first
#define se  second
#define mp  make_pair
#define  pb push_back
#define mem(a,b) memset(a,b,sizeof(a));
typedef long long ll;
//priority_queue<ll,vector<ll >,greater<ll > >q;
const int INF=0x3f3f3f3f;
//const double E=exp(1);
//const double PI=acos(-1);
using namespace std;
//__builtin_popcount
//priority_queue
const ll MAX=100000;
ll gcd(ll a,ll b)
{
    return b==0?a:gcd(b,a%b);
}
ll kc(ll a,ll b)
{
    ll c=1;
    while(b)
    {
        if(b&1)c=(c*a)%mod;
        a=(a*a)%mod;
        b>>=1;
    }
    return c;
}
bool cmp(double x,double y)
{
    return x>y;
}
ll F[50003*3];
ll Find(ll a)
{
    return F[a]<0?a:F[a]=Find(F[a]);
}
ll same(ll a,ll b)
{
    if(Find(a)==Find(b))return 1;
    return 0;
}
ll up1(ll a,ll b)
{
    ll x,y;
    x=Find(a);
    y=Find(b);
    if(x!=y)
        F[x]=y;
    return 0;
}
int read() {
    int x=0,f=1;char s=getchar();
    for(;s>'9'||s<'0';s=getchar()) if(s=='-') f=-1;
    for(;s>='0'&&s<='9';s=getchar()) x=x*10+s-'0';
    return x*f;
}
 
int main()
{
   // ios::sync_with_stdio(false);
   ll a,b;
   cin>>a>>b;
  // if(abs(a-b)%2==0)cout<<abs(a-b)/2;
  if(abs(a+b)%2==0)cout<<(a+b)/2;
   else cout<<"IMPOSSIBLE\n";
}

Measured memory_bytes: 256
type 'a t = {
  mutable front : int;
  mutable mask  : int;
  mutable index : int;
  mutable length : int;
  mutable elems : (string * int) array
}

let capacity (t: (string * int) t) = t.mask + 1

let is_empty (t: (string * int) t) = t.length = 0

let create ?(capacity=1) () =
  { front = 0;
    mask  = capacity - 1;
    index = 0;
    length = 0;
    elems = Array.make capacity ("",0)}

let enq (t: (string * int) t) (a: string * int) =
  let (elems: (string * int) array) = t.elems in
  elems.(t.index) <- a;
  t.length <- t.length + 1;
  t.index <- if t.mask=t.index then 0 else t.index + 1

let deq (t: (string * int) t) =
  let (elems: (string * int) array) = t.elems in
  let (front: int) = t.front in
  let (res: string * int) = elems.(front) in
  t.front <- if t.mask=t.front then 0 else t.front+1;
  t.length <- t.length - 1;
  res

let () =
  let (n:int),(quantum:int) = Scanf.scanf "%d %d\n" (fun a b -> a,b) in
  let (q:(string * int) t) = create ~capacity:n () in
  for i=1 to n do
    enq q (Scanf.scanf "%s %d\n" (fun a b -> a,b));
  done;
  let (sum:int ref) = ref 0 in
  while not (is_empty q) do
    let (p:string),(t:int) = deq q in
    if t <= quantum then (sum := !sum+t; Printf.printf "%s %d\n" p !sum)
    else (enq q (p,t-quantum); sum := !sum+quantum)
  done

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

using namespace std;

double a , b , ans = 1;

int main()
{
	cin >> a >> b;
	if(a <= 0 && 0 <= b){
		cout << "Zero";
		return 0;
	}
	for(a ; a <= b ; a++){
		ans *= a;
	}
	if (0 < ans){
		cout << "Positive";
	}
	else if(ans < 0){
		cout << "Negative";
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n) ;i++)

using namespace std;
using p=pair<int,int>;
typedef long long ll;

int main() {
  float d, t, s;
  cin >> d >> t >> s;
  if(d/s<= t){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  return 0;

}

Measured memory_bytes: 3684
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdio>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define all(v) (v).begin(), (v).end()
#define rev(s) string((s).rbegin(), (s).rend())
#define MP make_pair
#define X first
#define Y second

using namespace std;

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

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

int main(){

	while(1){
		int n;
		cin >> n;
		if(!n) break;
		vector<P> r(n);

		r[0] = MP(0, 0);
		FOR(i, 1, n){
			int num, d;
			cin >> num >> d;

			P p = r[num];

			r[i].X = p.X + dx[d];
			r[i].Y = p.Y + dy[d];
		}

		int left = 0, bottom = 0, top = 0, right = 0;

		rep(i, n){
			left = min(left, r[i].X);
			bottom = min(bottom, r[i].Y);
			right = max(right, r[i].X);
			top = max(top, r[i].Y);
		}
		//cout << "***";
		cout << (right - left)+1 << ' ' << (top - bottom)+1 << endl;
	}

	return 0;
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

int main(){
    ll N, K;
    cin >> N >> K;
    ll ans = K * pow(K-1, N-1);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
from collections import Counter
n = int(input())
v = list(map(int, input().split()))
if len(set(v)) == 1:
    print(n // 2)
    exit()
kisu = v[::2]
gusu = v[1::2]
kisu_color = Counter(kisu).most_common()[:2]
gusu_color = Counter(gusu).most_common()[:2]
if kisu_color[0][0] != gusu_color[0][0]:
    ans = n - kisu_color[0][1] - gusu_color[0][1]
else:
    ans = min(n - kisu_color[0][1] - gusu_color[1][1], n - kisu_color[1][1] - gusu_color[0][1])
print(ans)

Measured memory_bytes: 17500
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int d[] = new int[N];
		for(int i=0;i<N;i++){
			d[i] = scan.nextInt();
		}
		
		int Ans = 0;
		for(int i=0;N>i;i++){
			for(int j=1+i;N>j;j++){
				Ans += d[i] * d[j];
			}
		}
		System.out.println(Ans);
	}
}

Measured memory_bytes: 21716
N=int(input())
L=list(map(int,input().split()))
for i in range(N):
  L[i]-=i
L=sorted(L)
if N%2==1:
  c=L[N//2]
  L1=[abs(i-c) for i in L]
  print(sum(L1))
else:
  c=L[N//2]
  d=L[(N//2)+1]
  L1=[abs(i-c) for i in L]
  L2=[abs(i-d) for i in L]
  print(min(sum(L1),sum(L2)))

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

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

const int mod = 1000000000 + 7;

void solve() {
	int n;
	cin >> n;
	if (n >= 30) {
		cout << "Yes\n";
	}
	else {
		cout << "No\n";
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int tt = 1;
	//cin >> tt;
	while (tt--) {
		solve();
	}
	return 0;
}


Measured memory_bytes: 3648
/* ITP1_7_A: Grading*/
/* 20181123 AOJ */

#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

typedef struct {
	int score[3];
	int sum;
} Student;

int main(void) {
	int i, n, m, f, r;
	Student std[50] = {0};

	i = 0;
	while(1){
		scanf("%d %d %d", &m, &f, &r);
		if(m == -1 && f == -1 && r == -1) {
			break;
		} else {
			std[i].score[0] = m;
			std[i].score[1] = f;
			std[i].score[2] = r;
			std[i++].sum = m + f;
		}
	}

	n = i;
	for(i = 0; i < n; i++) {
		if(std[i].score[0] == -1 || std[i].score[1] == -1) {
			printf("F\n");
		}else if(std[i].sum  >= 80) {
			printf("A\n");
		} else if (std[i].sum >=65) {
			printf("B\n");
		} else if(std[i].sum >= 50) {
			printf("C\n");
		} else if(std[i].sum >= 30) {
			if(std[i].score[2] >= 50) {
				printf("C\n");
			} else {
				printf("D\n");
			}
		} else {
			printf("F\n");
		}
	}

	return 0;
}


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

int main(){
    int64_t n, m;
    cin >> n >> m;
    int64_t ans = 0;
    if(2*n<=m){
        ans += n;
        m -= 2*n;
        n=0;
        ans += (int64_t)m/4;
    }else{
        ans += (int64_t)m/2;
        n -= (int64_t)m/2;
        m=0;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
using namespace std; using ll = long long; using ld = long double;  using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vpll = vector<pll>;
const ld PI = 3.1415926535897932;
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define rep1(n) for(ll i=0;i<n;++i)
#define rep2(i,n) for(ll i=0;i<n;++i)
#define rep3(i,a,b) for(ll i=a;i<b;++i)
#define rep4(i,a,b,c) for(ll i=a;i<b;i+=c)
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define mp make_pair
#define mt make_tuple
#define INT(...) int __VA_ARGS__;in(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;in(__VA_ARGS__)
#define ULL(...) ull __VA_ARGS__;in(__VA_ARGS__)
#define STR(...) string __VA_ARGS__;in(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__;in(__VA_ARGS__)
#define DBL(...) double __VA_ARGS__;in(__VA_ARGS__)
#define LD(...) ld __VA_ARGS__;in(__VA_ARGS__)
void in() {}
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head h, Tail... t) {
	cerr << " " << h;
	if (sizeof...(t) > 0) cerr << " :";
	debug_out(t...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vec) {
	for (size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	return os;
}
ll ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}
void vout(vl V) {
	for (ll i = 0; i < V.size(); i++) cout << V[i] << " ";
	cout << endl;
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.first > secondElof.first;
}
//**Snippetリスト**//
//rep, vin, all, iteLoop//
//bitSearch, bitList, nod, gcdlcm, isPrime, primeFactorize, Npow, divisor, modinv, dfs, bfs, eratos//
//dijkstra, WarshallFloyd, BellmanFord, UnionFind, COM, digitDP ,RMQ//
ll i, j, k, l; ll N, M, K, H, W, L, X, Y, Z, R, Q;
ll MOD = 1000000007; ll INF = 1LL << 62; ll ans = 0; ll z = 0, o = 1;
vl flag, color, D; vll path;
int main() {
	cin >> K;
	ll A, B;
	cin >> A >> B;
	for (i = A; i <= B; i++) {
		if (i % K == 0) {
			cout << "OK";
			exit(0);
		}
	}
	cout << "NG";
}

Measured memory_bytes: 3656
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int n,l;
char c[105][105];
int main()
{
	scanf("%d%d",&n,&l);
	for(int i=1;i<=n;i++)
	{
		scanf("%s",c[i]);
	}
	for(int i=1;i<=n;i++)
	{
		for(int j=i;j>1;j--)
		{
			if(strcmp(c[j],c[j - 1])<0)
			{
				swap(c[j - 1],c[j]);
			}
		}
	}
	for(int i=1;i<=n;i++)
	{
		printf("%s",c[i]);
	}
	return 0;
}


Measured memory_bytes: 3200
#include <iostream>
#include <algorithm>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

int main()
{
    int a, b;
    cin >> a >> b;
    cout << max(a + b, max(a - b, a * b)) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define elif else if
#define INF 1000000007
using namespace std;
int a,b=0,cnt=0,d;
string s;
char e,f,g;
signed main()
{
	cin>>a>>s;
	rep(i,1000){
		b=0;
		e=i/100+48;
		f=i%100/10+48;
		g=i%10+48;
		while(1){
			if(s[b]==e){
				break;
			}
			if(b>=a){
				goto ri;
			}
			b++;
		}
		while(1){
			b++;
			if(s[b]==f){
				break;
			}
			if(b>=a){
				goto ri;
			}
		}
		while(1){
			b++;
			if(s[b]==g){
				break;
			}
			if(b>=a){
				goto ri;
			}
		}
		cnt++;
		ri:;
	}
	cout<<cnt;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-10;
  
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};

bool equal(double lhs, double rhs){
  return (lhs - EPS <= rhs && rhs - EPS <= lhs);
}

int main(){
  double R;
  while(~scanf("%lf",&R)){
    if(equal(R,0.0)) break;
    for(int denominator = 1; denominator <= 10000000; denominator++){
      int upper = 10000000;
      int lower = 0;
      for(int round = 0; round < 30; round++){
        int mid = lower + (upper - lower)/2;
        if((double)mid/(double)denominator >= M_PI - R){
          upper = mid;
        }
        else{
          lower = mid;
        }
      }

      int numerator = upper;
      if((double)numerator/(double)denominator > M_PI + R) continue;

      printf("%d/%d\n",numerator,denominator);
      break;
    }
  }
}

Measured memory_bytes: 1200