akhauriyash/Code-Regression huggingface dataset:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

x,y = input().split()
if ord(x)>ord(y):
    print(">")
elif ord(x) == ord(y):
    print("=")
else:
    print("<")


Measured memory_bytes: 3316
#include<iostream>
using namespace std;
#include<string>
int main()
{
	int n,x,maxi=2000000,cnt=0;
	string str;
	cin>>str;
	for(int i=0;i<str.length();i+=2)
	{
		if(str[i]=='0')
		cnt++;
		if(str[i+1]=='1')
		cnt++;
	}
	if(cnt<maxi)
	maxi=cnt;
     cnt=0;
		for(int i=0;i<str.length();i+=2)
	{
		if(str[i]=='1')
		cnt++;
		if(str[i+1]=='0')
		cnt++;
	}
	if(cnt<maxi)
	maxi=cnt;
	cout<<maxi;
	
	
	
	
	
	
	return 0;
}

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

using namespace std;

typedef long long ll;

const ll INF = 1LL << 60;
const ll MOD = 1000000007LL;


ll mod_pow(ll m, ll n, ll mod) {
    if (n == 0) {
        return 1;
    }

    ll rv = mod_pow(m * m % mod, n/2, mod);

    if (n % 2) {
        return (rv * m) % mod;
    } else {
        return rv;
    }
}


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

    ll N;
    ll C;
    cin >> N >> C;

    vector<ll> A;
    vector<ll> B;

    A.resize(N+1);
    B.resize(N+1);

    for (ll i = 1; i <= N; ++i) {
        cin >> A[i];
    }
    for (ll i = 1; i <= N; ++i) {
        cin >> B[i];
    }


    vector< vector<ll> > T;
    T.resize(401);
    // T[i][j] == mod_pow(i, j, MOD)

    for (ll i = 0; i < 401; ++i) {
        T[i].resize(401);

        T[i][0] = 1;

        for (ll j = 1; j < 401; ++j) {
            T[i][j] = mod_pow(i, j, MOD);
        }
    }


    vector< vector<ll> > U;
    U.resize(N+1);

    for (ll i = 0; i <= N; ++i) {
        U[i].resize(C+1);

        for (ll j = 0; j <= C; ++j) {
            U[i][j] = 0;

            for (ll x = A[i]; x <= B[i]; ++x) {
                U[i][j] = (U[i][j] + T[x][j]) % MOD;
            }
        }
    }


    //for (ll i = 0; i <= N; ++i) {
    //    for (ll j = 0; j <= C; ++j) {
    //        cout << U[i][j] << " ";
    //    }
    //    cout << endl;
    //}
    //cout << endl;


    vector< vector<ll> > dp; // N, C
    dp.resize(N+1);
    for (ll i = 0; i <= N; ++i) {
        dp[i].resize(C+1);
    }

    dp[0][0] = 1;
    for (ll j = 1; j <= C; ++j) {
        dp[0][j] = 0;
    }

    //for (ll j = 0; j <= C; ++j) {
    //    dp[1][j] = U[1][j];
    //}

    for (ll i = 1; i <= N; ++i) {
        for (ll j = 0; j <= C; ++j) {
            dp[i][j] = 0;

            for (ll k = 0; k <= j; ++k) {
                dp[i][j] = (dp[i][j] + dp[i-1][j-k] * U[i][k]) % MOD;
            }
        }
    }


    //for (ll i = 0; i <= N; ++i) {
    //    for (ll j = 0; j <= C; ++j) {
    //        cout << dp[i][j] << " ";
    //    }
    //    cout << endl;
    //}


    cout << dp[N][C] << endl;

    return 0;
}


Measured memory_bytes: 4096
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();

            List<Integer> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                list.add(Integer.parseInt(sc.next()));
            }
            System.out.println(calc(list));
        }
    }

    public static double calc(List<Integer> list) {
        list.sort((i1, i2) -> i1 - i2);

        BigDecimal num = new BigDecimal((list.get(0) + list.get(1))).divide(new BigDecimal(2), 10, RoundingMode.UP);
        for (int i = 2; i < list.size(); i++) {
            num = num.add(BigDecimal.valueOf(list.get(i))).divide(new BigDecimal(2), 10, RoundingMode.UP);
        }
        return num.doubleValue();

    }

}


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

#define whole(f, x, ...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)


using namespace std;
using ll = long long;

void solve() {
    ll n, y;
    cin >> n >> y;
    y /= 1000;

    for (int i = 0; i <= n; ++i) {
        for (int j = 0; j + i <= n; ++j) {
            if (10 * i + 5 * j + (n - i - j) == y) {
                cout << i << " " << j << " " << (n - i - j) << endl;
                return;
            }
        }
    }
    cout << "-1 -1 -1" << endl;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);

    solve();
    return 0;
}


Measured memory_bytes: 764
n, $k = gets.split.map(&:to_i)
def log2(x)
  count = 0
  loop do
    return count if x >= $k
    x *= 2
    count += 1
  end
end
sum = 0.0
1.upto(n) do |i|
  p = log2(i)
  prob = 1
  p.times do
    prob /= 2.0
  end
  sum += prob
end
sum /= n
puts sum


Measured memory_bytes: 1788
package main

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

var (
	h, w int
	s    []string
)

