akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(1){
        int data1, data2;
        cin >> data1 >> data2;
        
        if(data1 == 0 && data2 == 0){
            break;
        }else{
            if(data1 > data2){
                swap(data1, data2);
            }
            cout << data1 << " " << data2 << "\n";
        }
    }
}



Measured memory_bytes: 3124
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
using Pd = pair<double,double>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;
int n;
vector<Pd> ans;

void koch(Pd s,Pd t,int level){
    if(level==0){
        ans.push_back(s);
        return;
    }

    Pd c1 = {(2*s.first + t.first)/3.0,(2*s.second + t.second)/3.0};
    Pd c3 = {(s.first + 2*t.first)/3.0,(s.second + 2*t.second)/3.0};
    double dx = (t.first - s.first)/2.0;
    double dy = (t.second - s.second)/2.0;
    Pd c2 = {s.first + dx - (dy/sqrt(3)),s.second + dy + (dx/sqrt(3))};

    koch(s,c1,level-1);
    koch(c1,c2,level-1);
    koch(c2,c3,level-1);
    koch(c3,t,level-1);

    return ;
}

int main(){
    cin >> n;
    Pd s = {0,0};
    Pd t = {100,0};
    koch(s,t,n);
    ans.push_back(t);
    rep(i,ans.size()){
        printf("%f %f\n",ans[i].first ,ans[i].second);
    }
    return 0;
}


Measured memory_bytes: 3220
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <functional>
using namespace std;
#define int long long
#define All(v) (v).begin(),(v).end()
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int Dy[8] = {-1,-1,0,1,1,1,0,-1};
int Dx[8] = {0,1,1,1,0,-1,-1,-1};
const int mod = 1000000007;
const int inf = mod*mod;
const int d5 = 100100;
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin>>n>>m;
    vector<int> a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    a[0]%=m;
    for(int i=1;i<n;i++){
        a[i]+=a[i-1];
        a[i]%=m;
    }
    //for(auto it:a)cout<<it<<' ';
    unordered_map<int,int> D;
    for(auto it:a)D[it]++;
    int res=0;
    for(auto it:D){
        //cout<<it.first<<' '<<it.second*(it.second+1)/2<<endl;
        res+=it.second*(it.second-1)/2;
    }
    cout<<res+D[0]<<endl;
}

Measured memory_bytes: 4492
N = int(input())
H = list(map(int, input().split()))

res = 0
cnt = 0
for i in range(N - 1):
    if H[i] >= H[i + 1]:
        cnt += 1
    else:
        res = max(cnt, res)
        cnt = 0

res = max(cnt, res)

print(res)

Measured memory_bytes: 20336
N, K = map(int, input().split())
A = list(map(int, input().split()))

B = [0] * (N + 1)
for i in range(N):
    B[A[i]] += 1
B.sort(reverse=True)
cnt = 0
# 利用可能な種類数がK個なのでN-Kで答えになる
for i in range(K):
    cnt += B[i]
print(N - cnt)

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

int main(void) {

  int x,h;

  while(1) {

    scanf("%d",&x);

    scanf("%d",&h);

    if(x==0 && h==0) break;

    printf("%6lf\n",x*x+2.0*x*sqrt(x*x/4.0+h*h));

  }

  return 0;

}

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

int main()
{
    int a,b;
    cin>>a>>b;
    string str;
    cin>>str;
    int temp=1;
    if(str[a]=='-')
    {
        for(int i=0;i<str.length();i++)
        {
            if(i!=a)
            {
                if(str[i]>='0'&&str[i]<='9')
                    continue;
                else
                {
                    temp=0;
                    cout<<"No"<<endl;
                    break;
                }
            }
        }
        if(temp)
            cout<<"Yes"<<endl;
    }
    else
        cout<<"No"<<endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
 int n;
  cin>>n;
  string s1="AC",s2="WA",s3="TLE",s4="RE";
  string s[n];
  int i,c1=0,c2=0,c3=0,c4=0;
  for(i=0;i<n;i++)
  {
  
      cin>>s[i];
      if(s[i]==s1)
        c1++;
      else if(s[i]==s2)
        c2++;
      else if(s[i]==s3)
        c3++;
      else if(s[i]==s4)
        c4++;       
  
  }
  cout<<s1<<" "<<'x'<<" "<<c1<<endl<<s2<<" "<<'x'<<" "<<c2<<endl<<s3<<" "<<'x'<<" "<<c3<<endl<<s4<<" "<<'x'<<" "<<c4<<endl;}


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

