akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <vector> 
#include <algorithm>
#include <functional>
#include <iostream>
#include <string>
using namespace std;

bool check(string s){
    string s_=s;
    reverse(s_.begin(),s_.end());
    if(s_==s){
        return true;
    }else{
        return false;
    }
}

int main(){
    string S;
    cin>>S;
    int N=S.length();
    bool flag=false;
    if(check(S)){
        if(check(S.substr(0,((N-1)/2)))){
            if(check(S.substr((N+3)/2-1))){
                flag=true;
            }
        }

    }
    if(flag)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;


}

Measured memory_bytes: 256
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;

const ll MOD = 1e9 + 7;

ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}


ll h, w;

ll k;


int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> h >> w;
	cin >> k;
	ll p = 1, q = 1;
	for (int i = 1; i <= h + w; ++i)
		p = (p * i) % MOD;
	for (int i = 1; i <= h + w - k; ++i)
		q = (q * i) % MOD;
	p = p * pw(q, MOD - 2) % MOD;
	ll go = h * w % MOD * pw(h + w, MOD - 2) % MOD * pw(h + w - 1, MOD - 2) % MOD * 2 % MOD;
	ll ans = (k * p) % MOD;
	for (int i = 0; i < k; ++i) {
		ll cnt = k - i;
		ans = (ans + p * cnt % MOD * (1 + i * go % MOD)) % MOD;
	}
	cout << ans << "\n";
	return 0;
}




Measured memory_bytes: 256
import java.util.*;
import java.math.*;
// testing something
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        long[] ary = new long[n];
        int MAX_BIT_LENGTH = (new BigInteger(k+"")).bitLength();
        // number of 0s have to be greater
      	for( int i = 0; i < n; i++ ) ary[i] = in.nextLong();
        long xor = 0L;
        for( int i = MAX_BIT_LENGTH; i >= 0; i-- ) {
            int ones = 0;
            for( int j = 0; j < n; j++ ) {
                if((ary[j]&(1L<<i)) > 0 ) ones++;
            }
            if( ones < n-ones && xor+(1L<<i) <= k) xor += (long) (1L<<(long)i); // if 1 is less than 0s, and adding it to xor will keep it less than k
        }

        long ans = 0L;
        for( long i : ary ) ans += (long) (i^xor);
        System.out.println(ans);
    }
}

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

using namespace std;
#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define _dec(i,j,N) for(int i = (N-1);i >= (j);i--)
#define ALL(x) x.begin(),x.end()
#define PB push_back
#define LL long long

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {
    _for(i,0,v.size()) os << v[i] << " ";
    return os;
}

template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){
    for(typename set<T>::iterator it = v.begin();it != v.end();it++)
    os << *it <<" ";
    return os;
}

priority_queue<LL,vector<LL>,less<LL>> L;
priority_queue<LL,vector<LL>,greater<LL>> R;

int main()
{
    int Q;
    scanf("%d",&Q);
    LL B = 0;
    LL A = 0;

    LL mid;
    int Lsz = 0;
    int Rsz = 0;


    _for(i,0,Q){
        LL a,b;
        int q;
        scanf("%d",&q);

        if(q == 1){
            scanf("%lld %lld",&a,&b);
            B += b;
            if(!Lsz && !Rsz){
                L.push(a);
                mid = a;
                Lsz++;
            }
            else if(a >= mid){
                if(Rsz == Lsz){
                    A += a-mid;
                    R.push(a);
                    LL temp = R.top();
                    R.pop();

                    A -= (temp-L.top());
                    L.push(temp);
                }
                else{
                    A += a-mid;
                    R.push(a);
                }
                Lsz = L.size();
                Rsz = R.size();
                mid = L.top();
            }
            else{
                if(Rsz == Lsz){
                    A += mid-a;
                    L.push(a);
                }
                else{
                    A += mid - a;
                    L.push(a);
                    LL temp = L.top();
                    L.pop();
                    R.push(temp);
                }
                Lsz = L.size();
                Rsz = R.size();
                mid = L.top();
            }

        }
        else{
            cout << mid << " " <<A+B<<endl;

        }

    }
}


Measured memory_bytes: 3828
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
const ll inf = 1e9;
int main(){
    int n, q;
    cin >> n >> q;
    vector<stack<ll> > vs(n);
    rep(i,q){
        ll com, t; 
        cin >> com >> t;
        ll x;
        if(com == 0){
            cin >> x;
            vs[t].push(x);
        }else if(com == 1 && vs[t].size() > 0)cout << vs[t].top() << endl;
        else if(vs[t].size() > 0)vs[t].pop();
    }
    return 0;
} 


