akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <tuple>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <deque>
#include <iomanip>
#include <list>
#include <cstring>
using namespace std;
#define pi pair<int,int>
#define pl pair<long long,long long>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define en cout << endl //セミコロンつけろ
//#define MM 1000000000
//#define MOD MM+7
typedef long long ll;
const int MM = 1e9;
const int MOD = 1e9+7;
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
// 'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122
// priority_queue<pair<int, int>, vector<pair<int, int> >, greater<pair<int, int> > pq;

template<typename T> //最大公約数
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T> //最小公倍数
T LCM(T x,T y){
    T gc = GCD(x,y);
    return x*y/gc;
}

const int COM_MAX = 500500;
long long fac[COM_MAX],finv[COM_MAX],inv[COM_MAX];
void init(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < COM_MAX; i++){
        fac[i] = fac[i-1]*i%MOD;
        inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD;
        finv[i] = finv[i-1]*inv[i]%MOD;
    }
}

long long nCr(int n,int k){
    if(n < k || n < 0 || k < 0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}


// a^n mod を計算する
long long modpow(long long a, long long n, long long MOD) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

// a^{-1} mod を計算する
long long modinv(long long a, long long Mod) {
    return modpow(a, Mod - 2, Mod);
}


bool IsPrime(int x){
    for (int i = 2; i*i <= x; i++){
        if (x % i == 0){
            return false;
        }
    }
    return true;
}

vector<pair<ll, ll> > PrimeFactor(ll N){
    vector<pair<ll, ll> > prime;
    for (int i = 2; i*i <= N; i++){
        if (N % i != 0) continue;
        int cnt = 0;
        while (N % i == 0){
            cnt++;
            N /= i;
        }
        prime.push_back({i, cnt});
    }
    if (N > 1){
        prime.push_back({N, 1});
    }
    return prime;
}

vector<pair<ll, ll> > CountPrime(ll N){
    vector<pair<ll, ll> > prime;
    for (ll i = 2; i * i <= N; i++){
        if (N % i != 0) continue;
        ll cnt = 0, n = N;
        while (n % i == 0){
            cnt++;
            n /= i;
        }
        prime.push_back({i, cnt});
    }
    prime.push_back({N, 1});
    return prime;
}

int main(){
    int N; cin >> N;
    vector<ll> X(N), L(N);
    vector<pl> vp(N);
    vector<bool> isDeleted(N, false);
    for (int i = 0; i < N; i++){
        cin >> X[i] >> L[i];
        vp[i] = {X[i]+L[i], X[i]-L[i]};
    }

    sort(vp.begin(), vp.end());
    int res = 0;
    ll maxRight = (-1)*MM;
    for (int i = 0; i < N; i++){
        if (maxRight <= vp[i].second){
            res++;
            maxRight = vp[i].first;
        }
    }
    cout << res << endl;
}


Measured memory_bytes: 3328
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define INF 1<<30
#define LINF 1LL<<60

void dfs(ll n,vector<int>& can_use,vector<vector<ll>>& G,int f){
    for(auto next:G[n]){
        if(can_use[next] == 0){
            can_use[next] = f;
            dfs(next,can_use,G,f);
        }
    }
}

int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    ll N,M; cin >> N >> M;
    vector<vector<ll>> G(N);
    vector<pll> ab(M);
    for(int i = 0; i < M;i++){
        ll a,b; cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
        ab[i] = {a,b};
    }
    vector<int> can_use(N,0);
    can_use[0] = 1;
    dfs(0,can_use,G,1);
    can_use[1] = 2;
    dfs(1,can_use,G,2);

    ll cnt1 = 0,cnt2 = 0;
    
    for(auto use:can_use){
        if(use == 1)cnt1++;
        if(use == 2)cnt2++;
    }
    
    bool f = false;
    if(cnt1 < cnt2){
        f = true;
    }
    for(auto use:can_use){
        if(use == 0){
            if(f){
                cnt2++;
            }else{
                cnt1++;
            }
        }
    }
    
    ll e_cnt1 = 0,e_cnt2 = 0;
    for(int i = 0; i < M;i++){
        if(can_use[ab[i].first] == 0){
            if(f){
                e_cnt2++;
            }else{
                e_cnt1++;
            }
        }
        if(can_use[ab[i].first] == 1) e_cnt1++;
        if(can_use[ab[i].first] == 2) e_cnt2++;
    }
    ll ans1 = (cnt1*(cnt1 -1))/2 - e_cnt1;
    ll ans2 = (cnt2*(cnt2-1))/2 - e_cnt2;
    cout << ans1 + ans2 << endl;
    return 0;
}


Measured memory_bytes: 12416
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

void yes(){
    cout << "Yes" << endl;
}

void no (){
    cout << "No" << endl;
}

ll cel (ll a, ll b){
    if (a % b == 0) return a / b;
    else return a / b + 1;
}

ll gcds(ll a, ll b){
    ll c = a % b;
    while (c != 0){
        a = b;
        b = c;
        c = a % b;
    }
    return b;
}

int main() {
    int n; cin >> n;
    vector<P> ar(n);
    rep(i,n){
        int a, b; cin >> a >> b;
        ar[i].first = a + b;
        ar[i].second = a - b;
    }
    int xma = -INF;
    int yma = -INF;
    int xmi = INF;
    int ymi = INF;
    rep(i,n){
        xma = max(xma,ar[i].first);
        yma = max(yma,ar[i].second);
        xmi = min(xmi,ar[i].first);
        ymi = min(ymi,ar[i].second);
    }
    cout << max(xma-xmi,yma-ymi) << endl;
}

