akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef vector <string> VS;
const int size = 9;

int main() {
    VS lines( size );
    for ( int i = 0; i < size; ++ i ) {
        cin >> lines[i];
    }

    bool O[size + 5][size + 5];
    for ( int i = 0; i < size + 5; ++ i ) {
        for ( int j = 0; j < size + 5; ++ j ) {
            O[i][j] = false;
        }
    }
    for ( int i = 0; i < size; ++ i ) {
        for ( int j = 0; j < ( i % 2 == 0 ? 4 : 5 ); ++ j ) {
            O[i+2][j+2] = ( lines[i][j] == '1' );
        }
    }

    const string T  = "RDLU";
    const int R = 0;
    const int D = 1;
    const int L = 2;
    const int U = 3;
    int r = 2;
    int c = 2;
    int s = R;

    while ( true ) {
        putchar( T[s] );
        if ( r == 2 && c == 2 && s == L ) break;
        if ( r == 3 && c == 2 && s == U ) break;

        if ( s == L ) {
            if ( O[r + 1][c] ) {
                ++ r;
                s = D;
            } else if ( O[r][c - 1] ) {
                -- c;
                s = L;
            } else if ( O[r - 1][c] ) {
                -- r;
                s = U;
            } else if ( O[r][c + 1] ) {
                ++ c;
                s = R;
            } else {
                s = R;
            }
        } else if ( s == R ) {
            if ( O[r - 1][c + 1] ) {
                -- r;
                ++ c;
                s = U;
            } else if ( O[r][c + 1] ) {
                ++ c;
                s = R;
            } else if ( O[r + 1][c + 1] ) {
                ++ r;
                ++ c;
                s = D;
            } else if ( O[r][c - 1] ) {
                -- c;
                s = L;
            } else {
                s = L;
            }
        } else if ( s == U ) {
            if ( O[r - 1][c - 1] ) {
                -- r;
                -- c;
                s = L;
            } else if ( O[r - 2][c] ) {
                r -= 2;
                s = U;
            } else if ( O[r - 1][c] ) {
                -- r;
                s = R;
            } else if ( O[r + 2][c] ) {
                r += 2;
                s = D;
            } else {
                s = D;
            }
        } else if ( s == D ) {
            if ( O[r + 1][c] ) {
                ++ r;
                s = R;
            } else if ( O[r + 2][c] ) {
                r += 2;
                s = D;
            } else if ( O[r + 1][c - 1] ) {
                ++ r;
                -- c;
                s = L;
            } else if ( O[r - 2][c] ) {
                r -= 2;
                s = U;
            } else {
                s = U;
            }
        }
    }
    putchar( '\n' );
    
    return 0;
}

Measured memory_bytes: 0
unittest
{
	assert( [ "4 5" ].parse.expand.solve == "unsafe" );
	assert( [ "100 2" ].parse.expand.solve == "safe" );
	assert( [ "10 10" ].parse.expand.solve == "unsafe" );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto sw = input.front.split.to!( long[] );
	return tuple( sw[ 0 ], sw[ 1 ] );
}

auto solve( long s, long w )
{
	return ( s <= w ) ? "unsafe" : "safe";
}


Measured memory_bytes: 2760
e = []
o = []
gets.chop.split('').each_with_index{ |n, i|
  (i%2 == 0 ? e : o) << n.to_i
}
e1 = e.inject(:+)
o1 = o.inject(:+)
p o1 ? [e1 + o.size - o1, o1 + e.size - e1].min : 0


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

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

using namespace std;

int N, M;
vector< vector<int> > nodes;

bool contain(const vector<int> &v, int n)
{
  rep(i, v.size()) {
    if(v[i] == n) return true;
  }
  return false;
}

int dfs(int n, vector<int> *visited)
{
  if(visited->size() == N - 1) return 1;
  visited->push_back(n);
  vector<int> ns = nodes[n];
  int sum = 0;
  rep(i, ns.size()) {
    if(!contain(*visited, ns[i]))
      sum += dfs(ns[i], visited);
  }
  visited->pop_back();
  return sum;
}

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

  nodes.resize(N);
  rep(i, M) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    nodes[a].push_back(b);
    nodes[b].push_back(a);
  }

  cout << dfs(0, new vector<int>()) << endl;
  return 0;
}


Measured memory_bytes: 256
// 問題の URL を書いておく
// https://atcoder.jp/contests/arc068/tasks/arc068_b

#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>

using namespace std;

//#define ENABLE_PRINT

#if defined(ENABLE_PRINT)

#define Print(v) \
do {\
    cout << #v << ": " << v << endl; \
}while(0)

#define PrintVec(v) \
do {\
    for(int __i = 0; __i < v.size(); ++__i) \
    { \
        cout << #v << "[" << __i << "]: " << v[__i] << endl; \
    }\
}while(0)

#else

#define Print(v) ((void)0)
#define PrintVec(v) ((void)0)

#endif

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

using ll = int64_t;

int main(int, const char**)
{
    int n;
    cin >> n;
    map<int, int> d;
    rep(i, n)
    {
        int a;
        cin >> a;
        if(d.find(a) == d.end())
        {
            d[a] = 0;
        }
        d[a]++;
    }
    int even = 0, odd = 0;
    for(auto p : d)
    {
        if(p.second % 2 == 0)
        {
            even++;
        }
        else
        {
            odd++;
        }
    }
    if(even % 2 == 0)
    {
        cout << odd + even << endl;
    }
    else
    {
        cout << odd + even - 1 << endl;
    }
    return 0;
}


Measured memory_bytes: 8136
fun main(args: Array<String>) {

    val input = readLine()
    var n:Int = Integer.parseInt(input)
    var sum:Long = 0

    for(i in 1 until n+1){
        val tmp = if(i % 3 == 0) 0 else if(i % 5 == 0) 0 else i
        sum += tmp
    }
    println(sum)
}

