akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;
#define loop(i,a,b) for(int i=(a); i<int(b); i++)
#define rep(i,b) loop(i,0,b)
#define iter(it,c) for(auto it=c.begin(); it!=c.end(); ++it)
#define all(c) (c).begin(), (c).end()

typedef vector<string> vs;
typedef unsigned uint;

string s;
int p;

#define cur s[p]

bool equ();
bool formula();

bool equ(){
    bool l=formula();
    p++; // =
    bool r=formula();
    // cout << l << " " << r << endl;
    return l==r;
}

bool formula(){
    bool res;
    if(cur=='T'){
        p++; // T
        res = true;
    }
    else if(cur=='F'){
        p++; // F
        res = false;
    }
    else if(cur=='-'){
        p++; // -
        res = !formula();
    } else {
        p++; // (
        bool l=formula();

        char op=cur;

        p++; // +,*,-
        if(op=='-') p++; // >

        bool r = formula();

        if(op=='*') res = l&r;
        if(op=='+') res = l|r;
        if(op=='-') res = (!l)|r;

        p++; // )
    }
    return res;
}

inline bool solve(vs const& v){
    bool res = true;
    rep(i,v.size()){
        s=v[i];
        p=0;
        // cout << s << endl;
        if(!equ()){
            res = false;
            break;
        }
    }
    return res;
}

int main(){
    string s;
    while(cin>>s && s!="#"){
        vs ss(1<<11);
        rep(i,1<<11){
            string t=s;
            rep(j,t.size()){
                if(t[j]=='T' || t[j]=='F') continue;
                if(isalpha(t[j])) t[j] = "TF"[(i>>(t[j]-'a')&1)];
            }
            ss[i] = t;
        }
        sort(all(ss));
        ss.erase(unique(all(ss)),ss.end());
        bool id = solve(ss);
        if(id) cout << "YES";
        else cout << "NO";
        cout << endl;
    }
}

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

