akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
int main(){
  ll n,k;
  cin>>n>>k;
  vector<ll>a(n);
  rep(i,n)
    cin>>a[i];
  sort(a.begin(),a.end());
  ll ub=2e18,lb=-2e18;
  while(ub-lb>1){
    ll mid=(ub+lb)/2,cnt=0;
    rep(i,n-1){
      if(a[i]>0){
	    if(a[n-1]*a[i]<=mid)
          cnt+=(n-1)-(i+1)+1;
	    else if(a[i+1]*a[i]>mid)
          continue;
	    else{
	      ll ub2 = n-1;
	      ll lb2 = i+1;
	      while(ub2-lb2>1){
	        ll mid2 = (ub2+lb2)/2;
	        if(a[i]*a[mid2]<=mid)
              lb2=mid2;
	        else
              ub2=mid2;
	      }
        cnt+=ub2-(i+1);	  
	    }
      }
      else{
	    if(a[i+1]*a[i]<=mid)
          cnt += (n-1)-(i+1)+1;
        else if(a[n-1]*a[i]>mid)
          continue;
        else{
	      ll ub2 = n-1;
          ll lb2 = i+1;
          while(ub2-lb2>1){
            ll mid2=(ub2+lb2)/2;
            if(a[i]*a[mid2]>mid)
              lb2=mid2;
            else
              ub2=mid2;
          }
          cnt+=(n-1)-lb2;
	    }
      }
    }
    if(cnt<k)
      lb=mid;
    else
      ub=mid;
  }
  cout<<ub<<endl;
  return 0;
}

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

