akhauriyash/Code-Regression huggingface dataset:
c11, c12, c13 = map(int, input().split())
c21, c22, c23 = map(int, input().split())
c31, c32, c33 = map(int, input().split())

def correct():
  if a1 + b2 != c12:
    return False
  if a1 + b3 != c13:
    return False
  if a2 + b1 != c21:
    return False
  if a2 + b3 != c23:
    return False
  if a3 + b1 != c31:
    return False
  if a3 + b2 != c32:
    return False
  return True

for i in range(c11 + 1):
  for j in range(c22 + 1):
    for k in range(c33 + 1):
      a1 = i
      b1 = c11 - i
      a2 = j
      b2 = c22 - j
      a3 = k
      b3 = c33 - k
      if correct():
        print('Yes')
        exit(0)

print('No')


Measured memory_bytes: 3064
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

DIV=10**9+7

def cmb(n, r, DIV):
  if ( r<0 or r>n ):
    return 0
  r = min(r, n-r)
  return g1[n] * g2[r] * g2[n-r] % DIV

P = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, P + 1 ):
  g1.append( ( g1[-1] * i ) % DIV )
  inverse.append( ( -inverse[DIV % i] * (DIV//i) ) % DIV )
  g2.append( (g2[-1] * inverse[-1]) % DIV )

N,M=map(int,input().split())
if M==1:
  print(1)
  exit(0)
facs=factorization(M)
ans=1
for fac in facs:
  a,b=fac[0],fac[1]
  # 区別しないb個のモノを区別可能なN個の箱に分ける（0個の箱があってもよい）
  # (b+(N+1)) C b
  ans=((ans%DIV)*(cmb(b+(N-1),b,DIV))%DIV)%DIV

print(ans)


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

int main(){
    int n;
    cin >> n;
    int C[n+1];
    
    int N[n+1];
    for(int i=1; i<=n; i++){
        N[i] = 0;
    }
    int a,b,c,d;
    for(int i=0; i<n*(n-1)/2; i++){
        cin >> a >> b >> c >> d;
        if(c>d) {N[a]+=3;}
        else if(c==d) {N[a]+=1; N[b]+=1;
        }
        else if(c<d) {N[b]+=3;
        }
    }
    int s;
    for(int i=1; i<=n; i++){
        s=1;
        for(int j=1; j<=n; j++){
            if(N[i]<N[j]){
                s++;
            }
            C[i] = s;
        }
    }
    for(int i=1; i<=n; i++){
        cout << C[i] << endl;
    }
}

Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using pii = pair<int, int>;
 
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define x first
#define y second
 
const int MOD = 1e9 + 7;
 
void setIO() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
//    freopen((s+".in").c_str(),"r",stdin);
//    freopen((s+".text").c_str(),"w",stdout);
}

//ctrl q is comment
//ctrl b is run
//ctrl s is compile
//alt r is search & replace
//alt d is delete a line

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

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

using namespace std;

struct BIT {
    int64_t N;
    vector<int64_t> bit;

public:
    BIT(int64_t size) {
        N = 1LL;
        while(N < size) {
            N <<= 1LL;
        }
        bit.assign(N + 1, 0);
    }

    void add(int x, int64_t w) {
        for(int i = x; i <= N; i += i & (-i)) {
            bit[i] += w;
        }
    }

    int64_t sum(int x) {
        int64_t s = 0LL;
        for(int i = x; i > 0; i -= i & (-i)) {
            s += bit[i];
        }
        return s;
    }

    void clear() {
        bit.clear();
    }

    void debug() {
        for(int i = 1; i <= N; i++) {
            cout << ' ' << sum(i);
        }
        cout << endl;
    }
};

int main() {
    int64_t N, K;
    cin >> N >> K;
    vector<int64_t> a(N, 0);
    vector<int64_t> sum(N+1, 0);
    vector<int64_t> uni(N+1, 0);
    map<int64_t, int64_t> conv;

    for(int i = 0; i < N; i++) {
        cin >> a[i];
        a[i] -= K;
    }

    for(int i = 0; i < N; i++) {
        uni[i+1] = sum[i+1] = sum[i] + a[i];
    }

    sort(uni.begin(), uni.end());

    uni.erase(unique(uni.begin(), uni.end()), uni.end());
    for(int64_t i = 0; i < uni.size(); i++) {
        conv[uni[i]] = i+1;
    }

    BIT bit(N+1);
    int64_t ans = 0;

    for(int i = 0; i <= N; i++) {
        int64_t x = conv[sum[i]];
//        cout << x << ' ' << bit.sum(x+1) << endl;
        ans += bit.sum(x);
        bit.add(x, 1);
    }

    cout << ans << endl;
}

Measured memory_bytes: 19456
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <regex>
#include <cmath>
#include <vector>
#include <queue>
#include <functional>
#include <numeric>
#include <iomanip>
#include <stack>
#include <string>
#include <map>
#include <set>

using namespace std;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
template <class T>
using VVV = V<VV<T>>;
template <class T, class U>
using P = pair<T, U>;
template <class S, class T, class U>
using TUP = tuple<S, T, U>;

using ll = long long;
using ull = unsigned long long;
using dbl = double;
using ld = long double;
using str = string;
using vll = V<ll>;
using vll2 = VV<ll>;
using vll3 = VVV<ll>;
using pll = P<ll, ll>;
using tll = TUP<ll, ll, ll>;
using vpll = V<pll>;
using tpll = V<tll>;
using vs = V<str>;
using vvs = V<vs>;
using vd = V<dbl>;
using vvd = V<vd>;
using qll = queue<ll>;
using qpll = queue<pll>;
using mapll = map<ll, ll>;
using setll = set<ll>;

#define int ll
#define fst first
#define snd second
#define PQ priority_queue
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define popb pop_back()
#define sz size()
#define bn begin()
#define ed end()
#define FOR(i, a, b) for (ll i = (a); i <= (ll)(b); i++)
#define rFOR(i, a, b) for (ll i = (b); i >= (ll)(a); i--)
#define REP(i, n) FOR(i, 0, (n)-1)
#define REP1(i, n) FOR(i, 1, (n))
#define VFOR(i, v) for (auto &(i) : v)

signed main () {
    str X, Y;
    cin >> X >> Y;
    if (X < Y) {
        cout << "<" << endl;
    }else if(X > Y) {
        cout << ">" << endl;
    }else{
        cout << "=" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n, m = [int(t) for t in input().split()]
c    = [int(t) for t in input().split()]
assert len(c) == m

# ncoin[k] = k円支払うときの最小枚数
ncoin = {0: 0}

for k in range(1, n + 1):
    ncoin[k] = min(ncoin[k - x] + 1 for x in c if k >= x)

print(ncoin[n])


Measured memory_bytes: 11924
/*
 * Code Author: Akshay Miterani
 * DA-IICT
 */
import java.io.*;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.*;

public class Main {

	static double eps=(double)1e-6;
	static long mod=(long)1e9+7;
	static final long INF = Long.MAX_VALUE / 100;
	public static void main(String args[]) throws FileNotFoundException{
		InputReader in = new InputReader(System.in);
		OutputStream outputStream = System.out;
		PrintWriter out = new PrintWriter(outputStream);
		//----------------My Code------------------
		String s=in.next();
		if(s.charAt(0)==s.charAt(s.length()-1)){
			if(s.length()%2==0){
				out.println("First");
			}
			else{
				out.println("Second");
			}
		}
		else{
			if(s.length()%2!=0){
				out.println("First");
			}
			else{
				out.println("Second");
			}
		}
		out.close();
		//----------------The End------------------

	}

	static long modulo(long a,long b,long c) {
		long x=1;
		long y=a;
		while(b > 0){
			if(b%2 == 1){
				x=(x*y)%c;
			}
			y = (y*y)%c; // squaring the base
			b /= 2;
		}
		return  x%c;
	}
	static long gcd(long x, long y)
	{
		if(x==0)
			return y;
		if(y==0)
			return x;
		long r=0, a, b;
		a = (x > y) ? x : y; // a is greater number
		b = (x < y) ? x : y; // b is smaller number
		r = b;
		while(a % b != 0)
		{
			r = a % b;
			a = b;
			b = r;
		}
		return r;
	}
	static class Pair implements Comparable<Pair>{
		int x;
		int y;

		Pair(int xx,int yy){
			x=xx;
			y=yy;
		}
		@Override
		public int compareTo(Pair o) {
			if(Long.compare(this.x, o.x)!=0)
				return Long.compare(this.x, o.x);
			else
				return Long.compare(this.y, o.y);
		}
	}
	public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream inputstream) {
			reader = new BufferedReader(new InputStreamReader(inputstream));
			tokenizer = null;
		}

		public String nextLine(){
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
	}
}     

Measured memory_bytes: 11588
#include <iostream>
#include <algorithm>
#include <vector>
#include <climits>
const int INF = INT_MAX;

using namespace std;

struct RMQ {
    vector<int> data;
    int n;

    RMQ(int size) {
        n = 1;
        while(n < size) n *= 2;
        data = vector<int>(2*n-1, INF);
    }

    // 0??????????????則k?????????????卒????a????????卒??????
    void update(int k, int a) {
        k += n-1;
        data[k] = a;
        while(k > 0) {
            k = (k-1)/2;
            data[k] = min(data[2*k+1], data[2*k+2]);
        }
    }

    // minimum [a, b)
    int q(int a, int b) {
        return subq(a, b, 0, 0, n);
    }

    int subq(int a, int b, int k, int l, int r) {
        if(r <= a || b <= l) return INF;

        if(a <= l && r <= b) return data[k];
        else return min(subq(a, b, 2*k+1, l, (l+r)/2), subq(a, b, 2*k+2, (l+r)/2, r));
    }
};

int main() {
    int N, Q;
    cin >> N >> Q;
    RMQ rmq(N);
    for(int i = 0; i < Q; i++) {
        int comm, x, y;
        cin >> comm >> x >> y;
        if(comm == 0) rmq.update(x, y);
        else cout << rmq.q(x, y + 1) << endl;
    }
}

Measured memory_bytes: 3116
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

    static class B {
        int N;
        int[] W;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            N = in.nextInt();
            W = new int[N];
            for (int i = 0; i < N; i++) {
                W[i] = in.nextInt();
            }

            int[] ls = new int[N];
            ls[0] = W[0];
            int[] rs = new int[N];
            rs[N - 1] = W[N - 1];
            for (int i = 1; i < N; i++) {
                ls[i] = ls[i - 1] + W[i];
                rs[N - 1 - i] = rs[N - 1 - i + 1] + W[N - 1 - i];
            }
            int min = Integer.MAX_VALUE;
            for (int i = 0; i < N - 1; i++) {
                int diff = Math.abs(ls[i] - rs[i + 1]);
                min = Math.min(min, diff);
            }
            out.println(min);
        }

    }
}



Measured memory_bytes: 25172
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;

const int INF = 1001001001;

int main(void){
  int a, b, c;
  cin >> a >> b >> c;
  map<int, int> mp;
  mp[a]++;
  mp[b]++;
  mp[c]++;
  cout << mp.size() << endl;
  return 0;
}

Measured memory_bytes: 256
import numpy as np

N = int(input())

point = [[int(item) for item in input().split()] for _ in range(N)]
point.sort(key=lambda x:x[2], reverse=True)

ans = np.zeros((101,101))

for i,p in enumerate(point):
  if i == 0:
    for j in range(101):
      for k in range(101):
        H = p[2] + abs(j - p[0]) + abs(k - p[1])
        ans[j,k] = H
      #  print(ans[j,k])
  else:
    for j in range(101):
      for k in range(101):
        if not ans[j,k] == 0:
          if ans[j,k] != p[2] + abs(j - p[0]) + abs(k - p[1]):
            ans[j,k] = 0
  if len(ans[ans!=0]) <= 1:
    break
x,y = np.where(ans!=0)
print(x[0],y[0],int(ans[x[0],y[0]]))

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

int main(void)
{
	int n,i ;
	char a[200], b[200];
	scanf("%d", &n);
	scanf("%s%s", a, b);
	for(i=0;i<n;i++)
	{
		printf("%c%c", a[i], b[i]);
	}

	return 0;
}


Measured memory_bytes: 128
fun main(args: Array<String>) {
    val k = readLine()?.toInt() ?: return
    if (k <= 10) {
        println(k.toLong())
        return
    }
    var current = mutableListOf(1, 0)
    var direction = true
    var next = false
    0.until(k - 10).forEach {
        next = false
        direction = true
        var index = current.size - 1
        while (!next) {
            val v = current[index]
            if (index == 0) {
                // 左端
                if (v + 1 >= 10) {
                    current = (listOf(1) + current).toMutableList()
                } else {
                    current[index] += 1
                }
                direction = false
                index++
            } else if (index == current.size - 1) {
                // 右端
                val p = current[index - 1]
                if (direction) {
                    if (p - v <= -1 || v == 9) {
                        index--
                    } else {
                        current[index] += 1
                        next = true
                    }
                } else {
                    current[index] = Math.max(p - 1, 0)
                    next = true
                }
            } else {
                // それ以外
                val p = current[index - 1]
                val n = current[index + 1]
                if (direction) {
                    if ((p - v <= -1 || v - n >= 1) || v == 9) {
                        index--
                    } else {
                        current[index] += 1
                        direction = false
                        index++
                    }
                } else {
                    current[index] = Math.max(p - 1, 0)
                    index++
                }
            }
        }
    }
    val value = current.fold(0L, { a, b ->
        a * 10 + b
    })
    println(value)
}


Measured memory_bytes: 33776
A,B = map(int,input().split())

import fractions

GCD = fractions.gcd(A,B)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

PF = prime_factorize(GCD)

PF = set(PF)

res = len(PF) + 1

print(res)


Measured memory_bytes: 5048
MOD = 10 ** 9 + 7
N = int(input())
dp = [[[[0 for _ in range(4)] for _ in range(4)] for _ in range(4)] for _ in range(N + 1)]
dp[0][3][3][3] = 1
for len in range(N):
    for i in range(4):
        for j in range(4):
            for k in range(4):
                if dp[len][i][j][k] == 0: continue

                for l in range(4):
                    if l == 2 and i == 1 and j == 0: continue
                    if l == 2 and i == 0 and j == 1: continue
                    if l == 1 and i == 2 and j == 0: continue
                    if l == 2 and i == 1 and k == 0: continue
                    if l == 2 and j == 1 and k == 0: continue
                    dp[len + 1][l][i][j] += dp[len][i][j][k]
                    dp[len + 1][l][i][j] %= MOD
ans = 0
for i in range(4):
    for j in range(4):
        for k in range(4):
            ans += dp[N][i][j][k]
            ans %= MOD
print(ans)

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

int main() {
  int N, X, i;
  int min = 114514;
  
  cin >> N >> X;
  
  vector<int> m(N);
  
  for (i = 0; i < N; i++) cin >> m.at(i);
  
  for (i = 0; i < N; i++) {
    if(m.at(i) < min) min = m.at(i);
    X -= m.at(i);
  }  
  
  cout << m.size() + X / min << endl;  
}

Measured memory_bytes: 256
package main

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

const MOD = 1000000007

var sc = bufio.NewScanner(os.Stdin)

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

func getInt() int {
	sc.Scan()
	var i, e = strconv.Atoi(sc.Text())

	if e != nil {
		panic(e)
	}
	return i
}

func add(a *int, b int) {
	(*a) += b
	if (*a) >= MOD {
		(*a) -= MOD
	}
}

func main() {
	sc.Split(bufio.ScanWords)
	var H, W = getInt(), getInt()

	var grid = make([]string, H)
	for i := 0; i < H; i++ {
		grid[i] = readLine()
	}

	var dp = make([][]int, H)
	for i, _ := range dp {
		dp[i] = make([]int, W)
	}
	dp[0][0] = 1

	for i := 0; i < H; i++ {
		for j := 0; j < W; j++ {
			if i+1 < H && string(grid[i+1][j]) == "." {
				add(&dp[i+1][j], dp[i][j])
			}

			if j+1 < W && string(grid[i][j+1]) == "." {
				add(&dp[i][j+1], dp[i][j])
			}
		}
	}

	fmt.Println(dp[H-1][W-1])
}

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

#define NIL -1
#define MAX 500001

typedef struct{
  int right;
  int left;
  int key;
} Node;

void Insert(Node*,int,int);
void PreOrder(Node*,int);
void InOrder(Node*,int);
void Find(Node*,int, int);

int main(void){
  int i, n, k, f, count=0;
  char state[8];
  Node T[MAX];

  scanf("%d", &n);
  for(i = 0; i < n; i++){
    scanf("%s", state);

    if(state[0] == 'i'){

      scanf("%d",&k);
      Insert(T, count, k);
      count++;

    } else if(state[0] == 'p'){

      if(count > 0){
        InOrder(T, 0);
        printf("\n");
        PreOrder(T, 0);
        printf("\n");
      }

    } else if(state[0] == 'f'){

      scanf("%d", &f);
      Find(T, f, 0);

    }
  }
  return 0;
}

void Insert(Node *T,int count, int k){
  int x, y;

  T[count].key = k;
  T[count].left = NIL;
  T[count].right = NIL;

  if(count == 0) return;

  x = 0;
  while(x!=NIL){
    y = x;

    if(k < T[x].key) x = T[x].left;
    else x = T[x].right;

  }

  if(k < T[y].key) T[y].left = count;
  else T[y].right = count;

  return;
}

void PreOrder(Node *T, int u){

  if(u == NIL) return;

  printf(" %d", T[u].key);
  PreOrder(T, T[u].left);
  PreOrder(T, T[u].right);

  return;
}

void InOrder(Node *T, int u){

  if(u == NIL) return;

  InOrder(T, T[u].left);
  printf(" %d", T[u].key);
  InOrder(T, T[u].right);

  return;
}

void Find(Node *T, int f, int u){

  if(u == NIL) printf("no\n");
  else if(T[u].key == f) printf("yes\n");
  else if(T[u].key > f && T[u].left != NIL) Find(T, f, T[u].left);
  else Find(T, f, T[u].right);

  return;
}

Measured memory_bytes: 5308
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

S = input()

if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print(1)

Measured memory_bytes: 31192
H,W,K = map(int, input().split())
A = []
d = {'#':1, '.':0}
for i in range(H):
    A.append([d[x] for x in input()])


f=False
t = [0]*W
cnt=1

cnt2 = 0

for i in range(H):
    if f==False:

        if 1 not in A[i]:
            cnt2+=1
        else:
            n=0
            for j in range(W):
                if A[i][j]==1:
                    n+=1
            p = 0

            for j in range(W):
                t[j] = cnt+p

                if A[i][j] == 1:
                    p = min(p+1, n-1)

            for k in range(cnt2+1):
                print(*t)
            cnt2 = 0
            cnt = cnt + n
            if cnt>=(K+1):
                f=True


    else:
        print(*t)


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

#define UN unsigned
#define ll long long
#define mod 1000000007
#define pii pair<int, int>
#define pb push_back
//~ #define x first
//~ #define y second
const int N = 500000;

int main(void) {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.tie(nullptr);
	for(int i=1, x=0; i<=5; i++){
		cin >> x;
		if(x == 0) cout << i << endl;
	}
	
	return 0;
}

Measured memory_bytes: 3604
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > Q;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(int)(n);i++)