Measured memory_bytes: 5068
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

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

    vector<pair<int, int> > jobs;
    for(int i = 0; i < n; i++){
        int a,b;
        cin >>a >>b;
        jobs.push_back(make_pair(b, a));
    }
    sort(jobs.begin(), jobs.end());

    long long currentTime = 0;
    bool canComplete = true;
    for(int i = 0; i < n; i++){
        currentTime += jobs[i].second;
        if(currentTime > jobs[i].first){
            canComplete = false;
            break;
        }
    }
    if(canComplete){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 2420
//problem_b.go

package main

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

const (
	constMod = int(1e9) + 7
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wr = bufio.NewWriter(os.Stdout)
)

// -----------------------------------------

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

func getIntSlice(n int) []int {
	ns := []int{}
	for i := 0; i < n; i++ {
		ns = append(ns, getInt())
	}
	return ns
}

func getIntDoubleSlice(m int, n int) [][]int {
	var nds [][]int
	for i := 0; i < m; i++ {
		ns := getIntSlice(n)
		nds = append(nds, ns)
	}

	return nds
}

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

func getStringSlice(n int) []string {
	ss := []string{}
	for i := 0; i < n; i++ {
		ss = append(ss, getString())
	}
	return ss
}

func getStringDoubleSlice(m int, n int) [][]string {
	sds := [][]string{}
	for i := 0; i < m; i++ {
		ss := getStringSlice(n)
		sds = append(sds, ss)
	}

	return sds

}

// -----------------------------------------

// Sort Fanction

func sortIntSlice(ns []int) []int {
	sort.Sort(sort.IntSlice(ns))
	return ns
}

func sortIntReverseSlice(ns []int) []int {
	sort.Sort(sort.Reverse(sort.IntSlice(ns)))
	return ns
}

// -----------------------------------------

// Num Fanction

//numAbs(x) = abs(s)
func numAbs(x int) int {
	if x < 0 {
		return -x
	}

	return x
}

//numModPow(a, n, m) = a^n % m
func numModPow(a int, n int, m int) int {
	result := 1

	for n > 0 {
		if n%2 == 1 {
			result = (result * a) % m
		}

		a = (a * a) % m
		n >>= 1
	}

	return result
}

// numGcd(a, b) = gcd(a, b)
func numGcd(a int, b int) int {
	if b == 0 {
		return a
	}

	return numGcd(b, a%b)
}

// numLcm(a, b) = lcm(a, b)
func numLcm(a int, b int) int {
	return a * b / numGcd(a, b)
}

// numModInv(a, p) = a^(-1) % p
func numModInv(a int, p int) int {
	if a == 1 {
		return 1
	}

	return p - numModInv(p%a, p)*(p/a)%p
}

// numModFrac(n) = n! % constMod
func numModFrac(n int) []int {
	frac := []int{1}

	for i := 1; i <= n; i++ {
		frac = append(frac, i*frac[i-1]%constMod)
	}

	return frac
}

// numModConb(n, r) = nCr % constMod
func numModConb(n int, r int) int {
	frac := numModFrac(n)

	return (frac[n] / ((frac[n-r] * frac[r]) % constMod)) % constMod
}

// -----------------------------------------

func solve() {

	n, m := getInt(), getInt()
	a := getIntSlice(n)

	sum := 0
	for _, v := range a {
		sum += v
	}

	count := 0
	for _, v := range a {
		rate := float64(sum) / float64(4*m)
		if float64(v) >= rate {
			count++
		}
	}

	if count >= m {
		fmt.Fprintln(wr, "Yes")
	} else {
		fmt.Fprintln(wr, "No")
	}

}

// -----------------------------------------

func main() {
	maxBufSize := int(1e8)
	sc.Buffer(make([]byte, 4096), maxBufSize)
	sc.Split(bufio.ScanWords)
	solve()
	wr.Flush()
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

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

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

	sort(arr.begin(), arr.end());

	int sum = arr[n - 1] / 2;

	for (int i = 0; i < n - 1; i++)
	{
		sum += arr[i];
	}

	cout << sum  << endl;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
B=[]
C=[]
for _ in range(Q):
    b,c = map(int,input().split())
    B.append(b)
    C.append(c)
dic = {}
for a in A:
    if a in dic:
        dic[a] += 1
        continue
    dic[a] = 1

ans = 0
for key,val in dic.items():
    ans += key*val

for b,c in zip(B,C):
    if b in dic:
        ans -= dic[b] * b
        ans += dic[b] * c

        if c in dic:
            dic[c] += dic[b]
        else:
            dic[c] = dic[b]
        dic[b] = 0
    print(ans)



Measured memory_bytes: 26024
using namespace std;
#include<iostream>
#include <string.h>
int main() {
  int i = 0;
  char c[100];
  cin >> i;
  if (i % 2 != 0) {
    cout << "No";
    return 0;
  }
  int j = i / 2;
  cin >> c;
  for (int k = 0; k < j; k++) {
    if (c[k] != c[k + j]) {

      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <vector>
using namespace std;
#define FOR(__I,__N) for (int __I = 0; __I < __N; ++__I)

typedef long long int64;
typedef pair<int,int> pii;
typedef pair<int64, int64> pll;
typedef double db;
typedef long double ldb;

const int INF = 0x3f3f3f3f;
const int64 INF64 = 0x3f3f3f3f3f3f3f3fLL;

const int dir[4][2] = {{-1,0},{1,0},{0,1},{0,-1}};

const int MOD = 1000000007;

const int MAX_H = 1000000;
const int MAX_W = 1000000;

map<int,bool> maze[MAX_W];
map<int,int> dist[MAX_W];


int H,W,K;	
pii que[5*MAX_H];

int solve(int x1,int y1,int x2,int y2){
	int qs = 0, qt = 0;
	FOR(i,H)	FOR(j,W)	dist[i][j] = INF;

	que[qt++] = pii(x1,y1);
	dist[x1][y1] = 0;
	
	while(qs < qt){
		pii p = que[qs++];
		int x = p.first, y = p.second;
		int d = dist[x][y];
		if(x == x2 && y == y2)	return d;

		FOR(k,4){
			int xx = x, yy = y;
			FOR(step,K){
				xx += dir[k][0];
				yy += dir[k][1];

				if(xx < 0 || xx > H)	break;
				if(yy < 0 || yy > W)	break;
				if(maze[xx][yy])	break;
				int &dd = dist[xx][yy];
				if(dd > d+1){
					dd = d+1;
					que[qt++] = pii(xx,yy);
				}

				if(dd <= d){
					break;
				}

				if(dd+1 <= d){
					break;
				}
			}
		}
	}

	return -1;
}

char buff[MAX_H+1];

int main(){
	cin >> H >> W >> K;
	int x1,y1,x2,y2; cin >> x1 >> y1 >> x2 >> y2;
	--x1, --y1;
	--x2, --y2;
	FOR(i,H){
		scanf(" %s",buff);
		FOR(j,W)	maze[i][j] = buff[j]=='@';
	}

    int ans = solve(x1,y1,x2,y2);
    printf("%d\n",ans);
}





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

int main() {
  int K, N, res, diff;
  cin >> K >> N;

  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  
  res = K - vec.at(N-1) + vec.at(0);
  for (int i=0; i<N-1; i++){
    diff = vec.at(i+1) - vec.at(i);
    if (res < diff) {
      res = diff;
    }
  }
  
  cout << K - res << endl;
    
}


Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
#define fst first
#define scd second
int n, m, q, a[50], b[50], c[50], d[50], e[10];
int func(int cnt, int num)
{
	int ans = 0;
	if(cnt == n)
	{
		for(int i = 0; i < q; ++i)
		{
			if(e[b[i] - 1] - e[a[i] - 1] == c[i])
			{
				ans += d[i];
			}
		}
	}
	else
	{
		for(int i = num; i <= m; ++i)
		{
			e[cnt] = i;
			ans = max(ans, func(cnt + 1, i));
		}
	}
	return ans;
}
signed main()
{
	scanf("%d%d%d", &n, &m, &q);
	for(int i = 0; i < q; ++i)
	{
		scanf("%d%d%d%d", &a[i], &b[i], &c[i], &d[i]);
	}
	printf("%d\n", func(0, 1));
}


Measured memory_bytes: 3816
/*
 * main.cpp
 *
 *  Created on: 2017/10/22
 *      Author: sep
 */

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>

using namespace std;

inline int main001();
inline int main002();
inline int main003();
inline int main004();

//#define TEST

int main() {

#ifdef TEST
	while (1)
#endif
		main001();

	return 0;
}

inline int main001() {

	string input;

	cin >> input;

	if (input.find("AC") == -1) {
		cout << "No";
	} else {
		cout << "Yes";
	}

	return 0;

}


Measured memory_bytes: 256
H, W = map(int, input().split())
a = []
for i in range(H):
    a.append(list(map(int, input().split())))
cnt = 0
ans = []
for i in range(H):
    for j in range(W - 1):
        if a[i][j] % 2 != 0:
            ans.append([i + 1, j + 1, i + 1, j + 2])
            a[i][j] -= 1
            a[i][j + 1] += 1

for i in range(H - 1):
    if a[i][-1] % 2 != 0:
        ans.append([i + 1, W, i + 2, W])
        a[i][-1] -= 1
        a[i + 1][-1] += 1

print(len(ans))
for i in ans:
    print(i[0], i[1], i[2], i[3])


Measured memory_bytes: 30260
import math

a, b, h, m = map(int, input().split())

# print(a)
# print(b)
# print(h)
# print(m)

hm = (h * 60 + m) / 2
# print(hm)
mm = m * 6
# print(mm)

A = max(hm, mm) - min(hm, mm)
# print(A)

AA = math.radians(A)
# print(AA)

AAA = math.cos(AA)
# print(AAA)

c = (a**2) + (b**2) - (2 * a * b * AAA)
# print(c)

cc = math.sqrt(c)
print(cc)

Measured memory_bytes: 9516
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().rstrip().split())
inl = lambda: list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))

n = ini()
a = inl()
j = 1
for i in range(n):
    a[i] -= j
    j += 1
a = sorted(a)
x = a[n//2]
ans = 0
for i in range(n):
    ans += abs(a[i] - x)
print(ans)

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

using namespace std;

void Solution()
{
    string str;
    
    int a;
    int b;
    int l;
    int x;
    
    char c;
    
    while (getline(cin, str)) //enter
    {
        x = 0;
        
        l = (int)str.size();
        
        for (int i = 0; i < l; i++)
        {
            c = str.at(i); //string text = "ABCDEF";
                            //char ch = text.at( 2 );
            
                 if (c == 'I') a = 1;
            else if (c == 'V') a = 5;
            else if (c == 'X') a = 10;
            else if (c == 'L') a = 50;
            else if (c == 'C') a = 100;
            else if (c == 'D') a = 500;
            else if (c == 'M') a = 1000;
            
            if (i)
            {
                if (b >= a)
                {
                    x += b;
                }
                else
                {
                    x -= b;
                }
            }
            
            b = a;
        }
        
        x += b;
        
        cout << x << endl;
    }
    
}

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

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

int main(){
  ll A, B;
  cin >> A >> B;

  ll ans = -1;
  for(ans = 1; ans <= 1000; ans++){
    if(ans * 8 / 100 == A && ans / 10 == B)
      break;
  }
  if(ans == 1001) ans = -1;

  cout << ans << endl;
}

Measured memory_bytes: 256
/**
 *    author:  Mohamad Milhem
 *    created: 2020-04-29-16.54.15
**/

#include <bits/stdc++.h>
#include <stdio.h>

using namespace std;
typedef long long ll;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back
#define lp(i,s,f) for(ll i = s; i < ll(f); i++)
#define inF freopen("input.in", "r", stdin);
#define outF freopen("output.in", "w", stdout);
#define MOD ll(1000000007)
#define debug(x) cout << '[' << #x << " is: " << x << "] " <<endl;
#define decimalpoint cout << std::fixed << setprecision(5)
int n, k;
vector<int> v;
int dp[100005][4];
int arr[100005][3];


int calc(int idx, int last){
    if (idx >= n)return 0;

    if (dp[idx][last] != -1)return dp[idx][last];

    int ret = 0;


    for (int i = 0 ; i < 3; i++){
        if (i == last)continue;
        ret = max(ret, arr[idx][i] + calc(idx + 1 , i));
    }


    return dp[idx][last] = ret;

}




int main(){

    FAST;

    cin >> n;

    for (int i = 0 ; i < n ; i++){
        for (int j = 0 ; j < 3 ; j++){
            cin >> arr[i][j];
        }
    }
    memset(dp, -1 , sizeof dp);


    cout <<  calc(0 , 3) << endl;



    return 0;
}


Measured memory_bytes: 10752
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>

void roll(std::vector<int> &v, char c) {
    if (c == 'E') {
        char tmp = v[0];
        v[0] = v[3];
        v[3] = v[5];
        v[5] = v[2];
        v[2] = tmp;
    } else if (c == 'S') {
        char tmp = v[0];
        v[0] = v[4];
        v[4] = v[5];
        v[5] = v[1];
        v[1] = tmp;
    } else if (c == 'N') {
        char tmp = v[0];
        v[0] = v[1];
        v[1] = v[5];
        v[5] = v[4];
        v[4] = tmp;
    } else {
        char tmp = v[0];
        v[0] = v[2];
        v[2] = v[5];
        v[5] = v[3];
        v[3] = tmp;
    }
}

bool isSame(std::vector<int> v, std::vector<int> v2) {
    std::vector<int> tmp, tmp2;
    tmp = v;
    tmp2 = v2;
    std::sort(tmp.begin(), tmp.end());
    std::sort(tmp2.begin(), tmp2.end());
    if (tmp != tmp2) return false;
    if (v[1] != v2[1]) {
        if (v2[4] == v[1]) roll(v2, 'N');
        while (v2[0] != v[1]) roll(v2, 'E');
        roll(v2, 'S');
    }

    for (int i = 0; i < 4; i++) {
        if (v == v2) {
            return true;
        }
        roll(v2, 'E');
    }
    return false;
}

int main(){
    int n;

    std::cin >> n;

    std::vector<std::vector<int> > v(n, std::vector<int>(6));
    
    for (int i = 0; i < n; i++) {
        scanf("%d %d %d %d %d %d", &v[i][0], &v[i][1], &v[i][2], &v[i][3], &v[i][4], &v[i][5]);
    }

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (isSame(v[i], v[j])) {
                std::cout << "No" << std::endl;
                return 0;
            }
        }
    }

    std::cout << "Yes" << std::endl;
    return 0;
}

Measured memory_bytes: 3236
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define INF 1LL << 60;
#define LLINF 1e12
#define PI 3.14159265359
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
int ny, nx;
typedef long long ll;
using namespace std;

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

ll lcm(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n);
}