int main(){
  int a, b, c, x;
  cin >> a >> b >> c >> x;
  int ans = 0;
  for(int i = 0; i <= a; i++){
    for(int j = 0; j <= b; j++){
      for(int k = 0; k <= c; k++){
        int q = i*500+j*100+k*50;
        if(q == x) ans++;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

x, n = rm()
if n >= 1:
  li = rl()
else:
  print(x)
  exit()
for i in range(101):
  if (x-i) not in li:
    print(x-i)
    exit()
  elif (x + i) not in li:
    print(x+i)
    exit()

Measured memory_bytes: 27128
#include <bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
const ll INF=1LL<<30;
const ll LINF=1LL<<61;
const double eps=1e-9;
const ll MOD=1e9+7;
int main(){
    int n;cin>>n;
    vector<ll> a(n+1);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    a[n]=0;
    sort(all(a));
    ll x=0;
    for(int i=1;i<=n;i++){
        ll s=a[i]-a[i-1];
        if(s%2)x^=(n-i+1);
    }
    if(x==0){
        cout<<"second"<<endl;
    }else{
        cout<<"first"<<endl;
    }
}


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

arr = []

if n == 0:
    print(x)
else:
    tmp = input()
    num = tmp.split(' ')
    num_li = [int(i) for i in num]
    arr.extend(num_li)
    min = x
    max = x

    for i in range(10000):

        if min not in arr:
            print(min)
            break

        if max not in arr:
            print(max)
            break
                
        min -= 1
        max += 1

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

int n;
ll ans;

int main() {
    cin.sync_with_stdio(0); cin.tie(0);
    cin >> n;
    vector<ll> a(n);
    for (auto& i : a) cin >> i;
    
    for (int i = 0; i < n; i++) {
        if (!a[i]) continue;
        
        if (i < n - 1) {
            if (a[i] % 2 && a[i + 1]) {
                --a[i], --a[i + 1];
                ans += 1;
            }

        }
    }

    for (int i = 0; i < n; i++) {
        ans += a[i] / 2;
    }

    cout << ans;
}



Measured memory_bytes: 1024
import sys
import itertools

N = int(sys.stdin.readline())
P = [int(v) for v in sys.stdin.readline().split()]
Q = [int(v) for v in sys.stdin.readline().split()]
Ps = [list(v) for v in itertools.permutations(range(1, N + 1),N)]
Ps = sorted(Ps)

def find(l1):
    for i, l3 in enumerate(Ps):
        if l3 == l1:
            return i
    return 0

print(abs(find(P) - find(Q)))



Measured memory_bytes: 10612
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define reps(i,n) for (int i=1;i<=(n);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rreps(i,n) for (int i=(n);i>0;i--)
#define all(v) (v).begin(),(v).end()
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int,int>
template<class T> inline bool chmin(T &a, T b) {if (a>b) {a = b; return 1;} return 0;};
template<class T> inline bool chmax(T &a, T b) {if (a<b) {a = b; return 1;} return 0;};
typedef long long int ll;
const long long INF = 1LL << 60;

int main(){
  int N; cin >> N;
  int a[N]; rep(i,N) cin >> a[i];
  int b[N]; rep(i,N) cin >> b[i];

  ll sum = 0;
  rep(i,N){
    sum += b[i] - a[i];
  } 
  ll cnt = 0;
  rep(i,N){
    if (b[i]-a[i]>0) cnt += (b[i]-a[i]+1)/2;
  }
  if (sum>=0 && cnt<=sum) {
    cout << "Yes" << endl;
  }
  else cout << "No" <<endl;
 

  // cout << fixed << setprecision(10);
  
  return 0;
}


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

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		a[i] -= i;
	}
	sort(a.begin(), a.end());
	int b = a[n/2];
	long long ans = 0;
	for (int i = 0; i < n; i++) {
		ans += abs(a[i] - b);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4004
import java.io.IOException;
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) throws IOException {
 
        new Main().run();
    }
 
    private void run() throws IOException {
        Scanner scanner = new Scanner(System.in);
        while (true) {
            n = scanner.nextInt();
            if (n == 0)
                break;
            d = new int[n][n];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n; j++)
                    d[i][j] = scanner.nextInt();
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n; j++) {
                    d[i][j] = Math.max(d[i][j], d[j][i]);
                }
            ans = INF;
            pos = new int[n];
            dfs(0, 0);
            System.out.println(ans);
        }
    }
 
    private void dfs(int right, int bit) {
        if (ans <= right)
            return;
 
        if (Integer.bitCount(bit) == n) {
            ans = right;
            return;
        }
        for (int i = 0; i < n; i++) {
            if (((bit >> i) & 1) == 1)
                continue;
            int nbit = bit | 1 << i;
            for (int j = 0; j < n; j++) {
                if (((bit >> j) & 1) == 0)
                    continue;
                pos[i] = Math.max(pos[i], pos[j] + d[j][i]);
            }
            dfs(pos[i], nbit);
            pos[i] = 0;
        }
    }
 
    int n, ans;
    int[] pos;
    int[][] d;
    int INF = 1 << 30;
}

Measured memory_bytes: 26232
/*
 ▓█████▄  ▄████▄  ▓██   ██▓ ██▓███   ██░ ██ ▓█████  ██▀███
▒██▀ ██▌▒██▀ ▀█   ▒██  ██▒▓██░  ██▒▓██░ ██▒▓█   ▀ ▓██ ▒ ██▒
 ░██   █▌▒▓█    ▄   ▒██ ██░▓██░ ██▓▒▒██▀▀██░▒███   ▓██ ░▄█ ▒
 ░▓█▄   ▌▒▓▓▄ ▄██▒  ░ ▐██▓░▒██▄█▓▒ ▒░▓█ ░██ ▒▓█  ▄ ▒██▀▀█▄
 ░▒████▓ ▒ ▓███▀ ░  ░ ██▒▓░▒██▒ ░  ░░▓█▒░██▓░▒████▒░██▓ ▒██▒
  ▒▒▓  ▒ ░ ░▒ ▒  ░   ██▒▒▒ ▒▓▒░ ░  ░ ▒ ░░▒░▒░░ ▒░ ░░ ▒▓ ░▒▓░
  ░ ▒  ▒   ░  ▒    ▓██ ░▒░ ░▒ ░      ▒ ░▒░ ░ ░ ░  ░  ░▒ ░ ▒░
  ░ ░  ░ ░         ▒ ▒ ░░  ░░        ░  ░░ ░   ░     ░░   ░
    ░    ░ ░       ░ ░               ░  ░  ░   ░  ░   ░
  ░      ░         ░ ░
*/
//focus less on how much problem you should solve within a fixed time and focus more on getting the problem solved and
//learning something from it
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define per(i,a,b) for(ll i=a; i>=b; i--)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vii vector <pair<ll,ll> >
#define sedes set <ll, greater <ll> >
#define seasc set <ll>
#define pb push_back
#define mkp make_pair
#define ff first
#define ss second
#define MOD 1000000007
#define prec(n) fixed<<setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define umap unordered_map<ll, ll>
#define map map<ll, ll>
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define mems(a, i) memset(a, i, sizeof(a))
#define endl '\n'
#define all(v) v.begin(),v.end()
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define deba(a) cout << #a << " " << a << endl;
int main()
{
	fast;
#ifndef ONLINE_JUDGE
	freopen("/home/kushagra/Desktop/Kushagra/input.txt", "r", stdin);
	freopen("/home/kushagra/Desktop/Kushagra/output.txt", "w", stdout);
#endif
	ll a[5], k;
	rep(i, 0, 5)
	cin >> a[i];
	cin >> k;
	ll fl = 0;
	rep(i, 0, 5)
	{
		rep(j, 0, 5)
		{
			if (i != j)
			{
				ll x = abs(a[i] - a[j]);
				if (x > k)
					fl = 1;
			}
		}
	}

	if (fl == 1)
		cout << ":(" << endl;
	else
		cout << "Yay!" << endl;
	return 0;
}

Measured memory_bytes: 3592
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	void doIt() {
		int n = sc.nextInt();
		int h = sc.nextInt();
		int w = sc.nextInt();
		int cnt = 0;
		for(int i = 0 ; i < n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			if(h <= a && w <= b) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
	public static void main(String[] args) {
		new Main().doIt();
	}
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;

int main() {
	int n;
	string s,sum="";
	cin >> n;
	map<char, int>mp,tmp;
	cin >> s;
	for (auto c : s)mp[c]++;
	rep(i, n-1) {
		tmp.clear();
		cin >> s;
		for (auto c : s)tmp[c]++;
		rep(j, 26)mp['a' + j] = min(mp['a' + j], tmp['a' + j]);
	}
	for (auto p : mp) {
		if (p.second != 0) {
			rep(i, p.second)sum += p.first;
		}
	}
	sort(all(sum));
	cout << sum << endl;
	return 0;
}



Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define llu unsigned long long int
#define Endl endl
#define mod  998244353
#define mkp make_pair
#define pb push_back
#define cin(n) scanf("%d",&n)
#define cout(n) printf("%d ",n)
#define sf(n) scanf("%d",&n)
#define pf(n) printf("%d ",n)
#define bitget(n) __builtin_popcountll(n)
ll n,m;
ll dx[] = {1,1,0,-1,-1,-1,0,1};
ll dy[] = {0,-1,-1,-1,0,1,1,1};
ll dxx[] = {1,-1,0,0};
ll dyy[] = {0,0,-1,1};
ll modexpo(ll x,ll y){if(y==0)return 1;if(y%2){ll viky=modexpo(x,y/2);
return (((x*viky)%mod)*viky)%mod;}else{ll viky=modexpo(x,y/2);return (viky*viky)%mod;
}}
// ll intpoint(ll x1, ll y1, ll x2, ll y2) { return ( __gcd(abs(x1-x2),abs(y1-y2))+1); }
bool isvalid(ll x,ll y) { return (x>=1&&x<=n&&y>0&&y<=m); }
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// int pp = uniform_int_distribution<int>(0, kk-1)(rng);
// ---------------------///////////////---------------------------------
// ---------------------///////////////----------------------------------
// -------------/////////////////---------------------------------///////



int main() {
    // #ifndef ONLINE_JUDGE
    //     freopen("input.txt", "r", stdin);
    //     freopen("output.txt", "w", stdout);
    // #endif
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);

    string s,t;
    cin>>s>>t;
    ll ans = 0;
    if(s[0]==t[0]){
        ans++;
    }
    if(s[1]==t[1]){
        ans++;
    }
    if(s[2]==t[2]){
        ans++;
    }
    cout<<ans;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main (void){
    int t,h,m,s;
    scanf("%d",&t);
    h=t/3600;
    m=(t-h*3600)/60;
    s=t-h*3600-m*60;
    printf("%d:%d:%d\n",h,m,s);
    return 0;
}


Measured memory_bytes: 2060
#include<bits/stdc++.h>
using namespace std;
int sum=0,n,x;
bitset<5000000>s; 
int main(){
    scanf("%d",&n),s[0]=1;
    for(int i=1;i<=n;++i)scanf("%d",&x),s|=s<<x,sum+=x;
    for(int i=(sum+1)/2;;++i)if(s[i]){cout<<i;return 0;}
    return 0;
}


Measured memory_bytes: 2048
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n,k = inm()
d = set(inl())
for i in range(n,100000):
    a = set([])
    j = i
    while j>0:
        a.add(j%10)
        j //= 10
    if len(a&d)==0:
        print(i)
        exit()


Measured memory_bytes: 40684
def find(x):
    if parent[x] != x:
        parent[x] = find(parent[x])
    return parent[x]

def union(x, y):
    x = find(x)
    y = find(y)
    if x == y: return
    if rank[x] < rank[y]:
        parent[x] = y
    else:
        parent[y] = x
        if rank[x] == rank[y]:
            rank[x] += 1


N, M = map(int, input().split())
ps = list(map(lambda x: int(x) - 1, input().split()))

parent = [i for i in range(N)]
rank = [0] * N

for i in range(M):
    x, y = map(int, input().split())
    union(x - 1, y - 1)

for i in range(N):
    find(i)

ans = 0
for i in range(N):
    if parent[i] == parent[ps[i]]:
        ans += 1

print(ans)


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

#define lli long long int
#define REP(i,s,n) for(int i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;

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 main(){

    lli n;
    cin>>n;

    string s;
    cin>>s;

    lli lefW = 0,rigR = n-1;
    lli cnt = 0;

    while(1){
        while(lefW < n && s[lefW] != 'W')lefW++;
        while(rigR >=0 && s[rigR] != 'R')rigR--;
        LOG2(lefW,rigR);
        if(lefW > rigR)break;
        swap(s[lefW],s[rigR]);
        cnt++;
    }
    cout<<cnt<<endl;

    return 0;
}


Measured memory_bytes: 3752
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main(){
	int a, b, area, zhou;
	scanf("%d %d",&a,&b);
	area = a*b;//面積
	zhou = 2 * (a + b);//周の長さ
	printf("%d %d\n", area, zhou);
	return 0;
}


Measured memory_bytes: 2688
import java.util.*
import kotlin.math.*

fun int() = readLine()!!.toInt()
fun list() = readLine()!!.split(" ").map {it.toInt()}

fun main() {
	val n = int()
	val a = list().sortedDescending()

	fun t(i:Int,j:Int) = Triple(min(a[i],a[j]),i,j)

	val l = PriorityQueue<Triple<Int,Int,Int>>(compareBy {-it.first})
	l.add(t(0,1))
	l.add(t(1,0))

	var r = a[0].toLong()
	for(i in 2 until n) {
		val (v,pi,pj) = l.poll()
		r += v
		l.add(t(pi,i))
		l.add(t(i,pj))
	}
	println(r)
}


Measured memory_bytes: 96048
N = int(input())
As = list(map(int, input().split()))
Bs = list(map(int, input().split()))

numA, numB = 0, 0
for A, B in zip(As, Bs):
    if A < B:
        numA += (B - A + 1) // 2
        A += (B - A + 1) // 2 * 2
    if A > B:
        numB += A - B

if numA >= numB:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 4596
//新幹線からAC

#include <bits/stdc++.h>
#include <numeric>
#include <iomanip>
using namespace std;
    
#define int long long
#define pb push_back
#define ub upper_bound
#define lb upper_bound
#define mp make_pair
#define F first
#define S second
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define rep(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define ve vector
#define vi vector<int>
#define vp vector<pair<int,int>>
#define vvi vector<vector<int>>
    
using ll = long long;
const ll INF = LLONG_MAX - 100;
ll mod = 1e9 + 7;
int dx[] = {-1,0,1,0}, dy[] = {0,1,0,-1};
vector<ll> prime;
    
class fact {
public:
    int fmod = 1e9+7;
    vector<int> fac, inv;
    fact (int n, int Mod = 1e9+7) {
        fmod = Mod;
        fac = vector<int>(n,0);
        inv = vector<int>(n,0);
        fac[0] = 1; for (int i = 1; i < n; i++) fac[i] = fac[i-1] * i % fmod;
        for (int i = 0;i < n;i++) inv[i] = fact::POW(fac[i],fmod-2);
    }
    ll nCr(ll n, ll r) {return (fac[n] * inv[r] % fmod) * inv[n-r] % fmod;}
    ll POW(ll a, ll b) {ll c = 1; while (b > 0) {if (b & 1) {c = a * c%fmod;}a = a * a%fmod; b >>= 1;}return c;}
};
    
template <class T = ll> T in() {T x; cin >> x; return (x);}
void DEBUG(vector<int> a) {for(int i=0;i<a.size();i++)cout<<a[i]<<" ";cout<<endl;}
void EMP(int x) {cout<<"!!!"<<x<<"!!!"<<endl;}
ll GCD(ll a, ll b) {ll c; while (b != 0) {c = a % b; a = b; b = c;}return a;}
ll LCM(ll a, ll b) {return (a / GCD(a,b)) * b;}
ll POW(ll a, ll b) {ll c = 1; while (b > 0) {if (b & 1) {c = a * c%mod;}a = a * a%mod; b >>= 1;}return c;}
void PRI(ll n) {bool a[n + 1LL]; for (int i = 0; i < n + 1LL; i++) {a[i] = 1LL;}for (int i = 2; i < n + 1LL; i++) {if (a[i]) {prime.pb(i); ll b = i; while (b <= n) {a[b] = 0; b += i;}}}}
template <typename T> T chmin(T& a, T b) {if(a>b)a=b;return a;}
template <typename T> T chmax(T& a, T b) {if(a<b)a=b;return b;}
bool isSqrt(ll a) {return pow(sqrt(a),2) == a ? 1 : 0;}
void YesNo(bool a) {if (a) cout << "Yes"; else cout << "No"; cout << endl;}
void yesno(bool a) {if (a) cout << "yes"; else cout << "no"; cout << endl;}
void YESNO(bool a) {if (a) cout << "YES"; else cout << "NO"; cout << endl;}

int B[1005][1005];

bool solve() {
    int h, w, a, b; cin >> h >> w >> a >> b;
    rep (i, b) {
        rep (j, a) {
            B[i][j] = 1;
        }
        FOR (j, a, w) {
            B[i][j] = 0;
        }
    }
    FOR (i, b, h) {
        rep (j, a) {
            B[i][j] = 0;
        }
        FOR (j, a, w) {
            B[i][j] = 1;
        }
    }
    rep (i, h) {
        rep (j, w) {
            cout << B[i][j];
        }
        cout << endl;
    }
}

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();    
}


Measured memory_bytes: 9088
#n = int(input())
s = input()
#n, x= map(int,input().split())
#da = list(map(int,input().split()))
#a = [int(input()) for i in range(n)]

if s[0] == s[1] and s[1] == s[2]:
    print('No')
else:
    print('Yes')

Measured memory_bytes: 2940
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))

la = len(a)
lb = len(b)
l = min(la, lb)

for i in range(l):
    if a[i] > b[i]:
        print(0)
        break
    elif a[i] < b[i]:
        print(1)
        break
else:
    if la >= lb:
        print(0)
    else:
        print(1)


Measured memory_bytes: 5624
//do not think about past and stay in this moment
//organize and work - Abhinav IIITA
#include <bits/stdc++.h>
#include <ctime>
using namespace std;
#define int long long
#define ld long double
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end() 
const ld pi = acos(-1.0);
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int mod;
int h,w;
int mx=-1;
vector<int> adj[1000];
bool vis[20][20];
int level[20][20];
string s[20];
int zrr[100005];
void fact(){
	zrr[0]=1;
	for(int i=1;i<100005;++i){
		zrr[i]=i*zrr[i-1];
		zrr[i]%=mod;
	}
}
int modexp(int x){
	int y=mod-2;
	int res=1;
	while(y>0){
		if(y&1){
			res*=x;
			res%=mod;
		}
		x*=x;
		x%=mod;
		y/=2;
	}
	return res;
}
void solve(){	
	int n,r; cin>>n>>r;
	if(n>=10)
	cout<<r;
	else
	cout<<r+(100*(10-n));
}

// -----------------------------------------------------------------------


int32_t main()
{
	mod=1e9+7;
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); 	
	int t=1;
	//cin>>t;
	while(t--)
	solve();
	return 0;
}


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

