akhauriyash/Code-Regression huggingface dataset:
const input = require("fs").readFileSync("/dev/stdin", "utf8")
let cin = input.split(/ |\n/), cid = 0
const next = () => cin[cid++]
const nexts = (n) => cin.slice(cid, cid+=n).map(i=>parseInt(i))

const [A, V, B, W, T] = nexts(5)

const distance = Math.abs(A - B)
if (V <= W) return console.log('NO')
const velocity = V - W
distance / velocity <= T ? console.log('YES') : console.log('NO')


Measured memory_bytes: 30456
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    void input() {

    }

    void solve() {
        input();
        int N;
        cin >> N;
        using P = pair<ll, ll>;
        vector<P> sushi(N);
        rep(i, 0, N) {
            cin >> sushi[i].first >> sushi[i].second;
        }

        sort(all(sushi), [](P a, P b) {
            return a.first + a.second > b.first + b.second;
        });

        ll ans = 0ll;
        for (int i = 0; i < N; ++i) {
            if (i % 2) {
                ans -= sushi[i].second;
            } else {
                ans += sushi[i].first;
            }
        }

        cout << ans << endl;


    }
};


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

    Solve().solve();


    return 0;
}


Measured memory_bytes: 1792
import java.util.Scanner;

//Quaternion Multiplication
public class Main{