ll llpow(ll x, ll y)
{
    ll ans = 1;
    REP(i, y)
    ans *= x;
    return ans;
}

ll llmin(ll x, ll y) { return x < y ? x : y; }
ll llmax(ll x, ll y) { return x > y ? x : y; }

template <typename Container>
bool exist_in(const Container &c, const typename Container::value_type &v)
{
    return (c.end() != std::find(c.begin(), c.end(), v));
}

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

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

    ll N, A ,B; cin >> N >> A >> B;

    ll ans = N / (A+B) * A;
    ans += llmin(N%(A+B), A);
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
LIN=lambda : list(IN())
mod=1000000007

#+++++

def main():
	a = int(input())
	#b , c = IN()
	al = [input() for _ in range(a)]
	#s = input()
	n=len(list(set(al)))
	print(n)
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Measured memory_bytes: 110712
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < n; i++) 
using namespace std;

int main() {
  
  string s,t,u;
  cin >> s >> t >> u;
  
  cout << s[0] << t[1] << u[2] << endl;
   
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
//priority_queueを使用

int main(){
    ll n,m,ans=0; 
    cin >> n >> m;
    priority_queue<ll> a;

    for(int i=0; i<n ; ++i){
        ll temp; cin >> temp;
        a.push(temp);
    }

    for(int i=0; i<m ; ++i){
        ll temp = a.top();
        a.pop();
        temp /= 2;
        a.push(temp);
    }

    for(int i=0; i<n ; ++i){
        ans += a.top();
        a.pop();
    }

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

Measured memory_bytes: 1400
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstdint>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
 
template<class T> inline bool chmax(T &a, T b){
    if(a<b){
        a = b;
        return true;
    }
    return false;
}

template<class T> inline bool chmin(T &a, T b){
    if(a>b){
        a = b;
        return true;
    }
    return false;
}
class UnionFind {
private:
    int sz;
    vector<int> par, size_;
public:
    UnionFind(){}
    UnionFind(int node_size) : sz(node_size), par(sz), size_(sz, 1){
        iota(par.begin(), par.end(), 0);
    }
    int find(int x){
        if(par[x] == x) return x;
        else return par[x] = find(par[x]);
    }
    void unite(int x,int y){
        x = find(x), y = find(y);
        if(x == y) return;
        if(size_[x] < size_[y]) swap(x,y);
        par[y] = x;
        size_[x] += size_[y];
    }
    int size(int x){
        x = find(x);
        return size_[x];
    }
    bool same(int x,int y){
        return find(x) == find(y);
    }
};

int main(){
    int n,m;
    cin >> n >> m;
    UnionFind uf(n);
    rep(i,m){
        int a,b;
        cin >> a >> b;
        a--;b--;
        uf.unite(a,b);
    }
    set<int> st;
    rep(i,n){
        st.insert(uf.find(i));
    }
    cout << st.size() - 1 << endl;
    return 0;
}

Measured memory_bytes: 7924
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <cstdio>
#include <string.h>
#define rep(i,n) for (int i = 0; i < (int)n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
double PI = 3.1415926535897932;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;

int n, k;
string s;

int main() {
    cin >> n >> k >> s;
    int cnt = 0;
    for (int i = 1; i < n; i++) {
        if (s[i] == s[i-1]) cnt++;
    }
    cout << min(n-1, cnt+k*2) << endl;
}

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

int main() {
    int a,b;
    cin >> a >> b;
    cout << a*b-(a+b-1) << endl;
}

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

int main(){
  int N;
  cin>>N;
  int B[1100];
  
  for(int i=1;i<1100;i++){
    B[i]=0;
  }
  
  int temp=0;
  for(int i=2;i<1000;i++){
    for(int j=2;j<11;j++){
      if(pow(i,j)<1100){
        temp=pow(i,j);
        B[temp]=1;
      }
    }
  }
  
  for(int i=N;2<i;i--){
    if(B[i]==1){
      cout<<i<<endl;
      return 0;
    }

  }
    
  cout<<1<<endl;
  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<utility>
#include<cstdio>
#include<set>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include <bitset>
using namespace std;
const int mod=1e9+7;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,x,n) for (int i= x;i<n;i++)
#define all(v) v.begin(), v.end()
#define nepe(v) next_permutation(all(v))
#define F first 
#define S second
#define PB push_back 
#define MP make_pair
using ll = long long;
using vi = vector<int>; 
using vvi = vector<vi>;
using vp =vector<pair<int,int>>;

typedef pair<int,int> P;
string s;
int k;
ll INF = 10000000000000000;

int main(){
    int N;
    cin >> N;
    vp r(N),b(N);
    rep(i,N) cin >>r[i].F>>r[i].S;
    rep(i,N) cin >>b[i].F>>b[i].S;
    vi left(N,0);
    vi max(N,0);

    sort(all(b));
    sort(all(r));

    int jj=0;
    int ans=0;
    rep(i,N){//ao
        bool judge=false;
        rep(j,N){//aka
            if(left[j] ==0){
                if(r[j].F<b[i].F && r[j].S<b[i].S && r[j].S>=max[i]){
                    max[i]=r[j].S;
                    jj = j;
                    judge = true;
                }
            } 
        }
        if(judge) {
            ans++;
            left[jj] = 1;
        }
    }
    cout <<ans<<endl;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
using ll=long long;
template<typename T=ll>inline T in(istream&is=cin){T ret;is>>ret;return ret;}
template<typename T>inline auto vec2(typename vector<T>::size_type h,typename vector<T>::size_type w,T v=T()){return vector<vector<T>>(h,vector<T>(w,v));}

class Bellman_Ford final{
private:
    using size_type=std::vector<long long>::size_type;
    static inline constexpr auto inf=std::numeric_limits<long long>::max();
    static inline constexpr auto minf=std::numeric_limits<long long>::min();
    struct edge_info{
        size_type from;
        size_type to;
        long long cost;
        edge_info(size_type from,size_type to,long long cost):from(from),to(to),cost(cost)
        {
        }
    };
    std::vector<edge_info>edge;
    std::vector<long long>dist;
public:
    Bellman_Ford(size_type node_cnt):dist(node_cnt)
    {
    }
    void add_edge(size_type from,size_type to,long long cost)
    {
        edge.emplace_back(from,to,cost);
    }
    void update(size_type start=0)
    {
        std::fill(dist.begin(),dist.end(),inf);
        dist[start]=0;
        bool is_updated=false;
        for(size_type i=0;i<dist.size();++i){
            for(auto[from,to,cost]:edge){
                if(dist[from]!=inf&&dist[to]>dist[from]+cost){
                    dist[to]=dist[from]+cost;
                    is_updated=true;
                }
            }
            if(!is_updated)break;
        }
        if(is_updated){
            for(auto[from,to,cost]:edge){
                if(dist[from]==minf||(dist[from]!=inf&&dist[to]>dist[from]+cost)){
                    dist[to]=minf;
                }
            }
        }
    }
    long long get_dist(size_type node)
    {
        return dist[node];
    }
    bool is_unreacheable(size_type node)
    {
        return dist[node]==inf;
    }
    bool is_in_negative_loop(size_type node)
    {
        return dist[node]==minf;
    }
};
int main()
{
    ll n=in(),m=in();
    Bellman_Ford bf(n);
    for(ll i=0;i<m;++i){
        ll a=in(),b=in(),c=in();
        bf.add_edge(a-1,b-1,-c);
    }
    bf.update();
    cout<<(bf.is_in_negative_loop(n-1)?"inf":to_string(-bf.get_dist(n-1)))<<endl;
}


Measured memory_bytes: 3748
/**
 * author: moririn_cocoa       
**/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

int main(void) {
  
  int a;
  int b;
  int c;
  
  cin >> a;
  cin >> b;
  cin >> c;
  
  if ( a == b && b == c ) {
    
    cout << 1 << endl;
  }
  
  else if ( a != b && b != c && a != c ) {
    
    cout << 3 << endl;
  }
  
  else {
    
    cout << 2 << endl;
  }
	

return 0;
}


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

int N,M;
int Maxsum;
int sum[100005];
int data[15][100005];

void dfs(int x){
	if(x==N){
		int num=0;
		memset(sum,0,sizeof(sum));
		for(int i=0;i<M;i++){
			for(int j=0;j<N;j++){
				sum[i]+=data[j][i];
			}
			if(sum[i]<=N/2) sum[i]=N-sum[i];
			num+=sum[i];
		}
		Maxsum=max(Maxsum,num);
		return;
	}
	dfs(x+1);
	for(int i=0;i<M;i++){
		if(data[x][i]==1) data[x][i]=0;
		else data[x][i]=1;
	}
	dfs(x+1);
} 

void solve(){
	Maxsum=0;
	dfs(0);
	printf("%d\n",Maxsum);
}

int main(){
	while(true){
		scanf("%d%d",&N,&M);
		if(N==0&&M==0) break;
		for(int i=0;i<N;i++){
			for(int j=0;j<M;j++){
				scanf("%d",&data[i][j]);
			}
		}
		solve();
	}
	return 0;
} 


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

#define pb push_back
#define mk make_pair
#define fi first
#define se second
#define eb emplace_back

typedef long long ll;
typedef pair<int,int> ii;
typedef vector< pair<int,int> > vii;
const int INF = 0x3f3f3f3f;

const int T = 1e5 + 3;
const int N = 27;
int v[T][N];
string s,t;

int main() {
    ios::sync_with_stdio(false);
    memset(v, INF, sizeof v);
    cin >> s >> t;
    int n = s.size();
    s = "#" + s;

    for(int i = 1; i <= n; i++) v[i-1][s[i]-'a'] = i;

    for(int i = 0; i < 27; i++)
        for(int j = n; j >= 0; j--)
            v[j][i] = min(v[j][i], v[j+1][i]);

    ll ans = 0;
    int at = 0;
    int as = 0;

    while(at < t.size()) {
        if(v[as][t[at]-'a'] == INF) {
            if(as == 0) { cout << -1 << endl; return 0; }
            as = 0;
            ans += n;
        } else {
            as = v[as][t[at]-'a'];
            at++;
        }
    }

    cout << ans + as << endl; 

    return 0;
}



Measured memory_bytes: 11088
result = []
N = int(input())

for i in range(N):
    A = list(map(int, input().split()))
    chk_Num = sorted(A, reverse=True)
    if (chk_Num[1] ** 2 + chk_Num[2] ** 2) == (chk_Num[0] ** 2):
        result.append("YES")
    else:
        result.append("NO")

for i in result:
    print(i)


Measured memory_bytes: 5716
#!/usr/bin/env python3
import sys


N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]

for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans = 0
j = N

for i in range(M+1):
    if b[i] > K:
        break
    while a[j] > K - b[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)


Measured memory_bytes: 47296
n = int(input())
if n == 0:
	print(0)
	exit()
res = ""
while True:
	if n == 0:
		break
	else:
		if n%2 == 0:
			res += '0'
		else:
			res += '1'
			n -= 1
		n //= -2
print(res[::-1])

Measured memory_bytes: 2940
//I finally found out what's in your mind and I hate you!
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int MAXN = (int)1e6 + 3;
const int infint = (int)1e9 + 3;
const int MOD = (int)998244353;
const ll inf = (ll)1e18 + 3;
int n, a[MAXN];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> a[i];
		
	sort(a + 1, a + n + 1);
	reverse(a + 1, a + n + 1);
	for (int i = 1; i <= n; i++)
	{
		if(i + 1 > a[i + 1])
		{
			int ans = 0;
            for(int j = i + 1; a[j] == i; j++)
				ans ^= 1;
            ans |= (a[i] - i) & 1;
           	cout << (ans ? "First" : "Second");
            return 0;
		}
	}
}


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

#define int long long
#define inf 1000000007LL

#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define trep(i, n) for(int i = 0; i <= (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define mfor(i, s, t) for(int i = (s); i < (t); i++)
#define tfor(i, s, t) for(int i = (s); i <= (t); i++)

class Dinic {
public:
  vector<vector<pair<int, int>>> v;
  vector<int> e;

  vector<int> k;
  vector<int> j;

  Dinic(int n) {
    v.resize(n);
    k.resize(n);
    j.resize(n);
  }
  void add_edge(int a, int b, int atob, int btoa = 0) {
    v[a].push_back(make_pair(b, e.size()));
    e.push_back(atob);
    v[b].push_back(make_pair(a, e.size()));
    e.push_back(btoa);
  }
  void dyk(int s) {
    for(auto& i : k) {
      i = inf;
    }
    queue<pair<int, int>> pq;
    pq.push(make_pair(0, s));
    while(!pq.empty()) {
      int w = pq.front().first;
      int b = pq.front().second;
      pq.pop();
      if(k[b] > w) {
        k[b] = w;
        for(auto i : v[b]) {
          if(e[i.second] > 0) {
            pq.push(make_pair(w + 1, i.first));
          }
        }
      }
    }
  }
  int dfs(int s, int t, int p, int c) {
    if(p == t) {
      return c;
    }
    int all = 0;
    while(c > all && j[p] < v[p].size()) {
      if(k[v[p][j[p]].first] == k[p] + 1) {
        int r = dfs(s, t, v[p][j[p]].first, min(c - all, e[v[p][j[p]].second]));
        e[v[p][j[p]].second] -= r;
        e[v[p][j[p]].second ^ 1] += r;
        if(r < c - all) {
          j[p]++;
        }
        all += r;
      }
      else {
        j[p]++;
      }
    }
    return all;
  }
  int solve(int s, int t) {
    int all = 0;
    while(1) {
      dyk(s);
      for(auto& i : j) {
        i = 0;
      }
      int r = dfs(s, t, s, inf);
      if(r == 0) {
        return all;
      }
      all += r;
    }
  }
};

signed main() {
  int n, t;
  cin >> n >> t;
  int all = 0;
  int o;
  cin >> o;
  rep(i, n - 1) {
    int w;
    cin >> w;
    if(w - o < t) {
      all += w - o;
    }
    else {
      all += t;
    }
    o = w;
  }
  all += t;
  cout << all << endl;
}


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

int main() {
    int N,R,IR;
    cin>>N>>R;
    if (N>=10)
    {
        IR=R;
        cout<<IR;
    }
    else{
        IR=100*(10-N)+R;
        cout<<IR;
    }
}

Measured memory_bytes: 256
def prime(n):
    nums = [True]*n
    primes = []
    for i in range(2,n):
        if nums[i]:
            primes.append(i)
            for j in range(2*i,n,i):
                nums[j] = False
    return primes

def prime_fac(n):
    fac = {}
    primes = prime(int(n**0.5)+1)
    for p in primes:
        while n%p==0:
            fac[p] = fac.get(p,0)+1
            n//=p
    if n > 1:
        fac[n] = 1
    return fac

def main():
    n = int(input())
    fac = prime_fac(n)

    ans = 0
    for i in fac.values():
        ct = 1
        while i >= ct*(ct+1)//2:
            ct += 1
            ans+=1
    print(ans)
main()

Measured memory_bytes: 20268
#include <bits/stdc++.h>
#define MAX 1000005
#define ll long long
#define upperlimit 1000100
#define INF 1e18
#define eps 1e-8
#define endl '\n'
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define MOD 1000000007LL
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d\n",t)
#define plld(t) printf("%lld\n",t)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>
#define vll vector<ll>
#define clr(a) memset(a,0,sizeof(a))
#define debug(a) printf("check%d\n",a)
#define csl ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
 
ll gcd(ll n1,ll n2){
    if(n2==0)
        return n1;
    if(n1%n2==0)return n2;
    return gcd(n2,n1%n2);
}
ll powmod(ll base,ll exponent)
{
    if(exponent<0) exponent+=MOD-1;
    ll ans=1;
    while(exponent){
        if(exponent&1)ans=(ans*base)%MOD;
        base=(base*base)%MOD;
        exponent/=2;
    }
    return ans;
}
int x[MAX],y[MAX];
int main()
{
	csl;
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);

    int n,m,X,Y;
    cin>>n>>m>>X>>Y;
    for(int i=1;i<=n;i++)
        cin>>x[i];
    for(int i=1;i<=m;i++)
        cin>>y[i];
    sort(x+1,x+1+n);
    sort(y+1,y+1+m);
    if(max(x[n]+1,X+1)<=min(y[1],Y))
        cout<<"No War"<<endl;
    else
        cout<<"War"<<endl;

}

