akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define endl '\n'
#define fi first
#define se second
#define pb push_back
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
const int MOD = 1e9 + 7;
const int maxn = 1e6 + 5;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-8;
const double PI = acos(-1.0);

void header() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

ll h[maxn];

vector<int> G[maxn];
void solve() {
    int n, m, a, b;
    cin >> n >> m;
    for (int i = 1; i <= n; i++) cin >> h[i];
    while (m--) {
        cin >> a >> b;
        G[a].pb(b);
        G[b].pb(a);
    }
    ll res = 0;
    for (int i = 1; i <= n; i++) {
        int f = 1;
        for (auto x : G[i]) {
            if (h[i] <= h[x]) {
                f = 0;
                break;
            } 
        }
        if (f) res++;
    }
    cout << res << endl;
}

int main() {
	header();
	solve();
	return 0;
}


Measured memory_bytes: 30652
#include<bits/stdc++.h>
#define inf 0x7fffffff
#define RG register
#define maxn 100005
#define maxm 205
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
inline ll read(){
    ll x = 0, f = 1;
    char ch = getchar();
    while(ch > '9' || ch < '0') {if(ch == '-') f = -1;ch = getchar();}
    while(ch >= '0' && ch <= '9'){x = x *10 + ch -'0';ch = getchar();}
    return x * f;
}

int n, m, a[maxn], x;
ll sum, st;
int main(){
	int i, j, k;
	n = read(), x = read(); 
	for(i = 1;i <= n;i++) a[i] = read();
	if(a[1] > x) sum += a[1] - x, a[1] = x;
	for(i = 1;i < n;i++)
		if(a[i] + a[i + 1] > x) sum += a[i] + a[i + 1] - x, a[i + 1] = x - a[i];
	printf("%lld\n", sum);
	return 0;
}


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

int h, w;
vector<string> grid;
vector<vector<int>> DP;
const int inf = 1000000007;

int main()
{
	cin >> h >> w;
	grid.resize(h);
	DP.resize(h);
	for (int i = 0; i < h; i++)
	{
		cin >> grid[i];
		DP[i].resize(w, 0);
	}
	DP[0][0] = 1;
	for (int i = 0; i < h; i++)
	{
		for (int j = 0; j < w; j++)
		{
			if (grid[i][j] == '#')
				continue;
			if (i > 0)
			{
				DP[i][j] += DP[i - 1][j];
				DP[i][j] %= inf;
			}
			if (j > 0)
			{
				DP[i][j] += DP[i][j - 1];
				DP[i][j] %= inf;
			}
		}
	}
	cout << DP[h-1][w-1] << endl;
}


Measured memory_bytes: 9400
#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(){
  string s,t;
  cin >> s;
  cin >> t;
  if(t.substr(0, t.size()-1)==s)cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 3628
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		new Main().run();
	}

	private void run() throws IOException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			n = scanner.nextInt();
			if (n == 0)
				break;
			map = new int[n][n];
			v = new boolean[n][n];
			m = 0;
			p = new int[2][n * n];
			int sum = 0;
			for (int i = 0; i < n; i++)
				for (int j = 0; j < n; j++) {
					map[i][j] = scanner.nextInt();
					sum += map[i][j];
					if (map[i][j] < 0) {
						p[0][m] = i;
						p[1][m++] = j;
						v[i][j] = true;
					}

				}
			if (sum != 0) {
				System.out.println("NO");
				continue;
			}
			System.out
					.println(slove(p[0][0], p[1][0], 0, map[p[0][0]][p[1][0]]) ? "YES"
							: "NO");

		}
	}

	private boolean slove(int y, int x, int k, int sum) {
		if (sum > 0)
			return false;
		if (sum == 0) {
			if (++k == m)
				return true;
			int ny = p[0][k];
			int nx = p[1][k];
			return slove(ny, nx, k, map[ny][nx]);
		}
		for (int[] mo : move) {
			int ny = y + mo[0];
			int nx = x + mo[1];
			if (!isOK(ny, nx))
				continue;
			if (v[ny][nx])
				continue;
			v[ny][nx] = true;
			if (slove(ny, nx, k, sum + map[ny][nx]))
				return true;
			v[ny][nx] = false;
		}

		return false;
	}

	private boolean isOK(int ny, int nx) {
		return 0 <= ny && ny < n && 0 <= nx && nx < n;
	}

	int n, m;
	int[][] map;
	int[][] p;
	boolean[][] v;
	int[][] move = { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 } };
}

Measured memory_bytes: 27396
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define EPS      (double)1e-9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
typedef pair<int,int> pii;
template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cout<<' ';cout<<elem;}cout<<endl;}

int main(){
	int n;
	cin>>n;
	
	vi ans(n+1,0);
	REP(i,n-1){
		int a;
		cin>>a;
		ans[a]++;
	}
	
	for(int i=1;i<=n;++i) cout<<ans[i]<<endl;
}

Measured memory_bytes: 4052
#include <bits/stdc++.h>
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
using namespace std;

