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

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;

int N;
vector<pair<int, string>> v;

void dfs(int pre, int depth) {
    rep2(i, pre, v.size()) {
        if (v[i].first == pre) {
            rep(j, depth) cout << '.';
            cout << v[i].second << endl;
            dfs(i + 1, depth + 1);
        }
    }
}

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

    cin >> N;
    rep(i, N) {
        int k;
        string s;
        cin >> k >> s;
        v.emplace_back(k, s);
    }

    dfs(0, 0);
}

Measured memory_bytes: 3424
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
using namespace std;

int main() {
  int N;
  cin >> N;
  int A[N];
  int cnt[N];
  fill(cnt, cnt + N, 0);

  for (int i = 1; i < N; ++i) {
    cin >> A[i];
    ++cnt[A[i] - 1];
  }

  for (int i = 0; i < N; ++i) {
    cout << cnt[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 5184
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define umap unordered_map
#define uset unordered_set
#define frw(i, a, b) for(int i = a; i < b; i++)
#define bck(i, a, b) for(int i = a; i > b; i--)
#define fi first
#define se second
#define pub push_back
#define in insert
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) int(a.size())
#define pii pair<int, int>
#define pll pair<ll, ll>
#define plll pair<ll, pll>
#define vpll vector<pll>
#define vpii vector<pii>

const int N = 1e5 + 5;

int n, w;
vector<vll> dp;
vll wt, val;

ll rec(int n, int w){
	if(n == 0)	return 0;
	ll &aux = dp[n][w];
	if(aux != -1)	return aux;
	aux = 0;
	if(wt[n] <= w)	aux = val[n] + rec(n - 1, w - wt[n]);
	aux = max(aux, rec(n - 1, w));
	return aux;
}

int main(){
	ios::sync_with_stdio(0);
	cin >> n >> w;
	dp.assign(n + 1, vll (N, -1));
	wt.assign(n + 1, 0);
	val.assign(n + 1, 0);
	frw(i, 1, n + 1)	cin >> wt[i] >> val[i];
	cout << rec(n, w);
}

Measured memory_bytes: 80752
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 1000000000;
const long long int llINF = 1000000000000000000;

using namespace std;
using ll = long long int;
using vv = vector<vector<ll>>;
using edge = struct {
  int to;
  int cost;
};
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end());
#define MIN(vec) *std::min_element(vec.begin(), vec.end());
#define BIT(n, num) std::bitset<(n)>((num)).to_string()
#define REV(T) greater<T>()

vector<ll> divisor(ll n) {
  vector<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n)
        ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

map<ll, int> prime_factor(ll n) {
  map<ll, int> ret;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1)
    ret[n] = 1;
  return ret;
}