int main(){
    string num;
    cin >> num;
    if(num[0] == '7' || num[1] == '7' || num[2] == '7'){
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
    return 0;
}

Measured memory_bytes: 3628
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>

#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long>vll;
typedef pair<int,int> pi;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

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

    ll ans = 0;
    ll height = A[0];
    for(int i = 1; i < N; i++) {
        if (A[i] < height) {
            ans += height - A[i];
            height = height;
        } else {
            height = A[i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 4816
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vd(T) vector<vector<T>>
#define v(T) vector<T>
#define mod (ll)(1e9+7)
#define pp(T) pair<T,T>
#define pb push_back
#define mp make_pair
#define NN 100005
#define IO ios_base::sync_with_stdio(NULL),cin.tie(0),cout.tie(0)
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define DEBUG cout<<"***********DEBUGGING***********"<<endl
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; 
ll power(ll a,ll b){ if(b==0) return 1; ll s=power(a,b/2); s*=s;if(b&1) return s*a; return s;}
ll powermod(ll a,ll b,ll m){ if(b==0) return 1; ll s=power(a,b/2);s*=s; s%=m; if(b&1) return (s*a)%m; return s;}
inline int add(ll a,ll b,ll m=0){
    if(m==0) return a+b;
    return (a%m+b%m)%m;
}

inline int sub(ll a,ll b ,ll m=0){
    if(m==0) return a-b;
    return ((a%m-b%m)%m+m)%m;
}

inline int mul(ll a,ll b,ll m=0){
    if(m==0)return (a*b);
    return ((a%m)*(b%m))%m;
}

inline int div(ll a,ll b,ll m=0){
    if(m==0) return a/b;
    return ((a%m)*(powermod(a,b,m-2)%m))%m;
}

bool isopen(char c){
    return ((c=='(')||(c=='{')||(c=='['));
}

ll longest_balanced_parenthesis(string a,ll n){
    stack<char> s;
    ll start=0;
    ll ans=0,m=0;
    for(ll i=0;i<n;i++){
        if(isopen(a[i])){
            s.push(a[i]);
        }
        else{
            if(isopen(a[i])|| s.empty()){
                m=max(m,ans);
                continue;
            }
            else{
                s.pop();
                ans+=2;
                m=max(ans,m);
            }
        }
    }

    return m;

}

ll setup_k(ll *a,ll k){
  ordered_set x;
  // Now , insert and then check number of integers less than k by just using x.order_of_key(k+1)
}
ll pr[1000001];
vector<vector<ll>> f(1000001);
ll solve(){
    fill(pr,pr+1000001,0);
    for(ll i=3;i<1000001;i++)pr[i]=1;
    pr[2]=1;
    for(ll i=2;i<1000001;i+=2)f[i].push_back(2);
    for(ll i=3;i*i<1000001;i+=2){
        if(pr[i]){
            for(ll j=i*i;j<1000001;j+=2*i){
                pr[j]=0;
            }
            for(ll j=i;j<1000001;j+=i){
                f[j].push_back(i);
            }
        }
    }
}


int main() {

    IO; 
    solve();
    ll n;
    cin>>n;
    map<ll,ll> m;
    ll ans=1;
    for(ll i=1;i<=n;i++){
        ll t=i;
        
        for(auto j:f[i]){
            ll cnt=0;
            while(t%j==0){
                t/=j;
                cnt++;
            }
            m[j]+=cnt;
        }
        if(t!=1){
            m[t]+=1;
        }
    }
    for(auto i:m){
        ans*=(i.second+1);
        ans%=mod;
    }
    cout<<ans<<endl;
    

}

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

P f(int x){
  int a = x%10;
  int b = 0;
  while(x){
    b = x;
    x/=10;
  }
  return P(a,b);
}

int main(){
  int n,ans=0;
  P p,q;
  map <P,int> freq;
  cin >> n;
  for(int i = 1;i<=n;i++){
    p = f(i);
    freq[p]++;
  }
  for (int i = 1;i<=n;i++){
    p = f(i);
    q = P(p.second,p.first);
    ans+=freq[q];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int string_up(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
}

int up(const void *a, const void *b){
  return *(char *)a - *(char *)b;
}

int main(){
  int n;
  scanf("%d", &n);
  char ins[n][11];
  for(int i = 0; i < n; i++){
    scanf("%s", ins[i]);
  }

  char *s[n];
  for(int i = 0; i < n; i++){
    s[i] = ins[i];
  }

  for(int i = 0; i < n; i++){
    qsort(s[i], 10, sizeof(char), up);
  }
  qsort(s, n, sizeof(*s), string_up);

  //printf(" %s\n%s\n%s\n", s[0], s[1], s[2]);
  long long int cs[n];
  for(long long int i = 0; i < n; i++){
    cs[i] = i * (i + 1) / 2;
  }
  long long int ans = 0;
  int p = 0;
  int i = 1;


  while(i < n){

    while(strcmp(s[i], s[i - 1]) == 0){
      p++;
      i++;
      if(i >= n){
        break;
      }
    }
    if(p > 0){
      ans += cs[p];
      p = 0;
    }
    i++;
  }

  printf("%lld\n", ans);

  return 0;
}


Measured memory_bytes: 2812
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


# rstrip().decode('utf-8')
# INF=float("inf")
# MOD=10**9+7
# sys.setrecursionlimit(2147483647)
# import math
import numpy as np
# import operator
# import bisect
# from heapq import heapify,heappop,heappush
# from math import gcd
# from fractions import gcd
# from collections import deque
# from collections import defaultdict
# from collections import Counter
# from itertools import accumulate
# from itertools import groupby
# from itertools import permutations
# from itertools import combinations
# from scipy.sparse import csr_matrix
# from scipy.sparse.csgraph import floyd_warshall
# from scipy.sparse.csgraph import csgraph_from_dense
# from scipy.sparse.csgraph import dijkstra
# map(int,input().split())


def main():
	N, K = map(int, input().split())
	ans=0
	for i in range(1,N+1):
		x=max(0,np.ceil(np.log2(K/i)))
		ans+=2**(-x)
	print(ans/N)
	
	
	
	
	
	
if __name__ == '__main__':
	main()


Measured memory_bytes: 20528
package main

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

func main() {
	n, k := readInt(), readInt()
	m := make(map[int]bool)

	for i := 0; i < k; i++ {
		d := readInt()
		for j := 0; j < d; j++ {
			m[readInt()] = true
		}
	}

	fmt.Println(n - len(m))
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

// -----------------------------------------------------------------

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	log.SetFlags(log.Lshortfile)
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


Measured memory_bytes: 1772
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");
		}
	}
}

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

#define rep(i, n) REP(i, 0, n)
#define REP(i, x, n) for (int i = x; i < n; i++)
#define REP2(i, x, n) for (int i = x; i <= n; i++)
#define OP(x) cout << x << endl;
typedef long long ll;

int main() {
    int N, M; cin >> N >> M;

    int ans = 0;
    rep(i, N){
        REP(j, i + 1, N){
            ans++;
        }
    }
    if(1 < M){
        rep(i, M){
            REP(j, i + 1, M){
                ans++;
            }
        }
    }
    OP(ans);
}





Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(void){
  long long  a, b100;
  double b;
  cin >> a >> b;

  b100 = 100 * b + 0.5;
  
  long long ret = (a * b100) /  100;
  
  cout << ret << endl;
  
  return 0;
}


Measured memory_bytes: 3712
#include <stdio.h>
#include <iostream>
using namespace std;

int n;
int A,B,C,D;
long long maxn[500006],minn[500006];

int main()
{
    scanf ("%d",&n);
    scanf ("%d %d %d %d",&A,&B,&C,&D);
    for (int i=1;i<n;i++)
        {
        maxn[i]=maxn[i-1]+(long long)D;
        minn[i]=minn[i-1]+(long long)C;
        }
    long long ans_min,ans_max;
    for (int i=0;i<n;i++)
        {
        ans_min=minn[n-i-1]-maxn[i];
        ans_max=maxn[n-i-1]-minn[i];
        if ((long long)A+ans_min<=(long long)B && (long long)A+ans_max>=(long long)B)
            {printf ("YES"); return 0;}
        }
    printf ("NO");
}


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

int main() {
    int x, n, tmp, ans;
    vector<int> p;
    cin >> x >> n;
    if(n == 0)
    {
        cout << x << endl;
        return 0;
    }
    for(int i=0; i<n; i++)
    {
        cin >> tmp;
        p.push_back(tmp);
    }
    sort(p.begin(), p.end());
    if(p[0] > x)
    {
        cout << x << endl;
        return 0;
    }
    if(p[0] == x)
    {
        cout << (x-1) << endl;
        return 0;
    }
    for(int i=1; i<n; i++)
    {
        if(p[i] > x)
        {
            cout << x << endl;
            return 0;
        }
        else if(p[i] == x)
        {
            int diff = 1;
            int fi = i+1;
            int bi = i-1;
            while(1)
            {
                if(bi >= 0)
                {
                    if(p[bi] != (x-diff))
                    {
                        cout << (x-diff) << endl;
                        return 0;
                    }
                }
                else
                {
                    cout << (x-diff) << endl;
                    return 0;
                }
                if(fi < n)
                {
                    if(p[fi] != (x+diff))
                    {
                        cout << (x+diff) << endl;
                        return 0;
                    }
                }
                else
                {
                    cout << (x+diff) << endl;
                    return 0;
                }
                diff++;
                fi++;
                bi--;
            }
        }
    }
    if(p[n-1] == (x-1)) cout << (x+1) << endl;
    else cout << (x-1) << endl;
    return 0;
}



Measured memory_bytes: 3644
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/















//---------------------------------------------------------------------------------------------------
vector<bool> matching(string x, string y) {
	int nx = x.size();
	int ny = y.size();

	vector<bool> res(6010, true);
	rep(st, 0, nx) {
		for (int i = 0; st + i < nx && i < ny; i++) {
			if (x[st + i] == '?') continue;
			if (y[i] == '?') continue;
			if (x[st + i] != y[i]) res[st] = false;
		}
	}

	return res;
}
//---------------------------------------------------------------------------------------------------
int solve(string A, string B, string C) {
	int na = A.size();
	int nb = B.size();
	int nc = C.size();

	auto ab = matching(A, B);
	auto bc = matching(B, C);
	auto ac = matching(A, C);

	int ans = inf;
	rep(a, 0,  2001) rep(b, 0, 4001) if (ab[a] && bc[b] && ac[a + b]) {
		chmin(ans, max({ na, a + nb, a + b + nc }));
	}
	return ans;
}
//---------------------------------------------------------------------------------------------------
void _main() {
	vector<string> v;
	rep(i, 0, 3) {
		string s; cin >> s;
		v.push_back(s);
	}
	sort(all(v));

	int ans = inf;
	do {
		chmin(ans, solve(v[0], v[1], v[2]));
	} while (next_permutation(all(v)));
	cout << ans << endl;
}







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

class Main {
	
	public static void main(String[] args) {
		new Main().run();
	}
	
	class R implements Comparable<R>{
		int id, p;
		public R(int id) {
			this.id = id;
		}
		public int compareTo(R o) {
			return o.p - p;
		}
	}
	
	void run(){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] res = new int[n];
		R[] r = new R[n];
		for(int i = 0; i < n; i++)r[i] = new R(i);
		for(int i = 0; i < n * (n - 1) / 2; i++){
			int s = scan.nextInt() - 1,
					t = scan.nextInt() - 1,
					ps = scan.nextInt(),
					pt = scan.nextInt();
			if(ps < pt)r[t].p += 3;
			else if(pt < ps)r[s].p += 3;
			else{
				r[s].p++;
				r[t].p++;
			}
		}
		Arrays.sort(r);
		int v = 1;
		res[r[0].id] = 1;
		for(int i = 1; i < n; i++){
			if(r[i].p != r[i - 1].p)v = i + 1;
			res[r[i].id] = v;
		}
		for(int x:res)System.out.println(x);
	}
}

Measured memory_bytes: 47324
#include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>

using namespace std;
template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}

#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define REV(v) reverse(v.begin(),v.end())
#define SRT(v) sort(v.begin(),v.end())
#define MOD 1000000007

typedef long long ll;
typedef tuple<int,int,bool> Tb;

int atcoder(){
    //入力
    int n;
    cin >> n;
    //処理
    //出力
    if((n%1000)%111==0 || (n/10)%111==0) cout << "Yes" << ENT;
  	else cout << "No" << ENT;
    return 0;
}

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


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

typedef unsigned long ul;
typedef long long ll;
typedef pair<ul, ul> P;
map<int, int> dp;
#define REP(i, n) for (int i = 0; i < n; i++)

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int H, W, A, B;
  cin >> H >> W >> A >> B;
  for (int h = 0; h < B; ++h) {
    for (int i = 0; i < A; ++i) {
      cout << "1";
    }
    for (int i = 0; i < W - A; ++i) {
      cout << "0";
    }
    cout << endl;
  }
  for (int h = 0; h < H-B; ++h) {
    for (int i = 0; i < A; ++i) {
      cout << "0";
    }
    for (int i = 0; i < W - A; ++i) {
      cout << "1";
    }
    cout << endl;
  }



  return 0;
}


Measured memory_bytes: 1280
# -*- coding: utf-8 -*-

s = raw_input()

first = int(s[:2])
second = int(s[2:])

frstMM = first <= 12 and first > 0
scndMM = second <= 12 and second > 0

if frstMM and scndMM:
    print "AMBIGUOUS"
elif frstMM:
    print "MMYY"
elif scndMM:
    print "YYMM"
else:
    print "NA"



Measured memory_bytes: 2568
n,m = gets.chomp.split(" ").map(&:to_i)
listl = Array.new(n)
listp = Array.new(m).map{Array.new}
vl = Array.new(m,true)
vp =Array.new(n,true)
n.times do |i|
  k,*l = gets.chomp.split(" ").map{|i|i.to_i-1}
  listl[i] = l
  l.each do |j|
    listp[j].push(i)
  end
end
vp[0] = false
qp = [0]
ql = []
while qp.any?
  qp.each do |i|
    listl[i].each do |j|
      if vl[j]
        vl[j] = false
        ql.push(j)
      end
    end
  end
  qp = []
  ql.each do |i|
    listp[i].each do |j|
      if vp[j]
        vp[j] = false
        qp.push(j)
      end
    end
  end
  ql = []
end

puts vp.include?(true) ? "NO" : "YES"

Measured memory_bytes: 19436
N=input()
S=list(map(int,N))
X=sum(S)
f=int(N)/X

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False

print('Yes' if is_integer_num(f) else 'No')


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

int partition(int A[],int p,int r){
  int x=A[r];
  int i=p-1;
  for(int j=p; j<=r-1; j++){
    if(A[j]<=x){
      i++;
      swap(A[i],A[j]);
    }
  }
  swap(A[i+1],A[r]);
  return i+1;
}

int main(){
  int a;
  cin >> a;
  int Z[100000];
  for(int i=0; i<a; i++){
    cin >> Z[i];
  }
  int x=partition(Z,0,a-1);
  for(int i=0; i<a; i++){
    if(i==x){
      cout << '[' << Z[i] << ']';
    }else{
      cout << Z[i];
    }
    if(i<a-1){
      cout << ' ';
    }else{
      cout << endl;
    }
  }
  return 0;
}



Measured memory_bytes: 3448
[*$<][0..-2].map{|s|
    s.chop!
    if s.to_i%1111<1
        puts :NA
        next
    end
    c=0;
    while s!="6174"
        a=s.chars.sort.join
        s=((a.reverse.to_i)-(a.to_i)).to_s
        if s.size<4
            s="0"*(4-s.size)+s
        end
        c+=1
    end
    p c
}


Measured memory_bytes: 7268
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <bitset>

using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) ((int)(x).size())
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) (x).begin(), (x).end()
typedef tuple<int, int, int> t3;
typedef pair<ll, ll> pll;
typedef long double ldouble;
typedef pair<double, double> pdd;