Measured memory_bytes: 4824
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
using namespace std;
int n,k;
int a[100005],dp[100005];
ll sol(long long  i)
{
    ll res=1e10;
    //cout<<i<<endl;
    if(dp[i]!=-1)return dp[i];
    if(i>=n-1)return 0;
  for(int idx=1;idx<=k;idx++){
    if(i+idx<=n-1)
            res=min(res,sol(i+idx)+abs(a[i]-a[i+idx]));
  }
        return dp[i]=res;
}
int main()
{
    cin>>n>>k;
    for(int i=0;i<n;i++)cin>>a[i];
    memset(dp,-1,sizeof dp);
    cout<<sol(0);
}

Measured memory_bytes: 5760
N = int(input())
a = 26
counter = 1
while a<N:
  N -= a
  counter += 1
  a *= 26
ans = []
N -= 1
while N>=26:
  ans.append(N%26)
  N = N //26
ans.append(N)
dic = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
ans = [dic[i] for i in ans[::-1]]
n = len(ans)
print("a"*(counter-n) + "".join(ans))

Measured memory_bytes: 9000
//* AuThOr GaRyMr *//
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define niv vector<int>
#define LL long long
#define IT iterator
#define PB(a) push_back(a)
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
int main(){
	int Black,White;
	Black=0;
	string s;
	cin>>s;
	int len=s.length();
	LL res=0;
	rep(i,len){
		if(s[i]=='B'){
			Black++;
			
		}
		else{
			res+=Black;
		}
	} 
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 640
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
        List<Integer> list = Arrays.asList(sc.nextInt(), sc.nextInt(), sc.nextInt());
        Collections.sort(list);
        System.out.println(list.get(2) - list.get(0));
	}
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define pd(a,n) for(int i=0;i<n;i++)cout<<a[i]<<((i==n-1)?"\n":" ")
#define pdd(a,n,m)for(int i=0;i<m;i++)pd(a,m)
#define mp make_pair
#define pb push_back
#define ll long long
//#define __int64 long long
#define P pair<int,int>
#define PP pair<P,int>

ll n,a,b;
ll ans;
ll MOD=1000000007;
const int MAX=422222;

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}


// 二項係数計算
ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    ll ret=1;
    for(ll i=0;i<k;i++){
      ret*=(n-i);
      ret%=MOD;
    }
    for(ll i=1;i<=k;i++){
      ret%=MOD;
      ret=ret*modinv(i,MOD)%MOD;
    }
    //cout<<n<<" "<<k<<" "<<ret<<endl;
    return ret;
    //return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

/*
ll RepeatSquaring(ll n, ll P, ll M){
    if(P==0) return 1;
    if(P%2==0){
        ll t = RepeatSquaring(N, P/2, M);
        return t*t % M;
    }
    return N * RepeatSquaring(N, P-1, M);
}*/
ll hoge(ll n,ll p,ll m){
  if(p==0)return 1;
  if(p%2==0){
      ll t=hoge(n,p/2,m);
      return t*t%m;
  }
  return n*hoge(n,p-1,m);
}


int main(){
  //COMinit();
  cin>>n>>a>>b;
  ans=hoge(2LL,n,MOD);
  ans-=COM(n,a);
  ans+=MOD;
  ans-=COM(n,b);
  ans+=MOD;
  cout<<(ans-1+MOD)%MOD<<endl;

}


Measured memory_bytes: 256
n = int(input())
l = len(str(n))
res = 0
for i in range(1, l + 1, 2):
    if i == l:
        res += n - 10**(l-1) + 1
    else: res += (10**(i) - 1) - (10**(i-1)) + 1
print(res)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define P pair<long long, long long>

using namespace std;

