akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()

typedef long long ll;

using namespace std;
using namespace boost::multiprecision;

int main(){

    int n;
    cin >> n;

    vector<int> v(n);
    vector<int> a(n);
    vector<int> b(n);

    rep(i,n){
        int tmp;
        cin >> tmp;
        a[i] = tmp;
    }

    rep(i,n){
        int tmp;
        cin >> tmp;
        b[i] = tmp;
    }

    rep(i,n){
        v[i] = i + 1;
    }

    int an,bn;
    int k = 1;

    do{
        bool bo = true;
        rep(i,n){
            if(v[i] != a[i]){
                bo = false;
                break;
            }
        }

        if(bo){
            an = k;
        }

        bo = true;

        rep(i,n){
            if(v[i] != b[i]){
                bo = false;
                break;
            }
        }

        if(bo){
            bn = k;
        }

        k++;

    }while(next_permutation(ALL(v)));

    cerr << an << endl;
    cerr << bn << endl; 

    cout << abs(an - bn) << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <unordered_map>
#include <map>
#include <vector>
#include <stack>
#include <algorithm>
#include <list>
#include <set>
#include <climits>
#include <cmath>
#define lli long long int
#define M 1000000007
using namespace std ;

int eval(vector<int> &a, int k, int player, vector<vector<int> > &dp)
{
	if(dp[player][k] != -1) return dp[player][k] ;

	for(int i = 0 ; i < a.size(); i++)
	{
		int temp ;
		if(k - a[i] >= 0) 
		{
			temp = eval(a,k-a[i],1-player,dp) ;
			if(temp == player) return dp[player][k] = player ;
		}
	} 

	return dp[player][k] = 1 - player ;
}

int main(int argc, char const *argv[])
{
	int n,k ;
	cin>>n>>k ;

	vector<int> a(n) ;
	vector<vector<int> > dp(2, vector<int> (k+1,-1)) ;
	for(int i = 0 ; i < n ; i++) cin>>a[i] ;

	int ans = eval(a,k,0,dp) ;
	
	if(ans == 1) cout<<"Second"<<endl ;
	else cout<<"First"<<endl ;

	return 0 ;
}

Measured memory_bytes: 10360
// Package main provides ...
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Scan()

	A, err := strconv.Atoi(strings.Split(scanner.Text(), " ")[0])
	if err != nil {
		fmt.Println(err)
		return
	}

	B, err := strconv.Atoi(strings.Split(scanner.Text(), " ")[1])
	if err != nil {
		fmt.Println(err)
		return
	}

	K, err := strconv.Atoi(strings.Split(scanner.Text(), " ")[2])
	if err != nil {
		fmt.Println(err)
		return
	}

	if A >= K {
		A = A - K
	} else {
		if B >= K - A {
			B = B - (K - A)
		} else {
			B = 0
		}
		A = 0
	}

	fmt.Println(A, B)

}


Measured memory_bytes: 640
#include <malloc.h>
 #include <math.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>

//ABC164C-2
int main(void) {
  int n, k, i, cou=1, tmp;
  scanf("%d", &n);
  char s[n][11];
  for(i=0; i < n; i++) scanf("%s", s[i]);
  qsort(s, n, sizeof(char[11]), strcmp);//文字列ソート
  for(i=0; i < n-1; i++) if(strcmp(s[i],s[i+1])!=0)cou++;
  printf("%d",cou);
}

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

namespace AtCoder
{
	class Program
	{
		static void Main(string[] args)
		{
			var a = Console.ReadLine();
			var b = Console.ReadLine();
			var c = Console.ReadLine();

			char winner = 'Z';
			char next = 'a';

			while(winner == 'Z')
			{
				if (next == 'a')
				{
					if (a.Length == 0)
					{
						winner = 'A';
						break;
					}

					next = a.First();
					a = a.Remove(0, 1);
				}
				else if (next == 'b')
				{
					if (b.Length == 0)
					{
						winner = 'B';
						break;
					}

					next = b.First();
					b = b.Remove(0, 1);
				}
				else if (next == 'c')
				{
					if (c.Length == 0)
					{
						winner = 'C';
						break;
					}

					next = c.First();
					c = c.Remove(0, 1);
				}

			}

			Console.WriteLine(winner);
		}
	}
}


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

using namespace std;

#define LL long long
#define DD double
#define Pb push_back
#define Bp pop_back
#define Pf push_front
#define Fp pop_front
#define Ub upper_bound
#define Lb lower_bound
#define In insert
#define All(x) x.begin(), x.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define fast ios_base::sync_with_stdio(0);cin.tie(0)
#define X first
#define Y second
#define mx1 10
#define mx2 110
#define mx3 1010
#define mx4 10010
#define mx5 100010
#define mx6 1000010

typedef vector<LL> Vl;
typedef vector<DD> Vd;
typedef vector<bool> Vb;
typedef vector<Vl> VVl;
typedef pair<LL, LL> Pll;
typedef pair<DD, DD> Pdd;
typedef vector<Pll> Vpl;
typedef vector<Pdd> Vpd;
typedef queue<LL> Ql;
typedef stack<LL> Sl;
typedef deque<LL> Dl;

LL _set(LL N, LL pos) {return N = N | (1 << pos);}
LL _reset(LL N, LL pos) {return N = N & ~(1 << pos);}
bool _check(LL N, LL pos) {return (bool)(N & (1 << pos));}
bool _upper(char a) {return a >= 'A' && a <= 'Z';}
bool _lower(char a) {return a >= 'a' && a <= 'z';}
bool _digit(char a) {return a >= '0' && a <= '9';}

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

