akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <unordered_map>
#include <limits.h>
#include <bitset>
#include <math.h>
#define int long long
using namespace std;
using P = pair<int, int>;
using ll = long long;
using prique = priority_queue<int>;
const int MOD = 1000000007;
const int INF = LLONG_MAX/3;
const int MAX = 510000;

/*-----Library-----*/

struct UnionFind {
    vector<int> par; // 親ノード
    vector<int> rank; // ランク
    vector<int> sizeuf; //要素数
    UnionFind(int n = 1) {
        init(n);
    }

    void init(int n = 1) {
        par.resize(n); rank.resize(n); sizeuf.resize(n);
        for (int i = 0; i < n; ++i) {
            par[i] = i;
            rank[i] = 0;
            sizeuf[i]=1;
        }
    }

    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            return par[x] = r;
        }
    }

    bool issame(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 (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        sizeuf[x]+=sizeuf[y];
        return true;
    }

    int size(int x){
        return sizeuf[root(x)];
    }
};

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

long long lcm(long long i,long long j){
    return i*(j/gcd(i,j));
}

long long fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

/*-----Library-----*/
signed main(){
    string s;
    cin>>s;
    bool k=true;
    for(int i=1;i<s.size();i++){
        if(s[i]!='9')k=false;
    }
    if(k)cout<<9*(s.size()-1)+(s[0]-'0')<<endl;
    else if(s.size()==1)cout<<s[0]<<endl;
    else cout<<(s.size()-1)*9+(s[0]-'0')-1<<endl;
}


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

using namespace std;

int main() {
	map<string, int> m;
	int n;
	cin >> n;
	string b, str;
	cin >> str;
	b = str;
	m[str]++;
	for (int i = 1; i < n; i++)
	{
		cin >> str;
		if (m[str] != 0 || str[0] != b[b.length() - 1]) {
			cout << "No" << endl;
			return 0;
		}
		b = str;
		m[str]++;
	}
	cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(ll i=(n);i<(k);i++)
#define ALL(a)  (a).begin(),(a).end()
string ans="";
void Main(){
    string s;cin>>s;
    bool flag=true;
    if(s.size()%2==1) flag=false;
    For(i,0,s.size()/2){
        if(s[i*2]!='h') flag=false;
        if(s[i*2+1]!='i') flag=false;
    }
    cout<<(flag?"Yes":"No")<<endl;
}
int main(){
    Main();
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,m,in;
	cin>>n>>m;
	vl mv(m),ans(n);
	rep(i,m)cin>>mv[i],mv[i]--;
	rep(i,m){
		rep(j,n){
			cin>>in;
			in--;
			(in==mv[i]?ans[j]++:ans[mv[i]]++);
		}
	}
	rep(i,n)cout<<ans[i]<<endl;
}



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


int main()
{
	int A, B, C;
	cin >> A >>B;
	if (A == 1) {
		A =14;
	}
	if (B== 1) {
		B= 14;
	}
	if (A == B) {
		cout << "Draw" << endl;
	}
	else if (A > B) {
		cout << "Alice" << endl;
	}
	else {
		cout << "Bob" << endl;
	}

    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        final int n = sc.nextInt();
        sc.close();
        String result = "No";
        for (int i = 0; i <= 9; i++) {
            for (int j = 0; j <= 9; j++) {
                if (n == i * j) {
                    result = "Yes";
                }
            }
        }

        System.out.println(result);
    }
}


Measured memory_bytes: 22612
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<cstring>
#include<utility>
using namespace std;
#define REP(i, a,b) for(i=a;i<b;i++) 
#define output(x) cout<<x<<endl;
#define pb(x) push_back(x);
typedef long long int ll;
const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

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

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}



int main()
{
	ll  i, j, k, l, m, sum, flag, N, x, y, M, K, H, W, A, B;
	cin >> N;
	vector<ll>a(N + 1);
	ll b[100001] = {};
	
	REP(i, 0, N + 1) {
		cin >> a[i];
		b[a[i]]++;
	}
	ll two;
	REP(i, 1, N + 1) {
		if (b[i] == 2) {
			two = i;
			break;
		}
	}
	ll sentou, ushiro;
	j = 0;
	REP(i, 0, N + 1) {
		if (a[i] == two) {
			if (j == 0) {
				sentou = i + 1;
				j++;
			}
			else {
				ushiro = i + 1;
			}
		}
	}

	K = sentou - 1 + (N + 1 - ushiro);
	COMinit();
	REP(i, 1, N + 2) {
		if (i <= K + 1) {
			output((COM(N + 1, i) - COM(K, i - 1)+MOD)%MOD);
		}
		else {
			output(COM(N + 1, i));
		}

	}
	sum = 0;
	flag = 0;
	
	return 0;
}













Measured memory_bytes: 14720
#include <bits/stdc++.h>
#define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define all(x) (x).begin(), (x).end()
#define print(x) cout << (x) << endl;

typedef long long ll;
const ll INF = 99999999999999;
const ll MOD = 1000000007;

using namespace std;

