akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<typename T>
vector<T> table(int n, T v) { return vector<T>(n, v); }

template <class... Args>
auto table(int n, Args... args) {
    auto val = table(args...);
    return vector<decltype(val)>(n, move(val));
}
const ll INF = 1e9;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b;
    cin >> a >> b;
    PRINT(a*b-a-b+1);
}

Measured memory_bytes: 256
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy > 0:
        out = str(X_dumy % n) + out
        X_dumy = int(X_dumy / n)
    return out

a, b = map(int, input().split())
print("{}".format(len(Base_10_to_n(a,b)))) 

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
#define F first
#define S second
#define pb push_back
mt19937 rnd;

const int N = 1e3 + 10, H = 1e4 + 10;
int a[N], b[N], dp[N][H];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
#endif

    int h, n;
    cin >> h >> n;
    for (int i=1; i<=n; i++) {
        cin >> a[i] >> b[i];
    }
    for (int j=1; j<=h; j++) {
        dp[1][j] = (j + a[1] - 1) / a[1] * b[1];
    }
    for (int i=2; i<=n; i++) {
        for (int j=1; j<=h; j++) {
            dp[i][j] = dp[i-1][j];
            if (j <= a[i]) {
                dp[i][j] = min(dp[i][j], b[i]);
            }
            else {
                dp[i][j] = min(dp[i][j], dp[i][j-a[i]] + b[i]);
            }
        }
    }
    cout << dp[n][h] << "\n";

#ifdef LOCAL
    cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
   return 0;
}


Measured memory_bytes: 39424
#include <bits/stdc++.h>
using namespace std;
long long n, m, j, i, k, s;
int main(){
	scanf("%d", &n);
	for(i=-4999; i<=5000; i++){
		for(j=-1000; j<=1000; j++){
			k=i*i*i*i*i-j*j*j*j*j;
			if(k==n){
				printf("%d %d\n", i, j);
				break;
			}
		}
		if(k==n) break;
	}
	return 0;
}