string s,t;

int main()
{
  cin>>s>>t;
  vector<int> ss(26),tt(26);

  bool flag=true;
  int len=s.size();

  rep(i,len)
  {
    int a=s[i]-97;
    int b=t[i]-97;
    ss[a]++;
    tt[b]++;
  }
  sort(ss.begin(),ss.end());
  sort(tt.begin(),tt.end());
  rep(i,26)
  {
    if(ss[i]!=tt[i]) flag=false;
  }
  if(flag) cout<<"Yes";
  else cout<<"No";
  cout<<endl;
}

Measured memory_bytes: 776
#include<bits/stdc++.h>
typedef long long ll;

int main()
{
    std::ios::sync_with_stdio(0);
    std::cin.tie(0); std::cout.tie(0);
    //freopen("input.txt", "r", stdin);
    int n,i,j,k,s;
    std::cin >> n;
    int a[n+2], b[n+1];
    for(i=1; i<=n; i++)
    {
        std::cin >> a[i] >> b[i];
    }
    double mx=0,mn=0;
    std::sort(a+1, a+n+1);
    std::sort(b+1,b+n+1);
    if(n%2==1)
    {
        mx = (double) b[(n+1)/2];
        mn =(double) a[(n+1)/2];
        std::cout << (int)(mx-mn+1) << '\n';
    }
    else
    {
        mx = (double) (b[n/2] + b[n/2+1])/2.0;
        mn = (double) (a[n/2] + a[n/2+1])/2.0;
        std::cout << (int)((mx-mn)*2 + 1) << '\n';
    }
    //std::cout << mx << " " << mn << '\n';
    return 0;
}


