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

using namespace std;

#define sim template <class c
#define ris return *this
#define dor > debug &operator<<
#define eni(x)                                                                        \
	sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<(c i) \
	{
sim > struct rge
{
	c b, e;
};
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c *x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug
{
#ifdef LOCAL
	~debug()
	{
		cerr << endl;
	}
	eni(!=) cerr << boolalpha << i;
	ris;
} eni(==) ris << range(begin(i), end(i));
}
sim, class b dor(pair<b, c> d)
{
	ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d)
{
	*this << "[";
	for (auto it = d.b; it != d.e; ++it)
		*this << ", " + 2 * (it == d.b) << *it;
	ris << "]";
}
#else
	sim dor(const c &)
	{
		ris;
	}
#endif
}
;
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define forn(i, n) for (ll i = 0; i < int(n); i++)
#define rfor(n, i) for (ll i = (n - 1); i >= 0; --i)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'
#define M_PI 3.14159265358979323846
#define EPS 1e-7

void solve()
{	
        ll n, m; cin >> n >> m;
        vector<pair<ll, ll>> a(n), c(m);
        forn(i, n)
        {
                ll x, y; cin >> x >> y;
                a[i] = {x, y};
        }
        forn(i, m)
        {
                ll x, y; cin >> x >> y;
                c[i] = {x, y};
        }
        for (int i = 0; i < n; ++i)
        {
                ll mn = INT_MAX;
                //cout << a[i].first << ' ' << a[i].second << endl;
                for (int j = 0; j < m; ++j)
                {
                        mn = min(mn, abs(a[i].first - c[j].first) + abs(a[i].second - c[j].second));
                }
                for (int j = 0; j < m; ++j)
                {
                        if (abs(a[i].first - c[j].first) + abs(a[i].second - c[j].second) == mn)
                        {
                                cout << j + 1 << endl;
                                break;
                        }
                }
        }
}

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

Measured memory_bytes: 3560
import math

N = int(input())

d=[]

for i in range(1,int(math.sqrt(N))+1):
    if N%i == 0:
        d.append(N//i)
        d.append(i)
    
Fmin=10**10

for i in d:
    if N%i ==0:
        A = i
        B = N//i
        F = max(len(str(A)),len(str(B)))
        if F < Fmin:
            Fmin = F
print(Fmin)


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

using namespace std;

const ll mod=1000000007;
const ll inf=1e18;

int main(){

  ll n,a,b,c,d,e;
  cin >> n>> a >> b >> c >>d >>e;

  ll f=a;
  f=min(f,b);
  f=min(f,c);
  f=min(f,d);
  f=min(f,e);

  ll m;
  if(n%f==0)m=n/f;
  else m=n/f+1;
  cout << 4 + m << endl;


}


Measured memory_bytes: 3588
fn main() {
    let v = read_line();
    let n = v[0];
    let target = v[1];
    // let n = 1000;
    // let target = 1234000;

    for nx in 0..n+1 {
        for ny in 0..(n+1-nx) {
            let nz = n - nx - ny;
            let res = nx * 10000 + ny * 5000 + nz * 1000;
            if res == target {
                println!("{} {} {}", nx, ny, nz);
                return;
            }
        }
    }

    println!("-1 -1 -1");
}

fn read_line() -> Vec<i32> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let v = s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect();
    return v
}

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

int main(){
int N;
    cin >> N;
    vector<int> A(N);
    int mod = 1000000007;
    long long sum = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
        sum += A[i];
        sum %= mod;//配列の全和を求める
    }
 
    long ans = 0;
 
    //i について全探索する
    for (int i = 0; i < N; i++)
    {
        //A[i+1] ... A[N] の値を更新する
        sum -= A[i];//A[i+1]-の和
        if (sum < 0) sum += mod;//もしA[i]を引くことでsumの値が負になった時はmodを足す
        ans += A[i] * sum;//A[i]*(A[i+1]-の和)
        ans %= mod;
    }
 
    cout << ans << endl;
}

Measured memory_bytes: 4028
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		sc.close();

		if((a + b) % 2 == 0) {
			System.out.println((a + b) / 2);
		}else {
			System.out.println((a + b) / 2 + 1);
		}

	}
}

Measured memory_bytes: 21716
N,W = map(int, input().split(' '))
A = [list(map(int, input().split(' '))) for i in range(N)]
if A[0][0] > 300:
    if W//A[0][0] > 100:
        print(sum(list(zip(*A))[1]))
        exit()
    if W%A[0][0] >= 300:
        W = W//A[0][0]*300+299
    else:
        W = W//A[0][0]*300+W%A[0][0]
    k = A[0][0]
    for i in range(N):
        A[i][0] = 300+A[i][0]-k

DP = [[0 for i in range(31000)] for i in range(N+1)]
for i in range(1,N+1):
    for j in range(1,31000):
        DP[i][j] = max(DP[i][j],DP[i-1][j],DP[i][j-1])
        if j-A[i-1][0]>=0:
            DP[i][j] = max(DP[i][j],DP[i-1][j-A[i-1][0]]+A[i-1][1])            

print(DP[N][W])


Measured memory_bytes: 76124
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rrep(i, n) for(int i = n-1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9+7;
constexpr lint mod2 = 998244353;

int main() {
  bool a = 1, b = 1, c = 1;
  string s;
  cin >> s;
  int n = s.size();
  rep(i, n/2){
    if(s[i] != s[n-1-i]){
      a = 0;
      break;
    }
  }
  rep(i, n/2/2){
    if(s[i] != s[(n-1)/2-1-i]){
      b = 0;
      break;
    }
  }
  rep(i, n/2/2){
    if(s[(n+1)/2+i] != s[n-1-i]){
      c = 0;
      break;
    }
  }
  if(a && b && c) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
#include <array>
#include <numeric>
#include <regex>
#include <bitset>
#include <deque>

using namespace std;
typedef long long ll;
typedef pair<int, int> p_ii;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;



int main() {
    string s[4] = {"Christmas", "Christmas Eve", "Christmas Eve Eve", "Christmas Eve Eve Eve"};
    int D; cin>>D;
    string x;
    if(D==25){
        x=(s[0]);
    }else if(D==24){
        x=(s[1]);
    }else if(D==23){
        x=(s[2]);
    }else if(D==22){
        x=(s[3]);
    }
    cout<<x<<endl;

    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1

#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <random>

const long long INF = 10000000000000000;

using namespace std;

int main(){

	int H,W;
	cin>>H>>W;
	string S[30][30];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			cin>>S[i][j];
		}
	}
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			if(S[i][j]=="snuke"){
				printf("%c%d\n",65+j,i+1);
				return 0;
			}
		}
	}
	return 0;	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a) for(auto i=0; i<a; i++)
