akhauriyash/Code-Regression huggingface dataset:
a = ['11', '31', '41', '61', '71', '101', '131', '151', '181', '191', '211', '241', '251', '271', '281', '311', '331', '401', '421', '431', '461', '491', '521', '541', '571', '601', '631', '641', '661', '691', '701', '751', '761', '811', '821', '881', '911', '941', '971', '991', '1021', '1031', '1051', '1061', '1091', '1151', '1171', '1181', '1201', '1231', '1291', '1301', '1321', '1361', '1381']
print(' '.join(a[:int(input())]))

Measured memory_bytes: 3064
import heapq
import sys
input = sys.stdin.readline
INF = 10 ** 18


n = int(input())
edges = [list(map(int, input().split())) for i in range(n - 1)]
k = int(input())
info = [list(map(int, input().split())) for i in range(k)]

tree = [[] for i in range(n)]
for a, b in edges:
    a -= 1
    b -= 1
    tree[a].append(b)
    tree[b].append(a)

ans = [INF] * n
q = []
for v, val in info:
    v -= 1
    ans[v] = val
    heapq.heappush(q, (-val, v))
    for nxt_v in tree[v]:
        if ans[nxt_v] != INF and abs(ans[v] - ans[nxt_v]) != 1:
            print("No")
            exit()

while q:
    val, v = heapq.heappop(q)
    val = -val
    for nxt_v in tree[v]:
        if ans[nxt_v] == INF:
            ans[nxt_v] = val - 1
            heapq.heappush(q, (-(val - 1), nxt_v))
        else:
            if abs(ans[v] - ans[nxt_v]) != 1:
                print("No")
                exit()

print("Yes")
for val in ans:
    print(val)

Measured memory_bytes: 105692
#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<cstdio>
#include<cstring> 
#include<vector>
#include<queue>
using namespace std;
const int N=200100;
int n,m,val[N],vis[N];
vector<int> E[N];
char s[N];
queue<int> Q;
int check(int i)
{
	int v1=0,v2=0;			
	for(auto x:E[i])
	{
		if(vis[x]) continue;
		if(val[x]==0) v1=1;
		else v2=1;
	}
	return v1*v2;
}
int main()
{
	cin>>n;cin>>m;
	scanf("%s",s+1);
	for(int i=1;i<=n;i++) val[i]=s[i]-'A';
	for(int i=1;i<=m;i++)
	{
		int x,y;cin>>x>>y;
		E[x].push_back(y);
		if(x^y) E[y].push_back(x);	
	}
	for(int i=1;i<=n;i++) 
		if(!check(i)) Q.push(i),vis[i]=1;
	while(!Q.empty())
	{
		int x=Q.front();Q.pop();
		for(auto p:E[x]) 
			if(!vis[p]&&!check(p))
				Q.push(p),vis[p]=1; 
	}
	for(int i=1;i<=n;i++)
		if(!vis[i]) {puts("Yes");return 0;}
	puts("No");
}

Measured memory_bytes: 12544
#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
} 

vector <pair<int,int> > dish;
int n;
int t;
vector <vector <int> > dp;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    n=nxt();
    t=nxt();
    dish.resize(n);
    for(int i=0;i<n;i++)
        cin>>dish[i].first>>dish[i].second;
    vector <int> row;
    row.resize(t,0);
    dp.resize(n,row);
    vector <vector <int> > dp2;
    dp2.resize(n,row);
    for(int i=dish[0].first;i<t;i++){
        dp[0][i]=dish[0].second;
    }

    for(int i=dish[n-1].first;i<t;i++){
        dp2[n-1][i]=dish[n-1].second;
    }

    

    for(int i=1;i<n;i++)
    {
        int a=dish[i].first;
        int val=dish[i].second;
        int j=0;
        while(j<t&&j<a){
            dp[i][j]=dp[i-1][j];
            j++;
        }
        while(j<t)
        {
            dp[i][j]=max(dp[i-1][j],dp[i-1][j-a]+val);
            j++;
        }
    }

    for(int i=n-2;i>=0;i--)
    {
        int a=dish[i].first;
        int val=dish[i].second;
        int j=0;
        while(j<t&&j<a){
            dp2[i][j]=dp2[i+1][j];
            j++;
        }
        while(j<t)
        {
            dp2[i][j]=max(dp2[i+1][j],dp2[i+1][j-a]+val);
            j++;
        }
    }

    ll test=max(dp[n-2][t-1]+dish[n-1].second,dp2[1][t-1]+dish[0].second);
    //cout<<dp[n-2][t-1]<<" "<<dp2[1][t-1]<<endl;
    for(int i=1;i<n-1;i++)
    {
        for(int j=0;j<t;j++)
            test=max(test,dp[i-1][j]+dp2[i+1][t-1-j]+dish[i].second);
    }

    cout<<test<<endl;


    return 0;   
}


 
 


Measured memory_bytes: 70912
// https://atcoder.jp/contests/abc043/tasks/abc043_a
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s, t;
    cin >> s;
    for (auto &x : s) {
        if (x == '0') {
            t.push_back('0');
        } else if (x == '1') {
            t.push_back('1');
        } else {
            if (t.size() > 0) {
                t.pop_back();
            }
        }
    }
    cout << t << endl;

    return 0;
}


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

using namespace std;

long long int binary(long long int bina) {
	long long int ans = 0;
	for (long long int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2) * pow(10, i);
		bina = bina / 2;
	}
	return ans;
}