Measured memory_bytes: 34508
#include<stdio.h>
int isprime(int n){
  for(int i = 2; i * i <= n; i++)
      if(n % i == 0) return 0;
  return 1;
}
int main(void){
  int n,i,t=0,MAX=0;

  while(scanf("%d",&n)!=EOF){
    if(n==0)  break;

    for(i=n;i>=2;i--){
      if(isprime(i)==1 && isprime(i-2) == 1){
          MAX=i;  printf("%d %d\n",MAX-2,MAX);  break;
        }
    }
  }
  return 0;
}

Measured memory_bytes: 1712
#include<stdio.h>
int main(){
	int N,M,i,j,k,w[51]={0},b[51]={0},r[51]={0};
	int a=0,bl=0,c=0,e=2500;
	char f[51][51];
	scanf("%d%d",&N,&M);
	for(i=0;i<N;i++)scanf("%s",f[i]);
	for(i=0;i<N;i++){
		for(j=0;j<M;j++){
			if(f[i][j]!='W')w[i]++;
			if(f[i][j]!='B')b[i]++;
			if(f[i][j]!='R')r[i]++;
		}
	}
	for(i=0;i<N-2;i++){
		a=a+w[i];
		for(j=i+1;j<N-1;j++){
			bl=bl+b[j];
			for(k=j+1;k<N;k++)c=c+r[k];
			if(e>a+bl+c)e=a+bl+c;
			c=0;
		}
		bl=0;
	}
	printf("%d\n",e);
	return 0;
}



Measured memory_bytes: 2108
n, x = gets.chomp.split.map(&:to_i)
if n == 1
	puts (gets.chomp.to_i - x).abs
	exit
end
arr = gets.chomp.split.map{|a| a.to_i - x}
max = arr.min.abs * 2
arr = arr.map{|a| a + max}



def GCD(m, n)
	return 0 if m == 0 || n == 0
	while m != 0 && n != 0
		if m > n then
			m %= n
		else
			n %= m
		end
	end
	return [m, n].max
end

def LCM(m, n)
	return 0 if m == 0 || n == 0
	return m * n / GCD(m, n)
end

gcd = GCD(arr[0], arr[1])
if n > 2
	2.upto(n-1) do |i|
		gcd = GCD(gcd, arr[i])
	end
end
#p arr
puts gcd

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

int main(){
  int N;
  cin >> N;
  vector<pair<long long int, long long int>> BA(N);
  long long int sum=0;
  long long int B_max=0;
  int a,b;
  for(int i=0; i<N; i++){
    cin >> a >> b;
    if(a>b){
      cout << "No";
      return 0;
    }
    BA[i] = make_pair(b,a);
  }
  sort(BA.begin(), BA.end());
  
  for(int j=0; j<N; j++){
    if(BA[j].first>B_max) B_max=BA[j].first;
    sum += BA[j].second;
    if(sum>B_max){
      cout << "No";
      return 0;
    }
  }
  
  cout << "Yes";
  return 0;
}

Measured memory_bytes: 3328
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<bitset>
#include<math.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define N (1000000000+7)
#define INF (ll)1e16
typedef long long ll;


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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
typedef long long ll;
typedef long double ld;
char str[105];
int main() {
	int n;
	scanf("%d%s", &n, str);
	int r = 0, b = 0;
	for (int i = 0; i < n; ++i) {
		r += str[i] == 'R';
		b += str[i] == 'B';
	}
	printf(r > b ? "Yes\n" : "No\n");
}


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

#define sz(x) (int)(x.size())
#define rep(i,a,b) for(int i=a;i<b;++i)
#define pb push_back
typedef long long ll;
/////////////////////////

string s;

void solve(){
	cin >> s;
	int ans = 0;
	rep(i, 0, sz(s)){
		if(i & 1){
			if(s[i] == 'g') ++ans;
		}else{
			if(s[i] == 'p') --ans;
		}
	}
	cout << ans << endl;
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	solve();

	return 0;
}

Measured memory_bytes: 512
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <limits.h>
#include <map>
#include <numeric>

namespace test {
	std::string to_string (char val) {
		return std::string (1, val);
		// return std::string{val};
	}
	//if( str.find ("r") != string::npos)
}

using namespace std;
typedef long long int llint;

int main (void) {
	int w,h,n; cin >> w >> h >> n;
	int x,y,a;
	int xmax = w, xmin = 0, ymax = h, ymin = 0;
	for (int i = 0; i < n; i++) {
		cin >>x >> y >> a;
		if (a == 1) {
			xmin = max(xmin, x);
		}
		else if (a == 2) {
			xmax = min(xmax, x);
		}
		else if (a == 3) {
			ymin = max(ymin, y);
		}
		else {
			ymax = min(ymax, y);
		}
	}
	int ans = (xmax - xmin ) * (ymax - ymin);
	if (ans < 0 || ( xmax - xmin ) + ( ymax - ymin ) < 0) {
		ans = 0;
	}
	cout << ans << endl;
	return 0;
}

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

long long n, m, q;
vector< pair<int, int> > lmt;
int par[100100];
bool used[100100];
int get_par(int a){
	return (par[a] = (par[a] == a) ? a : get_par(par[a]));
}
void unite(int a, int b){
	if(get_par(a) != get_par(b)) par[get_par(a)] = get_par(b);
}

