akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define fix cout << fixed; cout << setprecision(0)





void solve() {

	
	int a, b, c;
	cin >> a >> b >> c;
	if(a + b + c >= 22) {
		cout << "bust";
	}
	else {
		cout << "win";
	}




	
}

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	fix;
	solve();

	return 0;
}

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

int main () {
	int a, b;
	char c[55] ;
	
	scanf ("%d %d" ,&a, &b);
	scanf ("%s", &c);
	
	b=b-1;
	c[b] = c[b]+32;
	
	printf ("%s",c);
	
	
	return 0;
}


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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
//#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++) // 0 ~ n-1

class UnionFind
{
public:
    vector<ll> par; // 各元の親を表す配列
    vector<ll> siz; // 素集合のサイズを表す配列(1 で初期化)

    // Constructor
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1)
    {
        for (ll i = 0; i < sz_; ++i)
            par[i] = i; // 初期では親は自分自身
    }
    void init(ll sz_)
    {
        par.resize(sz_);
        siz.assign(sz_, 1);
        for (ll i = 0; i < sz_; ++i)
            par[i] = i; // 初期では親は自分自身
    }

    // Member Function
    // Find
    ll root(ll x)
    { // 根の検索
        while (par[x] != x)
        {
            x = par[x] = par[par[x]]; // x の親の親を x の親とする
        }
        return x;
    }

    // Union(Unite, Merge)
    bool merge(ll x, ll y)
    {
        x = root(x);
        y = root(y);
        if (x == y)
            return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y])
            swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y)
    { // 連結判定
        return root(x) == root(y);
    }

    ll size(ll x)
    { // 素集合のサイズ
        return siz[root(x)];
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    lint n, m;
    cin >> n >> m;
    lint ans=0, tmp;
    UnionFind uf(n+1);
    //vector<lint> a(n),b(n);
    REP(i, m) {
        lint a, b;
        cin >> a >>b;
        uf.merge(a, b);
    }
    FOR(i,1,n+1){
        ans = max(ans, uf.size(i));
    }

    cout << ans <<"\n";

    return 0;
}

Measured memory_bytes: 6348
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<array>
#include<map>
#include<bitset>
#include<iomanip>
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define dme cout<<"IMPOSSIBLE"<<endl;return 0
//ios::sync_with_stdio(false);
//std::cin.tie(0);
//<< setprecision(20)
//19234567892927;
const int mod=1e9+7;
const llint big=1e13+100;
const long double pai=3.141592653589793238462643383279502884197;
const long double ena=2.71828182845904523536;
const long double eps=1e-7;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){return a/gcd(a,b)*b;}
//初めは1
//a+x秒でx倍になる
//nにするのにかかった時間-a
int main(void){
	llint n,a,ans=big;cin>>n>>a;
	for(int kai=1;kai<40;kai++){//食べる回数
		llint mto=pow((double)n,1/(double)kai);
		llint gen=(a+mto)*kai;
		llint ya=1;//現在の量
		for(int i=0;i<kai;i++){ya*=mto;}
		while(ya<n){
			ya/=mto;ya*=mto+1;
			gen++;
		}
		mineq(ans,gen);
	}
	cout<<ans-a<<endl;
	return 0;
}

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

public class Main {
    static long f(long min, long max){
        if(min>max) return f(max,min);
        if(min+10>max){
            //System.err.println("simple");
            long ans = 0;
            for(long x=min; x<=max; x++) ans ^= x;
            return ans;
        }

        long ans = 0;
        if((min&1) != 0){
            //System.err.println("min is odd");
            ans ^= min;
            min++;
        }
        if((max&1) == 0){
            //System.err.println("max is even");
            ans ^= max;
            max--;
        }

        long pair = (max-min+1)/2;
        //System.err.println((pair + " pairs."));
        if(pair%2 != 0) ans ^= 1L;

        return ans;
    }
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        long min = sc.nextLong();
        long max = sc.nextLong();
        System.out.println(f(min, max));
    }
}

Measured memory_bytes: 23124
<?php
    /*
        Problem URL : http://abc042.contest.atcoder.jp/tasks/abc042_a
 
        Score  :
        Result :
        Time   : ms
        Memory : KB
     */
 
    ini_set('error_reporting', E_ALL & ~E_NOTICE);
    // define('DEBUG', true);
    define('DEBUG', false);
 
    // N“ú‚ÅKŸ
    fscanf(STDIN, "%d %d %d", $A, $B, $C);

    if  ($A + $B + $C === 17) {
        echo "YES\n";
    } else {
        echo "NO\n";
    }


Measured memory_bytes: 3704
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#include<ctype.h>
#include<math.h>
#define PI 3.14159265359
#define N_MAX 1000
#define NUM 1000
#define min(x,y) x < y ? x : y
#define max(x,y) x > y ? x : y

int main()
{
  int n, i, sum;
  long double a[N_MAX], m, tmp, v, sd;
  while(1)
    {
      scanf("%d",&n);
      if(n == 0) break;
      tmp = 0;
      sum = 0;
      sd = 0;
      v = 0;
      for(i = 0; i < n; i++)
	{
	  scanf("%Lf", &a[i]);
	  sum += a[i];
	  tmp += a[i] * a[i];
	}
      m = sum / (double)n;
      v = tmp / (double)n - m*m;
      sd = sqrt(v);
      printf("%Lf\n", sd);
    }
  return 0;
}