///**************************DONE****************************///

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

    int a[20], ans = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        ans += a[i];
    }

    int x = *max_element(a, a + n);
    cout << ans - x + x / 2 << '\n';
    return 0;
}


Measured memory_bytes: 256
// https://atcoder.jp/contests/agc025/tasks/agc025_a
"use strict";
function Main(input) {
  const N = Number(input);
  let min = Infinity;

  for (let i = 1; i < N; i++) {
    const A = i;
    const B = N - A;

    const sumA = String(A)
      .split("")
      .reduce((acc, cur) => Number(acc) + Number(cur), 0);
    const sumB = String(B)
      .split("")
      .reduce((acc, cur) => Number(acc) + Number(cur), 0);

    if (sumA + sumB < min) {
      min = sumA + sumB;
    }
  }
  console.log(min);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 23828
#define rep(i, a, b) for(int i = a; i < (int)(b); i++)
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;
template<class T> inline void chmax(T &a, const T &b) {if(a < b) a = b;}
template<class T> inline void chmin(T &a, const T &b) {if(a > b) a = b;}
const long long INF = 1LL<<60;

const ll DIV = (ll)1e9+7;
// const ll MAXN = (ll)1e5+10;


int main(void) {
   ll N;
   cin>>N;
   if (N==1) cout<<"Hello World"<<endl;
   if (N==2) {
      ll a,b;
      cin>>a;
      cin>>b;
      cout<<a+b<<endl;
   }


   return 0;
}



Measured memory_bytes: 256
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int Q, doubles, lengths, dat[1000009], tmp[1000009], arrays[1000009]; string S, T;
inline bool compare_suffix(int i, int j) {
	if (dat[i] == dat[j]) {
		int ri = (i + doubles <= lengths ? dat[i + doubles] : -1);
		int rj = (j + doubles <= lengths ? dat[j + doubles] : -1);
		return ri < rj;
	}
	return dat[i] < dat[j];
}
void suffix_array() {
	lengths = S.size();
	for (int i = 0; i <= lengths; i++) arrays[i] = i, dat[i] = i < lengths ? S[i] : -1;
	for (doubles = 1; doubles <= lengths; doubles <<= 1) {
		sort(arrays, arrays + lengths + 1, compare_suffix);
		tmp[arrays[0]] = 0;
		for (int i = 1; i <= lengths; i++) tmp[arrays[i]] = tmp[arrays[i - 1]] + (compare_suffix(arrays[i - 1], arrays[i]) ? 1 : 0);
		for (int i = 0; i <= lengths; i++) dat[i] = tmp[i];
	}
}
int main() {
	cin >> S >> Q;
	suffix_array();
	for (int i = 0; i < Q; i++) {
		cin >> T;
		int l = 0, r = S.size() + 1, f = 0;
		while (r - l > 1) {
			int m = (l + r) / 2;
			string S1 = S.substr(arrays[m], T.size());
			if (S1 == T) { f = 1; break; }
			if (S1 < T) l = m;
			else r = m;
		}
		printf("%d\n", f);
	}
}

Measured memory_bytes: 15764
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define cerr cout
#define F first
#define S second
#define fori(i,a,b) for (i = a; i < b; ++i)
#define ford(i,a,b) for(i = a; i>=b;--i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) int(x.size())
typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <ll> vl;
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fill(a, x) memset(a, x, sizeof(a))
#define INF 1000000000
#define MOD 1000000007
#define SMOD 998244353
#define endl "\n"
string to_string(string s) { return '"' + s + '"';}
string to_string(char s) { return string(1, s);}
string to_string(const char* s) { return to_string((string) s);}
string to_string(bool b) { return (b ? "true" : "false");}
template <typename A> string to_string(A);
template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}
template <typename A> string to_string(A v) {bool f = 1; string r = "{"; for (const auto &x : v) {if (!f)r += ", "; f = 0; r += to_string(x);} return r + "}";}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {cerr << " " << to_string(H); debug_out(T...);}
#define pr(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
const ll N = 100043;
ll fact[N];
ll add(ll x, ll y)
{
	x += y;
	while(x >= MOD) x -= MOD;
	while(x < 0) x += MOD;
	return x;
}
ll mul(ll x, ll y)
{
	return (x * 1ll * y) % MOD;
}
ll mulmod(ll a, ll b)
{
    ll res = 0;
    a = a % MOD;
    while (b>0)
    {
        if (b % 2 == 1)
            res = (res + a) % MOD;
        a = (a * 2) % MOD;
        b /= 2;
    }
    return res % MOD; 
}
ll binpow(ll x, ll y)
{
	ll z = 1;
	while(y > 0)
	{
		if(y % 2 == 1)
			z = mul(z, x);
		x = mul(x, x);
		y /= 2;
	}
	return z;
}
ll inv(ll x)
{
	return binpow(x, MOD - 2);
}
ll divide(ll x, ll y)
{
	return mul(x, inv(y));
}
void precalc()
{
	fact[0] = 1;
	ll i;
	fori(i, 1, N)
		fact[i] = mul(i, fact[i - 1]);
}
ll C(ll n, ll k)
{
	if(k > n)
	    return 0;
	return divide(fact[n], mul(fact[n - k], fact[k]));
}

void solve()
{
    int n, d;
    double x, y;
    int cnt = 0;
    cin >> n >> d;
    while(n--)
    {
        cin >> x >> y;
        double dist = sqrt(x*x + y*y);
        if(dist<=d)
            cnt++;
    }
    cout << cnt << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t;
    t=1;
    // cin >> t;
    for(int i=1; i<=t; i++)
    {
        // cout << "Case #" << i << ": ";
        solve();
    }
    return 0;
}

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

