akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
signed main(){
  int N;
  cin>>N;
  cout<<800*N-200*(N/15)<<endl;
  }


Measured memory_bytes: 256
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()

# int(input())
# map(int, input().split())


def solve():
    from collections import defaultdict
    import sys
    input = sys.stdin.readline
    mod = 998244353

    n = int(input())
    d = list(map(int, input().split()))
    if d[0] != 0:
        return 0

    dic = defaultdict(int)
    for d_ in d[1:]:
        if d_ == 0:
            return 0
        dic[d_] += 1

    ans = 1
    pre_key = 0
    pre_value = 1
    for key, value in sorted(dic.items()):
        if key != pre_key + 1:
            return 0
        ans = ans * (pre_value ** value) % mod
        pre_key = key
        pre_value = value
    return ans


if __name__ == '__main__':
    print(solve())


Measured memory_bytes: 66852
use std::cmp::*;
use std::io::*;
const MOD: u64 = 1_000_000_007;

mod enumeration {
    pub struct Enumeration {
        fact: Vec<u64>,
        finv: Vec<u64>,
        modulo: u64,
    }
    impl Enumeration {
        pub fn new(n: usize, modulo: u64) -> Enumeration {
            let mut fact: Vec<u64> = vec![1; n];
            let mut inv: Vec<u64> = vec![1; n];
            let mut finv: Vec<u64> = vec![1; n];
            for i in 2..n {
                fact[i] = fact[i - 1] * (i as u64) % modulo;
                inv[i] = modulo - (modulo / (i as u64)) * inv[(modulo as usize % i)] % modulo;
                finv[i] = inv[i] * finv[i - 1] % modulo;
            }
            Enumeration {
                fact: fact,
                finv: finv,
                modulo: modulo,
            }
        }
        pub fn c(&self, n: usize, k: usize) -> u64 {
            if n < k {
                return 0;
            }
            self.fact[n] * self.finv[n - k] % self.modulo * self.finv[k] % self.modulo
        }
    }
}

fn main() {
    let mut s: String = String::new();
    stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let a: Vec<usize> = (0..n + 1)
        .map(|_| itr.next().unwrap().parse().unwrap())
        .collect();

    let mut from = 0;
    let mut to = 0;
    let mut pos = vec![1 << 17; n + 1];
    for i in 0..n + 1 {
        if pos[a[i]] != 1 << 17 {
            from = pos[a[i]];
            to = i;
            break;
        }
        pos[a[i]] = i;
    }
    let len = from + n - to + 1;
    // 同じ部分列を除外するのがだるいが、
    // n + 1こ中nこは異なるので、どこでその重複する値を使うかのみが重要

    let en = enumeration::Enumeration::new(n + 2, MOD);
    let mut out = Vec::new();
    for i in 1..n + 2 {
        let mut ans = en.c(n + 1, i);
        ans = (ans + MOD - (en.c(len, i) - en.c(len - 1, i))) % MOD;
        writeln!(out, "{}", ans).ok();
    }
    stdout().write_all(&out).unwrap();
}


Measured memory_bytes: 13436
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readNInts = readInt >>= flip replicateM readInt

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	n :: Integer <- readLn
	print $ solve n 1

solve n r
	| r * r <= n = check n r + solve n ( succ r )
	| otherwise = 0

check n r = if q < m && q * m + r == n then m else 0
	where
		q = r
		m = ( n - r ) `div` q

Measured memory_bytes: 9264
#include <stdio.h>
 
int main(){
  int a;
  char s[10];
  
  scanf("%d", &a);
  scanf("%s", s);
  
  if(a >= 3200)
    printf("%s", s);
  
  else if(a<3200)
    printf("red");
  
 
  return 0;
}

Measured memory_bytes: 128
def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N = Z()
    A, B, C = [], [], []
    for i in range(N):
        a, b = ZZ()
        A.append(a)
        B.append(b)
        C.append([a+b, i])
    C.sort(reverse=True)
    output = 0
    for i in range(N):
        _, j = C[i]
        if i%2 == 0: output += A[j]
        else: output -= B[j]
    print(output)

    return

if __name__ == '__main__':
    main()


Measured memory_bytes: 28012
#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;
    cin >> n;

    int k;
    for (k = 2;; k++) {
        int t = k * (k - 1) / 2;
        if (t >= n) {
            if (t == n) {
                cout << "Yes" << endl;
                cout << k << endl;
                vector<vector<int>> a(k, vector<int>());
                int x = 0;
                for (int i = 0; i < k; i++) {
                    for (int j = 0; j < i; j++) {
                        x++;
                        a[i].push_back(x);
                        a[j].push_back(x);
                    }
                }
                for (int i = 0; i < k; i++) {
                    cout << a[i].size();
                    for (int j = 0; j < a[i].size(); j++) {
                        cout << ' ' << a[i][j];
                    }
                    cout << endl;
                }
            } else {
                cout << "No" << endl;
            }
            break;
        }
    }

    return 0;
}

Measured memory_bytes: 2304
#include <bits/stdc++.h>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=1;i<=(n);i++)
typedef long long ll;
#define ALL(obj) (obj).begin(), (obj).end()

int main() {
  
  int x;
  cin>>x;
  
  if(x<600){
  	cout<<8<<endl;
  }
  
   else if(x<800){
  	cout<<7<<endl;
  }
  
   else if(x<1000){
  	cout<<6<<endl;
  }
	
     else if(x<1200){
  	cout<<5<<endl;
  }
  
     else if(x<1400){
  	cout<<4<<endl;
  }
  
     else if(x<1600){
  	cout<<3<<endl;
  }
  
       else if(x<1800){
  	cout<<2<<endl;
  }
  
         else if(x<2000){
  	cout<<1<<endl;
  }
}

Measured memory_bytes: 3616
#include <iostream>