Measured memory_bytes: 676
from collections import defaultdict
n, m = map(int, input().split())
friends_of = defaultdict(list)#[[] for _ in range(m)]
for _ in range(m):
    x, y, _ = map(int, input().split())
    friends_of[x - 1].append(y - 1)
    friends_of[y - 1].append(x - 1)
ans = 0
visited = [False] * n
for i in range(n):
    if not visited[i]:
        ans += 1
        stack = [i]
        while len(stack) != 0:
            popped = stack.pop()
            visited[popped] = True
            for friend in friends_of[popped]:
                if not visited[friend]:
                    stack.append(friend)
print(ans)

Measured memory_bytes: 79320
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<string>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<stack>
using namespace std;
#define ll long long
#define ull unsigned long long
#define up(i,a,b) for(register int i=(a);i<=(b);i++)
#define down(i,a,b) for(register int i=(a);i>=(b);i--)
#define mem(x,y) memset(x,(y),sizeof x)
#define ff first
#define ss second
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define sc(a) scanf("%d",&a)
#define scl(a) scanf("%lld",&a)
#define scs(a) scanf("%s",a)
#define pr(a,b) printf("%d%c",a,b)
#define prl(a,b) printf("%lld%c",a,b)
#define PQ priority_queue
#define ld long double
#define all(v) v.begin(),v.end()

typedef pair<int,int> pii;
typedef map<int,int> mii;
typedef vector<int> V;

pii a[100010];

bool cmp(pii a,pii b) {
	return a.ff+a.ss>b.ff+b.ss;
}