#define rep1(i, a, b) for(auto i=a; i<b; i++)
#define p_b push_back
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
 
int main() {
    ll n, m, t;
    cin>>n>>m>>t;
    vvi g(n, vi(n, INT_MAX));
    vi r(t);
    rep(i, t)
        cin>>r[i];
    sort(r.begin(), r.end());
    rep(i, n)
        g[i][i]=0;
    rep(i, m){
        ll x, y, w;
        cin>>x>>y>>w;
        x--;
        y--;
        if(g[x][y] > w)
            g[x][y] = g[y][x] = w;
    }
    rep(k, n)
        rep(i, n)
            rep(j, n)
                if(g[i][k]!=INT_MAX && g[k][j]!=INT_MAX)
                if(g[i][j] > g[i][k] + g[k][j])
                    g[i][j] = g[i][k] + g[k][j];
    ll ans = LLONG_MAX;
    do{
        ll cur = 0;
        rep(i, t-1){
            cur += g[r[i]-1][r[i+1]-1];
            // cout<<r[i]<<" ";
        }
        // cout<<r[t-1]<<endl;
        ans = min(ans, cur);
    }while(next_permutation(r.begin(), r.end()));
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <cmath>

typedef long long int lli;
using namespace std;

int main() {
	int N;
	string S;
    cin >> N >> S;
	vector<lli> w_num;
	lli  w_total = 0;
	for(auto c:S) {
		if(c == 'W') {
			w_total++;
		}
		w_num.push_back(w_total);
	}
	lli ans = N;
	for (lli i = 0; i < N; i++) {
		lli left_w = i > 0 ? w_num[i-1] : 0;
		lli right_e = N - i - 1 - (w_total - w_num[i]);
		ans = min(left_w + right_e, ans);
	}

	cout << ans << endl;
}


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

typedef long long int ll;
//Factors of an num
/*
vector<ll> fact(ll n){
	vector<ll>v;
	for(int i=1;i*i<=n;i++){
		if(n%i ==0){
			v.push_back(i);
		
		if(i!=n/i)
			v.push_back(n/i);
	    }
	}

	return v;
}
*/


/*
Seive Of Eratos..
int N=1e5;
vector<bool> isprime(N+1,true);
void pri(int n){
	for(int i=2;i*i<=n;i++){
		if(isprime[i]){
			for(int j=i*i;j<=n;j+=i){
				isprime[j]=false;
			}
		}
	}
	return;
}
*/

/*
//Prime Factors
vector<bool> isprime(1e6+1,true);
 vector<int> primes;
 void sieve()
 {

    ll  i,j;
    isprime[0] = false;
    isprime[1] = false;

    for(i=2; i<=1e6 ;i++)
  {

    if(isprime[i])
    {

      primes.push_back(i);

      for(j=i*i; j<=1e6; j+=i)
      {
        isprime[j]=false;
      }

    }

  }
}

vector<int> primefactors(int  N)

 {

    vector<int> factors;
    ll pf_idx = 0, pf=primes[pf_idx];

    while(pf*pf<=N)
    {
        while(N % pf == 0)
        {
            N/=pf;
            factors.push_back(pf);
        }
        pf = primes[++pf_idx];
    }
    
    if(N != 1) factors.push_back(N);
    return factors;
}
 */   




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);
  ll n,d,x,y,cnt=0;
  ll p;
  cin>>n>>d;
  for (int i = 0; i < n; ++i)
  {
  	/* code */
  	cin>>x>>y;
  	if(x*x + y*y <=d *d)
    cnt++;
  }

  cout<<cnt<<endl;
  
}




Measured memory_bytes: 3568
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>

struct DJSet {
  std::vector<int> upper;

  DJSet(int n) : upper(n) {
    for (int i=0;i<n;++i) upper[i]=-1;
  }

  int root(int x) {
    return upper[x]<0?x:(upper[x]=root(upper[x]));
  }

  bool equiv(int x, int y) {
    return root(x)==root(y);
  }

  void setUnion(int x, int y) {
    x=root(x);
    y=root(y);
    if (x==y) return;
    if (upper[x]<upper[y] || y==upper.size()-1) {
      x^=y;
      y^=x;
      x^=y;
    }
    upper[y]+=upper[x];
    upper[x]=y;
  }
};

int main() {
  int N, K;
  std::cin>>N>>K;
  std::vector<int> P(N);
  for (int i=0;i<N;++i) {
    std::cin>>P[i];
  }
  DJSet ds(N+1);
  std::priority_queue<int> mi;
  std::priority_queue<int> ma;
  std::vector<int> up(N, 0);
  up[0]=1;
  for (int i=1;i<N;++i) {
    if (P[i]>P[i-1]) up[i]=up[i-1]+1;
    else up[i]=1;
  }
  for (int i=0;i<K;++i) {
    mi.push(-P[i]);
    ma.push(P[i]);
  }
  std::vector<bool> used(N, false);
  for (int i=0;i+K<=N;++i) {
    used[P[i]]=true;
    while (used[ma.top()]) ma.pop();
    while (used[-mi.top()]) mi.pop();
    if (up[i+K-1]>=K) {
      ds.setUnion(i, N);
    } else if (i+K<N && P[i+K]>ma.top() && P[i]<-mi.top()) {
      ds.setUnion(i, i+1);
    }
    if (i+K<N) {
      ma.push(+P[i+K]);
      mi.push(-P[i+K]);
    }
  }
  int cnt=0;
  for (int i=0;i+K<=N;++i) {
    if (ds.upper[i]<0) ++cnt;
  }
  std::cout<<cnt<<std::endl;
}