int n,x[25],y[25],r[25],c[25],ans=0;
bool memo[(1<<24)]={};

bool check(int a,int b){
  int dis=(x[a]-x[b])*(x[a]-x[b])+(y[a]-y[b])*(y[a]-y[b]);
  if(((r[a]+r[b])*(r[a]+r[b]))<=dis)return false;
  return true;
} 

bool top(int now,int bits){
  for(int i=0;i<now;i++){
    if((bits>>i)%2 && check(i,now))return false;
  }
  return true;
}

void dfs(int bits,int sum){
  ans=max(sum,ans);
  //cout<<ans<<" "<<bits<<endl;
  for(int i=0;i<n;i++){
    if((bits>>i)%2 && top(i,bits)){
      for(int j=i+1;j<n;j++){
	if(c[i]==c[j] && (bits>>j)%2 && top(j,bits)){
	  int nbits=bits-((1<<i)+(1<<j));
	  if(!memo[nbits]){
	    memo[nbits]=true;
	    dfs(nbits,sum+2);
	  }
	}
      }
    }
  }
  return;
}

int main()
{
  while(1){
    cin>>n;
    if(n==0)break;
    for(int i=0;i<n;i++)cin>>x[i]>>y[i]>>r[i]>>c[i];
    ans=0;
    for(int i=0;i<(1<<24);i++)memo[i]=false;
    memo[(1<<n)-1]=true;
    dfs((1<<n)-1,0);
    cout<<ans<<endl; 
  }
  return 0;
}

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

