akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define MAX_N 100000
using namespace std;

int parent[MAX_N];
int ran[MAX_N];

void init(int n) {
    for (int i = 0; i < n; i++) {
        parent[i] = i;
        ran[i] = 0;
    }
}

int find(int x) {
    if (parent[x] == x) {
        return x;
    }
    else {
        return parent[x] = find(parent[x]);
    }
}

int unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return x;

    if (ran[x] > ran[y])
        return parent[y] = x;
    if (ran[x] == ran[y]) ran[y]++;
    return parent[x] = y;
}

bool same(int x, int y) {
    return find(x) == find(y);
}

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

    int a[MAX_N], b[MAX_N];
    for (int i = 0; i < m; i++) {
        cin >> a[i] >> b[i];
    }

    init(n);

    long ans[m];
    int group_size[n];
    fill(group_size, group_size + n, 1);
    ans[m - 1] = ((long) (n - 1) * n) >> 1;
    for (int i = m - 1; i > 0; i--) {
        if (same(a[i], b[i])) {
            ans[i - 1] = ans[i];
        } else {
            int asize = group_size[parent[a[i]]], bsize = group_size[parent[b[i]]];
            int nsize = asize + bsize;
            ans[i - 1] = ans[i] - (((long)(nsize - 1) * nsize) >> 1) + (((long)(asize - 1) * asize) >> 1) + (((long)(bsize - 1) * bsize) >> 1);
            group_size[unite(a[i], b[i])] = nsize;
        }
    }
    for (long x: ans) {
        cout << x << endl;
    }
    return 0;
}


Measured memory_bytes: 4096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1e9)
#define PI (acos(-1))
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl

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

    vector<char> ans;
    rep(i, s.size()) {
        if (s[i] == '0') {
            ans.push_back('0');
        } else if (s[i] == '1') {
            ans.push_back('1');
        } else {
            if (ans.size() != 0) {
                ans.erase(ans.begin() + ans.size() - 1);
            } else {
                continue;
            }
        }
    }

    rep(i, ans.size()) {
        cout << ans[i];
    }
    cout << endl;
}


Measured memory_bytes: 256
# code is from https://atcoder.jp/contests/abc112/submissions/7202999
n=int(input())
xyh=[tuple(map(int,input().split())) for i in range(n)]
xyh.sort(key=lambda tup:-tup[2])
for x in range(101):
	for y in range(101):
		esth=abs(x-xyh[0][0])+abs(y-xyh[0][1])+xyh[0][2]
		for i in range(1,n):
			if xyh[i][2]==0:
				if esth>abs(x-xyh[i][0])+abs(y-xyh[i][1]):
					break
			elif esth!=abs(x-xyh[i][0])+abs(y-xyh[i][1])+xyh[i][2]:
				break
		else:
			print(x,y,esth)
			exit()
		continue



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

using namespace std;

#define int long long
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define INF 1e9
#define LINF 1e18

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;
typedef pair<P, P> PP;

const int MOD = 1e9 + 7;
const int dy[]={0, 0, 1, -1};
const int dx[]={1, -1, 0, 0};