Measured memory_bytes: 4456
#include <iostream>
int main(){
	int w,h,x,y,r;
	std::cin >> w;
	std::cin >> h;
	std::cin >> x;
	std::cin >> y;
	std::cin >> r;
	if(w - r >= x && x >= r && h - r >= y && y >= r){
		std::cout << "Yes" <<std::endl;
	}else{
		std::cout << "No" <<std::endl;
	}}

Measured memory_bytes: 3084
input()
a = [int(i) for i in input().split()]
c = [i for i in a if i % 4 != 2]
if len(c) != len(a):
    c.append(1)
if len([i for i in c if i % 4 != 0]) - 1 <= len([i for i in c if i % 4 == 0]):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 14252
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int N;
struct A{
	int nowa,nowb,speed,rap;
};
main()
{
	while(cin>>N,N)
	{
		vector<A>P;
		for(int i=0;i<N;i++)
		{
			A a;
			cin>>a.speed>>a.rap;
			a.nowa=0;
			a.nowb=a.speed;
			P.push_back(a);
		}
		sort(P.begin(),P.end(),[](A a,A b){return a.speed<b.speed;});
		int ans=0;
		while(!P.empty())
		{
			vector<A>Q;
			P[0].nowa++;
			for(int i=1;i<P.size();i++)
			{
				P[i].nowa++;
				if(P[i].nowa*P[i-1].nowb>P[i-1].nowa*P[i].nowb)
				{
					P[i].nowa=P[i-1].nowa;
					P[i].nowb=P[i-1].nowb;
				}
			}
			for(int i=0;i<P.size();i++)
			{
				if(P[i].nowa==P[i].nowb)
				{
					P[i].nowa=P[i].nowb=P[i].speed;
				}
				else if(P[i].nowa==P[i].nowb*2)
				{
					P[i].nowa=0;
					P[i].nowb=P[i].speed;
					P[i].rap--;
				}
			}
			for(int i=0;i<P.size();i++)
			{
				if(P[i].rap>0)Q.push_back(P[i]);
			}
			stable_sort(Q.begin(),Q.end(),[](A a,A b){
				return a.nowa*b.nowb!=b.nowa*a.nowb?a.nowa*b.nowb>b.nowa*a.nowb:
					a.nowa%a.nowb==0?a.speed<b.speed:false;
			});
			P=Q;
			ans++;
		}
		cout<<ans<<endl;
	}
}



Measured memory_bytes: 3132
#pragma GCC optimize("Ofast,fast-math,unroll-loops")

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

typedef long long ll;
typedef string str;

#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define vi vector<int>


int main() {
    IOS;
	
	str s,t;
	cin >> s >> t;
	int n = s.size();
	ll ans = 0;
	for(int i = 0; i < n; i++){
		if(int(s[i]) != int(t[i]))ans++;
	}
	cout << ans;
}




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

int main(void){
  string res;
  int n,cnt=0,cntH=0,point=0;

    cin >> n;
  for( int i = 0 ; i < n ;){
    cin >> res;
    
    if( res == "OUT" ){
      cnt++;
      if( cnt == 3 ){
	i++;
	cnt = 0;
	cout << point << endl;
	point = 0;
	cntH = 0;
      }
    }
    else if( res == "HIT" ){
      cntH++;
      if( cntH == 4 ){
	point++; cntH--;
      }
    }
    else{
      point += cntH+1;
      cntH = 0;
    }
      
      
      }
  return 0;
}

Measured memory_bytes: 1208
#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define cont continue
#define rep(i, n) for(int i = 0 ; i < (n) ; i++)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll INF = 987654321;

int main() {
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  char c;
  cin >> c;

  if('A' <= c && c <= 'Z') {
    cout << 'A' << endl;
  } 
  else {
    cout << 'a' << endl;
  }
} 


Measured memory_bytes: 3636
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
 
int main() {
int n;
cin>>n;
long cnt=0;
for(int i=0;i<n;i++)
{
	int x;
	cin>>x;
	while(x%2==0)
	{
		cnt++;
		x/=2;
	}
}
cout<<cnt;
	return 0;
}

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

int main() {
  int h1,h2;
  int k1,k2;
  int a,b,c,d;
  cin >> h1 >> h2;
  cin >> k1 >> k2;
  cin >> a >> b >> c >> d;
  int iwana1,iwana2;
  int yamame1,yamame2;
  iwana1 = h1 / 10;
  iwana2 = k1 / 10;
  yamame1 = h2 / 20;
  yamame2 = k2 / 20;
  int hirosi  = (h1 * a) + (h2 + b) + (iwana1 * c) + (yamame1 * d);
  int kenjiro = (k1 + a) + (k2 * b) + (iwana2 * c) + (yamame2 * d);
  if(hirosi < kenjiro) {
    cout << "kenjiro" << endl;
  }else if(hirosi == kenjiro) {
    cout << "even" << endl;
  }else if(hirosi > kenjiro) {
    cout << "hiroshi" << endl;
  }
}

Measured memory_bytes: 3104
def f(x1, y1, x2, y2)
  start = [x1, y1]
  goal = [x2, y2]
  x_len = x2 - x1
  y_len = y2 - y1

  r = []
  # 1st
  r << [:R] * x_len + [:U] * y_len
  r << [:L] * x_len + [:D] * y_len
  # 2nd
  r << [:D] + [:R] * (x_len+1) + [:U] * (y_len+1) + [:L]
  r << [:U] + [:L] * (x_len+1) + [:D] * (y_len+1) + [:R]

  r.join
end

x1, y1, x2, y2 = gets.split(" ").take(4).map(&:to_i)
puts f(x1, y1, x2, y2)


