akhauriyash/Code-Regression huggingface dataset:
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


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;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b) {
  return b ? GCD(b,a%b) : a;
}


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {

  ll n,w;cin>>n>>w;
  vector<ll> weight(n),value(n);
  rep(i,n) cin>>weight[i]>>value[i];
  ll dp[n+1][Svec(value)+1];
  rep(i,Svec(value)+1) dp[0][i]=1e11;
  dp[0][0]=0;
  rep(i,n){
    rep(j,Svec(value)+1){
      if(j>=value[i]) dp[i+1][j]=min(dp[i][j],dp[i][j-value[i]]+weight[i]);
      else dp[i+1][j]=dp[i][j];
    }
  }
  for(ll i=Svec(value);i>=0;i--){
    if(dp[n][i]<=w){
      cout<<i<<endl;
      return 0;
    }
  }
}

Measured memory_bytes: 79104
#include <bits/stdc++.h>
#define assem99 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ld long double
#define endll '\n'
#define sz(a) (int)(a).size()
#define RWFile freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
int dx[] = { 0, -1, 0, 1, -1, 1, -1, 1 };
int dy[] = { -1, 0, 1, 0, 1, -1, -1, 1 };
const int MOD = 1e9 + 7, N = 2e6 + 5, oo = 1e9;
const double pi = acos(-1);
using namespace std;

int main()
{
    assem99
    int n, k; cin>>n>>k;
    int arr[n + 5];
    for(int i = 0; i < n; i++) cin>>arr[i];
    sort(arr, arr + n);
    int ans = oo;
    for(int i = 0; i < n; i++)
    {
        if(i + k - 1 < n) ans = min(ans, arr[i + k - 1] - arr[i]);
        else break;
    }
    cout<<ans;

    return 0;
}

Measured memory_bytes: 3960
#include "bits/stdc++.h"

using namespace std;

void solve(void)
{
	int n, m;
	cin >> n >> m;
	vector<int> ps(m);
	set<int> s[m];
	for (int i = 0; i < m; i++)
	{
		int k, x;
		cin >> k;
		while(k--)
		{
			cin >> x;
			s[i].insert(x - 1);
		}
	}
	for (int &v : ps)
		cin >> v;
	int ans = 0;
	for (int bit = 0; bit < (1 << n); bit++)
	{
		bool ok = 1;
		for (int i = 0; i < m; i++)
		{
			bool state = 0;
			for (int j = 0; j < n; j++)
			{
				if (bit>>j&1)
				{
					if (find(s[i].begin(), s[i].end(), j) != s[i].end())
					{
						state ^= 1;
					}
				}

			}
			ok &= ps[i] == state;
		}
		ans += ok;
	}
	cout << ans << endl;
}

