akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

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

    vector<int> a(n + 1);
    rep(i, n) cin >> a[i + 1];

    vector<int> b(n + 1);
    for (int i = n; i >= 1; i--)
    {
        int sum = 0;
        for (int j = i + i; j <= n; j += i)
        {
            sum ^= b[j];
        }
        b[i] = sum ^ a[i];
    }

    vector<int> ans;
    for (int i = 1; i <= n; i++)
    {
        if (b[i])
            ans.push_back(i);
    }
    cout << ans.size() << endl;
    rep(i, ans.size())
    {
        printf("%d%c", ans[i], i + 1 == ans.size() ? '\n' : ' ');
    }
    return 0;
}

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace   std;
#define ff        first
#define ss        second
#define ll        long long
#define int       long long
#define inf       ((ll)1e18)
#define double    long double
#define ull       unsigned long long
#define mod       1000000007
#define vi        vector<ll>
#define extreme   inline
#define ppi       pair<ll,pair<ll,ll>>
#define pb        push_back
#define mp        make_pair
#define str       string
#define pi        2*acos(0.0)
#define pr(a,x,n) for(int i=x;i<n;i++){cout<<a[i]<<" ";}
#define p(a)      cout<<a;
#define sp(x,y)   fixed<<setprecision(y)<<x
#define w(x)      ll x; cin>>x; while(x--)
#define all(v)    v.begin(), v.end()
#define test      cout<<"THIS_AND_THIS"<<endl;
void kehsihba(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	/*#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif*/
}
void solve(){
	ll n,m;
	cin>>n>>m;
	if(n%m==0){
		cout<<n/m;
	}
	else{
		cout<<n/m+1;
	}
}
int32_t main(){
	kehsihba();
	ll t=1;
	//cin>>t;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 3600
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
#include<cassert>
using namespace std;
#include<atcoder/all>
using namespace atcoder;


#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 998244353;
const ll MAX = 4000001;
const long double eps = 1E-14;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

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

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

using mint = modint998244353;

typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;

typedef vector<mint> vmint;
typedef vector<vector<mint>> vvmint;
typedef vector<vector<vector<mint>>> vvvmint;

/////////////////////////////////////

int main() {
	ll N, K;
	cin >> N >> K;
	vvll A(N, vll(N));
	rep(i, N)rep(j, N)cin >> A[i][j];

	mcf_graph<ll,ll> g(2 * N + 2);
	ll big = 1e10;

	ll s = 2 * N;
	ll t = 2 * N + 1;

	rep(i, N)rep(j, N) {
		g.add_edge(i, N + j, 1, big - A[i][j]);
	}
	rep(i, N) {
		g.add_edge(s, i, K, 0);
		g.add_edge(N+i, t, K, 0);
	}
	g.add_edge(s, t, N*K, big);

	ll ans = g.flow(s, t, N * K).second;
	ans = N * K * big - ans;
	cout << ans << endl;

	vvll gr(N, vll(N));

	rep(i, N* N) {
		auto e = g.get_edge(i);
		gr[e.from][e.to - N] = e.flow;
	}
	rep(i, N){
		rep(j, N) {
			if (gr[i][j]) { cout << 'X'; }
			else { cout << '.'; }
		}
		cout << endl;
	}

}


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

int main(){
    int a, b;
    cin >> a >> b;
    if(a%3==0||b%3==0||(a+b)%3==0){
        cout << "Possible" << endl;
    }else{
        cout << "Impossible" << endl;
    }
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define all(v) v.begin(), v.end()
#define repi(i, n, init) for (ll i = init; i < (n); i++)
#define repd(i, n, init) for (ll i = (n); i >= init; i--)
#define repm(i, m) for (auto i = m.begin(); i != m.end(); i++)
#define repb(bit, n, init) for (ll bit = init; bit < (1 << n); ++bit)

vector<ll> fact, invfact;
ll modpower(ll x, ll n, ll mod)
{
    ll res = 1;
    while (n)
    {
        if (n & 1)
            res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}
ll inv(ll n)
{
    return modpower(n, MOD - 2, MOD);
}
void COMinit(ll k)
{ //空っぽの配列を二つ
    k++;
    fact.resize(k, 0);
    invfact.resize(k, 0);
    fact[0] = 1;
    repi(i, k, 1)
    {
        fact[i] = fact[i - 1] * i % MOD;
    }
    invfact[k - 1] = inv(fact[k - 1]);
    repd(i, k - 2, 0)
    {
        invfact[i] = invfact[i + 1] * (i + 1) % MOD;
    }
    return;
}
ll nCk(vector<ll> &fact, vector<ll> &invfact, ll n, ll k)
{ //この関数を使う前にCOMinit
    if (k < 0 || n < k)
        return 0LL;
    return fact[n] * invfact[k] % MOD * invfact[n - k] % MOD;
}
ll com(ll n, ll k)
{
    ll iv = 1;
    ll fa = 1;
    repi(i, k, 0)
    {
        fa *= (n - i);
        fa %= MOD;
    }
    repi(i, k + 1, 1)
    {
        iv *= inv(i);
        iv %= MOD;
    }
    return fa * iv % MOD;
}

//---------main function----------

int main()
{
    ll x, y;
    cin >> x >> y;
    if ((2 * x - y) % 3 != 0 || (2 * y - x) % 3 != 0)
    {
        cout << 0 << endl;
    }
    else
    {
        ll n = (2 * x - y) / 3, m = (2 * y - x) / 3;
        // cout << n << " " << m << endl;
        if (n > m)
            swap(n, m);
        ll ans;
        if (m < 0 || n < 0)
            ans = 0;
        else
            ans = com(n + m, n);

        ans %= MOD;
        if (ans < 0)
            ans += MOD;
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>

int cmp(void const *a, void const *b) {
	return *((int*)a) - *((int*)b);
}

int main(void) {
	int n, w[100];
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", w + i);
	}
	int s1, s2, min = INT_MAX;
	for (int i = 0,j; i < n; i++) {
		s1 = 0; s2 = 0;
		for (j = 0; j <= i; j++) {
			s1 += w[j];
		}
		for (; j < n; j++) {
			s2 += w[j];
		}
		if (min > abs(s1 - s2))
			min = abs(s1 - s2);
	}
	printf("%d\n", min);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main() {
    int m, n;
    cin >> m >> n;
    if (m == 2) {
        int x = 0;
        for (int i = 0; i < n; i++) {
            int a;
            cin >> a;
            if ((i % 2 == 0) == (a == 1))x++;
        }
        cout << min(x, n - x) << endl;
    } else {
        vector<vector<int>> dp(n, vector<int>(2, 1145141919));
        dp[0][false] = 0, dp[0][true] = 1; // その日変えたか？
        int prev;
        cin >> prev;
        for (int i = 1; i < n; i++) {
            int now;
            cin >> now;

            dp[i][false] = dp[i - 1][true];
            if (prev != now) dp[i][false] = min(dp[i][false], dp[i - 1][false]);
            dp[i][true] = min(dp[i - 1][false], dp[i - 1][true]) + 1;

            prev = now;
        }
        cout << min(dp[n - 1][false], dp[n - 1][true]) << endl;
    }
    return 0;
}



Measured memory_bytes: 8428
#include <iostream>
#include<bits/stdc++.h>
#include<vector>
#include<set>
#include<math.h>

using namespace std; 

int main() 
{
	int n, d, count = 0;

	cin >> n >> d;

	while(n--)
	{
		int a, b;

		cin >> a >> b;
		
		if(sqrt(pow(a,2) + pow(b,2)) <= d)
			count++;	
	}

	cout << count;
}



Measured memory_bytes: 3672
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double lb;
#define REP(i,j,n) for (int i=j;i<(n);i++)
#define RREP(i,n,j) for (int i = n; j<=i;i--)
#define print(out) cout<< out  << "\n";
#define all(vec) vec.begin(),vec.end()
#define mod 1000000007
const int INF = 1e9;
typedef pair<ll,ll> P;

int main(){
  int N,K,h0,h,ans=INF,sum;cin>>N>>K;
  vector<int> H(N),Diff(N-1);
  REP(i,0,N){cin>>H[i];}
  sort(all(H));
  REP(i,0,N-K+1){
    sum=0;
    REP(j,i,i+K-1){
      sum+=H[j+1]-H[j];
    }
    ans=min(sum,ans);
  }
  print(ans)
}


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

using namespace std;

int main()
{
	int N, D, X;
	cin >> N >> D >> X;
	vector<int> A(N);
	for (auto& A_i : A) {
		cin >> A_i;
	}

	int ans = X;
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < D; j += A[i]) {
			++ans;
		}
	}
	cout << ans << endl;
}


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

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> h(N);
  for (int i = 0; i < N; i++) cin >> h[i];
  sort(h.begin(), h.end());
  int ans = 1e9;
  for (int i = 0; i < N - K + 1; i++) {
    ans = min(ans, h[K + i - 1] - h[i]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint mod = 1e9 + 7;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
lint power(lint base, lint exponent, lint module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ lint root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<lint> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } lint C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };
template<class itr> bool next_sequence(itr first, itr last, int max_bound){ itr now = last; while(now != first){ now--; (*now)++; if((*now) == max_bound){ (*now) = 0; }else{ return true; } } return false; }

int main(){
    int X, A;
    cin >> X >> A;
    if(X < A){
        cout << 0 << endl;
    }else{
        cout << 10 << endl;
    }
}


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

string src;
inline bool enc(string s){
	int done;
	done = 1;
	for(int i = 0 ; i < s.size() ; i++){
		if( !(done >> (s[i]-'a') & 1) ){
			done |= 1 << (s[i]-'a');
			s[i]--;
		}
		if( src[i] != s[i] ) return false;
	}
	return true;
}

int main(){
	while(cin >> src && src!= "#"){
		vector<string> v;
		for(int i = 0 ; i < (1<<src.size()) ; i++){
			string dst = src;
			for(int j = 0 ; j < src.size() ; j++)
				if( dst[j] != 'z' && (i >> j & 1) ){
					dst[j]++;
				}
			if( enc(dst) ){
				v.push_back(dst);
			}
		}
		sort(v.begin(),v.end());
		v.erase(unique(v.begin(),v.end()),v.end());
		cout << v.size() << endl;
		if( v.size() <= 10 ){
			for( auto x : v ) cout << x << endl;
		}else{
			for(int j = 0 ; j < 5 ; j++) cout << v[j] << endl;
			for(int j = 0 ; j < 5 ; j++) cout << v[v.size()-5+j] << endl;
		}
	}
}

Measured memory_bytes: 2352
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;

int main() {   
    int n, h, w;
    cin >> n >> h >> w;
    int res = 0;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        if (a >= h && b >= w) res++;
    }
    cout << res << endl;
}




Measured memory_bytes: 3636
#include<stdio.h>
int main(){
    int n;
    int h[200000];

    int max=-1;
    int max_i=-1;
    scanf("%d",&n);

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

    for(int i=n-1;i>=1;i--){
        if(h[i-1]>h[i]){
            h[i-1]--;
        }
    }

    for(int i=0;i<n-1;i++){
        if(h[i]>h[i+1]){
            printf("No\n");
            return 0;
        }
    }

    printf("Yes\n");
    
    return 0;
}

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

using namespace std;

int main()
{   int a,b,k  ;
    scanf("%d%d%d",&a,&b,&k) ;
    for (int i=0 ;  i<k ; i++){
        if (i%2==0){
            if (a % 2==1)
                a-- ;
            b+=a/2 ;
            a-=(a/2) ;
        }else {
         if (b% 2==1)
                b-- ;
            a+=b/2 ;
            b-=(b/2) ;
        }
    }
  cout<<a<<" "<<b ;
}


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

  int d,g;
  cin >> d >> g;
  vector<int>p(d);
  vector<int>c(d);
  rep(i,d){
    cin >> p[i]>> c[i];
  }
  ll ans = 1001;
  for(int bit = 0; bit < (1<<d); ++bit){
    ll sum = 0;
    ll cnt = 0;
    //全部解答
    rep(i,d){
      if(bit & (1<<i)) {
        sum += c[i] + p[i] * 100 * (i+1);
        cnt += p[i];
      }
    }
    if(sum >= g) ans = min(ans,cnt);
    else{
      //得点の大きい方からなるべく解答
      for(int i = d-1; i >= 0; i--){
        if (bit & (1<<i)) continue; // 全部解答はスキップ
        rep(j,p[i]){
          if (sum >= g) break;
          sum += 100 * (i+1);
          ++cnt;
        }
      }
      ans = min(ans,cnt);
    }
  }

  cout << ans << endl;
  return 0;

}

Measured memory_bytes: 3640
/*
时间:2020-7-29
书籍：算法和数据结构
内容：二分搜索
页数：P94
*/
#include<iostream>
using namespace std;
bool binarySearch(int *S,int length,int n)                
{
	int left = 0, right = length - 1;
	int mid;
	while (left <= right)
	{
		mid = (left + right) / 2;
		if (S[mid] == n)
			return true;
		else if (n < S[mid])
			right = mid - 1;
		else if (S[mid] < n)
			left = mid + 1;
	}
	return false;
}
int main()
{
	int n;
	cin >> n;
	int* S = new int[n];
	for (int i = 0; i < n; ++i)
		cin >> S[i];
	int q;
	cin >> q;
	int* T = new int[q];
	for (int i = 0; i < q; ++i)
		cin >> T[i];
	int count = 0;
	for (int i = 0; i < q; ++i)
	{
		if (binarySearch(S, n, T[i]))
			++count;
	}
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 3596
import itertools
N,M=map(int,input().split())
x=[0 for i in range(N)]
y=[0 for i in range(N)]
z=[0 for i in range(N)]
for i in range(N):
    x[i],y[i],z[i]=map(int,input().split())
w=[[0 for i in range(N)] for i in range(8)]
S=list(itertools.product([-1,1],repeat=3))
def num(inp):
    res=0
    for i in range(3):
        res+=2**i*(inp[i]+1)//2
    return res
for sg in S:
    for i in range(N):
        w[num(sg)][i]=x[i]*sg[0]+y[i]*sg[1]+z[i]*sg[2]
tmp=[0 for i in range(8)]
for sg in S:
    w[num(sg)].sort(reverse=True)
    for i in range(M):
        tmp[num(sg)]+=w[num(sg)][i]
print(max(tmp))



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

int main(){
       int a, b, c;
       scanf("%d%d%d", &a, &b, &c);
       int p, pp;
       p =  a;
        a=b;
       b=p;

       pp =  a;
        a=c;
       c=pp;
     printf("%d %d %d", a, b, c);
     return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int h,w;
	cin >> h >> w;
	int srow,scol,erow,ecol;
	cin >> srow >> scol;
	cin >> erow >> ecol;
	--srow,--scol,--erow,--ecol;
	string grid[h];
	for(int i = 0; i < h;++i){
		cin >> grid[i];
	}
	bool ok = false;
	deque<pair<int,int> > dq;
	int dist[h][w];
	for(int i = 0; i < h;++i){
		for(int j = 0; j < w;++j){
			dist[i][j] = 1e7;
		}
	}
	dist[srow][scol] = 0;
	dq.push_back({srow,scol});
	while(!dq.empty()){
		pair<int,int> cur_node = dq.front();
		dq.pop_front();
		int row = cur_node.first;
		int col = cur_node.second;
		if(row == erow && col == ecol){
			ok = true;
			break;
		}
		for(int dx = -2;dx <= 2;++dx){
			for(int dy = -2;dy <= 2;++dy){
				int nrow = row + dx;
				int ncol = col + dy;
				if(nrow == row && ncol == col)
					continue;
				if(nrow < 0 || ncol < 0 || nrow >= h || ncol >= w)
					continue;
				int w = 1;
				if(grid[nrow][ncol] == '#')
					continue;
				if((abs(nrow-row) == 1 && abs(ncol-col) == 0) || (abs(ncol-col) == 1 && abs(nrow-row) == 0))
					w = 0;
				if(dist[nrow][ncol] > dist[row][col] + w){
					dist[nrow][ncol] = dist[row][col] + w;
					if(w == 0)
						dq.push_front({nrow,ncol});
					else
						dq.push_back({nrow,ncol});
				}
			}
		}
	}
	if(!ok)
		dist[erow][ecol] = -1;
	cout << dist[erow][ecol] << "\n";
}


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

using namespace std;

#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 mp make_pair
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<pair<ll, ll>> vpll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template<class T>
void print(vector<T>& V, bool spaced = true) {
    string space;
    spaced ? space = " " : space = "";
    for(int i = 0; i < V.size(); i++) {
        cout<< V[i] << space;
    }cout<< '\n';
}

template<class T>
void printendl(vector<T>& V) {
    for(int i = 0; i < V.size(); i++) {
        cout<< V[i] << '\n';
    }
}

template<class T>
T gcd(T a, T b) {
    T r;
    while (b != 0) {
        r = a % b;
        a = b;
        b = r;
    }
    return a;
}

template <class T>
T lcm (T a, T b) {
    return a / gcd(a, b) * b;
}

template<class T>
T Max(T a, T b) {
    return (a < b) ? b : a;
}

template<class T>
T Min(T a, T b) {
    return (a < b) ? a : b;
}

//str

bool isPalindrome(string str){
    
    int length = str.length();
 
    for (int i = 0; i < (length / 2); i++)
        if (str[i] != str[length - 1 - i])
            return false;
 
    return true;    
}

void reverseStr(string& str) 
{ 
    int n = str.length(); 
    for (int i = 0; i < n / 2; i++) 
        swap(str[i], str[n - i - 1]); 
}



//Read through the messages at the end when you're done


int main() {

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


    string s, t; cin>> s>>t;
    for(int i = 0; i < s.length(); i++) {
        if(s[i] != tolower(s[i])) {
            cout << "No" << '\n';
            return 0;
        }
    }

    for(int i = 0; i < t.length(); i++) {
        if(t[i] != tolower(t[i])) {
            cout << "No" << '\n';
            return 0;
        }
    }
    
    for(int i = 0; i < s.length(); ++i) {
        if(s[i] != t[i]) {
            cout << "No" << '\n';
            return 0;
        }
    }

    if(s.length() + 1 == t.length() && s.length() <= 10 && s.length() >= 1) {
        cout << "Yes" << '\n';
    }else {
        cout << "No" << '\n';
    }

    

    
    

    return 0;
}

    //Use long long da5eel rabbak!
    //Dont use endl;
    //DONT SUBMIT IZA UR NOT SURE WALLAHI BTENDAM
    //Dear Amine, just because it worked for the test cases doesnt necessarily mean it is correct.
    //Dear Amine, try it on ur own test cases iza ur not SURE
    //In case u didnt use long long, CHECK FOR POTENTIAL OVERFLOWS
    //DONT FORGET TO MOD EVERYTHING IZA U NEED TO MOD



Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// Welcome to my source code!

int main() {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a+n, greater<int>());
    int cnt = 0;
    ll h = 0, w = 0;
    for (int i = 1; i < n && cnt < 2; i++) {
        if (a[i - 1] == a[i]) {
            if (cnt == 0) h = a[i];
            else w = a[i];
            i++;
            cnt++;
        }
    }
    ll ans = h * w;
    cout << ans << endl;
}

Measured memory_bytes: 640
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) throws Exception {
        
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] NK = br.readLine().split(" ");
        int N = Integer.parseInt(NK[0]);
        int X = Integer.parseInt(NK[1]);
        int[] L = Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        
        for(int i = 1; i < N; i++){
            L[i] += L[i-1];
        }
        
        int count = 1;
        for(int i = 0; i < N; i++){
            if( L[i] <= X ) count++;
        }
        
        System.out.println(count);
    }
}


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