int main(){
  long long n, m, d[100009];
  bool check[100009];
  vector<P> v[100009];
  cin >> n >> m;
  for(int i=0;i<m;i++){
    long long l, r, D;
    cin >> l >> r >> D;
    l--;r--;
    v[l].push_back(P(r, D));
    v[r].push_back(P(l, -D));
  }
  memset(check, false, sizeof(check));
  queue<long long> q;
  for(int i=0;i<n;i++){
    if(check[i])continue;
    long long mn=0, mx=0;
    check[i]=true;
    for(int j=0;j<v[i].size();j++){
      check[v[i][j].first]=true;
      d[v[i][j].first]=v[i][j].second;
      q.push(v[i][j].first);
    }
    while(!q.empty()){
      long long fr=q.front();q.pop();
      mn = min(mn, d[fr]);
      mx = max(mx, d[fr]);
      for(int j=0;j<v[fr].size();j++){
        long long nx=v[fr][j].first;
        long long dd=v[fr][j].second;
        if(check[nx]){
          if(d[fr]+dd!=d[nx]){
            cout << "No" << endl;
            return 0;
          }
        }
        else{
          check[nx]=true;
          d[nx]=d[fr]+dd;
          q.push(nx);
        }
      }
      if(mx-mn>1e9){
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
  return 0;
}



Measured memory_bytes: 17320
n = int(input())
record = [ [ [0 for r in range(10)] for f in range(3)] for b in range(4)]
for _ in range(n):
    b,f,r,v = [int(i) for i in input().split(" ")]
    record[b - 1][f - 1][r - 1] += v
for b1 in range(4):
    for f in record[b1]:
        print(" "+" ".join([str(x) for x in f]))
    if b1 != 3:
        print("#" * 20)
        
        

Measured memory_bytes: 7708
/*   ꧁༒☬महाकाल☬༒꧂ ꧁༒ঔमहाकालঔ༒꧂
                   
                   ঔৣ۝महाकालᴳᵒᵈ۝ঔৣ            
 
 */ 
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops"
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//template <typename T, typename cmp=less<T>> using oset =tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long 
#define mod 1000000007
#define MOD 998244353
#define inf 100000000000000000
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define _it iterator
#define all(_x) _x.begin(),_x.end()
#define f first
#define s second
#define pb push_back
#define ar array
#define ld long double

void mahakal(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};
// char c[4]={'D' , 'R' , 'U' , 'L'};
const ll maxN=3e5+5;
ll n ;
bool cmp(pair<ll,ll> p1 , pair<ll,ll>p2){
    ll ans1 = p1.f+p1.s , ans2 = p2.f+p2.s;
    return ans1<ans2;
}

bool cmp1(pair<ll,ll> p1 , pair<ll,ll>p2){
    ll ans1 = p1.f-p1.s , ans2 = p2.f-p2.s;
    return ans1<ans2;
}

void solve(){
   cin>> n ;
   vector<pair<ll,ll>> a(n), b(n);
   for(ll i=0;i<n ;i++){
       cin>>a[i].f>>a[i].s;
       b[i].f=a[i].f , b[i].s = a[i].s;
   }
   sort(a.begin() , a.end() , cmp);
   sort(b.begin() , b.end() , cmp1);
   ll ans = max(abs(a[0].f-a[n-1].f) + abs(a[0].s - a[n-1].s) , abs(b[0].f-b[n-1].f) + abs(b[0].s - b[n-1].s));
   
   
   cout<<ans<<endl;
    
}

int main(){
// 	mahakal();
	fast;
	ll t =1 ;
// 	cin>> t ; 
	while(t--)solve();
// 	cerr << "\ntime taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl; 
	return 0;
}


Measured memory_bytes: 9504
#include <bits/stdc++.h>
    using namespace std;
     
    int main()
    {
      int n;
      cin >> n;
      int ans = 0;
     
      if (n >= 195) ans++;
      if (n >= 189) ans++;
      if (n >= 165) ans++;
      if (n >= 135) ans++;
      if (n >= 105) ans++;
     
      cout << ans << endl;
    }


Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>

using namespace std;
 
const int N = 30;
int h, w;
char data[N][N];

class State{
public:
  int y, x, cnt, s;
};

int bfs(int sy, int sx, string str){
  State u, v;
  bool visited[1<<8+1][N][N];
  map<char, int> ctoi;
  for(int i=0;i<str.size();i++){
    ctoi[str[i]] = i;
  }
  int dx[] = {0, 1, 0, -1};
  int dy[] = {-1, 0, 1, 0};
  fill(visited[0][0], visited[1<<8][0], false);
  u.y = sy;
  u.x = sx;
  u.cnt = u.s = 0;
  queue<State> Q;
  Q.push(u);
  while(!Q.empty()){
    u = Q.front(); Q.pop();
    if(data[u.y][u.x] == '<'){
      return u.cnt;
    }
    if(data[u.y][u.x]>='a' && data[u.y][u.x]<='z'){
      if(u.s & (1<<ctoi[data[u.y][u.x]])){
	u.s = u.s & ~( 1<<ctoi[data[u.y][u.x]] );
      }else{
	u.s |= (1<<ctoi[data[u.y][u.x]]);
      }
    }
    //cout << u.y << ' ' << u.x << ' ' << u.cnt << ' ' << u.s << endl;
    for(int i=0;i<4;i++){
      int ty = u.y + dy[i];
      int tx = u.x + dx[i];
      if(ty<0 || ty>=h) continue;
      if(tx<0 || tx>=w) continue;
      if(data[ty][tx] == '#') continue;
      //cout << ty << ' ' << tx << endl;
      if(data[ty][tx]>='A' && data[ty][tx]<= 'Z'){
	if(ctoi.find(data[ty][tx]+('a'-'A')) == ctoi.end()) continue;
	if(u.s & (1<<ctoi[data[ty][tx]+('a'-'A')])){
	}else{
	  continue;
	}
      }
      if(visited[u.s][ty][tx]) continue;
      v.y = ty;
      v.x = tx;
      v.cnt = u.cnt+1;
      v.s = u.s;
      visited[v.s][v.y][v.x] = true;
      Q.push(v);
    }
  }
  return -1;
}

main(){
  while(1){
    cin >> w >> h;
    if(w == 0 && h == 0) break;
    set<char> input;
    int sx, sy;
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
	cin >> data[i][j];
	if(data[i][j]>= 'a' && data[i][j]<= 'z'){
	  input.insert(data[i][j]);
	}else if(data[i][j] == '@'){
	  data[i][j] = '.';
	  sx = j;
	  sy = i;
	}
      }
    }
    string str = "";
    set<char>::iterator ite = input.begin();
    for(;ite != input.end();ite++){
      str += *ite;
    }
    cout << bfs(sy, sx, str) << endl;
  }
  return 0;
}

Measured memory_bytes: 1292
#define _USE_MATH_DEFINES
#include <iostream>
#include <memory>
#include <memory.h>
#include <fstream>
#include <cmath>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <map>
#include <set>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<double, double> Pd;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const int INF = 1 << 29;
const double EPS = 1E-10;

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)

map<string, int> id;
int par[2000];
int depth[2000];

void input(int n){
	string s, name;
	int cnt = 0;
	memset(par, -1, sizeof(par));
	id.clear();
	rep(i, n){
		cnt = 0;
		getline(cin, s);
		while(cnt < (int)s.size() && s[cnt] == ' ') cnt++;
		name = string(s.begin() + cnt, s.end());
		id[name] = i;
		depth[i] = cnt;

		if(i != 0){
			int j = i;
			while(depth[i] - 1 != depth[j]) j--;
			par[i] = j;
		}
	}
}

bool xIsC(int x, int y){
	return par[x] == y;
}

bool xIsS(int x, int y){
	return par[x] == par[y];
}

bool xIsA(int x, int y){
	while(par[y] != -1){
		if(par[y] == x) return true;
		y = par[y];
	}
	return false;
}

