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

#define MAX 100000
typedef long long ll;

int n, k;
ll w[MAX];

int check(ll mid){
  int j = 0;
  for(int i = 0; i < k; i++){
    ll s = 0;
    while(mid >= w[j] + s){
      s += w[j];
      j++;
      if(j == n) return n;
    }
  }
  return j;
}

int solve(){
  ll left = 0;
  ll right = 100000 * 10000;
  ll mid;

  while(right - left > 1){
    mid = (right + left) / 2;
    int x = check(mid);
    //  cout << x << endl;
    if(x >= n) right = mid;
    else left = mid;
  }
  return right;
}
int main(){


  cin >> n >> k;

  for(int i = 0; i < n; i++){
    cin >> w[i];
  }
  ll ans = solve();
  cout << ans << endl;
}

Measured memory_bytes: 1944
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(input())

people = [[-1 for _ in range(N)] for _ in range(N)]
for i in range(N):
    A = int(input())
    for j in range(A):
        x, y = map(int, input().split())
        x -= 1
        people[i][x] = y

def countB(b):
    ret = 0
    while b > 0:
        if b % 2 == 1:
            ret += 1
        b //= 2

    return ret

ans = 0
for i in range(2 ** N):
    hs = [-1] * N
    contradiction = False
    for j in range(N):
        if i & 1 << j > 0:
            for k in range(N):
                if people[j][k] == -1:
                    continue
                if hs[k] == -1:
                    hs[k] = people[j][k]
                else:
                    if hs[k] != people[j][k]:
                        contradiction = True
    if not contradiction:
        for j in range(N):
            if hs[j] == -1:
                continue
            if i & 1 << j > 0 and hs[j]:
                continue
            if i & 1 << j == 0 and not hs[j]:
                continue
            else:
                break
        else:
            ans = max(ans, countB(i))
print(ans)
    




Measured memory_bytes: 3312
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define sl set<ll>
#define vs vector<string>
#define vl vector<ll>
#define vi vector<int>
#define vpl vector<pair<ll,ll>>
#define pb push_back
#define PI 3.14159265358979323846
#define ll long long
#define ld long double
#define endl "\n"
#define rep(i,a,b) for (ll i = (a); i < (b); i++)
#define repp(i,a,b) for (ll i = (a); i >= (b); i--)
#define rop(i,a,b)  for(ll i=(a); i>(b); i--)
#define min3(a, b, c) min(c, min(a, b))
#define min4(a, b, c, d) min(d, min(c, min(a, b)))
#define tt long long t; cin>>t; while(t--)
#define IOS ios::sync_with_stdio(0);cin.tie(0);
const int maxn=1e5+100;

int main()
{
	ll a,b,c,d;
	cin>>a>>b>>c>>d;
	ll m=max(1LL*a*c,1LL*a*d);
	ll n=max(1LL*b*c,1LL*b*d);
	cout<<max(m,n);
	
}

Measured memory_bytes: 3632
/******* all required header files *******/
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
using namespace std;

/*****All definitions*******/
#define w(t) int t; cin>>t; while(t--)
#define vi vector<int>
#define vs vector<string>
#define vc vector<char>
#define mp make_pair
#define ll long long int
#define pb push_back
#define F first
#define S second
/***************************/

int main()
{
/*#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif*/

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int a;
	for(int i = 1; i < 6; i++)
	{
		cin>>a;
		if(a == 0)
		{
			cout<<i;
			break;
		}
	}

	return 0;
}
	

Measured memory_bytes: 3600
#include <iostream>

using namespace std;

void solve()
{
	int p;
	while(cin >> p, p)
	{
		p = 1000 - p;
		int ans = 0;
		if(p >= 500)
		{
			p -= 500;
			++ans;
		}
		if(p >= 100)
		{
			int k = p / 100;
			p -= k * 100;
			ans += k;
		}
		if(p >= 50)
		{
			p -= 50;
			++ans;
		}
		if(p >= 10)
		{
			int k = p / 10;
			p -= k * 10;
			ans += k;
		}
		if(p >= 5)
		{
			p -= 5;
			++ans;
		}
		if(p >= 1)
		{
			ans += p;
		}
		cout << ans << endl;
	}
}

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

Measured memory_bytes: 1160
N = int(input())
A = list(map(int, input().split()))