using namespace std;

long long p[10004];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	long long n, x, y, k;
	cin >> n >> x >> y;
	for(long long i = 1; i < n; ++i){
		for(long long j = i + 1; j <= n; ++j){
			k = min(j - i, abs(x - i) + 1 + abs(y - j));
			++p[k];
		}
	}
	for(long long i = 1; i < n; ++i) cout << p[i] << endl;

	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()

int main(){
    string s;
    cin>>s;
    if(s[0]=='9' or s[1]=='9')cout<<"Yes";
    else cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define fr first
#define sc second
#define all(x) x.begin(), x.end()
#define skip continue
#define NAME "code"
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
 
void faster(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
 
const int MAXN = 3e5;
const int INF = 1e9 + 2;
const ld pi = acos(-1);
const ll MOD = 1e9 + 7;
const ll POW = 1e9 + 9;

ll n, Q, cnt[MAXN], ans;
bool used[MAXN];

int main() {

    faster();

    cin >> n >> Q;

    used[1] = 1;
    for(int i = 1; i <= n; ++i){
        cnt[i] = 1;
    }

    int u, v;
    while(Q--){
        cin >> u >> v;
        if(used[u] == 1){
            if(cnt[u] == 1)
                used[u] = 0;
            used[v] = 1;    
        }
        cnt[v]++;
        cnt[u]--;
    }

    for(int i = 1; i <= n; ++i){
        ans += used[i];
    }

    cout << ans;

    return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPi(i, a, b) for(int i=int(a); i<int(b); i++)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define mp make_pair
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; }
const ll MOD = 1e9+7;

bool X[810][810];
bool isvisit[810][810];
ll H, W, K;

typedef queue<pair<ll, ll>> Q;

//void dfs(Q& que, ll y, ll x, int move){
//    if(y >= H) return;
//    if(x >= W) return;
//    if(y < 0) return;
//    if(x < 0) return;
//    if(move < 0) return;
//
//    if(!X[y][x]) return;
//
//    if(isvisit[y][x]) return;
//    isvisit[y][x] = true;
//
//    que.push(mp(y, x));
//
//    dfs(que, y+1, x, move-1);
//    dfs(que, y-1, x, move-1);
//    dfs(que, y, x+1, move-1);
//    dfs(que, y, x-1, move-1);
//}

ll solve(pair<ll, ll> s){
    //dfs(que, s.first, s.second, K);
    queue<pair<pair<ll, ll>, ll>> que2;
    que2.push(mp(s, K));
    set<pair<ll, ll>> pos;
    while(!que2.empty()){
        auto p = que2.front();
        que2.pop();
        ll num = p.second;
        auto po = p.first;
        ll y, x;
        tie(y, x) = po;
        if(y >= H) continue;
        if(x >= W) continue;
        if(y < 0) continue;
        if(x < 0) continue;
        if(isvisit[y][x]) continue;
        if(num < 0) continue;
        if(!X[y][x]) continue;

        isvisit[y][x] = true;
        pos.insert(po);
        que2.push(mp(mp(y+1, x), num-1));
        que2.push(mp(mp(y-1, x), num-1));
        que2.push(mp(mp(y, x+1), num-1));
        que2.push(mp(mp(y, x-1), num-1));
    }
    
    
    ll ans = 1000;
    for(auto&& p : pos){
        ll y = p.first;
        ll x = p.second;
        ll dist = 1000;
        chmin(dist, y);
        chmin(dist, x);
        chmin(dist, H-1-y);
        chmin(dist, W-1-x);
        chmin(ans, dist/K + (dist%K != 0));
    }
    return ans+1;
}

int main(){
    cin >> H >> W >> K;

    pair<ll, ll> S;
    REP(i,H){
        REP(j,W){
            char c;
            cin >> c;
            if(c == 'S'){
                S = mp(i, j);
                X[i][j] = true;
            }
            else if(c == '.')
                X[i][j] = true;
        }
    }

    ll ans = solve(S);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 40704
import bisect
N = int(input())
Alist = sorted(list(map(int, input().split())))
Blist = sorted(list(map(int, input().split())))
Clist = sorted(list(map(int, input().split())))

num = 0

for B in Blist:
    small = bisect.bisect_left(Alist, B)
    left = N - bisect.bisect_right(Clist, B)
    num += small * left
print(num)


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

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    ll s;
    for (ll i = 0; i < N; i++){
        cin >> A[i];
        A[i] = A[i] - i - 1;
    }
    sort(A.begin(), A.end());
    ll x = A[N/2];
    ll ans = 0;
    for (ll i = 0; i < N; i++){
        ans += abs(A[i] - x);
    }
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
string alp="abcdefghijklmnopqrstuvwxyz";
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);


int main(){
    double l;cin>>l;
    cout<<setprecision(20)<<pow(l/3,3)<<endl;
    
    return 0;
}






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

using namespace std;


#define ff				first
#define ss				second
#define int				long long
#define pb				push_back
#define mp				make_pair
#define pii				pair<int,int>
#define vi				vector<int>
#define mii 			map<int,int>
#define	pqb				priority_queue<int>
#define pqs				priority_queue<int,vi,greater<int> >
#define setbits(x)		__builtin_popcountll(x)
#define zrobits(x)		__builtin_ctzll(x)
#define mod				1000000009
#define inf 			1e18
#define ps(x,y)			fixed<<setprecision(y)<<x
#define mk(arr,n,type)	type *arr = new type[n]
#define w(x)			int x; cin>>x; while(x--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define endl			'\n'
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl

const int maxn = 1e5 + 5;
void c_p_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

}


bool isPrime(int n)
{
	if (n <= 1)
		return false;
	if (n <= 3)
		return true;
	if (n % 2 == 0 || n % 3 == 0)
		return false;
	for (int i = 5; i * i <= n; i += 6)
	{
		if (n % i == 0 || n % (i + 2) == 0)
			return false;

	}
	return true;
}

set<int> Sieve(int n)
{
	bool prime[n + 1];
	memset(prime, true, sizeof(prime));
	for (int i = 2; i * i <= n; i++)
	{
		if (prime[i])
		{
			for (int j = i * i; j <= n; j += i)
			{
				prime[j] = false;
			}
		}
	}
	set<int> primes;

	for (int i = 2; i <= n; i++)
	{
		if (prime[i])
			primes.insert(i);
	}
	return primes;
}
set<int> primeFactors(int  n)
{
	set<int> factors;
	while (n % 2 == 0)
	{
		n /= 2;
		factors.insert(2);

	}
	for (int i = 3; i <= sqrt(n); i += 2)
	{
		// int count = 0;
		while (n % i == 0)
		{
			factors.insert(i);
			n /= i;
		}
	}
	if (n > 2)
		factors.insert(n);
	return factors;
}

int power(int x, unsigned int y, int p)
{
	int res = 1;

	x = x % p;

	if (x == 0) return 0;
	;
	while (y > 0)
	{

		if (y & 1)
			res = (res * x) % p;

		y = y >> 1; // y = y/2
		x = (x * x) % p;
	}
	return res;

}

// Graph------------------------------------------------------------------------


int32_t main()
{
	FIO;
	// c_p_c();
	// --------------------------------------------------
	// Never GIVE UP !!!!
	int n;
	cin >> n;
	vi v(n);
	for (int&x : v)
		cin >> x;
	sort(v.begin(), v.end());
	int count = 0;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < j; k++)
			{
				if (v[k] != v[j] and v[j] != v[i] and v[k] + v[j] > v[i])
				{
					count++;
				}
			}
		}
	}
	cout << count << endl;

}