int main() {
	int n;
	cin>>n;
	up(i,1,n)cin>>a[i].ff>>a[i].ss;

	sort(a+1,a+1+n,cmp);

	ll ans=0;
	up(i,1,n) {
		if(i%2)ans+=a[i].ff;
		else ans-=a[i].ss;
	}

	cout<<ans<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int n,a,b,h[100100];
int Judge(long long x)
{
    long long t[100100],cnt=0;
    for(int i=1;i<=n;i++)t[i]=h[i];
    for(int i=1;i<=n;i++)t[i]-=x*(long long)b;
    //for(int i=1;i<=n;i++)cout<<t[i]<<" ";
    //cout<<endl;
    for(int i=1;i<=n;i++)
    {
        if(t[i]>0)
        {
            if(t[i]%(long long)(a-b)==0)cnt+=t[i]/(long long)(a-b);
            else cnt+=t[i]/(long long)(a-b)+1;
        }
    }
    //cout<<cnt<<endl;
    if(cnt<=x)return 1;
    else return 0;
}
int main()
{
    scanf("%d%d%d",&n,&a,&b);
    for(int i=1;i<=n;i++)scanf("%d",&h[i]);
    long long L=1,R=1e9;
    //cout<<Judge(800000000)<<endl;
    while(L<R)
    {
        long long mid=((long long)L+(long long)R)/2;
        if(Judge(mid))R=mid;else L=mid+1;
    }
    //if(Judge(R))L=R;
    printf("%lld\n",L);
    return 0;
}


Measured memory_bytes: 1408
s = input()

ma = 0
l = s[0]
an = 0
#s+=str(1-int(s[len(s)-1]))
#print(s)
ar = [-11,s[0]]
ans = 0
for i in range(1,len(s)):
    #print(i,s[i])
    if int(s[i])+int(ar[len(ar)-1])==1:
        ar.pop()
        ans+=2
    else:
        ar.append(s[i])
print(ans)
        


Measured memory_bytes: 3956
function Main(input) {
  const num = parseInt(input);
  
  const a = Math.floor(num / 1000);
  const b = Math.floor((num / 100) % 10);
  const c = Math.floor((num / 10) % 10);
  const d = num % 10;

  const answer = b == c && (a == b || c == d) ? 'Yes' : 'No';

  console.log(answer);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n; cin >> n;
	map<char, int> occ;
	for(int i = 'a'; i <= 'z'; i++) occ[i] = 100000;
	for(int i = 0; i < n; i++){
		map<char, int> now;
		for(int j = 'a'; j <= 'z'; j++) now[j] = 0;
		string j; cin >> j;
		for(auto c : j) now[c]++;
		for(auto c : now) occ[c.first] = min(occ[c.first], c.second);
	}
	for(auto e : occ) while(e.second--) cout << e.first;
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Split
namespace util {

std::vector< std::string > split(std::string s, char delimiter)
{
  std::vector< std::string > vs;
  std::string sub;
  for (auto c : s) {
    if (c == delimiter) vs.push_back(sub), sub.clear();
    else sub += c;
  }
  vs.push_back(sub);
  return vs;
}

} // namespace util

// Minimum, Maximum
template<class T> T minimum(T head, T tail) { return std::min(head, tail); }
template<class H, class... T> H minimum(H head, T... tail) { return std::min(head, minimum(tail...)); }
template<class T> T maximum(T head, T tail) { return std::max(head, tail); }
template<class H, class... T> H maximum(H head, T... tail) { return std::max(head, maximum(tail...)); }

// Output
template<class T, class S> std::ostream& operator << (std::ostream& os, std::pair<T, S> p)
{
  return os << p.first << " " << p.second;
}

template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::vector< std::pair<T, S> > vp)
{
  ll i = 0;
  for (auto p : vp){os << " [" << i++ << "]" << p.first << " " << p.second; if (i % 10 == 0) os << std::endl;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

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

  ll N;
  ld K;
  std::cin >> N >> K;

  ld ans = 0.0;
  for (ll i = 1; i <= N; i++) {
    ld x = i;
    ll cnt = 0;
    while (x < K) {
      x *= 2;
      cnt++;
    }
    ld kaku = std::pow(0.5, cnt);
    //std::cout << i << " " << std::setprecision(12) << kaku << std::endl;
    ans += kaku;
  }

  ans /= (ld)N;
  
  std::cout << std::setprecision(12) << ans << std::endl;

  return 0;
}


Measured memory_bytes: 384
// default code for competitive programming
// ver 3.1415 {{{

// Includes
#include <bits/stdc++.h>

// Defines
#define NAME(x) #x
#define SZ(c) (int)(c).size()
#define ALL(c) (c).begin(), (c).end()
#define FOR(i, e) for( int i = 0 ; i < (e) ; i++ )
#define ITER(it, c) for(__typeof((c).begin()) it = (c).begin(); it != (c).end(); it++)
#define REP(i, s, e) for(int i = (s); i <= (e); i++)
#define REPD(i, s, e) for(int i = (s); i >= (e); i--)
#define IOS ios_base::sync_with_stdio( 0 )
#define DEBUG 1
#define fst first
#define snd second
#define PB push_back
#ifdef ONLINE_JUDGE
#define FILE( fn ) \
    freopen(fn".in","r",stdin); \
    freopen(fn".out","w",stdout);
#else
#define FILE( fn )
#endif

#ifdef AKAI
#define debug( ... ) fprintf( stderr , __VA_ARGS__ )
#else
#define debug( ... )
#endif

using namespace std;

// Typedefs
typedef double real;
typedef long long ll;
typedef pair<ll, int> pli;
typedef tuple<ll, int> tli;
typedef pair<int, int> pii;
typedef tuple<int, int> tii;
typedef unsigned long long ull;

// Some common const.
const double EPS = 1e-8;
const double Pi = acos(-1);

// Equal for double
bool inline equ(double a, double b)
{return fabs(a - b) < EPS;}

int _R( int& x ) { return scanf( "%d" , &x ); }
int _R( ll& x ) { return scanf( "%" PRId64 , &x ); }
int _R( double& x ) { return scanf( "%lf" , &x ); }
int _R( char* s ) { return scanf( "%s" , s ); }

int R() { return 0; }

template< typename T1 , typename... T2 >
int R( T1& x , T2&... tail )
{
  int tmp = _R( x );
  return tmp + R( tail... );
}

template< typename Iter , typename F >
inline void out( Iter s , Iter e , F of )
{
  bool flag = 0;
  for( Iter it = s ; it != e ; it++ )
  {
    if( flag ) printf( " " );
    else flag = 1;
    of( *it );
  }
  puts( "" );
}

// }}}
// start ~~QAQ~~

const int MAXN = 2010;

int n;
ll X , a[ MAXN ];
ll mnc[ MAXN ];
ll mina[ MAXN ][ MAXN ];

int main() {
  R( n , X );
  REP( i , 1 , n ) R( a[ i ] );
  REP( i , 1 , n ) {
    mina[ i ][ 0 ] = a[ i ];
    int cur = i;
    REP( j , 1 , n-1 ) {
      cur--;
      if( cur == 0 ) cur = n;
      mina[ i ][ j ] = min( mina[ i ][ j-1 ] , a[ cur ] );
    }
  }
  ll ans = -1;
  FOR( num , n ) {
    ll tans = num * X;
    REP( i , 1 , n ) tans += mina[ i ][ num ];
    if( ans == -1 || tans < ans ) ans = tans;
  }
  printf( "%lld\n" , ans );
}


Measured memory_bytes: 31616
#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()
{
    ll a;
    long double b;
    cin >> a >> b;
    ll ans = (ll)(a * b);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3732
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,fma,abm,mmx,avx,avx2,tune=native")
#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;
#ifdef rd
#define trace(...) cout<<"Line:"<<__LINE__<<" "; __f(#__VA_ARGS__, __VA_ARGS__)
template<typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
	cout<<name<<" : "<<arg1<<endl;
}
template<typename Arg1, typename ... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
	const char *comma=strchr(names+1,',');
	cout.write(names,comma-names)<<" : "<<arg1<<" | ";
	__f(comma+1,args...);
}
#else
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef float f80;
#define double long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
const ll infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;
const int mod=998244353;
//const int mod=1000000007;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;
auto clk=clock();
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
int powm(int a, int b) {
	int res=1;
	while(b) {
		if(b&1)
			res=(res*a)%mod;
		a=(a*a)%mod;
		b>>=1;
	}
	return res;
}

const int N=3e6+5;
int fact[N],ifact[N];
inline int ncr(int n,int r) {
	if(n<r||r<0)
		return 0;
	return (((fact[n]*ifact[r])%mod)*ifact[n-r])%mod;
}
inline int idf(int n, int r) {
	return ncr(n+r-1,r-1);
}
int vals[N];
void solve() {
	fact[0]=1;
	rep(i,1,N)
		fact[i]=(fact[i-1]*i)%mod;
	ifact[N-1]=powm(fact[N-1],mod-2);
	for(int i=N-2; i>=0; i--)
		ifact[i]=(ifact[i+1]*(i+1))%mod;
	int n,m;
	cin>>n>>m;
	int ans=idf(3*m,n);
	for(int i=2*m+1; i<=3*m; i++) {
		ans=(ans-n*idf(3*m-i,n-1))%mod;
	}
	for(int i=m+2; i<=3*m; i+=2) {
		ans=(ans-ncr(n,i)*idf((3*m-i)/2,n))%mod;
	}
	if(ans<0)
		ans+=mod;
	cout<<ans<<endl;
}

signed main() {
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	srand(chrono::high_resolution_clock::now().time_since_epoch().count());
	cout<<fixed<<setprecision(10);
	int t=1;
//	cin>>t;
	fr(i,1,t)
	{
		solve();
	}
#ifdef rd
	cout<<endl<<endl<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
#endif
	return 0;
}


Measured memory_bytes: 48128
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <fstream>
#include<cstdio>
#include<iomanip>

#define REP(i, n) for(int i=0;i<n;i++)
#define REP_1(i, n) for(int i=1;i<n+1;i++)
using namespace std;
typedef long long ll;
typedef unsigned long ul;
typedef long double ld;


int main() {
    int N;
    cin >> N;
    ll power = 1;
    REP_1(i, N) {
        power *= i;
        power %= 1000000007;
    }
    cout << power << endl;

}

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

int n;
int cnt[10005];

int main() {
	scanf("%d", &n);
	for (int x = 1; x * x <= n; x++) {
		for (int y = 1; y * y <= n; y++) {
			for (int z = 1; z * z <= n; z++) {
				int cur = x * x + y * y + z * z + x * y + y * z + z * x;
				if (cur <= n) cnt[cur]++;
			}
		}
	}
	for (int i = 1; i <= n; i++) printf("%d\n", cnt[i]);
	return 0;
}


Measured memory_bytes: 3844
import bisect

N, Q = map(int, input().split())
S = input()
oc = 'X'
results = []
for i in range(len(S)): 
    c = S[i] 
    if oc+c == "AC":
      results.append(i)
    oc = c
#print(results)

LRs = [tuple(map(int,input().split())) for i in range(Q)]

for L, R in LRs:
    fi = bisect.bisect_left(results,L)
    li = bisect.bisect_left(results,R)
    #print(fi,li)
    # fi が右端、liが左端(存在しないときの処理)
    print(li - fi)


Measured memory_bytes: 20740
#include<stdio.h>
int main()
{
    int a[10][10];
    int b[10][10];
    int c[10];
    int i,j,k,n;
    for(i=0;i<3;i++)
    {
        for(j=0;j<3;j++)
        {
            scanf("%d",&a[i][j]);
        }
    }
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&c[i]);
    }
    for(i=0;i<3;i++)
    {
        for(j=0;j<3;j++)
        {
            b[i][j]=0;
            for(k=0;k<n;k++)
            {
                if(c[k]==a[i][j])
                {
                    b[i][j]=1;
                }
            }
        }
    }
    if(b[0][0]==1&&b[0][1]==1&&b[0][2]==1){printf("Yes\n");return 0;}
    else if(b[1][0]==1&&b[1][1]==1&&b[1][2]==1){printf("Yes\n");return 0;}
    else if(b[2][0]==1&&b[2][1]==1&&b[2][2]==1){printf("Yes\n");return 0;}
    else if(b[0][0]==1&&b[1][0]==1&&b[2][0]==1){printf("Yes\n");return 0;}
    else if(b[0][1]==1&&b[1][1]==1&&b[2][1]==1){printf("Yes\n");return 0;}
    else if(b[0][2]==1&&b[1][2]==1&&b[2][2]==1){printf("Yes\n");return 0;}
    else if(b[0][0]==1&&b[1][1]==1&&b[2][2]==1){printf("Yes\n");return 0;}
    else if(b[2][0]==1&&b[1][1]==1&&b[2][0]==1){printf("Yes\n");return 0;}
    else printf("No\n");return 0;
}