int main(){
  int N;
  cin >> N;
  int A[N];
  
  for(int i=0; i<N;i++){
    cin >> A[i];
  }
  sort(A, A + SIZE_OF_ARRAY(A));
  int n=A[0];
  int label=0;
  for(int i=1; i<N; i++){
    if(A[i]==n){
      label=1;
      break;
    }
    n=A[i];
  }
  if(label==0){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 1024
N, K = [int(n) for n in input().split()]

a = N - K + 2 + (N + 1)*(N-K+2)*(K+N+1) // 2 - ((N + 1) * (N + 2) * (2 * N + 3) - K * (K - 1) * (2 * K - 1)) // 6

print(a % 1000000007)


Measured memory_bytes: 9176
N = int(input())
As = [int(input()) for _ in range(N)]
from bisect import bisect_right
from collections import deque

def LIS(L):
    dp = deque([L[0]])
    length = len(L)
    for i in range(1, length):
        a = L[i]
        if a >= dp[-1]:
            dp.append(a)
        else:
            dp[bisect_right(dp, a)] = a
    return dp

print(len(LIS(As[::-1])))

Measured memory_bytes: 8860
#include<iostream>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(a<b)swap(a,b);
	if(b<c)swap(b,c);
	if(a<b)swap(a,b);
	cout<<c<<" "<<a<<endl;
	return 0;
}


Measured memory_bytes: 3104
package main

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

var s = bufio.NewScanner(os.Stdin)

func next() int {
	s.Scan()
	i, _ := strconv.Atoi(s.Text())
	return i
}

func main() {
	s.Split(bufio.ScanWords)
	N := next()
	T := next()
	min := 10000
	for i := 0; i < N; i++ {
		c := next()
		t := next()
		if t <= T && c < min {
			min = c
		}
	}
	if min < 10000 {
		fmt.Println(min)
	} else {
		fmt.Println("TLE")
	}

}


Measured memory_bytes: 640
#include <algorithm>
#include <queue>
#include <iostream>
#include <string>
#include <set>
#include <map>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll,ll> p;

int main(){
    ll N,K;cin>>N>>K;
    vector<ll> max_d(N,0);//種類iごとのおいしさdの最大
    vector<p> sushi;
    REP(i,N){
        ll t,d;cin>>t>>d;//dは美味しさ,tはネタ
        t--;//0 origin
        sushi.push_back(p(d,t));
        max_d[t] = max(max_d[t],d);
    }
    sort(sushi.begin(),sushi.end(),greater<p>());
    priority_queue <p,vector<p>,greater<p>> prq_s;//昇順にする popするときに最小のものとなる
    vector<ll> type_cnt(N,0);//type iの数
    ll types = 0;
    ll sum = 0;

    //初期集合の作成
    REP(i,K){
        if(type_cnt[sushi[i].second]==0){
            //こいつらはpopされない
            //二個目ほんとに必要？
            types++;
            type_cnt[sushi[i].second]++;
        }else{
            prq_s.push(sushi[i]);
        }
        sum += sushi[i].first;
    }
    ll ans = types * types + sum;

    //dの最大値が大きい順に種類を追加していく
    vector<p> waiting;
    REP(i,N){
        if(max_d[i]!=0){
            waiting.push_back(p(max_d[i],i));
        }
    }
    sort(waiting.begin(),waiting.end(),greater<p>());

    for(p tmp : waiting){
       if (type_cnt[tmp.second]) continue;
       if (prq_s.empty()) break; 
       sum -= prq_s.top().first;
       sum += tmp.first;
       types++;
       prq_s.pop();
       ans = max(ans,types*types+sum);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 6384
#include <bits/stdc++.h>
 
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL << 62)

#define PI (acos(-1))
#define print(x) cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
typedef pair <ll,ll> P;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second > b.second;
    }
}

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    for (int i = 0; i < (int)v.size(); ++i) { 
        os << v[i]; 
        if (i != (int)v.size() - 1) 
            os << " "; 
    } 
    return os; 
} 

int main()
{
    ll H, W, D;
    cin >> H >> W >> D;
    vector<P> p(H*W);
    vector<ll> c(H*W,0);
    rep(i, H) {
        rep(j, W) {
            ll A;
            cin >> A;
            A--;
            p[A] = P(i,j);
        }
    }
    for (ll i = D; i < H*W; ++i) {
        c[i] = c[i-D] + abs(p[i-D].first - p[i].first) + abs(p[i-D].second - p[i].second); 
    }
    ll Q;
    cin >> Q;
    rep(i, Q) {
        ll L, R;
        cin >> L >> R;
        L--;R--;
        print(c[R] - c[L]);
    }
    return 0;
}

Measured memory_bytes: 3200
import itertools

n, m, q = map(int, input().split())

data = []
for i in range(q):
    data.append(list(map(int, input().split())))

# Aは,1からmまでの整数からn個選ぶ重複組み合わせ
a_list = list(itertools.combinations_with_replacement(range(1,m+1), n))

tokuten_list = []
for a in a_list:
    tokuten = 0
    for q_kumi in data:
        if a[q_kumi[1]-1]-a[q_kumi[0]-1] == q_kumi[2]:
            tokuten += q_kumi[3]
    tokuten_list.append(tokuten)

print(max(tokuten_list))