int main()
{
    int a,b,c;
    while(scanf("%d %d %d",&a,&b,&c)==3)
    {
        if(a+b>=c)
            printf("Yes\n");
        else
            printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 128
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main
{
    public static void main(String[] args)
    {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA
    {
        public void solve(int testNumber, Scanner in, PrintWriter out)
        {
            int x = in.nextInt();

            if (x < 100)
            {
                out.print(0);
                return;
            }

            int nums[][] = new int[1000][2];
            int j = 0;
            int increment = 5;
            for (int i = 100; i <= 100000; i += 100, increment += 5)
            {
                nums[j][0] = i;
                nums[j][1] = i + increment;
                j++;
            }
            for (int i = 0; i < 1000; i++)
            {
                if (x >= nums[i][0] && x <= nums[i][1])
                {
                    out.print(1);
                    return;
                }
            }
            out.print(0);
        }

    }
}



Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define rep(i, z, n) for(int i = z; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
const int INF = 1<<29;
//const int MODINF = 1000000007;
using namespace std;

int main(){
    int64_t N;
    cin >> N;
    vector<int64_t> A(N), B(N), C(N);
    rep(i, 0, N) cin >> A.at(i);
    rep(i, 0, N) cin >> B.at(i);
    rep(i, 0, N) cin >> C.at(i);
    sort(all(A));
    sort(all(B));
    sort(all(C));
    reverse(all(A));
    reverse(all(B));
    reverse(all(C));
    vector<int64_t> dp_1(N), dp_2(N);
    
    bool can = true;
    int64_t j = 0;
    rep(i, 0, N){
        while(can){
            if (B.at(i) >= C.at(j)) break;
            j++;
            if (j == N) can = false;
        }
        dp_2.at(i) = j;
    }
    
    can = true;
    j = 0;
    int64_t ans = 0, h = 0;
    
    rep(i, 0, N){
        while(can){
            if (A.at(i) >= B.at(j)) break;
            j++;
            if (j == N) can = false;
        }
        rep(k, h, j) dp_1.at(i) += dp_2.at(k);
        if (i != 0) dp_1.at(i) += dp_1.at(i - 1);
        h = j;
    }
    rep(i, 0, N) ans += dp_1.at(i);
    cout << ans << endl;
}

Measured memory_bytes: 4224
n=[input() for _ in range(int(input()))];m,a,r,c,h,count=0,0,0,0,0,0
for i in n:
  if i[0]=='M': m+=1
  elif i[0]=='A': a+=1
  elif i[0]=='R': r+=1
  elif i[0]=='C': c+=1
  elif i[0]=='H': h+=1
r=[m,a,r,c,h]
print(sum([sum([sum([r[i]*r[j]*r[k] for k in range(j+1,5)]) for j in range(i+1,5)]) for i in range(5)]))

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

int main() {
    string s; cin >> s;
    for (char c = 'a'; c <= 'z'; c++) {
        bool found = false;
        rep(i, 0, s.size()) {
            if (s[i] == c) {
                found = true;
            }
        }
        if (!found) {
            cout << c << endl;
            return 0;
        }
    }
    cout << "None" << endl;
    return 0;
}

Measured memory_bytes: 512
a = int(input())
b = int(input())
c = int(input())
x = int(input())

cnt = 0
for i in range(0,a+1):
  for j in range(0,b+1):
    for k in range(0,c+1):
      if x == 500*i + 100*j + 50*k:
        cnt = cnt + 1

print(cnt)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)n;++i)
#define each(a,b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 100005;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> vec(n);
    rep(i,n){
        cin >> vec[i];
    }
    int m;
    cin >> m;
    multiset<int> st;
    rep(i,m){
        int a;
        cin >> a;
        st.insert(a);
    }
    rep(i,n){
        auto it = st.lower_bound(vec[i]);
        if(*it == vec[i]){
            st.erase(it);
        }
    }
    if((int)st.size() == 0){
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }
    return 0;
}


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

int main()
{
	int a, b;
	char op;

	while (1){
		cin >> a >> op >> b;

		if (op == '+') cout << a + b << endl;
		else if (op == '-') cout << a - b << endl;
		else if (op == '*') cout << a * b << endl;
		else if (op == '/') cout << a / b << endl;
		else if (op == '?') break;
	}

	return (0);
}

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

using namespace std;

typedef long long ll;
#define SWAP(x,y,z) {if ( y > z ) swap(y,z); if ( x > y ) swap(x,y); if (y > z) swap(y,z);}


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

    int a,b;
    cin >> a >> b;
    if ( a == 1 && b != 1 ) cout << "Alice";
    else if ( b == 1 && a != 1) cout << "Bob";
    else if ( a > b ) cout << "Alice";
    else if ( b > a ) cout << "Bob";
    else cout << "Draw";
    return 0;
    // 274751WM
}


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