int main () {
  string n;
  cin >> n; 
  
  if (n.at(0) == '1') cout << 9;
  else cout << 1;
  if (n.at(1) == '1') cout << 9;
  else cout << 1;
  if (n.at(2) == '1') cout << 9 << endl;
  else cout << 1 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define pb              push_back
#define ppb             pop_back
#define endl            '\n'
#define mii             map<ll,ll>
#define pii             pair<ll,ll>
#define vi              vector<ll>
#define vs              vector<string>
#define all(a)          (a).begin(),(a).end()
#define F               first
#define S               second
#define sz(x)           ((ll)x.size())
#define hell            (1000000007)
#define inf             ((ll)5e18 + 5)
#define PI              ((double)3.14159265358979323844)
#define DECIMAL(n)      cout << fixed << setprecision(n);
#define rep(i,a,b)      for (ll i=a;i<b;i++)
#define repr(i,a,b)     for (ll i=a-1;i>=b;i--)
#define bitcount(a)     (ll)__builtin_popcount(a)
#define lbnd            lower_bound
#define ubnd            upper_bound
#define mp              make_pair
#define ios             ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ordered_set     tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define trace(...)      __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}

using namespace std;
using namespace __gnu_pbds;

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

//primes for hashing 937,991,1013,1409,1741

void solve() {
    ll a, b, c, d;
    cin>>a>>b>>c>>d;
    ll temp=-inf;
    if ((a<=0 && b>=0) || (c<=0 && d>=0) ) temp=0;
    cout<<max(a*c, max(a*d, max(b*c, max(temp, b*d))))<<endl;
}

signed main() {
    ios
    ll test=1;
    //cin>>test;
    while (test--) solve();
    return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define INF 100000000000000 //10^14 100兆
// aよりもbが大きいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T& b) {
  if (a < b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T& b) {
  if (a > b) {
    a = b;  // aをbで更新
    return true;
  }
  return false;
}

int main() {
	unsigned long long X;
	cin >> X;
	unsigned long long c = 0;
	unsigned long long m = 100;
	while (true) {
		if (m >= X) {
			cout << c << endl;
			return 0;
		}
		c++;
		m += m / 100;
	}
}

Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(c) c.begin(),c.end()
#define PB push_back

using namespace std;
typedef long long ll;

int main()
{
  int N;
  cin >> N;
  vector<int> a(N);
  REP(i, N) cin >> a[i];
  sort(ALL(a));
  a.PB(-1);

  int ans = 0, cnt = 1;
  REP(i, N) {
    if (a[i] != a[i + 1]) {
      if (cnt < a[i]) ans += cnt;
      else ans += cnt - a[i];
      cnt = 1;
    } else {
      cnt++;
    }
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n, k) for (int i = n; i < k; i++)
#define P(p) cout << (p) << endl;
#define sP(p) cout << setprecision(15) << fixed << p << endl;
#define vi vector<int>
#define printv(v)                      \
    for (int i = 0; i < v.size(); i++) \
        P(v[i]);
#define printt(a, b) cout << a << " " << b << endl;
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int dx8[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int MOD = 1e9 + 7;

void solve()
{
    int v[3][3];
    rep(i, 3) rep(j, 3)
    {
        int c;
        cin >> c;
        v[i][j] = c;
    }
    int a[3], b[3];
    a[0] = 0;
    a[1] = v[1][0] - v[0][0];
    a[2] = v[2][0] - v[0][0];
    b[0] = v[0][0];
    b[1] = v[0][1];
    b[2] = v[0][2];
    int ans[3][3];
    rep(i, 3) rep(j, 3)
    {
        ans[i][j] = a[i] + b[j];
    }

    bool flag = true;
    rep(i, 3) rep(j, 3)
    {
        if (v[i][j] != ans[i][j])
        {
            flag = false;
        }
    }
    P(flag ? "Yes" : "No");
}

int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<tuple>
#include<set>
#include<stack>
#include<map>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
using ll = int128_t;

// O(N^.5)
/// --- phi {{{ ///
ll phi(ll n) {
  ll res = n;
  for(ll i = 2; i * i <= n; i++) {
    if(n % i == 0) {
      // res = res / i * (i - 1);
      res = res / i * (i - 1);
      while(n % i == 0) n /= i;
    }
  }
  if(n != 1) res = res / n * (n - 1);
  return res;
}
/// }}}--- ///

/// --- math {{{ ///
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll extgcd(ll a, ll b, ll &x, ll &y) {
  ll d;
  return b == 0 ? (x = 1, y = 0, a)
    : (d = extgcd(b, a % b, y, x), y -= a / b * x, d);
}
ll modinv(ll a, ll mod = (ll) 1e9 + 7) {
  ll x = 0, y = 0;
  extgcd(a, mod, x, y);
  return (x + mod) % mod;
}
ll modpow(ll a, ll b, ll mod = (ll) 1e9 + 7) {
  ll r = 1;
  a %= mod;
  while(b) {
    if(b & 1) r = r * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return r;
}
/// }}}--- ///

const ll F = 35; // >= log_2 MAX_M
ll solve(ll a, ll m) {
  if(m == 1) return F;
  ll phiM = phi(m);
  ll x = solve(a, phiM);
  ll l = phiM * m; // lcm(phiM, m) is accepted
  ll r = modpow(a, x, l); // l is 64bit , not 32bit
  while(r < F) r += l;
  return r;
}

int main() {
  std::ios::sync_with_stdio(false), std::cin.tie(0);
  int q;
  cin >> q;
  while(q--) {
    ll a, m;
    cin >> a >> m;
    ll ans = solve(a, m);
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
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;
}

const long double EPS = 1e-10;
const long long INF = 1e18;
const long double PI = acos(-1.0L);
//const ll mod = 1000000007;
vector<vector<vector<int>>> dp;

void initialize() {
    dp.push_back(vector<vector<int>>());
    dp[0].push_back({1});
    for(int h = 1; h <= 10; h++) {
        dp.push_back(vector<vector<int>>());
        for(int i = 0; i < dp[h-1].size(); i++) {
            dp[h].push_back({});
            for(auto val : dp[h-1][i]) {
                dp[h].back().push_back(val);
                dp[h].back().push_back(val);
            }
            dp[h].push_back({});
            for(auto val : dp[h-1][i]) {
                dp[h].back().push_back(val);
                dp[h].back().push_back(val ^ 1);
            }
        }
    }
}

void print(int idx) {
    for(auto tmp : dp[idx]) {
        for(auto tmp2 : tmp) {
            cerr << tmp2 << " ";
        }
        cerr << endl;
    }
    cerr << "end: " << idx << endl;
}

bool SWAP = false;
vector<vector<int>> ans;

void printans() {
    if(!SWAP) {
        for(auto tmp : ans) {
            for(int i = 0; i < tmp.size(); i++) {
                cout << tmp[i];
            }
            cout << endl;
        }
        /*
        cout << endl;
        for(int h = 0; h < ans.size(); h++) {
            int now = 0;
            cout << now;
            for(int w = 0; w < ans[0].size(); w++) {
                now ^= ans[h][w];
                cout << now;
            }
            cout << endl;
        }
        */
        return;
    }
    for(int i = 0; i < ans[0].size(); i++) {
        for(int j = 0; j < ans.size(); j++) {
            cout << ans[j][i];
        }
        cout << endl;
    }
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    initialize();
    int N, M;
    cin >> N >> M;
    int H = pow(2, N) - 1;
    int W = pow(2, M) - 1;
    print(0);
    print(1);
    print(2);
    print(3);
    if(H > W) {
        swap(H, W);
        swap(N, M);
        SWAP = true;
    }
    ans = vector<vector<int>>(H, vector<int>(W));
    /*
    for(int h = 0; h < (H + 1) / 2; h++) {
        for(int w = 0; w < W; w++) {
            if(dp[M][h][w] != dp[M][h][w+1]) ans[h][w] = 1;
        }
    }
    for(int h = (H + 1) / 2; h < H; h++) {
        ans[h] = ans[H-1-h];
    }
    */
    for(int h = 0; h < H; h++) {
        for(int w = 0; w < W; w++) {
            ans[h][w] = dp[M][h+1][w+1] ^ dp[M][h+1][w] ^ dp[M][h][w+1] ^ dp[M][h][w];
        }
    }
    /*
    for(int h = 0; h < H; h++) {
        int now = 0;
        cout << now;
        for(int w = 0; w < W; w++) {
            now ^= ans[h][w];
            cout << " " << now;
        }
        cout << endl;
    }
    */
    printans();
    return 0;
}

Measured memory_bytes: 11008
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
void solve();
main { solve(); return 0; }
// clang-format on

double f(double x, double q) {
  return x - (x * x * x - q) / (3 * x * x);
}

void solve() {
  double q;
  while (cin >> q, q != -1) {
    double x = f(q / 2, q);
    while (abs(x * x * x - q) >= 0.00001 * q) {
      x = f(x, q);
    }
    cout << prec(8) << x << endl;
  }
}

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


long long yoko(long long H, long long W){
	if(H%3 == 0){
		return 0;
	}else{
		return W;
	}
}

long long yokotate(long long H, long long W){
	long long h1, h2;
	if(H%2 == 0){
		h1 = H/2;
		h2 = H/2;
	}else{
		h1 = H/2;
		h2 = H/2 + 1;
	}

	long long ret = INT_MAX;
	for(long long w = 1; w < W; w++){
		long long dim1, dim2, dim3;
		long long diff1, diff2, diff3;
		dim1 = h1 * w;
		dim2 = h2 * w;
		dim3 = H * (W - w);
		ret = min(ret, max(dim1, max(dim2, dim3)) - min(dim1, min(dim2, dim3)));
	}
	return ret;
}



int main(){
	long long H, W;
	cin >> H >> W;
	long long ret = INT_MAX;
	ret = min(ret, yoko(H, W));
	ret = min(ret, yoko(W, H));
	ret = min(ret, yokotate(H, W));
	ret = min(ret, yokotate(W, H));
	cout << ret << endl;
}


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

#define M 1046527
#define NIL (-1)
#define L 14

char H[M][L];

// 文字から数値に変換
int getChar(char ch) {
    if (ch=='A') return 1;
    else if(ch=='C') return 2;
    else if(ch=='G') return 3;
    else if(ch=='T') return 4;
    else return 0;
}

// 文字列から数値へ変換してkeyを生成する
long long getKey(char str[]) {
    long long sum=0, p=1, i;
    for (i=0; i<strlen(str); i++) {
        sum += p*getChar(str[i]);
        p *= 5;
    }
    return sum;
}

int h1(int key) { return key % M; }
int h2(int key) { return (key%(M)); }

int find(char str[]) {
    long long key, i, h;
    key = getKey(str);
    for (i=0; ; i++) {
        h = (h1(key) + i+h2(key)) % M;
        if( strcmp(H[h], str) == 0) return 1;
        else if( strlen(H[h]) == 0) return 0;
    }
    return 0;
}

int insert(char str[]) {
    long long key, i, h;
    key = getKey(str);
    for (i=0; ; i++) {
        h = (h1(key) + i+h2(key)) % M;
        if( strcmp(H[h], str) == 0) return 1;
        else if( strlen(H[h]) == 0) {
            strcpy(H[h], str);
            return 0;
        }
    }
    return 0;
}

int main() {
    int i, n, h;
    char str[L], com[9];
    for (i=0; i<M; i++) H[i][0] = '\0';
    scanf("%d", &n);
    for(i=0; i<n; i++) {
        scanf("%s %s", com, str);
        
        if(com[0] == 'i') {
            insert(str);
        } else {
            if(find(str)) {
                printf("yes\n");
            }else{
                printf("no\n");
            }
        }
    }
    return 0;
}


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

#define int long long
typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int N, M, K;
int p3[1000000];
int fact[1000000];

int modpow(int x, int k) {
  int a = 1;
  while (k > 0) {
    if (k & 1) a = (1LL*a*x) % MOD;
    x = (1LL*x*x) % MOD;
    k >>= 1;
  }
  return a;
}

int inv(int x) {
  return modpow(x, MOD-2);
}

int nCr(int n, int k) {
  if (n < 0 || k < 0 || n < k) return 0;
  return (1LL * fact[n] * inv((1LL*fact[k]*fact[n-k]) % MOD)) % MOD;
}

signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N >> M >> K;
  if (M > K) swap(M, K);
  p3[0] = 1, fact[0] = 1;
  for (int i=1; i<=N+M+K; i++) {
    p3[i] = (3LL*p3[i-1]) % MOD;
    fact[i] = (1LL*i*fact[i-1]) % MOD;
  }
  int s = 0, lt = 0;
  for (int i=M+K; i>=0; i--) {
    int u = M+K-i;
    int l = max(0LL, u-M), r = min(u, K);
    int t = 0;
    if (i == M+K) t = 1;
    else {
      t = (2LL*lt - nCr(u-1, r) - nCr(u-1, l-1) + 2LL*MOD) % MOD;
    }
    s = (s + 1LL*((1LL*p3[i]*t)%MOD)*nCr(N+M+K-i-1, N-1)) % MOD;
    lt = t;
  }
  cout << s << "\n";
  return 0;
}


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


 int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;

  if (n % 2 == 1) {
    puts("No");
    return 0;
  }

  string t = s.substr(0, n / 2);
  if (t + t == s)
    puts("Yes");
  else
    puts("No");
  return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <string>
using namespace std;
int main(void){
    string N;
    cin>>N;
    // cout<<N<<endl;
    long a=0;
    for(long i = 0; i < size(N); i++){
        a+=(N[i]-48);
        // cout<<N[i];
    }
    // cout<<endl<<a<<endl;
    if(a%9==0){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    return 0;
}

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

int main(){
  int k,n;
  cin>>k>>n;
  int a[200005],ma=0;
  rep(i,n) {
    cin>>a[i];
    if(i>0) ma=max(a[i]-a[i-1],ma);
  }
  ma=max(a[0]+k-a[n-1],ma);
  cout<<k-ma<<endl;
  return 0;
}

Measured memory_bytes: 1024
N = int(input())
if N%10 == 2 or N%10 == 4 or N%10 == 5 or N%10 == 7 or N%10 == 9:
    print("hon")
elif N%10 == 0 or N%10 == 1 or N%10 == 6 or N%10 == 8:
    print("pon")
else:
    print("bon")


Measured memory_bytes: 9172
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
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; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define FOR(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define ld long double
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
const long long dx[4]={1,0,-1,0};
const long long dy[4]={0,1,0,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int n,k; cin >> n >> k;
    int res=0;
    rep(i,n){
        int h; cin >> h;
        if(h>=k) res++;
    }
    cout<<res<<endl;
       
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
func init_for_competitive_programing() {
	sc.Split(bufio.ScanWords)
}
func nextInt() int {
	sc.Scan()
	i,e := strconv.Atoi(sc.Text())
	if e!=nil {
		panic(e)
	}
	return i
}

func nextString() string {
	sc.Scan()
	s := sc.Text()
	return s
}


func main(){
	init_for_competitive_programing()
	
	k := nextInt()
	s := nextString()
	
	var res string
	if len(s)>k {
		res = s[0:k] + "..."
	} else {
		res = s
	}
	fmt.Println(res)

}




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

int main()
{
  string s;
  cin >> s;
  vector<i64> ans(s.size());
  i64 sum = 0;
  for (i64 i = 0; i < s.size() - 1; i++)
    if (s[i] == 'R')
    {
      sum++;
      if (s[i + 1] == 'L')
      {
        ans[i + 1] += sum / 2;
        ans[i] += (sum + 1) / 2;
      }
    }
    else
      sum = 0;
  sum = 0;
  for (i64 i = s.size() - 1; 0 < i; i--)
    if (s[i] == 'L')
    {
      sum++;
      if (s[i - 1] == 'R')
      {
        ans[i - 1] += sum / 2;
        ans[i] += (sum + 1) / 2;
      }
    }
    else
      sum = 0;
  for (i64 i = 0; i < ans.size(); i++)
    cout << ans[i] << " ";
  cout << endl;
  return 0;
}


Measured memory_bytes: 1408
while 1:
  H, W = map(int, input().split())
  if H == 0 and W == 0: break
  for h in range(H):
    if h == 0:
      print("#" * W)
    elif h == H - 1:
      print("#" * W)
      print("")
    else:
      s = ""
      for w in range(W):
        if w == 0 or w == W - 1:
          s += "#"
        else:
          s += "."
      print(s)



Measured memory_bytes: 5616
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pr;
typedef vector<ll> vc;
#define pb push_back
#define rep(i,a,b) for(ll i=a;i<=b;i++)
#define repr(i,a,b) for(ll i=a;i>=b;i--)
#define reps(i,v) for(ll i=0;i<v.size();i++)
const ll mod = 1e9+7;
long long powmod(long long px, long long py, long long pmod){
	if(py == 0) return 1;
	if(py % 2 == 0) return powmod((px * px) % pmod, py / 2, pmod);
	else return (px * powmod(px, py - 1, pmod)) % pmod;
} 

int main() {
    // your code goes here
    ll n,k,dp[100005],ans=0;
    vc ps[100005];
    cin >> n >> k;
    rep(i,1,k){
        for(ll j=2;i*j<=k;j++){
            ps[i].pb(i*j);
        }
    }
    repr(i,k,1){
        dp[i]=powmod(k/i,n,mod);
        reps(j,ps[i]) dp[i]=(dp[i]+mod-dp[ps[i][j]])%mod;
    }
    rep(i,1,k) ans=(ans+i*dp[i]%mod)%mod;
    cout << ans << endl;
    return 0;
}

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

int main()
{
    string a,b,c;
    int ag,bg=0;
    cin >> a >> b >> c;
    ag=a.size()-1;
    bg=b.size()-1;
    
    if((a[ag]==b[0])&& (b[bg]==c[0]))
    {
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
using namespace std;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) long long((x).size())
#define OUT(x) cout << (x) << endl
typedef long long ll;

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int cnt = 1;
    char tmp = s[0];
    for (int i = 1; i < n; i++) {
        if (tmp != s[i]) {
            tmp = s[i];
            cnt++;
        }
    }
    OUT(cnt);
}


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

namespace ABC067A
{
    class Program
    {
        static void Main(string[] args)
        {
            int A, B;
            string[] vals = Console.ReadLine().Split(' ');

            A = int.Parse(vals[0]);
            B = int.Parse(vals[1]);

            if (A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0)
                Console.WriteLine("Possible");
            else
                Console.WriteLine("Impossible");


        }
    }
}

Measured memory_bytes: 13140
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>

#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)
using namespace std;
using ll = long long;

int main(){
	int x, y, z;
	cin >> x >> y >> z;

	int ans = (x - z) / (y + z);
	cout << ans << endl;


    return 0;
}


Measured memory_bytes: 256
def main():
    D, G = map(int, input().split())
    p = [0] * D
    c = [0] * D

    for i in range(D):
        p[i], c[i] = map(int, input().split())

    ans = float('inf')
    for i in range(1 << D):
        cnt = 0
        score = 0
        tmp = 0
        for j in range(D):
            if (i >> j) & 1:
                score += c[j] + 100 * (j + 1) * p[j]
                cnt += p[j]
            else:
                tmp = j
                
        if score < G:
            for k in range(1,p[tmp]):
                score += 100 * (tmp + 1)
                cnt += 1
                if score >= G:
                    break
        
        if score >= G:
            ans = min(ans,cnt)
    
    print(ans)


main()

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

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    if((a+b)>=c){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
     int a,b;
     scanf("%d %d",&a,&b);
     if(a>b){
       printf("a > b\n");
     }else if(a == b){
       printf("a == b\n");
     }else{
       printf("a < b\n");
     }
     return 0;
}

Measured memory_bytes: 2588
node = {}
readlines.map(&:chomp).each{|line|
  s, t = line.split.map(&:to_i)
  if s == 0 && t == 0
    if node[1] % 2 != node[2] % 2
      puts "NG"
    elsif
      node[1] % 2 == 0 && node[2] % 2 == 0
      puts "NG"
    else
      cnt = 0
      node.each{|h, k|
        cnt += 1 if k % 2 == 1
      }
      if cnt == 2
        puts "OK"
      else
        puts "NG"
      end
    end
    node = {}
    next
  end
  node[s] ||= 0
  node[t] ||= 0
  node[s] += 1
  node[t] += 1
}

Measured memory_bytes: 8760
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define REP(i,s,n) for(int i=s; i<(n); ++i)
#define ALL(n) begin(n),end(n)
using ll = long long;
const ll INF = 1e18;
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; }

int main(){
    int a;
    cin >> a;
    cout << int(a + a * a + a * a * a) << endl;

    return 0;
}


Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define ar array
#define mp make_pair
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	ll n,w;
	cin>>n>>w;
	ll w2 = w;
	ar<ll,2> a[n];
	for(int i = 0;i <n; i++)
		cin>>a[i][0]>>a[i][1];
	sort(a,a+n);
	vector<int > v[4];
	v[0].push_back(0);
	v[1].push_back(0);
	v[2].push_back(0);
	v[3].push_back(0);
	ll y = a[0][0],j=0;
	ar<ll,4> s={0,0,0,0};
	s[j]= y;
	vector<ll > g2;
	for(auto it:a)
	{
		if(y==it[0])
		{
			g2.push_back(it[1]);
			// v[j].push_back(v[j][v[j].size()-1]+it[1]);
		}
		else
		{
			sort(g2.begin(),g2.end(),greater<ll>());
			for(auto i = g2.begin(); i!=g2.end(); i++)
				v[j].push_back(v[j][v[j].size()-1]+(*i));
			// cout<<v[j].size()<<endl;
			g2.clear();
			j++;
			// v[j].push_back(v[j][v[j].size()-1]+it[1]);
			g2.push_back(it[1]);
			y = it[0];
			s[j]=y;
		}
	}
	sort(g2.begin(),g2.end(),greater<ll>());
	for(auto it:g2)
	{
		v[j].push_back(v[j][v[j].size()-1]+(it));
	}
	ll g = w/a[0][0],ans =0;
	for(ll i = 0 ;i<=min((ll)v[0].size()-1,g); i++)
	{
		ll y = v[0][i];
		ll w2 = i*(s[0]);
		if(w2<=w)
			ans = max(ans,y);
		if(s[1]>0)
		for(ll j2 = 0; j2<=min(w/(a[0][0]+1),(ll)v[1].size()-1); j2++)
		{
			ll y2 = v[1][j2];
			ll w3 = j2*(s[1]);
			if(w2+w3<=w)
				ans = max(ans,y+y2);
			if(s[2]>0)
			for(ll k = 0; k<=min(w/(a[0][0]+2),(ll)v[2].size()-1); k++)
			{
				ll y3 = v[2][k];
				ll w4 = k*(s[2]);
				if(w2+w3+w4<=w)
					ans = max(ans,y+y2+y3);
				// cout<<ans<<" "<<k<<" "<<j2<<" "<<i<<" "<<w2<<endl;
				if(s[3]>0)
				for(ll l = 0; l<=min(w/(a[0][0]+3),(ll)v[3].size()-1); l++)
				{
					ll y4 = v[3][l];
					ll w5 = l*(s[3]);
					if(w2+w3+w4+w5<=w)
						ans = max(ans,y+y2+y3+y4);
				}
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
  
 
int main()
{
    
    
	long long int n,cnt=0;
    cin>>n;
    if(n>=500)
    {
        cnt=cnt+((n/500)*1000);
        n=n%500;
    }
    if(n>=5)
    {
        cnt=cnt+((n/5)*5);
 
    }
    cout<<cnt<<endl;
		
		
}

Measured memory_bytes: 256
import java.util.*;

class Main{
	
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		
		String st = sc.next();

		int cnt = 0;
		for(int n=0;n<st.length();n++){
			if(st.charAt(n) == 'o') cnt++;
		}

		System.out.println(700 + cnt*100);
		

	}
}

Measured memory_bytes: 22228
#include<bits/stdc++.h>
using namespace std;
int main(){
  	int a,b,ans=0;
	cin >> a >> b;
  	if(a==1 && b ==1)ans+=400000;
  	ans += max(4-a, 0) * 100000;
  	ans += max(4-b, 0) * 100000;
    cout << ans;
    if(getchar()=='\n'&& getchar()=='\n') return 0;
}

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

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> l(N);
    for(int i=0; i<N; i++) cin>>l[i];
    sort(l.begin(), l.end(), greater<int>());

    int sum=0;
    for(int i=0; i<K; i++) sum+=l[i];

    cout<<sum<<endl;
}

Measured memory_bytes: 256
import sys
h,w = map(int,input().split())
S = [list(input()) for i in range(h)]
ans = []

dy_dx = [[1,0],[0,1],[-1,0],[0,-1]]

for i in range(h):
    for j in range(w):
        visit = [[0 for i in range(w)] for i in range(h)]
        pos = []
        if S[i][j] == '.':
            visit[i][j] = 1
            d = 0
            pos.append([i, j, 0])
            while len(pos) > 0:
                now = pos.pop(0)
                d = now[2]
                for k in range(4):
                    y = now[0]+dy_dx[k][0]
                    x = now[1]+dy_dx[k][1]
                    if 0 <= y < h and 0 <= x < w:
                        if S[y][x] != '#' and visit[y][x] == 0:
                            visit[y][x] = 1
                            pos.append([y, x, d + 1])
            ans.append(d)
                
print(max(ans))

Measured memory_bytes: 3064
#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;

typedef long long int ll;
 
//typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
 

 
const ll N = 200005;
const ll mod = 998244353;
const long long int inf = 10e17;
#define pp pair<ll,ll>

typedef long double ld;
typedef vector<pp> vpl;
#define MP make_pair
#define endl "\n"
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<n;i++)
#define rrep(i,n) for(ll i=n-1;i>=0;i--)
#define repb(i,n) for(ll i=1;i<n-1;i++) 
#define trace(i,a) for(auto i=a.begin();i!=a.end();i++) 
#define mtrace(i,a) for(auto i=a.begin();i!=a.end();i++)  cout<<i->first<<" "<<i->second<<endl;   
 
const ld pi = 3.14159265359;

mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}

 
void fastIO(void);
void decimal(int);
ll modmulti(ll, ll);
ll modadd(ll, ll);
ll modpower(ll, ll);
ll gcd(ll, ll );
ll modinv(ll);


int main()
{
	ll k,n;
	cin>>k>>n;
	ll a[n],b[n];
	rep(i,n) cin>>a[i];
	sort(a,a+n);
	ll mx = 0;
	rep1(i,n) mx = max(mx,a[i]-a[i-1]);
	mx = max(a[0]+k-a[n-1],mx);
	cout<<k-mx<<endl;
}

	


 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
void fastIO(void)
{  ios_base::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
}
 
void decimal(int n){
   cout<<fixed;
   cout<<setprecision(n);
}
ll modmulti(ll a, ll b){
   return ((a%mod)*1ll*(b%mod))%mod;
}
ll modadd(ll a, ll b){
   ll asdfgh =  ((a%mod)+(b%mod)+mod+mod)%mod;
   asdfgh = (asdfgh+mod)%mod;
   return asdfgh;
}
ll modpower(ll a, ll n){
   if(n==0) return 1;
   if(n==1) return a%mod;
   ll b = modpower(a,n/2);
   b = modmulti(b,b);
   if(n%2==0) return b;
   return modmulti(a,b);
}
ll gcd(ll a, ll b){
   if(b==0)
      return a;
   return gcd(b,a%b);
}
ll modinv(ll a){
   return modpower(a,mod-2);
}

Measured memory_bytes: 1792
#include<iostream>
using namespace std;
int main() {
	string s;
	cin >> s;
	string a;
	for (char c : s) {
		if (c != 'B') {
			a += c;
		}
		else if (!a.empty()) {
			a.pop_back();
		}
	}
	cout << a << endl;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using static kyoupuro.Input;
using static kyoupuro.MyMath;

namespace kyoupuro {

    class MainClass {
        
        public static void Main() {
            var A = NextInt();
            var B = NextInt();
            var X = NextInt();

            if(A <= X && X <= A + B) {
                Console.WriteLine("YES");
            } else {
                Console.WriteLine("NO");
            }
        }
    }

    class MyMath {
        static long Gcd(long a, long b) {
            return b == 0 ? a : Gcd(b, a % b);
        }
    }

    class Input {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line() {
            return Console.ReadLine();
        }

        public static int NextInt() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return int.Parse(enumerator.Current);
        }

        public static long NextLong() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return long.Parse(enumerator.Current);
        }

        public static string[] StrArr() {
            return Line().Split(' ');
        }

        public static List<int> IntList() {
            return StrArr().Select(int.Parse).ToList();
        }

        public static List<long> LongList() {
            return StrArr().Select(long.Parse).ToList();
        }

        public static void Skip(int line = 1) {
            enumerator.Reset();
            for (int i = 0; i < line; i++) Console.ReadLine();
        }

        public static void Reset() {
            enumerator.Reset();
        }
    }
}

Measured memory_bytes: 13268
H, N = map(int, input().split())
dp = [10 ** 9] * (H + 1)
dp[0] = 0
for _ in range(N):
    a, b = map(int, input().split())
    for i in range(H):
        idx = min(H, i + a)
        dp[idx] = min(dp[idx], dp[i] + b)
print(dp[H])



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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vdouble = vector<double>;
using vvdouble = vector<vdouble>;
using vvvdouble = vector<vvdouble>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;
constexpr int mod2 = 998244353;
template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return (a > b && (a = b, true)); }
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return (a < b && (a = b, true)); }

template<typename T>
vector<T> makeVector(size_t a, T b) { return (vector<T>(a, b)); }
template<typename... Ts>
auto makeVector(size_t a, Ts... ts) { 
	return (vector<decltype(makeVector(ts...))>(a, makeVector(ts...)));
}

template<typename T>
bool isin(T y, T x, T h, T w) { return (0 <= y && 0 <= x && y < h && x < w); }
template<typename T>
bool isin1(T y, T x, T h, T w) { return (0 < y && 0 < x && y <= h && x <= w); }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	os << v[0];
	for (int i = 1; i < v.size(); i++) os << " " << v[i];
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}


void Main() {
	ll L; cin >> L;
	ll size = 0;

	while ((1ll<<size) <= L) size++;
	
	vector<tuple<ll, ll, ll>> dats;
	int u = 1;
	while (L > 1) {
		dats.emplace_back(u, u+1, 0);
		dats.emplace_back(u, u+1, L/2);
		if (L&1) dats.emplace_back(u, size, L-1);
		u++;
		L >>= 1;
	}
	cout << size << " " << dats.size() << el;

	for (auto &d : dats) {
		ll a, b, c; tie(a, b, c) = d;
		cout << a << " " << b << " " << c << el;
	}
}

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


Measured memory_bytes: 3596
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	A, B := getInt(), getInt()
	if A == 1 {
		A = 14
	}
	if B == 1 {
		B = 14
	}

	if A > B {
		out("Alice")
	} else if A < B {
		out("Bob")
	} else {
		out("Draw")
	}
}


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

using static Input;
using static Util;
class Program
{
    static int N;
    static int M;
    static int[] H;
    static int[] A;
    static void INPUT()
    {
        N = NextInt();
        M = NextInt();
        H = LineInt();
        A = new int[N + 1];
        for (var m = 0; m < M; m++)
        {
            var a = NextInt();
            var b = NextInt();

            A[a] = Math.Max(A[a], H[b - 1]);
            A[b] = Math.Max(A[b], H[a - 1]);
        }
    }

    static void OUT()
    {
        var count = 0;
        for (var n = 1; n <= N; n++)
        {
            if (A[n] < H[n - 1]) count++;
        }
        Console.WriteLine(count);
    }
    static void Main(string[] args)
    {
#if DEBUG  
        TESTINPUT();
        //INPUT();

#else
        INPUT();
#endif
        OUT();
    }

    static void TESTINPUT()
    {
    }

}

public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}

