akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize (3)
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<iomanip>
#include<algorithm>
#include<unordered_map>
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/hash_policy.hpp>
#include<ext/pb_ds/trie_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>*/
//#include<ext/rope>
#define ll long long
#define ull unsigned long long
#define INFI 2147483647
#define INFL 9223372036854775807
#define INFU 18446744073709551615
using namespace std;
//using namespace __gnu_pbds;
//using namespace __gnu_cxx;
const double PI=acos(-1.0);
const double eps=1e-6;
inline ll read()
{
    ll x=0,f=1;
    char ch=getchar();
    while(ch<'0' || ch>'9'){
        if(ch=='-') f=-1;
        ch=getchar();
    }
    while(ch>='0' && ch<='9'){
        x=x*10+ch-'0';
        ch=getchar();
    }
    return x*f;
}
template<typename T> void debug(T x)
{
    cout<<"value="<<x<<endl;
    return;
}
signed main()
{
	//ios_base::sync_with_stdio(false);
    //cin.tie(0);
    //cout.tie(0);
	ll n=read(),d=read();
	ll cnt=0;
	for(ll i=1;i<=n;i++){
        ll x=read(),y=read();
        if(x*x+y*y<=d*d) cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}


Measured memory_bytes: 3592
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;

namespace adaptor = boost::adaptors;

void Main()
{
	int K, N;
    cin >> K >> N;

    int l, i = 0, A[N];
    while (cin >> l) {
        A[i] = l;
        i++;
        if (i >= N) {
            break;
        }
    }

	int diff[N]; 

	for (int i = 0; i < N-1; i++) {
		diff[i] = abs(A[i+1]-A[i]);
	}
	diff[N-1] = A[0] + K - A[N-1];
	
	int max = diff[0];
    for (i = 1; i < N; i++) {
        if (max < diff[i]) {
            max = diff[i];
        }
    }
	cout << K-max << endl;
}

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

Measured memory_bytes: 1792
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <tuple>
#include <stack>
#include <bitset>

#define MAX_N 200001
#define MAX_K 200001
#define MAX_P 1001
#define INF   1000000000000000000
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

ll dfs(ll hp) {

  if (hp == 1) return 1;
  hp = hp / 2;
  ll cnt = dfs(hp);
  
  return 1 + cnt * 2;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    ll H;
    cin >> H;
    cout << dfs(H) << endl;
    
    return 0;
}


Measured memory_bytes: 888
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


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

void YN(bool ans){
    if(ans)cout<<"1"<<endl;
    else cout <<"0"<<endl;
    return;
}

int main(){
    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    YN(a!=c);
    return 0;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
int main(){
   int a,b;
   char op;
   while (1){
	   cin>>a>>op>>b;
	   if (op=='+'){
		   cout<<a+b<<endl;
	   }
	   else if (op=='-'){
		   cout<<a-b<<endl;
	   }
	   else if (op=='*'){
		   cout<<a*b<<endl;
	   }
	   else if (op=='/') {
		   cout<<a/b<<endl;
	   }
	   else if (op=='?') {
		   return 0;
	   }
   }	   
}



Measured memory_bytes: 3092
//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define st first
#define nd second

using namespace __gnu_pbds;
using namespace std;
 
template <typename T>
using ordered_set =
	tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
 
#define shandom_ruffle random_shuffle
 
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;

const int kMaxN = 6000;
const int mod = 1e9 + 7;

inline void Add(int &x, int y) {
	x += y;
	if (x >= mod) { x -= mod; }
}
inline void Sub(int &x, int y) {
	x -= y;
	if (x < 0) { x += mod; }
}
inline void Mul(int &x, int y) {
	x = (ll)x * y % mod;
}

int PowMod(int a, int n) {
	int r = 1;
	while (n) {
		if (n & 1) { r = (ll)r * a % mod; }
		n >>= 1;
		a = (ll)a * a % mod;
	}
	return r;
}

int dp0[kMaxN][kMaxN];
int dp1[kMaxN][kMaxN];
int sum_dp0[kMaxN];
int sum_dp1[kMaxN];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(11);
	cerr << fixed << setprecision(6);

	int N, A, B;
	cin >> N >> A >> B;
	if (A > B) { swap(A, B); }

	debug() << imie(A) <<imie(B);

	dp0[0][0] = 1;
	sum_dp0[0] = 1;
	for (int n = 1; n <= N; ++n) {
		for (int g = 0; g < B && g <= n; ++g) {
			if (n && g) {
				Add(dp0[n][g], dp0[n-1][g-1]);
				Add(dp0[n][g], dp1[n-1][g-1]);
			}
			if (g == 0) {
				for (int k = 1; k < A && n - k >= 0; ++k) {
					Add(dp1[n][0], sum_dp0[n - k]);
				}
			} else if (g == A) {
				dp1[n][A] = dp0[n - A][0];
			} else if (g > A) {
				dp1[n][g] = dp1[n - 1][g - 1];
				Add(dp1[n][g], dp0[n - A][g - A]);
			}

			debug() << imie(n) << imie(g) << imie(dp0[n][g]) << imie(dp1[n][g]);

			Add(sum_dp0[n], dp0[n][g]);
			Add(sum_dp1[n], dp1[n][g]);
		}
	}

	int res = PowMod(2, N);
	Sub(res, sum_dp0[N]);
	Sub(res, sum_dp1[N]);
	cout << res << "\n";
}


Measured memory_bytes: 141076
a,b,c,x,y=map(int,input().split())
ans=a*x+b*y
if x>y:
    AB=c*y*2 + a*(x-y)
    AB=min(AB, c*x*2)
else:
    AB=c*x*2 + b*(y-x)
    AB=min(AB, c*y*2)
print(min(ans,AB))

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

using namespace std;

const int N = 1e5 + 5 , M = 17;
int p[N][M];

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.in" , "r" , stdin);
#endif
    int n;
    cin >> n;

    vector<int> a(n);
    for (int &x : a)
        cin >> x;

    int l , q;
    cin >> l >> q;

    p[0][0] = 0;
    for (int i = 0 ;i < n ; i++) {
        while (p[i][0] + 1 < n && a[p[i][0] + 1] - a[i] <= l)
            p[i][0]++;

        p[i + 1][0] = p[i][0];
    }

    for (int i = n - 1 ;i >= 0 ;i--)
        for (int j = 1 ;j < M ;j++)
            p[i][j] = p[p[i][j - 1]][j - 1];

    while (q--) {
        int a , b;
        cin >> a >> b;
        a-- , b--;

        if (a > b)
            swap(a , b);

        int ans = 0;
        for (int i = M - 1 ;i >= 0 ;i--) {
            if (p[a][i] < b) {
                ans += 1 << i;
                a = p[a][i];
            }
        }

        cout << ans + 1 << '\n';
    }
}