int main()
{
    string s, ans;
    cin >> s;
    if (s == "Sunny")
    {
        ans = "Cloudy";
    }
    else if (s == "Cloudy")
    {
        ans = "Rainy";
    }
    else if (s == "Rainy")
    {
        ans = "Sunny";
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
using namespace std;


typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)


int main(){
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int ans;
  ans = min(a, b);
  ans += min(c, d);
  cout << ans << endl;
}


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

int main()
{
  string s;
  cin >> s;
  int a(0), b(0);
  for (auto&& e : s)
    (e - '0' == (&e - &s[0]) % 2 ? a : b)++;
  cout << min(a, b) << endl;
}


Measured memory_bytes: 512
package main

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

func main() {
	N, A, B := ReadInt(), ReadInt(), ReadInt()
	ans := (B-A)*(N-2) + 1
	if ans < 1 {
		fmt.Println(0)
	} else {
		fmt.Println(ans)
	}
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int) { Scan(&i); return }


Measured memory_bytes: 1844
#include <stdio.h>
#include <string.h>
#define MAX 101
int main(void)
{
	int n, pt=0, ph=0, i, scale;
	char card[3][MAX];
	scanf("%d", &n);
	for(i=0; i<n; i++){
		scanf("%s%s", card[0], card[1]);
		scale = strcmp(card[0], card[1]);
		if(scale == 0){
			pt += 1; ph += 1;
		}else if(scale > 0){
			pt += 3;
		}else if(scale < 0){
			ph += 3;
		}
	}
	printf("%d %d\n", pt, ph);
	return 0;
}

Measured memory_bytes: 604
/**
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

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

vector<string> vec_splitter(string s) {
    for(char& c: s) c = c == ','?  ' ': c;
    stringstream ss; ss << s;
    vector<string> res;
    for(string z; ss >> z; res.push_back(z));
    return res;
}

void debug_out(vector<string> __attribute__ ((unused)) args, __attribute__ ((unused)) int idx) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, Head H, Tail... T) {
    if(idx > 0) cerr << ", ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, T...);
}

#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __VA_ARGS__)
#else
#define debug(...) 42
#endif

const double PI = acos(-1);
typedef long long ll;
#define int ll
#define fori(n) for(int i=0; i<int(n); i++)

#define cins(s) string s; cin>>s;
#define cini(i) int i; cin>>i;
#define cind(d) double d; cin>>d;
#define cinai(a, n) vi a(n); fori(n) { cin>>a[i]; }
#define cinas(s, n) vs s(n); fori(n) { cin>>s[i]; }
#define cinad(a, n) vd a(n); fori(n) { cin>>a[i]; }

typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<string> vs;

void solve() {
    cini(n);
    cini(m);
    cinai(a,m);

    int ans=0;
    for(int i=0; i<m; i++) {
        ans+=a[i];
    }
    ans=n-ans;
    if(ans<0)
        ans=-1;
    cout<<ans<<endl;
}

signed main() {
    cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    solve();
}



Measured memory_bytes: 3660
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.TreeMap;

public class Main {
	static int n;
	static int[] a;
	static TreeMap<Integer, Integer> map;

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		n = Integer.parseInt(br.readLine());
		String[] sa = br.readLine().split(" ");
		a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sa[i]);
		}
		br.close();

		int ok = n + 1;
		int ng = 0;
		while (Math.abs(ok - ng) > 1) {
			int mid = (ok + ng) / 2;
			if (judge(mid)) {
				ok = mid;
			} else {
				ng = mid;
			}
		}
		System.out.println(ok);
	}

	static boolean judge(int mid) {
		map = new TreeMap<>();
		for (int i = 0; i < n; i++) {
			Integer ce = map.ceilingKey(a[i]);
			if (ce == null) {
				Integer lo = map.lowerKey(a[i]);
				if (lo != null) {
					if (map.get(lo) == 1) {
						map.remove(lo);
					}
				}
				map.put(a[i], 1);
			} else {
				boolean res = update(a[i], ce, mid);
				if (!res) {
					return false;
				}
			}
		}
		return true;
	}

	static boolean update(int ai, int ce, int mid) {
		Integer[] arr = map.descendingKeySet().toArray(new Integer[0]);
		for (Integer k : arr) {
			if (k > ce) {
				continue;
			}
			int v = map.get(k);
			if (k == ce) {
				k = ai;
			}
			if (v < mid) {
				map.put(k, v + 1);
				if (k > 1) {
					if (map.containsKey(k - 1)) {
						if (map.get(k - 1) == v + 1) {
							map.remove(k - 1);
						}
					} else {
						map.put(k - 1, v);
					}
				}
				map.tailMap(k + 1).clear();
				if (k < ai) {
					map.put(ai, 1);
				}
				return true;
			}
		}
		return false;
	}
}


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

int func(int x)
{
    if(x%2==0)
    {
        return x/2;
    }
    else
    {
        return 3*x+1;
    }
}
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    int x;
    cin>>x;
    int count = 0;
    for(int i=0;i<=a;i++)
    {
        for(int j=0;j<=b;j++)
        {
            for(int k=0;k<=c;k++)
            {
                if(i*500+j*100+k*50==x)
                {
                    count++;
                }
            }
        }
    }

    cout<<count<<endl;
    return 0;
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <bits/stdc++.h> // only for GCC

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

//repetition
//------------------------------------------
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

// output vector
// ------------------------------------------
namespace std {
    template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
        iter(it,v) os<<*it<<(it+1==v.end()?"":",");
        return os;
    }
    template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
        return os << "[" << p.dirst << "," << p.second << "]";
    }
}

//clear memory
// ------------------------------------------
#define clr(a,i) memset((a), (i) ,sizeof(a))

int main(){
   int n,t;
   int h1,m1,h2,m2;
   char c;
   string s;
   vs a;
   vi ans;
   cin >> n >> t;
   rep(i,n){
      cin>>h1>>c>>m1>>s;
      if(i!=0)if((h1-h2)*60+(m1-m2)>=t){
         a.pb(s); ans.pb((h1-h2)*60+(m1-m2));
      }
      cin>>h2>>c>>m2>>s;
   }
   cout << a.size() << endl;
   rep(i,a.size()) cout << a[i] << " " << ans[i] << endl;
}

Measured memory_bytes: 1228
#include<bits/stdc++.h>				//written by thidailoc
using namespace std;				//team three wolves
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pll;
#define fu(i,a,b)   for(ll i=a;i<b;i++)
#define fd(i,b,a)   for(ll i=b;i>=a;i--)
#define ms(a,x) 	memset(a, x, sizeof a)
#define prec(n) 	fixed<<setprecision(n)
#define pb(i)	    push_back(i)
#define popb()    	pop_back()
#define sc(a) 	    cin>>a
#define sc2(a,b)    cin>>a>>b
#define pr(a)	    cout<<a<<" "
#define pr2(a,b)    cout<<a<<" "<<b<<" "
#define lowb(a,n,x) lower_bound(a,a+n,x) -a
#define lowb2(a,x)	lower_bound(a.begin(),a.end(),x) -a.begin()
#define all(x) 		(x).begin(), (x).end()
#define sz(a) 		(ll)a.size()
#define le			length()						
#define re 			return 	
#define	mp(a,b)  	make_pair(a,b)
#define se			second
#define fi			first 
#define debug(x)    cerr << #x << " = " << x << endl
#define INPUT       freopen("locin.txt", "r", stdin)
#define OUTPUT      freopen("locout.txt", "w", stdout)

double const eps = 1e-6;
ll const Base=1e9+7,oo=1e17;
ll arr[1000000],mark[10000000];


ll Solves(){
//	INPUT;
	ll n,k,cnt=0,ans=1,x,p,test,sum=0,query,a,b,c,d;
	// PROCESSING IN HERE
	fu(i,0,3)sc(x),cnt=cnt*10+x;
	
	cout<<(cnt%4==0?"YES":"NO");
	
	re 0;
}


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

Measured memory_bytes: 256
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

import math
X = INT()
if X == 1:
    print(1)
else:
    ans = 1
    for i in range(2, int(math.sqrt(X)) + 1, 1):
        tmp = i
        while tmp <= X:
            if tmp > ans: ans = tmp
            tmp *= i
    print(ans)


Measured memory_bytes: 27096
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,x,n) for (int i = x;i < n;++i)

char s[200001];

int main() {
	stack<bool> st;
	scanf("%s", s);
	int i = 0;
	while (s[i]) {
		if (s[i] == 'T' && !st.empty() && st.top())st.pop();
		else st.push(s[i] == 'S');
		++i;
	}
	printf("%d", st.size());
}

Measured memory_bytes: 640
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdlib>
using namespace std;
char a[15];
int main()
{
	scanf("%s",a+1);
	int len=strlen(a+1);
	if(a[1]!='A'){printf("WA\n");return 0;}
	int wy=0;
	for(int i=2;i<=len;i++)
	{
		if(a[i]=='C' && (i<3 || i==len)){printf("WA\n");return 0;}
		if((a[i]<'a' || a[i]>'z') && a[i]!='C'){printf("WA\n");return 0;}
		if(a[i]=='C')wy++;
	}
	if(wy==1)printf("AC\n");
	else printf("WA\n");
	return 0;
}

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

int main(){
  long long a,b,c,x,y;
  cin >> a >> b >> c >> x >> y;
  long long cost = (x+y)*max(a,b);
  long long xi,yi,costi;
  long long k = 0;
  for(int i=0;i<100001;i++){
    xi = x;
    yi = y;
    costi = 2*c*i;
    xi -= i;
    yi -= i;
    if(xi >= 0 || yi >= 0) costi += a*max(k,xi)+b*max(k,yi);
    else break;
    cost = min(cost,costi);
  }
  cout << cost << endl;
  return 0;
}


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

using namespace std;

#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define int long long
#define mp make_pair
#define ff first
#define ss second
#define pii pair<int,int>
#define INF LLONG_MAX
#define EPS 1e-9
#define all(v) (v).begin(),(v).end()
#define sq(x) ((x)*(x))
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)


#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
 
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
 
typedef long double dbl;
bool codejam = 0;

const int MOD = 1000*1000*1000 + 7;
const int NMAX = 1000*1000 + 11;

int arr[NMAX];
int n,m,p,q,k,a,b,c,ans;
string s,str;
char ch;
vector<int> v;

void solve()
{
    int n;
    cin>>n;
    set<string> st;
    for(int i=0;i<n;i++)
    {
        cin>>str;
        st.insert(str);
    }
    cout<<st.size()<<"\n";
}

int32_t main(){ fio;
    int t = 1;
    int cs = 1;
    // cin>>t;
    while(t--){
        if(codejam){
            cout<<"Case #"<<cs<<": ";
        }
        cs++;
        solve();
        cout<<"\n";
    }
}

Measured memory_bytes: 19244
#include<bits/stdc++.h>
#define ll long long
using namespace std;
long long n, m, x,cnt;
const ll N = 1e5 + 7;
    vector<ll>d(N);
    string s , s1;
int main(){
    cin >> s;
    if( s[s.size() - 1] == 's' )
        cout << s << "es";
    else
        cout << s <<  "s";
}


Measured memory_bytes: 3900
use std::io::BufRead;

fn main() {
    let stdin = std::io::stdin();

    let mut buf = String::new();
    stdin.read_line(&mut buf).ok();
    let (n, _m) = to_pair(&buf);

    let graph: Vec<_> = stdin.lock().lines().map(|l| to_pair(&l.unwrap())).collect();

    let mut matrix: Vec<u8> = vec![0; n as usize];
    for e in graph {
        matrix[e.0 as usize - 1] |= 1 << e.1 - 1;
        matrix[e.1 as usize - 1] |= 1 << e.0 - 1;
    }

    let mut seq: Vec<u32> = (0..n).rev().collect();
    let ans = generate(seq.len() - 1, seq.as_mut_slice(), &matrix); // 末尾以外の順列を生成
    println!("{}", ans);
}

fn to_pair(s: &str) -> (u32, u32) {
    let v: Vec<_> = s.split_whitespace().map(|w| w.parse().unwrap()).collect();
    let (l, r) = (v[0], v[1]);
    (l, r)
}

// Heap のアルゴリズム。thx to うぃきぺ
fn generate(n: usize, a: &mut[u32], mat: &[u8]) -> u64 {
    let mut tmp: u32;
    if n == 1 {
        let mut b = true;
        for i in 0..a.len()-1 {
            if mat[a[i] as usize] & (1 << a[i+1]) == 0 {
                b = false;
                break;
            }
        }
        return if b { 1 } else { 0 };
    } else {
        let mut ret: u64 = 0;
        for i in 0..n {
            ret += generate(n-1, a, mat);
            if n & 1 == 0 {
                tmp = a[i];
                a[i] = a[n - 1];
                a[n - 1] = tmp;
            } else {
                tmp = a[0];
                a[0] = a[n - 1];
                a[n - 1] = tmp;
            }
        }
        return ret;
    }
}


Measured memory_bytes: 4352
/*
Author : icewizard99
Created: 17:33:24 27-06-2020
*/

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

#define ll long long
#define int long long int
#define ull unsigned long long
#define FastAF ios_base::sync_with_stdio(false); cin.tie(NULL)
#define ff first
#define ss second
#define pb push_back
#define FOR(a,L,R) for(int i=L;i<R;i++)
#define all(v) v.begin(),v.end()
#define rev(v) reverse(all(v))
#define sot(v) sort(all(v))
#define printa(a,L,R) for(int i=L;i<R;i++) cout<<a[i]<<(i==R-1?'\n':' ')
#define printv(a) printa(a,0,a.size())
#define print2d(a,row,col) for(int i=0;i<row;i++) for(int j=0;j<col;j++) cout<<a[i][j]<<(j==col-1?'\n':' ')
#define mem(a,x) memset(a,x,sizeof(a))


int32_t main(){
    FastAF;
    
    string s, t;
    cin>>s>>t;
    ll res = 0;
    FOR(i, 0, s.length()){
        if(s[i]!=t[i])
            res++;
    }
    cout<<res;
    return 0;
}



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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
   string s;cin >>s;
   ll n=s.size();
    for (int i = 0; i < n; ++i) {
        if(s[i]=='1')s[i]='9';
        else if(s[i]=='9')s[i]='1';
    }
    cout <<s<<endl;
   return 0;
}