int main(){
	ios::sync_with_stdio(false);
	cin >> n >> m >> q;
	rep(i, n) par[i] = i;
	rep(i, q){
		int a, b, c;
		cin >> a >> b >> c;
		if(c == 0) unite(a, b);
		else lmt.push_back(make_pair(a, b));
	}
	if(m == n-1){
		if(lmt.size() == 0){
			cout << "Yes" << endl;
		} else cout << "No" << endl;
		return 0;
	}
	rep(i, (int)lmt.size()){
		if(get_par(lmt[i].first) == get_par(lmt[i].second)){
			cout << "No" << endl;
			return 0;
		}
	}
	long long cnt = 0;
	rep(i, n) if(!used[get_par(i)]) cnt++, used[get_par(i)] = 1;
	if(cnt <= 2){
		cout << "No" << endl;
		return 0;
	}
	if(m > 0LL + n + 1LL * cnt * (cnt - 1LL) / 2LL - cnt) cout << "No" << endl;
	else cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 4640
#include<iostream>
using namespace std;
int a[200000];
void qsort(int,int);
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i];
	qsort(0,n-1);
	for(int i=0;i<n;i++)if(a[i]==a[i+1])
	{
		cout<<"NO"<<endl;
		return 0;
	}
	cout<<"YES"<<endl;
	return 0;
}
void qsort(int l,int r)
{
	int i,j,mid;
	i=l;
	j=r;
	mid=a[(i+j)/2];
	while(i<=j)
	{
		while(a[i]<mid)i++;
		while(a[j]>mid)j--;
		if(i<=j)
		{
			swap(a[i],a[j]);
			i++;
			j--;
		}
	}
	if(i<r)qsort(i,r);
	if(l<j)qsort(l,j);
}

Measured memory_bytes: 1024
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <climits>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pdi pair<double,int>
#define pib pair<int,bool>
#define pbb pair<bool,bool>
#define mod 1000000007
#define INF 500001
#define MAX 300001
using namespace std;

/* 🐣🐥 */
int p[100001], arr[100001];
bool uu[100001];
vector<int> vec[100001];
int getr(int a) {
	if (p[a] == a) return a;
	return p[a] = getr(p[a]);
}
void merge(int a, int b) {
	a = getr(a);
	b = getr(b);
	if (a == b) return;
	p[a] = b;
}
int main() {
	int n, m, a, b, ans = 0;
	scanf("%d %d", &n, &m);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &arr[i]);
		p[i] = i;
	}
	for (int i = 0; i < m; i++) {
		scanf("%d %d", &a, &b);
		merge(a, b);
	}
	for (int i = 1; i <= n; i++) {
		vec[getr(i)].push_back(i);
	}
	for (int i = 1; i <= n; i++) {
		memset(uu, false, sizeof(uu));
		for (int v : vec[i]) {
			uu[arr[v]] = true;
		}
		for (int v : vec[i]) {
			if (uu[v]) ans++;
		}
	}
	printf("%d", ans);

	return 0;
}

Measured memory_bytes: 6528
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
using namespace std;
#define pie 3.141592653589793238462643383279
#define int long long
#define mod 10000
#define INF 1145141919364364
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}

int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1)*x%mod;
}