template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int X;
    cin >> X;
    int res = 0;
    FOR(i, 1, X + 1) {
        int latte = i;
        FOR(j, 1, X + 1) {
            latte *= i;
            if(latte <= X) chmax(res, latte);
            else break;
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#pragma GCC diagnostic ignored "-Wsign-compare"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < int(n); ++i)

void solve() {
    int r;
    cin >> r;
    cout << r * r << "\n";
}
int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int n;
    int max = -1000000;
    int min = 1000000;
    long sum = 0;
    cin >> n;
    int nums[n];
    for (int i = 0; i < n; i++) {
        cin >> nums[i];
    }
    for (int i = 0; i < n; i++) {
        sum += nums[i];
        if (nums[i] > max) max = nums[i];
        if (nums[i] < min) min = nums[i];
    }
    cout << min << " " << max << " " << sum << endl;
    return 0;
}

Measured memory_bytes: 3116
////////////////////////////////////
////////////////////////////////////
////                            ////
////                            ////
////     Please give me AC!     ////
////     Please give me AC!     ////
////                            ////
////                            ////
////////////////////////////////////
////////////////////////////////////
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
const int MOD=1e9+7;
const long double Pi=acos(-1);
using  P=pair<ll,ll>;
ll gcd(ll a,ll b){//aとbの最大公約数を返す//計算量は0(log(max(a,b))
  if(a%b==0){return b;}
  else{return gcd(b,a%b);}
}
ll lcm(ll a,ll b){//aとbの最小公倍数を返す//計算量は0(log(max(a,b))
  return a*b/gcd(a,b);
}
ll pow(ll x,ll y){//x^yを返す//計算量は0(log(y))
  ll tmp=x,res=1;
  while(y){
    if(y%2){res=res*tmp%MOD;}
    y>>=1;
    tmp=tmp*tmp%MOD;
  }
  return res;
}
ll nature(ll a){//絶対値を返す
  if(a>=0){return(a);}
  else{return(-1*a);}
}
ll prime(ll a){//素数なら1を返す//計算量は0(sqrt(a))
  if(a==2){return 1;}
  else if(a%2==0 || a==1){return 0;}
  for(ll i=3;i*i<=a;i+=2){if(a%i==0){return 0;}}
  return 1;
}
vector<int> Z;
void z_algorithm(string str){//計算量はO(str.size())
  Z.resize(str.size());
  Z.at(0)=str.size();
  int m=1,n=0;
  while(m<(int)str.size()){
    while(m+n<(int)str.size()&&str.at(n)==str.at(m+n)){n++;}
    Z.at(m)=n;
    if(n==0){
      m++;
      continue;
    }
    int k=1;
    while(k+Z.at(k)<n){
      Z.at(m+k)=Z.at(k);
      k++;
    }
    m+=k;
    n-=k;
  }
}
int main(){
  ll N,M,K;
  cin>>N>>M>>K;
  vector<ll> A(N+1);
  vector<ll> B(M+1);
  A.at(0)=0;
  B.at(0)=0;
  for(ll i=1;i<=N;i++){
    ll a;
    cin>>a;
    A.at(i)=a+A.at(i-1);
  }
  for(ll i=1;i<=M;i++){
    ll a;
    cin>>a;
    B.at(i)=a+B.at(i-1);
  }
  ll answer=0;
  for(ll i=0;i<=N;i++){
    if(A.at(i)>K){continue;}
    ll ans=0;
    ll left=0,right=M;
    while(left<=right){
      ll mid=left+(right-left)/2;
      if(B.at(mid)<=K-A.at(i)){left=mid+1;ans=max(ans,mid);}
      else{right=mid-1;}
    }
    answer=max(answer,ans+i);
  }
  cout<<answer<<endl;
}

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

int main() {
int n,r,p,d;
while(cin>>n>>r){
	if(n==0&&r==0){
		break;
	}
	int a[50]={},b[50]={},c[50]={};
	for(int k=0;k<n;k++){
		a[k]=n-k;
	}
	for(int i=0;i<r;i++){
		cin>>p>>d;
		for(int l=0;l<p-1;l++){
			b[l]=a[l];
		}
		for(int m=0;m<d;m++){
			c[m]=a[p+m-1];
		}
		for(int o=0;o<d;o++){
			a[o]=c[o];
		}
		for(int z=0;z<p-1;z++){
			a[d+z]=b[z];
		}
	}
		cout<<a[0]<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int N;
  
  int B = 1;
  
  int A;
  
  cin >> N >> A;
  
  for (int i = 0; i < N; i++) {
    
    if (B * 2 < B + A) {
        
        B = B * 2;
        
      }
      else if (B * 2 >= B + A) {
        
        B = B + A;
        
      }
  }
  
  cout << B << endl;
  
}

Measured memory_bytes: 256
import math
import copy
import bisect







def nCast(number):
    if type(number)==str:
        return int(number)
    for idx in range(0,len(number)):
        if type(number[idx])==str:

            number[idx]=int(number[idx])
        else:
            nCast(number[idx])
    return number
    
def inputArr(w):
    l=list()
    for idx in range(0,w):
        l.append(input())
    return l
def inputArr1(w):
    l=list()
    for idx in range(0,w):
        l.append(input().split())
    return l

n=nCast(input().split())



def func():
    if n[1]%n[0]==0:
        return sum(n)
    return n[1]-n[0]


print(func()) 



Measured memory_bytes: 3700
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
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 namespace std;

int main(){
    Init();
    ll k; string s; cin >> k >> s;
    if(s.size() <= k) cout << s << endl;
    else{
        cout << s.substr(0, k) << "..." << endl;
    }
}

Measured memory_bytes: 3652
/*
	Auther:_Destiny
	time:2020.5.3
*/
#include <bits/stdc++.h>
#define ll long long
#define N 100010
#define M 1010

using namespace std;
ll x, s, r;

ll read() {
	ll s = 0, f = 0; char ch = getchar();
	while (!isdigit(ch)) f |= (ch == '-'), ch = getchar();
	while (isdigit(ch)) s = s * 10 + (ch ^ 48), ch = getchar();
	return f ? -s : s;
}

int main() {
	x = read();
	for (ll i = -500; i <= 500; i++)
		for (ll j = -500; j <= 500; j++) {
			s = i * i * i * i * i;
			r = j * j * j * j * j;
			if (s - r == x) {
				cout << i << " " << j << "\n";
				return 0;
			}
		}
}

Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;
const int INF = numeric_limits<int>::max();
const ll INFL = numeric_limits<ll>::max();


// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

ll factorial(ll n) {
    ll res = 1;
    for (ll i = 1; i <= n; i++) {
        res *= i;
    }
    return res;
}

int main()
{
    int n,m; cin >> n >> m;
    if (n==m) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3640
#include<iostream>
#include<vector>
#include <algorithm>
#include <string>
#include <utility>
#include <set>
#include <map>
#include<cmath>
#include <queue>
#include <numeric>
#include <cassert>

using lli = long long int;
int inf = 1000000007;
using namespace std;

void solve()
{
	int N, K;
	cin >> N >> K;
	vector<char> D(N);
	for (int i = 0; i < K; i++) {
		cin >> D[i];
	}
	for (int i = N; i < 100000; i++) {
		string s = to_string(i);
		bool flag = true;
		for (int j = 0; j < K; j++) {
			if (s.find(D[j]) != string::npos) { flag = false; break; }
		}
		if (flag) { cout << i << endl; return; }
	}
}

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

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<int, P> E;
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	b += MOD;
	a += b;
	a %= MOD;
}

ll gcd(ll a, ll b){
	return ((b)?(gcd(b,a%b)):(a));
}

int main(void){
	ll n,m,g,i,p,q;
	string s,t;
	cin >> n >> m;
	g = gcd(max(n,m),min(n,m));
	n /= g;
	m /= g;
	cin >> s;
	cin >> t;
	for(i=0ll; i<g; ++i){
		p = n*i;
		q = m*i;
		if(s[p] != t[q]){
			cout << "-1" << endl;
			return 0;
		}
	}
	cout << (n*m*g) << endl;
	return 0;
}


Measured memory_bytes: 512
h,w=map(int,input().split())
S=[]
Key=[]
S.append(list('.'*(w+2)))
for i in range(1,h+1):
    S.append(list(input()))
    S[i].insert(0,'s')
    S[i].append('f')
S.append(list('.'*(w+2)))

for i in range(1,h+1):
    tmp=[]
    for j in range(1,w+1):
        cnt=0
        if S[i-1][j-1]=='#':
            cnt+=1
        if S[i-1][j]=='#':
            cnt+=1
        if S[i-1][j+1]=='#':
            cnt+=1
        if S[i][j-1]=='#':
            cnt+=1
        if S[i][j+1]=='#':
            cnt+=1
        if S[i+1][j-1]=='#':
            cnt+=1
        if S[i+1][j]=='#':
            cnt+=1
        if S[i+1][j+1]=='#':
            cnt+=1
        
        if S[i][j]=='#':
            tmp.append('#')
        else: tmp.append(str(cnt))
    Key.append(tmp)


for i in range(h):
    tmp=''.join(Key[i])
    print(tmp)   


Measured memory_bytes: 3188
N, W, H = map(int, input().split())
row, col = [0] * (H + 1), [0] * (W + 1)
for _ in range(N):
    x, y, w = map(int, input().split())
    row[max(0, y - w)] += 1
    row[min(H, y + w)] -= 1
    col[max(0, x - w)] += 1
    col[min(W, x + w)] -= 1
for i in range(H):
    row[i + 1] += row[i]
for i in range(W):
    col[i + 1] += col[i]
print("Yes" if all(x > 0 for x in row[:-1]) or all(x > 0 for x in col[:-1]) else "No")

Measured memory_bytes: 16280
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define all(v) (v).begin(),(v).end()

const int MAX_V = 301;
const int inf=10000;

struct edge {int to,cap,rev;};

int V;
vector<edge> G[MAX_V];
bool used[MAX_V];

void add_edge(int from,int to,int cap) {
  G[from].push_back((edge){to,cap,G[to].size()});
  G[to].push_back((edge){from,0,G[from].size()-1});
}

int dfs(int v,int t, int f) {
  if(v==t) return f;
  used[v]=true;
  for(int i=0; i<G[v].size(); i++) {
    edge& e =G[v][i];
    if(!used[e.to]&&e.cap>0) {
      int d=dfs(e.to,t,min(f,e.cap));
      if(d>0) {
	e.cap-=d;
	G[e.to][e.rev].cap += d;
	return d;
      }
    }
  }
  return 0;
}

int max_flow(int s, int t) {
  int flow=0;
  for(;;) {
    memset(used, 0,sizeof(used));
    int f=dfs(s,t,inf);
    if(f==0) return flow;
    flow+=f;
  }
}

int main() {
  int n;cin>>n;
  vector<int> a(n),b(n),c(n),d(n);
  rep(i,n) cin>>a[i]>>b[i];
  rep(i,n) cin>>c[i]>>d[i];
  rep(i,n) {
    add_edge(0,i+1,1);
  }
  rep(i,n) {
    add_edge(n+i+1,300,1);
  }
  rep(i,n) {
    rep(j,n) {
      if(a[i]<c[j]&&b[i]<d[j]) {
	add_edge(i+1,n+j+1,1);
      }
    }
  }
  cout<<max_flow(0,300)<<endl;
  return 0;
}


Measured memory_bytes: 384
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class Main {

	private final static long MOD = 1000000007;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int P = sc.nextInt();
		int Q = sc.nextInt();
		int R= sc.nextInt();
		
		long a = P+Q;
		long b  =Q+R;
		long c = P+R;
		
		System.out.println(Math.min(Math.min(a, b), c));		
	}
	
	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	public static class Scanner {
		private BufferedInputStream inputStream;
		private StringBuilder buffer = new StringBuilder();

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public int nextInt() throws IOException {
			int num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;
			int sign = 1;

			int read = skip();
			if (read == '-') {
				sign = -1;
				read = inputStream.read();
			}

			do {
				num = num * 10 + sign * (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			int read = skip();
			do {
				buffer.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			String text = buffer.toString();
			buffer.delete(0, buffer.length());

			return text;
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
}


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

int32_t main(){
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0),cin.tie(0);
	char c;
	cin >> c;
	cout << (char)(c+1);
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int t = sc.nextInt();
        int[] a = sc.nextIntArray(n);
        int min = Integer.MAX_VALUE;
        int diff = 0;
        int ans = 0;
        for(int v : a){
            if(min > v){
                min = v;
            }
            if(diff < v - min){
                diff = v-min;
                ans = 1;
            }else if(diff == v-min){
                ans++;
            }
        }
        System.out.println(ans);
    }
}

class Restaurant implements Comparable<Restaurant>{
    int p,i;
    String c;
    public Restaurant(int p,int i,String c){
        this.p = p;
        this.i = i;
        this.c = c;
    }
    
    public int compareTo(Restaurant r){
        if(this.c.compareTo(r.c) <= -1){
            return -1;
        }else if(this.c.compareTo(r.c) >= 1){
            return 1;
        }else{
            if(this.p > r.p){
                return -1;   
            }else if(this.p < r.p){
                return 1;
            }else{
                return 0;
            }
        }
    }
}

class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

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

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
            return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }
    
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) a[i] = nextLong();
        return a;
    } 
}