int main()
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long n;
int main() {
	ios::sync_with_stdio(false);
	cin >> n;
	for(int i = sqrt(n); i > 0; i--)
		if(!(n % i)) {
			cout << ceil(log10(n / i + 1)) << endl;
			break;
		}
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define boost_io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define int long long
#define num(a) a-'0'
#define charr(a) (a - 'A' + 1)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define maxs(a,b) if(b>a)a=b
#define mins(a,b) if(b<a)a=b
#define debug(x) cerr<<"["<<#x<<":"<<x<<"] "
#define debug2(a,b) debug(a);debug(b)
#define debug3(a,b,c) debug2(a,b);debug(c)
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/(__gcd(a,b))
#define print(arr) for(auto it = arr.begin();it < arr.end();it ++){cout << *it << " ";}cout << ln;
#define all(a) (a).begin(), (a).end()
#define vi vector<long long>
#define v vector
#define p pair
#define pb push_back
#define mk make_pair
#define f first
#define s second
#define ln "\n"
typedef long double ld;
typedef double d;
using namespace std;
int modF=1e9+7;
int INF=1e11;

void solve(){
	int a,b;
	cin>>a>>b;
	if(a<b){
		for(int i=0;i<b;i++){
			cout<<a;
		}
		cout<<ln;
	}
	else{
		rep(i,0,a){
			cout<<b;
		}
		cout<<ln;
	}
}

signed main(){
	boost_io;
	solve();
	return 0;
}

Measured memory_bytes: 3620
#include <stdio.h>

int main(void){

  int n;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int count = 0;
  int sukipi;
  for (int i = 1; i <= n; i++) {
    sukipi = a[i-1];
    if (a[sukipi-1] == i) {
      count++;
    }
  }
  count /= 2;
  printf("%d\n", count);

  return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string.h>
#include <stack>
#include <queue>
#include <algorithm>
#include <climits>
#include <cmath>
#include <map>
#include <set>
#include <assert.h>
#include <numeric>
#define REP(i,n) for(ll i=0;i<(n);i++)
#define MOD 1000000007
#define int long long
#ifdef int
const long long INF = LLONG_MAX / 10;
#else
const int INF = 1010101010;
#endif
using namespace std;
typedef long long ll;
typedef vector<vector<ll> > mat;
typedef pair<int, int> P;
//typedef pair<double, double> P;
const int dx[9] = {-1, 0, 0, 1, -1, -1, 1, 1, 0};
const int dy[9] = {0, -1, 1, 0, -1, 1, -1, 1, 0};


  bool used[1010];
 
signed main() {
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  string S;
  cin >> S;

  if (S == "zyxwvutsrqponmlkjihgfedcba") {
    cout << -1 << endl;
    return 0;
  }

  if (S.length() < 26) {
    for (char c='a'; c<='z'; c++) {
      bool ok = true;
      REP(i,S.length()) {
        if (S[i] == c) {
          ok = false;
          break;
        } 
      }
      if (ok) {
        cout << S << c << endl;
        return 0;
      }
    }
  }

  // if (S[0] != 'a') {
  //   cout << 'a' << endl;
  //   return 0;
  // }

  //len(S)=26
  // for (int i=0, c='a'; i<S.length(); i++, c++) {
  //   if (S[i] != c) {
  //     cout << S.substr(0, i-1) << (char)c << endl;
  //     assert(false);
  //     return 0;
  //   }
  // }

  vector<string> kouho;
  kouho.push_back(S);
  REP(i,S.length()) {
    for (char c=S[i]+1; c<='z'; c++) {
      if (!used[c]) {
        string temp = S.substr(0, i) + c;
        kouho.push_back(temp);
      }
    }
    used[S[i]] = true;
  }
  sort(kouho.begin(), kouho.end());

  REP(i,kouho.size()) {
    if (kouho[i] == S) {
      cout << kouho[i+1] << endl;
      return 0;
    }
  }

  //len(S)=26
  // vector<string> arr;
  // arr.push_back(S);
  // REP(i,26) REP(j,26) {
  //   string temp = S;
  //   char t = S[i];
  //   S[i] = S[j];
  //   S[j] = t;
  //   arr.push_back(temp);
  // }
  // sort(arr.begin(), arr.end());

  // vector<string> koho;
  // REP(i,arr.size()) {
  //   if (arr[i] == S) {
  //     koho.push_back(arr[i+1]);
  //   }
  // }


}

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

using namespace std;

int nb, nsw;

typedef pair<int, int> PI;
PI sw[200500];

int p[200500];
int done[200500];

int get_comp(int a) {
  if (p[a] == a)
    return a;
  return p[a] = get_comp(p[a]);
}

bool unite(int a, int b) {
  a = get_comp(a);
  b = get_comp(b);
  if (a == b)
    return false;
  
  p[a] = b;
  return true;
}


vector<PI> g[200500];
int used[200500];

vector<int> res;

int status[200500];

bool solve(int v, int p, int edge) {
  for (auto e : g[v]) if (e.first != p) {
    solve(e.first, v, e.second);
  }

  if (status[v] && p >= 0) {
    res.push_back(edge);
    status[v] ^= 1;
    status[p] ^= 1;
  }

  return status[v] == 0;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  
  cin >> nb >> nsw;
  
  map<int, PI> idmap;
  idmap[-1] = {0, 0};
  
  bool ok = true;
  for (int i = 0; i  < nb; ++i) {
    int b, s;
    cin >> b >> s;
    auto it =  idmap.find(b);
    if (it != idmap.end() && it->second.second != s) {
      ok =false;
    }
    idmap[b].second = s;
  }
  if (!ok) {
    cout << -1 << endl;
    return 0;
  }

  auto it = idmap.begin();
  int last = 0;
  int last_x = it->second.second;
  it->second.first = last;
  ++it;
  for (; it != idmap.end(); ++it) {
     int next_x = it->second.second;
     status[last] = last_x ^ next_x;

     it->second.first = ++last;
     last_x = next_x;
  }
  
  for (int i = 0; i < nsw; i++) {
    cin >> sw[i].first >> sw[i].second;
    auto down = idmap.lower_bound(sw[i].first);
    --down;
    sw[i].first = down->second.first;
    auto up = idmap.upper_bound(sw[i].second);
    --up;
    sw[i].second = up->second.first;
  }


  iota(p, p + last, 0);
  for (int i = 0; i < nsw; i++) {
    int a = sw[i].first, b = sw[i].second;
    if (a == b) continue;
    if (a == last) {
      g[a].push_back({b, i});
      continue;
    }
    if (b == last) {
      g[b].push_back({a, i});
      continue;
     }
     if (unite(a, b)) {
        g[a].push_back({b, i});
        g[b].push_back({a, i});
     }
  }


  for (auto e : g[last]) if (!done[get_comp(e.first)]) {
      if (!solve(e.first, last, e.second)) {
        ok = false;
        break;
      }

      done[get_comp(e.first)] = true;
  }

  if (ok) for (int i = 0; i < last; ++i) if (i == p[i] && !done[i]) {
      if (!solve(i, -1, -1)) {
        ok = false;
        break;
      }
  }
  if (!ok) cout << -1 << endl;
  else {
    sort(begin(res), end(res));
    cout << res.size() << endl;
    for (auto k : res) cout << k+1 << " ";
    cout << endl;
  }
}


Measured memory_bytes: 19068
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define LLMAX (1ll << 60) - 1
#define INTMAX (1 << 30) - 1
#define MOD 1000000007 
#define NMAX 1000*100+1

#define numberOfSetBits(S) __builtin_popcount(S) // __builtin_popcountl(S) __builtin_popcountll(S)
#define MSET(x,y) memset(x,y,sizeof(x))
#define gcd(a,b) __gcd(a,b)
#define all(x)  x.begin(),x.end()
#define isOn(S, j) (S & (1 << j))
#define endl '\n'
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define print(x)    for(auto it:x) cout<<it<<' '; cout<<endl;
#define printii(x)  for(auto it:x) cout<<it.F<<' '<<it.S<<'\t';  cout<<endl;
#define in(x,n)   for(int e=0;e<n;e++){ll y;cin>>y;x.pb(y);}

#define vi vector<ll>
#define vvi vector<vi>
#define ii pair<ll,ll>
#define pll pair<ll,ll>
#define vii vector<ii>
#define vvii vector<vii>
#define viii vector<pair<ii,ll>>
#define pb push_back
#define F first
#define S second
#define mp make_pair
#define mc(a,b,c) mp(mp(a,b),c)
vi a;
ll ma[1000004];

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,x,t,m,y,z;
    cin>>n;
    in(a,n);
    for(int i=0;i<n;i++){
        ma[a[i]]++;
    }
    z = 0 ;
    for(int i=0;i<n;i++){
        bool ok = true;
        for(int j=1;j*j<=a[i];j++){
            if(a[i]%j==0){
                x = j;
                y = a[i]/j;
                if(x==a[i]){
                    if(ma[x]>1)ok=false;
                }
                else{
                    if(ma[x])ok = false;
                }
                if(y==a[i]){
                    if(ma[y]>1)ok=false;
                }
                else{
                    if(ma[y])ok = false;
                }
            }
        }
        z+=ok;
    }
    cout<<z;
    
    

    return 0;
}

Measured memory_bytes: 12696
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#define _GLIBCXX_DEBUG // check []
#define DIVISOR 1000000007

using namespace std;
typedef pair<int,int> pii;
typedef pair<int64_t, int64_t> pII;

template<typename T>
void cins(vector<T>& arr) { for(T& e: arr) cin >> e; }

#ifdef DEBUG
#define debug(fmt, ...) \
    printf("[debug: %s] " fmt, __func__, __VA_ARGS__)
#define ps(arr) \
    for(auto e: arr) cout << e << " "; \
    cout << endl;
#else
#define debug(fmt, ...)
#define ps(arr)
#endif

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

int64_t lcm(int64_t a, int64_t b) {
    if(a > b) swap(a, b);
    int64_t g = gcd(a,b);
    return a / g * b;
}

int main(void) {
    int num;
    cin >> num;
    int64_t ans = 1;
    for(int i = 0; i < num; i++) {
        int64_t val;
        cin >> val;
        ans = lcm(ans, val);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3600
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<cstdio>

using namespace std;

double EPS = 1e-10;
const double PI = acos(-1);

double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}

struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}

  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }

  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

  point operator * (double d){
    return point(x*d,y*d);
  }

  point operator / (double d){
    return point(x/d,y/d);
  }
  
  bool operator == ( const point &p ) const {
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};