Measured memory_bytes: 2172
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
int main() {
  cout << fixed << setprecision(10);
  int n,k;
  cin >> n >> k;
  string s;
  cin >> s;
  s.at(k-1) = s.at(k-1)+'a'-'A';
  cout << s << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#define ll long long
#define ull unsigned long long
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
#define FOR(i,start,stop)  for(int i=(start); i < (stop); i++)
#define FORD(i,start,stop) for(int i=(start); i >= (stop); i--)
#define RIP(i,stop) FOR(i,0,stop)
#define PI 3.141592653589793
#define PRECISION(c,f) fixed << setprecision(c) << f
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  string S;
  cin >> S;
  string Sr, SS, SSr;

  FOR(i, (S.size()+3)/2-1, S.size()){
    SS.push_back(S[i]);
  }

  Sr = S;
  SSr = SS;
  reverse(Sr.begin(), Sr.end());
  reverse(SSr.begin(), SSr.end());

/*
  cout << S << endl;
  cout << Sr << endl;
  cout << SS << endl;
  cout << SSr << endl;
*/
  if(S == Sr && SS == SSr) yes;
  else no;


  return 0;
}


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

int main() {
    int n;
    cin>>n;
    int result=1;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        if(x%2==0){
            if(x%3==0 ||x%5==0){
                continue;
            }else{
                result=0;
                break;
            }
        }else{
            continue;
        }
    }
    if(result){
        cout<<"APPROVED"<<endl;
    }else{
        cout<<"DENIED"<<endl;
    }
}

Measured memory_bytes: 256
Ns = input().split(' ')
checkList = ['1', '9', '7', '4']
flag = [False for i in range(4)]

for n  in Ns:
    for j in range(4):
        if n == checkList[j]:
            flag[j] = True

if flag[0] and flag[1] and flag[2] and flag[3]:
    print('YES')
else:
    print('NO')



Measured memory_bytes: 3060
/**
 *    author  : 𝒌𝒚𝒐𝒎𝒖𝒌𝒚𝒐𝒎𝒖𝒑𝒖𝒓𝒊𝒏
 *    created : 2020-03-31 21:29:23
**/

#include <iostream>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>
#include <numeric>
#include <bitset>
#include <cassert>
#include <cctype>
#include <iomanip>
#include <random>
#include <utility>
#include <chrono>

using namespace std;

using int64 = long long;

template<class T> using binary_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) { os << '{'; size_t n = vec.size(); for (size_t i = 0; i < n; ++i) { os << vec[i]; if (i != n - 1) os << ','; } os << '}'; return os; }
template<class T, class U> std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) { return os << '{' << p.first << " " << p.second << '}'; }
template<class T, class U> std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) { os << '{'; for (auto it = mp.begin(); it != mp.end(); ++it) { os << '{' << it->first << ':' << it->second << '}'; if (it != --mp.end()) os << ','; } os << '}'; return os; }
template<class T> std::ostream& operator<<(std::ostream& os, const std::set<T>& st) { os << '{'; for (auto it = st.begin(); it != st.end(); ++it) { os << *it; if (it != --st.end()) os << ','; } os << '}'; return os; }
template<class T> std::istream& operator>>(std::istream& is, std::vector<T>& vec) { size_t n = vec.size(); for (size_t i = 0; i < n; ++i) is >> vec[i]; return is; }

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...) 1728
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}

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

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

  int64 ans = 0;

  for (int bit = 0; bit < (1 << (n - 1)); ++bit) {
    int64 t = 0;
    int64 cur = s[0] - '0';
    for (int i = 0; i < n - 1; ++i) {
      if (bit & (1 << i)) {
        t += cur;
        cur = s[i + 1] - '0';
      } else {
        cur *= 10;
        cur += s[i + 1] - '0';
      }
    }
    t += cur;

    debug(bit, t);

    ans += t;
  }

  cout << ans << endl;

  return 0;
}

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

int A, B, C;

int main() {
  cin >> A >> B >> C;
  if(A+B+C >= 22) {
    cout << "bust" << endl;
  } else {
    cout << "win" << endl;
  }
  return 0;
}




Measured memory_bytes: 256
n = int(input())

A = list(map(int, input().split()))

q = int(input())


for _ in range(q):

    com, b, e = map(int, input().split())

    if   com == 0:
        # min(b,e)
        print(min(A[b:e]))
    elif com == 1:
        # max(b,e)
        print(max(A[b:e]))
    else:
        raise



Measured memory_bytes: 5624
N = int(input())
ans = 0

for i in range(1, 10):
  if i > N:
    break
  else:
    ans += 1

for i in range(100, 1000):
  if i > N:
    break
  else:
    ans += 1

for i in range(10000, 100000):
  if i > N:
    break
  else:
    ans += 1

print(ans)

Measured memory_bytes: 38872
import java.util.*;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Stack<Integer> stack = new Stack<Integer>();
        while(sc.hasNextInt()){
            int a=sc.nextInt();
            if(a==0){
                System.out.println(stack.pop());
            }else{
                stack.push(a);
            }
        }
    }
}

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

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; }

using ll = long long;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int INF = 1<<30;

int main() {
  int H,W,A,B;
  cin>>H>>W>>A>>B;
  for(int i = 0; i < H; i++){
    int t = 0;
    if(i<B) t = 1;
    for(int j = 0; j < W; j++){
      if(j<A)cout<<1-t;
      else cout<<t;
    }
    cout<<endl;
  }
}

Measured memory_bytes: 1280
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using static MyIO;
using static MyBinarySearch;


public class B
{
	public static void Main()
	{
		(new Solver()).Solve();	
	}
}


public class Solver
{
	private long K;
	private long[] A;

	public Solver()
	{
		K = GetInt();
		A = new long[K];
		for(int i = 0; i < K; i++)
			A[i] = GetLong();
	}

	public void Solve()
	{
		long max = 2 + K * A.Max();
		Func<long, long> eval = alive;
		long lb = LowerBound(0, max, 2, eval);
		long ub = UpperBound(0, max, 2, eval);

		Console.WriteLine((lb <= ub) ? $"{lb} {ub}" : "-1");
	}
	