ll factorial(int n) {
  ll ans = 1;
  for (int i = 2; i <= n; i++) {
    ans *= i;
    ans %= MOD;
  }
  return ans;
}
ll P(int n, int m) {
  ll ans = 1;
  for (int i = m + 1; i <= n; i++) {
    ans *= i;
    ans %= MOD;
  }
  return ans;
}
ll power(int n, int m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = power(n, m / 2);
    return (tmp * tmp) % MOD;
  } else {
    return (n * power(n, m - 1)) % MOD;
  }
}
ll C(int n, int m) {
  return (P(n, n - m) * power(factorial(m), MOD - 2)) % MOD;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
  ll N;
  vector<ll> H;
  cin >> N;
  REP(i, N) {
    ll h;
    cin >> h;
    H.push_back(h);
  }
  ll ans = 0;
  while (true) {
    bool ok = true;
    REP(i, N) {
      if (H[i] > 0) {
        H[i]--;
        ok = false;
      } else if (!ok) {
        break;
      }
    }
    if (ok)
      break;
    ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <map>
#include <string.h>
#include <cstring>
 
using namespace std;
long long digit(long long n){
    long long ans=0;
    while(n>0){
        n/=10;
        ans++;
    }
    return ans;
}

int main() {
    string s;
    cin >> s;
    if(s=="ARC") cout << "ABC" << endl;
    else cout << "ARC" << endl;
    return 0;
}


Measured memory_bytes: 3628
#include<iostream>

#include <vector>
#include <list>
#include<stack>
#include<queue>
#include<array>

#include <set>
#include<map>

#include<string>
#include<stdlib.h>
#include<memory>

#include<algorithm>
#include <functional>
#include<math.h>

#include<fstream>
#include<iomanip>

using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<<str<<endl

constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7



//メイン関数
int main()
{
	ll D, G;
	vector<pair<ll, ll>> pc;
	cin >> D >> G;
	REP(i, D)
	{
		ll a, b;
		cin >> a >> b;
		pc.push_back({a,b});
	}

	vector<int> per;
	REP(i, D)per.push_back(i);
	int res = 9999999;
	do
	{
		int cnt = 0;
		ll score = 0;
		REP(i, D)
		{
			int pid = per[i];
			ll p = pc[pid].first;
			ll c = pc[pid].second;
			ll once = 100 * (pid + 1);
			ll adder = p * once;
			if(score + adder >= G)
			{
				ld left = G - score;
				cnt += ceil(left/once);
				break;
			}
			if(score + adder + c >= G){
				cnt+=p;
				break;
			}
			score+=adder+c;
			cnt+=p;
		}
		res = min(res,cnt);
	} while(next_permutation(per.begin(), per.end()));
	cout<<res<<endl;
	return 0;
}


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

int main() {
    
	int n, m;
	cin >> n >> m;
	int adj[n+1];
	memset(adj, 0, sizeof adj);
	for (int i=0; i<m; i++) {
		int a, b;
		cin >> a >> b;
		adj[a]++; adj[b]++;
	}
	for (int i=1; i<=n; i++) cout << adj[i] << endl;
	
    
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = INF+7;
const ll LINF = 1e18;
#define rep(i,N) for(int (i)=0;(i)<(N);++(i))
#define rrep(i,N) for(int (i)=(N-1);(i)>0;--i)
#define FOR(i,j,N) for(int (i)=(j);(i)<(N);++(i))
#define put(n) cout<<(n)<<endl;
#define VI vector<int>
#define VII vector<vector<int>>
#define all(v) v.begin(),v.end()
#define MP make_pair
#define pb(n) push_back(n)


int main(){
    string s;
    cin>>s;
    rep(i,s.size()){
        if(s[i] == '1') s[i] = '9';
        else if(s[i] == '9') s[i] = '1';
    }

    cout<<s<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>	
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ld long double
#define pii pair <int, int>
#define sz(a) (int)(a.size()) 
#define resize(v) v.resize(unique(all(v)) - v.begin()); 
#define all(a) a.begin(), a.end()
#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)
#define int long long 

// random_device rd; mt19937 g(rd());    
                                        	
using namespace std;
using namespace __gnu_pbds;
 
void Fast_Read_Out()
{
    ios_base::sync_with_stdio(0);
    cin.tie(), cout.tie();
}
 
void Random()
{
    unsigned int seed;                                                                        
    asm("rdtsc" : "=A" (seed));
    srand(seed);        
}
 
unsigned int Time()
{
     unsigned int time = clock() / 1000.00;                           
     return time;
}

template <typename T> using ordered_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>; 
 
const int mod = (int)1e9 + 7;
const int N = (int)2e5 + 123;

int n;
int ans;
int a[N], b[N];
vector <int> v;

main ()
{
	#ifdef JUDGE
		freopen("input.txt", "r", stdin);
	#endif		
	Fast_Read_Out();
	Random();
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> a[i];
	for(int j = 1; j <= n; j++) cin >> b[j];
	for(int k = 0; k <= 29; k++)
	{
		v.clear();
		int cur = 0;
		for(int i = 1; i <= n; i++) v.pb(b[i] % (1ll << (k + 1)));
		sort(all(v));
		for(int i = 1; i <= n; i++)
		{
			int what = a[i] % (1ll << (k + 1));
			int l1 = lower_bound(all(v), (1ll << k) - what) - v.begin() + 1;
			int r1 = lower_bound(all(v), (1ll << (k + 1)) - what) - v.begin() + 1;
			int l2 = lower_bound(all(v), 3 * (1ll << k) - what) - v.begin() + 1;
			int r2 = lower_bound(all(v), (1ll << (k + 2)) - what) - v.begin() + 1;
			cur += r1 - l1 + 1;
			cur += r2 - l2 + 1;				
		}
		if(cur & 1) ans += (1 << k);
	}
	cout << ans;
}      

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

void abccount(int list[], char str[]) {
  int l = strlen(str);
  int i;
  for (i = 0; i < l; i++) {
    list[str[i]-'a'] = 1;
  }
  return;
}

int check(int list1[], int list2[]) {
  int i;
  int cnt = 0;
  for (i = 0; i < 26; i++) {
    if (list1[i] == 1 && list2[i] == 1) {
      cnt++;
    }
  }
  return cnt;
}

int main() {
  int n;
  char str[101];
  int max = -1;
  scanf("%d", &n);
  scanf("%s", str);

  int i;
  for (i = 1; i < n; i++) {
    char str1[100], str2[100];
    strncpy(str1, str, i);
    str1[i] = '\0';
    strcpy(str2, str+i);

    int Alist[30] = {}, Blist[30] = {};
    abccount(Alist, str1);
    abccount(Blist, str2);

    int x = check(Alist, Blist);

    if (x > max) {
      max = x;
    }
  }

  printf("%d\n", max);
  return 0;
}


Measured memory_bytes: 128
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author ExplodingFreeze
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
#define int long long
#define f(i,a,b) for(int i=(a);i<(b);i++)
const int MOD=1e9+7;
using pii=std::pair<int,int>;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); <-- PUT IN main()/solve()!

using namespace std;

int n;
string s;
class BEcho {
public:
	void solve(std::istream& in, std::ostream& out) {
		in >> n >> s;
		if(n&1)
		{
			out << "No\n";
			return;
		}
		f(i,0,n/2)
			if(s[i]!=s[n/2+i])
			{
				out << "No\n";
				return;
			}
			out << "Yes\n";
	}
};


int32_t main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	BEcho solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

typedef long double ld;
typedef pair <ld, ld> pt;

#define x first
#define y second

const int MAXN = 2e5 + 5;

int N;
ld a[MAXN], b[MAXN];
ld p[MAXN], s[MAXN];
pt t[MAXN];

void load() {
	scanf("%d", &N);
	for (int i = 0; i < N; i++)
		scanf("%Lf", a + i);
	for (int i = 0; i < N; i++)
		scanf("%Lf", b + i);
}

pt operator -(pt A, pt B) {
	return {A.x - B.x, A.y - B.y};
}

ld cross(pt A, pt B) {
	return A.y * B.x - B.y * A.x;
}

bool ccw(pt A, pt B, pt C) {
	return cross(B - A, C - A) < 0;
}

ld solve() {
	int pos = max_element(a, a + N) - a;
	rotate(a, a + pos, a + N);
	rotate(b, b + pos, b + N);
	a[N] = a[0];
	b[N] = b[0];
	for (int i = 0; i <= N; i++) {
		p[i + 1] = p[i] + b[i];
		s[i + 1] = s[i] + i * b[i];
		t[i] = {i, s[i] - i * p[i] + a[i] / 2};
	}
	
	ld area = 0;
	vector <pt> hull = {{0, 0}};
	for (int i = 0; i <= N; i++) {
		for (; hull.size() > 1 && ccw(hull[(int)hull.size() - 2], hull.back(), t[i]); hull.pop_back()) 
			area -= cross(hull[(int)hull.size() - 2], hull.back());
		area += cross(hull.back(), t[i]);
		hull.push_back(t[i]);
	}
	
	ld sol = area - N * (s[N] - a[N] / 2);
	for (int i = 0; i < N; i++)
		sol += b[i] * i * i;
	
	return sol / N;
}

int main() {
	load();
	printf("%.15Lf\n", solve());
	return 0;
}

Measured memory_bytes: 30296
#include<stdio.h>
#include<math.h>

void judge(int*, int*, int*, int*);

int main(void) {
    int d, w, h, n, r;
    int i, j;
    
    while(1) {
        scanf("%d %d %d", &d, &w, &h);
        
        if(d==0&&w==0&&h==0) break;
        
        scanf("%d", &n);

        for(i=0; i<n; i++) {
            scanf("%d", &r);
            judge(&d, &w, &h, &r);
        }
    }
    
    return 0;
}

void judge(int *d, int *w, int *h, int *r) {
    if(pow(*d,2)+pow(*w,2) < pow(*r*2,2)) printf("OK\n");
    else if(pow(*w,2)+pow(*h,2) < pow(*r*2,2)) printf("OK\n");
    else if(pow(*h,2)+pow(*d,2) < pow(*r*2,2)) printf("OK\n");
    else printf("NA\n");
}

Measured memory_bytes: 580
#include<stdio.h>

int main(void) {
   int n, r;
   scanf("%d %d",&n, &r);

   int diff = 0;
   int rate = 0;
   if(n < 10) {
      diff = 100 * (10 - n);
      rate = r + diff;
   } else {
      rate = r;
   }

   printf("%d\n",rate);

   return 0;
}


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

#define taskname ""
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define for0(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex <ld> cd;
typedef vector <cd> vcd;
typedef vector <int> vi;

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

const int maxN = 1e5 + 1;

int n;
int h[maxN];

int dp[maxN];

int ABS(int x)
{
    return x > 0 ? x : -x;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n;
    for1(i, n)
    {
        cin >> h[i];
    }
    dp[1] = 0;
    fore(i, 2, n)
    {
        dp[i] = dp[i - 1] + ABS(h[i] - h[i - 1]);
        if (i > 2)
        {
            dp[i] = min(dp[i], dp[i - 2] + ABS(h[i] - h[i - 2]));
        }
    }
    cout << dp[n];
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>

using namespace std;

#define int long long

const int N  = 2e5 + 7;
const int MOD = 998244353;

int add(int a, int b) {
	return (a + b) % MOD;
}

int sub(int a, int b) {
	return (a - b + MOD) % MOD; 
}

int mul(int a, int b) {
	return (a * b) % MOD;
}

int pw[N];

void init() {
	pw[0] = 1;
	for (int i = 1; i < N; i++) {
		pw[i] = mul(pw[i - 1], 2);
	}
}

int cnt_bad(vector<int> p) {
	int ans = 0;
	for (auto t : p) {
		ans = add(ans, pw[t] - 1);
	}
	for (int i = 0; i < 4; i++) {
		int c = pw[p[i] + p[(i + 1) % 4]];
		c = sub(c, pw[p[i]]);
		c = sub(c, pw[p[(i + 1) % 4]]);
		c = add(c, 1);
		ans = add(ans, c);
	}
	return ans;
}

struct Fenw {
	int n;
	vector<int> f;

	void add(int x, int c) {
		for (int i = x; i < n; i = i | (i + 1)) {
			f[i] += c;
		}
	}

	int sum(int x) {
		int ans = 0;
		for (int i = x; i >= 0; i = (i & (i + 1)) - 1) {
			ans += f[i];
		}
		return ans;
	}

	Fenw(int n_) {
		n = n_;
		f.resize(n);
	}
};

void zip(vector<int> &a) {
	vector<int> sn = a;
	sort(sn.begin(), sn.end());
	sn.resize(unique(sn.begin(), sn.end()) - sn.begin());
	for (auto &t : a) {
		t = lower_bound(sn.begin(), sn.end(), t) - sn.begin();
	}
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	init();
	int n;
	cin >> n;
	vector<int> x(n);
	vector<int> y(n);
	for (int i = 0; i < n; i++) {
		cin >> x[i] >> y[i];
	}
	zip(x);
	zip(y);
	vector<int> ind(n);
	iota(ind.begin(), ind.end(), 0);
	sort(ind.begin(), ind.end(), [&](int i, int j) {
		return x[i] < x[j];
	});
	Fenw lp(n);
	Fenw rp(n);
	for (auto t : ind) {
		rp.add(y[t], 1);
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (i > 0) lp.add(y[ind[i - 1]], 1);
		rp.add(y[ind[i]], -1);
		vector<int> p(4);
		p[1] = lp.sum(y[ind[i]]);
		p[0] = i - p[1];
		p[2] = rp.sum(y[ind[i]]);
		p[3] = (n - i - 1) - p[2];
		{
			int all = sub(pw[n], 1);
			int none = cnt_bad(p);
			all = sub(all, none);
			ans = add(ans, all);
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 9700
while 0<n=gets.to_i
p [m=(1..n).map{gets.chars}<<[i=0]*(n+1),m.transpose,m.map{|l|l.rotate(i+=1)},m.map{|l|l.rotate(i-=1)}].map{|a|(a.transpose*"").scan(/1+/).map(&:size).max||0}.max
end

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

using namespace std;

void solve(){
    string S; cin >> S;
    string res;
    if(S=="Sunny") res="Cloudy";
    if(S=="Cloudy") res="Rainy";
    if(S=="Rainy") res="Sunny";

    cout << res << endl;
}

int main(){
    solve();
}

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

#define REP(i, n) for (int i=0; i<n; i++)
#define print(x) cout << x << endl

typedef long long ll;

using namespace std;

void solve() {
    ll N;
    cin >> N;

    ll ans = 1001001001001;
    for (ll i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            ll a = N / i;
            ans = min(ans, a + i - 2);
        }
    }
    print(ans);
}

signed main() {
    solve();
}


Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
inline int read(){
	int f=1,ans=0;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){ans=ans*10+c-'0';c=getchar();}
	return f*ans;
}
const int MAXN=200001;
int n,x,N,a[MAXN],vis[MAXN];
int main(){
	n=read(),x=read();N=2*n-1;
	if(x==1||x==N) {printf("No\n");return 0;}
	a[(N+1)>>1]=x,a[((N+1)>>1)-1]=x+1,a[((N+1)>>1)+1]=x-1;
	vis[x]=vis[x+1]=vis[x-1]=1;
	if(n==2&&x==2){printf("Yes\n1\n2\n3\n");return 0;}
	if(x+2<=N){
		if(((N+1)>>1)+2<=N) a[((N+1)>>1)+2]=x+2,vis[x+2]=1;
		int num=1;
		for(int i=1;i<=N;i++){
			if(a[i]) continue;
			while(vis[num]) num++;
			a[i]=num;vis[num]=1;
		}printf("Yes\n");
		for(int i=1;i<=N;i++) printf("%d\n",a[i]);
		return 0;
	}
	if(x-2>=1){
		if(((N+1)>>1)-2>=1) a[((N+1)>>1)-2]=x-2,vis[x-2]=1;
		int num=1;
		for(int i=1;i<=N;i++){
			if(a[i]) continue;
			while(vis[num]) num++;
			a[i]=num;vis[num]=1;
		}printf("Yes\n");
		for(int i=1;i<=N;i++) printf("%d\n",a[i]);
		return 0;
	}
	return 0;
}

Measured memory_bytes: 3072
#include<bits/stdc++.h>
using namespace std;
 
#define pii pair<int,int>
#define pll pair<ll,ll>
#define eb emplace_back
#define ll long long
#define nl '\n'
#define in() ( { int a ; scanf("%d",&a); a; } )
 
const int N = 3e5 + 9;
const int mod = 1e9 + 7;
//int dx[]={1,0,-1,0,1,-1,-1,1};
//int dy[]={0,1,0,-1,1,1,-1,-1};

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n, k, d, i, o;
    cin >> n >> k;
    vector<int> chk(n+1, 0);
    while(k--){
        cin >> d;
        while(d--){
            cin >> o;
            chk[o]++;
        }
    }
    int cnt = 0;
    for(i = 1; i <= n; i++){
        if(!chk[i]){
            cnt++;
        }
    }
    cout << cnt << nl;
}

Measured memory_bytes: 3668
from sys import stdin
M, D = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
for i in range(1, M+1):
    for j in range(1, D+1):
        d1 = int(j%10)
        d10 = int(j/10)
        if d1 >= 2 and d10 >= 2 and d1*d10 == i:
            ans += 1
print(ans)


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

using namespace std;

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

    int M, D;
    cin >> M >> D;
    int ans = 0;
    for (int i = 1; i <= M; ++i) {
        for (int j = 22; j <= D; ++j) {
            int d_10 = j / 10;
            int d_1 = j % 10;
            if (d_1 >= 2 && d_10 * d_1 == i) ++ans;
        }
    }
    cout << ans << '\n';
}

Measured memory_bytes: 256
package main

import (
  "fmt"
)

func main() {
  var (
    n,k int
    d int
    tmp int
    res int
  )
  fmt.Scan(&n)
  fmt.Scan(&k)
  ans := make([]int, n)

  for i:=0; i<k; i++ {
    fmt.Scan(&d)
    for j:=0; j<d; j++ {
      fmt.Scan(&tmp)
      ans[tmp-1] = 1
    }
  }
  for _, x := range ans {
    res += x
  }
  fmt.Println(n-res)
}


Measured memory_bytes: 2332
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Globalization;
using System.Diagnostics;
using static System.Console;
//using System.Numerics;
//using static System.Math;

class Program
{
    static void Main()
    {
        SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;


    void solve()
    {
        eratos(100000);
        int Q = cin.nextint;
        var L = new List<int>();
        foreach (var item in prime)
        {
            if (is_prime[item] && is_prime[(item + 1) / 2])
            {
                L.Add(item);
            }
        }
        var A = L.ToArray();
        for (int i = 0; i < Q; i++)
        {
            WriteLine(-lower_bound(A, cin.nextint) + upper_bound(A, cin.nextint));
        }
    }
    
    int lower_bound(int[] arr, int val)
    {
        int low = 0, high = arr.Count();
        int mid;

        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (arr[mid] < val) low = mid + 1;
            else high = mid;
        }
        return low;
    }
    int upper_bound(int[] arr, int val)
    {
        int low = 0, high = arr.Count();
        int mid;

        while (low < high)
        {
            mid = ((high - low) >> 1) + low;
            if (arr[mid] <= val) low = mid + 1;
            else high = mid;
        }
        return low;
    }
    List<int> prime;
    bool[] is_prime;
    void eratos(int n)
    {
        prime = new List<int>();
        is_prime = new bool[n + 1];
        for (int i = 0; i <= n; i++) is_prime[i] = true;
        is_prime[0] = is_prime[1] = false;
        for (int i = 0; i <= n; i++)
        {
            if (is_prime[i])
            {
                prime.Add(i);
                for (int j = 2 * i; j <= n; j += i) is_prime[j] = false;
            }
        }
    }
}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

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

int main(void) {
    int i, N, o, z;
    char S[100010];
    scanf("%s", &S);
    N = strlen(S);
    
    o = 0;
    z = 0;
    for (i=0;i<N;i++) {
        if (S[i] == '1') o++;
        else z++;
    }
    if (z<o) printf("%d\n", 2*z);
    else printf("%d\n", 2*o);

    return 0;
}

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

using namespace std;

typedef long long int ll;
typedef pair<int, int> P;
#define INF 10000000000000
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
template<class T>bool chmax(T & a, const T & b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

int main()
{
	int N;
	vector<int> L;
	int count = 0;

	cin >> N;
	rep(i, N)
	{
		int tmp;
		cin >> tmp;
		L.push_back(tmp);
	}

	sort(L.begin(), L.end());

	for (int i = N - 1; i >= 0; i--)
	{
		for (int j = i - 1; j >= 0; j--)
		{
			auto ret = lower_bound(L.begin(), L.end(), L[i] + L[j]);
			int length = distance(ret, L.end());
			count += (N - 1 - i) - length;
		}
	}

	cout << count << endl;

	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<ll> sum(n + 1);
  for (int i = 0; i < n; ++i) {
    sum[i + 1] = sum[i] + a[i];
    sum[i + 1] %= MOD;
  }
  ll ans = 0;
  for (int i = 1; i < n; ++i) {
    ll res = (sum[n] - sum[i] + MOD) % MOD;
    res = (res * a[i - 1]) % MOD;
    ans = (ans + res) % MOD;
  }
  cout << ans << endl;
  return 0;
}

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

#define MAX 100

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

    bool can = true;
    rep(i,n){
        int a;
        cin >> a;

        if(a % 2 == 0 && a % 3 != 0 && a % 5 != 0){
            can = false;
            break;
        }
    }

    if(can) cout << "APPROVED" << endl;
    else cout << "DENIED" << endl;

    return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	S := getStdin()
	T := getStdin()

	flag := true
	for i := 0; i < len(S); i++ {
		if S[i] != T[i] {
			flag = false
			break
		}
	}

	if flag {
		fmt.Printf("Yes\n")
	} else {
		fmt.Printf("No\n")
	}
}

func getStdin() string {
	sc.Scan()
	return sc.Text()
}
func getStdinInt() int {
	sc.Scan()
	rtn, _ := strconv.Atoi(sc.Text())
	return rtn
}
func getStdinInt64() int64 {
	sc.Scan()
	rtn, _ := strconv.ParseInt(sc.Text(), 10, 64)
	return rtn
}
func getStdinIntArr() []int {
	sc.Scan()
	str := sc.Text()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	sc.Scan()
	str := sc.Text()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}


Measured memory_bytes: 1760
#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int maxn = 1e6 + 5;
const ll mod = 1e9 + 7;
const ll inf=0x3f3f3f3f;
const ld pi=acos(-1.0);
ll n,k;
string s;
string haha(){
    while(n>0){
        ll m=n%26;
        if(m==0)m=26;
        s=(char)(m+'a'-1)+s;
        n=(n-m)/26;
    }
    return s;
}
void run(){
    cin>>n;
    cout<<haha()<<'\n';
}

int main(){
#ifdef haosao
freopen("main.h", "r", stdin);
#endif
    std::ios::sync_with_stdio(false);
    run();
    return 0;
}


Measured memory_bytes: 3668
def calculate_num_of_divisor(N):
    yakusuu = []
    for i in range(1, N+1):
        if N % i == 0:
            yakusuu.append(i)
    return len(yakusuu)

N = int(input())
count = []
for i in range(N+1):
    if i % 2 == 1 and calculate_num_of_divisor(i) == 8:
        count.append(i)
print(len(count))

Measured memory_bytes: 3060
#include "bits/stdc++.h"
#define ll long long
using namespace std;

string rot(string s) {
  ll e=s.size();
  string f=s;
  for(ll i=0;i<e;i++) {
    f.at(i)=s.at((i+e-1)%e);
  }
  return f;
}

int main() {
  string s,t;
  cin>>s>>t;
  int ans=0;
  for(int i=0;i<100;i++) {
    if(rot(s)==t) {
      cout<<"Yes"<<endl;
      return 0;
    }
    s=rot(s);
  }
  cout<<"No"<<endl;
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func main() {
	sc.Split(bufio.ScanWords)
	a, b := nextInt(), nextInt()
	ans := ((b-a)*(b-a-1))/2 - a
	fmt.Println(ans)
}


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

int map[25];

int index_xy(int x, int y) {
    return y * 5 + x;
}

int map_xy(int x, int y) {
    return map[index_xy(x, y)];
}

bool is_rect_ok(int x, int y, int w, int h) {
    for (int ix=x; ix<x+w; ix++) {
        for (int iy=y; iy<y+h; iy++) {
            if (!map_xy(ix, iy)) {
                return false;
            }
        }
    }
    return true;
}

void process_map() {
    for (int i=0; i<25; i++) {
        cin >> map[i];
    }
    
    int max_rect=1;
    
    for (int ix=0; ix<5; ix++) {
        for (int iy=0; iy<5; iy++) {
            for (int jw=1; ix+jw<=5; jw++) {
                for (int jh=1; iy+jh<=5; jh++) {
                    if (jw * jh <= max_rect) { continue; }
                    if (is_rect_ok(ix,iy,jw,jh)) { max_rect = jw * jh; }
                }
            }
        }
    }
    
    cout << max_rect << endl;
}

int main(void){
    int m;
    cin >> m;
    for (int i=0; i<m; i++) {
        process_map();
    }
    return 0;
}

Measured memory_bytes: 1160
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
)

type contest struct {
	in  io.Reader
	out io.Writer
}

func (con *contest) Scan(a ...interface{}) (int, error) {
	return fmt.Fscan(con.in, a...)
}
func (con *contest) Scanln(a ...interface{}) (int, error) {
	return fmt.Fscanln(con.in, a...)
}
func (con *contest) Scanf(f string, a ...interface{}) (int, error) {
	return fmt.Fscanf(con.in, f, a...)
}
func (con *contest) Print(a ...interface{}) (int, error) {
	return fmt.Fprint(con.out, a...)
}
func (con *contest) Println(a ...interface{}) (int, error) {
	return fmt.Fprintln(con.out, a...)
}
func (con *contest) Printf(f string, a ...interface{}) (int, error) {
	return fmt.Fprintf(con.out, f, a...)
}
func main() {
	in := bufio.NewReader(os.Stdin)
	out := bufio.NewWriter(os.Stdout)
	defer out.Flush()
	con := &contest{in: in, out: out}
	con.main()
}

func (con *contest) main() error {
	var s string
	con.Scan(&s)
	con.Println(s[0:5], s[6:13], s[14:19])
	return nil
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[200010], mp[200010];
int main(){
    ll n, k;
    while(cin>>n>>k){
        ll ans=0;
        for(int i=1; i<=n; ++i){
            scanf("%d",a+i);
        }
        int tmp=1;
        vector<int> v;
        int tmp1, tmp2;
        for(ll i=1; i<=k; ++i){
        	tmp=a[tmp];
        	if(mp[tmp]){
        		tmp1=i-mp[tmp];
        		tmp2=mp[tmp]-1;
        		break;
        	}
        	mp[tmp]=i;
        	v.push_back(tmp);
        }
        // for(auto it:v){
        // 	cout<<it<<" ";
        // }
        // cout<<endl;
       	// cout<<tmp1<<" "<<tmp2<<endl;
        --k;
        if(k<v.size()){
        	cout<<v[k]<<endl;
        }
        else{
        	k-=tmp2;
        	k=k%(int)(tmp1);
        	cout<<v[tmp2+k]<<endl;
    	}
    }
  return 0;
}




Measured memory_bytes: 5836
#include <iostream>
#include <algorithm>

int main() {
  int A, B, C ,D;
  std::cin >> A >> B >> C >> D;
  int overlap_time = 0;
  overlap_time = std::min(B, D) - std::max(A, C);
  if (overlap_time < 0) overlap_time = 0;
  std::cout << overlap_time << std::endl;
}

Measured memory_bytes: 888
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <tuple>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include <string.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;
int n;
pair<pair<string, int>, int> p[110];

int gcd(int a, int b) {
    return b != 0 ? gcd(b, a % b) : a;
}

void solve() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        string s;
        int num;
        cin >> s >> num;
        //点数を-1倍することで降順にソート
        p[i] = make_pair(make_pair(s, -num), i);
    }
    sort(p, p+n);
    for (int i = 0; i < n; ++i) {
        cout << p[i].second + 1 << endl;
    }
    return;
}
//逆元を求める関数
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
      fac[i] = fac[i-1] * i % MOD;
      inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
      finv[i] = finv[i-1] * inv[i] % MOD;
    }
}
//組み合わせ
long long COM (int n, int k) {
    if(n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}
int main(int args, char* argv[]) {
    solve();
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << endl; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

#include <functional>
template<typename T>
class SegmentTreeOneAll {
    using Func = function<T(T, T)>;

public:
    vector<T> data;
    int n;
    T init;
    Func update_func;
    Func query_func;
    SegmentTreeOneAll(int _n, T _init, Func up, Func qu) {
        init = _init;
        update_func = up;
        query_func = qu;
        for (n = 1; n < _n; n *= 2)
            ;
        data.resize(2 * n - 1, init);
    }
    void update(int pos, T val) {
        pos += n - 1;
        data[pos] = update_func(data[pos], val);
        while (pos > 0) {
            pos = (pos - 1) / 2;
            data[pos] = query_func(data[2 * pos + 1], data[2 * pos + 2]);
        }
    }
    T query(int l, int r) {
        T resL = init, resR = init;
        for (l += n - 1, r += n - 1; l < r; l = l / 2, r = (r - 1) / 2) {
            if (!(l & 1)) {
                resL = query_func(resL, data[l]);
            }
            if (!(r & 1)) {
                resR = query_func(data[r - 1], resR);
            }
        }
        return query_func(resL, resR);
    }
};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, k;
    cin, n, k;
    vector<int> a(n);
    REP(i, 0, n) {
        cin, a[i];
    }
    const int SZ = 300010;
    auto mx = [&](int x, int y) {
        return max(x, y);
    };
    SegmentTreeOneAll<int> seg(SZ, 0, mx, mx);
    REP(i, 0, n) {
        int l = max(0, a[i] - k);
        int r = min(SZ, a[i] + k + 1);
        int x = seg.query(l, r);
        seg.update(a[i], x + 1);
    }
    print(seg.query(0, SZ));
    return 0;
}


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

int main() {
  int a,b;
  cin >> a >> b;
  if ( a==1 ) a+=13;
  if ( b==1 ) b+=13;
  if ( a>b ) puts("Alice");
  else if ( a==b ) puts("Draw");
  else puts("Bob");
  return 0;
}

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

int main() {
	int a, b;
	cin >> a >> b;
	if (b % 2 == 0 && b >= 2 * a && b <= 4 * a) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}
}

Measured memory_bytes: 3540
#include "bits/stdc++.h"
using namespace std;
typedef pair<int, int> P;
typedef long long ll;
const int MOD = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main(){
  string s, t;
  cin >> s >> t;
  int i = 0;
  if (s[0] == t[0])	i++;
  if (s[1] == t[1])	i++;
  if (s[2] == t[2])	i++;
  cout << i;
}

Measured memory_bytes: 256
//{{{
#include <bits/stdc++.h>
using namespace std;
#define repX(a,b,c,x,...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__,rrep3,rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define rrep2(i,n) rrep3(i,n,0)
#define rrep3(i,begin,end) for(int i=(int)(begin-1),i##_end=(int)(end);i>=i##_end;--i)
#define foreach(x,a) for(auto&x:a)
using ll=long long;
const ll mod=(ll)1e9+7;
//}}}

int main(){
  int A, P;
  cin >> A >> P;
  int ans = (3 * A + P) / 2;
  cout << ans << endl;
  return 0;
}


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

int main(){
    int n, k;
    cin >> n >> k;
    vector<long long> locations(n);
    for (int i=0;i<n;i++){
        cin >> locations[i];
    }
    long long smallest_time;
    long long smaller_time;
    long long left_first, right_first;
    long long leftest, rightest;
    for (int i=0;i<=n-k;i++){
        leftest = locations[i];
        rightest = locations[i+k-1];
        left_first = abs(leftest) + abs(rightest - leftest);
        right_first = abs(rightest) + abs(rightest - leftest);
        smaller_time = min(left_first, right_first);
        if (i == 0){
            smallest_time = smaller_time;
        } else {
            if (smallest_time > smaller_time){
                smallest_time = smaller_time;
            }
        }
    }
    cout << smallest_time << endl;
    return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = 0;
		int y = 0;
		while (true) {
			x = sc.nextInt();
			y = sc.nextInt();
			if (x == 0 && y == 0)
				break;
			if (x < y) {
				System.out.println(x + " " + y);
			} else {
				System.out.println(y + " " + x);
			}
		}
	}
}