Measured memory_bytes: 128
#ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include<bits/stdc++.h>
#endif
using namespace std;

using ll = long long;

//constant
const double EPS = 1e-10;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, s, e) for (ll i = s; i < e; i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(), (x).rend()

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

// vector
//template<typename T> vector<vector<T>> vv(ll H, ll W, T v) { return vector<vector<T>> vec(H, vector<T>(W, v)); }

// view vector
template<typename T> void view(T e) { cout << e << endl; }
template<typename T> void view(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }
template<typename T> void view(const vector<vector<T> >& vv) { for (const auto& v : vv) { view(v); } }

// DP
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 N, K, C;

vector<ll> sub(string S){
    ll last = -C - 1;

    ll cnt = 0;
    vector<ll> vec(N+1, 0);
    REP(i, N){
        if(i - last > C && S[i] == 'o') {
            cnt++;
            last = i;
        }
        vec[i+1] = cnt;
    }

    return vec;
}


int main(){
    cin >> N >> K >> C;
    string S;
    cin >> S;

    string T = S;
    reverse(ALL(T));

    const auto& left = sub(S);
    const auto& right = sub(T);

    bool flag = false;
    REP(i, N){
        if (S[i] == 'x') continue;
        if (left[i] + right[N - 1 - i] < K) cout << i + 1 << endl, flag=true;
    }

    if (!flag) cout << endl;

}

Measured memory_bytes: 5184
#include "bits/stdc++.h"
#define rep(i,N) for (int (i) = 0; (i) < (N); (i)++)

int main() {

	std::cin.tie(nullptr); std::ios::sync_with_stdio(false);

	int N, A; std::cin >> N >> A;

	if (N % 500 <= A)std::cout << "Yes";
	else std::cout << "No";

	return 0;
}

Measured memory_bytes: 256
// In the name of God

#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>

using namespace std;

#define rep(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
template<typename T> inline bool smin(T &a, const T &b)   { return a > b ? a = b : a;    }
template<typename T> inline bool smax(T &a, const T &b)   { return a < b ? a = b : a;    }

typedef long long LL;

const int N = (int) 1e6 + 6, mod = (int) 0;
int a[N], p[N], dp[N];
int main() {
	memset(a, 63, sizeof a);
	int n;
	cin >> n;
	for (int j = 0; j < n; ++j) {
		cin >> a[j];
		--a[j];
		p[a[j]] = j;
	}
	for (int j = 0; j < n; ++j) {
		if (a[j] - 1 >= 0 && p[a[j] - 1] < j) {
			dp[j] = dp[p[a[j] - 1]]	+ 1;
		} else {
			dp[j] = 1;
		}
	}
	int res = 0;
	for (int j = 0; j < n; ++j) res = max(res, dp[j]);
	cout << n - res << endl;
}








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

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define mp make_pair
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

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

  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> B(N);
  vector<int> C(N-1);
  rep(i, N) {
    cin >> A[i];
    A[i]--;
  }
  rep(i, N) {
    cin >> B[i];
  }
  rep(i, N-1) {
    cin >> C[i];
  }
  int sum = 0;
  rep(i, N) {
    if (i >= 1) {
      if (A[i] == A[i-1]+1)
        sum += C[A[i-1]];
    }
    sum += B[i];
  }
  cout << sum << endl;
}


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