Measured memory_bytes: 3684
//ここで手段を選ばないゲスな精神が？

//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	int N = getint();

	short A[1001][1000];
	rep1(i, N) {
		rep(j, N - 1) A[i][j] = getint();
		A[i][N - 1] = 0;
	}
	short* k[1001];
	rep1(i, N) k[i] = A[i];
	int k2[1001] = {};
	k2[0] = 1e9;
	int V[2][1001], kazu = N;
	rep1(i, N) V[0][i] = i;

	int kotae = 0;
	while (kazu && kotae < 80000) {
		kotae++;
		int dotti = kotae & 1;
		int kari = 0;
		rep (i, kazu) {
			int v = V[!dotti][i];
			if (k2[v] < kotae) {
				int a = *k[v];
				if (k2[a] < kotae && *k[a] == v) {
					V[dotti][kari++] = v;
					k[v]++;
					k2[v] = kotae;
					V[dotti][kari++] = a;
					k[a]++;
					k2[a] = kotae;
				}
			}
		}
		kazu = kari;
	}

	int OK = 1;
	rep1(i, N) if (k[i] - A[i] != N - 1) OK = 0;
	if (kotae == 80000) printf("%d", N* (N - 1) / 2);
	else if (!OK) printf("-1"); 
	else printf("%d", kotae - 1);

	Would you please return 0;
}

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