	private long alive(long x)
	{
		long res = x;
		for(int i = 0; i < K; i++)
			res = res - (res % A[i]);
		return res;
	}
}


public static class MyBinarySearch
{
	public static int LowerBound<T>(T[] array, T key, Comparison<T> comp)
	{
		int len = array.Length;
		if(comp(array[len - 1], key) < 0)
			return -1;

		int left = 0;
		int right = len - 1;
		while(right > left)
		{
			int mid = (left + right) / 2;
			if(comp(array[mid], key) >= 0)
				right = mid;
			else
				left = mid + 1;
		}

		return left;
	}

	public static int LowerBound<T>(List<T> list, T key, Comparison<T> comp)
	{
		return LowerBound(list.ToArray(), key, comp);
	}

	public static long LowerBound(long left, long right, long target, Func<long, long> eval)
	{
		while(right > left)
		{
			long mid = (left + right) / 2;
			if(eval(mid) >= target)
				right = mid;
			else
				left = mid + 1;
		}

		return left;
	}

	public static long UpperBound(long left, long right, long target, Func<long, long> eval)
	{
		while(right > left)
		{
			long mid = (left + right) / 2;
			if(eval(mid) <= target)
				left = mid + 1;
			else
				right = mid;
		}

		return left - 1;
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}


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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()
#define rep(i,N) for(int i=0;i<N;i++)


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

  int H,W,D;
  cin>>H>>W>>D;
  vector<vector<int>>A(H,vector<int>(W));
  for(int i=0;i<H;i++)for(int j=0;j<W;j++)cin>>A[i][j];
  int Q;
  cin>>Q;
  vector<int>L(Q),R(Q);
  for(int i=0;i<Q;i++)cin>>L[i]>>R[i];
  map<int,pair<int,int>>m;
  for(int i=0;i<H;i++)for(int j=0;j<W;j++)m[A[i][j]]={i,j};
  vector<int>dp(H*W+1,0);
  for(int i=1;i<=H*W;i++){
    pii a=m[i];
    pii b=m[i-D];
    if(i-D>=0)dp[i]=dp[i-D]+abs(a.first-b.first)+abs(a.second-b.second);
  }
  for(int i=0;i<Q;i++){
    cout<<dp[R[i]]-dp[L[i]]<<endl;
  }
  return 0;
}


Measured memory_bytes: 13184
#include<bits/stdc++.h>
// debug
#define d(x) cerr << #x ":" << x << endl;
#define dd(x, y) cerr << "(" #x "," #y "):(" << x << "," << y << ")" << endl;
#define ddd(x, y, z) cerr << "(" #x "," #y "," #z "):(" << x << "," << y << "," << z << ")" << endl;
#define dump(v) cerr<<#v":[ ";for (auto macro_vi:v){cerr<<macro_vi<< " ";}cerr<<"]"<<endl;
#define ddump(v) cerr<<#v":"<<endl;for(auto macro_row:v) {cerr<<"["; for (auto macro__vi:macro_row){cerr<<macro__vi<< " ";}cerr<<"]"<<endl;}
#define damp(m) for(auto macro_pair:m){cerr<< macro_pair.first<<":"<<macro_pair.second<<endl;}
#define dpair(p) cerr << #p":"<<"(" << p.first << "," << p.second << ")" << endl;
// iterate
#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define reprrev(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define reprev(i, n) reprrev(i, 0, n)
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
#define all(v) v.begin(), v.end()
// etc
#define chmin(mi, val) mi = min(mi, val);
#define chmax(ma, val) ma = max(ma, val);
using ll = long long;

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int n = s.size();
    bool good = true;
    set<char> se_even{'L', 'U', 'D'}, se_odd{'R', 'U', 'D'};
    for(int i=1; i<=n; i++){
        char c = s[i-1];
        if(i%2 == 0){
            if(se_even.find(c) ==se_even.end()){
                dd(i, c)
                good =  false;
            }
        }
        else {
            if(se_odd.find(c) == se_odd.end()){
                good = false;
            }
        }
    }
    cout << (good?"Yes":"No") << endl;
    return 0;
    
}

Measured memory_bytes: 256
i,j=map(int,input().split())
listA=[]
for n in range(i):
    listA.append(list(map(int,input().split())))
    listA[n].append(sum(listA[n]))
listA.append([])
for n in range(j+1):
    number=0
    for m in range(i):
        number+=listA[m][n]
    listA[i].append(number)
for n in range(i+1):
    print(' '.join(map(str,listA[n])))


Measured memory_bytes: 5700
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#define N 654321
using namespace std;
int n,rt,size[N],fa[N],cnt=0,sum1,sum2;
int TOT,EN[N],LA[N],NE[N];
void ADD(int x,int y)
{
	TOT++;
	EN[TOT]=y;
	NE[TOT]=LA[x];
	LA[x]=TOT;
}
void DFS(int u,int f)
{
	int i,v;
	fa[u]=f;
	size[u]=1;
	for(i=LA[u];i;i=NE[i])
	{
		v=EN[i];
		if(v!=f)
		{
			DFS(v,u);
			size[u]+=size[v];
		}
	}
}
int main()
{
	int i,x,y;
	scanf("%d",&n);
	for(i=1;i<n;i++)
	{
		scanf("%d%d",&x,&y);
		ADD(x,y);ADD(y,x);
	}
	DFS(1,0);
	i=n;
	cnt=0;
	while(fa[i]!=1)i=fa[i],cnt++;
	x=n;
	for(int i=1;i<=cnt/2;i++)
        x=fa[x];
    y=x;
    if(y==n)
    {
        sum1=size[y];
        sum2=n-sum1;
        if(sum2>sum1)
        cout<<"Fennec";
	else cout<<"Snuke";
            return 0;
    }
    y=fa[y];
    //printf("y=%d\n",y);
	DFS(n,0);
	sum1=size[y];
	sum2=n-sum1;
    //printf("sum1=%d,sum2=%d\n",sum1,sum2);
	if(sum1>sum2)cout<<"Fennec";
	else cout<<"Snuke";
}


