akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

uint64_t C[100][100] = {};

uint64_t combination(uint64_t n, uint64_t r) {
	if (n >= r)
	{
		if (C[n][r] == 0)
		{
			if (r * 2 > n) r = n - r;
			uint64_t dividend = 1;
			uint64_t divisor = 1;
			for (unsigned int i = 1; i <= r; ++i) {
				dividend *= (n - i + 1);
				divisor *= i;
			}
			C[n][r] = dividend / divisor;
		}
	}
	return C[n][r];
}



vector<int> CountYakusu(int N)
{
	unsigned long M;
	unsigned long d;
	vector<int> S;

	M = N / 2;
	while (N > 1)
	{
		if (N % M == 0)
		{
			d = N / M;

			while (N % d == 0)
			{
				S.push_back(d);
				N = N / d;
			}
			M = N / 2;
		}
		else
		{
			M--;
		}
	}

	return(S);
}

int main()
{
	int N; // 引数
	int ans = 0; // 答え
	uint64_t SoinsuNum = 0;
	vector<int> SosuList;
	int JouSuu[101] = {};
	uint64_t CountOv74 = 0;
	uint64_t CountOv24 = 0;
	uint64_t CountOv14 = 0;
	uint64_t CountOv4 = 0;
	uint64_t CountOv2 = 0;
	uint64_t CountOv1 = 0;

	cin >> N;

	for (int i = 1; i <= N; i++)
	{
		SosuList = CountYakusu(i);
		for (auto itr = SosuList.begin(); itr != SosuList.end(); itr++)
		{
			(JouSuu[*itr])++;
		}
	}
	for (int i = 1; i <= N; i++)
	{
		if (JouSuu[i] >= 1)
		{
			CountOv1++;
		}
		if (JouSuu[i] >= 2)
		{
			CountOv2++;
		}
		if (JouSuu[i] >= 4)
		{
			CountOv4++;
		}
		if (JouSuu[i] >= 14)
		{
			CountOv14++;
		}
		if (JouSuu[i] >= 24)
		{
			CountOv24++;
		}
		if (JouSuu[i] >= 74)
		{
			CountOv74++;
		}
	}
	SoinsuNum = CountOv74
		+ combination(CountOv24, 2) * 2 + CountOv24 * (CountOv2 - CountOv24)
		+ combination(CountOv14, 2) * 2 + CountOv14 * (CountOv4 - CountOv14)
		+ combination(CountOv4, 3) * 3 + combination(CountOv4, 2) * (CountOv2 - CountOv4);

	cout << SoinsuNum << endl;

	return(0);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
ll mod=1e9+7;


	   
int main() {
			fast
			// #ifndef ONLINE_JUDGE
			// freopen("input.txt","r",stdin);
			// freopen("output.txt","w",stdout);
			// #endif
			 
	     	ll a,b,c,k;
			 cin>>a>>b>>c>>k;

			 ll x=0;
			 ll ans=0;
			 if(k>=a)
			 {
				 ans+=a;
				 k-=a;
			 }
			 else
			 {
				 ans+=k;
				 k=0;
			 }
			 
			 if(k>=b)
			 {
				 k-=b;
			 }
			 ans-=k;
			 cout<<ans;

			 
			return 0;
		 }	
 

Measured memory_bytes: 3600
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)

int pow(int b,int p){
  int res= 1;
  rep(i,p) res*=b;
  return res;
}

int main(){
  int x;
  cin >> x;
  int ans = 0;
  for (int i = 1;i <= x;i++){
    for (int j = 2; j < 10;j++){
      int tmp = pow(i,j);
      if (tmp > x) break;
      ans = max(ans,tmp);
    }
  }
  cout << ans << endl;

  

  return 0;
}

Measured memory_bytes: 3616
#include<stdio.h>