using namespace std;
typedef long long ll;

const int MX = 55;
const int GO = MX * 101;

const ll MN = 1e18;

ll dp[MX][GO];
int n;
int m;
ll d[MX];
int c[MX];
int s;

struct Edge {
        int to, cost;
        ll time;
};

vector<Edge> G[MX];

int main() {
        cin.sync_with_stdio(0);
      
        cin >> n >> m >> s;
        s = min(s, GO - 1);

        for (int i = 0; i < m; ++i) {
                int u, v, a, b;
                cin >> u >> v >> a >> b;
                G[u].push_back(Edge{ v, a, b });
                G[v].push_back(Edge{ u, a, b });
        }

        for (int i = 1; i <= n; ++i) {
                cin >> c[i] >> d[i];
        }

        fill(&dp[0][0], &dp[0][0] + MX * GO, MN);
        dp[1][s] = 0;

        typedef pair<ll, pair<int, int>> node;
        priority_queue <node, vector<node>, greater<node>> pq;

        pq.push(make_pair(dp[1][s], make_pair(1, s)));

        while (!pq.empty()) {
                auto cur = pq.top();
                pq.pop();
                int node = cur.second.first;
                int energy = cur.second.second;
                ll dist = cur.first;
                
                int new_energy = min(GO - 1, energy + c[node]);
                
                if (dp[node][new_energy] > dist + d[node]) {
                        dp[node][new_energy] = dist + d[node];
                        pq.push(make_pair(dp[node][new_energy], make_pair(node, new_energy)));
                }
                
                for (auto &e : G[node]) {
                        if (energy >= e.cost && dp[e.to][energy - e.cost] > dist + e.time) {
                                dp[e.to][energy - e.cost] = dist + e.time;
                                pq.push(make_pair(dp[e.to][energy - e.cost], make_pair(e.to, energy - e.cost)));
                        }
                }
                

        }
        
        for (int i = 2; i <= n; ++i) {
                ll ans = MN;
                for (int j = 0; j < GO; ++j)
                        ans = min(ans, dp[i][j]);
                cout << ans << "\n";
        }

        return 0;
}

Measured memory_bytes: 9892
import std.stdio;
import std.algorithm;
import std.array;
import std.conv;
import std.string;

void main() {
  int N, Y;
  auto l = readln.chomp.split.map!(to!int).array;

  N = l[0], Y = l[1];

  for (int i = 0; i <= N; ++i) {
    for (int j = 0; j <= N - i; ++j) {
      int k = N - i - j;
      int sum = 10000 * i + 5000 * j + 1000 * k;

      if (sum == Y) {
        writeln(i, " ", j, " ", k);
        return;
      }
    }
  }

  writeln(-1, " ", -1, " ", -1);

  return;
}

Measured memory_bytes: 256
while True:
    m, f, r = map(int, input().strip().split())
    if m == f == r == -1: break
    if m == -1 or f == -1 or m + f < 30:
        print('F')
    elif m + f >= 80:
        print('A')
    elif m + f >= 65:
        print('B')
    elif m + f >= 50:
        print('C')
    elif m + f >= 30:
        print('C' if r >= 50 else 'D')

Measured memory_bytes: 7668
#include"bits/stdc++.h"
#include"math.h"
using namespace std;

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

using ll = long long int;
using ld = long double;
using pii = pair<int,int>;

#define REP(i,m,n) for(ll i = m; i < (ll)(n);++i)
#define rep(i,n) REP(i,0,n)
#define all(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back

template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
 
using vi=vc<int>;

const ll mod=1e9+7;
const ll INF = 1e18;

int main(){
  int n;
  cin >>n;
  ll h[100010];
  REP(i,1,n+1) cin >> h[i];
  ll dp[100010];
  rep(i,100005) dp[i]=INF;
  dp[1]=0;
  dp[2]=labs(h[1]-h[2]);
  REP(i,3,n+1){
    dp[i]=min(dp[i-1]+labs(h[i-1]-h[i]),dp[i-2]+labs(h[i-2]-h[i]));
  }
  cout << dp[n] << endl;}

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