int main() {

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


Measured memory_bytes: 3076
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/

int L, C[1010];
int flag[101];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> L;

    stack<int> stk;
    rep(i, 0, L) {
        int c; cin >> c;
        if (0 < c) {
            // 入る
            if (flag[c]) {
                cout << i + 1 << endl;
                return;
            }

            flag[c] = true;
            stk.push(c);
        } else {
            // 出る
            c *= -1;
            if (!flag[c] or stk.top() != c)
            {
                cout << i + 1 << endl;
                return;
            }
            stk.pop();
            flag[c] = false;
        }
    }
    cout << "OK" << endl;
}



Measured memory_bytes: 3208
#include<bits/stdc++.h>
using namespace std;
short dp[(1<<24)+1];
int main(){
  int n;;
  while(cin>>n,n){
    int col[n],ans=0;
    double r[n],x[n],y[n];
    for(int i=0;i<n;i++)
      cin>>x[i]>>y[i]>>r[i]>>col[i];
    memset(dp,0,sizeof(dp));
    dp[((1<<n)-1)]=1;
  
    for(int i=1<<n;i>=0;i--)if(dp[i])
	for(int j=n-1;j>=0;j--)if((1<<j)&i)
	    for(int k=j-1;k>=0;k--)
	      if(((1<<k)&i)&&col[j]==col[k]){
		for(int l=j-1;l>=0;l--)if((i&(1<<l))&&abs(sqrt((x[l]-x[j])*(x[l]-x[j])+(y[l]-y[j])*(y[l]-y[j])))<r[j]+r[l])goto L;
	        for(int l=k-1;l>=0;l--)if((i&(1<<l))&&abs(sqrt((x[l]-x[k])*(x[l]-x[k])+(y[l]-y[k])*(y[l]-y[k])))<r[k]+r[l])goto L;
		dp[i-(1<<j)-(1<<k)] =dp[i]+2;
		ans=max(ans,(int)dp[i-(1<<j)-(1<<k)]);
	      L:;
	      }
    if(ans)cout<<ans-1<<endl;
    else cout<<0<<endl;
  }
}

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

/*---------------------------------------------------*/
/* 0 : push / d=0 : pushFront, d=1 : pushBack        */
/* 1 : randomAccess                                  */
/* 2 : pop  / d=0 : delFront,  d=1 : delBack         */
/*---------------------------------------------------*/

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

  int query;
  int d, num;
  std::deque<int> deq;

  for(int i=0; i<n; ++i){
    cin >> query;

    if(query == 0){
      cin >> d >> num;
      if(d == 0){
        deq.push_front(num);
      }else{
        deq.push_back(num);
      }
    }

    else if(query == 1){
      cin >> num;
      cout << deq[num] << endl;
    }

    else{
      cin >> d;
      if(d == 0){
        deq.pop_front();
      }else{
        deq.pop_back();
      }
    }
  }

  return 0;
}


Measured memory_bytes: 4636
from itertools import combinations_with_replacement

N, M, Q = map(int, input().split())
num = []

for i in range(Q):
    num.append(list(map(int, input().split())))

lst = list(combinations_with_replacement([i for i in range(1, M+1)], N))

ans = 0
for q in lst:
    ans_tmp = 0
    
    for i in range(Q):
        if(q[num[i][1]-1]-q[num[i][0]-1] == num[i][2]):
            ans_tmp += num[i][3]
    
    if(ans < ans_tmp):
        ans = ans_tmp
print(ans)

