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

using namespace std;

int flag[100020];

int main(){

    int n,m;
    int u,v;

    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>u>>v;
        flag[u]++;
        flag[v+1]--;
    }
    int cnt = 0;
    for(int i=1;i<=n;i++){
        flag[i] = flag[i]+flag[i-1];
        if(flag[i]==m)cnt++;
    }

    printf("%d\n",cnt);

    return 0;
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep2(i, m, n) for(int i=int(m); i<int(n); ++i)
#define drep2(i, m, n) for(int i=int(m-1); i>=int(n); --i)
#define rep(i, n) rep2(i, 0, n)
#define drep(i, n) drep2(i, n, 0)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = vector<V>;
using VVll = vector<Vll>;
using VVld = vector<Vld>;
using VVbo = vector<Vbo>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using Pld = pair<ld, ld>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (auto &e : v) is >> e; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { for (auto &e : v) os << e << " "; return os; }
template<typename T> inline int count_between(vector<T> &a, T l, T r) { return lower_bound(all(a), r) - lower_bound(all(a), l); } // [l, r)
inline int Log2(ll x) { int k; for (k = 0; x > 0; ++k) x >>= 1; return k; } // number of binary digits
const int INF  = 1<<30;
const ll INFll = 1ll<<62;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;


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

  set<string> S;
  rep(i, n) {
    string s; cin >> s;
    S.insert(s);
  }
  ll ans = S.size();
  cout << ans << endl;
  return 0;
}


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

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

using namespace std;

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

    int n;
    cin >> n;
    ll a[n+1];
    REP(i,n) cin >> a[i];

    FOR(i,1,n) a[i] += a[i-1];
    a[n] = 0;
    sort(a,a+n+1);
    ll ans=0,kpa=a[0],cnt=0;

    FOR(i,1,n+1){
        if(kpa==a[i]) ++cnt;
        else{
            ans += (cnt+1)*cnt/2;
            kpa = a[i];
            cnt = 0;
        }
    }
    ans += (cnt+1)*cnt/2;

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


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

int main(){
    ll N;
    cin >> N;
    vector<ll> a(N);
    ll M = 0;
    rep(i,N){
        cin >> a[i];
    }
    bool oddf= false;
    rep(i,N){
        if(a[i] % 2 == 1){
            oddf = true;
        }
    }
    cout << ((oddf)?"first":"second")<<endl;
}

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

int main(){
  int n;
  cin >> n;
  std::vector<string> s(n);
  std::map<string, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> s.at(i);
    mp[s.at(i)] = 0;
  }
  for (int i = 0; i < n; i++) {
    mp[s.at(i)]++;
  }
  std::cout << mp.size() << '\n';
  return 0;
}


Measured memory_bytes: 25100
#include <stdio.h> 
#include <string.h>
int min(int a, int b) {
	return (a < b) ? a : b;
}

int main() {
	int ans = 0,nagasa=0,tmp1 = 0,tmp2 = 0;
	char S[100001] = {};
	scanf("%s",S);
	nagasa = strlen(S);
	for (int i = 0; i < nagasa;)
	{
		if (S[i] != '0')
		{
			tmp1 += 1;
		}
		i+=2;
	}
	for (int i = 1; i < nagasa;)
	{
		if (S[i] != '1')
		{
			tmp1 += 1;
		}
		i += 2;
	}
	for (int i = 0; i < nagasa;)
	{
		if (S[i] != '1')
		{
			tmp2 += 1;
		}
		i += 2;
	}
	for (int i = 1; i < nagasa;)
	{
		if (S[i] != '0')
		{
			tmp2 += 1;
		}
		i += 2;
	}
	ans = min(tmp1, tmp2);
	printf("%d", ans);
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6+10;
const ll LINF=1e18;
using namespace std;
    
#define rep(i,n) for(ll (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrrep(i,a,b) for(ll i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define doublecout(a) cout<<fixed<<setprecision(15)<<a<<endl;
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 
#define U_MAP unordered_map<ll,ll>
#define pq priority_queue<ll>
#define rpq priority_queue<ll,vector<ll>,greater<ll>>
#define p_b push_back
    
ll n,cnt,ans,a,b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos,k,q;
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};
ll dat[ohara];
    
//------ Believe yourself as a genius!!!!!! ------
    
int main(void){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>n>>m;
    rep(i,m){
        cin>>a>>b;
        dat[a]++;
        dat[b]++;
    }
    rrep(i,1,n+1){
        Cout(dat[i]);
    }
    return 0;
}

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

int main(){
    int n; cin >> n;
    int a[n];
    int minj;
    int tmp;
    int cnt = 0;

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

    for(int i=0;i<n;i++){
        minj = i;
        for(int j=i;j<n;j++){
            if(a[j]<a[minj]){
                minj = j;
            }
        }
        if(i!=minj){
            tmp = a[i];
            a[i] = a[minj];
            a[minj] = tmp;
            cnt++;
        }
    }

    for(int i=0;i<n;i++){
        cout << a[i];
        if(i==n-1){
            cout << endl;
        }else{
            cout << " ";
        }
    }
    cout << cnt << endl;
    return 0;
}



Measured memory_bytes: 3120
#include <iostream>
#include <string>
#include <cmath>
#include <stdio.h>

using namespace std;