class Util
{

}




Measured memory_bytes: 33600
from string import ascii_lowercase, ascii_uppercase
s = open(0).read()
ans = [0]*26
for c in s:
    i = ascii_lowercase.find(c)
    if i > -1:
        ans[i]+=1
    i = ascii_uppercase.find(c)
    if i > -1:
        ans[i]+=1

for c, t in zip(ascii_lowercase,ans):
    print("%s : %d"%(c,t))


Measured memory_bytes: 6684
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());

		String[] s = new String[n];
		for(int i = 0;i < n;i++) {
			s[i] = sc.nextLine();
		}

		System.out.println(Arrays.stream(s).distinct().count());
    }
}

Measured memory_bytes: 72948
#include <cstdio>
#include <algorithm>

using namespace std;

int main() {
  int i;
  long long N;
  scanf("%lld", &N);
  long long T[1010], A[1010];
  long long T_now = 1;
  long long A_now = 1;
  for (i = 0; i < N; i++) {
    scanf("%lld %lld", &T[i], &A[i]);
    long long t = T_now % T[i];
    long long a = A_now % A[i];
    long long Tnew1, Anew2;
    if (t == 0) {
      Tnew1 = T_now;
    } else {
      Tnew1 = T_now + (T[i] - t);
    }
    if (a == 0) {
      Anew2 = A_now;
    } else {
      Anew2 = A_now + (A[i] - a);
    }
    long long Tnew2 = (Anew2 / A[i]) * T[i];
    T_now = max(Tnew1, Tnew2);
    A_now = (T_now / T[i]) * A[i];
    //printf("%lld %lld", T_now, A_now);
  }
  printf("%lld", T_now + A_now);
  return 0;
}


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