int main()
{
    long long int A,B,K;
    scanf("%lld %lld %lld",&A,&B,&K);
    if (A>K) {
        printf("%lld %lld",A-K,B);
    }
    else if (A<=K && A+B>K) {
        printf("%d %lld",0,A+B-K);
    }
    else printf("%d %d",0,0);
    printf("\n");
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <math.h>
#define N 1000000
using namespace std;


bool sosu_hantei(int num){
int i;
for(i=2;i<=sqrt((double)num);i++){
if(num%i==0)return false;
}

if(num==4)return false;

return true;

}

int main(){
int n,i,count=0;
bool sosu[N];

for(i=0;i<N;i++){

sosu[i]=sosu_hantei(i);
}

while(cin >> n){

for(i=2;i<=n;i++){
if(sosu[i]){ 
count++;
}
}

cout << count << endl;
i=2;count=0;
}

}

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

void push(int);
int pop(void);

int top,S[1000];

int main(){
  int a,b;
  top=0;
 char s[100];
  while( scanf("%s", s) != EOF ){
    if ( s[0] == '+' ){
      a=pop();
      b=pop();
      push(a+b);
    }
    else if ( s[0] == '-' ){
      b=pop();
      a=pop();
      push(a-b);
    }
    else if ( s[0] == '*' ){
      a=pop();
      b=pop();
      push(a*b);
    }
    else {
      push(atoi(s));
    }
  }
  printf("%d\n",pop());
  return 0;
}

void push(int x){
  S[++top] = x;
}
int pop(){
  top--;
  return S[top+1];
}



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

int main()
{
    int x;
    cin >> x;
    if (x == 0)
    {
        cout << 1 << endl;
    }
    else if (x == 1)
    {
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 3564
#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <vector>
using namespace std;

bool fizzBuzzCheck(int n,string s){
	if(n%15==0)return (s == "FizzBuzz");
	if(n%3==0)return  (s == "Fizz");
	if(n%5==0)return  (s == "Buzz");
	
	return (atoi(s.c_str()) == n);
}

int main(){
	int n,m;
	string s;
	
	while(scanf("%d %d\n",&m,&n), m){
	
		vector<int> rem(m);
		for(int i=0;i<m;i++){
			rem[i] = i+1;
		}
		int c = 0;
		for(int i=1;i<=n;i++){
			getline(cin,s);
			if(rem.size() == 1)continue;
			if( !fizzBuzzCheck(i,s) ){
				rem.erase(remove(rem.begin(),rem.end(),rem[c]),rem.end());
			}else{
				c++;
			}
			c %= rem.size();
		}
		for(int i=0;i<rem.size();i++){
			cout << (i?" ":"") << rem[i];
		}
		cout << endl;
	}
}

Measured memory_bytes: 0
import math
N, M = map(int, input().split())

if N == 1:
  print(M)
  exit()

ans = 1

for a in range(1, int(math.sqrt(M))+1):
  b = M // a
  if M % a != 0:
    continue

  if a * N <= M:
    ans = max(ans, a)
  
  if b * N <= M:
    ans = max(ans, b)

print(ans)



Measured memory_bytes: 3060
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N;
  cin>>N;
  map<int, int> amap;
  int A;
  for(int i=0;i<N-1;++i) {
    cin>>A;
    amap[A]++;
  }
  for(int i=1;i<=N;++i) cout<<amap[i]<<endl;
}



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

int main()
{
  string s;
  cin>>s;
  
  int ca=0,cb=0;
  for(int i=0;i<s.size();i++)
  {
	if(s[i]=='A')
    {
    	ca++;
    }
    else
    {
      cb++;
    }
  }
  
  if(ca==s.size() || cb==s.size())
  {
	cout<<"No"<<endl;
  }
  
  else{
    cout<<"Yes"<<endl;
  }
  return 0;
}
      

Measured memory_bytes: 256
#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(){
    string s;
    cin >> s;
    int ans = 0;
    bool pre_rain = true;

    rep(i, s.size()){
        if(s[i] == 'R' && (pre_rain||ans==0)){
            ans++;
            pre_rain=true;
        }else if(pre_rain){
            pre_rain=false;
        }
    }
    cout << ans << endl;
    return 0;
}


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

#define print cout <<
#define printl(s) cout << s << endl;
#define rep(i,n) for (int i = 0; i < (n); ++i)

template <typename T>
vector<T> getValues(int num){
    vector<T> values(num);
    for(int i=0;i<num;i++){
        cin >> values.at(i);
    }
    return values;
}

int main(){
    int N;
    cin >> N;
    if(N==0){
      print(1);
    }else{
      print(0);
    }
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
using namespace std;
main()
{
    int a,b,i;
    cin>>a>>b;
    if(a>b)
        swap(a,b);
    for(i=1;i<=b;i++)
        cout<<a;
}


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


void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

char c[62];
void pre(){
	rep(i,26) c[i]='a'+i,c[i+26]='A'+i;
	rep(i,10) c[52+i]='0'+i;
}
int l =0,cnt;
int q(string s){
	cnt++;
	assert(cnt<850);
	cout<<"? "<<s<<endl;
	int x;cin>>x;
	return x;
}
string solve(string s,string t){
	string p ="";
	while(sz(s)&&sz(t)){
		string x = p+t.substr(0,1)+s;
		int y = l-q(x);
		if(y==sz(x)){
			p+=t.substr(0,1);
			t=t.substr(1,sz(t)-1);
		}
		else{
			p+=s.substr(0,1);
			s=s.substr(1,sz(s)-1);
		}
	}
	p+=s;
	p+=t;
	return p;

}
int ct[62];
int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	pre();
	vector<string> v,gg;
	rep(i,62){
		int x = q(string(128,c[i]));
		l+=128-x;
		ct[i]=128-x;
	}
	rep(i,62) if(ct[i]) v.pb(string(ct[i],c[i]));
	while(sz(v)>1){
		rep(i,sz(v)/2){
			gg.pb(solve(v[2*i],v[2*i+1]));
		}
		if(sz(v)%2) gg.pb(v.back());
		v=gg;
		gg.clear();
	}
	cout<<"! "<<v[0]<<endl;
	return 0;
}




Measured memory_bytes: 3800
#include <stdio.h>

int main(int argc, char** argv){
	int n,x;
	int stack[100],stack_posi,sum,check_num,ptn_cnt;
	int found;

	for(;;){
		// Input
		scanf("%d %d", &n, &x);
		// Finish Check
		if( n == 0 && x == 0 ){
			break;
		}
		// Search Pattern
		stack_posi = -1;
		sum = 0;
		check_num = 1;
		ptn_cnt = 0;
		for(;;){
			// Check Length & Total
			if( stack_posi == 2 ){
				if( sum == x ){
					ptn_cnt++;
					// Success & Search Next Pattern
					sum -= stack[stack_posi];
					check_num = stack[stack_posi] + 1;
					stack_posi--;
					continue;
				} else {
					// Fail & Search Next Pattern
					sum -= stack[stack_posi];
					check_num = stack[stack_posi] + 1;
					stack_posi--;
					continue;
				}
			} else if( sum == x ){
				// Fail & Search Next Pattern
				sum -= stack[stack_posi];
				check_num = stack[stack_posi] + 1;
				stack_posi--;
				continue;
			}
			// Get Next Number
			found = 0;
			while( check_num <= n ){
				if( sum + check_num <= x ){
					// Save Current Number & Search Next Number
					stack_posi++;
					stack[stack_posi] = check_num;
					sum += check_num;
					check_num++;
					found = 1;
					break;
				}
				check_num++;
			}
			if( found ){
				continue;
			}
			if( stack_posi >= 0 ){
				// Fail & Search Next Pattern
				sum -= stack[stack_posi];
				check_num = stack[stack_posi] + 1;
				stack_posi--;
				continue;
			} else {
				// No More Other Pattern
				break;
			}
		}
		// Output Pattern Count
		printf("%d\n",ptn_cnt);
	}

	return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i,n) for(int i=0;i<(n);++i)
#define ll long long
const long long INF = 1LL<<60;
const long long mod = 1e9 + 7;
using Graph = vector<vector<int>>;

int main(){
    int N;
    cin >> N;
    int D[2][N];
    REP(i,N) cin >> D[0][i] >> D[1][i];
    bool zo[N];
    bool ans = false;
    REP(i,N){
        if(D[0][i] == D[1][i]) zo[i] = true;
        else zo[i] = false;
    }
    REP(i,N-2) if(zo[i]&&zo[i+1]&&zo[i+2]) ans = true;
    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3636
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define SZ 666666
int n,a[SZ];
const int MOD=1e9+7;
ll su[SZ];
ll qp(ll a,ll b)
{
	ll x=1; a%=MOD;
	while(b)
	{
		if(b&1) x=x*a%MOD;
		a=a*a%MOD; b>>=1;
	}
	return x;
}
int main()
{
	scanf("%d",&n); ll f=1;
	for(int i=1;i<=n;++i)
		scanf("%d",a+i),f=f*i%MOD;
	for(int i=1;i<=n;++i)
		su[i]=(su[i-1]+f*qp(i,MOD-2))%MOD;
	ll ans=0;
	for(int i=1;i<=n;++i)
		ans+=(su[i]+su[n+1-i]-f)%MOD*a[i],
		ans%=MOD;
	ans=(ans%MOD+MOD)%MOD;
	cout<<ans<<"\n";
}


Measured memory_bytes: 3072
#include<iostream>
#include<cmath>
#include<set>
#include<iterator>

using namespace std;
int dp[1000001];

int main()
{
    int n;
    cin>>n;
    int ara[n];
    long long int dp[n],a1,a2;
    for(int i=0;i<n;i++)cin>>ara[i];
    dp[0]=0,dp[1]=abs(ara[1]-ara[0]);
    for(int i=2;i<n;i++){
        a1=dp[i-2]+abs(ara[i]-ara[i-2]);
        a2=abs(ara[i]-ara[i-1])+dp[i-1];
        dp[i]=min(a1,a2);
        //cout<<dp[i]<<"\n";
    }
    cout<<dp[n-1];
}


Measured memory_bytes: 4772
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		n: usize,
		k: usize,
		a: [usize; n],
	}

	let mut b = a.clone();
	b.sort();
	b.dedup();
	let k2 = b.len();
	if k2 <= k {
		println!("0");
		return;
	}

	let mut v = vec![0usize; 200000];
	for i in 0..n {
		v[a[i]-1] += 1;
	}

	v.sort();
	for i in 0..v.len() {
		if v[i] != 0 {
			let mut ans = 0; 
			for j in i..i+k2-k {
				ans += v[j];
			}
			println!("{}", ans);
			return;
		}
	}
}



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

