akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int main(void) {
    int w, h, x, y, r;
    cin >> w >> h >> x >> y >> r;
    w -= r;
    h -= r;
    if (r <= x && r <= y && x <= w && y <= h) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 1160
sx, sy, tx, ty = map(int,input().split())

print("R" * (tx-sx) + "U" * (ty-sy), end="")
print("L" * (tx-sx) + "D" * (ty-sy), end="")
print("D" + "R" * (tx-sx+1) + "U" * (ty-sy+1) + "L", end="")
print("U" + "L" * (tx-sx+1) + "D" * (ty-sy+1) + "R", end="")

Measured memory_bytes: 3064
import sys
n = int(input())
A = [int(e)for e in sys.stdin]
cnt = 0
G = [int((2.15**i-1)/1.15)for i in range(19,1,-1)]+[1]
G = [v for v in G if v <= n]
def insertionSort(A, n, g):
    global cnt
    for i in range(g, n):
        v = A[i]
        j = i - g
        while j >= 0 and A[j] > v:
            A[j+g] = A[j]
            j = j - g
            cnt += 1
        A[j+g] = v
for g in G:
    insertionSort(A, n, g)
print(len(G))
print(*G)
print(cnt)
print(*A,sep='\n')


Measured memory_bytes: 53328
#include<iostream>
#include<string>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
if(a>=b && b>=c)cout<<b+c<<endl;
else if(a>=c && c>=b)cout<<b+c<<endl;
else if(b>=a && a>=c)cout<<a+c<<endl;
else if(b>=c && c>=a)cout<<a+c<<endl;
else if(c>=a && a>=b)cout<<b+a<<endl;
else if(c>=b && b>=a)cout<<b+a<<endl;

}

Measured memory_bytes: 256
n = gets.chomp
x = n.chars
for i in 0..x.length-1
    x[i]=x[i].to_i
end
#p x
a = x[0]*10+x[1]
b = x[2]*10+x[3]
#p a
#p b
cnt_a = 0
cnt_b = 0
if a <= 12 && a >= 1
    cnt_a = 1
end
if b <= 12 && b >= 1
    cnt_b = 1
end
#p cnt_a
#p cnt_b
if cnt_a==1&&cnt_b==1
    puts "AMBIGUOUS"
elsif cnt_a==0 &&cnt_b==1
    puts "YYMM"
elsif cnt_a==1&&cnt_b==0
    puts "MMYY"
else
    puts "NA"
end

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

#define ll long long int
#define pb push_back

int main()
{
    ll a,b,c,k,i;
    
    cin >> a>>b>>c>>k;
    
    if(a>=k)
    cout << k ;
    else if(a+b >= k)
    cout << a;
    else
    {
        cout << a-(k-(a+b));
    }
    
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
#define ll long long
#define linf 0x3f3f3f3f3f3f3f3fLL
using namespace std;
const int N = 1e5+5;
const ll mod = 1e9+7;
const ll INF = 1e18;
int head[N];
int ne;
struct edge{
	int to,nt,w;
}e[500004];
queue<int>q;
int dis[100004];
void spfa()
{
	memset(dis,127/3,sizeof(dis));
	dis[1]=0;
	while(!q.empty()){
		int x=q.front();q.pop();
		for(int i=head[x];i;i=e[i].nt){
			if( dis[e[i].to]>dis[x]+e[i].w){
				dis[e[i].to]=dis[x]+e[i].w;
				q.push(e[i].to);
			}
		}
	}
}
void add(int u,int v,int w){
	 e[++ne].to = v;e[ne].nt = head[u];
	 e[ne].w=w;
	 head[u]=ne;
}
 
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		add(i,(i+1)%n,1);
		add(i,(i*10)%n,0);
	}
	q.push(1);
	spfa();
	printf("%d\n",dis[0]+1);
 
	return 0;
}

Measured memory_bytes: 4864
from fractions import gcd
N = int(input())
A = list(map(int, input().split()))
gcdL = [0] * N
gcdR = [0] * N

gcdL[0] = A[0]
gcdR[-1] = A[-1]

if N == 2:
    print(max(A))
    exit()


for i in range(1, N):
    gcdL[i] = gcd(gcdL[i-1], A[i])
for i in range(1, N):
    gcdR[-i-1] = gcd(gcdR[-i], A[-i-1])

ans = gcdR[1]  # No 1
# print(ans)
for i in range(1, N-1):
    tmp = gcd(gcdL[i-1], gcdR[i+1])
    # print(tmp)
    ans = max(tmp, ans)
ans = max(ans, gcdL[-2])
# print(gcdL[-2])
print(ans)

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

int main() {
	int N;
	string S;
	cin >> N >> S;
	int cnt = 0;
	for (int i = 0; i < N-2; i++) {
		if (S[i] == 'A' && S[i+1] == 'B' && S[i+2] == 'C')
			cnt++;
	}
	cout << cnt << endl;
	return 0;
}


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

int main() {
    char x,y;
    cin >> x >> y;
    if(x < y) cout << "<";
    else if(x > y)cout << ">";
    else cout << "=";
}


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
    return string(1, val);
}