Measured memory_bytes: 21368
#include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using ll = long long;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
  ll modpow(ll x, ll b){
    ll res = 1;
    while(b){
      if(b&1)res = res * x % MOD;
      x = x * x % MOD;
      b>>=1;
    }
    return res;
  }

  ll modinv(ll x){
    return modpow(x, MOD-2);
  }

  bool was_output = false;
  template<class t>
  void output(t a){
    if(was_output)cout << " ";
    cout << a;
    was_output = true;
  }
  void outendl(){
    was_output = false;
    cout << endl;
  }
  ll in(){
    ll res;
    scanf("%lld", &res);
    return res;
  }

  template<class t>
  istream& operator>>(istream&is, vector<t>&x){
    for(auto &i:x)is >> i;
    return is;
  }

  template<class t, class u>
  istream& operator>>(istream&is, pair<t, u>&x){
    is >> x.first >> x.second;
    return is;
  }

  template<class t>
  void in(t&x){
    cin >> x;
  }

  template<class t>
  t in(){
    t res; cin >> res; return res;
  }

  template<class t>
  void out(t x){
    cout << x;
  }

  template<class t>
  vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
    sort(line.begin(),line.end(),comp);
    return line;
  }

  template<class t>
  vector<t> reversed(vector<t> line){
    reverse(line.begin(),line.end());
    return line;
  }
}

using namespace templates;

int main(){
  int n = in();
  vector<queue<int>> lines(n);
  int q = in();
  rep(i,q){
    int kind = in();
    if(kind==0){
      int t = in();
      int x = in();
      lines[t].emplace(x);
    }else if(kind==1){
      int t = in();
      if(lines[t].size()){
        cout << lines[t].front() << endl;
      }
    }else{
      int t = in();
      if(lines[t].size()){
        lines[t].pop();
      }
    }
  }
}



Measured memory_bytes: 4424
"""
// Author : snape_here - Susanta Mukherjee
     
 """
 
from __future__ import division, print_function
 
import os,sys
from io import BytesIO, IOBase
 
if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
 
 
def ii(): return int(input())
def si(): return input()
def mi(): return map(int,input().split())
def li(): return list(mi())
 
 
def read():
    sys.stdin = open('input.txt', 'r')  
    sys.stdout = open('output.txt', 'w') 
 
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

mod=1000000007

import math

import bisect

abc="abcdefghijklmnopqrstuvwxyz"

def main():

    n=ii()
    f=[0]*(n+5)
    a=li()
    for i in range(n-1):
        f[a[i]]+=1 
    for i in range(1,n+1):
        print(f[i])

        
# region fastio

 
BUFSIZE = 8192
 
 
class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()
 
 
if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
 
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# endregion
 
 
if __name__ == "__main__":
    #read()
    main()

Measured memory_bytes: 97152
#define _USE_MATH_DEFINES
#define INF 100000000

#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>

using namespace std;

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

static const double EPS = 1e-8;

const int tx[] = {-1,0,1,0};
const int ty[] = {0,1,0,-1};


bool check(map<int,int>& hand,int step,int n){
	for(map<int,int>::iterator it = hand.begin(); it != hand.end(); it++){
		if(it->first == step % n) continue;
		if(it->second != 0) return false; 
	}
	return true;
}
int main(){
	int n,p;	
	while(~scanf("%d %d",&n,&p)){
		if(n==p && p==0) break;
		map<int,int> hand;
		int bowl = p;
		int step = 0;
		int res = 0;
		while(1){
			if(bowl > 0){			
				hand[step]++;
				bowl--;
				if(bowl == 0 && check(hand,step,n)){
					res = step;
					break;
				}
			}
			else if(bowl == 0){
				bowl += hand[step];
				hand[step] = 0;
			}
			step = (step+1) % n;
		}

		printf("%d\n",res);
	}
}

Measured memory_bytes: 920
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
inline int read(){
	int sum=0;
	char c=getchar();
	while(!isdigit(c)) c=getchar();
	while(isdigit(c)){
		sum=(sum<<1)+(sum<<3)+(c^48);
		c=getchar();
	}
	return sum;
}
bitset<4000005> f;
int n;
int main(){
	n=read();
	f[0]=1;
	int sum=0;
	for(int i=1;i<=n;i++){
		int a=read();
		sum+=a;
		f|=f<<a;
	}
	for(int i=(sum+1)/2;i<=sum;i++)
	  if(f[i]){
	  	  printf("%d\n",i);
	  	  return 0;
	  }
	return 0;
}

Measured memory_bytes: 1664
#define __USE_MINGW_ANSI_STDIO 0
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <set>
#include <numeric>
#include <bitset>
#include <map>
#include <limits.h>
using namespace std;
typedef unsigned long ul;
typedef pair<ul, ul> P;
const int INF = 1e9;
 
long long gcd(long long x, long long y){
			if (x==0)return y;
      if(y==0)return x;
      if(x<y){
				long long temp = x;
			x = y;
				y = temp;
			}
			long long r = x % y;
				while(r!=0){
					x = y;
					y = r;
				r = x % y;
	    		}
			return y;
	    }

   