Measured memory_bytes: 36384
//#include<bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <utility>
#include <climits>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define F first
#define S second
#define OUT(x) cout << (x) << "\n"
using namespace std;
using point = pair< int,int >;
using ll = long long;

int main() {
    int a, b, c;
    cin >> a >> b >> c;

    OUT(a <= c && c <= b ? "Yes" : "No");
    return 0;
}



Measured memory_bytes: 256
package main

import (
	"fmt"
	"bufio"
	"os"
	"strings"
	"strconv"
)

const MAX_LEN = 100000

type Process struct {
	name string
	time int
}
type Queue struct {
	container [MAX_LEN]Process
	head int
	tail int
}

func genereteQueue() Queue {
	return Queue{head: 0, tail: 0}
}

func (q *Queue) isEmpty() bool {
	return q.head == q.tail
}

func (q *Queue) enqueue(name string, time int) {
	q.container[q.tail] = Process{name: name, time: time}
	q.tail = (q.tail + 1) % MAX_LEN
}

func (q *Queue) dequeue() Process {
	if q.isEmpty() {
		fmt.Println("Empty.")
	}
	process := q.container[q.head]
	q.head = (q.head + 1) % MAX_LEN
	return process
}

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	q := genereteQueue()
	scanner.Scan()
	str := scanner.Text()
	s := strings.Split(str, " ")
	//fmt.Println(scanner.Text())
	n, _ := strconv.Atoi(s[0])
	timeSlice, _ := strconv.Atoi(s[1])
	for i := 0; i < n; i++ {
		scanner.Scan()
		str := scanner.Text()
		s := strings.Split(str, " ")
		name := s[0]
		time ,_ := strconv.Atoi(s[1])
		q.enqueue(name, time)
	}
	ans := 0

	for {
		if q.isEmpty() {
			break
		}
		processing := q.dequeue()
		if processing.time <= timeSlice {
			ans += processing.time
			fmt.Printf("%s %d\n", processing.name, ans)
		} else {
			q.enqueue(processing.name, processing.time - timeSlice)
			ans += timeSlice
		}
	}
}