int main(void)
{
    string s, t;
    cin >> s;
    cin >> t;

    for (int i = 0; i < s.length(); i++) {
        if (s[i] != t[i]) {
            cout << "No";
            return 0;
        }
    }

    cout << "Yes";
    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<iterator>
#include<complex>
#include<stack>
#include "stdio.h"
using namespace std;

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

using ll = long long;
using Pii = pair<int, int>;

const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const long long mod_const = 1e9+7;

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

using MIte = multimap<ll, ll, greater<ll> >::iterator;



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

	// long long?
	int A, B;
	cin >> A >> B;

	cout << max(A - 2 * B, 0) << endl;

	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<string>
#include<vector>
#include<string.h>
using namespace std;
char ty[3];
char A[10000];
char B[10000];
string solve(int al,int ar,int bl,int br){
	int has=0;
	int am,bm;
	for(int i=al;i<ar;i++){
		if(A[i]=='(')has++;
		else if(A[i]==')')has--;
		if(has==1&&A[i]==','){
			am=i;break;
		}
	}
	has=0;
	for(int i=bl;i<br;i++){
		if(B[i]=='(')has++;
		else if(B[i]==')')has--;
		if(has==1&&B[i]==','){
			bm=i;break;
		}
	}
	string ret="(";
	if(al+1==am){
		if(ty[0]=='u'){
			for(int i=bl+1;i<bm;i++)ret+=B[i];
		}
	}else if(bl+1==bm){
		if(ty[0]=='u'){
			for(int i=al+1;i<am;i++)ret+=A[i];
		}
	}else{
		ret+=solve(al+1,am,bl+1,bm);
	}
	ret+=",";
	if(am+1==ar-1){
		if(ty[0]=='u'){
			for(int i=bm+1;i<br-1;i++)ret+=B[i];
		}
	}else if(bm+1==br-1){
		if(ty[0]=='u'){
			for(int i=am+1;i<ar-1;i++)ret+=A[i];
		}
	}else{
		ret+=solve(am+1,ar-1,bm+1,br-1);
	}
	ret+=")";
	//printf("%d %d %d %d: %s\n",al,ar,bl,br,ret.c_str());
	return ret;
}
int main(){
	while(~scanf("%s%s%s",ty,A,B)){
		int an=strlen(A);
		int bn=strlen(B);
		printf("%s\n",solve(0,an,0,bn).c_str());
	}
}

Measured memory_bytes: 1036
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) FOR(i,0,b)
#define INF 1e9

using ll = long long;
const ll mod = LLONG_MAX;


int main(){

  ll a,b,c,ans=0;
  cin>>a>>b>>c;
  if(a==b&&b==c && b%2==0){
    cout<<-1<<endl;
    return 0;
  }
  if(a==b&&b==c && b%2==1){
    cout<<0<<endl;
    return 0;
  }

  while(1){
    if(a%2==1 || b%2==1 || c%2==1)break;

    ll a_temp=a/2;
    ll b_temp=b/2;
    ll c_temp=c/2;

    a=0,b=0,c=0;
    a=b_temp+c_temp;
    b=a_temp+c_temp;
    c=a_temp+b_temp;
    ans++;
  }
  cout<<ans<<endl;

}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
	public static void main(String[] args) {
		var sc = new Scanner(System.in);
		var n = sc.nextInt();
		var a = IntStream.range(0, n).map(i -> sc.nextInt()).toArray();
		sc.close();

		Arrays.sort(a);
		var set = new HashSet<Integer>();
		var gcd = 0;
		var check = false;
		for (var i = 0; i < n; i++) {
			if (i == 0) {
				gcd = a[0];
			} else {
				gcd = gcd(gcd, a[i]);
			}
			if (!check) {
				for (var div : getDivisors(a[i])) {
					if (set.contains(div)) {
						check = true;
					}
					set.add(div);
				}
			}
		}

		if (gcd > 1) {
			System.out.println("not coprime");
		} else if (check) {
			System.out.println("setwise coprime");
		} else {
			System.out.println("pairwise coprime");
		}
	}

	public static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}

	public static List<Integer> getDivisors(int n) {
		var list = new ArrayList<Integer>();
		for (var i = 1; i < (long) Math.sqrt(n) + 1; i++) {
			if (n % i == 0) {
				list.add(i);
				var divisor = n / i;
				if (divisor != i) {
					list.add(divisor);
				}
			}
		}

		Collections.sort(list);
		list.remove(0);
		return list;
	}
}


Measured memory_bytes: 68556
#include <stdio.h>
#include <stdlib.h>
#define CONTEST_TYPE 26


//まずは、満足度低下を考えずやってみる

int get_max_satisfuction_of_day(int satisfuctions[]){
	int max = 0;
	int max_index ;
	for (int i = 0; i < CONTEST_TYPE; i++){
		if (max < satisfuctions[i]){
			max = satisfuctions[i];
			max_index = i;
		}
		//printf("satisfuctions[%d] = %d, max = %d\n", i, satisfuctions[i], max);
	}
	return max_index;
}


int main(void) {

	int days;
	int low_of_satisfuction[CONTEST_TYPE];
	int satisfuction[days][CONTEST_TYPE];
	int output_days[days];


	/*入力処理開始*/
	scanf("%d", &days);

	for (int i = 0; i < CONTEST_TYPE; i++ ){
		scanf("%d", low_of_satisfuction + i);
	}

	for (int i = 0; i < days; i++){

		for (int j = 0; j < CONTEST_TYPE; j++ ){
			int w;
			scanf("%d", &w);
			satisfuction [i][j] = w;
		}
	}
	for (int i = 0; i < days; i++){
		for (int j = 0; j < CONTEST_TYPE; j++){
			//printf("%d ", satisfuction[i][j]);
		}
		//printf("\n");
	}
	/*入力処理終了*/


	/*各日の満足度最高のコンテストを抽出*/
	for (int i = 0; i < days; i++){
		output_days[i] = get_max_satisfuction_of_day(satisfuction[i]);
		printf("%d\n", output_days[i] + 1);
	}


	return 0;
}



Measured memory_bytes: 1780
#include <iostream>