	void run(){
		Scanner sc = new Scanner(System.in);
		for(;;){
			int n = sc.nextInt();
			if(n==0)break;
			for(int i=0;i<n;i++){
				int x1 = sc.nextInt(), y1 = sc.nextInt(), z1 = sc.nextInt(), w1 = sc.nextInt();
				int x2 = sc.nextInt(), y2 = sc.nextInt(), z2 = sc.nextInt(), w2 = sc.nextInt();
				int x = x1*x2 - y1*y2 - z1*z2 - w1*w2;
				int y = x1*y2 + y1*x2 + z1*w2 - w1*z2;
				int z = x1*z2 - y1*w2 + z1*x2 + w1*y2;
				int w = x1*w2 + y1*z2 - z1*y2 + w1*x2;
				System.out.println(x+" "+y+" "+z+" "+w);
			}
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 12000
#include<bits/stdc++.h> 
using namespace std;
#define ll long long
const long long mod=1e9+7;

int main(){
 int N,M;
cin>>N>>M;
int a;
vector<int>oks(N+1,true); 
for(int i=0;i<M;++i){
cin>>a;
oks[a]=false; 
}
vector<ll>dp(N+1,0); 
dp[0]=1;
for(int now=0;now<N;++now){
for(int next=now+1;next<=min(N,now+2);++next){ 
    if(oks[next]){/*falseが2回以上あると０がたされ続ける*/
    //手段は合計値
    dp[next]+=dp[now];
    dp[next]%=mod; 
}
} 
}
cout<<dp[N]<<endl;
return 0; 
}

Measured memory_bytes: 1408
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
inline int read()
{
    int x=0,t=1;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-') t=-1,ch=getchar();
	while(ch<='9'&&ch>='0')x=x*10+ch-48,ch=getchar();
	return x*t;
}
int n;
int main ()
{
	n=read();
	if(n<=9)
	{
		printf("%d\n",n);
		return 0;
	}
	if(n>9&&n<100)
	{
		printf("%d\n",9);
		return 0;
	}
	if(n>=100&&n<1000)
	{
		printf("%d\n",9+n-99);
		return 0;
	}
	if((n>=1000&&n<10000))
	{
		printf("%d\n",9+900);
		return 0;
	}
	if(n>=10000&&n<=99999)
	{
		printf("%d\n",9+900+n-9999);
		return 0;
	}
	if(n>=100000)
	{
		printf("%d\n",9+900+90000);
		return 0;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define int         long long   
#define double      long double
#define endl        "\n"
#define pb          push_back
#define PI          3.1415926535897932384626433832795l
#define F           first
#define S           second
#define mp          make_pair
#define f(i,n)      for(int i=0;i<n;i++)
#define fastio      ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v)      (v).begin(),(v).end()
#define sort(v)     sort((v).begin(),(v).end())
#define rall(v)     (v).rbegin(),(v).rend()
#define rsort(v)     sort((v).rbegin(),(v).rend())
#define gcd(a,b)    __gcd((a),(b))

typedef pair<int,int> pii;  
typedef vector<int> vi;

signed main() 
{
    fastio;
    int a,b,m;
    cin>>a>>b>>m;
    vi A(a),B(b);
    f(i,a)cin>>A[i];
    f(i,b)cin>>B[i];
    int ans=1e10;
    ans=*min_element(all(A))+*min_element(all(B));
    f(i,m)
    {
        int x,y,c;
        cin>>x>>y>>c;
        x-=1;
        y-=1;
        ans=min(ans,A[x]+B[y]-c);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 1792
N=int(input())
l=list(map(int, input().split()))
C=0
l.sort()
l.reverse()
n=N//2
if N%2==1:
    C += min(l)
    l.remove(min(l))
for i in range(n):
    C += l[2*i]-l[2*i+1]
print(C)

Measured memory_bytes: 3060
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, D = MAP()
cnt = 0
for i in range(N):
    x, y = MAP()
    d = sqrt(x * x + y * y)
    if d <= D:
        cnt += 1
print(cnt)

Measured memory_bytes: 10628
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	m := make(map[int]int)
	var a int
	for i := 0; i < n; i++ {
		fmt.Scan(&a)
		m[a]++
	}

	ans := 0
	for a, c := range m {
		if a == c {
			continue
		} else if a < c {
			ans += c - a
		} else {
			ans += c
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 7936
n,*l=map(int,open(0).read().split());a=[0,1]+[0]*n;b=[1]*-~n
for i,j in zip(l[1::2],l[2::2]):a[j]|=a[i];b[i]-=1;b[j]+=1;a[i]&=(b[i]>0)
print(sum(a))

Measured memory_bytes: 24988
//空白区切りの数字読み込み&分割
#include <iostream>
#include <sstream>  // istringstream
#include <cstdio>
#include <string>
#include <vector>

using namespace std;

int main()
{
    string line;
    getline(cin, line);
    istringstream iss(line);
    string s;
    vector<string> inputstr;
    vector<int> inputnum;
    int count = 0;
    while (iss >> s) {
        inputnum.push_back(stoi(s));
        ++count;
    }

	int sum[3];
	sum[0] = inputnum[0] + inputnum[1];
	sum[1] = inputnum[0] + inputnum[2];
	sum[2] = inputnum[1] + inputnum[2];

	int result = sum[0];
	if(sum[0] > sum[1]) {
	}
	for(int loop = 0; loop < 3; ++loop){
		if (result > sum[loop]) {
			result = sum[loop];
		}
	}
    cout << result;
  
    return 0;
}


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

int main(void){
    string s,t;
    cin >> s;
    for(int i = 0;i < s.size();i++){
        if(s[i] == '0'||s[i] == '1')t += s[i];
        else t = t.substr(0,t.size()-1);
    }
    cout << t;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            // Input
            int L = Integer.parseInt(sc.next());
            int R = Integer.parseInt(sc.next());
            int d = Integer.parseInt(sc.next());

            // Calc
            int cnt = 0;
            for (int i = L; i <= R; i++) {
                if (i % d == 0) cnt++;
            }
            System.out.println(cnt);
        }
    }
}


Measured memory_bytes: 35496
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

    int a, b, k;
    cin >> k >> a >> b;
    for (int i = a; i <= b; ++i) {
        if (i % k == 0) {
            cout << "OK\n";
            return 0;
        }
    }
    cout << "NG\n";

    return 0;
}


Measured memory_bytes: 3636
import java.util.Scanner;
public class Main{
 public static void main(String args[]){
  boolean flag=false;
  Scanner scan=new Scanner(System.in);
  String s;

  s=scan.next();
  int n=Integer.parseInt(s);
 
  int a,b=0,ans=0;
  for(int i=0;i<n;i++){
   s=scan.next();
   a=Integer.parseInt(s);
   if(a==b&&!flag){
    ans++;
    flag=true;
   }
   else flag=false;
   b=a;
  }
  System.out.println(ans);
 }
}

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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

template<typename H> void print(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void print(H head, T ...tail) { cout << head << " "; print(tail...); }

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	string a, b; cin >> a >> b;
	b.pop_back();
	cout << (a == b ? "Yes" : "No") << endl;
}


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

int main(){
  int x,a,b;
  cin >>x>>a>>b;
  
  int d1 = abs(x-a);
  int d2 = abs(x-b);
  
  char ans;
  d1<d2 ? ans='A' : ans='B';
  cout <<ans<< endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<vector>
using namespace std;

char s[14];
char g[10];
vector<int> res;

bool check(int i){
    if(i<8){
        int t=g[i]%3;
        if(g[i+1]<t||g[i+2]<t)return false;
        g[i+1]-=t;
        g[i+2]-=t;
        bool k=check(i+1);
        g[i+1]+=t;
        g[i+2]+=t;
        return k;
    }else{
        if(g[8]%3==0&&g[9]%3==0)return true;
        else return false;
    }
}

int main(){
    while(~scanf("%s ",s)){
        memset(g,0,sizeof(g));
        for(int i=0;i<13;i++){
            g[s[i]-'0']++;
        };
        res.clear();
        for(int i=1;i<10;i++){
            if(g[i]==4)continue;
            g[i]++;
            for(int j=1;j<10;j++){
                if(g[j]<2)continue;
                g[j]-=2;
                bool k=check(1);
                g[j]+=2;
                if(k){
                    res.push_back(i);
                    goto NEXT;
                }
            }
          NEXT:
            g[i]--;
        }
        if(res.empty()){
            puts("0");
            continue;
        }
        for(vector<int>::iterator it=res.begin();it!=res.end();it++){
            if(it==res.begin()){
                printf("%d",*it);
            }else{
                printf(" %d",*it);
            }
        }
        puts("");
    }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#include <iostream>
#include<set>
#include<utility>
using namespace std;
#include<algorithm>
#define ll  long long
#define M1 1000000007
#define M2 998244353
#define pll pair<ll,ll>
#define fori(i,n) for(ll i=0;i<n;i++)
#define forj(j,m) for(ll j=0;j<m;j++)
#define vecti vector<ll int >
#define vectp vector<pair<ll int, ll int > >
#define MOD 1000000007
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MAXN   100001
#define pb push_back
#define m_p make_pair
//const int N = 2e5 + 5;
/*l int pow(ll int n){
ll int sum=0;
ll int x=1;

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

    x=x*2;

}
return x;


}*/
//ll int dp[100005][2];

/*void rvereseArray(ll int arr[],ll int start, ll int end)
{
    if (start >= end)
    return;

   ll int temp = arr[start];
    arr[start] = arr[end];
    arr[end] = temp;

    // Recursive Function calling
    rvereseArray(arr, start + 1, end - 1);
}*/



int32_t main()
{
	fast();
	ll int t;
	//cin >> t;
	t=1;
	while(t--)
	{
	    ll int n,k;
	    cin>>n>>k;
	    vecti a(n);
	    fori(i,n){
	    cin>>a[i];
	    }
	    sort(a.begin(),a.end());
          bool dp[100003]={false};
          for(ll int i=0;i<n;i++){
            dp[a[i]]=true;
          }
          for(ll int i=0;i<=k;i++){
                for(ll int j=0;j<n;j++){
                    if(a[j]<=i){
                        if(!dp[i-a[j]]){
                            dp[i]=true;
                        }
                    }
                }


          }
          if(dp[k]){
            cout<<"First"<<endl;
          }
        else{
            cout<<"Second"<<endl;
        }


}

 }


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

bool isprime(int n){
    double rootn = sqrt(n);
    if (n < 2){
        return false;
    }
    else if (n == 2){
        return true;
    }
    else if (n % 2 == 0){
        return false;
    }
    else{
        for(int i = 3; i <= rootn; i += 2){
            if(n % i == 0){
                return false;
            }
        }
        return true;
    }
}


signed main(){
    int A, B, N;
    cin >> A >> B >> N;

    int r = B-1;
    if(r > N){
        r = N;
    }
    cout << A*r / B << endl;

    return 0;
}

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

using namespace std;

const int MAXN=1E5+10;
const int P=1E9+7;

char s[MAXN];

int ans,cnt; 
int f[2][4];//0 A,1 AB;00,01,10,11

int ksm(int a,int b)
{
    if(b<0) return 0;
    int ret=1;
    for(;b;b>>=1,a=1ll*a*a%P) if(b&1) ret=1ll*ret*a%P;
    return ret;
}

signed main()  
{
	scanf("%s",s+1);
	int n=strlen(s+1);
	for(int i=1;i<=n;i++) cnt+=s[i]=='?';
	for(int i=1;i<=n;i++)
	{
	    if(s[i]=='A') (f[0][0]+=1)%=P;
	    else if(s[i]=='B')
	    {
	        (f[1][0]+=f[0][0])%=P;
	        (f[1][1]+=f[0][1])%=P;
        }
	    else if(s[i]=='C')
	    {
	        (ans+=1ll*ksm(3,cnt)*f[1][0]%P)%=P;
	        (ans+=1ll*ksm(3,cnt-1)*f[1][1]%P)%=P;
	        (ans+=1ll*ksm(3,cnt-1)*f[1][2]%P)%=P;
	        (ans+=1ll*ksm(3,cnt-2)*f[1][3]%P)%=P;
	    }
	    else if(s[i]=='?')
	    {
	        (ans+=1ll*ksm(3,cnt-1)*f[1][0]%P)%=P;
	        (ans+=1ll*ksm(3,cnt-2)*f[1][1]%P)%=P;
	        (ans+=1ll*ksm(3,cnt-2)*f[1][2]%P)%=P;
	        (ans+=1ll*ksm(3,cnt-3)*f[1][3]%P)%=P;//C
	        (f[1][2]+=f[0][0])%=P;
	        (f[1][3]+=f[0][1])%=P;//B
	        (f[0][1]+=1)%=P;//A
	    }
	    
    }
    printf("%d\n",ans);
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <math.h>
#include <iostream>
#include <stdlib.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
 
int main(void){
    int N, K;
    cin >> N >> K;
    int count=0, h;
    REP(i,N){
        cin >> h;
        if(h>=K){
            count += 1;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
input_line = input()

inputs = input_line.split(' ')
N, M = [int(s) for s in inputs]
input_line = input()
inputs = input_line.split(' ')
A = [int(s) for s in inputs]
A = sorted(A, reverse=True)
a_tot = sum(A)
fg = True
for i in range(M):
    if A[i] < a_tot/(4*M):
        fg = False
if fg:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3060
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main() {
    int N, i, ans = 0;
    int A[110];
    scanf("%d", &N);
    for (i = 0; i < N; i++) {
        scanf("%d", &A[i]);
        if (A[i] % 2 == 0) {
            if (A[i] % 3 == 0 || A[i] % 5 == 0) {
                continue;
            } else {
                ans = 1;
            }
        }
    }
    if (ans == 0) {
        printf("APPROVED\n");
    } else {
        printf("DENIED\n");
    }


    return 0;
}

Measured memory_bytes: 128
a=list(map(int,input().split()))
H=a[0]
W=a[1]
line=[]
sharp=""
j=0
for i in range(W+2):
    sharp+="#"
for i in range(H):
    line.append("#"+input()+"#")
for i in range(H+2):
    if i == 0 or i == H+1:
        print(sharp)
    else:
        print(line[j])
        j+=1

Measured memory_bytes: 3064
val = [int(x) for x in input().split()]

_sum = val[1] + val[2]
cnt = 0
res = 0

for i in range(0, 100):
    _sum += val[1]
    if _sum % val[0] == 0:
        res = 1
        break
print("YES" if res == 1 else "NO")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define int  long long
#define tc(t)  int t; cin>>t; while(t--)
#define f(n)    for(int i=0;i<n;i++)
#define endl   "\n"
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
     int d,n;
     cin>>d>>n;
     if(d==0)
     {
         if(n==100) cout<<101<<endl;
         else cout<<n<<endl;


     }
    if(d==1)
    {
        if(n==100) cout<<10100<<endl;
        else cout<<n*100<<endl;


    }
    if(d==2)
    {
        if(n==100) cout<<1010000<<endl;
        else cout<<n*10000<<endl;


    }


}

Measured memory_bytes: 3636
n = gets.chomp.to_i
array = gets.chomp.split(' ').map(&:to_i)

class Int
  attr_accessor :gray, :brown, :green, :skyblue, :blue, :yellow, :orange, :red
end

free = 0
array.each do |rate|
  if 1 <= rate && rate <= 399 then
    @gray ||= 1
  elsif 400 <= rate && rate <= 799 then
    @brown ||= 1
  elsif 800 <= rate && rate <= 1199 then
    @green ||= 1
  elsif 1200 <= rate && rate <= 1599 then
    @skyblue ||= 1
  elsif 1600 <= rate && rate <= 1999 then
    @blue ||= 1
  elsif 2000 <= rate && rate <= 2399 then
    @yellow ||= 1
  elsif 2400 <= rate && rate <= 2799 then
    @orange ||= 1
  elsif 2800 <= rate && rate <= 3199 then
    @red ||= 1
  else
    free += 1
  end
end

restricted_colors = @gray.to_i + @brown.to_i + @green.to_i + @skyblue.to_i +
                    @blue.to_i + @yellow.to_i + @orange.to_i + @red.to_i

if restricted_colors == 0 then
  min = 1
  max = free
else
  min = restricted_colors
  max = restricted_colors + free
end

print("#{min} #{max}")


Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second

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;
}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i];if(i<len-1) s<<" ";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i]<<endl;
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){
	s<<"{ ";
	for(auto itr=v.begin();itr!=v.end();++itr) {
		if (itr!=v.begin()) {s<< ", ";}
		s<<(*itr);
	}
	s<<" }";
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){
	s<<"{"<<endl;
	for(auto itr=m.begin();itr!=m.end();++itr){
		s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;
	}
	s<<"}"<<endl;
	return s;
}

const ll mod=1e9+7;
const ll inf=1e15;
const int INF=1e9;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int k,x;
	cin>>k>>x;
	if(k*500>=x) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Dynamic;
using System.Linq;
using System.Numerics;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

namespace atcorder
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] bigs = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
            long N = bigs[0];
            long A = bigs[1];
            long B = bigs[2];

            long c = N / (A + B);
            long amari = N % (A + B);
            if (N % (A + B) == 0)
            {
                Console.WriteLine(A * c);
            }
            else if (amari >= A)
            {
                Console.WriteLine(A * c + A);
            }
            else
            {
                Console.WriteLine(A * c + amari);
            }
        }
    }
}


//文字配列の取得
//string[] strArray = Console.ReadLine().Split(' ').ToArray();
//string S = strArray[0];
//string T = strArray[1];

//文字列の取得
//string s = Console.ReadLine();

//数字配列の取得
//int[] intArray = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
//int H = intArray[0];
//int W = intArray[1];

//数字の取得
//int N = int.Parse(Console.ReadLine());

//リスト型(int)の取得
//List<int> A = new List<int>(Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray());

//出力
//Console.WriteLine(ans);
//Console.WriteLine("Yes");
//Console.WriteLine("No");
//Console.WriteLine(cnt);



Measured memory_bytes: 28216
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main(){    
  int N,A;
  cin >> N;
  double a = 0;
  for(int i = 0; i < N; i++){
    cin >> A;
    a += (1.0/A)*100000;
  }
  cout <<  fixed << setprecision(8) << 100000/a << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>

using namespace std;

#define sz(a) static_cast<int>((a).size())
#define f first
#define s second
#define els(v) for (auto &el : (v))


#ifdef KIRYA
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif

template<typename T>
void _dbg(const char* _s, T _h) {
    cerr << _s << " = " << _h << "\n";
}

template<typename T, typename... Ts>
void _dbg(const char*_s, T _h, Ts... _t) {
    int _b = 0;

    while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',')
        cerr << *_s++;

    cerr << " = " << _h << ",";
    _dbg(_s + 1, _t...);
}

const int64_t INF = static_cast<int64_t>(1e9) + 7;
const int64_t LINF = INF * INF;
const int MAXN = static_cast<int>(1e6) + 17;

void solve() {
    int n, d;
    cin >> n >> d;
    vector<vector<int>> p(n, vector<int>(d));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < d; ++j) {
            cin >> p[i][j];
        }
    }
    int res = 0;
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            int dist = 0;
            for (int k = 0; k < d; ++k) {
                dist += pow(p[i][k] - p[j][k], 2);
            }
            int root = pow(dist, 0.5);
            if (pow(root, 2) == dist) {
                ++res;
            }
        }
    }
    cout << res;
}

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

    int q = 1;

    for (int i = 0; i < q; ++i) {
        solve();
    }
}

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

