akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000001
using namespace std;

int main(){

	int table[26],num_KI = 0;
	char buf[1001];

	for(int i = 0; i < 26; i++)table[i] = 0;

	scanf("%s",buf);
	for(int i = 0; buf[i] != '\0'; i++){
		table[buf[i]-'a']++;
	}

	for(int i = 0; i < 26; i++){
		if(table[i]%2 == 1)num_KI++;
	}

	if(num_KI%2 == 0){
		printf("%d\n",num_KI/2);
	}else{
		printf("%d\n",(num_KI-1)/2);
	}

	return 0;
}

Measured memory_bytes: 2744
#import numpy as np
#import math

X, N = map(int, input().split())
if N != 0:
    P = list(map(int, input().split()))
    # a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
    # c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
    # s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき
    
    #K = int(input())
    #S = input()
    
    ##一次元配列の初期化
    #a=[0]*5
    #[i for i in range(100) if i%2==1] #奇数のみ
    ##二次元配列の初期化
    #[[float("inf") for i in range(N)] for i in range(N)]
    
    for diff in range(0,102):
        if X-diff not in P:
            print(X-diff)
            break
        elif X+diff not in P:
            print(X+diff)
            break
else:
    print(X)

Measured memory_bytes: 9172
#include<iostream>
#include <stdio.h>
#include<string.h>
typedef long long ll;
using namespace std;
char s[100];
ll a[100];
int len;
ll result;
void dfs(int n, ll sum, int cnt) {
	if (n == len) {
		a[cnt] = sum;
		for (int i = 1; i <= cnt; i++)
			result += a[i];
		return;
	}
	a[cnt] = sum;
	dfs(n + 1, s[n] - '0', cnt + 1);
	if(sum)dfs(n + 1, sum * 10 + s[n] - '0', cnt);
}
int main()
{
	cin >> s;
	len = strlen(s);
	dfs(0, 0, 0);
	printf("%lld\n", result);
	return 0;
}

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

if N >= 64:
  print(64)
elif 32 <= N < 64:
  print(32)
elif 16 <= N < 32:
  print(16)
elif 8 <= N < 16:
  print(8)
elif 4 <= N < 8:
  print(4)
elif 2 <= N < 4:
  print(2)
else:
  print(1)

Measured memory_bytes: 3060
#include<cstdlib>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<cstring>
using namespace std;
const int MAXN = (int) 105;
const int INF = (int) 0x3f3f3f3f;
typedef long long LL;

int M,N,Z;
int edgefrom[MAXN],edgeto[MAXN];
vector<pair<int,int> > G[MAXN];

struct Matrix{
    int a[MAXN][MAXN];
}a,mp;

Matrix Matrix_Multiply(const Matrix& L, const Matrix& R,int siz){
    Matrix ret;
    memset(ret.a,0,sizeof(ret.a));
    for(int i=1;i<=siz;i++){
        for(int j=1;j<=siz;j++){
            for(int k=1;k<=siz;k++){
                ret.a[i][k] |= L.a[i][j]&R.a[j][k];
            }
        }
    }
    return ret;
}

void Power(int matrix_size,int X){
    while(X){
        if(X&1) a=Matrix_Multiply(a,mp,matrix_size);
        mp=Matrix_Multiply(mp,mp,matrix_size);
        X>>=1;
    }
}

void work(){
    while(~scanf("%d%d%d",&N,&M,&Z)){
        if(N==0&&M==0&&Z==0) return;
        int edgeid=0;
        for(int i=1;i<=N;i++) G[i].clear();
        for(int i=1;i<=M;i++){
            int u,v; scanf("%d%d",&u,&v);
            G[u].push_back(make_pair(v,++edgeid));
            edgefrom[edgeid]=u;
            edgeto[edgeid]=v;
            G[v].push_back(make_pair(u,++edgeid));
            edgefrom[edgeid]=v;
            edgeto[edgeid]=u;
        }
        memset(a.a,0,sizeof(a.a));
        memset(mp.a,0,sizeof(mp.a));
        for(int i=1;i<=N;i++){
            for(int j=0;j<G[i].size();j++){
                int to=G[i][j].first;
                int now_id=G[i][j].second;
                for(int k=0;k<G[to].size();k++){
                    int to_to=G[to][k].first;
                    int next_id=G[to][k].second;
                    if(to_to!=i){
                        mp.a[now_id][next_id]=1;
//                        printf("%d->%d->%d %d -> %d\n",i,to,to_to,now_id,next_id);
                    }
                }
            }
        }
        for(int i=1;i<=edgeid;i++)if(edgefrom[i]==1)
            for(int j=1;j<=edgeid;j++) a.a[j][i]=1;
        Power(edgeid,Z-1);
        int ok=0;
        for(int i=1;i<=edgeid;i++){
            for(int j=1;j<=edgeid;j++){
                if(a.a[i][j]&&edgeto[j]==N) ok=1;
            }
        }
        if(ok) printf("yes\n");
        else printf("no\n");
    }
}

int main(){
//    freopen("data.in","r",stdin);
    work();
    return 0;
}



/*
8 8 6
1 2
2 3
2 4
3 5
5 6
6 7
7 8
4 8
*/








Measured memory_bytes: 3184
// AOJ 1079 Cosmic Market
// 2018.2.3 bal4u

#include <stdio.h>
#include <string.h>

int a[50001], b[50001], ord[50001];
char mk[2][50001];

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

int in1()
{
	int c = getchar_unlocked() & 1;
	getchar_unlocked();
	return c;
}