Measured memory_bytes: 5212
#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);

  int A, B, a, b;

  std::string S;

  std::cin >> A >> B >> S;

  char fmt[256], buf[256];

  sprintf(fmt, "%%0%dd-%%0%dd", A, B);

  if (sscanf(S.c_str(), fmt, &a, &b) == 2) {
    sprintf(buf, fmt, a, b);

    std::cout << (strcmp(S.c_str(), buf) == 0 ? "Yes" : "No") << std::endl;
  }
  else {
    std::cout << "No" << std::endl;
  }

  return 0;
}


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

int main(){
  int h;
  cin >> h;
  int w;
  cin >> w;
  vector<string> a(h);
  for(int i=0;i<h;i++) cin >> a[i];
  
  vector<bool> row(h,false);
  vector<bool> col(w,false);
  for(int i=0;i<h;++i) {
    for(int j=0;j<w;++j){
      if(a[i][j] == '#') {
        row[i] = true;
        col[j] = true;
      }
    }
  }
  for (int i=0;i<h;++i) {
    if(row[i]) {
      for(int j=0;j<w;++j) {
        if(col[j]) { 
          cout << a[i][j];
        }
      }
      cout << endl;
    }
  }

  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
#define REP(i, n) for (Int i = 0, max_i = (n); i < max_i; i++)
#define REPI(i, a, b) for (Int i = (a), max_i = (b); i < max_i; i++)
#define ALL(obj) begin(obj), end(obj)
#define RALL(obj) rbegin(obj), rend(obj)
#define fi first
#define se second
using ii = pair<Int, Int>;
template <class T> inline bool chmax(T& a, const T& b) {
    if (a >= b) return false;
    a = b;
    return true;
}
template <class T> inline bool chmin(T& a, const T& b) {
    if (a <= b) return false;
    a = b;
    return true;
}
struct in {
    int n;
    in() {}
    in(int n_) : n(n_){};
    template <class T> operator T() {
        T ret;
        cin >> ret;
        return ret;
    }
    template <class T> operator vector<T>() {
        vector<T> ret(n);
        for (int i = 0; i < n; i++) cin >> ret[i];
        return ret;
    }
};
struct SetupIO {
    SetupIO() { cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(20); }
} setup_io;

#ifdef _MY_DEBUG
#include "/Users/knshnb/.competitive_local.hpp"
#else
#define dump(...)
#endif

/**
 *    author:  knshnb
 *    created: Sun Dec  1 21:00:12 JST 2019
 **/

signed main() {
    Int t1 = in(), t2 = in();
    Int a1 = in(), a2 = in();
    Int b1 = in(), b2 = in();
    Int x1 = t1 * a1, x2 = t2 * a2;
    Int y1 = t1 * b1, y2 = t2 * b2;
    if (x1 + x2 == y1 + y2) {
        cout << "infinity" << endl;
        return 0;
    }
    if (x1 + x2 < y1 + y2) {
        swap(x1, y1), swap(x2, y2);
    }
    auto check = [&](__int128_t k) -> bool { return k * (x1 + x2) + x1 <= k * (y1 + y2) + y1; };
    Int ok = -1, ng = 1e18;
    while (abs(ok - ng) > 1) {
        Int mid = (ok + ng) / 2;
        (check(mid) ? ok : ng) = mid;
    }
    Int ans = 2 * (ok + 1) - 1;
    if (ok * (x1 + x2) + x1 == ok * (y1 + y2) + y1) ans--;
    cout << max(0LL, ans) << endl;
}


Measured memory_bytes: 256
//header{{{
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
//#include <boost/graph/adjacency_list.hpp>
//#include <boost/graph/dijkstra_shortest_paths.hpp>
//#include <boost/graph/graph_utility.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
#include <boost/version.hpp>
  
using namespace std;
//using namespace boost::multiprecision;
//using namespace boost::math;

/*
typedef boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS,
        boost::no_property, boost::property<boost::edge_weight_t, int> > Graph;
*/


#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define Fixed fixed << setprecision(12)
#define int int_fast64_t
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9+7; 
constexpr int mod2 = 998244353;

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class A, class B> using umap = unordered_map<A,B>;
  
inline int square(int a){ return a * a;}
inline int updiv(int a,int b){ return (a + b - 1) / b; }

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

signed main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout.setf(ios_base::fixed);
    cout.precision(10);

    int x;
    cin >> x;

    if(x >= 30){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }

    return 0;
}