using namespace std;
typedef long long ll;


int main()
{
    int h, w, k;
    cin >> h >> w >> k;

    char g[h+1][w+1];
    int r[h+1], c[w+1], tot = 0;
    for (int i = 0; i <= h; i++) r[i] = 0;
    for (int j = 1; j <= w; j++) c[j] = 0;

    for (int i = 1; i <= h; i++) {
        for (int j = 1; j <= w; j++) {
            cin >> g[i][j];
            if (g[i][j]=='#') {
                r[i]++;
                c[j]++;
                tot++;
            }
        }
    }

    int p = 0, q = 0, ans = 0;
    vector<int> xx, yy;
    for (int x = 0; x < pow(2,h); x++) {
        xx.clear();
        p = 0;
        for (int i = 0; i < h; i++) {
            if (x&(1<<i)) {
                xx.push_back(i+1);
                p+=r[i+1];
            }
        }
        for (int y = 0; y < pow(2,w); y++) {
            q = p;
            yy.clear();
            for (int i = 0; i < w; i++) {
                if (y&(1<<i)) {
                    yy.push_back(i+1);
                    q+=c[i+1];
                }
            }
            for (auto c1: xx) {
                for (auto c2: yy) {
                    q-=(g[c1][c2]=='#');
                }
            }

            if (tot-q==k) {
                ans++;
            }
        }

    }

    cout << ans;


    return 0;
}