using namespace std;

bool dfs(int i, int n, int *a, int m) {
    if (i == n)
        return m == 0;
    
    if (dfs(i+1, n, a, m-a[i]))
        return true;
    if (dfs(i+1, n, a, m))
        return true;
    
    return false;
}

int main() {
    int n, q, m, *a;   cin >> n;
    a = new int[n];
    for (int i = 0; i < n; i++)
        cin >> a[i];
    cin >> q;
    
    for (int i = 0; i < q; i++) {
        cin >> m;
        
        if (dfs(0, n, a, m))
            cout << "yes" << endl;
        else 
            cout << "no" << endl;
    }
    
    return 0;
}



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

int main(){
  string S; cin >> S;
 
  vector<int> flag(S.size());
  vector<int> ans(S.size());
  
  int count = 0;
  for(int i=0; i<S.size(); i++){
    count++;
    if(i == S.size()-1 || S.at(i) != S.at(i+1)){
      flag.at(i) = count;
      count = 0;
    }  
  }
  
  bool change = false;
  int right;
  for(int i=0; i<S.size(); i++){
       
    if(flag.at(i) != 0 && change == false){
      right = i;
      change = true;
      continue;
    }
 
    if(flag.at(i) != 0 && change == true){
      change = false;
      ans.at(right) = (flag.at(right)+1)/2 + flag.at(i)/2;
      ans.at(right+1) = flag.at(right)/2 + (flag.at(i)+1)/2;
    }
  
  }
  
  for(int i=0; i<S.size(); i++)
    cout << ans.at(i) << ' ';
  

}

Measured memory_bytes: 1408
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

struct Team {
  int id, time;
  bool operator < (const Team& a) const { return time < a.time; }
};

int n;
Team teams[1000002];

void solve() {
  rep (i,n) {
    cin >> teams[i].id;
    teams[i].time = 0;
    int m, s;
    rep (j,4) {
      cin >> m >> s;
      teams[i].time += m * 60 + s;
    }
  }
  sort(teams, teams + n);
  const int ar[3] = { 0, 1, n-2 };
  rep (i,3) cout << teams[ ar[i] ].id << endl;
}

int main() {
  while (cin >> n, n) { 
    solve();
  }
  return 0;
}

Measured memory_bytes: 0
// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int N = 300 + 5, mod = 998244353;
int n, a[N];
long long dp[N][N*300+5], dp2[N][N*300 + 5];

int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n;
    int sum = 0;
    for (int i = 1; i <= n; i++){
        cin>>a[i];
        sum += a[i];
    }
    
    dp[0][0] = 1;
    //DP[i][j] is the number of colorings for the first i integers such that the sum of the red integers is j.
    for (int i = 1; i <= n; i++){
        for (int j = 0; j <= i*300; j++){
            if(a[i]<=j) dp[i][j] = dp[i-1][j-a[i]];
            (dp[i][j] += dp[i-1][j]*2)%=mod;
        }
    }
    
    int biger = (sum+1)/2;
    long long sub = 0;
    for (int j = biger; j <= 300*n; j++){
        (sub += dp[n][j])%=mod;
    }
    (sub *= 3)%=mod;
    
    //R = G = S/2, B = 0 or R = B = S/2, G = 0 twice.
    //need to make up for this duplicated subtraction
    long long sub2 = 0;
    if((sum&1)==0){//sum even
        if(dp[n][sum/2]!=0){
            dp2[0][0] = 1;
            for (int i = 1; i <= n; i++){
                for (int j = 0; j <= i*300; j++){
                    if(a[i]<=j) dp2[i][j] = dp2[i-1][j-a[i]];
                    (dp2[i][j] += dp2[i-1][j])%=mod;
                }
            }
            
            sub2 = (3ll*dp2[n][sum/2])%mod;
        }
    }
    
    long long ans =  1;
    for (int i = 1; i <= n; i++){
        (ans *= 3)%=mod;
    }
    
    ans = (ans - sub + mod)%mod;
    ans = (ans + sub2)%mod;
    cout<<ans<<endl;
    
    
    
    return 0;
}



Measured memory_bytes: 432384
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const int N = 200000 + 10;
int n, sz[N]; 
vector<int> g[N];
LL fac[N];
LL mpow(LL a, LL x){
	if (x==0) return 1;
	LL t = mpow(a, x>>1);
	if (x%2==0) return t*t%MOD;
	return t*t%MOD*a%MOD;
}
void dfs1(int u, int p) {
	sz[u] = 1;
	for (auto v: g[u]) {
		if (v == p) continue;
		dfs1(v, u);
		sz[u] += sz[v];
	}
}
LL ans[N];
void dfs2(int u, int p) {
	for (auto v: g[u]) {
		if (v == p) continue;
		ans[v] = ans[u] * sz[v] % MOD;
		ans[v] = ans[v] * mpow(n - sz[v], MOD - 2) % MOD;
		dfs2(v, u);
	}
}
int main() {
	fac[0] = 1;
	for (int i = 1; i < N; i ++) fac[i] = fac[i-1] * i % MOD;
	scanf("%d",&n);
	for(int i=1;i<n;i++){
		int u,v; scanf("%d%d",&u,&v);
		g[u].push_back(v);
		g[v].push_back(u);
	}
	dfs1(1, 1);
	ans[1] = fac[n];
	for (int i = 1; i <= n; i ++)
		ans[1] = ans[1] * mpow(sz[i], MOD-2) % MOD;
	dfs2(1, 1);
	for (int i = 1; i <= n; i ++)
		printf("%lld\n", ans[i]);
}

Measured memory_bytes: 17780
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC149A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ST = Console.ReadLine().Split(' ');
            Console.WriteLine("{0}{1}", ST[1], ST[0]);
        }
    }
}


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