Measured memory_bytes: 256
### constant

MAX_X = 500

### subroutines

def num_rec(frs, nums)
  while ! frs.empty?
    if frs.length == 1
      $id += 1
      nums[frs.first[0]] = $id
      break
    end

    # step 1
    min_x = MAX_X
    min_fs = []

    for i in (0...frs.length)
      if min_x > frs[i][1]
        min_x = frs[i][1]
        min_fs = [i]
      elsif min_x == frs[i][1]
        min_fs << i
      end
    end

    min_f = min_fs.sort!{|a, b| frs[a][2] <=> frs[b][2]}.first
    si, sx0, sy0, sx1, sy1 = frs.delete_at(min_f)

    $id += 1
    nums[si] = $id

    # step 2
    lx0 = sx0
    lx1 = MAX_X
    ly = sy1

    for fr in frs
      i, x0, y0, x1, y1 = fr
      if x0 < lx1 && y0 < ly && y1 > ly
        lx1 = x0
      end
    end

    # step 3
    frs0 = []

    for fr in frs
      i, x0, y0, x1, y1 = fr
      if x1 <= lx1 && y1 <= ly
        frs0 << fr
      end
    end

    frs -= frs0

    num_rec(frs0, nums)
  end
end

### main

prev = false

loop do
  n = gets.to_i
  break if n == 0

  frames = []

  for i in (0...n)
    x0, y0, x1, y1 = gets.split.map(&:to_i)
    if x0 > x1
      x0, x1 = x1, x0
    end
    if y0 > y1
      y0, y1 = y1, y0
    end
    frames << [i, x0, y0, x1, y1]
  end
  #p frames

  rfrs = frames.clone
  $id = 0

  nums = []
  num_rec(rfrs, nums)

  if prev
    puts
  end
  prev = true

  puts nums