func calcLeft(c chan [][]int) {
	ls := make([][]int, h)
	for i := range ls {
		ls[i] = make([]int, w)
		for j := 0; j < w; j++ {
			if s[i][j] == '#' {
				ls[i][j] = 0
				continue
			}
			if j == 0 {
				ls[i][j] = 1
				continue
			}
			ls[i][j] = ls[i][j-1] + 1
		}
	}
	c <- ls
}

func calcRight(c chan [][]int) {
	rs := make([][]int, h)
	for i := range rs {
		rs[i] = make([]int, w)
		for j := w - 1; j >= 0; j-- {
			if s[i][j] == '#' {
				rs[i][j] = 0
				continue
			}
			if j == w-1 {
				rs[i][j] = 1
				continue
			}
			rs[i][j] = rs[i][j+1] + 1
		}
	}
	c <- rs
}

func calcTop(c chan [][]int) {
	ts := make([][]int, h)
	for i := range ts {
		ts[i] = make([]int, w)
	}
	for j := 0; j < w; j++ {
		for i := 0; i < h; i++ {
			if s[i][j] == '#' {
				ts[i][j] = 0
				continue
			}
			if i == 0 {
				ts[i][j] = 1
				continue
			}
			ts[i][j] = ts[i-1][j] + 1
		}
	}
	c <- ts
}

func calcDown(c chan [][]int) {
	ds := make([][]int, h)
	for i := range ds {
		ds[i] = make([]int, w)
	}
	for j := 0; j < w; j++ {
		for i := h - 1; i >= 0; i-- {
			if s[i][j] == '#' {
				ds[i][j] = 0
				continue
			}
			if i == h-1 {
				ds[i][j] = 1
				continue
			}
			ds[i][j] = ds[i+1][j] + 1
		}
	}
	c <- ds
}