Measured memory_bytes: 25048
#include<bits/stdc++.h>
    #define pi acos(-1)
    #define ll long long
    #define pii pair<ll,ll>
    #define debug(a) cout<<a<<'\n'
    #define maxn 3009 /// leave to tomorrow anything that can be done today
    #define MOD 998244353
    #define F first
    #define S second
    #define rep(i, a, b) for(ll i = a; i < (b); ++i)
    #define per(i, b, a) for(ll i = b-1; i>=a ; i--)
    #define trav(a, x) for(auto& a : x)
    #define allin(a , x) for(auto a : x)
    #define all(x) begin(x), end(x)
    #define sz(x) (ll)(x).size()
    using namespace std;
    const ll INF = 1e17 + 9;
    ll dp[maxn][maxn]; ///soma i tamanho j
    ll mult(ll a,ll b){
        return a*b%MOD;
    }
    ll fastpow(ll a, ll b){
        ll calc=1;
        for(;b>=1LL;b/=2LL){
            if((b&1LL))calc=mult(calc,a);
            a=mult(a,a);
        }
        return calc;
    }
    ll soma(ll a,ll b){
        if(a+b>MOD)return a+b-MOD;
        else return a+b;
    }
    ll subt(ll a,ll b){
        if(a-b<0)return a-b+MOD;
        else return a-b;
    }
    int main(){
        ios::sync_with_stdio(false);
        cin.tie(0);
        ll n,s;
        cin>>n>>s;
        ll vet[maxn];
        rep(i,1,n+1){
            cin>>vet[i];
        }
        rep(i,0,n){
            dp[i][0]=fastpow(2,n);
        }
        // dp[0][0] = fastpow(2,n);
        rep(j,1,n+1){/// caras
            rep(i,1,s+1){//soma 
                if(vet[j]<=i)dp[j][i] = soma(mult(dp[j-1][i-vet[j]],(fastpow(2,MOD-2))),dp[j-1][i]);
                else dp[j][i] = dp[j-1][i];
            }
        }
        // cout<<dp[1][4]<<endl;
        cout<<dp[n][s]<<'\n';
        return 0;   
    }   

Measured memory_bytes: 74112
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7;


int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;
    cin >> n;
    while(n--){
        int x;
        cin >> x;
        if(x % 2 == 0){
            if(x % 3 == 0) continue;
            if(x % 5 == 0) continue;
            return cout << "DENIED", 0;
         }
    }
    cout << "APPROVED";
    

    return 0;
}


Measured memory_bytes: 3644
#include <iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include<queue>
#include<map>
using namespace std;
int B[100010];
int main() {
	int N;
	cin >> N;
	vector<long int> vec(N);
	for (int i = 0; i < N; i++) {
		cin >> vec.at(i);
	}
	long long int Y=1 ;
	int Z = 0;
	sort(vec.begin(), vec.end(), greater<int>());
	for (int i = 0; i < N-1; i++) {
		if (vec[i] == vec[i + 1]) {
			Y *= vec[i];
			Z++;
			i++;
		}
		if (Z == 2)break;
	}

	

	
	if(Z==2)cout << Y << endl;
	else cout << 0 << endl;
	return 0;
}