long long a,b;

long long gcd(long long x,long long y){
  if(y == 0) 
    return x;
  else 
    return gcd(y, x % y);
}
long long lcm(long long x,long long y){
    return (x * y) / gcd(x, y);
}

int main(){
  while(cin >> a >> b){
    cout << gcd(a ,b) << " " << lcm(a, b) << endl;
  }
  return 0;
}

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

struct node
{
	int index;
	int ai;
};

bool cmp(node a,node b)
{
	return a.ai<b.ai;
}

int main()
{
	int n;
	cin>>n;
	node stu[n+1];
	for(int i=1;i<=n;i++)
	{
		cin>>stu[i].ai;
		stu[i].index=i;
	}
	sort(stu+1,stu+n+1,cmp);
	for(int i=1;i<=n;i++)
	{
		cout<<stu[i].index<<" ";
	}
	cout<<endl;
	
} 

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

using namespace std;

double dis(double x,double y){
    double dis=(x-y)*(x-y);
    return abs(dis);
}

int main()
{
    int n,d;
    double x[10][10];
    double dist=0;
    int i,j,k;
    int ans=0;

    cin >> n >> d;
    for(i=0;i<n;i++){
        for(j=0;j<d;j++){
            cin >> x[i][j];
        }
    }


    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            for(k=0;k<d;k++){
                dist+=dis(x[i][k],x[j][k]);
            }//cout << dist << endl;
            dist=sqrt(dist); //printf("[%d][%d] ",i,j); cout << dist << endl;
            if(ceil(dist) == floor(dist)){
                ans++;
            }
          dist=0;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
using System;

namespace ConsoleApp2
{
    public class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();

            if(s == "ABC")
            {
                Console.WriteLine("ARC");
            }
            else
            {
                Console.WriteLine("ABC");
            }
        }
    }
}


Measured memory_bytes: 17328
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.PriorityQueue;

class Main {
	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		FastScanner sc=new FastScanner();
		PrintWriter pw=new PrintWriter(System.out);
		int a=sc.nextInt();
		int b=sc.nextInt();
		int c=sc.nextInt();
		pw.println(a==b&&b==c&&c==a?"Yes":"No");
		pw.close();
	}
	
	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}