Measured memory_bytes: 3600
package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	var A uint64
	var s string
	fmt.Scan(&A, &s)

	bs := strings.Split(s, ".")
	if len(bs) == 1 {
		b, _ := strconv.ParseUint(bs[0], 10, 64)
		fmt.Println(A * b)
		return
	}

	b, _ := strconv.ParseUint(bs[0], 10, 64)
	c, _ := strconv.ParseUint(bs[1], 10, 64)

	ret := A*b + A*c/100
	fmt.Println(ret)
}


Measured memory_bytes: 1824
#include <bits/stdc++.h>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif
#define rep(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;
typedef long long ll;

int N;

int query(int x) {
    cout << x << endl;
    string s;
    cin >> s;
    if (s == "Vacant") {
        exit(0);
    }
    if (s == "Male") {
        return 0;
    } else {
        return 1;
    }
}

// [head, tail)
int search(int x0, int head, int tail) {
    if (x0 == -1) return head;
    int mid = (head + tail) / 2;
    //printf("#%d %d %d %d\n", x0, head, tail, mid);
    int x = query(mid);
    if (x == -1) return mid;
    //printf("#x=%d x0=%d head=%d mid=%d\n", x, x0, head, mid);
    if ((x == x0) ^ (((mid - head) % 2) == 0)) {
        return search(x0, head, mid);
    } else {
        return search(x, mid, tail);
    }
}