bool solve(const string &s){
	istringstream in(s);
	string X, Y, A, c;
	in >> X >> c >> c >> A >> c >> Y;
	Y = string(Y.begin(), Y.end() - 1);
	int x = id[X];
	int y = id[Y];
	if(A == "child"){
		return xIsC(x, y);
	}else if(A == "parent"){
		return xIsC(y, x);
	}else if(A == "sibling"){
		return xIsS(x, y);
	}else if(A == "ancestor"){
		return xIsA(x, y);
	}else{
		return xIsA(y, x);
	}
}

int main(){
	int n, m;
	string s;
	while(cin >> n >> m && (n || m)){
		getline(cin, s);
		input(n);
		rep(i, m){
			getline(cin, s);
			if(solve(s)) cout << "True" << endl;
			else cout << "False" << endl;
		}
		cout << endl;

	}
	return 0;
}

Measured memory_bytes: 0
#include<stdio.h>

static const int N = 100;

int main(){
  int n, i, j;
  int A[N];
  int count=0;
  int tmp;
  int minj;


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

  for(i=0;i<=n-1;i++){
    minj=i;
    for(j=i;j<=n-1;j++){
      if(A[j]<A[minj]){
	minj=j;
      }
    }
      tmp=A[i];
      A[i]=A[minj];
      A[minj]=tmp;
      if(i != minj){
	count++;
      }
  }
  

  
  for ( i = 0; i < n; i++ ){
    if ( i >= 1 ) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
  
  printf("%d\n",count);


  return 0;
}

Measured memory_bytes: 604
N,K=map(int,input().split())
sunuke=[]
for i in range (0,N):
    sunuke.append(i+1)
for k in range (0,K):
    a=int(input())
    b=list(map(int,input().split()))
    for j in range (0,a):
        if b[j] in sunuke:
            sunuke.remove(b[j])
print(len(sunuke))

Measured memory_bytes: 9196
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
using namespace std;

void solve() {
    ll n; cin >> n;
    cout << (n+1)/2 - 1 << endl;
}

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

    solve();
    return 0;
}
 


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#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 VAR(v, i) __typeof(i) v=(i)
#define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
#define all(v) (v).begin(),(v).end()
 
#define PII pair<int,int>
#define mp make_pair
#define st first
#define nd second
#define pb push_back
#define lint long long int
#define VI vector<int>

using namespace std;

template<class TH> void _dbg(const char *sdbg, TH h){cerr<<sdbg<<"="<<h<<"\n";}
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;cerr<<"="<<h<<","; _dbg(sdbg+1, a...);
}

template<class T> ostream &operator<<(ostream &os, vector<T> V){
  os<<"[";for(auto vv:V)os<<vv<<",";return os<<"]";
} 

template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}


#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
 
#define make( x) int (x); scanf("%d",&(x));
#define make2( x, y) int (x), (y); scanf("%d%d",&(x),&(y));
#define make3(x, y, z) int (x), (y), (z); scanf("%d%d%d",&(x),&(y),&(z));
#define make4(x, y, z, t) int (x), (y), (z), (t); scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define makev(v,n) VI (v); FOR(i,0,(n)) { make(a); (v).pb(a);} 
#define IOS ios_base::sync_with_stdio(0)
#define HEAP priority_queue
 
#define read( x) scanf("%d",&(x));
#define read2( x, y) scanf("%d%d",&(x),&(y));
#define read3(x, y, z) scanf("%d%d%d",&(x),&(y),&(z));
#define read4(x, y, z, t) scanf("%d%d%d%d",&(x),&(y),&(z),&(t));
#define readv(v,n) FOR(i,0,(n)) { make(a); (v).pb(a);}
#define jeb fflush(stdout)
 
const int max_n = 1e5 + 5;
 

char s[105];
char t[105];
char t2[105];

int main() {
	scanf("%s", s);
	int n = strlen(s);
	int best = n-1;
	FOR(i,0,26) {
		char C = 'a'+i;
		bool ok = false;
		FOR(j,0,n) if (s[j]==C) ok = true;
		if (!ok) continue;
		FOR(j,0,n) t[j] = s[j];
		int m = n;
		while (1) {
			bool ok = true;
			FOR(j,0,m-1) if (t[j]!=t[j+1]) ok = false;
			if (ok) break;
			FOR(j,0,m-1) {
				if (t[j]==C || t[j+1]==C) t2[j] = C;
				else t2[j] = 'A';
			}
			m--;
			FOR(j,0,m) t[j] = t2[j];
		}
		best = min(best, n-m);
	}
	printf("%d\n", best);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <numeric>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD (1e9+7)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void)
{
    int n;
    cin >> n;
    vector<int> d(n);
    for (int i = 0; i < n; i++) {
        cin >> d[i];
    }   
    SORT(d);

    pr(d[n/2]-d[n/2-1]);
}

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int a, b, c, d, start, end;
    cin >> a >> b >> c >> d;
    start = max(a, c);
    end   = min(b, d);
    if(start > end) cout << 0 << endl;
    else cout << end - start << endl;
    return 0;
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>

using namespace std;