int main(){
int H,W;
cin >> H >> W;
vector<string> S(H+2) ;
for(int i = 1;i <= H;i++){
	cin >> S[i];
}
string tmp;
for(int i=0;i<W+2;i++){
	tmp += "#"; 
}
S[0] = tmp;
S[H+1] = tmp;
for(int i=1;i<=H;i++){
	S[i] += "#";
	S[i] = "#" + S[i];
}
for(int i=0;i<H+2;i++){
	cout << S[i] << endl;
}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
#define pq priority_queue
#define P pair<int,int>
#define P2 pair<int,P>
#define P3 pair<int,P2>
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0};
const int vx[]={1,0,-1,0}, vy[]={0,1,0,-1};
const ll LINF=1e18;
const ld PI=abs(acos(-1));

int main(){
	int k,n; cin >> k >> n;
	
	if(k % 2){
		deque<int> qu;
		REP(i, 0, n) qu.push_back((k + 1) / 2);	
		
		REP(i, 0, n / 2){
			if(qu.back() == 1) qu.pop_back();
			else{
				int tmp = qu.back(); qu.pop_back();
				qu.push_back(--tmp);
				
				while(qu.size() < n) qu.push_back(k);
			}
		}
		
		while(!qu.empty()) cout << qu.front() << " ", qu.pop_front();
		cout << endl;
	}else{
		cout << k / 2 << " ";
		REP(i, 0, n - 1) cout << k << " ";
		cout << endl;
	}
	return 0;
}


Measured memory_bytes: 3584
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<cstdlib>
#include<map>
#include<fstream>
#include<string>
#include<sstream>
#include<iomanip>
using namespace std;


int main()
{
	int h, w, m, n;
	cin >> h >> w >> m >> n;
	cout << (h - m) * (w - n) << endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp12
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] aa = Console.ReadLine().Split(' ');

            if(int.Parse( aa[0]) == int.Parse(aa[1]))
            {
                if(int.Parse(aa[1]) == int.Parse(aa[2]))
                {
                    Console.WriteLine("No");
                }
                else
                {
                    Console.WriteLine("Yes");
                    
                }
            }
            else
            {
                if (int.Parse(aa[0]) == int.Parse(aa[2]))
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    if (int.Parse(aa[1]) == int.Parse(aa[2]))
                    {
                        Console.WriteLine("Yes");
                    }
                    else
                    {
                        Console.WriteLine("No");

                    }
                }
            }
        }
    }
}


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

int main(){
  ll n, z, w;
  cin >> n >> z >> w;

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

  if(n == 1){
    cout << abs(a[0]-w) << endl;
  }
  else{
    cout << max(abs(a[n-1]-w), abs(a[n-1]-a[n-2])) << endl;
  }

  return 0;
}


Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
map<int,int> m;
int main(){
    int n;
    scanf("%d",&n);
    for (int i =0,x;  i <n; i++){
        scanf("%d",&x);
        if (m[x]){
            printf("NO");
            return 0;
        }
        m[x]++;
    }
    printf("YES");

}


Measured memory_bytes: 9600
N=int(input())
S=input()
cnt=0
black=[0]*N
white=[0]*N
for i in range(N):
    if S[i]==".":
        white[i]=1
    else:
        black[i]=1
    if i>=1:
        white[i]+=white[i-1]
        black[i]+=black[i-1]
        
B=black[-1]
W=white[-1]

ans=min(B,W)
for i in range(1,N):
    num=black[i-1]+W-white[i-1]
    ans=min(ans,num)
    
print(ans)

Measured memory_bytes: 43616
#include<bits/stdc++.h>
#define R(x) (x)=read()
const int N = 100005;
char c[N];
int a[N],b[N];
int n,m,T;
using namespace std;
int gcd(int x,int y) {
	if(x%y==0) return y;
	else return gcd(y,x%y);
}
int read() {
	int x=0;char c=getchar();
	while((c<48||c>57)&&c!='-') c=getchar();
	if(c=='-') {c=getchar();while(c>=48&&c<=57) x=x*10-c+48,c=getchar();}
	while(c>=48&&c<=57) x=x*10+c-48,c=getchar();
	return x;
}
void init() {
	
}
void solve() {
	R(n);
	while(n) {
		if(n%10==9) {printf("Yes");return ;}
		n/=10;
	}
	printf("No");return ;
//	for(int i=1;i<=n;i++) {
//		
//	}
	
	
	
	
}
int main() {
	init();
	solve();
	return 0;
}

Measured memory_bytes: 256
import numpy as np
import heapq
N,M = map(int,input().split())
A = list(map(int,input().split()))
A = [x*(-1) for x in A]
heapq.heapify(A)
for i in range(M):
  heapq.heapreplace(A,int(A[0]/2))
print(-sum(A))

Measured memory_bytes: 23124
/*g++ main.cpp -o main.out*/
/*./main.out*/

#include<bits/stdc++.h>
using namespace std;

#define LL long long
#define LD long double
#define Mod 1000000007
#define L_Mod 17100000013

const double eps = 1e-9;
const int INF = 0x3f3f3f3f;
const double PI = 3.1415926535;

#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define ree(a,n) memset(a,n,sizeof(a));

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))