Measured memory_bytes: 1024
/*
    Reference :-
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define forn1(i, n) for (int i = 1; i < int(n); i++)
#define PI pair<int,int>
#define all(vec) vec.begin(),vec.end()
ll mod=1e9+7;
ll fac[100001];
ll power(ll n,ll k){
    ll ans=1;
    while(k){
        if(k&1)ans=(ans*n)%mod;
        k/=2;
        n=(n*n)%mod;
    }
    //ans=(ans-1+mod)%mod;
    return ans;
}
bool comp(PI a,PI b){
    return b.F<a.F;
}

int main(){
    //std::ios::sync_with_stdio(false);
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n,k,s;
    cin>>n>>k>>s;
    forn(i,k)cout<<s<<" ";
    for(int i=k;i<n;i++){if(s==1000000000)cout<<s-1<<" ";else cout<<s+1<<" ";}

	return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<int,int> pa;

#define fst first
#define snd second
#define pb push_back

const int maxn=500005,maxm=55;
const double pi=acos(-1.0);
const ll mod=1000000007;
const double eps=1e-6;


char c[10];

int main()
{
	int i,j,k;
	scanf("%s",c);
	if(c[2]==c[3]&&c[4]==c[5]) printf("Yes\n");
	else printf("No\n");
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int pos[][3]={
	{1,2,3},{1,3,5},{1,4,2},{1,5,4},
	{2,1,4},{2,3,1},{2,4,6},{2,6,3},
	{3,1,2},{3,2,6},{3,5,1},{3,6,5},
	{4,1,5},{4,2,1},{4,5,6},{4,6,2},
	{5,1,3},{5,3,6},{5,4,1},{5,6,4},
	{6,2,4},{6,3,2},{6,4,5},{6,5,3},
};

int d1[7],d2[7];
int main(){
	for(int i=1;i<=6;i++)scanf("%d",d1+i);
	for(int i=1;i<=6;i++)scanf("%d",d2+i);
	for(int i=0;i<24;i++){
		int flag=1;
		for(int j=0;j<3;j++)flag&=d1[j+1]==d2[pos[i][j]];
		for(int j=3;j<6;j++)flag&=d1[j+1]==d2[7-pos[i][5-j]];
		if(flag){
			puts("Yes");
			return 0;
		}
	}
	puts("No");
}


Measured memory_bytes: 2112
#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int a,b;
    cin >> a >> b;
    int c;
    c = (a*b)%2;
    // 出力
    if(c==0){
        cout << "Even" << endl;}
    else{
        cout << "Odd" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N, A, B;
    cin >> N >> A >> B;
    cout << min(A * N, B) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <array>
#include <algorithm>
#include <map>
#include <iostream>
#include <vector>]
#include <cmath>
using namespace std;

int main()
{
	int n;
	cin >> n;
	char w[50] = {};
	cin >> w;

	int count = 0;
	for (int i = 0; i < n - 2; i++)
	{
		if (w[i] == 'A' && w[i + 1] == 'B' && w[i + 2] == 'C')
		{
			count++;
		}
	}
	cout << count;
}

const int mod = 1000000007;
struct mint {
	long long x; // typedef long long ll;
	mint(long long x = 0) :x((x% mod + mod) % mod) {}
	mint operator-() const { return mint(-x); }
	mint& operator+=(const mint a) {
		if ((x += a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator-=(const mint a) {
		if ((x += mod - a.x) >= mod) x -= mod;
		return *this;
	}
	mint& operator*=(const mint a) {
		(x *= a.x) %= mod;
		return *this;
	}
	mint operator+(const mint a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint a) const {
		mint res(*this);
		return res *= a;
	}
	mint pow(long long t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime mod
	mint inv() const {
		return pow(mod - 2);
	}
	mint& operator/=(const mint a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint a) const {
		mint res(*this);
		return res /= a;
	}
};

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

using namespace std;

int p[10000];

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

    int n, k, sum = 0;
    cin >> n >> k;
    for (int i = 0; i < n; ++i) {
        cin >> p[i];
    }
    sort(p, p + n);
    for (int i = 0; i < k; ++i) {
        sum += p[i];
    }
    cout << sum << endl;

}

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

def main():
    N,S=map(int, input().split())
    A = list(map(int,input().split()))
    mod = 998244353
    dp = [[0]*(S+1) for i in range(N+1)]
    dp[0][0]=1
    for i in range(N):
        vi = A[i]
        for j in range(S+1):
            dp[i+1][j] += 2 * dp[i][j]
            dp[i+1][j] %= mod
            if j+vi<=S:
                dp[i+1][j+vi] += dp[i][j]
                dp[i+1][j+vi] %= mod

    print(dp[N][S])

if __name__ == '__main__':
    main()


Measured memory_bytes: 132412
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>

#define REP(i,x,y) for(int i=(x);i<(y);i++)
#define RREP(i,x,y) for(int i=(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
// #define int long long

using namespace std;

// conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#else
#define eprintf(...) 42
#define dump(x) 42
#define debug(x) 42
#endif

typedef long long ll;

map<ll, int> memo; // number of snacks, number of people
const int MAX_N = 100;
int N;
ll x;
ll A[MAX_N];

int solve() {
    int answer = 0;
    int j = 0;
    sort(A, A+N);
    REP(i,0,N) {
        if (x < A[i]) break;
        x -= A[i];
        answer++;
        j = i;
    }
  if (j == N - 1) {
    return x == 0 ? answer : answer - 1;
  } else {
    return answer;
  }
}

signed main() {
    // to shorten execution time for iostream
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> N >> x;
    REP(i,0,N) cin >> A[i];
    cout << solve() << "\n";
    return 0;
}



Measured memory_bytes: 256
#%%
from collections import defaultdict

n = int(input())

d = defaultdict(list)
for i in range(n):
    k, v = input().split()
    v = int(v)
    d[k].append([v, i+1])

#%%
ks = sorted(d.keys())
for k in ks:
    vs = d[k]
    score_d = {}
    for v in vs:
        score_d[v[0]] = v[1]

    score_keys = sorted(score_d.keys(), reverse=True)
    for sk in score_keys:
        print(score_d[sk])



Measured memory_bytes: 38512
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>0;--i)
#define yesno(flg) if(flg){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
#define Vi vector<int>
#define Vl vector<long long>
#define pb(a) push_back(a)
using namespace std;

typedef long long ll;
const int inf=1000000000;
const int np=1000000007;
struct edge{
	int myc,to,c,cost;
};
struct pos{
	int to,cost,color;
};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
Vi p(200001);

int FindP(int a){
	if(p[a]!=a){
		p[a]=FindP(p[a]);
		return p[a];
	}
	return a;
}
bool Unite(int a,int b){
	int pa=FindP(a);
	int pb=FindP(b);

	if(pa==pb){
		return true;
	}else if(pa>100000&&pb>100000){
		return false;
	}else{
		if(pa>pb){
			p[pb]=p[pa];
		}else{
			p[pa]=p[pb];
		}
		return true;
	}
}

int main() {
	int n,m,k;
	cin>>n>>m>>k;
	rep(i,200001)p[i]=i;
	rep(i,k){
		int a1,a2,a3;
		cin>>a1>>a2>>a3;
		if(a1==1){
			if(!Unite(a2,a3)){
				cout<<i+1<<endl;
				return 0;
			}
		}else{
			if(!Unite(a2,a3+100000)){
				cout<<i+1<<endl;
				return 0;
			}
		}
	}
	cout<<"0"<<endl;
	return 0;
}



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

int main() {
  int val;
  int n, k;
  int i;
  cin >> n >> k;
  
  val = 1;
  for (i = 0; i < n; i++) {
    if (val < k) {
      val *= 2;
    } else {
      val += k;
    }
  }
  cout << val << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <unordered_map>
#include <unordered_set>

int main() {
    std::size_t N;
    std::cin >> N;
    
    std::size_t cnt = 0;
    std::unordered_map<std::string, std::size_t> wordCountMap;
    for (std::size_t i = 0; i < N; ++i) {
        std::string str;
        std::cin >> str;

        std::sort(str.begin(), str.end());

        if (wordCountMap.count(str) == 0) {
            wordCountMap.insert({str, 1});
        } else {
            cnt += wordCountMap[str];
            wordCountMap[str] = wordCountMap[str] + 1;
        } 
    }

    std::cout << cnt << std::endl;
    
    return 0;
}


Measured memory_bytes: 10660
tate,yoko = map(int,input().split())
tate_hiku,yoko_hiku = map(int,input().split())
zenbu = tate*yoko
tate_hiku_zenbu = tate_hiku*yoko
yoko_hiku_zenbu = yoko_hiku*tate
kasanari = tate_hiku*yoko_hiku
print(zenbu-tate_hiku_zenbu-yoko_hiku_zenbu+kasanari)

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

int main(){
    ll d, g; cin >> d >> g;
    vector<ll> p(d), c(d);

    rep(i, d){
        cin >> p[i] >> c[i];
    }
    ll ANS = 1e+9+7, cnt = 0;
    for(int bits = 0; bits < (1<<d); bits++){
        ll tmp = 0, cnt = 0;
        ll ans = 1e+9+7;
        rep(i, d){
            if (bits & (1<<i)) {
                tmp += (i+1) * p[i] * 100 + c[i];
                cnt += p[i];
            }
        }
        if (tmp >= g){
            ans = min(ans, cnt);
        }
        else{
            int mxid = 0;
            rep(j, d){
                if (!(bits & (1<<j))){
                    mxid = j;
                }
            }
            ll res = g - tmp;
            ll add = (res + (mxid+1)*100 - 1) / ((mxid+1)*100);
            if (add < p[mxid]){
                cnt += add;
                ans = min(ans, cnt);
            }
        }
        ANS = min(ans, ANS);
    }
    cout << ANS << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#ifdef LOCAL
#include <pprint.hpp>
#endif
#define endl "\n";
#define pb push_back
#define md 1000000007
#define ll long long int
#define all(v) v.begin(),v.end()
ll power(ll a,ll b){ll z=1;while(b){if(b&1){z*=a;z%=md;}a*=a;a%=md;b/=2;}return z%md;}
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

ll n,m,u,v;
vector<ll> used;
vector<vector<ll>> adj;

ll dfs(ll s){
	// cout<<s<<endl;
	if(used[s])
		return used[s];
	ll val=0;
	for(auto x:adj[s])
	{
		val = max(val,(ll)dfs(x));
	}
	used[s] = 1+val;
	return used[s];
}

int main(){
	//You need to change array size!
	#ifndef LOCAL
	ios_base::sync_with_stdio(false);	cin.tie(NULL);
	#endif 
	
	cin>>n>>m;
	adj.resize(n+1);
	used.assign(n+1,0);
	for(int i=0;i<m;++i){
		cin>>u>>v;
		adj[u].pb(v);
		// adj[v].pb(u);
	}

	for(int i=1;i<=n;++i)
		dfs(i);
	// cout<<used<<endl;
	cout<<*max_element(all(used))-1;
	
	return 0;	
}

Measured memory_bytes: 11568
#include<bits/stdc++.h>
#define MOD 1000000007
#define md 998244353
#define INF LLONG_MAX
#define F first
#define S second
#define sz(x) (long long)x.size()
#define vi vector<int>
#define vll vector<long long>
#define vpl vector<pair<long long,long long> >
#define vpi vector<pair<int,int> >
#define pb push_back
#define debug(x) cerr<<#x<<"= "<<x<<endl
#define all(v) v.begin(),v.end()
#define TT ll test;cin>>test; while(test--)
#define rep(i,a,n) for(ll i=a;i<(long long)n;++i)
#define repr(i,n,a) for(ll i=n;i>(long long)a;--i)
#define endl '\n'
#define MAXN 200005
typedef long long ll;
typedef long double ld;
using namespace std;
bool palin(string s){
    string s1=s;
    reverse(all(s1));
    return s1==s;
}
int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    string s;
    cin>>s;
    string s1="",s2="";
    ll n=sz(s);
    rep(i,0,(n-1)/2){
        s1+=s[i];
    }
    rep(i,(n+3)/2-1,n){
        s2+=s[i];
    }
    if(palin(s)&&palin(s1)&&palin(s2)){
        cout<<"Yes";
    }else{
        cout<<"No";
    }


    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        if(a+b>=c){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 21844
// ABC 144-A
// 2019.10.27 bal4u

#include <stdio.h>

int main()
{
	int A, B;
	
	scanf("%d%d", &A, &B);
	if (A >= 1 && A <= 9 && B >= 1 && B <= 9) printf("%d\n", A*B);
	else puts("-1");
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <deque>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <functional>
#include <climits>
#include <numeric>
#include <bitset>
#include <random>
#include <tuple>
#include <initializer_list>
#include <fstream>
#include <cctype>
#include <string>
#include <cfloat>
#include <array>

int main() {
	int x, y, z; std::cin >> x >> y >> z;
	std::swap(x, y);
	std::swap(x, z);
	std::cout << x << ' ' << y << ' ' << z << std::endl;
}


Measured memory_bytes: 888
#include<cstdio>
#include<algorithm>
using namespace std;
const int ans[]={0,1,1,1,2,1,2,1,5,2,2,1,5,1,2,1,14,1,5,1,5,2,2,1,15,2,2,5,4,1,4,1,51};
int main()
{
    int k;
    scanf("%d",&k);
    printf("%d\n",ans[k]);
    return 0;
}


Measured memory_bytes: 128
object Main extends App {
  val in = new java.util.Scanner(System.in)
  val N, M = in.nextInt
  val accepted = Array.fill(N)(0)
  val (ac, pe) = (1 to M).foldLeft((0, 0)){case ((ac, pe), i) =>
    val p = in.nextInt - 1
    val s = in.next

    (accepted(p), s) match {
      case (-1, _) => (ac, pe)
      case (n, "AC") =>
        accepted(p) = -1
        (ac + 1, pe + n)
      case (_, _) =>
        accepted(p) += 1
        (ac, pe)
    }
  }

  println(s"$ac $pe")
}

Measured memory_bytes: 67620
#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e9;
int main() {
  int n;
  cin >> n;
  bool ok = false;
  while(n){
    if(n%10 == 7)ok = true;
    n/=10;
  }
  puts(ok ? "Yes": "No");
  return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

using pi = pair<int,int>;

struct Polygon{
    int id;
    int V;
    vector<pi> v;
};

map<string,int> name2id;
int C;
Polygon read_p(){
    Polygon ret;

    string name;
    cin >>name;

    if(!name2id.count(name)) name2id[name] = C++;
    ret.id = name2id[name];

    int x,y;
    while(1){
        cin >>x;
        if(x==-1) break;

        cin >>y;
        ret.v.pb({x,y});
    }
    ret.V = ret.v.size();
    return ret;
}

bool share_edge(pi p1, pi p2, pi q1, pi q2){
    if(p1>p2) swap(p1,p2);
    if(q1>q2) swap(q1,q2);

    int px = p2.fi-p1.fi, py = p2.se-p1.se;
    int pg = __gcd(abs(px), abs(py));
    px /= pg;
    py /= pg;

    int qx = q2.fi-q1.fi, qy = q2.se-q1.se;
    int qg = __gcd(abs(qx), abs(qy));
    qx /= qg;
    qy /= qg;

    if(px!=qx || py!=qy) return false;

    if(px == 0){
        if(p1.fi != q1.fi) return false;
        return (p1<=q1 && q1<p2) || (q1<=p1 && p1<q2) ;
    }
    else{
        pi tp(p1);
        int D = p1.fi/px;
        tp.fi -= px*D;
        tp.se -= py*D;

        pi tq(q1);
        D = q1.fi/qx;
        tq.fi -= qx*D;
        tq.se -= qy*D;
        if(tp != tq) return false;

        // cout << p1 << " " << p2 << " " <<q1 <<" " <<q2<<endl;
        return (p1<=q1 && q1<p2) || (q1<=p1 && p1<q2) ;
    }
}

bool check(const Polygon &p, const Polygon &q){
    rep(i,p.V)rep(j,q.V){
        if(share_edge(p.v[i], p.v[(i+1)%p.V], q.v[j], q.v[(j+1)%q.V])) return true;
    }
    return false;
}

vector<vector<bool>> adj;
int ans;
int col[10];
void dfs(int d, int new_color){
    if(d==C){
        ans = min(ans,new_color);
        return;
    }

    rep(i,new_color){
        col[d] = i;

        bool ok = true;
        rep(j,d){
            if(adj[d][j] && col[j]==col[d]) ok = false;
        }
        if(ok) dfs(d+1,new_color);

        col[d] = -1;
    }

    col[d] = new_color;
    dfs(d+1,new_color+1);
    col[d] = -1;
}

int main(){
    int n;
    while(cin >>n,n){
        name2id.clear();
        C = 0;

        vector<Polygon> p(n);
        rep(i,n) p[i] = read_p();

        adj = vector<vector<bool>>(C,vector<bool>(C));
        rep(i,n)rep(j,i){
            if(check(p[i],p[j])){
                adj[p[i].id][p[j].id] = true;
                adj[p[j].id][p[i].id] = true;
            }
        }

        ans = C;
        rep(i,C) col[i] = -1;
        dfs(0,0);
        cout << ans << endl;
    }
    return 0;
}



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

#define int long long
#define rep(i, n) for (int i = 0; i < (int) (n); i++)
#define reps(i, n) for (int i = 1; i <= (int) (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), (x).end())
#define bit(n) (1LL << (n))
#define cdiv(a, b) (((a) - 1) / (b) + 1)
#define dump(x) cerr << #x " = " << (x) << endl
using vint = vector<int>;
using vvint = vector<vint>;
using pint = pair<int, int>;
using vpint = vector<pint>;
template<typename T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
constexpr double PI = 3.1415926535897932384626433832795028;
constexpr int DY[9] = {0, 1, 0, -1, 1, 1, -1, -1, 0};
constexpr int DX[9] = {1, 0, -1, 0, 1, -1, -1, 1, 0};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int sgn(int x) { return (x > 0) - (x < 0); }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T, typename U> bool chmax(T &a, const U &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> bool chmin(T &a, const U &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

int N;
int A[110];
signed main() {
    cin>>N;
    rep(i,N)cin>>A[i];
    int m=1000,k=0;
    rep(i,N){
        if(A[i]>A[i+1]){
            m+=k*A[i];
            k=0;
        }else if(A[i]<A[i+1]){
            k+=m/A[i];
            m%=A[i];
        }
    }
    cout<<m<<endl;
}

Measured memory_bytes: 3628
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int a,b,c,x;
    cin>>a>>b>>c;
    x=(a*100)+(b*10)+c;
    if(x%4==0)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;

}

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

int main() {
  ll N, K;
  cin >> N >> K;
  vector<ll> d(N);
  for (ll i = 0; i < N; i++) {
    ll e;
    cin >> e;
    if (i > 0) d[i] = d[i-1]+e;
    else d[i] = e;
  }
  
  set<ll> s;
  s.insert(d[K-1]);
  for (ll i = 0; i < N-K; i++) {
    s.insert(d[i+K]-d[i]);
  }
  
  ll pos = *rbegin(s);
  cout << (pos+K)/2;
  if ((pos+K)%2 != 0) cout << ".5";
  cout << endl;
}

Measured memory_bytes: 5888
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

#define int long long

const int MOD = 1e9 + 7;

int add(int a, int b) {
	return (a + b) % MOD;
}

int mul(int a, int b) {
	return (a * b) % MOD;
}

int gcd(int a,int b){
    if(b==0){
        return a;
    }else{
        return gcd(b, a%b);
    }
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

    int K;
    cin >> K;

    int acc = 0;

    for(int i=1; i<=K; i++){
        for(int j=1; j<=K; j++){
            int gcd1 = gcd(i, j);
            for(int k=1; k<=K; k++){
                acc += gcd(gcd1, k);
            }
        }
    }

    cout << acc << endl;

    return 0;
}


Measured memory_bytes: 3648
N = gets.to_i
A = gets.split.map(&:to_i)
h = {}
A.each do |a|
  if h.key?(a)
    h[a] += 1
  else
    h[a] = 1
  end
end
g = {}
c = {}
total = 0
h.each do |key, v|
  _h = {self: 0, other: 0}
  if v >= 2
    _h[:other] = (v * (v - 1)) / 2
    _h[:self] = ((v-1) * (v - 2)) / 2
  end
  total += _h[:other]
  c[key] = _h
end
c.each do |key, _h|
  g[key] = total - _h[:other] + _h[:self]
end
A.each{|a|puts g[a]}

Measured memory_bytes: 86216
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef long long ll;
const ll INF = 1LL << 60;


int N;
int main(){
    cin >> N;
    vector<ll> a(N);
    REP(i,N){
        ll t;
        cin >> t;
        a[i] = t - i - 1;
    }
    sort(a.begin(),a.end());
    ll b;
    if(N%2==1) b = a[N/2];
    else b = (a[N/2-1]+a[N/2]) / 2;
    ll ans = 0;
    REP(i,N) ans += abs(a[i]-b);
    cout << ans << endl;
}

Measured memory_bytes: 1792
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

def main():
    N = int(input())
    ans = 0
    for digits in range(1, 10):
        for i in range(3 ** digits):
            num = []
            for j in range(digits):
                k = i
                for _ in range(j):
                    k //= 3
                if k % 3 == 0:
                    num.append(7)
                elif k % 3 == 1:
                    num.append(5)
                else:
                    num.append(3)
            if all(j in num for j in [3, 5, 7]):
                num = reduce(lambda x, i: x * 10 + i, num)
                if num <= N:
                    ans += 1
    print(ans)



main()


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

typedef long long ll;
const long double pi = acos(-1);
ll X1,Y1,X2,Y2,n,a[200020],d[200020],len;
map<ll,ll> x,y;

int main(){
    ios::sync_with_stdio(false);
    cin >> X1 >> Y1 >> X2 >> Y2 >> n;
    if(X2 < X1){
        swap(X1,X2);
        swap(Y1,Y2);
    }
    for(int i = 1,u,v;i <= n;++i){
        cin >> u >> v;
        x[u] = v;
        y[v] = u;
    }
    double qc = 5.0 * pi, ans = 0.0;
    if(X1 == X2){
        int p = min(Y1,Y2), q = max(Y1,Y2);
        ans = 100.0 * (q - p);
        if(x.count(X1) && x[X1] > p && x[X1] < q) ans += 2*qc - 20.0;
        cout << fixed << setprecision(12) << ans << endl;
        return 0;
    }
    if(Y1 == Y2){
        int p = min(X1,X2), q = max(X1,X2);
        ans = 100.0 * (q - p);
        if(y.count(Y1) && y[Y1] > p && y[Y1] < q) ans += 2*qc - 20.0;
        cout << fixed << setprecision(12) << ans << endl;
        return 0;
    }

    ll cnt = 0, mny = min(Y1,Y2), mxy = max(Y1,Y2);
    ans = 100.0 * (X2 - X1 + mxy - mny);
    for(auto p: x){
        if(p.first < X1 || p.first > X2) continue;
        if(p.second >= mny && p.second <= mxy) a[++cnt] = (Y1 < Y2 ? 1 : -1) * p.second;
    }

    for(int i = 1;i <= cnt;++i){
        int pos = lower_bound(d+1,d+1+len,a[i]) - d;
        if(pos == len + 1) len++;
        d[pos] = a[i];
    }

    ans -= 20*len - pi * (5 * len);
    if(len > min(X2 - X1,mxy - mny)) ans += qc;

    cout << fixed << setprecision(12) << ans << endl;

    return 0;
}


Measured memory_bytes: 28416
#include <bits/stdc++.h>
#include <cmath>
#include <limits>
#include <iostream>
#include <cfenv>
using namespace std;

int main(){
  double N , K;
  cin >> N >> K;
  double p = 0;
  for(int i = 1;i<min(N+1,K);i++){
    int score = i;
    double a = 0.5;
    p += (1/N) * std::pow(0.5,std::ceil(std::log2(K/i)));
   // for(int j = 1;j<std::ceil(std::log2(K/i));j++){
     // a *= 0.5;
    //}
    //p += (1.0/N) * a;
    
  }
  
  for(int i = K;i<=N;i++){
    p+=1/N;
  }
  std::cout << std::setprecision(20) << p << endl;
}

Measured memory_bytes: 256
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readV(T...)(ref T t){auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  string w; readV(w);

  auto c = new int[](26);
  foreach (wi; w) ++c[wi-'a'];

  writeln(c.all!(ci => ci%2 == 0) ? "Yes" : "No");
}


Measured memory_bytes: 256
x=0
while True:
    try:
        s=list(str(input()))
        n=0
        for i in range(len(s)//2):
            if s[i]!=s[len(s)-1-i]:
                break
            n+=1
        if n==len(s)//2:
            x+=1
    except:
        break
print(x)


Measured memory_bytes: 5560
N = int(input())

if N <= 10 or N == 12 or N == 14 or N == 15 or N == 16 or N == 18 or N == 20 or N == 21 or N == 24 or N == 25 or N == 27 or N == 28 or N == 30 or N == 32 or N == 35 or N == 36 or N == 40 or N == 42 or N == 45 or N == 48 or N == 49 or N == 54 or N == 56 or N == 63 or N == 64 or N == 72 or N == 81:
  print('Yes')
else:
  print('No')


Measured memory_bytes: 3060
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <random>
#include <iomanip>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<pair<ll,ll> > vpll;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
typedef map<int, int> mii;
typedef set<int> si;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define arep(i,v) for(auto i : v)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
// #define endl '\n';
#define fi first
#define se second
#define NONVOID [[nodiscard]]
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
template <class T> inline void dump(T &v){irep(i, v){cout<<*i<<((i==--v.end())?'\n':' ');}}
inline string getline(){string s; getline(cin,s); return s;}
inline void yn(const bool b){b?fin("yes"):fin("no");}
inline void Yn(const bool b){b?fin("Yes"):fin("No");}
inline void YN(const bool b){b?fin("YES"):fin("NO");}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
constexpr ll LLINF = 1LL<<60;
constexpr ll MOD = 1000000007;
constexpr double EPS = 1e-9;

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a;}
// gcdも呼ぶ！！！
ll ngcd(vector<ll> a){
    ll d;
    d = a[0];
    for(int i = 1; i < a.size() && d != 1; i++) d = gcd(a[i], d);
    return d;
}

int main() {

    int n;
    cin>>n;
    vll v(n);
    rep(i,n)cin>>v[i];
    fin(ngcd(v));
}



Measured memory_bytes: 1792
//** aman**/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define dl          double
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b) for(int i=a;i<b;i++)
#define lb lower_bound
#define ub upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
int main(){
	int n,x,y;cin>>n>>x>>y;
	int c1=0,c2=0,c3=0,a[n];
	for(int i=0;i<n;i++){
		cin>>a[i];
		if(a[i]<=x)c1++;
		else if(x<a[i]&&a[i]<=y)c2++;
		else c3++;
	}cout<<min(c1,min(c2,c3))<<endl;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Scanner;
import java.util.Collections;
import java.util.ArrayList;

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

    static class LunlunNumber {
        List<Long> result = new ArrayList<>();

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();

            for (int i = 1; i < 10; i++) {
                val(i, 1);
            }
            Collections.sort(result);
            out.println(result.get(n - 1));
        }

        public void val(long v, int k) {
            result.add(v);

            if (k > 10) {
                return;
            }

            for (int j = -1; j <= 1; j++) {
                long add = v % 10 + j;
                if (0 <= add && add <= 9) {
                    String sb = String.valueOf(v) + add;
                    val(Long.parseLong(sb), k + 1);
                }
            }
        }

    }
}