int main()
{
	int R, C, Q, i, r, c, t, ans;

	while (R = in()) {
		C = in(), Q = in();
		for (i = 0; i < Q; i++)	a[i] = in1(), b[i] = in(), ord[i] = in1();

		memset(mk, 0, sizeof(mk));
		ans = 0; r = c = 0;
		i = Q; while (i--) {
			t = b[i];
			if (a[i]) {
				if (mk[0][t]) continue;
				mk[0][t] = 1;
				if (ord[i]) ans += R - r;
				c++;
			} else {
				if (mk[1][t]) continue;
				mk[1][t] = 1;
				if (ord[i]) ans += C - c;
				r++;
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}


Measured memory_bytes: 2332
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<map> 
#include<set> 
using namespace std;
#define mid 1000000007
#include <stdio.h>
int c[500006],book[500006];
int main(){
	int a,b,i,e,f,sum=0;
	cin>>a>>b;
	for(i=1;i<=a;i++)cin>>c[i];
	while(b--){
		cin>>e>>f;
		if(c[e]<c[f]){
		if(book[e]!=1){
		book[e]=1;
		sum++;
		}
	}
		else if(c[e]>c[f]){
		if(book[f]!=1){
		book[f]=1;
		sum++;
		}	
	}
		else{
		if(book[e]!=1){
			book[e]=1;
			sum++;
		}
		if(book[f]!=1){
			book[f]=1;
			sum++;
		}
	}
}
	cout<<a-sum;
	return 0;
}

Measured memory_bytes: 4408
using System;
using System.Linq;
using System.Collections.Generic;
namespace AtCoder
{
	class Programs
	{
		static void Main ()
		{
			var nx = Array.ConvertAll (Console.ReadLine ().Split (), int.Parse);
			var x = Array.ConvertAll (Console.ReadLine ().Split (), int.Parse);
			var dist = new List<int> ();
			for (int i = 0; i < x.Length; i++) {
				dist.Add((int)Math.Abs (x[i] - nx [1]));
			}
			int D = dist [0];
			for (int i = 0; i < dist.Count (); i++) {
				D = gcd (dist [i], D);
			}
			Console.WriteLine (D);
		}
		public static int gcd(int a, int b)
		{
			if (a < b)
				return gcd (b, a);
			while (b > 0) {
				int temp = a % b;
				a = b;
				b = temp;
			}
			return a;
		}
	}
}

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




int main(){
  while(1){
  
  int a,b,c,d;
  int x=0;
  cin>>a>>b>>c>>d;

  if(a==0 && b==0 && c==0 && d==0){break;}
  
  c=b*c;
  while(a<c){
    a+=d;
    x++;
  }

  cout<<x<<endl;
  
  }
    
  return 0;
}



Measured memory_bytes: 2988
//abc100_d.cpp
//Sat Jun 16 21:21:02 2018

#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std;
using ll=long long;



int main(){
	int n,m;
	cin >> n >> m;
	ll x[n],y[n],z[n];

	for (int i=0;i<n;i++){
		cin >> x[i] >> y[i] >> z[i];
	}

	ll ans = 0;
	for (int i=-1;i<=1;i++){
		for (int j=-1;j<=1;j++){
			for (int k=-1;k<=1;k++){
				ll total[n];
				for (int a=0;a<n;a++){
					total[a] = x[a]*i+y[a]*j+z[a]*k;
				}
				sort(total,total+n);
				ll candidate = 0;
				for (int a=0;a<m;a++){
					candidate += total[a];
				}
//				cout << i << " " << j << " " << k << " " << candidate << " " << ans << endl; 
				if (abs(candidate) > ans){
					ans = abs(candidate);
				}
				k++;
			}
			j++;
		}
		i++;
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int dp[35][101010];
int ans[101010];
signed main() {
    string S;
    cin >> S;
    int N = S.size();
    for(int i = 0; i < N; i++) {
        if(S[i] == 'R') {
            dp[0][i] = i+1;
        }
        else {
            dp[0][i] = i-1;
        }
    }
    for(int i = 0; i < 32; i++) {
        for(int j = 0; j < N; j++) {
            dp[i+1][j] = dp[i][dp[i][j]];
        }
    }
    for(int i = 0; i < N; i++) {
        ans[dp[32][i]]++;
    }
    for(int i = 0; i < N; i++) {
        if(i) {
            cout << " ";
        }
        cout << ans[i];
    }
    cout << endl;
}

Measured memory_bytes: 30456
#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
#include <functional>

using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define SORT(v) sort(ALL(v))
//#define scanf scanf_s


int main()
{
	int a, l;
	while (cin >> a >> l, l)
	{
		map<int, int> used;
		used[a] = 0;
		int cnt = 1;
		while (true)
		{
			string s = to_string(a);
			vector<int> v;
			REP(i, s.size()) v.push_back(s[i]-'0');
			while (v.size() != l) v.push_back(0);
			SORT(v);
			int min = 0; int max = 0;
			int t = 1;
			REP(i, l)
			{
				max += v[i] * t;
				t *= 10;
			}
			t = 1;
			REP(i, l)
			{
				min += v[l - i - 1] * t;
				t *= 10;
			}
			a = max - min;
			if (used.find(a) == used.end()) used[a] = cnt;
			else
			{
				cout << used[a] << " " << a << " " << cnt - used[a] << endl;
				break;
			}
			cnt++;
		}
	}
	return 0;
}

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

int main() {
    int n,sum=0;
    cin>>n;
    int arr[n];
    for(int x=0; x<n; x++) {cin>>arr[x] ;}
    for(int x=0; x<n; x++) {sum+=arr[x] ;}
    cout<<sum-n<<endl;
    return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    if(a <b && b<c) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}


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

#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,x,n) for(int i=x; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back

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

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 (a>b) { a=b; return 1; } return 0; }

template<class A, size_t N, class T> void Fill(A (&a)[N], const T &v){ fill( (T*)a, (T*)(a+N), v ); }

const ll INF = 1e9+7;


int l[500005]={};
int r[500005]={};
int dp[500005][3]={};  // 0:何もしてない 1:左へ行った 2:右へ行った
int main(){
	//ios_base::sync_with_stdio(0);
	int N, ans=0;
	string s;

	cin >> N >> s;

	l[0] = -1;
	rep(i,N-1){
		if( s[i] == '0' ) l[i+1] = i;
		else l[i+1] = l[i];
	}
	r[N-1] = -1;
	rrep(i,N-1){
		if( s[i+1] == '0' ) r[i] = i+1;
		else r[i] = r[i+1];
	}

	rep(i,N) rep(k,3){
		if(i && i < N-1 && s[i] == '0' && s[i-1] == '1' && s[i+1] == '1'){
			// 左へ
			if( l[i] >= 0 ){
				int j = l[i];
				chmax(dp[i][1], dp[j][0] + i-j-1);
				chmax(dp[i][1], dp[j][1] + i-j-2);
				chmax(dp[i][1], dp[j][2] + i-j-1);
			}else{
				chmax(dp[i][1], i);
			}
			// 右へ
			int j;
			if( r[i] >= 0 ) j = r[i];
			else j = N;
			if( i >= 2 ){
				chmax(dp[j][2]  , dp[i-2][0] + j-i-1);
				chmax(dp[j][2]  , dp[i-2][2] + j-i-1);
				chmax(dp[j-2][0], dp[i-2][0] + j-i-2);
				chmax(dp[j-2][0], dp[i-2][2] + j-i-2);
			}else{
				chmax(dp[j][2]  , dp[i][0] + j-i-1);
				chmax(dp[j-2][0], dp[i][0] + j-i-2);
			}
		}
		chmax(dp[i+1][0], dp[i][k]);
	}
	//	rep(i,N+1){
	//		cout << s[i] << ":\t";
	//		rep(k,3) cout << dp[i][k] << "\t";
	//		cout << endl;
	//	}

	rep(k,3) chmax(ans, dp[N][k]);
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 10628
#include <bits/stdc++.h>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,LL> PL;

const int MOD=1000000007;
int INF=100100100;
int main(){
  int a,b;cin>>a>>b;
  if(a%2==1 && b%2==1)cout<<"Odd"<<endl;
  else cout<<"Even"<<endl;  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();


int main() {
    int n, a;
    cin >> n >> a;
    vector<int> arr(n, 0);
    for(int& val: arr)
        cin >> val;
    map<pair<int, int>, ll> dp;
    int mx = n*a;
    dp[{0, 0}] = 1; // item_num, val
    for(int val: arr) {
        map<pair<int, int>, ll> new_dp;
        for(auto p: dp) {
            int item_num = p.first.first;
            int v2 = p.first.second;
            if (val + v2 <= mx) {
                new_dp[{item_num+1, val + v2}] += p.second;
            }
        }
        for(auto p: dp) {
            new_dp[{p.first.first, p.first.second}] += p.second;;
        }
        new_dp.swap(dp);
    }
    ll ans = 0;
    for(int i = 1; i <= n; i++) {
        ans += dp[{i, i*a}];
        // cout << dp[{i, i*a}] << endl;
    }
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 2816
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
/*
 * 最大公約数を求める
 * ユークリッドの互除法
 * bの方が必ず大きいとする
 */
long long euclid(vector<long long> v){
	int j;
	/*
	 * リストは最初昇順に並んでる
	 * 値が一番小さいもので割り切れるかどうかを試す
	 * 項には余りを突っ込む
	 * jは配列の中身が0でない最初の番号
	 */
	j = 0;
	while (j != v.size()-1) {
		for (size_t i = j+1; i < v.size(); i++) {
			v[i] = v[i] % v[j];
		}
		sort(v.begin()+j, v.end());
		while (v[j] == 0) {
			j++;
		}
	}
	return v[j];
}

int main(int argc, char const *argv[]) {
	int n;
	long long k,temp;
	vector<long long> v;

	cin >> n >> k;

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

	// そーと
	sort(v.begin(), v.end());

	// A_1 ~ A_nの最大公約数
	long long x = euclid(v);

	if (k % x != 0 || k > v.back()) {
		cout << "IMPOSSIBLE" << '\n';
	}
	else {
		cout << "POSSIBLE" << '\n';
	}

	return 0;
}


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

//#define int long long
//struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;
using intpair = pair<int, int>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()

signed main(){
    string s;
    cin >> s;
    stack<char> st;
    reverse(ALL(s));
    for(char c : s){
        if(c == 'S' && !st.empty())if(st.top() == 'T'){
            st.pop();
            continue;
        }
        st.push(c);
    }
    cout << st.size() << endl;
}

Measured memory_bytes: 644
mod = 10**9+7
import sys
sys.setrecursionlimit(10000000)

N,M = [int(x) for x in input().split()]
a = [int(input()) for _ in range(M)]
di = {}
for i in a:
    di[i]=1
dp = [0 for _ in range(N+1)]
dp[0] = 1
for i in range(N+1):
    if(i in di):
        continue
    if(i<N-1):
        if(i+2 not in di):
            dp[i+2]+=dp[i]
            dp[i+2]%=mod
    if(i<N):
        if(i+1 not in di):
            dp[i+1]+=dp[i]
            dp[i+1]%=mod
print(dp[N])


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

int main(){
  string S;
  cin >> S;

  int N = S.size();
  bool flag = true;
  rep(i,N){
    if(i%2==0){
      if(S[i] == 'L'){
        flag = false;
        break;
      }
    }else{
      if(S[i] == 'R'){
        flag = false;
        break;
      }
    }
  }

  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a;i<(int)b;++i)
int main(){
  int a,b,c;cin>>a>>b>>c;
  if(b-a==c-b)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
    return 0;
}

Measured memory_bytes: 256
a, b =  list(map(int, input().split() ))
if 0 <= a <= b:
	print(b-a)
elif 0 < b <= a:
	print(a-b+2)
elif b <= a < 0:
	print(a-b+2)
elif a <= b <= 0:
	print(b-a)
else:
	print( abs(abs(b)-abs(a)) + 1)


Measured memory_bytes: 2940
/*
	@・ω・@ <だれだろうね
*/

/*****/

#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>	//cout << fixed << setprecision(桁数);
#include <stdexcept>

//#define int long long

using namespace std;
using ll = long long;
using ld = long double;
using vecll = vector<long long>;
using pll = pair<long long, long long>;
template<class T> using pr = pair<T, T>;
template<class T> using vec = vector<T>;
template<class T> using grid = vector<vector<T>>;

#define debug(x) (std::cerr << (x) << "\n")
#define debug_tab(n, x) (std::cerr << strMulti("\t",n) << (x) << "\n")
#define debug_cout(x) (std::cerr << #x << " : " <<  (x) << "\n")
#define debug_tabcout(n, x) (std::cerr << strMulti("\t",n) << #x << " : " <<  (x) << "\n")
#define debug_headcout(h, x) (std::cerr << h << " : " <<  (x) << "\n")
#define debug_tabheadcout(n, h, x) (std::cerr << strMulti("\t",n) << h << " : " <<  (x) << "\n")

#define str(n)	(n.toString())

#define rep(i, n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i, n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i, n) for(ll i=(n)-1; i >= 0; --i)
#define rrep1(i, n) for(ll i=(n); i > 0; --i)
#define all(x) (x).begin(), (x).end()
#define pair(a, b) make_pair(a, b)
constexpr int INF = 2000000100;
constexpr ll MOD = 1000000007;	// 10e9+7
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> T divup(T a, T b) { if (a % b == 0) { return a / b; } return a / b + 1; }
std::string strMulti(std::string t, int n) { std::string out = ""; for (int i = 0; i < n; i++) { out += t; } return out; }
template<class T> T math_P(T m, T n) { T ret = 1; for (T i = m; i > m - n; i--) { ret *= i; } return ret; }
template<class T> T math_C(T m, T n) { T ret = math_P(m, n); for (T i = 2; i <= n; i++) { ret /= i; } return ret; }
template<class T> bool compare_by_b(pair<T, T> a, pair<T, T> b) { if (a.second != b.second) { return a.second < b.second; } return a.first < b.first; }
template<class T> T mod_pow(T x, T n, const T& p) { T ret = 1; while (n > 0) { if (n & 1) { (ret *= x) %= p; } (x *= x) %= p; n >>= 1; } return ret; }
template<class T> void Grid(grid<T>& G, size_t w, size_t h)
{
	G.reserve(w);
	for (size_t i = 0; i < w; ++i)
	{
		G.emplace_back(vector<ll>(h));
	}
}

/*****/

ll N;
vector<ll> A;

void Main()
{
	cin >> N;
	A.resize(N);
	rep(i, N)	cin >> A[i];
	sort(all(A));
	bool ret = true;
	rep(i, N - 1)
	{
		if (A[i] == A[i + 1])
		{
			ret = false;
			break;
		}
	}

	cout << (ret ? "YES" : "NO");
}

/*****/

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

	//std::cout << std::fixed << std::setprecision(10);

	/*
	while (true)
	{
		Main();
		cout << endl;
	}
	//*/

	Main();
	cout << endl;

	return 0;
}


Measured memory_bytes: 1792
//! ----------------------------------------------
//! Framework <https://github.com/vain0x/procon>
//!
//! See the bottom of file for solution.
//! ----------------------------------------------

#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Display, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

/// Print values to standard error if debug mode.
#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), stderr());
            writeln!(err, "\x1B[33m{}\x1B[0m = {:?}", e, $e).unwrap()
        })*
    };
}

/// Read from standard input and parse each word.
/// - `read!(T, U, ..)` parses a line as a tuple of words.
/// - `read![[T]]` parses a line as an array of words.
/// - `read![..; N]` parses `N` lines, using `read!(..)` repeatedly.
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

/// Read a line from standard input.
#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();

    #[allow(deprecated)]
    buf.trim_right().to_owned()
}

// -----------------------------------------------
// Solution
// -----------------------------------------------

fn main() {
    let (A, B) = read!(i64, i64);

    println!("{}", max(A + B, max(A - B, A * B)))
}


Measured memory_bytes: 4352
import java.util.Scanner

fun main(args: Array<String>) {
    val D = readLine()!!.toInt();
        
    if(D==25){
		println("Christmas");
    }else if(D==24){
        println("Christmas Eve");
    }else if(D==23){
        println("Christmas Eve Eve");
    }else if(D==22){
        println("Christmas Eve Eve Eve");
    }
}

Measured memory_bytes: 31864
#include<stdio.h>
#define N 100
main(){
  int i,j,count=0,mini,n,a,A[N],f;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%d",&A[i]);
  }
  for(i = 0; i < n; i++){
    mini = i;
    f = 0;
    for(j = i; j < n; j++){
      if(A[j] < A[mini]){
        mini = j;
	f = 1;
      }
    }
    if(f == 1){
	a = A[i];
	A[i] = A[mini];
	A[mini] = a;
        count++;
    }
  }
  for(i = 0; i < n; i++){
    if(i > 0) printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
  printf("%d\n",count);
  return 0;
}

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

const int MAXW = 310;
const int MAXH = 310;

int H, W;
vector<string> field;
int dp[MAXH][MAXH];
int cost[MAXH][MAXH];

int dfs(int w, int l, int r){
    if(dp[l][r] >= 0) return dp[l][r];
    
    int res = 1e9;
    if(l < H){
        res = min(res, dfs(w, l+1, r));
    }
    if(r < H){
        res = min(res, dfs(w, l, r+1));
    }
//    for(int i=0; i<H-max(l, r); i++){
//        if(field[H-1-r-i][w] == field[H-1-l-i][w+1])
//            res++;
//    }
    res += cost[l][r];
    
    //cout << l << " " << r << " " << res << endl;
    return dp[l][r] = res;
}

int main(){
    cin >> H >> W;
    field.resize(H);
    for(auto &s: field) cin >> s;
    
    int ans = 0;
    for(int w=0; w<W-1; w++){
        for(int d=-H; d<H; d++){
            int sum = 0;
            for(int l=-H; l<H; l++){
                if(l<0 || l+d<0 || H<=l || H<=l+d) continue;
                
                sum += field[l][w] == field[l+d][w+1];
                cost[H-1-l][H-1-l-d] = sum;
            }
        }
        
        memset(dp, -1, sizeof(dp));
        for(int w=0; w<MAXW; w++)
            dp[H][H] = 0;
        ans += dfs(w, 0, 0);
    }
    
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 1152
nums = input().split()
a = int(nums[0])
b = int(nums[1])
c = int(nums[2])
 
if a <= b <= c:
    print(a, b, c)
 
elif a <= c <= b:
    print(a, c, b)
 
elif b <= a <= c:
    print(b, a, c)
 
elif b <= c <= a:
    print(b, c, a)
 
elif c <= a <= b:
    print(c, a, b)
 
else:
    print(c, b, a)

Measured memory_bytes: 6728
N,C,K = [int(s) for s in input().split()]
T = []
for i in range(N):
    T.append(int(input()))
T.sort()
 
pas = 0
leave = T[0]
ans = 1
 
for t in T:
    if pas == C or K < t - leave:
        leave = t
        ans += 1
        pas = 0
    pas += 1
print(ans)

Measured memory_bytes: 7488
#include<bits/stdc++.h>
#define MAX 105
using namespace std;
 
int main(){
  int n;
  string s[MAX];
  bool t = true;
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> s[i];
    if(i && s[i-1][s[i-1].size()-1] != s[i][0]) t = false;
    for(int j = 0; j < i; j++) if(s[j] == s[i]) t = false;
  }
  cout << (t ? "Yes" : "No");
}

Measured memory_bytes: 256
local D=io.read"*n"
local c={}
for i=1,26 do c[i]=io.read"*n"end
local s={}
for i=1,D do s[i]={}for j=1,26 do s[i][j]=io.read"*n"end end
local t={}
for i=1,D do t[i]=io.read"*n"end

local last={}
for i=1,26 do
last[i]=0
end

local a=0
for i=1,D do
	last[t[i]]=i
	for j=1,26 do
		a=a-c[j]*(i-last[j])
	end
	a=a+s[i][t[i]]
	print(a)
end


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

using namespace std;

const int mod = 1e9 + 7;

int main(){
  int N, K;
  cin >> N >> K;
  
  vector<int> d(1, 0);
  for(int i = 1; i * i <= N; i++){
    d.push_back(i);
    if(i * i != N) d.push_back(N / i);
  }
  
  sort(d.begin(), d.end());
  
  int m = (int)d.size() - 1;
  vector<vector<long long>> dp(K + 1, vector<long long>(m, 0));
  dp[0][0] = 1;
  
  vector<long long> sum(m + 1, 1);
  sum[0]=0;
  
  for(int i = 0; i < K; i++){
    for(int j = 0; j < m; j++){
      dp[i + 1][j] += sum[m - j] * (d[j + 1] - d[j]) % mod;
      dp[i + 1][j] %= mod;
    }
    for(int j = 0; j < m; j++){
      sum[j + 1] = (sum[j] + dp[i + 1][j]) % mod;
    }
  }
  
  cout << sum[m] << endl;
  
  return 0;
}

Measured memory_bytes: 51196
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
const int Nmax=200010;
int main() {
	char c;
	for(int i=0;i < 9;i++){
		cin >> c;
		if(i==0||i==4||i==8) cout << c;
	}
	return 0;
}

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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define INF         INT_MAX/3
#define LLINF       LLONG_MAX/3
#define MOD         (1000000007LL)
#define MODA(a, b)  a=((a)+(b))%MOD
#define MODP(a, b)  a=((a)*(b))%MOD
#define inc(i, l, r)   for(int i=(l);i<(r);i++)
#define dec(i, l, r)   for(int i=(r)-1;i>=(l);i--)
#define pb          push_back
#define se          second
#define fi          first
#define mset(a, b)  memset(a, b, sizeof(a))

using LL  = long long;
using G   = vector<vector<int>>;

int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
// }}}

int d[30][30];
int c[500][500];
int v[3][30];

int main() {
    cin.tie(0);ios::sync_with_stdio(false);
    int n;cin >> n;
    int C;cin >> C;
    inc(i, 0, C){
        inc(j, 0, C){
            cin >> d[i][j];
        }
    }
    inc(i, 0, n){
        inc(j, 0, n){
            cin >> c[i][j];
            c[i][j]--;
        }
    }

    inc(x, 0, C){
        inc(i, 0, n){
            inc(j, 0, n){
                v[(i+j)%3][x] += d[c[i][j]][x];
            }
        }
    }
    int ans = INT_MAX;
    inc(x, 0, C){
        inc(y, 0, C){
            inc(z, 0, C){
                if(x == y || y == z || z == x) continue;
                ans = min(ans, v[0][x]+v[1][y]+v[2][z]);
            }
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1280
#include <bits/stdc++.h>
#define fore(x,a,b) for(int x=a, qwerty=b; x<qwerty; x++)
#define ALL(a) (a).begin(),(a).end()
#define SZ(a) ((int)(a).size())
#define pb push_back
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define fst first
#define snd second
#define mset(a,v) memset((a),(v),sizeof(a))
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")
using namespace std;
typedef long long ll;
const int N=200500;
int n,a[N][3];
int dp[N][3];
int f(int i, int last){
	if(i==n)return 0;
	int &r=dp[i][last];
	if(r!=-1)return r;
	r=0;
	fore(j,0,3)if(j!=last)r=max(r,a[i][j]+f(i+1,j));
	return r;
}
int main(){FIN;
	cin>>n;
	fore(i,0,n)fore(j,0,3)cin>>a[i][j];
	memset(dp,-1,sizeof dp);
	int r=0;
	fore(i,0,3)r=max(r,a[0][i]+f(1,i));
	cout<<r<<"\n";
}

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

int main() {
  int n, c;
  cin >> n >> c;
  vector<vector<int>> ds(c + 1, vector<int>(c + 1));
  for (int i = 1; i <= c; i++)
    for (int j = 1; j <= c; j++)
      cin >> ds[i][j];
  vector<vector<int>> colors(3, vector<int>(c + 1));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int c;
      cin >> c;
      colors[(i + j) % 3][c]++;
    }
  }
  int result = 2147480000;
  for (int i = 1; i <= c; i++) {
    for (int j = 1; j <= c; j++) {
      for (int k = 1; k <= c; k++) {
        if (i == j || j == k || k == i) continue;
        array<int, 3> color = {i, j, k};
        int diff = 0;
        for (int m = 0; m < 3; m++)
          for (int l = 1; l <= c; l++)
            diff += ds[l][color[m]] * colors[m][l];
        result = min(diff, result);
      }
    }
  }
  cout << result << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i=0;i<(n);++i)
#define RANGE(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(n)-1;i>= 0;--i)

#define endl '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define uset unordered_set
#define BIG 2000000000
#define VERYBIG 1000000000000000ll
#define PI 3.141592653589793238
#define dcout cout<<fixed<<setprecision(50)
#define _popcnt __builtin_popcount

const long long dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long
#define double long double

template<typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
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;}

typedef pair<int, int> INTP;
typedef vector<int> INTV;
struct edge2 {int to, cost;};
struct edge3 {int from, to, cost;};

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

  string S, T, U; int A, B; cin >> S >> T >> A >> B >> U;
  A -= (S==U); B -= (T==U);
  cout << A << ' ' << B << endl;
}


Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9+7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
#ifdef LOCAL
#define debug(x) cerr << #x << ": " << x << endl
#else
#define debug(x)
#endif
int dx[4]={ 1,0,-1,0 };
int dy[4]={ 0,1,0,-1 };