struct segment{
  point a,b;
};

double dot(point a, point b) {
  return (a.x * b.x + a.y * b.y);
}

double cross(point a, point b) {
  return (a.x * b.y - a.y * b.x);
}

double vec_abs(point a){
  return sqrt(a.x*a.x+a.y*a.y);
}

double dist(point a,point b){
  return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
}

int ccw(point p0, point p1, point p2){
  point a = p1 - p0;
  point b = p2 - p0;
  if(cross(a,b)>EPS)return +1;
  if(cross(a,b)<EPS)return -1;
  if(dot(a,b)<-EPS)return +2;
  if(a.x*a.x+a.y*a.y<b.x*b.x+b.y*b.y)return -2;
  return 0;
}

vector<segment> construct_edge(point* p, int n){
  vector<segment>seg,seg2;
  segment temp;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(i!=j){
	temp.a=p[i];
	temp.b=p[j];
	seg.push_back(temp);
      }
    }
  }

  int t=seg.size();
  for(int i=0;i<t;i++){
    int fg=0;
    for(int j=0;j<t;j++){
      if(i!=j && vec_abs(seg[i].b-seg[j].a)<=EPS){
	if(ccw(seg[i].a,seg[i].b,seg[j].b)==1){
	  fg=1;
	  break;
	}
      }
    }
    if(!fg)seg2.push_back(seg[i]);
  }
  return seg2;
}

/*
double areaPol(point* ps, int n){
  vector<segment>t=construct_edge(ps,n);

  int tsz=t.size();
  double area=0;
  for(int i=0;i<tsz;i++){
    area+=abs((t[i].a.x-t[i].b.x)*(t[i].a.y+t[i].b.y));
  }
  return abs(area)/2.0;
}
*/
/*
double areaPol(point* ps, int n){
  vector<segment>t=construct_edge(ps,n);

  int tsz=t.size();
  point c;
  c.x=c.y=0;
  for(int i=0;i<n;i++)c=c+ps[i];
  c=c/n;

  double area=0;
  for(int i=0;i<tsz;i++){
    double a=dist(t[i].a,t[i].b);
    double b=dist(t[i].a,c);
    double d=dist(t[i].b,c);
    double z=(a+b+d)/2;
    area+=sqrt(z*(z-a)*(z-b)*(z-d));
  }
  return area;
}
*/

int main(void){
  point p[21];
  int n=0;
  char k;
  double x,y;
 
 while(cin>>x>>k>>y){
   if(cin.eof())break;
   p[n].x = x;
   p[n].y = y;
   n++;
 }
  p[n]=p[0];
  double s;
  for(int j=0; j<n; j++) 
    s+=(p[j].x-p[j+1].x)*(p[j].y+p[j+1].y);
  printf("%.6f\n",abs(s/2));

  return 0;
}

Measured memory_bytes: 0
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if 500*i + 100*j + 50*k == X:
                count += 1
print(count)

Measured memory_bytes: 3060
// "header" {{{
#pragma GCC optimize("Ofast")

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <tuple>
#include <iomanip>
#include <climits>

using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define pii pair<int,int>
#define int int64_t
#define double long double
#define Fixed fixed << setprecision(10)
#define moke_pair make_pair

constexpr int INF = 0x3f3f3f3f;
constexpr int64_t LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int64_t mod1 = 1000000007;
constexpr int64_t mod2 = 998244353;

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

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class T,class U> using umap = unordered_map<T,U>;

inline int64_t updiv(int64_t n,int64_t d){ return ((n + d -1) / d); }
inline int square(int a){ return a * a; }
// }}}

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

    int a,b,c;
    cin >> a >> b >> c;

    int maxv = max({a,b,c});
    int sum = maxv - a + maxv - b + maxv - c;

    int res = sum / 2;
    if(sum & 1) res += 2;

    cout << res << '\n';

    return 0;
}


Measured memory_bytes: 256
#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 = 1LL << 60;
/* テンプレートここまで */