#define for_(i,a,b) for(int i=a;i<b;++i)

typedef long long lint;

int H, W, dx[4] = { 0, 1, 0, -1 }, dy[4] = { -1, 0, 1, 0 };
lint L;
string grid[110], dir = "NESW";

int visit[110][110][4], px[41000], py[41000], pd[41000];

bool able(int x, int y) {
	if (x < 0 || x >= W || y < 0 || y >= H) return false;
	return grid[y][x] == '.';
}

int main() {
	while (cin >> H >> W >> L, H) {
		int x = 0, y = 0, d = 0;
		
		for_(i,0,H) {
			cin >> grid[i];
			for_(j,0,W) if (grid[i][j] != '.' && grid[i][j] != '#') {
				x = j; y = i;
				d = dir.find(grid[i][j]);
				grid[i][j] = '.';		
			}
		}
		
		memset(visit, -1, sizeof(visit));
		
		lint s = 0;
		while (visit[y][x][d] < 0) {
			visit[y][x][d] = s;
			px[s] = x; py[s] = y; pd[s] = d;
			while (!able(x + dx[d], y + dy[d])) d = (d + 1) % 4;
			x += dx[d]; y += dy[d];
			++s;
		}
		
		lint t = visit[y][x][d], id = L;
		if (s < L) id = t + (L - t) % (s - t);
		
		cout << py[id] + 1 << " " << px[id] + 1 << " " << dir[pd[id]] << endl;
	}
	
	return 0;
}

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

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define intMAX 1000000000
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod = 1e9+7;