int main(){
    int H,W;
    char S[2100][2100];

    cin>>H>>W;
    
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            cin>>S[i][j];
        }
    }

    vector<vector<int> > right(H,vector<int>(W,0));
    vector<vector<int> > left(H,vector<int>(W,0));
    vector<vector<int> > under(H,vector<int>(W,0));
    vector<vector<int> > up(H,vector<int>(W,0));

    for(int i=0; i<H; i++){
        int cnt = 0;
        for(int j=0; j<W; j++){
            if(S[i][j] == '#') cnt = 0;
            else cnt++;
            left[i][j] = cnt;
        }
    }

    for(int i=0; i<H; i++){
        int cnt = 0;
        for(int j=W-1; j>=0; j--){
            if(S[i][j] == '#') cnt = 0;
            else cnt++;
            right[i][j] = cnt;
        }
    }

    for(int j=0; j<W; j++){
        int cnt = 0;
        for(int i=0; i<H; i++){
            if(S[i][j] == '#') cnt = 0;
            else cnt++;
            up[i][j] = cnt;
        }
    }

    for(int j=0; j<W; j++){
        int cnt = 0;
        for(int i=H-1; i>=0; i--){
            if(S[i][j] == '#') cnt = 0;
            else cnt++;
            under[i][j] = cnt;
        }
    }

    int ans = 0;

    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            ans = max(ans,(right[i][j] + left[i][j] + under[i][j] + up[i][j] - 3));
        }
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 70312
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
#define REP(i, d, n) for(int i=(d); i<(n); i++)
typedef long long ll;
const int mod = 1e9 + 7;
int main() {

    int n;
    string s;
    cin >> n >> s;

    int ans = 0;
    rep(i, n-2){
        string tmp = s.substr(i, 3);
        if(tmp == "ABC"){
            ans++;
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.util.stream.IntStream;

public class Main {

    public static boolean found = false;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();

        int minSec = Integer.MAX_VALUE;
        int maxSec = 0;

        for (int i = 0; i < 101; i++) {
            boolean alice = (a <= i && i <= b);
            boolean bob = (c <= i && i <= d);

            if (alice && bob) {
                maxSec = Math.max(maxSec, i);
                minSec = Math.min(minSec, i);
            }
        }

        if (minSec == Integer.MAX_VALUE) {
            System.out.println("0");
        } else {
            System.out.println(maxSec - minSec);
        }
    }

}

Measured memory_bytes: 21844
gets
a = gets.split.map(&:to_i).sort
p = Hash.new(0)
a.each do |x|
  p[x] += 1
end
q = 10 ** 6 + 1
f = [true] * q
p.each do |k, v|
  f[k] = false if v > 1
  (k + k).step(q, k) do |i|
    f[i] = false
  end

end
puts a.select{|x| f[x]}.size

Measured memory_bytes: 46076
<?php
$A = trim(fgets(STDIN));
$B = trim(fgets(STDIN));
$C = trim(fgets(STDIN));
$X = trim(fgets(STDIN));
$cnt = 0;

for ($a = min($A, floor($X / 500)); $a >= 0; $a--) {
    for ($b = min($B, floor(($X - 500 * $a) / 100)); $b >= 0; $b--) {
        $c = min($C, floor(($X - 500 * $a - 100 * $b) / 50));
        if ($X == 500 * $a + 100 * $b + 50 * $c) {
            $cnt++;
        }
    }
}

print "{$cnt}\n";

Measured memory_bytes: 4728
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <forward_list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

#define N 200010
#define M 20
int n;
int a[N], b[N][M+1];

int query(int l, int r){
	if(r-l<=0) return n;
	if(r-l<=2) return l;
	int t = 0;
	while(l+(2<<(t+1))<=r) t++;
	int res = b[l][t];
	int res2 = query(l+(2<<t), r);
	return a[res]<a[res2]?res:res2;
}

vector<int> solve(){
	priority_queue<PP,vector<PP>,function<bool(PP,PP)>> q([](const PP &p1, const PP &p2){ return a[p1.fst]>a[p2.fst];});
	q.push(PP(query(0, n), P(0, n)));
	vector<int> res; res.reserve(n);
	while(!q.empty()){
		PP p = q.top(); q.pop();
		int x = p.fst, l = p.snd.fst, r = p.snd.snd;
		res.push_back(x);
		int y = query(x+1, r);
		res.push_back(y);
		if(l<x){
			q.push(PP(query(l, x), P(l, x)));
		}
		if(x+1<y){
			q.push(PP(query(x+1, y), P(x+1, y)));
		}
		if(y+1<r){
			q.push(PP(query(y+1, r), P(y+1, r)));
		}
	}
	return res;
}

int main(){
	scanf("%d", &n);
	rep(i, n) scanf("%d", a+i);
	a[n] = INF;
	rep(i, n) b[i][0] = i;
	rep(j, M) for(int i = n-1; i >= 0; i--){
		b[i][j+1] = b[i][j];
		int i2 = min(i+(2<<j), n-1);
		if(i%2!=i2%2) i2--;
		if(a[b[i][j+1]]>a[b[i2][j]]) b[i][j+1] = b[i2][j];
	}
	vector<int> res = solve();
	for(auto x: res) printf("%d ", a[x]);
	puts("");
	return 0;
}

Measured memory_bytes: 19652
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long int ll;
int main(){
 ll a,b,k;
 cin >> a>>b>>k;
 for(int i=0;i<k;i++){
   if(i%2==0){
     if(a%2==1) a--;
     b+=(a/2);a-=(a/2);
   }
   else{
     if(b%2==1) b--;
     a+=(b/2);b-=(b/2);
   }
 }
 cout <<a<<" "<<b<<endl;
}


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

std::vector<size_t> SetPosList(std::string str, std::string keystr)//先頭に目的のキーがある場合を除く
{
	std::vector<size_t> posList;

	size_t i=0;

	while(1)
	{
		i = str.find(keystr,i);

		if(i==std::string::npos)
		{
			break;
		}

		posList.push_back(i);

		++i;
	}

	return posList;
}


int main()
{
	std::string str;

	getline(std::cin,str);

	std::vector<size_t> posP,posA;

	size_t i=0;

	if(str.find("Apple",i)==0)
	{
		str.replace(0,5,"Peach");
	}
	else if(str.find("Peach",i)==0)
	{
		str.replace(0,5,"Apple");
	}

	posA = SetPosList(str, "apple");

	posP = SetPosList(str, "peach");

	for(size_t j=0; j<posP.size(); ++j)
	{
		str.replace(posP[j],5,"apple");
	}

	for(size_t j=0; j<posA.size(); ++j)
	{
		str.replace(posA[j],5,"peach");
	}

	std::cout << str << '\n';
}

Measured memory_bytes: 1200
use proconio::fastout;
use whiteread::parse_line;

#[fastout]
fn main() {
    let (a, b, k): (usize, usize, usize) = parse_line().unwrap();

    for i in a..=b {
        if i - a + 1 <= k || b - i + 1 <= k {
            println!("{}", i);
        }
    }
}


Measured memory_bytes: 2144
#include<iostream>
#include<cmath>
#include<queue>
#include<algorithm>
using namespace std;
typedef long long ll;
//#define int long long 
int n;
char s[105];
int x;
queue<char> que;
signed main(){
   scanf("%d", &n);
   scanf("%s", s);
   for (int i = 0; i < n; i++)
   {
   		if (s[i] == '(')
		   que.push(s[i]);
		else 
		{
			if (que.empty())
				x++;		
			else
				que.pop();
		}	
   } 
   for (int i = 0; i < x; i++)	printf("(");
   printf("%s", s);
   for (int i = 0; i < que.size(); i++)	printf(")");
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <cmath>
#include <set>
#include <bitset>
#include <queue>

using namespace std;

#define ll long long

int main(void){
    int k;
    cin >> k;

    queue<ll> next;
    for(ll i = 1;i < 10LL;++i){
        next.push(i);
    }
    ll ans;
    for(int i = 0;i < k;++i){
        ans = next.front();
        next.pop();

        ll one = ans - (ans/10LL)*10LL;
        for(ll j = -1LL;j < 2LL;++j){
            if(one + j >= 0LL && one+j < 10LL){
                next.push(10LL*ans + one+j);
            }
        }        
    }

    cout << ans << endl;

    return 0;
}

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

typedef long long ll;
typedef pair<int,int> pii;

long long MOD = 1000000000 + 7;

int main(){
  cout << setprecision(10);
  int N;
  cin >> N;
  N = N % 10;
  string ans;
  if(N == 2 || N == 4 || N == 5 || N == 7 || N == 9){
    ans = "hon";
  } else if(N == 0 || N == 1 || N == 6 || N == 8){
    ans = "pon";
  } else { 
    ans = "bon";
  }
  cout << ans << endl;
}


Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>

using ll = long long;

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

    std::vector<int> div;
    int border = (int)std::sqrt(M) + 1;
    for (int i = 1; i < border; i++)
    {
        if (M %i == 0)
        {
            div.emplace_back(i);
            div.emplace_back(M / i);
        }
    }

    std::sort(div.begin(), div.end());
    int max = 0;
    for (int i = 0; i < div.size(); i++)
    {
        if (div[i] > M / N) break;
        max = div[i];
    }

    std::cout << max << std::endl;
}

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

int main(){
    int N;
    cin >> N;
    vector<int> p(N);
    vector<int> q(N);
    for (int i = 0; i < N; i++){
        cin >> p.at(i);
    }
    for (int i = 0; i < N; i++){
        cin >> q.at(i);
    }

    vector<int> v(N);
    for (int i = 0; i < N; i++){
        v.at(i) = i + 1;
    }
    int count = 1;
    int a,b;
    do{
        if (v == p){
            a = count;
        }
        if (v == q){
            b = count;
        }
        count++;
    }while(next_permutation(v.begin(),v.end()));

    cout << abs(a - b) << endl;
}

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

long double pot[50];
int main(){
    
    pot[0] = 1;
    for(int i = 1; i <= 30; i++)
        pot[i] = pot[i-1] * 0.5;
    

    int n, k; cin >> n >> k;
    long double res = 0;
    for(int i = 1; i <= n; i++){
        int aux = 0, j = i;
        while(j < k) j *= 2, aux++;
        res += pot[aux];
    }
    res /= n;
    printf("%.11LF\n", res);
	return 0;
}


Measured memory_bytes: 256
strong = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1]
a, b = map(int, input().split())
if strong.index(a) == strong.index(b):
    print("Draw")
elif strong.index(a) > strong.index(b):
    print("Alice")
else:
    print("Bob")


Measured memory_bytes: 2940
package main

import (
	"fmt"
	"sort"
)

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

	others := []int{}
	for range make([]struct{}, n) {
		var s int
		fmt.Scan(&s)
		sum += s
		if s%10 == 0 {
			tens += s
		} else {
			others = append(others, s)
		}
	}
	ans := sum
	if sum%10 == 0 {
		if len(others) > 0 {
			sort.Ints(others)
			ans -= others[0]
		} else {
			ans = 0
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())

def digit(n):
    l = 0
    while n:
        l += 1
        n //= 10
    return l

ans = 100
i = 1
while i ** 2 <= n:
    if n % i == 0:
        #ans = min(ans, max(len(str(i)), len(str(n // i))))
        ans = min(ans, max(digit(i), digit(n // i)))
    i += 1
print(ans)


Measured memory_bytes: 65692
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

#[allow(unused_imports)]
use std::cmp;

fn main() {
    input!{
        n: usize,
        ss: chars,
    }

    let mut a = 0;
    for i in 1..n {
        if ss[i] == 'E' {
            a += 1;
        }
    }
    let mut min = a;
    for i in 1..n {
        let mut an = a + if ss[i-1] == 'W' { 1 } else { 0 };
        if ss[i] == 'E' {
            an -= 1;
        }
        a = an;
        min = cmp::min(an, min);
    }
    println!("{}", min);
}


Measured memory_bytes: 6396
n=int(input())
hl=list(map(int,input().split()))
c=0
mi=min(hl)
c+=mi
hdebug=hl[:]
hdebug.append(0)
if mi!=0:
  for i in range(len(hl)):
    hl[i]-=mi
hl.append(0)
for x in range(100):
  a=101
  for i in range(len(hl)):
    if hl[i]!=0 and a>hl[i] and a==101:
      a=i
    if hl[i]==0 and a<i:
      mi2=min(hl[a:i])
      c+=mi2
      for j in range(a,i):
        hl[j]-=mi2
print(c)

Measured memory_bytes: 3064
import collections
N = int(input())
A_list = list(map(int, input().split()))
c = collections.Counter(A_list)
result = sum(A_list)
Q = int(input())

for _ in range(Q):
    B,C = map(int,input().split())
    result += (C-B) * c[B]
    c[C] += c[B]
    c[B] = 0
    print(result)

Measured memory_bytes: 24168
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] ch = s.toCharArray();
		sc.close();

		int cnt = 0;
		for (int i = 0; i < ch.length; i++) {
			if (ch[i] == 'o') {
				cnt++;
			}
		}
		if (cnt + 15 - ch.length >= 8) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}


Measured memory_bytes: 23252
#include <stdio.h>

int main() {
	int i, j;
	int n, p;
	
	while (1) {
		scanf("%d%d", &n, &p);
		if (n == 0) {
			break;
		}
		int owan = p;
		int child[n];
		int turn = -1;
		for (j = 0; j < n; j++) {
			child[j] = 0;
		}
		
		do {
			turn = (turn + 1) % n;
			if (owan > 0) {
				child[turn]++;
				owan--;
			} else {
				owan += child[turn];
				child[turn] = 0;
			}
		} while (child[turn] != p);
		printf("%d\n", turn);
	}
	
	return 0;
}

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

// using namespace __gnu_pbds;
using namespace std;

#define fbo find_by_order
#define ook order_of_key
#define fi first
#define se second
#define long long long
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// void initiate_random() { mt19937_64 rng(std::chrono::system_clock::now().time_since_epoch().count()); }

// /mnt/c/Users/vince/Desktop/POST-IOI/Codeforces/Regular/670

int main()
{
	// ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	// freopen("input.in", "r", stdin);

	long a, b, c, d;
	scanf("%lld %lld %lld %lld", &a, &b, &c, &d);

	long res = max(max(a*c, a*d), max(b*c, b*d));
	printf("%lld\n", res);
}

Measured memory_bytes: 3820
N = int(input())
dp = [[0]*3 for _ in range(N+1)]
happy = [[0]*3 for _ in range(N)]

for i in range(N):
    a, b, c = [int(s) for s in input().split()]
    happy[i][0] = a
    happy[i][1] = b
    happy[i][2] = c

for i in range(N):
    for j in range(3):
        for k in range(3):
            if j!= k:
                dp[i+1][k] = max(dp[i+1][k], dp[i][j] + happy[i][j])

ans = max(dp[N][0],dp[N][1],dp[N][2])
print(ans)

Measured memory_bytes: 68524
import java.util.*;
import static java.lang.Math.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int[] b = new int[n];
		for(int i = 0; i < n; i++){
		    b[i] = sc.nextInt()-1;
		}
		
		// 計算
		int result = -1;
		int index = 0;
		int next = 0;
		for(int i = 0; i < n; i++){
		    if(b[index] < 0) break;
		    if(b[index] == 1){
		        result = i+1;
		        break;
		    }else{
		        next = b[index];
		        b[index] = -1;
		    }
		    index = next;
		}
		
		
		// 出力
		System.out.println(result);
	}
}


Measured memory_bytes: 50816
import numpy as np
n = int(input())
a = list(int(i) for i in input().split())  

x = -float("inf")
for i in range(n):
  if a[i] < x:
    if a[i] == x - 1:
      pass
    else:
      print('No')
      exit()
  else:
    x = a[i]
print('Yes')

Measured memory_bytes: 23084
#include <iostream>
#include <vector>
#include <bitset>
using namespace std;
#define COUT(x) cout<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl


const int MAX_ROW = 2600; // to be set appropriately
const int MAX_COL = 2600; // to be set appropriately
struct BitMatrix {
    int H, W;
    bitset<MAX_COL> val[MAX_ROW];
    BitMatrix(int m = 1, int n = 1) : H(m), W(n) {}
    inline bitset<MAX_COL>& operator [] (int i) {return val[i];}
};

ostream& operator << (ostream& s, BitMatrix A) {
    s << endl; 
    for (int i = 0; i < A.H; ++i) {
        for (int j = 0; j < A.W; ++j) {
            s << A[i][j] << ", ";
        }
        s << endl;
    }
    return s;
}

int GaussJordan(BitMatrix &A, bool is_extended = false) {
    int rank = 0;
    for (int col = 0; col < A.W; ++col) {
        if (is_extended && col == A.W - 1) break;
        int pivot = -1;
        for (int row = rank; row < A.H; ++row) {
            if (A[row][col]) {
                pivot = row;
                break;
            }
        }
        if (pivot == -1) continue;
        swap(A[pivot], A[rank]);
        for (int row = 0; row < A.H; ++row) {
            if (row != rank && A[row][col]) A[row] ^= A[rank];
        }
        ++rank;
    }
    return rank;
}

int linear_equation(BitMatrix A, vector<int> b, vector<int> &res) {
    int m = A.H, n = A.W;
    BitMatrix M(m, n + 1);
    for (int i = 0; i < m; ++i) {
        for (int j = 0; j < n; ++j) M[i][j] = A[i][j];
        M[i][n] = b[i];
    }
    int rank = GaussJordan(M, true);

    // check if it has no solution
    for (int row = rank; row < m; ++row) if (M[row][n]) return -1;

    // answer
    res.assign(n, 0);
    for (int i = 0; i < rank; ++i) res[i] = M[i][n];
    return rank;
}



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

int R, C;
const int MOD = 1000000009;

long long modpow(long long a, long long n, long long m) {
    if (n == 0) return 1 % m;
    long long t = modpow(a, n/2, m);
    t = t*t % m;
    if (n & 1) t = t*a % m;
    return t;
}

int main() {
    cin >> R >> C;
    BitMatrix A(R*C, R*C);
    vector<int> b(R*C), res;
    for (int i = 0; i < R; ++i) for (int j = 0; j < C; ++j) cin >> b[i*C + j];
        
    for (int i = 0; i < R; ++i) {
        for (int j = 0; j < C; ++j) {
            int c = i*C + j;
            A[c][c] = 1;
            for (int k = 0; k < 8; ++k) {
                for (int l = 0; l < 50; ++l) {
                    int ni = i + dx[k]*l, nj = j + dy[k]*l;
                    if (ni < 0 || ni >= R || nj < 0 || nj >= C) break;
                    A[ni*C+nj][c] = 1;
                }
            }
        }
    }
         
    int rank = linear_equation(A, b, res);
    if (rank == -1) cout << 0 << endl;
    else cout << modpow(2LL, R*C - rank, MOD) << endl;
}



Measured memory_bytes: 5668
#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
int n,m,a[101000],b[101000];
map<int,int>f;
map<int,set<int,greater<int> > >s;
void add(int x,int v){for(;x<=mod;x+=x&-x)f[x]=(f[x]+v)%mod;}
int qry(int x){int t=0;for(;x;x-=x&-x)t=(t+f[x])%mod;return t;}
int main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<=m;i++)cin>>b[i];
	for(int i=1;i<=n;i++)
	{
		int p=lower_bound(b+1,b+m+1,a[i])-b;
		if(p>=2&&p<=m)s[a[i]-b[p-1]].insert(b[p]-a[i]);
	}
	add(1,1);
	for(map<int,set<int,greater<int> > >::iterator it1=s.begin();it1!=s.end();it1++)for(set<int,greater<int> >::iterator it2=((*it1).second).begin();it2!=((*it1).second).end();it2++)add((*it2)+1,qry(*it2));
	cout<<qry(mod)<<endl;
	return 0;
}