end

Measured memory_bytes: 6128
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
typedef long long ll;
typedef pair<ll,ll> pint;
ll gcd(ll a,ll b){
    if(b==0){
        return a;
    }
    else{
        return gcd(b,a%b);
    }
}

int main(){
    vector<pint> E[50];
    ll dist[50][3010];
    int a[101],b[101],c[50],d[50];
    priority_queue<pint,vector<pint>,greater<pint>> que;
    bool visited[50][3010];
    ll ans[50];
    ll n,m,s;cin>>n>>m>>s;
    chmin(s,3000LL);
    rep(i,m){
        int u,v;cin>>u>>v;u--;v--;
        cin>>a[i]>>b[i];
        E[u].push_back({v,i});
        E[v].push_back({u,i});
    }
    rep(i,n){
        cin>>c[i]>>d[i];
    }
    rep(i,n)rep(s,3001)dist[i][s]=1LL << 60;
    rep(i,n)rep(s,3001)visited[i][s]=false;
    rep(i,n)ans[i]=1LL << 60;
    dist[0][s]=0;
    que.push({0,s});
    while(!que.empty()){
        auto q = que.top();que.pop();

        ll cst = q.first;
        int cu = q.second /5010;
        int s = q.second %5010;
        if(visited[cu][s]) continue;
        visited[cu][s] =true;
        chmin(ans[cu],cst);
        for(int j=0;j<E[cu].size();j++){
            auto p =E[cu][j];
            int to = p.first;
            int i = p.second;
            if (s<a[i]) continue;

            ll cst2 = cst+b[i];
            if (chmin(dist[to][s-a[i]],cst2)) que.push({dist[to][s-a[i]],to*5010+s-a[i]});
        }
        ll cst2 = cst+d[cu];
        int s2 = min(3000,s+c[cu]);
        if(chmin(dist[cu][s2],cst2)) que.push({dist[cu][s2],cu*5010+s2});
    }

    REP(i,1,n) cout<<ans[i]<<endl;
}