using namespace std;

typedef long long LL;
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

int main(){
	int N; cin >> N;
	int r = 0, b = 0;
	string S; cin >> S;
	for(auto c : S){
		if(c == 'R') ++r;
		else ++b;
	}
	cout << (r>b?"Yes":"No") << endl;
	return 0;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author rizhiy
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = in.nextInt();
            }
            int[] d = new int[n];
            d[0] = Math.abs(a[0]);
            for (int i = 1; i < n; i++) {
                d[i] = d[i - 1] + Math.abs(a[i] - a[i - 1]);
            }
            int[] dn = new int[n];
            dn[n - 1] = Math.abs(a[n - 1]);
            for (int i = n - 2; i >= 0; i--) {
                dn[i] = dn[i + 1] + Math.abs(a[i] - a[i + 1]);
            }
//        out.println();
            int[] d2 = new int[n];
            d2[0] = a[0];
            d2[1] = a[1];
            for (int i = 2; i < n; i++) {
                d2[i] = Math.abs(a[i - 2] - a[i]);
            }
            out.println(dn[1] + Math.abs(a[1]));
            for (int i = 1; i < n - 1; i++) {
                int answ = 0;
                answ += d[i - 1];
                answ += dn[i + 1];
//            answ += d[n - 1] - d[i + 1] + Math.abs(a[n - 1]);
                answ += d2[i + 1];
                out.println(answ);
            }
            out.println(d[n - 2] + Math.abs(a[n - 2]));

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 43528
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
template <typename T> using V = vector<T>;
constexpr int Mod = 998244353;
constexpr int mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
template <typename T> constexpr bool chmax(T &a, const T &b) {
    if(a >= b) return false;
    a = b;
    return true;
}
template <typename T> constexpr bool chmin(T &a, const T &b) {
    if(a <= b) return false;
    a = b;
    return true;
}