Measured memory_bytes: 68096
#include <stdio.h>
#include <string.h>
   
int main() {
          int A;
          int B;
          scanf("%d %d", &A, &B);
          
          
          if((A + B) >= 10) {
          printf("error");
          printf("\n");
          } else {
          printf("%d",  (A + B));
          printf("\n");
          return 0;
      }     
  }

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

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

/* REPmacro */
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOREACH(x, a) for(auto x : a)

/* function */
#define IN(x) cin >> x
#define DEBUG(x) cerr << (x) << " "
#define LN() cerr << "\n"
#define PRINT(x) cout << (x) << endl
#define BR cout << endl

/* const */
const int ARRAY = 100005;
const int INF = 1001001001; // 10^9
const ll LINF = 1001001001001001001; // 10^18
const int MOD = 1e9 + 7;



ll N = 0;
ll K;
ll tmp;
ll ret = 0;
vector<ll> A;
vector<ll> B;

void input() {
  IN(N);
  IN(K);
  REP(i, N) {
    IN(tmp);
    A.pb(tmp);
    B.pb(tmp);
  }
}

void solve() {
  ll a = K*(K-1)/2;
  sort(ALL(B), greater<ll>());

  FOR(i, 0, N) {
    FOR(j, i+1, N) {
      if (A[i] > A[j]) {
        ret += K;
        ret %= MOD;
      }
      if (B[i] > B[j]) {
        ret += a;
        ret %= MOD;
      }
    }
  }



  PRINT(ret);
}

