akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES

#include <iostream>
#include <cstdio>
#include <memory>
#include <string>
#include <cstdlib>
#include <set>
#include <utility>
#include <vector>
#include <list>
#include <forward_list>
#include <algorithm>
#include <regex>
#include <cmath>
#include <map>
#include <iterator>
#include <climits>
#include <numeric>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <array>
#include <valarray>
#include <complex>
#include <random>
#include <functional>
#include <cassert>
#include <chrono>
#include <memory>

using namespace std;

#define int long long
//region TEMPLATE
////@formatter:off
#define double long double
typedef long long ll;
typedef unsigned long long ull;
template<typename T>void __read(T &a) { cin >> a; }
template<typename T, typename ... Args> void __read(T &a, Args &... args) { cin >> a;__read(args...);}
#define make(t, ...) t __VA_ARGS__; __read(__VA_ARGS__)
#define makev(a, n) VI a(n); FOR(n) cin >> a[i]
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define FORIT(p) for(auto it = p.begin(); it != p.end(); it++)
#define FOR(b) for(signed i = 0; i <(b); i++)
#define FORE(i, l, r) for(int i = (l); i < (r); i++)
#define NFOR(i, n) for(int i = (((int) n)-1); i >= 0; i--)
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<pair<int, int>, int> PPII;
constexpr ll M7 = 1000000007ll;
constexpr ll M9 = 1000000009ll;
constexpr ll MFFT = 998244353ll;
template<class T> void outv(T &a) { for (auto &x : a) cout << x << ' '; }
static mt19937 rnd(static_cast<unsigned>(chrono::steady_clock::now().time_since_epoch().count())); // NOLINT(cert-err58-cpp)
auto __fast_io__ = (ios_base::sync_with_stdio(false), cin.tie(nullptr)); // NOLINT(cert-err58-cpp,cppcoreguidelines-interfaces-global-init)
////@formatter:on
//endregion



int32_t main() {
    makev(a, 5);
    cout << find(ALL(a), 0) - a.begin() + 1;


    return 0;
}

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

int main(void) {
	double a, b, C;
	double PI = atan(1.0) * 4.0;
	double angle, h;
	if (scanf("%lf%lf%lf", &a, &b, &C) != 3) return 1;
	angle = C * PI / 180.0;
	h = b * sin(PI - angle);
	printf("%.15f\n", a * h / 2.0);
	printf("%.15f\n", a + b + sqrt(a*a + b*b - 2*a*b*cos(angle)));
	printf("%.15f\n", h);
	return 0;
}




Measured memory_bytes: 2116
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#include<queue>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
#define F first
#define S second
#define mp(x,y) make_pair(x,y)
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<int,pi> pii;
const int INF=1e+9;
const ll INFLL=1e+17;
int H,W;
char A[1010][1010];
int d[1010][1010];
priority_queue<pii,vector<pii>,greater<pii> > q;//pair(コスト、頂点)としてコストの小さい順に並ぶ
void solve(){
  rep(i,H){
    rep(j,W){
      if(A[i][j]=='#'){
	pii p=mp(0,mp(i,j));
	d[i][j]=0;
	q.push(p);
      }
      else d[i][j]=INF;
    }
  }
  while(!q.empty()){
    pii p=q.top();q.pop();
    int x=p.S.F,y=p.S.S;
    if(x>0){
      if(d[x-1][y]>p.F+1){
	d[x-1][y]=p.F+1;
	q.push(mp(p.F+1,mp(x-1,y)));
      }
    }
    if(y>0){
      if(d[x][y-1]>p.F+1){
	d[x][y-1]=p.F+1;
	q.push(mp(p.F+1,mp(x,y-1)));
      }
    }
    if(x<H-1){
      if(d[x+1][y]>p.F+1){
	d[x+1][y]=p.F+1;
	q.push(mp(p.F+1,mp(x+1,y)));
      }
    }
    if(y<W-1){
      if(d[x][y+1]>p.F+1){
	d[x][y+1]=p.F+1;
	q.push(mp(p.F+1,mp(x,y+1)));
      }
    }
  }
  int res=0;
  rep(i,H){
    rep(j,W){
      res=max(res,d[i][j]);
    }
  }
  prin(res);
    
}
int main(){
  cin>>H>>W;
  rep(i,H){
    rep(j,W){
      cin>>A[i][j];
    }
  }
  solve();
  /*  rep(i,H){
    rep(j,W){
      cout<<d[i][j]<<" ";
    }
    cout<<"\n";
  }
  */
  return 0;
}


Measured memory_bytes: 19564
#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))

using namespace std;
typedef pair<llint, llint> P;

string s;

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> s;
	llint ans = 0;
	for(int i = 0; i < s.size(); i++){
		if(s[i] == '+') ans++;
		else ans--;
	}
	cout << ans << endl;
	
	return 0;
}

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

#define FOR(s, i, n) for(int i = s; i n; i++)
typedef long long ll;
const int INF = 1e9;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.precision(30);
	// cout<<(ll)1e15<<'\n';
	// double a = 2.01;
	// a *= 100;
	// cout<<a<<'\n';
	// ll b = a;
	// cout<<b<<'\n';

	ll a;
	ll b;
	string s;
	cin>>a>>s;
	s.erase(s.find('.'), 1);
	// cout<<s<<'\n';
	istringstream fin(s);
	fin>>b;
	cout <<a*b/100<<'\n';
	return 0;
}

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

int main(void){
	int a;
	int b;
	int d;
	int r;
	double f;
	scanf("%d %d", &a, &b);
	d = a / b;
	r = a % b;
	f = (double)a / (double)b;
	printf("%d %d %f\n", d, r, f);
	return 0;
}