Measured memory_bytes: 6612
package main

import "fmt"

func main() {
	C := make([][]int, 3)
	for i := 0; i < 3; i++ {
		C[i] = make([]int, 3)
	}

	for i := 0; i < 3; i++ {
		for j := 0; j < 3; j++ {
			fmt.Scan(&C[i][j])
		}
	}

	for i := 0; i < 3; i++ {
		p := C[0][1] - C[0][0]
		q := C[0][2] - C[0][1]
		if C[i][1]-C[i][0] != p {
			fmt.Println("No")
			return
		}
		if C[i][2]-C[i][1] != q {
			fmt.Println("No")
			return
		}
	}
	for i := 0; i < 3; i++ {
		p := C[1][0] - C[0][0]
		q := C[2][0] - C[1][0]
		if C[1][i]-C[0][i] != p {
			fmt.Println("No")
			return
		}
		if C[2][i]-C[1][i] != q {
			fmt.Println("No")
			return
		}
	}
	fmt.Println("Yes")
}


Measured memory_bytes: 1836
// finish date: 2018/03/13

#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvvi vector<vector<vector<int>>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vvd vector<vector<double>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define bigmod 1000000007
#define INF 1050000000
#define pii pair<int,int>


int main() {
    int N, M;
    cin >> N >> M;
    if (N > M) swap(N, M);
    if (N == 1) {
        if (M == 1) cout << 1 << endl;
        else cout << M - 2 << endl;
        return 0;
    }
    ll ans = (ll) (N - 2) * (M - 2);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func combinationTwo(a int)int{
	return a * (a-1) / 2
}

func main() {
	var even, odd int
	fmt.Scan(&even, &odd)
	// even2個、odd2個で偶数になる
	// even C 2 + odd C 2の組み合わせが答え

	ans := 0
	if even >= 2 && odd >= 2{
		ans = combinationTwo(even) + combinationTwo(odd)
	}else if even >= 2 && odd < 2{
		ans = combinationTwo(even)
	}else if even < 2 && odd >= 2{
		ans = combinationTwo(odd)
	}

	fmt.Println(ans)
}

Measured memory_bytes: 512
#include<iostream>
#include<string>
#include<algorithm>
#include<utility>
#include<vector>
#include<map>
#include<set>
#include<tuple>
#include<stack>
#include<queue>
#include<functional>
#include<iterator>
#include<cmath>

using namespace std;

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

	int n,k;
	cin >> n >> k;

	int tmp;
	for(int i=0;i<n;i++){
		cin >> tmp;
	}

	if(n <= k) cout << 1 << "\n";
	else{
		int ans = 1;
		ans += (n-k) / (k-1);
		if((n-k)%(k-1) != 0) ans++;
		cout << ans << "\n";
	}
	

	return 0;
}

Measured memory_bytes: 256
//Author : pakhandi
//
using namespace std;
 
#include <bits/stdc++.h>
 
#define wl(n) while(n--)
#define fl(i,a,b) for(i=a; i<b; i++)
#define rev(i,a,b) for(i=a; i>=b; i--)
 
#define si(n) scanf("%d", &n)
#define sll(l) scanf("%lld",&l)
 
#define debug(x) cout<<"\n#("<<x<<")#\n"
#define nline printf("\n")
 
#define mem(a,i) memset(a,i,sizeof(a))
 
#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int
 
#define PB push_back
#define SZ size
#define MP make_pair
 
#define IGNORE cin.ignore (std::numeric_limits<std::streamsize>::max(), '\n');
 