string s,t;
int main(){
	cin >> s >> t;
	cout << t << s << endl;
}


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

using namespace std;

vector<vector<int>> dp;

signed main(){
// 	int q;
// 	cin>>q;
// 	while(q--){
		
// 	}
    string s;
    cin>>s;
    if(s=="ABC"){
        cout<<"ARC";
    }
    else
        cout<<"ABC";
}



Measured memory_bytes: 3624
#include <bits/stdc++.h>
const double pi = acos(-1);
using namespace std;

template<class T> inline void read(T &x) {
    x = 0;
    char ch = getchar(), w = 0;
    while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
    while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
    x = w ? -x : x;
    return;
}

int main() {
    double a, b, c;
    cin >> a >> b >> c;
    if (a * a * b <= 2 * c) {
        double x = 2 * (a * a * b - c) / (a * a);
        double the = atan2(x, a);
        printf("%.10lf", the * (180.00 / (pi)));
        return 0;
    }
    else {
        double x = 2 * c / (a * b);
        double the = atan2(b, x);
        printf("%.10lf", the * (180.00 / (pi)));
    }
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a,long long int b){
  if(a>b)
    return a;
  else
    return b;
}



void solve(){
  int k;
  cin>>k;
  string s;
  cin>>s;
  int n = s.length();
  if(n<=k){
    cout<<s;
  }

  else{
    string ans = "";
    for(int i = 0;i<k;i++){
      ans+=s.at(i);
    }
    ans+="...";
    cout<<ans;
  }
}