Measured memory_bytes: 3988
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<string>
#include<unordered_map>
#include <iomanip>
using namespace std;
 
#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j,k
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define sort(a) sort(a.begin(),a.end())
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define sizeoof(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
ll ans=0;llfor;///////////////////////////////////////////////////////////
int main(){
  int N,A,B;
  cin>>N>>A>>B;
  cout<<(N-A+1)*(N-B+1);
return 0;}

Measured memory_bytes: 3640
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
using namespace std;

typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 1000000007 //10^9+7
#define MAXR 100000 //10^5:最大のrange(素数列挙などで使用)

int main(void){
    int n, k;
    cin >> n >> k;
    vector<bool> d(n);
    REP(i, n) d[i] = false;
    
    REP(i, k) {
        int dd;
        cin >> dd;
        REP(j, dd) {
            int a;
            cin >> a;
            d[a-1] = true;
        }
    }
    int sum = 0;
    REP(i, n) {
        if(!d[i]) sum++;
    }
    cout << sum << endl;
    
    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,L,R;
string S, T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

int main() {
    cin>>N>>M;
    cout<<(N <= 9 && M <= 9 ? N*M : -1)<<endl;
}

Measured memory_bytes: 256
//============================================================================
// Name        : template.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <algorithm>
#include <set>
#include <map>
#include <set>
#include <vector>
#include <string.h> // for memset in CF judge.
using namespace std;
#define _CRT_SECURE_NO_DEPRECATE // suppress some compilation warning messages (for VC++ users)
// Shortcuts for "common" data types in contests
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<string, int> msi;
// To simplify repetitions/loops, Note: define your loop style and stick with it!
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define REP(i, a, b) \
for (int i = int(a); i <= int(b); i++) // a to b, and variable i is local!
#define forn(i,n) \
for (int i =0; i<(n); i++)
#define TRvi(c, it) \
for (vi::iterator it = (c).begin(); it != (c).end(); it++)
#define TRvii(c, it) \
for (vii::iterator it = (c).begin(); it != (c).end(); it++)
#define TRmsi(c, it) \
for (msi::iterator it = (c).begin(); it != (c).end(); it++)
#define INF 2000000000 // 2 billion
// If you need to recall how to use memset:
#define MEMSET_INF 127 // about 2B
#define MEMSET_HALF_INF 63 // about 1B
//memset(dist, MEMSET_INF, sizeof dist); // useful to initialize shortest path distances
//memset(dp_memo, -1, sizeof dp_memo); // useful to initialize DP memoization table
//memset(arr, 0, sizeof arr); // useful to clear array of integers

int main() {
	ios::sync_with_stdio(false);
 cin.tie(0);
 map<ll, ll> mp;
 int n; cin >> n;
 ll sum = 0;
 forn(i,n) {
 	int x; cin >> x;
 	mp[x]++;
 	sum += x;
 }
 int tx; cin >> tx;

 forn(i, tx) {
 	ll a, b; cin >> a >> b;
 	ll freq = mp.find(a) == mp.end()? 0 : mp.find(a)->second;
 	ll freqt = mp.find(b) == mp.end() ? 0 : mp.find(b)->second;
 	sum -= (a*freq);
 	mp[a] = 0;
 	mp[b] = freq + freqt;
 	sum += freq * b;
 	cout << sum << endl;
 }

return 0;
}


Measured memory_bytes: 9452
#include <cstdio>

using namespace std;

int main() {
    long long n, x, p, q, ans = 0;
    
    scanf("%lld %lld", &n, &x);
    
    ans += n;
    
    p = n - x;
    q = x;
    
    while (1) {
        long long np, nq;
        
        if (p % q == 0) {
            ans += p * 2 - q;
            
            break;
        }
        
        if (p > q) ans += p / q * 2 * q;
        
        np = q;
        nq = p % q;
        
        p = np;
        q = nq;
    }
    
    printf("%lld\n", ans);
    
    return 0;
}


Measured memory_bytes: 128
import java.io.*;
 
public class Main{
    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
        String s = br.readLine();
        int x = Integer.parseInt(s);
 
        System.out.println(x*x*x);
    }
 
}

Measured memory_bytes: 16864
#include<queue>
#include<queue>
#include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
struct edge{
  ll to;
  ll cost;
  edge(ll t,ll w) : to(t),cost(w){}
};
int main(){
  vector<vector<edge> > g(100010);
  ll i,V,E,r,s,t,d;
  ll ds[100010],ns[100010];
  const ll INF=1000000000000000;
  priority_queue<P,vector<P>,greater<P> > que;
  scanf("%lld %lld %lld\n",&V,&E,&r);
  for(i=0;i<E;i++){
    scanf("%lld %lld %lld\n",&s,&t,&d);
    g[s].push_back(edge(t,d));
  }
  for(i=0;i<V;i++){
    ds[i]=INF,ns[i]=0;
  }
  ds[r]=0,ns[r]=1;
  que.push(P(0,r));
  while(!que.empty()){
    // もしゴールが明確に決められているときは、
    //if(ns[c]==1){
    //    break;
    //}
    P p=que.top();
    ll v=p.second;
    que.pop();
    if(ds[v]<p.first){
      continue;
    }
    for(i=0;i<g[v].size();i++){
      edge us=g[v][i];
      if(ds[us.to]>ds[v]+us.cost && ns[us.to]==0){
        ds[us.to]=ds[v]+us.cost;
        que.push(P(ds[us.to],us.to));
      }
    }
    ns[v]=1;
  }
  for(i=0;i<V;i++){
    if(ds[i]==INF){
      printf("INF\n");
    }
    else{
      printf("%lld\n",ds[i]);
    }
  }
  return 0;
}


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

struct node {
	node *p, *l, *r;
	int cnt;
	void Init(node *p_) {
		p = p_;
		l = r = nullptr;
		cnt = 0;
	}
};

int it;
node pool[2000000];

node *new_node(node *p) {
	pool[it].Init(p);
	return &pool[it++];
}

class uint_Trie {
	node *root;
	int siz;
public:
	uint_Trie() : root(new_node(nullptr)) {}
	int size() {
		return root->cnt;
	}
	void insert(unsigned val) {
		// if (find(val)) return; // multiset ???????¶????
		node *t = root;
		for (int i = 30; i >= 0; i--) {
			t->cnt++;
			if (val & (1 << i)) {
				if (t->r == nullptr) {
					t->r = new_node(t);
				}
				t = t->r;
			}
			else {
				if (t->l == nullptr) {
					t->l = new_node(t);
				}
				t = t->l;
			}
		}
		t->cnt++;
	}
	void erase(unsigned val) {
		node *t = root, *ne;
		for (int i = 30; i >= 0; i--) {
			t->cnt--;
			if (val & (1 << i)) {
				if (t->r == nullptr) return;
				t = t->r;
			}
			else {
				if (t->l == nullptr) return;
				t = t->l;
			}
		}
		t->cnt--;
		while (t != root && t->cnt == 0) {
			ne = t->p;
			(t == ne->l ? ne->l : ne->r) = nullptr;
			t = ne;
		}
	}
	bool find(unsigned val) {
		node *t = root;
		for (int i = 30; i >= 0; i--) {
			if (val & (1 << i)) {
				if (t->r == nullptr) return false;
				t = t->r;
			}
			else {
				if (t->l == nullptr) return false;
				t = t->l;
			}
		}
		return true;
	}
	unsigned max() {
		assert(root->cnt >= 1);
		node *t = root;
		unsigned res = 0;
		for (int i = 30; i >= 0; i--) {
			assert(t->l != nullptr || t->r != nullptr);
			if (t->r != nullptr) {
				res |= 1 << i;
				t = t->r;
			}
			else {
				t = t->l;
			}
		}
		return res;
	}
	unsigned min() {
		assert(root->cnt >= 1);
		node *t = root;
		unsigned res = 0;
		for (int i = 30; i >= 0; i--) {
			assert(t->l != nullptr || t->r != nullptr);
			if (t->l != nullptr) {
				t = t->l;
			}
			else {
				res |= 1 << i;
				t = t->r;
			}
		}
		return res;
	}
};

int main()
{
	cin.sync_with_stdio(false);
	uint_Trie ut;
	string com;
	int k;
	while (cin >> com, com != "end") {
		if (com == "insert") {
			cin >> k;
			ut.insert(k);
		}
		else {
			int res = ut.max();
			printf("%d\n", res);
			ut.erase(res);
		}
	}
	return 0;
}

Measured memory_bytes: 38196
function main()
	N=parse.(Int,readline())
	a=sort(parse.(Int,split(readline())),rev=true)
	
	diff=0
	for i=1:length(a)
		if i%2==0
			diff-=a[i]
		else
			diff+=a[i]
		end
	end
	println(diff)
end

main()

Measured memory_bytes: 187236
#include<bits/stdc++.h>
using namespace std;
//size_t f = string::npos
//make pair, tuple

int main(){
      int w,a,b;cin >> w >> a >> b;
      if(b <= a + w && b >= a)cout << 0;
      else if(b + w <= a + w && b + w >= a)cout << 0;
      else cout << min(abs(a + w - b), abs(a - (b + w)));
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int n;
  scanf("%d",&n);
  char s[n];
  scanf("%s",&s);
  int i;
  i = 0;
  if (n%2 != 0)
  {
    printf("No");
    return(0);
  }
  while (i*2 < n)
  {
    if (s[i] != s[n/2+i])
    {
      printf("No");
      return(0);
    }
    i++;
  }
  printf("Yes");
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
const int maxn = 1e9 + 5;
#define INF 1000000000
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;



int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	fastio
	int n,m;
	cin >> n >> m;
	int cnt[n];
	bool found[n];
	int accepted = 0;
	int penalty = 0;
	for(int i=0; i<n; i++){
		cnt[i]=0;
		found[i]=false;
	}
	for(int i=0; i<m; i++){
		int val ;string s;
		cin >> val >> s; val--;
		if(s == "AC" and !found[val]){
			found[val]=true;
			penalty+=cnt[val];
			accepted++;
		}else{
			cnt[val]++;
		}
	}
	cout << accepted << " " << penalty << endl;
	return 0;
} 






Measured memory_bytes: 4040
#include<iostream>
#include<algorithm>
using namespace std;
int d[100001];
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>d[i];
	sort(d+1,d+n+1);
	cout<<d[n/2+1]-d[n/2]<<endl;
	return 0;
}