/*-------------------------------------------*/

int n;
vector<pair<int, int>> vec, vec2;

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

    cin >> n;
    int all = 0;
    rep(i, n) {
        string s;
        cin >> s;
        int x = 0;
        int mn = 0;
        for(auto &&c : s) {
            x += (c == '(' ? 1 : -1);
            chmin(mn, x);
        }
        all += x;
        (x > 0 ? vec : vec2).emplace_back(-mn, x - mn);
    }
    if(all) {
        cout << "No" << endl;
        return 0;
    }
    for(auto &&p : vec2)
        swap(p.first, p.second);
    sort(ALL(vec));
    sort(ALL(vec2));

    int now = 0;
    for(auto &&p : vec) {
        if(p.first > now) {
            cout << "No" << endl;
            return 0;
        }
        now += p.second - p.first;
    }
    now = 0;
    for(auto &&p : vec2) {
        if(p.first > now) {
            cout << "No" << endl;
            return 0;
        }
        now += p.second - p.first;
    }

    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 11252
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
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; }

// constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
// constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n;
    cin >> n;
    VI cnt(n+1);
    REP(x,1,101) REP(y,1,101) REP(z,1,101) {
        int sum = x*x+y*y+z*z+x*y+y*z+z*x;
        if (sum > n || sum < 0) continue;
        cnt[sum]++;
    }
    REP(i,1,n+1) cout << cnt[i] << endl;
}

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

Measured memory_bytes: 3624
#include<iostream>
#include<vector>
using namespace std;
#define int long long
#define V vector
#define vel V<int>
#define rep(i,n) for(int i=0;i<n;i++)
#define mkp make_pair
#define pin pair<int,int>
pin solve(V<pin>& ab, int ex) {
	if (!ex) { return mkp(0, 0); }
	V<V<pin>> qab(2);
	int sz = ab.size();
	qab[0].reserve(sz);
	qab[1].reserve(sz);
	for (pin& x : ab) {
		qab[x.second & 1].push_back(mkp(x.first / 2, x.second / 2));
		if (x.first & 1) { qab[(x.second + 1) & 1].push_back(mkp(x.first / 2, (x.second + 1) / 2)); }
	}
	int c = 0;
	for (pin& x : qab[0]) {
		int qc = 2 * x.first + x.second + 1;
	qc = (qc & (0xffffffff)) + ((qc & (0x7fffffff00000000)) >> 32);//qc<=1ffffffff
	qc = (qc & (0xffff)) + ((qc & (0x1ffff0000)) >> 16);//qc<=2ffff
	qc = (qc & (0xff)) + ((qc & (0x3ff00)) >> 8);//qc<=3ff
	qc = (qc & (0xf)) + ((qc & (0x3f0)) >> 4);//qc<=4e
	qc = (qc & (0xf)) + ((qc & (0x7e)) >> 4);//qc<=18
	qc = (qc & 3) + ((qc & 28) >> 2);
	qc = (qc & 3) + ((qc & 4) >> 2);
      	qc = (qc & 3) + ((qc & 4) >> 2);
      	qc = (qc & 3) + ((qc & 4) >> 2);
      	qc = (qc & 3) + ((qc & 4) >> 2);
      	qc = (qc & 3) + ((qc & 4) >> 2);
      	qc = (qc & 3) + ((qc & 4) >> 2);
      	qc = (qc & 3) + ((qc & 4) >> 2);
      	qc = (qc & 3) + ((qc & 4) >> 2);
		c ^= qc;
	}
	if (!c) {
		pin ans = solve(qab[1], ex - 1);
		ans.first *= 2; ans.second *= 2; ans.second++;
		return ans;
	}
	pin ans = solve(qab[0], ex - 1);
	c = 0;
	int d = 0;
	for (pin& x : qab[1]) {
		int w = ans.second - x.second - 1;
		if ((w & x.first) == w) { c ^= 1; }
		w++;
		if ((w & x.first) == w) { d ^= 1; }
	}
	ans.first *= 2; ans.second *= 2;
	ans.first += (c | d); ans.second -= c;
	return ans;
}
signed main() {
	cin.tie(0); ios::sync_with_stdio(false);
	long long inf = 1e17;
	int n; cin >> n;
	V<pin> ab(n);
	rep(i, n) {
		long long a, b; cin >> a >> b;
		ab[i] = { a + inf,b + inf };
	}
	pin ret = solve(ab, 59);
	cout << ret.first - inf << " " << ret.second - inf << "\n";
}