int main()
{
	int n;
	long long int a, b, c;
	long long int ba = 0b0;
	long long int ca = 0b0;
	long long int as[100];
	cin >> n;
	long long int wa = 0b0;
	for (int i = 0; i < n; i++) {
		long long int aa = 0b0;
		cin >> a;
		aa = binary(a);
		wa ^= a;
	}
	if (wa == 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define ll 			long long
#define vl 			vector<ll>
#define vi 			vector<int>
#define pi 			pair<int,int>
#define pl 			pair<ll,ll>
#define all(a)      a.begin(),a.end()
#define mem(a,x)    memset(a,x,sizeof(a))
#define pb 			push_back
#define mp 			make_pair
#define F 			first
#define S 			second
#define trace(x) 	cerr<<#x<<":"<<x<<endl;
#define trace2(x,y) cerr<<#x<<":"<<x<<"|"<<#y<<":"<<y<<endl;
#define trace3(x,y,z) cerr<<#x<<":"<<x<<"|"<<#y<<":"<<y<<"|"<<#z<<":"<<z<<endl;
#define fast_io 	std::ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)

using namespace std;


int main()
{
	fast_io;
	int n;
	cin>>n;
	string s;
	s=to_string(n);
	int su=0;
	for(int i=0;i<s.length();i++)
	{	
		su+=(int)s[i]-48;
	}//trace(su)
	if(n%su==0)cout<<"Yes";
	else cout<<"No";
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int main() {
  int n;
  string s; 
  cin >> n >> s;
  if(n%2 != 0) {
    cout << "No" << endl;
    return 0; 
    }
  
  string a = s.substr(0, n/2);
  string b = s.substr(n/2);

  if(a == b) cout << "Yes" << endl; else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<vector>
#include<algorithm>
#include<map>
#include<math.h>
using namespace std;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    a-=b;
    if(c>a) cout<<c-a<<endl;
    else cout<<0<<endl;
    return 0;
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

const ll N_MAX = 200005;

ll inv[N_MAX],fac[N_MAX],finv[N_MAX];
void make(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<N_MAX;i++){
        inv[i]=mod-inv[mod%i]*(mod/i)%mod;
        fac[i]=fac[i-1]*(ll) i%mod;
        finv[i]=finv[i-1]*inv[i]%mod;
    }
}

ll combination(ll C, ll D){
    if(C<D||C<1) return 0;
    return fac[C]*(finv[D]*finv[C-D]%mod)%mod;
}

map<ll, ll> mp;
void prime_factorization(ll x){
    bool flag = true;
    while(flag){
        ll sqx = sqrt(x)+1;
        for(ll j=2;j<sqx+1;j++){
            if(x%j==0){
                mp[j]++;
                x/=j;
                break;
            }
            if(j==sqx) flag = false;
        }
    }
    if(x!=1){
        mp[x]++;
    }
}

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

    ll N, M;
    cin >> N >> M;

    prime_factorization(M);

    ll res = 1;
    for(auto x: mp){
    	res *= combination(N-1+x.second, x.second);
    	res %= mod;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 4992
#include <iostream>
#include<algorithm>
#include <vector>
#include <iomanip>
#include<string.h>
#include<complex>

int main()
{
    long N,K,Q;
    std::vector<long> A;
    long P[100000]={};
    std::cin >> N >> K >> Q;
    for(long i=0; i<Q; i++){
        long temp;
        std::cin >> temp;
        A.push_back(temp);
    }
    std::sort(A.begin(),A.end());
    for(long i=0; i<Q; i++){
        P[A[i]-1]++;
    }
    for(long i=0; i<N; i++){
        if(Q-P[i]<K){
            std::cout << "Yes" << std::endl;
        }else{
            std::cout << "No" << std::endl;
        }
    }
    return 0;
}

Measured memory_bytes: 2292
#include<math.h>
int isprime(int);

int main(){
  int x,n[10000],i,count=0;
  scanf("%d",&x);
  for(i=0;i<x;i++){
    scanf("%d",&n[i]);
  }
  for(i=0;i<x;i++){
    if(isprime(n[i])==1)
      count++;
  }
  printf("%d\n",count);
  return 0;
}

int isprime(int x)
{
  int i;
  if(x==2) return 1;
  if(x<2 || x%2==0)
    return 0;
  i=3;
  while(i<=sqrt(x)){
    if(x%i==0)
      return 0;
      i=i+2;
  }
      return 1;
    }

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

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            string digits = Console.ReadLine();
            bool isFound = false;
            for (int i = 0; i < digits.Length; i++)
            {
                if(digits[i] == '7')
                {
                    isFound = true;
                    break;
                }
            }
            Console.WriteLine(isFound ? "Yes" : "No");

        }
    }
}


Measured memory_bytes: 17304
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import numpy as np
n, m = map(int, input().split())
xyz = [list(map(int, input().split())) for _ in range(n)]
xyz = np.asarray(xyz)
ans = 0
for i in [-1, 1]:
    for j in [-1, 1]:
        for k in [-1, 1]:
            tmp = xyz.copy()
            tmp[:, 0] = i * xyz[:, 0]
            tmp[:, 1] = j * xyz[:, 1]
            tmp[:, 2] = k * xyz[:, 2]
            base = sum(sorted(np.sum(tmp, axis=1), reverse=True)[:m])
            if base > ans:
                ans = base
print(ans)


Measured memory_bytes: 21652
import std;

void main()
{
    const N = readln().chomp().to!uint();
    const S = readln().chomp();

    size_t ans = count(S, 'R') * count(S, 'G') * count(S, 'B');

    foreach (uint i; 0 .. N)
    foreach (uint j; i + 1 .. N)
    {
        if (S[i] == S[j]) continue;
        const k = 2 * j - i;
        if (k >= N) continue;
        if (S[j] == S[k] || S[i] == S[k]) continue;
        --ans;
    }

    writeln(ans);
}


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

using namespace std;

// Solve function here


// End Solve function

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int64_t n, m;
	cin >> n >> m;
	if(n > m) n %= m;
	cout << min(n, abs(n-m)) << endl;
  	return 0;
	
}


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

