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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define MOD 1000000007LL

#define rep(i, n) for(ll (i) = 0LL;(i) < (ll)(n);(i)++)
#define rep2(i, s, e) for(ll (i) = (ll)(s);(i) < (ll)(e);(i)++)
#define repi(i, n) for(ll (i) = 0LL;(i) <= (ll)(n);(i)++)
#define repi2(i, s, e) for(ll (i) = (ll)(s);(i) <= (ll)(e);(i)++)
#define per(i, n) for(ll (i) = (ll)(n) - 1LL;(i) >= 0LL;(i)--)
#define per2(i, s, e) for(ll (i) = (ll)(s) - 1LL;(i) >= (ll)(e);(i)--)
#define peri(i, n) for(ll (i) = (ll)(n);(i) >= 0LL;(i)--)
#define peri2(i, s, e) for(ll (i) = (ll)(s);(i) >= (ll)(e);(i)--)
#define iter(i, it) for(auto &(i): (it))

template<typename T, typename U> ostream& operator<<(ostream &s, const pair<T, U> m) {
    cout << "(" << m.first << ", " << m.second << ")";
    return s;
}
template<typename T, typename U> ostream& operator<<(ostream &s, const map<T, U> m) {
    ll c = 0;
    cout << "{ ";
    iter(i, m) cout << i << (c++ == m.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const vector<T> &v) {
    cout << "{ ";
    rep(i, v.size()) cout << v[i] << (i == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}
template<typename T> ostream& operator<<(ostream &s, const list<T> &v) {
    ll c = 0;
    cout << "{ ";
    iter(i, v) cout << i << (c++ == v.size() - 1 ? " " : ", ");
    cout << "}";
    return s;
}

#define MAX 10000001
vector<ll> hurui(MAX);

void prepare() {
    hurui[1] = 1;
    rep2(i, 2, MAX) {
        if(hurui[i] == 0) {
            for(ll j = i;j < MAX;j += i) hurui[j] = i;
        }
    }
}

void factor(ll n, set<ll> &factors) {
    factors.insert(1);
    if(n == 1) return;
    while(true) {
        ll temp = hurui[n];
        factors.insert(temp);
        if(temp == n) break;
        n = n / temp;
    }
}

int main(void) {
    prepare();
    ll N;
    cin >> N;
    vector<ll> Araw(N);
    map<ll, ll> factors;
    rep(i, N) {
        set<ll> factorss;
        cin >> Araw[i];
        factor(Araw[i], factorss);
        iter(j, factorss) {
            if(j != 1) factors[j]++;
        }
    }
    bool flag = true;
    iter(i, factors) {
        if(i.second != 1) flag = false;
    }
    if(flag) {
        cout << "pairwise coprime";
    } else {
        ll gcd = Araw.front();
        rep2(i, 1, N) gcd = __gcd(gcd, Araw[i]);
        if(gcd == 1) cout << "setwise coprime";
        else cout << "not coprime";
    }
    cout << endl;
    return 0;
}


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

#define REPZ(i, z, n) for (decltype(n) i = (z); i <= (n); i++)
#define REP(i, n) for (decltype(n) i = 0; i <= (n); i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(v) ((ll)(v).size())
#define MAX(v) (*max_element(ALL(v)))
#define MIN(v) (*min_element(ALL(v)))
#define INF 1000000000000  // 1E+12

// 略
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define READ cin >>
#define PRINT cout <<
#define PYES cout << "YES" << endl
#define pyes cout << "Yes" << endl
#define POK cout << "OK" << endl
#define PNO cout << "NO" << endl
#define pno cout << "No" << endl
#define PNG cout << "NG" << endl
#define ret return 0

using namespace std;

// デバッグ用
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

// typedef
typedef long long ll;
typedef unsigned long long ul;
typedef long double ld;
typedef pair<ll, ll> pl;

// const
// 円周率
const ld pi = acos(-1);
// mod用
// 1E+9 +7
const ll mod = (int)1e+9 + 7;
// 1s間で可能なループ回数2E+8回
// int        最大値2147483647         〜2E+9
// long long  最大値9223372036854775807〜9E+18
// 総和accumulate
// 単純リストvector<type> push_back
// 連想配列map<key,value> insert,
// 集合set<type>
// pair キーとバリューを格納 firstとsecondでアクセス
// 小数点指定 cout << fixed << setprecision(15) << endl;
// to_string<->stoi
// stoll(longlong)
// stod(double)
// deep copy v1->v2 copy(v1.begin(), v1.end(), back_inserter(v2) );
// 大文字65-90(-32)
// 小文字97-122(+32)
//  priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>
//  ba;
signed main() {
  // faster
  // C言語流の入出力は使用できない
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<ll> a((ll)1e+5 + 1, 0);
  ll sum = 0;
  rep(i, n) {
    ll temp;
    cin >> temp;
    sum +=temp;
    a[temp]++;
  }
  ll q;
  cin >> q;
  rep(i, q) {
    ll b, c;
    cin >> b >> c;
    sum += a[b]*c;
    sum -= a[b]*b;
    a[c] += a[b];
    a[b] = 0;
    cout << sum << endl;
  }
  ret;
}


Measured memory_bytes: 3884
#include <iostream>
#include <cstdio>
#include <climits>
#include <cmath>
#include <vector>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>

typedef long long ll;

using namespace std;

int main(void) {
  int N;
  cin >> N;
  vector<char> S(N);
  for (int i = 0; i < N; i++) cin >> S[i];

  // accum sum
  vector<int> L(N, 0), R(N, 0);
  for (int i = 1; i < N; i++) {
    L[i] = L[i - 1] + (S[i - 1] == 'W' ? 1 : 0);
  }
  for (int i = N - 2; i >= 0; i--) {
    R[i] = R[i + 1] + (S[i + 1] == 'E' ? 1 : 0);
  }

  // for (auto v : L) { cout << v << " "; } cout << endl;
  // for (auto v : R) { cout << v << " "; } cout << endl;

  int ans = INT_MAX;
  for (int i = 0; i < N; i++)
    ans = min(ans, L[i] + R[i]);
  cout << ans << endl;
}


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

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

    ll ans = 0;
    for (int bit = 0; bit < (1 << n - 1); bit++) {
        ll a = s[0] - '0', b = 0;
        for (int i = 1; i < n; i++) {
            if (bit & (1 << i - 1))
                a = a * 10 + s[i] - '0';
            else
                b += a, a = s[i] - '0';
        }
        b += a;
        ans += b;
    }

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


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

int main()
{
  double temp;
  double sum;
  double x1, y1, x2, y2;
  scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
  sum = ((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1));
  temp = sqrt(sum);
  printf("%f\n", temp);
}



Measured memory_bytes: 2140
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
char a[1000007];
int main()
{
	int m;
	scanf("%d",&m);
	scanf("%s",a);
	int i,j;
	int cnt=0;
	int ans=0;
	for(i=0;a[i];i++)
	{
		if(a[i]=='(')
			cnt++;
		else
			cnt--;
		ans=min(ans,cnt);
	}
	for(i=0;i<-ans;i++)
		printf("%c",'(');
	printf("%s",a);
	cnt=0;
	ans=0;
	i=strlen(a)-1;
	for(;i>=0;i--)
	{
		if(a[i]==')')
			cnt++;
		else
			cnt--;
		ans=min(ans,cnt);
	}
	for(i=0;i<-ans;i++)
		printf("%c",')');	
	printf("\n");
	return 0;
}

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

std::string s, t;

int main()
{
    std::cin >> s >> t;

    if (s == t.substr(0, t.size() - 1))
        std::cout << "Yes" << std::endl;
    else
    {
        std::cout << "No" << std::endl;
    }

    return 0;
}

Measured memory_bytes: 3064
def examA():
    N, K = LI()
    ans = 1
    if N%K==0:
        ans = 0
    print(ans)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N; cin >> N;
    double denominator = 0.0;

    for (int i = 0; i < N; i++) {
        double num; cin >> num;
        denominator += 1.0 / num;
    }

    cout << 1 / denominator << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define inf 10e17
#define rep(i,n) for(long long i=0; i<n; i++)
#define repr(i,n,m) for(long long i=m; i<n; i++)
#define mod 1000000007
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<long long>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto&& itr : x) { cerr << (itr) << " "; }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

long long modpow(long long a, long long n, long long m) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }

  return res;
}