const int MAX_N = 1e5 + 5;
lint N, A, B, H[MAX_N];

int main(){
    cin >> N >> A >> B;
    for(int i=0;i<N;i++) cin >> H[i];

    lint left = -1, right = 2e9, d = A - B;
    while(1<right-left){
        lint mid = (left+right) / 2, cnt = 0;
        for(int i=0;i<N;i++){
            if(mid*B<H[i]) cnt += (H[i]-mid*B+d-1) / d;
        }
        if(cnt>mid) left = mid;
        else right = mid;
    }

    cout << right << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef struct _data {
	int x;
	int y;
} data;

int  main()
{
	int n;
	cin >> n;
	vector<int> x(n);
	rep (i, n)
		cin >> x.at(i);
	sort(x.begin(), x.end());
	// int len = abs(x[0] - x.back()) / 2;
	// len  += x[0];
	int len = x.back();
	int sum = 0;
	int ans = INT_MAX;
	for (int j = len; j >= x[0]; j--)
	{
		sum = 0;
		rep(i, n)
		{
			sum += (x[i] - j) * (x[i] - j);
		}
		ans = min(ans, sum);
	}
	cout << ans << endl;;
	return (0);
}


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

using namespace std;

#define fi(n) for(int i=0;i<n;i++)
#define fj(n) for(int j=0;j<n;j++)
#define fr(n) for(int i=n-1;i>=0;i--)
#define chlo(i,a,n) for(int i=a;i<n;i++)
#define vi vector<int>
#define vs vector<string>
#define int long long int
#define all(a) (a).begin(),(a).end()
#define sortall(x) sort(all(x))
#define itr(a) for(auto it=a.begin();it!=a.end();it++)
#define pb push_back
#define setbits(x) __builtin_popcountll(x)
#define zerbits(x) __builtinctzll(x)
#define mod 1000000007
#define sz(x) (int)x.size()
#define inf 1e18
#define W(x) int x;cin>>x;while(x--)
#define ps(x,y) fixed<<setprecision(y)<<x
#define mp make_pair
#define INT_SIZE 32
#define pr pair<int,int>
#define deb(x) cout<<#x<<"="<<x<<endl;
#define F first
#define S second
#define pii pair<int,int>

int mpow(int exp, int base);
void aeh()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("aana.txt", "r", stdin);
	freopen("jj.txt", "w", stdout);
#endif
}
int32_t main()
{

	int n;
	cin >> n;
	vi dp(3);
	for (int i = 1; i <= n; i++)
	{
		vi new_dp(3);
		int a[3];
		fi(3)
		{
			cin >> a[i];
		}
		for (int i = 0; i < 3; i++)
		{
			for (int j = 0; j < 3; j++)
			{
				if (i != j)
				{
					new_dp[j] = max(new_dp[j], dp[i] + a[j]);
				}
			}
		}
		dp = new_dp;
	}
	cout << max({dp[0], dp[1], dp[2]}) << endl;
}