int mod_pow(int x, int y, int mood) {
	int res = 1;
	while (y > 0) {
		if (y & 1)res = res * x%mood;
		x = x * x%mood;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}

int n, k, a[100010];
bool dp[100010];

signed main() {
	cin >> n >> k;
	for (int i = 0; i < n; i++)cin >> a[i];
	dp[0] = false;
	for (int i = 1; i <= k; i++) {
		for (int j = 0; j < n; j++) {
			if (a[j] <= i && !dp[i - a[j]])dp[i] = true;
		}
	}
	if (dp[k])cout << "First" << endl;
	else cout << "Second" << endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intput(i) cout << i << endl
#define ll long long
#define stringput(s) cout << (string)(s) << endl

int main(){
  int p, q, r;
  cin >> p >> q >> r;
  int sum = p + q + r;
  int max1 = max(max(p,q),r);
  
  cout << sum - max1 << endl;
  
  
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <list>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;

int main() {
    int a;
    cin >> a;
    int ct=1;
    //int tmp=0;
    vector<int> num;
    num.push_back(a);
    while(1){
        //tmp=a;
        if(a%2==0){
            a/=2;
        }
        else a=a*3+1;
        ct++;
        num.push_back(a);
        for(int i=0;i<num.size()-1;i++){
            if(a==num[i]){
                cout << ct << endl;
                return 0;
            }
        }
    }
    //cout << ct << endl;
}

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

int main() {
    unsigned long N, Q;
    cin >> N >> Q;
    string s;
    cin >> s;
    vector<long> a(N);
    for(unsigned long i = 1; i < N; ++i)a[i] = s[i - 1] == 'A' && s[i] == 'C';
    partial_sum(a.begin(), a.end(), a.begin());
    for(unsigned long i = 0, l, r; i < Q; ++i){
        cin >> l >> r;
        cout << a[r - 1] - a[l - 1] << endl;
    }
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define s(x) (x).begin(),(x).end();
using namespace std;
typedef long long ll; 


int main(){
int n;
cin >> n;
vector<int> a(n);

rep(i,n){
    cin >> a.at(i);
}

int flag = 0;
rep(i,n-1){
    int mae = a.at(i);
    int ushiro = a.at(i+1);
    if(mae != i+1) flag++;
}
if(flag <=2) cout << "YES"<<endl;
else cout << "NO" <<endl;



}

Measured memory_bytes: 256
#include <math.h>
#include <algorithm>
#include <cmath>
#include <iostream>


using namespace std;


int main()
{
    int bill {1000};
    double n{};

    cin >> n;

    double change{};
    int count{};

    while (n >= 1000)
    {
        n -= 1000;
        count += 1;
    }

    if (bill - n == 1000)
    {
        cout << 0;
    }

    else
    {
        change = bill - n;

        cout << change;
    }
}


Measured memory_bytes: 3720
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    int N, L;
    cin >> N >> L;
    string S[N];
    for(int i = 0; i < N; i++) {
        cin >> S[i];
    }
    sort(&S[0], &S[N]);
    string ans;
    for(string &s:S) {
        ans += s;
    }
    cout << ans;
    return 0;
}

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

using namespace std;

int n,ans,a[120000];

int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;++i){
		scanf("%d",&a[i]);
		ans+=abs(a[i]-a[i-1]);
	}
	ans+=abs(a[n+1]-a[n]);
	for (int i=1;i<=n;++i)
		printf("%d\n",ans-abs(a[i]-a[i-1])-abs(a[i]-a[i+1])+abs(a[i-1]-a[i+1]));
	
	return 0;
}
			

Measured memory_bytes: 1664
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		int N = S.Length;
		long[] a = new long[N + 1];
		for(int i=0;i<N;i++){
			if(S[i] == '<'){
				a[i + 1] = a[i] + 1;
			} else {
				a[i + 1] = a[i] - 1;
			}
		}
		long b = a.Min();
		for(int i=0;i<N+1;i++) a[i] -= b;
		
		int[] ord = Enumerable.Range(0,N+1).ToArray();
		Array.Sort(ord, (i, j) => a[i].CompareTo(a[j]));
		
		foreach(var n in ord){
			if(n == 0){
				if(S[n] == '<'){
					a[n] = 0;
				} else {
					a[n] = a[n + 1] + 1;
				}
			} else if(n == N){
				if(S[n - 1] == '>'){
					a[n] = 0;
				} else {
					a[n] = a[n - 1] + 1;
				}
			} else {
				if(S[n - 1] == '<' && S[n] == '<'){
					a[n] = a[n-1] + 1;
				} 
				if(S[n - 1] == '>' && S[n] == '<'){
					a[n] = 0;
				} 
				if(S[n - 1] == '<' && S[n] == '>'){
					a[n] = Math.Max(a[n-1], a[n+1]) + 1;
				} 
				if(S[n - 1] == '>' && S[n] == '>'){
					a[n] = a[n+1] + 1;
				} 
			}
		}
		
		Console.WriteLine(a.Sum());
	}
	String S;
	public Sol(){
		S = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 23008
#include<stdio.h>

int main(void){
    
    int N,K,i,h[100001],ans = 0;

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

    for(i = 0;i < N;i++){
        if(h[i] >= K){
            ans++;
        }
    }

    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 512
import sys
import io

input = sys.stdin.readline
data = int(input())
array = [int(x) for x in input().split()]

color = set()
over = 0
for a in array :
    if a < 3200 :
        color.add(a//400)
    else :
        over += 1

print(max(1,len(color)), len(color)+over)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;

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

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

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

    if (4 <= M)
    {
        ans += (M / 4);
    }
    cout << ans << endl;
}

int main()
{
    long long N;
    scanf("%lld", &N);
    long long M;
    scanf("%lld", &M);
    solve(N, M);
    return 0;
}


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

/*
int to_sum_digit( int x ){
}
*/

int main() {
  string s, t;
  cin >> s >> t;

  sort(s.begin(), s.end());  //vec.at(0)に最小の値が入る
  sort(t.begin(), t.end());  //vec.at(0)に最小の値が入る
  reverse(t.begin(), t.end());

  for( int i = 0; i < min( s.size(), t.size() ); i++ ){
    if ( s.at(i) < t.at(i) ){
      cout << "Yes";
      return 0;
    }else if( s.at(i) > t.at(i) ){
      cout << "No";
      return 0;
    }
  }
  if( s.size() < t.size() ){
    cout << "Yes";
  }else{
    cout << "No";
  }
  return 0;
}
  /*
  vector<int> time(max_step+1), x(max_step+1), y(max_step+1);
  for ( int i = 0; i < max_step; i++ ) {
    cin >> time.at(i+1) >> x.at(i+1) >> y.at(i+1);
  }
  
  for ( int step = 0; step < max_step; step++ ){
    if( can_travel( time.at(step), x.at(step), y.at(step),
                    time.at(step+1), x.at(step+1), y.at(step+1) ) ){
//      cout << "OK" << endl;
      continue;
    }else{
      cout << "NO";
      return 0;
    }
  */

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;
        for (int i = 1; i < b - a; i++) {
            sum += i;
        }
        System.out.println(sum - a);
    }
}

Measured memory_bytes: 23636
// unihernandez22
// https://atcoder.jp/contests/abc076/tasks/abc076_c
// string manipulation

import std.stdio;
import std.string;
void main() {
	string s = readln.chomp;
	string t = readln.chomp;

	ulong idx = -1;
	bool matched;
	for(long i = (s.count-t.count); i >= 0; i--) {
		if (s[i] == '?' || s[i] == t[0]) {
		matched = true;
		foreach(j; 0..t.count) {
			if (s[i+j] != '?' && s[i+j] != t[j]) {
				matched = false;
				break;
			}
		}
		if (matched) {
			idx = i;
			break;
		}
		}
	}
	if (idx == -1) {
		writeln("UNRESTORABLE");
		return;
	}
	foreach(i; 0..s.count) {
		if (s[i] == '?' && (i < idx || i >= t.count+idx))
			write("a");
		else if (s[i] == '?')
			write(t[i-idx]);
		else
			write(s[i]);
	} writeln;
}


Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
template<int V>
struct MaxFlow {
  using T = double;
  const T INF = 1<<28;

  struct Edge {
    int to,rev;
    T cap;
  };

  vector<Edge> g[V];
  int level[V];
  int iter[V];