for n in range(N // 2, 0, -1):
    if A[n-1] == sum(A[2*n-1:N:n]) % 2:
        A[n-1] = 0
    else:
        A[n-1] = 1

ans = sum(A)
print(ans)
if ans > 0:
    print(*[i+1 for i, a in enumerate(A) if a == 1], sep=" ")


Measured memory_bytes: 11704
#[test]
fn test_solve() {
    assert_eq!(solve("-9\n"), "1011\n");
    assert_eq!(solve("123456789\n"), "11000101011001101110100010101\n");
    assert_eq!(solve("0\n"), "0\n");
}

fn solve(src: &str) -> String {
    let mut sc = Scanner::from_str(src);

    let mut n: i64 = sc.read();
    if n == 0 {
        return "0\n".to_string();
    }

    let mut s = String::new();
    s.push('\n');

    for i in 0..32 {
        if n == 0 {
            break;
        }
        if n.abs() & (1 << i) != 0 {
            s.push('1');
            n -= (-2i64).pow(i);
        } else {
            s.push('0');
        }
    }

    s.chars().rev().collect()
}

fn main() {
    let mut buf = String::new();
    use std::io;
    use std::io::{Read, Write};
    io::stdin().read_to_string(&mut buf).unwrap();
    io::stdout().write_all(solve(&buf).as_bytes()).unwrap();
}

struct Scanner<'a>(std::str::SplitWhitespace<'a>);
impl<'a> Scanner<'a> {
    fn from_str(src: &str) -> Scanner {
        Scanner(src.split_whitespace())
    }
    fn get(&mut self) -> &str {
        self.0.next().unwrap()
    }
    fn read<T: std::str::FromStr>(&mut self) -> T {
        self.get().parse().ok().unwrap()
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
#define int long long
int p;
struct StarrySky{
  int n;
  const int def=1;
  vector<int> datm,data;
  StarrySky(){}
  StarrySky(int n_){init(n_);}
  void init(int n_){
    n=1;
    while(n<n_) n*=2;
    datm.clear();
    datm.resize(n*2-1,def);
    data.clear();
    data.resize(n*2-1,0);
  }
  void add(int a,int b,int x,int k,int l,int r){
    if(r<=a||b<=l) return;
    if(a<=l&&r<=b){
      (data[k]+=x)%=p;
      return;
    }
    add(a,b,x,k*2+1,l,(l+r)/2);
    add(a,b,x,k*2+2,(l+r)/2,r);
    datm[k]=max(datm[k*2+1]+data[k*2+1],datm[k*2+2]+data[k*2+2]);
  }
  int query(int a,int b,int k,int l,int r){
    if(r<=a||b<=l) return def;
    if(a<=l&&r<=b) return datm[k]+data[k];
    int vl=query(a,b,k*2+1,l,(l+r)/2);
    int vr=query(a,b,k*2+2,(l+r)/2,r);
    return max(vl,vr)+data[k];
  }
  void add(int a,int b,int x){
    add(a,b,x,0,0,n);
  }
  int query(int a,int b){
    return query(a,b,0,0,n)%p;
  }
};
signed main(){
  int a,b;
  while(cin>>a>>b>>p,a||b||p){
    int n=b-a+1;
    //cout<<n<<endl;
    StarrySky ss(n);
    vector<string> vs(n);
    for(int i=0;i<n;i++) vs[i]=to_string(a+i);
    sort(vs.begin(),vs.end());
    map<string,int> ms;
    for(int i=0;i<n;i++) ms[vs[i]]=i;
    int ans=0;
    for(int i=0;i<n;i++){
      int k=ms[to_string(a+i)];
      int x=ss.query(k,k+1);
      ss.add(k+1,n,x);
      //cout<<a+i<<" "<<k<<":"<<x<<endl;
      (ans+=x)%=p;
    }
    cout<<ans<<endl;
  }
  return 0;
}

/*
verified on 2017/02/24
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_E
*/

Measured memory_bytes: 18756
#include "bits/stdc++.h"
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define replrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) replrev(i,0,n)
#define repi(itr,ds) for(auto itr = ds.begin(); itr != ds.end(); ++itr)
#define mp make_pair
#define INF 2000000000
#define INFL 2000000000000000000LL
#define EPS 1e-9
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<P> vP;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<double> > vvd;
typedef vector<vector<P> > vvP;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<P, vector<P>, greater<P> > pqlP;
typedef pair<int, pair<int, int> > Edge;
typedef vector<Edge> vE;
typedef priority_queue<Edge, vector<Edge>, greater<Edge> > pqlE;


//#define DEBUG

#ifdef DEBUG
#define dprintf printf
#define dbg 
#define drepl(i,a,b) repl(i,a,b)
#define drep(i,n) rep(i,n)
#else
#define dprintf (true)?0:printf
#define dbg if(false)
#define drepl(i,a,b) int i; if(false)
#define drep(i,n) int i; if(false)
#endif // DEBUG



int main() {
	int N, L, T;
	cin >> N >> L >> T;
	vll x(N);
	vi w(N);
	rep(i, N) {
		cin >> x[i] >> w[i];
	}
	int w0 = w[0];
	int x0 = x[0];
	ll hit = 0;
	rep(i, N) {
		if (w[i] != w0) {
			int dist;
			if (w0 == 1) {
				dist = x[i] - x0;
			}
			else {
				dist = L - (x[i] - x0);
			}
			if (dist < 2 * T) {
				hit += (2 * T - dist - 1) / L + 1;
			}
		}

		if (w[i] == 1) {
			x[i] = (x[i] + T) % L;
		}
		else {
			x[i] = (x[i] - (T % L) + L) % L;
		}
	}
	x0 = x[0];
	hit %= N;

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

	int id;
	rep(i, N) {
		if (x[i] == x0) {
			if (i != N - 1 && x[i + 1] == x0 && w0 == 2) {
				id = i + 1;
			}
			else {
				id = i;
			}
			break;
		}
	}

	if (w0 == 1) {
		rep(i, N) {
			cout << x[(id - hit + i + N) % N] << endl;
		}
	}
	else {
		rep(i, N) {
			cout << x[(id + hit + i) % N] << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 2432
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<iomanip>
using namespace std;

int main(){
    int n,k;
    cin>>n;
    int a[n],minv=1e9;
    int cnt=0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        minv=min(minv,a[i]);
        if(minv==a[i])cnt++;
    }
    cout<<cnt<<endl;
    return 0;
}

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

int main(){
    double r;
    cin >> r;
    
    cout << setprecision(100) << r*r*M_PI << " " << setprecision(100) << 2*r*M_PI << endl;
    
    return 0;
}



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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (int i = (int)a; i < (int)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define MOD 1000000007
#define INF 1000000000
#define PI 3.14159265359
#define EPS 1e-12

int main(void)
{
  ll x;
  cin >> x;

  ll ans = (x/11)*2;
  if(x%11 > 6) ans += 2;
  else if(x % 11 > 0) ans++;

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
using namespace std;

class Dice
{
private:
    //頂点
    int top;
    //底
    int bot;
    //左
    int left;
    //右
    int righ;
    //上
    int up;
    //下
    int down;

public:
    //コンストラクタ。目の代入
    Dice(int c1, int c2, int c3, int c4, int c5, int c6)
    {
        top = c1;
        down = c2;
        righ = c3;
        left = c4;
        up = c5;
        bot = c6;
    }

    //topを返す
    int Get_top()
    {
        return top;
    }

    //回転
    void roll(char D)
    {
        //数字一時保存用
        int num;

        if (D == 'N')
        {
            num = top;
            top = down;
            down = bot;
            bot = up;
            up = num;
            return;
        }

        if (D == 'S')
        {
            num = top;
            top = up;
            up = bot;
            bot = down;
            down = num;
        }

        if (D == 'E')
        {
            num = top;
            top = left;
            left = bot;
            bot = righ;
            righ = num;
        }

        if (D == 'W')
        {
            num = top;
            top = righ;
            righ = bot;
            bot = left;
            left = num;
        }
    }
};

int
main(void)
{
    char inp[1000];
    char *dicch;
    int diceinp[6];
    int result;

    fgets(inp, sizeof(inp), stdin);
    dicch = strtok(inp, " ");
    sscanf(dicch, "%d\n", &diceinp[0]);

    for (int i = 1; i < 6; i++)
    {
        dicch = strtok(NULL, " ");
        sscanf(dicch, "%d\n", &diceinp[i]);
    }

    Dice dice(diceinp[0], diceinp[1], diceinp[2], diceinp[3], diceinp[4], diceinp[5]);

    fgets(inp, sizeof(inp), stdin);

    for (int j = 0; inp[j] != '\0'; j++)
    {
        dice.roll(inp[j]);
    }

    result = dice.Get_top();

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

    return 0;
}


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

using namespace std;
typedef long long ll;
#define pll pair<ll,ll>
#define pii pair<int,int>
#define fr first
#define sc second
#define pb push_back
#define mp make_pair
#define forr(i,a,b) for(ll i=a;i<b;i++)
#define mod 1000000007
ll n,m,k,x,y,z,t,a,b,s=0;

int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin>>a>>b;
if((a*b)&1)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}


Measured memory_bytes: 256
A,B,K = map(int,input().split())

st = A

di = {}
o = []

for i in range(K):
    if A<=st+i and st+i<=B:
        di[st+i] = 1

st = B+1-K

for i in range(K):
    if A <= st + i and st + i <= B:
        di[st+i] = 1

for ke in di.keys():
    o.append(ke)

o.sort()

for item in o:
    print(item)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>
#include <functional>
#include <iomanip>

using namespace std;

#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ;
#endif

#define equals(a,b) (fabs((a)-(b)) < EPS)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

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

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

template <typename T>
void print_array(const T &ary, int size){
    REP(i,size){
        cout << ary[i] << " ";
    }
    cout << endl;
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(12);
    string n; cin >> n;
    LL acc = 0;
    int len = n.length();
    REP(i,len){
        acc += n[i] - '0';
    }
    if(acc % 9 == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;

    }

}

Measured memory_bytes: 3760
#include <iostream>
#include <vector>
#include <bitset>
#include <utility>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
 
using namespace std;
typedef long long ll;

ll getans(const vector<ll> &t,int l, int r, int rl, int rr, int k){
  if(r<rl || rr<l) {
    return (ll)0;
  }else if(l<=rl && rr<=r) {
    return t[k];
  }else{
    return (getans(t,l,r,rl,(rl+rr)/2,2*k+1)|getans(t,l,r,(rl+rr)/2+1,rr,2*k+2));
  }
}

int main(){
  int N,Q;
  string S;
  cin >> N >> S >> Q;

  //cout << "#" << N << " " << S << " " << Q << endl;
  
  int n=1;
  for(n=1;;n*=2) {if(N<=n) break;}
  //cout << "#" << n << endl;
  
  vector<ll> t(2*n-1,0);

  for(int i=0;i<N;i++){
    t[n+i-1]=(ll)1<<(S[i]-'a');
  }    

  for(int i=n-2;0<=i;i--){
    t[i]=t[2*i+1]|t[2*i+2];
  }

  vector<int> ans;

  int q;
  int iq;
  string cq;
  int l,r;
  for(int j=0;j<Q;j++){
    cin >> q;
    if(q==1){
      cin >> iq >> cq;
      iq--;
      t[n-1+iq]=((ll)1)<<(cq[0]-'a');
      //cout << "#" << t[n-1+iq] << endl;
      for(int i=(n-2+iq)/2;0<i;i=(i-1)/2){
	t[i]=(t[2*i+1]|t[2*i+2]);
      }
      t[0]=(t[1]|t[2]);
    }else{
      cin >> l >> r;
      if(l>r) {swap(l,r);}
      ans.push_back(__builtin_popcount(getans(t,l-1,r-1,0,n-1,0)));
    }
  }
  for(auto ai:ans) cout << ai << endl;
  
  return 0;
}


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

int main()
{
	long long L;
	while(cin>>L,L){
		long long ans = 1;
		for(long long i=2; i*i<=L; i++){
			if(L%i==0){
				int c = 1;
				for(;L%i==0;L/=i)c++;
				ans*=c*2-1;
			}
		}
		if(L>1)ans*=3;
		printf("%lld\n",(ans+1)/2);
	}
	return 0;
}

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

void solve()
{
    int x, y;
    cin >> x >> y;

    if(y<=x*4 && y>=x*2 && y%2==0)
    {
        cout << "Yes" << endl;
    }
    else
        cout << "No" << endl;
}


int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll t;
    solve();
    return 0;
}


Measured memory_bytes: 3640
#include<cstdio>
#include<algorithm>
using namespace std;
int n,k;
int a,b,deg[5];
int main(){
	for(int i=1;i<=3;++i){
		int x,y;
		scanf("%d%d",&x,&y);
		++deg[x],++deg[y];
	}
	sort(deg+1,deg+5);
	if(deg[1]==deg[2]&&deg[2]==1&&deg[3]==deg[4]&&deg[3]==2)puts("YES");
	else puts("NO");
	return 0;
}

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

int main(void){
  int n;
  scanf("%d",&n);
  
  int t = n , flag = 0;

  while(flag == 0){
    for(int i = 2;i <= sqrt(t);i ++){
      if(t%i == 0){
        flag = 1;
      }
    }
    if(flag == 1){
      flag = 0;
      t ++;
    }
    else{
      flag = 1;
    }
  }

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

  return 0;
}

Measured memory_bytes: 128
let id x = x

let s = Scanf.scanf "%s\n" id

let s_len = String.length s

let a = 
  let rec f t d arr =
    if d = s_len then arr
    else begin
      let v = int_of_char s.[s_len - d - 1] - 48 in
      let b = (v * t) mod 2019 in
      arr.(d + 1) <- (arr.(d) + b) mod 2019;
      f (t * 10 mod 2019) (d + 1) arr
    end
  in
  f 1 0 (Array.make (s_len + 1) 0)

let ans = ref 0

let () =
  let rec f arr i =
    let v = a.(i) in
    ans := !ans + arr.(v);
    arr.(v) <- arr.(v) + 1;
    if i < s_len then f arr (i + 1)
  in
  f (Array.make 2020 0) 0;
  print_int !ans

Measured memory_bytes: 6188
#include <bits/stdc++.h>
 #include <math.h>
 #include <string>
 using namespace std;
 
 int main(){
    int N;
    int i,j;
    bool ans = false;

    cin >> N;

    for(i=0; i < 26; i++){
        for(j=0; j < 26; j++){
            if(N == (i*4 + 7*j)){
                ans = true;
                break;
                }
        }
        if(ans == true)
            break;
        }

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


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <set>
#include <map>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
#include <vector>
#include <bitset>
#include <algorithm>
#include <deque>

using namespace std;

#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define FORD(i,a,b) for(int i = (a); i >= (b); i--)
#define REP(i,n) for(int i = 0; i < (n); i++)
#define REPD(i,n) for(int i = (n) - 1; i >= 0; i--)

#define sqr(x) (x)*(x)

#define ii pair<int,int>
#define iii pair<int,ii>
#define fi first
#define se second
#define mp make_pair

#define ll long long
#define sz(x) (int)x.size()
#define ALL(x) x.begin(), x.end()

#define vi vector<int>
#define vii vector<ii>
#define pb push_back

#define next AndreaPirlo
#define prev FrancescoTotti
#define mod 1337377
#define maxn 100010


int n, a[maxn], forw[maxn], backw[maxn];

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

    cin >> n;
    FOR(i, 1, n) cin >> a[i];
    FOR(i, 1, n) forw[i] = forw[i - 1] + abs(a[i] - a[i - 1]);
    FORD(i, n, 1) backw[i] = backw[i + 1] + abs(a[i] - a[i + 1]);

    FOR(i, 1, n) {
        int res = forw[i - 1] + backw[i + 1] + abs(a[i + 1] - a[i - 1]);
        cout << res << '\n';
    }
}


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

int main() {
  while(1) {
    int n;
    cin >> n;
    if(n == 0) break;

    int max = INT_MIN;
    int maxBfr = INT_MIN;
    int bfr = INT_MIN;
    int before = INT_MIN;

    int temp;
    for(int i = 0; i < n; i++) {
      cin >> temp;

      if(maxBfr > 0) {
	maxBfr += bfr;
      } else {
	maxBfr = bfr;
      }

      int sum;
      sum = maxBfr+temp;

      if(maxBfr != INT_MIN && sum > max && sum > temp) {
	max = sum;
      } else if(temp > max) {
	max = temp;
      }

      bfr = temp;
    }

    cout << max << endl;
  }
  return 0;
}

Measured memory_bytes: 0
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

	static Scanner scanner;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    String S=gs()+gs();
	    int n=Integer.parseInt(S);
	    
	    int i=0;
	    while (i*i<=n) {
	    	if(n==i*i) {
	    		System.out.println("Yes");
	    		return;
	    	}
	    	i++;
	    }
	    System.out.println("No");
//	    if (isNumber(s1) && isNumber(s2) && s.charAt(a) == '-') {
//	    	System.out.print("Yes");
//	    }else {
//	    	System.out.print("No");
//	    }



	}

public static boolean isNumber(String val) {
	try {
		Integer.parseInt(val);
		return true;
	} catch (NumberFormatException nfex) {
		return false;
	}
}

	public static int d(int n) {
		int m=0;
		while(true) {
			if(n<1) {
				break;
			}
			int l= n%10;
			m+=l;
			n= (n-l)/10;
		}
		return m;
	}
	public static long d(long n) {
		String a=String.valueOf(n);
		return (long)a.length();
	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

Measured memory_bytes: 39272
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <assert.h>
#include <iomanip>


int max1 = 1e9;

using namespace std;

int main(int argc, const char * argv[]) {

    std::ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    cin.tie(NULL);
 	int n,k,aux;
	cin >> n >> k;
	vector<int> fruits;
	for(int i =0;i<n;i++){
		cin >> aux;
		fruits.push_back(aux);
	}
	sort(fruits.begin(),fruits.end());
	int soma=0;
	for(int i =0;i<k;i++){
		soma += fruits[i];
	}
	cout << soma << endl;

	return 0;
}



Measured memory_bytes: 3648
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














int N, AB[18][2];
int dp[1 << 18][51];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N;
	rep(i, 0, N) cin >> AB[i][0];
	rep(i, 0, N) cin >> AB[i][1];

	rep(msk, 0, 1 << N) rep(lst, 0, 51) dp[msk][lst] = inf;

	dp[0][0] = 0;
	rep(msk, 0, 1 << N) rep(lst, 0, 51) if (dp[msk][lst] != inf) {
		int done = 0;
		rep(i, 0, N) if (msk & (1 << i)) done++;

		rep(i, 0, N) {
			if (msk & (1 << i)) continue;

			int p = abs(done - i) % 2;
			if (AB[i][p] < lst) continue;

			int c = 0;
			rep(j, 0, i) if (!(msk & (1 << j))) c++;

			chmin(dp[msk | (1 << i)][AB[i][p]], dp[msk][lst] + c);
		}
	}

	int ans = inf;
	rep(lst, 0, 51) chmin(ans, dp[(1 << N) - 1][lst]);

	if (ans == inf) ans = -1;
	cout << ans << endl;
}







Measured memory_bytes: 52480
//g++ -std=gnu++14 a.cpp
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>

using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;

int main() {
  ll X;
  cin >> X;
  ll ans = X;
  bool hantei = true;
  bool somosomo = true;
  if(X != 2){
    for(int i = 2;i < ans;i++){
      if(X%i == 0){
        somosomo = false;
        break;
      }
    }
  }
  if(X == 2){
    cout << 2 <<endl;
  }
  else if(somosomo){
      cout << X <<endl;
  }else{
    while(hantei){
      ans++;
      for(int i = 2;i < ans;i++){
        if(ans%i == 0){
          break;
        }else{
          ans += 0;
        }
        if(i == ans-1){
          hantei = false;
          break;
        }
      }
    }
    cout << ans <<endl;
  }


}


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

int main()
{
    string S;
    cin >> S;
    int c=0, flag =0;
    if (S[0] == 'A') {
        // S.erase(0, 1);
        S[0] ='a';
        for(int i = 2; i < S.length() -1; i++)
        {
            if (S[i] == 'C') {
                c++;
                // S.erase(i, 1);
                S[i] = 'c';
            }
        }
        if (c==1) {
            for(auto x : S){
                if ((x >= 'A') && (x<= 'Z'))
                {
                    flag++;
                }
            }
            if (flag == 0) {
                cout << "AC" << endl;
            }
            else
            {
                cout << "WA" << endl;
            }
        }
        else
        {
            cout << "WA" << endl;
        }
    }
    else
    {
        cout << "WA" << endl;
    }
    
    
    return 0;
}

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

int dfs(vector<int> edges[], vector<int> &dp, int sv){
    if(dp[sv] != -1)
        return dp[sv];
    int maxLen = 0;
    for(int neighbour: edges[sv]){
        int currLen = dfs(edges, dp, neighbour) + 1;
        if(currLen > maxLen)
            maxLen = currLen;
    }
    dp[sv] = maxLen;
    return maxLen;
}

int main()
{
 int n, m;
 cin>>n>>m;
 vector<int> edges[n];
 int u, v;
 for(int i=0; i<m; i++){
    cin>>u>>v;
    edges[u-1].push_back(v-1);
 }
 int maxLen = 0;
 vector<int> dp(n, -1);
 for(int i=0; i<n; i++){
    if(dp[i] == -1){
        int currLen = dfs(edges, dp, i);
        if(currLen > maxLen)
            maxLen = currLen;
    }
 }
 cout<<maxLen;
 return 0;
}



Measured memory_bytes: 11868
#include "bits/stdc++.h"
#include <math.h>
#include <time.h>
using namespace std;
const long long mod = 1000000007;
#define ll long long
#define P pair<int, int>
#define dump(x)                             \
    if (dbg) {                              \
        cout << #x << " = " << (x) << endl; \
    }
bool dbg = false;
long long gcd(long long a, long long b){
   if (a % b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a % b));
   }
}
long long lcm(long long a, long long b){
   return (a / gcd(a, b))* b;
}
//---------------------------------------------------------------------------------------------------
/*ここからいじる*/
//---------------------------------------------------------------------------------------------------
int n, k;