Measured memory_bytes: 2304
#include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <cmath>
#include<queue>
#include <sstream>
#include <set>
#include<stack>

const long long MOD = 1000000007;
using namespace std;
typedef long long llong;

//int isalpha(char ch): ch がアルファベットなら true を返す
//int isdigit(char ch): ch が数字なら true を返す
//int islower(char ch): ch が小文字なら true を返す
//int isupper(char ch): ch が大文字なら true を返す
//int tolower(char ch): ch の小文字を返す
//int toupper(char ch): ch の大文字を返す

//string型
//size()	文字数を返す
//Insert()	（指定した場所に）文字・文字列を挿入する
//erase()	（指定した場所の）文字・文字列を削除する
//clear()	すべての文字を削除する
//substr()	文字列の（指定した）部分文字列を返す
//replace()	（指定した）部分文字列を新しい文字列に置換する
//c_str()変換
//文字列の比較は、<=や==などを使え
//replace関数を使い、簡単に文字列を置換
//リバース関数：reverse(str.begin(), str.end());
//map<type, type> dict;で宣言
//グラフ理論用変数
//vector<vector<llong> > graph(N);

//ソート
//降順sort(v.begin(), v.end(), std::greater<Type>());

//大文字から小文字へんかん
//w[i] = w[i]-'A'+'a';