  void add(int from, int to, T cap) {
    g[from].push_back(Edge{to, (int)g[to].size(), cap});
    g[to].push_back(Edge{from, (int)g[from].size()-1, 0});
  }
  void add_multi(int from, int to, T cap) {
    g[from].push_back(Edge{to, (int)g[to].size(), cap});
    g[to].push_back(Edge{from, (int)g[from].size()-1, cap});
  }

  void bfs(int s) {
    fill_n(level,V,-1);
    queue<int> que;
    level[s] = 0;
    que.push(s);
    while(!que.empty()) {
      int v = que.front();
      que.pop();
      for(Edge e: g[v]) {
        if(e.cap <= 0)continue;
        if(level[e.to] < 0) {
          level[e.to] = level[v] + 1;
          que.push(e.to);
        }
      }
    }
  }

  T dfs(int v,int t,T f) {
    if(v == t)return f;
    for(int &i = iter[v]; i < g[v].size(); i++) {
      Edge &e = g[v][i];
      if(e.cap <= 0)continue;
      if(level[v] < level[e.to]) {
        T d = dfs(e.to,t,min(f,e.cap));
        if(d <= 0)continue;
        e.cap -= d;
        g[e.to][e.rev].cap += d;
        return d;
      }
    }
    return 0;
  }
  T exec(int s,int t) {
    T flow = 0;
    while(true) {
      bfs(s);
      if(level[t] < 0)return flow;
      fill_n(iter,V,0);
      T f;
      while((f = dfs(s,t,INF)) > 0) {
        flow += f;
      }
    }
  }
};

bool isleaf(char c){
  if(c == 'S' || c == 'T' || c == 'o')
    return true;
  return false;
}
int H,W;
int trIn(int i,int j){
  return i*W+j;
}
int trOut(int i,int j){
  return i*W+j + H*W;
}

int main(void) {
  cin >> H >> W;
  vector<string> a(H);
  for(int i=0;i<H;i++){
    cin >> a[i];
  }

  bool out = false;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(a[i][j] == 'S'){
        for(int k=0;k<H;k++)
          if(a[k][j] == 'T')out = true;
        for(int k=0;k<W;k++)
          if(a[i][k] == 'T')out = true;
      }
    }
  }
  if(out){
    cout << -1 << endl;
    return 0;
  }

  // Graph g(10010);
  MaxFlow<20010> mf;
  int s,t;
  for(int i=0;i<H;i++){
    for(int j=0;j<W;j++){
      if(a[i][j] == 'S')s = trOut(i,j);
      if(a[i][j] == 'T')t = trIn(i,j);

      if(isleaf(a[i][j])){
        mf.add(trIn(i,j),trOut(i,j),1);
        for(int k=0;k<H;k++){
          if(k == i)continue;
          if(isleaf(a[k][j])){
            mf.add(trOut(i,j), trIn(k,j), 1);
          }
        }
        for(int k=0;k<W;k++){
          if(k == j)continue;
          if(isleaf(a[i][k])){
            mf.add(trOut(i,j), trIn(i,k), 1);
          }
        }
      }
    }
  }
  

  cout << mf.exec(s,t) << endl;

  return 0;
}

Measured memory_bytes: 83584
import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int M = sc.nextInt();
    int a[] = new int[A];
    int b[] = new int[B];
    int m[] = new int[M];
    int x;
    int y;
    int c;
    
    for(int i=0; i<A; i++) {
      a[i] = sc.nextInt();
    }
    for(int j=0; j<B; j++) {
      b[j] = sc.nextInt();
    }
    
    for(int k=0; k<M; k++) {
      x = sc.nextInt();
      y = sc.nextInt();
      c = sc.nextInt();
      m[k] = a[x-1] + b[y-1] - c;
    }
    Arrays.sort(a);
    Arrays.sort(b);
    Arrays.sort(m);
    if(m[0]<=a[0]+b[0]) {
      System.out.println(m[0]);
    } else {
      System.out.println(a[0] + b[0]);
    }
  }
}

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

int main(){
  int n,k;
  double u,v,t,l,d[201],ans,remain,limit;
  while(cin >> n >> k >> t >> u >> v >> l){
    for(int i=0;i<n;i++) cin >> d[i];
    d[n] = l;
    
    ans = d[0] / u;
    limit = t * v * (k + 1);
    remain = 0;
    for(int i=0;i<n;i++){
      remain = min(remain + t * v, limit);
      double dis = d[i+1] - d[i];
      if(dis > remain){
        ans += remain / v + (dis - remain) / u;
        remain = 0;
      } else{
        ans += dis / v;
        remain -= dis;
      }
      
    }
    
    printf("%.9f\n",ans);
  }
}

Measured memory_bytes: 1248
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <random>
#include <queue>

using namespace std;



int main()
{
	int N,M;
	const int MOD7 = 1e9 + 7;

	cin >> N >> M;

	vector<int> Fs(N,0);
	vector<int> Ss(N+2,0);

	int n;
	for (int mi = 0; mi < M; mi++){
		cin >> n;
		Fs[n] = 1;
	}
	Ss[N] = 1;
	Ss[N+1] = 0;

	for (int ni = N -1; ni >= 0; ni--){
		if (Fs[ni] == 0){
			Ss[ni] = (Ss[ni + 1] + Ss[ni + 2]) % MOD7;
		}
	}

	int ans = Ss[0];

	printf("%d",ans);

	return 0;
}



Measured memory_bytes: 1024
n = int(input())
b = list(map(int,input().split()))

a = []
a.append(b[0])

for i in range(n-1):
    if i==n-2:
        a.append(b[i])
    else:
        if b[i]<b[i+1]:
            a.append(b[i])
        else:
            a.append(b[i+1])

print(sum(a))

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
        int a = in.nextInt(), b = in.nextInt();
        if (a <= b)
            System.out.println("unsafe");
        else {
            System.out.println("safe");
        }
    }

}


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