Measured memory_bytes: 640
#include <stdio.h>

int main(void) {

    int m;
    int f;
    int r;
    int total;
    char result;

    while(1) {
        scanf("%d %d %d", &m, &f, &r);

        if(m == -1 && f == -1 && r == -1) {
            break;
        }

        total = m + f;

        if((m == -1 || f == -1) ||
           (total < 30)) {
             result = 'F';
        }
        else if(total >= 80) {
             result = 'A';
        }
        else if(total >= 65) {
             result = 'B';
        }
        else if(total >= 50 ||
                total >= 30 && r >= 50) {
             result = 'C';
        }
        else {
             result = 'D';
        }
        
        printf("%c\n", result);
    }

    return 0;
}

Measured memory_bytes: 600
using System;
using System.Text; 
using System.Collections.Generic;
using System.Linq;

public class Remainder
{
    static Node[] Nodes;
    static long N;

    static public void Main ()
    {
        N = long.Parse(Console.ReadLine());
        
    
        Nodes = new Node[N+1];
        //ノードを初期化
        for(int i = 1;i <= N ;i++){
            Nodes[i] = new Node();
        }
        
        for(int i = 1;i < N ;i++){
            var AB = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            var A = AB[0];
            var B = AB[1];
            
            //子ノードを登録
            Nodes[A].child.Add(B);
            Nodes[B].child.Add(A);
        } 
        
        fwfs();
        swfs();
        var snum = 0;
        var fnum = 0;
       
        for(int i = 1;i <= N ;i++){
            if(Nodes[i].fnum >= Nodes[i].snum){
                fnum++;
            }else{
                snum++;
            }
        }
        
        if(fnum > snum){
            Console.WriteLine("Fennec ");
        }else{
            Console.WriteLine("Snuke");
        }
        

    }
    
