akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ll                      long long int
#define pb                      push_back
#define rep(i,a,b,c)            for(ll i=(a);i<=(b);i+=(c))
#define repb(i,a,b,c)           for(ll i=(a);i>=(b);i-=(c))
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
//#define mp                      make_pair
#define vpll                    vector<pair<ll,ll>>
#define sll                     set<ll>
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define umcl                    um<char,ll>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define ln                      cout<<"\n";
#define endl                    "\n"
#define test                    ll Testcases;cin>>Testcases;while(Testcases--)
#define isvowel(a)              (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define show(w,size)            {for(ll i=0;i<size;i++) cout<<w[i]<<" ";cout<<"\n";}
#define print(a)                cout<<a<<"\n";
#define mset(dp,no)             memset(dp,no,sizeof(dp))
#define input(a,n)              rep(i,0,n-1,1) cin>>a[i];
#define countbit                __builtin_popcount                                           //Number of setbits in decimal notation
#define lb(v,val)               lower_bound(all(v),val)-v.begin()
#define ub(v,val)               upper_bound(all(v),val)-v.begin()
#define SS                      stringstream
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 <<'\n'; }
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...);
}

ll poww(ll b,ll e){if(e==0)return 1;else if(e%2==0){ll a=pow(b,e/2);return a*a;}else {ll a=pow(b,e/2);return b*a*a;}}
ll powm(ll x,ll y,ll m=MOD){x=x%m;ll res=1;while(y){if(y&1)res=res*x;res%=m;y=y>>1;x=x*x;x%=m;}return res;}
ll modInverse(ll a,ll m=MOD){if(m==1)return 0;ll m0=m,y=0,x=1;while(a>1){ll q=a/m,t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0) x+=m0;return x;}

int main()
{
	fastIO
	ll n;
	cin>>n;
	string s;
	cin>>s;
	ll ans=0;
	rep(i,2,n-1,1)
	{
		if((s[i]=='C')&&(s[i-1]=='B')&&(s[i-2]=='A'))
			++ans;
	}	
	cout<<ans;
	return 0;
}




Measured memory_bytes: 256
m = int(input())

for i in range(m):
    a = str(input())
    result=[]
    result.append(a)
    
    for j in range(len(a)):
        m=a[:j]
        mre=m[::-1]
        u=a[j:]
        ure=u[::-1]
        
        result.append(m+u)
        result.append(m+ure)
        result.append(mre+u)
        result.append(mre+ure)
        result.append(u+m)
        result.append(u+mre)
        result.append(ure+m)
        result.append(ure+mre)
    print(len(set(result)))


Measured memory_bytes: 5632
k,a,b = gets.split.map &:to_i

#操作はk回
#1枚ビスケットを増やす
#a枚のビスケットと1円を交換
#1円とb枚のビスケットを交換
#最初は1枚ビスケットを持っている

#お金を経由するかどうか

if a + 2 >= b
    puts k + 1
    exit
end

#a-1回叩く
#k-(a-1)回の操作でAとBの操作を行う

#k-(a-1)が偶数
#(k-(a-1))/2回(b-a)個のビスケットが増える
if (k-(a-1)) % 2 == 0
    puts a + (b-a) * (k-(a-1)) / 2
    exit
else
    #k-(a-1)が奇数のときはもう1回叩く
    puts a + 1 + (b-a) * (k-(a)) / 2
    exit
end

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

typedef long long  ll;

ll MOD = 1000000007;
ll INF = 100000000000000;
double PI = 3.1415926535;

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}

using Graph = vector<vector<pair<ll,ll>>>;

ll tableF[200010];
ll tableI[200010];

ll modfact(ll a,ll m){
   if(tableF[a] != -1){
      return tableF[a];
   }
   if(a == 1){
      tableF[a] = 1;
      return tableF[a];
   }
   ll res = 1;
   res = a * modfact(a-1,m);
   res %= m;
   tableF[a] = res;
   return res;
}

ll modpow(ll a,ll n,ll m){//modpow(a,n,m) := a ^ n (mod m)
  ll res = 1;
  while(n > 0){
    if(n & 1)res = res * a % m;
    a = a * a % m;
    n >>= 1;
  }
  return res;
}

ll modinv(ll a,ll p){//modinv(a,p) := pを法とするaの逆元(※pは素数でなければならない)
    ll res = modpow(a,p-2,p);
    return res;
}

ll modCON(ll n,ll r,ll m){
   if(n < 200010){
   ll res = 1;
   if(n == 0 || r == 0){
      return 1;
   }
   res *= tableF[n];
   res %= m;
   res *= tableI[r];
   res %= m;
   res *= tableI[n-r];
   res %= m;
   return res;
   }else{
   ll res = 1;//tableを持ってないときよう
   for(int i = 1;i <= n;i++){
      res *= i;
      res %= m;
   }
   for(int i = 1;i <= r;i++){
      res *= modinv(i,m);
      res %= m;
   }
   for(int i = 1;i <= n-r;i++){
      res *= modinv(i,m);
      res %= m;
   }
   return res;
   }
}

void modfill(ll m){//忘れない　約300ms
   fill(tableF,tableF+200010,-1);
   fill(tableI,tableI+200010,-1);
   tableF[0] = 1;
   tableI[0] = 1;
   for(int i = 1;i < 200010;i++){
      tableF[i] = modfact(i,m);
      tableI[i] = modinv(tableF[i],m);
   }
}


int main(){
  ll N,A,B,C;cin >> N >> A >> B >> C;
  modfill(MOD);
  ll ans = 0;
  for(ll i = N;i < 2*N;i++){
    ll num = (modpow(A,N,MOD) * modpow(B,i-N,MOD) % MOD + modpow(A,i-N,MOD) * modpow(B,N,MOD) % MOD) * i * 100 % MOD;
    ll den = modpow(A+B,i,MOD) * (100 - C) % MOD;
    ans += modCON(i-1,N-1,MOD) * num % MOD * modinv(den,MOD) % MOD; 
  }
  cout << ans % MOD << endl;
}