Measured memory_bytes: 636
#include<stdio.h>                                                         
                                                                          
int main(void){                                                           
                                                                          
  int array[10000];                                                       
  int i = 1;                                                              
  int j;                                                                  
  int k;                                                                  
                                                                          
  do {                                                                    
    scanf("%d",&array[i]);                                                
    i++;                                                                  
  } while (array[i-1] != 0);                                              
                                                                          
  k = i-2;                                                                
                                                                          
  for(j = 1,i = 1;j <= k;j++,i++) {                                       
    printf("Case %d: %d\n",j,array[i]);                                   
  }                                                                       
                                                                          
  return 0;                                                               
} 

Measured memory_bytes: 2648
import sys
from collections import defaultdict as dd
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
N = int(input())
e = dd(list)
for _ in range(N - 1):
  u, v = map(int, input().split())
  e[u].append(v)
  e[v].append(u)

cl = [0] * (N + 1)
vis = set()
def dfs(x):
  global cl
  global vis
  vis.add(x)
  for y in e[x]:
    if y in vis: continue
    cl[y] = (cl[x] + 1) % 2
    dfs(y)

dfs(1)
bl = cl.count(1)
wh = N - bl
res = [0] * (N + 1)
nm = [[] for _ in range(3)]
for i in range(1, N + 1): nm[i % 3].append(i)
#print(cl)
if bl <= N // 3:
  for i in range(1, N + 1):
    if cl[i]:
      res[i] = nm[0].pop()
    else:
      if len(nm[1]): res[i] = nm[1].pop()
      elif len(nm[2]): res[i] = nm[2].pop()
      else: res[i] = nm[0].pop()
  print(*res[1: ])
  exit(0)
if wh <= N // 3:
  for i in range(1, N + 1):
    if cl[i] == 0:
      res[i] = nm[0].pop()
    else:
      if len(nm[1]): res[i] = nm[1].pop()
      elif len(nm[2]): res[i] = nm[2].pop()
      else: res[i] = nm[0].pop()
  print(*res[1: ])
  exit(0)
#print(nm)
#print(cl, nm)
f = 0
for i in range(1, N + 1):
  if cl[i]:
    if len(nm[1]):
      res[i] = nm[1].pop()
    else:
      res[i] = nm[0].pop()
  else:
    if len(nm[2]):
      res[i] = nm[2].pop()
    else:
      res[i] = nm[0].pop()

print(*res[1: ])

Measured memory_bytes: 183132
#include<stdio.h>
int f[100005]={0};
int high[100005]={0};
int main(){
	int n,m,u,v;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) scanf("%d",&high[i]);
	for(int i=1;i<=m;i++){
		scanf("%d%d",&u,&v);
		if(high[u]>high[v]) f[v]=1;
		else if(high[v]>high[u]) f[u]=1;
        else{
          f[v]=1;
          f[u]=1;
        }
	}
	int ans=0;
	for(int i=1;i<=n;i++) if(!f[i]) ans++;
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 2512
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007

typedef long long int lli;

int main(void) {
  int N;
  scanf("%d", &N);
  if ( N == 0 ) printf("0\n");

  int mt = 1;
  int s[MAX] = {0};
  int ki = 0;
  while ( N != 0 ) {
    int si = abs(N % -2);
    N -= si;
    N /= -2;
    mt *= -2;
    s[ki++] = si;
    //printf("N = %d, Si = %d\n", N, si);
  }
  for ( int i = ki - 1; i >= 0; i-- ) {
    printf("%d", s[i]);
  }
  printf("\n");
  return 0;
}


Measured memory_bytes: 512
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using static System.Console;
using static System.Math;

class program
{
    static public int mod = 1000000007;
    static void Main()
    {
        var nk = inta();
        int n = nk[0], k = nk[1];
        var a = inta();
        int amx = a.Max();
        int amn = amx / (k + 1);
        while (amx > amn)
        {
            int mid = (amx + amn) / 2;
            long div = 0;
            if(mid > 0)
            {
                for (int i = 0; i < n; i++)
                {
                    div += (long)Ceiling((double)a[i] / mid) - 1;
                }
            }
            else
            {
                div = long.MaxValue;
            }
            if (k >= div)
            {
                amx = mid;
            }
            else
            {
                amn = mid + 1;
            }
        }
        Write(amx);

    }

    static int pow(int a, int b) { string binary = Convert.ToString(b, 2); int bileng = binary.Length; long a_power = a; long value = 1; for (int i = bileng - 1; i >= 0; i--) { if (binary[i] == '1') { value = value * a_power % mod; } a_power = a_power * a_power % mod; } return (int)value; }
    static string rstr() { return ReadLine(); }
    static int rint() { return int.Parse(ReadLine()); }
    static long rlong() { return long.Parse(ReadLine()); }
    static string[] stra() { return ReadLine().Split(' '); }
    static char[] chara() { string[] a = stra(); string b = ""; for (int i = 0; i < a.Length; i++) { b += a[i]; } return b.ToCharArray(); }
    static int[] inta() { string[] read_str_array = ReadLine().Split(' '); int[] return_int_array = new int[read_str_array.Length]; for (int countup_i = 0; countup_i < read_str_array.Length; countup_i++) { return_int_array[countup_i] = int.Parse(read_str_array[countup_i]); } return return_int_array; }
    static long[] longa() { string[] read_str_array = ReadLine().Split(' '); long[] return_long_array = new long[read_str_array.Length]; for (long countup_i = 0; countup_i < read_str_array.Length; countup_i++) { return_long_array[countup_i] = long.Parse(read_str_array[countup_i]); } return return_long_array; }
    static double[] doublea() { string[] read_str_array = ReadLine().Split(' '); double[] return_double_array = new double[read_str_array.Length]; for (long countup_i = 0; countup_i < read_str_array.Length; countup_i++) { return_double_array[countup_i] = double.Parse(read_str_array[countup_i]); } return return_double_array; }
    static long GCD(long a, long b) { if (a < b) { long temp = a; a = b; b = temp; } if (a % b == 0) { return b; } else { long temp = b; b = a % b; a = temp; return GCD(a, b); } }
    static long LCM(long a, long b) { return a * b / GCD(a, b); }
    static void WriteArray2(int[,] a, int b, int c) { for (int i = 0; i < b; i++) { for (int j = 0; j < c; j++) { if (j != 0) Write(" "); Write(a[i, j]); } WriteLine(); } }
    static void WriteArray(int[] a, int b) { for (int i = 0; i < b; i++) { Write(" "); Write(a[i]); } WriteLine(); }
}