int main() {
  int N; cin >> N;
  vector<ll> x(N), y(N);
  REP(i, N){
    cin >> x[i] >> y[i];
  }

  map<pair<ll,ll >, int> diff;
  map<pair<ll,ll >, int> dot;

  REP(i, N){
    dot[{x[i], y[i]}] = 1;
  }

  REP(i, N) REP(j, N){
    if(i == j) continue;
    if(x[i] - x[j] == 0 && y[i] - y[j] == 0) continue;
    diff[{x[i]-x[j], y[i]-y[j]}]++;
  }

  int ans = N;
  for(auto a : diff){
    ans = min(ans, N - a.second);
  }
  cout << ans << endl;
}


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

using namespace std;

typedef long long ll;
typedef long double ld;

#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(v) v.begin(),v.end()

const int maxn = 1e5 + 100;
const ll inf = 2e18, mod = 1e9 + 7;

int n;
ll a[maxn], ps[maxn];

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

	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	sort(a, a + n);
	for (int i = 0; i < n; i++)
		ps[i] = a[i] + (i ? ps[i - 1] : 0);
	int pos = 0;
	for (int i = 0; i < n - 1; i++)
		if (ps[i] * 2 < a[i + 1])
			pos = i + 1;
	cout << n - pos << endl;
}



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

int main() {
  string s,t;
  cin>>s>>t;
  for(int i=0;i<s.size();i++){
    string temp=s.substr(0,s.size()-1);
    s[0]=s.at(s.size()-1);
    for(int j=0;j<s.size()-1;j++) s.at(j+1)=temp.at(j);
    if(s==t) {
      cout<<"Yes"<<endl;
      return 0;
    }
  }
  cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
static const int MAX = 100;

void insertionSort(int A[],int N){
  for(int i=0;i<N;i++){
    int v=A[i];
    int j=i-1;
    while(j>=0 && A[j]>v){
      A[j+1]=A[j];
      j--;
    }
    A[j+1]=v;
    cout<<A[0];
    for(int k=1;k<N;k++){
      cout<<" "<<A[k];
    }
    cout<<endl;
  }
}

int main(){
  int A[MAX],N;
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> A[i];
  }
  insertionSort(A,N);
  return 0;
}

Measured memory_bytes: 3068
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
def do():
    N = INT()
    if N<1200:
        print('ABC')
    else:
        print('ARC')    
if __name__ == '__main__':
    do()

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

int main(){
  int k,i,kari;
  double n,kotae,ans=0;
  cin>>n>>k;
  for(i=1;i<n+1;i++){
    kari=i;
    kotae=1.0;
    for(;;){
      if(kari>k-1){
        break;
      }
      kari*=2;
      kotae*=2.0;
    }
    ans+=1.0/kotae;
  }
  printf("%14.12lf",ans/n);
}

Measured memory_bytes: 256
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv,
    std.functional, std.math, std.numeric, std.range, std.stdio, std.string,
    std.random, std.typecons, std.container;

ulong MAX = 100_100, MOD = 1_000_000_007, INF = 1_000_000_000_000;
alias sread = () => readln.chomp();
alias lread(T = long) = () => readln.chomp.to!(T);
alias aryread(T = long) = () => readln.split.to!(T[]);
alias Pair = Tuple!(long, "a", long, "b");
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);

void main()
{
    long n = lread();
    auto alph = "abcdefghijklmnopqrstuvwxyz";
    auto k = new long[](0);
    while (n > 0)
    {
        k ~= n % 26;
        n /= 26;
    }
    // k.writeln();
    auto ans = new char[](0);
    foreach (i, e; k)
    {
        if (e)
        {
            ans ~= alph[e - 1];
        }
        else
        {
            if (i + 1 < k.length)
            {
                ans ~= 'z';
                long tmp = i + 1;
                while (k[tmp] == 0)
                {
                    k[tmp] = 25;
                    tmp++;
                }
                k[tmp]--;
            }
        }
    }
    ans.reverse().writeln();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}


Measured memory_bytes: 2716
#include <algorithm>
#include <cstdio>
#include <vector>

using std::vector;

int main() {
  int n;
  vector<int> res;
  scanf("%d", &n);
  while (n) {
    res.push_back(n & 1);
    n -= n & 1;
    n /= -2;
  }
  reverse(begin(res), end(res));
  if (res.empty()) res.push_back(0);
  for (auto x : res) printf("%d", x);
  printf("\n");
}

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

int w[100002];
long v[100002];
long long dp[102][100002] = {};


int main(){
    int N, W;
    cin >> N >> W;
    for(int n=1;n<=N;n++){
        cin >> w[n] >> v[n];
    }

    for(int n=1;n<=N;n++){
        for(int wi=0;wi<=W;wi++){
            if(w[n] <= wi){
                dp[n][wi] = max(dp[n-1][wi-w[n]] + v[n], dp[n-1][wi]);
            }
            else{
                dp[n][wi] = dp[n-1][wi];
            }
        }
    }

    cout << dp[N][W] << "\n";

    return 0;
}

Measured memory_bytes: 79360
#ifdef __GNUC__
#include <bits/stdc++.h>
#endif // __GNUC_