//conversion
//------------------------------------------
inline long toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline long toLong(string s) {long v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

//constant
//--------------------------------------------

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

const long double EPS = 1e-8;
const long INF = 1e10;

int main(){
	long N;string str;
	cin>>str>>N;
	int bpos=0;
	vector<int>num;
	vector<char>kigo;
	REP(i,SZ(str)){
		if(str[i]=='+'||str[i]=='*'){
			kigo.PB(str[i]);
			num.PB(toInt(str.substr(bpos,i-bpos+1)));
			bpos=i+1;
		}else if(i==SZ(str)-1){
			num.PB(toInt(str.substr(bpos)));
		}
	}
	long L=num[0];
	FOR(i,1,SZ(num)){
		if(kigo[i-1]=='+')L+=num[i];
		else L*=num[i];
	}
	stack<long>st;
	st.push(num[0]);
	FOR(i,1,SZ(num)){
		if(kigo[i-1]=='+')st.push(num[i]);
		else{
			long t=st.top();st.pop();
			st.push(t*num[i]);
		}
	}
	long M=0;
	while(!st.empty()){
		M+=st.top();st.pop();
	}
	//cout<<L<<" "<<M<<endl;
	if(N==L&&N==M){
		cout<<"U"<<endl;
	}else if(N==L){
		cout<<"L"<<endl;
	}else if(N==M){
		cout<<"M"<<endl;
	}else{
		cout<<"I"<<endl;
	}
	return 0;
}

Measured memory_bytes: 1248
input = gets.chomp.to_i
left = input/100
right = input%100

def month?(num)
  if 1 <= num && num <=12
    return true
  else
    return false
  end
end

if month?(left)
  if month?(right)
    puts "AMBIGUOUS"
  else
    puts "MMYY"
  end
else
  if month?(right)
    puts "YYMM"
  else
    puts "NA"
  end
end

Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
#define BOOST ios_base :: sync_with_stdio(false), cin.tie(NULL), cout.tie(0)
#define fo(i,a,n) for(int i=a;i<n;i++)
#define fc(i,a,n,c) for(int i=a;i<n;i+=c)
#define fi(i,n,a) for(int i=n-1;i>=a;i--)
#define in cin>>
#define out cout<<
#define ll long long
#define el <<"\n"
#define es <<" "

int main(){
  BOOST;
  ll int a,b,k=0;
  in a>>b;
  while(a>=pow(b,k))  k++;
  out k;
  return 0;
}

Measured memory_bytes: 512
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <limits>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <array>
#include <tuple>
#include <utility>
#include <cctype>
#include <typeinfo>
using namespace std;

#define len(x)  (int((x).size()))
#define append push_back
#define pp make_pair
#define ff(a, b)    for (int a = 0; a < int(b); ++a)
#define ii(n)    ff(i, n)
#define kk(n)    ff(k, n)
#define mm(n)    ff(m, n)
#define fff(a, b, c) for (int a = int(b); a < int(c); ++a)
#define iii(a, b) fff(i, a, b)
#define kkk(a, b) fff(k, a, b)
#define mmm(a, b) fff(m, a, b)
#define xx first
#define yy second
#define bb begin()
#define ee end()
#define all(x)  (x).bb, (x).ee
#define ite(v)   decltype((v).bb)
#define fe(i, v) for(ite(v) i = (v).bb; i != (v).ee; ++i)
#define err(...)    { fprintf(stderr, __VA_ARGS__); fflush(stderr); }

using LL = long long;
using pii = pair<int, int>;
using pLLi = pair<LL, int>;


const LL INF = 9223372036854775807LL;
//const int INF = 2147483647;
   




int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //cout << '\n';
    

    int N;
    cin >> N;
    vector<LL> aa(N);
    ii (N)
        cin >> aa[i];

    vector<LL> checkpts(1, aa[0]);
    iii (1, N) {
        if (aa[i] > checkpts[len(checkpts)-1])
            checkpts.append(aa[i]);
    }
    vector<LL> a2(all(aa));
    sort(all(a2));

    vector<LL> rr(len(checkpts)+1, -1);

    LL width = 0;
    LL integral = 0;
    LL last_height = 1000111000;
    int current_cp = len(checkpts)-1;
    for (int i = N-1; i >= 0; --i) {
        LL here = a2[i];
        integral += (last_height - here) * width;
        //printf("At %d %d integral %d width %d\n", i, int(a2[i]), int(integral),
        //        int(width));
        if (current_cp >= 0 && here == checkpts[current_cp]) {
            rr[current_cp+1] = integral;
            --current_cp;
        }
        ++width;
        last_height = here;
    }
    rr[0] = integral + last_height * width;

    LL last_max = 0;
    int next_cp = 0;
    rr.append(0);
    ii (N) {
        if (aa[i] > last_max) {
            last_max = aa[i];

            cout << rr[next_cp] - rr[next_cp+1] << '\n';
            ++next_cp;
            continue;
        }
        cout << "0\n";
    }


    return 0;
}



Measured memory_bytes: 4340
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <cctype>
#include <cmath>
#include <map>
#include <set>
#define rep(i, m, n) for (int i = m; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define ll long long
#define ull unsigned long long
#define push(a) push_back(a)
#define pop(a) pop_back(a)
#define debug(x) cout << #x << ": " << x << endl
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define PI 3.14159265358979
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int main(){
    int n;
    cin>>n;
    cout<<n/3<<endl;
}

Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  ll n;cin>>n;
  vector<double> a(n);
  rep(i,n)cin>>a[i];
  double ave=0;
  rep(i,n)ave+=a[i];
  ave/=n;
  double MIN=INF;
  ll k=-1;
  rep(i,n){
    if(abs(ave-a[i])<MIN){
      k=i;
      MIN=abs(ave-a[i]);
    }
  }
  cout<<k<<endl;
}

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

using namespace std;