//vector
//assignメソッド　引数：サイズ、値
//与えられたサイズと値でvectorを初期化する

//queueクラス
//find()次に取り出す値の表示をする。
//pop()値を取り出す。戻り値はなし
//push()キューに値をプッシュする

//priority_queueクラス

//切り上げ
//ceil
//floor

llong eval(char* s){
    vector<llong> table;
    llong num;
    llong total=0;
    while(*s){
        if(*s=='+'){
            s++;
        }
        num = strtol(s, &s, 10);
        table.push_back(num);
    }
    for(int i=0; i<table.size(); i++){
        total = total + table[i];
    }
    return total;
}

int main(){
    llong N;
    string S;
    string s;
    llong total = 0;
    cin >> S;
    N = S.size()-1;
    string temp;
    for(int i=0; i<pow(2, N); i++){
        s = "";
        for(int j=0; j<N; j++){
            if((i>>j)&1){
                s.push_back('+');
                continue;
            }
            s.push_back(' ');
        }
        temp = "";
        for(int i=0; i<N; i++){
            if(s[i]==' '){
                temp = temp + S[i];
                continue;
            }
            temp = temp + S[i] + s[i];
        }
        temp = temp + S[S.size()-1];
        total = total + eval((char*)temp.c_str());
    }
    cout << total << endl;
    return 0;
}