    static void fwfs(){
        var que = new Queue<Node>();
        Nodes[N].fnum = 0;
        que.Enqueue(Nodes[N]);
        
        while(que.Count > 0){
            var top = que.Dequeue();
            foreach(long child in top.child){
                if(Nodes[child].fnum == long.MaxValue){
                    Nodes[child].fnum = top.fnum+1;
                    que.Enqueue(Nodes[child]);
                }
            }
        }
    }
    
    static void swfs(){
        var que = new Queue<Node>();
        Nodes[1].snum = 0;
        que.Enqueue(Nodes[1]);
        
        while(que.Count > 0){
            var top = que.Dequeue();
            foreach(long child in top.child){
                if(Nodes[child].snum == long.MaxValue){
                    Nodes[child].snum = top.snum+1;
                    que.Enqueue(Nodes[child]);
                }
            }
        }
    }
    
    

}

public class Node{
    public List<long> child;
    public long fnum = long.MaxValue;
    public long snum = long.MaxValue;
    public Node(){
        this.child = new List<long>();
    } 
}


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

int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int r_count = 0;
  int ng_count = 0;
  int ans = 0;
  for (int i = 0; i < n; i++) if (s[i] == 'R') r_count++;
  for(int i = 0; i < n; i++) {
    if(i < r_count && s[i] == 'W') ng_count++;
    else if(i >= r_count && s[i] == 'R') ng_count++;
  }
  ans = (ng_count + 1) /2;
  cout << ans << endl;
  return 0;
}


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