int main(void){
  input();
  solve();
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define endl '\n'
using namespace std;
const ll mod = (ll)1e9+7;
const int INF = 0x3f3f3f3f;
ll max(ll a, ll b){return a > b ? a : b;}
ll min(ll a, ll b){return a < b ? a : b;}

int mpow(int b, int e)
{
    int ret=1;
    for(int i=0; i<e; i++)
    {
        ret=ret*b%mod;
    }
    return ret;
}

ld a[3000];
ld dp[3001][3001];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    ld p;
    cin >> n;
    dp[0][0] = 1.0;
    for(int i=1; i<=n; i++)
    {
        cin >> p;
        dp[0][i] = dp[0][i-1]*p;
        dp[i][0] = dp[i-1][0]*(1.0-p);
        for(int j=1; j<i; j++)
        {
            dp[j][i-j] += dp[j-1][i-j]*(1.0-p)+dp[j][i-j-1]*(p);
        }
    }
    ld ans=0;
    //for(int i=0; i<=n; i++){cout << endl; for(int j=0; j<=n; j++) cout << dp[i][j] << ' ';}
    for(int i=n; i>n/2; i--) ans += dp[n-i][i];
    cout << fixed << setprecision(10) << ans;
}

Measured memory_bytes: 139648
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

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

#define MP make_pair
#define EACH(i,c) for(auto i: c)
#define SORT(c) sort((c).begin(),(c).end())