int main() {
  ll n,k;
  cin >> n >> k;
  
  vector<ll> cnt(k+1);
  for (ll i = k; i > 0; --i) {
    ll cp = i, total = 0;
    ll tmp = 0;
    do {
      total += 1;
      cp += i;
      if (cp > k) break;
      tmp += cnt[cp];
      tmp %= mod;
    } while (cp <= k);

    cnt[i] += modpow(total, n, mod) + (mod - tmp);
    cnt[i] %= mod;
  }

  auto res = [&k](auto const& cnt) -> ll {
    ll c = 0;
    for (int i = 1; i <= k; ++i) {
      c += cnt[i] * i;
      c %= mod;
    }
    return c;
  };

  cout << res(cnt) << endl;
}

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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A, B;
    cin >> A >> B;
    A--; //A - 1 ~ 0 XOR B ~ 0 を行うため1を引く
    ll zeroToA = 0;
    //0~AまでのXOR
    if (A % 4 == 1 || A % 4 == 2)
    {
        zeroToA += 1;
    }
    ll kisuu = 2; //基数
    while (kisuu <= A)
    {
        ll bitCount = max((ll)0, (A % (kisuu * 2)) - (kisuu - 1));
        if (bitCount % 2)
        {
            zeroToA += kisuu;
        }
        kisuu *= 2;
    }
    ll zeroToB = 0;
    //0~BまでのXOR
    if (B % 4 == 1 || B % 4 == 2)
    {
        zeroToB += 1;
    }
    kisuu = 2;
    while (kisuu <= B)
    {
        ll bitCount = max((ll)0, (B % (kisuu * 2)) - (kisuu - 1));
        if (bitCount % 2)
        {
            zeroToB += kisuu;
        }
        kisuu *= 2;
    }
    ll answer = zeroToA ^ zeroToB;
    cout << answer << endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
a = []
a = list(map(int,input().split()))

b = [0]*N
for i in reversed(range(N)):
    j = i + 1
    buf = b[i::j]
    if (sum(buf) % 2) != a[i]:
        b[i] = 1