int main() {

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

    int N, K;
    std::cin >> N >> K;
    std::vector<int> l(N);
    for (auto& i : l)std::cin >> i;
    std::sort(l.rbegin(), l.rend());
    int ans = 0;
    for (int i = 0; i < K; ++i) {
        ans += l[i];
    }
    std::cout << ans << std::endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
int main(){
    int a,ma=1,c;
    cin >> a;
    for(int i=1;i<a;i++){
        for(int j=2;j<a;j++){
            c=pow(i,j);
            if(a>=c)
            ma = max(ma,c);
        }
    }cout << ma << endl;

}

Measured memory_bytes: 640
#include <iostream>
#include <iomanip>
#include <queue>

using namespace std;
using P = pair<int,int>;

enum dir{
  RIGHT = 1,
  DOWN = 2,
  LEFT = 4,
  UP = 8
};

int map[30][30];
int visited[30][30];
int dist[30][30];

int main(){
  int w,h;
  while(cin >> w >> h&&w>0&&h>0){
    for(int i=0;i<h;++i){
      for(int j=0;j<w;++j){
        map[i][j] = 0;
        visited[i][j] = 0;
        dist[i][j] = 0;
      }
    }

    //???????£?????????£?????????
    for(int i=0;i<h;++i){
      map[i][0] |= LEFT;
      map[i][w-1] |= RIGHT;
    }

    for(int j=0;j<w;++j){
      map[0][j] |= UP;
      map[h-1][j] |= DOWN;
    }

    for(int i=0;i<2*h-1;++i){
      for(int j=0;j<w-1+i%2;++j){
        int wall;
        cin >> wall;
        if(wall){
          if(i%2){
            map[i/2][j] |= DOWN;
            map[i/2+1][j] |= UP;
          }else{
            map[i/2][j] |= RIGHT;
            map[i/2][j+1] |= LEFT;
          }
        }
      }
    }
    
    queue<P> q;
    q.push(P(0,0));
    visited[0][0] = 1;
    dist[0][0] = 1;

    int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
    while(!q.empty()){
      auto p = q.front();q.pop();
      int y = p.first , x = p.second;

      for(int i=0;i<4;++i){
        int y2 = y+dy[i] , x2 = x+dx[i];
        if(!((map[y][x]&(1<<i))||visited[y2][x2])){
          q.push(P(y2,x2));
          dist[y2][x2] = dist[y][x] + 1;
          visited[y2][x2] = 1;
        }
      }
    }
    cout << dist[h-1][w-1] << endl;
  }
}

Measured memory_bytes: 3048
def main():
    A, B, M = map(int, input().split())

    aryA = [int(v) for v in input().split()]
    aryB = [int(v) for v in input().split()]

    minPrice = min(aryA) + min(aryB)

    for _ in range(M):
        x, y, c = map(int, input().split())

        x -= 1
        y -= 1

        minPrice = min(minPrice, aryA[x] + aryB[y] - c)

    print(minPrice)


main()


Measured memory_bytes: 18488
#include <stdio.h>
#include <memory.h>
int ans;
char s[20][21];
int b[20][20];
void dfs(int h,int w,int i,int j){
  if(s[i][j]!='#'&&b[i][j]==0){
    b[i][j]=1;
    ans++;
  }
  else
    return ;
  if(i>0)
    dfs(h,w,i-1,j);
  if(i<h-1)
    dfs(h,w,i+1,j);
  if(j>0)
    dfs(h,w,i,j-1);
  if(j<w-1)
    dfs(h,w,i,j+1);
}
int main(void){
  int h,w,i,j;
  //char s[20][21];
  while(1){
    scanf("%d %d",&w,&h);
    if(!w)
      break;
    memset(b,0,sizeof(b));
    for(i=0;i<h;i++)
      scanf("%s",s[i]);
    ans=0;
    for(i=0;i<h;i++){
      for(j=0;j<w;j++){
	if(s[i][j]=='@')
	  goto LOOP_END;
      }
    }LOOP_END:
    dfs(h,w,i,j);
    printf("%d\n",ans);
  }
  return 0;
}

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

int main() {
  long N;
  cin >> N; // N = a * b
  long x = sqrt(N); // a <= sqrt(N)を満たす。対称性より、bにも同じことが言える
  long a = x;
  long b = 0;
  long ans = 1 + N - 2; // 多分これが一番大きい組。(a,b) = (1,N)

  for (long i = 1; i <= x; i++) {
    if (!(N % i)) {
      a = i;
      b = N / a;
      if (ans > a + b - 2) ans = a + b - 2;
    }
  }

  cout << a + b - 2 << endl;
}


Measured memory_bytes: 256
K, N = map(int, input().split())
a = list(map(int, input().split()))

dist = []
for i in range(N-1):
    dist.append(a[i + 1] - a[i])
dist.append(a[0] + (K - a[-1]))

ans = sum(dist) - max(dist)

print(ans)


Measured memory_bytes: 32356
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int N = 1000000;
const ll mod = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * B / gcd(A, B);
}

/*------------------------------------------------------------------*/

int main(){
    ll a, b; cin >> a >> b;
    if((a + b) % 2 == 0)cout << (a + b) / 2 << endl;
    else cout << "IMPOSSIBLE" << endl;
}

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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<int> vi;
typedef vector<ll> vll;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz(a) ((int)(a).size())
#define rep(i,a,b) for(int i=(a); i<(b); i++)
#define trav(it, a) for(auto& it : a)
#define allin(it, a) for(auto it : a)
#define read(v, a, b) for(int i=(a); i<(b); i++) scanf("%d", &v[i]);
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define FAST cin.tie(0), cout.tie(0), ios::sync_with_stdio(0)
#define db(x) cerr << #x << " == " << x << endl

const int maxn = 1e5 + 100;

int main(){
	int n; scanf("%d", &n);
	vector<int> dp(3);
	rep(k,0,n){
		vector<int> a(3);
		trav(it, a)
			scanf("%d", &it);
		vector<int> new_dp(3, -1);
		rep(i,0,3)
			rep(j,0,3)
				if(i != j)
					new_dp[i] = max(new_dp[i], dp[j] + a[i]);
		dp = new_dp;
	}
	printf("%d\n", max({dp[0], dp[1], dp[2]}));
}


Measured memory_bytes: 256
#include <stdio.h>
#include <cctype>
#include <limits.h>
#include <math.h>
#include <complex>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define VARIABLE(x) cerr << #x << "=" << x << endl
#define BINARY(x) static_cast<bitset<16> >(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
#define if_range(x, y, w, h) if (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()
const int INF = 1e9;
int dx[4]={0, 1, 0, -1}, dy[4]={-1, 0, 1, 0};
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;