Measured memory_bytes: 3816
#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
#include<string>
#include<unordered_map>
#include<math.h>
using namespace std;
using ll = long long;
int main(){
    string N;
    cin >> N;
    for(int i = 2;i <= N.size()-1;i++){
        if(N[i] == N[i-1] && N[i-1] == N[i-2]){
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";
    return 0;
}

Measured memory_bytes: 256
program H2020A
    implicit none
    integer(8)::i
    integer(8)::flg=0
    character(10)::S
    read(5,*)S
    do i=1,len_trim(S),2
        if(S(i:min(len_trim(S),i+1))/="hi")then
            flg=1
            exit
        end if
    end do

    if(flg==0)print'(A)',"Yes"
    if(flg==1)print'(A)',"No"
end program H2020A

Measured memory_bytes: 640
fun main(args: Array<String>){
    val S = readLine()!!
    var min = 1000

    for(i in 0..S.length-3){
        var num = S.substring(i..i+2).toInt()
        if(Math.abs(753-num) <= min){
            min = Math.abs(753-num)
        }
    }
    println(min)
}

Measured memory_bytes: 33732
///============================================================================
/// Name        : Faisal.cpp
/// Author      : Faisal Ahmed
/// Version     :
/// Copyright   : Your copyright notice
/// Description : C++, Ansi-style
///============================================================================
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef long double ld;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	ll ans = 0, n, x;
    ll arr[100010];

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

    for(int i = 0; i < n - 1; i++){
        int d = arr[i] + arr[i + 1];

        if(d > x){
            ll m = d - x;

            if(m > arr[i + 1]){
                arr[i + 1] = 0;
            }
            else{
                arr[i + 1] -= m;
            }

            ans += m;
        }
    }

    cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1024
#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;
    string s;
    cin >> s;
    string t;
    rep(i, n / 2) t += s[i];
    t += t;
    if (s == t)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}

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

int main(void){

    int N; cin>>N;
    int ans=1e+9;

    for (int i = 0; i < N; ++i) {
        int tmp; cin>>tmp;
        if(tmp%2!=0) {
            ans = 0;
            break;
        }
        int cnt=0;
        while(tmp%2==0){
            tmp /= 2;
            cnt++;
        }
        ans = min(ans, cnt);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define inf 1e9+1
struct knapsack{
    ll wt;
    ll val;
};
ll solve(vector<knapsack>a , ll n,  ll W){
    ll maxVal = n*1000;
    ll dp[n+1][maxVal+1];
    for(ll val=0 ; val<=maxVal ; val++){
        dp[1][val] = inf;
    }
    dp[1][a[1].val] = a[1].wt;
    dp[1][0] = 0;

    for(ll i=2 ; i<=n ; i++){
        for(ll v=0 ; v<=maxVal ; v++){
            dp[i][v] = dp[i-1][v];
            if(a[i].val > v){
                continue;
            }
            dp[i][v] = min(dp[i][v] , a[i].wt + dp[i-1][v-a[i].val]);
        }
    }
    ll ans = 0;
    for(ll x= 0 ; x<=maxVal ; x++){
        if(dp[n][x] <= W){
            ans = x;
        }
    }
    return ans;
}
int main(){
   ll n  , W;
   cin>>n>>W;
   vector<knapsack>a(n+1);
   for(ll i=1 ; i<=n ; i++){
       cin>>a[i].wt>>a[i].val;
   }
   cout<<solve(a , n , W);
   return 0;
}

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

char a[100][100], b[102][102];
int main() 
{
	int H, W;
	cin >> H >> W;
	for (int i = 0; i < H; i++)
	{
		cin >> a[i];
	}

	for (int i = 0; i < H + 2; i++)
	{
		for (int j = 0; j < W + 2; j++)
		{
			b[i][j] = '#';
		}
	}

	for (int i = 0; i < H; i++)
	{
		for (int j = 0; j < W; j++)
		{
			b[i + 1][j + 1] = a[i][j];
		}
	}
	for (int i = 0; i < H + 2; i++) {
		for (int j = 0; j < W + 2; j++)
		{
			cout << b[i][j];
		}
		cout << endl;
	}
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <queue>
#include <vector>
#include <string>
#include <sstream>
#include <utility>
#include <deque>
#include <numeric>
#include <map>
#include <stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define INF 100000

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

#define MOD 1000000007

ll c[60];

int main () {
    ll N;
    cin >> N;
	vector<ll> a(N);
	rep(i,N) cin >> a[i];
	rep(k,60) rep(i,N)
		c[k] += (a[i] >> k) & 1;
	ll ans = 0;
	ll tmp;
	ll b = 1;
	rep (k,60) {
		tmp = c[k] * (N - c[k])%MOD;
		ans += tmp * b;
		ans %= MOD;
		b = b*2%MOD;
	}
	cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2560
#include<cstdio>
#include<iostream>
using namespace std;
const int maxn = 101;
int N;
int A[maxn];

int main(){
	cin >> N;
	for(int i = 0;i < N;i++){
		cin >> A[i];
	}
	getchar();
	int i,j;
	int count = 0;
	
	for(i = 0;i < N;i++){
		for(j = 0;j < N - i - 1;j++){
			if(A[j] > A[j + 1]){
				int temp = A[j];
				A[j] = A[j + 1];
				A[j + 1] = temp;
				count++;
			}
		}		
//		for(int i = 0;i < N - 1;i++){
//			cout << A[i] << " "; 
//		}
//		cout << A[N - 1];
//		cout << endl; 
	}
	for(i = 0;i < N - 1;i++)cout << A[i] <<" ";
	cout << A[N - 1] << endl;
	cout << count << endl; 
}


Measured memory_bytes: 3096
#include <stdio.h>

#define MAX 100000

int n, k;
double T[MAX];

int check(double p){
  int i = 0, j;
  double s;
  for( j = 0 ; j < k ; j++){
    s = 0.0;
    while( s + T[i] <= p){
      s += T[i];
      i++;
      if( i == n ) return n;
    }
  }
  return i;
}

int solve(){
  double left = 0.0;
  double right = 100000*10000;
  double mid;
  int v;

  while( right - left > 1){
    mid = ( left + right ) / 2;
    v = check(mid);
    if( v >= n ) right = mid;
    else left = mid;
  }
  return right;
}

int main(){
  int i;
  double ans;
  scanf("%d%d", &n, &k);
  for( i = 0 ; i < n ; i++) scanf("%lf", &T[i]);
  ans = solve();
  printf("%d\n", (int)ans);

  return 0;
}


Measured memory_bytes: 2584
using System;
class Program {
  static void Main(string[] args) {
    const int ALPHA_SIZE = 26;
    string S = Console.ReadLine();
    int[] A = new int[ALPHA_SIZE + 1];

    for (int i = 0; i < S.Length; ++i) {
      ++A[S[i] - 'a'];      
    }

    int ans = 0;
    while (A[ans] != 0) ++ans;

    if (ans == ALPHA_SIZE) {
      Console.WriteLine("None");
    } else {
      Console.WriteLine((char)('a' + ans));
    }
  }
}


Measured memory_bytes: 11232
function main(input){
  const lines = input.split('\n');
  const H = lines[0].split(' ').map(x => parseInt(x))[0];
  const W = lines[0].split(' ').map(x => parseInt(x))[1];

  const wall = lines.slice(1,1+H).map(x => x.split(''));

//    console.log(wall);

 var result = true;
  for(var h = 0;h<H;h++){
    for(var w = 0;w<W;w++){

      var current_hex = wall[h][w];
      if(current_hex=='.'){continue;}

      var up = (h>0 && wall[h-1][w]=='.');
      var down  = (h<H-1 && wall[h+1][w]=='.');
      var left = (w>0 && (wall[h][w-1]=='.'));
      var right = (w<W-1 && (wall[h][w+1]=='.'));

      if(up && down && left && right){
        result=false;
        break;
      }
    }
  }
  if(result){
    console.log('Yes');
  }else{
    console.log('No');
  }



}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    string s;
    cin >> n >> s;
    
    if(n % 2 != 0){
        cout << "No\n";
        return 0;
    }
    
    for(int i = 0; i < n / 2; ++i){
        if(s[i] != s[i + n / 2]){
            cout << "No\n";
            return 0;
        }
    }
    cout << "Yes\n";
}

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

int main() {
    long long N, A, B;
    cin >> N >> A >> B;
    long long ans = N / (A + B) * A + min(N % (A + B), A);
    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;
typedef long long ll;
typedef pair<int,int>P;

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

int a[200000];
int cnt[3];

int main(){
	int n;cin>>n;
	rep(i,n)scanf("%d",&a[i]);
	ll ans=1;
	rep(i,n){
		ll d=0;
		rep(j,3){
			if(cnt[j]==a[i]){
				d++;
			}
		}
		(ans*=d)%=MOD;
		rep(j,3){
			if(cnt[j]==a[i]){
				cnt[j]++;
				break;
			}
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 640
# -*- coding: utf-8 -*-
sx, sy, tx, ty = map(int, input().split())
dx,dy = tx-sx, ty-sy

r1 = 'U'*dy + 'R'*dx
r2 = 'D'*dy + 'L'*dx

r3 = 'LU'+r1+'RD'
r4 = 'RD'+r2+'LU'

print(r1+r2+r3+r4)

Measured memory_bytes: 3060
// C - Fennec vs Monster
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
int N,K;
int H[200000];

int main(){
	cin>>N>>K;
	rp(i,0,N) cin>>H[i];
	long long ans = 0;
	if(N > K){
		sort(H, H+N);
		reverse(H, H+N);
		rp(i,K,N) ans += H[i];
	}
	cout<< ans <<endl;
}

Measured memory_bytes: 1024
#define _CRT_SECURE_NO_DEPRECATE
/************************
*创建时间：2018 12 
*文件类型：源代码文件
*题目来源：
*当前状态：
*备忘录：
*作者：HtBest
************************/
#include <stdio.h>
#include <iostream>
#include <string>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <queue>
#include <bitset>
// #include <sys/wait.h>
// #include <sys/types.h>
// #include <unistd.h>
using namespace std;
int a,c,b;
/* Variable explain:

*/
void read()
{
	scanf("%d%d%d",&a,&b,&c);
	return;
}
int main()
{
	// freopen(".in","r",stdin);
	// freopen(".out","w",stdout);
	read();
	printf("%d\n",b+min(a+b+1,c));
	return 0;
}


Measured memory_bytes: 256
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
 
readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine
 
main = do
    [n,k] <- getIntList
    as <- VU.fromList . map pred <$> getIntList
    vec <- VUM.replicate n (-1 :: Int)
    let loop m a = do
            b <- VUM.read vec a
            if b < 0 then do
                VUM.write vec a m
                loop (m+1) (as VU.! a)
            else return (b,m)
    (s,t) <- loop 0 0
    let sim 0 a = a + 1
        sim m a = sim (m-1) (as VU.! a)
    print $ if k < t then sim k 0 else sim (s + (k-s) `mod` (t-s)) 0

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

int main() {
  string a,b;
  b="No";
  cin>>a;
  for(int i=0;i<a.size()-1;i++){
    if(a.at(i)=='A' && a.at(i+1)=='C'){
      b="Yes";
    }
  }
  cout<<b<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1000003 ;

ll comb[100][100];

int main(){
  for(int i=0;i<61;i++){
    comb[i][0]=1;
    comb[i][i]=1;
  }
  for(int i=2;i<=61;i++){
    for(int j=1;j<i;j++){
      comb[i][j]=comb[i-1][j-1]+comb[i-1][j];
    }
  }
  int n,a,b;
  cin >> n >> a >> b;
  ll v[n];
  rep(i,n){
    cin >> v[i];
  }
  sort(v,v+n,greater<ll>());
  map<ll,ll> mp;
  vector<pair<long double,ll>> res;
  rep(i,n)mp[v[i]]++;
  for(int i=a;i<=b;i++){
    long double ave=0;
    ll cnt=0;
    ll com=1;
    for(int j=0;j<i;j++){
      ave+=v[j];
      if(v[j]==v[i-1])cnt++;
    }
    ave/=(long double)i;
    com=comb[mp[v[i-1]]][cnt];
    res.push_back({ave,com});
  }
  sort(res.begin(),res.end());
  reverse(res.begin(),res.end());
  ll ans=0;
  rep(i,res.size()){
    if(res[i].first==res[0].first)ans+=res[i].second;
  }
  cout << setprecision(10) << res[0].first << endl;
  cout << ans << endl;
return 0;}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>

using namespace std;

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

int main(){
    int h, n;
    cin >> h >> n;
    int a[n];
    rep(i, n) cin >> a[i];
    rep(i, n) h -= a[i];
    if (h > 0){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
    
}


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

int main() {
    int n;
    cin >> n;
    set<int> st;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a; 
        st.insert(a);
    }
    if (st.size() == n) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    } 
}


Measured memory_bytes: 11520
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = (ll)a;i < (ll)b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = (ll)b-1LL;i >= (ll)a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

const ll INF=(1LL<<50);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
template<class T>
bool chmax(T& a,const T& b){
  if(a<b){
    a=b;
    return true;
  }
  return false;
}
template<class T>
bool chmin(T& a,const T& b){
  if(a>b){
    a=b;
    return true;
  }
  return false;
}
template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}


vector<set<ll>> tr;
vector<ll> ans;
vector<ll> st;
vector<ll> A;
void rec(ll cur){
  auto itr=lower_bound(st.begin(),st.end(),A[cur]);
  auto saved=*itr;
  *itr=A[cur];
  ans[cur]=lower_bound(st.begin(),st.end(),INF)-st.begin();
  for (auto &&i : tr[cur])
  {
    rec(i);
  }
  *itr=saved;
}
void solve(long long N, std::vector<long long> a, std::vector<long long> u, std::vector<long long> v){
  A=move(a);
  tr.resize(N);
  ans.resize(N);
  st.resize(N);
  fill(st.begin(),st.end(),INF);
  fill(ans.begin(),ans.end(),INF);
  REP(N-1){
    tr[u[i]].insert(v[i]);
    tr[v[i]].insert(u[i]);
  }
  deque<pll> q;
  q.push_back(pll(-1,0));
  while(!q.empty()){
    pll cur=q.back();q.pop_back();
    for (auto &&i : tr[cur.second])
    {
      if(i==cur.first)continue;
      tr[i].erase(cur.second);
      q.push_front(pll(cur.second,i));
    }
  }
  rec(0);
  REP(N){
    cout<<ans[i]<<endl;
  }
}

int main(){
  cout<<setprecision(1000);
    long long N;
    scanf("%lld",&N);
    std::vector<long long> a(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&a[i]);
    }
    std::vector<long long> u(N-1);
    std::vector<long long> v(N-1);
    for(int i = 0 ; i < N-1 ; i++){
        scanf("%lld",&u[i]);
        scanf("%lld",&v[i]);
        --u[i];--v[i];
    }
    solve(N, std::move(a), std::move(u), std::move(v));
    return 0;
}


Measured memory_bytes: 47524
#import pysnooper
#import numpy
#import os,re,sys,operator
#from collections import Counter,deque
#from operator import itemgetter,mul
#from itertools import accumulate#,combinations,groupby,combinations_with_replacement,permutations
from sys import stdin,setrecursionlimit
#from bisect import bisect_left,bisect_right
#from copy import deepcopy
#import heapq
#import math
#import string
#from time import time
#from functools import lru_cache,reduce
#from math import factorial
#import sys
from fractions import gcd
setrecursionlimit(10**6)
input=stdin.readline

n=int(input())
a=[int(i) for i in input().split()]
ans=0
now=1
for i in range(n):
    if a[i]==now:
        now+=1
    else:
        ans+=1
print(-1 if ans==n else ans)

Measured memory_bytes: 26988
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <functional>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;
typedef pair<int, int> P;

#define pi 3.141592653589793)
#define mod 1000000007

int N;
int a[200001], c[200001];

void solve() {
	cin >> N;
	for (int i = 0; i < N; i++) cin >> a[i];
	for (int i = 0; i < N; i++) c[i] = a[i];
	sort(a, a + N);
	
	for (int i = 0; i < N; i++) {
		int b = a[N / 2 - 1];
		if (b >= c[i]) b = a[N / 2];
		cout << b << endl;
	}
}

int main() {
	solve();
	return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int n;
  cin >> n;
  vector<string> s(10);
  s[0] = "pon";
  s[1] = "pon";
  s[2] = "hon";
  s[3] = "bon";
  s[4] = "hon";
  s[5] = "hon";
  s[6] = "pon";
  s[7] = "hon";
  s[8] = "pon";
  s[9] = "hon";
  cout << s[n%10] << endl;
  return 0;
}


Measured memory_bytes: 3628
#include <stdio.h>
int main(void)
{
    int high, width;
    int i, j;
    while (1)
    {
        scanf("%d %d", &high, &width);
        if (high == 0 && width == 0)
        {
            break;
        }
        for (i = 0; i < high;i++){
            if(i % 2 == 0){
                for (j = 0; j < width; j++)
                {
                    if(j % 2 == 0){
                        printf("#");
                    }
                    else{
                        printf(".");
                    }
                }
            }else{
                for (j = 0; j < width; j++){
                    if(j % 2 == 0){
                        printf(".");
                    }else{
                        printf("#");
                    }
                }
            }
            printf("\n");
        }
            printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2048
n=int(input())
a=input()
l = []
for i in range(0, n):
    l.append(a[i])
t0=[]
for k in range(0, n):
    l1 = l[0:k]
    l2 = l[k: n]
    s1 = set(l1)
    s2 = set(l2)
    t = s1 & s2
    t0.append(len(t))
print(max(t0))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define pb push_back
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int kaijo[200010];
struct edge{int to,cost;};
int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
bool prime(int a){
	if(a==1)return false;
	for(int i=2;i*i<=a;i++){
		if(a%i==0)return false;
	}
	return true;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){//線分の交差判定
	double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
	double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
	double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
	double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
	return tc*td<0&&ta*tb<0;
}
void init_fact(int n){
	kaijo[0]=1;
	for(int i=1;i<=n;i++){
		kaijo[i]=kaijo[i-1]*i;
		kaijo[i]%=MOD;
	}
}
int modpow(int a,int b){
	if(b==0)return 1;
	if(b%2)return modpow(a,b-1)*a%MOD;
	int memo=modpow(a,b/2);
	return memo*memo%MOD;
}
int comb(int a,int b){
	if(b>a)return 0;
	if(a==b)return 1;
	return kaijo[a]*modpow(kaijo[a-b],MOD-2)%MOD*modpow(kaijo[b],MOD-2)%MOD;
}
int g(int x){
	x=modpow(x,MOD-2);
	return x;
}
string s,t;
int ss[100010],st[100010],q;
signed main(){
	cin>>s>>t>>q;
	ss[0]=(s[0]=='A'?1:2),st[0]=(t[0]=='A'?1:2);
	for(int i=1;i<s.size();i++)ss[i]=ss[i-1]+(s[i]=='A'?1:2);
	for(int i=1;i<t.size();i++)st[i]=st[i-1]+(t[i]=='A'?1:2);
	while(q--){
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		a--,b--,c--,d--;
		int S=ss[b]-(a==0?0:ss[a-1]);
		int T=st[d]-(c==0?0:st[c-1]);
		if(S%3==T%3)puts("YES");
		else puts("NO");
	}
	return 0;
}


Measured memory_bytes: 2560
N,W = map(int, input().split())
wv = [list(map(int, input().split())) for _ in range(N)]

dp = [[0 for _ in range(W+1)] for _ in range(N+1)] 

dp[0][0] = 0

for i in range(N):
    weight = wv[i][0]
    for j in range(W+1):
        dp[i+1][j] = dp[i][j]
        if j >= weight:
            dp[i+1][j] = max(dp[i+1][j], dp[i][j-weight] + wv[i][1])
print(dp[N][W])


Measured memory_bytes: 171912
#include<bits/stdc++.h>
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (register int i=(x);i<(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define Debug(v) for (auto i:v) printf("%lld ",i);puts("")
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define ep emplace_back
#define siz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define fil(a,b) memset((a),(b),sizeof(a))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pa;
typedef pair<ll,ll> PA;
typedef vector<int> poly;
inline ll read(){
    ll x=0,f=1;char c=getchar();
    while ((c<'0'||c>'9')&&(c!='-')) c=getchar();
    if (c=='-') f=-1,c=getchar();
    while (c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
    return x*f;
}

const int N = 1e6+10, mod = 998244353;
int n,x,mx,c[N],b[N],a[N];

int mu[N],tot,p[N],vis[N];
inline void init(int n){
	mu[1]=1;
	For(i,2,n){
		if (!vis[i]) p[++tot]=i,mu[i]=-1;
		for (int j=1;j<=tot&&i*p[j]<=n;++j){
			vis[i*p[j]]=p[j];
			if (i%p[j]==0) break;
			mu[i*p[j]]=mu[i]*mu[p[j]];
		}
	}
	For(i,1,n) mu[i]=(mu[i]+mod)%mod;
}

int main(){
	n=read();
	For(i,1,n) c[b[i]=read()]++,mx=max(mx,b[i]);
	For(i,1,mx)
		For(j,1,mx/i) a[i]=(a[i]+1ll*c[i*j]*j)%mod;
	init(mx);
	int ans=0;
	For(d,1,mx){
		ll ret=0;
		For(k,1,mx/d) ret=(ret+1ll*mu[k]*k%mod*k%mod*a[d*k]%mod*a[d*k])%mod;
		ans=(ans+1ll*ret*d)%mod;
	}
	For(i,1,n) ans=(ans+mod-b[i])%mod;
	printf("%d\n",1ll*ans*(mod+1>>1)%mod);
}

Measured memory_bytes: 20476
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<functional>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<chrono>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
typedef long long int ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<signed(n);i++)
#define EREP(i,n) for(int i=1;i<=signed(n);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
//#define EVEL 1
#ifdef EVEL
#define DEB(X) cout << #X <<":" <<X<<" " ;
#define TF(f) f ? cout<<"true  " : cout<<"false ";
#define END cout<<"\n";
#else
#define DEB(X) {}
#define TF(f) {}
#define END {}
#endif
const ll MOD = 1000000007;
const ll INF = 9e14;
typedef std::pair<ll,ll> P;
struct edge{ int to,cost; };
#define VMAX 100000

ll N,M,K;
ll A,B,C,D,X,Y;
ll ans=0;
string G[100010];
string S,T,U;
ll F[100010];
bool ok=true;
std::queue<ll> Q;
ll Z[]={1,2,3,6,7,8,9,0};
int main(){
    long double a,b;
    cin>>a>>b;
    ans=b*a;
    cout<<ans;
}


Measured memory_bytes: 6896
#include<bits/stdc++.h>
using namespace std;
string s,b="AKIHABARA";
int idx=0,pos=0;
int main(){
	cin>>s;
	if(s.size()>9){
		puts("NO");
		return 0;
	}
	while(idx!=10){
		if(b[idx]!=s[pos]){
			if(b[idx]!='A'){
				puts("NO");
				return 0;
			}
			s.insert(s.begin()+pos,'A');
		}
		idx++;
		pos++;
	}
	puts("YES");
	return 0;
}

Measured memory_bytes: 256
use std::io;
use std::cmp;
use std::collections::BinaryHeap;
use std::collections::HashMap;

fn read_line() -> String {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).ok();
    buf
}

fn main() {
    let n: usize = read_line().trim().parse().unwrap();
    let mut a: Vec<i64> = read_line().split_whitespace().map(|s| s.parse().unwrap()).collect();

    for i in 0..n {
        a[i] -= i as i64 + 1;
    }

    a.sort();

    let mut ans = n as i64 * 1000_000_000i64;
    for i in (n-1)/2..(n+2)/2 {
        ans = cmp::min(ans, a.iter().fold(0, |acc, &x| acc + (x - a[i]).abs()));
    }


    println!("{}", ans);
}


Measured memory_bytes: 10492
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)

int main() {
	int n,a,b,ans;
	cin>>n;
	ans=n*n*n;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
	int ans=0,tot=0,n;
	cin>>n;
	for(int i=1; i<=n; i++)
	{
		char c;
		cin>>c;
		tot+=(c=='I');
		tot-=(c=='D');
		ans=max(ans,tot);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef tuple<int,int,int> T;
int dx[4]={1,0,-1,0};
int dy[4]={0,-1,0,1}; //????????????
bool wall[30][30][4];
bool vis[30][30];
int main() {
	int w,h;
	while(scanf("%d %d",&w,&h),w) {
		memset(wall,0,sizeof(wall));
		memset(vis,0,sizeof(vis));
		for(int i=0;i<h-1;i++) {
			for(int j=0;j<w-1;j++) {
				int a;
				scanf("%d",&a);
				if(a) wall[i][j][0]=wall[i][j+1][2]=1;
			}
			for(int j=0;j<w;j++) {
				int a;
				scanf("%d",&a);
				if(a) wall[i][j][3]=wall[i+1][j][1]=1;
			}
		}
		for(int i=0;i<w-1;i++) {
			int a;
			scanf("%d",&a);
			if(a) wall[h-1][i][0]=wall[h-1][i+1][2]=1;
		}
		queue<T> Q;
		Q.push(make_tuple(0,0,1));
		vis[0][0]=1;
		int ans=0;
		while(!Q.empty()) {
			T t=Q.front();Q.pop();
			int x=get<0>(t);
			int y=get<1>(t);
			int d=get<2>(t);
			if(x==w-1&&y==h-1) {ans=d;break;}
			for(int i=0;i<4;i++) {
				int nx=x+dx[i],ny=y+dy[i];
				if(wall[y][x][i]||0>nx||nx>=w||0>ny||ny>=h||vis[ny][nx]) continue;
				Q.push(make_tuple(nx,ny,d+1));
				vis[ny][nx]=1;
			}
		}
		printf("%d\n",ans);
	}
}

Measured memory_bytes: 3224
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

int main() {
  LL A, B; cin >> A >> B;
  LL A0 = A - (A % 4);
  LL B0 = B - (B % 4);

  LL SA = 0, SB = 0;
  for (LL i = A0; i < A; ++i) SA ^= i;
  for (LL i = B0; i <= B; ++i) SB ^= i;
  LL S = SB ^ SA;
  cout << S << endl;
}


Measured memory_bytes: 3648
#include <stdio.h>

int main() {
	int i,sum;
	char a[1001];
	
	while(1){
		scanf("%s",a);
		if(a[0] == '0') break;
    
		sum = 0;
		for(i=0;a[i]!='\0';i++)
		sum += a[i] - '0';
		printf("%d\n", sum);
	}
	return 0;
}


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

long long ways[51][51][2501] = {0};

int main(){
    int N, A;
    cin >> N >> A;
    int x[N];
    for(int i=0; i<N; i++){
        cin >> x[i];
    }

    ways[0][0][0]=1;

    for(int beforePos=1; beforePos<=N; beforePos++){
        for(int chooseNum=beforePos; chooseNum>=0; chooseNum--){
            for(int value=A*N+1; value>=0; value--){
                ways[beforePos][chooseNum][value]+=ways[beforePos-1][chooseNum][value];
                if(value>=x[beforePos-1] && chooseNum>=1){
                    ways[beforePos][chooseNum][value]+=ways[beforePos-1][chooseNum-1][value-x[beforePos-1]];
                }
            }
        }
    }

    long long totalWays=0;

    for(int chooseNum=1; chooseNum<=N; chooseNum++){
        totalWays += ways[N][chooseNum][chooseNum*A];
    }

    cout << totalWays << '\n';
}


Measured memory_bytes: 29168
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>

using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef vector<int> vi;

#define rep(i, n) for(int i = 0, i##_len=(n); i < i##_len; i++)
#define all(x) (x).begin(), (x).end()
#define SIZE(x) ((int)(x).size())

int main(void)
{
  // code begin

  int n, a, b;
  cin >> n >> a >> b;

  cout << min(b, n * a) << endl;

  // code end
  return 0;
}


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

int main()
{
    string S,T;
    cin >> S >> T;
    int cnt=0;

    for(int i = 0; i < (int) S.size(); ++i)
    if(S[i] != T[i]) ++cnt;

    cout << cnt  << endl;
}

Measured memory_bytes: 3900
#include "bits/stdc++.h"

using namespace std;

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

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

int pass[200][200];
int n;

int dijk(int s,int g){
    int d[200];
    bool used[200];
    rep(i,200)d[i]=999999999;
    rep(i,200)used[i]=false;
    d[s]=0;
    
    while(1){
        int v=-1;
        rep(u,n){
            if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
        }
        if(v==-1)break;
        
        used[v]=true;
        
        rep(u,n){
            d[u] = min(d[u],d[v]+pass[v][u]);
        }
    }
    return d[g];
}


int main(){
    while(cin>>n){
        rep(i,200)rep(j,200)pass[i][j]=999999999;
        rep(i,200)pass[i][i]=0;
        rep(i,n){
            int r,k;
            cin>>r>>k;
            r--;
            rep(j,k){
                int x;
                cin>>x;
                x--;
                pass[r][x]=1;
            }
        }
        int p;
        cin>>p;
        rep(i,p){
            int s,g,v;
            cin>>s>>g>>v;
            s--,g--;
            int res = dijk(s,g)+1;
            if(res<=v)cout<<res<<endl;
            else cout<<"NA"<<endl;
        }
    }
}

Measured memory_bytes: 1320
#include <iostream>
#include<algorithm>
#include<string>
#include<vector>
#include <math.h>
#include <iomanip>

using namespace std;

int main()
{
	int a,b,c;
	cin >> a >> b  >> c;
	cout << a + b + c - max(a, max(b, c)) << endl;
}

Measured memory_bytes: 256
/*
susheel_7
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define INF 0x3f3f3f3f 
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)

int main(){
    ll m1,d1,m2,d2;
    cin>>m1>>d1>>m2>>d2;
    if(m1<m2)
    {
        if(d2==1)
        {
            if(d1==30||d1==31||d1==29||d1==28)
            cout<<"1";
        }
    }
    else
    cout<<"0";
    return 0;
}

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

const int MOD = 1e9 + 7;

void solve_test() {
    int s;
    cin >> s;
    
    vector<int> dp(s + 1);
    dp[0] = 1;
    for (int i = 1; i <= s; i++)
        for (int j = 3; j <= i; j++) {
            dp[i] += dp[i - j];
            dp[i] %= MOD;
        }
    
    cout << dp[s] << '\n';
}

int32_t main() {
	int T; 
	// cin >> T;
	T = 1;
	while (T--)
		solve_test();

	return 0;
}


Measured memory_bytes: 3636
import java.io.*;
import java.util.*;

class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        long s = Long.parseLong(st.nextToken());
        long c = Long.parseLong(st.nextToken());
        long ans=0;
        if(c<=2*s){
            ans+=c/2;
        }
        else{
            ans+=s;
            c-=2*s;
            ans+=c/4;
        }
        System.out.println(ans);

    }


}


Measured memory_bytes: 21204
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <random>
#include <climits>
#include <set>
#include <deque>
#include <queue>
#include <bitset>
#include <stack>
#include <regex>

#define mod 1000000007
#define INF2 9999999999
#define INF (1 << 30)
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define P pair<int, int>

using namespace std;
using ll = int64_t;

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

bool isLower(char c){
    if(c <= 'z' && c >= 'a'){
        return true;
    }
    return false;
}

bool ruleOne(string s){
    if(s[0] == 'A'){
        return true;
    }
    return false;
}

bool ruleTwo(string s){
    int count = 0;
    for(int i = 2; i <= s.length()-2; i++){
        if(s[i] == 'C'){
            count++;
        }
    }
    if(count == 1){
        return true;
    }
    return false;
}

bool ruleThree(string s){
    for(int i = 0; i < s.length(); i++){
        if(!isLower(s[i])){
            return false;
        }
    }
    return true;
}

void solve(){
    string s;
    cin >> s;
    if(ruleOne(s)){
        s[0] = 'a';
        if(ruleTwo(s)){
            for(int i = 2; i <= s.length()-2; i++){
                if(s[i] == 'C') s[i] = 'c';
            }
            if(ruleThree(s)){
                cout << "AC" << endl;
                return;
            }
        }
    }
    cout << "WA" << endl;
}

int main(){
    solve();
    return 0;
}

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

using namespace std;
typedef long long ll;

const int M = 2e5 + 10;
int n, m;
ll a[M] = {0}, b[M] = {0}, k;

int bs(int len, int w, ll arr[]) {
    int l = 0, r = len;
    while (l < r) {
        int mid = (l + r + 1) >> 1;
        if (arr[mid] <= w)
            l = mid;
        else
            r = mid - 1;
    }
    return l;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout);
#endif
    scanf("%d%d%lld", &n, &m, &k);
    for (int i = 1; i <= n; i++) {
        scanf("%lld", &a[i]);
        a[i] += a[i - 1];
    }
    for (int i = 1; i <= m; i++) {
        scanf("%lld", &b[i]);
        b[i] += b[i - 1];
    }
    int l = bs(n, k, a);
    // printf("%d)", l);
    int r = bs(m, k - a[l], b);
    int num = l + r;
    for (int i = l - 1; i >= 0; i--) {
        int tmp = bs(m, k - a[i], b);
        if (num < i + tmp) {
            num = i + tmp;
        }
    }

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

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

int main() {
    int N;
    cin >> N;
    bool answer = false;
    for(int i = 1; i <= 9; i++) {
        for(int j = 0; j <= 9; j++) {
            if(i * j == N) {
                answer = true;
            }
        }
    }
    if(answer == true) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect
from heapq import heappush, heappop

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()

print(N+(M-2*N)//4 if M >= 2*N else M//2)


Measured memory_bytes: 5196
#include<bits/stdc++.h>
#define fastIO std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0)
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define Local
#ifdef Local
  #define dbg(args...) do { cout << #args << " -> "; err(args); } while (0)
  void err() { std::cout << std::endl; }
  template<typename T, typename...Args>
  void err(T a, Args...args) { std::cout << a << ' '; err(args...); }
  template <template<typename...> class T, typename t, typename... A> 
  void err(const T <t> &arg, const A&... args) {
  for (auto &v : arg) std::cout << v << ' '; err(args...); }
#else
  #define dbg(...)
#endif

using namespace std;
typedef vector<int> VI;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
const ll mod = 1000000007;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

const int maxn = 2e5 + 10; 

int main()
{
	fastIO;
	int x;
	cin >> x;
	if(x >= 30) cout << "Yes" << endl;
	else cout << "No" << endl;	
	return 0;
}

Measured memory_bytes: 3652
N, Q = map(int, input().split())
S = [ _ for _ in input()]
lr = [[int(_) for _ in input().split()] for _ in range(Q)]
ans = [0] * (N + 1)

for i, data in enumerate(S, 1):
    if data == "A":
        if i >= N:
            break

        if S[i] == "C":
            ans[i] = ans[i - 1] + 1
            continue

    ans[i] = ans[i - 1]

for l, r in lr:
    print(ans[r - 1] - ans[l - 1])


Measured memory_bytes: 25088
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

ll M[2000000],C[2000000],MC[2000000];
int main(){
	int n;string s;cin>>n>>s;
	rep(i,n){
		if(s[i]=='M')M[i]++;
		if(i)M[i]+=M[i-1];
		if(s[i]=='C')C[i]++;
		if(i)C[i]+=C[i-1];
		if(s[i]=='C')MC[i]+=M[i];
		if(i)MC[i]+=MC[i-1];
	}
	int q;cin>>q;
	rep(i,q){
		int k;scanf("%d",&k);
		ll sum=0;
		rep(j,n){
			if(s[j]!='D')continue;
			sum+=MC[min(n-1,j+k-1)]-MC[j]-(C[min(n-1,j+k-1)]-C[j])*M[j];
			//~ cout<<MC[min(n-1,j+k-1)]-MC[j]-(C[min(n-1,j+k-1)]-C[j])*M[j]<<endl;
		}
		cout<<sum<<endl;
	}
}

Measured memory_bytes: 29956
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
const int N = 100005;
const int INF = 1e9 + 7; 
using namespace std;

int n, cnt[N]; 
char s[N]; 

template < typename T >
inline T read()
{
	T x = 0, w = 1; char c = getchar();
	while(c < '0' || c > '9') { if(c == '-') w = -1; c = getchar(); }
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * w; 
}

int main()
{
	scanf("%s", s + 1), n = strlen(s + 1);
	for(int id, x = 0; x < 26; x++)
	{
		for(int i = 1; i <= n; i++) cnt[i] = cnt[i - 1] + (s[i] == 'a' + x);
		id = 0;
		for(int i = 1; i <= n; i++)
		{
			if(2 * cnt[i] - i > 2 * cnt[id] - id && id != i - 1) { printf("%d %d\n", id + 1, i); return 0; }
			if(2 * cnt[i] - i < 2 * cnt[id] - id) id = i; 
		}
	}
	puts("-1 -1"); 
	return 0; 
}


Measured memory_bytes: 3672
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
using Graph = vector<vector<ll>>;

#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=b;i--)
#define ALL(x) x.begin(),x.end()
#define SIZE(x) ll(x.size())

#define INF 1000000000000 //10^12
#define MOD 1000000007 //10^9+7:合同式の法
 
int main(){
    
    ll k;
    cin >> k;

    string str = "ACL";
    string ss;
    REP(i,k){
        ss += str;
    }

    cout << ss << endl;
    
    return 0;
}

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

int main() {
    int h,w;cin>>h>>w;
    string s[h];
    for (int i=0;i<h;i++)
        cin>>s[i];
    int cnt[h][w]{};
    for (int i=0;i<h;i++)
        for (int j=0;j<w;j++) {
            if (s[i][j]!='#')
                continue;
            for (int k=-1;k<=1;k++)
                for (int l=-1;l<=1;l++) {
                    int y=i+k;
                    int x=j+l;
                    if (y<0||h<=y||x<0||w<=x)
                        continue;
                    cnt[y][x]++;
                }
        }
    for (int i=0;i<h;i++) {
        for (int j=0;j<w;j++) {
            if (s[i][j]=='#')
                cout<<'#';
            else
                cout<<cnt[i][j];
        }
        cout<<endl;
    }

    return 0;
}

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

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

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

template<typename T1,typename T2>ostream& operator<<(ostream& os,const pair<T1,T2>& a) {os << "(" << a.first << ", " << a.second << ")";return os;}

const char newl = '\n';

int main() {
    int n;cin >> n;
    vector<ll> a(n);
    for (int i = 0;i < n;++i) cin >> a[i];
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    ll ans = a[0];
    n -= 2;
    int i = 1;
    while (n > 0) {
        ans += min(2,n)*a[i];
        i++;
        n -= 2;
    }
    cout << ans << endl;
}

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

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(lol i=0;i<lol(n);i++)
#define REPD(i,n) for(lol i=n-1;i>=0;i--)
#define FOR(i,a,b) for(lol i=a;i<=lol(b);i++)
#define FORD(i,a,b) for(lol i=a;i>=lol(b);i--)
#define VL vector<lol>
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() //sortなどの引数を省略したい
#define SIZE(x) lol(x.size()) //sizeをsize_tからllに直しておく
//定数
#define PI 3.1415926535897932385 //pi
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//最大値最小値
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main()
{
    //lol result{0};
    lol d, t, s; cin >> d >> t >> s;
    if(d <= t*s) cout << "Yes" << endl;
    else cout << "No" << endl;
    

    //cout << result << endl;
    return 0;
}

Measured memory_bytes: 3616
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        int count=0;
        int max=Integer.MIN_VALUE;
        if(s.charAt(0)=='R' && s.charAt(1)=='R' && s.charAt(2)=='R')
        count=3;
        else if(s.charAt(0)=='R' && s.charAt(1)=='R')
        count=2;
        else if(s.charAt(1)=='R' && s.charAt(2)=='R')
        count=2;
        else if(s.charAt(0)!='R' && s.charAt(1)!='R' && s.charAt(2)!='R')
        count=0;
        else
        count=1;
        System.out.println(count);
    }    
}

Measured memory_bytes: 35700
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s,t;
	cin>>s>>t;
	int dp[s.length()+1][t.length()+1];
	memset(dp,0,sizeof(dp));
	int i,j;
	for(i=1;i<=s.length();i++)
	{
		for(j=1;j<=t.length();j++)
		{
			if(s[i-1]==t[j-1])
				dp[i][j]=dp[i-1][j-1]+1;
			else
			    dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
		}
	}
	i=s.length();
	j=t.length();
	string lcs="";
	while(i>0 && j>0) {
		if(dp[i][j]==dp[i-1][j]) 
		i-=1;
		else if(dp[i][j]==dp[i][j-1]) 
		j-=1;
		else {
		lcs=s[i-1]+lcs;
		i-=1;
		j-=1;
	    }
	}
	cout<<lcs;
}

Measured memory_bytes: 38772
#include <stdio.h>
#include <stdlib.h>

int main(void){
  int M,N;
  
  scanf("%d %d",&N,&M);  
  if(N<M){
    printf("error\n");
    exit(1);
  }
  
  if(M==N){
    printf("Yes\n");
  }
  else{
    printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 128
x, n = map(int,input().split())
if n>0:
    li = list(map(int, input().split()))
    y1 = x
    y2 = x
    while True:
        if y1 not in li:
            print(y1)
            break
        elif y2 not in li:
            print(y2)
            break
        else:
            y1-= 1
            y2 += 1
else:
    print(x)

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

using mint = modint1000000007;
// using mint = modint998244353;

typedef int64_t Int;
#define all(x) (x).begin(), (x).end()
 
const double EPS = 1e-10;
const Int INF = 1e18;
const int inf = 1e9;
const Int mod = 1e9+7;

bool print_space_enable = false;
void print() { 
    cout << '\n'; 
    print_space_enable = false;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
    if (print_space_enable) std::cout << " ";
    cout << fixed << setprecision(15) << head;
    print_space_enable = true;
    print(std::forward<Tail>(tail)...);
}

template<typename T>
void print(vector<T> v) {
    for (size_t i = 0; i < v.size(); i++) {
        if (i > 0) std::cout << " ";
        std::cout << v[i];
    }
    std::cout << '\n';
}

void solve() {
    Int n, q;
    cin >> n >> q;
    vector<Int> a(n);
    for (Int i = 0; i < n; i++) {
        cin >> a[i];
    }
    vector<tuple<Int, Int, Int>> query(q);
    for (Int i = 0; i < q; i++) {
        Int s, t, u;
        cin >> s >> t >> u;
        query[i] = tie(s, t, u);
    }
    fenwick_tree<Int> fw(n);
    for (Int i = 0; i < n; i++) {
        fw.add(i, a[i]);
    }
    for (Int i = 0; i < q; i++) {
        Int t, p, x;
        tie(t, p, x) = query[i];
        if (t == 0) {
            fw.add(p, x);
        }
        if (t == 1) {
            print(fw.sum(p, x));
        }
    }
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 23852