func main() {
	fmt.Scan(&h, &w)

	sc := bufio.NewScanner(os.Stdin)
	s = make([]string, h)
	for i := range s {
		sc.Scan()
		s[i] = sc.Text()
	}

	c := make(chan [][]int)
	go calcLeft(c)
	go calcRight(c)
	go calcTop(c)
	go calcDown(c)
	xs1, xs2, xs3, xs4 := <-c, <-c, <-c, <-c

	ans := 0
	for i := 0; i < h; i++ {
		for j := 0; j < w; j++ {
			if v := xs1[i][j] + xs2[i][j] + xs3[i][j] + xs4[i][j] - 3; v > ans {
				ans = v
			}
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 138296
/*input
3
7 6 8


*/

#include <bits/stdc++.h>
using namespace std;

// ALL DEFFINES HERE
#define ll long long int
#define ii pair<int, int>
#define mp make_pair
#define N 100005
#define rep(i, n) for(i=0; i < n; i++)
#define Rep(i, k, n) for(i=k; i < n; i++)
#define pb push_back
#define vi vector<int>
#define vii vector< vector<int> >
#define vl vector<ll>
#define F first
#define S second
// ALL declarations here const ints etc
const  ll mod =1000000000+7; 
ll gcd(ll a, ll b)
{
	if ( b==0)
		return a;
	return gcd(b, a%b);
}
// --->>> main starts here
ll absl(ll a )
{
	return  a>= 0 ?a:-a;
}
ll maxl(ll a, ll b)
{
	return a >= b? a:b;
}
int main()
{
	int n;
	cin >> n;
	ll arr[n+5];
	int i;
	rep(i,n)
	cin >> arr[i];
	ll gd = gcd(arr[0],arr[1]);
	
	if ( n == 2)
	{
		cout << maxl(arr[0], arr[1]);
		return 0;

	}
	else
	{

		ll prefix[n+5];
		ll suffix[n+5];
		prefix[0]=arr[0];
		suffix[n-1]=arr[n-1];
		for ( i=1; i < n; i++)
		{
			prefix[i]= gcd( prefix[i-1], arr[i]);
		}
		for ( i=n-2; i>=0; i--)
			suffix[i] = gcd(suffix[i+1], arr[i]);
		ll max_gcd=1;
		max_gcd = gcd(suffix[1], prefix[n-2]);
		for ( i=1; i <= n-2; i++)
		{
			ll new_gcd = gcd(prefix[i-1], suffix[i+1]);
			max_gcd = maxl( new_gcd, max_gcd);
		}
		max_gcd = maxl(max_gcd, suffix[1]);
		max_gcd = maxl(max_gcd, prefix[n-2]);
		cout << max_gcd;


	}

}
		








Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
#ifdef DEBUG
#define line() cerr << "[" << __LINE__ << "] ";
#define dump(i) cerr << #i ": " << i << " ";
#define dumpl(i) cerr << #i ": " << i << endl;
#else
#define line(i)
#define dump(i)
#define dumpl(i)
#endif
using namespace std;

int n, m;

bool check(vector<string> &a, vector<string> &b, int y, int x)
{
    rep(i, m) rep(j, m)
    {
        if (b[i][j] != a[i + y][j + x])
        {
            return false;
        }
    }
    return true;
}

int main(int argc, char const *argv[])
{
    cin >> n >> m;
    vector<string> a(n, "");
    vector<string> b(m, "");
    rep(i, n) cin >> a[i];
    rep(i, m) cin >> b[i];
    rep(x, n - m + 1) rep(y, n - m + 1)
    {
        if (check(a, b, y, x))
        {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 764
#include<stdio.h>
int search(int key);

int a[10001],n;

int main(){
  int i,m,q,sum=0;

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

  scanf("%d",&m);
  for(i=0;i<m;i++){
    scanf("%d",&q);
    a[n]=q;
    if(search(q)){sum++;}
  }
  printf("%d\n",sum);
  return 0;
}



int search(int key){
  int i=0;
  while(a[i]!=key)i++;
  if(i==n)return 0;
  else return 1;
}


Measured memory_bytes: 2124
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    int n;
    R(n);
    map<string,int>AA;
    REP(i,n){
        string s;
        R(s);
        AA[s]++;
    }
    vector<pair<int,string>>BB;
    for(auto x:AA){
        BB.PB(MP(-x.S,x.F));
    }
    sort(ALL(BB));
    REP(i,SZ(BB)){
        if(BB[i].F==BB[0].F){
            W(BB[i].S);
        }
    }
    return 0;
}


Measured memory_bytes: 29556
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;

int main(){
	int n[4];
	for(int i = 0; i < 5; ++i)
		cin >> n[i]; 
	sort(n, n + 5, greater<int>());
	for(int i = 0; i < 5; ++i){
		if(i == 4)
			cout << n[i] << endl;
		else
			cout << n[i] << " ";
	}
	return 0;
}

Measured memory_bytes: 1176
#include<stdio.h>
int main(void)
{
	int a,b,c,d;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	if(a<c)	  a=c;
	if(b>d)  b=d;
	c=b-a;
	if(c<1)	printf("0\n");
	else	printf("%d\n",c);
	return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

import java.io.*;
import java.util.*;

public class Main {
    static int N;
    static double[][][] dp;
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        N = Integer.parseInt(s.nextLine());

        int[] count = new int[3];
        StringTokenizer st = new StringTokenizer(s.nextLine());
        for (int i =0 ; i < N; ++i) {
            int dish = Integer.parseInt(st.nextToken()) - 1;
            count[dish]++;
        }

        dp = new double[301][301][301];

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

        dp[0][0][0] = 0;

        System.out.println(getExpectedValue(count[2], count[1], count[0]));
    }

    static double getExpectedValue(int a, int b, int c) {
        if (dp[a][b][c] != -1) {
            return dp[a][b][c];
        }

        double expected = 0;
        if (a != 0)
            expected += a * getExpectedValue(a-1, b+1, c);
        if (b != 0)
            expected += b * getExpectedValue(a, b-1, c+1);
        if (c != 0)
            expected += c * getExpectedValue(a, b, c-1);

        double score = N/((double)(a + b + c)) + expected/(double)(a + b + c);
        dp[a][b][c] = score;
        return score;

    }
}


Measured memory_bytes: 305728
n, k = list(map(int, input().split()))
s = list(input())

s_new = s
if s_new[k -1] == 'A':
    s_new[k -1] = 'a'
elif s_new[k -1] == 'B':
    s_new[k -1] = 'b'
elif s_new[k -1] == 'C':
    s_new[k -1] = 'c'
print(''.join(s_new))


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

int main() {
  int k, x; cin >> k >> x;
  bool init = true;
  for (int i = x + 1 - k; i < x + k; i++) {
    if (!init) {
      cout << " ";
    }
    cout << i;
    init = false;
  }
  cout << endl;
}

Measured memory_bytes: 256
//@author :  |< U $ |-|
#include<cmath>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<deque>
#include<queue>
#include<algorithm>
#include<list>
#include<cstring>
#include<unordered_map>
#define ll long long
#define vi vector<long long>
#define pb push_back
#define pop pop_back
#define pi pair<long long ,long long>
#define vp vector<pair<long long,long long> >
#define mkp make_pair
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define jaldi ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define map map<long long,long long>
#define inm1(b)  memset(b,-1,sizeof(b))
#define in0(b) memset(b,0,sizeof(b))
#define ininf(b) memset(b,1000000001,sizeof(b))
#define MOD         1000000007
#define I 1000000000000000001
#define t(a) cout<<a<<" "<<endl
#define tt(a,b) cout<<a<<" "<<b<<endl
#define th(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define TakeInput freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
using namespace std;
ll gcd(ll a, ll b) {  if (a == 0)  return b; return gcd(b % a, a); }


int main(){
    jaldi
    #ifndef ONLINE_JUDGE
    TakeInput
    #endif
    
    ll n,m,k,x;
    string a;
    cin>>a;
    n = a.length();

    ll count=0;
    for(ll i=0;i<n;i++){
        count += a[i] - '0';
    }

    if(count%9 ==0 ){
        cout<<"Yes";
    }
    else{
        cout<<"No";
    }
}


Measured memory_bytes: 3736
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

typedef long long ll;

using namespace std;

struct sieve{
  int p=0;
  vector<bool> furui;
  sieve(int n){
    furui.resize(n,1);
    furui[0]=0;
    furui[1]=0;
    for(int i=2;i<n;i++)if(furui[i])for(int j=i*2;j<n;j+=i)furui[j]=0;
  }
  bool isprime(int m){return furui[m];}
};
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;cin>>n;
  ll a,b;cin>>a>>b;
  ll res=0;
  vector<ll>x(n);
  rep(i,n){
    cin>>x[i];
  }
  rep(i,n-1){
    res+=min(b,(x[i+1]-x[i])*a);
  }
  cout<<res<<endl;


  return 0;

}


Measured memory_bytes: 1024
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * 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;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();
	}

	static class Task {
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			String O = in.next();
			String E = in.next();
			for(int i = 0; i < E.length(); i++) {
				out.print("" + O.charAt(i) + E.charAt(i));
			}
			if(O.length() > E.length()) {
				out.println("" + O.charAt(O.length() - 1));
			} else {
				out.println();
			}
		}
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		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 char nextChar() {
			return next().charAt(0);
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}
		
		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

	}
}


Measured memory_bytes: 23380
a,b = map(int, input().split())
s = input()
for i in s[0:a]:
    if 48 <= ord(i) and ord(i) <= 57:
        continue
    else:
        print("No")
        exit()
if s[a] != "-":
    print("No")
    exit()
for i in s[a+1:a+b+1]:
    if 48 <= ord(i) and ord(i) <= 57:
        continue
    else:
        print("No")
        exit()
print("Yes")

Measured memory_bytes: 9144
S=input()
cnt=0
long=int(len(S))
if long%2==0:
    for i in range(long//2):
        if S[i]!=S[long-1-i]:
            cnt+=1
else:
    for i in range((long-1)//2):
        if S[i]!=S[long-1-i]:
            cnt+=1
print(cnt)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
  	int n,tp; set<int> st;
  	cin>>n;
  	for(int i=0; i<n; ++i) cin>>tp, st.insert(tp);
  	if(st.size()==n) cout<<"YES";
  	else cout<<"NO";
  	return 0;
}


Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
 
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<long long, long long> pll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll,ll> ii;
typedef vector<pair<ll,ll> > vii;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<pair<long long,long long> > vpll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<ll,pair<ll,ll> > iii;
#define PI 3.141592653589793
#define mod (ll)(1000*1000*1000+7)
//# define N 300005
template<typename T> T gcd(T a,T b) { if(a==0) return b; return gcd(b%a,a); }
template<typename T> T pow(T a,T b, ll m){T ans=1; while(b>0){ if(b%2==1) ans=((ans%m)*(a%m))%m; b/=2; a=((a%m)*(a%m))%m; } return ans%m; }
# define INF (ll)1e18
# define LG 20  
typedef pair<ll,pair<ll,ll> > pii;
# define INF1 (ll)1e9+2
# define maxn 100005
# define offset 1000005

int main()
{
  int n,k;
  cin >> n >> k;
  int a[n];

  for(int i=0;i<n;i++)
  {
    cin >> a[i];
  }
  if(k>=n)
  {
    cout << "1";
    return 0;
  }
  n-=k;
  int ans=1;
  ans+=(n/(k-1));
  if(n%(k-1))
    ans++;
  cout << ans;

}

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <unordered_set>
#include <map>
#define ll long long
#define endl '\n'
using namespace std;

struct Pos{
  int x;
  int y;
};

int H, W;
vector<string> grid;
bool visited[50][50];
int dx[]{0, 1, 0, -1};
int dy[]{1, 0, -1, 0};

int get_number_of_component(int x, int y)
{
  int ret = 1;
  queue<Pos> quu; quu.push(Pos{x, y}); visited[x][y] = true;

  while(!quu.empty())
    {
      auto cur = quu.front(); quu.pop();
      for(int i = 0; i < 4; i++)
	{
	  auto nx = cur.x + dx[i], ny = cur.y + dy[i];
	  if(min(nx, ny) < 0 || nx >= H || ny >= W) continue;
	  if(visited[nx][ny]) continue;
	  if(grid[nx][ny] == '.') continue;

	  visited[nx][ny] = true;
	  quu.push(Pos{nx, ny});
	  ret += 1;
	}
    }
  return ret;
}

int main(void)
{
  cin.tie(NULL); ios_base::sync_with_stdio(false); cin >> H >> W;
  for(int i = 0; i < H; i++)
    {
      string temp; cin >> temp; grid.push_back(temp);
    }
  for(int i = 0; i < H; i++)
    {
      for(int j = 0; j < W; j++)
	{
	  if(visited[i][j]) continue;
	  if(grid[i][j] == '.') continue;
	  auto ret = get_number_of_component(i, j);
	  if(ret == 1)
	    {
	      cout << "No" << endl;
	      return 0;
	    }
	}
    }


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

/*

 */


Measured memory_bytes: 256
(function main(){
  const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');
  const n = Number(lines.shift());
  const arr = lines.shift().split(' ').map(Number);
  buildMaxHeap(arr);
  console.log(arr.reduce((s, e) => s += ' ' + e, ''));
})();

function buildMaxHeap(arr) {
  const n = arr.length;
  const maxHeapify = (i) => {
    const left = 2 * i + 1, right = 2 * i + 2;
    let largest = i;
    if (left < n && arr[left] > arr[largest]) largest = left;
    if (right < n && arr[right] > arr[largest]) largest = right;
    if (largest != i) {
      arr[largest] = [arr[i], arr[i] = arr[largest]][0];
      maxHeapify(largest);
    }
  };

  for (let i = Math.floor(arr.length / 2); i >= 0; i--) maxHeapify(i);
}



Measured memory_bytes: 140164
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


inf = float('inf')


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_list_of_int():
    return [int(i) for i in input().split()]


def get_list_of_float():
    return [float(f) for f in input().split()]


def get_list_of_char():
    return list(input().strip())


def get_data(n, order=None, **kwargs):
    if not order:
        order = range(len(kwargs))
    it = iter(order)
    var, fn = zip(*sorted(sorted(kwargs.items()), key=lambda _: next(it)))

    rows = []
    for _ in range(n):
        rows.append(input().split())
    columns = zip(*rows)
    exec("global "+", ".join(var)+"\n"+"\n".join(
        v+"=list(map(fn[{}], data[{}]))".format(i, i)
        for i, v in enumerate(var)),
        globals(),
        {"fn": list(fn), "data": list(columns)}
    )
    return


# inputs
N, K = 0, 0


def set_inputs():
    global N, K
    N = get_int()
    K = get_int()
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    p = 1
    for i in range(N):
        p = min(p * 2, p + K)
    print(p)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
import java.util.*;

@SuppressWarnings("unused")
public class Main {

  private static void solve() {
    int n = ni();

    long ret = 0;
    for (int a = 1; a < n; a++) {
      ret += (n - 1) / a;
    }
    System.out.println(ret);
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


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

signed main()
{
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int cnta = (c+b-1)/b;
    int cntb = (a+d-1)/d;
    cout << (cnta <= cntb? "Yes" : "No") << "\n";
    
}

Measured memory_bytes: 3632
# define _CRT_SECURE_NO_WARNINGS 1
# define _USE_MATH_DEFINES
# include <iostream>
# include <numeric>
# include <string>
# include <bitset>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <deque>
# include <iomanip>
# include <queue>
# include <sstream>
# include <unordered_set>
# include <unordered_map>
# include <climits>
# include <complex>
# include <cmath>
# include <list>
# include <functional>
# include <string>
# include <ctime>
# include <set>
# include <forward_list>
# include <map>
# include <stack>
using namespace std;
# define MP make_pair
# define INF ((int)(1<<25))
# define REP(i,n) for(int i=0;i<(int)n;i++)
# define FOR(i,n) REP(i,n)
# define FORI(i,k,n) for(int i=k;i<(int)n;i++)
# define TORAD 2.0*M_PI/360.0
# define INT(x) int x;cin>>x;
# define STRING(x) string x;cin>>x;
# define STR(x) STRING(x);
# define DOUBLE(x) double x;cin>>x;
# define DBL(x) DOUBLE(x); 
# define ALL(x) begin(x),end(x)
# define RALL(x) (x).rbegin(),(x).rend()
# define DEBUG(x) cout<<#x<<":"<<x<<endl
# define INIT(a) memset(a,-1,sizeof a)
# define CLR(a) memset(a,0,sizeof a)
# define EPS 1e-12
#ifdef _MSC_VER
#include <intrin.h>
#define __builtin_popcount __popcnt
#endif
typedef long long lint;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<int> vi;
typedef vector<lint> vl;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
//const int dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 };
//const int M = 1000000007;
template<class T> void debug(T a) { for ( auto i : a )cout << i << endl; }

struct P
{
	int maxx = -1, maxy = -1;
	int minx = INF, miny = INF;
	void add_point(int x, int y)
	{
		maxx = max(maxx, x);
		maxy = max(maxy, y);
		minx = min(minx, x);
		miny = min(miny, y);
	}
	bool operator<(const P &other) const { return 1; }
	bool operator>(const P &other) const { return 1; }
};
int main()
{
	int n;
	cin >> n;
	FOR(c, n)
	{
		int h, w;
		cin >> h >> w;
		vs data;
		FOR(i, h)
		{
			string s;
			cin >> s;
			data.push_back(s);
		}
		map<char, P> m;
		FOR(i, h)
		{
			FOR(j, w)
			{
				if ( data[i][j] != '.' )
				{
					m[data[i][j]].add_point(i, j);
				}
			}
		}
		
		bool safe = false;
		vector< pair<char, P> > order;
		for ( auto it = m.begin(); it != m.end(); it++ )order.push_back(*it);
		sort(ALL(order));
		do
		{
			vs temp = data;
			bool ok = true;
			for ( auto s : order )
			{
				P a = s.second;
				for ( int i = a.minx; i <= a.maxx; i++ )
				{
					for ( int j = a.miny; j <= a.maxy; j++ )
					{
						if ( temp[i][j] != s.first&&temp[i][j] != '*' )ok = false;
						temp[i][j] = '*';
					}
				}
			}
			safe |= ok;
		} while ( next_permutation(ALL(order)) );

		cout << (safe ? "SAFE" : "SUSPICIOUS") << endl;

	}
}

Measured memory_bytes: 3200
n,k=map(int,input().split())
d=[]
a=[]
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
n_list=[]
for i in range(1,n+1):
    n_list.append(i)
count=[1]*n
for i in range(len(a)):
    for j in range(len(a[i])):
        count[a[i][j]-1]=0
sum=0
for l in count:
    sum+=l
print(sum)


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

double a, b, x;
double pi = 3.141592653589793;
double calc(double x) {
    double y = x/180 * pi;
    double z = (90 - x) / 180 * pi; 
    double res;
    if (b * tan(z) > a) res = (a*a*b - a*a*a*tan(y)/2);
    else res = a*b*b*tan(z)/2;
    return res;
}

int main() {
    cin >> a >> b >> x;
    double s = 0;
    double t = 90;
    while (t - s > 0.000000001) {
        double u = (s+t)/2;
        if (calc(u) > x) s = u;
        else t = u;
    }
    printf("%2.10lf", t);
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <climits>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#define MAX 1000
#define INFTY 1<<30 // 2^30
using namespace std;
typedef long long llong;

static const int N = 100;

int n, M[N][N];
int d[N];

int bfs(int s)
{
  queue<int> q;
  q.push(s);
  for(int i = 0; i < n; i++) d[i] = INFTY;
  d[s] = 0;
  int u;
  while(!q.empty())
  {
    u = q.front(); q.pop();
    for(int v = 0; v < n; v++)
    {
      if(M[u][v] == 0) continue; // if not connect
      if(d[v] != INFTY) continue; // if have reached
      d[v] = d[u] + 1;
      q.push(v);
    }
  }
  for(int i = 0; i < n; i++)
    cout << i+1 << " " << ((d[i] == INFTY) ? (-1) : d[i]) << endl;
}

int main()
{
  int u, k, v;
  cin >> n;
  for(int i = 0; i < n; i++)
  {
    cin >> u >> k;
    u--;
    for(int j = 0; j < k; j++)
    {
      cin >> v;
      v--;
      M[u][v] = 1;
    }
  }
  bfs(0);
}

Measured memory_bytes: 1240
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
int main()
{
    int N, K;
    cin >> N>>K;

    vector<int> l(N);
    REP(i, N){
        cin>>l[i];
    }

    sort(l.begin(), l.end());
    reverse(l.begin(), l.end());

    int ans = 0;
    REP(i, K){
        ans+=l[i];
    }



    cout << ans << endl;

   return 0;
}

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

string s[200000],a[200000],t;
map<string,int> mp;

int main(){
    int n,cnt=0;

    cin >> n;
    int k=n-1;
    for(int i=0; i<n; i++){
        cin >> t;
        mp[t] += 1;
        s[i] = t;
    }
    for(int i=0; i<n; i++){
        if(mp[s[i]]){
            cnt ++;
            mp[s[i]] = 0;
        }
    }
    cout << cnt << endl;


    return 0;
}

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

int main()
{
    int n, temp = -1, i = 4;
    cin>>n;

    while(i--)
    {
        if(temp == n % 10)
        {
            cout<<"Bad"<<endl;
            return 0;
        }
        temp = n % 10;
        n = n / 10;
    }
    cout<<"Good"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
ll ans = 1;
const ll mo = 1000000007;

int main()
{
ll n , x , y , z ;
cin >> n >> x >> y >> z ;
vector<vector<ll>> dp(n+1, vector<ll>(1LL<<(x+y+z-1),0) );
dp[0][0]=1;
rep(i,n)rep(j,dp[i].size()){
  for(ll k=1;k<=10;k++){
    ll te=(j<<k)|(1LL<<(k-1));
    if(!(((te>>(x+y+z-1))&1LL)&&((te>>(x+y-1))&1LL)&&((te>>(x-1))&1LL))){
      dp[i+1][te&((1LL<<(x+y+z-1))-1LL)]+=dp[i][j];
      dp[i+1][te&((1LL<<(x+y+z-1))-1LL)]%=mo;
    }
  }
}
rep(i,n){
  ans*=10;
  ans%=mo;
}
for(auto i:dp[n]){
  ans-=i;
  ans%=mo;
}
cout << (ans+mo)%mo << endl;
return 0;
}

Measured memory_bytes: 21888
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int n;
vector<int> to[8];
bool check[8];
int ans;

void dfs(int p, int cnt) {
    if (cnt == n) {
        ans++;
        return;
    }
    for (int np : to[p]) {
        if (!check[np]) {
            check[np] = true;
            dfs(np, cnt + 1);
            check[np] = false;
        }
    }
  	return;
}

int main() {
    int m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    check[0] = true;
    dfs(0, 1);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
n,q = map(int,input().split())
s = input()
b = [0]*n
c = 0
for i in range(1,n):
    if s[i-1]=="A" and s[i]=="C":
        c+=1
    b[i]=c
for i in range(q):
    x,y = map(int,input().split())
    print(b[y-1]-b[x-1])

Measured memory_bytes: 6084
/*input
4
1 1
1 2
2 1
2 2
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}

//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}

ll x[maxn],y[maxn];

set<pll> st;

int main(){
	IOS;
	int n;
	cin>>n;
	REP(i,n) cin>>x[i]>>y[i];

	int ans=n;

	REP(i,n) st.insert(MP(x[i],y[i]));

	REP(i,n) REP(j,n) if(i!=j){
		ll dx=x[j]-x[i];
		ll dy=y[j]-y[i];
		int cnt=0;
		REP(k,n){
			if(st.count(MP(x[k]+dx,y[k]+dy)));
			else cnt++;
		}
		ans=min(ans,cnt);
	}
	cout<<ans<<'\n';

	return 0;
}


Measured memory_bytes: 2432
from collections import deque

N,M = map(int,input().split())
ad = [[[] for _ in range(3)] for _ in range(N)]
for _ in range(M):
    u,v = map(int,input().split())
    u -= 1
    v -= 1
    for j in range(3):
        ad[u][j].append((v,(j+1)%3))
S,T = map(int,input().split())
S -= 1
T -= 1

visited = [[False]*3 for _ in range(N)]
dq = deque()
dq.append((S,0,0))
visited[S][0] = True

while dq:
    v,j,d = dq.popleft()
    nd = d + 1
    for nv,nj in ad[v][j]:
        if (nv,nj) == (T,0):
            print(nd//3)
            exit()
        if visited[nv][nj]:
            continue
        visited[nv][nj] = True
        dq.append((nv,nj,nd))
        
print(-1)

Measured memory_bytes: 80692
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <ctime>
#include <map>
#include <stack>
#include <sstream>
#include <set>
#include <fstream>
#include <cmath>

using namespace std;
#define SWAP(x,y,t) (t=x,x=y,y=t)
int main(void)
{
	int n;
	vector <int> p;
	int count = 0;
	int temp;
	cin >> n;

	for (int i = 0; i < n; i++)
	{
		cin >> temp;
		p.push_back(temp);
	}

	int i = 0;
	while (1)
	{
		for (i = 0; i < n; i++)
		{
			if (p[i] == i + 1)
			{
				count++;
				if (i == 0)
				{
					SWAP(p[i], p[i + 1], temp);
				}
				else if (i == n - 1)
				{
					SWAP(p[i], p[i - 1], temp);
				}
				else
				{
					if (p[i + 1] == i + 2)
					{
						SWAP(p[i], p[i + 1], temp);
					}
					else
					{
						SWAP(p[i], p[i - 1], temp);
					}
				}
			}
		}
		if (i == n)
		{
			break;
		}
	}

	cout << count << endl;
	return 0;
}

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

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)

using namespace std;

int N,H;
string s[110];
int cap[110];

int main(){
  cin >> N >> H;
  rep(i,N) cin >> s[i] >> cap[i];
  double numType = 0;
  double numSucc = 0;
  rep(i,N){
    int cur = 0, miss = 0;
    //char S[20];
    //rep(j,s[i].size()) S[i] = s[i][j];
    //S[s[i].size()] = '\0';
    string S = s[i];
    while( cur < s[i].size() ) {
      //printf("? %s\n", S); fflush(stdout);
      cout << "? " << S << endl; fflush(stdout);
      char c[2];
      scanf(" %s", c);
      ++numType;
      if( tolower(c[0]) == tolower(S[cur]) ) {
	++numSucc;
	S[cur] = '_';
	++cur;
      } else {
	++miss;
      }
      if( miss > cap[i] ) {
	--H;
	break;
      }
    }
    if( H <= 0 ) {
      printf("! Game Over\n"); fflush(stdout);
      return 0;
    } 
  }
  double success_type_rate = numSucc / numType * 100.0;
  success_type_rate *= 10.0;
  success_type_rate = floor(success_type_rate);
success_type_rate /= 10.0;
  printf("! Game Clear %.1lf\n", success_type_rate); fflush(stdout);
  return 0;
}

Measured memory_bytes: 1304
import Data.List
import Data.Function
import Control.Monad
import Control.Applicative
import Debug.Trace

toPair [x,y] = (x,y)

f (a, b) bs = do
  let s = take 1 $ sortBy (compare `on` snd) $ filter (\(x, y) -> x > a && y > b) bs
  (s, bs \\ s)

g [] bs s = reverse s
g (r:rs) bs s = do
  let (b, bs') = f r bs
  g rs bs' (b ++ s)

main = do
  n <- read <$> getLine :: IO Int
  rs <- reverse.sort <$> map (toPair.map read.words) <$> replicateM n getLine :: IO [(Int,Int)]
  bs <- reverse.sort <$> map (toPair.map read.words) <$> replicateM n getLine :: IO [(Int,Int)]
  --let rs = reverse $ sort [(1,3),(8,3)]
  --let bs = reverse $ sort [(9,4),(9,9)]
  --let rs = reverse $ sort [(2, 0), (3, 1), (1, 3)]
  --let bs = reverse $ sort [(4, 2), (0, 4), (5, 5)]
  --print $ rs
  --print $ bs
  --print $ g rs bs []
  print $ length $ g rs bs []


Measured memory_bytes: 1020
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
typedef long long ll;

int main() {
  int n,r;
  cin >> n >> r;
  if(n>=10){
    cout << r << endl;
  }else{
    cout << r+100*(10-n) << endl;
  }
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))
out = lambda x: print('\n'.join(map(str, x)))

n = ini()
ans = 0
tmp = 1
while n > 0:
    n //= 2
    ans += tmp
    tmp *= 2
print(ans)

Measured memory_bytes: 9196
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) (((x) < 0)?-(x):(x))
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

using cat = long long;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	cat N, A, B;
	cin >> N >> A >> B;
	if(A > B) swap(A, B);
	if((B-A)%2 == 0) cout << (B-A)/2 << "\n";
	else cout << min((B+A-1)/2, (2*N-B-A+1)/2) << "\n";
	return 0;
}

// look at my code
// my code is amazing


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();

        if (a < b && b < c) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

        System.exit(0);
    }
}



Measured memory_bytes: 26252
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define FORR(x, arr) for(auto& x:arr)
#define ITR(x, c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;
typedef pair<int, int> P;

int a, b;

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	cin >> a >> b;
	cout << b*2-a << endl;
	return 0;
}

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

using namespace std;

void solve(int a, int b, int c, int cnt){
	if(a == b && a == c){
		cout << cnt;
		exit(0);
	}
	if(a < b && a < c) solve(a+2,b,c,cnt+1);
	if(b < a && b < c) solve(a,b+2,c,cnt+1);
	if(c < a && c < b) solve(a,b,c+2,cnt+1);
	if(a <= c && b <= c) solve(a+1,b+1,c,cnt+1);
	if(a <= b && c <= b) solve(a+1,b,c+1,cnt+1);
	if(b <= a && c <= a) solve(a,b+1,c+1,cnt+1);
}

int main(){
	int a,b,c;
	cin >> a >> b >> c;
	solve(a,b,c,0);
}

Measured memory_bytes: 256
pub struct ProconReader<R: std::io::Read> {
    reader: R,
}

impl<R: std::io::Read> ProconReader<R> {
    pub fn new(reader: R) -> Self {
        Self { reader }
    }
    pub fn get<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&byte| byte == b' ' || byte == b'\n' || byte == b'\r')
            .take_while(|&byte| byte != b' ' && byte != b'\n' && byte != b'\r')
            .collect::<Vec<_>>();
        std::str::from_utf8(&buf)
            .unwrap()
            .parse()
            .ok()
            .expect("Parse Error.")
    }
}

fn gcd(a: usize, b: usize) -> usize {
    if a % b == 0 {
        b
    } else {
        gcd(b, a % b)
    }
}

fn main() {
    let stdin = std::io::stdin();
    let mut rd = ProconReader::new(stdin.lock());

    let n: usize = rd.get();
    let a: Vec<usize> = (0..n).map(|_| rd.get()).collect();

    let mut pairwise = true;
    let mut seen = std::collections::HashSet::new();
    for &x in &a {
        if !pairwise {
            break;
        }
        let mut s = std::collections::HashSet::new();
        let mut y = x;
        let mut i = 2;
        while y > 1 {
            if i * i > y {
                break;
            }
            while y % i == 0 {
                s.insert(i);
                y /= i;
            }
            i += 1;
        }
        if y > 1 {
            s.insert(y);
        }
        for s in s {
            if !seen.insert(s) {
                pairwise = false;
                break;
            }
        }
    }

    if pairwise {
        println!("pairwise coprime");
        return;
    }

    let mut g = a[0];
    for i in 1..n {
        g = gcd(g, a[i]);
    }
    if g == 1 {
        println!("setwise coprime");
        return;
    }

    println!("not coprime");
}

Measured memory_bytes: 9956
#include<stdio.h>

int main(void){
	int a,b,c,i,a1 = 0;
	scanf("%d",&a);
	scanf("%d",&b);

	c = b - a;

	for(i = 1;i <= c;i++){
		a1 = a1 + i;
	}

	printf("%d",a1 - b);


	return 0;
}

Measured memory_bytes: 128
import sys
input = sys.stdin.readline

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))

n,d = inlt()
points = []
count = 0
for i in range(n):
    x,y = inlt()
    if x*x + y*y <= d*d:
        count += 1

print(count)

Measured memory_bytes: 72976
#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 6;
int n, m, t, f[N], ans;
vector<int> e[N];
bitset<N> v;

bool dfs(int x) {
    for (unsigned int i = 0; i < e[x].size(); i++) {
        int y = e[x][i];
        if (v[y]) continue;
        v[y] = 1;
        if (!f[y] || dfs(f[y])) {
            f[y] = x;
            return 1;
        }
    }
    return 0;
}

int main() {
    cin >> n >> m >> t;
    while (t--) {
        int x, y;
        scanf("%d %d", &x, &y);x++,y++;
        e[x].push_back(y + n);
        e[y+n].push_back(x);
    }
    for (int i = 1; i <= n; i++) {
        v.reset();
        ans += dfs(i);
    }
    cout << ans << endl;
    return 0;
}
/* 
3 4 6
0 0
0 2
0 3
1 1
2 1
2 3

|X| |Y| |E|
x0 y0
x1 y1
:
x|E|−1 y|E|−1

1 ≤ |X|, |Y| ≤ 100
0 ≤ |E| ≤ 10,000
 */


Measured memory_bytes: 3392
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;
typedef long long ll;

const ll M = 1000000007;

int main(){
    int N;
    cin >> N;
    vector<ll> A(N);
    ll s = 0;
    for(int i = 0; i < N; i++){
        cin >> A[i];
        s += A[i];
        s %= M;
    }

    vector<ll> pro(N);
    ll ans = 0;
    for(int i = 0; i < N; i++){
        s -= A[i];
        if (s < 0) s += M;
        ans += A[i] * s;
        ans %= M;
    }

    cout << ans << endl;
}

Measured memory_bytes: 6424