Measured memory_bytes: 10320
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
#define MOD 1000000007
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(10);
}
signed main(){
  init_io();
  ll n,ans=1;
  cin >> n;
  vector<ll> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  if(n%2==1){
    a.push_back(0);
  }
  sort(a.begin(),a.end());
  ll st = 0;
  if(n%2==0) st = 1;
  for(int i = 0;i+1<n;i+=2){
    ll val;
    val = st+i;
    if(a[i]!=val || a[i+1]!=val){
      ans = 0;
    }else{
      ans *= 2;
      ans %= MOD;
    }
  }
  cout << ans << endl;
}


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

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

int X,Y;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>X>>Y;
	int R=0;
	R+=max(4-X,0)*100000;
	R+=max(4-Y,0)*100000;
	if(X==1 && Y==1) R+=400000;
	cout<<R<<endl;
}


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


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

int main()
{
    long long int a,b,c,d,d1,d2,d3;
    cin>>a>>b>>c>>d;
    a--;
    d1=(b/c)-(a/c);
    d2=(b/d)-(a/d);
    d3=b/((c*d)/__gcd(c,d))-a/((c*d)/__gcd(c,d));
    cout<<b-a-(d1+d2-d3)<<'\n';
    
    return 0;
}


Measured memory_bytes: 256
using System.Collections.Generic;
using System.Linq;
using System;

public class Hello
{
    public static long a, b, c, d;
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        a = long.Parse(line[0]);
        b = long.Parse(line[1]);
        c = long.Parse(line[2]);
        d = long.Parse(line[3]);
        getAns();
    }
    static void getAns()
    {
        var ans = new List<long>();
        ans.Add(a * c);
        ans.Add(a * d);
        ans.Add(b * c);
        ans.Add(b * d);
        Console.WriteLine(ans.Max());
    }
}


Measured memory_bytes: 28292
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