int main(){
  solve();  
}

Measured memory_bytes: 3608
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(true){
            int H=sc.nextInt();
            int W=sc.nextInt();
            if(H==0 && W==0)break;
            for(int i=0;i<H;i++){
                for(int j=0;j<W;j++){
                    if(i==0 || i==H-1 || j==0 || j==W-1)System.out.printf("#");
                    else System.out.printf(".");
                }
                System.out.println();
            }
            System.out.println();
        }
    }
}


Measured memory_bytes: 54052
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    ls = [0] * 101
    a, b, c, d = list(map(int, readline().split()))
    for i in range(a, b):
        ls[i] += 1
    for i in range(c, d):
        ls[i] += 1
    print(ls.count(2))


if __name__ == '__main__':
    solve()


Measured memory_bytes: 38384
using System;
using System.Collections;
using System.Linq;
class Pogram{
    static void Main(){
        string a,b;
        a = Console.ReadLine();
        b = Console.ReadLine();
        if (a.Length > b.Length)
            Console.WriteLine("GREATER");
        else if (b.Length > a.Length)
            Console.WriteLine("LESS");
        else{
            for (int i = 0; i < a.Length; i++){
                if (char.GetNumericValue(a[i]) > char.GetNumericValue(b[i])){
                    Console.WriteLine("GREATER");
                    Environment.Exit(0);
                }
                else if (char.GetNumericValue(a[i]) < char.GetNumericValue(b[i])){
                    Console.WriteLine("LESS");
                    Environment.Exit(0);
                }
            }
            Console.WriteLine("EQUAL");
        }
    }
}

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