void solve(){
}
int main(){
    double pi = 3.1415926535897932384626;
    int r;
    cin >> r;
    cout << fixed << setprecision(10);
    cout << 2 * r * pi << endl;
    solve();
    return 0;
}



Measured memory_bytes: 3784
#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define ms(a,b) memset(a,b,sizeof(a))
#define msn(a,n,b) for(int i=0;i<=n;i++)a[i]=b
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define fi first
#define se second
using namespace std;
mt19937 rng_32(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
const int mod=1e9+7;
const int seed=233;
const double PI=acos(-1.0);
const double eps=1e-7;
const int inf=0x3f3f3f3f;
const int max_n=100005;
namespace {
    inline int Add(int x,int y){return (x+=y)>=mod?x-mod:x;}
    inline int Sub(int x,int y){return (x-=y)<0?x+mod:x;}
    inline int Mul(int x,int y) {return 1ll*x*y%mod;}
    inline int Pow(int x,int y=mod-2){if(y==0)return 1;int res=1;while(y){if(y&1)res=1ll*res*x%mod;x=1ll*x*x%mod;y>>=1;}return res;}
}
/**********************head************************/
char s[25][25];
int n,m;
int d[25][25];
int dx[4]={1,0,0,-1};
int dy[4]={0,1,-1,0};
int ans=0;
void solve(int sx,int sy){
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++)d[i][j]=inf;
    }
    d[sx][sy]=0;
    queue<P> que;
    que.push(P(sx,sy));
    while(!que.empty()){
        P p=que.front();que.pop();
        for(int i=0;i<4;i++){
            int nx=p.fi+dx[i],ny=p.se+dy[i];
            if(nx>=1&&nx<=n&&ny>=1&&ny<=m&&s[nx][ny]!='#'&&d[nx][ny]==inf){
                d[nx][ny]=d[p.fi][p.se]+1;
                que.push(P(nx,ny));
            }
        }
    }
    
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(s[i][j]!='#')ans=max(ans,d[i][j]);
        }
    }
    /*
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(s[i][j]!='#')cout<<i<<' '<<j<<' '<<d[i][j]<<endl;
        }
    }
    */
}
int main(){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)scanf(" %s",s[i]+1);
    
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(s[i][j]!='#')solve(i,j);
        }
    }
    printf("%d\n",ans);
    
    //solve(3,1);
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define de(x) cout<<#x<<" = "<<x<<endl
#define sz(a) (int)(a.size())
#define mp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
typedef long long ll;
struct node  {
    int x,y;
}ns[105];