Measured memory_bytes: 3328
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main{
    public static void main(String[] args) throws IOException{
        FastReader in = new FastReader();
        FastWriter out = new FastWriter();
        int a = in.nextInt();
        out.pl(a + (a*a) + (a*a*a));
        out.close();
    }
}
class FastReader{ 
    BufferedReader br; 
    StringTokenizer st; 
    public FastReader() { 
        br = new BufferedReader(new InputStreamReader(System.in)); 
    } 
    String next(){ 
        while (st == null || !st.hasMoreElements()) { 
            try{ 
                st = new StringTokenizer(br.readLine()); 
            }catch (IOException  e){ 
                e.printStackTrace(); 
            } 
        } 
        return st.nextToken(); 
    } 
    int nextInt(){ 
        return Integer.parseInt(next()); 
    } 
    long nextLong(){ 
        return Long.parseLong(next()); 
    } 
    double nextDouble(){ 
      return Double.parseDouble(next()); 
    } 
    String nextLine(){ 
        String str = ""; 
        try{ 
            str = br.readLine(); 
        } 
        catch (IOException e){ 
            e.printStackTrace(); 
        } 
        return str; 
    } 
}
class FastWriter{
    PrintWriter out;
    FastWriter(){
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
	out.flush();
    }
    void pl(Object o){
        out.write(o.toString());
	    out.write("\n");
        out.flush();
    }
    void pl(){
        out.write("\n");
    }
    void p(Object o){
        out.write(o.toString());
    }
    void close(){
        out.flush();
        out.close();
    }  
}


Measured memory_bytes: 32900
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m1(x) memset(x,-1,sizeof(x))
const int INF = 1000000001;
const ll MOD = 1000000007;

int main(){
  int a[3];
  rep(i, 3) cin >> a[i];
  int b[3];
  b[1] = abs(a[1] - a[0]);
  b[0] = abs(a[2] - a[0]);
  b[2] = abs(a[2] - a[1]);
  cout << min(b[0]+b[1], min(b[1]+b[2], b[0]+b[2])) <<endl;
}

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

int m,n;
int lef,rig,cen;
int a[100];
int ans;

bool func(){
	int sum=0,M=1;
	for (int i=0; i<n; i++) {
		if (sum+a[i]<=cen) {
			sum+=a[i];
		}
		else{
			M++;
			if (M>m) {
				return false;
			}
			sum=0;
			if (a[i]>cen) {
				return false;
			}
			sum+=a[i];
		}
	}
	return true;
}

int main(){
	
	while (1) {
		cin>>m>>n;
		if (m==0&&n==0) {
			break;
		}
		for (int i=0; i<n; i++) {
			cin>>a[i];
		}
		lef=0;
		rig=1500000-1;
		ans=0;
		
		while (lef<=rig) {
			cen=(lef+rig)/2;
			if (func()) {
				ans=cen;
				rig=cen-1;
			}
			else{
				lef=cen+1;
			}
			
		}
		cout << ans << endl;
	}		
	
}

Measured memory_bytes: 0
import sys
sys.setrecursionlimit(10**6)

N = int(input())
h = list(map(int, input().split()))
dp = [None] * N

def solve(idx):
    if dp[idx] is not None:
        return dp[idx]

    if idx == N - 1:
        dp[idx] = 0
        # return 0
    elif idx == N - 2:
        dp[idx] = abs(h[idx] - h[idx + 1])
        # return abs(h[idx] - h[idx + 1])
    else:
        # Jump 1
        v1 = solve(idx + 1) + abs(h[idx] - h[idx + 1])

        # Jump 2
        v2 = solve(idx + 2) + abs(h[idx] - h[idx + 2])

        dp[idx] = min(v1, v2)

    return dp[idx]

print(solve(0))

Measured memory_bytes: 162952
N, Y = map(int, input().split())

for x in range(N+1):
    for y in range(N-x+1):
        z = N - x - y
        if 10000 * x + 5000 * y + 1000 * z == Y:
            print(x, y, z)
            exit()

print('-1 -1 -1')

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
bool s[200050] = {};
bool t[200050] = {};

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

  for(int i = 0; i < M; i++){
    int a, b;
    cin >> a >> b;
    if(a == 1){
      t[b] = true;
    }
    if(b == N){
      s[a] = true;
    }
  }

  for(int i = 0; i < 200050; i++){
    if(s[i] && t[i]){
      cout << "POSSIBLE" << endl;
      return 0;
    }
  }

  cout << "IMPOSSIBLE" << endl;
  return 0;

  return 0;
}


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

#define ll long long int

double calc_cos(double xa, double xb, double xc, double ya, double yb, double yc) {
    double c;
    c = ((xb - xa) * (xc - xa) + (yb - ya) * (yc - ya)) /
        (sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya)) *
         sqrt((xc - xa)*(xc - xa) + (yc - ya)*(yc - ya)));
    return c;
}

double calc_rad(double xa, double xb, double ya, double yb, double ta, double tb) {
    double r;
    double l;
    l = sqrt((xb - xa)*(xb - xa) + (yb - ya)*(yb - ya));
    r = l / (2 + 1/tan(ta) + 1/tan(tb));
    return r;
}