/* struct P {
	int x, y, n;
	P(int n, int x, int y):n(n), x(x), y(y){}
	P(){}
}; */


/** Problem1148 : Analyzing Login/Logout Records **/
bool login[10000][1300];

int main()
{
	int N, M;
	while (cin>>N>>M, N||M) {
		vector<int> login_num(M);
		vector<int> start(M);
		memset(login, 0, sizeof(login));
		
		int R; cin>>R;
		
		rep(i, R) {
			int t, n, m, s;
			cin>>t>>n>>m>>s;
			m--;
			
			if (s) {
				login_num[m]++;
				if (start[m]==0) start[m]=t;
			} else {
				login_num[m]--;
				
				if (login_num[m]==0) {
					for (int j=start[m]; j<t; j++) {
						login[m][j] = true;
					}
					
					start[m] = 0;
				}
				
			}
		}
		
		int Q; cin>>Q;
		
		rep(i, Q) {
			int s, e, m;
			cin>>s>>e>>m;
			m--;
			
			int ans=0;
			for (int j=s; j<e; j++) {
				if (login[m][j]) ans++;
			}
			
			cout << ans << endl;
		}
	}
}

Measured memory_bytes: 13972
dishes = []
zero = []

for i in range(5):
    x = int(input())
    if int(str(x)[-1]) != 0:
        dishes.append(x)

    else:
        zero.append(x)

dishes = sorted(dishes, key=lambda x: str(x)[-1])
dishes.reverse()

dishes = zero + dishes

ans = 0
for i in range(len(dishes)):
    if i == len(dishes)-1:
        ans += dishes[i]
    else:
        sa = 10 - int(str(dishes[i])[-1])
        if sa == 10:
            ans += dishes[i]
        else:
            ans += dishes[i] + sa

print(ans)


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

typedef long long ll;
#define dou  double 
#define endl "\n"
const int MOD=1e9+7;
int main()
{
	ll x,k,d,a,b,c,x_d,step=0,ans;
	cin >> x >> k >> d;
	//x_d=abs(x);
	
	x_d = abs(x);

	a = (x_d)/d;
	x_d -= a*d;
	step = a;

	if(abs(x_d-d)< x_d)
	{
		x_d = abs(x_d-d);
		step++;
	}
	if(k>=step)
	{
		if((k-step)%2 == 0)
			ans = abs(x_d);
		else
			ans = min(x_d+d,abs(x_d-d));
	}
	else
	{	
		x_d = abs(x);
		while(k!=0)
		{
			x_d = x_d - d;
			k--;
		}
		ans = x_d;
	}
	cout << ans << endl;
	//cout << c << endl;
	//cout << a << endl;
	/*if(k>=a){
		b=k-a;
		//cout << b << endl;
		if(b%2==0)
			cout << c << endl;
		else
			cout << abs(c-d) << endl;
	}
	else{
		ll m=x-k*d;
		cout << abs(m) << endl;
	}*/
	
	return 0;
}


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


/* エイリアス */
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define endl '\n'

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define em emplace
#define mp make_pair


/* 関数マクロ */
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n, m) for (ll i = n; i <= m; ++i)
#define rep3(i, n, m) for (ll i = n; i >= m; --i)
#define all(v) v.begin(), v.end()
#define si(v) int(v.size())
#define UNIQUE(v) sort(all(v)), v.erase(unique(all(v)),v.end())


/* 定数 */
const ll mod = 1e9 + 7;
const ll infll = (1LL << 62) - 1;
const ll inf = (1LL << 30) - 1;


/* その他 */
template<class S, class T> inline bool chmax(S &a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class S, class T> inline bool chmin(S &a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> using pq = priority_queue<T>;
template<class T> using pqg = priority_queue<T, vector<T>, greater<T>>;


signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  ll n, y; cin >> n >> y;
  rep(i, n+1) rep(j, n+1) {
    int k = n - i - j;
    if (k < 0) continue;

    ll val = i * 10000 + j * 5000 + k * 1000;
    if (val == y) {
      cout << i << " " << j << " " << k << endl;
      return 0;
    }
  }

  cout << -1 << " " << -1 << " " << -1 << endl;
}


Measured memory_bytes: 3616
#include <stdio.h>

int main(void)
{
    int n, a[100000], max = 0, count[100003] = {};
    int i, j;

    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%d", &a[i]);
        count[a[i]]++;
        count[a[i] + 1]++;
        count[a[i] + 2]++;
    }

    for (i = 1; i <= 100001; i++)
    {
        if (count[i] > max)
            max = count[i];
    }

    printf("%d", max);
    return (0);
}

Measured memory_bytes: 896
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
typedef long long ll;