Measured memory_bytes: 44384
s = input()
n = len(s)


if(s[::-1]==s):
  if(s[((n-1)//2)-1::-1]==s[:(n-1)//2] and s[n-1:((n+3)//2)-2:-1] == s[((n+3)//2)-1:]):
    print("Yes")
  else:
    print("No")
else:
  print("No")

Measured memory_bytes: 3060
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define cin_desync()                                                           \
    do {                                                                       \
        ios_base::sync_with_stdio(false);                                      \
        cin.tie(0);                                                            \
    } while (0)

#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
    const char *comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | ";
    __f(comma + 1, args...);
}

#else
#define trace(...)
#endif // ifndef ONLINE_JUDGE

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int max_W = 2e5 + 10;
vector<int> xs[max_W];

int mbc(int col, int row);
bool blocked(int col, int row);

int H, W;
int main() {
    cin_desync();
    int N;
    cin >> H >> W >> N;

    for (int i = 1; i <= N; ++i) {
        int x, y;
        cin >> x >> y;
        xs[y].push_back(x);
    }

    for (int i = 1; i <= W; ++i) {
        xs[i].push_back(H + 1);
        sort(xs[i].begin(), xs[i].end());
    }

    int cx = 1, cy = 1;
    int msf = 0;
    int ans = H;

    while(cx <= H && cy <= W) {
        ans = min(ans, msf + mbc(cy, cx));
        if (!blocked(cy, cx + 1)) {
            ++cx;
        } else {
            break;
        }

        if (!blocked(cy + 1, cx)) {
            ++cy;
        }

        ++msf;
    }

    cout << ans << endl;
}

int mbc(int col, int row) {
    int lb = *lower_bound(xs[col].begin(), xs[col].end(), row);
    return (lb - row);
}

bool blocked(int col, int row)
{
    if (col > W) {
        return true;
    }
    return binary_search(xs[col].begin(), xs[col].end(), row);
}


Measured memory_bytes: 11392
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<algorithm>
#include<tuple>

long long N;
std::string SN;
int digit[17]={};
int length;

long long power(int exp){
    int num=1;
    for(int i=0;i<exp;i++){
        num*=10;
    }
    return num;
}


void digitinput(long long num){
    int pos=1;
    long long amari=0;
    while(num>0){
        amari=num%power(pos);
    num-=amari;
    digit[pos]=amari/power(pos-1);
    pos++;
    }
    length=pos-1;
}
void digitinput(void){
    length=SN.length();
    for(int i=1;i<=length;i++){
        digit[i]=SN[length-i]-48;
    }
}

int solve_sum(int i){
    int sum=0;
    if(digit[i]==0){
        return 0;
    }else{
        int target;
        for(int target=length;target>i;target--){
            sum+=digit[target];
        }
        sum+=digit[i]-1;
        for(int target=i-1;target>=1;target--){
            sum+=9;
        }
    }
    return sum;
    
}

int solve(void){
    int max=0;
    int tempans;
    for(int i=length;i>=1;i--){
        max+=digit[i];
    }
    for(int i=length;i>=2;i--){
        tempans=solve_sum(i);
        if(max<tempans){
            max=tempans;
        }
    }
    return max;
}

int main(void){
    //std::cin>>N;
    std::cin>>SN;
    //digitinput(N);
    digitinput();
    std::cout<<solve()<<std::endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pii_ pair<int,int>
#define mp_ make_pair
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define show1(a) cout<<#a<<" = "<<a<<endl
#define show2(a,b) cout<<#a<<" = "<<a<<"; "<<#b<<" = "<<b<<endl
using namespace std;
const ll INF = 1LL<<60;
const int inf = 1<<30;
const int maxn = 2e5+5;
inline void fastio() {ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}



int main()
{
    fastio();
    int n,k,x;
    cin>>n>>k; vector<int> g;
    rep(i,1,n) {cin>>x;g.pb(x);}
    sort(g.begin(),g.end());
    int ans = 0;
    rep(i,0,k-1) ans += g[i];
    cout<<ans<<endl;
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

#define REP(i,a,b) for(int i=a; i<=b; i++)

void solve(int test_case) {
	int n;
	cin>>n;
	vector<ll> arr(n),srr(n,0);
	for(ll &i:arr)cin>>i;
	srr[n-1]=arr[n-1];
	for(int i=n-2;i>=0;i--) {
		srr[i]=(arr[i]+srr[i+1])%1000000007;
	}
	//REP(i,0,n-1)cerr<<srr[i]<<" ";
	ll sum = 0;
	REP(i,0,n-2) sum = (sum+(arr[i]*srr[i+1])%1000000007)%1000000007;
	cout<<sum;
}

int main() {
	
	////// FILE BASED IO////
	//freopen("in", "r", stdin);
	//freopen("out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
}	


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

typedef long long ll_t;

#define INF 1E9

ll_t pack(ll_t x, ll_t y) {
    return x * 1E9 + y;
}

using edge = pair<ll_t, int>;

struct Dist {
    ll_t v;
    int d;
    Dist(ll_t v_, int d_ = INF) : v(v_), d(d_) { } 
    bool operator < (const Dist& rhs) const {
        return d > rhs.d;
    }
};

int N;
int M;
unordered_map<ll_t, vector<edge>> graph;
unordered_map<ll_t, int> dist;
unordered_set<ll_t> done;

int main() {
    scanf("%d%d", &N, &M);

    for (int i = 1; i <= M; i++) {
        int p, q, c;
        scanf("%d%d%d", &p, &q, &c);
        graph[pack(p, c)].push_back(edge(pack(q, c), 0));
        graph[pack(q, c)].push_back(edge(pack(p, c), 0));
        
        graph[pack(p, c)].push_back(edge(pack(p, 0), 0));
        graph[pack(p, 0)].push_back(edge(pack(p, c), 1));
        graph[pack(q, c)].push_back(edge(pack(q, 0), 0));
        graph[pack(q, 0)].push_back(edge(pack(q, c), 1));
    }
 
    priority_queue<Dist> q;
    dist[pack(1, 0)] = 0;
    q.push(Dist(pack(1, 0), 0));
    while (!q.empty()) {
        Dist t = q.top();
        q.pop();
        if (done.count(t.v)) continue;
        done.insert(t.v);

        for (auto& kv : graph[t.v]) {
            ll_t u = kv.first;
            int d = kv.second;
            int tmp = dist[t.v] + d;
            if (dist.count(u) == 0 || tmp < dist[u]) {
                dist[u] = tmp;
                q.push(Dist(u, tmp));
            }
        }
    }
    if (dist.count(pack(N, 0)) == 0)
        printf("-1\n");
    else
        printf("%d\n", dist[pack(N, 0)]);
    return 0;
}

Measured memory_bytes: 97268
a,b,k=map(int,input().split())
A=[i for i in range(101)][::-1]
for i in A:
  if a%i==b%i==0:
    po=i
    break
B=[]
for i in range(1,int(po**(1/2)+1)):
  if po%i==0:
    B.append(i)
    B.append(po//i)
B=list(set(B))
B.sort()
print(B[-k])

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)

int main() {
  int n, t;
  cin >> n >> t;
  vector<pair<int,int>> p(n);
  for (auto &i : p) cin >> i.first >> i.second;
  sort(p.begin(), p.end());
  int ans = 0;
  int dp[6005];
  rep (i, n) {
    int f = p[i].first, s = p[i].second;
    drep (j, t) {
      ans = max(ans, dp[j]+s);
      dp[j+f] = max(dp[j+f], dp[j]+s);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <fstream>
#define mem(i,a) memset(i,a,sizeof(i))
#define PI acos(-1.0)
#define DMAX 100005
#define MOD 20190823
#define eps 1e-8
#define bl bool
#define INF 1e+9
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
template<class T> inline void read(T &f){
	f=0;
    T x=1;
    char ch=getchar();
    while(ch<48 || ch>57) {
        if(ch=='-') {
            x=-1;
        }
        ch=getchar();
    }
    while(ch<=57 && ch>=48) {
        f=f*10+ch-'0';
        ch=getchar();
    }
    f*=x;
}
ll n,k,q;
ll a[DMAX];
int main(){
//	mem(a,k); 
	read(n);
	read(k),read(q);
	ll p;
	for(ll i=1;i<=q;i++){
		read(p);
		a[p]++;
	}
	for(ll i=1;i<=n;i++){
		if(k-(q-a[i])>0){
			cout<<"Yes"<<endl;
		}		
		else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}

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



int main() {
    int N,M;
    cin >> N >> M;
    vector<vector <int>> number(N,vector<int>(0));
    vector<bool> seen(N,false);
    vector<int> A(M);
    vector<int> B(M);

    for(int i = 0; i < M; i++){
        cin >> A[i] >> B[i];
    }

    for(int i = 0; i < M; i++){
        number[A[i]-1].push_back(B[i]-1);
        number[B[i]-1].push_back(A[i]-1);
    }

int ans = 0;
queue<int> stack;


    for(int i = 0; i < N; i++){
        int count = 0;
            if(seen[i]) continue;
            seen[i] = true;
            stack.push(i);
            while(!stack.empty()){
                int now = stack.front(); stack.pop();
                for(auto nv : number[now]){
                    if(!seen[nv]){
                    seen[nv] = true;
                    stack.push(nv);
                    }
            }
            count ++;
        }
    ans = max(ans,count);
    }

cout << ans << endl;

}


Measured memory_bytes: 16228
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

class MainClass
{
    static void Main()
    {
        long N = long.Parse(ReadLine());
        long ans = 0;
        for (int i = 2; i < Sqrt(N)+1; i++)
        {
            int cnt = 0;
            while (N % i == 0)
            {
                N /= i;
                cnt++;
            }
            int num = 1;
            while (cnt - num >= 0)
            {
                ans++;
                cnt -= num;
                num++;
            }
        }
        if (N > 1) ans++;
        WriteLine(ans);
    }
    
}


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

int h, w;
vector<string> mat;
bool ans = false;

void dfs(int x, int y){
  if(x == w-1 && y == h-1){
    bool isok = true;
    rep(i, h){
      rep(j, w){
        if(mat[i][j] == '#') isok = false;
      }
    }
    if(isok) ans = true;
  }
  if(x+1 < w && mat[y][x+1] == '#'){
    mat[y][x+1] = '.';
    dfs(x+1, y);
    mat[y][x+1] = '#';
  }
  if(y+1 < h && mat[y+1][x] == '#'){
    mat[y+1][x] = '.';
    dfs(x, y+1);
    mat[y+1][x] = '#';
  }
}
    
    
  

int main(){
  cin >> h >> w;
  vector<string> origin(h);
  rep(i, h) cin >> origin[i];
  mat = origin;
  mat[0][0] = '.';
  dfs(0, 0);
  if(ans) cout << "Possible" << endl;
  else cout << "Impossible" << endl;
  return 0;
}

Measured memory_bytes: 3640
import java.util.ArrayDeque;
import java.util.Scanner;

public class Main {

	private static       boolean flg     = false;
	private static       int     index   = 0;
	private static final boolean SUCCESS = true;
	private static final int     EMPTY   = -1,
			                     END     = 10;

	private static int[]               pipe_A = new int[10];
	private static ArrayDeque<Integer> pipe_B = new ArrayDeque<Integer>(),
                                       pipe_C = new ArrayDeque<Integer>();

    public static void main(String[] args) {

    	Scanner sc = new Scanner(System.in).useDelimiter(System.getProperty("line.separator"));
    	int n = sc.nextInt();

    	String[] s;
    	for(int i=0;i<n;i++){
    		s = sc.next().split("\\s");
    		for(int j=0;j<10;j++){pipe_A[j] = Integer.parseInt(s[j]);}
    		init();
    		push('B');
			if   (flg){System.out.println("YES");}
			else      {System.out.println("NO"); }
    	}
    }

    private static void init(){
		pipe_B.clear();
		pipe_C.clear();
		pipe_B.add(EMPTY);
		pipe_C.add(EMPTY);
		flg = false;
		index = 0;
    }

    private static void push(char pipe){

    	if(flg){return;}
    	if(index == END){
    		flg = SUCCESS;
    		return;
   		}
    	int ball = pipe_A[index];
    	ArrayDeque<Integer> pipe_X = null;
    	if      (pipe == 'B'){pipe_X = pipe_B;}
    	else if (pipe == 'C'){pipe_X = pipe_C;}

		if(pipe_X.peek() < ball ){
			pipe_X.push(ball);
	    	index++;
		} else if(pipe_X == pipe_C){
			if(index == 0){return;}
			if     (pipe_A[index - 1] == pipe_B.peek()){pipe_B.pop();}
			else if(pipe_A[index - 1] == pipe_C.peek()){pipe_C.pop();}
			index--;
			return;
		} else {
			return;
		}
		push('B');
		push('C');
    }
}

Measured memory_bytes: 17328
while (n = gets.to_f) != 0
  xs = gets.split.map(&:to_i)
  mean = xs.sum / n
  sum_of_squares = xs.inject(0) { |sum, i| sum + (i - mean) ** 2 }
  s2 = sum_of_squares / n
  puts Math.sqrt(s2)
end


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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll N,A,B;
  cin >> N >> A >> B;

  if(A == 0) {cout << A << endl; return 0;}

  ll ans=0;
  ll rem=0;

  ans = N / (A+B)*A;
  rem = N % (A+B);

  if(rem < A)
    ans += rem;
  else
    ans += A;
  
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3636
#include <cassert>
#include <cstdio>
#include <vector>
#include <set>

#include <map>
#include <unordered_map>
#include <deque>
#include <string>
#include <utility>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <climits>

using namespace std;

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

const int INF = 1e9;
const long long LINF = 1e18;

int main() {
    string S;
    cin >> S;
		for (int i = 0; i < S.size(); i++)
		{
                    S[i] = 'x';
                }
                cout << S << endl;

                return 0;
}


Measured memory_bytes: 256
import math

N, M = map(int, input().split())

path = [[] for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())

    path[a-1] += [b-1]
    path[b-1] += [a-1]

length = [-1]*N
last = [-1]*N

Q = [0]
while Q:
    n = Q.pop(0)
    for x in path[n]:
        if length[x] == -1:
            length[x] = length[n] + 1
            last[x] = n
            Q += [x]
        elif length[x] > (length[n] + 1):
            length[x] = length[n] + 1
            last[x] = n

print("Yes")
print("\n".join([str(n+1) for n in last[1:]]))

Measured memory_bytes: 42492
n, m = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
mod = 10 ** 9 + 7

xsm = 0
for i, ex in enumerate(x, 1):
    xsm -= ex * (n - i)
    xsm += ex * (i - 1)
    xsm %= mod

ysm = 0
for i, ey in enumerate(y, 1):
    ysm -= ey * (m - i)
    ysm += ey * (i - 1)
    ysm %= mod

ans = xsm * ysm % mod
print(ans)


Measured memory_bytes: 18752
d,g=map(int,input().split())
A,B=[],[]
for i in range(d):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
ans=float("inf")
for i in range(2**d):
    s,k=0,0
    for j in range(d):
        if (i>>j)&1:
            s+=A[j]*(j+1)*100+B[j]
            k+=A[j]
    if s>=g:
        ans=min(ans,k)  
    else:
        for l in range(d-1,-1,-1):
            if (i>>l)&1==0:
                if s+(l+1)*100*A[l]<g:
                    s+=(l+1)*100*A[l]
                    k+=A[l]
                else:
                    rem=g-s
                    k+=-(-rem//(l+1)//100)
                    ans=min(ans,k)
print(ans)

Measured memory_bytes: 3064
class in{struct It{int it;const bool rev;explicit constexpr It(int it_, bool rev=false):it(it_),rev(rev){}int operator*(){return it;}bool operator!=(It& r){return it!=r.it;}void operator++(){rev?--it:++it;}};const It i,n;public:explicit constexpr in(int n):i(0),n(n<0?0:n){}explicit constexpr in(int i,int n):i(i,n<i),n(n){}const It& begin(){return i;}const It& end(){return n;}};

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

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m, h, k;
    while(cin >> n >> m >> h >> k && n) {
        vector<int> score(n);
        for(int& x : score) cin >> x;
        
        vector<vector<int>> yoko(h);
        for(int _ : in(m)) {
            int u, v;
            cin >> u >> v;
            --u;
            yoko[v].emplace_back(u);
        }
        vector<int> a(n);
        iota(a.begin(), a.end(), 0);
        auto swapped = a;
        for(const auto& v : yoko) for(int j : v) swap(swapped[j], swapped[j + 1]);
        vector<int> swappedID(n, 0);
        for(int i : in(n)) swappedID[swapped[i]] = i;
        auto b = a;
        int ans = 0;
        for(const auto& vec : yoko) for(int j : vec) {
            int mi = min(b[j], b[j + 1]), ma = max(b[j], b[j + 1]);
            if(mi < k && ma >= k) {
                int tmp = score[swappedID[mi]] - score[swappedID[ma]];
                ans = max(ans, tmp);
            }
            swap(b[j], b[j + 1]);
        }
        int sum = 0;
        for(int i : in(k)) sum += score[swappedID[i]];
        cout << sum - ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3572
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <deque>

using namespace std;

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

	int a, b;
	cin >> a >> b;

	int t;
	if (b / 10 == 0) {
		t = a * 10 + b;
	} else if (b / 10 == 10) {
		t = a * 1000 + b; 
	} else {
		t = a * 100 + b;
	}

	for (int i = 1; i <= 361; i++) {
		if (t == i * i) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
}

Measured memory_bytes: 256
n, m = map(int, input().split())

all = list(map(int, input().split()))
all.sort(reverse=True)
flg = []
for i in range(m):
  if all[i] < (sum(all)*1/(4*m)):
      flg.append(False)
  else:
      flg.append(True)

if False in flg:
  print("No")
else:
  print("Yes")

Measured memory_bytes: 3060
#include <set>
#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <sstream>
#include <string>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <cmath>
#include <map>
#include <string>

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

int cnt[100010];

set<int> divisor(int N){
  set<int> res;
  for(int i=1;i*i<=N;i++){
    if(N%i==0){
      res.insert(i);
      res.insert(N/i);
    }
  }
  return res;
}

int main(){
  // ifstream cin("in.txt");
  int N,W;
  cin>>N>>W;
  int ans=0;
  // [1,W]の値について、約数を計算
  for(int i=1;i<=W;i++){
    set<int> s=divisor(i);
    for(set<int>::iterator it=s.begin();it!=s.end();it++){
      int num=*it;
      cnt[num]++;
      // 今回入ってきた数字は無条件に増える
      if(num==i)ans++;
      else{
        if(!(1<=num&&num<=i)&&cnt[num]==2)ans++;
      }
    }
  }
  cout<<ans;
  for(int i=0;i<N-W;i++){
    // for(int j=0;j<10;j++)
    //   cout<<cnt[j]<<" ";cout<<endl;
    {
      set<int> s=divisor(W+i+1);
      for(set<int>::iterator it=s.begin();it!=s.end();it++){
        int num=*it;
        cnt[num]++;
        if(num==W+i+1)ans++;
        else if(!(i+1<=num&&num<=W+i+1)&&cnt[num]==2)ans++;
      }
    }
    {
      set<int> s=divisor(i+1);
      for(set<int>::iterator it=s.begin();it!=s.end();it++){
        int num=*it;
        cnt[num]--;
        // 今回出て行った数字が維持できるかどうか
        if(num==i+1){
          if(cnt[num]<2)ans--;
        }
        // そうでない場合
        else{
          if(cnt[num]==1)ans--;
        }
      }
    }
    cout<<" "<<ans;
  }
  cout<<endl;
  
  return 0;
}

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



void solve(){
 int a,b,c;
  cin >> a >> b >> c;
  cout << (c/a)*b << endl;
}

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


Measured memory_bytes: 256
#include <set>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
	int V,d;
	while(cin>>V>>d){
		int fib[1001];
		int cnt=1;
		fib[0]=1;
		fib[1]=2;
		for(int i = 2; i < 1001; i++)
			fib[i]=(fib[i-1]+fib[i-2])%1001;
		sort(fib+1,fib+V+1);
		int prv=fib[1];
		for(int i = 2; i <= V; i++){
			if(abs(prv-fib[i])>=d){
				cnt++;
			}
			prv=fib[i];
		}
		cout<<cnt<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


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

  int N = s.size();

  int ans = 0;
  REP(bit, (1<<(N-1))){
    REP(i, N-2) if(((bit >> i)&1) && ((bit >> (i+1))&1)) continue;
    int now = 0;
    REP(i, N){
      now *= 10;
      now += s[i]-'0';

      if(i == N-1 || (bit >> i)&1){
        ans += now;
        now = 0;
      }
    }
  }

  cout << ans << "\n";

  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    int a,b,e;
    char op;
    while(1){
        scanf("%d %c %d",&a,&op,&b);
        if(op=='?')break;
        if(op=='+'){
            e=a+b;
        }else if(op=='-'){
            e=a-b;
        }else if(op=='*'){
            e=a*b;
        }else if(op=='/'){
            e=a/b;
        }else{

        }
        printf("%d\n",e);
    }

    return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <vector>
#define MAX 100

typedef long long ll;
using namespace std;

ll x[MAX + 10];
ll y[MAX + 10];
ll h[MAX + 10];

struct p
{
    ll x, y, h;
};

vector<p> vec;

int main()
{
    int n;
    p G;
    cin >> n;
    
    for (int i = 0; i < n; i++)
    {
        cin >> x[i] >> y[i] >> h[i];
        if (h[i] >= 1) G = p{x[i], y[i], h[i]};
    }
    
    for (int i = 0; i <= 100; i++)
    {
        for (int j = 0; j <= 100; j++)
        {
            bool is_equal = true;
            ll v = abs(G.x - i) + abs(G.y - j) + G.h; v = max(v, 0LL);
            for (int k = 0; k < n; k++)
            {
                ll ch = v - abs(x[k] - i) - abs(y[k] - j); ch = max(ch, 0LL);
                if (ch != h[k])
                {
                    is_equal = false;
                    break;
                }   
            }
            if (is_equal)
            {
                vec.push_back(p{i, j, v});
            }
        }
    }
    
    if (vec.size() == 1) 
        cout << vec[0].x << " " << vec[0].y << " " << vec[0].h << endl;
    return 0;
}

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

#define pb push_back
#define int ll

using ll=long long;
using pii=pair<int,int>;
using vpii=vector<pii>;
using vvpii=vector<vpii>;
using vi=vector<int>;
using vvi=vector<vi>;

signed main() {
    ios_base::sync_with_stdio(false);

  int n, m;
  cin >> n >> m;
  vi as(n);
  for (int& ai: as) {
    cin >> ai;
  }
  sort(as.begin(), as.end(), greater<int>());
  int sum = 0;
  for (int i=0; i<n; ++i) {
    sum += as[i];
  }
  int i;
  for (i=0; i<n; ++i) {
    if (sum > 4*m*as[i]) {
      break;
    }
  }
  if (i < m) {
    cout << "No\n";
  } else {
    cout << "Yes\n";
  }
}


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

r = 10**9 + 7

dp=[[0 for i in range(W)] for j in range(H+1)]

dp[0][0]=1

num = [1,1,2,3,5,8,13,21]

if W!=1:
    for i in range(H):
        for j in range(W):
            if j==0:
                dp[i+1][j]=(num[W-1]*dp[i][j]+num[W-2]*dp[i][j+1])%r
            elif j==W-1:
                dp[i+1][j]=(num[W-1]*dp[i][j]+num[W-2]*dp[i][j-1])%r
            else:
                dp[i+1][j]=(num[j]*num[W-j-1]*dp[i][j]+num[j-1]*num[W-j-1]*dp[i][j-1]+num[j]*num[W-j-2]*dp[i][j+1])%r
    print(dp[H][K-1])
else:
    print(1)


Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int A = Integer.parseInt(sc.next());
    int B = Integer.parseInt(sc.next());

    int result = B;
    if ((N * A) <= B)
      result = A * N;

    System.out.println(result);

  }
}


Measured memory_bytes: 22608
#include <bits/stdc++.h>
#define int long long
#define double long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define pii pair<int,int>
#define ff first
#define ss second
#define frr(i,n) for(int i=0;i<n;i++)
#define td(v) v.begin(),v.end()
#define inf 1000000000 // 1e9
#define M   1000000007 // 1e9 + 7
using namespace std;
inline int mod(int n, int m){ int ret = n%m; if(ret < 0) ret += m; return ret; }
int gcd(int a, int b){return (b == 0 ? a : gcd(b, a%b));}
int lcm(int a,int b){return (a*b)/gcd(a,b);}
int exp(int a,int b,int m){
    if(b==0) return 1;
    if(b==1) return mod(a,m);
    int k = mod(exp(a,b/2,m),m);
    if(b&1){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}
struct SegmentTree{
    struct node{
        int val=0;
        int lazy=0;
        node(){}
        node(int val,int lazy) : val(val), lazy(lazy){}
    };
    std::vector<node> stree;
    SegmentTree(){}
    SegmentTree(int size){
        stree.resize(4*size);
    }
    node merge(node a,node b){
        return node(a.val+b.val,a.lazy+b.lazy);
    }
    // root = 1;
    void propagate(int cur,int l,int r){
        if(stree[cur].lazy==0) return;
        stree[cur].val += stree[cur].lazy*(r-l+1); // r-l+1 quantidade de elementos
        if(l!=r){
            stree[2*cur].lazy += stree[cur].lazy;
            stree[2*cur+1].lazy += stree[cur].lazy;
        }
        stree[cur].lazy = 0;
    }
    void updaterange(int cur,int l,int r,int a,int b,int x){ // l r ->posiçoes atuais
        propagate(cur,l,r);
        if(r<a || l>b){
            return;
        }
        if(a <= l && r <= b){
            stree[cur].lazy += x;
            propagate(cur,l,r);
            return;
        }
        int m = (l+r)>>1;
        updaterange(2*cur,l,m,a,b,x);
        updaterange(2*cur+1,m+1,r,a,b,x);
        stree[cur] = merge(stree[2*cur],stree[2*cur+1]);
        return;
    }
    node query(int cur,int l,int r,int a,int b){ // l r ->posiçoes atuais
        propagate(cur,l,r);
        if(r<a || l>b){
            return node(0,0);
        }
        if(a <= l && r <= b) return stree[cur];
        int m = (l+r)>>1;
        node x = query(2*cur,l,m,a,b);
        node y = query(2*cur+1,m+1,r,a,b);
        return merge(x,y);
    }
};
int32_t main(){
    fastio;
    int n,m;
    cin >> n >> m;
    SegmentTree Tree(n+200);
    for(int i=0;i<m;i++){
        int l,r;
        cin >> l >> r;
        Tree.updaterange(1,1,n,l,r,1);
    }
    int ans = 0;
    for(int i=1;i<=n;i++){
        int k = Tree.query(1,1,n,i,i).val;
        if(k==m){
            ans++;
        }
    }
    cout << ans << endl;
}

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

using namespace std;

#define PI 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679L

int main()
{
	long double x , y;
	char c;
	long double nowX = 0.0L , nowY = 0.L , nowA = 0.L;
	while(cin >> x >> c >> y , x || y)
	{
		nowX += cosl(PI*nowA / 180.L)*x;
		nowY += sinl(PI*nowA / 180.L)*x;
		nowA += y;
		if(nowA > 360.L)
		{
			nowA -= 360.L;
		} else if(nowA < 0.0L)
		{
			nowA += 360.L;
		}
	}
	cout << ( long long int )nowY << endl << ( long long int )nowX << endl;
}

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

using namespace std;

int main(void) {
    int N, D;
    cin >> N >> D;
    vector< vector<int> > X(N, vector<int>(D));
    for(int i=0; i<N; i++) {
        for(int j=0; j<D; j++) {
            cin >> X[i][j];
        }
    }

    int ans = 0;
    for(int i=0; i<N; i++) {
        for(int j=i+1; j<N; j++) {
            double dist = 0.0;
            for(int k=0; k<D; k++) {
                dist += (double)(X[i][k] - X[j][k]) * (double)(X[i][k] - X[j][k]);
            }
            if(sqrt(dist) - (int)sqrt(dist) < 1e-5) {
                ++ans;
            }
        }
    }

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


Measured memory_bytes: 256
N = int(input())
S = input()

res = float('inf')
W_sum = [0]
E_sum = [S.count('E')]
for i in range(0, N):
    W_sum.append(W_sum[i] + 1 if S[i] == 'W' else W_sum[i]) 
    E_sum.append(E_sum[i] - 1 if S[i] == 'E' else E_sum[i])
    res = min(res, W_sum[i] + E_sum[i])

res = min(res, W_sum[-1] + E_sum[-1])
print(res)

Measured memory_bytes: 17640
#include <iostream>
#include <iomanip>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    int n;
    double sum = 0;
    cin >> n;
    vector< pair<double, double> > d(n);
    for (int i = 0; i < n; ++i) cin >> d.at(i).first >> d.at(i).second;
    vector<int> ord(n);
    iota(ord.begin(), ord.end(), 0);
    do {
        for (int i = 1; i < n; ++i) sum += sqrt(pow(d.at(ord.at(i)).first - d.at(ord.at(i - 1)).first, 2) + pow(d.at(ord.at(i)).second - d.at(ord.at(i - 1)).second, 2));
    } while (next_permutation(ord.begin(), ord.end()));
    for (int i = 1; i <= n; ++i) sum /= i;
    cout << setprecision(15) << sum << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static long Mod = (long)1e9 + 7;
        static void Main(string[] args)
        {
            SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            Out.Flush();
            Read();
        }
        static long N, Z, W;
        static long[] Ai;
        static long[][] points;
        static void Solve()
        {
            var NZW = Sarray();
            N = NZW[0];
            Z = NZW[1];
            W = NZW[2];
            Ai = Sarray();
            points = Enumerable.Range(0, 2).Select(_ => Enumerable.Repeat(-1L, (int)N).ToArray()).ToArray();
            var max = long.MinValue;
            for (var i = N - 1; 0 <= i; --i)
                max = Max(max, dfsZ(i));
            WriteLine(max);
        }
        static long dfsZ(long t)
        {
            long tZ = Z, tW = W;
            try
            {
                Z = Ai[t];
                if (N - 1 == t)
                    return Abs(Z - W);
                if (-1 != points[0][t]) return points[0][t];
                var res = long.MaxValue;
                for (var i = N - 1; t < i; --i)
                    res = Min(res, dfsW(i));
                return points[0][t] = res;
            }
            finally { Z = tZ; W = tW; }
        }
        static long dfsW(long t)
        {
            long tZ = Z, tW = W;
            try
            {
                W = Ai[t];
                if (N - 1 == t)
                    return Abs(Z - W);
                if (-1 != points[1][t]) return points[1][t];
                var res = long.MinValue;
                for (var i = N - 1; t < i; --i)
                    res = Max(res, dfsZ(i));
                return points[1][t] = res;
            }
            finally { Z = tZ; W = tW; }
        }
    }
}

Measured memory_bytes: 28908
#A
N = int(input())
playlist = []
timelist = []
for _ in range(N):
    s, t = input().split()
    playlist.append(s)
    timelist.append(int(t))

X = input()
last_played = playlist.index(X)

try:
    print(sum(timelist[last_played+1:]))
except:
    print(0)

Measured memory_bytes: 3060
#include <stdio.h>

int main()
{
	int a, b;
	scanf("%d %d", &a, &b);
	
	if (a==1 && b==2)
{
	printf("3");
}
	else if(a==2 && b==1)
{
	printf("3");
}
	else if(a==2 && b==3)
{
	printf("1");
}
	else if(a==3 && b==2)
{
	printf("1");
}
	else if (a==1 && b==3)
{
	printf("2");
}
	else if(a==3 && b==1)
{
	printf("2");
}
    return 0;



}


Measured memory_bytes: 3120