Measured memory_bytes: 16000
#include <iostream>
int partition(int* a, int size)
{
    int r = a[size - 1];
    int i = -1;
    for (int j = 0; j < size; j++) {
	if (a[j] <= r) {
	    i++;
	    int tmp = a[i];
	    a[i] = a[j];
	    a[j] = tmp;
	}
    }
    return i;
}

int main()
{
    int n = 0;
    std::cin >> n;
    int* a = (int*)malloc(n * sizeof(int));
    for (int i = 0; i < n; i++) {
	std::cin >> a[i];
    }
    int r = a[n - 1];
    int partNum = partition(a, n);
    for (int i = 0; i < n; i++) {
	if (partNum == i) {
	    std::cout << "[" << a[i] << "]";
	} else {
	    std::cout << a[i];
	}
	if (i + 1 < n) {
	    std::cout << " ";
	}
    }
    std::cout << std::endl;

    return 0;
}

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

int main(){
  int n;
  cin >> n;
  string s;
  map<string, int> mapn;
  rep(i, n){
    cin >> s;
    ++mapn[s];
  }

  int m;
  cin >> m;
  string t;
  rep(i, m){
    cin >> t;
    --mapn[t];
  }

  int ans = 0;
  for (pair<string, int> count : mapn){
    if (count.second > ans) ans = count.second;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007 

ll a[52][52];
int main() {
	ll h,w;
	cin>>h>>w;
	string s[52];
	for(ll i=0;i<h;i++){
		cin>>s[i];
	}
	queue<pair<ll,ll>>ch;
	ch.push(make_pair(0,0));
	a[0][0]=1;
	ll dh[4]={0,0,1,-1};
	ll dw[4]={1,-1,0,0};
	while(ch.size()!=0){
		ll nowh=ch.front().first;
		ll noww=ch.front().second;
		ch.pop();
		for(ll i=0;i<4;i++){
			ll nexh=nowh+dh[i];
			ll nexw=noww+dw[i];
			if(nowh+dh[i]<0||nowh+dh[i]==h||noww+dw[i]<0||noww+dw[i]==w){
				continue;
			}
			if(a[nexh][nexw]!=0||s[nexh][nexw]=='#'){
				continue;
			}
			a[nexh][nexw]=a[nowh][noww]+1;
			ch.push(make_pair(nexh,nexw));
		}
	}
	if(a[h-1][w-1]==0){
		cout << -1;
		return 0;
	}
	ll ans=0;
	for(ll i=0;i<h;i++){
		for(ll j=0;j<w;j++){
			if(s[i][j]=='#'){
				ans++;
			}
		}
	}
	cout << h*w-ans-a[h-1][w-1];
	// your code goes here
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstring>
using namespace std;
typedef pair<int,int> pi;
int main(){
	int n;
	cin>>n;
	int arr[n];
	for(int i=0; i<n; i++) cin>>arr[i];
	int minop = n;
	
	int counter[100005]={0};
	
	for(int i=0; i<n; i+=2) counter[arr[i]]++;
	vector<pi>counter1;
	for(int i=1; i<=100000; i++){
		if(counter[i]) counter1.push_back(make_pair(counter[i],i));
	}	
	counter1.push_back(pi(0,0));
	sort(counter1.begin(),counter1.end());

	memset(counter,0,sizeof(counter));
	
	vector<pi>counter2;
	for(int i=1; i<n; i+=2) counter[arr[i]]++;
	for(int i=1; i<=100000; i++){
		if(counter[i]) counter2.push_back(make_pair(counter[i],i));
	}
	counter2.push_back(pi(0,0));
	sort(counter2.begin(),counter2.end());
	
	if(counter1[counter1.size()-1].second!=counter2[counter2.size()-1].second){
		cout<<n-counter1[counter1.size()-1].first-counter2[counter2.size()-1].first;
	}
	else{
		minop = (n/2-counter1[counter1.size()-1].first)+(n/2-counter2[counter2.size()-2].first);
		minop = min(minop,(n/2-counter2[counter2.size()-1].first)+(n/2-counter1[counter1.size()-2].first));
		cout<<minop;
	}	
}

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

int main()
{
    string s, t;
    cin >> s >> t;

    int a[s.size()];
    for (int i = 0; i < s.size(); i++)
    {
        a[i] = s[i] - 'a';
    }
    sort(a, a + s.size());

    int b[t.size()];
    for (int i = 0; i < t.size(); i++)
    {
        b[i] = t[i] - 'a';
    }
    sort(b, b + t.size());
    reverse(b, b + t.size());

    string ans = "Yes";
    int idx = 0;
    while (idx < min(s.size(), t.size()) && a[idx] == b[idx])
    {
        idx++;
    }

    if (idx == min(s.size(), t.size()))
    {
        if (s.size() >= t.size())
        {
            ans = "No";
        }
    }
    else
    {
        if (a[idx] > b[idx])
        {
            ans = "No";
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>
#include <random>
#include <cstring>
#define mod  1000000007

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

using namespace std;
using ll = long long;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

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

int main(){
  int N, K;
  cin >> N >> K;
  if(K <= (N + 1) / 2) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}


Measured memory_bytes: 256
import sys,math,copy,queue,itertools,bisect
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
_LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(0,1),(-1,0),(0,-1))

N,M = LI()
A = LI()
ans = N - sum(A)
if ans < 0:
    ans = -1
print (ans)

Measured memory_bytes: 69072
import java.util.*;
import java.io.*;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		HashMap hs = new HashMap();
		PrintWriter ou = new PrintWriter(System.out);
		int h = Integer.parseInt(sc.next());
		int w = Integer.parseInt(sc.next());
		char[][] a = new char[h][w];
		for(int i = 0 ; i < h ; i++){
			String s = sc.next();
			for(int j = 0 ; j < w ; j++){
				a[i][j] = s.charAt(j);
			}
		}
		sc.close();
		for(int i = 0 ; i < h ; i++){
			boolean ebishu = true;
			for(int j = 0 ; ebishu && j < w ; j++){
				if(a[i][j] == '#') ebishu = false;
			}
			if(ebishu){
				for(int j = 0 ; j < w ; j++){
					a[i][j] = '鶏';
				}
			}
		}
		for(int i = 0 ; i < w ; i++){
			boolean ebishu = true;
			for(int j = 0 ; ebishu && j < h ; j++){
				if(a[j][i] == '#') ebishu = false;
			}
			if(ebishu){
				for(int j = 0 ; j < h ; j++){
					a[j][i] = '鶏';
				}
			}
		}
		for(int i = 0 ; i < h ; i++){
			boolean ebishu = false;
			for(int j = 0 ; j < w ; j++){
				if(a[i][j] != '鶏'){
					ebishu = true;
					ou.print(a[i][j]);
				}
			}
			if(ebishu) ou.print("\n");
		}
		ou.flush();
	}
}

Measured memory_bytes: 37076
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.*;

public class Main implements Runnable {

    public static void main(String[] args) throws Exception {
        Thread.setDefaultUncaughtExceptionHandler((t, e)->System.exit(1));
        new Thread(null, new Main(), "", 16 * 1024 * 1024).start();
    }

    public void run() {
        int D = 0;
        
        // 入力
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in));) {
            D = Integer.parseInt(br.readLine());
        } catch (Exception e) {
            e.printStackTrace();
        }
        String result = "";
        switch (D) {
            case 25:
            result = "Christmas";
            break;
            case 24:
            result = "Christmas Eve";
            break;
            case 23:
            result = "Christmas Eve Eve";
            break;
            case 22:
            result = "Christmas Eve Eve Eve";
            break;
        }

        // 出力
        System.out.println(result);
    }
}


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