int main(){
  int x; cin >> x;
  
  if(x < 1200) {
    cout << "ABC" << endl;
  } else {
    cout << "ARC" << endl;
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<bitset>
#include<cctype>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<deque>
#include<list>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<queue>
#include<vector>
using namespace std;
 
int n, A[21];
 
//O(n^2)
int solve(int i, int m) {
    if (m == 0)return 1;
    if (i >= n)return 0;
    int res = solve(i + 1, m) || solve(i + 1, m - A[i]);
    return res;
}
 
int main() {
    cin >> n;
    for (int i = 0; i < n; i++)cin >> A[i];
    int q; cin >> q;
    for (int i = 0; i < q; i++) {
        int m; cin >> m;
        if (solve(0, m))
            cout << "yes" << endl;
        else
            cout << "no" << endl;
    }
    return 0;
}


Measured memory_bytes: 3088
import java.util.Scanner;

public class Main {

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

		int n, k, q;

		String[] sp = scanner.nextLine().split(" ");
		n = Integer.parseInt(sp[0]);
		k = Integer.parseInt(sp[1]);
		q = Integer.parseInt(sp[2]);

		int[] members = new int[n];
		for (int i = 0; i < n; i++) {
			members[i] = k;
		}

		int[] corrects = new int[q];
		for (int i = 0; i < q; i++) {
			corrects[i] = Integer.parseInt(scanner.nextLine());
		}
		scanner.close();

		for (int i = 0; i < q; i++) {
			members[corrects[i] - 1] = members[corrects[i] - 1] + 1;
			//			for (int j = 0; j < n; j++) {
//				if (j + 1 != corrects[i]) {
//					members[j] = members[j] - 1;
//				}
//			}
		}
		
		for (int i = 0; i < n; i++) {
			members[i] = members[i] - q;
		}


		for (int i = 0; i < n; i++) {
			if(members[i] <= 0) {
				System.out.println("No");
			} else {
				System.out.println("Yes");
			}
		}
	}
}

Measured memory_bytes: 97996
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
#define int long long
#define double long double
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 


////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////
string ss;int d, n;vector<int> s;
int dp[11000][2][100];
signed main(){
  cin>>ss>>d;n = ss.length();s.resize(n);
  rep(i,n)s[i] = (int)(ss[i] - '0');
  dp[0][1][s[0]%d] = 1;
  rep(i,10)if(i < s[0])dp[0][0][i%d] += 1;
  repd(i,1,n){
    rep(j,d){
      rep(k,10){
        dp[i][0][j] = (dp[i][0][j] + dp[i-1][0][(j+d*10-k)%d])%MOD;
        if(k < s[i])dp[i][0][j] = (dp[i][0][j] + dp[i-1][1][(j+d*10-k)%d])%MOD;
        if(k == s[i])dp[i][1][j] = (dp[i][1][j] + dp[i-1][1][(j+d*10-k)%d])%MOD;
      }
    }
  }
  cout << ((dp[n-1][0][0] + dp[n-1][1][0])%MOD + MOD -1)%MOD << endl;
}


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

long long GCD(long long x, long long y) {
    return y ? GCD(y, x%y) : x;
}
 
vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0;
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
        res.push_back({a, ex});
    }
    if (N != 1) res.push_back({N, 1});
    return res;
}

int main(){
    long long a,b;
    cin>>a>>b;
    auto pf=prime_factorize(GCD(a,b));
    cout<<pf.size()+1<<endl;
}

Measured memory_bytes: 3644
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<cassert>
#include<cassert>
#include<unordered_map>
#include<unordered_set>
#include<functional>
#include<queue>
#include<stack>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<sstream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<numeric>
#include<random>
#include<chrono>
#include<bitset>
using namespace std;

#define all(x) (x).begin(), (x).end()
#define pb push_back
#define xx first
#define yy second
#define sz(x) (int)(x).size()
#define gc getchar
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mp make_pair

#ifndef ONLINE_JUDGE
#  define LOG(x) (cerr << #x << " = " << (x) << endl)
#else
#  define LOG(x) ((void)0)
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const double PI=acos(-1);
const ll INF = 1LL<<62;
const ll MINF = -(1LL<<62);

template<typename T> T getint() {
	T val=0;
	char c;
	
	bool neg=false;
	while((c=gc()) && !(c>='0' && c<='9')) {
		neg|=c=='-';
	}

	do {
		val=(val*10)+c-'0';
	} while((c=gc()) && (c>='0' && c<='9'));

	return val*(neg?-1:1);
}

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); uniform_int_distribution<int>(0, n-1)(rng)c

const int MAXN=100001;
int par[MAXN], sz[MAXN];

void init() {
	memset(par, -1, sizeof par);
	for(int i=0;i<MAXN;++i) sz[i]=1;
}

int get(int x) {
	if(par[x]==-1) return x;
	return par[x]=get(par[x]);
}

void merge(int x, int y) {
	int px=get(x), py=get(y);
	
	if(px==py) return ;
	
	if(sz[px]>sz[py]) {
		swap(px, py);
		swap(x, y); //:) lyft
	}
	
	par[px]=py;
	sz[py]+=sz[px];
}