signed main() {
    cin >> N;
    int x0 = query(0);
    search(x0, 0, N);
    return 0;
}

Measured memory_bytes: 852
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//const ll INF = 1LL << 60;
//const int INF = 1001001001;

int main(void){
    ll a,b,k;
    cin >> a >> b >> k;
    if(k>=a){
        k-=a;a=0;
    }else{
        a-=k;k=0;
    }
    if(k>0){
        if(k>=b) b=0;
        else b-=k;
    }
    cout << a << " " << b;
}

Measured memory_bytes: 3564
s = input()
w = ""
cnt1 = 0
for x in s[1:]:
	if x != w:
		cnt1 += 1
		w = x

cnt2 = 0
for x in s[-2::-1]:
	if x != w:
		cnt2 += 1
		w = x

print(min(cnt1, cnt2))


Measured memory_bytes: 3316
n,k = map(int,input().split())

p = list(map(int,input().split()))

iter_num = n - k + 1

num = sum(p[0:k])
ans = [(num+k)/2]
for i in range(iter_num-1):
	num = num - p[i] + p[k+i]
	ans.append((num+k)/2)

print(max(ans))


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

// 💖 Hi, thanks for using ICIE! 💖
// 🔧 To use a custom code template, set it in Settings(Ctrl+,) in "Icie Template List" entry 🔧
// 📝 If you spot any bugs or miss any features, create an issue at https://github.com/pustaczek/icie/issues 📝

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++)
        cout<<'x';
    return 0;
}



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