int main(){
	int n,k,a[1005];
	cin>>n>>k;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a,a+n);
	int ans=0;
	for(int i=0;i<k;i++){
		ans+=a[i];
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>
#include <new>
#include <typeinfo>
#include <iterator>
#include <cassert>

using ll = long long;
using ull = unsigned long long;
constexpr ll mop = 1000000007;
constexpr ll mop2 = 998244353;

using namespace std;

constexpr ll NOT_SPECIFIED_VALUE_MIN = INT64_MIN;
constexpr ll NOT_SPECIFIED_VALUE_MAX = INT64_MAX;


int main() {
	ll n, x, t;
	cin >> n >> x >> t;
	if (n % x == 0) {
		cout << t * (n / x) << endl;
	}
	else {
		cout << t * (n / x + 1) << endl;
	}
}


Measured memory_bytes: 3512
#include <cstdio>

const int MN = 1005;

int N;
int X[MN][20], Y[MN][20];

inline void V(int *A) {
	static int _[3] = {0, 1, -1};
	int x = A[0];
	for (int j = 0; j <= 19; ++j) {
		A[j] = _[(x % 3 + 3) % 3];
		x = (x - A[j]) / 3;
	}
}

int main() {
	scanf("%d", &N);
	for (int i = 1; i <= N; ++i) scanf("%d%d", &X[i][0], &Y[i][0]);
	for (int i = 1; i <= N; ++i) if ((X[i][0] ^ Y[i][0] ^ X[1][0] ^ Y[1][0]) & 1) return puts("-1"), 0;
	int O = (X[1][0] ^ Y[1][0]) & 1;
	for (int i = 1; i <= N; ++i) V(X[i]), V(Y[i]);
	printf("%d\n", O ? 39 : 40);
	for (int j = 0, x = 1; j <= 19; ++j, x *= 3) {
		if (j == 19) {
			if (O) printf("%d\n", x);
			else printf("%d %d\n", x, x);
		} else printf("%d %d ", x, x);
	}
	for (int i = 1; i <= N; ++i) {
		int *x = X[i], *y = Y[i];
		for (int j = 0; j <= 19; ++j) {
			if (x[j] == 2) x[j] = -1, ++x[j + 1];
			if (x[j] == -2) x[j] = 1, --x[j + 1];
			if (y[j] == 2) y[j] = -1, ++y[j + 1];
			if (y[j] == -2) y[j] = 1, --y[j + 1];
			if (j == 19 && O) {
				if (x[j]) printf("%c", ~x[j] ? 'R' : 'L'), x[j] = 0;
				if (y[j]) printf("%c", ~y[j] ? 'U' : 'D'), y[j] = 0;
			} else if (!x[j] && !y[j]) printf("RL");
			else if (x[j] && y[j]) printf("%c%c", ~x[j] ? 'R' : 'L', ~y[j] ? 'U' : 'D'), x[j] = y[j] = 0;
			else if (x[j]) printf("%s", ~x[j] ? "LL" : "RR"), x[j + 1] += x[j], x[j] = 0;
			else if (y[j]) printf("%s", ~y[j] ? "DD" : "UU"), y[j + 1] += y[j], y[j] = 0;
		} puts("");
	}
	return 0;
}

Measured memory_bytes: 384
S = input()
S_first_half = int(S[0:2])
S_last_half = int(S[2:5])

if 1 <= S_first_half <= 12:
    if 1 <= S_last_half <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif 1 <= S_last_half <= 12:
    print("YYMM")
else:
    print("NA")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define FAST_IO                     \
  ios_base::sync_with_stdio(false); \
  cin.tie(0);                       \
  cout.tie(0);
typedef long long ll;
/**
 * Uncomment the #define below if problem contains multiple test cases
 */
// #define MULTIPLE_TESTS 1

void solve() {
  double r;
  cin >> r;

  double res = 2 * 3.141592653589793238 * r;
  cout << fixed;
  cout << setprecision(6) << res << endl;
}

int main() {
  FAST_IO;
  int t = 1;
#ifdef MULTIPLE_TESTS
  cin >> t;
#endif

  while (t--) {
    solve();
  }

  return 0;
}

Measured memory_bytes: 3780
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		double r = sc.nextDouble();
		sc.close();
		
		double pi = Math.PI;
		double area = pi * r * r;
		double circle = 2 * pi * r;

		System.out.printf("%f %f", area, circle);
	}
}

Measured memory_bytes: 18928
import java.util.*;
public class Main{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int w[]=new int[n];
    int total=0;
    for (int i=0;i<n;i++) {
      w[i]=sc.nextInt();
    }
    int a[]=new int[n+1];
    for (int i=0;i<n;i++) {
      a[i+1]=a[i]+w[i];
      total=total+w[i];
    }