int n, m, A[200020], B[200020];

void solve(){
	scanf("%d%d", &n, &m);
	rep(i, m) {
		int x, y; scanf("%d%d", &x, &y);
		if(x == 1) A[y] = 1;
		if(y == n) B[x] = 1;
	}
	for(int i=2;i<=n;i++) if(A[i] && B[i]) { puts("POSSIBLE"); return; }
	puts("IMPOSSIBLE");
}

int main(){
	int Tc = 1; //scanf("%d\n", &Tc);
	for(int tc=1;tc<=Tc;tc++){
		// printf("Case #%d: ", tc);
		solve();
	}
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()
#ifdef _DEBUG_
  #define debug(...) printf(__VA_ARGS__)
#else
  #define debug(...) (void)0
#endif
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;

vector<PII> red, blue;

const int MAXN = 300;
VI e[MAXN];
int match[MAXN];
bool vis[MAXN];

bool DFS(int x)
{
  vis[x]=1;
  for(int u:e[x])
  {
    if(match[u]==-1 || (!vis[match[u]]&&DFS(match[u])))
    {
      match[u]=x;
      match[x]=u;
      return 1;
    }
  }
  return 0;
}

int main() {
  int N;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    red.PB(MP(x, y));
  }
  for (int i = 0; i < N; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    blue.PB(MP(x, y));
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (red[i].F < blue[j].F && red[i].S < blue[j].S) {
        e[i].PB(N + j);
        e[N + j].PB(i);
      }
    }
  }
  fill(match, match + N + N, -1);
  int ans = 0;
  for (int i = 0; i < N + N; i++)
    if (match[i] == -1) {
      fill(vis, vis + N + N, 0);
      if (DFS(i))
        ans++;
    }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define sz(a) (int)(a.size())
