akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define pb(b) push_back(b) 
#define all(a) a.begin(),a.end()
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size_(a,b) (a,vector<ll>(b))
/* 
UnionFind：素集合系管理の構造体(union by size)
isSame(x, y): x と y が同じ集合にいるか。 計算量はならし O(α(n))
unite(x, y): x と y を同じ集合にする。計算量はならし O(α(n))
treeSize(x): x を含む集合の要素数。
*/
struct UnionFind{
 vector<int>size,parents;
 UnionFind(){}
 UnionFind(int n){//make n trees.
  size.resize(n,0);
  parents.resize(n,0);
  for(int i=0;i<n;i++)makeTree(i);
 }
 void makeTree(int x){
   parents[x]=x;//the parent of x is x
   size[x]=1;
  }
 bool isSame(int x,int y){return findRoot(x)==findRoot(y);}
 bool unite(int x,int y){
  x = findRoot(x);
  y = findRoot(y);
  if(x==y)return false;
  if(size[x]>size[y]){
   parents[y]=x;
   size[x]+=size[y];
  } 
  else{
   parents[x]=y;
   size[y]+=size[x];
  }
  return true;
 }
 int findRoot(int x){//木の根を探す,計算量削減のため低く
  if(x!=parents[x])parents[x]=findRoot(parents[x]);
  return parents[x];
 }
 int treeSize(int x){return size[findRoot(x)];}
};
/*mod*/const int mod=1e9+7;
/*pi*/const double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗 1*/ll llpow(ll x,ll n){ll ans=1,i;rep(i,0,n){ans*=x;ans%=mod;}return ans;}
/*n乗 2*/ll modpow(ll x,ll n){ll ans=x,i,tmp=x,t1=1;i=1; while(i<n){if(i*2<n){ans*=ans;ans%=mod;i*=2;}else{t1=1;tmp=x;while(t1*2<n-i){tmp*=tmp;tmp%=mod;t1*=2;}ans*=tmp;ans%=mod;i+=t1;}}return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x){ans*=(x-i);ans%=mod;}return ans;}
/*逆元*/ll inv(ll x){return modpow(x,mod-2);}
/*nCr*/ll ncr(ll n,ll r){ll a=fact(n),b=modpow(fact(n-r),mod-2),c=modpow(fact(r),mod-2);ll ans=a*b;ans%=mod;ans*=c;ans%=mod;return ans;}
/*nPr*/ll npr(ll n,ll r){ll a=fact(n),b=modpow(fact(n-r),mod-2);return (a*b)%mod;}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll i,fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=0,tmp=n;while(tmp/10>0){tmp/=10;d++;}return d;}
/*迷路移動*/const int dx[4]={1,0,-1,0};const int dy[4]={0,1,0,-1};
llfor;////////////////////////////////////////////////////////////
int main(){
 ll n;
 cin>>n;
 ll ans=n*(n-1)/2;
 pr(ans);
return 0;}

Measured memory_bytes: 3604
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	mi := int(1e15 + 1)
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			mi = min(mi, (i+n/i)-2)
		}
	}
	fmt.Println(mi)
}

func min(a, b int)int{
	if a > b{
		return b
	}
	return a
}

Measured memory_bytes: 1792
program triangular_relationship
  implicit none
  integer(8) :: n, k, ans
  read(*,*) n, k
  ans = (n/k)**3
  if (mod(k,2_8) == 0_8) ans = ans+((n+k/2_8)/k)**3
  write(*,'(i0)') ans
end program triangular_relationship

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ff first
#define ss second
#define pb push_back

#define N 200010
#define MOD 998244353

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

	int n;
	cin >> n;
	ll a[n];
	cin >> a[0];
	ll ans = a[0];
	for (int i = 1; i < n; ++i)
	{
		cin >> a[i];
		ans = __gcd(a[i], ans);
	}

	cout << ans;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e9;
bool graph[nmax][nmax];
vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
  public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}


void solve(long long W, long long H, long long x, long long y){
    cout << fixed << setprecision(10) << (double)W*H/2 << " ";
    if(x*2 == W && y*2 == H){
        cout << 1 << endl;
    }else{
        cout << 0 << endl;
    }
}

// Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long W;
    scanf("%lld",&W);
    long long H;
    scanf("%lld",&H);
    long long x;
    scanf("%lld",&x);
    long long y;
    scanf("%lld",&y);
    solve(W, H, x, y);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
const ll INF=100000000000000001;
const double PI=3.141592653589;


int main(){
  int n,m; cin>>n>>m;
  int ml=-1;
  int mr=100005;
  rep(i,m){
    int l,r; cin>>l>>r;
    ml=max(ml,l);
    mr=min(mr,r);
  }
  if(mr-ml<0)
  cout<<0<<endl;
  else
  cout<<mr-ml+1<<endl;
  return 0;
}


Measured memory_bytes: 256
r, g, b, n = map(int, input().split())

if r >= g and g >= b:
    pass
elif r >= b and b >= g:
    temp = g
    g = b
    b = temp
else:
    temp = r
    r = g
    g = temp

if (r == 1 and g == 1) or (r == 1 and b == 1) or (g == 1 and b == 1):
    rg = [i + 1 for i in range(n + 1)]