print(sum(b))
bb = [i+1 for i in range(N) if b[i] == 1]
if sum(b) != 0:
    print(' '.join(map(str, bb)))

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

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	int R=in(),G=in(),B=in(),N=in();
	int maxR=N/R;
	int sum = 0;
	for(int r=0;r<=maxR;r++){
		int maxG = (N-r*R)/G;
		for(int g=0;g<=maxG;g++){
			int b = N-r*R-g*G;
			if(b>=0 && !(b%B)) sum++;
		}
	}
	
	out(sum);
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<queue>
#include<cmath>
using namespace std;
const int MAXN = 100000;
int BLOCK;
struct node
{
	int to,co,ct;
	node(){}
	node(int xx,int yy,int zz)
	{
		to=xx,co=yy,ct=zz;
	}
};
vector<node>g[MAXN];
void addedge(int u, int v, int c, int d) {
	g[u].push_back(node(v,c,d));
	g[v].push_back(node(u,c,d));
}
int clr[MAXN + 5], dis[MAXN + 5];
int fa[MAXN + 5][20], dep[MAXN + 5];
int dfn[2*MAXN + 5], fir[MAXN + 5], bac[MAXN + 5], dcnt = 0;
void dfs(int x, int pre) {
	dfn[++dcnt] = x, fir[x] = dcnt;
	fa[x][0] = pre, dep[x] = dep[pre] + 1;
	for(int i=1;i<20;i++)
		fa[x][i] = fa[fa[x][i-1]][i-1];
	for(int i=0;i<g[x].size();i++)
	{
		int v=g[x][i].to;
		if( v != pre ) {
			dfs(v, x);
			clr[v] = g[x][i].co, dis[v] = g[x][i].ct;
		}
	}
	dfn[++dcnt] = x, bac[x] = dcnt;
}
int lca(int u, int v) {
	if( dep[u] < dep[v] ) swap(u, v);
	for(int i=19;i>=0;i--)
		if( dep[fa[u][i]] >= dep[v] )
			u = fa[u][i];
	if( u == v ) return u;
	for(int i=19;i>=0;i--)
		if( fa[u][i] != fa[v][i] )
			u = fa[u][i], v = fa[v][i];
	return fa[u][0];
}
struct query{
	int le, ri, num;
	int x, y;
}qry[MAXN + 5];
bool operator < (query a, query b) {
	return (a.le/BLOCK == b.le/BLOCK) ? a.ri < b.ri : a.le < b.le;
}
int nwres, cnt[MAXN + 5], tag[MAXN + 5];
int sum[MAXN + 5], ans[MAXN + 5];
void update(int x) {
	int y = dfn[x];
	if( tag[y] )
		cnt[clr[y]]--, sum[clr[y]] -= dis[y], nwres -= dis[y];
	else cnt[clr[y]]++, sum[clr[y]] += dis[y], nwres += dis[y];
	tag[y] ^= 1;
}
int main() {
	int N, Q; scanf("%d%d", &N, &Q);
	for(int i=1;i<N;i++) {
		int a, b, c, d; scanf("%d%d%d%d", &a, &b, &c, &d);
		addedge(a, b, c, d);
	}
	dfs(1, 0);
	BLOCK=sqrt(N);
	for(int i=1;i<=Q;i++) {
		int x, y, u, v; scanf("%d%d%d%d", &x, &y, &u, &v);
		int l = lca(u, v);
		if( l == u || l == v ) {
			if( l == v ) swap(u, v);
			qry[i].le = fir[u] + 1, qry[i].ri = fir[v];
		}
		else {
			if( fir[u] > fir[v] ) swap(u, v);
			qry[i].le = bac[u], qry[i].ri = fir[v];
		}
		qry[i].num = i, qry[i].x = x, qry[i].y = y;
	}
	sort(qry + 1, qry + Q + 1);
	int l = 1, r = 0;
	for(int i=1;i<=Q;i++) {
		while( l > qry[i].le ) update(--l);
		while( r < qry[i].ri ) update(++r);
		while( l < qry[i].le ) update(l++);
		while( r > qry[i].ri ) update(r--);
		ans[qry[i].num] = nwres - sum[qry[i].x] + cnt[qry[i].x]*qry[i].y;
	}
	for(int i=1;i<=Q;i++)
		printf("%d\n", ans[i]);
}


Measured memory_bytes: 27136
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> pp;
const int INF = 1e9;
const int MOD = 1000000007;
int n = 200005;
vector<vector<int>> tree(n,vector<int>());
vector<int> ans(n,0);

void dfs(int i,int before,int cnt = 0){
        ans[i] += cnt;
        for(int j:tree[i]){
                if(j == before) continue;
                dfs(j,i,ans[i]);
        }
}
 
int main(){
        int q;
        cin >> n >> q;
        rep(i,n-1){
                int a,b;
                cin >> a >> b;
                --a;--b;
                tree[a].push_back(b);
                tree[b].push_back(a);
        }

        rep(i,q){
                int p,x;
                cin >> p >> x;
                --p;
                ans[p] += x;
        }

        dfs(0,-1);

        rep(i,n) cout << ans[i] << " ";
        cout << endl;


        return 0;
}






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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector< vector<long long> > count(10, vector<long long>(10, 0));
  for (int i = 1; i <= n; ++i) {
  	int start_d = i, end_d = i % 10;
    while (start_d >= 10) start_d /= 10;
    if (start_d && end_d) ++count[start_d][end_d];
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    int start_d = i, end_d = i % 10;
    while (start_d >= 10) start_d /= 10;
    ans += count[end_d][start_d];
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <map>
#include <set>
#include <list>
#include <unordered_set>
#include <unordered_map>
#include <stdlib.h>

using namespace std;
 
typedef long long i64;
typedef pair<i64, i64> P;

template<class T>
const T INF = numeric_limits<T>::max();
template<class T>
const T SINF = numeric_limits<T>::max() / 10;
static const i64 MOD = 1000000007;

//int dx[4] = {0,1,0,-1}, dy[4] = {-1,0,1,0};
//int dx[5] = {-1,0,0,0,1}, dy[5] = {0,-1,0,1,0};
//int dx[8] = {-1,0,1,1,1,0,-1,-1}, dy[8] = {1,1,1,0,-1,-1,-1,0};
//int dx[9] = {-1,0,1,1,1,0,-1,-1,0}, dy[9] = {1,1,1,0,-1,-1,-1,0,0};

struct edge {
	i64 from, to, cost;
	edge(i64 to, i64 cost) : from(-1), to(to), cost(cost) {}
	edge(i64 src, i64 to, i64 cost) : from(src), to(to), cost(cost) {}
};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
	return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
	for(auto &e:t) fill_v(e,v);
}

//-----end of template-----//

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int a, b;
	cin >> a >> b;
	int ha = 0;
	int hb = 1;
	for(int i = 1; i < 1000; ++i){
		ha += i;
		hb += i + 1;
		if(ha - a == hb - b){
			cout << ha - a << endl;
			return 0;
		}
	}
}

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

const int nm = 1e5;
int n, m, q, x[11][nm], v[nm], d[nm], c[nm];
vector<int> g[nm];

void f(int v, int d, int c) {
	if (x[d][v] > 0)
		return;
	x[d][v] = c;
	if (!d)
		return;
	f(v, d - 1, c);
	for (int nv : g[v])
		f(nv, d - 1, c);
}

int main() {
	cin >> n >> m;
	for (int i = 0; i < m; ++i) {
		int a, b;
		cin >> a >> b;
		--a, --b;
		g[a].emplace_back(b);
		g[b].emplace_back(a);
	}
	cin >> q;
	for (int i = 0; i < q; ++i)
		cin >> v[i] >> d[i] >> c[i];
	for (int i = q - 1; i >= 0; --i)
		f(v[i] - 1, d[i], c[i]);
	for (int i = 0; i < n; ++i)
		cout << x[0][i] << endl;

}


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