class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public int nextInt() {
    	return Integer.parseInt(next());
    }
    
    public long nextLong() {
    	return Long.parseLong(next());
    }
}

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

const int maxn = 3e3+5;
int rd[maxn], bl[maxn], gr[maxn];

int32_t main()
{
  	ios::sync_with_stdio(0);
	int r, g, b, n;
  	cin >> r >> g >> b >> n;
  
  	int ways = 0;
  
  	for(int i = 0; i <= n; i += r)
    {
      	for(int j = 0; i + j <= n; j += g)
        {
          	if((n-i-j)%b == 0)
              	ways++;
        }
    }
  	cout << ways;	  		
  	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
signed main(){
	int X, Y;
	cin >> X >> Y;
	for(int i = 0; i <= X; i++){
		if(2*(X-i)+4*i == Y){
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;

	return 0;
}

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

int main()
{
	int N, L;
	scanf("%d%d", &N, &L);
	int sum{N * L - N + N * (N + 1) / 2};
	if (L > 0) sum -= L;
	else if (L + N - 1 < 0) sum -= L + N - 1;
	printf("%d\n", sum);

	return 0;
}

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

ans = ["-1", "-1", "-1"]
for i in range(n+1):
    for j in range(n+1):
        if i + j > n:
            continue
        k = n - i - j
        if i * 10000 + j * 5000 + k * 1000 == y:
            ans = list(map(str, [i, j, k]))
            break
print(" ".join(ans))


Measured memory_bytes: 41580
#include <bits/stdc++.h>
#define rep(i, x, N) for (int i = x; i < (N); i++)
using namespace std;
int main()
{
    long N, count = 0;
    cin >> N;
    vector<long> a(N), b(200002);
    rep(i, 0, N)
    {
        cin >> a[i];
    }
    int q = 0;
    rep(i, 0, N)
    {
        if (a[i] == 1)
        {
            q = 1;
            break;
        }
    }
    if (q == 1)
    {

        long k = 1;
        rep(i, 0, 200002)
        {
            b[i] = k;
            k++;
        }
        long i = 0;
        rep(j, 0, N)
        {
            long key = j;
            while (b[i] != a[j] && j < N)
            {
                j++;
            }
            count += j - key;
            i++;
        }
        cout << count << endl;
    }
    else
    {
        cout << -1 << endl;
    }
}


Measured memory_bytes: 3328
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
long long N, A[1 << 18];
int main() {
  cin >> N; long long S = 0;
  for (int i=1; i<=N; i++) {cin >> A[i]; S+=A[i];}

  long long minx=S, sum=0;
  for (int i=1; i<=N; i++) {
    sum+=A[i];
    minx=min(minx,abs(sum-(S-sum)));
  }
  cout << minx << endl;
  return 0;
}

Measured memory_bytes: 5196
#include<algorithm>
#include<bitset>
#include<cmath>
#include<complex>
#include<cstdlib>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include<vector>

using namespace std;

#define ll long long
#define pal pair<ll,ll>
#define pad pair<double,double>
#define PB push_back
#define MP make_pair
#define F first
#define S second

const ll MOD = 1e9+7;
const ll INF = 1e18;
const double EPS = 1e-8;

long long MODPOW(long long x, long long n) {
    long long ret = 1;
    while (n > 0) {
        if (n & 1) ret = ret * x % MOD;
        x = x * x % MOD;
        n >>= 1;
    }
    return ret;
}

template<typename T,typename U>
bool chmax(T& max, const U& x){
	if(max<x){
		max = x;
		return true;
	}
	return false;
}

template<typename T,typename U>
bool chmin(T& min, const U& x){
	if(min>x){
		min = x;
		return true;
	}
	return false;
}


int main(){
	ll n,d,ans=0;
	cin >> n >> d;
	for(ll i=0;i<n;i++){
		ll x,y;
		cin >> x >> y;
		if(d*d >= x*x + y*y){
			ans ++;
		}
	}
	cout << ans<< endl;
}

Measured memory_bytes: 3628
<?php
  $stdin = fopen('php://stdin', "r");

  fscanf($stdin, "%d", $a);
  fscanf($stdin, "%d", $b);
  fscanf($stdin, "%d", $c);
  fscanf($stdin, "%d", $x);

  $count = 0;
  for ($i=0; $i<=$a; $i++) {
    for ($j=0; $j<=$b; $j++) {
      for ($k=0; $k<=$c; $k++) {
        $sum = $i*500 + $j*100 + $k * 50;
        if ($sum == $x) {
          $count++;
        }
      }
    }
  }

  echo $count.PHP_EOL;


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

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string deck;
    int matches;
    int taro_point = 0;
    int hanako_point = 0;
    string taro;
    string hanako;
    cin >> matches;
    
    for(int i = 0; i < matches; i++){
        cin >> taro;
        cin >> hanako;
        if(taro > hanako){
            taro_point += 3;
        }else if(taro < hanako){
            hanako_point += 3;
        }else{ //draw
            taro_point += 1;
            hanako_point += 1;
        }
    }
    
    cout << taro_point << " " << hanako_point << endl;
}



Measured memory_bytes: 3204
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
using pii = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1 << 29;
const int N =  1e5 + 10;
 
struct IOsetup{
  IOsetup(){
   ios_base::sync_with_stdio(false);
   cin.tie(nullptr);
   cout.tie(nullptr);
   cout << fixed << setprecision(20);
  }
}IO;

int32_t main(){
  int n, r;
  cin >> n >> r;
  if (n >= 10) cout << r  << endl;
  else cout << r + (100 * (10 - n)) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define si set <ll>
#define vi vector <ll>
#define popcount(x) __builtin_popcountll(x)
#define mii map <ll,ll>
#define vpi vector <pair <ll,ll> >
#define sz(c) (int)c.size()
#define fr first
#define ll long long
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define mem0(a) memset(a,0,sizeof(a))
#define rep(i,a,n) for( ll i=a ; i<n ; i++)
#define ld long double
#define rall(a) (a).rbegin(),(a).rend()

ll power(ll b,ll e,ll m)
{
  if(e==0) return 1;
  if(e&1) return b*power(b*b%m,e/2,m)%m;
  return power(b*b%m,e/2,m);
}
ll power( ll b, ll e)
{
  if(e==0) return 1;
  if(e&1) return b*power(b*b,e/2);
  return power(b*b,e/2);
}  
bool isPowerOfTwo(ll x)
{
    // x will check if x == 0 and !(x & (x - 1)) will check if x is a power of 2 or not
    return (x && !(x & (x - 1)));
} 
 

set <ll> v;

void make(ll num)
{
    if(num>10000000000)
        return ;
    if(num!=0)
        v.insert(num);
     make(num*10+4);
     make(num*10+7);
}

void solve()
{
  ll x;
  cin>>x;
  if(x>=30) cout<<"Yes"<<"\n";
  else cout<<"No"<<"\n";
}


int main()       
{
  fastio
  ll tt=1;
  // cin>>tt;
  while(tt--)
  {
    solve();
    cout<<"\n";
  }
  return 0;
}

Measured memory_bytes: 3656
#include <stdio.h>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef vector<vector<int>> v2int;
typedef vector<vector<vector<int>>> v3int;
typedef vector<ll> vll;
typedef vector<vector<ll>> v2ll;
typedef vector<vector<vector<ll>>> v3ll;
typedef list<int> liint;
typedef pair<int, int> pint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<ll, int>> vpll_int;
typedef vector<pair<int, ll>> vpint_ll;
typedef set<pair<int, int>> spint;
typedef set<pair<ll, int>> spll;
typedef unordered_map<int, unordered_set<int>> Graph;
const int INF = int(2e9);
const ll LINF = ll(2e9) * ll(2e9);
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b) { a > b ? : a = b; }
template<class T, class C> void chmin(T& a, C b) { a < b ? : a = b; }



int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll D, T, S;
    cin >>D >> T >> S;
    if (T * S >= D) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    
    return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define LL long long int
#define DL double
#define MLL map<LL,LL>::iterator
#define MSL map<string,L>::iterator
#define MLS map<LL,string>::iterator
#define MSS map<string,string>::iterator
#define MCL map<char,LL>::iterator
#define SL set<LL>::iterator
#define SS set<string>::iterator sl
#define G getline
#define SZ size()
#define IN insert
#define C clear()
#define B begin()
#define F front()
#define T top()
#define E end()
#define EM empty()
#define V vector
#define Q queue
#define DQ deque
#define PQ priority_queue
#define ST stack
#define FI first
#define SE second
#define PI acos(-1)
#define PS push
#define PP pop()
#define PSF push_front
#define PSB push_back
#define PPF pop_front()
#define PPB pop_back()
#define endl "\n"
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
V<LL>v;
int main()
{
    FAST;
    LL n,m,i,j,k,p,q,o,l,s,t,z;
    cin>>n;
    k=0;
    for(i=0; i<n; i++)
    {
        cin>>o;
        k+=o;
        v.PSB(o);
    }
    if(k%10==0)
    {
        sort(v.B,v.E);
        s=0;
        for(i=0; i<n; i++)
        {
            if(v[i]%10!=0)
            {
                k-=v[i];
                s=1;
                break;

            }
        }
        if(s==0)
        {
            cout<<0<<endl;
        }
        else

        {
            cout<<k<<endl;
        }
    }
        else

        {
            cout<<k<<endl;
        }

    return 0;

}


Measured memory_bytes: 256
fn main() {
    let n = read::<usize>();
    let h = read_vec::<usize>();
    let mut ret = 1;
    for i in 1..n {
        let mut ok = true;
        for j in 0..i {
            if h[j] > h[i] {
                ok = false;
                break;
            }
        }
        if ok {
            ret += 1;
        }
    }
    println!("{}", ret);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
typedef long l;
const ll l_INF = 101010101000;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;

int main(){
  int n;
  cin >> n;
  set<int> a;
  vi c(1010100);
  rep(i,n){
    int y;
    cin >> y;
    a.insert(y);
    c[y]++;
  }
  for(auto x : a){
    int num=x*2;
    while(num<=1000000){
      if(a.count(num)){
        a.erase(num);
      }
      c[num]=0;
      num+=x;
    }
  }
  ll sum=0;
  rep(i,1010100) if(c[i]>1) sum+=c[i];
  ll ans=0;
  rep(i,1010100) ans += c[i];
  cout << ans - sum;
}

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

int main ()
{
	int a, b;
	cin >> a >> b;
	
	if (a<b)
		cout << "a < b\n";
	if (a>b)
		cout << "a > b\n"	;
	if (a==b)
		cout << "a == b\n";	
	return 0;	
}

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

void insertionSort(int ary[], int num);

void printArray(int ary[], int num){
    for (int i=0; i<num; i++){if(i==num -1) cout << ary[i] << endl; else cout << ary[i] << ' ';}
}

int main(){
    int n, a[100];
    cin >> n;
    for(int i=0; i<n; i++){cin >> a[i];}
    insertionSort(a, n);

    return 0;
}
void insertionSort(int ary[], int num){
    int v, j;
    for (int i=1; i<num; i++){
        printArray(ary, num);
        v = ary[i];
        j = i - 1;
        while (j >= 0 && ary[j] > v){
            ary[j+1] = ary[j];
            j--;
        }
        ary[j+1] = v;
    }
    printArray(ary, num);
}


Measured memory_bytes: 3104
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int D = sc.nextInt();
        if(N%(2*D+1)==0){
 
            System.out.println(N/(2*D+1));
            return;
        }
        System.out.println(N/(2*D+1)+1);
    }
}

Measured memory_bytes: 22996
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip> //fixed << setprecision(10)

using namespace std;

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

typedef long long ll;
typedef vector<int> vi;

ll mons(ll a){
    if(a == 1){
        return 1;
    }
    else{
        return (mons(a/2)*2)+1;
    }
}

int main(){
    ll h;
    cin >> h;

    cout << mons(h) << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#define int long long
#define mod 1000000007
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int n, m;
vector<pair<pair<int, int>, int>>v;
set<pair<int, pair<int, int>>>s;
int a[123456], p = 1;
signed main() {
	a[1] = 0;
	cin >> n >> m;
	for0(i, m) {
		pair<pair<int, int>, int>p1;
		cin >> p1.first.first >> p1.first.second >> p1.second;
		v.push_back(p1);
	}
	sort(v.begin(), v.end());
	int q = 0;
	while (p < n) {
		int q1 = q;
		while (v[q].first.first <= p && q < m) {
			v[q].second += a[v[q].first.first];
			s.insert(make_pair(v[q].second, v[q].first));
			q++;
		}
		if (s.size() == 0 && q1 == q) { cout << "-1\n"; return 0; }
		pair<int, pair<int, int>> p1 = *s.begin(); s.erase(s.begin());
		for (int j = p + 1; j <= p1.second.second; j++)a[j] = p1.first;
		p = p1.second.second;
	}
	cout << a[n] << endl;
}

Measured memory_bytes: 10224
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <bitset>
#include <numeric>
#include <unordered_set>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <numeric>
#include <cstdlib>
#include <random>
#include <bits/stdc++.h>


using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll mod=1000000007ll;
const ll inf=1000000000000000ll;

const ll MAX_N=100010;

ll dp[MAX_N];

ll N;

int main(){
  cin>>N;
  dp[0]=0;
  for(ll i=1;i<=N;i++){
    dp[i]=dp[i-1]+1;
    ll tmp=6;
    for(;tmp<=MAX_N;){
      if(i-tmp>=0)dp[i]=min(dp[i],dp[i-tmp]+1);
      tmp*=6;
    }
    tmp=9;
    for(;tmp<=MAX_N;){
      if(i-tmp>=0)dp[i]=min(dp[i],dp[i-tmp]+1);
      tmp*=9;
    }
  }
  cout<<dp[N]<<endl;
  return 0;
}


Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
bool is_prime[1000001];
int num[1010][1010];
int x[1000001];
int y[1000001];
int dp[1010][1010];
int dx[] = { 1,0,-1,0 };
int dy[] = { 0,-1,0,1 };
int main() {
	for (int i = 2; i <= 1000000; i++) is_prime[i] = 1;
	for (int i = 2; i <= 1000000; i++) {
		if (!is_prime[i]) continue;
		for (int j = 2 * i; j <= 1000000; j += i) is_prime[j] = 0;
	}
	int len = 1;
	int cnt = 0;
	int dir = 0;
	memset(num, -1, sizeof(num));
	num[505][505] = 1;
	x[1] = 505;
	y[1] = 505;
	for (int i = 2; i <= 1000000; i++) {
		x[i] = x[i - 1] + dx[dir];
		y[i] = y[i - 1] + dy[dir];
		num[y[i]][x[i]] = i;
		cnt++;
		if (cnt == len) {
			cnt = 0;
			if (dir % 2) len++;
			(dir += 1) %= 4;
		}
	}
	int m, n;
	while (cin >> m >> n, m) {
		int sx = x[n];
		int sy = y[n];
		memset(dp, -1, sizeof(dp));
		dp[sy][sx] = 0;
		if (is_prime[num[sy][sx]]) dp[sy][sx]++;
		for (int i = sy; i + 1 < 1010; i++) {
			for (int j = 0; j < 1010; j++) {
				if (num[i][j] == -1 || num[i][j] > m || dp[i][j] == -1) continue;
				for (int k = -1; k <= 1; k++) {
					int nx = j + k;
					if (0 > nx || nx >= 1010 || num[i + 1][nx] == -1 || num[i + 1][nx] > m) continue;
					dp[i + 1][nx] = max(dp[i + 1][nx], dp[i][j] + is_prime[num[i + 1][nx]]);
				}
			}
		}
		int ans = -1;
		int t = -1;
		for (int i = 1; i <= m; i++) {
			if (!is_prime[i]) continue;
			if (ans <= dp[y[i]][x[i]]) {
				ans = dp[y[i]][x[i]];
				t = i;
			}
		}
		if (ans == -1) cout << "0 0" << endl;
		else cout << ans << " " << t << endl;
	}
}


Measured memory_bytes: 19844
#include <stdio.h>

#define INF 999999999

const int d[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};

int H, W;
char S[32][32];

int cost[512][512];

int main(void) {
	int i, j, k;
	int answer = 0;
	if (scanf("%d%d", &H, &W) != 2) return 1;
	for (i = 0; i < H; i++) {
		if (scanf("%31s", S[i]) != 1) return 1;
	}
	for (i = 0; i < H * W; i++) {
		for (j = 0; j < H * W; j++) {
			cost[i][j] = INF;
		}
		cost[i][i] = 0;
	}
	for (i = 0; i < H; i++) {
		for (j = 0; j < W; j++) {
			if (S[i][j] == '.') {
				for (k = 0; k < 4; k++) {
					int ii = i + d[k][0], jj = j + d[k][1];
					if (0 <= ii && ii < H && 0 <= jj && jj < W && S[ii][jj] == '.') {
						cost[i * W + j][ii * W + jj] = 1;
					}
				}
			}
		}
	}
	for (k = 0; k < H * W; k++) {
		for (i = 0; i < H * W; i++) {
			for (j = 0; j < H * W; j++) {
				if (cost[i][j] > cost[i][k] + cost[k][j]) {
					cost[i][j] = cost[i][k] + cost[k][j];
				}
			}
		}
	}
	for (i = 0; i < H * W; i++) {
		for (j = 0; j < H * W; j++) {
			if (S[i / W][i % W] == '.' && S[j / W][j % W] == '.') {
				if (cost[i][j] > answer && cost[i][j] < INF) answer = cost[i][j];
			}
		}
	}
	printf("%d\n", answer);
	return 0;
}

/*

20 20
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................

*/


Measured memory_bytes: 1024
verdicts = {'AC':0,'WA':0,'TLE':0,'RE':0}
N = int(input())
string = []

for i in range(N):
    input_i = input()
    if input_i == 'AC':
        verdicts['AC'] += 1
    elif input_i == 'WA':
        verdicts['WA'] += 1
    elif input_i == 'TLE':
        verdicts['TLE'] += 1
    elif input_i == 'RE':
        verdicts['RE'] += 1

print('AC x '+str(verdicts['AC']))
print('WA x '+str(verdicts['WA']))
print('TLE x '+str(verdicts['TLE']))
print('RE x '+str(verdicts['RE']))

Measured memory_bytes: 9224
#include<iostream>
#include<vector>
using namespace std;
#define ll long long

int main(){
  ll H,W;
  cin >> H >> W;
  vector<ll> row(W+2, -1);
  vector<vector<ll>> M(H+2, row);
  vector<vector<ll>> X;
  
  for(ll h=0; h<H; ++h) {
    string s;
    cin >> s;
    for(ll w=0; w<W; ++w) {
      if(s[w]=='#') continue;
      M[h+1][w+1] = 0;
      vector<ll> x = {h+1, w+1};
      X.push_back(x);
    }
  }

  //for(ll h=0; h<H+2; ++h) {
  //for(ll w=0; w<W+2; ++w)
  //  cout << -M[h][w]; cout << endl;}


  ll mark = 0, ans = 0;
  for(ll ist=0    ; ist<X.size(); ++ist)  { 
    ++mark;
    ll turn = 0;
    bool f = false;
    vector<vector<ll>> queue = {X[ist]};
    M[X[ist][0]][X[ist][1]] = mark;

    while(queue.size() && !f) {
      vector<vector<ll>> queue_new;
      for(ll iq=0; iq<queue.size(); ++iq) {
        ll qx = queue[iq][0], qy = queue[iq][1];
        
        //cout << ist << ":" << turn << ":" << qx << "," <<  qy << endl;
        
        ll x, y, m;
        x = qx+1; y = qy  ; m = M[x][y];
        if(m!=-1 && m!=mark) { M[x][y] = mark; vector<ll> xx = {x,y}; queue_new.push_back(xx); }
        x = qx-1; y = qy  ; m = M[x][y];
        if(m!=-1 && m!=mark) { M[x][y] = mark; vector<ll> xx = {x,y}; queue_new.push_back(xx); }
        x = qx  ; y = qy+1; m = M[x][y];
        if(m!=-1 && m!=mark) { M[x][y] = mark; vector<ll> xx = {x,y}; queue_new.push_back(xx); }
        x = qx  ; y = qy-1; m = M[x][y];
        if(m!=-1 && m!=mark) { M[x][y] = mark; vector<ll> xx = {x,y}; queue_new.push_back(xx); }
        
      }

      queue = queue_new;
      ++turn;
    }

    ans = max(ans, turn-1);

  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

#define int long long
//using ll = long long;
using P = pair<int,int>;

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

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }

const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

signed main(){
	int x;
	cin >> x;
	isYes(x >= 30);
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define pq priority_queue
using namespace std; typedef pair<int, int> P; typedef pair<int, P> P2;
typedef pair<int, P2> P3; typedef long long ll; typedef long double ld;
constexpr long long gcd(long long a, long long b){return b ? gcd(b, a % b) : a;}
constexpr long long lcm(long long a, long long b){return a / gcd(a, b) * b;}
constexpr int INF = 1e9, MOD = INF + 7, around[] = {0, 1, 1, -1, -1, 0, -1, 1, 0, 0};
constexpr int mod_pow(long long x, long long n, const int mod){long long ret=1;while(n){if(n&1)(ret*=x)%=mod;(x*=x)%=mod;n>>=1;}return ret;}
template<int n> struct Prime{bool arr[n+1];constexpr bool operator[](int k){return arr[k];}constexpr Prime():arr(){for(int i=2;i<n;i++){arr[i]=true;for(int j=2;j*j<=i;j++){if(!(i%j))arr[i]=false;}}}};
template<int n> struct Factorial{long long arr[n+1],ary[n+1];constexpr Factorial():arr(),ary(){arr[0]=1;ary[0]=1;for(int i=0;i<n;i++){arr[i+1]=arr[i]*(i+1)%MOD;ary[i+1]=mod_pow(arr[i+1],MOD-2,MOD);}}};
constexpr Factorial<10> fact; constexpr Prime<10> prime;
constexpr int comb(int a, int b){long long pos = fact.arr[a], pot = fact.ary[a - b], por = fact.ary[b];return pos * pot % MOD * por % MOD;}
template<int n> struct Bernoulli{long long arr[n+1];constexpr Bernoulli():arr(){arr[0]=1;for(int i=1;i<=n;i++){long long sum=0;for(int j=0;j<i;j++){(sum+=comb(i+1,j)*arr[j]%MOD)%=MOD;}arr[i]=(MOD-mod_pow(i+1,MOD-2,MOD))%MOD*sum%MOD;}}};
constexpr int vx[] = {1, 0, -1, 0}, vy[] = {0, 1, 0, -1};
constexpr int sqrtN = 512, logN = 32;
constexpr ld PI = abs(acos(-1));
constexpr ll LINF=1e18;

int main(){
	int n, m; cin >> n; string s[110], w[110]; set<string> st;
	for(int i = 0; i < n; i++) cin >> s[i], st.insert(s[i]); cin >> m;
	for(int i = 0; i < m; i++) cin >> w[i], st.insert(w[i]);
	
	int ma = 0;
	for(auto t : st){
		int c = 0;
		for(int i = 0; i < n; i++) if(s[i] == t) c++;
		for(int i = 0; i < m; i++) if(w[i] == t) c--;
		
		ma = max(ma, c);
	}
	
	cout << ma << endl;
	return 0;
}


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

namespace ConsoleApp1
{
    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            B();
        }

        static void B()
        {
            var O = Read();
            var E = Read();
            for (int i = 0; i < Math.Max(O.Length, E.Length); i++)
            {
                if (O.Length > i)
                {
                    Console.Write(O[i]);
                }

                if (E.Length > i)
                {
                    Console.Write(E[i]);
                }
            }
        }

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int DigitsSum(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static IList<string> ReadSplit() => Read().Split().ToList();
        static IList<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
long n,a[100005],res;
int main()
{
    cin >> n;
    for (long i = 1 ; i <= n ; i++)
        cin >> a[i];
    res = 0;
    if (a[1]==1) {
        res++;
        swap(a[1],a[2]);
    }
    for (long i = 2 ; i <= n ; i++)
        if (a[i]==i) {
            swap(a[i],a[i+1]);
            res++;
        }
    cout << res;
}


Measured memory_bytes: 1024
import numpy as np
n = input("")
n = int(n)
#exa = input("").split(" ")
exa = list(map(int, input("").split(" ")))

exa2 = np.arange(n)+1
if np.count_nonzero((exa != exa2)) in [0, 2]:
    print("YES")
else:
    print("NO")


Measured memory_bytes: 12388
// Problem : D - Not Divisible
// Contest : AtCoder - AtCoder Beginner Contest 170
// URL : https://atcoder.jp/contests/abc170/tasks/abc170_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

//#pragma GCC optimize("Ofast")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
#define eb emplace_back
#define pb push_back
#define size(s) (int)s.size()
#define int long long
#define vi vector<int>
#define vs vector<string>
#define vv vector<vector<int>>
#define pii pair<int,int>
#define m_p(x,y) make_pair(x,y)
#define vp vector<pair<int,int>>
#define setbits(x) __builtin_popcountll(x)
#define f first
#define se second
#define inc(v,n,x) v.assign(n,x)
#define incd(v,n) v.resize(n)
#define iniz(n) memset(n,0,sizeof(n))
#define inin(n) memset(n,-1,sizeof(n))
#define inimi(n) memset(n,0xc0,sizeof(n))
#define inima(n) memset(n,0x3f,sizeof(n))
#define all(v) (v).begin(),(v).end()

using namespace std;

template<typename T1,typename T2>istream &operator>>(istream &is, vector<pair<T1,T2>> &v) { for (pair<T1,T2> &t : v) is >> t.f>>t.se; return is; }
template<typename T>istream &operator>>(istream &is, vector<T> &v) { for (T &t : v) is >> t; return is; }
template<typename T>ostream &operator<<(ostream &os, const vector<T> &v) { for (const T &t : v) {os << t <<" ";} os << '\n'; return os; }

double pi=acos(-1.0);
const int md=1e9+7;
const int INF=1e15;
int dx1[]={0,0,-1,1};
int dy1[]={1,-1,0,0};

template<class T>
T abst(T a)
{return a<0?-a:a;}

template<class T>
T max2(T a,T b){return a>b?a:b;}
template<class T>
T min2(T a,T b){return a<b?a:b;}
int arr[1000001];
int found[1000001];
void solve()
{
int n;cin>>n;
vi v(n);cin>>v;
for(int i:v)
found[i]++;
for(int i=1;i<=1000000;i++)
{
	for(int j=2*i;j<=1000000;j+=i)
	arr[j]+=found[i];
}
int ans=0;
for(int i:v)
if(!arr[i] and found[i]==1)
ans++;
cout<<ans;
}

int32_t main(){
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int t=1;
//cin>>t;
for(int i=1;i<=t;i++)
{
    solve();
}
return 0;
}


Measured memory_bytes: 20204
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repR(i, n) for(int i = (n) - 1; i > -1; i--)
#define rep1(i, n) for(int i = 1; i < (int)(n + 1); i++)
#define rep1R(i, n) for(int i = (n); i > 0; i--)
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

int main() {
  int N, T, A;
  cin >> N >> T >> A;
  vector<int> H(N + 1);
  rep1(i, N) cin >> H[i];
  int ans = -1;
  double min_delta = 10000000;
  rep1(i, N) {
    double delta = abs(A - (T - H[i] * 0.006));
    if (min_delta > delta) {
      min_delta = delta;
      ans = i;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256