Measured memory_bytes: 3264
#include <algorithm>
        #include <bitset>
        #include <cassert>
        #include <chrono>
        #include <cmath>
        #include <complex>
        #include <cstdio>
        #include <cstdlib>
        #include <cstring>
        #include <ctime>
        #include <deque>
        #include <functional>
        #include <iomanip>
        #include <iostream>
        #include <iterator>
        #include <limits>
        #include <climits>
        #include <list>
        #include <map>
        #include <numeric>
        #include <queue>
        #include <random>
        #include <ratio>
        #include <set>
        #include <sstream>
        #include <stack>
        #include <string>
        #include <unordered_map>
        #include <unordered_set>
        #include <utility>
        #include <vector>
        using namespace std;
         
        typedef long long ll;
        typedef long double LD;
        #define int ll
        #define double LD
        #define pb push_back
        #define mp make_pair
        #define REP(i,n) for (int i = 0; i < n; i++)
        #define loop(i,n) for (int i = 0; i < n; i++)
        #define FOR(i,a,b) for (int i = a; i < b; i++)
        #define REPD(i,n) for (int i = n-1; i >= 0; i--)
        #define FORD(i,a,b) for (int i = a; i >= b; i--)
        #define remax(a,b) a = max(a,b)
        #define remin(a,b) a = min(a,b)
        #define mem(a, b) memset(a, b, sizeof a)
        #define append push_back
        #define all(v) v.begin(),v.end()
        #define F first
        #define S second
        #define print(x) cout << (x) << endl
        #define PRECISION(x) cout << fixed << setprecision(x)
        #define FAST_IO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
        #define Test(){int t;cin >> t;for(int i=1;i<=t;i++){cout << "Case #" << i << ": ";solve();}}
        #define test(){int t; cin>>t; for(int i=1;i<=t;i++){solve();}}
        #define vi vector<int>
        #define vii vector<pair<int,int> > 
        #define vci vector<pair<char,int> >
        #define vic vector<pair<int,char> > 
        #define N 20005
        #define pb push_back
        const double PI=acos(-1);
        const int MOD = 1000000007;
        const int FMOD = 998244353;
		
	
		void solve()
		{
			int d,t,s;
			cin>>d>>t>>s;
			
			if((s*t)>=d)
			{
				cout<<"Yes"<<endl;
			}
			else
			{
				cout<<"No"<<endl;
			}
		}
		signed main()
		{
		//	test();
		solve();
		}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn = 1e2 + 5;