int main(){
	ll d,g; cin >> d >> g;
	vl p(d); vl c(d); rep(i,d)cin >> p[i] >> c[i];
	ll ans = 100000;
	rep(tmp,(1 << d)){
		bitset<10> r(tmp);
		ll m = 0; ll s = g;
		rep(i,d){
			if(r.test(i)){
				m += p[i];
				s = s - p[i] * 100 * (i+1) - c[i];
			}
		}
		if(s <= 0)ans = min(m,ans);
		else{
			for(int i = d-1;i >= 0;i--){
				if(!(r.test(i))){
					if(s >= 100 * (i+1) * p[i])break;
					else{
						m += (s + 100 * (i+1) - 1) / (100 * (i+1));
						ans = min(m,ans);
						break;
					}
				}
			}
		}

	}
	cout << ans << endl;
}

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

using namespace std;

#define INF 1000000007
#define int long long
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
signed main()
{
    int N, K, Q;
    cin >> N >> K >> Q;
    vector<int> A;
    rep(i, Q)
    {
        int a;
        cin >> a;
        A.push_back(a);
    }
    sort(A.begin(), A.end());

    int j = 0;
    for (int i = 1; i <= N; i++)
    {
        int count = 0;
        for (; j < A.size(); j++)
        {
            if (A[j] == i)
            {
                count++;
            }
            if (A[j] > i)
            {
                break;
            }
        }
        if (K <= (Q - count))
        {
            cout << "No";
        }
        else
        {
            cout << "Yes";
        }
        cout << endl;
    }
}


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

int main() {
    int N,K,Q;
    int index;
    cin>>N>>K>>Q;
    vector<int>ans(N);
    for(int i=0;i<Q;i++){
        cin>>index;
        --index;
        ans[index]++;
    }
    int change=K-Q;
    for(int i=0;i<N;i++){
        ans[i]+=change;
        if(ans[i]>0)
            cout<<"Yes"<<"\n";
        else
            cout<<"No"<<"\n";
    }
    return 0;
}

Measured memory_bytes: 1024
#include<stdio.h>
#include<stdlib.h>
#define NIL NULL

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};

typedef struct node * Node;
Node root;

void insert(int);
void inorder(Node);
void preorder(Node);
Node treeSearch(Node,int);

Node treeSearch(Node z, int k) { // 再帰を用いて key と node の数が一致するかすべての node surabataら終わり
  if( z == NIL || k == z->key ) {
    return z;
  }
  if( k < z->key ) {
    return treeSearch( z->left,k);
  }
  else{
    return treeSearch( z->right,k);
  }
}
 
void insert(int k){
  Node y = NIL;  //xの親
  Node x = root; //Tの根
  Node z;
 
  z = (Node)malloc(sizeof(struct 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 z){ // 中間順巡回の出力
  if( z->left != NIL ) inorder( z->left );
  printf(" %d",z->key);
  if( z->right != NIL ) inorder( z->right );
}

void preorder(Node z){ // 先行順巡回の出力
  printf(" %d",z->key);
  if( z->left != NIL ) preorder(z->left);
  if( z->right != NIL ) preorder(z->right);
}
 
 
int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);
 
  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } 
    else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } 
    else if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    }
  }
  return 0;
}

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

int main(){
    double a,b;
    int h,m;
    cin>>a>>b>>h>>m;
    int t = h*60+m;//t分後
    double hrad = (2*M_PI)/(12*60)*(t%(12*60));
    double mrad = ((2*M_PI)/60)*m;

    double rad = hrad-mrad;

    cout<<fixed<<setprecision(20)<<sqrt(a*a+b*b-2*a*b*cos(rad))<<endl;

    return 0;
}

Measured memory_bytes: 4212
N, M = [int(e) for e in input().split()]
A = [int(e) for e in input().split()]
count = 0
sum = 0

for a in A:
    sum += a

for a in A:
    if 4 * M * a >= sum:
        count += 1

if count >= M:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)
/* ┗(^o^)┛ｗｗｗｗｗ┏(^o^)┓ﾄﾞｺﾄﾞｺﾄﾞｺﾄﾞｺｗｗｗｗｗ */
int main(){
	string s;
	cin>>s;
	if(s[0]=='A'){
		int mode=0,count=0;
		for(int i=1;i<s.size();i++){
			if(s[i]=='C') {
				count++;
				if(i<2||i>s.size()-2) mode=1;
			}
			else if('a'<=s[i]&&s[i]<='z') 1;
			else mode=1;
		}
		if(mode==0&&count==1) cout<<"AC"<<endl;
		else cout<<"WA"<<endl;
	}

	else cout<<"WA"<<endl;
	return 0;
}

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