Measured memory_bytes: 82652
using System;

class ITP1_8_C
{
  static void Main()
  {
    int[] results = new int[1200];
    while(true)
    {
      string s = Console.ReadLine();
      if (s == null) break;
      s = s.ToLower();
      for (int i = 0; i < s.Length; i ++)
      {
        results[s[i]] ++;
      }
    }
    for (int i = 'a'; i <= 'z'; i++)
    {
      Console.WriteLine((char)i + " : " + results[i]);
    }
  }
}



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

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

using namespace std;

int f[10][10];
int temp[10][10];
int ans[10][10];
int dx[5] = {1,0,0,-1,0};
int dy[5] = {0,1,0,0,-1};

void change(int y,int x)
{
	if(f[y-1][x] == 1)
	{
		ans[y][x] = 1;
		rep(i,5)
		{
			int ny = y + dy[i];
			int nx = x + dx[i];

			if(0 <= nx && nx < 10 && 0 <= ny && ny < 10)
			{
				f[ny][nx] = !f[ny][nx];			
			}
		}
	}
}

bool check(int *used)
{
	memset(ans,0,sizeof(ans));
	memcpy(f,temp,sizeof(temp));

	rep(i,10)
	{
		ans[0][i] = used[i];
		if(used[i])
		{
			rep(j,5)
			{
				int nx = i + dx[j];
				int ny = dy[j];

				if(0 <= nx && nx < 10 && 0 <= ny && ny < 10)
				{
						f[ny][nx] = !f[ny][nx];
				}
			}
		}
	}

	REP(i,1,10)
	{
		rep(j,10)
		{
			change(i,j);	
		}
	}

	int cnt = 0;
	rep(i,10) rep(j,10) if(f[i][j] == 1) cnt++;

	if(cnt == 0)
	{
		return true;
	}
	else return false;
}