Measured memory_bytes: 36152
#include<bits/stdc++.h>
#define ll long long
using  namespace std;
int a[100010];

int main () {
    int n,ok=1;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(a[i]%2==0){
            if(a[i]%3==0||a[i]%5==0){}
            else ok=0;
        }
    }
    cout<<(ok?"APPROVED":"DENIED");

}

Measured memory_bytes: 256
$\=$/;
$L=0,$|=$R=10,$_.=${print("? ",($_.($%=$L+$R>>1))*1e9),<>=~Y?$R:$L=$%while$R-$L>1;L}while$i++<9;
#while($i++<9){$L=0,$|=$R=10,print("? ",($_*10+($%=$L+$R>>1))*1e9),<>=~Y?$R:$L=$%while$R-$L>1;$_.=$L}
print"? ",++$_+s/0*$//;
print"? ",($_.=0)+1while<>=~(/^9*$/?Y:N);
print"! ",$_

Measured memory_bytes: 852
#include <iostream>
#include <vector>
#include <map>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>
#include <set>
using namespace std;

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,k,n) for(int i=k;i<(int)n;i++)
#define rei(n) for(int i=0;i<(int)n;i++)
#define rel(n) for(int l=0;l<(int)n;l++)
#define al(s) s.begin(),s.end()
#define INT_MAX 2147483647
typedef pair<int, int> pi;
typedef pair<pi, pi> ppi;
typedef pair<int, ppi> pipp;
typedef pair<int, pi> pip;