int main()
{
    int n,ans=0;
    cin>>n;
    string s;
    cin>>s;
    for(int i=2; i<n; i++)
        if(s[i]=='C' && s[i-1]=='B' && s[i-2]=='A')
            ans++;
    cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
n = int(input())
F = []
P = []
for _ in range(n):
    f = list(map(int, input().split()))
    F.append(f)
for _ in range(n):
    p = list(map(int, input().split()))
    P.append(p)

ans = (10**10) * (-1)

#営業する時間帯をbitで選択する
for i in range(1<<10):
    if i == 0:
        continue
    #n個の営業している店について、10この時間帯のうちいくつ被るかを格納するリスト
    Cov = [0] * n
    can = 0
    for j in range(10):
        # bit:1 の場合は営業とする
        # 営業の場合は他の店舗が営業しているかどうかを確認する
        # j: 0~9 
        if (i>>j)&1 == 1:
            for k in range(n):
                if F[k][j] == 1:
                    Cov[k] = Cov[k] + 1
        
    for l in range(n):
        can += P[l][Cov[l]]
    
    if can >= ans:
        ans = can

print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

typedef vector<double> vd;

struct circle {	int x; int y; int r; };
const double INF = 1e15;

int N;
vector<circle> C;
vector<vd> cost;
vd d;
vector<bool> used;

void dijkstra(int s) {
	d.resize(N + 2, INF);
	used.resize(N + 2, false);
	d[s] = 0.0;

	while (true) {
		int v = -1;
		for (int u = 0; u < N + 2; u++) {
			if (!used[u] && (v == -1 || d[u] < d[v])) v = u;
		}
		if (v == -1) break;
		used[v] = true;
		for (int u = 0; u < N + 2; u++) {
			d[u] = min(d[u], d[v] + cost[v][u]);
		}
	}
}

int main(void) {
	int x_s, y_s, x_t, y_t;

	cin >> x_s >> y_s >> x_t >> y_t;
	cin >> N;

	C.resize(N + 2);
	C[0].x = x_s;	C[0].y = y_s;	C[0].r = 0;
	C[N + 1].x = x_t;	C[N + 1].y = y_t;	C[N + 1].r = 0;
	for (int i = 1; i <= N; ++i)
		cin >> C[i].x >> C[i].y >> C[i].r;
	
	vd vinf;
	vinf.resize(N + 2, INF);
	cost.resize(N + 2, vinf);
	for (int i = 0; i <= N; ++i) {
		for (int j = i + 1; j <= N + 1; ++j) {
			double xx = (double)(C[i].x - C[j].x) * (double)(C[i].x - C[j].x);
			double yy = (double)(C[i].y - C[j].y) * (double)(C[i].y - C[j].y);
			double dst = sqrt(xx + yy) - (C[i].r + C[j].r);
			if (dst < 0)
				dst = 0.0;
			cost[i][j] = cost[j][i] = dst;
		}
	}

	dijkstra(0);

	cout << fixed << setprecision(15) << d[N + 1] << '\n';
	return 0;
}


Measured memory_bytes: 8192
#include<stdio.h>
 
int main(void) {
  
  int A,B,X;
  int cat;
  scanf("%d %d %d",&A,&B,&X);

  if((A<1 || A>100) || (B<1 || B>100) || (X<1 || X>200)){
    printf("NO\n");
    return 0;
  }
  
  if((A+B)<X){
    printf("NO\n");
    return 0;
  }

  if((X-A)<=B && (X-A)>=0){
    printf("YES\n");
    return 0;
  }else{
    printf("NO\n");
    return 0;
  }
 
  return 0;
}


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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<=(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define rev(v) reverse(all(v))
#define minvec(v) *min_element(all(v))
#define maxvec(v) *max_element(all(v))
#define sumvec(v) accumulate(all(v),0)
#define mapmax(v) v.rbegin()->first
#define mapmin(v) v.begin()->first
#define pb push_back
#define pf push_front
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define INF ((1LL<<62)-(1LL<<31))
#define zero(x,n) setw(x) << setfill('0') << n

typedef long long ll;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;

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

const double pi = acos(-1.0);
const int mod=1000000007;
const int mod2=998244353;

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

template<class T>
inline bool chmax(T& a, T b){if(a<b){a=b;return true;} return false;}

template<class T>
inline bool chmin(T& a, T b){if(a>b){a=b;return true;} return false;}

void YES(bool b) {cout << (b?"YES\n":"NO\n");}
void Yes(bool b) {cout << (b?"Yes\n":"No\n");}
void yes(bool b) {cout << (b?"yes\n":"no\n");}
void Yay(bool b) {cout << (b?"Yay!\n":":(\n");}

long long powmod(long long a,long long b){
    long long c=1;
    while(b>0){
        if(b&1) c=a*c%mod;
        a=a*a%mod;
        b>>=1;
    }
    return c;
}

ll gcd(ll x, ll y) {return __gcd(x,y);}
ll lcm(ll x, ll y) {return x/__gcd(x,y)*y;}

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

int main()
{
	ll n,ans=0;
	vvll c(10,vll(10));
	cin >> n;
	for(ll i=1;i<=n;i++){
		string s=to_string(i);
		ll m=(ll)s.size();
		c[s[0]-'0'][s[m-1]-'0']++;
	}
	REP(i,1,9){
		REP(j,1,9){
			ans+=c[i][j]*c[j][i];
		}
	}
	cout << ans << endl;
	return 0;
}


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

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#define boost ios::sync_with_stdio(0); cin.tie(0);
#define int long long

const int N = 1e5 + 10;
const int MOD = 1e9 + 7;

int32_t main(){
    boost;

    //code

    int r , d , x;
    cin >> r >> d >> x;
    for(int i = 0 ; i < 10 ; ++i){
    	x = r * x * 1LL - d;
    	cout << x << "\n";
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
	double r,S,L;
	
	scanf("%lf",&r);
	
	S = r * r *  3.14159265358979;
	L = r * 2 *  3.14159265358979;

	printf("%lf %lf\n",S,L);

	return 0;
}

Measured memory_bytes: 1816
#$debug=3
$debug=0

def aux0()
  h=[]
  #a=[[2,3,5,4,2],[1,4,6,3,1],[1,2,6,5,1],[1,5,6,2,1],[1,3,6,4,1],[3,2,4,5,3]]
  a=[[1,2,4,3,1],[0,3,5,2,0],[0,1,5,4,0],[0,4,5,1,0],[0,2,5,3,0],[2,1,3,4,2]]
  6.times{|t|
    h[t]=[]
    4.times{|i|
      h[t][a[t][i]]=a[t][i+1]
    }
  }
  h
end

def main
  if $debug&1==1 
    fh=File.open("ITP1_11_B.txt")
  else
    fh=STDIN
  end
  b = fh.gets.chomp.split
  n = fh.gets.chomp.to_i
  puts "b: #{b.to_s}" if $debug&2==2
  puts "n: #{n}" if $debug&2==2
  h=aux0
  n.times {|i|
    x=fh.gets.chomp.split
    puts "x: #{x.to_s}" if $debug&2==2
    fr = x.map{|x|b.index(x)}
    puts "fr: #{fr.to_s}" if $debug&2==2
    puts "h: #{h[fr[0]][fr[1]]}" if $debug&2==2
    puts b[h[fr[0]][fr[1]]]
  }

end

if $0 == __FILE__ then
  main
end


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


int N;

void Main() {
  cin >> N;

  if (floor(N / 1.08) == N / 1.08) {
    cout << N / 1.08 << endl;
  } else if (int((int(N / 1.08) + 1) * 1.08) == N ) {
    cout << int(int(N / 1.08) + 1) << endl;
  } else {
    cout << ":(" << endl;
  }
}

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

Measured memory_bytes: 256
#5 2
#18

#3 -1
#0

#30 -50
#-1044

input_line = input()
lines = input_line.split()
N = int(lines[0])
L = int(lines[1])
total = 0
for i in range(1,N+1):
  taste = L + i - 1
  total += taste
best_diff = None
best = None
for i in range(1,N+1):
  this_total = 0
  for j in range(1,N+1):
    if i == j:
      continue
    this_total += L + j - 1
  score = abs(total - this_total)
  if None == best_diff:
    best_diff = score
    best = this_total
  else:
    if score < best_diff:
      best_diff = score
      best = this_total
print(best)


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

int main(){
    int n;
    cin>>n;
    vector<vector<int>> me (n,vector<int>(2));
    for(int i=0;i<n;i++){
        cin>>me.at(i).at(0)>>me.at(i).at(1);
    } //入力

    int count=0;
    bool answer=false;

    for(int i=0;i<n;i++){
        if(me.at(i).at(0)==me.at(i).at(1)){
            count++;
            if(count>=3){
                answer=true;
            }
        }
        else{
            count=0;
        }
    }

    if(answer){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
}

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

using namespace std;
 
using ll = long long;
using ull = unsigned long long;
using ldouble = long double;
 
const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s) cout << fixed << setprecision(10) << s << endl;

string res;

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

    println(min(a, b) + min(c, d));
}


Measured memory_bytes: 3608
#include<bits/stdc++.h>
#include<atcoder/all>
#define int long long
using namespace std;
using namespace atcoder;
int mx(int a,int b){return max(a,b);}
int e(){return 0;}
signed main(){
  int N,K;
  cin>>N>>K;
  segtree<int,mx,e> S(300001);
  for(int i=0;i<N;i++){
    int a;
    cin>>a;
    S.set(a,S.prod(max(a-K,0LL),min(a+K+1,300001LL))+1);
  }
  cout<<S.prod(0,300001)<<endl;
}

Measured memory_bytes: 13848
#include <cstdio>
#include <cstring>
#include <map>
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;
#define LL long long
#define pb push_back
#define mk make_pair
#define pill pair<int, int>
#define mst(a, b)	memset(a, b, sizeof a)
#define REP(i, x, n)	for(int i = x; i <= n; ++i)
const int MOD = 1e9 + 7;
const int qq = 2e5 + 10;
vector<int> vt[qq];
int n, a, b;
int dp[qq], num[qq];
int pre[qq];
bool vis[qq];
void Dfs(int v, int fa, int dis){
	dp[v] = dis;
	pre[v] = fa;
	for(int i = 0; i < (int)vt[v].size(); ++i){
		int u = vt[v][i];
		if(u == fa)	continue;
		Dfs(u, v, dis + 1);
		num[v] += num[u];
	}
	num[v] = num[v] + 1;
}
int node[qq];

int main(){
	scanf("%d", &n);
	REP(i, 1, n - 1){
		scanf("%d%d", &a, &b);
		vt[a].pb(b), vt[b].pb(a);
	}
	Dfs(1, -1, 0);
	int cnt = 0;
	int x = n;
	while(pre[x] != -1){
		node[++cnt] = x;
		x = pre[x];
	}
	node[++cnt] = 1;
	int l = 1, r = cnt;
	while(l < r){
		if(l + 1 >= r - 1)	break;
		l++, r--;
	}
	int F, S;
	F = S = 0;
	S = num[node[l]];
	F = n - S;
	if(F > S)	puts("Fennec");
	else	puts("Snuke");
	return 0;
}

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

int main() {
  vector<int> x(5);
  int ans;
  rep(i, 5) {
    cin >> x[i];
    if (x[i] == 0) {
      ans = i+1;
    }
  }

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

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

unsigned GetDigit(unsigned num){
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}

int main() {

  int a, b, ans=1, x;
  cin >> a >> b;

  for(int i=0; i<GetDigit(b); i++) {
    ans *= 10;
  }

  ans = a*ans + b;
  x = sqrt(ans);

  if(x == sqrt(ans)) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}


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

using namespace std;

int main() {
	int i = 0, count = 0;
	string s;
	cin >> s;

	while (s[i] != '\0') {
		if (s[i] == 'o') count++;
		i++;
	}

	cout << 700 + count * 100;
	char x;
	cin >> x;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main (void)
{
 char c;
  cin>>c;
  if(c=='A')cout<<'T'<<endl;
   if(c=='C')cout<<'G'<<endl;
   if(c=='G')cout<<'C'<<endl;
   if(c=='T')cout<<'A'<<endl;
}
 

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

#define INF 0x3f3f3f3f
#define NINF -0x3f3f3f3f

using namespace std;

typedef pair<int,int> pii;

int a[100005];

int main (int argc, char const* argv[])
{
	int k;
	scanf("%d",&k);
	
	for (int i = 0; i < k; i += 1)
	{
		scanf("%d",&a[i]);
	}
	
	if (a[k-1] != 2)
	{
		printf("-1\n");
		return 0;
	}
	
	long long lo = 2;
	long long hi = 3;
	
	for (int i = k-2; i >= 0; i--)
	{	
		long long plo = a[i]*((lo+a[i]-1LL)/a[i]);
		long long phi = a[i]*((hi+a[i]-1LL)/a[i]);
		
		if (a[i]*((phi + a[i]-1)/a[i]) <= hi)
			phi += a[i]-1;
		
		if (a[i]*(phi/a[i]) > hi)
		{
			phi--;
		}
		
		//printf("%d: %lld %lld\n",a[i],plo,phi);
		
		if (plo > hi)
		{
			printf("-1\n");
			return 0;
		}
		
		lo = plo;
		hi = phi;
	}
	
	printf("%lld %lld\n",lo,hi);
	
	return 0;
}

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

int main()
{
	int N;
	long long W;
	scanf("%d%lld", &N, &W);
	std::vector<long long> weight_min(100001, 1LL << 50);
	weight_min[0] = 0;
	for (int i{}; i < N; i++)
	{
		long long w;
		int v;
		scanf("%lld%d", &w, &v);
		for (int j{100000}; j >= v; j--)
			weight_min[j] = std::min(weight_min[j], weight_min[j - v] + w);
	}
	for (int i{100000}; i >= 0; i--)
	{
		if (weight_min[i] > W) continue;
		printf("%d\n", i);
		break;
	}

	return 0;
}

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

int main(){
	int n;
	cout << fixed << setprecision(8);
	while (cin >> n, n != 0){
		vector<int> s(n);
		int sum = 0;
		for (int i = 0; i < n; i++){
			cin >> s[i];
			sum += s[i];
		}
		double av = (double)sum / n;
		double sigma = 0.0;
		for (int i = 0; i < n; i++){
			sigma += (s[i] - av) * (s[i] - av);
		}
		cout << sqrt(sigma / n) << endl;
	}
}


Measured memory_bytes: 3296
#include<stdio.h>

int main(void)
{
  int a, b, k;
  int i;
  int ak, bk;
  
  scanf("%d %d %d", &a, &b, &k);
  
  ak = a + k;
  bk = b - k;
  for(i = a; i <= b; i++) {
    if(i < ak || i > bk) {
      printf("%d\n", i);
    }
  }
  
  return 0;
}

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

using namespace std;

int main()
{
  int ans = 0;
  int now = 0;
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n + 1; i++) {
    if (s[i]=='I') now++;
    else if(s[i]=='D') now--;
    if (now>=ans) ans=now;
  }
  cout << ans << '\n';

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct card {char suzi, mozi;};
card hozon[36];
int hyozi(card hai[36],int a){
	for(int i = 0;i<a-1;i++){
		cout<<hai[i].mozi<<hai[i].suzi<<" ";
	}
	cout<<hai[a-1].mozi<<hai[a-1].suzi<<endl;
}
int kakunin(card hai[36],card hozon[36],int a){
	for(int i = 0;i<a;i++){
		if(hai[i].mozi != hozon[i].mozi){
			cout<<"Not stable"<<endl;
			return 0;
		}
	}
	cout<<"Stable"<<endl;
	return 0;
}
 int bubble(card hai[36],int a){
	
    int flag = 1;
    while(flag){
        flag = 0;
        for(int i = a-1;i>0;i--){    
            if(hai[i].suzi <hai[i-1].suzi){
                card o;
                o = hai[i];
                hai[i] = hai[i-1];
                hai[i-1] = o;
                flag = 1;
            }
        }
    }
    hyozi(hai,a);
    cout<<"Stable"<<endl;
    for(int i = 0;i<a;i++){
    	hozon[i] = hai[i];
    }
 }
int selection(card hai[36],int a){
	for(int i = 0;i<a-1;i++){
        int minj  =i;
        for(int j = i+1;j<a;j++){
            if(hai[minj].suzi>hai[j].suzi){
                minj = j;
            }
 
        }
        card aho;
        aho = hai[i];
        hai[i]  = hai[minj];
        hai[minj] = aho;
    }
	hyozi(hai,a);
	kakunin(hai,hozon,a);
}
int main(){
	int a;
	cin>>a;
	card hai[a],hai2[a];
	for(int i = 0;i<a;i++){
			cin>>hai[i].mozi>>hai[i].suzi;
	}
	for(int i = 0;i<a;i++){
		hai2[i] = hai[i];
	}
	bubble(hai,a);
	selection(hai2,a);
	return 0;
}


Measured memory_bytes: 3072
#include<bits/stdc++.h>
using namespace std;
auto speedup = [](){
    std::ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    return nullptr;
}();

int main()
{

int n;
cin>>n;
int count = 0;
unordered_map<string , int>mp;
for(int i =0;i<n;i++)
{
    string s;
    cin>>s;
    if(mp.find(s) == mp.end())
    {
        mp[s] = 1;
        count++;
    }
}
cout<<count<<endl;

    

}

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

using namespace std;

int main(){
  string N;
  int K;
  cin >> N >> K;
  int dp[110][2][4];
  for(int i=0; i<=K; i++){
    dp[0][0][i]=0;
    dp[0][1][i]=0;
  }
  dp[0][0][0]=1;
  for(int i=1; i<=N.size(); i++){
    dp[i][0][0]=0;
    dp[i][1][0]=1;
  }
  for(int i=1; i<=N.size(); i++){
    for(int j=1; j<=K; j++){
      if(N[i-1]=='0'){
        dp[i][0][j]=dp[i-1][0][j];
        dp[i][1][j]=dp[i-1][1][j-1]*9+dp[i-1][1][j];
      }
      else{
        dp[i][0][j]=dp[i-1][0][j-1];
        dp[i][1][j]=dp[i-1][0][j-1]*(N[i-1]-'0'-1)+dp[i-1][0][j]
                    +dp[i-1][1][j-1]*9+dp[i-1][1][j];
      }
    }
  }
  cout << dp[N.size()][0][K]+dp[N.size()][1][K] << endl;

  return 0;
}


Measured memory_bytes: 256
//package sample;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);
		int A, B, C;
		int count = 0;

		A = sc.nextInt();
		B = sc.nextInt();
		C = sc.nextInt();

		for(int i = 1; i < C + 1; i++) {
			if(A * i <= B) {
				count++;
			}
		}
		System.out.println(count);
	}

}


Measured memory_bytes: 22612
a=int(input())
#持っているカードの状態を、初期値をFalseとする4x13の２次元配列に記録する
cards = [[False for i in range(13)] for j in range(4)]
pattern =['S', 'H', 'C', 'D']
# 呼ばれたカードをTrueにする
for _ in range(a):
    ch, rank = input().split()
    cards[pattern.index(ch)][int(rank)-1] = True

# 2重ループによって呼ばれていないカードを表示する
for i in range(4):
    for j in range(13):
        if cards[i][j] == False:
            print(pattern[i],  j+1)




Measured memory_bytes: 5604
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include<math.h>

int main(){
    long long int a,b,c;
    scanf("%lld %lld %lld",&a,&b,&c);
    if(c-a-b > 0 && 4*a*b < (c-a-b)*(c-a-b)){
        printf("Yes");
    }else{
        printf("No");
    }
    return 0;
}

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

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) noexcept {
  return std::vector<T>(n, std::forward<T>(val));
}

template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) noexcept {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}