#define ALL(a)  (a).begin(),(a).end()

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int N;
	cin >> N;
	vector<PII> X(N);

	REP(i, N){
		cin >> X[i].second >> X[i].first;
	}

	sort(ALL(X), greater<PII>());

	int t = X[0].first;

	REP(i, N){
		t -= X[i].second;
		t = min(t, X[i].first - X[i].second);
	}

	if(t < 0){
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
	return 0;
}


Measured memory_bytes: 1792
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    int x,y,ans=0; cin>>x>>y;
    if(x<=3) ans+=(4-x)*100000;
    if(y<=3) ans+=(4-y)*100000;
    if(x==1 && y==1) ans+=400000;
    cout<<ans<<endl;
}


Measured memory_bytes: 3632
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   main.cpp                                           :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: monoue <marvin@student.42.fr>              +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/04/22 12:30:15 by monoue            #+#    #+#             */
/*   Updated: 2020/04/26 21:12:46 by monoue           ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include <bits/stdc++.h>

/* #include <boost/multi_array.hpp> */
/* #include <boost/optional.hpp> */
/* #include <boost/range/irange.hpp> */
/* #include <boost/range/algorithm.hpp> */
/* #include <boost/range/adaptors.hpp> */
/* #include <boost/multiprecision/cpp_int.hpp> */
/* #include <boost/algorithm/string/classification.hpp> // is_any_of */
/* #include <boost/algorithm/string/split.hpp> */
/* #include <boost/algorithm/string/join.hpp> */
/* #include <boost/algorithm/string/replace.hpp> */
/* #include <boost/math/tools/minima.hpp> */
/* namespace adaptor = boost::adaptors; */
/* using boost::math::tools::brent_find_minima; */
/* using boost::irange; */
/* using boost::algorithm::join; */
/* using boost::algorithm::split; */
/* using boost::algorithm::replace_all; */
/* using boost::multiprecision::cpp_int; */