int mpow(int base, int exp)
{
	base %= mod;
	int result = 1;
	while (exp > 0)
	{
		if (exp & 1)result = (result * base) % mod;
		base = (base * base) % mod;
		exp >>= 1;
	}
	return result;
}

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

int main(){
    int N;
    cin >> N;
    int x[N];
    int y[N];
    for(int i =0; i < N; i++){
        cin >> x[i] >> y[i];
    }
    double sum = 0;
    vector<double> disitance;
    for(int i =0; i < N-1; i++){
        for(int j = i + 1; j < N; j++){
            double d = sqrt((x[i]-x[j])*(x[i]-x[j])+ (y[i]-y[j])*(y[i]-y[j]));
            disitance.push_back(d);
        }
    }
    sort(disitance.begin(), disitance.end());
    for(int i =0; i < disitance.size(); i++){
        sum += disitance.at(i);
    }
    cout << fixed << setprecision(10) << 2*sum/N << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
#include <functional>
using namespace std;
typedef long long ll;

#define fi first
#define se second
#define rep(i, n) for (ll i = 0; i < n; i++)
#define debugA cerr << "AAAAA" << endl
#define debug_ cerr << "-------------" << endl
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    cout << #v << endl;                \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;
#define debug_vec2(v)                         \
    cout << #v << endl;                       \
    for (int i = 0; i < v.size(); i++)        \
    {                                         \
        for (int j = 0; j < v[i].size(); j++) \
        {                                     \
            cout << v[i][j] << " ";           \
        }                                     \
        cout << endl;                         \
    }

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

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

using Graph = vector<vector<int>>;
using P = pair<int, int>;
using P1 = pair<int, pair<int, int>>; // クラスカル法とかで、{cost, {from, to}}的に使う。
const ll LINF = 1001002003004005006ll;
const ll INF = 1001001001;
const double pi = acos(-1);

int main()
{
    ll a, b;
    cin >> a >> b;
    ll c = __gcd(a, b);
    cout << a * b / c << endl;

    return 0;
}

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

int main() {
  int n, m;
  cin >> n >> m;

  int ans = n * (n - 1) / 2 + m * (m - 1) / 2;

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

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
typedef long long int ll;
using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define EFOR(i,a,b) for (int i=(a);i<=(b);i++)
const ll MOD = (10*10*10*10*10*10*10*10*10+7);

    char A,T;

int main(){
    scanf("%c %c",&A,&T);
    if(A=='H'){
        if(T=='H'){cout<<'H';}
        else{cout<<'D';}
    }else{
        if(T=='D'){cout<<'H';}
        else{cout<<'D';}
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256