    // for (int i=0;i<a.length;i++) {
    //   System.out.println(a[i]);
    // }

    int min=100;

    for (int i=0;i<a.length;i++) {
      int b1=a[i];
      int b2=total-a[i];
      int ans=Math.abs(b1-b2);
      min=Math.min(min,ans);

    }

    System.out.println(min);

  }
}


Measured memory_bytes: 22996
/* Aditya0412 */
#include <bits/stdc++.h>
using namespace std; 
typedef long long int ll;
#define pb push_back 
//#define pop pop_back
#define mp make_pair
#define ve vector
#define vii vector < int >
#define vll vector < ll > 
#define pii pair < int , int >
#define pll pair < ll , ll >
#define vpl vector < pll >
#define fi first
#define sz size 
#define len length 
#define se second 
//const ll mod=998244353;
const ll mod = 1000000000+7;
const ll N=1000000+6;
#define M_PI           3.14159265358979323846 
vector< ll > tree[N];

int main() 
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    // #ifndef ONLINE_JUDGE
    //   freopen ("INPUT.txt" , "r" , stdin);
    //   freopen ("OUTPUT.txt", "w" , stdout);
    // #endif 
     ll x;
     cin>>x;
     ll r=x/500;
     ll ans=r*1000;
     x=x%500;
     r=x/5;
     ans+=(r*5);
     cout<<ans<<'\n';
}

Measured memory_bytes: 23680
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 1ll<<59


vector<ll> dp1(25002500,0),dp2(25002500,0);

int main(){
  ll i,j;
  ll n;
  cin>>n;
 
  ll ga,sa,ba,gb,sb,bb;
  cin>>ga>>sa>>ba>>gb>>sb>>bb;

  for(i=1;i<25002500;i++){
    dp1[i]=i;
    dp2[i]=i;
    if(i-ga>=0) dp1[i]=max(dp1[i],dp1[i-ga]+gb);
    if(i-sa>=0) dp1[i]=max(dp1[i],dp1[i-sa]+sb);
    if(i-ba>=0) dp1[i]=max(dp1[i],dp1[i-ba]+bb);
    if(i-gb>=0) dp2[i]=max(dp2[i],dp2[i-gb]+ga);
    if(i-sb>=0) dp2[i]=max(dp2[i],dp2[i-sb]+sa);
    if(i-bb>=0) dp2[i]=max(dp2[i],dp2[i-bb]+ba);
  }

  cout<<dp2[dp1[n]]<<endl;
  return 0;
}

Measured memory_bytes: 391040
#include <bits/stdc++.h>
#define ll long long
#define PB push_back
#define MP make_pair

#define REP(i, n) for(int i=0;i<(int)(n);++i)
#define FOR(i,l,h) for(int i=(int)(l);i<=(int)(h);++i)
#define FORD(i,h,l) for(int i=(int)(h);i>=(int)(l);--i)

#define max(a,b) a>b?a:b
#define min(a,b) a>b?b:a

ll gcd(ll a, ll b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }

#define dump(x)  cerr << #x << " = " << (x) << endl
#define ALL(t) (t).begin(),(t).end()

using namespace std;

/*
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin>>s;
    //std::map<char, int> mp
    int cnta = 0 , cntb = 0;
    for (size_t i = 0; i < 3; i++) {
        if(s[i] == 'A'){
            cnta++;
        }
        else{
            cntb++;
        }
    }
    if(cnta == 0 || cntb == 0){
        cout<<"No\n";
    }
    else{
        cout<<"Yes\n";
    }
    return 0;
}
*/
/*
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll int n,b,r;cin>>n>>b>>r;
    ll int rem , time;
    rem = n%(b+r);
    if(rem > b){
        rem = b;
    }
    time = n/(b+r);
    cout<<((ll)b*time) + rem;
    return 0;
}
*/
const int nax = 100005;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int a,b;
    cin>>a>>b;
    ll int cnta , cntb , cnt1 , cnt2;
    //cnt1 = (100*a)/8;
    //cnt2 = (100*b)/10;
    //ll int l = min(cnt1,cnt2);
    for (size_t i = 1; i < nax; i++) {
        cnta = floor(i*0.08);
        cntb = floor(i*0.1);
        //dump(cnta);dump(cntb);
        if(cnta == a && cntb == b){
            cout<<i;
            return 0;
        }
    }
    cout<<"-1";
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define lli long long int
#define REP(i,s,l) for(lli i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)

lli dp[3010][3010];
lli vis[3010][3010];
lli n;
vector<lli> a;

lli f(lli l,lli r){
	if(l>r)return 0;
	if(vis[l][r])return dp[l][r];

	lli diff = n-(r-l+1);
	lli res;
	if(diff%2==0){
		res = -INF;
		res = max(res,f(l+1,r)+a[l]);
		res = max(res,f(l,r-1)+a[r]);
	}
	else{
		res = INF;
		res = min(res,f(l+1,r)-a[l]);
		res = min(res,f(l,r-1)-a[r]);
	}
	vis[l][r]=1;
	return dp[l][r]=res;
}

signed main(){

	cin>>n;
	a.resize(n);
	REP(i,0,n)cin>>a[i];

	REP(i,0,3010)REP(j,0,3010){
		dp[i][j]=0;
		vis[i][j]=0;
	}
	cout<<f(0,n-1)<<endl;

	return 0;
}