Measured memory_bytes: 13500
#include <bits/stdc++.h>
using namespace std;
#define MOD7 1000000007
#define MOD9 1e9 + 9
#define SCD(t) scanf("%d",&t)
#define SCLD(t) scanf("%ld",&t)
#define SCLLD(t) scanf("%lld",&t)
#define SCC(t) scanf("%c",&t)
#define SCS(t) scanf("%s",t)
#define SCF(t) scanf("%f",&t)
#define SCLF(t) scanf("%lf",&t)
#define MEM(a, b) memset(a, (b), sizeof(a))
typedef long long ll;
typedef long double ld;
typedef string str;
typedef double d;
typedef unsigned u;
typedef unsigned long long ull;

const long long BIGINF = 2e18 + 7;
const int INF = 2e9 + 7;

int main () {
	/*#ifndef ONLINE_JUDGE
		freopen("inputf.txt", "r", stdin);
		freopen("outputf.txt", "w", stdout);
	#endif*/
	int n;
	SCD(n);
	map<string, int> hash;
	for (int i = 1; i <= n; i++) {
		string s = to_string(i);
		int l = s.length();
		char ch1, ch2;
		ch1 = s[0];
		ch2 = s.back();
		s.clear();
		s += ch1;
		s += ch2;
		hash[s]++;
	}
	assert((int) hash.size() <= 100);
	long long ans = 0;
	for (pair<string, int> x: hash) {
		string s = x.first;
		swap(s[0], s[1]);
		if (s[0] == s[1]) {
			ans += 1LL * x.second * x.second;
		}
		else {
			ans += 1LL * hash[s] * x.second;
		}
	}
	printf("%lld" ,ans);
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define bst ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define f first
#define s second
#define mp make_pair
#define sz size()
#define ex0 exit(0)
#define endl '\n'
typedef long long ll;
ll t;
string s;
vector <set <int> > pos(26);
void solve() {
	int x, l, r;
	cin >> x;
	char cd;
	if(x == 1) {
		cin >> l >> cd;
		--l;
		pos[s[l] - 'a'].erase(l);
		s[l] = cd;
		pos[s[l] - 'a'].insert(l);
	}
	else {
		cin >> l >> r;
		--l, --r;
		ll ans = 0;
		for(int i = 0; i < 26; ++i) {
			set <int> :: iterator cur_elem = pos[i].lower_bound(l);
			if(cur_elem != pos[i].end() && *cur_elem <= r) ++ans;
		}
		cout << ans << '\n';
	}
}
int main() {
    bst;
    int sadasd;
    cin >> sadasd;
	cin >> s;
	for(int i = 0; i < s.sz; ++i) pos[s[i] - 'a'].insert(i);
	cin >> t;
	while(t--) {
		solve();
	}
	return 0;
}


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

int main(){
  int n;
  cin>>n;
  if(n<2)cout<<1;
  else if(n<4)cout<<2;
  else if(n<8)cout<<4;
  else if(n<16)cout<<8;
  else if(n<32)cout<<16;
  else if(n<64)cout<<32;
  else cout<<64;
}

Measured memory_bytes: 256
H, W = map(int,input().split())

ans = [H//2+W//3+1, H//3+W//2+1, H, W]
if(H%3 == 0 or W%3 == 0):
  ans += [0]
if(H%2 == 0):
  ans += [H//2]
if(W%2 == 0):
  ans += [W//2]
print(min(ans))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;
using vb = vector<bool>;
using vs = vector<string>;
using vp = vector<pii>;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (ll)((x).size())
#define all(x) (x).begin(), (x).end()
#define each(a, x) for (auto&& a : (x))
#define _overload3(_1,_2,_3,name,...) name
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) for (ll i=(a); i<(n); ++i)
#define rep(...) _overload3(__VA_ARGS__,rep3,rep2,rep1)(__VA_ARGS__)
const int INF = 1e9;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
template<class T> inline void print(const T& x) {cout << x << "\n";}
template<class T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template<class T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
struct Init {Init() {cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(10);}} init;

int main() {
    ll n; cin >> n;
    vi a(n); rep(i, n) cin >> a[i];
    sort(all(a));
    ll ma = a[n - 1] + 1;
    vi cnt(ma, 0);
    vb isOk(ma, true);
    each(x, a) {
        cnt[x]++;
        if (cnt[x] == 1 && isOk[x]) {
            for (ll y = x + x; y <= ma; y += x) {
                isOk[y] = false;
            }
        }
    }
    ll ans = 0;
    each(x, a) if (cnt[x] == 1 && isOk[x]) ans++;
    print(ans);
}

Measured memory_bytes: 12768
#include<stdio.h>
#include<algorithm>
using namespace std;
int x[100000];
int y[100000];
int w[100000];
int A[100001];
int B[100001];
int main(){
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	for(int i=0;i<a;i++){
		scanf("%d%d%d",x+i,y+i,w+i);
	}
	for(int i=0;i<a;i++){
		int L=max(0,x[i]-w[i]);
		int R=min(b,x[i]+w[i]);
		A[L]++;
		A[R]--;
	}
	for(int i=0;i<a;i++){
		int L=max(0,y[i]-w[i]);
		int R=min(c,y[i]+w[i]);
		B[L]++;
		B[R]--;
	}
	bool ok1=true;
	long long d=0LL;
	for(int i=0;i<b;i++){
		d+=A[i];
		if(!d)ok1=false;
	}
	d=0LL;
	bool ok2=true;
	for(int i=0;i<c;i++){
		d+=B[i];
		if(!d)ok2=false;
	}
	if(ok1||ok2)printf("Yes\n");
	else printf("No\n");
}

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

#define fs first
#define sc second
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

const int32_t inf = 1001001001;
const int64_t infll = 1001001001001001001ll;
const int dx[] = {0, -1, 1, 0, -1, 1, -1, 1}, dy[] = {-1, 0, 0, 1, -1, -1, 1, 1};

template <typename T> using vector2d = vector<vector<T>>;

// clang-format off
template <typename T> void sort(vector<T> &v) { sort(all(v)); }
// ostream &operator<<(ostream &os, __int128_t value) { if (ostream::sentry(os)) { __uint128_t tmp = value < 0 ? -value : value; char buffer[64]; char *d = end(buffer); do { --d; *d = "0123456789"[tmp % 10]; tmp /= 10; } while (tmp != 0); if (value < 0) { --d; *d = '-'; } int len = end(buffer) - d; if (os.rdbuf()->sputn(d, len) != len) { os.setstate(ios_base::badbit); }} return os; }
// istream &operator>>(istream &is, __int128_t &value) { string in; is >> in; value = 0; for (const char &c : in) { if ('0' <= c && c <= '9') value = 10 * value + (c - '0'); } if (in[0] == '-') value *= -1; return is; }
// ostream &operator<<(ostream &os, __uint128_t value) { if (ostream::sentry(os)) { char buffer[64]; char *d = end(buffer); do { --d; *d = "0123456789"[value % 10]; value /= 10; } while (value != 0); int len = end(buffer) - d; if (os.rdbuf()->sputn(d, len) != len) { os.setstate(ios_base::badbit); }} return os; }
// istream &operator>>(istream &is, __uint128_t &value) { string in; is >> in; value = 0; for (const char &c : in) { if ('0' <= c && c <= '9') value = 10 * value + (c - '0'); } return is; }
template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { os << v[0]; for (int i = 1; i < v.size(); ++i) os << " " << v[i]; return os; }
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << p.fs << " " << p.sc; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.fs >> p.sc; return is; }

struct IoSetup { IoSetup(){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); cerr << fixed << setprecision(10); } } iosetup;

inline int64_t in() { int64_t x = 0; cin >> x; return x; }
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

signed main(int argc, char *argv[]) {
  int n = in();
  vector<int> c(n);
  cin >> c;

  vector<int> cnt(n);
  int q = in();
  while (q--) {
    int t = in(), x = in(), d = in();
    if (t == 1) {
      cnt[x - 1] += d;
    } else {
      cnt[x - 1] -= d;
    }

    if (cnt[x - 1] < 0 || c[x - 1] < cnt[x - 1]) {
      cout << x << endl;
      return 0;
    }
  }

  cout << 0 << endl;
}



Measured memory_bytes: 3236
#include<iostream>                                                    
#include<cstdlib>
#include<cstring>
#include<cstdio>
using namespace std;

struct Node{
    int key;
    Node *parent,*left,*right;
};
Node *root,*NIL;

Node *find(Node *u,int k){
    while(u!=NIL&&k!=u->key){
        if(u->key>k)
            u=u->left;
        else
            u=u->right;
    }
    return u;
    
}
void insert(int k){
    Node *y=NIL;
    Node *x=root;
    Node *z; 

    z=(Node *)malloc(sizeof(Node));
    z->key=k;
    z->left=NIL;
    z->right=NIL;

    while(x!=NIL){
        y=x;
        if(z->key<x->key)
            x=x->left;
        else
            x=x->right;
    }   
    z->parent=y;
    if(y==NIL)
        root=z;
    else{
        if(z->key<y->key)
            y->left=z;
        else
            y->right=z;
    }   
}
void inorder(Node *u){
    if(u==NIL)return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
}
void preorder(Node *u){
    if(u==NIL)return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}

int main(){
    int n,x;
    char com[7];
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>com;
        if(com[0]=='i'){
            cin>>x;
            insert(x);
        }else if(com[0]=='f'){
            cin>>x;
            Node *t=find(root,x);
            if(t!=NIL)printf("yes\n");
            else printf("no\n");
        }else if(com[0]=='p'){
            inorder(root);
            putchar('\n');
            preorder(root);
            putchar('\n');
        }
    }
    return 0;
    
}       


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