int main(){
	using namespace std;
	string str,sstr;
	int i = 0,leng = 0;
	cin >> leng;
	char astr[2 * leng];
	cin	>> str >> sstr;
	for (i = 0; i < leng;i++) {
		astr[2 * i] = str[i];
		astr[2 * i + 1] = sstr[i];
	}
	for (i = 0; i < 2 * leng;i++) {
		cout << astr[i];
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
using System.Linq;
using System.Text;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Numerics;
using System.Runtime.CompilerServices;

namespace AtCoder
{
    class Program
    {

        const int BiggestMod = 1000000007;

        public static void Main()
        {

            var args = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var memo = new bool[101];
            var x = args[0];

            if (args[1] != 0) args = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            else args = new int[0];

            for (int i = 0; i < 101; i++)
                memo[i] = false;

            foreach (var data in args)
                memo[data] = true;

            int min = 0, max = 101;

            for (int i = x; 0 < i; i--)
                if (memo[i] == false)
                {
                    min = i;
                    break;
                }

            for (int i = x; i < 101; i++)
                if (memo[i] == false)
                {
                    max = i;
                    break;
                }

            if (max - x < x - min)
                Console.WriteLine(max);
            else
                Console.WriteLine(min);

        }

    }

}

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

int main(){
    int N , H , w;
    scanf( "%d%d%d" , &N , &H , &w );
    int Ans = ( N - H + 1 ) * ( N - w + 1 );
    printf( "%d\n" , Ans );
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
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;
}
struct UnionFind {
    vector<int> par;
    
    UnionFind(int n) : par(n, -1) {}

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    bool same(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y);
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x) {
        return -par[root(x)];
    }
};
int main(){
    ll a,b,c,d,f;double e;cin >> a >>b >>c >>d >>e >>f;
    a*=100,b*=100;e=(double)100*e/((double)100+e);
    vl tmp;
    set<ll> w,s;
    ll rp=f/a+1;
    ll x=0;
    rep(i,rp){
        tmp.pb(x);
        x+=a;
    }
    x=0;rp=f/b+1;
    rep(i,rp){
        rep(j,tmp.size()){
            if(tmp[j]+x<=f)w.ins(tmp[j]+x);
        }
        x+=b;
    }
    ll l=e*f/100;
    rp=l/c+1;x=0;
    vl tp;
    rep(i,rp){
        tp.pb(x);
        x+=c;
    }
    rp=l/d+1;x=0;
    rep(i,rp){
        rep(j,tp.size()){
            if(tp[j]+x<=l)s.ins(tp[j]+x);
        }
        x+=d;
    }
    double ans=-1;
    ll weight,swe;
    for(auto p:s){
        for(auto k:w){
            double per=(double)100*p/((double)p+k);
            if(per<=e&&p+k<=f){
                if(chmax(ans,per)){
                    weight=p+k;swe=p;
                }
            }
        }
    }
    cout << weight <<" " <<swe <<endl;
}

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

int  main()
{
	char a,b; cin >> a >> b;

	if (a == 'D')
	{
		if (b == 'D') cout << 'H';
		else cout << 'D';
	}
	else
		cout << b;
	return (0);
}

Measured memory_bytes: 256
w,h,n = map(int,input().split())
x = []
y = []
a = []
for i in range(n):
    xx,yy,aa = map(int,input().split())
    x.append(xx)
    y.append(yy)
    a.append(aa)

l = 0
r = w
t = h
b = 0


for i, aa in enumerate(a):
    if aa == 1:
        l = max(l,x[i])
    elif aa == 2:
        r = min(r,x[i])

    elif aa == 3:
        b = max(b,y[i])
    elif aa == 4:
        t = min(t,y[i])

ans = max(0,(r-l) * (t-b))
if r-l <= 0 or t-b <= 0:
    ans = 0
print(ans)


Measured memory_bytes: 3064
from collections import deque

N,Q = map(int, input().split())
es = [[] for _ in range(N)]

for i in range(N-1):
    a,b = map(int, input().split())
    es[a-1].append(b-1)
    es[b-1].append(a-1)

ans = [0] * N
for _ in range(Q):
    p,x = map(int, input().split())
    ans[p-1] += x

checked = [False] * N
q = deque()
q.append(0)
while q:
    node = q.popleft()
    checked[node] = True
    for nxt in es[node]:
        if not checked[nxt]:
            ans[nxt] += ans[node]
            q.append(nxt)
        

print(*ans)

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

int main() {
	int N, M;
	cin >> N >> M;
	vector<int>p(M);
	vector<string>s(M);

	for (int i = 0; i < M; i++) {
		cin >> p.at(i) >> s.at(i);
		p.at(i)--;
	}

	int CO = 0, PE = 0;
	vector <int>AC(N,0);
	vector <int>WA(N);


	for (int i = 0; i < M; i++) {
		if (s.at(i) == "WA") {
			WA.at(p.at(i))++;
		}
		if (s.at(i) == "AC" && AC.at(p.at(i)) != 1) {
			CO++;
			PE += WA.at(p.at(i));
			AC.at(p.at(i)) = 1;
		}
	}

	cout << CO << " " << PE << endl;
	return 0;
}

Measured memory_bytes: 3712
from math import ceil


n, m = map(int, input().split())
a = list(map(int, input().split()))
a_sum = sum(a)
a.sort(reverse=True)
a_limit = ceil(a_sum / (4 * m))
if a[m-1] < a_limit:
    print('No')
else:
    print('Yes')


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#include<math.h>
#include <stdio.h>
#include<vector>
#include<deque>
#include<stdlib.h>
//#include <algorithm>
#include<set>
#include <limits>
#include<string>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define ll long long
#define d_5 100000
#define d9_7 1000000007

int main(void){
  ll n,k;
  cin >> n >> k;
  ll c=0;
  ll tmp;
  for(ll tk=k+1;tk<=n;tk++){
    if(n/tk>=1){
      c+=(n/tk)*(tk-k);
      //cout << (n/tk)*(tk-k) << endl;
    }
    if(n%tk==0)continue;
    if(k==0){
      tmp=0;
    }else{
      tmp=1;
    }
    c+=max((n%tk)-k+tmp,(ll)0);
    //cout << max((n%tk)-k+1,(ll)0) << endl;
  }
  cout << c;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
#define inf 1e9


int main(){

	int a,b;
	cin>>a>>b;
	if((a*b)%2==0){
		cout<<"Even"<<endl;
	}else{
		cout<<"Odd"<<endl;
	}

	return 0;
}


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

using namespace std;
using ll = long long;

const int MOD = 1e9 + 7;
#define REP(i, n)  for(int i = 0; i < n; ++i)
#define FOR(i, t, n)  for(ll i = t; i <= (ll)n; ++i)
struct edge {
    int from, to;
    ll cost;
};


class Eratosthenes {
public:
    vector<bool> prime;

    Eratosthenes(int size) {
        prime.resize(size + 1, 1);
        prime[0] = 0;
        prime[1] = 0;
        FOR(i, 2, size) {
            if (prime[i]) {
                for (int j = 2 * i; j <= size; j += i) {
                    prime[j] = 0;
                }
            }
        }
    }

};


class Combination {
    vector<ll> fac; //n!(mod M)
    vector<ll> ifac; //k!^{M-2} (mod M)
public:
    Combination(ll size) {
        fac.resize(size);
        ifac.resize(size);
        fac[0] = 1;
        ifac[0] = 1;
        for (ll i = 0; i < size; i++) {
            fac[i + 1] = fac[i] * (i + 1) % MOD;
            ifac[i + 1] = ifac[i] * mpow(i + 1, MOD - 2) % MOD;
        }
    }

    ll mpow(ll x, ll n) {
        ll ans = 1;
        while (n != 0) {
            if (n & 1) ans = ans * x % MOD;
            x = x * x % MOD;
            n = n >> 1;
        }
        return ans;
    }

    ll comb(ll a, ll b) {
        if (a == 0 && b == 0)return 1;
        if (a < b || a < 0)return 0;
        ll tmp = ifac[a - b] * ifac[b] % MOD;
        return tmp * fac[a] % MOD;
    }
};


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

ll N, x;


int main() {
    cin >> N;
    vector<int> A(N), B(N), p(N);
    REP(i, N)cin >> p[i];
    int c = 28376;

    REP(i, N) {
        A[i] = c * (i + 1);
        B[i] = c * (N - i);
    }

    REP(i, N)A[p[i] - 1] += i;

    REP(i, N)cout << A[i] << " ";
    cout << endl;
    REP(i, N)cout << B[i] << " ";
    cout << endl;
    
    return 0;
}


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

struct Point 
{
  double x, y;
  
  Point() {}
  
  Point(double x, double y) : x(x), y(y) {}
  
  void input() { scanf("%lf %lf", &x, &y); }
  void output() { printf("%.10f %.10f\n", x, y); }
  double abs() { return (sqrt(norm())); }
  double norm() { return (x * x + y * y); }
  
  Point operator + (Point d) { return (Point(x + d.x, y + d.y)); }
  Point operator - (Point d) { return (Point(x - d.x, y - d.y)); }
  Point operator - () { return (Point(-x, -y)); }
  Point operator * (double a) { return (Point(x * a, y * a)); }
  Point operator / (double a) { return (Point(x / a, y / a)); }
  
};

struct Segment
{
  Point p1, p2;
  
  Segment() {}
  Segment(Point p1, Point p2) : p1(p1), p2(p2) {}

  void input() { p1.input(); p2.input(); }
  
};

typedef Point Vector;
typedef vector < Point > Polygon;
typedef Segment Line;

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

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

Point project(Line s, Point p)
{
  Vector base = s.p2 - s.p1;
  return (s.p1 + base * (dot(p - s.p1, base) / base.norm()));
}

Point reflect(Line s, Point p)
{
  return (-p + project(s, p) * 2.0);
}


main()
{
  int n;
  Line s;
  
  s.input();
  cin >> n;

  for(int i = 0; i < n; i++) {
    Point p;
    p.input();
    reflect(s, p).output();
  }
  
  
  return (0);
}

Measured memory_bytes: 3200
N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for i in range(N)]

books = []

book_prices = float('inf')

for i in range(2 ** N):
    book = 0
    skill_points = [0] * M
    for j in range(N):
        if (i >> j) & 1:
            book += CA[j][0]
            for k in range(1, M + 1):
                skill_points[k - 1] += CA[j][k]
    X_overs = filter(lambda x: x >= X, skill_points)
    if(len(list(X_overs)) == M):
        book_prices = min(book_prices, book)

print('-1' if book_prices == float('inf') else book_prices)

Measured memory_bytes: 9240
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	using iii = tuple<int,int,int>;
	int n; cin >> n;
	vector<iii> in;
	rep(i, n){
		int w, s, v; cin >> w >> s >> v;
		in.emplace_back(w, s, v);
	}
	sort(all(in), [](iii a, iii b)
		{
			return get<1>(a) + get<0>(a) < get<1>(b) + get<0>(b);
		});
	
	//rep(i, n) dbg(i, get<0>(in[i]), get<1>(in[i]), get<2>(in[i]));
	
	vector<ll> dp(20010);
	for(auto i : in){
		int w, s, v; tie(w, s, v) = i;
		for(int j = s; j >= 0; j--){
			dp[j + w] = max(dp[j + w], dp[j] + v);
		}
	}
	cout << *max_element(all(dp)) << endl;
	return 0;
}