int main()
{
    ios::sync_with_stdio(false);
    int a , b , c; cin >> a >> b >> c;
    swap( a , b);
    swap( a , c);
    cout << a << " " << b << " " << c << endl;
    return 0;
}


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

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a, ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t =rep_jijo(n,x/2);
        return t*t%mod;
  }
  return n*rep_jijo(n,x-1)%mod;
}

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
const long long INF =1LL << 60;

//DP テーブル
ll dp[100100];

int main() {
   ll N,M; 
   cin >> N>>M;
   vcl bs(N+1,true);

   rep(i,M){
       ll a;
       cin>>a;
       bs[a]=false;
   }

// DP テーブル全体を初期化 (最小化問題なので INF に初期化)
for (int i = 0; i < 100100; ++i) {
    dp[i] = 0;
    }

// 初期条件
dp[0] = 1;

// ループ
for (ll now = 0; now < N; ++now) {
       for(ll next=now+1; next<=min(N,now+2);next++){
           if(bs[next]){
               dp[next]+=dp[now];
               dp[next]%=mod;
           }
       }
}
cout<<dp[N]<<endl;

return 0 ;

}



Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        final int BASE = 1000000007;
        int n = sc.nextInt();
        int taka[] = new int [n];
        int ao[] = new int [n];

        for(int i=0;i<n;i++){
            taka[i]= sc.nextInt();
        }
        for(int i=0;i<n;i++){
            ao[i]= sc.nextInt();
        }

        long pattern = 1;
        boolean flag = true;