int main(void) {
  string S;
  cin >> S;
  int num = 0;
  for (int i = 0; i < 4; i++) {
    if (S[i] == '+') {
      num++;
    } else {
      num--;
    }
  }
  cout << num;
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace ITP1_4_D
{
    class Program
    {
        static void Main()
        {
            Console.ReadLine();
            long[] x = Console.ReadLine().Split(' ', '\r', '\n').Select(long.Parse).ToArray();
            Console.WriteLine("{0} {1} {2}", x.Min(), x.Max(), x.Sum());
        }
    }
}


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

int main() {
  int H;// 縦
  int W;// 横
  cin >> H >> W;
  string s = "#";
  string str;
  
  for(int i=0; i<W+2; i++){
    cout << "#";
  }
  cout << endl;
  
  for(int i=0; i<H; i++){
   cin >> str;   
   cout << "#" << str << "#" << endl;
  }
  
  for(int i=0; i<W+2; i++){
    cout << "#";
  }
  cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <ctime>
using namespace std;
#define _LL long long
#define rep(i, n) for (_LL i = 0; i < (_LL)(n); i++)
#define vecrep(itr, v) for (auto itr = (v).begin(); itr != (v).end(); itr++)

template <class T> class MultiArray2
{
    public:
        T* _a;
        int _w;
        int _h;
        MultiArray2(int w, int h, bool clr = false)
        {
            _w = w; _h = h;
            _a = new T[_w * _h];
            if(clr) memzero();
        }

        void memzero()
        {
            memset(_a, 0, _w * _h * sizeof(T));
        }

        void setall(T v)
        {
            for( int j = 0; j < _h; j++ )
            {
                for( int i = 0; i < _w; i++ )
                {
                    (*this)[i][j] = v;
                }
            }            
        }


        ~MultiArray2()
        {
            delete _a;
        }

        T* operator[](int i)
        {
            return _a + (i * _h);
        }

        void print()
        {
            for( int j = 0; j < _h; j++ )
            {
                for( int i = 0; i < _w; i++ )
                {
                    cout << (*this)[i][j] << " ";
                }
                cout << endl;
            }
        }
};

void search_next(int i, int j, int w, int h, int d, MultiArray2<bool> &maze, MultiArray2<int> &shortest, priority_queue<tuple<int, int, int>> &q)
{
    if( i < 0 || i >= w || j < 0 || j >= h ) return;
    if( maze[i][j] ) return;
    if( d >= shortest[i][j] ) return;
    shortest[i][j] = d;
    q.emplace(-d, i, j);
}

int main()
{
    int w, h;
    cin >> h >> w;
    MultiArray2<bool> maze(w, h);
    MultiArray2<int> shortest(w, h);
    rep(j, h)
    {
        string s;
        cin >> s;
        rep(i, w) maze[i][j] = (s[i] == '#');
    }

    int ans = 0;

    rep(j, h)
        rep(i, w)
        {
            if(maze[i][j]) continue;
            shortest.setall(1 << 30);
            shortest[i][j] = 0;
            priority_queue<tuple<int, int, int>> q;
            q.push(make_tuple(0, i, j));
            while(!q.empty())
            {
                tuple<int, int, int> next = q.top();
                q.pop();
                int d = -get<0>(next);
                int x = get<1>(next);
                int y = get<2>(next);
                if( d > shortest[x][y] ) continue;
                search_next(x - 1, y, w, h, d + 1, maze, shortest, q);
                search_next(x + 1, y, w, h, d + 1, maze, shortest, q);
                search_next(x, y - 1, w, h, d + 1, maze, shortest, q);
                search_next(x, y + 1, w, h, d + 1, maze, shortest, q);
            }

            int best = 0;
            rep(x, w)
                rep(y, h) 
                {
                    if( shortest[x][y] < (1 << 30) )
                    best = max(best, shortest[x][y]);
                }
            ans = max(ans, best);
        }
    
    cout << ans;
    
    return 0;
}

Measured memory_bytes: 3624
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
		string[] str = Console.ReadLine().Split();
		string ans = "APPROVED";
		for(var i=0;i<N;i++){
			int a1 = int.Parse(str[i]);
			if(a1%2==0){
				if(a1%3!=0 && a1%5!=0){
					ans = "DENIED";
				}
			}
		}
		Console.WriteLine(ans);
	}
}

Measured memory_bytes: 13140
#include<iostream>
#include<algorithm>
#include<map>
#include<vector>

using namespace std;

int main() {
	string s;
	cin >> s;
	int c = 0;
	for(int i = 0; i < s.length(); i++) {
		if(s[i] == 'o') c++;
	}

	cout << 700 + c * 100 << endl;





}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for(int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<ll> sum(n + 1, 0);
  for(int i = 0; i < n; i++) {
    sum[i + 1] = sum[i] + a[i];
  }
  ll ave = sum[n] / 2;
  ll ans = 1001001001001001001;
  for(int i = 1; i < n; i++) {
    ans = min(ans, abs(sum[n] - sum[i] - sum[i]));
  }
  cout << ans << endl;
  return 0;
}

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

ll lcm(ll l, ll r);
ll gcd(ll l, ll r);

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

  vector<ll> T(N);
  rep(i,0,N-1) cin >> T[i];

  rep(i,1,N-1) {
    T[i] = lcm(T[i-1], T[i]);
  }

  cout << T[N-1] << endl;
  return 0;
}

ll lcm(ll l, ll r)
{
  ll d = gcd(l, r);
  return l / d * r;
}