#include "boost/multiprecision/cpp_int.hpp"
#include "boost/multiprecision/cpp_dec_float.hpp"
namespace mp = boost::multiprecision;
typedef mp::cpp_int LL;
typedef mp::number<mp::cpp_dec_float<1024>> DD;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)


typedef long double dd;
//#define i_7 (ll)(1E9+7)
#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
template<class T,class S>
inline bool chmax(T &a, S b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T,class S>
inline bool chmin(T &a, S b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

void mod_print(ll k){
    ll P=1000;
    rep(y,1,P){
        ll x=mod(y*k);
        if(x+P>=i_7){
            x-=i_7;
        }
        if(abs(x)<=P){
            cout<<x<<"/"<<y<<endl;
            return;
        }
    }
    cout<<"nun"<<endl;
}
#define all(c) c.begin(),c.end()
//////////////////////////



ll n,s;
void conv(vector<ll>&ans){
    ll as=ans.size();
    while(as>s+1){
        ans.pop_back();
        as--;
    }
}


int main(){fastio
    cin>>n>>s;
    vector<ll>ans(s+1);
    ans[0]=1;
    rep(i,0,n-1){
        ll t;cin>>t;
        vector<ll>nxt(s+1);
        rep(j,0,s){
            Add(nxt[j],ans[j]*2);
            if(j+t<=s)Add(nxt[j+t],ans[j]);
        }
        ans=nxt;
    }
    //for(auto x:ans)cout<<x<<" ";cout<<endl;
    cout<<mod(ans[s])<<endl;
    
    return 0;
}





Measured memory_bytes: 3652
<?php

class In {

	private $buf = [];
	private $count = 0;
	private $pointer = 0;

	public function nextLine() {
		$ret = '';
		if($this->hasNext()){
			while($this->hasNext()){
				$ret .= $this->next();
			}
		}else{
			$ret = trim(fgets(STDIN));
		}

		return $ret;
	}

	public function next() {
		if(!$this->hasNext()) {
			$str = trim(fgets(STDIN));
			$this->buf = explode(' ',$str);
			$this->count = count($this->buf);
			$this->pointer = 0;
		}

		return $this->buf[$this->pointer++];
	}

	public function hasNext() {
		return $this->pointer < $this->count;
	}

	public function nextInt() {
		return (int)$this->next();
	}

	public function nextDouble() {
		return (double)$this->next();
	}
}

class Out {
	public function println($str = '') {
		echo $str . PHP_EOL;
	}
}

$in = new In();
$out = new Out();

$s = $in->next();
$len = strlen($s);

$ans = '';
for ($i = 0;$i < $len;$i+=2) {
	$ans .= $s[$i];
}

$out->println($ans);

?>


Measured memory_bytes: 4728
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N; cin >> N;
  vector<int> weight(N);
  for (int i=0;i<N;i++){
    cin >> weight.at(i);
  }
  int sum=0;
  int SUM=0;
  int center=0;
  for (int i=0;i<N;i++){
    sum+=weight.at(i);
  }
  for (int i=0;i<N;i++){
    SUM+=weight.at(i);
    if (SUM > sum/2){
      center=i;
      break;
    }
  }
  int a=0;
  int b=0;
  for (int i=0;i<center;i++){
    a+=weight.at(i);
  }
  for (int i=0;i<center+1;i++){
    b+=weight.at(i);
  }
  if (sum-a*2<=2*b-sum) cout << sum-a*2 << endl;
  else cout << 2*b-sum << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
ll c[300005]={0};
ll d[300005]={0};
ll dsum[300005]={0},dksum[300005]={0};
signed main(){
  ll n;
  cin>>n;
  for(int i=0;i<n;i++){
    ll a;
    cin>>a;
    c[a]++;
  }
  for(int i=1;i<=n;i++) d[c[i]]++;
  for(int i=1;i<=n;i++){
    dsum[i]=dsum[i-1]+d[i];
    dksum[i]=dksum[i-1]+i*d[i];
  }
  //for(int i=1;i<=n;i++) cout<<dsum[i]<<" ";
  //cout<<endl;
  //for(int i=1;i<=n;i++) cout<<dksum[i]<<" ";
  //cout<<endl;
  vector<ll> ans;
  ans.push_back(n+1);
  for(int i=1;i<=n;i++) ans.push_back((dksum[i]+i*(dsum[n]-dsum[i]))/i);
  //for(int i=1;i<=n;i++) cout<<ans[i]<<" ";
  //cout<<endl;
  for(int i=1;i<=n;i++){
    ll lb=0,rb=ans.size();
    while(rb-lb>1){
      ll mid=(lb+rb)/2;
      if(ans[mid]>=i) lb=mid;
      else rb=mid;
    }
    cout<<rb-1<<endl;
  }
}


Measured memory_bytes: 15728
# coding: utf-8

S = input()
cnt = 0
ls = []
for i in range(2**(len(S)-1)):
    #print(str(bin(i))[2:].zfill(len(S)-1))
    bi = list(str(bin(i))[2:].zfill(len(S)-1))
    ls.append(bi)

for item in ls:
    s = S[0]
    for inx, bi in enumerate(item):
        if bi == "0":
            pass
        else:
            s = s+"+"
        if len(S) != 1:
            s = s + S[inx+1]
        else:
            s = S
    cnt += sum(map(int, s.split("+")))
print(cnt)

Measured memory_bytes: 3188
#include<stdio.h>
#define MAX 100000
#define SENTINELtw 2000000000

struct Card{
    char suit;
    int value;
};

struct Card L[MAX/2+2],R[MAX/2+2];

void mergetw(struct Card Atw[],int n,int left,int mid,int right){
    int i,j,k;
    int n1=mid-left;
    int n2=right-mid;
    for(i=0;i<n1;i++)L[i]=Atw[left+i];
    for(i=0;i<n2;i++)R[i]=Atw[mid+i];
    L[n1].value = R[n2].value = SENTINELtw;
    i=j=0;
    for(k=left;k<right;k++){
        if(L[i].value <= R[j].value){
            Atw[k]=L[i++];
        }else{
            Atw[k]=R[j++];
        }
    }
}

void mergeSorttw(struct Card A[],int n,int left,int right){
    int mid;
    if(left + 1 < right){
        mid=(left+right)/2;
        mergeSorttw(A,n,left,mid);
        mergeSorttw(A,n,mid,right);
        mergetw(A,n,left,mid,right);
    }
}

int partition(struct Card Atw[], int n,int p,int r){
    int i,j;
    struct Card t,x;
    x=Atw[r];
    i=p-1;
    for(j=p;j<r;j++){
        if(Atw[j].value <= x.value){
            i++;
            t=Atw[i];Atw[i]=Atw[j];Atw[j]=t;
        }
    }
    t=Atw[i+1];Atw[i+1]=Atw[r];Atw[r]=t;
    return i+1;
}

void quickSort(struct Card Atw[],int n,int p,int r){
    int q;
    if(p<r){
        q=partition(Atw,n,p,r);
        quickSort(Atw,n,p,q-1);
        quickSort(Atw,n,q+1,r);
    }
}

int main(){
    int n,i,v;
    struct Card Atw[MAX],Btw[MAX];
    char S[10];
    int stable=1;

    scanf("%d",&n);

    for(i=0;i<n;i++){
        scanf("%s %d",S,&v);
        Atw[i].suit=Btw[i].suit=S[0];
        Atw[i].value=Btw[i].value=v;
    }

    mergeSorttw(Atw,n,0,n);
    quickSort(Btw,n,0,n-1);

    for(i=0;i<n;i++){

        if(Atw[i].suit != Btw[i].suit)stable=0;
    }

    if(stable==1)printf("Stable\n");
    else printf("Not stable\n");
    for (i=0;i<n;i++){
        printf("%c %d\n",Btw[i].suit,Btw[i].value);
    }

    return 0;
}


Measured memory_bytes: 4076
import std.stdio;
import std.string;
import std.conv;

ulong debt(ulong x, int n) {
  if(n > 0) {
    ulong m = x * 105 / 100;
    if(m % 1000 > 0) m = (m / 1000 + 1) * 1000;

    return debt(m, n - 1);
  }
  else return x;
}

void main() {
  int n = to!int(chomp(readln()));

  writeln(debt(100000, n));
}

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

using namespace std;

int main() {
int k,x,y,z;
cin>>k>>x;
   z=x;
   y=k-1;
    for (int i = 0; i <y ; ++i) {
        z--;
    }
    for (int j = 0; j <=(y*2) ; ++j) {
        cout<<z<<" ";
        z++;
    }

}

Measured memory_bytes: 256
<?php
    list($N,$M) = array_map('intval',explode(" ",trim(fgets(STDIN))));
    
    $height = array_map('intval',explode(" ",trim(fgets(STDIN))));
    array_unshift($height,0);
    
    for($i=1;$i<=$M;$i++){
        list($a,$b) = array_map('intval',explode(" ",trim(fgets(STDIN))));
        
        //無向ぐらふにする。
        $G[$a][] = $b;
        $G[$b][] = $a;
    }
    // sort($G);
    // array_unshift($G,0);
    // var_dump($G);
    
    //全てよい展望台であることとする
    $flg = array_fill(1,$N,1);
    // var_dump($flg);
    //展望台＄jについて
    for($j=1;$j<=$N;$j++){
        if(empty($G[$j])){
            // echo $j."\n";
            $flg[$j] = 1;
            goto next;
        }
        foreach((array)$G[$j] as $value){
            //一個でも$jより一か所でも高ければ
            if($height[$j] <= $height[$value]){
                // echo $j." ".$value."\n";
                $flg[$j] = 0;
                break;
            }
        }
        next:
    }
    // var_dump($flg);
    echo array_sum($flg)."\n";
?>

Measured memory_bytes: 61640
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main() {
	int g[4] = { 4,6,9,11 };
	int x, y;

	cin >> x >> y;

	if (x == 2 || y == 2) {
		cout << "No" << endl;
	}
	else {
		bool bx=false, by=false;
		for (int i = 0; i < 4; i++) {
			if (g[i] == x) bx = true;
			if (g[i] == y) by = true;
		}
		if ((bx && by) || (!bx && !by)) {
			cout << "Yes" << endl;
		}
		else{
			cout << "No" << endl;
		}
	}
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
  int a,b;
  cin>>a>>b;
  if(a==1)
    a=14;
  if(b==1)
    b=14;
  if(a>b)
    cout<<"Alice"<<endl;
  else
    cout<<(a==b?"Draw":"Bob")<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll= long long;
using ld= long double;
using P =pair<ll,ll>;


//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<=(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define sort(a) sort(ALL(a))//sortの省略
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 10000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define in(T, x) T x;cin >> x;//Tは型,xが入力値
#define vec(T,a,n,x) vector<T> a(n,x);
#define vec2(T,a,n,m) vector<vector<T>> a(n,vector<T>(m));
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define out(x) cout << x << endl//出力
#define bout(b) if(b){out("Yes");}else{out("No");}//真偽問題に対する出力
#define ain(T, a, n) vector<T> a(n);REP(i, n){cin >> a[i];}//配列の宣言と入力
#define a2in(T1, a, T2, b, n) vector<T1> a(n);vector<T2> b(n);REP(i, n){cin >> a[i] >> b[i];}//2つの配列を同時宣言、入力

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }//dp表とかで最大値更新するやつ
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }//最小値更新


signed main(){
  in(ll,N);
  ain(ll,a,N);
  sort(a);
  reverse(ALL(a));
  ll Alice=0;
  ll Bob=0;
  REP(i,N-1){
    if(i%2==0){Alice+=a[i];}
    else{Bob+=a[i];}
  }
  out(Alice-Bob);

}


Measured memory_bytes: 256
import math
N, M = map(int, input().split())


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


if N <= 1 and M <= 1:
    print(0)
elif N <= 1 and M > 1:
    print(combinations_count(M, 2))

elif N > 1 and M <= 1:
    print(combinations_count(N, 2))

else:
    print(combinations_count(N, 2)+combinations_count(M, 2))


Measured memory_bytes: 3060
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      int A = sc.nextInt();
      int B = sc.nextInt();
      int C = sc.nextInt();
      if(A+B>=C){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }
    }
}