int main() {
  i64 N, K;
  cin >> N >> K;
  i64 R, S, P;
  cin >> R >> S >> P;
  vector<i64> score = { R, S, P };
  string T;
  cin >> T;

  map<char, i64> mp;
  mp['r'] = 0;
  mp['s'] = 1;
  mp['p'] = 2;

  i64 ans = 0;
  rep(k,0,K) {
    vector<i64> dp(4, -1e18);
    dp[3] = 0;
    for(i64 i = k;i < N;i += K) {
      vector<i64> next(4, -1e18);
      i64 hand = mp[T[i]];
      rep(x,0,4) {
        rep(y,0,3) {
          if(x == y) continue;
          i64 g = 0;
          if((y + 1) % 3 == hand) {
            g = score[y];
          }
          next[y] = std::max(next[y], dp[x] + g);
        }
      }
      swap(dp, next);
    }
    ans += std::max({ dp[0], dp[1], dp[2], dp[3] });
  }
  cout << ans << endl;
}


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

const int Maxn = 200005;
int n, a[Maxn];
map <int, int> Ma[Maxn];
int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i]);
	for (int i = 1; i < n; i++)
		if (a[i] >= a[i + 1]) goto A;
	puts("1");
	return 0;
	A:int l = 2, r = n;
	while (l + 1 <= r)
	{
		int mid = (l + r) >> 1;
		for (int i = 1; i < n; i++)
		{
			Ma[i + 1] = Ma[i];
			if (a[i] >= a[i + 1])
			{
				while (Ma[i + 1].size() && Ma[i + 1].rbegin() -> first > a[i + 1]) Ma[i + 1].erase(--Ma[i + 1].end());
				Ma[i + 1][a[i + 1]]++;
				int pnt = a[i + 1];
				while (Ma[i + 1][pnt] == mid)
				{
					if (pnt == 1)
					{
						l = mid + 1;
						goto END;
					}
					Ma[i + 1][pnt] = 0, Ma[i + 1][pnt - 1]++;
					pnt--;
				}
			}
		}
		r = mid;
		END:;
	}
	printf("%d", l);
	return 0;
}