int x[105];
int main() {
    int n,k;
    while(~scanf("%d%d",&n,&k)) {
        rep(i,1,n) {
            scanf("%d%d",&ns[i].x,&ns[i].y);
            x[i]=ns[i].x;
        }
        sort(x+1,x+1+n);
        int xn=unique(x+1,x+1+n)-x-1;
        ll ans=-1;
        rep(i,1,xn) {
            rep(j,i+1,xn) {
                int l=x[i],r=x[j];
               // de(l);de(r);
                rep(p,1,n) {
                    rep(q,1,n) {
                        if(p==q) continue;
                        if(!(ns[p].x>=l&&ns[p].x<=r)) continue;
                        if(!(ns[q].x>=l&&ns[q].x<=r)) continue;
                        int up=max(ns[p].y,ns[q].y);
                        int down=min(ns[p].y,ns[q].y);
                        if(up==down) continue;
                        int cnt=0;
                        for(int a=1;a<=n;++a) {
                            if(ns[a].x>=l&&ns[a].x<=r&&ns[a].y>=down&&ns[a].y<=up) ++cnt;
                        }
                       // de(cnt);
                        if(cnt>=k) {
                            if(ans==-1) ans=1ll*(r-l+0ll)*(up-down+0ll);
                            else ans=min(ans,1ll*(r-l+0ll)*(up-down+0ll));
                        }
                    }
                }
            }
        }

        printf("%lld\n",ans);
    }
    return 0;
}