#define pb push_back
#define all(c) c.begin(),c.end()
#define tr(it,a,c) for(auto it=c.begin()+a;it!=c.end();it++)
#define fr(i,a,n)	for(int i=a;i<n;i++)
#define present(c,x) (c.find(x)!=c.end()) //for set/map etc.
#define cpresent(c,x) (find(all(c),x)!=c.end())
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<pair<int,int>> vp;
int N=100001;
int mod=1e9+7;


int min(int a,int b){if(a<b) return a; else return b;}
int max(int a,int b){if(a>b) return a; else return b;}
int power(int a,int b){int res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int gcd(int p, int q){if(p%q==0) return q; else{return gcd(q,p%q);}} 
bool comp(int a, int b) 
{ 
    return (a > b); 
}

bool comp1(pi a, pi b)
{
	if(a.first==b.first)return a.second<b.second;
	else return a.first>b.first;
}

template<typename T> 
istream& operator>>(istream& in, vector<T>& v)
{
	for (T& x : v) in >> x; return in;
}

template<typename T> 
ostream& operator<<(ostream& out, vector<T>& v)
{
	for (T& x : v) out << x<<" "; return out;
}

// template<typename T>
int sum1(vector<int>& v)
{
	int sum=0;
	// for(auto x: v)sum+=x;
	fr(i,0,v.size())sum+=v[i];
	return sum;
}





 void solve()
{
	int n;
	cin>>n;
	if(n>=30)cout<<"Yes";
	else cout<<"No";

}

signed main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	// int t;
	// cin>>t;
	// while(t--)
	// {
	// 	solve();
	// 	cout<<endl;
	// }
	solve();
	return 0;	
}