int main() {
    int V, E;
    cin >> V >> E;
    vector<vector<int>> g(V, vector<int>(V, -1));
    for (int i = 0; i < E; ++i) {
        int s, t, d;
        cin >> s >> t >> d;
        g[s][t] = d;
    }
    const int INF = 1 << 30;
    vector<vector<int>> dp(1 << V, vector<int>(V, INF));
    dp[0][0] = 0;
    for (int bit = 0; bit < 1 << V; ++bit) for (int i = 0; i < V; ++i) if (dp[bit][i] != INF) {
        for (int j = 0; j < V; ++j) if (!(bit >> j & 1) && g[i][j] >= 0) {
            dp[bit | (1 << j)][j] = min(dp[bit | (1 << j)][j], dp[bit][i] + g[i][j]);
        }
    }
    cout << (dp[(1 << V) - 1][0] == INF ? -1 : dp[(1 << V) - 1][0]) << endl;
}


Measured memory_bytes: 6240
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
	cin>>s;
	if(s=="Sunny")  cout<<"Cloudy";
	else if(s=="Cloudy")  cout<<"Rainy";
	else if(s=="Rainy")  cout<<"Sunny";
	return 0; 
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int a, b, flg = 0;
	char op;
	
	while(flg == 0){
		scanf("%d %c %d", &a, &op, &b);
		switch(op){
			case '+': printf("%d\n", a+b); break;
			case '-': printf("%d\n", a-b); break;
			case '*': printf("%d\n", a*b); break;
			case '/': printf("%d\n", a/b); break;
			case '?': flg = 1; break;
		}
	}
	
	return(0);
}