int a, b;
vector<string> S;
signed main(){
	cin >> a >> b;
	string tmp = "";
	rep(i, b){
		tmp += to_string(a);
	}
	S.pb(tmp);
	tmp = "";
	rep(i, a){
		tmp += to_string(b);
	}
	S.pb(tmp);
	sort(all(S));
	cout << S[0] << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b,ans=0,tmp;
    string s;
    vector<string> aa,bb;
    cin>>a;
    for(int i=0;i<a;i++){
        cin>>s;
        aa.push_back(s);
    }
    cin>>b;
    for(int i=0;i<b;i++){
        cin>>s;
        bb.push_back(s);
    }
    for(string x:aa){
        tmp=0;
        for(string y:aa){
            if(x==y)tmp++;
        }
        for(string y:bb){
            if(x==y)tmp--;
        }
        //cout<<tmp<<endl;
        ans=max(ans,tmp);
    }
    cout<<max(ans,0)<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
    using namespace std;
    int a[100010],n;char s[100010];
    int main(){
    	scanf("%s",s);
    	n = strlen(s);
    	for(int i=1; i<=n; i++)a[i] = (s[i-1] == '1');
    	int res = n;
    	for(int i=n; i>=1; i--){
    		a[i] ^= a[i-1];
    		if(a[i])
    			res = min(res, max(i-1, n+1-i));
    	}
    	printf("%d\n",res);
    	return 0;
    }

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

int main() {
    int N;
    cin >> N;
    map<int, int> cnt;
    for (int i = 0; i < N; i++) {
        int a;
        cin >> a;
        cnt[a]++;
    }

    int ans = 0;
    for (auto p : cnt) {
        if (p.second >= p.first) {
            ans += p.second - p.first;
        } else {
            ans += p.second;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 4736
n = int(input())
p = input().split()
p = [int(num) for num in p]
t = 0
for i in range(1,n-1):
  if ((p[i-1] < p[i] < p[i+1])
      or (p[i+1] < p[i] < p[i-1])):
    t += 1
print(t)

Measured memory_bytes: 3060
package main

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

func main() {
	T1 := nextInt64()
	T2 := nextInt64()
	A1 := nextInt64()
	A2 := nextInt64()
	B1 := nextInt64()
	B2 := nextInt64()

	P := (A1 - B1) * T1
	Q := (A2 - B2) * T2

	if P > 0 {
		P = -P
		Q = -Q
	}

	if P+Q <= 0 {
		if P+Q == 0 {
			fmt.Println("infinity")
		} else {
			fmt.Println(0)
		}
		return
	}

	// 追いつく回数を求める
	s := (-P) / (P + Q)
	t := (-P) % (P + Q)

	if t == 0 {
		fmt.Println(s * 2)
	} else {
		fmt.Println(s*2 + 1)
	}
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextString())
	return i
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}


Measured memory_bytes: 640
using System;
class Program
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split(' ');
        int A = int.Parse(input[0]);
        int B = int.Parse(input[1]);
        int C = int.Parse(input[2]);
        int ans = Math.Max(0, C - (A - B));
        Console.WriteLine(ans);
    }
}


Measured memory_bytes: 13140
import java.io.*;
import java.math.*;

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {

		BigInteger A = new BigInteger(nextString(),10);
		BigInteger B = new BigInteger(nextString(),10);

		String ans ="";
		if(A.compareTo(B)<0){
			ans="LESS";
		}else if(A.compareTo(B)>0){
			ans="GREATER";
		}else{
			ans="EQUAL";
		}

		System.out.println(ans);




	}




	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


Measured memory_bytes: 22612
#include <bits/stdc++.h>
using namespace std;
int main() {
	long N; cin >> N;
	vector<char>A(N);
	for (int i = 0; i < N; i++) {
		cin >> A.at(i);
	}
	bool ans = true;
	long sum = 0;
	for (int i = 0; i < N; i++) {
		if (A.at(i) == 'o') {
			sum++;
			ans = true;
		}
		else {
			if (ans) {
				sum++;
				ans = false;
			}
			else break;
		}
	}
	cout << sum << endl;
}


Measured memory_bytes: 3216
i = input()
n = i.split(' ')

x = int(n[0])
y = int(n[1])
even = y % 2 == 0

xt = x * 2
xf = x * 4

if y > (x * 4) or not even:
  print('No')
elif y == 2 or y == 4:
  print('Yes')
elif y >= xt and y <= xf:
  print('Yes')
else:
  print('No')



Measured memory_bytes: 9056
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
int INF = 1000000009;
int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    int cnt = 0;
    rep(i, n)
    {
        cin >> a[i];
        while(a[i]%2==0){
            a[i] /= 2;
            cnt++;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
N = int(input())
t = []
x = []
y = []

now_x = 0
now_y = 0
now_time = 0
flag = 0

for i in range(N):
    ti, xi, yi = list(map(int, input().split()))
    t.append(ti)
    x.append(xi)
    y.append(yi)

for i in range(N):
    if now_x < x[i]:
        now_time += x[i] - now_x
    else:
        now_time += now_x - x[i]
    now_x = x[i]

    if now_y < y[i]:
        now_time += y[i] - now_y
    else:
        now_time += now_y - y[i]
    now_y = y[i]

    if now_time <= t[i]:
        if (t[i] - now_time) % 2 == 0:
            now_time = t[i]
        else:
            flag = 1
            break
    else:
        flag = 1
        break

if flag == 0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 11752
S = input()[::-1]
digits = 1
num, ans = 0, 0
mod_list = [0] * 2019
mod_list[0] = 1

for c in S:
  num += int(c) * digits
  mod_list[num % 2019] += 1
  digits *= 10
  digits %= 2019

for i in range(2019):
  ans += mod_list[i] * (mod_list[i] - 1) // 2
  
print(ans)

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> a >> b >> c;


	if(a == b && b == c){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}

}	

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define REPO(i, n) for (ll i = 1; i <= n; i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(), n.end()
#define MOD 1000000007
#define P pair<ll, ll>

ll n, d;

int main() {
    cin >> n >> d;
    ll ans = 0;
    REP(i, n){
        ll a, b;
        cin >> a >> b;
        if (d >= sqrt(a * a + b * b)) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3660
#include<stdio.h>

struct tra {
  char name;
  int no;
	
};

void sort2(struct tra *su, int);
void sort(struct tra *su, int);
void ire(int*,int*);
void ire2 (char*,char*);
void s(int*,int*);
void s2 (char*,char*);
int ha(struct tra *su,struct tra *su0,int);

int main(){
  int s=0,i,j;
  struct tra su0[36];
  struct tra su[36];
  struct tra su2[36];
  scanf("%d",&s);  
  for(i=0;i<s;i++){
   
    scanf(" %c%d",&su0[i].name,&su0[i].no);
    su[i].name=su0[i].name;
    su[i].no=su0[i].no;
    su2[i].name=su0[i].name;
    su2[i].no=su0[i].no;
  }
  
  sort(su,s); 
  sort2(su2,s);

  for (i=0; i < s; i++) {
    printf("%c%d",su[i].name,su[i].no);
    if(i!=s-1)printf(" ");
  }
  printf("\n");
  printf("Stable\n");
 
  for (i = 0; i < s; i++){
    printf("%c%d", su2[i].name,su2[i].no);
    if(i!=s-1)printf(" ");}
  printf("\n");

 j= ha(su2,su,s);
 if(j==2)printf("Not stable\n");
 else  printf("Stable\n");

  return 0;
}

void sort (struct tra *su, int size) {
  int i, j;
  
  for (i = 0; i < size - 1; i++){
    for (j = size - 1; j >= i + 1; j--){
      if (su[j].no < su[j-1].no){
	ire(&su[j].no,&su[j-1].no);
	ire2(&su[j].name,&su[j-1].name);

      }
    }
  }
}
void ire (int *x, int *y){
  char temp;    
  temp = *x;
  *x = *y;
  *y = temp;
}
void ire2 (char *x, char *y){
  char temp;    
  temp = *x;
  *x = *y;
  *y = temp;
}
void sort2 (struct tra *su, int size) {
  int i, j, in;

  for (i = 0; i < size-1; i++) {
    in = i;   
    for (j = i + 1; j < size; j++) {
      if (su[j].no <su[in].no){in = j; }   
    }
   
    s2(&su[in].name, &su[i].name);
    s(&su[in].no, &su[i].no);
  }
}void s (int *x, int *y){
  char temp;    
  temp = *x;
  *x = *y;
  *y = temp;
}
void s2 (char *x, char *y){
  char temp;    
  temp = *x;
  *x = *y;
  *y = temp;
}
int ha (struct tra *su,struct tra *su0,int s) {
  int i,c=0;
  for(i=0;i<s;i++){

    if(su[i].name != su0[i].name){c=1;}


  }

  if(c==1) return 2;
  else return 1;
  
}



Measured memory_bytes: 2104
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using P   = pair<ll, ll>;
using mat = vector<vector<ll>>;

void IOS() { ios::sync_with_stdio(false), cin.tie(0); }

const ll INF = 1e16;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-12;

template <typename T>
void dump(T x) { cout << x << endl; }
void dumpf(ld x, int t) { cout << setprecision(t) << fixed << x << endl; }
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
	fill((T *)array, (T *)(array + N), val);
}
inline ll mod(ll a, ll b) {
	if (a > 0) return a % b;
	if (a % b == 0) return 0;
	ll x = -a / b + 1;
	a += x * b;
	return a % b;
}
ll powm(ll a, ll b, ll c) {
	if (b == 0)
		return 1;
	else if (b % 2 == 0) {
		ll d = powm(a, b / 2, c);
		return (d * d) % c;
	} else
		return (a * powm(a, b - 1, c)) % c;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

//ll dx[4] = {1, 0, -1, 0};
//ll dy[4] = {0, 1, 0, -1};

int main() {
	IOS();
	ll n;
	cin >> n;
	dump((n - 2) * 180);
	return 0;
}

Measured memory_bytes: 256
def main():
    import sys
    input=sys.stdin.buffer.readline
    n=int(input())
    b=37
    M=998244353
    x,y=1,0
    f=[x]*(n+2)
    h=[y]*(n+2)
    for i,c in enumerate(input()):
        f[i+1]=x=x*b%M
        h[i+1]=y=(y*b+c)%M
    ok,ng=0,n//2+1
    while ng-ok>1:
        mid=ok+ng>>1
        d={}
        for i in range(0,n-mid+1):
            k=(h[i+mid]-h[i]*f[mid])%M
            if k in d:
                if d[k]+mid<=i:
                    ok=mid
                    break
            else:
                d[k]=i
        else:
            ng=mid
    print(ok)
main()

Measured memory_bytes: 4092
#include <iostream>
#include <algorithm>
#include<climits>
#include <cmath>
using namespace std;
#define long long int int
int main(){
int i,j,k,l,n;
cin>>n;
int a[n+1],b[n+1]={INT_MAX};
b[1]=0;
for(i=1;i<=n;i++)
	cin>>a[i];
b[2]=abs(a[1]-a[2]);
for(i=3;i<n+1;i++){
	b[i]=min(b[i-1]+abs(a[i]-a[i-1]),b[i-2]+abs(a[i-2]-a[i]));
}
cout<<b[n];
}

Measured memory_bytes: 1024
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define ArraySizeOf(array)     (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define REV(i,n) for(int i=n-1;i>0;i--)
#define req(i,n,m) for(int i=n;i<m;i++)
#define REQ(i,n,m,l) for(int i=n;i<m;i+=l) 
#define _GLIBCXX_DEBUG
int INF = 1e9 + 7;
unsigned NthDayOfWeekToDay(unsigned n, unsigned dow, unsigned dow1)
{
    unsigned day;
    if (dow < dow1) dow += 7;
    day = dow - dow1;
    day += 7 * n - 6;
    return day;
}
signed gcd(int x, int y) {
    if (y == 0)return x;
    return gcd(y, x % y);
}
signed lcm(int x, int y) {
    return x / gcd(x, y) * y;
}
unsigned DayToWeekNumber(unsigned day)
{
    return (day - 1) / 7 + 1;
}
unsigned AnotherDayOfWeek(unsigned day, unsigned day0, unsigned dow0)
{
    return (dow0 + 35 + day - day0) % 7;
}
using namespace std;
signed main() {
    string S; cin >> S;
    vector<int>A(S.size());
    bool b = false;
    rep(i, S.size()) {
        A[i] = S.at(i);
        if (i == 0 && A[i] != 65) {
            cout << "WA" << endl;
            return 0;
        }
        else if (((i == 1 || i == S.size() - 1) && A[i] < 97) || (b == true && A[i] < 97) || (i!=0&&A[i] < 97 && A[i] != 67)) {
            cout << "WA" << endl;
            return 0;
        }
        else if (b == false && A[i] == 67)b = true;
    }
    if (b == false)cout << "WA" << endl;
    else cout << "AC" << endl;
}

Measured memory_bytes: 3564
r, c = gets.split(" ").map(&:to_i)

a = []
r.times do |i|
    a[i] = gets.split(" ").map(&:to_i)
end

x = Array.new(c + 1, 0)
a.each do |b|
    print b.join(" "), " ", b.sum, "\n"
    c.times do |i|
        x[i] += b[i]
    end
    x[c] += b.sum
end

print x.join(" "), "\n"



Measured memory_bytes: 7012
#coding:utf-8
def Dijkestra(G,n):
    d=[100000000000]*n
    pi=[None]*n
    d[0]=0
    C=[]
    for i in range(n):
        C.append(i)
    
    while len(C)!=0:
        u=C[0]
        for i in range(1,len(C)):
            if d[u]>d[C[i]]:
                u=C[i]
        C.remove(u)
        for i in range(len(G[u])):
            if G[u][i]==-1:
                continue
            elif d[i]>d[u]+G[u][i]:
                d[i]=d[u]+G[u][i]
                pi[i]=u                
    for i in range(n):
        print(i,d[i])
    

if __name__=="__main__":
    n=int(input())
    G=[]
    for i in range(n):
        a=[]
        ele=list(map(int,input().split()))
        k=ele[1]
        t=ele[2:]
        v=c=[]
        for j in range(k):
            v=v+[t[2*j]]
            c=c+[t[2*j+1]]
        for j in range(n):
            if j in v:
                a.append(c[v.index(j)])
            else:
                a.append(-1)
        G.append(a)
    Dijkestra(G,n)

Measured memory_bytes: 7860
# abc167_d.py
N, K = map(int,input().split())
A = list(map(int,input().split()))
pos = 0
flg = [0] * N
route = [0]
is_ok = 0
while K > 0:
    K-=1
    if flg[pos] == 1 and is_ok==0:
        route = route[route.index(A[pos] - 1):]
        K%=len(route)
        is_ok = 1
#        print("find cycle!:",route)
    flg[pos] = 1
    pos = A[pos] - 1
    route.append(pos)
#    print(route)
print(pos + 1)


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

#define int long long
#define rep(i,l,r) for(int i=(int)(l);i<(int)(r);i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,T b){if(a>b){a=b;return 1;}return 0;}

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

const int inf = 1LL<<60;
const int mod = 1e9 + 7;
const double eps = 1e-9;

/*{
  }*/

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

  vi v(n);
  rep(i, 0, n) cin >> v[i];

  priority_queue<double, vector<double>, greater<double>> que;
  rep(i, 0, n) que.push(v[i]);

  rep(i, 0, n-1){
    double a = que.top(); que.pop();
    double b = que.top(); que.pop();
    double c = (a+b)/2;
    que.push(c);
  }

  printf("%.12f\n", que.top());

  return 0;
}


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

int main() {
	string s; cin >> s;
	int n = s.size();

	bool flag = true;
	for (int i = 0; i < n/2; ++i)
		if (s[i] != s[n-1-i]) flag = false;
	for (int i = 0; i < n/2; ++i)
		if (s[i] != s[n/2-1-i]) flag = false;
	for (int i = n/2+1; i < n; ++i)
		if (s[i] != s[n-1-i]) flag = false;

	if (flag) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
const int N=200005;
long long n,k,ans;
int main()
{
	scanf("%lld%lld",&n,&k);
	for(long long i=1;i<=n;i++)
		if(2*(abs(k-i)%k)%k==0)
			ans+=1ll*((n-(abs(k-i)%k))/k+(abs(k-i)%k!=0))*((n-(abs(k-i)%k))/k+(abs(k-i)%k!=0));//,cerr<<i<<" "<<(n-(abs(k-i)%k))/k<<endl;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 256