Measured memory_bytes: 141952
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define f first
#define s second
int a[200000]={0};
int main(){
int n,i,j;
pair<int,int> mx,sb;
mx.f=0;
sb.f=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
if(mx.f<=a[i]){
sb.f=mx.f;
sb.s=mx.s;
mx.f=a[i];
mx.s=i;
}
else if(sb.f<a[i]){
sb.f=a[i];
sb.s=i;
}
}
for(i=0;i<n;i++){
if(i!=mx.s)
printf("%d\n",mx.f);
else
printf("%d\n",sb.f);
}
return 0;
}


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

int main() {
    char c1[3];
    char c2[3];

    for (int i = 0; i < 3; i++) {
        cin >> c1[i];
    }

    for (int i = 0; i < 3; i++) {
        cin >> c2[i];
    }

    if (c1[0] == c2[2] && c1[1] == c2[1] && c1[2] == c2[0]) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int MOD = 1000000007;

int main() {
  int N; cin >> N;
  int result = ceil((double)N/111)*111;
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 256
IDENTIFICATION DIVISION.
	PROGRAM-ID. IDEONE.

	ENVIRONMENT DIVISION.

	DATA DIVISION.
	WORKING-STORAGE SECTION.
	01 INP PIC X(100).
	01 K PIC 9(10).
	01 X PIC 9(10).
	01 temp1 PIC 9(10).
    01 temp2 PIC 9(10).
    01 N PIC 9(10).
	
	PROCEDURE DIVISION.
	MAIN.
		ACCEPT INP.
        PERFORM VARYING temp1 FROM 1 BY 1 UNTIL INP(temp1:1)=SPACE
        END-PERFORM.
        SUBTRACT 1 FROM temp1.
        MOVE INP(1:temp1) TO K.
        ADD 2 TO temp1.
        PERFORM VARYING temp2 FROM temp1 BY 1 UNTIL INP(temp2:1)=SPACE
        END-PERFORM.
        COMPUTE N=temp2 - temp1.
        MOVE INP(temp1:N) TO X.
		COMPUTE K = K * 500.
		IF K >= X THEN
			DISPLAY "Yes"
		ELSE 
			DISPLAY "No"
		END-IF.
		STOP RUN.

Measured memory_bytes: 384
// TOPSIC001_0

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

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

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

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

    S.at(K) = tolower(S.at(K));
    cout << S;

    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef pair<double,double> pdd;
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) ll(i.size())
#define FOR(i, j, k, in) for (ll i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (ll i=j ; i>=k ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define REP1(i,j) FOR(i, 1, j+1, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define ALL(_a) _a.begin(),_a.end()
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#ifdef tmd
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
#endif

template<class T> inline bool cmax(T &a, const T &b) { return b > a ? a = b, true : false; }
template<class T> inline bool cmin(T &a, const T &b) { return b < a ? a = b, true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

const ll MOD=1000000007;
const ll INF=0x3f3f3f3f3f3f3f3f;
const ll MAXN=1e5+5;
const ll MAXLG=__lg(MAXN)+2;

int x[4],y[4];
/********** Main()  function **********/
int main()
{
  IOS();
  cin>>x[0]>>y[0]>>x[1]>>y[1];
  int a = x[0] - x[1];
  int b = y[0] - y[1];
  cout<<x[1]+b<<" "<<y[1] - a<<" "<<x[1]+b+a<<" "<<y[1] - a+b<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const long long inf=1e18;
const long long Mod=1000000007;
struct node
{
	long long x,y;
};
int q;
long long fib[100];
vector<node> v[100],ch;
int main()
{
	fib[0]=fib[1]=1;
	int k=1;
	while (true)
	{
		k++;
		fib[k]=fib[k-1]+fib[k-2];
		if (fib[k]>inf)
		{
			break;
		}
	}
	k--;
	v[1].push_back((node){1,2});
	v[1].push_back((node){1,3});
	v[1].push_back((node){1,4});
	for (int i=1;i<k-2;i++)
	{
		for (int j=0;j<v[i].size();j++)
		{
			long long x=v[i][j].x;
			long long y=v[i][j].y;
			x+=y;
			while (x<=fib[i]+fib[i+3])
			{
				v[i+1].push_back((node){y,x});
				x+=y;
			}
		}
	}
	scanf("%d",&q);
	while (q--)
	{
		long long n,m;
		scanf("%lld%lld",&n,&m);
		if (n>m)
		{
			swap(n,m);
		}
		k=1;
		while (fib[k+1]<=n && fib[k+2]<=m)
		{
			k++;
		}
		printf("%d ",k);
		if (k==1)
		{
			n%=Mod;
			m%=Mod;
			printf("%lld\n",n*m%Mod);
			continue;
		}
		long long ans=0;
		k--;
		for (int i=0;i<v[k].size();i++)
		{
			long long x=v[k][i].x;
			long long y=v[k][i].y;
			if (y<=n)
			{
				ans=(ans+(m-x)/y)%Mod;
			}
			if (y<=m)
			{
				ans=(ans+(n-x)/y)%Mod;
			}
		}
		printf("%lld\n",ans);
	}
    return 0;
}
//凝眸顾盼柔情藏，灵动佳人婉清扬。

Measured memory_bytes: 4096
import java.util.Scanner;
  
class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
  
        int [][][] build = new int [4][3][10];
        int tatemon,floo,roo;
  
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){
  
                build [tatemon][floo][roo] = 0;
  
                }
            }
        }
  
        int n = scan.nextInt();
        int tatemono = 0;
        int floor= 0;
        int room = 0;
        int info,person;
        String result;
  
        for(info = 0; info < n; info++){
                     
        tatemono = scan.nextInt();
        floor = scan.nextInt();
        room = scan.nextInt();
        person = scan.nextInt();
        build [tatemono-1][floor-1][room-1] = build [tatemono-1][floor-1][room-1]+person;
        }
          
                 
        for(tatemon = 0; tatemon < 4; tatemon++){
            for(floo = 0; floo < 3; floo++){
                for(roo = 0; roo < 10; roo++){ 
                      
                result = " "+build [tatemon][floo][roo];
                      
                /*switch(tatemono){
                 case 1: 
                System.out.print(result);
                break;       
                 case 2:
                System.out.print(result);
                break;       
                case 3:
                System.out.print(result);
                break;           
                case 4:
                System.out.print(result);
                break;       
                default:    
                } */
                System.out.print(result);
                }
                System.out.println();
            }
            if(tatemon < 3){
            System.out.println("####################");
            }
        }
         
    }
}

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