struct SegTree
{
	int N;
	vector<int> Seg;
	void init(int n)
	{
		N = 1;
		while (N < n)N *= 2;
		for (int i = 0; i < N*2; i++)
		{
			Seg.push_back(INT_MAX);
		}
		
	}
	
	void update(int k, int a)
	{	
		k = k - 1 + N;
		Seg[k] = a;
		while (k > 0)
		{
			k = (k - 1) / 2;
			Seg[k] = min(Seg[2 * k + 1], Seg[2 * k + 2]);
		}
	}
	int find_min(int a, int b)
	{
		return query(a, b, 0, 0, N);
	}

	int query(int a, int b, int k, int l, int r)
	{
		if (r <= a || l >= b)return INT_MAX;
		if (l>=a&&r<=b)
		{
			return Seg[k];
		}
		else
		{
			return min(query(a, b, k * 2 + 1, l, (r + l) / 2),
					   query(a, b, k * 2 + 2, (r + l) / 2, r));
		}
	}
};



int main()
{
	int n, q;
	cin >> n >> q;
	SegTree S;
	S.init(n);
	for (int i = 0; i < q; i++)
	{
		int x, y, a;
		cin >> a;
		cin >> x >> y;

		if (a)
		{
			cout << S.find_min(x, y+1) << endl;
		}
		else
		{
			S.update(x, y);
		}
	}
}