elif (r == 1 and g == 2) or (r == 1 and b == 2) or (g == 1 and b == 2) or (r == 2 and g == 1) or (r == 2 and b == 1) or (g == 2 and b == 1):
    rg = [1 + i // 2 for i in range(n + 1)]
else:
    rg = [0 for _ in range(n + 1)]
    ri = 0
    while ri <= n:
        gi = 0
        while gi <= n - ri:
            rg[ri + gi] += 1
            gi += g
        ri += r

bi = 0
result = 0

while bi <= n:
    total = rg[n - bi]
    result += total
    bi += b

print(result)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<ll, ll>;
int dp[1005];
int c[6] = {1, 5, 10, 50, 100, 500};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int x;
  fill(dp, dp + 1005, 0x3f3f3f3f);
  dp[0] = 0;
  for (int i = 1; i <= 1000; i++) {
    for (int j = 0; j < 6; j++) {
      if (i - c[j] >= 0)
        dp[i] = min(dp[i], dp[i - c[j]] + 1);
    }
  }
  while (true) {
    cin >> x;
    if (x == 0)
      break;
    x = 1000 - x;
    cout << dp[x] << endl;
  }
}


Measured memory_bytes: 3100
#include<stdio.h>
int main()
{
    int n,a[21],b[22],c[20],i,s=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d",&a[i]);
    for(i=0;i<n;i++)
        scanf("%d",&b[i]);
    for(i=0;i<n-1;i++)
        scanf("%d",&c[i]);
    for(i=0;i<n;i++)
    {
        s+=b[a[i]-1];
        if(i&&a[i]-a[i-1]==1)
            s+=c[a[i-1]-1];
    }
    printf("%d\n",s);
    return 0;
}


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