Measured memory_bytes: 1732
class UnionFind(): # 0インデックス
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]
N,M = map(int,input().split())
A,B = [],[]
for _ in range(M):
    a,b = map(int,input().split())
    A.append(a-1)
    B.append(b-1)
 
cur = N *(N-1)//2
ans = [0]*(M)
 
uf = UnionFind(N)
for i in range(M-1,-1,-1):
    ans[i] = cur
    if(uf.find(A[i]) != uf.find(B[i])):
        cur -= uf.size(A[i])*uf.size(B[i])
        uf.union(A[i],B[i])
for n in ans:
    print(n)

Measured memory_bytes: 91096
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define lop(i, n) for(i=0; i<n; i++)

int main()
{
	int n, i, j, min=100000001;
	int x[100];
	
	scanf("%d", &n);
	lop(i, n){
		scanf("%d", &x[i]);
	}
	
	int L=x[0], R=x[0];
	for(i=1; i<n; i++){
		if(L>x[i])L=x[i];
		if(R<x[i])R=x[i];
	}
	
	for(i=L; i<=R; i++){
		int sum=0;
		lop(j, n){
			sum+=(x[j]-i)*(x[j]-i);
		}
		if(min>sum)min=sum;
	}
	
	printf("%d", min);
	
return 0;
}

Measured memory_bytes: 128
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv, std.math,
    std.functional, std.numeric, std.range, std.stdio, std.string, std.random,
    std.typecons, std.container, std.format;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);
// dfmt on

void main()
{
    long N = lread();
    writeln((N + 1) / 2);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using pii = pair<int, int>;
using vi = vector<int>;
using vii = vector<vi>;

int main() {
    int h_1, m_1, h_2, m_2 , k;
    cin >> h_1 >> m_1 >> h_2 >> m_2 >> k;
    
    int h;
    h = (h_2 - h_1) * 60;
    
    cout << h + (m_2 - m_1) - k << endl;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
#define REP(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
const ll MOD = 1000000007;

int main() {
  string s;
  cin >> s;
  REP(i, 3) {
    if (s[i] == '1') s[i] = '9';
    else s[i] = '1';
  }
  cout << s << endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
 
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <stdint.h>
#include <string.h>
 
//#define _USE_MATH_DEFINES
//#include <math.h>
 
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <deque>
#include <string>
 
#include <algorithm>
#include <functional>
#include <bitset>
#include <functional>
#include <chrono>
#include <random>
#define sqr(x) (x) * (x)
 
typedef unsigned int u32;
typedef int i32;
typedef unsigned long long int u64;
typedef long long int i64;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;
 
using namespace std;
using namespace std::chrono;
 
//const i64 mod = 1000000007ll;
const i64 smod = 998244353ll;
const i64 inf = 10000000000000007ll;
 
const double eps = 1e-8;
 
const i64 MAXN = 1'000'000 + 6;
 
i64 n;
i64 a[MAXN];
 
int main(int argc, char* argv[]) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout.precision(15); cout.setf(ios::fixed);
 
    cin >> n;
 
    for (i64 i = 1; i * 3 <= n; i++) {
        a[i * 3] = 1;
    }
 
    for (i64 i = 1; i * 5 <= n; i++) {
        a[i * 5] = 1;
    }
 
    i64 R = 0;
    for (i64 i = 1; i <= n; i++) {
        R += (a[i] ? 0 : i);
    }
 
    cout << R << endl;
 
 
    return 0;
}

Measured memory_bytes: 11460
import java.util.*;
class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt(),m = sc.nextInt();
    int a=0;
    for(int i=0;i<m;i++){
    	a+=sc.nextInt();
    }
    n-=a;
    if(n<0){
    	pl("-1");
    }else{
    	pl(n+"");
    }
  }

  public static void pr(String str){
    System.out.print(str);
  }
  public static void pl(String str){
    System.out.println(str);
  }
}


Measured memory_bytes: 47576
import java.util.*;

public class Main {
    private static final int MOD = 1_000_000_007;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        long tmp = pow(2, n);
        tmp -= 1;
        if (tmp < 0) tmp += MOD;
        tmp -= comb(n,a);
        if (tmp < 0) tmp += MOD;
        tmp -= comb(n,b);
        if (tmp < 0) tmp += MOD;

        System.out.println(tmp);
    }

    private static final long pow(long a, int n) {
        if (n == 0) {
            return 1;
        }
        if (n%2 == 1) {
            return a*pow(a,n-1)%MOD;
        }
        long half = pow(a,n/2);
        return half*half%MOD;
    }

    private static final long comb(int n, int k) {
        long a = 1;
        for (int i = 0; i < k; i++) {
            a *= n-i;
            a %= MOD;
        }
        long b = 1;
        for (int i = 0; i < k; i++) {
            b *= k-i;
            b %= MOD;
        }

        return a*pow(b, MOD-2)%MOD;
    }
}



Measured memory_bytes: 21844
N,M,X=map(int,input().split())
A=[int(i) for i in input().split()]
for i in range(len(A)):
    if A[i]>X:
        S1=A[0:i]
        S2=A[i:]
        break
    else:
        continue
print(min(len(S1),len(S2)))

Measured memory_bytes: 3060