//        if(taka[n-1]!=ao[0]){
//            flag = false;
//        }

        for(int i=0;i<n&&flag;i++){
            int max_t=0,min_t=0;
            int max_a=0,min_a=0;

            if(i==0){
                max_t = taka[0];
                min_t = taka[0];
            }
            else{
                if(taka[i]==taka[i-1]){
                    max_t = taka[i];
                    min_t = 1;
                }
                else {
                    max_t = taka[i];
                    min_t = taka[i];
                }
            }

            if(i==n-1){
                max_a = ao[n-1];
                min_a = ao[n-1];
            }
            else{
                if(ao[i+1]==ao[i]){
                    min_a =1;
                    max_a = ao[i];
                }
                else {
                    max_a = ao[i];
                    min_a = ao[i];
                }
            }

            if(max_t<min_a || max_a<min_t){
                flag = false;
            }
            else{
                int tmp = Math.min(max_a,max_t) - Math.max(min_a,min_t)+1;
                pattern *= tmp;
                while (pattern>=BASE) {
                    pattern = pattern % BASE;
                }
            }

        }

        if(!flag) pattern = 0;

        System.out.println(pattern);


    }

 }

Measured memory_bytes: 64396
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

#define FOR(i,s,e) for (int i = int(s); i < int(e); i++)
#define FORIT(i,c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define ISEQ(c) (c).begin(), (c).end()
typedef long long ll;

int SURP = 1000000007;

int main(){
	int A,B,C,X,Y;
	cin >> A >> B >> C >> X >> Y;

	int m = max(X,Y) * 2;
	long long int min = 1000000000000;
	FOR(i,0,m+1){
		if(i%2 == 0){
			long long int cash = 0;
			cash = i * C + A * max((X- i/2),0) + B * max((Y- i/2),0);
			if (min > cash) min = cash;
		}
	}

	cout << min << endl;
	return 0;


}

Measured memory_bytes: 256
n = int(input())
S = [int(x) for x in input().split()]
 
q = int(input())
T = [int(x) for x in input().split()]
 
ans = 0
for i in range(q):
    find = 0
    for j in range(n):
        if S[j] == T[i]:
            find = 1
    ans = ans + find
print(ans)


Measured memory_bytes: 6560