int main() {
    int a, b;
    cin >> a >> b;
    string s;
    cin >> s;
    int count = 0;
    for(int i = 0; i < s.size(); i++){
        if(s.at(i) == '-'){
            count++;
        }
    }
    if(count == 1 && s.at(a) == '-'){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ff { ios_base::sync_with_stdio(false);cin.tie(NULL);}
using namespace std;

typedef long long int ll;
 ll  p=1e9+7; 

 int  main() {
        ff;
       
       int k,a,b;
       cin>>k>>a>>b;
         
         int f=0;
         for(int i=a;i<=b;i++){
             if(i%k==0){
                 cout<<"OK"<<endl;
                 f=1;
                 break;
             }
         }
       
      if(f==0){
          cout<<"NG"<<endl;
      }
       
       
      
    return 0;
}


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

int main(){
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    int cnt;
    rep(i, k){
        if(b > a){
            cnt = i;
            break;
        }
        b *= 2;
    }
    rep(i, k-cnt){
        c *= 2;
    }
    if(c > b){
        cout << "Yes" << endl;
            return 0;
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3620
//By Don4ick
//#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

typedef long long ll;
typedef long double ld;
typedef unsigned int ui;

#define forn(i, n) for (int i = 1; i <= n; i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define y1 qwer1234

const double PI = acos(-1.0);
const int DIR = 4;
const int X[] = {1, 0, -1, 0};
const int Y[] = {0, 1, 0, -1};

using namespace std;

const int N = 1e5 + 123;
const ll inf = 1e18;

ll n, T, e, dp[N], x[N];
ll t[4 * N][2];

ll get(int v, int tl, int tr, int l, int r,int k){
	if(l > r)
		return inf;
	if(tl == l && tr == r)
		return t[v][k];
	int tm = (tl + tr) / 2;
	return min(get(v + v, tl, tm , l, min(tm, r), k), get(v + v + 1, tm + 1, tr, max(tm + 1, l), r, k));
}

void upd(int v, int tl, int tr, int pos, ll val,int k){
	t[v][k] = min(t[v][k], val);
	if(tl == tr)
		return;
	int tm = (tl + tr) / 2;
	if(pos <= tm)                  
		upd(v + v, tl, tm, pos, val, k);
	else
		upd(v + v + 1, tm + 1, tr, pos, val, k);
}


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

	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	for(int i = 0; i < 4 * N; i++)
		t[i][0] = t[i][1] = inf;
	cin >> n;
	cin >> e >> T;
	for(int i = 1; i <= n; i++)
		cin >> x[i];
	
	dp[1] = x[1];
	x[n + 1] = e;
	for(int i = 1, j = 1; i <= n; i++){
        upd(1, 1, n, i, dp[i] - x[i], 0);
		upd(1, 1, n, i, dp[i] - 3 * x[i], 1);  
		                                         
        while(j <= i && max(0ll, T - 2 * (x[i] - x[j])) == 0)
        	j++;
        
        dp[i + 1] = min(T + get(1, 1, n, j, i, 0) + x[i], get(1, 1, n, 1, j - 1, 1) + 3 * x[i]) + x[i + 1] - x[i];
	}
	cout << dp[n + 1];
	return 0;
}


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

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

  for(int i=0;i<n.size();i++){
    if(n[i]=='1'){
      cout << 9;
    }
    else{
      cout << 1;
    }
  }
  cout << endl;

  return 0;
}


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

bool isOdd(int ope){
   int two;
   two =ope /2;
   if(two*2==ope){
      return false;
   }else{
      return true;
   }
}

int main() {
   int A,B;
   cin >> A;
   cin >> B;

   int K;
   cin >> K;

   for(int i = 0; i<K;i++){

      if(isOdd(i)){
         if(isOdd(B)){
            B--;
         }
         B=B/2;
         A=A+B;
      }else {
         if(isOdd(A)){
            A--;
         }
         A=A/2;
         B=B+A;
      }   
   }
   cout << A << " ";
   cout << B;
}

Measured memory_bytes: 256
function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}
function Main(input) {
  input = myconv(input,3);
  var N = myconv(input[0],4)[0];
  var K = myconv(input[0],4)[1];
  var list = {};
  for(var i = 1; i <= N; i++){
    var a = myconv(input[i],4)[0];
    var b = myconv(input[i],4)[1];
    if(list[a] == null){
       list[a] = b;
    }else{
      list[a] += b;
    }
  }
  var set = Array.from(Object.keys(list)).sort(function(a,b){
  	return a-b;
  });
  for(var i = 0; i < set.length; i++){
    K -= list[set[i]];
    if(K <= 0){
       myout(set[i]);
      return;
    }
  }
}
Main(myin());

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

int main(){
  int n,k,q;
  cin>>n>>k>>q;
  long long int a[n];
  
  if(k>q){
      for(int i=0;i<n;i++)
       cout<<"Yes\n";
  }
  else{
      for(int i=0;i<n;i++)
       a[i]=k;
       
  for(int i=0;i<q;i++){
    int l;
    cin>>l;
    a[l-1]+=1;
  }
  for(int i=0;i<n;i++){
    if(a[i]-q>0)
       cout<<"Yes\n";
    else
       cout<<"No\n";
  }
  }
}

Measured memory_bytes: 1280
#include "bits/stdc++.h"
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define INF 100000000
typedef long long ll;

using namespace std;

int main()
{
    string str;
    cin >> str;
    int ans=INF;
    REP(i, str.size()) {
        if (str[i]==str[i + 1])continue;
        ans = min(ans, max(i + 1, (int)str.size() - i - 1));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <cmath>

using namespace std;
int main() {
	int n, k;
	cin >> n >> k;

	long long c = 0;
	for (int b = k+1; b <= n; b++) {
		c += (n / b) * max(0, b - k) + max(0, n % b - k + 1);
	}
	if (k == 0) c -= n;

	cout << c << endl;
	return 0;
}


Measured memory_bytes: 888
program xxor
  implicit none
  integer(8)              :: n, k, d, s, m
  integer(8)              :: i, j, p
  integer(8), allocatable :: a(:)
  read(*,*) n, k
  allocate(a(n))
  read(*,*) a(:)
  d = int(log(real(k,8))/log(2.d0)) + 1
  p = 2**d
  m = 0
  do i = d, 0, -1
     s = 0_8
     do j = 1, n
        if (and(p,a(j)) .eq. p) s = s + 1
     end do
     if (s .lt. n-s .and. m+p .le. k) then
        m = m + p
     end if
     p = p / 2
  end do
  p = 0
  do i = 1, n
     p = p + xor(m,a(i))
  end do
  deallocate(a)
  write(*,'(i0)') p
  stop
end program xxor

Measured memory_bytes: 1536
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace cysharp_test
{
    class Program
    {
        static void Main (string[] args)
        {
            new Program ().solve ();
        }

        void solve ()
        {
            int N = int.Parse(Console.ReadLine());
            int[] As = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            int[] nums = new int[N];

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

            for (int i = 0; i < N;i++)Console.WriteLine(nums[i]);
        }

    }

    class Vector2
    {
        public Vector2 (long x, long y)
        {
            this.x = x;
            this.y = y;
        }

        long x, y;

        public static Vector2 operator + (Vector2 a, Vector2 b)
        {
            return new Vector2 (a.x + b.x, a.y + b.y);
        }

        public static Vector2 operator - (Vector2 a, Vector2 b)
        {
            return new Vector2 (a.x - b.x, a.y - b.y);
        }

        public static Vector2 operator * (Vector2 a, long scala)
        {
            return new Vector2 (a.x * scala, a.y + scala);
        }
    }
}

Measured memory_bytes: 40152
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define INF (1LL<<59)
#define MV 200001
#define LMV 21
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define emp emplace
#define whoami(x) cerr<<#x<<" "<<x<<"\n";
#define mp make_pair
#define ins insert
#define sz size

void FLASH() {ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
void SETF() {cout.ios_base::setf(ios_base::fixed);}
void UNSETF() {cout.ios_base::unsetf(ios_base::fixed);}

typedef long long ll;
typedef long double ld;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef pair<PII, int> PPII;
typedef pair<PLL, ll> PPLL;
typedef map<int, int> MII;

const int MOD = 1000000007;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

struct h_llint {
  static uint64_t splitmix64(uint64_t x) {    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};

struct h_pair{
  size_t operator()(const PLL&x)const{
    return hash<ll>()(((ll)x.ff)^(((ll)x.ss)<<32));
  }
};

typedef map<ll, ll> MLL;
typedef map<PII, int> MPII;
typedef map<PLL, ll> MPLL;
typedef set<int> SI;
typedef set<ll> SL;
//ordered_set = order_of_key(.)
//ordered_set = find_by_order(.)
typedef ordered_set<int> OSI;
typedef ordered_set<ll> OSL;
typedef ordered_multiset<int> MOSI;
typedef ordered_multiset<ll> MOSL;
typedef unordered_map<ll, int, h_llint> UMLI;
typedef unordered_map<ll, ll, h_llint> UMLL;
typedef unordered_map<PLL, int, h_pair> UMPI;
typedef unordered_map<PLL, ll, h_pair> UMPL;

int ar[MV];
ll arr[MV];

void solve(int T)
{
	int n,m;
	cin>>n>>m;
	int sx = 0;
	for(int i=0;i<m;i++)
	{	
		cin>>ar[i];
		sx += ar[i];
	}
	cout<<max(n-sx, -1)<<"\n";
	return;	
}

int main(void)
{
	FLASH();
	int T;
	T = 1;

// #ifndef ONLINE_JUDGE
// 	time_t time_t1, time_t2;
// 	time_t1 = clock();
// #endif

	//cin>>T;
	while(T--)
	solve(T);

// #ifndef ONLINE_JUDGE
// 	time_t2 = clock();
// 	SETF();
// 	cout<<"Time taken: "<<setprecision(7)<<(time_t2 - time_t1)/(double)CLOCKS_PER_SEC<<"\n";
// 	UNSETF();
// #endif

	return 0;
}

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

const int MOD = 1000000007;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define copy(from, to) copy(from.begin(), from.end(), back_inserter(to))
#define _sort(a) sort(a.begin(), a.end())
#define _sortd(a) sort(a.rbegin(), a.rend())
#define reverse(s) reverse(s.begin(), s.end())
#define p(s) cout << (s) << endl

typedef long long ll;
using namespace std;

template<class T>
void load(vector<T> &v, int n) {
  for (int i = 0; i < n; ++i) {
    T t;
    cin >> t;
    v.push_back(t);
  }
}

template<class T>
T max(vector<T> &v) {
  return *max_element(v.begin(), v.end());
}

template<class T>
T min(vector<T> &v) {
  return *min_element(v.begin(), v.end());
}

void py(bool isUpper = false) {
  if (isUpper) {
    p("YES");
  } else {
    p("Yes");
  }
}

void pn(bool isUpper = false) {
  if (isUpper) {
    p("NO");
  } else {
    p("No");
  }
}

int main() {
  int h, w;
  cin >> h >> w;

  char board[101][101];
  bool mark_x[101] = {false};
  bool mark_y[101] = {false};
  rep(i, h) {
    rep(j, w) {
      char c;
      cin >> c;
      board[i][j] = c;
      if (c == '#') {
        mark_x[i] = true;
        mark_y[j] = true;
      }
    }
  }

  rep(i, h) {
    if (!mark_x[i]) continue;
    rep(j, w) {
      if (!mark_y[j]) continue;
      cout << board[i][j];
    }
    cout << endl;
  }

  rep(i, h) {
    rep(j, w) {
      if (board[i][j] == '#') {

      }
    }
  }
}

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

int main(){
    char s[100000];
    cin >> s;
    
    bool alp[26] = {false};
    for (int i=0;s[i] != '\0';++i) alp[s[i] - 'a'] = true;
    for (int i=0;i<26;++i){
        if (alp[i] == false) {
            printf("%c\n", (char)(i + 'a'));
            return 0;
        }
    }
    cout << "None" << endl;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i,N) for (int i = 0; i < (N); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(void){
  string s,t;
  cin >> s >> t;

  cout << t << s << endl;
}


Measured memory_bytes: 3588
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <functional>
#include <numeric>

using namespace std;
using lint = int64_t;
using P = pair<int, int>;
using D = pair<double, double>;

#define rep(i, n) for (lint i = 0; i < (n); ++i)
#define rep1(i, n) for (lint i = 1; i < (n); ++i)
#define repn(i, a, b) for(lint i = (a); i < (b); ++i)
#define Rep(i, n) for (lint i = (n); i >= 0; --i)
#define All(vec) vec.begin(), vec.end()
#define cend printf("\n")

//constexpr lint mod = 998'244'353LL;
constexpr lint mod = 1000'000'007LL;
constexpr lint inf = 3LL * mod * mod;
const double Pi = 2.0 * acos(0.0);

template<class T> using prique     = priority_queue<T>;
template<class T> using prique_inv = priority_queue<T, vector<T>, greater<T>>;
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& rhs) { return is >> rhs.first >> rhs.second; }
template<class T, class U>inline ostream& operator<<(ostream& os, const pair<T, U>& rhs) { return os << rhs.first << " " << rhs.second << "\n"; }
template<class T> void vecin(vector<T>& v) { arrin(v.begin(), v.end()); }
template<class T> void vecout(vector<T>& v) { arrout(v.begin(), v.end()); }
template<class InputIterator> void arrin(InputIterator first, InputIterator last) { for (; first != last; ++first) cin >> (*first); }
template<class InputIterator> void arrout(InputIterator first, InputIterator last) {
	for (; first != last; ++first) {
		cout << (*first) << ((first + 1) != last ? " " : "\n");
	}
}

constexpr bool pri(lint x) { for (lint i = 2; i * i <= x; ++i) if (x % i == 0) return false; return 1 < x; }

inline double dis(D a, D b) { return hypot(a.first - b.first, a.second - b.second); }

lint fact[3000000];
void fact_init(lint n) {
	if (3000000 <= n) return;
	fact[0] = fact[1] = 1;
	for (lint i = 2; i <= n; ++i) {
		fact[i] = i * fact[i - 1];
		if (mod <= fact[i]) fact[i] %= mod;
	}
}

lint modpow(lint x, lint n, lint m = mod) {
	lint res = 1;
	while (n > 0) {
		if (n & 1) {
			res *= x;
			if (m <= res) res %= m;
		}
		x *= x;
		if (m <= x) x %= m;
		n >>= 1;
	}
	return res;
}

lint intpow(lint x, lint n) {
	lint res = 1;
	while (n > 0) {
		if (n & 1) res *= x;
		x *= x;
		n >>= 1;
	}
	return res;
}

lint comb(lint n, lint r) {
	if (r == 0 || r == n) return 1;
	lint res = fact[n] * modpow(fact[n - r], mod - 2) % mod * modpow(fact[r], mod - 2) % mod;
	return res < 0 ? res + mod : res;
}

map<lint, lint> factring(lint n) {
	map<lint, lint> res;
	for (lint i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			n /= i;
			++res[i];
		}
	}
	if (n != 1) ++res[n];
	return res;
}

int n, mem, ans = 1;
int cnt[2 * 100010];
int main() {
	cin >> n;
	rep(i, n) {
		int p;
		cin >> p;
		cnt[p - 1] = i;
	}
	mem = n;
	for (int i = n - 1; i > 0; --i) {
		if (cnt[i] < cnt[i - 1]) {
			ans = max(ans, mem - i);
			mem = i;
		}
	}
	ans = max(ans, mem);
	cout << n - ans << endl;
}

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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  vector<long long> num(N);
  for(int i=0; i<N; i++){
    cin >> A.at(i);
    num.at(A.at(i)-1)++;
  }
  long long cnt = 0;
  for(int i=0; i<N; i++){
    if(num.at(i)>1){
      cnt+=(num.at(i)*(num.at(i)-1))/2;
    }
  }
  //
  //for(int i=0; i<N; i++) cout << num.at(i) << ' ';
  //cout << endl;
  //cout << cnt << endl;
  //
  for(int i=0; i<N; i++){
    long long ans;
    long long temp = cnt;
    if(num.at(A.at(i)-1)<=1) ans=temp;
    else{
      temp -= (num.at(A.at(i)-1)*(num.at(A.at(i)-1)-1))/2;
      temp += ((num.at(A.at(i)-1)-1)*(num.at(A.at(i)-1)-2))/2;
      ans = temp;
    }
    cout << ans << endl;
  }
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    int t;
    cin >> t;
    vector<ll> vec;
    vec.reserve(t);
    ll xorr = 0;
    while (t--)
    {
        ll k;
        cin >> k;
        xorr ^= k;
        vec.emplace_back(k);
    }
    for (auto &it : vec)
    {
        cout << (ll)(it ^ xorr) << ' ';
    }
    cout << '\n';
}


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

using namespace std;

int main(void){

  int n;
  string bit[10];
  bit[0] = "0111111";
  bit[1] = "0000110";
  bit[2] = "1011011";
  bit[3] = "1001111";
  bit[4] = "1100110";
  bit[5] = "1101101";
  bit[6] = "1111101";
  bit[7] = "0100111";
  bit[8] = "1111111";
  bit[9] = "1101111";

  while( cin >> n , n >= 0 ){

    int A,B;    
    cin >> A;
    cout << bit[A] << endl;
    n--;

    while(n--){
      cin >> B;
      for( int i = 0 ; i < 7 ; i++ ){
	if( bit[A][i] == bit[B][i] ){
	  cout << "0";
	}
	else cout << "1";
      }
      cout << endl;
      A = B;
    }
  }
  return 0;
}

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

#define reep(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) reep((i),0,(n));

int main(){
	int n;
	cin>>n;
	while(n){
		int out=0;
		int ans=0;
		int rui=0;
		while(out!=3){
			string s;
			cin>>s;
			if(s=="HIT"){
				if(rui==3){
					ans++;
				}
				else{
					rui++;
				}
			}
			else if(s=="OUT"){
				out++;
			}
			else{
				ans+=rui;
				ans++;
				rui=0;
			}
		}
		cout<<ans<<endl;
		n--;
	}
	return 0;
}

Measured memory_bytes: 1212
def main():
    N, K, Q = input_int_tuple()
    A = []
    for i in range(Q):
        A.append(input_int())

    points = [0] * (N+1)

    for a in A:
        points[a] += 1

    for point in points[1:]:
        if K - (Q - point) > 0:
            print('Yes')
        else:
            print('No')


def input_int():
    return int(input())


def input_int_tuple():
    return map(int, input().split())


def input_int_list():
    return list(map(int, input().split()))


main()


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

using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> h(N);
  int k=0;
  int ans=0;
  for(int& a : h){
    cin >> a;
  }
  for(int i=0;i<N-1;i++){
    if(h.at(i)>=h.at(i+1)){
      k++;
    }
    else{
      k=0;
    }
    ans=max(ans,k);
  }
  cout << ans << endl;
  return 0;
}

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

int main() {
  int n;
  cin >> n;
  int a[2][n];
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < n; j++) {
      cin >> a[i][j];
    }
  }

  // 全探索
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int sum = 0;
    // i 番目で下移動
    for (int j1 = 0; j1 <= i; j1++) {
      sum += a[0][j1];
    }
    for (int j2 = i; j2 < n; j2++) {
      sum += a[1][j2];
    }
    ans = max(ans, sum);
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
num = []
vote = []
num = list(map(int,input().split()))
vote = list(map(int,input().split()))
N = num[0]
M = num[1]
j = sum(vote)/(4*M)
#print(j)

cnt = 0
for i in vote:
    if  i>=j:
        cnt += 1
    else:
        pass
#print(cnt)
if M<=cnt:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef long long ll;

int main() {
    int x, y, z, k;    cin >> x >> y >> z >> k;
    vector<ll> a(x), b(y), c(z), v, u, s;
    for (int i = 0; i < x; i++)
        cin >> a[i];
    for (int i = 0; i < y; i++) 
        cin >> b[i];
    for (int i = 0; i < z; i++)
        cin >> c[i];

    for (int i = 0; i < x; i++) {
        for (int j = 0; j < y; j++)
            v.push_back(a[i] + b[j]);
    }
    sort(v.begin(), v.end(), greater<ll>());
    sort(c.begin(), c.end(), greater<ll>());
    for (int i = 0; i < min(k, x*y); i++)
        u.push_back(v[i]);

    for (int i = 0; i < u.size(); i++) {
        for (int j = 0; j < z; j++)
            s.push_back(u[i] + c[j]);
    }

    sort(s.begin(), s.end(), greater<ll>());
    for (int i = 0; i < k; i++)
        cout << s[i] << endl;
    return 0;
}

Measured memory_bytes: 44180
#include <iostream>
#define MAX 2000
using namespace std; 
bool solve(int p,int n,int A[],int M);
bool nouse(int p,int n,int A[],int t);
bool yesuse(int p,int n,int A[],int t);


int main()
{
	int p,t,i,j,n,q,M;
	int A[MAX];         
	cin >> n;
	for(i=0;i<n;i++){
		cin >> A[i] ;
	}         cin >>q ;
	
	for(i=0;i<q;i++){
		cin >> M;
		if(solve(0,n,A,M) == true){
			cout << "yes" << endl ;
		}
		else{
			cout << "no" << endl ;
		}
	}        
	return 0;
}

bool solve(int p,int n,int A[],int t){
	int select=0;
	bool hit=false;

	if(p == n) return false ;

	hit = nouse(p,n,A,t);
	if(hit == false)hit = yesuse(p,n,A,t);       
	if(hit==false) return false;
	return true;
}

bool nouse(int p,int n,int A[],int t){
	bool hit=false;
	p++;
	
	hit = solve(p,n,A,t);
	
	return hit ;
}

bool yesuse(int p,int n,int A[],int t){
	bool hit=false;
	
	t = t- A[p] ;
	p++; 
	if(t==0) return true;
	if(t<0) return false;
	
	return solve(p,n,A,t);
	
}

Measured memory_bytes: 1160
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int A = sc.nextInt();
        int B = sc.nextInt();
        
        System.out.println( (int)Math.ceil((A+B)/2.0) );
    }
}


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

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

    for (int i = 0; i < n; i++){
        int x;
        cin >> x;
        if (x % 2==0 && x % 3 != 0 && x % 5 != 0){
            cout << "DENIED";
            return 0;
        }
    }
    cout << "APPROVED";
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

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

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func main() {
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)

	n := nextInt()
	p := make([]int, n)
	for i := 0; i < n; i++ {
		p[i] = nextInt()
	}

	if sort.SliceIsSorted(p, func(i, j int) bool { return p[i] < p[j] }) {
		fmt.Println("YES")
		return
	}

	for a := 0; a < n-1; a++ {
		for b := a + 1; b < n; b++ {
			p[a], p[b] = p[b], p[a]
			if sort.SliceIsSorted(p, func(i, j int) bool { return p[i] < p[j] }) {
				fmt.Println("YES")
				return
			}
			p[a], p[b] = p[b], p[a]
		}
	}

	fmt.Println("NO")
}


