akhauriyash/Code-Regression huggingface dataset:
k, n = gets.chomp!.split(" ").map(&:to_i)
a = gets.chomp!.split(" ").map(&:to_i)


aa = a.map.with_index do |at, i|
  if i != (n - 1)
    a[i + 1] - at
  else
    k - a[i] + a[0]
  end
end


puts k - aa.max


Measured memory_bytes: 16900
A, B, C = map(int, input().split())
K = int(input())

while B <= A and K > 0:
    B = 2 * B
    K = K - 1

while C <= B and K > 0:
    C = 2 * C
    K = K - 1

if A < B < C:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9176
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <numeric>
#include <tuple>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
#define ALL(x)   (x).begin(),(x).end()
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define mp       make_pair
#define eb       emplace_back
typedef pair<LL, LL> P;
typedef pair<P, P> PP;

int main() {
	int n, m;
	cin >> n >> m;
	cout << (1900 * m + 100 * (n - m))*pow(2, m) << endl;
}

Measured memory_bytes: 512
#include <iostream>
using namespace std;
bool solve(string S){
    if(S.size()%2!=0){
        return 0;
    }
    for(int i=0;i<(int)S.size();i+=2){
        
        if(S.substr(i,2)!="hi"){
            return 0;
        }
    }
    return 1;

}
int main(){
    string S;
    cin>>S;
    cout<<(solve(S)?"Yes":"No")<<endl;
}

Measured memory_bytes: 256
/**
 *    author:  FromDihPout
 *    created: 2020-08-18
**/

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


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n, k;
    cin >> n >> k;
    long long ans = 0;
    for (int i = k + 1; i <= n; i++) {
        ans += (i - k) * (n / i);
        ans +=  max(n - ((n / i) * i + k) + 1, 0);
        if (k == 0) ans--;    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3624
#include<iostream>
#include<cmath>
#include<vector>
#include<map>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  long L, R;
  cin >> L >> R;
  long r = (L*(L+1))%2019;
  for(long i=L; i<min(R, L+2019); i++){
    for(long j=i+1; j<=min(R, i+2019); j++){
      r = min(r, (i*j)%2019);
    }
  }
  cout << r << endl;
  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();
		int d = sc.nextInt();
		// 出力
		System.out.println(Math.min(a, b) + Math.min(c, d));
	}
}

Measured memory_bytes: 23252
#include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
using namespace std;

bool binarySearch (int key, int n, int s[]) {
  int left = 0, right = n, mid;
  while (left < right) {
    mid = (left + right)/2;
    if (key == s[mid]) return true;
    if (key > s[mid]) left = mid + 1;
    else if (key < s[mid]) right = mid;
  }
  return false;
}
  
int main () {
  int n, q, count, left, right, mid;
  cin >> n;
  int s[n];
  REP(i, n) {
    cin >> s[i];
  }
  cin >> q;
  int t[q];
   REP(i, q) {
    cin >> t[i];
  }

  count = 0;
  REP(i, q) {
    if (binarySearch(t[i], n, s)) count++;
  }
  
  cout << count << endl;
  return 0;
}

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

P getHeadTail(int x){
    int tail = x % 10;
    int head = 0;
    while(x > 0){
        head = x;
        x /= 10;
    }
    return P(head, tail);
}