Measured memory_bytes: 256
#include<stdio.h>

#define MAX 500000

void maxHeapify(int k);

int H,A[MAX+1];

  
int main(void){
  int i;
  
  scanf("%d",&H);

  for(i = 1;i <= H;i++){
    scanf("%d",&A[i]);
  }

  for(i = H/2 ;i > 0;i--){ //
    maxHeapify(i);
  }

  for(i = 1;i <= H;i++){
    printf(" %d",A[i]);
  }

  puts("");

  return 0;
}


void maxHeapify(int k){
  int l,r;
  int largest;
  int temp = 0;
  
  l = 2*k;
  r = 2*k+1;

  if(l <= H && A[k] < A[l]){
    largest = l;
  } else {
    largest = k;
  }
  
  if(r <= H && A[largest] < A[r] ){
    largest = r;
  }

  if(largest != k){
    temp = A[k];        
    A[k] = A[largest] ;
    A[largest] = temp ;
    
    maxHeapify(largest);
  }
}



Measured memory_bytes: 3692
#include <bits/stdc++.h>
using namespace std;
//using Graph = vector<vector<edge>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

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

#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define query int qq;std::cin >> qq;rep(qqq,qq)
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
//#define vvector(name,typ,m,n)vector<vector<typ> > name(m,vector<typ> (n))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define res resize
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout << a<<" "<<b <<" "<< c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define ssum(a) accumulate(a,0ll) 

typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
//typedef long long T;
ll ceil(ll a,ll b){
    return ((a+b-1)/b);
}
const int INF = 2000000000;
const ll INF64 = 9223372036854775807ll;
const ll MOD = 1000000007ll;
const dou pi=3.141592653589793;
//mapは、if関数などで覗いただけで構成されるので注意しよう！
//std::vector<vector<int>> g;


//std::vector<std::set<int>> g;
int main(){
    int n,m;
    std::cin >> n>>m;
    std::vector<std::set<P>> a(n+1);
    std::vector<int> p(m),y(m);
    rep(i,m){
        std::cin >> p[i]>>y[i];
    }
    rep(i,m){
        a[p[i]].insert(mp(y[i],i));
    }
    std::vector<string> an(m),ans(m);
    rep(i,n+1){
        int c=0;
        erep(j,a[i]){
            c++;
            int d=j.fi,dd=j.se;
            ans[dd]=to_string(c);
            an[dd]=to_string(i);
        }
    }
    rep(i,m){
        while(an[i].size()!=6){
            an[i].insert(an[i].begin(),'0');
            
        }
        while(ans[i].size()!=6){
            ans[i].insert(ans[i].begin(),'0');
            
        }
        std::cout << an[i]<<ans[i] << std::endl;
    }
    
}