Measured memory_bytes: 2324
#include<bits/stdc++.h>
typedef long long ll;
#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--)
#define ALL(x) x.begin(),x.end()

#define INF (int)1e9 //10^9:∞
#define LLINF (long long)1e12
#define MOD (int)1e9+7 //10^9+7:合同式の法
#define PI 3.141592653589

#define YESNO(T) if(T){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(T) if(T){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(T) if(T){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#define Graph vector<vector<int>>
#define PII pair<int,int>
#define VI vector<int>
#define VVI vector<vector<int>>
#define VPII vector<pair<int,int>>

#define DDD fixed<<setprecision(10)

typedef  long long INT;

typedef long double ld;

using namespace std;
/*........................................Define functions.........................................*/




/*....................................Define global variables .....................................*/

/*.........................................kemkemG0................................................*/
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	/*.........................................kemkemG0.............................................*/

	int N;
	cin>>N;
	set<int> st;
	int red=0;
	REP(i,N){
		int r;cin>>r;
		if(r<400)st.insert(0);
		else if(r<800)st.insert(1);
		else if(r<1200)st.insert(2);
		else if(r<1600)st.insert(3);
		else if(r<2000)st.insert(4);
		else if(r<2400)st.insert(5);
		else if(r<2800)st.insert(6);
		else if(r<3200)st.insert(7);
		else red++;
	}

	int ans=0;
	int ans1=0;

	if(st.size()==0)ans=1;
	else ans=st.size();

	ans1=st.size()+red;
	cout<<ans<<" "<<ans1<<endl;


	return 0;
}




