akhauriyash/Code-Regression huggingface dataset:
/*
Author : N_o_o_B
Created : April 22 2020 21:21:01 
*/
#include <bits/stdc++.h>
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
*/
#define TRACE
#ifdef TRACE
#define trace(...) { cerr<<"[ "; __trace__(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.first<<","<<x.second<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
void __trace__(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void __trace__(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    __trace__(names.substr(1+(int)name.size()), args...);
}
#else
    #define trace(args...)
#endif
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vll;
typedef vector<vl> vvl;
//typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
#define fori(i,n) for(int i=0;i<n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,a,b) for(int i=a;i>=b;i--)
#define ford(i,n)  for(int i=n-1;i>=0;i--)
#define trav(x,a) for(auto& x:a)
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define sz(a) (int)a.size()
#define fi first
#define se second
clock_t time_p=clock();
void time_taken()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
//const ll mod=998244353;
const ll mod=1e9+7;
const ll INF=1e18;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    cout.precision(12);cout << fixed;

    int x1,y1,x2,y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int x = x2 - x1,y = y2 - y1;
    cout << x2 - y << ' ' << y2 + x << ' ' << x1 - y << ' ' << y1 + x << endl;
   
    time_taken();
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <iomanip>
#include <map>
#include <stack>
#include <sstream>

using namespace std;
int main()
{
	ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	unsigned long long int a, b, c;
	cin >> a >> b >> c;
	int sum = 0;
	for (unsigned long long int  i = a; i <= b; i++)
	{
		
			if (i % c == 0)
			{
			  sum++ ;
			
			}
		
	}
	cout << sum;
	return 0;

}

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

int main()
{
    long long n,m,ans=0;
    cin>>n>>m;
    if (n>2 && m>2) ans=(n-2)*(m-2);
    else
    {
        if (n==1)
        {
            if (m>2) ans=m-2;
            if (m==2) ans=0;
            if (m==1) ans=1;
        }
        if (n==2) ans=0;
        if (m==1)
        {
            if (n>2) ans=n-2;
            if (n==2) ans==0;
            if (n==1) ans=1;
        }
        if (m==2) ans=0;
    }
    cout<<ans<<'\n';
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int n;
	scanf("%d", &n);
	int i;
	int x[55], y[55];
	for (i = 0; i < n; i++)
		scanf("%d %d", &x[i], &y[i]);
	int ans = 2000000009;
	int p, q;
	int j, k, l, a;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < n; j++)
		{
			if (i != j)
			{
				p = x[i] - x[j];
				q = y[i] - y[j];
				a = n;
				for (k = 0; k < n; k++)
					for (l = 0; l < n; l++)
						if (x[k] - p == x[l] && y[k] - q == y[l])
							a--;
				if (ans > a)
					ans = a;
			}
		}
	}
	if (n > 1)
		printf("%d\n", ans);
	else
		printf("1\n");
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
#define INF 0x3f3f3f3f

#define _rep(i,a,b) for(int i=(a);i<=(b);++i)
int n,m;

int main()
{
    #ifdef __LOCAL__
        freopen("1.in","r",stdin);
        freopen("1.out","w",stdout);
    #endif
    cin>>n>>m;
    if(n==m)
        cout<<"Yes";
    else
        cout<<"No";
    
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    long long n,res;
    cin>>n;
        res = ((1 + n) * n) / 2;
    res -= 3 * (((n / 3) + 1) * (n / 3)) / 2;
    res -= 5 * (((n / 5) + 1) * (n / 5)) / 2;
    res += 15 * (((n / 15) + 1) * (n / 15)) / 2;
    cout<<res;
    return 0;
}


Measured memory_bytes: 3648
import bisect as bs
import sys

x = int(input())

dic = {}

i = 1
while True:
  if i ** 5  > 10 ** 12:
    break
    
  dic[i ** 5] = i
  dic[-(i ** 5)] = -i
    
  i += 1
  
i = 0
while True:
  if i ** 5 > 10 ** 12:
    break
    
  tmp = x + (i ** 5)
  if tmp in dic.keys():
    print(dic[tmp], i)
    sys.exit(0)
    
  tmp = x - (i ** 5)
  if tmp in dic.keys():
    print(dic[tmp], -i)
    sys.exit(0)
    
  i += 1

Measured memory_bytes: 62368
#include <iostream>

using namespace std;

int main()
{
    int n,x,m=0,m2=0,index=0;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>x;
        if(x>m){m2=m;m=x;index=i;}
        else if(x>m2)m2=x;
    }


    for(int i=0;i<n;i++)
    {
        if(i==index)cout<<m2<<endl;
        else cout<<m<<endl;
    }
}


Measured memory_bytes: 1664
N, M = map(int, input().split())
X = list(map(int, input().split()))

if N >= M:
    print(0)
    exit(0)

X.sort()

sa = []
for i in range(0, M-1):
    ima_sa = X[i+1] - X[i]
    sa.append(ima_sa)

sa.sort()

for i in range(0, N-1):
    sa.pop()

kotae = sum(sa)
print(kotae)

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