Measured memory_bytes: 22656
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

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

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

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

    int n, k; cin>>n>>k;
    int ans = 0;
    for(int i=0; i<n; i++){
        int h; cin>>h;
        ans += (k <= h);
    }
    cout << ans <<  endl;

    return 0;
}

Measured memory_bytes: 256
N = int(input())
a = list(map(int,input().split()))
import heapq
hq = a[:N]
fsum = [0]*(N+1)
fsum[0] = sum(hq)
heapq.heapify(hq)
for i in range(N):
    a_ = a[N+i]
    a_min = heapq.heappop(hq)
    if a_min < a_:
        fsum[i+1]=fsum[i]-a_min+a_
        a_min = a_
    else:
        fsum[i+1]=fsum[i]
    heapq.heappush(hq,a_min)
a = [-a[-i-1] for i in range(3*N)]
hq = a[:N]
lsum = [0]*(N+1)
lsum[0] = sum(hq)
heapq.heapify(hq)
for i in range(N):
    a_ = a[N+i]
    a_min = heapq.heappop(hq)
    if a_min < a_:
        lsum[i+1]=lsum[i]-a_min+a_
        a_min = a_
    else:
        lsum[i+1]=lsum[i]
    heapq.heappush(hq,a_min)
lsum.reverse()
ans = -float('inf')
for i in range(N+1):
    diff = fsum[i]+lsum[i]
    if ans < diff:
        ans = diff
print(ans)

Measured memory_bytes: 39252
#include <iostream>
#include <math.h>
#include <algorithm>
#include <queue>
#include <map>
#include <list>
//#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
typedef long long ll;

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

    return 0;
}

Measured memory_bytes: 3592
retu=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k=int(input())

print(retu[k-1])

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

#define int long long 
#define MIN -1e18
#define MAX 1e18

using namespace std;
int beki(int wa,int rr,int warukazu){
    if(rr==0) return 1%warukazu;
    if(rr==1) return wa%warukazu;
    wa%=warukazu;
    if(rr%2==1) return ((int)beki(wa,rr-1,warukazu)*(int)wa)%warukazu;
    int zx=beki(wa,rr/2,warukazu);
    return (zx*zx)%warukazu;
}
void solve()
{
    int n;cin >> n;
    int a=beki(10,n,1000000007);
    int b=beki(9,n,1000000007);
    int c=beki(8,n,1000000007);
    cout << (a+1000000007-b+1000000007-b+c)%1000000007 << endl;
}

int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    //int t;cin >> t;while(t--)
        solve();

    return 0;
}

Measured memory_bytes: 3588
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N, K, Q;
	cin >> N >> K >> Q;

	int P[100001];
	rep1(i, N) {
		P[i] = K - Q;
	}
	rep(i, Q) {
		int a;
		cin >> a;
		P[a]++;
	}
	rep1(i, N) {
		if (P[i] > 0) co("Yes");
		else co("No");
	}

	Would you please return 0;
}

Measured memory_bytes: 1024
n = int(input())
tl = input().split()

l = [int(i) for i in tl]

mn = n

count = 0
mn_i = 0
for i in range(len(l)):
    if l[i] > mn:
        continue

    sl = l[mn_i:i+1]
    mn = min(sl)
    mn_i = i
    count += 1

print(count)


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

struct point{
  int x,y;
};
  
int n;
point p[50];

void solve(){
  bool flg=true;
  int X=0,Y=0;
  if(n%2)flg=false;
  for(int i=0;i<n&&flg;i++){
    int j=(i+1)%n;
    int i2=(i+n/2)%n;
    int j2=(j+n/2)%n;
    point v=(point){p[i].x-p[j].x,p[i].y-p[j].y};
    point w=(point){p[i2].x-p[j2].x,p[i2].y-p[j2].y};
    if(v.x*w.y-v.y*w.x)flg=false;
    X+=p[i].x;
    Y+=p[i].y;
  }
  if(flg){
    printf("%.8f %.8f\n",(double)X/n,(double)Y/n);
  }else{
    cout<<"NA"<<endl;
  }
}

int main(){
  cin>>n;
  for(int i=0;i<n;i++)cin>>p[i].x>>p[i].y;
  solve();
  return 0; 
}

Measured memory_bytes: 1200
N, K = map(int, input().split())
d = []


C = [0 for i in range(N+1)]
for i in range(K):
    d.append(input())  #Kこの文字列を読み込み　行列

    A = list(map(int, input().split())) #一行ずつ処理


    for v in A:
        C[v-1] = 1


print(N-sum(C))



Measured memory_bytes: 9032
<?php
$n = trim(fgets(STDIN));
$trampCheckList = createTrampCheckList();
 
for ($i = 0; $i < $n; $i++) {
    list($mark, $num) = getSpacesByExplodeTrimInput();
    $trampCheckList[$mark][$num] = 'check';
}
 