Measured memory_bytes: 118784
#include <bits/stdc++.h>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i,a,b) for (ll i=(a);i<(ll)b; i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define INF 1LL << 60
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll,ll> p;
const long long MOD=1000000007;

// vector<p> cut(M); vector<vector<ll> > v(4);
// cut[i].second
// cut[i].first;
// REP(i,M){
//     int a,b;cin>>a>>b;
//     cut[i] = make_pair(b,a);//last first の順番
// }
// for(int i=0; i<N;i++){
// }
// sort(cut.begin(),cut.end()), sort(v.rbegin(), v.rend()); //sort
// char '' str ""
int main(void)
{
    int N, M;cin>>N>>M;
    int sum=0;
    vector<int> X; vector<int> Y;
    if(N>=M) {
      cout<<0<<endl; return 0;
    }
    for(int i=0; i<M;i++){
      int x; cin>>x;
      X.push_back(x);
    }
  sort(X.begin(),X.end()); //sort
    for(int i=0; i<M-1;i++){
      int y; y = X[i+1]- X[i];
      Y.push_back(y);
    }
      sort(Y.rbegin(), Y.rend()); //sort

      for(int i=0; i<N-1; i++){
        sum += Y[i];
      }

    cout<<X[M-1]-X[0]-sum<<endl;


    return 0;
}


Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
long long red,green,blue;
int main(){
	char ch[4004];
	int n;
	cin>>n;
	string s;
	cin>>s;
	for(int i=1; i<=n; i++) ch[i] = s[i-1];
	long long ret = 0;
	for(int i=1; i<=n; i++){
		if(ch[i]=='R') red++;
		else if(ch[i]=='G') green++;
		else blue++;
	}
	ret = blue*red*green;
	for(int i=1; i<=n; i++){
		for(int j=i+1; j<=n; j++){
			int dist = j-i;
			int k = j+dist;
			if(k>n) continue;
			if(ch[i]!=ch[j] && ch[j]!=ch[k] && ch[i]!=ch[k]) ret--;
		}
	}
	cout<<ret;
}