using namespace std;

#define int long long
typedef vector<int> vint;
typedef pair<int, int> pint;
const double PI = 3.14159265358979323846;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
// cout << fixed << setprecision(20);

double T, X;

signed main() {
    cin >> T >> X;
    cout << fixed << setprecision(20);
    cout << T / X << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fr(i,a,b) for (int i = (a), _b = (b); i <= _b; i++)
#define rep(i,n) for (int i = 0, _n = (n); i < _n; i++)
#define ull unsigned long long int
#define ll long long int
#define pb push_back
 
#define PI 3.1415926535897932385
#define INF 1e18
#define EPS 1e-7
#define MOD 1000000007 
                                 
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
ll exp(ll x, ll y, ll p)
{
    ll res = 1;   
    x = x % p;  
    while (y > 0)
    {
        if (y & 1)    
            res = (res*x) % p;
        y = y>>1;     
        x = (x*x) % p; 
    }
    return res;
}

 
int main() {
   
    fastio;
    int x;
    cin >> x;
    cout << !x;

 
    return 0; 
}

Measured memory_bytes: 3644
#pragma GCC target ("avx2")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("O3")
#include"bits/stdc++.h"
#include<unordered_set>
#include<unordered_map>
#include<random>
using namespace std;
typedef long long ll;
const ll MOD = 1'000'000'007LL; /*998'244'353LL;*/
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)

int X, N;
unordered_set<int> st;

signed main(){
    cin >> X >> N;
    rep(i, N){
        int p;
        cin >> p;
        st.insert(p);
    }

    int d = INT_MAX;
    int ans = -1;
    for(int i=-1; i<=101; i++){
        if(st.count(i)) continue;
        if(d > abs(X-i)){
            d = abs(X-i);
            ans = i;
        }
    }
    cout << ans << endl;
}

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int ans;
int A[3];
int w[8];
int L[8];

void dfs(int d, const int N) {
  if (d == N) {
    int l[3] = {0};
    int mp = 0;
    REP(i, N) {
      if (w[i] != 3) {
        if (l[w[i]] != 0) mp += 10;
        l[w[i]] += L[i];
      }
    }
    REP(i, 3) {
      if (l[i] == 0) mp = 1001001001;
      else mp += abs(l[i] - A[i]);
    }
    chmin(ans, mp);
    return;
  }
  REP(i, 4) {
    w[d] = i;
    dfs(d + 1, N);
  }
}
int main2() {
  int N; cin >> N;
  REP(i, 3) cin >> A[i];
  REP(i, N) {
    cin >> L[i];
  }
  ans = 1001001001;
  dfs(0, N);
  cout << ans << endl;
  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int a, b, c,y=0;
	cin >> a >> b >> c;
	for (int i = b; i >= a; i--){
		if (c%i == 0){
			y++;
		}
	}
	cout << y << endl;
	return 0;
}

Measured memory_bytes: 3080
function Main(input){
	input = input.split('');	
    //console.log(input[2]);
  　if(input[0]*input[2]%2 ==0){
    console.log('No');
    }else{
    console.log('Yes');
    }
	  
}
 
Main(require("fs").readFileSync("/dev/stdin","utf8"));