const ll INF = (1LL << 58);
const bool DEBUG = 0;
 
int N, A, B;
ll arr[55];
	ll C[55][55];
 
int main()
{
	int i, j;
 
	scanf("%d %d %d", &N, &A, &B);
 
	for(int i = 0; i < N; i++)
	{
		scanf("%lld", &arr[i]);
	}
 
	sort(arr, arr + N);
	reverse(arr, arr + N);
 
	ll sum  = 0;
	ll lastEle;
	for(int i = 0; i < A; i++)
	{
		sum += arr[i];
		lastEle = arr[i];
	}
 
	double mean = (sum * 1.0) / (A * 1.0);
	int tot = 0, in = 0;
	for(int i = 0; i < N; i++)
	{
		if(arr[i] == lastEle)
			tot++;
		if(i < A && arr[i] == lastEle)
			in++;
	}
 
	C[0][0] = 1;
	for(int i = 1; i < 51; i++)
	{
		C[i][0] = 1;
		for(int j = 1; j <= i; j++)
		{
			C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
		}
	}
 
	ll ways = 0;
 
	if(in == A)
	{
		for(int i = A; i <= B ; i++)
		{
			ways += C[tot][i];
		}
	}
	else
		ways = C[tot][in];
 
 
	// ll ways = C[tot][in];
 
	printf("%0.9lf\n%lld", mean, ways);
 
	return 0;
}
/*
	Powered by Buggy Plugin
*/

Measured memory_bytes: 256
import java.util.*;

public class Main {
    static int MOD = 1000000007;
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int c = sc.nextInt();
        int k = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        Arrays.sort(array);
        