bool dfs(int i,int *t)
{
	if(i == 10)
	{
		if(check(t)) return true;
		else return false;
	}

	if(dfs(i+1,t)) return true;
	t[i] = 1;
	if(dfs(i+1,t)) return true;
	t[i] = 0;
}

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

	rep(i,n)
	{
		memset(f,0,sizeof(f));
		memset(temp,0,sizeof(temp));

		rep(j,10)
		{
			rep(k,10)
			{
				cin >> temp[j][k];
			}
		}
		
		int t[10];
		memset(t,0,sizeof(t));
		dfs(0,t);
	

		rep(j,10)
		{
			rep(k,10)
			{
				cout << ans[j][k];

				if(k == 9) cout << endl;
				else cout << " ";
			}
		}
	}
	return 0;
}

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

typedef long long ll;
int main(){
  int N, K;
  cin >> N >> K;
  int mincost = 10000;
  for(int i =0; i < N; i++){
    int tmp1, tmp2;
    cin >> tmp1 >> tmp2;
    if(tmp2 <= K){
      if(tmp1 < mincost){
        mincost = tmp1;
      }
    }
  }
  
  if(mincost == 10000){
    cout << "TLE" << endl;
  } else { 
    cout << mincost << endl;
  }
  
}


Measured memory_bytes: 256