int main() {

    double x1, x2, x3;
    double y1, y2, y3;
    cin >> x1 >> y1;
    cin >> x2 >> y2;
    cin >> x3 >> y3;

    double c1, c2, c3;
    c1 = calc_cos(x1, x2, x3, y1, y2, y3);
    c2 = calc_cos(x2, x3, x1, y2, y3, y1);
    c3 = calc_cos(x3, x1, x2, y3, y1, y2);

    double t1, t2, t3;
    t1 = acos(c1) / 2;
    t2 = acos(c2) / 2;
    t3 = acos(c3) / 2;

    double r1, r2, r3;
    r1 = calc_rad(x1, x2, y1, y2, t1, t2);
    r2 = calc_rad(x2, x3, y2, y3, t2, t3);
    r3 = calc_rad(x3, x1, y3, y1, t3, t1);

    cout << fixed << setprecision(15) << max(max(r1, r2), r3) << endl;

    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-

# A, B, C, Dの入力
a, b, c, d = map(int, input().split())
s_1 = a * b     # 面積1(AとB)
s_2 = c * d     # 面積2(CとD)

if s_1 >= s_2:
    print(s_1)
else:
    print(s_2)


Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
 
#define REP(i,b,n) for(int i=b;i<n;++i)
#define REPR(i,b,n) for(int i=n-1;i>=b;--i)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PI acos(-1.0)

using namespace std;

static const double EPS = 1e-9;
typedef pair<int, int> pii;
typedef long long ll;

double l[11]={0}, v1, v2;

int solve(){
	
	double r = v1/(v1+v2);
	double x = r*l[10];
	
	for(int i=1; i <= 10; ++i){
		if( x <= l[i] )
			return i;
	}
	
	return 10;
}
	

int main(){
	
	char c;
	
	while(cin>>l[1]>>c>>l[2]>>c>>l[3]>>c>>l[4]>>c>>l[5]>>c>>
			l[6]>>c>>l[7]>>c>>l[8]>>c>>l[9]>>c>>l[10]>>c>>v1>>c>>v2, !cin.eof()){
		
		for(int i=1; i<=10; ++i){
		
			l[i]+=l[i-1];
		}
		
		cout << solve() << endl;
	}
		
	return 0;
}

Measured memory_bytes: 1224
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;

int main()
{
  const uint64_t M = 10'000'000'000;
  int n, m;
  cin >> n >> m;
  vector<uint64_t> a(m);
  map<uint64_t, uint64_t> mp;

  for (auto i = 0; i < m; i++) {
    uint64_t p, y;
    cin >> p >> y;
    a[i] = p * M + y;
  }

  vector<uint64_t> b(a);
  sort(begin(b), end(b));

  uint64_t p = 0;
  uint64_t x;
  for (auto&& e : b) {
    if (e / M != p) {
      p = e / M;
      x = 1;
    }
    mp[e % M] = x++;
  }

  for (auto&& e : a) {
    uint64_t p = e / M;
    uint64_t c = mp[e % M];
    cout << setfill('0') << setw(6) << p
         << setfill('0') << setw(6) << c
         << endl;
  }
}


Measured memory_bytes: 9344
#include <iostream>
#include <string.h>

using namespace std;

int main () {
  string h;
  cin >> h;
  for (int i = 0; i < h.size(); i++) {
    if (h[i] == '9') {
      cout << '1';  
    }  
    else {
      if (h[i] == '1') {
        cout << '9';  
      }  
      else {
        cout << h[i];  
      }
    }
  }  
  cout << endl;
}

Measured memory_bytes: 256
n = int(input())
lst = [input().split() for i in range(n)]
dict = {}
for op, s in lst:
    if op == 'insert':
        dict[s] = 1
    if op == 'find':
        try:
            if dict[s] == 1:
                print('yes')
        except:
            print('no')



Measured memory_bytes: 303792
#include <stdio.h>

int main() {
  int K,A,B,count=0;
  scanf("%d",&K);
  scanf("%d %d",&A,&B);
  if(A>=1 && A<=B && B<=1000 && 1<=K && K<=1000) {
    for(int i=A;i<=B;i++) {
      if(i%K==0) {
	printf("OK");
	count++;
	break;
      }
    }
    if(count==0) {
      printf("NG");
    }
  }
  return 0;
}

Measured memory_bytes: 1728
#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 fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

bool visited[200001];
ll v[200001];

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll n,k;
    cin>>n>>k;
    for(ll i=1;i<=n;i++){
        cin>>v[i];
    }
    ll place=1;
    ll cyclestart=0;
    visited[1]=1;
    while(1){
        place=v[place];
        if(visited[place]==1){
            cyclestart=place;
            break;
        }
        visited[place]=1;
    }
    ll step=0;
    place=1;
    while(1){
        place=v[place];
        step+=1;
        if(place==cyclestart){
            break;
        }
    }
    ll count=0;
    place=cyclestart;
    while(1){
        place=v[place];
        count+=1;
        if(place==cyclestart){
            break;
        }
    }
    if(k>=step){
        k-=step;
        k=k%count;
        place=cyclestart;
        for(ll i=0;i<k;i++){
            place=v[place];
        }
        cout<<place<<endl;
    }
    else if(k<step){
        place=1;
        for(ll i=0;i<k;i++){
            place=v[place];
        }
        cout<<place<<endl;
    }
    return 0;
}


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

#define pb push_back
#define mp make_pair
#define ll long long int
int main()
{
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL);    

    int n;
    cin >> n;
    int a[n][3];
    for (int i=0;i<n;i++)
    	cin >> a[i][0] >> a[i][1] >> a[i][2];

    int dp[n][3];
    dp[0][1]=a[0][1];
    dp[0][2]=a[0][2];
    dp[0][0]=a[0][0];

    for (int i=1;i<n;i++)
    {
    	dp[i][0]=max(dp[i-1][1],dp[i-1][2]) + a[i][0];
    	dp[i][1]=max(dp[i-1][0],dp[i-1][2]) + a[i][1];
    	dp[i][2]=max(dp[i-1][0],dp[i-1][1]) + a[i][2];
    }

    cout << max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2])) << endl;

	return 0;
}

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


using namespace std;

int main(void){

  int H,N;
  cin >> H >> N;
  int Skill[N];
  int Ans = 0;
  for (int i = 0; i < N; i++)
  {
    cin >> Skill[i];
    Ans += Skill[i];
  }
  
  if (Ans >= H){
    cout << "Yes" << endl;
  }else {
    cout << "No" << endl;
  }
  return 0;
}

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