Measured memory_bytes: 3584
#include<stdio.h>
main(){
  int a,b,c,d,sum,m,s;

  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&c);
  scanf("%d",&d);

  sum=a+b+c+d;

  s=sum%60;

  m=sum/60;

  printf("%d\n%d\n",m,s);

  return 0;

}

Measured memory_bytes: 592
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <complex>
#include <valarray>
#include <fstream>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <random>

#define _overload(a, b, c, d, ...) d
#define _rep1(X, A, Y) for (int (X) = (A);(X) <= (Y);++(X))
#define _rep2(X, Y) for (int (X) = 0;(X) < (Y);++(X))
#define rep(...) _overload(__VA_ARGS__, _rep1, _rep2)(__VA_ARGS__)
#define rrep(X,Y) for (int (X) = Y-1;(X) >= 0;--(X))
#define all(X) (X).begin(),(X).end()
#define len(X) ((int)(X).size())
#define mod(n, m) (((n)%(m)+(m))%m)
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
const int INFINT = 1 << 30;                          // 1.07x10^ 9
const ll INFLL = 1LL << 60;                          // 1.15x10^18
const double EPS = 1e-10;
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

const int MAX_N = 10000;
int N;
ll A[MAX_N], B[MAX_N];

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

  cin >> N;
  rep(i, N) cin >> A[i];
  rep(i, N) cin >> B[i];

  ll AminusB = 0;
  ll BminusA = 0;
  for (int i = 0; i < N; ++i) {
      if (A[i] > B[i]) {
          AminusB += A[i] - B[i];
      } else {
          BminusA += (B[i]-A[i])/2;
      }
  }

  if (AminusB <= BminusA) {
      cout << "Yes" << endl;
  } else {
      cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const int MAX = 510000;

int main() {
  string S;
  cin >> S;
  bool keyence = false;
  for (int i=0; i<S.size(); i++) {
    for (int j=0; j<=S.size()-i; j++) {
      string S_copy = S;
      S_copy.erase(i, j);
      if (S_copy=="keyence") {
        keyence = true;
        break;
      }
    }
    if (keyence) break;
  }
  if (keyence) cout << "YES" << endl;
  else cout << "NO" << endl;
}

Measured memory_bytes: 256
//***********************
//Author:kibi11
//Quarantine Days
//***********************

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100005
#define MOD 1000000007
#define dd double
#define fr(i, n) for(int i = 0; i < n; i++)
#define fr1(i,a,b) for(int i=a;i<b;i++)
#define frr(i,a,k) for(int i=a;i>=k;i--)
#define same int t;cin>>t;while(t--)
#define check(x) cout << (#x) << " is " << (x) << endl
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define f first
#define s second
#define XOX
#define pi 3.14159265358979323846

//////////////////////////////////////////////////////////////////////////
/////////////////DEBUGING ZONE//////////////////////////////

vector<string> vec_splitter(string s) {
	s += ',';
	vector<string> res;
	while(!s.empty()) {
		res.push_back(s.substr(0, s.find(',')));
		s = s.substr(s.find(',') + 1);
	}
	return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
	if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
	stringstream ss; ss << H;
	cerr << args[idx] << " = " << ss.str();
	debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif
///////////////////////////////////////////////////////////////////////////
 
ll powermod(ll base, ll exp, ll mod) {
	ll result = 1;
	while (exp != 0) {
		if ((exp % 2) == 1) {
			result = (result * base) % mod;
		}
		base = (base * base) % mod;
		exp /= 2;
	}
	return result;
}

///////////////////////////////////////////////////////////////////////////
//Fuctions if any:





///////////////////////////////////////////////////////////////////////////
int main() 
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tt = clock();
//ios_base& scientific (ios_base& str);

long double a,b,h,m;
cin>>a>>b>>h>>m;
double beta=((m*6));
// cout<<beta<<endl;
double alpha=(((h*30)+(30*(m*6))/360));
// check(alpha);
// cout<<(alpha-beta)<<endl;
long dd c= sqrt((a*a)+(b*b)-(2*b*a*cos(abs(alpha-beta)*(pi/180))));
cout<<fixed<<setprecision(10);
cout<<c<<endl;

// cout<<beta<<"\n";
cerr << "TIME = " << (double) 1.0 * (clock() - tt) / CLOCKS_PER_SEC << " seconds" << endl;
return 0;
}

Measured memory_bytes: 4292
#include <algorithm>
#include <deque>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;

int main() {
  ll N, K;
  string S;
  cin >> N >> K >> S;
  S[K - 1] = S[K - 1] + 0x20;
  cout << S << endl;
  return 0;
}

Measured memory_bytes: 256
/*
      author : nishi5451
      created: 11.08.2020 21:17:39
*/

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;


int main(){
    int a,b,c;
    cin >> a >> b >> c;
    cout << a*b/2 << endl;
    return 0;
}

Measured memory_bytes: 3524
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <map>
#include <queue>

using namespace std;

int main() {
	int n;
	cin >> n;

	int u, v, w;

	vector<vector<int>> connect(n);
	map<pair<int, int>, int> distances;

	for (int i = 0; i < n - 1; i++) {
		cin >> u >> v >> w;
		u--;
		v--;
		w %= 2;

		connect[u].emplace_back(v);
		connect[v].emplace_back(u);
		distances[make_pair(u, v)] = w;
		distances[make_pair(v, u)] = w;
	}

	vector<int> colors(n, -1);
	queue<int> que;

	que.push(0);
	colors[0] = 0;

	while (!que.empty()) {
		int x = que.front();
		que.pop();

		for (auto y: connect[x]) {
			if (colors[y] != -1) {
				continue;
			}

			colors[y] = distances[make_pair(x, y)] == 0 ? colors[x] : 1 - colors[x];
			que.push(y);
		}
	}

	for (auto x: colors) {
		cout << x << endl;
	}
	return 0;
}


Measured memory_bytes: 18816
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;
const int N_MAX = pow(10, 5);
typedef long long ll;
int main (void) {
    int N;
    ll K;
    vector<pair<int, int> > v;

    cin >> N >> K;
    for (int i = 0; i < N; i++) {
        int a;
        int b;
        cin >> a >> b;
        v.push_back(make_pair(a, b));
    }

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

    ll cnt = 0;
    int ans = 0;
    for (int i = 0; i < N; i++) {
        cnt += v[i].second;
        if (cnt >= K) {
            ans = v[i].first;
            break;
        }
    }

    cout << ans << endl;

    return 0;
}

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

int main()
{
    int a;
    cin >> a;
    cout << a * (1 + a + pow(a, 2)) << endl;
}


Measured memory_bytes: 3784
a, b, c, x, y = map(int, input().split())
# print(a, b, c, x, y)

ans = 10000 * (10 **5) + 7
c_max = 0
if x > y:
  c_max = x * 2
else:
  c_max = y * 2

for cc in range(c_max+1):
  ac = x - (cc // 2)
  bc = y - (cc // 2)
  
  if ac < 0:
    ac = 0
  if bc < 0:
    bc = 0
  price = ac * a + bc * b + cc * c
  # print('price: {}, ac: {}, bc: {}, cc: {}'.format(price, ac, bc, cc))
  ans = min(ans, price)

print(ans)

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

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




Measured memory_bytes: 3640
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pb push_back
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define endl '\n'
#define ll long long
#define f first
#define s second
#define int long long
#define FAST cin.tie(0), cout.tie(0), ios::sync_with_stdio(0)
#define debug(x) cout << "DEBUG " << x << endl
#define debug2(x, y) cout << "DEBUG " << x << " " << y << endl
#define debug3(x, y, z) cout << "DEBUG " << x << " " << y << " " << z<< endl
#define debug4(x, y, z, o) cout << "DEBUG " << x << " " << y << " " << z<< " " << o << endl
using namespace std;
typedef pair<ll, ll> pii;
typedef vector<vector<ll>> mat;
const ll mod = 1e9+7;
const int MAXN = 1e6+5;


int32_t main() {
	int n;
	cin >> n;
	vector<int> f(n+5, 0);
	
	for(int i = 0; i < n-1; i++) {
		int x;
		cin >> x;
		f[x]++;
	}
	for(int i = 1; i <= n; i++)
		cout << f[i] << endl;
}


Measured memory_bytes: 4776
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>



using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)












int main(){
    ll n, a, b;
    cin >> n >> a >> b;
    if((b - a) % 2 == 0){
        cout << (b - a) / 2 << endl;
    }
    else{
        cout << min(a + ((b - a) - 1) / 2, (n - b + 1) + (n - (a + (n - b + 1))) / 2) << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using ld = long double;
const ll ATCODER_AMARI = 1000000007; //10^9 + 7
const ll INF = 10000000000000;

//階乗関数　ATCODER_AMARIに注意
ll factorial(ll k){
  ll sum = 1;
  for(int i = 1 ; i < k + 1; i++) {
    sum *= i;
    //sum = sum % ATCODER_AMARI;
  }
  return sum;
}

int main() {
  ll n,k;
  cin >> n >> k;

  std::vector<ll> p(n);
  std::vector<ll> c(n);

  rep(i,n) {
    ll tmp_p;
    cin >> tmp_p;
    p.at(i) = tmp_p - 1;
  }
  rep(i,n) cin >> c.at(i);

  ll ans_max = -1 * INF;

  rep(i,n) {
    ll tmp_max = -1 * INF;
    ll tmp_count = 0;
    ll current_pos = i;
    ll count_round = 0;
    ll souwa = 0;
    std::vector<ll> renzoku;
    // renzoku.push_back(c.at(i));
    // tmp_max = max(tmp_max,c.at(i));
    
    while(count_round < k) {
      souwa += c.at(current_pos);
      current_pos = p.at(current_pos);

      if(i != current_pos) {
      //  cout << 0 << endl;
         renzoku.push_back(souwa);
         count_round++;

         if(souwa > tmp_max) {
           tmp_max = souwa;
           tmp_count = count_round;
         }
         
      }
      else if( i == current_pos ) {
      //  cout << 1 << endl;
        renzoku.push_back(souwa);
        count_round++;

        if(souwa > tmp_max) {
          tmp_max = souwa;
          tmp_count = count_round;
        }

        if(souwa <= 0) break;
        else {
          ll nankai_mawareru = (k / count_round) - 1;
          ll nankai_amaru = (k % count_round) + count_round;

          souwa = souwa * nankai_mawareru;

          tmp_max = max(tmp_max,souwa);

          //cout << nankai_amaru << endl;

          rep(taiga, nankai_amaru) {
            if(taiga == count_round) {
              souwa += renzoku.at(count_round - 1);
            }
            if(taiga < count_round) {
              ll tmp_nanka = souwa + renzoku.at(taiga);
              tmp_max = max(tmp_max,tmp_nanka);
            }
            else {
              ll taiga2 = taiga - count_round;
              ll tmp_nanka = souwa + renzoku.at(taiga2);
              tmp_max = max(tmp_max,tmp_nanka);
            }
          
          }
          
        }
        break;
      }
    }
    
    ans_max = max(tmp_max,ans_max);
  }

  cout << ans_max << endl;
}



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

int main() {
	
	ll d, g; cin >> d >> g;
	vector<ll> p(d), c(d);	
	for (ll i = 0; i < d; i++) {
		cin >> p[i] >> c[i];
	}
	ll ans = 9223372036854775807LL;
	for (int bit = 0; bit < (1 << d); ++bit) {
		ll tmpAns = 0;
		ll tmpPointSum = 0;
		vector<bool> used(d, false);
		for (ll i = 0; i < d; ++i) {
			if (bit & (1 << i)) {
				used[i] = true;
				tmpAns += p[i];
				tmpPointSum += (i + 1) * 100 * p[i];
				tmpPointSum += c[i];
			}
		}
		if (g <= tmpPointSum) {
			ans = min(ans, tmpAns);
			continue;
		}
		for (ll i = d - 1; i >= 0; i--) {
			if (used[i]) continue;
			ll p_cnt = 0;
			while (p_cnt < p[i]) {					
				if (g <= tmpPointSum) {
					ans = min(ans, tmpAns);
					break;
				}
				tmpPointSum += (i + 1) * 100;
				tmpAns++;
				p_cnt++;
			}
			break;
		}
	}
	cout << ans << endl;
	return 0;
}

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

int main(){
    string S;
    cin >> S;
    if (S[0] - 'A' < 26 && S[0] - 'A' >= 0) cout << "A" << endl;
    else cout << "a" << endl;

}

Measured memory_bytes: 3592
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
   	public long knapsack(int n, int capacity, int[] weights, long[] profits) {
        long[] dp = new long[capacity + 1];
        for (int i = 0; i < n; i++) {
            for (int c = capacity; c >= 0; c--) {
                long skip = dp[c];
                long take = 0;
                if (weights[i] <= c) {
                    take = dp[c - weights[i]] + profits[i];
                }
                dp[c] = Math.max(skip, take);
            }
        }
        return dp[capacity];
    }
    public static void main(String[] args)  {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String[] split = br.readLine().split(" ");
            int n = Integer.parseInt(split[0]);
            int w = Integer.parseInt(split[1]);
          	int[] weights = new int[n];
          	long[] values = new long[n];
            for (int i = 0; i < n; i++) {
                split = br.readLine().split(" ");
                weights[i] = Integer.parseInt(split[0]);
                values[i] = Long.parseLong(split[1]);
            }
          	Main app = new Main();
            long result = app.knapsack(n, w, weights, values);
            System.out.println(result);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


Measured memory_bytes: 21332
import Foreign;x%'1'=2*x+1;x%c=2*x;main=do n<-readLn;s<-getLine;putStr.unlines.map show$length.fst.span(/=0).iterate(rem<*>toInteger.popCount).complementBit(foldl(%)0s)<$>[n-1,n-2..0]

Measured memory_bytes: 13288
#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;
const int itiman = 10000;
const int gosen = 5000;
const int sen = 1000;
int n, y;
int main(void) {
	cin >> n >> y;
	for (int i = 0; i <= n; ++i) {
		for (int j = 0; j <= n; ++j) {
			if (i + j > n) break;
			if (i * itiman + j * gosen + (n - i - j) * sen == y) {
				printf("%d %d %d\n", i, j, (n - i - j));
				return 0;
			}
		}
	}
	printf("%d %d %d\n", -1, -1, -1);
	return 0;
}

Measured memory_bytes: 384
#include <cstdio>
#include <algorithm>
int N, M, g[15][15], f[32768][15];
int main()
{
	scanf("%d%d", &N, &M);
	for (int i = 0, u, v, w; i < M; i++)
	{
		scanf("%d%d%d", &u, &v, &w);
		u--, v--;
		g[u][v] = g[v][u] = w;
	}
	for (int i = 0; i < 1 << N; i++)
		for (int j = 0; j < N; j++)
			f[i][j] = 2000000000;
	for (int i = 1; i < 1 << N; i += 2)
		f[i][0] = 0;
	for (int i = 1; i < 1 << N; i++)
		for (int j = 0; j < N; j++)
			if (f[i][j] < 2000000000)
			{
				static int s[15];
				for (int k = 0; k < N; k++)
				{
					s[k] = 0;
					for (int l = 0; l < N; l++)
						if (i >> l & 1)
							s[k] += g[k][l];
				}
				for (int k = i; k < 1 << N; k = k + 1 | i)
				{
					int S = 0;
					for (int l = 0; l < N; l++)
						if (k - i >> l & 1)
							S += s[l];
					for (int l = 0; l < N; l++)
						if (k - i >> l & 1 && g[j][l])
							f[k][l] = std::min(f[k][l], f[i][j] + S - g[j][l]);
				}
			}
	printf("%d\n", f[(1 << N) - 1][N - 1]);
	return 0;
}


Measured memory_bytes: 2048
#include <stdio.h>
int main(){
  int i, j, minj, temp, N, c=0;
  int A[100]={};

  scanf("%d",&N);

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

  for(i=0; i<N; i++){
    minj = i;
    for(j=i; j<N; j++){
      if(A[j]<A[minj]){
	minj=j;
      }
    }
    if(A[i]>A[minj]){
    temp = A[minj];       
    A[minj] = A[i];
    A[i]= temp;
    c++;
    }
  }

  for(i=0; i<N-1; i++){
    printf("%d ",A[i]);
      }
  printf("%d",A[N-1]);
  printf("\n%d\n",c);

  return 0;
}

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

using namespace std;

int main() {
  int a, b, x;
  cin >> a >> b >> x;
  if (a <= x && x <= a + b) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
 
using namespace std;
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
 
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.precision(10);
    cout << fixed;
  
	set<int> s;
	int q;
	cin >> q;
	while(q--){
		int op, el;
		cin >> op >> el;
		if(op)cout << s.count(el) << '\n';
		else s.insert(el), cout << s.size() << '\n';
	}
    return 0;
}



Measured memory_bytes: 12488