Measured memory_bytes: 35768
#include <bits/stdc++.h>
#define pb push_back
#define SZ(x) ((int)(x.size()))
#define FOR(i,s,n) for (ll i = (s); (i) < (n); ++i)
#define FORD(i,s,l) for (ll i = (s); (i) >= l; --i)
#define F first
#define S second
#define TC int __tc; cin >> __tc; FOR(case_num,1,__tc+1)
#define TEST(x,i) ((x)&(1ll<<(i)))
#define SET(x,i) ((x)|(1ll<<(i)))
#define FLIP(x,i) ((x)^(1ll<<(i)))
#define CLEAR(x,i) ((x)&~(1ll<<(i)))

const double pi = 4 * atan(1);
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;
const int MAXN = 200005;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	string s;
	cin >> s;
	
	map<int,int> c;
	for (auto x : s) {
		c[x]++;
	}
	
	for (auto p : c) {
		if (p.S&1){
			cout << "No\n";
			return 0;
		}
	}
	cout << "Yes\n";

}


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

#define ff first
#define endl "\n"
#define ss second
using namespace std;
#define maxn 2000006
#define pb push_back
#define ll long long
#define lll __int128
#define vll vector<ll>
#define mll map<ll,ll>
#define MOD 1000000007
#define pll pair<ll,ll>
#define ull unsigned long long
#define f(i,x,n) for(ll i=x;i<=n;i++)
#define fr(i,x,n) for(ll i=x;i>=n;i--)
inline ll min(ll a, ll b, ll c) { return min(min(a, b), c);}
inline ll max(ll a, ll b, ll c) { return max(max(a, b), c);}
inline void fastio() {ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);}

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