int main(){
	string S;
	cin >> S;
	int i, j, k;
	string A;
	bool b = false;
	//長さi開始j番目の文字列を検討
	for (i = 1; i <= S.size(); i++) {
		for (j = 0; j <= S.size() - i; j++) {
			string T = S.substr(j, i);
			bool c = true;
			for (k = 0; k < T.size(); k++) {
				if (T.at(k) != 'A'&&T.at(k) != 'T'&&T.at(k) != 'G'&&T.at(k) != 'C') {
					c = false;
					break;
				}
			}
			if (c == true) {
				A = T;
				b = true;
			}
		}
	}
	if (b == false) {
		cout << 0;
	}
	else {
		cout << A.size();
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main()
{
    long long n;
    cin>>n;
    deque<long long>s;
    for(;n;n/=26)s.push_front((n%26)),n--;
    //for(auto i:s)cout<<i<<" ";
    for(auto i:s)if(i==0)cout<<"z";else cout<<char(('a'+i)-1);
}


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

int main() {
  int N;
  cin >> N;
  int cnt = 0;
  cnt += (N/105);
  cnt += (N/165);
  cnt += (N/135);
  cnt += (N/189);
  cnt += (N/195);
  cout << cnt << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define fi first
#define se second 
#define pb push_back
#define all(x) (x).begin() , (x).end()
#define rep(i,a,b) for( ll i = a ; i < b ; i+=1 )
#define pp pair<ll,ll> 
#define sz(v) (ll)(v.size())
#define hell (ll)1000000007
#define slld(x) scanf("%lld",&x)
const ll N = 1e5 + 5 ;
ll t = 1 ;
void solve() 
{
    ll n, k , ans = 0 ;
    cin >> n >> k ;
    rep( i , 0 , n ){
        ll x ;
        cin >> x ;
        if( x >= k )
            ans++;
    }
    cout << ans ;
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
//    cin >> t ;
    while(t--){
        solve();
    }
    return 0 ;
}


Measured memory_bytes: 256
; ABC124-A
(defun max2(a b)
  (if (> a b) a b)
  )

(defun solve(a b)
  (setq r1 (max2 a b))
  (setq r2 (if (> a b) (max2 (- a 1) b) (max2 a (- b 1))))
  (+ r1 r2)
  )

(let ((a (read)) (b (read)))
  (format t "~d~%" (solve a b))
  )


Measured memory_bytes: 5736
! 2019.9.28 
!
      program answer
      implicit none
      integer :: N_i
      integer :: M_i
      double precision :: N_d
      double precision :: M_d
      double precision :: ans_d
      intrinsic dble
!
      read(*,*) N_i
      N_d = dble(N_i)
! M_i : the number of odd 
      M_i = (N_i + 1) / 2
      M_d = dble(M_i)
! 
      ans_d = M_d / N_d
      write(*,*) ans_d
      end program answer


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

long long int N, M, x[114514], y[114514], mx, my, i;
//char s[];

int main(){
    scanf("%lld%lld", &N, &M);
    for(i = 0; i < N; ++i){
        scanf("%lld", x + i);
        if(i){
            mx += (x[i] - x[i - 1]) * i * (N - i);
            mx %= 1000000007;
        }
    }
    for(i = 0; i < M; ++i){
        scanf("%lld", x + i);
        if(i){
            my += (x[i] - x[i - 1]) * i * (M - i);
            my %= 1000000007;
        }
    }
    cout << ((mx * my) % 1000000007) << endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define maxim(a, b) ((a > b) ? a : b)
int d[3002][3002],k;
char sir[3002], a[3002], b[3002];
void construieste(int i, int j){
    if(i&&j){
        if(a[i]==b[j]){
            construieste(i-1,j-1);
            sir[++k]=a[i];
        }
        else if(d[i-1][j]>d[i][j-1])
            construieste(i-1,j);
        else
            construieste(i,j-1);
    }
}
int main()
{
    int i,j,m,n;
    cin>>(a+1)>>(b+1);
    m=strlen(a+1);
    n=strlen(b+1);
    for(i=1;i<=m;i++)
        for(j=1;j<=n;j++)
            if(a[i]==b[j])
                d[i][j]=d[i-1][j-1]+1;
            else
                d[i][j]=maxim(d[i-1][j],d[i][j-1]);
    construieste(m,n);
    for(i=1;i<=k;i++)
        cout<<sir[i];
}


Measured memory_bytes: 35456
def a(n, a_st, b_st)
  result = ""
  a_set = a_st.split('')
  b_set = b_st.split('')
  for a in 0..a_set.size-1
    result = result+a_set[a]
    result = result+b_set[a]
  end
  return result
end

n = gets.chop.split.map(&:to_i)
a_st, b_st = gets.chop.split

print a(n, a_st, b_st)

Measured memory_bytes: 1788
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
//#include"functions.h"
#define pb push_back
#define pf push_front
#define ppb pop_back
#define mp make_pair
#define np next_permutation
#define fi first
#define sc second
#define vi vector<int>
#define vll vector<long long>
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pff pair<float,float>
#define pdd pair<double,double>
#define psi pair<string,int>
#define pis pair<int,string>
#define ppi pair<pii,int>
#define pdi pair<pii,pii>
#define INF 1e9
#define EPS 1e-5
#define MOD 1000000007
#define E 2.7182818284
#define PI 3.1415926535
#define FOR(a,b) for(int a=0;a<b;a++)
#define FORN(a,m,n) for(int a=0;a<m;a+=n)
#define REP(a,m,n) for(int a=m;a<n;a++)
#define REPN(a,m,n,p) for(int a=m;a<n;a+=p)
#define frestream freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define stdfopen(a,b) freopen(a,"r",stdin);freopen(b,"w",stdout);
#define ifopen(a) freopen(a,"r",stdin);
#define ofopen(a) freopen(a,"w",stdout);
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef long double ld;
using namespace std;

bool isp(ll n){
	for(int i=2;i*i<=n;i++){
		if(n%i==0)return 0;
	}
	return 1;
}
int main(){
	ll r;
	cin>>r;
	ll a=3*r*r;
	cout<<a<<endl;
	return 0;
}


Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNiINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include <map>
#include <fstream>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <cassert>
#include <set>
using namespace std;
#define eps 0.000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
#define cycle_per_sec 2806192512
int main() {
	vector<int> a;
	REP(i, 3) {
		int n;
		cin >> n;
		a.push_back(n);
	}
	sort(a.begin(), a.end());
	int k;
	cin >> k;
	for (int i = 0; i < k; ++i) {
		a[2] *= 2;
	}
	cout << a[0] + a[1] + a[2] << endl;
}

Measured memory_bytes: 888
import java.util.*;

public class Main{
	public static void main(String[] args){
		int a, b, d, r;
		double f;

		Scanner sc = new Scanner(System.in);
		a = sc.nextInt();
		b = sc.nextInt();
		//整数a,bを格納する

		if(1<=a && a <=Math.pow(10, 9)){
			d = a/b;
			//除算（余無）
			r = a%b;
			//除算（余有）
			f = (double)a/b;
			//除算（浮動小数点）
			System.out.print(d+" "+r+" ");
			System.out.printf("%f\n",(double)f);
		}
	}
}

Measured memory_bytes: 17192
#include <iostream>
using namespace std;
int main() {
	int n, j,p, x[100], y[100], h[100], i, a[100],q,r,s,b,ansx,ansy,ansh,u;
	int out[100];
		cin >> n;
  u=0;
		for (i = 1; i <= n; i++) {
			cin >> x[i] >> y[i] >> h[i];
			if (h[i] == 0) out[i] = 1;
			else {out[i] = 0; u++;}
           
		}
  if(u==1){for(i=1;i<=n;i++){
    if(h[i]==1){ansx=x[i];ansy=y[i];ansh=h[i];}
  }
  }
	else{	for (i = 0; i <= 100; i++) {
			for (j = 0; j <= 100; j++) {
				s = 1;
				for (p = 1; p <= n; p++) {
					q = i - x[p];
					if (q < 0)q = -q;
					r = j - y[p];
					if (r < 0) r = -r;
					a[p] = h[p] + q + r;
					if (out[p] == 0) {
						b = a[p];
					}
				}
				for (p = 1; p <= n; p++) {
					if (out[p] == 0) {
						if(a[p]==b) s = s * 1;
						else s = s * 0;
					}}
                  
					if (s == 1) {
						ansx = i; ansy = j; ansh = b;
					}
				
			}
		}}
		cout << ansx << " " << ansy << " " << ansh << endl;
		return 0;
	
}

Measured memory_bytes: 256
prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443,
         449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]
n = int(input())
ans = 1
for i in prime:
    if i <= n:
        m = n
        multi = 0
        while m >= i:
            multi += m // i
            m = m // i
        multi += 1
        ans *= multi
print(ans % (10**9 + 7))


Measured memory_bytes: 3192
#include <bits/stdc++.h>
using namespace std;
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))
#define INF 0x3f3f3f3f
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define fastcin ios_base::sync_with_stdio(false);
#define ll long long
#define MAX 200005 
 
int n;
ll int resp;
int v[MAX];
 
int main()
{	
	fastcin;
	cin >> n;
	for(int i=0;i<n;i++)
	{
		cin >> v[i];
	}
	int l=0,r=0,last=0;
	while(r<n)
	{
		//cout << resp << " l = " << l << " r = " << r <<endl;
		if((last & v[r]) == 0 ) // valido
		{
			resp+=r-l+1;
			last+=v[r];
			r++;
		}
		else
		{
			last-=v[l];
			l++;
		}
	}
	
	cout << resp;
}	


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main(){
  int x,m=1;
  cin>>x;
  if(x<4){
    cout<<m;
    return 0;
  }
  for(int i=2;i<32;i++){
    for(int j=2;j<10;j++){
      int c=i;
      c*=i;
      for(int k=2;k<j;k++){
        
        if(c*i>x)
          break;
        c*=i;
      }
      if(c<=x)
      m=max(m,c);
    }
  }
  cout<<m;
}


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

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

int main() {
  ll A, B;
  cin >> A >> B;
  ll g = gcd(A, B);
  
  //異なる素因数の個数
  ll n = g;
  
  ll a = 2;
  ll num = 0;
  
  bool div = false;
  // sqrt(g)以下の素数の個数
  while (a*a<=g) {
    if (n % a == 0) {
      while (n % a == 0) {n /= a;}
      num++;
    } else {a++;}
  }
  // sqrt(g)より大きい素数を換算
  if (n!=1) {num++;}
  
  //1も換算
  cout << num+1<< endl;
}


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

using namespace std;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	long double a, b, x, d;
	cin >> a >> b >> x;
	a *= 1.00000000;
	b *= 1.00000000;
	x *= 1.00000000;
	d = 2.0 * (a * b - x / a) / a;
/*	d = a * b;
	cout << d << endl;
	d -= x / a;
	cout << d << endl;
	d *= 2.0;
	cout << d << endl;
	d /= a;
	cout << d << endl;*/
	if(d > b){
	    d = 2.0 * (x / a) / b;
//	    cout << d << endl;
	    cout << std::setprecision(11) << atan2(b, d) * 180.0 / 3.14159265;
	}
	else cout << std::setprecision(11) << atan2(d, a) * 180.0 / 3.14159265;

	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;
using ll = long long;

int n;
const vector<string> ans{"Vacant", "Male", "Female"};

int judge(int q) {
    cout<<q<<endl;
    string s; cin>>s;
    for (auto i=0;i<3;i++) {
        auto &stus = ans[i];
        if (s == stus)
            return i;
    }
    return -1;
}

int vs(int l, int r, int ls, int rs) {
    if (((r-l)%2==0 && ls!=rs) ||
        ((r-l)%2==1 && ls==rs)) {
        auto c=(l+r)/2;
        auto cs=judge(c);
        if (cs==0) return 0;
        auto lcs=vs(l, c, ls, cs);
        if (lcs==0) return 0;
        auto rcs=vs(c, r, cs, rs);
        if (rcs==0) return 0;
    }
    return -1;
}

int main() {
    
    cin>>n;
    
    auto ls=judge(0);
    if (ls==0) return 0;
    auto rs=judge(n-1);
    if (rs==0) return 0;
    
    vs(0, n-1, ls, rs);
    
    return 0;
}



Measured memory_bytes: 852
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 14 17:18:33 2020

@author: NEC-PCuser
"""

N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

score = 0
your_hand = [-1] * N
# グー 0 チョキ 1 パー 2
score_dict = {"r":P, "s":R, "p":S}


for i in range(len(T)):
    if T[i] != your_hand[i - K]:
        score += score_dict[T[i]]
        your_hand[i] = T[i]

print(score)

Measured memory_bytes: 4084
#include <cstdio>
#include <climits>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#include <set>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
long long MOD = 1000000007;
long long INF = 1000000000000000; //10^15
typedef long long ll;
typedef unsigned long long ull;

ll powMod(ll x, ll n) {
  if (n == 0) return 1;
  ll r = powMod(x, n / 2);
  if (n % 2 == 0) return (r * r) % MOD;
  return (r * r % MOD) * x % MOD;
}

bool ijv(int i, int j, int h, int w) {
  if (0 <= i && i < h && 0 <= j && j < w) return true;
  return false;
}

char a[2010][2010];
ll s[2010][2010];

int main(void) {

  int n, m;
  cin >> n >> m;
  if (n == m) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
from collections import deque


user_num,rer_num=map(int,input().split())
graph=[[] for loop in range(user_num)]

for loop in range(rer_num):
    user1,user2=map(int,input().split())
    graph[user1].append(user2)
    graph[user2].append(user1)

#group[user1]はuser1が属するグループ.同じグループに属するuser同士は互いに到達可能
group=[-1]*user_num

que=deque([])
que.append(0)
tmp_group=0
for user in range(user_num):
    if(group[user]==-1):
        que.append(user)
        group[user]=tmp_group
        while(1):
            user1=que.popleft()
            for user2 in graph[user1]:
                if(group[user2]==-1):
                    que.append(user2)
                    group[user2]=tmp_group
            if(len(que)==0):
                tmp_group+=1
                break

for loop in range(int(input())):
    user1,user2=map(int,input().split())
    if(group[user1]==group[user2]):
        print("yes")
    else:
        print("no")


Measured memory_bytes: 23556
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define endl '\n'
#define pb push_back
#define fi first
#define se second
#define all(c) (c).begin(),(c).end()
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;

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

#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

const ll inf = 2e18;
const int mod = 1e9 + 7;
const int N = 2e5 + 10;

signed main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

	string s;
	cin >> s;
	for(auto &it : s) {
		if(it == '?') {
			it = 'D';
		}
	}
	cout << s;

	return 0;
}

Measured memory_bytes: 3720
#include <iostream>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <deque>
#include <cmath>
#include <iomanip>
#include <cstdio>
#include <limits>
#include <climits>

using namespace std;

int main(){
#define MAX 100000
    vector<bool> prims(MAX+1, true);
    prims[0]=prims[1]=false;
    for(int i=2; i*i<=MAX; ++i){
        if(!prims[i]) continue;
        for(int j=i*2; j<=MAX; j+=i) prims[j]=false;
    }
    vector<int> cnts(MAX+1);
    for(int i=1; i<MAX; ++i){
        if(i%2){
            cnts[i]=cnts[i-1]+int(prims[i] && prims[(i+1)/2]);
        } else{
            cnts[i]=cnts[i-1];
        }
    }
    int q; cin >> q;
    for(int i=0; i<q; ++i){
        int l, r; cin >> l >> r;
        cout << cnts[r]-cnts[l-1] << endl;
    }
    return 0;
}


Measured memory_bytes: 1024
e=enumerate
n,*a=map(int,open(0).read().split())
d=[0]
for j,(a,i)in e(sorted((a,i)for i,a in e(a))[::-1]):d=[d[0]+a*(~i-j+n)]+[max(d[k]+a*(~i-j+n+k),d[k-1]+a*abs(i-k+1))for k in range(1,j+1)]+[d[j]+a*abs(i-j)]
print(max(d))

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

int main() {
	int krsw, unco, yj = 0;
	string si;
	cin >> si;
	cin >> krsw;
	for(int j = 0; j < krsw; j++) {
		string sj;
		cin >> sj;
		for(int i = 0; i < 10; i++){
			unco = 0;
			for(int k = 0; k < si.size(); k++) {
				if(si[k] == sj[(k + i) % 10])
				unco++;
			}
			if(unco == si.size()){
				yj++;
				break;
			}
		}
	}
	cout << yj <<endl;
	return 0;
}

Measured memory_bytes: 1204
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int unko() {
	string s; cin >> s;
	if (s == "C") return 0;
	if (s == "C#") return 1;
	if (s == "D") return 2;
	if (s == "D#") return 3;
	if (s == "E") return 4;
	if (s == "F") return 5;
	if (s == "F#") return 6;
	if (s == "G") return 7;
	if (s == "G#") return 8;
	if (s == "A") return 9;
	if (s == "A#") return 10;
	if (s == "B") return 11;
}

int main() {
	int T; cin >> T;
	while (T--) {
		int n, m; cin >> n >> m;
		vector<int> a(n), b(m);
		for (int i = 0; i < n; i++)
			a[i] = unko();
		for (int j = 0; j < m; j++)
			b[j] = unko();
		vector<int> i(2);
		i[0] = n - 1; i[1] = max(0, n - 2);
		for (int j = m - 1; j >= 0; j--) {
			int x = b[j];
			//cout << i[0] << ' ' << i[1] << endl;
			for (int k = 0; k < 2; k++) {
				if (i[k] == -2 || i[k] == -1 || i[k] == n) {
					i[k] = -2;
					continue;
				}
				int y = a[i[k]];
				if (x == y) i[k]--;
				else if (x == (y + 1) % 12) i[k] -= 2;
				else if (x == (y + 11) % 12) i[k]++;
				else i[k] = -2;
			}
		}
		if (i[0] == -1 || i[1] == -1) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
}

Measured memory_bytes: 1524
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, s, e) for (int i = (int)(s); i < (int)(e); i++)
#define _rep(i, n) for (int i = (int)(n - 1); i >= 0; i--)
#define _REP(i, e, s) for (int i = (int)(e - 1); i >= (int)(s); i--)

#define yes cout << "yes" << endl;
#define Yes cout << "Yes" << endl;
#define YES cout << "YES" << endl;

#define no cout << "no" << endl;
#define No cout << "No" << endl;
#define NO cout << "NO" << endl;

#define out(st) cout << st << endl;

#define ll long long
#define ull unsigned long long

ll gcd(ll a, ll b) {
    if (a < b) return gcd(b, a);
    ll r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

int main() {
    int a, b;
    cin >> a >> b;
    if (a <= b) {
        out(a);
    } else {
        out(a - 1);
    }
}

Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        a: [u16; 2],
    }
    println!("{}", a[0] * a[1] - a[0] - a[1] + 1);
}


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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  int M1=0;
  int M2=0;
  for(int i=0; i<N; i++){
    cin >> A.at(i);
    if(A.at(i)>M1){
      M2=M1;
      M1=A.at(i);
    }
    else if(A.at(i)>M2){
      M2=A.at(i);
    }
  }
  for(int i=0; i<N; i++){
    if(A.at(i)!=M1){
      cout << M1 << endl;
    }
    else{
      cout << M2 << endl;
    }
  }
}

Measured memory_bytes: 2432
#line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"


#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void say(bool val, T yes = "Yes", T no = "No") { cout << (val ? yes : no) << endl; }

template <class T> void chmin(T &a, T b) {
  if (a > b)
    a = b;
}

template <class T> void chmax(T &a, T b) {
  if (a < b)
    a = b;
}


#line 3 "/mnt/c/Users/leafc/dev/compro/lib/union_find.hpp"
#ifndef UNION_FIND
#define UNION_FIND
class UnionFind {
private:
  std::vector<int> parent;
  std::vector<int> _size;

  int root(int x) {
    if (parent[x] == -1)
      return x;
    return parent[x] = root(parent[x]);
  }

public:
  UnionFind(const int s) {
    parent = std::vector<int>(s, -1);
    _size = std::vector<int>(s, 1);
  }

  void merge(int x, int y) {
    int rx = root(x), ry = root(y);
    if (rx == ry)
      return;
    if (_size[rx] < _size[ry])
      std::swap(rx, ry);
    parent[ry] = rx;
    _size[rx] += _size[ry];
    _size[ry] = _size[rx];
  }

  int size(int x) { return _size[x]; }

  bool isSame(int x, int y) { return root(x) == root(y); }
};
#endif
#line 3 "tmp.cpp"

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

  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> ab(m);
  REP(i, m) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    ab[i] = {a, b};
  }

  int ans = 0;
  REP(i, m) {
    UnionFind uf(n);
    REP(j, m) {
      if (j == i)
        continue;
      uf.merge(ab[j].first, ab[j].second);
    }
    REP(i, n - 1) {
      if (!uf.isSame(i, i + 1)) {
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
N, K = map(int, input().split())
ans = [1] * N
for i in range(K):
    d = int(input())
    a = list(map(int, input().split()))
    A = list(map(lambda x: x - 1, a))
    for j in range(d):
        ans[A[j]] = 0
print(sum(ans))

Measured memory_bytes: 9196
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> pp;
const int INF = 1e9;
const int MOD = 1000000007;

 
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  rep(i,1000){
    int num = i;
    vector<int> now;
    rep(j,3){
      now.push_back(num%10);
      num /= 10;
    }
    reverse(now.begin(),now.end());
    int k = 0;
    rep(j,n){
      if(s.at(j) - '0' == now.at(k)){
        k ++;
        if(k == 3){
          ans ++;
          break;
        }
      }
    }
  }
  cout << ans << endl;
      
  return 0;
}

Measured memory_bytes: 256
n = input()
n = n[::-1]
n += '0'
cnt = 0
dp = [[float('inf')] * 2 for _ in range(len(n) + 1)]
dp[0][0] = 0
dp[0][1] = 1
for i in range(len(n)):
    a = int(n[i])
    dp[i + 1][0] = min(dp[i][0] + a, dp[i][1] + a + 1)
    dp[i + 1][1] = min(dp[i][0] + 10 - a, dp[i][1] + 10 - (a + 1))
print(min(dp[len(n)][0], dp[len(n)][1]))

Measured memory_bytes: 192052
#include <cassert>
#include <algorithm>
#include <array>
#include <bitset>
#include <cctype>
#include <cstdint>
#include <cmath>
#include <complex>
#include <chrono>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#include <random>
#include <memory>
#include <utility>
#include <limits>
 
#define rep(i, a, b) for (long long i = (a); (i) < (b); (i)++)
#define all(i) i.begin(), i.end()
#define debug(...) std::cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

void debug_out(){std::cerr<<std::endl;}

template<typename Head,typename... Tail>
void debug_out(Head h,Tail... t){
  std::cerr<<" "<<h;
  debug_out(t...);
}
 
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << pa.first << " " << pa.second;
}
 
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (int i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
 
template<typename T1,typename T2>
inline bool chmax(T1& a,T2 b){return a<b && (a=b,true);}
 
template<typename T1,typename T2>
inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);}
 
long long pow_mod(long long a, long long b, long long mod=-1) {
  if(b==0)return 1;
  if ((a == 0)||(mod!=-1&&(a+mod)%mod==0))return 0;
  long long x = 1;
  while (b > 0) {
    if (b & 1)x = (mod!=-1)?(x * a) % mod:x*a;
    a = (mod!=-1)?(a * a) % mod:a*a;
    b >>= 1;
  }
  return x;
}

// const long long MOD = 998244353;
const long long MOD = 1e9 + 7;

using ll = long long;
using P=std::pair<long long,long long>;

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

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

  ll n;
  std::cin>>n;

  std::vector<ll> a(n);
  rep(i,0,n)std::cin>>a[i];

  ll ans=std::accumulate(all(a),0ll);

  for(ll i=1;i<n;i+=2)ans-=2*a[i];

  std::cout<<ans;

  rep(i,0,n-1){
    ans=2*a[i]-ans;
    std::cout<<" "<<ans;
  }

  std::cout<<"\n";

  return 0;
}



Measured memory_bytes: 2176
import java.util.*;
class Main{
    public static void main(String[] args){
	new Main().run();
    }
    Scanner sc = new Scanner(System.in);
    char[][] c = 
    { {'a', 'f', 'k', 'p', 'u', 'z'},
      {'b', 'g', 'l', 'q', 'v', '.'},
      {'c', 'h', 'm', 'r', 'w', '?'},
      {'d', 'i', 'n', 's', 'x', '!'},
      {'e', 'j', 'o', 't', 'y', ' '} };
    
    void run(){
	while(sc.hasNext()){
	    boolean flag = true;
	    String ans = "";
	    char[] num = sc.next().toCharArray();

	    if(num.length%2==1){
		System.out.println("NA");
		continue;
	    }
	    
	    for(int i=0; i<num.length; i+=2){
		int p = Character.getNumericValue(num[i])-1;
		int q = Character.getNumericValue(num[i+1])-1;
		if(p>=6 || p<0 || q>=5 || q<0){
		    System.out.println("NA");
		    flag = false;
		    break;
		}
		ans += c[q][p];
	    }
	    if(flag)System.out.println(ans);
	}
    }
}

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

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    string s;
    int mx = 0;
    vector<string> v;
    map<string, int> m;
    while (n--) {
        cin >> s;
        m[s]++;
        if (mx == m[s]) v.push_back(s);
        if (mx < m[s]) {
            mx = m[s];
            v = {s};
        }
    }
    sort(v.begin(), v.end());
    for (const auto & i : v) cout << i << "\n";
    return 0;
}


Measured memory_bytes: 25712
#include <iostream>
#include <cstdio>

using namespace std;

typedef long long ll;

ll n;
ll cnt;

bool f(ll p, ll q)
{
    if(q == 1) return false;
    if(p < q) return p == 1;
    if(p % q == 0) return f(p / q, q);
    return f(p % q, q);
}

int main()
{
    scanf("%lld", &n);
    for(ll i = 1; i * i <= n - 1; i++)
    {
        if((n - 1) % i == 0)
        {
            if(f(n, i)) cnt++;
            if(i != (n - 1) / i) if(f(n, (n - 1) / i)) cnt++;
        }
    }
    for(ll i = 1; i * i <= n; i++)
    {
        if(n % i == 0)
        {
            if(f(n, i)) cnt++;
            if(i != n / i) if(f(n, n / i)) cnt++;
        }
    }
    cout<<cnt<<endl;
    return 0;
}


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

struct ca
{
  int idx,st,et,aidx;
};

int prime[1000001]={};

int power(int x, unsigned int y, int p)  
{  
    int res = 1;     
  
    x = x % p; 
   
    if (x == 0) return 0; 
  
    while (y > 0)  
    {  
         
        if (y & 1)  
            res = (res*x) % p;  
  
        
        y = y>>1; 
        x = (x*x) % p;  
    }  
    return res;  
}  

void pr()
{
  prime[1]=0;

 for(int i=2;i*i<1000001;i++)
  if(prime[i]==0)
  for(int j=i*i;j<1000001;j+=i)
  prime[j]=1;

}

int countSetBits( int n) 
{ 
     int count = 0; 
    while (n) { 
        count += n & 1; 
        n >>= 1; 
    } 
    return count; 
} 
  
bool cmp1(ca c1,ca c2)
{
  if(c1.st<c2.st)
   return true;

  if(c1.st==c2.st && c1.idx<c2.idx)
   return true;

  return false;
}

bool cmp2(ca c1,ca c2)
{
  
  if(c1.idx<c2.idx)
  return true;
  return false;
}








int main()
{

    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);  
   //pr();
  int t;
   //cin>>t;
   t=1;
  int id=1;

  while(t--)
{
   int k;
    cin>>k;
   
    long sum=0;
   int count=0;

    for(int i=1;i<=k;i++)
     for(int j=1;j<=k;j++)
      for(int l=1;l<=k;l++)
     sum+= __gcd(i,__gcd(j,l));

     

  cout<<sum;
}



return 0;
}


Measured memory_bytes: 3640
import sys
stdin=sys.stdin

ns=lambda:input().rstrip()
ni=lambda:int(input().rstrip())
nm=lambda:map(int,input().split())
nl=lambda:list(map(int,input().split()))

N=int(input())
A=nl()
A_inv=[1/A[i] for i in range(len(A))]
print(1/sum(A_inv))

Measured memory_bytes: 3064
x, n = map(int, input().split())
if n > 0:
    ps = list(map(int, input().split()))
else:
    print(x)
    exit()
nums = [n for n in range(-1, 102) if n not in ps]

abs_plus = sorted([n-x for n in nums if n-x >= 0])
abs_minus = sorted([-(n-x) for n in nums if n-x < 0])
if abs_plus == []:
    print(x-abs_minus[0])
elif abs_minus == []:
    print(x+abs_plus[0])
elif abs_plus[0] >= abs_minus[0]:
    print(x-abs_minus[0])
else:
    print(x+abs_plus[0])

Measured memory_bytes: 9224
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const int Nmax = 1000000;

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

    vector<ll> v;  // nの約数を入れるvector

    for(ll i = 1LL; i*i <= n; i++) {
        if(n%i == 0) {
            v.push_back(i-1);
            if(i*i != n) {
                v.push_back(n/i - 1);
            }
        }
    }
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());

    ll ans = 0;
    rep(i, v.size()) {
        if(v[i] != 0) {
            ll a = n/v[i];
            ll b = n%v[i];
            if(a == b) {
                ans += v[i];
            }
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include <stdio.h>

int main(void){
  int h, w, H, W;
  for(;;){
    scanf("%d %d", &H, &W);
    if(H == 0 && W == 0)
      break;
    for(h = 0; h < H; h++){
      for(w = 0; w < W; w++)
	printf("#");
      printf("\n");
    }
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 572
n,m,l=map(int,input().split())
A=[list(map(int,input().split())) for _ in range(n)]
B=[list(map(int,input().split())) for _ in range(m)]
c=[[0 for i in range(l)]for j in range(n)]
for i in range(n):
    for j in range(l):
        for k in range(m):
            c[i][j]+=A[i][k]*B[k][j]

for i in c:
    print(*i)




Measured memory_bytes: 7064
m, k = map(int, input().split())

if 2**m <= k:
    print(-1)

elif m == 0:
    if k == 0:
        print(0, 0)
    else:
        print(-1)

elif m == 1:
    if k == 0:
        print(0,0,1,1)
    else:
        print(-1)

else:
    b = [i for i in range(2**m) if i != k]
    ans = b + [k] + b[::-1] + [k]
    print(*ans)


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

#define what_is(x) cerr << #x << " is " << x << endl;
#define what_is_v(x) cerr << #x << " is "; for(auto&e: (x)) cerr << e << ' '; cerr << '\n'; //vector, set
#define what_is_a(x, n) cerr << #x << " is "; for(int i=0;i<n;i++) cerr << x[i] << ' '; cerr <<  '\n'; //n first element of array
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define st first
#define nd second
#define cerr_pair(x) '{' << x.st << ", " << x.nd << '}'
#define pwhat_is(x) cerr << #x << " is " << cerr_pair(x) << endl;
#define pwhat_is_v(x) cerr << #x << " is "; for(auto&e: (x)) cerr << cerr_pair(e) << ' '; cerr << '\n'; //vector, set
#define pwhat_is_a(x, n) cerr << #x << " is "; for(int i=0;i<n;i++) cerr << cerr_pair(x[i]) << ' '; cerr <<  '\n'; //n first element of array
#define endl '\n'
// #define int long long

typedef pair<int,int> pii;
const int N = 1e5+5;
const int INF = 1e9;
const int MOD = 1e9+7;

int n, k;
double ans = 0;
int32_t main()
{
	IOS
	//freopen("input.txt", "r", stdin);
	cin >> n >> k;
	for(int i=1; i<=n; i++){
		int cnt = 0;
		for(int j=i; j<k; j*=2){
			cnt++;
		}
		ans += pow(0.5, cnt);
	}
	ans /= n;
	cout << fixed << setprecision(10);
	cout << ans << endl;
	
	return 0;
}


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

#define int long long

signed main() {
    int a, b, c;
    cin >> a >> b >> c;
    if(a==b) cout << c << endl;
    else if(a==c) cout << b << endl;
    else cout << a << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
using namespace std;

long long int solve(long long int n){
	if(n==2){return 3;}
	else if(n==4||n==6||n==9||n==11){return 2;}
	else{return 1;}
}

int main() {
	long long int n=0,m,a,b,c,d,e;
	long double z,w;
	string str,str2,str3;
	char ch;
	long long int x[130]={};
	cout << fixed << setprecision(10);
	cin>>a;
	if(a<1200){cout<<"ABC";}
	else{cout<<"ARC";}





	cout<<endl;
} 


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>

int main(void){
    char string[7] = {};
    scanf("%s",string);
    if(!strcmp(string,"Sunny"))
       printf("Cloudy");
    else if(!strcmp(string,"Cloudy"))
        printf("Rainy");
    else
        printf("Sunny");
    return 0;
}

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

#define rep(i,n) for(int i=0; i<(n); i++)
#define repi(i,a,b) for(int i = (a); i<= (b); i++)
#define repA(i,n) for(int i=n; i>=0; i--)
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz(a) (int)(a.size())

typedef long long ll;
typedef long double ld;
const ll mod = 998244353;//1e9+7

vector<int> cnt[201],sp;

void pre() {

}

void solve() {
  int n;  cin>>n;
  vector<int> a(n);
  int x = 0;
  rep(i,n)  {cin>>a[i];x = x^a[i];}
  rep(i,n) cout<<(a[i]^x)<<' ';
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  #endif
  int t = 1;
  pre();
  //cin>>t;
  rep(i,t)  {
    solve();
    cout<<'\n';
  }
  return 0;
}


Measured memory_bytes: 3972
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int ans = 0;

void an(){
    ans++;
}


vector<pair<long long, long long> > prime_factorize(long long N) {
    vector<pair<long long, long long> > res;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }

        // その結果を push
        res.push_back({a, ex});
    }

    // 最後に残った数について
    if (N != 1) res.push_back({N, 1});
    return res;
}

int main() {
    ll N;
    cin >> N;
    ll M;
    vector<ll>pfs(N+1);
    for (ll i=1; i<=N; i++){
        vector<pair<ll, ll>>curr_pf;
        curr_pf = prime_factorize(i);
        for (ll j=0; j<curr_pf.size(); j++){
            pair<ll, ll>pr;
            pr = curr_pf[j];
            pfs[pr.first] += pr.second;

        }
    }
    int c2, c4, c14, c24, c74;
    c2 = c4 = c14 = c24 = c74 = 0;
    for (int i=0; i<N+1; i++){
        if (pfs[i] >= 2)c2++;
        if (pfs[i] >= 4)c4++;
        if (pfs[i] >= 14)c14++;
        if (pfs[i] >= 24)c24++;
        if (pfs[i] >= 74)c74++;
    }

    ans += (c4 * (c4-1) * (c2-2)) /2;
    ans += c14 * (c4-1);
    ans += c24 * (c2 - 1);
    ans += c74;

    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int main()
{
    string s;
    cin >> s;
    for(ll i = 0; i < s.size(); i ++)
    { 
        if(s[i] == s[i+1])
        {
            cout << "Bad";
            return 0;
        }
    }
    cout << "Good";
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt();
        int r = sc.nextInt();
        int d = sc.nextInt();

        int lnum = (l%d)==0 ? (l/d-1) : l/d;
        int ans = r/d - lnum;
        System.out.print(ans);
    }
}

Measured memory_bytes: 35672
import math
import itertools
n=int(input())
k=int(input())
def comb(n,k):
    return len(list(itertools.combinations(range(n), k)))
x=str(n)
m=len(x)
ans=0
for i in range(1,m):
    ans+=(comb(i-1,k-1)*(9**k))
if k==1:
    for i in range(1,10):
        if i*(10**(m-1))<=n:
            ans+=1
elif k==2:
    for i in range(1,10):
        if i*(10**(m-1))<=n:
            for j in range(m-1):
                for a in range(1,10):
                    if i*(10**(m-1))+a*(10**(j))<=n:
                        ans+=1
                    else:
                        break
        else:
            break
else:
    po=[10**i for i in range(m)]
    for i in range(1,10):
        if i*po[m-1]<=n:
            for j in range(m-1):
                for a in range(1,10):
                    if i*po[m-1]+a*po[j]<=n:
                        for b in range(j):
                            for c in range(1,10):
                                ans+=(i*po[m-1]+a*po[j]+c*po[b]<=n)
                    else:
                        break
        else:
            break
print(ans)


Measured memory_bytes: 42204
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x,h,a,sum=0;
    cin>>h>>a;
    for(int i=0;i<a;i++){
        cin>>x;
        sum+=x;
    }
    if(sum>=h) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


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

int kaijo(ll a) {
  if (a == 1) return 1;
  ll pos = (kaijo(a-1) * a) % 1000000007;
  return pos;
}

int main() {
  ll N;
  cin >> N;
  cout << kaijo(N) << endl;
}

Measured memory_bytes: 1792
/***************************

		  ~PEACE~

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

#include<bits/stdc++.h>
using namespace std;
	
	#define 	ll 					 	long long
	#define 	endl 					"\n"
	#define 	int 					long long
	#define 	fo(i,n)					for(i=0;i<n;i++)
	#define 	re(i,n)					for(i=n-1;i<=0;i--)
	#define 	pb 						push_back
    #define 	mp 						make_pair
	#define 	vi 						vector<int>
	#define 	pii 					pair<int,int>
	#define 	mii 					map<int,int>
	#define 	umii 					unordered_map<int,int>
	#define 	si 						set<int>
	#define 	usi 					unordered_set<int>
	#define 	fast 					ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);

int mod = pow(10,9)+7;
int inf=1e18;
vector<vector<int> > adj(100005);
bool vis[100005];

int Log2(int x){
	int ans=0;
	while(x>>=1)	ans++;
	return ans;
}

void dfs(int root){
	vis[root]=true;
	for(auto it: adj[root]){
		if(!vis[it]){
			dfs(it);
		}
	}
}

void solve(){
	int n,m;	cin>>n>>m;
	int i;
	fo(i,m){
		int a,b;	cin>>a>>b;
		adj[a].pb(b);
		adj[b].pb(a);
	}

	int ans=0;
	for(int i=1;i<=n;i++){
		if(!vis[i]){
			ans++;
			dfs(i);
		}
	}

	cout<<ans-1<<endl;
}

void pb_18(){
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
	#endif

	int t=1;
	while(t--)	solve();
}

int32_t main(){
	fast
	pb_18();
	return 0;
}

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

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


Measured memory_bytes: 256