Measured memory_bytes: 1848
#!/usr/bin/env python3

alpha = {
    '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',
}

S=set(input())
if len(S) == len(alpha):
    print("None")
else:
    print(sorted(alpha - S)[0])




Measured memory_bytes: 9116
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        //sが同じ文字だけでできていないかはんてい。同じだったら0
        char[] sa = s.toCharArray();
        int count = 100000000;
        boolean sameFlg = true;
        for (int i = 0 ; i < s.length() - 1 ; i++) {
            if (sa[i] != sa[i+1]) {
                sameFlg = false;
            }
        }
        if (sameFlg) {
            count = 0;
        }

        char[][] c = new char[100][s.length()];
        for (int i = 0 ; i < 100 ; i++) {
            for (int j = 0 ; j < s.length(); j++) {
                c[i][j] = ' ';
            }
        }
        for (int j = 0; j < s.length() ; j++) {
            c[0][j] = s.charAt(j);
        }


        for (char ch = 'a' ; ch <= 'z' ; ch++) {
            for (int i = 1 ; i < 100 ; i++) {
                for (int j = 0 ; j < s.length() - 1; j++) {
                    if (c[i - 1][j] == ch || c[i - 1][j + 1] == ch) {
                        c[i][j] = ch;
                    } else {
                        c[i][j] = c[i - 1][j + 1];
                    }
                }
                //全部chかblankだったらbreakして回数判定
                boolean flg = true;
                for (int j = 0 ; j < s.length() ; j++) {
                    if (c[i][j] != ch && c[i][j] != ' ') {
                        flg = false;
                    }
                }
                if (flg) {
                    count = Math.min(count, i);
                    break;
                }
            }

        }

        System.out.println(count);

    }

}