class pp{
    string name;
    int time;
    
    public:
    pp(string n,int t):name(n),time(t){} //コンストラクタ、引数で表す
    pp():name(""),time(0){} //初期化、これより下はpublicより上の変数を用いる
    int execute(int q){return time -= q;};
    string get_name(){return name;};
    int get_time(){return time;};
};

int main(){
    int n,q;
    cin >> n >> q;
    pp Q[n];
    string name;
    int time;
    for (int i=0;i<n;i++){
        cin >> name >> time ;
        Q[i] =pp(name,time);
    }
    int i = 0, last = 0,size=n, p =0 ,tt = 0;  //カンマ区切りだと全てint型に
    while(size > 0){
        p += q;
        tt = Q[i].execute(q);
        if (tt <=0){
            p += tt;
            cout << Q[i].get_name() << " " << p << endl;
            size --;
            i = (i+1)%n;//はみ出るのを防ぐ
        }else{
            Q[last] = Q[i];
            i = (i +1) % n; 
            last = (last +1) % n;
        }

    }
}


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

#define NIL -1

typedef struct{
    int parent, leftChild, rightSibling;
} Node;

void getDepth(int *depth, Node *nodes, int label, int val);
int getHeight(int *height, int *degree, Node *nodes, int label, bool sameLevel);

int main(int argc, char** argv) {
    int len, root, *depth, *height, *degree;
    Node* nodes;

    scanf("%d", &len);
    nodes = (Node *) calloc(sizeof(Node), len + 1);
    depth = (int *) calloc(sizeof(int), len + 1);
    height = (int *) calloc(sizeof(int), len + 1);
    degree = (int *) calloc(sizeof(int), len + 1);
    for (int i = 0; i < len; i++) {
        nodes[i].parent = nodes[i].leftChild = nodes[i].rightSibling = NIL;
    }

    for (int i = 0; i < len; i++) {
        int label, child1, child2;

        scanf("%d %d %d", &label, &child1, &child2);

        if (child1 == NIL && child2 != NIL) {
            int tmp = child1;
            child1 = child2;
            child2 = tmp;
        }

        if (child1 != NIL) {
            nodes[child1].parent = label;
            nodes[label].leftChild = child1;
        }

        if (child2 != NIL) {
            nodes[child2].parent = label;
            nodes[child1].rightSibling = child2;
        }
    }

    for (int i = 0; i < len; i++) {
        if (nodes[i].parent == NIL) {
            root = i;
            break;
        } 
    }

    getDepth(depth, nodes, root, 0);

    getHeight(height, degree, nodes, root, false);

    for (int i = 0; i < len; i++) {
        printf("node %d: parent = %d, sibling = ", i, nodes[i].parent);
        if (i != root) {
            int ctr = 0;
            for (int j = nodes[nodes[i].parent].leftChild; j != NIL; j = nodes[j].rightSibling) {
                if (j != i) {
                    ctr++;
                    printf("%d, ", j);
                }
            }

            if (ctr == 0) {
                printf("-1, ");
            }
        } else {
            printf("-1, ");
        }

        printf("degree = %d, depth = %d, height = %d, ", degree[i], depth[i], height[i]);
        printf("%s", i == root ? "root" : (nodes[i].leftChild == NIL ? "leaf" : "internal node"));
        printf("\n");
    }

    free(nodes);
    free(depth);
    free(height);
    free(degree);
    return 0;
}