Measured memory_bytes: 512
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input,
  "index" : 0,
  "max" : input.length,
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  },
  "hasNext" : function(){return (this.index < this.max);}
}
Main();
function next(){return obj.next();}
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var list = myconv(next(),6);
  var N = list.length - 1;
  var output = 0;
  for(var i = 0; i < (1 << N); i++){
    var s = list[0];
    for(var j = 0; j < N; j++){
      if((i & (1 << j)) != 0){
         s += "+" + list[j + 1];
      }else{
         s += list[j + 1];
      }
    }
    var adder = s.split("+").map((a) => Number(a));
    for(var j = 0; j < adder.length; j++){
      output += adder[j];
    }
  }
  myout(output);
}


Measured memory_bytes: 7740
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#ifdef __has_include
  #if __has_include(<boost/version.hpp>)
    #include <boost/range.hpp>
    #include <boost/range/irange.hpp>
    #include <boost/range/adaptors.hpp>
    #include <boost/range/algorithm.hpp>
    #include <boost/range/algorithm_ext.hpp>
    using namespace boost;
    using namespace boost::adaptors;
  #endif
#endif

auto init_ = []{
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed;
	return 0;
}();

template <typename T>
inline T in() {
    T x;
    std::cin >> x;
    return x;
}

template <typename T, typename U = std::vector<T>>
inline U in(int n) {
    U v(n);
    for(int i = 0; i < n; ++i) {
        std::cin >> v[i];
    }
    return v;
}