Measured memory_bytes: 7552
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a,b;
    //cin>>n;
 // for(int i = 1; i <= n; i++){
          cin>>a>>b;
        if(a==b)puts("Yes");
        else puts("No");
   // }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
const int INF = 1001001001;

template<class Type>
Type modpow(Type a, Type n, Type mod)
{
	Type res = 1;
	while (0 < n) {
		if (n & 1) {
			res = res * a % mod;
		}
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

template<class Type>
Type gcd(Type x, Type y)
{
	Type r;
	if (x < y) swap(x, y);

	while (0 < y) {
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

template<class Type>
Type lcm(Type x, Type y)
{
	return x * y / gcd(x, y);
}

template<class Type>
bool is_prime(Type x)
{
	if (x == 2) return true;
	if (x < 2 || x % 2 == 0) return false;

	for (Type i = 3; i <= sqrt(x); i += 2) {
		if (x % i == 0) return false;
	}
	return true;
}

template<class Type>
vector<bool> eratos(Type n)
{
	vector<bool> isPrime(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	for (Type i = 2; i <= n; i++) {
		if (isPrime[i]) {
			Type j = i + i;
			while (j <= n) {
				isPrime[j] = false;
				j = j + i;
			}
		}
	}
	return isPrime;
}

bool binary_search_judge(vector<int> a, int index, int key)
{
	if (key <= a[index]) return true;
	else return false;
}

int binary_search(vector<int> a, int key)
{
	int ng = -1;
	int ok = a.size();
	while (1 < abs(ng - ok)) {
		int mid = (ng + ok) / 2;
		if (binary_search_judge(a, mid, key)) ok = mid;
		else ng = mid;
	}
	return a[ok] == key;
}

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

	vector<vector<vector<int>>> dp(n, vector<vector<int>>(K + 1, vector<int>(2)));
	int nd = s[0] - '0';
	for (int d = 0; d < 10; d++) {
		int nj = 0;
		int nk = 0;
		if (d != 0) nj++;
		if (nd == d) nk = 1;
		if (nd < d) continue;
		dp[0][nj][nk] += 1;
	}

	for (int i = 1; i < n; i++) {
		for (int j = 0; j <= K; j++) {
			for (int k = 0; k < 2; k++) {
				for (int d = 0; d < 10; d++) {
					nd = s[i] - '0';
					int nj = j;
					int nk = k;

					if (d != 0) nj++;
					if (K < nj) continue;
					if (nk == 1) {
						if (nd < d) continue;
						if (d < nd) nk = 0;
					}
					dp[i][nj][nk] += dp[i - 1][j][k];
				}
			}
		}
	}
	cout << dp[n - 1][K][0] + dp[n - 1][K][1] << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (long long  i=a;i<n;i++)
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define get(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
typedef long long ll;
typedef pair<int, int> PII;
typedef vector<int> VI;
int mod;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res*a%mod; a = a*a%mod; }return res; }
void solve() {
	ll a, v, b, w;
	cin >> a >> v >> b >> w;
	ll t; cin >> t;
	if (abs(a - b) <= t*(v - w)) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int T_ = 1;
	//cin >> T_;
	for (int i = 0; i < T_; i++)solve();
	return 0;
}







Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pf push_front

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

#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
double pi = 3.141592653589793;
ll mod = 1000000007;
ll INF = 1000000001;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;



int main(){
	int n, first, second,tmp;
    cin>>n;
    vi a(n+10);
    rep(i,n){
        cin>>a[i];
        if(i==0)first=0;
        else if(i==1){
            second=1;
            if(a[first]<a[second]){
                tmp=first;
                first=second;
                second=tmp;
            }
        }else{
            if(a[first]<a[i]){
                second=first;
                first=i;
            }else if(a[second]<a[i]){
                second=i;
            }
        }
    }
    rep(i,n){
        if(i==first)cout<<a[second]<<endl;
        else cout<<a[first]<<endl;
    }

}

Measured memory_bytes: 2432
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define FOR(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
const long long dx[4]={1,0,-1,0};
const long long dy[4]={0,1,0,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    for(int i=n; i<1000; i++){
        string s=to_string(i);
        if(s[0]==s[1] && s[1]==s[2]){
            cout<<s<<endl;
            return 0;
        }

    }
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define MAX 10000

int main(void)
{
  int a,b,c,count;
  do{
    cin >> a >> b >> c ;
  }while(a < 1 || a > MAX || b < 1 || b > MAX || c < 1 || c > MAX || a > b);
  
  for(int i = a;i <= b;i++){
    if(c % i == 0) count++;
  }
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 1164
#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(){
    string s;
    cin >> s;
    int l;
    l=s.size();
    int ans;
    ans=0;
    rep(i,l){
        if(i%2==1 and s[i]=='R' or i%2==0 and s[i]=='L'){           
        ans=1;
        }
    }

    if(ans==0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    

    return 0;
}

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

int sum(int x)
{
    int su=0;
    while(x!=0)
    {
        su+=(x%10);
        x/=10;
    }
    return su;
}
int main()
{
    int n;
    int mini=1000000000;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        int a=i;
        int b=n-i;
        mini=min(mini,sum(i)+sum(n-i));

    }
    cout<<mini<<endl;
}


Measured memory_bytes: 768
K, N = map(int, input().split())
house = list(map(int,input().split()))
house = house + house
min = house[N - 1] - house[0]
 
for i in range(N - 1):
  if K - (house[N + 1 + i] - house[i]) < min:
    min = K - (house[N + 1 + i] - house[i])
 
print(min)


Measured memory_bytes: 26444
extern crate core;

use std::io::{self, Read};

#[macro_export]
macro_rules! input {
  ($s:expr=>$($t:tt)*) => {
    let mut lines=$s.split("\n");
    $(
        line_parse!(lines,$t);
    )*
  };
}

macro_rules! line_parse {
  ($lines:expr,($($name:ident:$t:tt)*)) => {
    let mut line=$lines.next().unwrap().split_whitespace();
    $(value_def!(line,$name,$t);)*
  };

  //複数行
  ($lines:expr,{$n:expr;$name:ident:$t:tt}) => {
    values_def!($lines,$n,$name,$t);
  };
}

macro_rules! value_def {
    ($line:expr, $name:ident, $t:tt) => {
        let $name = value!($line, $t);
    };
}

macro_rules! values_def {
    ($lines:expr, $n:expr, $name:ident, $t:tt) => {
        let $name = {
            let mut vec = Vec::new();
            for i in 0..$n {
                let mut next = $lines.next().unwrap().split_whitespace();
                vec.push(value!(next, $t));
            }
            vec
        };
    };
}

macro_rules! value {
  //配列
  ($line:expr,[$t:tt]) => {
    $line.map(|x|{
      let mut iter=::std::iter::once(x);
      value!(iter,$t)
    }).collect::<Vec<_>>()
  };
  //タプル
  ($line:expr,($($t:tt),*)) => {
    ($(value!($line,$t),)*)
  };
  //文字列
  ($line:expr,#) => {
    $line.next().unwrap()
  };
  //単一値
  ($line:expr,$t:ty) => {
    $line.next().unwrap().parse::<$t>().unwrap()
  };
  //インデックス(-1)
  ($line:expr,@) => {
    $line.next().unwrap().parse::<usize>().unwrap()-1
  };
}

fn main() {
    let mut input = String::new();
    io::stdin().read_to_string(&mut input).unwrap();
    let output = solve(input.trim().to_string());
    println!("{}", output);
}

fn solve(input: String) -> String {
    input!(input=>(a:i64 b:i64));
    (a * b - a - b + 1).to_string()
}

macro_rules! tests {
    ($($name:ident: $input:expr=>$output:expr,)*) => {
        mod tests {
            $(
                #[test]
                fn $name() {
                    assert_eq!($output.trim().to_string(),super::solve($input.trim().to_string()));
                }
            )*
        }
    }
}
tests! {
    test1: "2 2" => "1",
    test2: "5 7" => "24",
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >> s;
  stringstream geek(s);
  int x = 0;
  geek >> x;
  int digits = 0;
  for (int i=0; i<s.length(); i++) digits += int(s[i]) - 48;
  if (x%digits == 0) cout << "Yes";
  else cout << "No";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
int main(){
#define int ll
    string s,ans;
    cin>>s;
    rep(i,0,s.size()){
        if(s[i]=='0')ans+='0';
        if(s[i]=='1')ans+='1';
        if(s[i]=='B'&&ans.size())ans.pop_back();
    }
    cout<<ans;
}


Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A + 1):
	for j in range(B + 1):
		for k in range(C + 1):
			if i * 500 + j * 100 + k * 50 == X:
				ans += 1
print(ans)

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

char c[4] = {'m', 'c', 'x', 'i'};
int v[4] = {1000, 100, 10, 1};

int toint(std::string);

int main(void){

	int n;
	int sum=0;
	std::string s1, s2;
	std::cin >> n;

	while(n--){
		std::cin >> s1 >> s2;
		sum = toint(s1) + toint(s2);

		for(int i=0; i<4; i++){
			int d = (sum / v[i]);
			sum -= (d * v[i]);
			if(d>1){
				std::cout << d;
			}
			if(d>0){
				std::cout << c[i];
			}
		}
		std::cout << std::endl;

	}
	return 0;
}

int toint(std::string s){

	int d=1;
	int sum=0;

	for(int i=0; i<(int)s.size();i++){
		if('0' <= s[i] && s[i] <='9'){
			d = s[i] - '0';
		}else{
			for(int j=0; j<4; j++){
				if(s[i] == c[j]){
					sum += (v[j] * d);
					d = 1;
					break;
				}
			}
		}
	}
	return sum;
}

Measured memory_bytes: 0
N=int(input())
listA=list(map(int,input().split()))
listB=[0 for i in range(N)]
listANS=[]
for i in range(N-1,-1,-1):
  listN=listA[i:N:i+1]
  if len(listN)==1 and listA[i]==1:
    listB[i]=1
  elif len(listN)>1 and listA[i]!=sum(listB[i:N:i+1])%2:
    listB[i]=1
for i in range(N):
  if listB[i]==1:
    listANS+=[i+1]
ANS=len(listANS)
print(ANS)
if ANS!=0:
  print(*listANS)

Measured memory_bytes: 16436