void getDepth(int *depth, Node *nodes, int label, int val) {
    depth[label] = val;

    if (nodes[label].leftChild != NIL) {
        getDepth(depth, nodes, nodes[label].leftChild, val + 1);
    }

    if (nodes[label].rightSibling != NIL) {
        getDepth(depth, nodes, nodes[label].rightSibling, val);
    }
}

int getHeight(int *height, int *degree, Node *nodes, int label, bool sameLevel) {
    int h = 0, h1 = 0, h2 = 0;

    if (sameLevel) {
        degree[nodes[label].parent]++;
    }

    if (nodes[label].leftChild != NIL) {
        degree[label]++;
        h1 = getHeight(height, degree, nodes, nodes[label].leftChild, false) + 1;
    }
    height[label] = h1;
    
    if (nodes[label].rightSibling != NIL) {
        h2 = getHeight(height, degree, nodes, nodes[label].rightSibling, true);
    }

    h = h1 > h2 ? h1 : h2;

    return h;
}


Measured memory_bytes: 2712
#include <bits/stdc++.h>
#define cout16 cout << setprecision(16) 
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define MAX(A) *max_element(A.begin(),A.end())
#define MIN(A) *min_element(A.begin(),A.end())
#define SORT(A) sort(A.begin(),A.end())
#define REV(A) reverse(A.begin(),A.end())
typedef long long int ll;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vll = std::vector<ll>;
using vvll = std::vector<std::vector<ll>>;
using P = std::pair<int,int>;
using vp = std::vector<P>;
using namespace std;
#define INF 1001001001
#define LL_INF 1001001001001001001
#define fi first
#define se second
// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
  //stream
  friend ostream& operator<<(ostream& os, const mint a);
};
ostream& operator<<(ostream& os, const mint a){
  os << a.x;
  return os;
}
// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};
int main(void) {
	int n,k; cin >> n >> k;
	combination c(n+5);
	for(int i=1; i<=k; i++){
		mint add;
		int r = n-k;
		int b = k;
		add = c(r+1,i)*c(k-1,i-1);
		cout << add << endl;
	}
}




Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<stdio.h>
#include<queue>
#include<stack>

using namespace std;

typedef long long ll;
typedef double db;
typedef vector<int> vint;
typedef vector<ll> vll;

bool mark[28];//p!

int main(){
    string s;
    cin>>s;

    for(int i=0; i<s.size(); i++){
        int x=s[i]-'a';
        mark[x]= true;
    }

    for(int i=0; i<26; i++){
        if(mark[i]==false){
            char a = i+'a';
            cout<<a<<endl;
            return 0;
        }
    }
    cout<<"None"<<endl;
    return 0;
}

Measured memory_bytes: 512
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
#どっかで最悪計算量の入力データを用意する関数を作ろう？
"""
愚直に操作を実装する
"""
#solution:
N=int(input())
B=list(pin())
#まるでDPしてみろと言われた問題だな
A=[B[0]]+[0]*(N-2)+[B[-1]]
for i in range(1,N-1):
    A[i]=min(B[i-1],B[i])
print(sum(A))

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

maxt = None
for i in range(1, 2**10):
  total = 0
  for _f, _p in zip(f, p):
    c = 0
    for bi, fi in zip(reversed(bin(i)[2:]), _f):
      if fi==1 and int(bi)==1:
        c += 1
    total += _p[c]
  maxt = max(total, maxt) if maxt is not None else total
print(maxt)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <string.h>
#include <stack>
#include <queue>
#include <algorithm>
#include <climits>
#include <cmath>
#include <map>
#define REP(i,n) for(ll i=0;i<(n);i++)
#define MOD 1000000007
#define int long long
#ifdef int
const long long INF = LLONG_MAX / 10;
#else
const int INF = 1010101010;
#endif
using namespace std;
typedef long long ll;
typedef vector<vector<ll>> mat;
typedef pair<int, int> P;
//typedef pair<double, double> P;

string X;
stack<char> sta;

signed main()
{
    cin >> X;

    for (char c : X) {
        if (c == 'S') sta.push(c);
        else {
            if (sta.empty() || sta.top() == 'T') sta.push(c);
            else if (sta.top() == 'S') sta.pop();
        }
    }

    cout << sta.size() << endl;
}


Measured memory_bytes: 644
/**
 * @author Finn Lidbetter
 */
import java.util.*;
import java.io.*;
import java.awt.geom.*;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();
    String[] s = br.readLine().split(" ");
    int H = Integer.parseInt(s[0]);
    int W = Integer.parseInt(s[1]);
    int h = Integer.parseInt(s[2]);
    int w = Integer.parseInt(s[3]);

    if (h==1 && w==1) {
      System.out.println("No");
      System.exit(0);
    }
    int neg = -h*w;
    int[][] mat = new int[H][W];
    int sum =0;
    for (int i=0; i<H; i++) {
      for (int j=0; j<W; j++) {
        mat[i][j] = 1;
        if ((i+1)%h==0 && (j+1)%w==0) {
          mat[i][j] = neg;
        }
        sum += mat[i][j];
      }
    }
    if (sum>0) {
      System.out.println("Yes");
      for (int i=0; i<H; i++) {
        for (int j=0; j<W; j++) {
          sb.append(mat[i][j]);
          sb.append(" ");
        }
        sb.delete(sb.length()-1, sb.length());
        sb.append("\n");
      }
      System.out.print(sb);
    } else {
      for (int i=0; i<H; i++) {
        Arrays.fill(mat[i],0);
      }
      sum = 0;
      for (int i=0; i<H; i++) {
        for (int j=0; j<W; j++) {
          if ((i+1)%h==0 && (j+1)%w==0) {
            mat[i][j] = neg-1000;
          } else if (i%h==0 && j%w==0) {
            mat[i][j] = 1001;
          } else {
            mat[i][j] = 1;
          }
          sum += mat[i][j];
        }
      }

      if (sum>0) {
        System.out.println("Yes");
        for (int i=0; i<H; i++) {
          for (int j=0; j<W; j++) {
            sb.append(mat[i][j]);
            sb.append(" ");
          }
          sb.delete(sb.length()-1, sb.length());
          sb.append("\n");
        }
        System.out.print(sb);
      } else {
        System.out.println("No");
      }
    }
  }
}


