akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
// using mP = pair<modint, modint>;

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




void solve() {
    ll A, B, N; cin >> A >> B >> N;

    ll tmp = (N/B)*B-1;
    if(B > N){
        cout << (A*N)/B - A*(N/B) << endl;
    }else{
        // cout << (A*(B-1))/B - A*((B-1/N)) << endl;
        cout << (A*tmp)/B - A*(tmp/B) << endl;
    }

    // cout << (A*tmp)/B - A*(tmp/B) << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 7760
# -*- coding: utf-8 -*-
"""
Created on Wed May 13 13:45:08 2020

@author: shinba
"""
import sys
n,m = map(int,input().split())

X = list(map(int,input().split()))

if n >= m:
    print(0)
    sys.exit()

sub = []
X.sort()

for i in range(m-1):
    sub.append(X[i+1]-X[i])

sub.sort()

for i in range(n-1):
    sub.pop()

print(sum(sub))



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

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

    map<ll, ll> a;
    rep(i, n){
        ll tmp;
        cin >> tmp;
        a[tmp]++;
    }

    ll ma = 0;
    ll ma_sec = 0;
    for(auto a_tmp: a){
        if(a_tmp.second >= 2){
            if(ma <= a_tmp.first){
                if(a_tmp.second >= 4){
                    ma_sec = a_tmp.first;
                }else{
                    ma_sec = ma;
                }
                ma = a_tmp.first;
            }else if(ma_sec <= a_tmp.first){
                ma_sec = a_tmp.first;
            }
        }
    }

    cout << ma * ma_sec << endl;
    return 0;
}


Measured memory_bytes: 6528
// atcoder/abc178/E/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;

constexpr array<int, 8> di({0, 1, -1, 0, 1, -1, 1, -1});
constexpr array<int, 8> dj({1, 0, 0, -1, 1, -1, -1, 1});
constexpr lli mod = 1e9 + 7;

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.setf(ios_base::fixed);
  cout.precision(15);

  int n;
  while (cin >> n) {
    vec<pair<int, int>> v(n);
    cin >> v;

    auto fn = [] (int x, int y, int d) {
      if (d == 0) return x - y;
      else return x + y;
    };
    const lli inf = 1LL << 60;
    lli z = -inf;
    for (int d = 0; d < 2; ++d) {
      lli mx = -inf;
      for (int i = 0; i < v.size(); ++i) {
        setmax<lli>(mx, fn(v[i].first, v[i].second, d));
      }
      lli mn = inf;
      for (int i = 0; i < v.size(); ++i) {
        setmin<lli>(mn, fn(v[i].first, v[i].second, d));
      }
      setmax(z, mx - mn);
    }
    cout << z << endl;
  }

  return 0;
}


Measured memory_bytes: 4780
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <iomanip>
#include <cassert>
#include <random>


int main() {
    int n; std::cin >> n;
    std::set<int> s;
    for (int i = 0; i < n; i++) {
        int a; std::cin >> a;
        if (s.count(a)) s.erase(a);
        else s.insert(a);
    }
    std::cout << s.size() << std::endl;
    return 0;
}