int main() {
	IO;
	int n,m;
	cin>>n>>m;
	init();
	for(int i=0;i<m;++i) {
		int a,b,c;
		cin>>a>>b>>c;
		merge(a,b);
	}
	int ans=0;
	for(int i=1;i<=n;++i) {
		ans+=get(i)==i;
	}
	
	cout<<ans<<"\n";
	return 0;
}


Measured memory_bytes: 4388
// ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
// ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
// [███████████████████].░░░░░░░░░░░░░░
// ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░

//PointBlank's code (⌐■_■)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
 
ll power(ll x, ll y); 
#define repp(I, A, B) for(int I = A; I <= B; I++)
#define rep(I, A, B) for(int I = A; I < B; I++)
#define rrep(I, B, A) for(int I = B; I >= A; I--)
#define pb emplace_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define LB lower_bound
#define UB upper_bound
#define MP make_pair
#define mem(A, B) memset(A, B, sizeof(A));
#define mem0(A) memset(A, 0, sizeof(A));
#define quickio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define bitcount(n) __builtin_popcountll(n)
#define in_edges(M) repp(I, 1, M){int A, B; cin >> A >> B; v[A].pb(B), v[B].pb(A);}
#define in_edges2(M) repp(I, 1, M){int A, B; cin >> A >> B; v[A].pb(B);}
#define endl "\n"

const ll MOD = 1000000007;
 
int main() //PointBlank's code ¯\_(ツ)_/¯
{
    int n;
    cin >> n;
    if(n % 1000 == 0) cout << 0;
    else cout << 1000 - n % 1000;
}

ll power(ll x, ll y)
{ 
    ll res = 1; x %= MOD;
    while(y > 0){if(y & 1) res = (res*x) % MOD; y = y>>1, x = (x*x) % MOD;} 
    return res; 
}

Measured memory_bytes: 3620
# -*- coding: utf-8 -*-
import numpy as np
inputs = np.array(input().split(), dtype = 'float')

diff = inputs.max() * 3 - inputs.sum()
if diff % 2 == 0:
    print(int(diff / 2.0))
else:
    print(int(np.floor(diff / 2.0)) + 2)


Measured memory_bytes: 21532
import java.util.Scanner;

public class Main {

	static final int INF=Integer.MAX_VALUE;			// 2147483647
	static final long LINF=Long.MAX_VALUE;			// 9223372036854775807

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int as[] = new int[n]; 
		for (int i=0; i<n; i++) {
			as[i] = sc.nextInt();
		}
		sc.close();
		
		int pair = 0;
		for (int i=0; i<n; i++) {
			if (as[as[i]-1] == i+1) {
				pair++;
			}
		}
		
		p(pair/2);
		
		
	}
	
	
	
	
	public static void p(Number a) {
		System.out.println(a);		
	}
	public static void p(String a) {
		System.out.println(a);		
	}
	public static void pn(Number a) {
		System.out.print(a);		
	}
	public static void pn(String a) {
		System.out.print(a);		
	}
	
	public static int powerInt(int a, int b) {
		return (int) Math.pow(a, b);
	}

	public static int max(int arr[]) {
		int max = arr[0];
		
		for (int i=0; i<arr.length; i++) {
			if (max < arr[i]) {
				max = arr[i];
			}
		}
		
		return max;
	}
	public static double max(double arr[]) {
		double max = arr[0];
		
		for (int i=0; i<arr.length; i++) {
			if (max < arr[i]) {
				max = arr[i];
			}
		}
		
		return max;
	}	
	public static int min(int arr[]) {
		int max = arr[0];
		
		for (int i=0; i<arr.length; i++) {
			if (max > arr[i]) {
				max = arr[i];
			}
		}
		
		return max;
	}
	public static double min(double arr[]) {
		double max = arr[0];
		
		for (int i=0; i<arr.length; i++) {
			if (max > arr[i]) {
				max = arr[i];
			}
		}
		
		return max;
	}	

}


Measured memory_bytes: 32092
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>

using namespace std;

int l_sosuu[10000000];
int flag[7400000];
int now;
int now2;
int now3;
int now4;
int m,n;
int flag2[7400000];

void sosuu(){
	l_sosuu[0] = 2;
	flag[0]=1;
	flag[1]=1;
	flag[2]=1;
	now = 1;
	now2 = 3;
	while(now2<7390000){
		if(flag[now2]==0){
			l_sosuu[now] = now2;
			now ++;
			for(int i=now2;i<7400000;i+=2*now2){
				flag[i] = 1;
			}
		}
		now2 +=2;
	}
}	




int main(){
	int b = 0;
	sosuu();
	while(1){
	b = 0;
	cin >> m >> n;
	if (m==0&&n==0) return 0;
	for(int i=0;i<7400000;i++) flag2[i] =0;
	int owari2 = l_sosuu[lower_bound(l_sosuu,l_sosuu+now,m)-l_sosuu-1];
	int owari = owari2 * owari2;
	now3=m;
	while(now3<=owari){
		if(flag2[now3]==0){
			n --;
			for(int i=now3;i<=owari;i+=now3){
				flag2[i] = 1;
			}
		}
		if(n==0){
			int a = l_sosuu[lower_bound(l_sosuu,l_sosuu+now,now3)-l_sosuu];
			while(flag2[a]==1) a++;
 			cout << a << endl;
			b=1;
			break;
		}
		now3 ++;
	}
	int owari3 = l_sosuu[lower_bound(l_sosuu,l_sosuu+now,owari)-l_sosuu+n];
	if(b==0)cout << owari3 << endl;
	}
}