Measured memory_bytes: 3608
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <cstring>
#include <math.h>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
using namespace std;
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007

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

int main(int argc, char const *argv[]) {
  int H,W;
  cin>>H>>W;
  char s[H][W];
  for(int i=0;i<H;i++){
      for(int j=0;j<W;j++){
          cin>>s[i][j];
        }
    }
  bool ans=true;
  for(int i=0;i<H;i++){
      for(int j=0;j<W;j++){
          if(s[i][j]=='#'){
              bool found=false;
              for(int k=0; k<4; k++){
                  int x=i+dx[k];
                  int y=j+dy[k];
                  if(x>=0 && x<H && y>=0 && y<W && s[x][y]=='#')found=true;
              }
              if(!found) ans=false;
          }
      }
  }
    cout<<(ans?"Yes":"No")<<endl;

  return 0;
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
  let stdin = stdin();
  let stdin = stdin.lock();
  let token: String = stdin
    .bytes()
    .map(|c| c.expect("failed to read char") as char)
    .skip_while(|c| c.is_whitespace())
    .take_while(|c| !c.is_whitespace())
    .collect();
  token.parse().ok().expect("failed to parse token")
}

use std::cmp::{max, min};
use std::collections::HashMap;

fn main() {
  let n = read::<i64>();
  let x = read::<i64>();
  let mut min_d = 10000000;
  let mut cost = 0;

  for _ in 0..n {
    let m_i = read::<i64>();
    min_d = min(min_d, m_i);
    cost += m_i
  }

  println!("{}", n + ((x - cost) / min_d));
}



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

#define INF (INT64_MAX/2)
typedef pair<long long, int> P;

int main()
{
	int n;
	cin >> n;
	vector<vector<P>> g( n );
	for( int i = 0; i < n; i++ ) {
		int u, k;
		cin >> u >> k;
		g[u].resize( k );
		for( int j = 0; j < k; j++ ) {
			int v, c;
			cin >> v >> c;
			g[u][j] = P( c, v );
		}
	}

	vector<long long> d( n, INF );
	d[0] = 0;
	priority_queue<P, vector<P>, greater<P>> que;
	que.push( P( 0, 0 ) );
	while( !que.empty() ) {
		P p = que.top();
		que.pop();
		int c = p.first;
		int u = p.second;
		for( P e : g[u] ) {
			int cost = e.first;
			int v = e.second;
			if( d[v] <= d[u] + cost ) continue;
			d[v] = d[u] + cost;
			que.push( e );
		}
	}

	for( int i = 0; i < n; i++ ) {
		cout << i << " " << d[i] << endl;
	}
}



Measured memory_bytes: 10952