Measured memory_bytes: 4864
#include<iostream>
#include<string>
using namespace std;
int main(){
  int i;string s;bool ng = false;cin >> s;
  for (i=0;i<s.size();i++){
    if ((i%2==0 && s[i]=='L')||(i%2==1 && s[i]=='R')) ng = true;
  }
  cout << ((ng) ? "No":"Yes") << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int a,b,c,d,e,k;
int main(){
	cin>>a>>b>>c>>d>>e>>k;
	if(e-a>k)
		cout<<":(\n";
	else cout<<"Yay!\n";
	return 0;
}

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

// Shrotening
#define fst first
#define snd second
#define pb push_back

// Loop
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define RFOR(i,a,b) for(long i=(a);i>=(b);--i)

#define REP(i,a) for(long i=0;i<(a);++i)
#define RREP(i,a) for(long i=(a);i>=0;--i)

#define EACH(i,a) for(auto (i)=(a).begin(),_END=(a).end();i!=_END;++i)
#define REACH(i,a) for(auto (i)=(a).rbegin(),_END=(a).rend();i!=_END;++i)

//Algorithm
#define ALL(a) (a).begin(), a.end()
#define RALL(a) (a).rbegin(), a.rend()
#define EXIST(a,x) ((a).find(x)!=(a).end())
#define SORT(a) std::sort((a).begin(), (a).end())
#define UNIQUE(a) std::sort((a).begin(), a.end()), a.erase(std::unique((a).begin(), a.end()), a.end());
#define SUM(a) std::accumulate((a).begin(), (a).end(), 0);

//Setting
#define OPT std::cin.tie(0);std::ios::sync_with_stdio(false);

//debug message
bool debug = true;
#define MSG(s)   if(debug){std::cout << s << std::endl;}
#define DEBUG(x) if(debug){std::cout << "debug(" << #x << "): " << x << std::endl;}

//alias
typedef long long LL;
typedef std::vector<char> VC;
typedef std::vector<int>  VI;
typedef std::vector<long> VL;
typedef std::vector<long long> VLL;

typedef std::vector< VC > VC2;
typedef std::vector< VI > VI2;
typedef std::vector< VL > VL2;
typedef std::vector< VLL > VLL2;

typedef std::pair<int,int> PII;

int N;
int main() {
    std::cin >> N;
    int ans = 1e9;
    REP(i, N) {
        int A;
        std::cin >> A;

        std::bitset<32> bit(A);
        int j = 0;
        while(bit[j] == 0) j++;
        ans = std::min(ans, j);
    }
    std::cout << ans << std::endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>

namespace
{
	int a, b;
}

int main()
{

	while (std::scanf("%u", &a) != EOF)
	{
		std::scanf("%u", &b);
		std::printf("%u\n", (int)std::log10(a + b) + 1);
	}
	return 0;
}


Measured memory_bytes: 2916
#include <bits/stdc++.h>
#ifdef DBP
#define deb(...) fprintf(stderr,__VA_ARGS__)
#else
#define deb(...) 0
#endif
#define fst first
#define snd second
#define fore(x,a,b) for(int x=(a), qwerty=(b); x<qwerty; x++)
#define pb push_back
#define mset(a,v) memset((a),(v),sizeof(a))
#define ALL(a) (a).begin(), (a).end()
#define SZ(a) int((a).size())
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
typedef long long ll;

const int N=301;
int A[N],n;
double dp[N][N][N];

int main(){FIN;cout<<setprecision(12);
	cin >> n;
	fore(x,0,n)cin>>A[x];
	double nd=n;
	fore(c,0,n+1)fore(b,0,n+1)fore(a,0,n+1){
		if(a+b+c==0||a+b+c>n)continue;
		double s = a+b+c, &r=dp[a][b][c]=1;
		if(a)r+=dp[a-1][b][c]*(a/nd);
		if(b)r+=dp[a+1][b-1][c]*(b/nd);
		if(c)r+=dp[a][b+1][c-1]*(c/nd);
		r/=(1-(nd-s)/nd);
	}
	cout << dp[count(A,A+n,1)][count(A,A+n,2)][count(A,A+n,3)]<<"\n";
}

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

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;

vector<int> get_prime_numbers(int n){
    vector<int> table(n+1, 1);
    table[0] = 0;
    table[1] = 0;
    for (int i=0; i<=(int)sqrt(n); i++){
        if (table[i]){
            for (int j=2*i; j<=n; j+=i){
                table[j] = 0;
            }
        }
    }
    return table;
}

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

    vector<int> table = get_prime_numbers(55555);
    
    int cnt = 0;
    REP(i, 55556){
        if(table[i]==1 && i%10==1){
            cout << i << " ";
            cnt++;
            if(cnt==N){
                cout << endl;
                break;
            }
        }
    }

    return 0;
}

Measured memory_bytes: 3728
#include <bits/stdc++.h>
#define IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define S second
#define F first
#define ll long long
#define ld long double
#define u unsigned
#define pi 3.141592653589793238462643383279502884

using namespace std;

ll n, x[3005];
ll dp[3005][3005][3];
ll vis[3005][3005][3];

ll solve(int s, int e, bool temp)
{
    if(s>e)return 0;
    ll ans;
    if(vis[s][e][temp])return dp[s][e][temp];
    vis[s][e][temp] = 1;
    if(temp)
    {
        ans = min(solve(s, e-1, !temp)-x[e], solve(s+1, e, !temp)-x[s]);
    }
    else
    {
        ans = max(solve(s, e-1, !temp)+x[e], solve(s+1, e, !temp)+x[s]);
    }
    return dp[s][e][temp] = ans;
}

int main()
{
    cin>>n;
    for(int i = 0 ; i < n ; i++)
    {
        cin>>x[i];
    }
    cout<<solve(0, n-1, 0);
    return 0;
}


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

using ll = long long;
using vi = vector<int>;
using vi2 = vector<vector<int>>;
#define MP(a,b) make_pair((a),(b))
#define MT(...) make_tuple(__VA_ARGS__)

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define DCOUT(x,n) cout << fixed << setprecision(n) << (x) << endl;

#define sz(x) (int)(x).size()
#define HOGE cout << "hoge" << endl;
using P = pair<ll,ll>;

template<typename T>inline istream& operator>>(istream&i,vector<T>&v)
{REP(j,sz(v))i>>v[j];return i;}

const int INF = 1e9;

vector<pair<ll,ll>> pf(ll N){

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

        while (N % a == 0) {
            ex ++;
            N /= a;
        }

        res.push_back({a, ex});
    }

    if (N != 1) res.push_back({N, 1});
    return res;
}