using namespace std;
#define int long long
int32_t main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    string s;
    cin>>s;
    int sum=0;
    for(int i=0;i<s.size();++i)
    {
        sum+=(s[i]-'0');
    }
    int dp[n+1];
    dp[0]=0;
    for(int i=1;i<=n;++i)
    {
        dp[i]=dp[i%__builtin_popcount(i)]+1;
    }
    int po1[n];
    int po2[n];
    int po3[n];
    int u=1;
    for(int i=0;i<n;++i)
    {
        po1[i]=u;
        u*=2;
        u%=(sum+1);
    }
    if(sum==0)
    {
        for(int i=0;i<n;++i)
        {
            po2[i]=0;
        }
    }
    else
    {
         u=1;
    for(int i=0;i<n;++i)
    {
        po2[i]=u;
        u*=2;
        u%=(sum);
    }
    }
    if(sum<=1)
    {
        for(int i=0;i<n;++i)
        {
            po2[i]=0;
        }
    }
    else
    {
         u=1;
    for(int i=0;i<n;++i)
    {
        po3[i]=u;
        u*=2;
        u%=(sum-1);
    }
    }
    int answ1=0;int answ2=0;int answ3=0;
    reverse(s.begin(),s.end());
    for(int i=0;i<n;++i)
    {
        answ1+=po1[i]*(s[i]-'0');
        answ2+=po2[i]*(s[i]-'0');
        answ3+=po3[i]*(s[i]-'0');
    }
    for(int i=s.size()-1;i>=0;--i)
    {
        if(s[i]=='1')
        {
            if(sum==1)
            {
                cout<<0<<endl;
                continue;
            }
            int r=answ3;
            r-=po3[i];
            cout<<dp[((r%(sum-1))+(sum-1))%(sum-1)]+1<<endl;
        }
        else
        {
            int r=answ1;
            r+=po1[i];
            cout<<dp[r%(sum+1)]+1<<endl;
        }
    }
    return 0;
}


Measured memory_bytes: 9996
#include <stdio.h>
using namespace std;
int N;
int X;
int c=0;
int main(){
  if(scanf("%d %d", &N, &X)==1);
  int L[N];
  int D[N+1];
  D[0]=0;
  c++;
  for(int i=0; i<N; i++){
   if(scanf("%d", &L[i])==1); 
  }
  for(int i=1; i<N+1; i++){
    D[i] = D[i-1] + L[i-1];
    if(D[i] <= X){
      c++;
    }
  }
  printf("%d", c);
  return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main(){
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << max({a * c, a * d, b * c, b * d});
}

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

using namespace std;

const int N = 100005;
int a[N];

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a, a + n);
    int cnt = 1, res = 0;
    for (int i = 1; i < n; i++) {
        if (a[i] != a[i-1]) {
            if (cnt >= a[i-1]) {
                res += cnt - a[i-1];
            } else {
                res += cnt;
            }
            cnt = 0;
        }
        cnt++;
    }
    if (cnt >= a[n-1]) {
        res += cnt - a[n-1];
    } else {
        res += cnt;
    }
    cout << res;
    return 0;
}

Measured memory_bytes: 3972
//https://atcoder.jp/contests/abc125/tasks/abc125_b
#include <iostream>
using namespace std;
int main(){
    int N;
    cin >> N;
    int *V = new int[N];
    int *C = new int[N];

    for(int i = 0; i<N;i++){
    cin >> V[i];
    }
    for(int i = 0; i<N;i++){
    cin >> C[i];
    }
    int D=0;
    for(int i=0;i<N;i++){
        //cout << V[i] << ":" <<C[i] << endl;
        if(V[i]-C[i]>0){
            D +=V[i]-C[i];
        }
    }
    cout << D << endl;
    return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <bitset>
#include <memory>
#include <string>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <deque>
#include <algorithm>
#include <random>
#include <iomanip>

using namespace std;


int main(int argc, char *argv[]) {
	int l;
	cin >> l;
	double a = l * 1.0 / 3;
	cout << setprecision(12) << a * a * a << endl;
}









Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
	int a, b, c;
	cin >> a >> b >> c;
	int d = 3 * max(max(a, b), c) - a - b - c;
	cout << (d % 2 ? d / 2 + 2 : d / 2);
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long int ll;

template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const int INF = 1e9 + 7;


int main() {

	int n, m;
	cin >> n;
	string s;
	cin >> s;
	cin >> m;
	char c = s[m - 1];

	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] != c)
		{
			s[i] = '*';
		}
	}
	cout << s << endl;



}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int N,M;
int L,R;
int ans=0;
int main(){
    cin >> N >> M;
    vector<int> le(M+1);
    vector<int> ri(M+1);
    for(int i=0;i<M;i++){
        cin >> le.at(i) >> ri.at(i);
    }
    L=le.at(0);
    R=ri.at(0);
    for(int i=1;i<M;i++){
//        if(ri.at(i)>=L || le.at(i)<=R){
            if(L<le.at(i)){
                L=le.at(i);
            }
            if(R>ri.at(i)){
                R=ri.at(i);
            }
        }
//    }
    if(L<=R){
        ans=R-L+1;
    }
    cout << ans;
}