Measured memory_bytes: 3600
#include <stdio.h>
 
int main(){
  int input,A,B;
  
  scanf("%d",&input);
  
  if(input==1){
    printf("Hello World\n");
  }else{
    scanf("%d",&A);
    scanf("%d",&B);
    printf("%d",A+B);
    printf("\n");
  }
  
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()


int main(){
  int N;
  cin >> N;
  vector<int> x(N);
  vector<int> r(N);
  rep(i,0,N - 1){
    cin >> x[i] >> r[i];
  }
  int LL = x[0] - r[0];
  int RR = x[0] + r[0];
  rep(i,1,N - 1){
    LL = max(LL,x[i] - r[i]);
    RR = min(RR,x[i] + r[i]);
  }

  double left = LL;
  double right = RR;

  auto f = [&](double k){
    double MIN = 1e18;
    for(int i = 0;i < N;i++){
      double X = abs(k - x[i]);
      if(X > r[i]) continue;
      MIN = min(MIN , max(0.0,sqrt(1.0 * r[i] * r[i] - X * X)));
    }
    return MIN;
  };
  for(int i = 0;i < 500;i++){
    double x1 = (left * 2 + right) / 3;
    double x2 = (left + right * 2) / 3;
    if(f(x1) < f(x2)){
      left = x1;
    }
    else{
      right = x2;
    }
  }
  cout << fixed << setprecision(10);
  cout << f(left) <<endl;
}



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

int top, S[1000];

void push(int x) {
    S[++top]=x;
}

int pop() {
    return S[top--];
}

int main(void) {
    int a, b;
    char s[100];
    top=0;

    while (scanf("%s", s)!=EOF) {
        if (s[0]=='+') {
            a=pop();
            b=pop();
            push(a+b);
        } else if (s[0]=='-') {
            b=pop();
            a=pop();
            push(a-b);
        } else if (s[0]=='*') {
            a=pop();
            b=pop();
            push(a*b);
        } else {
            push(atoi(s));
        }
    }
    printf("%d\n", S[top]);
    return 0;
}



Measured memory_bytes: 2124
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,sum=0;
  cin>>n;
  int a,b[n+1]={0};
  for(int i=0;i<n-1;i++)
  {  cin>>a;b[a]++;}
  for(int i=0;i<n;i++)
  cout<<b[i+1]<<endl;
    return 0;
}