        int ans = 0;
        int index = 0;
        while (index <= n - 1) {
            // System.out.println(index);
            int tmp = array[index];
            ans++;
            for (int i = 0; i < c; i++) {
                if (index > n - 1) break;
                if (array[index] <= tmp + k) {
                    index++;
                } else {
                    break;
                }
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 51488
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
const ll INF=99999999999999999;
ll a,b,c,d,e,f,g,ans=0;
int main(){
    ll n,k;
    cin>>n>>k;
    ans=INF;
    vl x(n);
    rep(i,n){
        cin>>x[i];
    }

    for(int i=0;i<(1<<n);i++){
        a=0;
        rep(j,n){
            if((i&(1<<j))>0)a++;
        }
        if(a==k){
            b=0;
            c=0;
            rep(j,n){
              if((i&(1<<j))==0){
                if(b<x[j])goto next;
            }
            if((i&(1<<j))>0){
                if(b+1>x[j])c+=b+1-x[j];
                b=fmax(b+1,x[j]);
            }
        }
         //cout<<i<<" "<<c<<endl;
        if(ans>c)ans=c;
        }
      next:
      f=0;
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 256
n,m,c = map(int, input().split())
b = list(map(int, input().split()))
l=[]
for i in range(n):
        tmp = list(map(int,input().split()))
        l.append(tmp)
ans=0
for i in range(n):
        sm=0
        for j in range(m):
                sm+=l[i][j] * b[j]
        sm+=c
        if sm > 0:
                ans+=1
print(ans)

Measured memory_bytes: 3064
#include<iostream>
#include<string>
using namespace std;
class Dice{
public:
	int dice[6];
	int getAns(){
		return dice[0];
	}
	int getAns2(){
		return dice[1];
	}
	int getAns3(){
		return dice[2];
	}
	void input(){
		for (int i = 0; i < 6; i++){
			cin >> dice[i];
		}
	}
	void moveS(){
		int dice2[6];
		int index_list[6] = { 4, 0, 2, 3, 5, 1 };
		for (int i = 0; i < 6; i++){
			int idx = index_list[i];
			dice2[i] = dice[idx];
		}
		for (int i = 0; i < 6; i++){
			dice[i] = dice2[i];
		}
	}
		void moveE(){
			int dice2[6];
			int index_list[6] = { 3,1, 0, 5,4, 2 };
			for (int i = 0; i < 6; i++){
				int idx = index_list[i];
				dice2[i] = dice[idx];
			}
			for (int i = 0; i < 6; i++){
				dice[i] = dice2[i];
			}
		}
		void moveX(){
			int dice2[6];
			int index_list[6] = {0,3,1,4,2,5};
			for (int i = 0; i < 6; i++){
				int idx = index_list[i];
				dice2[i] = dice[idx];
			}
			for (int i = 0; i < 6; i++){
				dice[i] = dice2[i];
			}
		}
		
};
int main(){
	Dice dice;
	dice.input();
	int q,a,b;
	cin >> q;
	for (int i = 0; i < q; i++){
		cin >> a >> b;
		for (int j = 0; j < 4; j++){
			if (dice.getAns() == a)break;
			dice.moveS();
		}
		for (int k = 0; k < 4; k++){
			if (dice.getAns() == a)break;
			dice.moveE();
		}
		for (int l = 0; l < 4; l++){
			if (dice.getAns2() == b)break;
			dice.moveX();
		}
		cout << dice.getAns3() << endl;
	}
	return 0;
}

Measured memory_bytes: 3048
#include <iostream>

using namespace std;

int main(){
  int n;
  int debt=100000;
  double tmp;

  cin >> n;
  for(int i=0; i<n; i++){
    debt += debt * 0.05; 
    //1000円未満切り上げ
    tmp = (double)debt/1000 - debt/1000;
    tmp = (tmp > 0.0) ? 1.0 : 0.0;
    debt = (debt/1000) * 1000 + tmp * 1000;
  }

  cout << debt << endl;
  return 0;
}

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

const int N = 2e5+10;

int n, a[N];
vector<int> to[N];

int b[N], ans[N];

void dfs(int u, int f) {
	int pos = -1, val = 0;
	pos = lower_bound(b, b+n+1, a[u])-b;
	val = b[pos];
	b[pos] = min(b[pos], a[u]);
	for (int v: to[u]) {
		if (v == f) continue;
		dfs(v, u);
	}
	ans[u] = lower_bound(b, b+n+1, 0x3f3f3f3f)-b-1;
	b[pos] = val;
}

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i) {
		scanf("%d", a+i);
	}
	for (int i = 1; i < n; ++i) {
		int u, v;
		scanf("%d%d", &u, &v);
		to[u].push_back(v);
		to[v].push_back(u);
	}
	memset(b, 0x3f, sizeof(b));
	b[0] = 0;
	dfs(1, 1);
	for (int i = 1; i <= n; ++i) {
		printf("%d\n", ans[i]);
	}
}


Measured memory_bytes: 31340
#include <iostream>
#include <vector>
#include <cmath>


int main()
{
    while (true) {
        int students_num;
        std::cin >> students_num;

        if (students_num == 0) {
            break;
        }

        std::vector<int> points(students_num);
        for (int i = 0; i < students_num; i++) {
            std::cin >> points.at(i);
        }

        double ave = 0;
        for (int i = 0; i < students_num; i++) {
            ave += points.at(i);
        }
        ave /= students_num;

        double variance = 0;
        for (int i = 0; i < students_num; i++) {
            variance += pow(points.at(i) - ave, 2);
        }
        variance /= students_num;

        double deviation = sqrt(variance);

        std::cout << std::fixed << deviation << std::endl;
    }

    return 0;
}

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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

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

    int ans;
    if (a > b)
    {
        ans = max(a - b - w, 0);
    }
    else
    {
        ans = max(b - a - w, 0);
    }

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


Measured memory_bytes: 3608
//header{{{
#include<bits/stdc++.h>
  
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define setout(n,x) setw(n+1) << setfill(x)
#define Fixed fixed << setprecision(10)
#define int int64_t
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1e9+7; 
constexpr int MOD = 998244353;

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

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class A, class B> using umap = unordered_map<A,B>;
  
int gcd(int a,int b){ return b ? gcd(b,a % b) : a;}
int lcm(int a,int b){ return a / gcd(a,b) * b;}

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

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    int n;
    string s;
    cin >> n >> s;
    int cnt = 0;
    rep(i,n-2){
        if(s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C') ++cnt;
    }
    cout << cnt << '\n';
	return 0;
}


Measured memory_bytes: 256
from collections import Counter

N = int(input())
A = list(map(int, input().split()))
c_dict = Counter(A)
B = []
C = []

for k, v in c_dict.items():
    if v >= 4:
        B.append(k)
    elif v >= 2:
        C.append(k)
B.sort(reverse=True)
C.sort(reverse=True)

if len(B) < 1 and len(C) < 2:
    print(0)
elif len(B) < 1 and len(C) >= 2:
    F = C[1] * C[0]
    print(F)
elif len(B) >= 1 and len(C) == 1:
    D = B[0] ** 2
    E = C[0] * B[0]
    print(max(D, E))
elif len(B) >= 1 and len(C) >= 2:
    D = B[0] ** 2
    E = C[0] * B[0]
    F = C[1] * C[0]
    print(max(D, E, F))


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

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<double> vd;
typedef vector<vd> vdd;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define debug_print(x...) cerr << "line " << __LINE__ << " : "; debug_print_in(x);

template <typename First>
void debug_print_in(First first){
  cerr << first << endl;
  return;
}

template <typename First, typename... Rest>
void debug_print_in(First first, Rest... rest){
  cerr << first << " ";
  debug_print_in(rest...);
  return;
}

void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

template <typename First>
void OUT(First first){
  cout << first << endl;
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

template<class t, class u> void chmax(t&a,u b){if(a<b)a=b;};
template<class t, class u> void chmin(t&a,u b){if(a>b)a=b;};
int popcount(int t){return __builtin_popcount(t);} //GCC
int popcount(ll t){return __builtin_popcountll(t);} //GCC

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cerr << VEC[i] << " ";
  }
  cerr << endl;
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i,MAT.size()){
    REP(j,MAT[i].size()){
      cerr << MAT[i][j] << " ";
    }
    cerr << endl;
  }
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll N;
  IN(N);

  REP(X,N+1){
    ll N_tmp = (ll)((double)X*1.08);
    if(N==N_tmp){
      OUT(X);
      return 0;
    }
  }

  OUT(":(");

  return 0;
}

Measured memory_bytes: 256
import queue

"""
N = int(input())
#S = input()
# (N,M) = (int(i) for i in input().split(" "))
# A = [int(i) for i in input().split()]
A = []
for i in range(N):
	A.append(int(input()))

print(A)

"""
R={"Sunny":"Cloudy","Cloudy":"Rainy","Rainy":"Sunny"}
N = input()
print(R[N])

Measured memory_bytes: 4208
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
const ll LL_MAX=LLONG_MAX;

struct In{
    template<typename T>
    operator T(){
        T x;
        cin >> x;
        return x;
    }
};
In in;

template <typename T,typename U>
void forin(T* x,U n){
    for (U i=0;i<n;i++) cin >> x[i];
}

template <typename T>
int div1(T x) {
    return x%1000000007;
}

template <typename T>
void out(T x){
    cout << x << endl;
}

template <typename T>
T gcd(T x,T y){
    if (y == 0) return x;
    return gcd(y,x%y);
}

template <typename T>
T lcm(T x,T y){
    return x*y/gcd(x,y);
}

int main(){
    int n=in,r=in;
    out( (n<10) ? r+100*(10-n) : r );
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
*/public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		Scanner in = new Scanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
static class TaskD   {
public void solve(int testNumber, Scanner in, PrintWriter out) {
        int N = in.nextInt();
        int M = in.nextInt();
        int Q = in.nextInt();
        int a[][] = new int[N][N];
        for(int i = 0; i<M; i++) a[in.nextInt()-1][in.nextInt()-1]++;
        int[][] sum = sum2D(a);
        for(int i = 0; i<Q; i++){
            int p = in.nextInt();
            int q = in.nextInt();
            out.println(query(sum, p-1, p-1, q, q));
        }
    }

int[][] sum2D(int[][] a) {
        int ret[][] = new int[a.length+1][a[0].length+1];
        for(int j=0; j < a[0].length; j++){
            for(int i=0; i < a.length; i++){
                ret[i+1][j+1] = ret[i+1][j] + ret[i][j+1] - ret[i][j] + a[i][j];
            }
        }
        return ret;
    }

int query(int[][] sum, int sx, int sy, int fx, int fy) {
        return sum[fx][fy] - sum[sx][fy] - sum[fx][sy] + sum[sx][sy];
    }

}
}



Measured memory_bytes: 155420
#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "bitset"
#include "queue"
#include "functional"
#include "map"
#include "unordered_map"

#define lp(n) for (int i = 0; i < n; i++)
#define LP(n,i) for (int i = 0; i < n; i++)
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define nya_n "(=^･ω･^=)"
typedef long long ll;
using namespace std;


int n, a, nmbcnt[100000], cnt;
bool flag;

int main() {
	cin >> n;
	lp(100000)
		nmbcnt[i] = 0;
	lp(n) {
		cin >> a;
		nmbcnt[a - 1]++;
	}
	cnt = 0;
	flag = false;
	lp(100000) {
		if (nmbcnt[i] % 2 == 1)cnt++;
		else if (nmbcnt[i] != 0) {
			if (flag)cnt += 2;
			flag = !flag;
		}
	}
	cout << cnt << endl;
	return 0;
}

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

using namespace std;

int main(void){
    int H, W;
    cin >> H >> W;
    vector<string> a(H);
    for(auto& it : a) cin >> it;
    for(int i=0;i<W+2;i++) cout << '#'; cout << endl;
    for(int i=0;i<H;i++){
        cout << '#' << a[i] << '#' << endl;
    }
    for(int i=0;i<W+2;i++) cout << '#'; cout << endl;
    
    return 0;
}

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

# define REP(i,n) for (int i=0;i<(n);++i)
# define rep(i,a,b) for(int i=a;i<(b);++i)
# define p(s) std::cout << s ;
# define pl(s)  std::cout << s << endl;
# define printIf(j,s1,s2) cout << (j ? s1 : s2) << endl;
# define YES(j) cout << (j ? "YES" : "NO") << endl;
# define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
# define yes(j) std::cout << (j ? "yes" : "no") << endl;
# define all(v) v.begin(),v.end()
# define showVector(v) REP(i,v.size()){p(v[i]);p(" ")} pl("")
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;}
typedef long long int ll;
typedef pair<ll,ll> P_ii;
typedef pair<double,double> P_dd;

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}