int main() {
  int n, p; cin >> n >> p;
  string S; cin >> S;
  if(10 % p == 0) {
    ll ans = 0;
    for(int r = 0; r < n; r++) {
      if((S[r]-'0') % p == 0) ans += r+1;
    }
    cout << ans << endl;
    return 0;
  }

  vector<int> d(n+1);
  int ten = 1;
  for(int i = n-1; i >= 0; --i) {
    int a = (S[i]-'0')*ten%p;
    d[i] = (d[i+1] + a) % p;
    ten *= 10; ten %= p;
  }

  vector<int> cnt(p);
  ll ans = 0;
  for(int i = n; i>= 0; i--) {
    ans += cnt[d[i]];
    cnt[d[i]]++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1412
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

int p[20];
signed main(){
	int n;cin>>n;
	rep(i,n)cin>>p[i];
	sort(p,p+n);
	int sum=0;
	rep(i,n-1)sum+=p[i];
	sum+=p[n-1]/2;
	cout<<sum<<endl;
}

Measured memory_bytes: 256
package main

import "fmt"

var A, B, C string

func main() {
	fmt.Scan(&A, &B, &C)
	if A[len(A)-1:len(A)] == B[0:1] && B[len(B)-1:len(B)] == C[0:1] {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}


Measured memory_bytes: 512
import math

A, B = [int(i) for i in input().split()]
diff = B - A

str_B = format(B, 'b')

A = A - 1
result = ""
for i in range(0, len(str_B)):
    keta = len(str_B) - i
    num = math.pow(2, keta)
    
    one_in_A = int(A / num) * (num / 2)
    one_in_B = int(B / num) * (num / 2)

    if A % num >= int(num / 2):
        one_in_A += A % num - int(num / 2) + 1
    if B % num >= int(num / 2):
        one_in_B += B % num - int(num / 2) + 1

    if one_in_A < 0:
        one_in_A = 0
    
    if A >= 0:
        if (one_in_B - one_in_A) % 2 == 1:
            result += "1"
        else:
            result += "0"
    else:
        if one_in_B % 2 == 1:
            result += "1"
        else:
            result += "0"

print(int(result, 2))


Measured memory_bytes: 3064
a,b=map(int,input().split())
G=[[0]*25 for i in range(25)]
x=min(a,b) #地の色
y=max(a,b) #塗る色
C=[x-1,y-x+1]
for i in range(25):
    for j in range(25):
        if C[0]>0:
            G[i][j]=1
            C[0]-=1
        elif C[1]>0:
            G[i][j]=2
            C[1]-=1
        else:
            break
    if C[0]==C[1]==0:
        break

P=[]
if a<b:
    P.append(["....","....","....","...."])
    P.append(["###.","#.#.","###.","...."])
    P.append(["....",".#..","....","...."])
else:
    P.append(["####","####","####","####"])
    P.append(["...#",".#.#","...#","####"])
    P.append(["####","#.##","####","####"])

print(100,100)
for i in range(25):
    for k in range(4):
        s=""
        for j in range(25):
            s+=P[G[i][j]][k]
        print(s)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;

int main(void)
{
    IOS
    string s;
    cin >> s;

    int x = (s.size()-1)/2;
    int ans=0;
    for(int i = x; i > 0; i--) {
        bool b = true;
        REP(j,i) {
            if (s[j] != s[j+i]) {
                b = false;
                break;
            }
        }
        if(b) {
            ans = i*2;
            break;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>//author::@whohet-->Het Patel
#define fasterthanlight ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define test int T; cin>>T; while(T--)
#define endl "\n"
#define int long long
#define uint unsigned long long
#define ld long double
#define pii pair<int,int>
#define vi vector<int>
#define vc vector<char>
#define vs vector<string>
#define vvi vector<vector<int>>
#define mii map<int,int>
#define msi map<string,int>
#define mis map<int,string>
#define pb push_back
#define mod 1000000007
#define PI 3.141592653589793238

using namespace std;

//author::@whohet-->Het Patel

signed main()
{
	fasterthanlight;
	set<string>s;
	int n;
	cin>>n;
	while(n--)
	{
		string x;
		cin>>x;
		s.insert(x);
	}
	cout<<s.size();
}



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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c;
    cin >> a >> b >> c;
    int tmp=a;
    for(int i=0;i<b;i++){
        if(tmp%b==c){
            cout << "YES" << endl;
            return 0;
        }
        tmp+=a;
    }
    cout << "NO" << endl;

	return 0;
}

Measured memory_bytes: 256
A = [int(i) for i in input().split()]

odd = len([a for a in A if a % 2 == 1])
even = 3 - odd

ans = 0
if odd == 3 or even == 3:
    pass
elif odd == 1:
    A = [a + 1 if (a % 2 == 0) else a for a in A]
    ans += 1
elif even == 1:
    A = [a + 1 if (a % 2 == 1) else a for a in A]
    ans += 1

MAXA = max(A)
for a in A:
    ans += (MAXA - a) // 2

print(ans)

Measured memory_bytes: 3064
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all(C) std::begin(C), std::end(C)

int32_t N,K;
int32_t memo[2001][2001];//黒の始点,x,y

void imos(int32_t x, int32_t y, int32_t x2, int32_t y2)
{
	++memo[x][y];
	--memo[x][y2];
	--memo[x2][y];
	++memo[x2][y2];
}

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	in >> N>>K;
	for (size_t i = 0; i < N; i++)
	{
		int32_t x, y; char c;
		in >> x >> y>>c;
		x %= 2*K; y %= 2*K;

		if (((x < K && y < K) || (x >= K && y >= K)) == (c == 'B'))
		{
			auto x_ = x % K, y_ = y % K;
			//++memo[0][0]; --memo[x_ + 1][y_ + 1];
			imos(0, 0, x_ + 1, y_ + 1);
			imos(x_ + K + 1, 0, 2 * K, y_ + 1);

			imos(0, y_ + K + 1, x_ + 1, 2 * K);
			imos(x_ + K + 1, y_ + K + 1, 2 * K, 2 * K);

			imos(x_ + 1, y_ + 1, x_ + K + 1, y_ + K + 1);
		}
		else
		{
			auto x_ = x % K, y_ = y % K;
			//++memo[x_ + 1][y_ + 1]; --memo[x_ + K + 1][y_ + K + 1];

			imos(x_ + 1, 0, x_ + K + 1, y_ + 1);
			imos(x_ + 1, y_ + K + 1, x_ + K + 1, 2 * K);

			imos(0, y_ + 1, x_ + 1, y_ + K + 1);
			imos(x_ + K + 1, y_ + 1, 2 * K, y_ + K + 1);
		}
	}

	for (size_t i = 0; i < 2001; i++)
		for (size_t j = 1; j < 2001; j++)
	{
			memo[i][j] += memo[i][j - 1];
	}
	for (size_t i = 1; i < 2001; i++)
		for (size_t j = 0; j < 2001; j++)
	{
		memo[i][j] += memo[i - 1][j];
	}

	int32_t max = 0;
	for (size_t i = 0; i < 2 * K; i++)
		for (size_t j = 0; j < 2*K; j++)
		{
			max = std::max(max, memo[i][j]);
		}
	out << max << endl;

	return 0;
}
#endif


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

int main() {
    int w, h, n;
    cin >> w >> h >> n;
    int top = h;
    int bottom = 0;
    int left = 0;
    int right = w;
    for (int i = 0; i < n; ++i) {
        int x, y, a;
        cin >> x >> y >> a;
        if (a == 1) left = max(left, x);
        else if (a == 2) right = min(right, x);
        else if (a == 3) bottom = max(bottom, y);
        else if (a == 4) top = min(top, y);
    }
    if (left >= right || bottom >= top) cout << 0 << endl;
    else cout << (right - left) * (top - bottom) << endl;
}


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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}
int main() {
	int n = ri();
	int w = ri();
	int a[n], b[n];
	for (int i = 0; i < n; i++) a[i] = ri(), b[i] = ri();
	std::vector<int64_t> dp(100001, 1000000000000000000);
	dp[0] = 0;
	for (int i = 0; i < n; i++) for (int j = 100000 - b[i]; j >= 0; j--)
		dp[j + b[i]] = std::min(dp[j + b[i]], dp[j] + a[i]);
	for (int i = 100000; i >= 0; i--) if (dp[i] <= w) {
		std::cout << i << std::endl;
		return 0;
	}
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b; cin >> a >> b;
  cout << (a+b+1)/2 << "\n";
  return 0;
}


Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x,n,c=0,ans=0,m=100;
    cin>>x>>n;
    int a[101];
    vector<int>v;
    for(int i=0;i<=101;i++)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    for(int i=0;i<=101;i++)
    {
        if(a[c]==i)
            c++;
        else
            v.push_back(i);
    }
    for(int i=0;i<v.size();i++)
    {
        if(m>abs(x-v[i]))
           ans=v[i];
         m=abs(x-v[i]);
    }
    cout<<ans;
}




Measured memory_bytes: 3620
n, k = map(int, input().split())
X = list(map(int, input().split()))
ans = 3 * 10 ** 8
for i in range(n - k + 1):
    left = X[i]
    right = X[i + k - 1]
    if left < 0 and right > 0:
        time = right - left + min(abs(left), abs(right))
    else:
        time = max(abs(right), abs(left))
    ans = min(ans, time)
print(ans)

Measured memory_bytes: 14224
N = int(input())
S = input()
S1 = S[:N]
S2 = S[N::][::-1]
H = dict()
for i in range(2**N):
    t1 = ''.join([s for j, s in enumerate(S2) if 2**j & i])
    t2 = ''.join([s for j, s in enumerate(S2) if not 2**j & i])
    k = H.get((t1, t2), 0)
    H[(t1, t2)] = k+1
ans = 0
for i in range(2**N):
    t1 = ''.join([s for j, s in enumerate(S1) if 2**j & i])
    t2 = ''.join([s for j, s in enumerate(S1) if not 2**j & i])
    ans += H.get((t1, t2), 0)
print(ans)

Measured memory_bytes: 126044
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int a, b;
int main(){
    cin >> a >> b;
    if(a*b % 2 == 0) cout << "Even" << endl;
    else if(a*b % 2 != 0) cout << "Odd" << endl;
    
    return 0;
}
      

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int, int>> vpi;
typedef vector<pair<long long, long long>> vpl;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define FOR(i, k, n) for (int i = (k); i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.begin(), a.end(), greater<int>()
#define ROT(a) a.begin(), a.begin() + 1, a.end()
#define RROT(a) a.begin(), a.end() - 1, a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
#define sz(a) a.size()
const ll MOD = 1e9 + 7;
const int MAX = 10000000;
template <typename T1, typename T2>
inline bool chmin(T1& a, T2 b)
{
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T1, typename T2>
inline bool chmax(T1& a, T2 b)
{
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
T gcd(T a, T b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
//cout << 'H' << endl;
/*--------------------------------------------*/
map<int64_t, int> prime_factor(int64_t n)
{
    map<int64_t, int> ret;
    for (int64_t i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1)
        ret[n] = 1;
    return ret;
}
int main()
{
    //cout << fixed << setprecision(10)
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll N;
    cin >> N;

    ll ans = 1;  //N

    ll M = N - 1;

    map<int64_t, int> mp = prime_factor(M);

    ll tmp = 1;

    for (auto i : mp) {
        tmp *= (i.second + 1);
        //cout << i.first << ' ' << i.second << endl;
    }

    ans += tmp - 1;

    map<int64_t, int> mp2 = prime_factor(N);
    for (int i = 2; i <= sqrt(N); i++) {
        if (!(N % i)) {
            ll t = N;
            while (!(t % i)) {
                t /= i;
            }

            if (!((t - 1) % i)) {
                if ((N - 1) % i) {
                    ans++;
                }
            }
        }
    }
    cout << ans << endl;
}


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

using namespace std;

int main()
{
    int n;
    long long money = 100000;

    cin >> n;
    for (int i = 0; i < n; i++) {
        money += money * 0.05;
        if (money % 1000) {
            money += 1000;
            money -= money % 1000;
        }
    }
    cout << money << endl;
    
    return 0;
}

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

int main(){
	int a[10];
	for(int i = 0; i < 10; i++ ){
		cin >> a[i];
	}
	for(int i = 0; i < 3; i++){
		for(int j = 0; j < 9; j++ ){
			if(a[j] > a[j+1]){
				swap(a[j],a[j+1]);
			}
		}
		cout << a[9-i] << endl;
	}
	
	return 0; 
}

Measured memory_bytes: 1160