template <typename T, typename U = std::vector<T>, typename V = std::vector<U>>
inline V in(int h, int w) {
    V vv(h, U(w));
    for(int i = 0; i < h; ++i){
        for(int j = 0; j < w; ++j) {
            std::cin >> vv[i][j];
        }
    }
   return vv;
}

template <typename T>
inline void out(const T& x) {
	std::cout << x << std::endl;
}

template <char delimiter = ' ', typename T, typename... Ts>
inline void out(const T& t, const Ts&... ts) {
	std::cout << t << delimiter;
	out(ts...);
}

template <char delimiter = ' ', typename T>
inline void vout(const T& v, int n) {
	for(int i = 0; i < n; ++i) {
		if(i) std::cout << delimiter;
		std::cout << v[i];
	}
	std::cout << std::endl;
}


int main() {
    auto s = in<string>();

    bool f1 = false, f2 = false;
    for(int i = 0; i < s.size(); ++i) {
        if(s[i] == 'C') {
            f1 = true;
        }

        if(s[i] == 'F' && f1) {
            f2 = true;
        }
    }

    cout << (f2 ? "Yes" : "No") << endl;
}

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

using namespace std;

int main() {
	vector <int> list;
	int swaps = 0;
	int size = 0;
	int num = 0;

	scanf("%d", &size);
	for (int i = 0; i < size; i++) {
		scanf("%d", &num);
		list.push_back(num);
	}
	size = size-1;
	for (int i = 0; i <= size; i++) {
		num = i;
		for (int j = i; j <= size; j++) {
			if (list[j] < list[num]) {
				num = j;
			}
		}
		if (i != num) {
			list[i] = list[i] + list[num];
			list[num] = list[i] - list[num];
			list[i] = list[i] - list[num];
			swaps++;
		}
	}
	for (int i = 0; i < size; i++) {
		printf("%d ", list[i]);
	}
	printf("%d\n%d\n", list.back(), swaps);
}



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

int main(){
    ll n;
    cin >> n;
    ll a[3*n];
    priority_queue<ll> que1;
    priority_queue<ll> que2;
    ll maxq[3*n];
    ll minq[3*n];
    memset(maxq,0,sizeof(maxq));
    memset(minq,0,sizeof(minq));
    ll save1=0;
    ll save2=0;
    rep(i,3*n){
        cin >> a[i];
        if(i<n){
            que1.push(-a[i]);
            save1+=(-a[i]);
        }
        if(i>=2*n){
            que2.push(a[i]);
            save2+=a[i];
        }
    }
    maxq[n-1]=save1;
    minq[2*n]=save2;

    for(int i=n;i<2*n;i++){
        que1.push(-a[i]);
        maxq[i]=maxq[i-1]-a[i];
        maxq[i]-=que1.top();
        que1.pop();
    }

    for(int i=2*n-1;i>=n;i--){
        que2.push(a[i]);
        minq[i]=minq[i+1]+a[i];
        minq[i]-=que2.top();
        que2.pop();
    }
    ll ans=-90000000000000000;
    for(int i=n-1;i<2*n;i++){
        ans=max(ans,-maxq[i]-minq[i+1]);
    }

    cout << ans << endl;




}

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

char s[100005];