template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}


const int MOD = 1000000007;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;

void addM(long long &a, long long b) {
    a += b;
    if (a >= MOD) a -= MOD;
}

void mulM(long long &a, long long b) {
    a = ((a%MOD)*(b%MOD))%MOD ;
}

// a^b mod M
long myPow(long a,long b,int M) {
    long ret = 1;
    long tmp = a;
    while(b>0) {
        if((b&1)==1) ret = (ret * tmp) % M;
        tmp = (tmp * tmp) % M;
        b = b>>1;
    }
    return ret;
}

 // nCk mod M
int nCk(int n,int k,int M) {
    long ret = 1;
    int mi = min(k, n-k);
    for(int i=1;i<=mi;i++) {
        ret = (ret * myPow(i,M-2,M)) % M;
    }
    for(int i=n-mi+1;i<=n;i++) {
        ret = (ret * i) % M;
    }
    return (int)ret;
};

vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

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

    vector<int> a(n);
    vector<int> b(n);
 
    REP(i,n) cin >> a[i];
    REP(i,n) cin >> b[i];

    // 矛盾の確認
    int j=0;
    while(a[j]!=a[n-1]) j++;    
    if(b[j]!=a[n-1] || a[n-1] != b[0]) {
        cout << 0 << endl;
        return 0;
    }

    ll ans = 1;
    REP(i,n-2) if(a[i]==a[i+1] && b[i+1]==b[i+2]) mulM(ans,min(a[i+1],b[i+1]));
    

    pl(ans)

    return 0;
}

Measured memory_bytes: 1024