int main() {
    int N;
    cin >> N;
    int x = 0;
    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a[i];
        x ^= a[i];
    }
    for (int i = 0; i < N; i++) {
        cout << (x ^ a[i]);
        if (i != N-1) {
            cout << ' ';
        } else {
            cout << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 4052
N=int(input())
pos=[0,0]
jt=0
arr=[]
for i in range(N):
    t,x,y=map(int,input().split())
    a=t-jt
    b=abs(pos[0]-x)+abs(pos[1]-y)
    arr.append(a%2==b%2 and a>=b)
    jt=t
    pos=[x,y]
print('Yes' if all(arr) else 'No')

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

int main() {
	// your code goes here
        int k,a,b;
	cin>>k;
	cin>>a;
	cin>>b;
	if(a%k==0||b%k==0)
	cout<<"OK";
	else if(a/k!=b/k)
	cout<<"OK";
	else
	cout<<"NG";
	return 0;
}


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

nine = [9**i for i in range(7, 0, -1)]
six = [6**i for i in range(8, 0, -1)]
tmp = {}

def f(n):
  if(n < 6):
    return n
  if(n in tmp):
    return tmp[n]
  
  m = 1e9+7
  if(n >= 9):
    mn = max(x for x in nine if x <= n)
    if(n%mn == 0):
      m = min(m, n//mn)
    else:
      m = min(m, f(n-mn)+1)
  ms = max(x for x in six if x <= n)
  if(n%ms == 0):
    m = min(m, n//ms)
  tmp[n] = min(m, f(n-ms)+1)
  return tmp[n]
print(f(N))

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 29;
const ll INF64 = 1ll << 40;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

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

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

map<ll, int>  prime_factorization_map(ll x) {
  map<ll, int> res;
  for(ll i = 2; i*i <= x; ++i) {
    if(x % i == 0) {
      while(x % i == 0) {
        if(res.find(i) == res.end()) res[i] = 0;
        ++res[i];
        x /= i;
      }
    }
  }
  if(x != 1) res[x] = 1;
  return res;
}

int main()
{
  ll n; cin >> n;
  auto primes = prime_factorization_map(n);
  ll ans = 0;
  for(auto it=primes.begin();it!=primes.end();it++){
    ans += (sqrt(1+8*it->second)-1)/2;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3716
def Dp(x, hl, islim):
    if x == len(digit):
        return hl == 0
    if f[x][hl][islim]:
        return f[x][hl][islim]
    ans = 0
    mx = int(digit[x]) if islim else 1
    for i in range(mx + 1):
        ans += Dp(x + 1, hl, islim and i == mx)
        if hl != i:
            ans += Dp(x + 1, not hl, islim and i == mx)
    ans %= p
    f[x][hl][islim] = ans
    return ans

p = 10**9 + 7
digit = bin(int(input()))[2:]
f = [[[0, 0], [0, 0]] for i in range(len(digit))]
print(Dp(0, 0, 1))

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

int calc(int A, int B){
    int ans = 0;
    int sum = 0;

    for(int i = 1; i <= B; i++){
        sum = i * A - (i - 1);
        
        if(B == 1){
            ans = 0;
            break;
        }

        if(sum >= B){
            ans = i;
            break;
        }
    }

    return ans;

}

int main(){

    int A, B;
    cin >> A >> B;

/*
    for(int i = 2; i <= 20; i++){
        for(int j = 1; j <= 20; j++){
            cout << "i:" << i << " j:" << j << " " << calc(i, j) << endl;
        }
    }
*/
    cout << calc(A, B) << endl;

    return 0;
}

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

using namespace std;

int a[2],b[2];
int main()
{
    for(int i=0;i<2;i++)cin>>a[i];
    for(int j=0;j<2;j++)cin>>b[j];
    sort(a,a+2);
    sort(b,b+2);
    cout<<(a[0]+b[0]);

    return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(x) cout << fixed << setprecision(x);
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;


int main(){
  ll r; cin >> r;
  cout << 3*r*r << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define double long double
#define int long long
#define mii map<int,int>
#define low lower_bound
#define upp upper_bound
#define inf 1000000007 //10^9+7
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define sort(vec) sort(all(vec));
#define rever(vec) reverse(all(vec));
#define bisea binary_search
#define cend cout<<endl;
#define F first
#define S second
using namespace std;
signed main() {
  int n,k;
  cin>>n>>k;
  if(n%2==0) {
    n--;
  }
  if((n+1)/2>=k) {
    cout<<"YES"<<endl;
  }
  else {
    cout<<"NO"<<endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(final String args[]) {
        Scanner scan = new Scanner(System.in);
        int A = scan.nextInt();
        int B = scan.nextInt();
        int C = scan.nextInt();
        int K = scan.nextInt();
        int sum = 0;
        if(A >= K){
            sum = K;
        }else if(A < K){
            sum = A;
            K = K - A;
            if(B >= K){
                
            }else if(B < K){
                //sum = sum + B;
                K = K - B;
                if(C >= K){
                    sum = sum - K;
                }else{
                    sum = sum - C;
                }
            }
        }
        System.out.println(sum);
    }
}

Measured memory_bytes: 35700
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define Cin(T, x) T x; cin >> x
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cout(x) cout << (x) << "\n"
#define Couts(xs) for(const auto &e : xs) cout << e << " "; cout << "\n"
#define Cusum(T, n, xs, sxs) vector<T> sxs(n+1); For(i, n) sxs[i+1] = sxs[i] + xs[i]
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) find(Range(c), x) != c.end()
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Vec2(T, vs, n, m) vector<vector<T>> vs(n, vector<T>(m))

using namespace std;
using ll = long long;

int main(void){
    Cin(int, n);
    Cins(ll, n, a);
    
    ll ans = 0, res = 0;
    int r = 0;
    For(l, n){
        while(r < n && (res & a[r]) == 0){
            res += a[r];
            r ++;
        }
        ans += (ll)r-l;
        res -= a[l];
    }
    Cout(ans);
}


Measured memory_bytes: 1792
N = gets.to_i
as = N.times.map{gets.to_i}
ones = {}
as.each do |a|
    num = 0
    num += 1 while a % (2<<num) == 0
    ones[a] = num
end
as.sort_by!{|a| -ones[a]}
pt = 0
L = as.max.bit_length
ans = 0
(L-1).downto(0) do |i|
    bit = 0
    as.each do |a|
        bit ^= a[i]
    end
    if bit == 1
        while pt < N && ones[as[pt]] > i
            pt += 1
        end
        if pt < N && ones[as[pt]] == i
            as[pt] -= 1
            pt += 1
            ans += 1
        else
            puts -1
            exit
        end
    end
end
puts ans

Measured memory_bytes: 10312
use std::io::*;
use std::str::*;

fn main() {
    let n: usize = read();
    let a: Vec<usize> = read_vec();
    let b: Vec<i32> = read_vec();
    let c: Vec<i32> = read_vec();
    let mut result: i32 = 0;
    let mut prev: usize = 0;
    let mut first: bool = true;
    for i in 0..n {
        let index = a[i] - 1;
        result += b[index];
        if index as i32 - prev as i32 == 1 && !first {
            result += c[prev];
        }
        prev = index;
        first = false;
    }
    println!("{}", result);
}

fn read<T: FromStr>() -> T {
    let mut line = String::new();
    stdin().read_line(&mut line).ok();
    line.trim().parse().ok().unwrap()
}

fn read_vec<T: FromStr>() -> Vec<T> {
    let mut line = String::new();
    stdin().read_line(&mut line).ok();
    line.trim().split_whitespace()
        .map(|i| i.parse().ok().unwrap()).collect()
}

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


int main(){
  char in[120];
  pair<pair<string,int>,int> p[110];
  
  int a;
  cin >> a;
  
  for(int i=0 ; i<a ; i++){
    int t;
    cin >> in >> t ;
    //string tmp = in;
    p[i] =make_pair(make_pair(in,-t),i);
  }
  
  sort(p,p+a);
  
  for(int i=0 ; i<a ; i++) {
    cout << p[i].second+1 << endl ;
  }
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define r(i, n) for (int i=1;i<=n;i++)
using namespace std;
int main() {
  std::cout<<std::fixed<<std::setprecision(10);
  double a,b,x,c;
  cin >> a >> b >> x;
  c=a*a*b;
  double d=2.0*asin(1.0),e=180.0/d,f;
  if (c<=2*x) f=atan(a*a*a/(2*(c-x)))*e;
  else f=atan(2*x/(a*b*b))*e;
  cout << 90.0-f << endl;
  return 0;
}

Measured memory_bytes: 256
#include <functional>  
#include <iostream>    
#include <map>       
#include <set>        
#include <string>     
#include <utility>     
#include <vector>      

using namespace std;
#define endl '\n'
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define MOD 1000000007
#define pi acos(-1.0)
#define MAX 10000001
//////////////////////////////////////////////////////////////////////////
/* Custom function starts here */

/* Custom function ends here: */
//////////////////////////////////////////////////////////////////////////////

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

  /* MAIN Code STARTS here: */
  map<string, int> mm;
  int cases;
  cin >> cases;
  while (cases--) {

    string s;
    cin >> s;

    if (mm.find(s) == mm.end()) {
      mm[s] = 1;
    } else {
      mm[s]++;
    }
  }

  set<int, greater<int>> sss;
  for (auto itr : mm) {
    sss.insert(itr.second);
  }
  auto store = *sss.begin();
//   cout << store << endl;
  

for(auto itr : mm){
    // cout << itr.first << " ----" << itr.second << endl;
    if(itr.second == store){
        cout << itr.first << endl;
    }
}

  /* MAIN Code ENDS here: */
  
}

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

int main(){
    int n;
    cin>>n;
    cout<<(1000-n%1000)%1000<<endl;
}

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

#define PAUSE system("pause")
#define LL long long int
#define LD long double
#define PB push_back
#define PF push_front
#define MP make_pair
#define FORi(i, a, b) for(int i = a; i < b ; ++i)
#define FORd(i, a, b) for(int i = a; i > b ; --i)

using namespace std;

int main() {
	int n,a,b;
	cin >> n >> a >> b;
	vector<int> h(n);
	FORi(i,0,n){
		cin >> h[i];
	}
	LL l=1,r=1e9;
	while(l!=r){
		LL k = (l+r) / 2;
		LL cur = 0;
		FORi(i,0,n){
			int need = max(0ll, h[i] - k*b);
			cur += need/(a-b) + bool(need%(a-b));
		}
		// cout << k << " " << cur << endl;
		if (cur <= k){
			r = k;
		}
		else {
			l = k + 1;
		}
	}
	cout << l;
	return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<string>

int main(){
    std::string str;
    int i,sum=0;
    
    while(1){
        std::cin>>str;
        if (str=="0"){
            break;
        }else{
            for(i=0;i<str.size();i++){
                sum+=str[i]-'0';
            }
            std::cout<<sum<<std::endl;
            sum=0;
        }        
    }
    return 0;

}



Measured memory_bytes: 3148
n,m = map(int, input().split())
ab = []
for _ in range(n):
  a,b = map(int, input().split())
  ab.append((a,b))
cd = []
for _ in range(m):
  c,d = map(int, input().split())
  cd.append((c,d))
  
for i in ab:
  s = float("inf")
  for j in range(m):
    t = abs(i[0]-cd[j][0]) + abs(i[1]-cd[j][1])
    if t < s:
      s = t
      ans = j+1
  print(ans)

Measured memory_bytes: 9124
#include<stdio.h>
int main(void)
{
	int i,a,b,c,d;
	scanf("%d %d %d\n",&a,&b,&c);
	for(i=0;i<100;i++){
	if(a>b){
		d=a;
		a=b;
		b=d;
	}
	if(b>c){
		d=b;
		b=c;
		c=d;
	}
	}
	printf("%d %d %d\n",a,b,c);
	return 0;
}

Measured memory_bytes: 1796
#include <bits/stdc++.h>
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
using i64 = int64_t;
using f80 = __float80;
static const int dy[4] = {0,1,0,-1}, dx[4] = {1,0,-1,0};
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
#define _overload3(_1,_2,_3,name,...) name
#define repi(i,start,end) for(i64 i=(start);i<(end);++i)
#define _rep(i,n) repi(i,0,n)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,start,end) for(i64 i=(start);i>end;--i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define v(T) vector<T>
#define vv(T) v(v(T))
typedef v(i64) vi;
typedef v(vi) vvi;
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;}
template<typename T> ostream &operator<<(ostream &os, const vector< T > &v){
  rep(i,v.size()) os << v[i] << (i + 1 != v.size() ? " " : "");
  return os;
}
template<typename T> istream &operator>>(istream &is, vector< T > &v){
  for(T &in : v) is >> in;
  return is;
}

void Main()
{
  i64 N;
  string S;
  cin >> N >> S;

  i64 L = 0, R = 0;
  rep(i,N){
    if(S[i]==')'){
      if(R>0) R--;
      else L++;
    }
    else R++;
  }
  cout << string(L,'(') + S + string(R,')') << "\n";
}

int main()
{
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
}

Measured memory_bytes: 256
S=input()
n=len(S)
s1=S[0:(n-1)//2]
s2=S[(n+1)//2:n]

if s1!=s2:
    print("No")
    exit()

s3=s1[0:(n-1)//2]
s4=s1[0:(n+1)//2]
if s3!=s4:
    print("No")
    exit()

s5=s2[0:(n-1)//2]
s6=s2[0:(n+1)//2]
if s5!=s6:
    print("No")
    exit()

print("Yes")

'''
def flyer_split(s):
    n=len(s)
    return s[0:(n-1)//2],s[(n+1)//2:n]

S=input()
l=flyer_split(S)
if l[0]!=l[1]:
    print("No")
    exit()
l1=flyer_split(l[0])  
if l1[0]!=l1[1]:
    print("No")
    exit()
l2=flyer_split(l[1])  
if l2[0]!=l2[1]:
    print("No")
    exit()
print("Yes")
'''


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

const double PI = acos(-1); // acos = arc cos  コサインの逆関数

int main() {
    int a,b,h,m;
    cin >> a >> b >> h >> m;
    double th = double(h*60+m)/720 * 2*PI;
    double tm = double(m)/60 * 2*PI;
    double xh = a*cos(th), yh = a*sin(th);
    double xm = b*cos(tm), ym = b*sin(tm);
    double dx = xh-xm, dy = yh-ym;
    double ans = sqrt(dx*dx + dy*dy);
    printf("%.10f\n", ans);
    return 0;
}

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

int dp[31][105],cycle[31];
int interview[105];

int main() {
    int t,n,d,m;
    while(cin>>t, t) {
        for(int i=0; i<t; ++i) cin>>cycle[i];
        cin>>n;
        for(int i=0; i<105; ++i) interview[i] = 24;
        for(int i=0; i<n; ++i) {
            cin>>d>>m;
            interview[d] = min(interview[d], m);
        }
        for(int i=0; i<31; ++i) for(int j=0; j<105; ++j) dp[i][j] = 1<<29;
        dp[0][1] = 0;

        //cout<<"end init"<<endl;

        for(int i=1; i<104; ++i) {
            for(int j=0; j<t; ++j) {
                dp[0][i+1] = min(dp[0][i+1], dp[j][i]+1);
                if(j+1 == t) dp[0][i+1] = min(dp[0][i+1], dp[j][i]);
                if(j+1 < t && interview[i+1] >= cycle[j+1]) {
                    dp[j+1][i+1] = min(dp[j+1][i+1], dp[j][i]);
                }
            }
            // cout<<i<<endl;
            // for(int j=0; j<t; ++j) cout<<dp[j][i]<<" ";
            // cout<<endl;
        }

        int ans = 1<<29;
        for(int j=0; j<t; ++j) ans = min(ans, dp[j][104]);
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 0
#include <stdio.h>

int main(void)
{
    
    int a,b,c,max,min,sum;
    scanf("%d %d %d",&a,&b,&c);
    max=a+b;
    min=a+c;
    sum=b+c;
    if(min<max)max=min;
    if(sum<max)max=sum;
    printf("%d\n",max);
    
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int N;
int a[200100];
int b[200100];
int main(){
	cin >> N;
	for(int i=1;i<=N;i++){
		cin >> a[i];
	}
	for(int i=N;i>=1;i--){
		int c = a[i];
		for(int j=i;j<=N;j+=i){
			c ^= b[j];
		}
		b[i] = c;
	}
	vector<int> ans;
	for(int i=1;i<=N;i++){
		if(b[i])ans.pb(i);
	}
	cout << ans.size() << endl;
	for(int i=0;i<ans.size();i++){
		cout << ans[i];
		if(i+1<ans.size())cout << ' ';
		else cout << endl;
	}
	return 0;
}



Measured memory_bytes: 3064