using namespace std;

int main(int argc, const char *argv[]) {
  unsigned long int A, B, K;
  cin >> A >> B >> K;

  if(A < K){
    K -= A;
    A = 0;
    if(B < K){
      printf("0 0\n");
    }else{
      B -= K;
      printf("%ld %ld\n", A, B);
    }
  } else {
    printf("%ld %ld\n", A - K, B);
  }
  return 0;
}


Measured memory_bytes: 888
import numpy as np

n=int(input())

a=list(map(int,input().split()))
a.sort(reverse=True)
#print(a)
r=0
for ii in range(len(a)-2):
	for jj in np.arange(ii+1,len(a)-1):
		for kk in np.arange(jj+1,len(a)):
			if a[ii]==a[jj] or a[jj]==a[kk] or a[kk]==a[ii]:
				pass
			else:
				if a[ii]<a[jj]+a[kk]:
					#print(ii,jj,kk,a[ii],a[jj],a[kk])
					r+=1

print(r)

Measured memory_bytes: 27244
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = (int)(n); i >= 0; i--)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
 
ll N, K, T, W, H, M, C;
 
const int MAX = 5100000;
const ll MOD = 1e9 + 7;
 
const double PI=3.14159265358979323846;
 
 
long long fac[MAX], finv[MAX], inv[MAX];
 
vector<double> cx, cy, c;
 ll MM = 1e12;
 
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
std::vector<int> Eratosthenes(int n ){
    std::vector<bool> is_prime( n + 1 );
    for( int i = 0; i <= n; i++ ) is_prime[ i ] = true;
    std::vector<int> P;
    for( int i = 2; i <= n; i++ ){
        if( is_prime[ i ] ){
            for( int j = 2 * i; j <= n; j += i ){
                is_prime[ j ] = false;
            }
            P.emplace_back( i );
        }
    }
    return P;
}
 
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;
}
 