int main(){

	scanf("%s",s);

	int len=strlen(s);

	if(len%2==0){
		if(s[0]==s[len-1]){
			printf("First\n");
		}
		else{
			printf("Second\n");
		}
	}
	else{
		if(s[0]==s[len-1]){
			printf("Second\n");
		}
		else{
			printf("First\n");
		}
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long double

int main() {
	ll m,t=0,s=0;
	long long n;
	cin>>n>>m;
	ll arr[n];
	for(long long i=0;i<n;i++)
	{
		cin>>arr[i];
		t=t+arr[i];
	}
	//cout<<t<<endl;
	t=t/(4*m);
	//cout<<t<<endl;
	for(long long i=0;i<n;i++)
	{
		if(arr[i]>=t)
		++s;
	}
	//cout<<s<<endl;
	if(s>=m)
	cout<<"Yes";
	else
	cout<<"No";
	return 0;
}

Measured memory_bytes: 256
import itertools
s = list(input())
op = ["+", ""]
tt = 0
for i in itertools.product(op, repeat=len(s)-1):
    t = 0
    ts = ""
    for j, v in enumerate(s):
        ts += v
        if j < len(i) and i[j] != "":
            t += int(ts)
            ts = ""
    t += int(ts)
    tt += t
print(tt)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()


int main(){
    int n;
    cin>>n;
    vector<ll> a(n);

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

    ll sum=0;
    for(auto e : m){
        sum+=e.second*(e.second-1)/2;
    }
    rep(i,n){
        ll x=m[a[i]];
        ll ans=sum-(x*(x-1)/2-(x-1)*(x-2)/2);
        cout<<ans<<endl;
    }

}



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

#define ll long long
#define maxv 1000000000000
#define maxn 200000

int n;
ll k;
ll a[maxn],f[maxn];

int check(ll m){
    ll c=0,temp;
    for(int i=0;i<n;i++){
        temp=m/f[i];
        if(temp<a[n-1-i]){
            c+=a[n-1-i]-temp;
        }
    }
    if(c<=k) return 1;
    else return 0;
}

int main() {
    cin>>n>>k;
    for(int i=0;i<n;i++) cin>>a[i];
    for(int i=0;i<n;i++) cin>>f[i];
    sort(a,a+n);
    sort(f,f+n);
    ll l=0,r=maxv,m,ans;
    while(l<=r){
        m=(l+r)/2;
        if(check(m)){
            ans=m;
            r=m-1;
        }
        else l=m+1;
    }
    m=(l+r)/2;
    if(check(m)) ans=m;
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 3328
#include<iostream>
#include<string>
 
using namespace std;
 
int main()
{
 
	string S;
	int cnt[2] = {0,0};
	int ans = 0;
 
	cin >> S;

	for(int i=0;i<S.size();i++)
	{
		cnt[S[i] - '0']++;
	}

	cout << min(cnt[0],cnt[1])*2 << endl;
 
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
using namespace std;

typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()

vector<ll> A, B;

void sort2vectors_custom(vector<ll> &av, vector<ll> &bv)
{
    ll n = av.size();
    vector<ll> p(n), av2(n), bv2(n);
    iota(all(p), 0);
    sort(all(p), [&](ll a, ll b) { return av[a] + bv[a] > av[b] + bv[b]; });
    rep(i, n)
    {
        av2[i] = av[p[i]];
        bv2[i] = bv[p[i]];
    }
    av = av2;
    bv = bv2;
}

int main()
{
    ll n;
    cin >> n;
    A.resize(n);
    B.resize(n);
    rep(i, n)
    {
        cin >> A[i] >> B[i];
    }
    sort2vectors_custom(A, B);

    ll cnt = 0;
    rep(i, n)
    {
        cnt += i % 2 == 0 ? A[i] : -B[i];
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 4096
// #pragma GCC target("avx")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
// #define BEGIN_STACK_EXTEND(size) void * stack_extend_memory_ = malloc(size);void * stack_extend_origin_memory_;char * stack_extend_dummy_memory_ = (char*)alloca((1+(int)(((long long)stack_extend_memory_)&127))*16);*stack_extend_dummy_memory_ = 0;asm volatile("mov %%rsp, %%rbx\nmov %%rax, %%rsp":"=b"(stack_extend_origin_memory_):"a"((char*)stack_extend_memory_+(size)-1024));
// #define END_STACK_EXTEND asm volatile("mov %%rax, %%rsp"::"a"(stack_extend_origin_memory_));free(stack_extend_memory_);

#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
#include<unordered_set>
#include<unordered_map>
#include<complex>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-20;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3100000;
const int UF_SIZE = 3100000;
namespace{
	long long fact[C_SIZE];
	long long finv[C_SIZE];
	long long inv[C_SIZE];
	long long Comb(int a,int b){
	 	if(a<b||b<0)return 0;
	 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
	}
	void init_C(int n){
		fact[0]=finv[0]=inv[1]=1;
		for(int i=2;i<n;i++){
			inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
		}
		for(int i=1;i<n;i++){
			fact[i]=fact[i-1]*i%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	long long pw(long long a,long long b){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%mod;
			a=a*a%mod;
			b/=2;
		}
		return ret;
	}
	long long pw_mod(long long a,long long b,long long M){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%M;
			a=a*a%M;
			b/=2;
		}
		return ret;
	}
	int pw_mod_int(int a,int b,int M){
		if(a<0)return 0;
		if(b<0)return 0;
		int ret=1;
		while(b){
			if(b%2)ret=(long long)ret*a%M;
			a=(long long)a*a%M;
			b/=2;
		}
		return ret;
	}
	int ABS(int a){return max(a,-a);}
	long long ABS(long long a){return max(a,-a);}
	double ABS(double a){return max(a,-a);}
	int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
	int UF[UF_SIZE];
	void init_UF(int n){
		for(int i=0;i<n;i++)UF[i]=-1;
	}
	int FIND(int a){
		if(UF[a]<0)return a;
		return UF[a]=FIND(UF[a]);
	}
	void UNION(int a,int b){
		a=FIND(a);b=FIND(b);if(a==b)return;
		if(UF[a]>UF[b])swap(a,b);
		UF[a]+=UF[b];UF[b]=a;
	}
}
// ここから編集しろ
char in[110][110];
int main(){
	int a,b,c;scanf("%d%d%d",&a,&b,&c);
	for(int i=0;i<a;i++)scanf("%s",in[i]);
	int ret=0;
	for(int i=0;i<a;i++){
		int cur=0;
		for(int j=0;j<b;j++){
			if(in[i][j]=='.')cur++;
			else{
				ret+=max(0,cur-c+1);
				cur=0;
			}
		}
		ret+=max(0,cur-c+1);
	}
	for(int i=0;i<b;i++){
		int cur=0;
		for(int j=0;j<a;j++){
			if(in[j][i]=='.')cur++;
			else{
				ret+=max(0,cur-c+1);
				cur=0;
			}
		}
		ret+=max(0,cur-c+1);
	}
	
	printf("%d\n",ret);
}


Measured memory_bytes: 2728
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE                                               \
  ifstream in("atcoder-problems/codefestival_2016_qualA_b.txt"); \
  cin.rdbuf(in.rdbuf());
#define print_vec(v)                        \
  rep(l, v.size()) { cout << v[l] << " "; } \
  cout << endl;
#else
#define INPUT_FILE
#define print_vec(v)
#endif
#define CIN_OPTIMIZE \
  cin.tie(0);        \
  ios::sync_with_stdio(false);
typedef pair<int, int> P;
typedef long long ll;
typedef pair<ll, ll> pl;
const int INF = 100100100;
const ll LINF = 1e18 + 100;
const int MOD = 1e9 + 7;

int main() {
  INPUT_FILE CIN_OPTIMIZE;

  int N;
  cin >> N;

  vector<int> c(N);
  rep(i, N) {
    cin >> c[i];
    c[i]--;
  }

  ll ans = 0;
  rep(i, N) {
    int j = c[i];
    if (c[j] == i) ans++;
  }

  cout << ans / 2 << endl;
}

Measured memory_bytes: 3720
#include <iostream>
#include <string>
#include <sstream>
#include <utility>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <cmath>
#include <functional>
#include <chrono>
#include <cstring>

using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<lint> vl;
typedef pair<lint,lint> pll;

#define mpr make_pair


int main()
{
    ios_base::sync_with_stdio(0);    cin.tie(NULL);    cout.tie(NULL);
    int n; cin>>n;
    set<string> cnt;
    string s;
    for (int i=0; i<n; ++i){
        cin>>s;
        cnt.insert(s);
    }
    cout << cnt.size();

}


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


int n;
long long int dp[800005],a[200001];
int h[200001];


long long int maximum(int a,int b,int curr,int z)
{
	if(a > z) return 0;
	if(b <= z) return dp[curr];
	if(b == a) {
		if(a <= z)
		return dp[curr];
		else
		return 0; 
	}
	if(b > a) 
	{
		int mid = (a + b)/2;
		long long int x = maximum(a , mid , 2*curr + 1 , z); 
		long long int y = maximum(mid + 1, b , 2*curr + 2 , z);
		return max(x,y);
	}
	return 0;
}

void update(int curr,int a,int b,long long int z,int i)
{
	// cout<<a<<" "<<b<<" "<<i<<endl;
	if(a > i or b < i){ return ;}
	if(b == a)
	{
		if(a == i) dp[curr] = max(z,dp[curr]);
		return; 
	}
	if(b > a)
	{
		dp[curr] = max(z,dp[curr]);
		update(2*curr + 1 , a, (a + b)/2 , z,i);
		update(2*curr + 2,(a + b)/2 + 1, b,z,i);
	}
}

void fn(int i)
{
	long long int z = maximum(1 ,n, 0 , h[i] - 1) + a[i];
	update(0,1,n,z,h[i]);
}

int main()
{
	cin>>n;
	for (int i = 0; i < n; ++i)
	{
		cin>>h[i];
	}
	for (int i = 0; i < n; ++i)
	{
		cin>>a[i];
	}
	memset(dp,0,sizeof(dp));
	for (int i = 0; i < n; ++i)
	{
		fn(i);
		// cout<<h[i]<<" "<<dp[0]<<endl;
	}
	long long int ans = maximum(1,n,0,n);
	cout<<ans<<endl;
	return 0;
}

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

int main() {
  int h, w;
  cin >> h >> w;
  char pix[2 * h][w];

  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      char c;
      cin >> c;
      pix[2 * i][j] = c;
      pix[2 * i + 1][j] = c;
    }   
  }
  for (int i = 0; i < 2 * h; i++) {
    for (int j = 0; j < w; j++) {
      cout << pix[i][j];
    }   
    cout << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
using ll = long long;
using ld = long double;
using namespace std;

const int N = 2e5 + 64;
ll n;
char s[N];

int m1(int i) {
	int len = 1;
	while (0 <= i - len && i + len < n && s[i - len] == s[i + len]) {
		++len;
	}
	return len;
}

int m0(int i) {
	int len = 0;
	while (0 <= i - len && i + len + 1 < n && s[i - len] == s[i + len + 1]) {
		++len;
	}
	return len;
}

int main() {
#ifdef LC
	assert(freopen("input.txt", "r", stdin));
#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> s;
	n = strlen(s);
	ll ans = n * (n - 1) / 2;
	++ans;
	for (char c = 'a'; c <= 'z'; ++c) {
		ll cnt = count(s, s + n, c);
		ans -= cnt * (cnt - 1) / 2;
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 512
#include <iostream>

void call(int n){
	int i = 1;
	int x = i;

	while(++i <= n){
		x = i;
		if(x % 3 == 0){
			std::cout << " " << i;
			continue;
		}
		while(x){
			if(x % 10 == 3){
				std::cout << " " << i;
				break;
			}
			x /= 10;
		}
	}

	std::cout << std::endl;
	return;
}

int main(int argc, char **argv){
	int n = 0;

	std::cin >> n;
	call(n);
	
	return 0;
}

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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)

using namespace std;

namespace mp = boost::multiprecision;

using ll = long long;
using ul = unsigned long long;
using Bint = mp::cpp_int;
ll mod = 1000000007;

int main() {
source:
    ll a_num, b_num, m;
    cin >> a_num >> b_num >> m;

    ll a[a_num], b[b_num];
    rep(i, a_num) { cin >> a[i]; }
    rep(i, b_num) { cin >> b[i]; }

    ll x[m], y[m], c[m];
    rep(i, m) { cin >> x[i] >> y[i] >> c[i]; }

    ll a_min = a[0], b_min = b[0];
    rep(i, a_num) { a_min = min(a_min, a[i]); }
    rep(i, b_num) { b_min = min(b_min, b[i]); }

    ll ans = a_min + b_min;

    rep(i, m) {
        ll temp = a[x[i] - 1] + b[y[i] - 1] - c[i];
        ans = min(temp, ans);
    }

    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 4096
#include<iostream>
#include<vector>
#include<algorithm>
#define REP(i,n) for(int i=0;i<n;i++)

using namespace std;


int main() {
	string S;
	cin >> S;
	sort(S.begin(), S.end());
	if (S[0] == S[1] && S[1] != S[2] && S[2] == S[3])cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

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

using namespace std;

int main(void){
  
   int a,b,c;
    cin >> a >> b >> c;

   if(b-a == c-b){
	   cout << "YES" << endl;
   }else{
	   cout << "NO" << endl;
   }


} 


Measured memory_bytes: 256
from sys import setrecursionlimit as srl; srl(10**7)
rr = lambda: int(raw_input())
rrm = lambda: map(int, raw_input().split())
 
A,B,C = rrm()
if A==B!=C or A==C!=B or B==C!=A:
    print "Yes"
else:
    print "No"

Measured memory_bytes: 28012
a = int(input())
if 400<= a <= 599:
  print('8')
elif 600<= a <= 799:
  print('7')
elif 800<= a <= 999:
  print('6')
elif 1000<= a <= 1199:
  print('5')
elif 1200<= a <= 1399:
  print('4')
elif 1400<= a <= 1599:
  print('3')
elif 1600<= a <= 1799:
  print('2')
elif 1800<= a <= 1999:
  print('1')


Measured memory_bytes: 9120
/******************************************
* AUTHOR : kamesh_11 *
* INSTITUTION : GVPCOE *
******************************************/

#include <bits/stdc++.h>
using namespace std;

#define pi 3.141592653589793
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define bs binary_search
#define endl '\n'
#define start_clock clock_t beginn=clock()
#define end_clock clock_t endd=clock()
#define cal_exec_time double time_spent=(double)(endd-beginn)/CLOCKS_PER_SEC
#define print_exec_time cout<<endl<<time_spent<<" secs"

typedef long long int ll;

const ll MOD = 1e9+7;
const ll mxN = 21;
const ll mxL = (1 << 21) + 10;

ll arr[mxN], dp[mxN][mxL], n, x;

ll powmod(ll a,ll b) {ll res=1;a%=MOD; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

ll ways(ll row, ll bitmask){
	if(row == n)
		return (__builtin_popcount(bitmask) == n);

	if(dp[row][bitmask] != -1)
		return dp[row][bitmask];

	ll res = 0;
	for(ll i=0;i<n;i++){
		if(!(bitmask & (1<<i)) && (arr[row] & (1 << i)))
			res = (res + ways(row+1, bitmask | (1 << i)))%MOD;
	}

	return dp[row][bitmask] = res;
}

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

	cin>>n;
	for(ll i=0;i<n;i++){
		for(ll j=0;j<n;j++){
			cin>>x;
			if(x)
				arr[i] = arr[i] | (1 << j);
		}
	}

	memset(dp, -1, sizeof(dp));
	cout<<ways(0, 0);

	return 0;
}

Measured memory_bytes: 344320
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a,b,c;
	cin>>n;
	int s1=0,s2=0,s3=0;
	for(int i=0;i<n;i++){
		cin>>a>>b>>c;
		if(i==0){
			s1 = a,s2=b,s3=c;
		}
		else{
			int t1=max(s2,s3),t2=max(s1,s3),t3=max(s1,s2);
			s1 = a+t1;
			s2 = b+t2;
			s3 = c+t3;
		}
	}
	int ans = max(s1,s2);
	ans = max(ans,s3);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
s = input()
t = input()
num = 10 ** 10
for i in range(len(s) - len(t) + 1):
    # a = s[i:]
    # print(a)
    cnt = 0
    for j in range(len(t)):
        if t[j] != s[i + j]:
            cnt += 1
    num = min(num, cnt)

print(num)



Measured memory_bytes: 9044
# AOJ 0124 League Match Score Sheet
# Python3 2018.6.21 bal4u

f = True
while True:
	n = int(input())
	if n == 0: break
	tbl = []
	for i in range(n):
		name, w, l, d = list(input().split())
		tbl.append([name, i, 3*int(w)+int(d)])
	if f: f = False
	else: print()
	for i in sorted(tbl, key=lambda x:(-x[2],x[1])): print(i[0], ',', i[2], sep='')



Measured memory_bytes: 5600
#include <iostream>

int main(){
   int N;
   std::cin >> N;
   int t[N], x[N], y[N];
   for(int i=0; i<N; ++i)
      std::cin >> t[i] >> x[i] >> y[i];

   int tt = 0;
   int xt = 0;
   int yt = 0;
   for(int i=0; i<N; ++i){
      int dt = t[i] - tt;
      int dx = abs(x[i] - xt);
      int dy = abs(y[i] - yt);
      if(!(dt>=dx+dy && (dt-dx-dy)%2==0)){
	 std::cout << "No" << std::endl;
	 return 0;
      }
      tt = t[i];
      xt = x[i];
      yt = y[i];
   }
   std::cout << "Yes" << std::endl;
   return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (ll i = (a); i < (b); i++)
#define rep2(r, aa, bb) for (ll r = (aa)-1; r >= (bb); r--)
#define be(x) (x.begin(), x.end())
#define pb(t) push_back(t)
#define ll long long
int main()
{
	string s;
	cin>>s;
	rep(i,0,s.size())
	{
		if(i%2==0)
		{
			if(s[i]=='R'||s[i]=='D'||s[i]=='U')
				continue;
		}
		else
		{
			if(s[i]=='L'||s[i]=='U'||s[i]=='D')
				continue;
		}
		cout<<"No";
		return 0;
	}
	cout<<"Yes";
}

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

using namespace std;

int main() {
	long long int q, h, s, d;
	long long int n;
	cin >> q >> h >> s >> d;
	cin >> n;
	long long int p[4];
	p[0] = q;
	p[1] = h;
	p[2] = s;
	p[3] = d;
	p[1] = min(p[0] * 2, p[1]);
	p[2] = min(p[1] * 2, p[2]);
	p[3] = min(p[2] * 2, p[3]);
	long long int ans = 0;
	if (n % 2 == 0) {
		ans += p[3] * n / 2;
	}
	else {
		ans += p[3] * (n / 2);
		ans += p[2];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256