foreach ($trampCheckList as $key => $nullTramp) {
    for ($i = 1; $i <= 13; $i++) {
        if (! isset($trampCheckList[$key][$i])) {
            echo "$key".' '.$i, PHP_EOL;
        }
    }
}
 
function getSpacesByExplodeTrimInput()
{
    return explode(' ', trim(fgets(STDIN)));
}
 
function createTrampCheckList()
{
    return array(
        "S" => array_fill(1, 13, null),
        "H" => array_fill(1, 13, null),
        "C" => array_fill(1, 13, null),
        "D" => array_fill(1, 13, null)
    );
}

Measured memory_bytes: 15240
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <vector>
#include <cstring>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uld = unsigned long long;
using P = pair<int,int>;
const ll mod = 1e9+7;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
template<class T> inline bool chmax(T &a,T& b){if(a < b){a = b; return true;} else return false;}
template<class T> inline bool chmin(T &a,T& b){if(a > b){a = b; return true;} else return false;}
int main(){
    int h,w,a,b;
    cin >> h >> w >> a >> b;
    cout << (h-a)*(w-b) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MAX_NUM = 100000000;

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

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

    int dp[H+1];
    rep(i,H+1) dp[i] = MAX_NUM;

    rep(i,H+1)rep(j,N) {
        if (A[j] >= i) dp[i] = min(dp[i], B[j]);
        else dp[i] = min(dp[i], dp[i - A[j]] + B[j]);
    }

    cout << dp[H] << endl;
    return 0;
}


Measured memory_bytes: 888
package main

import "fmt"

func main() {
	var c string
	fmt.Scan(&c)

	switch c {
	case "a":
		fmt.Println("vowel")
	case "e":
		fmt.Println("vowel")
	case "i":
		fmt.Println("vowel")
	case "o":
		fmt.Println("vowel")
	case "u":
		fmt.Println("vowel")
	default:
		fmt.Println("consonant")
	}
}


Measured memory_bytes: 512
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
#include<fstream>
#include<set>
#include<queue>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define out(str) cout << str << endl
#define ALL(a) (a).begin(),(a).end()
#define INF (1<<29)

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

int N,M,a,b,S,T;
vector<int> G[100000];
int dist[100000][3]={};

int main(){
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    cin>>N>>M;
    rep(i,M){
        cin>>a>>b;
        a--;
        b--;
        G[a].push_back(b);
    }
    cin>>S>>T;
    S--;
    T--;
    queue<pair<int,int>> que;
    que.push(make_pair(S,0));
    while(que.size()){
        pair<int,int> p = que.front();
        que.pop();
        for(int x : G[p.first]){
            if(!dist[x][(p.second+1)%3]){
                dist[x][(p.second+1)%3]=dist[p.first][p.second]+1;
                que.push(make_pair(x,(p.second+1)%3));
            }
        }
        

    }
    if(dist[T][0])out(dist[T][0]/3);
    else out(-1);
    
}


Measured memory_bytes: 6912
s = list(str(input()))
res = 'AC'
if(s[0] != 'A') : res = 'WA'
if(s[2:len(s)-1].count('C') != 1 ) : res = 'WA'
if('A' in s) : s.remove('A')
if('C' in s) : s.remove('C')
for i in range(len(s)) :
  if(s[i].isupper()) : res = 'WA'
print(res)

Measured memory_bytes: 3064
{-# LANGUAGE ScopedTypeVariables, LambdaCase #-}

import qualified Data.List as List
import qualified Data.Set as Set

main :: IO ()
main = do
    [a, b, c, x] :: [Int] <- map read . words <$> getContents
    print $ length [(an, bn, cn) | an <- [0..a], bn <- [0..b], cn <- [0..c], 500 * an + 100 * bn + 50 * cn == x]

Measured memory_bytes: 508
w, a, b = gets.strip.split.map(&:to_i)
a_left = a
b_left = b
a_right = a + w
b_right = b + w

if b_right < a_left
    puts a_left - b_right
elsif (a_left <= b_left && b_left <= a_right) || (b_left <= a_left && a_left <= b_right)
    puts 0
else
    puts b_left - a_right
end

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

int main(void) {
	int a, b, c;
	cin >> a >> b >> c;
	int color = 3;
	if (a == b || b == c || c == a)color--;
	if (a == b && b == c && c == a)color--;
	cout << color << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll n,d;
  cin >> n >> d;
  //vector<double> dist(n);
  ll ans=0;
  for(int i=0;i<n;i++){
    ll x,y;
    cin >> x >> y;
    double dist = sqrt((double)(x*x+y*y));
    if(dist <= d){
      ans++;
    }
  }
  
  cout << ans << endl;
  
  return(0);
}

Measured memory_bytes: 3648
#include <iostream>
#include<string.h>
using namespace std;

int n[6],temp;
void throww(char a){
  if(a=='N'){temp=n[0];n[0]=n[1];n[1]=n[5];n[5]=n[4];n[4]=temp;}
  if(a=='S'){temp=n[0];n[0]=n[4];n[4]=n[5];n[5]=n[1];n[1]=temp;}
  if(a=='E'){temp=n[0];n[0]=n[3];n[3]=n[5];n[5]=n[2];n[2]=temp;}
  if(a=='W'){temp=n[0];n[0]=n[2];n[2]=n[5];n[5]=n[3];n[3]=temp;}
}
int main() {
   char strm[101];
  for(int i=0;i<6;i++)cin>>n[i];
  cin>>strm;
  for(int i=0;i<strlen(strm);i++)throww(strm[i]);
  cout<<n[0]<<endl;
  return 0;
}

Measured memory_bytes: 1168