int main() { 
	ll N;
	cin >> N;
	vector<pair<ll,ll>>pN  =pf(N);
	
	ll ans =0;
	REP(i,pN.size()){
		ll num = pN[i].second;
		REP(i,num+100){
			if(i*(i+1)/2 <= num && (i+2)*(i+1)/2 > num){
				ans += i;
				break;
			}
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <utility>
#include <numeric>
#include <iomanip>

using namespace std;

int main() {
    int n; cin >> n;
    vector<string> vec(n);
    for (int i = 0; i < n; i++)
    {
        cin >> vec[i];
        sort(vec[i].begin(), vec[i].end());
    }
    sort(vec.begin(), vec.end());

    long long int ans = 0;
    long long int i = 0;
    long long int j = 0;
    long long int k = 2;

    while (i < n-1)
    {
        j = i + 1;
        while (j < n && vec[i] == vec[j])
        {
            j++;
        }
        //cout << i << " " << j << endl;
        ans += (j - i) * (j - i - 1) / k;
        i = j;
    }
    
    cout << ans << endl;
    
}


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

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> PII;
typedef pair<ll, int> PILL;
typedef pair<ll, ll> PLL;

const int MAX_N = 1e5+5;
const int M = 1e6;
const ll INF = (ll)(1e18);
const int inf = 1e9;
const ll MOD = 1000000007LL;

void solve() {

}

int h, w;
string a[25];
int dp[25][25];
set<PII> vis;

void reset() {
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            dp[i][j] = inf;
        }
    }
}

bool ok(int x, int y) {
    if (x < 0 || x >= h) return false;
    if (y < 0 || y >= w) return false;
    if (vis.count({x, y})) return false;
    if (a[x][y] == '#') return false;

    return true;
}

void bfs(int x1, int y1) {
    vis.clear();
    queue<PII> q;
    q.push({x1, y1});
    vis.insert({x1, y1});

    while (!q.empty()) {
        int x = q.front().first;
        int y = q.front().second;
        q.pop();
        if (x == x1 && y == y1) dp[x][y] = 0;

        if (ok(x-1, y)) {
            q.push({x-1, y});
            dp[x-1][y] = min(dp[x-1][y], dp[x][y] + 1);
            vis.insert({x-1, y});
        }
        if (ok(x+1, y)) {
             q.push({x+1, y});
             dp[x+1][y] = min(dp[x+1][y], dp[x][y] + 1);
             vis.insert({x+1, y});
        }
        if (ok(x, y-1)) {
             q.push({x, y-1});
             dp[x][y-1] = min(dp[x][y-1], dp[x][y] + 1);
             vis.insert({x, y-1});
        }
        if (ok(x, y+1)) {
             q.push({x, y+1});
             dp[x][y+1] = min(dp[x][y+1], dp[x][y] + 1);
             vis.insert({x, y+1});
        }
    }
}


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

    cin >> h >> w;
    for (int i = 0; i < h; i++) {
        cin >> a[i];
    }

    int ans = 0;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (a[i][j] == '#') continue;
            reset();
            bfs(i, j);
            for (int k = 0; k < h; k++) {
                for (int l = 0; l < w; l++) {
                    if (dp[k][l] != inf) ans = max(ans, dp[k][l]);
                }
            }
        }
    }

    cout << ans;


    return 0;
}


Measured memory_bytes: 256
# coding: utf-8
# Your code here!
N,M = map(int,input().split())
S = list(map(int,input().split()))
T = list(map(int,input().split()))
LAST = 10**6
MOD = 10**9 + 7
S.append(LAST)
T.append(LAST)
total = [[0 for j in range(M+2)] for i in range(N+2)]
for i in range(N+1):
    for j in range(M+1):
        I,J = i+1,j+1
        if S[i] != T[j]:
            total[I][J] = (total[I][J-1] + total[I-1][J] - total[I-1][J-1]) % MOD
        else:
            total[I][J] = (total[I][J-1] + total[I-1][J] + 1) % MOD
        
print((total[N][M] + 1) % MOD)

Measured memory_bytes: 74460
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <utility>
#include <numeric>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