Measured memory_bytes: 21460
n, m = map(int, input().split())
z = [0]*(m+1)

for i in range(n):
    l= list(map(int, input().split()))
    for j in range(1, l[0]+1):
        z[l[j]] +=1

cnt = 0

for i in z:
    if i == n:
        cnt += 1

print(cnt)

Measured memory_bytes: 62496
N = int(input())
X = list(map(int, input().split()))
Y = sorted(X)
m1 = Y[N//2]
m2 = Y[N//2-1]
 
for i in range(N):
    if m1 > X[i]:
        print(m1)  # left
    else:
        print(m2)  # right

Measured memory_bytes: 25224
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include <sstream>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
#include <iomanip>
#include <regex>
#include <initializer_list>
#include <deque> 
#include <boost/multiprecision/cpp_int.hpp>
#define DBL_MIN 0.000000000000001

#include <iostream>
using namespace std;


int main(void){
    long M,MM;
    long D,DD;
    cin >> M >> D;
    MM = M;
    DD = D;
    if(abs(M - D) > 1){
        cout << 0 << endl;
        return 0;
    }
    long m_pi = 1, d_pi = 1;
    for(M; M > 0 ;M-- ){
        m_pi *= M;
        m_pi = m_pi % 1000000007;
    }

    for(D; D > 0 ;D-- ){
        d_pi *= D;
        d_pi = d_pi % 1000000007;
    }
    if(MM == DD){
        cout << m_pi*d_pi*2 % 1000000007 << endl;
    }else{
        cout << m_pi*d_pi % 1000000007 << endl;
    }
}



Measured memory_bytes: 3612
#include<stdio.h>
#define MAX 102
#define WHITE 0
#define BLACK 1
#define GRAY 2
#define INF 10000000
#define NIL -1

int n;
int a[MAX][MAX],d[MAX],pi[MAX],color[MAX];

void prim(){
  int i,u,v,mincost;

  for( u = 0 ; u < n ; u++ ){
    d[u] = INF;
    pi[u] = NIL;
    color[u] = WHITE;
  }

  d[0] = 0;

  while(1){
    mincost = INF;
    for( i = 0 ; i < n ; i++ )
      {
	if( color[i] != BLACK && d[i] < mincost ){
	  mincost = d[i];
	  u = i;
	}
      }
    color[u] = BLACK;
    if( mincost == INF ) break;
    //  color[u] = BLACK;

    for( v = 0 ; v < n ; v++ ){

      if( a[u][v] != NIL ){
	if( color[v] != BLACK && a[u][v] < d[v] ){
	pi[v] = u;
	d[v] = a[u][v];
	//	color[v] = GRAY;
      }
      }
    }
  }


}

int main(){
  int sum=0,i,j;

  scanf("%d",&n);

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

  prim();

  for( i = 0 ; i < n ; i++ ){
    if( pi[i] != NIL && a[pi[i]][i] != NIL ){
      sum += a[pi[i]][i];
    }
  }

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

  return 0;
}

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

int main() {
    int n, c1, c2;
    cin >> n;
    int dp[n + 1], h[n + 1];
    For(i, n) {
        cin >> h[i];
        dp[i] = 0;
    }
    dp[2] = abs(h[2] - h[1]);
    For(i, n - 2) {
        c1 = abs(h[i + 2] - h[i + 1]) + dp[i + 1];
        c2 = abs(h[i + 2] - h[i]) + dp[i];
        dp[i + 2] = (c1 > c2 ? c2 : c1);
    }
    cout << dp[n];
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
const ll mod = 1000000007;
const ll INF = 9223372036854775807;
#define Sort(a) sort(a.begin(), a.end())
#define Bsort(a) sort(a.begin(), a.end(), greater<ll>())
#define Pi acos(-1)

vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0;
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
        res.push_back({a, ex});
    }
    if (N != 1) res.push_back({N, 1});
    return res;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << setprecision(15) << fixed;
  ll n, p;
  cin >> n >> p;
  auto a = prime_factorize(p);
  Sort(a);
  ll ans = 1;
  for (ll i = 0; i < a.size(); i++) {
    ll t = a[i].second;
    if (t >= n) {
      for(ll j = 0; j < t/n; j++) ans *= a[i].first;
    }
  }
  cout << ans << '\n';
}

Measured memory_bytes: 256
import java.io.*;
import java.lang.*;
import java.util.*;
public class Main{  
    public static void main(String[] args) throws IOException{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int N=Integer.parseInt(br.readLine());
        double sum=Math.PI*2*N;
        System.out.println(sum);
        }
    }


Measured memory_bytes: 33132
class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.num = [1] * (n+1)#集合の要素の数
 
    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
 
    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.num[y]+=self.num[x]
        else:
            self.par[y] = x
            self.num[x]+=self.num[y]
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
 
    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

n, m = map(int, input().split())
f = [list(map(int, input().split())) for i in range(m)]

uf = UnionFind(n)
  
for i in range(m):
  a, b = f[i]
  if not uf.same_check(a, b):
    uf.union(a, b)
    
print(max(uf.num))
  

Measured memory_bytes: 122512
#include<iostream>
 
using namespace std;
 
int main(){
  int data[30];
  int temp;
  for(int i=0;i<28;i++){
    cin >>temp;
    data[temp-1]=-1;
  }
  for(int i=0;i<30;i++){
    if(data[i]!=-1){
      cout << i+1<<endl;
    }
  }
}

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

#define SPEED cin.tie(0);ios::sync_with_stdio(false);
template <class T> void chmax(T& a, const T b){a=max(a,b);}

int main() {
    SPEED
    int N; cin >> N;
    vector<int> V(N+1),W(N+1);
    for(int i = 1; i <= N; ++i) cin >> V[i] >> W[i];

    //O(Q)
    int nl = 1<<10,nr=1<<8,L_max=100001;
    vector<int> msb(nl,0);
    for(int i = 1; i < nl; ++i) msb[i]=31-__builtin_clz(i);
    vector<int> bit_w_dp(nl,0);
    vector<int> bit_v_dp(nl,0);
    vector<vector<int>> dp(nl,vector<int>(L_max,0));

    //前計算
    for(int n = 1; n < min(nl,N+1); ++n) {
        int k = 2*n;
        vector<int> l;
        while(k/=2) l.push_back(k);
        int sz=l.size();
        //bit全探索
        for(int i = 1; i < (1<<sz); ++i) {
            bit_w_dp[i]=bit_w_dp[i^(1<<msb[i])]+W[l[msb[i]]];
            bit_v_dp[i]=bit_v_dp[i^(1<<msb[i])]+V[l[msb[i]]];
            if(bit_w_dp[i]<=L_max) chmax(dp[n][bit_w_dp[i]],bit_v_dp[i]);
        }
        //累積max
        for(int i = 1; i < L_max; ++i) {
            chmax(dp[n][i],dp[n][i-1]);
        }
    }

    int Q; cin >> Q;
    string ans_str="";

    //クエリ
    while(Q--) {
        int p,L; cin >> p >> L;
        vector<int> r;
        int k = 2*p,l=0;
        while(k/=2) {
            if(k<nl) chmax(l,k);
            else r.push_back(k);
        }
        int sz = r.size(),ans=dp[l][L];
        //bit全探索
        for(int i = 1; i < (1<<sz); ++i) {
            bit_w_dp[i]=bit_w_dp[i^(1<<msb[i])]+W[r[msb[i]]];
            bit_v_dp[i]=bit_v_dp[i^(1<<msb[i])]+V[r[msb[i]]];
            if(bit_w_dp[i]<=L) chmax(ans,dp[l][L - bit_w_dp[i]]+bit_v_dp[i]);
        }
        ans_str += to_string(ans)+"\n";
    }
    cout << ans_str;

    return 0;
}


Measured memory_bytes: 408256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll MOD = 1000000007;
const ll INF = 1061109567;
const double EPS = 1e-10;
int main(){

    int D,G;
    cin>>D>>G;
    ll p[D],c[D];
    int sum=0;
    int ans;
    int min_ans=10000;

    for(int i=0;i<D;i++){
        cin>>p[i]>>c[i];
    }
    for(int i=0;i<(int)pow(2,D);i++){
        sum=0;
        ans=0;
        for(int j=0;j<D;j++){
            if(i&(1<<j)){
                sum+=(j+1)*100*p[j]+c[j];
                ans+=p[j];
            }
        }
        if(sum<G){
            for(int j=D-1;j>=0;j--){
                if(!(i&(1<<j))){
                    for(int k=0;k<p[j];k++){
                        if(sum>=G){
                            break;
                        }
                        ans++;
                        sum+=(j+1)*100;
                    }
                }
            }
        }
        if(sum>=G&&ans<min_ans){
            min_ans=ans;
        }
    }
    cout<<min_ans<<endl;
    return 0;
}


Measured memory_bytes: 4068
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]B - 81
            int N = int.Parse(Console.ReadLine());

            if (IsMultiplication(N))
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }

        static bool IsMultiplication(int N)
        {
            for(int a = 1; a <= 9; a++)
            {
                for(int b = 1; b <= 9; b++)
                {
                    if (a * b == N)
                    {
                        return true;
                    }
                }
            }

            return false;
        }
    }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