int main() {
	fastio();

	ll h, a; cin >> h >> a;
	cout << (h / a) + (h % a != 0);

	return 0;
}

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

int main(int argc, char *argv[]) {
  int n, cnts[10] = {};
  for (int i = 0; i < 4; i++) {
    scanf("%d", &n);
    cnts[n]++;
  }
  if (cnts[1] == 1 && cnts[9] == 1 && cnts[7] == 1 && cnts[4] == 1) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  
  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
#define rep(i,n) for (int i=0;i<(n);++i)
#define REP(i,n) for (int i=1;i<=(n);++i)
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define read(x) scanf("%d",&x)

int n,m;
vector<pii> G[55];
int add[50];
int dep[55],fa[55],faEdge[55];
inline void dfs(int u,int pa){
	dep[u]=dep[pa]+1;
	fa[u]=pa;
	for (int i=0;i<G[u].size();++i){
		int v=G[u][i].F;
		if (v!=pa) dfs(v,u);
		else faEdge[u]=G[u][i].S;
	}
}
ll dp[1<<20][50];
int main(){
	ios::sync_with_stdio(false);
	cin>>n;
	rep(i,n-1){
		int x,y;cin>>x>>y;
		G[x].pb(mp(y,i));G[y].pb(mp(x,i));
	}
	dfs(1,0);
	cin>>m;
	rep(i,m){
		int x,y;cin>>x>>y;
		if (dep[x]<dep[y]) swap(x,y);
		while(dep[x]>dep[y]){
			add[faEdge[x]]|=1<<i;
			x=fa[x];
		}
		while(x!=y){
			add[faEdge[x]]|=1<<i;
			add[faEdge[y]]|=1<<i;
			x=fa[x];y=fa[y];
		}
	}
	dp[0][0]=1;
	rep(i,n-1) for (int mask=0;mask<(1<<m);++mask) if (dp[mask][i]){
		dp[mask][i+1]+=dp[mask][i];
		dp[mask|add[i]][i+1]+=dp[mask][i];
	}
	cout<<dp[(1<<m)-1][n-1]<<endl;
	
	return 0;
}

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

int main(){
  int N,X,Y; cin >> N >> X >> Y;
  int count[3000];
  for(int i=1; i<=N-1; i++){
    for(int j=i+1; j<=N; j++){
      count[min(j-i,abs(X-i)+1+abs(Y-j))]++;
    }
  }
  
  for(int k=1; k<=N-1; k++) cout << count[k] << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
   int i, n, input, first, min, max;
   long sum;
   
   sum=0;
   cin >> n;
   cin >> first;
   min = max = first;

   sum=sum+first;
   for (i=2; i<=n; i++)
   {
       cin >> input;
       sum=sum+input;
       if (input < min)
          min=input;
       if (input > max)
          max=input;
   }

   cout << min << " " << max << " " << sum << endl;
   return 0;
}


Measured memory_bytes: 3096