using namespace std;

int main() {
  int n,k;cin>>n>>k;
  vector<int>p(n);
  rep(i,n)cin>>p[i];
  sort(p.begin(),p.end());
  int ans=0;
  for(int i=0;i<k;i++){
    ans+=p[i];
  }
  cout<<ans<<endl;
}
  

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

int main() {
  string s; cin >> s;
  long long ans = 0LL;
  auto pos = s.find("BC");
  while(pos != string::npos) {
    s.replace(pos, 2, "D");
    pos = s.find("BC", pos+1);
  }
  long long acnt = 0LL;
  for(char c: s) {
    if(c == 'A') acnt++;
    else if(c == 'D') ans += acnt;
    else acnt = 0;
  }

  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
const int SIZE = 200005;
int main(){
    int n, k; cin >> n >> k;
    long long sum = 0;
    vector<int> H;
    for (int i = 0; i < n; i++)
    {
        int h; cin >> h;
        H.push_back(h);
    }
    sort(H.begin(), H.end());
    for (int i = 0; i < n-k; i++)
    {
        sum += H[i];
    }
    cout << sum << endl;
}

Measured memory_bytes: 1400
#include <iostream>
#include <cmath>

using namespace std;

int main() {
  uint64_t a;
  double b;
  cin >> a >> b;
  uint64_t b_int = b * 100 + 0.5;

  cout << (a * b_int) / 100 << endl;
  
  return 0;
}


Measured memory_bytes: 3704
//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <map>
using namespace std;
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long int

int gcd(int a, int b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b);      
} 
 
int main() {
	//freopen("test.txt", "r", stdin);
	FASTER;
	int n; cin>>n;
	ll sum=0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			for(int k=1;k<=n;k++){
				sum+=gcd(gcd(i,j),k);
			}
		}
	}
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 3160
#include<stdio.h>
int main(){
  int m[10];
  int i;
  for(i=0;i<10;i++){
    scanf("%d",&m[i]);
  }
  int j;
  for(i=0;i<10;i++){
    for(j=0;j<10;j++){
      if(m[i]>m[j]){
	int temp=m[i];
	m[i]=m[j];
	m[j]=temp;
      }
    }
  }
  for(i=0;i<3;i++){
    printf("%d\n",m[i]);
  }
  return(0);
}

Measured memory_bytes: 1028
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>

using namespace std;

int main()
{
    int a,b,x;
    cin>>a>>b>>x;
    if (a<=x && a+b>=x) cout<<"YES";
    else cout<<"NO";
    return 0;
}


Measured memory_bytes: 764
s=input()
b="s"
n=0
last=-1
ans=[0 for _ in range(len(s))]
for i,v in enumerate(s):
    if b=='R' and v=='L':
        ans[i]+=1
        r=n//2
        l=n-r
        ans[i-1]+=l
        ans[i]+=r
        last=i
        n=0
        b=v
    elif b=="L" and v=="L":
        if (i-last)%2==0:
            ans[last]+=1
        else:
            ans[last-1]+=1
        b=v
    else:
        n+=1
        b=v
print(" ".join(map(str,ans)))
        

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

int main(){
  string S,T;
  cin>>S>>T;
  vector<int> s,t;
  for(int i=0;i<S.size();i++){
    s.push_back(S.at(i));
  }
  for(int i=0;i<T.size();i++){
    t.push_back(T.at(i));
  }

  sort(s.begin(),s.end());
  sort(t.begin(),t.end());
  reverse(t.begin(),t.end());

  for(int i=0;i<S.size();i++){
    S.at(i)=s.at(i);
  }
  for(int i=0;i<T.size();i++){
    T.at(i)=t.at(i);
  }
  if(S<T){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}


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

using namespace std;

int n, a[22][22];

const int mod = 1000000007;

int f[1<<21];

int F(int mask)
{
    int i = __builtin_popcount(mask);

    if (i == n)
        return 1;

    if (f[mask] > -1) return f[mask];
    f[mask] = 0;

    for (int j=0; j<n; ++j)
    {
        if (!(mask & (1<<j)))
        {
            if (a[i][j])
            {
                f[mask] += F(mask | (1 << j));
                f[mask] %= mod;
            }
        }
    }
    return f[mask];
}

int main()
{
    #ifdef DEBUG
    freopen("input.txt","r",stdin);
    #endif // DEBUG
    cin >> n;
    for (int i=0; i<n; ++i)
        for (int j=0; j<n; ++j)
            cin >> a[i][j];
    for (int j=0; j<(1<<n); ++j)
        f[j] = -1;
    cout << F(0);
    return 0;
}


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

void solve() {
	int n; cin >> n;
	int64_t a[n]; for(int i = 0; i < n; ++i) cin >> a[i];
	string s; cin >> s;
	vector<int64_t> base;
	for(int i = n - 1; i >= 0; --i) {
		for(int64_t b : base) {
			a[i] = min(a[i], a[i] ^ b);
		}
		if(s[i] == '0') {
			if(a[i] != 0) {
				base.push_back(a[i]);
			}
		} else {
			if(a[i] != 0) {
				cout << 1 << '\n';
				return;
			}
		}
	}
	cout << 0 << '\n';
}

int main() {
	int t; cin >> t;
	while(t--) {
		solve();
	}
	return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <climits>
#include <set>

using namespace std;

int hoge(set<int>&vec, int n, int cnt=0, int vsum=0) {
  if (cnt == 5)
    return (n <= vsum) ? vsum : INT_MAX;

  int ret = hoge(vec, n, cnt+1, vsum);
  for (auto &v : vec)
    ret = min(ret, hoge(vec, n, cnt+1, vsum*10+v));
  return ret;
}

int main() {
  int n, k;
  cin >> n >> k;
  set<int> vec;
  for (int i = 0; i < 10; ++i)
    vec.insert(i);
  for (int i = 0; i < k; ++i) {
    int d;
    cin >> d;
    vec.erase(d);
  }
  cout << hoge(vec, n) << endl;
}


Measured memory_bytes: 3644
using System.Collections.Generic;
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        Array.Sort(a);
        var t = a[n - 1] / 2d;
        var w = LowerBound(a, (int)t);
        var d1 = Math.Abs(t - a[w]);
        var d2 = Math.Abs(t - a[w - 1]);
        Console.Write("{0} ", a[n - 1]);
        Console.WriteLine(d1 < d2 ? a[w] : a[w - 1]);
    }
    public static int LowerBound<T>(T[] arr, int start, int end, T value, IComparer<T> comparer)
    {
        int low = start;
        int high = end;
        int mid;
        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (comparer.Compare(arr[mid], value) < 0)
                low = mid + 1;
            else
                high = mid;
        }
        return low;
    }
    public static int LowerBound<T>(T[] arr, T value) where T : IComparable
    {
        return LowerBound(arr, 0, arr.Length, value, Comparer<T>.Default);
    }
}