int main() {
    int N, M;
    cin >> N >> M;
    priority_queue<long long> A;
    for (int i = 0; i < N; ++i) {
        long long a;
        cin >> a;
        A.push(a);
    }

    while (M != 0) {
        long long top = A.top();
        A.pop();
        top /= 2;
        A.push(top);
        M--;
    }
    long long ans = 0;
    while (!A.empty()) {
        ans += A.top();
        A.pop();
    }

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


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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N,A,B;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>A>>B;
	ll ret=0;
	for(int i=1;i<=N;i++) {
		x=i,y=0;
		while(x) {
			y+=x%10;
			x/=10;
		}
		if(A<=y && y<=B) ret+=i;
	}
	cout<<ret<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 256
import math
import sys

def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []
    time = 0
    
    while True:
        prime = min(A)
        
        if prime > math.sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P

X = int(input())
for i in eratosthenes(100003):
    if i >= X:
        print(i)
        sys.exit()

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

int main(){
	char mark;
	int i,j,n;

	cin >> n;
	int a[4][13]={0};

	for(i=0;i<n;i++){
		cin >> mark >> j;
		switch(mark){
			case'S':a[0][j-1]=1;break;
			case'H':a[1][j-1]=1;break;
			case'C':a[2][j-1]=1;break;
			case'D':a[3][j-1]=1;break;
		}
	}

	for(i=0;i<4;i++){
		for(j=1;j<14;j++){
			if(a[i][j-1]==0){
				if(i==0)cout <<"S "<<j<<endl;
				if(i==1)cout <<"H "<<j<<endl;
				if(i==2)cout <<"C "<<j<<endl;
				if(i==3)cout <<"D "<<j<<endl;
			}
		}
	}
}

Measured memory_bytes: 3076
#include <bits/stdc++.h>
using namespace std;
#define start_routine cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false); int begtime = clock();
#define end_routine int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
#define contests_de_diya_kar 0
#define PB push_back
#define MP make_pair
#define int long long
#define MOD ((long long) (1000*1000*1000 + 7))
#define inf (int) 2e15
#define exit(a, b) return cout << a, b;
#define eps (double)1e-8
#define forn(a, b, i) for (int i = a; i < b; i += 1)
#define vi vector<int>
#define vb vector<bool>
#define all(v) v.begin(), v.end()
#define ll long long 
#define pii pair<int, int>
#define mii map<int, int> 
#define print(stuff) cout << stuff << endl
#define len(stuff) stuff.size()

const int MODULO = MOD;
int n;
bool vis[3][1001][4];
int dp[3][1001][4];
bool blocked[3][1001];

int rec (int row, int col, int type) {
	if (vis[row][col][type]) return dp[row][col][type];
	vis[row][col][type] = true;
	if (blocked[row][col]) {
		dp[row][col][type] = 0;
		return 0;
	}
	if (type == 0) {
		if (row >= 1) {
			if (col >= n - 1 && row != 2) {
				dp[row][col][type] = 0;
				return 0;
			}
			dp[row][col][type] += rec(row - 1, col, 2);
			dp[row][col][type] %= MODULO;
		}
	} 
	if (type == 1) {
		if (row <= 1) {
			if (col >= n - 1) {
				dp[row][col][type] = 0;
				return 0;
			}
			dp[row][col][type] += rec(row + 1, col, 3);
			dp[row][col][type] %= MODULO;
		}
	}
	if (type == 2) {
		if (col == 0 && row == 0) {
			dp[row][col][type] = 1;
			return dp[row][col][type];
		}
		if (col >= 1 && row < 2) {
			dp[row][col][type] += rec(row, col - 1, 0);
			dp[row][col][type] %= MODULO;
			dp[row][col][type] += rec(row, col - 1, 1);
			dp[row][col][type] %= MODULO;
		}
	}
	if (type == 3) {
		if (col >= 1 && row >= 1) {
			dp[row][col][type] += rec(row, col - 1, 0);
			dp[row][col][type] %= MODULO;
			dp[row][col][type] += rec(row, col - 1, 1);
			dp[row][col][type] %= MODULO;
		}
		else {
			dp[row][col][type] = 0;
			return dp[row][col][type];
		}
	}
}
signed main () {
	start_routine;
	
	#ifndef ONLINE_JUDGE
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#endif 

	vi divide[3];
	for (int i = 1; ; i += 1) {
		int j = i;
		int p = 0;
		while (j % 100 == 0) j /= 100, p += 1;

		if (p > 2) continue;
		divide[p].PB(i);
		if (len(divide[0]) >= 100 && len(divide[1]) >= 100 && len(divide[2]) >= 100) break;
	}

	int d, n;
	cin >> d >> n;

	n -= 1;
	cout << divide[d][n];
	end_routine;
}


Measured memory_bytes: 10604
N = int(input())
l = list(map(int,input().split()))
l = [0]+l+[0]
cost = 0
for a,b in zip(l,l[1:]):
    cost += abs(b-a)
for i in range(1,N+1):
    n = cost
    n-=abs(l[i-1]-l[i])
    n-=abs(l[i]-l[i+1])
    n+=abs(l[i-1]-l[i+1])
    print(n)


Measured memory_bytes: 14048
#include<bits/stdc++.h>
#define ll long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;

signed main(){
  fastio
  ll a,b,c,k;
  cin>>a>>b>>c>>k;
  ll ans=0;
  ans+=min(a,k);
  k-=min(a,k);
  k-=min(b,k);
  ans-=min(c,k);
  cout<<ans<<"\n";
  return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main()
{
	std::ios::sync_with_stdio(false);
	int a,b,c;
	cin>>a>>b>>c;
	int sum=(a*100+b*10+c);
	if(sum%4==0) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#include <bits/stdc++.h>
using namespace std;

#define INIT std::cin.tie(0);std::ios::sync_with_stdio(false);
#define ALL(c) (c).begin(), (c).end()
#define CALL(c) (c).cbegin(), (c).cend()
#define RALL(c) (c).rbegin(), (c).rend()
#define CRALL(c) (c).crbegin(), (c).crend()
#define REP(i, n) for (int i = 0; i < static_cast<int>(n); i++)
#define FOR(i, s, n) for (int i = s; i < static_cast<int>(n); i++)
#define ASC(t) [](t& x, t& y){ return x < y; }
#define DESC(t) [](t& x, t& y){ return x > y; }
#define PSORT(s,p,e) partial_sort((s), next((s), (p)), (e))
#define VIEW(v,t) for_each((v).begin(), (v).end(), [](t& a) { cout << a << " "; }); cout << endl;

#define IN(a, x, b) (a<=x && x<=b)
template<class T> inline T CHMAX(T& x, const T y){return x=(x<y)?y:x;}
template<class T> inline T CHMIN(T& x, const T y){return x=(x>y)?y:x;}
#define OUT(dist) std::cout<<(dist);
#define WS std::cout<<" ";
#define NL std::cout<<"\n"

using PII = pair<int, int>;
using PLL = pair<long long, long long>;
using LL = long long;
using ULL = unsigned long long;
template<class T> using V = vector<T>;
template<class T> using V2 = vector<vector<T>>;
template<class T, int W=255> using A = array<T, W>;
template<class T, int W=255, int H=255> using A2 = array<array<T, W>, W>;



int main(){
    INIT;
    int n; cin >> n;
    if(n % 10 == 9 || n / 10 == 9) cout << "Yes";
    else cout << "No";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define pb push_back
#define mpr make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ll long long
#define ld long double
#define all(arr) arr.begin(), arr.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, l, r) for (int i = l; i <= r; i++)
#define INF 1000000001
#define inf1 1000000000000000001
#define mod 1000000007
#define pie 3.14159265358979323846264338327950L
#define N 100005
#define mid(l, r) l + (r - l) / 2
#define vec vector<int>
#define vecl vector<ll>
#define umap unordered_map<ll,ll>
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define endl "\n"
using namespace std;

int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}



    
void test_case() {

    
  int r;
  cin>>r;

  cout<<2*pie*r<<endl;





    

}


int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout<<fixed<<setprecision(20);

    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);


    int t = 1;
    // cin >> t;
    while (t--)
    {
        test_case();
    }
}

Measured memory_bytes: 3792
package main

import (
	"fmt"
)

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

	ans := 0
	for i := 1; i*i < n; i++ {
		if (n-i)%i == 0 {
			div := (n - i) / i
			if n/div == n%div {
				ans += div
			}
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define pb push_back
#define ppb pop_back
#define fi first
#define se second
#define mid ((x + y) / 2)
#define left (ind * 2)
#define right (ind * 2 + 1)
#define mp make_pair
#define timer ((double)clock() / CLOCKS_PER_SEC)
#define endl "\n"
#define spc " "
#define d1(x) cerr<<#x<<":"<<x<<endl
#define d2(x, y) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<endl
#define d3(x, y, z) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl
#define fast_io() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;

typedef long long int lli;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<double, double> dd;

const int N = (int)(1e6 + 5);
const int LOG = (int)(20);

lli n, a[N], b[N], atl, ans;

int main() {
	fast_io();
	// freopen("inp.in", "r", stdin);
	
	cin >> n;
	for(int i = 1; i <= n; i++)
		cin >> a[i] >> b[i];

	lli atl = 0;
	for(int i = n; i >= 1; i--) {
		b[i] *= ceil((double)(a[i] + atl) / b[i]);
		ans += b[i] - a[i] - atl;
		atl = b[i] - a[i];
	}
	cout << ans;
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
#define ALL(a) a.begin(), a.end()
#define fi first
#define se second
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B;
string S;
const ll MOD = 998244353;
//const ll MOD = (1e+9) + 7;
const ll INF = 1LL<<60;
typedef pair<ll, ll> P;

int main() {
    cin>>N>>M;
    vec a(N);
    rep(i,N) cin>>a[i];
    ll sum = 0;
    rep(i,N) sum += a[i];
    sort(ALL(a));
    reverse(ALL(a));
    cout<<(4 * M * a[M - 1] >= sum ? "Yes" : "No")<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define for(i,a,b) for(int i=a;i<=b;i++)
#define _inline __inline__ __attribute__((always_inline))
#define ll long long
using namespace std;
_inline void read(ll &x){
	ll res=0,f=1;
	char c=getchar();
	if(c=='-') f=-1;
	while(c>'9'||c<'0') c=getchar();
	while(c>='0'&&c<='9'){
		res=res*10+c-'0';
		c=getchar();
	}
	x=res*f;
}
inline void print(ll x){
    if(x<0) putchar('-'),x=-x;
    if(x>9) print(x/10);
    putchar(x%10+'0');
}
ll n,m,h=0;
int main(){
    read(n),read(m);
    print(min(n,m/2)+max(m-n*2,h)/4);
    exit(0);
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  double sum = 0;
  for(int i=0;i<N;i++){
    double b;
    string c;
    cin>>b>>c;
    if(c=="JPY"){
       sum+=b;
    }
    else{
      b*=380000;
      sum+=b;
    }
  }
  cout<<sum<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
signed main() {
	int n, m;
	cin >> n >> m;
	int a[n][3], Cmp[8][3] = {{1, 1, 1}, {1, 1, -1}, {1, -1, 1}, {1, -1, -1}, { -1, 1, 1}, { -1, -1, 1}, { -1, 1, -1}, { -1, -1, -1}};
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < 3; j++) {
			cin >> a[i][j];
		}
	}
	int Ans = -1;
	for (int i = 0; i < 8; i++) {
		vector<int> vec;
		for (int j = 0; j < n; j++) {
			int Sum = 0;
			for (int k = 0; k < 3; k++) {
				Sum += a[j][k] * Cmp[i][k];
			}
			vec.push_back(Sum);
		}
		sort(vec.begin(), vec.end(), greater<int>());
		int Tmp = 0;
		for (int i = 0; i < m; i++) {
			Tmp += vec[i];
		}
		Ans = max(Ans, Tmp);
	}
	cout << Ans << endl;
	return 0;
}

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

i = 0
x = 1
while n > 0:
  x *= 26
  i += 1
  n -= x

if n == 0:
  print('z' * i)
  exit()
ls = [chr(i) for i in range(97, 97+26)]
ans = ''
n = n + x - 1
x = int(x / 26)
while x >= 1:
  j = n // x
  n = n % x
  x = int(x/26)
  ans += ls[j]
  
print(ans)


Measured memory_bytes: 9196
#include <bits/stdc++.h>
using namespace std;
#define Hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define ll long long
int main()
{
    Hello
    int a;
    string s;
    cin >> a >> s;
    if(a >= 3200)
        cout << s;
    else
        cout << "red";
    return 0;
}


Measured memory_bytes: 3572
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>


using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i,a,b) for(int i = (a); i < (int)(b); ++i)
#define ALL(c) (c).begin(), (c).end()
#define SIZE(v) ((int)v.size())

#define pb push_back
#define mp make_pair
#define mt make_tuple

class UnionFind
{
public:
    UnionFind(){};
    ~UnionFind(){};
    void init(int num_entries) {
        num_entries_ = num_entries;
        par_.resize(num_entries_);
        rank_.resize(num_entries_, 0);
        REP(i, num_entries_) par_[i] = i;
    }
    int find(int x) {
        if (par_[x] == x) return x;
        else return par_[x] = find(par_[x]);
    }
    void unite(int x, int y) {
        x = find(x); y = find(y);
        if (x == y) return;
        if (rank_[x] < rank_[y]) par_[x] = y;
        else {
            par_[y] = x;
            if (rank_[x] == rank_[y]) rank_[x]++;
        }
    }
    bool same(int x, int y) { return find(x) == find(y); }
private:
    int num_entries_;
    std::vector<int> par_;
    std::vector<int> rank_;
};

int main(void)
{
    cin.sync_with_stdio(false);
    int N, M;
    cin >> N >> M;

    vector<int> Ps(N);
    REP(n, N) {
        int p;
        cin >> p;
        Ps[n] = p-1;
    }

    UnionFind uf;
    uf.init(N);

    REP(m, M) {
        int x, y; cin >> x >> y;
        --x; --y;
        uf.unite(x, y);
    }

    vector<int> used(N);
    vector<set<int>> groups(N);
    REP(n, N) {
        auto id = uf.find(n);
        groups[id].insert(n);
    }
    int ans = 0;
    REP(n, N) {
        if (!used[n]) {
            auto id = uf.find(n);
            auto members = groups[id];
            for(auto m: members) {
                auto val = Ps[m];
                if (members.count(val)) {
                    ++ans;
                }
                used[m] = 1;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 15872
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	long n,k=0,r=0;
	cin>>n;
	long a[n],b[n];
	for(int i=0;i<n;i++)cin>>a[i];
	sort(a,a+n);
	if(n==2)cout<<a[1]-a[0];
	else{
		for(int i=0;i<n-1;i++){
			b[i]=a[i+1]-a[i];
		}
		sort(b,b+n-1);
	if(n%2==0){
	for(int i=0;i<n;i++){
		k+=2*a[i];
	}
	for(int i=0;i<n/2;i++){
		k-=4*a[i];
	}
	k-=a[n/2]-a[n/2-1];
	cout<<k<<endl;
	}
	else{
		for(int i=0;i<n;i++){
			r+=2*a[i];
		}
		for(int i=0;i<n/2+1;i++){
			r-=4*a[i];
		}
		r+=2*a[n/2];
		r-=(min(a[n/2]-a[n/2-1],a[n/2+1]-a[n/2]));
		cout<<r<<endl;
	}
	}
	return 0;
}

Measured memory_bytes: 1792
from sys import stdin

N,A,B = [int(x) for x in stdin.readline().rstrip().split()]
# A,B = [int(x) for x in stdin.readline().rstrip().split()]
# U = stdin.readline().rstrip().split()
#print(S)
if N%(A+B)==0:
    print(A*int(N/(A+B)))
else:
    temp1=int(N/(A+B))
    temp=N-(temp1*(A+B))
    if temp<A:
        print(temp1*A+temp)
    else:
        print(temp1*A+A)

Measured memory_bytes: 3064
#define _CRT_SECURE_NO_WARNINGS
#define y1 klfjvkldfngldf

#pragma comment(linker, "/STACK:400000000")

#include <iostream>
#include <fstream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <bitset>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <complex>
#include <functional>
#include <numeric>
#include <random>
#include <memory.h>
#include <time.h>

using namespace std;

typedef long long LL;

int main()
{
	int n, c, k;
	cin >> n >> c >> k;
	vector<int> t(n);
	for (int i = 0; i < n; ++i)
		cin >> t[i];
	sort(t.begin(), t.end());

	int res = 1;
	int first = t[0] + k;
	int have = c - 1;
	for (int i = 1; i < n; ++i)
	{
		if (have == 0 || first < t[i])
		{
			res++;
			have = c - 1;
			first = t[i] + k;
		}
		else
			have--;
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    string s;
    cin >> s;
    int rcnt = 0, bcnt = 0;
    
    rep(i, n) {
        if (s[i] == 'R') {
            rcnt++;
        }
        else {
            bcnt++;
        }
    }
    
    cout << ((rcnt > bcnt) ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <iomanip>

#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue

using namespace std;
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
const int inf = 1e9;
const ll linf = 1LL << 50;

int main(int argc, char const* argv[])
{
	ll x, a, b;
	cin >> x >> a >> b;
	if(-a + b <= 0)cout << "delicious";
	else if(-a+b <= x)cout << "safe";
	else cout << "dangerous";
	cout << endl;
	return 0;
}


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

using namespace std;

int main() {
    int n;
    int a[101];
    int alice = 0;
    int bob = 0;
    int turn = 1;
    cin >> n;
    for(int i = 0; i < n; i ++){
        cin >> a[i];
    }
    sort(a,a+n);
    for(int i = n-1; i >= 0; i --){
        if(turn == 1){
            alice += a[i];
            turn = 2;
        }else{
            bob += a[i];
            turn = 1;
        }
    }

    cout << alice - bob;
    return 0;
}

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

#ifdef LOCAL
#include "../../dump.hpp"
#else
#define dump(...)
#endif

#define int ll
#define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(int i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(int i=(a)-1,i##_cond=(b);i>=i##_cond;--i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define sz(x) ((int)(x).size())
#define pb push_back
#define fst first
#define snd second
#define mp make_pair
using ll  = long long;
using vi  = vector<int>;
using vvi = vector<vi>;
using vs  = vector<string>;
using pii = pair<int,int>;
constexpr ll inf = 1ll<<61;
constexpr ll mod = 1e9+7;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>void add(T &a, const T &b){a += b; a %= mod;}

// rank無しなのでlog n
class UnionFind{
public:
  vi data;

  UnionFind(int size){
    data.resize(size,-1);
  }

  bool unite(int x,int y){
    x = root(x);
    y = root(y);
    if(x != y){
      if(data[y] < data[x]) swap(x,y);
      data[x] += data[y];
      data[y] = x;
    }
    return x != y;
  }

  bool find(int x, int y){
    return root(x) == root(y);
  }

  int root(int x){ // どの集合か
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }

  int size(int x){
    return -data[root(x)];
  }

  void print(){
    cout << "i :\t";
    rep(i, data.size()) cout << i << "\t";
    cout << endl;
    cout << "data :\t";
    rep(i, data.size()) cout << root(i) << "\t";
    cout << endl;
  }
};

signed main(){
  int h, w; cin >> h >> w;
  vs s(h); rep(i,h) cin >> s[i];
  UnionFind tate(h*w), yoko(h*w);
  rep(i,h) rep(j,w){
    if(s[i][j] == '#') continue;
    if(0 < i and s[i-1][j] == '.')
      tate.unite((i-1)*w+j,i*w+j);
    if(0 < j and s[i][j-1] == '.')
      yoko.unite(i*w+j-1,i*w+j);
  }
  int ans = 0;
  rep(i,h) rep(j,w){ // (i,j) においたとき
    int tmpa = i*w+j;
    dump(i,j);
    int tmpb = tate.size(tmpa) + yoko.size(tmpa) - 1;
    dump(tmpb);
    ans = max(ans, tmpb);
  }
  cout << ans << endl;
}


Measured memory_bytes: 66944
import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Char

main :: IO ()
main = readContents 2 >>= print . solve

solve :: [[Int]] -> Int
solve [[n, k], ds] = head $ filter ff [(max n $ 10 ^ e)..(10 ^ (e + 2))]
    where
        e = truncate . logBase 10 $ fromIntegral n
        ff = all (`notElem` ds) . map (read . (: [])) . show


readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine

Measured memory_bytes: 892
import java.io.*;
import java.util.*;

public class Main {


    public static void main(String[] args) throws Exception {

        FastReader fs = new FastReader();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = fs.nextInt();
      HashSet<String> set = new HashSet<>();
      for(int i=0 ; i<n ; i++){
        set.add(fs.next());
      }
      out.println(set.size());
      

        out.close();

    }

    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;

    //-----------MyScanner class for faster input----------
    public static 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;
        }

    }
    //--------------------------------------------------------
}


Measured memory_bytes: 62968
#include <iostream>
//#include <cmath>
using namespace std;
int main(void){
    
    int x,a=0;
    cin>>x;
    a=x%7;
    
    if(a==0){
        cout<<"thu"<<endl;
    }
    else if(a==1){
        cout<<"fri"<<endl;
    }
    else if(a==2){
        cout<<"sat"<<endl;
    }
    else if(a==3){
        cout<<"sun"<<endl;
    }
    else if(a==4){
        cout<<"mon"<<endl;
    }
    else if(a==5){
        cout<<"tue"<<endl;
    }
    else if(a==6){
        cout<<"wed"<<endl;
    }
  
  
}



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

struct Pt {
	double x;
	double y;
};

int main() {
	ios_base::sync_with_stdio( false );
	cout << fixed << setprecision( 10 );

	int N;
	cin >> N;

	vector<Pt> pt( N );
	for( auto& v: pt ) { cin >> v.x >> v.y; }
	vector<int> idx( N );
	for( int i = 0; i < N; ++i ) { idx[i] = i; }

	int cnt = 0;
	double d = 0;

	do {
		for( int i = 1; i < N; ++i ) {
			double x = pt[idx[i]].x - pt[idx[i-1]].x;
			double y = pt[idx[i]].y - pt[idx[i-1]].y;
			d += sqrt( x*x + y*y );
		}

		cnt += 1;
	} while( next_permutation( idx.begin(), idx.end() ) );

	cout << d/cnt << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int n,a,b,ca,x[101],t=0,c=0,st;
  double cp;
  cin >> n >> a >> b >> ca;

  for(int i=0;i<n;i++){
    cin>>x[i];
  }
  for(int i=0;i<n;i++){
    for(int j=1;j<n;j++){
      if(x[j-1]<x[j]){
        st=x[j-1];
	x[j-1]=x[j];
	x[j]=st;
      }
    }
  }
  t+=a;
  c+=ca;
  for(int i=0;i<n;i++){
    cp=(double)c/t;
    if((double)x[i]/b>=cp){
      t+=b;
      c+=x[i];
    }
    else break;
  }
  cout << (int)cp << endl;
  return 0;
}

Measured memory_bytes: 1160
s = list(map(int, list(input())))
k = int(input())
ans = 1

if len(s) <= k:
    for i in s:
        if i != 1:
            ans = i
            break
else:
    for i in range(0,k):
        if s[i] != 1:
            ans = s[i]
            break

print(ans)


Measured memory_bytes: 9128
/******************************************
* AUTHOR : SOMU KUMAR *
* INSTITUTION : IIT BHUBANESWAR *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100005
#define MOD 1000000007
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
//code here...............//
int s;
cin>>s;
ll dp1[s+1];
memset(dp1,0,sizeof(dp1));
for(int i=3;i<=s;i++){
	for(int j=3;j<=s;j++){
		if(i-j==0)dp1[i]=(dp1[i]+1)%MOD;
		else if(i-j>0)dp1[i]=(dp1[i]+dp1[i-j])%MOD;
	}
}
cout<<(dp1[s])%MOD<<endl; 
return 0;
}

Measured memory_bytes: 3604
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define MOD 1000000007
using namespace std;

typedef pair<int, int> P;
typedef pair<long long, long long> LLP;

int main() {

    int N;
    cin >> N;

    cout << N * N * N << endl;

    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
template<class T> bool INRANGE(T x,T a,T b) { return a<=x&&x<=b; }
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;


typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

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


    int N, W;
    cin >> N >> W;

    int a[N][2];
    REP(i,N) cin >> a[i][0] >> a[i][1];

    const long long INF = 1LL << 30;
    long long dp[N+1][W+1];
    REP(i,N+1)REP(j,W+1)  dp[i][j] = -INF;
    REP(i,W+1) dp[0][i] = 0;

    REP(i,N)REP(w,W+1){
        chmax(dp[i+1][w],dp[i][w]);
        if (w>=a[i][0]) chmax(dp[i+1][w],dp[i][w-a[i][0]]+a[i][1]);
    }

//    REP(i,N+1){
//        REP(j,W+1){
//            cout << dp[i][j] << " ";
//        }
//        cout << endl;
//    }

    cout << dp[N][W] << endl;

    return 0;
}

Measured memory_bytes: 79232
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define rep(i, n) FOR(i, 0, n - 1)
using namespace std;
typedef long long ll;
template <class T> inline bool dpmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool dpmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

void solve(string S) {
    ll ans = 0;
    ll n = S.size(), nB = 0;

    rep(i, n) {
        if (S[i] == 'B') {
            nB++;
        } else {
            ans += nB;
        }
    }

    cout << ans << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips:
// You use the default template now. You can remove this line by using your
// custom template)
int main() {
  string S;
  cin >> S;
  solve(S);
  return 0;
}


Measured memory_bytes: 3864
#include<bits/stdc++.h>
using namespace std;
const int nmax=100005;
// union-find
int par[nmax],siz[nmax];
void init(int x){
    for(int i=0;i<x;i++){
        par[i]=i;
        siz[i]=1;
    }
}
int root(int x){
    if(par[x]==x){
        return x;
    }
    return par[x]=root(par[x]);
}
void unite(int x,int y){
    x=root(x);
    y=root(y);
    if(x==y){
        return ;
    }
    par[y]=x;
    siz[x]+=siz[y];
}
int main(){
    int n,m,k;cin >> n >> m >> k;
    init(n);
    vector<int> a(m),b(m),c(k),d(k);
    vector<int> h(n);
    for(int i=0;i<m;i++){
        cin >> a[i] >> b[i];
        a[i]--,b[i]--;
        unite(a[i],b[i]);
        h[a[i]]++,h[b[i]]++;
    }
    vector<int> ans(n);
    for(int i=0;i<n;i++){
        ans[i]=siz[root(i)]-h[i]-1;
    }
    for(int i=0;i<k;i++){
        cin >> c[i] >> d[i];
        c[i]--,d[i]--;
        if(root(c[i])==root(d[i])){
            ans[c[i]]--;
            ans[d[i]]--;
        }
    }
    for(int i=0;i<n;i++){
        cout << ans[i] << " ";
    }
    cout << endl;
}

Measured memory_bytes: 4608
#include <bits/stdc++.h>
#define DUMP(x)  cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define IFOR(i, m, n) for(int i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
const ll INF = 1e18;
/* テンプレートここまで */

int main() {
  string s; cin >> s;
  sort(ALL(s));
  if(s[0] == s[1] && s[2] == s[3] && s[1] != s[2]){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}


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

int main(){
    
   
    long long int N,K;

    cin >> N >> K;

    if(N%K==0){

        cout << 0 << endl;

    }else{
        
        N=N%K;

        if( K-N > N){
            cout << N<< endl;
        }else{
            cout << K-N << endl;
        }

    }

}


Measured memory_bytes: 256