Measured memory_bytes: 35144
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm> 
#include<cstring>
#define ios ios::sync_with_stdio(false)
#define mem(arr) memset(arr,0,sizeof(arr))
using namespace std;
typedef long long ll;
const ll maxn = 1e6 + 10;
int main()
{
	int k,x;
	cin>>k>>x;
	if(x <= k * 500)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
	return 0;	
}

Measured memory_bytes: 3584
ct=0
n=int(input())
li=list(map(int,input().split()))
n=len(li)
val=0
for i in range(n):
    side1=li[i]
    for ii in range(i+1,n):
        side2=li[ii]
        for iii in range(ii+1,n):
            side3=li[iii]
            if side1!=side2 and side2!=side3 and side1!=side3:
                if side3<side2+side1 and side2<side1+side3 and side1<side2+side3:
                    # print(side1,side2,side3,i+1,ii+1,iii+1)
                    val+=1
print(val)


Measured memory_bytes: 73820
using System;
using System.Collections.Generic;

namespace abc140_c
{
  class Program
  {
    static void Main(string[] args)
    {
      var n = CIn.ReadInt();
      var b = CIn.ReadIntArray(n - 1);

      var sum = b[0] + b[n - 2];

      for (var i = 0; i < n - 2; i++)
      {
        sum += Math.Min(b[i], b[i + 1]);
      }

      Console.WriteLine(sum);
    }
  }

  class CIn
  {
    private static readonly Queue<string> fieldBuffer = new Queue<string>();

    public static string Read()
    {
      if (fieldBuffer.Count == 0)
      {
        foreach (var field in Console.ReadLine().Split())
        {
          fieldBuffer.Enqueue(field);
        }
      }

      return fieldBuffer.Dequeue();
    }

    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());

    public static string[] ReadStringArray(long n)
    {
      var array = new string[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = Read();
      }

      return array;
    }

    public static int[] ReadIntArray(long n)
    {
      var array = new int[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadInt();
      }

      return array;
    }

    public static long[] ReadLongArray(long n)
    {
      var array = new long[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadLong();
      }

      return array;
    }
    public static double[] ReadDoubleArray(long n)
    {
      var array = new double[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadDouble();
      }

      return array;
    }
  }
}

Measured memory_bytes: 13268
#include <stdio.h>

int main(){
	int top3[3]={0}, i, j, k, input;

	for( i=0; i<10; i++ ){
		scanf("%d", &input);
		for( j=0; j<3; j++ ){
			if( top3[j] < input ){
				for( k=2; k>j; k--){//shift down
					top3[k] = top3[k-1];
				}
				top3[j] = input;
				break;//store finish. read next.
			}
		}
	}
	
	for( j=0; j<3; j++ ){
		printf("%d\n", top3[j] );
	}

	return 0;
}
				

Measured memory_bytes: 600
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    string a,b,c; cin>>a>>b>>c;
    cout<<"A"<<b[0]<<"C"<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = (ll)1<<32;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
typedef unsigned long long ul;
int n;
int main() {
	int a, b, c; cin >> a >> b >> c;
	if (a*a + b * b == c * c)cout << a * b / 2 << endl;
	else if (b*b + c * c == a * a)cout << b * c / 2 << endl;
	else cout << a * c / 2 << endl;
	//stop
	return 0;
}

Measured memory_bytes: 764
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

dif = abs(b-a)
waru = v - w
if waru <= 0:
    print('NO')
    exit()
tmp = dif/waru
#print(tmp)
if tmp<=t:
    print('YES')
else:
    print('NO')

Measured memory_bytes: 9184
#![allow(unused_imports)]

use std::{i32, i64, u32, u64, usize, f64};
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::io::{stdout, Write, BufWriter};
use std::mem::{swap};
use maplit::*;
use proconio::{input, marker::{Isize1, Usize1, Bytes, Chars}};

#[proconio::fastout]
fn main() {
    input!(
        mut core: Chars,
        n: usize,
    );
    let mut rev = 0;
    let mut s = VecDeque::with_capacity(core.len() + n);
    for c in core { s.push_back(c); }
    for _ in 0..n {
        input!(mode: u8);
        if mode == 1 { rev = 1 - rev; }
        else {
            input!(lr: u8, c: char,);
            if (lr - 1) ^ rev == 0 { s.push_front(c); }
            else { s.push_back(c); }
        }
    }
    if rev == 0 { println!("{}", s.into_iter().collect::<String>()) }
    else { println!("{}", s.into_iter().rev().collect::<String>()) }
}


Measured memory_bytes: 4636