// main
int main(){
    int N;
    cin >> N;

    map<P, int> freq;

    for (int i = 1; i <= N; ++i){
        P p = getHeadTail(i);
        freq[p]++;
    }

    int ans = 0;
    for(const auto& itr : freq){
        auto key = itr.first;
        P q(key.second, key.first);
        ans += itr.second * freq[q];
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <random>
using namespace std;
using ll = long long;
struct P {
    ll x;
    ll y;
    bool operator<(const P& p) const
    {
        return (x != p.x) ? x < p.x : y < p.y;
    }
};
vector<P> pos;
int N;

bool ok(const int i, const int j)
{
    const ll x = (pos[i].x + pos[j].x) / 2;
    const ll y = (pos[i].y + pos[j].y) / 2;
    const ll dx = pos[j].x - x;
    const ll dy = pos[j].y - y;
    set<P> p;
    int cnt = 0;
    ll h = 0;
    for (int k = 0; k < N; k++) {
        if (k == i or k == j) {
            continue;
        }
        const ll X = pos[k].x - x;
        const ll Y = pos[k].y - y;
        const ll S = X * dx + Y * dy;
        const ll T = -X * dy + Y * dx;
        h = max(h, abs(T));
        if (S == 0) {
            cnt++;
        }
        p.insert(P{S, T});
    }
    if (cnt >= 3 or h == 0) {
        return false;
    }
    for (const auto& pp : p) {
        if (p.find(P{-pp.x, pp.y}) == p.end()) {
            return false;
        }
    }
    return true;
}

int main()
{
    cin >> N;
    for (int i = 0; i < N; i++) {
        ll x, y;
        cin >> x >> y;
        pos.push_back(P{2 * x, 2 * y});
    }
    mt19937 mt{random_device{}()};
    uniform_int_distribution<int> dist{0, N - 1};
    for (int i = 0; i < 30 * N; i++) {
        int u = 0;
        int v = 0;
        while (u == v) {
            u = dist(mt);
            v = dist(mt);
        }
        if (ok(u, v)) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;

    return 0;
}



Measured memory_bytes: 3276
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <deque>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main()
{
	int N;
	cin >> N;
	vector<pair<int, int>> a;
	for (auto i = 0; i < N; ++i)
	{
		int temp;
		cin >> temp;
		a.push_back({ temp, i + 1 });
	}

	sort(a.begin(), a.end());
	set<int> s;
	s.insert(0);
	s.insert(N + 1);
	auto ans = 0ll;
	for (auto i = 0; i < N; ++i)
	{
		auto& p = a[i];
		auto it = s.upper_bound(p.second);
		auto right = *it;
		--it;
		auto left = *it;
		ans += (ll)(p.second - left) * (right - p.second) * p.first;
		s.insert(p.second);
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 11248
while True:
    x,p,y = input().split()
    x = int(x)
    y = int(y)
    
    if p=="+": 
        cal = x+y
    elif p=="-":
        cal = x-y
    elif p=="/":
        cal = int(x/y)
    elif p=="*":
        cal = x*y
    elif p=="?":
        break
    else:
        continue
    print(cal)


Measured memory_bytes: 5596
#include<bits/stdc++.h>
#define Max 300002
using namespace std;

int n,m,num;
long long sum[Max],a[Max],b[Max],c[Max];

int main()
{
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  cin>>m;
  for(int i=0;i<m;i++){
    cin>>b[i];
  }
  for(int i=0;i<m;i++){
    cin>>c[i];
  }
  sort(a,a+n);
  sum[0]=a[0];
  for(int i=1;i<n;i++){
    sum[i]=sum[i-1]+a[i];
  }

  for(int i=0;i<m;i++){
    int index=upper_bound(a,a+n,b[i])-a;
    if(0<=index && c[i]<=sum[index-1])cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
  return 0;
}

Measured memory_bytes: 10468
N = int(input())
h = list(map(int, input().split()))
dp = [0 for i in range(N)]
dp[0] = 0
dp[1] = abs(h[0]-h[1])
for i in range(N-2):
  dp[i+2] = min(dp[i+1] + abs(h[i+1]-h[i+2]), dp[i] + abs(h[i]-h[i+2]))
print(dp[N-1])

Measured memory_bytes: 13928
#include<bits/stdc++.h>
#define endl "\n"
#define pb push_back
#define ll long long
#define d1(x)  cerr << #x << "--> " << x << endl
#define d2(x, y)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<endl
#define d3(x, y,z)  cerr << #x << "--> " << x << " | " << #y << "--> " << y <<" | " << #z << "--> "<< z<< endl
#define vpll vector<pair<ll,ll>>
#define F first
#define S second
#define T ll tt; cin>>tt; while(tt--)
using namespace std;
ll mode=1e9+7;
const ll maxn=1e5+10;
ll __lcm(ll a, ll b){ return (a*b)/__gcd(a,b); }
ll random(ll mn, ll mx){
	return (rand() % (mx - mn + 1)) + mn; 
}
vector<ll> adj[maxn];
vector<ll> deg(maxn, 0);
vector<ll> ans(maxn);

void solve(){
	
	
	string s;
	cin>>s;
	if ((s[2]==s[3]) && (s[4]==s[5])){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
	
	return ;
	
}

int main(){ 
    
    #ifndef ONLINE_JUDGE
  	//	freopen("input.txt", "r", stdin);
    #endif
    srand(time(0)); 
    
    ios::sync_with_stdio(0);
    cin.tie(0);

	//T{ solve(); }
	solve();
	
	
	
	return 0;
}

Measured memory_bytes: 4224
/* Bismillahirrahmanirrahim */
/* Author : Jehian Norman Saviero (@Reiva5) */
#include <bits/stdc++.h>

// MACROS SAMPAH
#define Jehian using
#define Norman namespace
#define Saviero std

Jehian Norman Saviero;

// MACROS TYPE
typedef long l;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef double ld;
typedef pair<int,int> pi;
typedef pair<l,l> pl;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<l> vl;
typedef vector<ll> vll;

// MACROS FOR PRINT
#define nl printf("\n")
#define sp printf(" ")

// MACROS FOR ATTRIBUTE
#define fi first
#define se second

// MACROS FOR FUNCTION AND METHOD
#define eb emplace_back
#define mp make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define ALL(x) (x).begin(), (x).end()
#define ALLN(x,n) (x), (x)+(n)
#define CUBE(x) (SQR(x)*(x))
#define SET(x,y) for (int _qwe = sizeof(x)/sizeof(x[0]); _qwe; ) x[--_qwe] = (y)
#define SQR(x) ((x)*(x))
#define SSORT(x,sz) sort(ALLN(x,sz))
#define RESET(x) memset((x), 0, sizeof(x))
#define VSORT(x) sort(ALL(x))

// MACROS READ INPUT
#define sci(x) scanf("%d", &x)
#define scl(x) scanf("%ld", &x)
#define scll(x) scanf("%lld", &x)
#define scul(x) scl(x)
#define scull(x) scll(x)

int main() {
	ll D, G;
	scll(D), scll(G);
	vector< pair<pll, ll> > dat;
	ll i = 1;
	while (D--) {
		ll p, c;
		scll(p), scll(c);
		dat.pb({{i++,p},c});
	}
	ll ANS = 1e18;
	do {
		ll curr = 0;
		ll prob = 0;
		for (ll i = 0; i < dat.size(); ++i) {
			if (curr + dat[i].fi.se * 100 * dat[i].fi.fi + dat[i].se < G) {
				prob += dat[i].fi.se;
				curr += dat[i].fi.fi * 100 * dat[i].fi.se + dat[i].se;
			} else {
				ll tmp = dat[i].fi.se;
				while (tmp > 0 && curr < G) {
					curr += dat[i].fi.fi * 100;
					--tmp;
					++prob;
				}
				if (tmp == 0) curr += dat[i].se;
				assert(curr >= G);
				ANS = min(ANS, prob);
			}
		}
	} while (next_permutation(ALL(dat)));
	cout << ANS << endl;
	return 0;
}

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

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

	vector<int> A;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		A.push_back(a);
	}

	int maxNum = *max_element(A.begin(), A.end());
	int minNum = *min_element(A.begin(), A.end());

	cout << abs(maxNum - minNum) << endl;

}

Measured memory_bytes: 256
#include<iostream>
#include<map>

using namespace std;

map<int,int> num;

int main( )
{
	int n;
	cin >> n;
	for(int j = 0; j < n; j++){
		int a;
		cin >> a;
		num[a]++;
	}
	int m;
	cin >> m;
	bool ok = true;
	int j;
	for(j = 0; j < m; j++){
		int a;
		cin >> a;
		if(!(num[a]--)) break;
	}
	if(j == m)
		cout << "YES" << endl;
	else
		cout << "NO" << endl; 
}


Measured memory_bytes: 9600
#include <iostream>
#include <algorithm>

using namespace std;

const int M = 1000, N = 1000;
int a[N] = { 0 };

int main(){
	int m, n, b, ans = 0;
	cin >> n >> m;
	for(int i = 0;i < m;++i){
		cin >> a[i] >> b;
	}
	sort(a, a + N, greater<int>());
	for(int i = 0;i < m - 1;++i){
		if(a[i] < n) {
			ans += n - a[i];
		}
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 3164
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
int main()
{
    int i,j;
    char a[5][5];
    for(i=0;i<3;i++)
    {

        for(j=0;j<3;j++)
        {
            scanf("%c",&a[i][j]);
        }
        getchar();
    }
    printf("%c%c%c\n",a[0][0],a[1][1],a[2][2]);
    return 0;
}


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

struct Edge {
  int to;
  int id;
  Edge(int t, int i) : to(t), id(i) {}
};

using Graph = vector<vector<Edge>>;
vector<int> ans;

void dfs(Graph &g, int v, int pre_color = -1, int parent = -1) {
  int color = 1;
  for (auto next_v : g.at(v)) {
    int u = next_v.to;
    int id = next_v.id;
    if (u == parent) continue;
    if (color == pre_color) color++;
    ans.at(id) = color;
    color++;
    dfs(g, u, ans.at(id), v);
  }
}

int main() {
  int N;
  cin >> N;
  vector<vector<Edge>> graph(N);
  for (int i = 0; i < N - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    graph.at(a).push_back(Edge(b, i));
    graph.at(b).push_back(Edge(a, i));
  }

  ans.resize(N - 1);
  dfs(graph, 0);

  int mx = 0;
  for (int i = 0; i < N; i++) mx = max(mx, (int)graph.at(i).size());
  cout << mx << endl;
  for (int i = 0; i < N - 1; i++) cout << ans.at(i) << endl;
  return 0;
}

Measured memory_bytes: 8320
N , M =map(int , input().split())
S = set(k for k in range(0,N))
H = list(map(int , input().split()))
for i in range(M):
    f , g =map(int , input().split())
    x=f-1
    y=g-1
    if H[x]<=H[y]:
            S.discard(x)
    if H[x]>=H[y]:
            S.discard(y)
print(len(S))

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

flag =True

for i in A:
    if i%2 == 0:
        if i%3 ==0:
            flag = True
        elif i%5 == 0:
            flag = True
        else:
            flag = False
            break
            
if flag:
    print('APPROVED')
else:
    print('DENIED')
        




Measured memory_bytes: 3060
#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<stack>
#include<queue>
#include<vector>
using namespace std;
int main()
{
	long long int a, b, c, d, i, j, k, m, l, t;
	vector<long long int>v;
	cin >> a;
	for (i = 0; i < a; i++)
	{
		cin >> b;
		v.push_back(b);
	}
	sort(v.begin(), v.end());
	cout << v[a / 2] - v[a / 2 - 1] << endl;
	return 0;
}

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

using namespace std;

#define mp make_pair
#define F first
#define S second
#define pb push_back
#define fo(i, n) for(int i = 1; i <= n; ++i)

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int N = 200200;
const int mod = 1e9 + 7 ;
int n,a[N];

map<int, int> cnt;
int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	cin>>n;
	fo(i,n)
	{
		cin >> a[i];
		cnt[a[i]]++;
		cnt[a[i]+1]++;
		cnt[a[i]-1]++;
	}
	int id = -1;
	for(auto x : cnt)
		id=max(id, x.S);
	cout << id;
	return 0;
}
               

Measured memory_bytes: 5120
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <cmath>
#include <stack>
#include <string>
#include <cstring>
#include <numeric>
#include <iomanip>
#include <fstream>
using namespace std;
long long mod=998244353;
int main(){
	int h,w,k;
	int sx,sy,gx,gy;
	char c[1000000];
	cin>>h>>w>>k;
	cin>>sx>>sy>>gx>>gy;
	sx--;
	sy--;
	gx--;
	gy--;
	int s=sx*w+sy,g=gx*w+gy;
	for(int i=0;i<h*w;i++){
		cin>>c[i];
	}
	int d[1000000];
	fill(d,d+h*w,1e9+7);
	queue<pair<int,pair<int,int> > > que;
	que.push(make_pair(s,make_pair(0,-1)));
	d[s]=0;
	while(!que.empty()){
		pair<int,pair<int,int> > hoge=que.front();
		int now=hoge.first;
		int dis=hoge.second.first;
		int dir=hoge.second.second;
		que.pop();
		int cnt=0;
		int mow=now;
		mow-=w;
		while(cnt<k&&mow>=0&&dir!=0){
			if(c[mow]=='@'){
				break;
			}else{
				if(mow==g){
					cout<<dis+1<<endl;
					return 0;
				}
				if(d[mow]==1e9+7){
					d[mow]=dis+1;
					que.push(make_pair(mow,make_pair(d[mow],1)));
				}else if(d[mow]!=dis+1){
					break;
				}
			}
			cnt++;
			mow-=w;
		}
		cnt=0;
		mow=now;
		mow+=w;
		while(cnt<k&&mow<h*w&&dir!=1){
			if(c[mow]=='@'){
				break;
			}else{
				if(mow==g){
					cout<<dis+1<<endl;
					return 0;
				}
				if(d[mow]==1e9+7){
					d[mow]=dis+1;
					que.push(make_pair(mow,make_pair(d[mow],0)));
				}else if(d[mow]!=dis+1){
					break;
				}
			}
			cnt++;
			mow+=w;
		}
		cnt=0;
		mow=now;
		mow--;
		while(cnt<k&&mow%w<now%w&&dir!=2){
			if(c[mow]=='@'){
				break;
			}else{
				if(mow==g){
					cout<<dis+1<<endl;
					return 0;
				}
				if(d[mow]==1e9+7){
					d[mow]=dis+1;
					que.push(make_pair(mow,make_pair(d[mow],3)));
				}else if(d[mow]!=dis+1){
					break;
				}
			}
			cnt++;
			mow--;
		}
		cnt=0;
		mow=now;
		mow++;
		while(cnt<k&&mow%w>now%w&&dir!=3){
			if(c[mow]=='@'){
				break;
			}else{
				if(mow==g){
					cout<<dis+1<<endl;
					return 0;
				}
				if(d[mow]==1e9+7){
					d[mow]=dis+1;
					que.push(make_pair(mow,make_pair(d[mow],2)));
				}else if(d[mow]!=dis+1){
					break;
				}
			}
			cnt++;
			mow++;
		}
	}
	cout<<-1<<endl;
	return 0;
}


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

int main() {
  int R;
  cin >> R;
  
  if(R < 1200) {
    cout << "ABC" << endl;
  } else if(R < 2800) {
    cout << "ARC" << endl;
  } else {
    cout << "AGC" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
	import java.util.Map.Entry;
	 
	 
	 class Main {
		 static int mod =  (int) (Math.pow(10,9)+7);
//		 static int mod =  (int) 998244353;
		 static List<ArrayList<Integer>> list= new ArrayList<ArrayList<Integer>>();
		 static int a_dist[];
		 public static void main(String[] args) {
	    	
	        Scanner sc = new Scanner(System.in);
	        
	        String S = sc.next();
	        char[] c = S.toCharArray();
	        int N = c.length;
	        long ans = (long)N*(N-1)/2+1;
	        
	        long[] m = new long[26];
	        for(int i=0;i<N;i++) {
	        	m[c[i]-'a']++;
	        }
	        
	        for(int i=0;i<26;i++) {
	        	ans=ans-m[i]*(m[i]-1)/2;
	        }
	        
	        System.out.println(ans);
	        
		 }
		 
	}

Measured memory_bytes: 40980
#include <stdio.h>

int main(void){
	int number[3];
  
  scanf("%d%d%d",&number[0],&number[1],&number[2]);
  int i,j,shell;
  for(i=0;i<3;i++){
  for(j=0;j<2;j++){
  	if(number[j] < number[j+1]){
    	shell = number[j];
        number[j] = number[j+1];
        number[j+1] = shell;
    }
  }
  }
  number[0] = number[0] * 10 + number[1] + number[2];
  
  printf("%d\n",number[0]);


}

Measured memory_bytes: 128
#include <stdio.h>

int main() {
  int h,m,s,S;

  scanf("%d",&S);

  h = S/3600;
  m = (S-h*3600)/60;
  s = S-h*3600-m*60;
  
  printf("%d:%d:%d\n",h,m,s);
  return 0;
}


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

int t[1000000],u[1000000];

int main(){
    int n,s=0,m=0;
    cin>>n;
    int b[n];
    for(int i=0;i<n;i++){
        cin>>b[i];
        if(t[b[i]]==0){
            s++;
        }
        t[b[i]]++;
    }
    for(int i=0;i<n;i++){
        if(t[b[i]]%2==0 && u[b[i]]==0){
            m++;
        }
        u[b[i]]=1;
    }
    cout<<s-m%2;
}


Measured memory_bytes: 5120
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;



int main(){
  string a,b;
  cin >> a >> b;
  string s = a+b;
  int ans = 0;
  int de = 1;
  REP(i,s.size()){
    ans *= 10;
    ans += (int)(s[i] - '0');
  }

  REP2(i,1,1000){
    if(ans == i*i){
      cout << "Yes" << endl;
      return 0;
    }
  }

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


Measured memory_bytes: 3548
h,w = map(int, input().split())
s = []
for i in range(h):
    s.append(str(input()))
    
flag = True
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            check = False
            if i+1 < h:
                if s[i+1][j] == '#':
                    check = True
            if j+1 < w:
                if s[i][j+1] == '#':
                    check = True
            if i-1 >= 0:
                if s[i-1][j] == '#':
                    check = True
            if j-1 >= 0:
                if s[i][j-1] == '#':
                    check = True
            if check == False:
                flag = False
if flag:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>     // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
using namespace std;
/*
         ########     ########   ########   #########   ##       #######   ##       #######
         #      #     #      #   #      #       #       # #      #     #   # #      #     #
         #      #     #      #   #      #       #       #  #     #     #   #  #     #     #
         ########     #      #   #      #       #       #   #    #     #   #   #    #     #
         ###          #      #   #      #       #       #    #   #######   #    #   #######
         #  #         #      #   #      #       #       #   #    #     #   #   #    #     #
         #   #        #      #   #      #       #       #  #     #     #   #  #     #     #
         #    #       #      #   #      #       #       # #      #     #   # #      #     #
         #     #      ########   ########       #       ##       #     #   ##       #     #
*/

#define rep(i, a, b) for (__typeof((b)) i = (a); i < (b); i++)
#define nrep(i, a, b) for (__typeof((b)) i = (a); i > (b); i--)
#define all(a) (a).begin(), (a).end()
#define ff first
#define ss second
#define ppi pair<int, int>
#define pppi pair<ppi, int>
#define vi vector<int>
#define vii vector<ppi>
#define viii vector<pppi>
#define vs vector<string>
#define pb push_back
#define bitcount __builtin_popcountll //count no's of ones in a set bit
#define prq priority_queue
#define mp make_pair
#define mem(x, val) memset((x), (val), sizeof(x));
#define sz(x) (int)x.size()
#define M_PI 3.14159265358979323846
#define rootdada                      \
    ios_base::sync_with_stdio(false); \
    cin.tie(0);                       \
    cout.tie(0);
#define test  \
    int t;    \
    cin >> t; \
    while (t--)
#define debug(a)          \
    cerr << #a << ": ";   \
    for (auto i : a)      \
        cerr << i << " "; \
    cerr << '\n';
#define trace(a) cerr << #a << ": " << a << "\n"
#define print(ar, n)            \
    for (int u = 0; u < n; u++) \
    {                           \
        cout << ar[u] << " ";   \
    }                           \
    cout << endl;
#define int long long
#define M 1000000007
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
signed main()
{
	rootdada;
// #ifndef ONLINE_JUDGE
//     freopen("input.txt", "r", stdin);
//     freopen("output.txt", "w", stdout);
//     freopen("error.txt", "w", stderr);
// #endif
	int n, x, t;
	cin >> n >> x >> t;
	int l;
	if (n % x == 0)
		l = n / x;
	else
		l = n / x + 1;
	cout << l*t << endl;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
ll A[101010];
ll B[101010];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N) cin>>A[i];
	
	ll pre=0;
	FOR(i,N) pre=A[i]-pre;
	
	B[0]=pre/2;
	FOR(i,N-1) {
		B[i+1]=A[i]-B[i];
	}
	FOR(i,N) cout<<B[i]*2<<" ";
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 2944
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(){
    int q; cin>>q;
    while(q--){
        int c, a, n; cin>>c>>a>>n;
        int ans = 0;
        while(0 < c && 0 < a && 0 < n){
            c--, a--, n--;
            ans++;
        }

        while(1 < c && 0 < a){
            c -= 2;
            a--;
            ans++;
        }

        while(2 < c){
            c -= 3;
            ans++;
        }

        cout << ans << endl;
    }
}


Measured memory_bytes: 3100
#include<stdio.h>
int main()
{
   int H[10000],W[10000],i,j,x,y;
   for(i=0;i<10000;i++)
   {
       scanf("%d %d",&H[i],&W[i]);
       if(H[i]==0&&W[i]==0)
        break;
   }
   for(i=0;i<10000;i++)
   {
       if(H[i]==0&&W[i]==0)
       {
           break;
       }
       for(x=0;x<H[i];x++)
      {
       for(j=0;j<W[i];j++)
       {
           if((x+j)%2==0)
            printf("#");
           else
            printf(".");
       }
       printf("\n");
   }
printf("\n");
    }
    return 0;
}



Measured memory_bytes: 2044
#include <iostream>
#include <queue>
#include <algorithm>

using namespace std;

const int INF = 10000000;
typedef pair<int, int> P;

char field[1000][1001];
int H, W, N;
int sx, sy;
int gx, gy;

int dis[1000][1000];
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

void input(void){
	cin >> H >> W >> N;
	for(int j = 0;j < H;j++){
		for(int i = 0;i < W;i++){
			cin >> field[i][j];
		}
	}
}

void firstcheck(void){
	for(int i = 0;i < W;i++){
		for(int j = 0;j < H;j++){
			if(field[i][j] == 'S'){
				sx = i;
				sy = j;
			}
		}
	}

	for(int i = 0;i < W;i++){
		for(int j = 0;j < H;j++){
			if(field[i][j] == '1'){
				gx = i;
				gy = j;
			}
		}
	}
}

void nextnum(void){
	sx = gx;
	sy = gy;

	for(int i = 0;i < W;i++){
		for(int j = 0;j < H;j++){
			if(field[i][j] == field[gx][gy] + 1){
				gx = i;
				gy = j;

				return ;
			}
		}
	}
}

int bfs(void){
	queue<P> que;

	for(int i = 0;i < W;i++){
		for(int j = 0;j < H;j++){
			dis[i][j] = INF; //????????§??§?????????
		}
	}

	que.push(P(sx, sy));
	dis[sx][sy] = 0; //??????????????????????????¢0???

	while(que.size()){ //que????????????????????§?????????
		P p = que.front(); //?????????????????????
		que.pop(); //???????????´??°

		if(p.first == gx && p.second == gy) break;

		for(int i = 0;i < 4;i++){
			int nx = p.first + dx[i], ny = p.second + dy[i];

			if(0 <= nx && nx < W && 0 <= ny && ny < H && field[nx][ny] != 'X' && dis[nx][ny] == INF){
				que.push(P(nx, ny)); //????£??????????
				dis[nx][ny] = dis[p.first][p.second] + 1;
			}
		}
	}

	return dis[gx][gy];
}


int main(){
	int res = 0;
	input();

	for(int i = 0;i < N;i++){
		if(i == 0){
			firstcheck(); //????????????S,G?????????
		} else {
			nextnum(); //S, G?????´??°
		}
		res += bfs(); //?????¢?????????
	}
	cout << res << endl;

	return 0;
}

Measured memory_bytes: 6100
#include<stdio.h>
int main(){
  int N,A[100],i,j,count=0,minj,B;
  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]){
      B=A[i];
      A[i]=A[minj];
      A[minj]=B;
      count++;
    }
  }
  for(i=0;i<N;i++){
    printf("%d",A[i]);
    if(i != N-1)
      printf(" ");
    else printf("\n");
  }
  printf("%d\n",count);
  return 0;
}
      



Measured memory_bytes: 2144
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
using ll = long long;
using ldb = long double;
using pa = pair < ll, ll >;
using vec = vector < ll >;
 
template < typename T > using index_set = tree < T, null_type, less < T >, rb_tree_tag, tree_order_statistics_node_update >;
template < typename T > using MinPriorityQueue = priority_queue < T, vector < T >, greater < T > >;

#define pb push_back
#define po pop_back
#define mp make_pair
#define mt make_tuple
#define F  first
#define S  second
#define f(i,x,n) for(ll i=x;i<n;i++) 
#define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x))))
#define all(c) c.begin(),c.end()
#define str string
#define edl "\n"
#define add insert
#define cot continue
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)


const int MOD = 1e9 + 7, INF = INT_MAX, N = 1e5 + 10;
const double PI = acos(-1);
const ll LINF = LLONG_MAX;

int main() 
{

    fast();
      
 
    ll d,m,n;
    cin>>m>>d;
    ll c=0;
    f(i,1,m+1)
    {
      f(j,1,d+1)
      {
        str s1=to_string(j);
        if(s1.size()==1)
          continue;
        else
        {
          int a1=s1[0]-'0';
          int b1=s1[1]-'0';
      
          if(a1*b1==i&&b1>=2&&a1>=2)
          {
        
            c++;
          }
        }
      }
    }

    cout<<c;

        
  

    cerr << "Time taken: " << int((clock() * 1000.) / CLOCKS_PER_SEC) << "ms\n";
    return 0;
}


Measured memory_bytes: 256
use std::io::prelude::*;

fn input<T: std::str::FromStr>() -> T {
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

fn main() {
    let n: usize = input();
    let xy: Vec<(i32, i32)> = (0..n).map(|_| (input(), input())).collect();
    const V: usize = 100005;

    let mut e = vec![vec![vec![]; V]; 2];
    for (x, y) in xy {
        let (x, y) = (x as usize - 1, y as usize - 1);
        e[0][x].push(y);
        e[1][y].push(x);
    }

    let mut used = vec![vec![false; V]; 2];
    let mut ans = 0i64;
    for i in 0..V {
        if !used[0][i] {
            let mut cnt = vec![0, 0];
            dfs(i, 0, &e, &mut used, &mut cnt);
            ans += cnt[0] * cnt[1];
        }
        if !used[1][i] {
            let mut cnt = vec![0, 0];
            dfs(i, 0, &e, &mut used, &mut cnt);
            ans += cnt[0] * cnt[1];
        }
    }

    println!("{}", ans - n as i64);
}

fn dfs(
    cur: usize,
    xy: usize,
    e: &Vec<Vec<Vec<usize>>>,
    used: &mut Vec<Vec<bool>>,
    cnt: &mut Vec<i64>,
) {
    if used[xy][cur] {
        return;
    }

    used[xy][cur] = true;
    cnt[xy] += 1;
    for &next in &e[xy][cur] {
        let xy = 1 - xy;
        if !used[xy][next] {
            dfs(next, xy, e, used, cnt);
        }
    }
}


Measured memory_bytes: 20476
#include <iostream>

using namespace std;

int main() {
  int64_t N;
  cin >> N;
  int64_t result = 0;
  for (int64_t i = 1; i <= N; ++i) {
    if (((i % 3) != 0) && ((i % 5) != 0)) {
      result += i;
    }
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 3576
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <ctype.h>
#include <cmath>
#include <iomanip>
#include <ios>
#include <set>
#define ll long long
using namespace std;

int main(void){
    
    string w;
    cin>>w;
    map <char,int>c;
    for(int i=0;i<w.size();i++){
        c[w[i]]+=1;
    }
    for(int i=0;i<w.size();i++){
        if(c[w[i]]%2==1){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    
    
    return 0;
}




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

int main()
{
  int k, x;
  cin >> k >> x;

  int minx = x - k + 1;
  if(minx < -20000000)  minx = -20000000;

  int maxx = x + k - 1;
  if(maxx > 20000000) maxx = 20000000;

  for(int i = minx; i <= maxx; i++){
    cout << i;
    if(i != maxx) cout << " ";
  }

  cout << endl;

  return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); ++(i))
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef pair<int, int> pii;
typedef complex<double> xy_t;

const lint mod = 1e9 + 7;

int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    const int INF = mod;
    int d[n][n], e[n][n];
    rep(i, n){
        rep(j, n) d[i][j] = e[i][j] = INF;
        d[i][i] = e[i][i] = 0;
    }
    rep(i, m){
        int a, b, c;
        scanf("%d%d%d", &a, &b, &c);
        --a; --b;
        d[a][b] = d[b][a] = c;
        e[a][b] = e[b][a] = c;
    }
    
    rep(k, n)rep(i, n)rep(j, n)if(d[i][k] < INF && d[k][j] < INF){
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
    }
    
    int ans = 0;
    rep(i, n)For(j, i+1, n)if(e[i][j] < INF){
        bool flag = false;
        rep(k, n)rep(l, n){
            if(d[k][l] == d[k][i] + e[i][j] + d[j][l]){
                flag = true;
                break;
            }
        }
        if(!flag) ++ans;
    }
    
    printf("%d\n", ans);
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define all(c) c.begin(), c.end()
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
#define gadd(x,y) x=add(x,y)
#define gmul(x,y) x=mul(x,y)
using namespace std;

typedef pair<int,int> pii;
typedef long long ll;

int main(){
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(0);
	int n;
	cin >> n;
	int x;
	rep(i,0,n){
		cin >> x;	
		if(x % 2 == 0 && !(x % 3 == 0 || x % 5 == 0)){
			cout << "DENIED\n";
			return 0;
		}
	}
	cout << "APPROVED" << '\n';
}


Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#include <iomanip>
#define ll long long int
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
using namespace std;
int mx4[] = {0,1,0,-1};
int my4[] = {1,0,-1,0};
int mx2[] = {1,0};
int my2[] = {0,1};

class BPolygon {
public:
	void solve(istream& in, ostream& out) {
        int n; in >> n;
        vector<int> l(n);
        rep(i,n) in >> l[i];
        sort(l.begin(),l.end());
        int sum = 0;
        rep(i,n-1) sum += l[i];
        if(sum > l[n-1]) out << "Yes" << endl;
        else out << "No" << endl;
	}
};

int main() {
	BPolygon solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

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

int main(){
	int n,m;
	vector<int> A;
	cin >> n >> m;
	int total = 0;
	for(int x = 0; x<n; x++){
		int input;
		cin >> input;
		A.push_back(input);
		total = total + A[x];
	}

	double pred = 1/(4* (double) m) * (double) total;
	int count = 0;
	for(int x = 0; x<n; x++){
		if(A[x] >= pred){
			count++;
		}
		if(count >=m ){
			cout << "Yes";
			return 0;
		}
	}
	cout << "No";

}

Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include <set>
#include <cassert>
#include<cmath>
#include<climits>
#include<iomanip>
using namespace std;
#define MOD 1000000007
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
const long long INF = 1LL << 60;


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;
}

class UnionFind {
	vector<int> data;
public:
	UnionFind(int size) : data(size, -1) { }
	bool unionSet(int x, int y) {
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	bool findSet(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};

int find(vector<long long> &arr, long long obj) {
	if (arr[arr.size() - 1] < obj)return arr.size()-1;
	if (arr[0] > obj)return -1;

	int min = 0; int max = arr.size() - 1;
	for (int i = 0; i < arr.size(); i++) {
		if (arr[min+(max-min) / 2] > obj) {
			max = min + (max - min) / 2;
		}
		else {
			min = min + (max - min) / 2;
		}
		if (max - min == 1) {
			return min;
		}
	}


}

//約数求める //約数
void divisor(ll n,vector<ll> &ret) {
	for (ll i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			ret.push_back(i);
			if (i * i != n) ret.push_back(n / i);
		}
	}
	sort(ret.begin(), ret.end());
	
}
//階乗
long long factorial(long long n, long long mod) {
	long long ret = 1;
	for (long long i = 1; i <= n; i++) {
		ret = (ret * i) % mod;
	}
	return ret;
}
//モジュラ逆数
long long inv_mod(long long n, long long mod) {
	long long a = n % mod, b = mod - 2, ret = 1;
	while (b > 0) {
		if (b & 1) ret = (ret * a) % mod;
		a = (a * a) % mod;
		b >>= 1;
	}
	return ret;
}

long long nPr(long long n, long long r, long long mod) {
	long long ret = 1;
	for (long long i = n; i >= n - r + 1; i--) {
		ret = ret * (i % mod) % mod;
	}
	return ret;
}

long long nCr(long long n, long long r, long long mod) {
	return nPr(n, r, mod) * inv_mod(factorial(r, mod), mod) % mod;
}

ll gcd(ll m, ll n){
	if (n == 0)return m;
	return gcd(n, m%n);
}//gcd



int main() {
  ll n;
  cin>>n;
  vector<vector<char>> a;
  a.resize(n);
  rep(i,n)a[i].resize(n);
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      cin>>a[i][j];
    }
  }
  ll count=0;
  for(int k=0;k<n;k++){
    int flag=1;
    for(int i=1;i<n;i++){
      for(int j=0;j<i;j++){
        int x,y;
        if(i+k>=n){
          x=i+k-n;
        }else{
          x=i+k;
        }
        if(j+k>=n){
          y=j+k-n;
        }else{
          y=j+k;
        }
        if(a[x][j]!=a[y][i])flag=0;
        
      }
    }
    if(flag==1)count+=n;
  }
  cout<<count;
	return 0;
}

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

#define vint vector<int> 
#define vbool vector<bool>
#define vvint vector<vector<int>>

#define rep(a, b, c) for(int (a)=(b); (a)<(c); (a)++)
#define all(a) (a).begin(), (a).end()

int main(){
    int n; cin>>n;
    vvint f(n, vint(10));
    vvint p(n, vint(11));

    rep(i, 0, n)rep(j, 0, 10)cin>>f[i][j];
    rep(i, 0, n)rep(j, 0, 11)cin>>p[i][j];

    long long int max = LLONG_MIN;
    rep(i, 1, pow(2, 10)){ // いつ営業するか

        stringstream ss;
        ss << bitset<10>(i);

        string s = ss.str();
        long long int score = 0;
        rep(j, 0, n){ // 核店
            int count = 0;
            rep(k, 0, 10){
                if(f[j][k] && s[k]-'0'){
                    count++;
                }
            }
            score += p[j][count];
        }
        if(score > max) max = score;
    }
    cout << max;
}

Measured memory_bytes: 256
#include <iostream>

int main() {
    int n;
    std::cin >> n;
    int count = 1000000;
    for(int i = 0; i < n; ++i) {
        int tmp_count = 0;
        int a;
        std::cin >> a;
        while (a % 2 == 0) {
            tmp_count++;
            a /= 2;
        }
        if (tmp_count < count) count = tmp_count;
    }
    std::cout << count << std::endl;
    return 0;
}

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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<string> Vs;

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> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void uniq(vector<int> &vec){sort(vec.begin(), vec.end());vec.erase(unique(vec.begin(), vec.end()), vec.end());}
void start(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);}

signed main(){start();
    int n,a;
    cin>>n>>a;
    cout<<(n<a?0:10)<<endl;
    return 0;
}


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

divisors = []
for i in range(1, int(sumA**0.5)+1):
    if sumA % i ==0:
        divisors.append(i)
        if  i != sumA // i:
            divisors.append(sumA//i)

ans = 0

for i in divisors:
    listA = [0]*N
    for j in range(N):
        listA[j] = A[j] % i
    listA.sort()
    sumlist = sum(listA)


    if sum(listA[:-sumlist // i]) <= K:
        ans = max(ans,i)
            
print(ans)




Measured memory_bytes: 41580
/*
We will not return to the countless mistakes of the past
I will not relive the failures of the man I once was

Only through dedication will I destroy all preconception

No longer will I let myself be truly satisfied with the standard
We will not return to the countless mistakes of the past

Only through dedication will I destroy all preconception

Let this be
Be the day
Day of my
My declaration
Let this be the day of my declaration

Join me,
Walk with me
Shatter the bonds that tie us
To what we strive to never be

Join me,
Walk with me
*/
#include<bits/stdc++.h>

#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef pair<ll, ll> pii;
typedef vector<ll> 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; }

const ll maxn=1000001,mod=1e9+7;


int main(){

string s,t;
cin>>s>>t;
int l=s.size();
s+=s;
fore(i,0,l-1){
string st=s.substr(i,l);
if(st==t){cout<<"Yes";
return 0;
}
}
cout<<"No";
return 0;
}


Measured memory_bytes: 256
#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 fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned int uint;
typedef unsigned long long ulint;
typedef long double ldouble;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
constexpr lint mod1 = 1e9+7;

int main() {
  int h, w, m = 0;
  cin >> h >> w;
  vector<string> v(h);
  rep(i, h) cin >> v[i];
  vector<vector<int>> d(h*w, vector<int>(h*w, 0));
  rep(i, h*w){
    if(i%w != w-1 && v[i/w][i%w] == '.' && v[i/w][i%w+1] == '.'){
      d[i][i+1] = 1; d[i+1][i] = d[i][i+1];
    }
    if(i/w != h-1 && v[i/w][i%w] == '.' && v[i/w+1][i%w] == '.'){
      d[i][i+w] = 1; d[i+w][i] = d[i][i+w];
    }
  }
  bool b = 1;
  while(b){
    rep(i, h*w){
      if(v[i/w][i%w] == '#') continue;
      rep(j, h*w){
        rep(k, h*w){
          if(j == k) continue;
          else if(d[j][i] != 0 && d[i][k] != 0 && d[j][k] == 0){
            d[j][k] = d[j][i] + d[i][k]; d[k][j] = d[j][k];
          }
          else if(d[j][i] != 0 && d[i][k] != 0){
            d[j][k] = min(d[j][i] + d[i][k], d[j][k]); d[k][j] = d[j][k];
          }
        }
      }
    }
    rep(i, h*w){
      rep(j, h*w){
        if(v[i/w][i%w] == '.' && v[j/w][j%w] == '.' && i != j && d[i][j] == 0) break;
      }
      if(i == h*w-1) b = 0;
    }
  }
  rep(i, h*w){
    rep(j, h*w){
      m = max(m, d[i][j]);
    }
  }
  cout << m << endl;
  return 0;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pci pair<char, int>
#define pic pair<int, char>
#define plvl pair<long long, vector<long long> >
#define pcvc pair<char, vector<char> >
#define mod 1e9 + 7
#define newl "\n"

using namespace std;

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

template <typename T>
void show1(vector<T> dp) {
	for(auto d : dp) {
		cout << d << " ";
	}
	cout << "\n";
}

template <typename T>
void show2(vector<vector<T> > dp) {
	for(auto d : dp) {
		for(auto dd : d) {
			cout << dd << " ";
		}
		cout << "\n";
	}
}

bool isPal(string s) {
	for(ll i = 0 ; i < s.length() ; i++) {
		if(s[i] != s[s.length() - 1 - i]) {
			return false;
		}
	}
	return true;
}

void executeCode() {
	double n;
	cin >> n;
	cout << fixed << setprecision(12) << (pow(n, 3) / 27.0) << newl;
	return;
}

int main() {
	ios::sync_with_stdio(false);
    cin.tie(nullptr);
	int tt = 1;
	// cin >> tt;
	for(ll i = 1; i <= tt ; i++) {
	//	cout << "Case #" << i << ": ";
		executeCode();	
	}
	return 0;
}

Measured memory_bytes: 4208
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#pragma warning(disable : 4996)
using namespace std;
int N, Q, t[1000000], w[1000000], x; string s; vector<int> leader, ls;
int query(int x1, int x2) {
	return lower_bound(w, w + N, x2) - lower_bound(w, w + N, x1);
}
int check(int v) {
	int ret = 0;
	for (int i = 0; i < (int)ls.size() - 1; i++) ret += query(max(ls[i] + 1, ls[i + 1] - v), ls[i + 1] + 1);
	return ret + (ls.size() ? query(ls[0] - v, ls[0] + 1) : 0);
}
int main() {
	scanf("%d%d", &N, &Q);
	for (int i = 0; i < N; i++) scanf("%d", &t[i]), w[i] = t[i];
	sort(w, w + N);
	for (int i = 0; i < Q; i++) {
		cin >> s >> x;
		if (s == "ADD") leader.push_back(x - 1);
		if (s == "REMOVE") {
			for (int j = 0; j < leader.size(); j++) {
				if (leader[j] == x - 1) leader.erase(leader.begin() + j);
			}
		}
		if (s == "CHECK") {
			int l = -1, r = 1000000001; ls.clear();
			for (int j = 0; j < leader.size(); j++) ls.push_back(t[leader[j]]);
			sort(ls.begin(), ls.end());
			while (r - l > 1) {
				int m = (r + l) / 2, u = check(m);
				if (u >= N - x) r = m;
				else l = m;
			}
			if (r == 1000000001) printf("NA\n");
			else printf("%d\n", r);
		}
	}
	return 0;
}

Measured memory_bytes: 11100
// use proconio::marker::Chars;
use proconio::{fastout, input};
// use std::cmp::{max, min};

#[fastout]
fn main() {
    input! {
        n: usize,
        l: [usize; n]
    };

    let mut l: Vec<usize> = l;
    l.sort();

    if l.iter().sum::<usize>() > l.last().unwrap() * 2 {
        println!("Yes");
    } else {
        println!("No")
    }
}


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

int main(){
    int N, A[1000000], i, j;
    cin >> N;
    for(i = 2; i <=N; i++){
        cin >> j;
        A[j]++;
    }
    for(i = 1; i <= N; i++){
        cout << A[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 4388
#include <iostream>

using namespace std;

int main() {
    int n, ans = 0, prev = 0, cnt = 0;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        int a;
        cin >> a;
        if (a == prev) ++cnt;
        else {
            ans += (cnt + 1) / 2;
            cnt = 0;
        }
        prev = a;
    }
    ans += (cnt + 1) / 2;
    cout << ans << endl;
    return 0;
}


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

int main() {
  string ch;
  cin >> ch;
  if(ch == "a" || ch == "i" || ch == "u" || ch == "e" || ch == "o"){
  cout << "vowel" << endl;}
  else{
  cout << "consonant" << endl;}
}

Measured memory_bytes: 3628
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;

int main(){
	int A,B;
	cin>>A>>B;
	if(A==B)cout<<"Draw";
	else if(A==1)cout<<"Alice";
	else if(B==1)cout<<"Bob";
	else if(A>B)cout<<"Alice";
	else cout<<"Bob";
}

Measured memory_bytes: 256