Measured memory_bytes: 1024
import collections
import itertools

n = int(input())
lst = []
for _ in range(n):
    lst.append(str(input()))
    
c = collections.Counter(lst)

mode_v = c.most_common()[0][-1]
it = itertools.takewhile(
    lambda kv: kv[-1] == mode_v, c.most_common()
)

lst2 = [k for k, v in it]

print(' '.join(sorted(lst2)))

Measured memory_bytes: 45112
n=int(input())
A=map(int,input().split())
B=map(int,input().split())
a=list(A)
b=list(B)
s=0
m=0

for i in range(0,n):
    l=a[i]-m
    if l<=0:
        s=s+a[i]
        m=b[i]
    elif l>b[i]:
        s=s+b[i]+m
        m=0
    else:
        s=s+a[i]
        m=b[i]-l

if a[n]<m:
    s=s+a[n]
else:
    s=s+m


print(s)

Measured memory_bytes: 80996
n, m = map(int, input().split())
lis = list(map(lambda z: int(z) - 1, map(int, input().split())))

s = {0}
res = [0]

while lis[res[-1]] not in s:
    res.append(lis[res[-1]])
    s.add(res[-1])

x, y = res.index(lis[res[-1]]), len(res)

if m < y:
    print(res[m] + 1)
else:
    mm = (m - x) % (y - x)
    print(res[mm + x] + 1)


Measured memory_bytes: 126392
n,m = map(int,input().split())
g = [set() for _ in range(n)]
for _ in range(m):
    a,b = map(int,input().split())
    a-=1
    b-=1
    g[a].add(b)
    g[b].add(a)
for i in g[0]:
    if i in g[n-1]: print('POSSIBLE');exit()
print('IMPOSSIBLE')

Measured memory_bytes: 162236
l, r = map(int, input().split())
ans = 100000000000000000
if r -l > 2019:
  print('0')
else:
  for i in range(l,r+1):
    for j in range(i+1,r+1):
      if (i*j)%2019 <= ans:
        ans = (i*j)%2019
  print(ans)

Measured memory_bytes: 3060
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;
#define SAY_YES cout << "YES" << endl;
#define SAY_Yes cout << "Yes" << endl;
#define SAY_NO cout << "NO" << endl;
#define SAY_No cout << "No" << endl;
#define IFYES(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "YES" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "NO" << endl;  \
    }
#define IFYes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "Yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "No" << endl;  \
    }
#define IFyes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "no" << endl;  \
    }
#define DEBUG_OUTPUT_ARRAY(XXX, ONE)                            \
    for (int i = 0; i < (ONE); i++)                             \
    {                                                           \
        cout << "DEBUG: i = " << i << " -> " << XXX[i] << endl; \
    }
#define DEBUG_OUTPUT_ARRAY2(XXX, ONE, TWO)                             \
    for (int i = 0; i < (ONE); i++)                                    \
    {                                                                  \
        cout << "<<< i = " << i << " >>>" << endl;                     \
        for (int j = 0; j < (TWO); j++)                                \
        {                                                              \
            cout << "DEBUG: j = " << j << " -> " << XXX[i][j] << endl; \
        }                                                              \
    }
#define DEBUG_OUTPUT_ARRAY2_BOX(XXX, ONE, TWO) \
    for (int i = 0; i < (ONE); i++)            \
    {                                          \
        cout << i << "  ";                     \
        for (int j = 0; j < (TWO); j++)        \
        {                                      \
            cout << XXX[i][j] << " ";          \
        }                                      \
        cout << endl;                          \
    }

typedef pair<long long int, long long int> pll;


const long long int mod = 1000000007;
const long long int INF = 99999999999999999;


long long int N,M,K,Q,res,sum=0,X,Y,a,memo[200050]={};
string str;
vector<long long int>vec;