Measured memory_bytes: 62832
#include<iostream>

#include<cmath>

using namespace std;

int main()

{

	int n,m;

	cin>>n>>m;

	for(int i=m/n;i>=1;i--)

	{

		if(m%i==0)

		{

			int t=m/i;

			if(t>=n)

			{

				cout<<i<<endl;

				break;

			}

		}

	}

}


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

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int h, w;
    cin >> h >> w;
    vs s(h);
    rep(i, h) cin >> s[i];
    ll ans = 0;
    vector<vi> dist(h, vi(w, INF));
    int num = 0;
    rep(i, h) rep(j, w) {
        if (dist[i][j] != INF) continue;
        queue<pii> q;
        q.emplace(i, j);
        dist[i][j] = num;
        vi cnt(2);
        if (s[i][j]=='.') cnt[0]++;
        else cnt[1]++;
        while (!q.empty()) {
            auto p = q.front(); q.pop();
            int y = p.first, x = p.second;
            char col = s[y][x];
            const vi dy = { -1, 0, 1, 0 }, dx = { 0, 1, 0, -1 };
            rep(i2, 4) {
                int ny = y + dy[i2], nx = x + dx[i2];
                if (ny<0||ny>=h||nx<0||nx>=w) continue;
                if (dist[ny][nx] != INF) continue;
                if (s[ny][nx] == col) continue;
                q.emplace(ny, nx);
                dist[ny][nx] = num;
                if (s[ny][nx]=='.') cnt[0]++;
                else cnt[1]++;
            }
        }
        ans += (ll)cnt[0] * cnt[1];
        ++num;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4436
import java.util.Scanner;

public class Main {
	
	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int i = 1;
		int x;
		while((x =sc.nextInt() )!= 0) {
			
				System.out.println("Case" + " " + i + ": " + x);
				i++;
		}
	}
}



Measured memory_bytes: 42120
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;