#define MOD 1e9+7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = (n); i >= 0; --i)

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

// TOP
void	Main()
{
	ll	n;
	cin >> n;

	vector<string>	V(n);
	rep(i, n)
		cin >> V.at(i);
	sort(V.begin(), V.end());
	auto itr = unique(V.begin(), V.end());
	V.erase(itr, V.end());
	cout << V.size() << endl;
}
// END

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


Measured memory_bytes: 9540
#include<bits/stdc++.h>
using namespace std;
#define int long long
vector<int> arr;
int fum(int a ,int b)
{if(a==0)
return 0;
    if(a>b)
        return fum(b,a);
    int ans=0;
    ans+=(b/a)*3*a;
    return ans+fum((b)%a,a);
}
int n,x;
 main()
{
scanf("%lld%lld",&n,&x);
printf("%lld\n",fum(x,n-x));
return 0;}


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

using namespace std;

typedef long long ll;

int main() {
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	map<ll, int> mp;
	ll ans = 0;
	ll s = 0;
	mp[0] = 1;
	for (int i = 0; i < n; ++i) {
		int a;
		cin >> a;
		s += a;
		ans += mp[s];
		mp[s]++;
	}
	cout << ans << endl;
}


Measured memory_bytes: 12800
////////////////////////// Author
////////////////////////// Nasim Hossain Rabbi
////////////////////////// JU-CSE28
////////////////////////// CF - imnasim3.1415
////////////////////////// UVA - imnasim3.1415
////////////////////////// Mail - imnasim3.1415@gmail.com
#include<bits/stdc++.h>
using namespace std;
#define E end()
#define B begin()
#define sz size()
#define EM empty()
#define clr clear()
#define sqr(a) (a*a)
#define mk make_pair
#define pb push_back
string en="\n";
string t="hello";
string Y="YES\n";
string N="NO\n";
#define rep(i,n) for(i=0;i<n;i++)
#define Rep(i,n) for(i=1;i<=n;i++)
#define per(i,n) for(i=n-1;i>=0;i--)
#define peR(i,n) for(i=n;i>0;i--)
#define mem(a,b) memset(a,b,sizeof(a))
#define all(cont) cont.begin(),cont.end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL)
#define pi 3.1415926535897932384626433832795
#define vi vector<int>
#define vl vector<long long>
#define vs vector<string>
#define vp(vi,x) cin>>x; vi.pb(x);
#define srch(a,x) binary_search(all(a),x)
#define LB(a,x) (lower_bound(all(a),x)-a.B)
#define UB(a,x) (upper_bound(all(a),x)-a.B)
typedef long long LL;
typedef unsigned long long ULL;
bool isprm(LL a){for(LL i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
bool isVowel(char ch){ ch=toupper(ch); if(ch=='A'||ch=='U'||ch=='I'||ch=='O'||ch=='E') return true; return false;}
int toInt(string s){int sm;stringstream ss(s);ss>>sm;return sm;}
template<typename T>inline T gcd(T a,T b){if(a<0)return gcd(-a,b);if(b<0)return gcd(a,-b);return (b==0)?a:gcd(b,a%b);}
template<typename T>inline T lcm(T a,T b) {if(a<0)return lcm(-a,b);if(b<0)return lcm(a,-b);return a*(b/gcd(a,b));}
int main()
{
//    fast;
    LL i,j,k,n,m,l,s=0,x,y,tc=1,c=0;
    while(cin>>n)
    {
        vi a;
        rep(i,n)
        {
            vp(a,x);
        }
        sort(all(a));
        x=a[n-1]-a[0];
        cout<<x<<en;
    }
}




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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    vector<int> a(3);
    rep(i, 3) cin >> a[i];
    ll ans = 0;

    int x=0, y=0;
    rep(i, 3) if (a[i]%2) x++; else y++;
    if (x > y and y > 0) {
        rep(i, 3) if (a[i]%2) a[i]++;
        ans++;
    }
    else if (y > x and x > 0) {
        rep(i, 3) if (a[i]%2==0) a[i]++;
        ans++;
    }

    sort(a.begin(), a.end());
    int ma = a[2];
    rep(i, 2) {
        ans += (ma-a[i])/2;
    }

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


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

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

    int n=1e4;
    cin >> n;
    vi ans(n+1);
    auto f = [] (ll i,ll j,ll k) -> ll{
        return i*i + j*j + k*k + i*j + j*k + k*i;
    };

    rep(i,1,100) rep(j,1,100) rep(k,1,100) {
        ll foo = f(i,j,k);
        if(foo <= n) ans[foo]++; 
    }
    rep(i,1,n) cout << ans[i] << endl;

    time_taken();
    return 0;
}

Measured memory_bytes: 3736