typedef long long ll;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll inf=1e9+7;
const ll mod=998244353;
//Binary Indexes Tree
vector<ll>bit(200010);
ll n;
ll sum(ll i){
    ll s=0;
    while(i>0){
        s+=bit[i];
        i=i&(i-1);
    }
    return s;
}
void add(ll i,ll a){
    while(i<=n){
        bit[i]+=a;
        i+=i&-i;
    }
}
signed main(){
    ll n_;cin>>n_;
    vector<ll>a(n_);
    rep(i,n_)cin>>a[i];
    ll l=0,r=inf;
    ll m=100001;
    n=2*m;
    if(n_==1){
        cout<<a[0]<<endl;
        return 0;
    }
    while(r-l>1){
        ll mid=(r+l)/2;
        vector<ll>s(n);
        rep(i,n_){
            if(a[i]>=mid)s[i]=1;
            else s[i]=-1;
        }
        //cout<<mid<<' ';
        REP(i,1,n_){
            s[i]+=s[i-1];
        }
        rep(i,n_){
            s[i]+=m;
        }
        rep(i,m*2){
            bit[i]=0;
        }
        ll cnt=0;
        add(m,1);
        rep(i,n_){
            //cout<<sum(s[i])<<' ';
            cnt+=sum(s[i]);
            add(s[i],1);
        }
        //cout<<endl;
        if(cnt>=(n_+1)*n_/4){
            l=mid;
        }else{
            r=mid;
        }
    }
    cout<<l<<endl;
}