ll gcd(ll l, ll r)
{
  ll a = max(l, r);
  ll b = min(l, r);
  ll c = a % b;
  while (c != 0)
  {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}


Measured memory_bytes: 3600
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{

  static boolean[][] z = new boolean[22][22];
  static boolean[][] zz = new boolean[22][22];
  public static void main(String[] args) throws IOException
  {
    BufferedReader r = new BufferedReader(new InputStreamReader(System.in), 1);
    String s;
    String sl[];

    s = r.readLine();
    sl = s.split(" ");

    long n = Integer.parseInt(sl[0]);
    long v = 0;

    for(int i = 1; i <= n; i++)
    {
      for(int j = 1; j <= n; j++)
      {
        int ii = i, jj = j;
        if(ii < jj)
        {
          int tt = ii;
          ii = jj;
          jj = tt;
        }
        while(jj != 0)
        {
          int tt = ii % jj;
          ii = jj;
          jj = tt;
        }
        if(ii == 1)
        {
          v += n;
        }
        else
        {
          for(int k = 1; k <= n; k++)
          {
            int iii = ii, jjj = k;
            if(iii < jjj)
            {
              int tt = iii;
              iii = jjj;
              jjj = tt;
            }
            while(jjj != 0)
            {
              int tt = iii % jjj;
              iii = jjj;
              jjj = tt;
            }
            v += iii;
          }
        }
      }
    }

    System.out.println(v);
  }

}

class RemRing
{
  long module;

  public RemRing(long module)
  {
    this.module = module;
  }

  public long sum(long a, long b)
  {
    return (a + b + module) % module;
  }

  public long sub(long a, long b)
  {
    return (a - b + module) % module;
  }

  public long prod(long a, long b)
  {
    return (a * b) % module;
  }

  public long div(long a, long b)
  {
    return (a * inv(b)) % module;
  }

  public long inv(long a)
  {
    long b = this.module;
    long u = 1;
    long v = 0;
    while (b > 0)
    {
      long t = a / b;
      a -= t * b;
      u -= t * v;
      long z = a;
      a = b;
      b = z;
      z = u;
      u = v;
      v = z;
    }
    u %= this.module;
    if (u < 0)
      u += this.module;
    return u;
  }
}

Measured memory_bytes: 32628
#-*-coding:utf-8-*-
#from collections import Counter

def main():
    n, k = map(int, input().split())
    a_list = list(input().split())
    a_set = set(a_list)

    #c = Counter(a_list)
    dic = {}
    for i in a_list:
        dic.setdefault(i, 0)
        dic[i] += 1

    freq = sorted(dic.values())

    cnt = 0
    for i in range(len(a_set) - k):
        cnt += freq[i]
        #cnt += c.most_common()[::-1][i][1]

    print(cnt)

if __name__ == '__main__':
    main()

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

typedef pair<int, int> ii;

ii mii(int a, int b){
    return make_pair(a,b);
}

int main(){
    int N, E;
    scanf("%d %d", &N, &E);
    if(E%2 == 1){
        printf("-1");
        return 0;
    }
    vector<int> adjlist[N+1];
    bool visited[N+1];
    bool out[N+1];
    for(int i = 1; i <= N; i++){
        out[i] = false;
        visited[i] = true;
    }
    for(int i = 0; i < E; i++){
        int a, b;
        scanf("%d %d", &a, &b);
        adjlist[a].push_back(b);
        adjlist[b].push_back(a);
    }
    stack<ii> ffromroot; //node, par
    queue<int> tovisit;
    tovisit.push(1);
    visited[1] = false;
    while(!tovisit.empty()){
        int v = tovisit.front();
        tovisit.pop();
        for(int i = 0; i < adjlist[v].size(); i++){
            if(visited[adjlist[v][i]]){
                    //printf("%d\n", adjlist[v][i]);
                visited[adjlist[v][i]] = false;
                tovisit.push(adjlist[v][i]);
                ffromroot.push(mii(adjlist[v][i], v));
            }
        }
    }
    while(!ffromroot.empty()){
        ii p = ffromroot.top();
        int v = p.first;
        visited[v] = true;
        int par = p.second;
        ffromroot.pop();
        for(int i = 0; i < adjlist[v].size(); i++){
            if(adjlist[v][i] == par || visited[adjlist[v][i]]){
                continue;
            }else{
                out[v] = !out[v];
                printf("%d %d\n", v, adjlist[v][i]);
            }
        }
        if(out[v]){
            printf("%d %d\n", v, par);
        }else{
            printf("%d %d\n", par, v);
            out[par] = !out[par];
        }
    }
}


Measured memory_bytes: 7936
#include <cstdio>
#include <queue>
using namespace std;
int main(){
	int n;
	while(scanf("%d",&n) && n){
		priority_queue<long long>pque;
		for(int i=0;i<n;i++){
			long long int r;
			scanf("%lld",&r);
			pque.push(r);
		}
		long long ans=0;
		for(long long i=0;i<n;i++){
			ans+=(pque.top()*i);
			pque.pop();
		}
		printf("%lld\n",ans);
	}
}

Measured memory_bytes: 1176
#include<bits/stdc++.h>
#define ll long long
using namespace std;
bitset<2002009> dp;
int a[2009];
main(){
    int n;
    cin >> n;
    int s = 0;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        s += a[i];
    }
    dp[0] = 1;
    for(int i = 1; i <= n; i++){
        dp |= (dp << a[i]);
    }
    for(int i = (s+1)/2; i <= s; i++){
        if(dp[i]) {cout << i<<endl; return 0;}
    }
}


Measured memory_bytes: 1024
#include <iostream>
#include <iostream>

using namespace std;

int main() {

  int a, b, k, poo;
  cin >> a >> b;
  poo = ((a - 1) / k) * k + k;
  if(!(a > b)){
    cout << "un";
  }
  cout << "safe";
  return 0;
}


Measured memory_bytes: 3568
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		
		ans = Math.abs(A - B);
		
		System.out.println(ans);
	}

}