using namespace std;

#define sz(x) (int) x.size()
#define all(a) a.begin(), a.end()

long long n, k;

int main() {

    cin >> n >> k;

    long long ans = n;

    if (n >= k) {
        n = n % k;
        ans = min(ans, n);
    }

    ans = min(ans, abs(k - n));
    cout << ans << endl;

    return 0;
}


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

int c=0;
int A[100000000];

void marge(int A[], int left, int mid, int right){
  int n1=0,n2=0;
  int L[500100];
  int R[500100];
  n1=mid-left;
  n2=right-mid;
  for(int i=0;i<n1;i++){
    L[i]=A[left+i];
  }
  for(int i=0;i<n2;i++){
    R[i]=A[mid+i];
  }
  L[n1]=INT_MAX;
  R[n2]=INT_MAX;
  int j=0;
  int i=0;
  for(int k=left;k<right;k++){
    c++;
    if(L[i]<=R[j]){
      
      A[k]=L[i];
      i++;
      
    }
    else {
      A[k]=R[j];
      j++;
    }
  }
}

void margesort(int A[], int left, int right){
  int mid=0;
  if(left+1<right){
    mid=(left+right)/2;
    margesort(A,left,mid);
    margesort(A,mid,right);
    marge(A,left,mid,right);
  }
}

int main(){
  int n=0;
  int left=0,right=0;
  //int S[100000000];
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  left=0;
  right=n;
  margesort(A,left,right);
  for(int i=0;i<n;i++){
    if(i!=0)cout<<" ";
    cout<<A[i];
  }
  printf("\n%d\n",c);
  
  return 0;
}




Measured memory_bytes: 7048
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const long long infll = (long long) 1.01e18;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

#ifdef DEBUG
mt19937 mrand(300); 
#else
mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count()); 
#endif

int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int maxn = (int) 2e5 + 5;
int n;
vector<int> g[maxn];

bool read() {
  if (scanf("%d", &n) < 1) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    g[i].clear();
  }
  for (int i = 0; i < n - 1; i++) {
    int v, u;
    scanf("%d%d", &v, &u);
    v--;
    u--;
    g[v].push_back(u);
    g[u].push_back(v);
  }
  return true;
}

int ps[maxn];
int mx[maxn];

void dfs0(int v, int p) {
  ps[v] = p;
  for (int i = 0; i < sz(g[v]); i++) {
    int u = g[v][i];
    if (u == p) {
      continue;
    }
    mx[u] = max(mx[v], v);
    dfs0(u, v);
  }
}

int del[maxn];
int dp[maxn];
int toadd[maxn];
int ts[maxn];

void getTs(int v) {
  ts[v] = 1;
  for (int i = 0; i < sz(g[v]); i++) {
    int u = g[v][i];
    if (del[u] || u == ps[v]) {
      continue;
    }
    getTs(u);
    ts[v] += ts[u];
  }
}

int get(int v, int x) {
  if (v > x) {
    return 0;
  }
  int res = 1;
  for (int i = 0; i < sz(g[v]); i++) {
    int u = g[v][i];
    if (del[u] || u == ps[v]) {
      continue;
    }
    res += get(u, x);
  }
  return res;
}

void dfsDel(int v, int val, int t) {
  dp[v] = val;
  toadd[v] = t;
  del[v] = true;
  for (int i = 0; i < sz(g[v]); i++) {
    int u = g[v][i];
    if (del[u] || u == ps[v]) {
      continue;
    }
    dfsDel(u, val, t);
  }
}

void updateDp(int v) {
  if (toadd[v] != -1) {
    dp[v] += dp[toadd[v]];
  }
  for (int i = 0; i < sz(g[v]); i++) {
    int u = g[v][i];
    if (u == ps[v]) {
      continue;
    }
    updateDp(u);
  }
}