int main()
{
    cout << fixed << setprecision(18);
    cin>>N>>K>>Q;
    for(long long int i=1;i<=N;i++){
        memo[i]=K-Q;
    }
    for(long long int i=0;i<Q;i++){
        cin>>a;
        memo[a]++;
    }
    for(long long int i = 1; i <=N; i++){
        if(memo[i]>0){cout<<"Yes"<<endl;}
        else{cout<<"No"<<endl;}
    }
    
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define hyperspeed ios::sync_with_stdio(false);cin.tie(NULL);
#define ll long long  
#define ull unsigned long long
#define ui unsigned int
#define li long int
#define uli unsigned long int
#define pb push_back
#define ld long double
#define vi vector<int>
#define vvi vector<vector<int>>
#define vli vector<li>
#define vll vector<ll>
#define all(v) v.begin(),v.end()
#define pi pair<int,int>
#define FOR(i,s,n) for(auto i=s;i<n;++i)
#define FORN(i,s,n) for(auto i=s;i<=n;++i)
#define FORR(i,s,n) for(auto i=s;i>=n;--i)
#define FORE(i,a) for(auto i : a)
#define mp make_pair
const int MOD = 1e9+7;

void solve() {
    ll n;
    cin >> n;
    ll k;
    cin >> k;
    vll a(n);
    FOR(i,0,n) {
        cin >> a[i];
    }
    sort(all(a),greater<>());
    ll cnt=0;
    FOR(i,k,n) {
        // cout << "adding : " << a[i];
        cnt+=a[i];
    }
    cout << cnt << endl;
}

int32_t main()
{
    hyperspeed
    int test=1;
    // cin >> test;
    while(test--) {
        solve();
    }
    return 0;
}

//--n1m5


Measured memory_bytes: 4760
#include <iostream>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()

int const N = 200001;

int main(){
    string s, t;
    cin >> s >> t; 
    if(t.size()-1 == s.size()){
        for(int j = 0; j<s.size(); ++j){
             if(s[j] != t[j])return puts("No"),0;
        }
        puts("Yes");
    }
    else puts("No");
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define pb push_back
#define pll pair <ll, ll>
#define mp make_pair
#define pyshnapyshnakaa ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define x first
#define y second
#pragma GCC optimize("O3")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
#define plll pair <ll, pair <ll, ll>>
#define pllll pair <pair <ll, ll>, pair <ll, ll> >
#define psl pair <string, ll>
#define all(a) a.begin(), a.end()
#define vvl vector <vector <ll> >
 
typedef long long ll;
 
typedef long double ld;
 
using namespace std;
 
const ll maxn = 1e6 + 100;

ll n, m, k, t;

int main() {
    pyshnapyshnakaa;
    ll q, w, e, a, b, c;
    string s;
    cin >> s;
    n = s.length();
    // cout << n << endl;
    ll ans = 0;
    // set <string> S;
    string last = "";
    string cur = "";
    // S.insert(cur);
    for (q = 0; q < n; q++) {
        if (cur == last) {
            cur += s[q]; 
        }
        else {
            last = cur;
            // S.insert(cur);
            ans++;
            cur = "";
            cur += s[q];
        }
    }
    if (last != cur) {
        ans++;
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 3788
N = int(input())
c = input()

i = 0
j = N-1
count = 0
while i < j:
    if c[i] == "W":
        if c[j] == "R":
            i += 1
            j -= 1
            count += 1
        else:
            j -= 1
    else:
        i += 1

print(count)

Measured memory_bytes: 9460
#include <bits/stdc++.h>
using namespace std;
int main(void){
  int N;
  cin >> N;
  int q_four = 0;
  int q_odd = 0;
  int q_two = 0;
  for(int i=0; i<N; i++) {
    int tmp;
    cin >> tmp;
    if(tmp%4 == 0){
      q_four++;
    }else if(tmp%2 == 0){
      q_two++;
    }else{
      q_odd++;
    }
  }
  bool tf = false;;
  if(q_two == 0){
    if(q_four + 1 >= q_odd) tf = true;
  }else{
    if(q_four >= q_odd) tf = true;
  }
  
  if(tf) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
/*
God
There is always someone loves me
So let it come
God bless me
*/
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std; 
int n,d,i,j,k,x[20][20],sum,a,jou,su=1,co;
int main()
{
	sum=jou=co=0;
	scanf("%d %d",&n,&d);
	for(i=0;i<n;i++)
		for(j=0;j<d;j++)
			scanf("%d",&x[i][j]);
	for(i=0;i<n-1;i++){
		for(k=i+1;k<n;k++){
			for(j=0;j<d;j++){
				a=x[i][j]-(x[k][j]);
				sum+=a*a;
			}
			jou=0;
			su=1;
			while(sum>jou)
			{
				jou=su*su;
				su++;
				if(sum==jou)
					co++;
			}
			sum = 0;
		}
	}
	printf("%d\n", co);
	return 0;
}

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

int main(){
  ll x;
  cin>>x;
  ll ans = 0;
  ll now = 100;  
  while(now < x){
    now *= 1.01;
    ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3636
large=list("BDEFGHIJKLMNOPQRSTUVWXYZ")
small=list("abcdefghijklmnopqrstuvwxyz")
s=list(input())
if s[0]!="A" or s.count("A")!=1:
  print("WA")
  exit()
t=s[2:len(s)-1]
if t.count("C")!=1:
  print("WA")
  exit()
for i in s:
  if i in large:
    print("WA")
    exit()
print("AC")

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


long long int gcd(long long int a, long long int b){
  while (a && b){
    (a < b) ? b %= a : a %= b;
  }
  return a + b;
}

int main(){
  int K;
  cin >> K;
  vector<vector<vector<int>>> dp(201, vector<vector<int>>(201, vector<int>(201, 0)));
  long long int ans = 0;
  for(int a=1; a<=K; a++){
    for(int b=1; b<=K; b++){
      for(int c=1; c<=K; c++){
        vector<int> z = {a, b, c};
        sort(z.begin(), z.end());
        if(dp[z[0]][z[1]][z[2]]==0){
          dp[z[0]][z[1]][z[2]] = gcd(gcd(a, b), c);
        }
        ans += dp[z[0]][z[1]][z[2]];
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 36692