int board[20][20];
int main() {
    int N; cin >> N;

    fill(board[0], board[N], -1);
    for(int i=0; i<N; i++) {
        int K; cin >> K;
        for(int j=0; j<K; j++) {
            int x, y; cin >> x >> y;
            x--;
            board[i][x] = y;
        }
    }

    int ans = 0;
    for(int bit=0; bit<(1<<N); bit++) {
        bool ok = true;
        for(int i=0; i<N; i++) {
            int wi = (bit >> i & 1);
            for(int j=0; j<N; j++) {
                int wj = (bit >> j & 1);
                // 不明ならあてにならない
                if(wi == 0) continue;
                // 不明か、証言があっているか
                ok &= (board[i][j] == -1 or board[i][j] == wj);
            }
        }
        // fprintf(stderr, "bit = %d, ok = %d\n", bit, ok);
        if(ok) ans = max(ans, __builtin_popcount(bit));
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

#define all(v) v.begin(), v.end()

const ll mod=1000000007;

ll countBits(ll in){
  int res=0;
  for(;in>0;in>>=1){
    if((in&0x01)!=0){
      res++;
    }
  }
  return res;
}

template<typename T>
void show2dVector(vector<vector<T>>& v){
  for(int i=0;i<v.size();i++){
    int m=v[i].size();
    cout<<i<<" : ";
    for(int j=0;i<m;i++){
      cout<<v[i][j]<<" ";
    }
    cout<<endl;
  }
}

void bfs(const vector<vector<int>>&g, int v, vector<bool>& seen){
  seen[v]=true;
  cout<<v<<" ";
  for(auto next: g[v]){
    if(seen[next]){
      continue;
    }
    bfs(g,next,seen);
  }
}

bool dfs(vector<vector<int>> &g,int start,int goal,vector<bool>&seen){
  bool res=false;
  seen[start]=true;
  if(start==goal){
    return true;
  }
  for(auto next: g[start]){
    if(seen[next]){
      continue;
    }
    res=dfs(g,next,goal,seen);
    if(res){
      break;
    }
  }
  return res;
}

ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}

ll powm(ll a,ll n, ll m){
  ll ret=1;
  while(n>0){
    if(n%2==1){
      ret=(ret*a)%m;
    }
    n>>=1;
    a=(a*a)%m;
  }
  return ret;
}

const string yesno(bool ans){
  return (ans?"Yes":"No");
}
int main() {
  ll n,d;cin>>n>>d;
  ll ans=0;
  for(int i=0;i<n;i++){
    ll x,y;cin>>x>>y;
    if(x*x+y*y<=d*d){
      ans++;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3580
import math
def count(a, b, P):
    if abs(a-b) > 2:
        return 0
    if a == b:
        return 0
    m = (a+b)/2
    c = m + (m-a)*(math.sqrt(1-abs(m-a)**2))*1j/abs(m-a)
    cnt = 0
    for x in P:
        if abs(x-c) <=1.0001:
            cnt += 1
    return cnt

while True:
    N = int(input())
    if N == 0:
        break
    P = []
    for i in range(N):
        x, y = map(float, input().split())
        P.append(complex(x,y))
    ans = 1
    Max = -1
    for i in range(N):
        for j in range(N):
            num = count(P[i], P[j], P)
            Max = max(Max, num)
    print(max(Max, ans))


Measured memory_bytes: 5704
#include <bits/stdc++.h>
#include <cstdio>
#include <cstdlib>
 
#ifdef _MSC_VER
#include <Windows.h>
#else
#include <unistd.h>
#endif
 
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();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 
//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD=(LL)1e9+7;
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
#define INF 1LL << 50
 

int main(){
    LL N,K;
    cin>>N>>K;
    vector<LL>a(N),b(N+1),c(N+1);
    REP(i,N)cin>>a[i];
    b[0]=0;
    c[0]=0;
    REP(i,N){
        b[i+1]=b[i]+a[i];
        c[i+1]=c[i]+max(a[i],0LL);
    }
    LL res=0;
    REP(i,N-K+1){
        LL tmp1=max(b[i+K]-b[i],0LL);
        LL tmp2=c[i]+(c[N]-c[i+K]);
        //cout<<i<<" "<<tmp1<<" "<<tmp2<<endl;
        res=max(res,tmp1+tmp2);
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

int main(){
    int N;
    cin >> N;
    int D[100005];
    for(int i = 0; i < N; i++){
        cin >> D[i];
    }
    int ans = 0;
    sort(D, D + N);

    if(N % 2 == 0){
        if( D[N / 2 - 1] != (D[N / 2]) ){
            ans =  D[N / 2] - D[N / 2 - 1];
        } 
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
X = int(input())


def check_exist(X):
    for i in range(1, X + 1):
        start_point = i * 100
        end_point = i * 105
        for j in range(start_point, end_point + 1):
            if X == j:
                return True


if check_exist(X):
    print(1)
else:
    print(0)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>

void showVector(std::vector<int> readVec){
    int length = readVec.size();
    for(int i = 0; i < length; ++i){
        if(length - 1 != i){
            std::cout << readVec.at(i) << " ";
        }else{
            std::cout << readVec.at(i);
        }
    }
    
    std::cout << std::endl;
}

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

    std::vector<int> a(n);
    for(int i = 0; i < n; ++i){
        std::cin >> a.at(i);
    }

    bool flg = true;
    int i, j, tmp;
    int count = 0;
    while(flg){
        flg = 0;
        for(i = n - 1; 1 <= i; --i){
            if(a.at(i) < a.at(i - 1)){
                a.at(i) += a.at(i - 1);
                a.at(i - 1) = a.at(i) - a.at(i - 1);
                a.at(i) = a.at(i) - a.at(i - 1);
                flg = true;
                ++count;
            }
        }
    }
    
    showVector(a);    
    std::cout << count << std::endl;

    return 0;
}



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

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

int main()
{
	int A, B, K;

	scanf("%d %d %d", &A, &B, &K);

	int gcd = euclid(A, B);
	int counter = 0;
	int i;

	for ( i = 1; i <= gcd; i++)
	{
		if (gcd%i == 0)
		{
			counter++;
			if (counter == K)
			{
				printf("%d", gcd / i);
				return 0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
	long N, M;
	cin >> N >> M;

	long ans = 0;
	if (2 * N < M) {
		ans += N;
		M -= 2 * N;
		N = 0;
	} else {
		ans += M / 2;
		M = 0;
	}

	ans += M / 4;

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>

#include <list>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define YES(j) cout << (j ? "YES" : "NO") << endl;
#define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
#define yes(j) std::cout << (j ? "yes" : "no") << endl;
typedef long long ll;
const ll MOD = 1'000'000'007;
ll mod_powe(ll x, ll n, ll mod)
{
    ll res = 1;
    while (n > 0)
    {
        if (n & 1)
            res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}
int main(void)
{
    ll n, m;
    cin >> n >> m;

    if (max(n, m) - min(n, m) >= 2)
    {
        cout << "0" << endl;
        return 0;
    }

    ll comb[200100];
    ll combr[200100];

    comb[0] = combr[0] = 1;

    rep(i, 1, 200100)
    {
        comb[i] = comb[i - 1] * i % MOD;
        combr[i] = combr[i - 1] * mod_powe(i, MOD - 2, MOD) % MOD;
    }
    long long ans = 1;

    ans *= comb[n];
    ans = (ans * comb[m]) % MOD;
    if (n == m)
        ans = (ans * 2) % MOD;

    cout << ans << endl;
}

Measured memory_bytes: 1792
use proconio::{input, fastout};

#[fastout]
fn main() {
    input!{
        s: String
    };
    let w = ["Sunny", "Cloudy", "Rainy"];
    for i in 0..w.len() {
        if s == w[i] {
            println!("{}", w[(i + 1) % 3]);
            break
        }
    }

}


Measured memory_bytes: 2084
#include <iostream>
using namespace std;
int a, b, c;
int main() {
  cin >> a >> b >> c;
  if (a == 7 && b == 5 && c == 5)
    cout << "YES" << endl;
  else if (a == 5 && b == 7 && c == 5)
    cout << "YES" << endl;
  else if (a == 5 && b == 5 && c == 7)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>
#include <stack>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << endl; }
}

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

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define sz(x) (ll)(x).size()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;
typedef vector<ll> vl;
typedef vector<P> vp;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  //cout << setprecision(10) << fixed;

  ll n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) {
    cin >> a[i];
  }

  unordered_map<ll,ll> vs;
  rep(i,n) {
    ++vs[a[i]];
  }
  // printmap(vs);

  ll ans = 0;
  rep(i,n) {
    --vs[a[i]];
    // if (vs[a[i]] == 0) { // reach to 0
    //   vs.erase(a[i]);
    // }

    bool found = false;
    // set<ll> divs;
    {
      ll j = 1;
      while (j*j <= a[i]) {
        if (a[i] % j == 0) {
          // Chekc i and v/i
          if (vs.find(j) != vs.end() && vs[j] != 0) {
            found = true;
            break;
          }
          if (vs.find(a[i]/j) != vs.end() && vs[a[i]/j] != 0) {
            found = true;
            break;
          }
          // divs.insert(j);
          // divs.insert(a[i]/j);
        }
        ++j;
      }
    }
    // Here, divs has all divisors
    // printvec(divs);

    // bool found = false;
    // for (ll v : divs) {
    //   if (vs.find(v) != vs.end() && vs[v] != 0) {
    //     found = true;
    //   }
    // }
    if (!found) { // not divisoble
      ++ans;
    }

    ++vs[a[i]];
  }

  cout << ans << endl;
}


Measured memory_bytes: 12996
#include <iostream>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <iomanip>
#include <fstream>
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = (1 << 30);
const ll inf = (1LL << 60LL);
const int maxn = 3e5 + 10;
ll n, m;
int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    cin >> n >> m;
    if(n == m){
        return 0 * printf("1\n");
    }
    ll ret = 0;
    for(ll i = 1; i * i <= m; i ++){
        if(m % i == 0){
            if(m / i >= n){
                ret = max(ret, i);
            }
            if(i != m / i){
                if(m / (m / i) >= n){
                    ret = max(ret, m / i);
                }
            }
        }
    }
    cout << ret << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
using ll = long long;
int MOD = 1e9 + 7;
using namespace std;
ll GCD(ll x, ll y)
{
    if (y == 0)
    {
        return x;
    }
    else
    {
        return GCD(y, x % y);
    }
}
ll LCM(ll x, ll y)
{
    return x / GCD(x, y) * y;
}
struct UnionFind
{
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N)
    { //最初は全てが根であるとして初期化
        for (int i = 0; i < N; i++)
            par[i] = i;
    }

    int root(int x)
    { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x)
            return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y)
    {                     // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry)
            return;   //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y)
    { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};
//使い方　インスタンス化(頂点数)　uniteつなぐ(双方向注意) same判定
int main()
{
    int n;
    cin >> n;
    set<int> se;
    int k = 0;
    for(int i=0;i<n;i++){
        int x;
        cin >> x;
        x /= 400;
        if(x>=8){
            k++;
            continue;
        }
        se.insert(x);
    }
    if(se.size()==0){
        cout << 1 << " ";
    }else{
        cout <<se.size() << " ";
    }
    cout << k + (int)se.size() << endl;
}


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

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

    static class AABCSwap {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            out.println(c + " " + a + " " + b);
        }

    }

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

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

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

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



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

N = int(input().strip())
A_list = list(map(int, input().rstrip().split()))
#-----

S=0
for i in range( len(A_list) ):
    if i==0:
        S = abs(A_list[i])
    else:
        S += abs(A_list[i] - A_list[i-1])
        
S += abs(A_list[i])


ans_S=[]
for i in range( len(A_list) ):
    if i == 0:
        ex_S = S - abs(A_list[i+1] - A_list[i]) - abs(A_list[i] - 0) + abs(A_list[i+1] - 0)
    elif i == len(A_list)-1:
        ex_S = S - abs(0 - A_list[i]) - abs(A_list[i] - A_list[i-1]) + abs(0 - A_list[i-1])
    else:
        ex_S = S - abs(A_list[i+1] - A_list[i]) - abs(A_list[i] - A_list[i-1]) + abs(A_list[i+1] - A_list[i-1])
    
    ans_S.append(ex_S)


for i in ans_S:
    print(i)


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

int main() {
    int n;
    cin >> n;
    vector<int> l(n);
    for(int i = 0; i < n; i++) {
        cin >> l.at(i);
    }
    sort(l.begin(), l.end(), greater<int>());

    int ans = 0;
    for(int i = 0; i < n - 2; i++) {
        int longest = l.at(i);
        for(int j = i + 1; j < n - 1; j++) {
            int diff = l.at(i) - l.at(j);
            if(diff >= l.at(j + 1)) {
                break;
            }
            for(int k = j + 1; k < n; k++) {
                if(diff < l.at(k)) {
                    ans++;
                } else {
                    break;
                }
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
    while(1){
        int sum = 0;
        int n;
        cin >> sum;
        if(sum == 0) break;
        for(int i = 0; i < 9; i++){
            cin >> n;
            sum -= n;
        }
        cout << sum << endl;
    }
	return 0;
}

Measured memory_bytes: 1160
# input
n = int(input())
as_ = tuple(int(i) for i in input().split())

# whether the number of negative number is even/odd
# First, calc absolute sum of all element
maxb = sum(abs(a) for a in as_)

# when even negative number
if [a < 0 for a in as_].count(True) % 2 == 0:
    # all element can be positive
    pass
else:
    # all element can be positive, except one element
    smallest = min(abs(a) for a in as_)
    maxb -= smallest * 2

print(maxb)


Measured memory_bytes: 14412
s = input()

if s == 'SUN':
    print(7)
elif s == 'MON':
    print(6)
elif s == 'TUE':
    print(5)
elif s == 'WED':
    print(4)
elif s == 'THU':
    print(3)
elif s == 'FRI':
    print(2)
else:
    print(1)

Measured memory_bytes: 61796
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
#include <deque>
 
// author:Swastik Banerjee
 
using namespace std;
 
typedef long long ll;
#define MOD 1000000007
 
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
 

 
 
  ll a,b; cin>>a>>b;
  if(a==b)
    cout<<"Yes\n";
  else
    cout<<"No\n";



  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    char ch;
    cin>>ch;
    if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u'){
        cout<<"vowel"<<endl;
    }
    else cout<<"consonant"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll elem[205000];
vector<char>ans;
int main()
{
   ll n,sum=0;
   cin>>n;
   for(ll i=0;i<n;i++)
   {
       cin>>elem[i];
       sum^=elem[i];

   }
   for(ll i=0;i<n;i++)
   {
       if(i!=n)
       cout<<(sum^elem[i])<<" ";
       else
        cout<<(sum^elem[i]);
   }

}


Measured memory_bytes: 5152
#include <bits/stdc++.h>
// #include <limits>
//auto std::numeric_limits<float>::infinity() { return __builtin_huge_valf(); }
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)

int main()
{
    //A
    /*
    string S;
    cin >> S;
    if (S == "AAA" || S == "BBB")
        cout << "No" << endl;
    else
        cout << "Yes" << endl;
        */
    //B
    /*
    long long N, A, B, C;
    cin >> N >> A >> B;
    //この事前の条件分岐はいらない
    if (N <= A)
        cout << N << endl;
    else if (A == 0)
        cout << 0 << endl;
    else
    {
    C = N % (A + B);
    cout << N / (A + B) * A + min(C, A);
     }
*/
    //C
    /*
    int A, B;
    cin >> A >> B;
    float c;
    c = A / 0.08;
    if ((int)(10 * c) % 10 == 0)
    {
        if (floor(c * 0.1) == B)
        {
            cout << (int)c << endl;
        }
        else
            cout << -1 << endl;
    }
    else
    {
        if (floor((c + 1) * 0.1) == B)
            cout << (int)c << endl;
        else
            cout << -1 << endl;
    }
    */
    //Cやり直し
    /*
    int A, B;
    cin >> A >> B;
    for (int i = 1; i <= 1009; i++)
    {
        if (int(i * 0.08) == A && int(i * 0.1) == B)//intの対象を()でくくるように
        {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    */
    //D
    string s;
    cin >> s;
    int q;
    cin >> q;
    int flg = 1;
    deque<char> d;
    rep(i, 0, s.length()) d.push_back(s[i]);
    rep(i, 0, q)
    {
        int t;
        cin >> t;
        if (t == 1)
        {
            flg *= -1; //dの反転操作はdの頭か尻かを区別すれば特にやる必要ない
        }
        else
        {
            int f;
            char c;
            cin >> f >> c;
            if (f == 1)
            {
                if (flg == 1)
                    d.push_front(c);
                else
                    d.push_back(c);
            }
            else
            {
                if (flg == 1)
                    d.push_back(c);
                else
                    d.push_front(c);
            }
        }
    }
    if (flg == 1)
        rep(i, 0, d.size()) cout << d.at(i);
    else
    {
        for (int i = d.size() - 1; i >= 0; i--)
            cout << d.at(i);
    }
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ll long long
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(i, n) for(int i=0; i<=n; i++)
#define repr(i, n) for(int i=n; i>0; i--)
#define REPR(i, n) for(int i=n; i>=0; i--)
const ll INF = 1e18;
const int INT_INF = 1e9;
const ll MOD = 1e9+7;
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; }
using namespace std;

int n, k, h;

int main() {
    cin >> n >> k;
    int ans = 0;
    rep(i, n) {
        cin >> h;
        if (h>=k) ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
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;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll N;
    cin >>N;
    map<ll,ll>m;
    ll ans=0;
    rep(i,N){
        ll a;
        cin>>a;
        if(m[a]==0){
            ans++;
            m[a]=1;
        }else{
            ans--;
            m[a]=0;
        }
    }
    cout << ans << endl;


    return 0;
    

}

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

P f(int n){
  int a = n%10;
  int b = n;
  while(b>9) b /= 10;
  return P(a, b);
}

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


Measured memory_bytes: 256
import sys
INF = float('inf')
MOD = 10**9 + 7
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 1
is_pos = 0
for ai in A:
    if ai > 0:
        is_pos += 1
if is_pos == 0 and K % 2 == 1:
    sortA = sorted(A, key=abs)    
    for ai in sortA[:K]:
        ans = (ans * ai) % MOD
    print(ans)
    sys.exit()
        
sortA = sorted(A, reverse=True, key=abs)
pos_list = [0]
neg_list = [0]
for ai in sortA[:K]:
    if ai < 0:
        neg_list += [ai]
    elif ai > 0:
        pos_list += [ai]
    else:
        print(0)
        sys.exit()
# first_pos = 0
# first_neg = 0
first_pos = INF
first_neg = INF
for i in range(K, N):
    if sortA[i] > 0 and first_pos == INF:
        first_pos = sortA[i]
    elif sortA[i] < 0 and first_neg == INF:
        first_neg = sortA[i]
len_pos = len(pos_list)
len_neg = len(neg_list)
if len_pos == 1:
    if len_neg % 2 == 1:
        for i in range(1, len_neg):
            ans = (ans * neg_list[i]) % MOD
    else:
        ans = ans * first_pos
        for i in range(1, len_neg-1):
            ans = (ans * neg_list[i]) % MOD
    print(ans)
    sys.exit()
if len_neg % 2 == 1 or K==N:
    for i in range(1, len_pos):
        ans = (ans * pos_list[i]) % MOD
    for i in range(1, len_neg):
        ans = (ans * neg_list[i]) % MOD
    print(ans)
    sys.exit()
# print(first_neg, first_pos)
if first_neg == INF and first_pos == INF:
    print(0)
    sys.exit()
if first_neg == INF:
    ans = (ans * first_pos) % MOD
    for i in range(1, len_pos):
        ans = (ans * pos_list[i]) % MOD
    for i in range(1, len_neg-1):
        ans = (ans * neg_list[i]) % MOD
    print(ans)
    sys.exit()
if first_pos == INF:
    ans = (ans * first_neg) % MOD
    for i in range(1, len_pos-1):
        ans = (ans * pos_list[i]) % MOD
    for i in range(1, len_neg):
        ans = (ans * neg_list[i]) % MOD
    print(ans)
    sys.exit()
pos2 = abs(pos_list[-1] * first_pos)
neg2 = abs(neg_list[-1] * first_neg)
if pos2 > neg2:
    ans = (ans * first_pos) % MOD
    for i in range(1, len_pos):
        ans = (ans * pos_list[i]) % MOD
    for i in range(1, len_neg-1):
        ans = (ans * neg_list[i]) % MOD
else:
    ans = (ans * first_neg) % MOD
    for i in range(1, len_pos-1):
        ans = (ans * pos_list[i]) % MOD
    for i in range(1, len_neg):
        ans = (ans * neg_list[i]) % MOD
print(ans)

Measured memory_bytes: 113268
#include <stdio.h>
#include <string.h>

int main() {
	int i,N,acc=0,wac=0,tlec=0,rec=0;
	char C[4];
	scanf("%d", &N);
	for (i = 0; i < N; i++) {
		scanf("%s", &C);
		if (strcmp(C, "AC") == 0){
			acc = acc + 1;
		}
		else if (strcmp(C, "WA") == 0) {
			wac = wac + 1;
		}
		else if (strcmp(C, "TLE") == 0) {
			tlec = tlec + 1;
		}
		else if (strcmp(C, "RE") == 0) {
			rec = rec + 1;
		}
	}
	printf("AC x %d\n", acc);
	printf("WA x %d\n", wac);
	printf("TLE x %d\n", tlec);
	printf("RE x %d\n", rec);
	return 0;
}

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

int main() {
  char c;
  cin >> c;
  string v = "aeiou";
  int f=0;
  
  for (int i=0; i<5; i++) {
    if (c == v.at(i)) {
      f=1;
      break;
    }
  }
  if (f==1) 
    cout << "vowel" << endl;
  else 
    cout << "consonant" << endl;
}

     

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class AStationAndBus {
        public void solve(int testNumber, inputClass sc, PrintWriter out) {
            String s = sc.nextLine();
            int a = 0, b = 0;
            for (int i = 0; i < 3; i++) {
                if (s.charAt(i) == 'A')
                    a++;
                else
                    b++;
            }
            if (a == 3 || b == 3) {
                out.println("No");
            } else {
                out.println("Yes");
            }
        }

    }

    static class inputClass {
        BufferedReader br;

        public inputClass(InputStream in) {

            br = new BufferedReader(new InputStreamReader(in));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}



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

int main(){
  int A, B;
  char op;
  cin>>A>>op>>B;
  int ans;
  if(op=='+'){
    ans = A+B;
  }
  else{
    ans = A-B;
  }
  cout<<ans<<endl;
}

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

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int nr,v[2001],n;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>v[i];
    for(int i=2;i<n;i++)
        if((v[i]>v[i-1]&&v[i]<v[i+1])||(v[i]<v[i-1]&&v[i]>v[i+1]))
            nr++;
    cout<<nr;
    return 0;
}


Measured memory_bytes: 256