LL Pow(LL a, LL n, LL m)
{
    LL t = 1;
    for (; n; n >>= 1, a = (a * a % m))
        if (n & 1)
            t = (t * a % m);
    return t;
}
const int p=1000000007;
vector<int> v;
int dp[1101];
LL Cal(int l, int r, int k, int dis)
{
    LL res = 1;
    for (int i = l; i <= r; i++)
    {
        int t = i;
        for (int j = 0; j < v.size(); j++)
        {
            int y = v[j];
            while (t % y == 0) dp[j] += dis, t /= y;
        }
        res = res * (LL)t % k;
    }
    return res;
}
LL inv(LL a, LL p) { return Pow(a, p - 2, p); }
LL Comb(int n, int m, int k)
{
    memset(dp, 0, sizeof(dp));
    v.clear();
    int tmp = k;
    for (int i = 2; i * i <= tmp; i++)
        if (tmp % i == 0)
        {
            int num = 0;
            while (tmp % i == 0) tmp /= i, num++;
            v.push_back(i);
        }
    if (tmp != 1) v.push_back(tmp);
    LL ans = Cal(n - m + 1, n, k, 1);
    for (int j = 0; j < v.size(); j++) ans = ans * Pow(v[j], dp[j], k) % k;
    ans = ans * inv(Cal(2, m, k, -1), k) % k;
    return ans;
}


int main()
{
    LL n,a,b;
    cin>>n>>a>>b;
    LL ans=(Pow(2,n,Mod)-1+Mod)%Mod;
    ans=((ans-Comb(n,a,p)+Mod)%Mod-Comb(n,b,p)+Mod)%Mod;
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
n,a,b,c,d = map(int,input().split(' '))
s=input()
ans=1

if c<d:
    m=d
else:
    m=c

for i in range(a, m-3):
        if s[i] == '#' and s[i+1] == '#':
            ans=0

flag=0
if d<c:
    for i in range(b-2, d-1):
        if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.':
            flag=1
    if flag == 0:
        ans=0
        
if ans == 1:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3572
#include <iostream>
#include <regex>
using namespace std;
int main() {
  string S,T; cin>>S>>T;
  regex format (R"(^[a-z]+$)");
  bool res1=regex_match(S, format);
  bool res2=regex_match(T, format);
  if (res1 == true && res2==true) {
    if (S.length()+1 == T.length() && S.length()<=10) {
      T.erase(T.length()-1);
      if (S == T) {
        cout<<"Yes"<<endl;
      } else {
        cout<<"No"<<endl;
      }
    } else {
      cout<<"No"<<endl;
    }
  } else {
    cout<<"No"<<endl;
  }
  return 0;
}

Measured memory_bytes: 3716
# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


MOD = 10**9 + 7

X, Y = read_ints()
if (X + Y) % 3 != 0:  # !=0
    print(0)
    exit()

pascal_depth = int((X + Y) / 3)  # パスカルの三角形に当たるn
x, y = int((X + Y) * 2 / 3), (X + Y) / 3
pascal_k = x - X  # 端からいくつずれているか

if pascal_k > pascal_depth / 2:
    pascal_k = pascal_depth - pascal_k

# ans = 1
# # for k in range(int(pascal_k), 0, -1):
# #     ans *= pascal_depth
# #     # print(ans)
# #     pascal_depth -= 1
# #     if ans > MOD:
# #         ans %= MOD

# # for k in range(int(pascal_k), 0, -1):
# # フェルマーの少定理jを使ってみる
# for i in range(1, int(pascal_depth) + 1):
#     ans *= i
#     if ans > MOD:
#         ans %= MOD

# from math import factorial
# # k_fact = factorial(pascal_k)
# k_fact = 1
# # k_fact
# for i in range(1, pascal_k + 1):
#     k_fact *= i
#     if k_fact > MOD:
#         k_fact %= MOD
# ans *= k_fact**(MOD - 2) % MOD
# # nk_fact = factorial(pascal_depth - pascal_k)
# nk_fact = 1
# for i in range(1, int(pascal_depth - pascal_k) + 1):
#     nk_fact *= i
#     if nk_fact > MOD:
#         nk_fact %= MOD

# ans *= nk_fact**(MOD - 2) % MOD


def cmb(n, r, mod):
    if (r < 0 or r > n):
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod


mod = 10**9 + 7  # 出力の制限
N = pascal_depth
g1 = [1, 1]  # 元テーブル
g2 = [1, 1]  # 逆元テーブル
inverse = [0, 1]  # 逆元テーブル計算用テーブル

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)


a = cmb(pascal_depth, pascal_k, mod)
print(a)


Measured memory_bytes: 82504
<?php
//error_reporting(0);
$N = trim(fgets(STDIN));
//list($N,$K) =  explode(" ",trim(fgets(STDIN)));
$A = explode(" ",trim(fgets(STDIN)));

asort($A);

foreach($A as $k=>$v) {
  printf("%d ",$k+1);
}
printf("\n");


Measured memory_bytes: 16884
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int m,h;
    
    while(true) {
    	String c = sc.next();
    	if(c.equals("-")) {
    		break;
    	}
    	
    	m = sc.nextInt();
    	for(int i=0;i<m; i++) {
    		h = sc.nextInt();
    		String head =c.substring(0,h);
    		String tail = c.substring(h);
    		c = tail+head;
    	}
    	System.out.println(c);
    }
    }
}


Measured memory_bytes: 26276
import sys
Input = sys.stdin.readline
#Input = input

N = int(Input())
X = list(map(int, Input().split()))
l = (N-1) // 2

X_idx = [idx for idx, _ in sorted(enumerate(X), key=lambda x: x[1])]
med_r = X[X_idx[N//2]]
med_l = X[X_idx[(N//2)-1]]
for x in X:
    if x < med_r:
        print(med_r)
    else:
        print(med_l)

Measured memory_bytes: 37120