Measured memory_bytes: 7372
#include<bits/stdc++.h>
using namespace std;
struct Oca{
	long long x,y,z;
} a[1001];
long long num[1001];
long long sum,Max,Part;
int n,m;
int main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		scanf("%lld%lld%lld",&a[i].x,&a[i].y,&a[i].z);
	}
	for(int i=1;i<=n;i++){
		sum=0;
		sum+=a[i].x;sum+=a[i].y;sum+=a[i].z;
		num[i]=sum;
	}
	sort(num+1,num+n+1);
	Part=0;
	for(int i=n;i>n-m;i--){
		Part+=num[i];
	}
	if(Part>Max){
		Max=Part;
	}
	for(int i=1;i<=n;i++){
		sum=0;
		sum+=a[i].x;sum=sum+(-1*a[i].y);sum+=a[i].z;
		num[i]=sum;
	}
	sort(num+1,num+n+1);
	Part=0;
	for(int i=n;i>n-m;i--){
		Part+=num[i];
	}
	if(Part>Max){
		Max=Part;
	}
	for(int i=1;i<=n;i++){
		sum=0;
		sum+=(-1*a[i].x);sum+=a[i].y;sum+=a[i].z;
		num[i]=sum;
	}
	sort(num+1,num+n+1);
	Part=0;
	for(int i=n;i>n-m;i--){
		Part+=num[i];
	}
	if(Part>Max){
		Max=Part;
	}
	for(int i=1;i<=n;i++){
		sum=0;
		sum+=a[i].x;sum+=a[i].y;sum+=(-1*a[i].z);
		num[i]=sum;
	}
	sort(num+1,num+n+1);
	Part=0;
	for(int i=n;i>n-m;i--){
		Part+=num[i];
	}
	if(Part>Max){
		Max=Part;
	}
	for(int i=1;i<=n;i++){
		sum=0;
		sum+=(-1*a[i].x);sum+=(-1*a[i].y);sum+=(-1*a[i].z);
		num[i]=sum;
	}
	sort(num+1,num+n+1);
	Part=0;
	for(int i=n;i>n-m;i--){
		Part+=num[i];
	}
	if(Part>Max){
		Max=Part;
	}
	for(int i=1;i<=n;i++){
		sum=0;
		sum+=(-1*a[i].x);sum+=(-1*a[i].y);sum+=a[i].z;
		num[i]=sum;
	}
	sort(num+1,num+n+1);
	Part=0;
	for(int i=n;i>n-m;i--){
		Part+=num[i];
	}
	if(Part>Max){
		Max=Part;
	}
	for(int i=1;i<=n;i++){
		sum=0;
		sum+=(-1*a[i].x);sum+=a[i].y;sum+=(-1*a[i].z);
		num[i]=sum;
	}
	sort(num+1,num+n+1);
	Part=0;
	for(int i=n;i>n-m;i--){
		Part+=num[i];
	}
	if(Part>Max){
		Max=Part;
	}
	for(int i=1;i<=n;i++){
		sum=0;
		sum+=a[i].x;sum+=(-1*a[i].y);sum+=(-1*a[i].z);
		num[i]=sum;
	}
	sort(num+1,num+n+1);
	Part=0;
	for(int i=n;i>n-m;i--){
		Part+=num[i];
	}
	if(Part>Max){
		Max=Part;
	}
	cout<<Max;
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <queue>


using namespace std;
using ll = long long int;

template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}

const string YES = "Yes";
const string NO = "No";

void solve(std::string S){
  bool f = true;
  for(ll i=0; i<S.size(); i++)
    f  = f and ((i%2==0 and (S[i]=='R' or S[i]=='U' or S[i]=='D'))
	    or (i%2==1 and (S[i]=='L' or S[i]=='U' or S[i]=='D')));
  if(f)
    std::cout << YES << std::endl;
  else
    std::cout << NO << std::endl;
      
}

int main(){
  std::string S;
  std::cin >> S;
  solve(S);
  return 0;
}



Measured memory_bytes: 256
/*
 ============================================================================
 Name        : AtCoder_A.c
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Hello World in C, Ansi-style
 ============================================================================
 */

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void) {
	int a,b,c,d;
	scanf("%d %d %d %d",&a,&b,&c,&d);

	if((abs(a-b)<=d && abs(c-b)<=d)||abs(a-c)<=d){
		printf("Yes");
	}else{
		printf("No");
	}
	return 0;

}


Measured memory_bytes: 128
#include <iostream>
#include<sstream>
#include<string>
#include<vector>
#include <cmath>
#include <limits>
#include <queue>
#include<algorithm>
 
using namespace std;
 
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
 
int main(){
    int n, l;
    cin >> n >> l;
    priority_queue<string, vector<string>, greater<string> > S;
    string s;
    rep(i,n){
        cin >> s;
        S.push(s);
    }
    rep(i,n){
        cout << S.top();
        S.pop();
    }

    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <algorithm>

using namespace std;

long long b_sum = 0, median = 0, a_sum_below_median = 0, a_sum_above_median = 0;
priority_queue <int> below_median;
priority_queue <int, vector <int>, greater <int> > above_median;

void showpq(priority_queue <int> gq)
{
    priority_queue <int> g = gq;
    while (!g.empty())
    {
        cout << '\t' << g.top();
        g.pop();
    }
    cout << '\n';
}


void showq(priority_queue <int, vector <int>, greater <int> > gq)
{
    priority_queue <int, vector <int>, greater <int> > g = gq;
    while (!g.empty())
    {
        cout << '\t' << g.top();
        g.pop();
    }
    cout << '\n';
}

void answer()
{
    int query_type;
    cin >> query_type;

    const int INSERT = 1, GET_MINIMUM = 2;
    if(query_type == INSERT)
    {
        int a, b;
        cin >> a >> b;

        b_sum += b;

        if(below_median.empty() || a < below_median.top())
        {
            below_median.push(a);
            a_sum_below_median += a;
        }
        else
        {
            above_median.push(a);
            a_sum_above_median += a;
        }

        while(below_median.size() > above_median.size() + 1)
        {
            int x = below_median.top();
            below_median.pop();
            above_median.push(x);

            a_sum_below_median -= x;
            a_sum_above_median += x;
        }

        while(above_median.size() > below_median.size())
        {
            int x = above_median.top();
            above_median.pop();
            below_median.push(x);

            a_sum_above_median -= x;
            a_sum_below_median += x;
        } //cout << "Below median - " << endl; showpq(below_median); cout << "Above median " << endl; showq(above_median);
    }
    else if(query_type == GET_MINIMUM)
    {
        long long median = below_median.top();
        long long elements_below_median = below_median.size(), elements_above_median = above_median.size();

        long long minimum_value = (median*elements_below_median - a_sum_below_median) + (a_sum_above_median - median*elements_above_median) + b_sum;

        cout << median << " " << minimum_value << endl;
    }
}

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

    while(no_of_queries--)
        answer();

    return 0;
}


Measured memory_bytes: 3452