void main() {
    for (int i = 0; i < 3; i++) {
        write(readln[i]);
    }
    writeln();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
long double const pi = std::acos(-1.0L);


int main() {
  string s;
  cin >> s;
  int n=s.size();
  if(s[0]!='A'){
    cout << "WA" << endl;
    return 0;
  }
  int cnt=0;
  int num;
  for(int i = 2; i < n-1; ++i){
    if(s[i]=='C'){
      cnt++;
      num=i;
    }
    
  }
  if(cnt!=1){
    cout << "WA" << endl;
    return 0;
  }
  s.erase(num,1);
  for(int i = 1; i < n-1; ++i){
    if(s[i]<97) {
      cout << "WA" << endl;
      return 0;
    }
  }
  cout << "AC" << endl;
  return 0;
}

Measured memory_bytes: 256
x,y,A,B,C=map(int,input().split())
R=list(map(int,input().split()))
G=list(map(int,input().split()))
N=list(map(int,input().split()))
arr=[]
for i in range(A):
    arr.append([R[i],-1])
for i in range(B):
    arr.append([G[i],-2]) 
for i in range(C):
    arr.append([N[i],-3])    
arr.sort(reverse=True)
ans=0
adv=0
for i in range(len(arr)):
    if x+y==adv:
        break
    if arr[i][1]==-1:
        if x>0:
            ans+=arr[i][0]
            x-=1 
    elif arr[i][1]==-2:
        if y>0:    
            ans+=arr[i][0]
            y-=1
    else:
        ans+=arr[i][0]
        adv+=1 
        
print(ans)        

Measured memory_bytes: 128100
#include <stdio.h>
/*　pivot関数
	ピボットの決定を行う
	引数は、配列の先頭アドレス、左端のindex、右端のindex
	数列の左から見て、最初に得られた異なる2要素のうち
	大きいほうの要素番号を返す。
	数列の値がすべて同じ場合は -1 を返す。
*/
int pivot(int *a, int i, int j)
{
	int k = i + 1;
	while(k <= j && a[i] == a[k]){
		k++;
	}
	if(k > j){
		return -1;
	}
	if(a[i] >= a[k]){
		return i;
	}
	return k;
}

/*
	partition関数
	a[i] ~ a[j]の間で、pivotを軸として分割を行う。
	引数は、配列の先頭アドレス、左端のindex、右端のindex、ピボットの値
	返り値は、ピボット以上のグループの開始番号
*/
int partition(int *a, int l, int r, int pivot)
{
	int tmp;
	while(l < r){
		while(a[l] < pivot){
			l++;
		}
		while(a[r] >= pivot){
			r--;
		}
		if(l < r){
			tmp = a[l];
			a[l] = a[r];
			a[r] = tmp;
			l++;
			r--;
		}
	}
	return l;
}

void quick_sort(int *a, int i, int j)
{
	if(i == j) return;
	int p = pivot(a, i, j);
	if(p != -1){
		int k = partition(a, i, j, a[p]);
		quick_sort(a, i, k - 1);
		quick_sort(a, k, j);
	}
}

int main()
{
	int n, i, j;
	int a[200000];
	scanf("%d", &n);
	
	for(i = 0; i < n; i++){
		scanf("%d ", &a[i]);
	}
	quick_sort(a, 0, n - 1);
	for(i = 0; i < n - 1; i++){
		if(a[i] == a[i + 1]){
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	
	return 0;
}

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

int main() {
  int n, max_w;
  cin >> n >> max_w;
  vector<int> v(n);
  vector<int> w(n);
  rep (i, n) {
    cin >> w[i] >> v[i];
  }
  vector<vector<ll>> dp(n+1,vector<ll>(max_w+1, -1));
  dp[0][0] = 0;
  rep (i, n) {
    rep (j, max_w+1) {
      if (dp[i][j] == -1) continue;
      dp[i+1][j] = max(dp[i+1][j], dp[i][j]);
      if (j+w[i] <= max_w) dp[i+1][j+w[i]] = max(dp[i][j] + v[i], dp[i+1][j+w[i]]);
    }
  }
  ll maximum = 0;
  rep (i, max_w+1) {
    maximum = max(maximum, dp[n][i]);
  }
  cout << maximum << endl;
  return 0;
}


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

int main(){
	int n;
	cin >> n;
	int ac,wa,tle,re;
	ac = wa = tle = re = 0;
	rep(i,n){
		string s;
		cin >> s;
		if(s == "AC") ac++;
		else if (s == "WA") wa++;
		else if (s == "TLE") tle++;
		else if (s == "RE") re++;
	}
	cout << "AC x " << ac << endl;
	cout << "WA x " << wa << endl;
	cout << "TLE x " << tle << endl;
	cout << "RE x " << re<< endl;
	return 0;
}

Measured memory_bytes: 3632
#include<iostream>
using namespace std;
int main(){
	int A,B;
	cin>>A>>B;
	if(B<0){
		if(A-B>A*B){
			cout<<A-B<<endl;
		}else{
			cout<<A*B<<endl;
		}
	}else{
		if(A+B>A*B){
			cout<<A+B<<endl;
		}else{
			cout<<A*B<<endl;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int , int> pi;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll n;
	cin>>n;
	ll answer = n*(n+1)/2;
	ll t = n/3;
	ll f = n/5;
	ll fif = n/15;
	answer -= 3*t*(t+1)/2;
	answer -= 5*f*(f+1)/2;
	answer += 15*fif*(fif+1)/2;
	cout<<answer<<endl;
	return 0;
};


Measured memory_bytes: 3640
import java.util.*;

class Main{            
     
   public static void main(String[] args){
       Scanner sc = new Scanner(System.in);  
       
       int b4 = 0;
       int b2 = 0;
       int b1 = 0;
       
       int N = sc.nextInt();
       
       for(int i = 0;i < N;i++){
           int a = sc.nextInt();
           int count = 0;
           while(a%2 ==0){
               a/=2;
               count++;
           }           
           if(count >=2){
               b4++;
           }
           else if(count >= 1){
               b2++;
           }
           else if(count == 0){
               b1++;
           }
       }
       
       if(b2 > 0){
           if(b4 >= b1){
               System.out.println("Yes");
               return;
           }else{
               System.out.println("No");
               return;
           }
       }       
       
       if(b2 == 0){
           if(b4 +1>=b1){
               System.out.println("Yes");
           }else{
               System.out.println("No");               
           }           
       }
              
       
   }
}
             

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

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e18
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
ll mod = 1e9+7;
void ans(bool b, ostream& out=cout){ out << (b ? "Yes" : "No") << endl; }
void ans2(bool b, ostream& out=cout){ out << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){fill((T*)array, (T*)(array+N), val);}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};

#ifndef INCLUDE_DEBUG_HPP
#define INCLUDE_DEBUG_HPP

class debug
{
public:
    template<typename T> void vdeb(T vec);
    template<typename T1, typename T2> void adeb(T1 *arr, T2 n);
    template<typename T> void mdeb(T mp);
};

#endif //INCLUDE_DEBUG_HPP

template<typename T> void debug::vdeb(T vec)
{
    cout << "#vector set debug" << endl;
    for(auto vv : vec) cout << vv << " ";
    cout << endl;
}

template<typename T1, typename T2> void debug::adeb(T1 *arr, T2 n)
{
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}

template<typename T> void debug::mdeb(T mp)
{
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
debug dbg;

class AGrouping2 {
public:
	void solve(std::istream& in, std::ostream& out)
	{
	    int n;
	    in >> n;
	    int res = n / 3;
	    out << res << endl;
	}
};


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


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

int main() {
  int N;
  cin >> N;
  
  map<string, int> data;
  
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    data[s] += 1;
  }
  
  int d_max = 0;
  
  for (auto d : data) {
    d_max = max(d_max, d.second);
  }
  
  vector<string> ans;
  
  for (auto d : data) {
    if (d.second == d_max) {
      ans.push_back(d.first);
    }
  }
  
  sort(ans.begin(), ans.end());
  
  for (auto a : ans) {
    cout << a << endl;
  }
  
  return 0;
}


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

int main() {  
  int n, k;
  string s;
  cin >> n >> s >> k;
  for(int i = 0; i < n; i++) {
    if(s[i] != s[k-1]) s[i] = '*';
  }
  cout << s << "\n";
}

Measured memory_bytes: 256
def solution(path1, path2, path3):
    counts = [0, 0, 0, 0]
    paths = [path1, path2, path3]
    for path in paths:
        counts[path[0] - 1] += 1
        counts[path[1] - 1] += 1

    countsOfCounts = [0, 0]
    for count in counts:
        if count == 1:
            if countsOfCounts[0] == 2:
                return "NO"
            countsOfCounts[0] += 1
        elif count == 2:
            if countsOfCounts[1] == 2:
                return "NO"
            countsOfCounts[1] += 1
        else:
            return "NO"
    return "YES"


path1 = [int(s) for s in input().split(' ')]
path2 = [int(s) for s in input().split(' ')]
path3 = [int(s) for s in input().split(' ')]

print(solution(path1, path2, path3))


Measured memory_bytes: 3064
import Control.Monad
import Text.Printf
import Control.Applicative
import Data.List as L

main :: IO()
main = do
  [a, b, c, x, y] <- map read . words <$> getLine
  printf "%d" $ slv a b c x y

slv :: Int -> Int -> Int -> Int -> Int -> Int
slv a b c x y = minimum [cost1, cost2, cost3]
  where cost1 = 2 * c * max x y
        cost2 = x * a + b * y
        cost3 = 2 * c * min x y + (x - min x y) * a + (y - min x y) * b

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


int main(){
	int n;
	while(cin>>n&&n){
		double a=1e10;
		int ans=0;
		for(int i=0;i<n;i++){
			int id,h,w;
			cin>>id>>h>>w;
			double bmi=w/(h*h*1e-4);
			if(fabs(bmi-22)<a){
				a=fabs(bmi-22);
				ans=id;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
N = int(input())
a_list = [int(x) for x in input().split()]
cnt = 0
b_list = set()
for i in range(len(a_list), 0, -1):
    tmp = 0
    for j in range(i*2, N+1, i):
        tmp ^= (j in b_list)
    if (tmp != a_list[i-1]):
        b_list.add(i)
M = len(b_list)
print(M)
if (M>0):
    print(" ".join([str(b) for b in b_list]))


Measured memory_bytes: 76124
N, x = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]
eat = [0] * N
eat[0] = max(A[0] - x, 0)
for i in range(N - 1):
    eat[i + 1] = max(A[i + 1] + A[i] - eat[i] - x, 0)
print(sum(eat))


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

typedef long long   ll;
typedef long double ld;
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll x;
    cin >> x;

    ll year=0;
    double chokin=100;
    while(true) {
        chokin*=1.01;
        chokin=floor(chokin);
        year++;
        if(chokin>=x){
            cout << year << "\n";
            return 0;
        }
    }
    return 0;
}

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

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int getRand(int l, int r)
{
    uniform_int_distribution<int> uid(l, r);
    return uid(rng);
}
  
#define int long long 
#define pb push_back
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define vi vector<int>
#define pii pair<int,int>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define precise(x) fixed << setprecision(x) 

const int MOD = 998244353;

int mod_pow(int a,int b,int M = MOD)
{
    int res = 1;
    
    while(b)
    {
        if(b&1) res=(res*a)%M;
        a=(a*a)%M;
        b>>=1;
    }
    
    return res;
}


void solve()
{
    long double a;
    cin >> a;
    
    long double b;
    cin >> b;
    
    long double c = b;
    c = (c*a);
    
    int res = floor(c);
    
    cout << res;
}

signed main()
{
    fast;
    
    int t = 1;
    
//    cin >> t;
    
    while(t--)
        
    solve();
}

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

int main() {
  int N;
  cin >> N;
  vector<int> card(N);
  for (int i=0; i<N; i++) {
    cin >> card.at(i);
  }
  
  int count=0;
  int num = 100;
  int turn=1;
  int A=0;
  int B=0;
  while (count<N) {
    for (int j=0; j<N; j++) {
      if (card.at(j)==num) {
        if (turn==1)
          A += num;
        else
          B += num;
        card.at(j) = 0;
        turn *= -1;
        count++;
        num++;
        break;
      }
    }
    num--;
  }
  cout << A-B << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int main(){
    ll n; cin>>n;
    vector<pair<ll,ll>> child(n, {-1, -1});
    vector<ll> par(n, -1), sib(n, -1), depth(n, -1), height(n, -1);
    rep(i,n){
        ll id, l, r; cin>>id>>l>>r;
        child[id]={l, r};
        if(l!=-1){par[l]=id; sib[l]=r;}
        if(r!=-1){par[r]=id; sib[r]=l;}
    }
    rep(i,n){
        if(child[i].first==-1 && child[i].second==-1){
            height[i]=0;
            ll tmp=i;
            while(true){
                if(par[tmp]==-1) break;
                chmax(height[par[tmp]], height[tmp]+1);
                tmp=par[tmp];
            }
        }
    }
    ll root;
    rep(i,n) if(par[i]==-1) root=i;
    queue<ll> que;
    que.push(root);
    depth[root]=0;
    while(!que.empty()){
        ll x=que.front();
        que.pop();
        pair<ll,ll> y=child[x];
        if(y.first!=-1){
            depth[y.first]=depth[x]+1;
            que.push(y.first);
        }
        if(y.second!=-1){
            depth[y.second]=depth[x]+1;
            que.push(y.second);
        }
    }
    rep(i,n){
        cout<<"node "<<i<<": ";
        cout<<"parent = "<<par[i]<<", ";
        cout<<"sibling = "<<sib[i]<<", ";
        cout<<"degree = ";
        ll deg;
        if(child[i].first==-1 && child[i].second==-1) deg=0;
        else if(child[i].first==-1 || child[i].second==-1) deg=1;
        else deg=2;
        cout<<deg<<", ";
        cout<<"depth = "<<depth[i]<<", ";
        cout<<"height = "<<height[i]<<", ";
        if(depth[i]==0) cout<<"root"<<endl;
        else if(deg==0) cout<<"leaf"<<endl;
        else cout<<"internal node"<<endl;
    }
    return 0;
}


Measured memory_bytes: 3100
#include<bits/stdc++.h>
#define YY "YES\n"
#define NN "NO\n"
#define LL long long
using namespace std;

int a,b,h,w;
int main(){
	cin>>h>>w>>a>>b;
	for (int i=1;i<=b;i++){
		for (int j=1;j<=a;j++) cout<<0;
		for (int j=1;j<=w-a;j++) cout<<1;
		cout<<"\n";
	}
	for (int i=1;i<=h-b;i++){
		for (int j=1;j<=a;j++) cout<<1;
		for (int j=1;j<=w-a;j++) cout<<0;
		cout<<"\n";
	}
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a<b?a:b
#define REP(i,x,n) for(int i=x;i<n;i++)
#define REPR(i,x,n) for(int i=n-1;i>=x;i--)
#define pb  push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLr(obj) (obj).rbegin(), (obj).rend()
#define endl "\n"
#define F first
#define S second
#define EN cout<<endl;
using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll,ll,ll> PP;
typedef tuple<ll,ll,ll,ll> PPP;
const ll mod=1000000007;
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outvvp(T v){rep(i,v.size())outvp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void yes(T b){if(b)out("yes");else out("no");}
template<class T> void Yes(T b){if(b)out("Yes");else out("No");}
template<class T> void YES(T b){if(b)out("YES");else out("NO");}
template<class T> void no(T b){if(b)out("no");else out("yes");}
template<class T> void No(T b){if(b)out("No");else out("Yes");}
template<class T> void NO(T b){if(b)out("NO");else out("YES");}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll modpow(ll a,ll b){ll res=1;a%=mod;while(b){if(b&1)res=res*a%mod;a=a*a%mod;b>>=1;}return res;}
 


int main(){
    ll n;cin>>n;
    if(n%1000)
    cout<<1000-(n%1000)<<endl;
    else cout<<0<<endl;


    
}


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

#define ll long long
using namespace std; 

int main() 
{ 
   long n,x;
   cin>>n>>x;
   long a[n],sum=0,c=1;
   for(long i=0;i<n;i++){
       cin>>a[i];
       sum+=a[i];
       if(sum<=x){
           c++;
       }
   }
   cout<<c;
   return 0;
}





Measured memory_bytes: 3604
#include<bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define repk(i,k,n) for (ll i = k; i < (ll)(n); ++i)
#define INF 5000000000
#define MOD 1000000007
typedef long long  ll;

using namespace std;

int ans, cnt;

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

	string S, T;
	cin >> S >> T;
	
	rep(i, S.size()) {
		if (S[i] != T[i]) {
			cout << "No" << endl;
			return 0;
		}
	}

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

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

long long A, B;
int main(){
	scanf("%lld %lld", &A, &B);
	long long g = __gcd(A, B);
	
	int res = 1;
	for(long long d = 2; d * d <= g; d++){
		if(g % d != 0)continue;
		
		res++;
		while(g % d == 0)g /= d;
	}
	if(g > 1)res++;
	printf("%d\n", res);
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    int x,y,i,j;
    string s;
    cin>>x>>y;
    getchar();
    for(i=0;i<=y+1;i++) cout<<"#";
    cout<<endl;
    for(i=1;i<=x;i++){
    	getline(cin,s);
    	cout<<"#"<<s<<"#"<<endl;
	}
	for(i=0;i<=y+1;i++) cout<<"#";
	return 0;
}


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

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  a.begin(),a.end()

class CommonIO {
public:
    CommonIO() {
        std::cin.tie(0);
        std::ios::sync_with_stdio(false);
    }
    ~CommonIO() {}

    template <class T>
    void scan(T &v) {
        std::cin >> v;
    }
    template <class T, class... Rest>
    void scan(T &v, Rest&... rest) {
        scan(v);
        scan(rest...);
    }

    template <class T>
    void print(T v) {
        std::cout << v;
    }
    template <class T>
    void print(std::vector<T> &v) {
        if (v.size() == 0) return;
        print(*v.begin());
        for (auto it = ++v.begin(); it != v.end(); ++it) {
            print(' ');
            print(*it);
        }
    }
    template <class T>
    void print(std::vector< std::vector<T> > &grid) {
        if (grid.size() == 0) return;
        print(*grid.begin());
        for (auto it = ++grid.begin(); it != grid.end(); ++it) {
            print('\n');
            print(*it);
        }
    }
    template <class T, class... Rest>
    void print(T v, Rest... rest) {
        print(v);
        print(' ');
        print(rest...);
    }

    template <class T>
    void printl(T v) {
        print(v);
        std::cout << '\n';
    }
    template <class T, class... Rest>
    void printl(T v, Rest... rest) {
        print(v);
        print(' ');
        printl(rest...);
    }
} io;


struct Infant {
  int index;
  ll active;

  ll point(int i) {
    return active * abs(index - i);
  }
};

int main() {
  ll N; io.scan(N);
  vector<Infant> A(N+2);
  REP(i, N) {
    A[i].index = i+1;
    io.scan(A[i].active);
  }
  sort(ALL(A), [](Infant& a, Infant& b) {return a.active >= b.active;});
  
  ll dp[2002] = {0,}, dp2[2002] = {0,};
  ll i, x, y;
  for (ll sum=1; sum<=N; ++sum) {
    swap(dp, dp2);
    ll aa = A[sum-1].active, ai = A[sum-1].index;
    // x = 0, y = sum
    dp[0] = dp2[0] + aa*abs(ai-(N-sum+1));
    // x = 1 ~ sum-1
    ll iend = min(ai, sum);
    for (i=1, x=aa*(ai-i), y=aa*(N-sum+i+1-ai); i<iend; x-=aa, y+=aa, ++i) {
      dp[i] = max(dp2[i-1] + x, dp2[i] + abs(y)); 
    }
    for (i=ai, x=0, y=aa*(N-sum+i+1-ai); i<sum; x+=aa, y+=aa, ++i) {
      dp[i] = max(dp2[i-1] + x, dp2[i] + abs(y));
    }
    // x = sum, y = 0
    dp[sum] = dp2[sum-1] + aa*abs(ai-sum);
  }
  
  io.printl(*max_element(dp, dp+N+1));
  
  return 0;
}


Measured memory_bytes: 3664
#include<stdio.h>
int main(void)
{
	int a,s,d,f,g,i;
	s=100000;
	scanf("%d",&a);
	for(i=1;i<=a+1;i++){
	s=s+d;
		d=(s/100)*5;
		if(d%1000!=0){
			g=d/1000;
			d=(g+1)*1000;
		}
	}
	printf("%d\n",s);
	return 0;
}

Measured memory_bytes: 1020
S = input()
S = S[::-1]
divide = list(map(lambda phrase:phrase[::-1], ['dream', 'dreamer', 'erase', 'eraser']))

flag = False
i = 0
while i != len(S):
    flag = False
    for d in divide:
        if S[i:i+len(d)] == d:
            flag = True
            i += len(d)
            break

    if flag == False:
        break

print('YES' if flag else 'NO')


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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second

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

    int ans=0;
    rep(i,S-1) ans+=(s[i]!=s[i+1]);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 512
import math
import os
import sys
# from fractions import gcd
input = sys.stdin.readline

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


def main():
    a, b, x = list(map(int, input().split()))

    h = x / float(a ** 2)
    remain = b - h
    ans = math.degrees(math.atan2(remain, a/2))
    limit = math.degrees(math.atan2(h, a/2))
    # limit = x / float(a ** 2)
    # # limit_degree = math.degrees(math.atan2(limit, a))
    # print(limit + h < b)
    # print(limit)

    if ans <= limit:
        print(ans)
    else:
        # x = b * a * t / 2
        t = 2 * x / (b * a)
        deg = math.degrees(math.atan2(b, t))
        print(deg)


if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
/*
Though leaves are many , the root is one.
Through all the lying days of my youth
I swayed my leaves and flowers in the sun.
Now I may wither into the truth.
	  	  	- William Butler Yeats
*/
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
//#pragma GCC target("avx,tune=native")
#include<bits/stdc++.h>
#define int long long
#pragma comment("-Wl,--stack=1024000000")
//#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
const int inf=0x3f3f3f3f;
const double eps=1e-6;
const int mod=1000000007;
typedef long long ll;
#ifndef LOCAL
#define cerr if(0)cout
#define eprintf(...) 0
#else
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#endif
inline string getstr(string &s,int l,int r){string ret="";for(int i=l;i<=r;i++)ret.push_back(s[i]);return ret;}
int modpow(int x,int y,int md=mod){int ret=1;do{if(y&1)ret=(ll)ret*x%md;x=(ll)x*x%md;}while(y>>=1);return ret;}
inline int Rand(){return rand()*32768+rand();}
int n,c,h[200005],dp[200005];
typedef pair<int,int> func;
vector<func>stk;
void show(){
	cerr<<"show func:"<<endl;
	for(int i=0;i<stk.size();i++){
		cerr<<-stk[i].first<<" "<<-stk[i].second<<endl;
	}
	cerr<<"end"<<endl;
}
void add_stack(int x){
	//a=h[i],b=h[i]^2+dp[i]
	func f3=make_pair(2ll*h[x],-h[x]*h[x]-dp[x]);
	while(stk.size()>=2){
		func f2=stk.back();stk.pop_back();
		func f1=stk.back();stk.pop_back();
		if((f3.second-f1.second)*(f2.first-f1.first)>(f2.second-f1.second)*(f3.first-f1.first)){
			stk.push_back(f1);
		}else{
			stk.push_back(f1);
			stk.push_back(f2);
			break;
		}
	}
	stk.push_back(f3);
	show();
}
int f(func f,int v){
	return -v*f.first-f.second;
}
int query(int v){
	int l=0,r=stk.size();
	while(r-l>1){
		int mid=(l+r)/2;
		if(f(stk[mid],v)<f(stk[mid-1],v))l=mid;
		else r=mid;
	}
	return f(stk[l],v);
}
signed main(){
	cin>>n>>c;
	for(int i=1;i<=n;i++)cin>>h[i];
	dp[1]=0;add_stack(1);
	for(int i=2;i<=n;i++){
		dp[i]=h[i]*h[i]+c+query(h[i]);
		add_stack(i); 
	}
	cout<<dp[n]<<endl;
	return 0;
}

Measured memory_bytes: 9200
#include <bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int MOD = 1e9 + 7;
using namespace std;
const int N = 100010;
int v[N] = {},dp[N] = {};
int n,k;

int fun(int idx)
{
	if(idx == n)
		return 0;
	if(dp[idx] != -1)
		return dp[idx];
	int ans = 1e18;
	for(int i = idx + 1;i <= n && i <= idx + k;i++)
	{
		ans = min(ans,fun(i) + abs(v[i] - v[idx]));
	}
	dp[idx] = ans;
	return ans;
}

int32_t main()
{
    IOS
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/
    cin >> n >> k;
    for(int i = 1;i<=n;i++)
    {
    	cin >> v[i];
    }
    memset(dp,-1,sizeof(dp));
    cout << fun(1) << '\n';
    return 0;
}

Measured memory_bytes: 6656
//minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
const int N=2e5+5;
char s[N];int a[N],n,x,m,res,y,d;
inline int calc(R int i,R int j){
	if(i<=x&&j>=y)return j-i-(y-x)+1;
	if(i<=x&&j<=x)return j-i;
	if(i>=y&&j>=y)return j-i;
	if(i<=x)return min(j-i,y-j+1+x-i);
	if(j>=y)return min(j-i,j-y+1+i-x);
	return min(j-i,i-x+y-j+1);
}
int main(){
//	freopen("testdata.in","r",stdin);
	scanf("%d%d%d",&n,&x,&y);
	fp(i,1,n)fp(j,i+1,n)++a[calc(i,j)];
	fp(i,1,n-1)printf("%d\n",a[i]);
	return 0;
}

Measured memory_bytes: 256
def div_with_mod(x, y, mod):
    # Fermat's little theorem
    return x*pow(y, mod - 2, mod)


def solve():
    N, K = map(int, input().split())
    mod = 10**9+7

    s = 0
    s_1 = 0
    a = []
    b = 0
    ans = 0
    for i in range(N+1):
        b += i
        a.append(b)

    for i in range(K, N+1):
        s = a[i-1]
        s_1 = a[N]-a[N-i]
        ans += s_1-s + 1
    print(ans % mod + 1)


if __name__ == "__main__":
    solve()


Measured memory_bytes: 78536
IDENTIFICATION                   DIVISION.
PROGRAM-ID.                      ABC_073_A.
ENVIRONMENT                      DIVISION.
DATA                             DIVISION.
WORKING-STORAGE                  SECTION.
    01 INP    PIC X(2).

PROCEDURE                        DIVISION.
MAIN.
    ACCEPT INP.

    IF INP(1:1) = 9 OR INP(2:1) = 9 THEN
        DISPLAY "Yes"
    ELSE
        DISPLAY "No"
    END-IF

    STOP RUN.


Measured memory_bytes: 764
def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop
n=n0()
V=n1()
V0=[V[i] for i in range(n) if i%2==0]
V1=[V[i] for i in range(n) if i%2==1]

c0=list(Counter(V0).items())
c1=list(Counter(V1).items())
c0.sort(key=lambda x:-x[1])
c1.sort(key=lambda x:-x[1])

if c0[0][0]!=c1[0][0]:
    ans=n-c0[0][1]-c1[0][1]
else:
    if len(c0)==1 or len(c1)==1:
        if len(c0)==len(c1)==1:
            ans=n-c0[0][1]
        elif len(c0)==1:
            ans=n-c1[1][1]
        else:
            ans=n-c0[1][1]        
    elif c0[0][1] > c1[0][1]:
        ans=n-c0[0][1]-c1[1][1]
    elif c0[0][1] < c1[0][1]:
        ans=n-c0[1][1]-c1[0][1]
    else:
        if c0[1][1] > c1[1][1]:
            ans=n-c0[1][1]-c1[0][1]
        else:
            ans=n-c0[0][1]-c1[1][1]
print(ans)

Measured memory_bytes: 21084
#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long n,s=0,m;
	scanf("%lld",&n);
	m=n;
	while(n)
	{
		s+=n%10;
		n/=10;
	}
	if(m%s==0)
		printf("Yes");
	else
		printf("No");
	return 0;
}

Measured memory_bytes: 256
Option Infer On
Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim N As Integer = NextInt()
        Dim M As Integer = NextInt()
        Dim dic = New Dictionary(Of Integer, Integer)

        For i = 1 To M
            Dim a = NextInt()
            Dim b = NextInt()

            Add(dic, a)
            Add(dic, b)
        Next

        For i = 1 To N
            If Not dic.ContainsKey(i) Then
                WriteLine(0)
            Else
                WriteLine(dic(i))
            End If
        Next
    End Sub

    Sub Add(dic As Dictionary(Of Integer, Integer), a As Integer)
        If Not dic.ContainsKey(a) Then
            dic(a) = 1
        Else
            dic(a) += 1
        End If
    End Sub

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function

End Module


Measured memory_bytes: 19920
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<(n);i++)
#define MOD 1000000007
#define all(n) (n).begin(),(n).end()
typedef long long ll;
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}else{return 0;}}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}else{return 0;}}
template <class T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <class T> inline T LCM(T a,T b){return a*b/GCD(a,b);}

ll n,q;
ll a[200010],b[200010];
ll v[200010];
bool reached[200010]={0};
vector<ll> g[200010];

void dfs(ll s){
	reached[s]=1;
	FOR(i,g[s].size()){
		if(!reached[g[s][i]]){
			v[g[s][i]]+=v[s];
			dfs(g[s][i]);
		}
	}
}

int main(){
	
	cin >> n >> q;
	
	FOR(i,n-1){
		cin >> a[i] >> b[i];
		g[a[i]].push_back(b[i]);
		g[b[i]].push_back(a[i]);
	}

	
	FOR(i,200005){
		v[i]=0;
		
	}
	ll p,x;
	FOR(i,q){
		cin >> p >> x;
		v[p]+=x;
	}
	dfs(1);
	FOR(i,n){
		cout << v[i+1] << " ";
	}
	cout << endl;

}


Measured memory_bytes: 27520
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

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


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const ll INF = 1e9 + 7;


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

const ll MOD = 1e9 + 7;



//ユークリッド互除法
template<typename T>
T gcd(T x, T y) {

	if (y == 0) {
		return x;
	}
	else {
		return gcd(y, x % y);
	}
}
/*最小公倍数*/
template<typename T>
T lcm(T x, T y) {
	T tmp = gcd(x, y);
	return (x / tmp) * y;
}


/******************************************************************************************/


int main() {


	vector<int> a(3);
	for (int i = 0; i < 3; i++)
	{
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	cout << a[0] + a[1] << endl;










	return 0;
}


Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
int fact(int n){
  int m;
  if (n == 0)
      return 1;
  m = fact(n - 1);    
  return n * m;       
}
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h,w,k;
    cin>>h>>w>>k;
    vector<string> s(h);
    rep(i,h){
        cin>>s[i];
    }
    int flag=1;
    vector<vector<int> > count(h,vector<int>(w));
    rep(i,h){
        rep(j,w){
            if(s[i][j]=='#'){
                count[i][j]=flag;
                flag++;
            }
        }
    }
    int count2=0,count3=0;
    rep(i,h){
        rep(j,w){
            count2=0;
            count3=0;
            if(count[i][j]!=0){
                count2=j-1;
                flag=count[i][j];
                while(true){
                    if(count2<0){
                        break;
                    }
                    if(count[i][count2]!=0){
                        break;
                    }
                    count[i][count2]=flag;
                    count2--;
                }
                count3=j+1;
                while(true){
                    if(count3>=w){
                        break;
                    }
                    if(count[i][count3]!=0){
                        break;
                    }
                    count[i][count3]=flag;
                    count3++;
                }
            }
        }
    }
    rep(i,w){
        rep(j,h){
            count2=0;
            count3=0;
            if(count[j][i]!=0){
                count2=j-1;
                flag=count[j][i];
                while(true){
                    if(count2<0){
                        break;
                    }
                    if(count[count2][i]!=0){
                        break;
                    }
                    count[count2][i]=flag;
                    count2--;
                }
                count3=j+1;
                while(true){
                    if(count3>=h){
                        break;
                    }
                    if(count[count3][i]!=0){
                        break;
                    }
                    count[count3][i]=flag;
                    count3++;
                }
            }
        }
    }
    rep(i,h){
        rep(j,w){
            if(j!=w-1){
                cout<<count[i][j]<<' ';
            }
            else{
                cout<<count[i][j]<<'\n';
            }
        }        
    }
    return(0);
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define itrep(it, a) for(it = (a).begin(); it != (a).end(); it++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 30)
using namespace std;

int dis(int a, int b){
    return (a - b) * (a - b);
}

int main(){
    int n, a[105];
    int ans = INF;
    cin >> n;
    rep(i,n){
        cin >> a[i];
    }
    range(i,-100,101){
        int sum = 0;
        rep(j,n){
            sum+=dis(a[j], i);
        }
        ans = min(ans, sum);
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
'use strict'

function Main(input) {
    let abc = input.trim().split(' ').map((v)=>parseInt(v));

    if(abc[0]<abc[1]){
        if(abc[0]<abc[2] && abc[2] < abc[1]){
            console.log('Yes');
        } else {
            console.log('No');
        }
    } else {
        if(abc[0]>abc[2] && abc[2] > abc[1]){
            console.log('Yes');
        } else {
            console.log('No');
        }
    }

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 21064