Measured memory_bytes: 7132
#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
  int A,B;
  cin >> A >> B;

  for(int i=0; i<=10000; i++) {
    if( (int)(i*0.08) == A && (int)(i*0.10) == B) {
      cout << i << endl;
      return 0;
    }
  }
  puts("-1");
}

Measured memory_bytes: 256
#include <stdio.h>

#include <iostream>
#include <new>

using namespace std;

void displaySequence(int *values, int N) {
  for (int i = 0; i < N; ++i) {
    cout << values[i];
    if (i < N - 1) cout << ' ';
  }
  cout << endl;
}

void insertionSort(int *values, int N) {
  int index, current;

  for (index = 0; index < N; ++index) {
    int targetValue = values[index];
    for (current = index - 1; current >=0 && values[current] > targetValue; --current) {
      values[current + 1] = values[current];
    }
    values[current + 1] = targetValue;

    // Display intermediate sequence:
    displaySequence(values, N);
  }
}

int main() {
  int N;

  scanf("%d", &N);

  int *values = new int[N];

  for (int i = 0; i < N; ++i) {
      scanf("%d", values + i);
  }

  insertionSort(values, N);

  delete[] values;

  return 0;
}

Measured memory_bytes: 3196
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC144_
{
    class Program
    {
        static void Main(string[] args)
        {
            int l, m, n;
            var word = Console.ReadLine().Split(' ');

            l = int.Parse(word[0]);
            m = int.Parse(word[1]);

            if (1 <= l && 1 <= m && l <= 9 && m <= 9)
            {
                n = m * l;
            }
            else
            {
                n = -1;
            }
            Console.WriteLine(n);
            Console.ReadKey();



        }
    }
}


Measured memory_bytes: 13140
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素


signed main(){
  ll all_sum=0;
  string S;
  cin>>S;
  int n=S.length()-1;
  for(int i=0;i<(1<<n);i++){
    ll part_sum=0;
    ll part=0;
    for(int j=0;j<n;j++){
      if(i&(1<<j)){
        part_sum+=part+(S[j]-'0');
        part=0;
      }else{
        part+=(S[j]-'0');
        part*=10;
      }
    }
    all_sum+=part_sum+part+S[n]-'0';
  }
  cout<<all_sum;

}

Measured memory_bytes: 256