void solve() {
  mx[0] = -1;
  dfs0(0, -1);
  for (int i = 0; i < n; i++) {
    del[i] = false;
    toadd[i] = -1;
  }
  for (int s = n - 1; s > 0; s--) {
    if (del[s]) {
      continue;
    }
    auto &cur = dp[s];
    cur = 1;
    vector<int> gs(sz(g[s]));
    for (int i = 0; i < sz(g[s]); i++) {
      int v = g[s][i];
      if (del[v] || v == ps[s]) {
        continue;
      }
      getTs(v);
      gs[i] = get(v, mx[s]);
      cur += gs[i];
    }
    toadd[s] = ps[s];
    del[s] = true;
    for (int i = 0; i < sz(g[s]); i++) {
      int v = g[s][i];
      if (del[v] || v == ps[s]) {
        continue;
      }
      int val = cur - gs[i] + ts[v];
      dfsDel(v, val, ps[s]);
    }
  }
  dp[0] = 0;
  updateDp(0);
  for (int i = 1; i < n; i++) {
    printf("%d ", dp[i]);
  }
  printf("\n");
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


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

//define
#define ALL(a) a.begin(),a.end()
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define debug(x) if(1) cout<<#x<<":"<<x<<endl;
#define DEBUG(x) if(1) cout<<#x<<":"<<x<<endl;
#define ll long long

//constant
const int MOD=1000000007;
const int INF=INT_MAX/3-1;
const double EPS=1e-9;
const int dx4[]={1,0,-1,0};
const int dy4[]={0,1,0,-1};

//typedef
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

int main(){
    int n,l;
    cin>>n>>l;
    vector<string> s(n);
    REP(i,n)
        cin>>s[i];

    sort(ALL(s));
    REP(i,n)
        cout<<s[i];
    cout<<endl;


    return 0;

}


Measured memory_bytes: 256
#include <cstdlib>
#include <cmath>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <map>
#include <list>
#define MOD 1000000007
#define INF 1000000000
typedef long long ll;
using namespace std;
typedef pair<int,int> P;

int main(void){
    int n,k;
    cin>>n>>k;
    vector<int>a(n);
    vector<int>b(200000);
    int cnt=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(b[a[i]]>=1){
            b[a[i]]++;
        }else{
            b[a[i]]=1;
            cnt++;
        }
    }
    
    if(cnt<=k){cout<<0<<endl;
        return 0;
    }
    cnt=cnt-k;
    //cout<<cnt<<endl;
    sort(b.begin(),b.end());
    int i=0;
    while(b[i]==0)i++;
    int ans=0;
    while(cnt--){
        ans+=b[i++];
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1792
liststr = list(input())
n = len(liststr)
listnum = []
for i in range(n):
    listnum.append(int(liststr.pop()))



a = [1]
for i in range(1, n):
    tmp = a[-1] * 10 + 2 ** (i-1)
    a.append(tmp)



sum1 = 0
for i in range(n):
    tmp = listnum[i]
    sum1 += int(tmp * a[i] * (2**(n-i-1)))
    
print(sum1)















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

int main() {
	int a, b;
	cin >> a >> b;
	if (a < b) {
		cout << "a < b\n";
	}
	else if (a == b) {
		cout << "a == b\n";
	}
	else if (a>b) {
		cout << "a > b\n";	
	}
	return 0;
}

Measured memory_bytes: 1124
N,K=map(int,input().split())
H=[0]*(K+1)
m=pow(10,9)+7

ans=0
i=K
while i>=1:
    H[i]=pow(K//i,N,m)
    j=2
    while j*i<=K:
        H[i]-=H[j*i]
        j+=1
    ans+=H[i]*i
    i-=1


print(ans%m)

Measured memory_bytes: 68892
# -*- coding: utf-8 -*-
import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

N, K = map(int, raw_input().split())
P = set([raw_input() for i in xrange(N)])

cnt = [0]*26
for p in P:
    cnt[ord(p[0]) - ord("A")] += 1

ans = 0
while 1:
    cnt.sort(reverse = True)
    k = 0
    for i in xrange(26):
        if cnt[i] > 0:
            k += 1
            cnt[i] -= 1
        if k == K:
            ans += 1
            break
    else:
        break
print ans


Measured memory_bytes: 5268
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;


int main(int argc, char* argv[])
{
    int n;
    scanf("%d", &n);

    printf("%d\n", (n-3+1)*180);


    return 0;
}


Measured memory_bytes: 128
from collections import deque

q = int(input())
a = deque()

for i in range(q):
    inp = input()
    # pushBack
    if inp[0] == "0":
        operation, x = list(map(int, inp.split()))
        a.append(x)

    # randomAccess
    elif inp[0] == "1":
        operation, p = list(map(int, inp.split()))
        print(a[p])

    # popBack
    else:
        a.pop()


Measured memory_bytes: 13816
#include <iostream>

int main(){
   int H, N;
   std::cin >> H >> N;
   int A;
   long long sum = 0;
   for(int i=0; i<N; ++i){
      std::cin >> A;
      sum += A;
   }
   std::cout << (sum<H ? "No" : "Yes") << std::endl;
   return 0;
   
}


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

using namespace std;

int main(){
	vector<string> days = {"MON","TUE","WED", "THU","FRI","SAT","SUN"};
	string d;
	cin>>d;
	if(d=="SUN") cout<<7;
	else{
		auto p = find(days.begin(),days.end(),d);
		cout<<days.end()-p-1;
		}
	
	return 0;
	}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <functional>
#include <map>
#include <set>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define INF 100000000
#define INFLL 100000000000
#define MOD 1000000007
#define PI 3.14159265359
#define All(a) (a).begin(), (a).end()

using namespace std;
using P = pair<ll, ll>;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

struct Edge {
  int to;     
  ll weight; 
  Edge(int t, ll w) : to(t), weight(w) { }
};

template<class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

template<class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}



string s;

ll pow3[1100000];

void pow3Init() {
  pow3[0] = 1;
  for (int i=1; i<1100000; ++i) {
    pow3[i] = (pow3[i-1] * 3) % MOD;
  }
}

int main () {
  pow3Init();

  cin >> s;
  int n = s.size();

  ll ans = 1;

  for (int i=n-1;i>=0;--i) {
    char tmp = s[i];

    if (tmp == '1') {
      ans = ans * 2 + pow3[n-1-i];
      ans %= MOD;
    }
  }

  cout << ans << "\n";
}

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

int main() {
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;
    string ans = "";
    /*1回目(行き)*/
    rep(i, tx - sx) ans += 'R';
    rep(i, ty - sy) ans += 'U';
    /*1回目(帰り)*/
    rep(i, tx - sx) ans += 'L';
    rep(i, ty - sy) ans += 'D';
    /*2回目(行き)*/
    ans += 'D';
    rep(i, tx - sx + 1) ans += 'R';
    rep(i, ty - sy + 1) ans += 'U';
    ans += 'L';
    /*2回目(帰り)*/
    ans += 'U';
    rep(i, tx - sx + 1) ans += 'L';
    rep(i, ty - sy + 1) ans += 'D';
    ans += 'R';
    cout << ans << endl;
}

Measured memory_bytes: 256
def merge(a, left, mid, right)
    n1 = mid - left
    n2 = right - mid
    l = []
    r = []
    for i in 0..n1 - 1
        l[i] = a[left + i]
    end 
    for i in 0..n2 - 1
        r[i] = a[mid + i]
    end
    l[n1] = Float::INFINITY
    r[n2] = Float::INFINITY
    i = 0
    j = 0
    for k in left..right-1
        $n += 1
        if l[i] <= r[j] then
            a[k] = l[i]
            i += 1
        else
            a[k] = r[j]
            j += 1
        end
    end
    return a
end

def mergeSort(a, left, right)
    if left + 1 < right then
        mid = (left + right) / 2
        mergeSort(a, left, mid)
        mergeSort(a, mid, right)
        return merge(a, left, mid, right)
    else
        return a
    end
    
end

$n = 0
gets
s = gets.split.map(&:to_i)
left = 0
right = s.length
s = mergeSort(s, left, right)

puts s.join(" ")
puts $n


Measured memory_bytes: 61716
#include <stdio.h>
#define MAX_INDEX (10050)
int main(){

    int N;
    scanf("%d", &N);

    int ans[MAX_INDEX] = {0};
    int i, j, k;
    for(i=1;i<105;i++){
        for(j=1;j<105;j++){
            for(k=1; k<105;k++){
                int v = i*i + j*j + k*k + i*j + j*k + k*i;
                if (v<10050){
                    ans[v] +=1;
                }
            }
        }
    }
    for(i=0;i<N;i++){
        printf("%d\n", ans[i+1]);
    }

    return 0;
}

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

int main(){
    while(1){
        int T,D,L;  cin>>T>>D>>L;
        if(T==0)break;

        int ans=0;
        int dtime=0;
        for(int i=0;i<T;i++){
            
            int x;  cin>>x;

            if(dtime){
                ans++;
                dtime--;
            }
            if(L<=x){
                dtime=D;
            }

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



Measured memory_bytes: 3068
import copy
N = int(input())
Dn = list(map(int,input().split(' ')))
d_map = {}
for d in Dn:
    if d not in d_map:
        d_map[d] = 1
    else:
        d_map[d] += 1
if 0 in d_map:
    print(0)
    exit(0)
if len(Dn) == 1:
    print(Dn[0])
    exit(0)
for v in d_map.values():
    if 3 <= v:
        print(0)
        exit(0)
all_combination = [ [0] ]
for k,v in d_map.items():
    if v == 1:
        len_all_combination = len(all_combination)
        for i in range(len_all_combination):
            tmp = copy.deepcopy(all_combination[i])
            all_combination[i].append(k)
            tmp.append(24-k)
            all_combination.append(tmp)
    else:
        for comb in all_combination:
            comb.append(k)
            comb.append(24-k)
ans = -1
for comb in all_combination:
    comb.sort()
    #print(comb)
    tmp = 100
    for i in range(1,len(comb)):
        if comb[i] > 12:
            tmp = min(tmp,min(comb[i]-comb[i-1],24-comb[i]))
        else:
            tmp = min(tmp,comb[i]-comb[i-1])
    ans = max(ans,tmp)
print(ans)

Measured memory_bytes: 42096
#include <iostream>

using namespace std;

int main()
{
    int a;
    int b;
    int c;
    int d;

    cin >> a >> b >> c >> d;

    int fee_train = min(a, b);
    int fee_bus = min(c, d);

    cout << fee_train + fee_bus << endl;

    return 0;
}


Measured memory_bytes: 256
from math import floor

word = input()
num = int(input())
length=len(word)

char_before= ''
sum=0
subsum =0
count= 0
stack=[]

for index in range(length):
    char_now=word[index]
    if index == 0 :
        char_before = char_now
        char_first=char_now
        count = 1
        if length==1:
            char_last=char_now
            stack.append(count)
        continue
    
    if char_before == char_now :
        count = count + 1
    else:
        char_before = char_now
        stack.append(count)
        count = 1
    
    if index == length-1:
        char_last=char_now
        stack.append(count)

for i in stack:
    subsum= subsum + floor(i/2)
    
if (stack[0]%2)==1 and (stack[-1]%2)==1 and char_last==char_first and len(stack)>=2:
    sum =(subsum+1)*num -1
elif len(stack)==1:
    sum = floor(length*num/2)
else:
    sum =(subsum)*num

print(sum)

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

int dp[101][100001];
int W[101];
int val[101];
int knapsack(int i,int sum,int n){
    if(sum<=0)return 0;
    if(i==n)return INT_MAX-1;
    if(dp[i][sum]!=-1)return dp[i][sum];
    dp[i][sum]=min(knapsack(i+1,sum-val[i],n)+W[i],knapsack(i+1,sum,n));
    
    return dp[i][sum];
   
}
int32_t main()
{
    int n,w;
    cin>>n>>w;
    memset(dp,-1,sizeof(dp));
    int sum=0;
    for(int i=0;i<n;i++){cin>>W[i]>>val[i];sum+=val[i];}
    
    int ans=0;
    for (int i = sum; i >= 0; i--) { 
        if (knapsack(0,i,n) <= w) { 
            ans= i; 
            break;
        } 
    }
    cout<<ans<<endl;


  return 0;
}

Measured memory_bytes: 82552
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef long double ld;
typedef complex<ld> com;
constexpr int inf = 1000000000;
constexpr ll INF = 1000000000000000000;
constexpr ld EPS = 1e-12;
constexpr ld PI = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }


signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);

	int n, m;
	cin >> n >> m;
	vector<int> a(m);
	rep(i, m) {
		cin >> a[i];
		n -= a[i];
	}
	cout << (n >= 0 ? n : -1) << '\n';
}

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

const int mxN = 2e5 + 5;
int a[mxN];

int main() {
	int n;
	cin >> n;
	for(int i = 1; i <= n; ++i)
		cin >> a[i];
	int answer = 0, look = 1;
	if(n == 1)
		return cout << (a[1] == 1 ? 0 : -1), 0; 
	for(int i = 1; i <= n; ++i) {
		if(a[i] == look) {
			++look;
			continue;
		}
		++answer;
	}
	cout << (look == 1 ? -1 : answer);
}


Measured memory_bytes: 4388
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll k;
  in(k);
  out((k / 2) * ((k + 1) / 2));
  memi;
}

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

int main() {
  int N;
  cin >> N;
  int64_t B = 1000000000000000000;
  int64_t C = 1000000000;
  int64_t A;
  int64_t sum = 1;
  int K = 0;
  for (int i = 0; i < N; i++) {
    cin >> A;
    if (sum > C && A > C){
      K++;
      sum = 1;
    }
      
    sum *= A;
    
    if (sum > B) {
      K++;
      sum = 1;
    }
  }
  if (sum <= B && K == 0) {
    cout << sum << endl;
  }
  else if (sum == 0) {
    cout << sum << endl;
  }
  else {
    cout << -1 << endl;
  }
    
}


Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>

using namespace std;

long long_abs(long num) {
    if (num > 0) return num;
    else return -num;
}

int main(int argc, const char * argv[]) {
    // insert code here...
    long n = 0;
    
    cin >> n;
    vector < long > lists;
    
    for(int i = 0; i < n; i++){
        long temp;
        cin >> temp;
        lists.push_back(temp);
    }
    
    sort(lists.begin(), lists.end());
    
    long maximum = lists[n-1];
    
    long result = lists[0];
    
    for(int i = 0; i < n-1; i++){
        if (long_abs(lists[i] * 2 - maximum-1) < long_abs(result * 2 - maximum-1)) result = lists[i];
    }
    
    cout << maximum  << " " << result << endl;
    
    return 0;
}


Measured memory_bytes: 1400
#include<iostream> 
#include<vector> 
#include<cmath> 
using namespace std; 
#define lld long long int
int main()
{ios_base::sync_with_stdio(false); 
cin.tie(0); 
int n,x,i,k,j; 
lld y; 
cin>>n>>k; 
lld  dp[n],h[n]; 
for( i=0; i<n;i++) 
 cin>>h[i]; 

 dp[0]=0; 
 dp[1]=abs(h[0]-h[1]); 

 for(i=2;i<n;i++) 
 { y=1000000000;
   for(j=i-k;j<i;j++) 
    {   if(j<0)
           j=0; 
      x=abs(h[i]-h[j])+dp[j]; 
        if(y>x) 
         y=x; 
    } 
   dp[i]=y; 
 }
cout<<dp[n-1]<<endl; 
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <stdlib.h>
#define ll long long
#define MOD_P 1000000007
using namespace std;

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

	if (a % 2 == 0) {
		if ((b - a) % 2) {
			printf("%lld", ((b - a + 1LL) / 2LL) % 2);
		} else {
			printf("%lld", (((b - a) / 2LL) % 2) ^ b);
		}
	} else {
		if ((b - a) % 2) {
			printf("%lld", a ^ b ^ ((b - a - 1LL) / 2LL) % 2);
		} else {
			printf("%lld", a ^ ((b - a) / 2LL) % 2);
		}
	}


	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
const int maxn = 2e5 + 10;
using namespace std;

typedef pair<ll, ll> pa;
int n, k;
ll a[maxn], b[maxn], c[maxn], d[maxn];
pa res[maxn];

int main() {
    while(scanf("%d", &n) != EOF) {
        for(int i = 1; i <= n; i++) scanf("%lld", &a[i]);
        for(int j = 1; j <= n; j++) scanf("%lld", &b[j]);
        sort(a + 1, a + n + 1);
        sort(b + 1, b + n + 1);
        ll ans = 0;
        for(ll i = 0; i <= 30; i++) {
            ll x = (ll)1 << i;
            for(ll j = 1; j <= n; j++) {
                res[j - 1].first = (b[j] / x) & 1;
                res[j - 1].second = (b[j] % x);
            }
            sort(res, res + n);
            int id = 0;
            ll tot = 0;
            for(int ii = 0; ii < n; ii++) if(!res[ii].first) id = ii + 1;
            for(ll j = 1; j <= n; j++) {
                ll nx = (a[j] / x) & 1;
                ll ny = a[j] % x;
                if(nx == 0) {
                    ///为0要进位
                    ll c = (lower_bound(res, res + id, pa(0, x - ny)) - res);
                    tot += id - c;
                    ///为1不要进位
                    tot += lower_bound(res + id, res + n, pa(1, x - ny)) - (res + id);
                } else { ///不需要进位就有1
                    ///为0不需要进位
                    tot += lower_bound(res, res + id, pa(0, x - ny)) - res;
                    ///为1需要进位
                    ll ix = lower_bound(res + id, res +n, pa(1, x - ny)) - (res +id);
                    tot += n - (lower_bound(res + id, res + n, pa(1, x - ny)) - res);
                }
                //cout << "tot = " << tot << endl;
            }
            //cout << "tot = " << tot << endl;
            if(tot & 1) ans = ans | x;
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 7552
#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)
#include <functional> // std::function<void(int)>

#define rep(i,n) for(int i = 0; i < n; i++)
#define ENDL "\n"
#define print(i) std::cout << (i) << "\n"

#define int long long // at least int64 > 9*10^18
#define all(v) v.begin(), v.end()

signed main() {
	int n;
	std::cin >> n;
	std::vector<std::string> strings(n);
	rep(i,n) {
		std::cin >> strings[i];
		std::sort(all(strings[i]));
	}
	std::map<std::string,int> count;
	for(auto i:strings) count[i]++;
	int sum = 0;
	for(auto i:count) {
		sum+=(i.second*(i.second-1))/2;
	}
	print(sum);

	return 0;
}


Measured memory_bytes: 18176
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(int i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

int main() {
  int n;
  cin >> n;
  vi dp(n + 1, 1e9);
  dp[0] = 0;
  rep(i, n) {
    dp[i + 1] = min(dp[i + 1], dp[i] + 1);
    int x = 6;
    while(i + x <= n) {
      dp[i + x] = min(dp[i + x], dp[i] + 1);
      x *= 6;
    }
    x = 9;
    while(i + x <= n) {
      dp[i + x] = min(dp[i + x], dp[i] + 1);
      x *= 9;
    }
  }
  cout << dp[n] << endl;
}

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

int main()
{
	int i;
	int a,n;
	for(i=0;i<4;i++)
	{
		cin >> a >> n;
		switch(a)
		{
			case 1:
				cout << n*6000 << endl ;
				break;
			case 2:
				cout << n*4000 << endl ;
				break;
			case 3:
				cout << n*3000 << endl ;
				break;
			case 4:
				cout << n*2000 << endl ;
				break;
		}
	}
	return 0;
}

Measured memory_bytes: 3084
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>

using namespace std;

#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i, a, b)  for(int i = (a); i < (b) ; i++)
#define pb push_back
#define SORT(v,n) sort(v, v+n)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define itn int
using ll = long long;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
///                →,↑,←,↓,↗,↖,↙,↘
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };



signed main() {
	int n, k;
	cin >> n >> k;
	ll ans = 1;
	for (int i = 0; i < n; i++) {
		if (i == 0) ans *= k;
		else ans *= k - 1;
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

vi calc(int n){
  vi cand;
  FOR(i,2,30001){
    if(i%2==0 || i%3==0 || i%5==0)cand.push_back(i);
  }
  while(true){
    vector<bool> used(30001, false);
    vi S;
    ll sm = 0;
    random_shuffle(ALL(cand));
    ll ggg = 0;
    REP(i,n-1){
      S.push_back(cand[i]);
      sm += cand[i];
      ggg = __gcd(ggg, (ll)cand[i]);
      used[cand[i]] = true;
    }
    if(ggg != 1)continue;
    FOR(i,2,30001){
      if(used[i])continue;
      ll nsum = sm + i;
      if(nsum%30 != 0)continue;
      if(__gcd(nsum, (ll)i)==1)continue;
      S.push_back(i);
      return S;
    }
  }
}

int main(){
  int n;
  scanf("%d",&n);
  vi S = calc(n);
  REP(i,n)printf("%d%c",S[i],i==n-1?'\n':' ');

  // FOR(n,3,20001){
  //   DEBUG(n);
  //   vi S = calc(n);
  //   ll sum = accumulate(ALL(S),0ll);
  //   REP(i,n)if(__gcd(sum,(ll)S[i])==1){
  //     printf("invalid : n=%d\n",n);
  //     exit(0);
  //   }
  //   ll ggg = 0;
  //   REP(i,n)ggg=__gcd(ggg,(ll)S[i]);
  //   if(ggg!=1){
  //     printf("invalid : n=%d\n",n);
  //     exit(0);
  //   }
  // }
  return 0;
}


Measured memory_bytes: 552
#include <bits/stdc++.h>
using namespace std;
#define int ll
#define ll long long
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353
#define MEM_SIZE 101010
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template <typename T>
void DEBUG(T e)
{
  if (DEBUG_OUT == false)
    return;
  std::cout << e << " ";
}
template <typename T>
void DEBUG(const std::vector<T> &v)
{
  if (DEBUG_OUT == false)
    return;
  for (const auto &e : v)
  {
    std::cout << e << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void DEBUG(const std::vector<std::vector<T>> &vv)
{
  if (DEBUG_OUT == false)
    return;
  for (const auto &v : vv)
  {
    DEBUG(v);
  }
}
template <class T, class... Ts>
void DEBUG(T d, Ts... e)
{
  if (DEBUG_OUT == false)
    return;
  DEBUG(d);
  DEBUG(e...);
}
template <class T>
void corner(bool flg, T hoge)
{
  if (flg)
  {
    cout << hoge << endl;
    abort();
  }
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//BELOW
//solve

void solve(void)
{
  double d, t, s;
  cin >> d >> t >> s;
  if (d / s <= t)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }

  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


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

int main(){
    int K, S;
    cin >> K >> S;
    int cnt = 0;
    
    for (int x = 0; x <= K; x++){
        for (int y = 0; y <= K; y++){
            if (S - x - y >= 0 && S - x - y <= K){
                cnt++;
            }
        }
    }
    cout << cnt << endl;
}

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

int main(){
  int64_t N,K;
  cin >> N >> K;
  
  int64_t mod;
  mod=N%K;
  if (mod == 0){
    cout <<0<<endl;
  }
  else if (mod>=K-mod){
    cout <<K-mod<<endl;
  }
  else{
    cout <<mod<<endl;
  }
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
const int INF = 2100100100;
using ll = long long;

// int main(){
//     int L;
//     cin >> L;
//     double l = L/3.l;
//     printf("%.12f\n.",pow(l,3));
//     return 0;
// }

int main() {
    int L;
    cin >> L;
 
    double d = L / 3.l;
    double ans = d * d * d;
 
    printf("%.10f", ans);
 
    return 0;
}

Measured memory_bytes: 256
n = input()
num = []
num = input().split(" ")
 
t = 0 
a=0 
while True: 
  num2=[] 
  for i in num: 
    if not int(i)%2==0:
      a =1
      break
    num2.append(int(i)/2)
  num = num2
  if a==1: 
     print(t) 
     break
  t+=1

Measured memory_bytes: 3060
#include<stdio.h>
#define NIL -1

static const int MAX = 500;
static const int INFTY = (1<<21);

main(){
  int n, i, j, k, c;
  int M[MAX][MAX];
  int d[MAX];
  int visited[MAX];
  int min = INFTY;
  int v, u;


  scanf("%d", &n);
  for ( i = 0; i< n; i++ ){
    for ( j = 0; j < n; j++ ){
      M[i][j] = INFTY;
    }
  }

  for ( i = 0; i < n; i++ ){
    scanf("%d %d", &u, &k);
    for ( j = 0; j < k; j++ ){
      scanf("%d %d", &v, &c);
      M[u][v] = c;
    }
  }

  for(i = 0; i < n; i++){
    d[i] = INFTY;
    visited[i] = 0;
  }
  d[0] = 0;

  while(1){
    u = NIL;
    min = INFTY;

    for(i = 0; i < n; i++){
      if(d[i] < min && !visited[i]){
	u = i;
	min = d[i];
      }
    }

    if(u == NIL) break;
    visited[u] = 1;

    for(v = 0; v < n; v++){
      if(d[v] >= d[u] + M[u][v]){
	d[v] = d[u] + M[u][v];
      }
    }
  }


  for ( i = 0; i < n; i++ ){
    printf("%d %d\n", i, (d[i]==INFTY?-1:d[i]));
  }

  return 0;
}

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

for i in range(N):
  a[i] = a[i] - (i+1)

a.sort()
med = [a[N//2-1],a[N//2]]
mina = 0
for i in range(N):
  mina += abs(a[i] - med[0])

minb = 0
for i in range(N):
  minb += abs(a[i] - med[1])

print(min(mina,minb))

Measured memory_bytes: 26704
#include<iostream>
using namespace std;
int main(){
	int n,m,a[1000];
	cin>>n>>m;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}

	for(int j=1;j<=m;j++){
		for(int i=0;i<n-1;i++){
			if(a[i]%j>a[i+1]%j){
				swap(a[i],a[i+1]);
			}
		}
	}
	for(int i=0;i<n;i++){
		cout<<a[i]<<endl;
	}
	return 0;
}

Measured memory_bytes: 3080
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,s,f) for(i=s;i<f;i++)
#define print(v) for(auto &z:v) cout<<z<<' ';cout<<'\n'
#define hi cout<<'h'<<'i'<<'\n' 
#define pb push_back
#define pii pair<int,int>
#define F first
#define S second
#define B begin()
#define E end()
#define sz(v) (int)((v).size())
#define vi vector<int>
#define vii vector<pair<int,int>>
#define boost ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define clk1 clock_t start_time=clock()
#define clk2 cout<<(clock()-start_time)/(double)CLOCKS_PER_SEC
#define clean(arr) memset(arr,0,sizeof(arr))
#define mod 1000000007
#define mod2 998244353
#define space 100005
//<<fixed << setprecision(9)

int main()
{
    int n,i,j,t;
    boost;

    cin>>t>>n;
    int sum=0;
    rep(i,0,n)
    {
        cin>>j;
        sum+=j;
    }
    if(sum>=t)cout<<"Yes";
    else cout<<"No";

    return 0;
}



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

  int A,B;cin>>A>>B;
  
  if(A<10&&B<10){
    cout<<A*B<<endl;
  }
  else{
    cout<<"-1"<<endl;
  }
}
    

Measured memory_bytes: 256
#include <iostream>

using namespace std;

#define rep(i, start, end) for (int(i) = (start); (i) < (end); i++)
#define len(a) (sizeof(a) / sizeof(a[0]))

int main() {
  string S;
  cin >> S;
  int a[26] = {0};
  rep(i, 0, S.length()) { a[S[i] - 'a']++; }

  rep(i, 0, len(a)) {
    if (a[i] == 0) {
      cout << char(i + 'a');
      return 0;
    }
  }
  cout << "None";
  return 0;
}

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

int main(){
    string s;   cin>>s;
    string ans="WA";

    if(s[0]=='A'&&s[s.length()-1]-'a'>=0){
        int Cnum=0;
        for(int i=2;i<s.length()-1;i++){
            if(s[i]=='C'){
                Cnum++;
            }
            else if(s[i]-'a'<0){
                ans="WA";
                break;
            }

            if(Cnum==1){
                ans="AC";
            }else ans="WA";
        }
        if(s[1]-'a'<0)ans="WA";
    }

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


Measured memory_bytes: 256
import numpy as np
import sys
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
XY = np.array(read().split(), np.int64)
X = XY[0::2]
Y = XY[1::2]

t = 0
for i in range(N):
    for j in range(i, N):
        t += math.sqrt((X[i] - X[j])**2 + (Y[i] - Y[j])**2)
print(2*t/N)

Measured memory_bytes: 12432
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < n; i++) {
			h[i] = sc.nextInt();
		}
		sc.close();

		Arrays.parallelSort(h);
		long ans = 0;
		for (int i = 0; i < n - k; i++) {
			ans += h[i];
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 65356
#include<cstdio>
#include<iostream>
#include<queue>
#include<map>
#include<cstring>
#include<string>
#include<set>
#include<algorithm>
using namespace std;
int n,m,mmp[11][10003],ans=0;
void dfs(int step)
{
    if(step==n){
        int temp=0,sum=0;
        for(int j=0;j<m;j++){
            temp=0;
            for(int i=0;i<n;i++)
                if(mmp[i][j])
                    temp++;
            sum+=temp>n-temp?temp:n-temp;
        }
        ans=max(ans,sum);
        return ;
    }
    dfs(step+1);
    for(int i=0;i<m;i++)
        mmp[step][i]=!mmp[step][i];
    dfs(step+1);
}
int main()
{
    while(scanf("%d %d",&n,&m)!=EOF){
        if(!n&&!m) break;
        ans=0;
        for(int i=0;i<n;i++)
            for(int j=0;j<m;j++)
                scanf("%d",&mmp[i][j]);
        dfs(0);
        printf("%d\n",ans);
    }
    return 0;
}

Measured memory_bytes: 3548
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  
  if (a + b > c + d) {
    cout << "Left" << endl;
  }
  else if (a + b < c + d) {
    cout << "Right" << endl;
  }
  else{
    cout << "Balanced" << endl;
  }

}

Measured memory_bytes: 256