Measured memory_bytes: 4420
#include <stdio.h>

int main () {
  int i, j, k;
  scanf("%d %d", &i, &j);
  k = i + j;
  if (k == 0) {
    puts("0");
  } else if (k > 0) {
    puts("1");
  } else if (k < 0) {
    puts("-1");
  }
  return 0;
}



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

const ll INF = 1LL << 60;

ll N, D, A;
vector<P> v;
int main() {
    cin >> N >> D >> A;
    v.resize(N);
    rep(i, N) {
        ll x, h;
        cin >> x >> h;
        v[i] = P(x, h);
    }
    sort(v.begin(), v.end());

    queue<P> que;
    D = 2 * D;
    ll ans = 0;
    ll before_damage = 0;

    rep(i, N) {
        ll x2 = v[i].first;
        ll h2 = v[i].second; 

        // 爆風で与えるダメージ
        while (que.size() > 0 && que.front().first < x2) {
            before_damage -= que.front().second;  
            que.pop();
        }

        h2 -= before_damage;

        // 何回必要か
        if (h2 > 0) {
            ll cnt = ceil((double)h2 / A);
            ans += cnt;
            ll damage = cnt * A;
            before_damage += damage;

            que.push(P(x2 + D, damage));
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 7952
n = int(input())
s = input()
q = int(input())
k = list(map(int, input().split()))
for ki in k:
    ans = 0
    DMC = [0]*3
    #for i, c in enumerate(s):
    for i in range(n):
        if s[i] == "D":
            DMC[0] += 1
        elif s[i] == "M":
            DMC[1] += 1
            DMC[2] += DMC[0]
        if i >= ki:
            j = i-ki
            if s[j] == "D":
                DMC[0] -= 1
                DMC[2] -= DMC[1]
            elif s[j] == "M":
                DMC[1] -= 1
        if s[i] == "C":
            ans += DMC[2]
    print(ans)

Measured memory_bytes: 59996
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
typedef long long ll;
/* clang-format off */
#define MOD 1000000007
#define INF 1000000000000000000ll
#define REP(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(a) (a).begin(), (a).end()
//#define __DEBUG__
#ifdef __DEBUG__
#define CH_P(a) cout <<"check_point("<<#a<<")" << "\n";
#define DEBUG(x) cout<<#x<<":"<<x<<"\n"
#define DEBUGS(v) cout << #v << ":";for(auto x:v){cout<<x<<" ";}cout<<"\n"
#endif
#ifndef __DEBUG__
#define CH_P(a) 
#define DEBUG(x) 
#define DEBUGS(v) 
#endif
/* clang-format on */

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string s;
  cin >> s;
  if (s.back() == 's') s += "es";
  else
    s += "s";
  cout << s << endl;
  return 0;
}


Measured memory_bytes: 3644