Measured memory_bytes: 20704
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a, b;
	char x;
	scanf("%d %c %d", &a, &x, &b);
	if (x == '+')
	{
		printf("%d\n",a + b);
	}
	else
	{
		printf("%d\n",a - b);
	}
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
using namespace std;

int main()
{
	char a[200001], ar[200001];
    scanf("%s\n", a);
    int n=strlen(a);
    deque<int> dq;
    set<char> st;
    for(int i=n-1; i>=0; i--){
      st.insert(a[i]);
      if(st.size()==26){
        dq.push_front(i);
        st.clear();
      }
    }
    int k=0, l;
    vector<char> v;
    while(!dq.empty()){
      l=dq.front();
      dq.pop_front();
      set<char> st1;
      for(int i=k; i<l; i++){
        st1.insert(a[i]);
      }
      char c;
      for(int i=0; i<26; i++){
        if(st1.find((char)('a'+i))==st1.end()){
          c=(char)('a'+i);
          v.push_back((char)('a'+i));
          break;
        }
      }
      for(int i=l; i<n; i++){
        if(a[i]==c){
          k=i;
          break;
        }
      }
      k++;
    }
    st.clear();
    for(int i=k; i<n; i++){
        st.insert(a[i]);
    }
    char c1;
    for(int i=0; i<26; i++){
      if(st.find((char)('a'+i))==st.end()){
        c1=(char)('a'+i);
        v.push_back((char)('a'+i));
        break;
      }
    }
    for(int i=0; i<v.size(); i++){
      printf("%c", v[i]);
    }
    printf("\n");	
	return 0;
}


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

int main(){
	int k,a,b;
	cin >> k >> a >> b;
	bool ans=false;
	for(int i=a;i<=b;i++){
		if(i%k==0){cout << "OK";return 0;}
	}
	cout << "NG";
	return 0;
}


Measured memory_bytes: 3640
#include <iostream>
using namespace std;
int main(){
int a, b, c;
cin >> a >> b >> c;
if (a > b) {
int x = a;
a = b;
b = x;
}
if (a > c) {
int x = a;
a = c;
c = x;
}
if (b > c) {
int x = b;
b = c;
c = x;
}
cout << a << " " << b << " " << c << "\n";
return 0;
}

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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define ALL(a) a.begin(),a.end()
#define INIT(a,b) memset(a,b,sizeof(a))
using lint = long long int;

int main() {
    for_(i,0,5) {
        int x;
        cin >> x;
        if (x == 0) {
            cout << i+1 << endl;
        }
    }
}

Measured memory_bytes: 3564
import java.util.Arrays;
import java.util.Scanner;

/**
 * Gluttony
 */
public class Main {

    public static void main(String[] args) throws Exception {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();
            long K = sc.nextLong();

            long[] A = new long[N];
            long[] F = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
            }
            for (int i = 0; i < N; i++) {
                F[i] = sc.nextLong();
            }

            long sum = Arrays.stream(A).sum();
            if (sum <= K) {
                System.out.println(0);
                return;
            }

            Arrays.sort(A);
            Arrays.sort(F);

            long min = 0;
            long max = 0;
            for (int i = 0; i < N; i++) {
                max = Math.max(max, A[i] * F[N - 1 - i]);
            }

            while (max - min > 1) {
                long mid = (min + max) / 2;

                long need = 0;
                for (int i = 0; i < N; i++) {
                    //need += Math.max(0, A[i] - mid / F[N - 1 - i]);
                    if (A[i] * F[N - 1 - i] > mid) {
                        need += A[i] - mid / F[N - 1 - i];
                    }
                }

                if (need > K) {
                    min = mid;
                } else {
                    max = mid;
                }
            }

            System.out.println(max);
        }

    }

}


Measured memory_bytes: 100332