ll lcm(ll a, ll b)
{
   return a * b / gcd(a, b);
}
 
  /*
int main(){
    string str;
    cin >> str;
    N = str.size();
    int sub = 0;
    int p10 = 1;
    vector<int> v(2019, 0);
    for(int i = N-1; i >= 0; --i){
        sub = (sub + (str[i] - '0')*p10) % 2019;
        ++v[sub];
        p10 = (p10 * 10) % 2019;
    }
    ll ans = 0;
    for(auto u:v) ans += u*(u-1)/2;
    if(v[0] == 1) ++ans;
    cout << ans;
    return 0;
}
*/
int main(){
    cin >> N;
    vector<string> v;
    string str;
    for(int i = 0; i < N; ++i) {cin >> str; v.push_back(str);}
    sort(ALL(v));
    str = v[0];
    int ans = 1;
    for(int i = 1; i < N; ++i){
        if(v[i] == str) continue;
        ++ans;
        str = v[i];
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 11676
#include <bits/stdc++.h>
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
using Int = long long;
const char newl = '\n';


template<typename T,T MOD = 1000000007>
struct Mint{
  static constexpr T mod = MOD;
  T v;
  Mint():v(0){}
  Mint(signed v):v(v){}
  Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}

  Mint pow(long long k){
    Mint res(1),tmp(v);
    while(k){
      if(k&1) res*=tmp;
      tmp*=tmp;
      k>>=1;
    }
    return res;
  }

  static Mint add_identity(){return Mint(0);}
  static Mint mul_identity(){return Mint(1);}

  Mint inv(){return pow(MOD-2);}

  Mint& operator+=(Mint a){v+=a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator-=(Mint a){v+=MOD-a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator*=(Mint a){v=1LL*v*a.v%MOD;return *this;}
  Mint& operator/=(Mint a){return (*this)*=a.inv();}

  Mint operator+(Mint a) const{return Mint(v)+=a;}
  Mint operator-(Mint a) const{return Mint(v)-=a;}
  Mint operator*(Mint a) const{return Mint(v)*=a;}
  Mint operator/(Mint a) const{return Mint(v)/=a;}

  Mint operator-() const{return v?Mint(MOD-v):Mint(v);}

  bool operator==(const Mint a)const{return v==a.v;}
  bool operator!=(const Mint a)const{return v!=a.v;}
  bool operator <(const Mint a)const{return v <a.v;}

  static Mint comb(long long n,int k){
    Mint num(1),dom(1);
    for(int i=0;i<k;i++){
      num*=Mint(n-i);
      dom*=Mint(i+1);
    }
    return num/dom;
  }
};
template<typename T,T MOD> constexpr T Mint<T, MOD>::mod;
template<typename T,T MOD>
ostream& operator<<(ostream &os,Mint<T, MOD> m){os<<m.v;return os;}

//INSERT ABOVE HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n,s;
  cin>>n>>s;
  vector<int> as(n);
  for(int i=0;i<n;i++) cin>>as[i];

  using M = Mint<int, 998244353>;
  using Poly = vector<M>;
  Poly dp(s+1,0);
  dp[0]=1;
  for(int a:as){
    Poly nx(s+1,0);
    for(int i=0;i<(int)dp.size();i++){
      if(i+0<=s) nx[i+0]+=dp[i]*M(2);
      if(i+a<=s) nx[i+a]+=dp[i]*M(1);
    }
    swap(dp,nx);
  }

  cout<<dp[s]<<endl;
  return 0;
}


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

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);  
	
	int n, a, b; cin >> n >> a >> b;
	int dif = b - a + 1;
	if(dif % 2 == 1) cout << "Alice" << endl;
	else cout << "Borys" << endl;
	return 0;	
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
#include<unordered_map>
#include<unordered_set>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592
#define PI acos(-1.0);

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;


struct Combination{
    vector<long long> _fac,_finv,_inv;
    const int m = MOD;

    Combination(int sz) : _fac(sz),_finv(sz),_inv(sz){
        _fac[0] = _fac[1] = 1;
        _finv[0] = _finv[1] = 1;
        _inv[1] = 1;
        for(int i = 2; i <= sz; i++){
            _fac[i] = _fac[i-1]*i%m;
            _inv[i] = m-_inv[m%i]*(m/i)%m;
            _finv[i] = _finv[i-1]*_inv[i]%m;
        }
    }

    inline long long fac(int n){return _fac[n];}
    inline long long inv(int n){return _inv[n];}
    inline long long finv(int n){return _finv[n];}

    long long comb(int n,int k){
        if(n < k) return 0;
        if(n < 0 || k < 0) return 0;
        return _fac[n]*(_finv[k]*_finv[n-k]%m)%m;
    }
};

int main(){
    int N; cin >> N;
    vector<int> A(N);
    rep(i,N) cin >> A[i];
    vector<ll> sum(N+1);
    rep(i,N){
        sum[i+1] = sum[i]+A[i];
        sum[i+1] %= MOD;
    }
    vector<ll> sum2(N+2);
    rep(i,N+1){
        sum2[i+1] = sum2[i]+sum[i];
        sum2[i+1] %= MOD;
    }
    ll ans = 0;
    Combination C(200000);
    repr(i,1,N+1){
        if(i == N){
            ans += sum[N];
            ans %= MOD;
            continue;
        }
        ans += sum[i]*C.inv(i+1)%MOD;
        ans %= MOD;
        ans += (sum[N]-sum[N-i]+MOD)%MOD*C.inv(i+1)%MOD;
        ans %= MOD;
        if(i+2 <= N){
            ll now = 0;
            now += (sum2[N]-sum2[i+1]+MOD)%MOD;
            now -= (sum2[N-i]-sum2[1]+MOD)%MOD;
            if(now < 0) now += MOD;
            ans += now*2%MOD*C.inv(i+2)%MOD*C.inv(i+1)%MOD;
            ans %= MOD;
        }
    }
    ans *= C.fac(N);
    ans %= MOD;
    cout << ans << endl;
}



Measured memory_bytes: 6912
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int is_prime1(int);
int is_prime2(int);

int prime[168];

int main()
{
	int input_count;
	int prime_count;
	int input;
	int cnt;
	int output[30];
	int prime_cnt;
	
	/*Make prime table*/
	prime[0] = 2;
	prime_cnt = 1;
	for(cnt = 3; cnt < 1000; cnt += 2)
	{
		if(is_prime1(cnt))
		{
			prime[prime_cnt] = cnt;
			//printf("%d: %d\n", prime_cnt, cnt);
			prime_cnt++;
		}
	}
	
	
	/*Get, calculate input then save in output[]*/
	input_count = 0;
	while(scanf("%d", &input) != EOF)
	{
		prime_count = 0;
		if(input >= 2)
		{
			prime_count++;
		}
		for(cnt = 3; cnt <= input; cnt += 2)
		{
			if(is_prime2(cnt))
			{
				//printf("%d ", cnt);
				prime_count++;
			}
		}
		output[input_count] = prime_count;
		input_count++;
	}
	
	/*print output[]*/
	for(cnt = 0; cnt < input_count; cnt++)
	{
		printf("%d\n", output[cnt]);
	}

	
    return 0;
}

int is_prime1(int prime1_input)
{
	int prime1_cnt;
	
	if(prime1_input == 1)
	{
		return 0;
	}
	else if(prime1_input == 2 || prime1_input == 3 || prime1_input == 5 || prime1_input == 7)
	{
		return 1;
	}

	for(prime1_cnt = 3 ; prime1_cnt <= (sqrt(prime1_input)); prime1_cnt += 2)
	{
		if(prime1_input % prime1_cnt == 0)
		{
			return 0;
		}
	}
	
	return 1;
}

int is_prime2(int prime2_input)
{
	
	int prime2_cnt = 0;
	//printf("%d: ", prime2_input);
	for( ;prime2_cnt <168; prime2_cnt++)
	{
		//printf("%d %d\n", prime2_cnt, prime[prime2_cnt]);
		if(prime[prime2_cnt] > sqrt(prime2_input))
		{
			//printf("1\n");
			//printf("%d %d\n", prime2_cnt, prime[prime2_cnt]);
			break;
		}
		if(prime2_input % prime[prime2_cnt] == 0)
		{
			//printf("2\n");
			return 0;
		}
		//printf("%d ", prime[prime2_cnt]);
		//printf("3\n");
		//printf("LOOP\n");
	}
	return 1;
}

Measured memory_bytes: 592
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include<bits/stdc++.h>
//#include "job.h"
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define mkp make_pair
#define in insert
#define er erase
#define fd find
#define fr first
#define sc second
typedef long long ll;
typedef long double ld;
const ll INF=0x3f3f3f3f3f3f3f3f;
const ll llinf=(1LL<<62);
const int inf=(1<<30);
const int nmax=2e5+50;
const int mod=1e9+7;
using namespace std;
int n,i,x,y,v[nmax],q;
vector<int>a[nmax];
void dfs(int x,int p)
{
	v[x]+=v[p];
	for(int i=0;i<a[x].size();i++)
	{
		int y=a[x][i];
		if(y==p)continue;
		dfs(y,x);
	}
}
int main()
{
	//freopen("sol.in","r",stdin);
	//freopen("sol.out","w",stdout);
	//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
	cin>>n>>q;
	for(i=1;i<n;i++)
	{
		cin>>x>>y;
		a[x].pb(y);
		a[y].pb(x);
	}
	while(q--)
	{
		cin>>x>>y;
		v[x]+=y;
	}
	dfs(1,0);
	for(i=1;i<=n;i++)cout<<v[i]<<" ";
	cout<<endl;
    return 0;
}

Measured memory_bytes: 23552
#include<bits/stdc++.h>
#define rep(i,x,y) for (int i=(x);i<=(y);i++)

using namespace std;

const int N=510;
int n,b[N*N];
struct node{int x,i;}a[N];

const bool cmp(node x,node y){return x.x<y.x;}

int main(){
	scanf("%d",&n);
	rep (i,1,n) scanf("%d",&a[i].x),a[i].i=i;
	sort(a+1,a+1+n,cmp);
	rep (i,1,n){
		int tmp=a[i].i-1;
		rep (j,1,a[i].x-1){
			if (!tmp) break;
			if (!b[j]) b[j]=a[i].i,tmp--;
		}
		if (tmp) return puts("No"),0;
		b[a[i].x]=a[i].i;
	}
	for (int i=n;i;i--){
		int tmp=n-a[i].i;
		rep (j,a[i].x+1,n*n){
			if (!tmp) break;
			if (!b[j]) b[j]=a[i].i,tmp--;
		}
		if (tmp) return puts("No"),0;
	}
	puts("Yes");
	rep (i,1,n*n) printf("%d ",b[i]);
	return 0;
}

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

int main(){
    LL k,x;
    cin >> k >> x;

    for(LL i = max((LL)-1000000,x - k + 1); i <= min((LL)1000000,x + k - 1); ++i){
        cout << i << " ";
    }

    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)






int main() {
	int A, B, C;
	cin >> A >> B >> C;
	cout <<min(C,B/A) << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF = 1LL << 60;

//auto mod int

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){} //初期化指定子
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator++() {
      if ((x++) >= mod) x-= mod;
      return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator--() {
      if ((x += mod-1) >= mod) x-= mod;
      return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

int main(){
    int n,k;
    cin >> n >> k;
    map<int,mint> mp;
    mint ans = 0;
    for(int i=k; i>=1; i--){
        mint now = k / i;
        now = now.pow(n);
        for(int j=2*i; j<=k; j+=i){
            now -= mp[j];
        }
        mp[i] = now;
        ans += now * i;
    }

    cout << ans.x << endl;

    return 0;
}

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


namespace ConsoleApp15
{
    class Class2
    {
        static void Main()
        {
            var NP = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = NP[0], P = NP[1];
            var A = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int odd = A.Count(x => x % 2 == 1);
            int even = A.Count(x => x % 2 == 0);
            long ans;

            if (P == 0)
            {
                if (odd == 0) odd = 1;
                ans = (long)Math.Pow(2, odd - 1) * (long)Math.Pow(2, even);
            }
            else
            {
                if (odd == 0) ans = 0;
                else
                {
                    ans = (long)Math.Pow(2, odd - 1) * (long)Math.Pow(2, even);
                }
            }
            Console.WriteLine(ans);
        }
        
    }
}


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

int N, c[509][509];

void dfs(vector<int>v, int dep) {
	for (int i = 0; i < v.size() / 2; i++) {
		for (int j = v.size() / 2; j < v.size(); j++) {
			c[v[i]][v[j]] = dep;
		}
	}
	if (v.size() == 1) return;

	vector<int>v1; for (int i = 0; i < v.size() / 2; i++) v1.push_back(v[i]);
	vector<int>v2; for (int i = v.size() / 2; i < v.size(); i++) v2.push_back(v[i]);
	dfs(v1, dep + 1);
	dfs(v2, dep + 1);
}

int main() {
	cin >> N;
	vector<int>E; for (int i = 0; i < N; i++) E.push_back(i);
	dfs(E, 1);
	for (int i = 0; i < N - 1; i++) {
		for (int j = i + 1; j < N; j++) { if (j - i >= 2) cout << " "; cout << c[i][j]; }
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1536
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<complex>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF (long long)1000000000
#define MOD 1000000007
#define EPS (long double) 1e-8
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};

int main(void) {
	while(1) {
		int r, w, c, g;
		cin>>r>>w>>c>>g;
		if(r == 0 && w == 0 && c == 0 && g == 0) break;
		int res = 0;
		if(r < w * c) res = (w * c - r - EPS) / g + 1;
		cout<<res<<endl;
	}
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1e9 + 7;
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); }
template<class T>
istream& operator >> (istream& is, vector<T>& v)
{
	for (auto &i : v) is >> i;
	return is;
}
template<class T>
ostream& operator<<(ostream& os, vector<T>& v)
{
	const string delimiter = "\n";
	REP(i, v.size())
	{
		os << v[i];
		if (i != v.size() - 1) os << delimiter;
	}
	return os;
}
/*--------------------template--------------------*/

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	ll n; cin >> n;
	ll ans = 1e9;
	FOR(i, 1, 1e5 + 1)
	{
		if (n % i == 0)
		{
			ll a = to_string(i).size();
			ll b = to_string(n / i).size();
			chmin(ans, max(a, b));
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
//競技プログラミング用のテンプレート
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <math.h>

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

using namespace std;
using ll = long long int;
using p = pair<int, int>;
using pl = pair<ll, ll>;
using v = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vl = vector<ll>;

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

int main()
{
    ll x;
    cin >> x;
    while(!isPrime(x)) x++;
    cout << x << endl;
}

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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl





using ll = long long;


const int maxn = 1e6 + 5;
const int inf = 1e9;

int n, q;
int rowbit[maxn], colbit[maxn];

int qry(int *bit, int i) {
    int res=0;
    for (; i; i-=i&-i) {
	res=max(res,bit[i]);
    }
    return res;
}

void upd(int *bit, int i, int val) {
    for (; i<=n; i+=i&-i) {
	bit[i]=max(bit[i],val);
    }
}

int getfirst(int *bit, int bound) {
    int lo=0;
    int hi=n;
    while (hi-lo>1) {
	int mid=(lo+hi)/2;
	if (qry(bit,mid) >= bound) {
	    hi = mid;
	} else {
	    lo = mid;
	}
    }
    return hi;
}

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

    cin>>n>>q;

    ll black = 1ll*(n-2)*(n-2);

    upd(rowbit,n,n);
    upd(colbit,n,n);


    for (int z=1; z<=q; z++) {
	int type;
	cin>>type;
	if (type==1) {
	    int col; cin>>col;
	    int rblock = getfirst(rowbit, col);
	    int cur = rblock-1;
	    black -= (cur-1);
	    upd(colbit, col, cur);

	    //cout<<z<<": "<<cur<<endl;
	} else {
	    int row; cin>>row;
	    int cblock = getfirst(colbit, row);
	    int cur = cblock-1;
	    black -= (cur-1);
	    upd(rowbit, row, cur);

	    //cout<<z<<": "<<cur<<endl;
	}
    }


    cout<<black<<endl;    
    return 0;
}


Measured memory_bytes: 5180
#include <iostream>
#include <bitset>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <regex>
using namespace std;
using ll = long long int;
using dd = long double;
const ll MOD = 1e9 + 7;

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

int main()
{
    ll N;
    cin >> N;
    cout << 2 * N / gcd(2, N) << endl;
}

Measured memory_bytes: 256
/*Alohomora*/
#include<bits/stdc++.h>
#define ll         long long
#define fl(i,n)    for(i=0;i<n;i++)
#define fld(i,a,b) for(i=a;i>b;i--)
#define fli(i,a,n) for(i=a;i<n;i++)
#define inp(i,a,n) for(i=0;i<n;i++) {cin>>a[i];}
#define op(i,a,n)  for(i=0;i<n;i++) {cout<<a[i]<<" ";}
#define pb         push_back
#define mp         make_pair
#define mod1       100000000000007
#define speedup    ios_base::sync_with_stdio(false),cin.tie(0)
using namespace std;
ll fact(ll n){ if(n==0){return 1;}return (n*fact(n-1))%mod1;}
ll power(ll x, ll y)
{
    ll temp;
    if( y == 0)
        return 1;
    temp = power(x, y/2);
    if (y%2 == 0)
        return temp*temp;
    else
        return x*temp*temp;
}
ll gcd(ll a,ll b){if(b==0){return a;}gcd(b,a%b);}
ll a[2000000];
void sieve(){ll i,j;fli(i,2,1000001){if(a[i]==0){for(j=i*i;j<1000001;j+=i){a[j]=1;}}}}
map<ll,vector<ll> >m1;
vector<ll>v1;
bool compar(const pair<ll,ll> &a, const pair<ll,ll> &b) 
{ 
    return (a.second < b.second);
} 
ll level[1000000];
vector<ll>root;
set<ll>s1;
void factorise(long long n) 
{ 
    while (!(n%2)) 
    { 
        n >>= 1; 
        s1.insert(2);
    } 
    for (long long i=3; i<=sqrt(n); i+=2) 
    { 
        while (n%i==0) 
        { 
        	s1.insert(i);
            n=n/i; 
        } 
    } 
  	if (n>2) 
  	{
       s1.insert(n);
	}
} 

void comp()
{
	ll a,b,c,d,e,i;
	cin>>a>>b;
	fl(i,a-1)
	{
		cout<<b-a+i+1<<" ";
	}
	cout<<b<<" ";
	fl(i,a-1)
	{
		cout<<b+1+i<<" ";
	}
}	 
int main()
{
	speedup;
	ll i=0,t;
	ll n;
	//cin>>t;
	t=1;
	while(t--)
	{
	 comp();
	}
}

Measured memory_bytes: 2304
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
namespace mp = boost::multiprecision;
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = 1; i <= n; i++)
#define drep(i, n) for(int i = n-1; i >= 0; i--)
#define srep(i, s, t) for (int i = s; i < t; i++)
#define vi vector<int>
#define P pair<ll, ll>
int mod = 1'000'000'000 + 7;
struct edge {
    int to;
    ll cost;
};

void COME_LET_THE_GAMES_BEGIN() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(20);
}

int main() {
    COME_LET_THE_GAMES_BEGIN();
    int N, M;
    cin >> N >> M;
    int L = 1, R = N;
    for (int i = 0; i < M; i++) {
        int l, r;
        cin >> l >> r;
        L = max(L, l);
        R = min(R, r);
    }
    cout << max(0, R - L + 1) << endl;
}

Measured memory_bytes: 256
//Jai Bhole Ki
#include <bits/stdc++.h>
using namespace std;
#define fast static int fastline = []() { std::ios::sync_with_stdio(false); cin.tie(NULL); return 0; }();
#define ll long long
#define LL unsigned ll
#define pb push_back
#define pi pair<ll,ll>
#define debug(x) cout<<x<<"\n";
#define debug cout<<"debugged\n";
#define minval -2e9
#define maxval 2e9
long double PI =3.14159265358979323846;
 
const ll M=1e9+7;
const ll inf=1e18;
const ll ms=2e5+5;
fast;
double ans;
ll n;
void solve()
{
    cin>>n; vector<pair<double,double>> a(n);
    vector<ll>b(n);
    for(int i=0;i<n;i++)
        {cin>>a[i].first>>a[i].second;b[i]=i;}
        
    do{
        double des=0;
        for(int i=1;i<n;i++)
        {
            des+=pow(pow((a[b[i-1]].first-a[b[i]].first),2)+pow((a[b[i-1]].second-a[b[i]].second),2),0.5);
        }
        ans+=des;
    }while(next_permutation(b.begin(),b.end()));
    for(int i=2;i<=n;i++)
        ans/=i;
    cout<<fixed<<setprecision(12)<<ans<<endl;
}

int main()
{
 // freopen("input.txt","r",stdin);
//  freopen("output.txt","w",stdout);
   // int t;cin>>t;while(t--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
	int n , m;
	cin >> n >> m;
	priority_queue<int>q;
	for(int i=0;i<n;i++){
		int x;
		cin >> x;
		q.push(x);
	}
	for(int i=0;i<m;i++){
		int t = q.top();
		q.pop();
		t = t/2;
		q.push(t);
	}
	int ans =  0;
	while(!q.empty()){
		int t = q.top();
		q.pop();
		ans += t;
	}
	cout << ans<< '\n';
}

Measured memory_bytes: 1400
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n,m=nii()

mod=10**9+7

dp=[-1 for i in range(n+1)]
dp[0]=1
dp[1]=1
for i in range(m):
  a=int(input())
  dp[a]=0

for i in range(2,n+1):
  if dp[i]==0:
    continue
  num=dp[i-2]+dp[i-1]
  num%=mod
  dp[i]=num

print(dp[-1])

Measured memory_bytes: 12924
#define _CRT_SECURE_NO_WARNINGS
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<functional>
#include<iomanip>
#include<iostream>
#include<list>
#include<map>
#include<queue>
#include<random>
#include<set>
#include<stack>
#include<string>
#include<utility>
#include<vector>

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

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll>pll;

int main() {
	ll N, K, a[1010], S[1010] = { 0 };

	cin >> N >> K;
	REP(i, N) {
		cin >> a[i];
	}

	REP(i, N) {
		S[i + 1] = S[i] + a[i];
	}

	vector<ll> vec;
	REP(i, N) {
		FOR(j, i + 1, N + 1) {
			vec.push_back(S[j] - S[i]);
		}
	}

	ll ans = 0;
	pair<ll, vector<ll>> p;
	REP(i, 51) {
		p.first = 0;
		p.second.clear();
		ll x = powl(2LL, 50LL - (ll)i);
		REP(j, vec.size()) {
			if (vec[j] >= x) {
				p.first++;
				p.second.push_back(vec[j] & (x - 1));
			}
			vec[j] &= (x - 1);
		}
		if (p.first >= K) {
			ans += x;
			vec.clear();
			vec.resize(p.second.size());
			copy(p.second.begin(), p.second.end(), vec.begin());
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 6384
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;
constexpr long long INF = std::numeric_limits<LL>::max();
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Mfor(i,mf) for(LL i=mf-1;i>=0;i--)
LL h, w, n, m, k, t, s, q, last, cnt, sum[2000000], ans, dp[5000][5000], a[2000000],b[2000000];
string str;
bool f;
char c;
int di[4][2] = { { 0,1 },{ 1,0 },{ -1,0 } ,{ 0,-1 } };
struct Edge { LL from, cost; };
vector<Edge>vec[1000000];
vector<Pll>v;
map<string, LL>ma;
set<LL>st;
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}
int main() {
	cin >> n ;
	rep(i, n) {
		cin >> a[i];
		if(i)
			if (a[i] == a[i - 1]) {
				a[i] = 0;
				ans++;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 29440
N=int(input())
T,A=map(int,input().split())
s=12000
p=0
H=list(input().split())
for i in range(N):
    H[i]=int(H[i])
    t=abs(A-(T-H[i]*0.006))
    if s>t:
        s=t
        p=i+1
print(p)


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

int main(){
    string O,E;
    cin >> O >> E;
    if(O.size()==E.size()){
        for(int i=0;i<O.size();i++){
            cout << O[i] << E[i];
        }
        cout << endl;
    }
    else{
        for(int i=0;i<E.size();i++){
            cout << O[i] << E[i];
        }
        cout << O[O.size()-1] << endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void) {
	int data[4] = {6000,4000,3000,2000},t,n;
	for (int i = 1; i <= 4; i++) {
		scanf("%d%d", &t, &n);
		printf("%d\n",data[t-1]*n);
	}
	return 0;
}


Measured memory_bytes: 2048
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#define ci cin
#define co cout
#define ed endl
#define vc vector
#define sr string
#define pb push_back
#define st(a,n) sort(a,a+n)
#define ms(a) memset(a,0,sizeof(a))
#define fr(i,k,n) for(int i=k;i<=n;++i)
#define FR(i,n,k) for(int i=n;i>=k;--i)
#define inf 0x3f3f3f3f
#define mod 10000019
#define maxn 1000
#define exp 1e-6
typedef long long ll;
using namespace std;
int main()
{
    int a[3];
    fr(i,1,3)
    ci>>a[i];
    st(a+1,3);
    if(a[1]==5 and a[2]==5 and a[3]==7) co<<"YES"<<ed;
    else co<<"NO"<<ed;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main (void){
 char s[201]="\0";
 int n,i,w=0,m=0,h=0;
 scanf("%d",&n);
 scanf("%s",s);
 for(i=0;i<n;i++){
  if(w){
   if(s[i]=='('){
    h++;
   }else{
    h--;
    if(!h)
     w--;
   }
  }else{
   if(s[i]=='('){
    w++;
    h++;
   }else{
    m++;
   }
  }
 }
 if(m){
  n+=m;
  for(i=n-1;i>=m;i--)
   s[i]=s[i-m];
  for(i=0;i<m;i++)
   s[i]='(';
 }
 if(h){
  for(i=n;i<n+h;i++)
   s[i]=')';
 }
 s[n+h]='\0';
 printf("%s\n",s);
}


Measured memory_bytes: 128
#include<stdio.h>
int main(){
  double x,y,a,b,c,d,e,f;
  
  while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){
    
    y=(a*f-d*c)/(a*e-d*b);
    x=(c-b*y)/a;
    
    printf("%.3f %.3f\n",x,y);
    
  }
  
  return 0;
}

Measured memory_bytes: 652
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <cmath>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

typedef long long ll;
typedef long long int llt;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

int main(void){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int n = s.length();
    cout << s[0] << n - 2 << s[n - 1] << endl;
    return 0;
}

Measured memory_bytes: 256