Measured memory_bytes: 26236
#include <bits/stdc++.h>
using namespace std;
int d[10];
int main()
{
	int n, k, x;
	
	scanf("%d%d", &n, &k);
	while (k--) {
		scanf("%d", &x);
		d[x] = 1;
	}
	while (1) {
		int tmp = n, fg = 1;
		while (tmp) {
			if (d[tmp % 10]) {
				fg = 0;
				break;
			}
			tmp /= 10;
		}
		if (fg) {
			break;
		}
		n++;
	}
	printf("%d\n", n);
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#define ll long long

ll A, B;

ll work(ll a){
	ll tmp = 0, tc = 0;
	if(a & 1) ((a >> 1) & 1) ? 0 : (tmp = 1);
	else ((a >> 1) & 1) && (tmp = 1);
	tc = a & 1, a >>= 1;
	for(int i = 1; i <= 60; i++){
		if(!a) break;
		if(a & 1) (!(tc & 1)) && (tmp |= (1ll << i));
		tc |= ((a & 1ll) << i * 1ll);
		a >>= 1;
	}
	return tmp;
}

int main(){
	scanf("%lld %lld", &A, &B);
	ll C = work(A - 1), D = work(B);
	printf("%lld\n", C ^ D);
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long 
#define ff first
#define ss second
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back 
#define mp make_pair
#define inf 2000000009
#define mod 1000000007
#define ld long double
using namespace std;

bool comp(pair<ll,ll> p1,pair<ll,ll> p2)
{
  if(p1.ff!=p2.ff)
  return p1.ff<p2.ff;
  else return p1.ss<p2.ss;
}

int main()
{ 

    fast;
ll n;
cin>>n;

ll x[n+1],l[n+1];
vector<pair<ld,ll > > v;

for(ll i=1;i<=n;i++)
{
  cin>>x[i]>>l[i];
  ld mn=x[i]-l[i]+0.1;
  ld mx=x[i]+l[i]-0.1;
  v.pb({mn,-i});
  v.pb({mx,i});
}

sort(v.begin(),v.end(),comp);
ll ans=0;
ll prev=0;
ll temp=0;
set<ll> sett;

for(ll i=0;i<v.size();i++)
{
  if(sett.find(abs(v[i].ss))!=sett.end())
   continue;
  else if(prev==0)
    prev=v[i].ss;

  else if(prev+v[i].ss==0)
  {
    prev=0;
    temp++;
    ans=max(ans,temp);
  }
  else
  {
    ll pp=abs(prev);
    ll cc=abs(v[i].ss);

    if(x[pp]+l[pp]>x[cc]+l[cc])
    {
      prev=-cc;
     sett.insert(pp);
    }
    else
    sett.insert(cc);
  }
}
cout<<ans<<endl;

}

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

typedef long long ll;
typedef double keytype;

void quicksort(keytype a[], int first, int last)
{
    int i, j;
    keytype x, t;

    x = a[(first + last) / 2];
    i = first;  j = last;
    for ( ; ; ) {
        while (a[i] < x) i++;
        while (x < a[j]) j--;
        if (i >= j) break;
        t = a[i];  a[i] = a[j];  a[j] = t;
        i++;  j--;
    }
    if (first  < i - 1) quicksort(a, first , i - 1);
    if (j + 1 < last) quicksort(a, j + 1, last);
}

int main(){
    int a, b, x;

    scanf("%d %d %d", &a, &b, &x);

    if(a <= x && (a + b) >= x) puts("YES");
    else puts("NO");

    return 0;
}


Measured memory_bytes: 1660
n = int(input())

list = [[[0] * 10 for i in range(3)] for i in range(4)]

for i in range(n):
    b, f, r, v = map(int, input().split())

    list[b-1][f-1][r-1] += v

for b in range(4):
    for f in range(3):
        print(' ' + ' '.join(map(str, list[b][f])))
    if b < 3:
        print("####################")


Measured memory_bytes: 5612
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ui unsigned int
#define ull unsigned ll
#define foi(n) for(ll i=0;i<n;i++)
#define foj(n) for(ll j=0;j<n;j++)
#define fok(n) for(ll k=0;k<n;k++)
#pragma GCC optimize("O3", "unroll-loops")
#define fixed(); cout << fixed << setprecision(20);
#define fast(); ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

/*****************************************************************************/


#define graph          vector<vector<int>>
#define V              vector
typedef pair<int, int> pii;
typedef pair<ll, ll>   pll;
typedef V<int>         vi;
typedef V<ll>          vll;
typedef V<string>      vs;
typedef V<double>      vd;
typedef V<pii>         vpii;              
typedef V<pll>         vpll;             
typedef pair<int,pii>  piii;             
typedef priority_queue<pii, vector<pii>, greater<pii> > pqq;   

/*****************************************************************************/

#define mp                   make_pair
#define eb                   emplace_back
#define pb                   push_back
#define pf                   push_front
#define popb                 pop_back
#define popf                 pop_front
#define hashmap              unordered_map
#define hashset              unordered_set
#define lb                   lower_bound
#define ub                   upper_bound
#define all(a)               (a).begin(), (a).end()
#define rall(a)              (a).rbegin(), (a).rend()
#define ff                   first
#define ss                   second
#define lbpos(v,x)           (int)(lower_bound(all(v),x)-v.begin())//=v.size()==>No LB 
#define ubpos(v,x)           (int)(upper_bound(all(v),x)-v.begin())//=v.size()==>No UB

/*****************************************************************************/

//for declaring most used global variables and constants
ll mod=1e9+7;


//for string with space use std::getline(cin,string_name);
//*****************UVAISH ZAFRI(Rush_For_AC)**********************
long long power(long long a, long long b,ll m) {
    if (b == 0)
        return 1;
    long long res = power(a, b / 2,m)%m;
    if (b % 2)
        return (res * res * a)%m;
    else
        return (res * res)%m;
}		

int32_t main() {
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);

	#endif
    
   ll a,b,c,d;
   cin>>a>>b>>c>>d;
   cout<<max(max(a*c,a*d),max(b*c,b*d))<<endl;


       return 0;
}


	

Measured memory_bytes: 3620