akhauriyash/Code-Regression huggingface dataset:
X = int(input())

def is_prime(n):
    if n==1:return False
    for i in range(2,n+1):
        if i*i > n:
            return True
        if n%i==0:
            return False
    return True

for i in range(X,110000):
    if is_prime(i):
        print(i)
        break

Measured memory_bytes: 3060
n = int(input())
p = list(map(float, input().split()))

dp = [[0]*(n+1) for _ in range(n+1)]
dp[0][0] = 1
for i in range(1,n+1):
    dp[i][0] = dp[i-1][0]*(1-p[i-1]) 
for i in range(1, n+1):
    for j in range(1, i+1):
        dp[i][j] = dp[i-1][j-1]*p[i-1] + dp[i-1][j]*(1-p[i-1])
        #print(dp, sep='\n')        
ans = 0
for j in range(n//2+1, n+1):
    ans += dp[n][j]

print(ans)
        

Measured memory_bytes: 311432
//#include <bits/stdc++.h>
// utility
#include <bitset>
#include <tuple>
#include <typeinfo>
// error handling
#include <cassert>
// string
#include <cctype>
#include <cstring>
#include <string>
// container
#include <array>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
// algorithm
#include <algorithm>
// iterator
#include <iterator>
// math
#include <cmath>
#include <complex>
#include <numeric>
#include <random>
// i/o
#include <iostream>
#include <iomanip>
#include <cstdio>



using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
typedef __int128_t Int;
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF =
sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
#define fi first
#define se second
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>
istream &operator>>(istream &is, pair<T, S> &p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T> void printvv(const vector<vector<T>> &v) {
  cerr << endl;
  rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
    if (typeid(v[i][j]) == typeid(INF) and v[i][j] == INF) {
      cerr << "INF";
    } else
      cerr << v[i][j];
    cerr << (j == v[i].size() - 1 ? '\n' : ' ');
  }
  cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);

  int N, K; cin >> N >> K;
  cout<<!!(N%K)<<endl;

    return 0;
}


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

using namespace std;

const int NMAX = 1e5+5;
const int MOD = 1e9+7;

vector<int> g[NMAX];

bool viz[NMAX];
int dp[NMAX][2];
//dp[i][0] = the nr of valid ways to paint the subtree of i given that i is painted white
//dp[i][1] = the same but if i is painted black

inline void DFS(int node)
{
    viz[node] = 1;
    dp[node][0] = dp[node][1] = 1;
    for(auto gnode : g[node])
    {
        if(!viz[gnode])
        {
            DFS(gnode);
            dp[node][0] = (1LL*dp[node][0]*1LL*(dp[gnode][0] + dp[gnode][1]))%MOD;
            dp[node][1] = (1LL*dp[node][1]*dp[gnode][0])%MOD;
        }
    }
}

int main()
{
    int N,i,j;

    cin>>N;

    for(i = 1 ; i < N ; ++i)
    {
        int x,y;
        cin>>x>>y;
        g[x].push_back(y);
        g[y].push_back(x);
    }

    DFS(1);

    cout<<(dp[1][0] + dp[1][1])%MOD;
}


Measured memory_bytes: 9088
N, K = map(int, input().split())
d = []
A = []

for k in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

all_sunuke = set(list(range(1, N+1)))
sunuke = set()

for k in range(K):
    sunuke |= set(A[k])

result = len(all_sunuke - sunuke)

print(result)



Measured memory_bytes: 9240
#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <functional>
#include <string>
#include <stack>
#include <set>
#include <sstream>
#include <iomanip>
#include <limits>
#include <cstring>

using namespace std;
using ll = long long;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<double, double >pd;
typedef pair<string, string> sP;
typedef pair<ll, P> PP;
typedef pair<P, P> PPP;

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll INF = 1 << 30;
const ll INF2 = 9e18;
const double INF3 = 9e14;
const double eps = 1e-10;
const double PI = 3.14159265358979323846;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };

#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define pb push_back
#define eb emplace_back
#define fr first
#define sc second


struct Starry_Sky_tree {
private:
	vector<ll>segMin;
	vector<ll>segAdd;
	ll N;
public:
	Starry_Sky_tree(vector<ll>v) {
		ll sz = v.size();
		N = 1;while (N < sz)N *= 2;
		segMin.resize(2 * N - 1, 0);
		segAdd.resize(2 * N - 1, 0);
	}

	//区間[a, b)に値xを加算する.
	void add(int a, int b, int x, int k = 0, int l = 0, int r = -1)
	{
		if (r < 0)r = N;
		if (r <= a || b <= l) return; //もし交差しない区間であれば終える.

		if (a <= l && r <= b) { //もし今みている区間[l, r)が[a, b)に完全に内包されていれば
			segAdd[k] += x;  //区間[l, r)にkを加算する.
			return;
		}

		add(a, b, x, k * 2 + 1, l, (l + r) / 2); //子の区間に(必要があれば)xを加算する.
		add(a, b, x, k * 2 + 2, (l + r) / 2, r); //〃

												 //親の区間の最小値は, 子の区間の最小値 + 自分に一様に加算されている値 である.一様に加算される値は更新しなくて良い.
		segMin[k] = min(segMin[k * 2 + 1] + segAdd[k * 2 + 1], segMin[k * 2 + 2] + segAdd[k * 2 + 2]);
	}

	ll getMin(int a, int b, int k = 0, int l = 0, int r = -1)
	{
		if (r < 0)r = N;
		if (r <= a || b <= l) return INF2;

		if (a <= l && r <= b) return segMin[k] + segAdd[k]; //完全に内包されていれば,その区間の最小値を返す.

		ll left = getMin(a, b, k * 2 + 1, l, (l + r) / 2); //子の区間の最小値を求める.
		ll right = getMin(a, b, k * 2 + 2, (l + r) / 2, r); //子の区間の最小値を求める

		return min(left, right) + segAdd[k]; //親の区間の最小値は, 子の区間の最小値 + 自分に一様に加算されている値 である (大切なので2回書きました!!)

	}
};

vector<ll>v;

int main() {
	ll n, d[300010];
	cin >> n;
	for (int i = 1;i <= n;i++) {
		cin >> d[i];
	}
	v.resize(n+1);
	Starry_Sky_tree seg(v);
	seg.add(1, 2, 1);
	for (int i = 1;i < n;i++) {
		if (seg.getMin(i, i + 1) >= 1) {
			if (d[i] / 10 >= 1)seg.add(i + 1, min(n+1, i + d[i] / 10 + 1), 1);
		}
	}
	if (seg.getMin(n, n + 1) == 0) {
		cout << "no" << endl;
		return 0;
	}
	Starry_Sky_tree se(v);
	se.add(n, n + 1, 1);
	for (int i = n;i >= 2;i--) {
		if (se.getMin(i, i + 1) >= 1) {
			if (d[i] / 10 >= 1)se.add(max(1LL, i - d[i] / 10), i, 1);
		}
	}
	if (se.getMin(1, 2) == 0) {
		cout << "no" << endl;
		return 0;
	}
	cout << "yes" << endl;
	return 0;
}



Measured memory_bytes: 42724
n, m = map(int, input(). split())
lstr_a = input().split(" ")
lint_a = [int(n) for n in lstr_a]
alist = sorted(lint_a, reverse = True)
s = sum(alist)
if alist[m-1]>=s/(4*m):
  print("Yes")
else:
  print("No")

Measured memory_bytes: 3060
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef int64_t int64;
typedef uint32_t uint;
typedef uint64_t uint64;
using namespace std;

//---

template <typename T>
inline void print(const T& rhs){ std::cout<<" = "<<rhs<<std::endl; }
template <typename T>
inline void print(const std::vector<T>& rhs){
    std::cout<<" = [ ";
    for(uint i=0; i<rhs.size(); ++i){ std::cout<<rhs[i]<<' '; }
    std::cout<<"]"<<std::endl;
}
template <typename T>
inline void print(const std::vector<std::vector<T>>& rhs){
    std::cout<<" = "<<std::endl;
    std::cout<<"[[ ";
    for(uint p=0; p<rhs.size(); ++p){
        if(p!=0){ std::cout<<" [ "; }
        for(uint q=0; q<rhs[p].size(); ++q){
            std::cout<<rhs[p][q]<<' ';
        }
        if(p!=rhs.size()-1){ std::cout<<"]"<<std::endl; }
    }
    std::cout<<"]]"<<std::endl;
}
template <typename TL, typename TR>
inline void print(const std::vector<std::pair<TR,TL>>& rhs){
    std::cout<<" = [";
    uint i=0;
    for(; i<rhs.size()-1; ++i){ std::cout<<"[f: "<<rhs[i].first<<", s: "<<rhs[i].second<<"], "; }
    std::cout<<"[f: "<<rhs[i].first<<", s: "<<rhs[i].second<<"]]" << endl;
}
#define printn(var) {printf("%s", #var);print(var);}
#define printn_all(var) {printf("%s(%d): ", __func__, __LINE__);printf("%s", #var);print(var);}

//---

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int N; cin >> N;
    string s; cin >> s;
    vector<int> vL('z'-'a'+1, 0);
    
    int max_cnt=0;
    for(int c=0; c<N; ++c){
        int cnt=0;

        // left side
        for(int i=0; i<c; ++i){ vL[s[i]-'a'] += 1; }

        // right side
        for(int i=c; i<N; ++i){
            if( vL[s[i]-'a'] !=0 ){
                vL[s[i]-'a'] = 0;
                ++cnt;
            }
        }
        max_cnt = max(max_cnt, cnt);
    }
    
    cout << max_cnt << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define sz(v) (int) v.size()
#define pr(v) For(i, 0, sz(v)) {cout<<v[i]<<" ";} cout<<endl;
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(ll i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long
#define int long long
#define mp make_pair
#define F first
#define S second
typedef pair<int, int> pii;
typedef vector<int> vi;
#define MOD 1000000007
#define INF 1000000000000000007LL

const int N = 100005;
 
// it's swapnil07 ;)
 
#ifdef SWAPNIL07
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif


signed main()
{
    fast
    #ifdef SWAPNIL07
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    int n, k; cin>>n>>k;
    int ans = 1;
    For(i, 0, n-1){
        ans = ans*(k-1);
    }
    ans *=k;
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
def getinputdata():

    array_result = []    
    array_result.append(input().split(" "))

    flg = True

    try:
        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

arr=[]
for i in range(1,1+n):
    
    arr.append(arr_data[i][0])

chkflg=True
if len(arr)!=len(set(arr)):
    chkflg=False
    
for i in range(0,n-1):
    
    if arr[i][-1]!=arr[i+1][0]:

        chkflg=False
        break
        
print("Yes" if chkflg else "No")

Measured memory_bytes: 3064
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n = I()
    a = collections.Counter(["".join(sorted([c for c in S()])) for _ in range(n)])
    r = 0
    for i in a.values():
        r += i * (i-1) // 2

    return r


print(main())





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

int main(){
    int a,b,c,k,gcd;

    scanf("%d",&k);

    gcd=0;
    for(a=1;a<=k;a++){
       for(b=1;b<=k;b++){
          for(c=1;c<=k;c++){
             gcd+=__gcd(__gcd(a,b),c);
          }
       }
    }
    printf("%d\n",gcd);

return 0;
}



Measured memory_bytes: 3796
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
#include <stdio.h>
#include <stdlib.h>
#include <cstdint>
#include <cfenv>
//#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
long long MOD = 1000000000 + 7;
constexpr long long INF = std::numeric_limits<LL>::max();
const double PI = acos(-1);
#define fir first
#define sec second
#define thi third
#define debug(x) cerr<<#x<<": "<<x<<'\n'
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Mfor(i,mf) for(LL i=mf-1;i>=0;i--)
LL h, w, n, m, k, t, s, q, last, cnt, sum[1000000], ans, dp[110000];
Pll a[200000], b[2000000];
string str, ss, dd;
bool f[2000][2000],ff;
char c;
int di[4][2] = { { 0,1 },{ 1,0 },{ -1,0 } ,{ 0,-1 } };
struct Edge { LL to, cost; };
vector<Edge>vec[10000];
vector<Pll>v;
map<string, LL>ma;
set<LL>st;
void YN(bool f) {
	if (f)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
}
void yn(bool f) {
	if (f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

int main() {
	cin >> n >> m >> w >> h;
	cout << max(n*m, h*w) << endl;
	return 0;
}

Measured memory_bytes: 2560
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int calc()
{
	int ret=0;
	vector<int>ok;
	for(int i=0;i<9;i++)
	{
		int a;cin>>a;
		ret+=a;
		for(int&j:ok)
		{
			if(j-->0)ret+=a;
		}
		if(a==10)
		{
			ok.push_back(2);
			continue;
		}
		int b;cin>>b;
		ret+=b;
		for(int&j:ok)
		{
			if(j-->0)ret+=b;
		}
		if(a+b==10)
		{
			ok.push_back(1);
		}
	}
	int a,b;cin>>a>>b;
	ret+=a+b;
	for(int&j:ok)
	{
		if(j-->0)ret+=a;
		if(j-->0)ret+=b;
	}
	if(a+b>=10)
	{
		int c;cin>>c;ret+=c;
	}
	return ret;
}
main()
{
	int N;
	while(cin>>N,N)
	{
		vector<pair<int,int> >P;
		for(int i=0;i<N;i++)
		{
			int id;cin>>id;
			int p=calc();
			P.push_back(make_pair(-p,id));
		}
		sort(P.begin(),P.end());
		for(pair<int,int>p:P)cout<<p.second<<" "<<-p.first<<endl;
	}
}



Measured memory_bytes: 3052
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

// 内部定数
#define D_ARRAY_MAX		200000									// 最大配列数

// 内部変数
static FILE *szpFpI;											// 入力
static int si1A[D_ARRAY_MAX + 5];								// 配列A
static int si1B[D_ARRAY_MAX + 5];								// 配列B
static int siACnt;												// 配列数

// 実行メイン
int
fMain(
	int piTNo					// <I> テスト番号 1～
)
{
	int i;
	char lc1Buf[1024];

	// データ - 初期化
	memset(si1A, 0, sizeof(si1A));								// 配列A
	memset(si1B, 0, sizeof(si1B));								// 配列B

	// 入力 - セット
#ifdef D_TEST
	sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
	szpFpI = fopen(lc1Buf, "r");
#else
	szpFpI = stdin;
#endif

	// 配列数 - 取得
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
	sscanf(lc1Buf, "%d", &siACnt);

	// 配列 - 累積和 - 初期値
	for (i = 1; i <= siACnt; i++) {
		si1A[i] = 1;
		si1B[i] = 1;
	}

	// 順序 - 取得
	for (i = 0; i < siACnt; i++) {
		int liVal;
		fscanf(szpFpI, "%d", &liVal);

		// 配列 - 累積和 - 加算
		si1A[liVal] += i;
		si1B[liVal] += i;

	}
	fgets(lc1Buf, sizeof(lc1Buf), szpFpI);

	// 配列 - 累積和 - 計算
	for (i = 1; i <= siACnt; i++) {
		si1A[i] += si1A[i - 1];
	}
	for (i = siACnt; i >= 1; i--) {
		si1B[i] += si1B[i + 1];
	}

	// 配列A - 表示
	printf("%d", si1A[1]);
	for (i = 2; i <= siACnt; i++) {
		printf(" %d", si1A[i]);
	}
	printf("\n");

	// 配列B - 表示
	printf("%d", si1B[1]);
	for (i = 2; i <= siACnt; i++) {
		printf(" %d", si1B[i]);
	}
	printf("\n");

	// テストファイルクローズ
#ifdef D_TEST
	fclose(szpFpI);
#endif

	return 0;
}

int
main()
{

#ifdef D_TEST
	int i;
	for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
		fMain(i);
	}
#else
	fMain(0);
#endif

	return 0;
}



Measured memory_bytes: 2048
n = int(input())
rx = 0
ry = 0
rt = 0
ok = True
for _ in range(n):
    t, x, y = map(int, input().split())
    dist = abs(x-rx) + abs(y-ry)
    #print(dist)
    if dist <= abs(t-rt) and (abs(t-rt)-dist)%2 == 0:
        rx = x
        ry = y
        rt = t
    else: ok = False

if ok: print("Yes")
else: print("No")

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

int waru(int n){
    int x=0;
    while(n%2==0){
        n/=2;
        x++;
    }
    return x;
}

int main() {
int n; cin >> n;
int MAX = 0;
int ans=1;
for(int i = 1;i<=n;++i){
    if(waru(i)>MAX){
       MAX = waru(i);
       ans = i;
    }
}
cout << ans << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <cstring>
#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
#include <math.h>
using namespace std;
typedef long long ll;
const int INF = 1001001001;

int main() {
    ll N, M, X;
    int i, j;

    cin >> N >> M >> X;

    vector<int> C(N);
    vector<vector<int> > A(N, vector<int>(M));

    for(i=0; i<N; i++) {
        cin >> C[i];
        for(j=0; j<M; j++) {
            cin >> A[i][j];
        }
    }

    int ans = INF;

    for(i=0; i<1<<N; i++) {
        int cost = 0;
        vector<int> sum(M, 0);
        for(j=0; j<N; j++) {
            if(((i>>j)&1)) {
                cost+=C[j];
                for(int k=0; k<M; k++) {
                    sum[k]+=A[j][k];
                }
            }
        }
        bool ok = true;
        for(j=0; j<M; j++) {
            if(sum[j] < X) {
                ok = false;
            }
        }
        if(ok) {
            ans = min(ans, cost);
        }
    }
    if(ans == INF) cout <<  -1 << endl;
    else cout << ans << endl;

    return 0;
    
}

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

int main(){
  int N;
  cin >> N;
  vector<char> v (N);
  for (int i = 0; i < N; i++){
    cin >> v.at(i);
  }
 bool ans = false;
  for (int i = 0; i < N; i++){
    if (v.at(i) == 'Y')
      ans = true;
  }
  if (ans)
    cout << "Four" << endl;
  else cout << "Three" << endl;
}

Measured memory_bytes: 256
c_l = []
for _ in range(3):
    c_l.append(list(map(int,input().split())))

b2mb1 = c_l[0][1]-c_l[0][0]
b3mb1 = c_l[0][2]-c_l[0][0]

for i in (1,2):
    if c_l[i][1] != c_l[i][0] + b2mb1:
        print('No')
        exit()
    if c_l[i][2] != c_l[i][0] + b3mb1:
        print('No')
        exit()

print('Yes')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define FOR(i, n) for(int i = 0; i < (n); ++i)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define TRAV(i, a) for(auto & i : (a))
#define SZ(x) ((int)(x).size())
#define PR std::pair
#define MP std::make_pair
#define X first
#define Y second
typedef long long ll;
typedef std::pair<int, int> PII;
typedef std::vector<int> VI;

const int INF = 1000000666;
int dist[205][205];

std::vector<VI> g;
int bad = 0;
VI col;
void dfs(int v){
	TRAV(ch, g[v]){
		if(col[ch] == -1){
			col[ch] = 1-col[v];
			dfs(ch);
		}else{
			if(col[ch] == col[v]) bad = 1;
		}
	}
}

int main(){
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(0);
	int n;
	std::cin >> n;
	g.resize(n);
	col.resize(n, -1);
	FOR(i, n){
		FOR(j, n){
			char a;
			std::cin >> a;
			if(a == '0') dist[i][j] = INF;
			else dist[i][j] = 1, g[i].push_back(j);
		}
	}
	FOR(i, n) dist[i][i] = 0;
	FOR(k, n){
		FOR(i, n){
			FOR(j, n){
				dist[i][j] = std::min(dist[i][j], dist[i][k]+dist[k][j]);
			}
		}
	}
	int mx = 0;
	FOR(i, n){
		FOR(j, n){
			mx = std::max(mx, dist[i][j]);
		}
	}
	col[0] = 0;
	dfs(0);
	if(bad) std::cout << -1;
	else std::cout << mx+1;

	return 0;
}

Measured memory_bytes: 640
# ABC073D - joisino's travel
from itertools import permutations
from scipy.sparse.csgraph import floyd_warshall


def main():
    N, M, R, *RABC = map(int, open(0).read().split())
    visit, ABC = RABC[:R], RABC[R:]
    G = [[float("inf")] * (N + 1) for _ in range(N + 1)]
    for v, u, c in zip(*[iter(ABC)] * 3):
        G[v][u] = G[u][v] = c
    dist = floyd_warshall(G, directed=0)
    ans = float("inf")
    for perm in permutations(visit):
        cur = sum(dist[v][u] for v, u in zip(perm, perm[1:]))
        ans = min(ans, cur)
    print(int(ans))


if __name__ == "__main__":
    main()

Measured memory_bytes: 18880
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>
#include <queue>
#include <cctype>
#include <stack>
#include <random>
#include <list>
#include <numeric>
#include <chrono>
#include <set>


#define rep(i,p,q) for(ll i = p;i < q;i++)
#define ll long long

using namespace std;

vector<vector<ll>> graph;
vector<ll> query;
vector<ll> ans;
vector<ll> visited;


const long long MAX_N = 1 << 17;

long long dat[2 * MAX_N - 1];

ll ecd(ll a, ll b) {
	if (a < b) swap(a, b);
	if (b == 0) return a;
	else {
		return ecd(b, a % b);
	}
}

//143 C
int main(void) {
	ll n;
	cin >> n;
	string s;
	cin >> s;
	ll ans = 0;
	rep(i, 0, n) {
		if (i == n - 1 || s[i] != s[i + 1]) {
			ans++;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 512
import scala.io.StdIn._

/**
 * ABC107B
 */
object Main extends App {

  val Seq(h, w) = readLine().split(" ").toSeq.map(_.toInt)
  val blob: Seq[String] = (0 until h).map(_ => readLine()).toIndexedSeq

  val calcNewRow = (b: String) => {
    (0 until w)
      .filter(colIndex => blob.map(_(colIndex).toString).contains("#"))
      .map(b(_))
      .mkString
  }

  val ans = blob.filter(_.contains("#"))
    .map(calcNewRow(_))

  ans.foreach(println)
}


Measured memory_bytes: 50016
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
#include <functional>
using namespace std;

int main()
{
    int n = 1000;

    for(int i=0; i<n; ++i){
        string s;
        cin >> s;
        bool ok = true;
        for(unsigned j=0; j<s.size()-1; ++j){
            int y1 = (s[j] - 'A') / 3;
            int x1 = (s[j] - 'A') % 3;
            int y2 = (s[j+1] - 'A') / 3;
            int x2 = (s[j+1] - 'A') % 3;
            if(abs(y1 - y2) + abs(x1 - x2) != 1)
                ok = false;
        }
        if(ok)
            cout << s << endl;
    }

    return 0;
}

Measured memory_bytes: 1176
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            A();
        }

        static void A()
        {
            var N = ReadInt();
            var d = ReadSplitInt();
            var order = d.OrderBy(x => x).ToList();

            var index = N / 2;
            var left = index - 1;
            var right = index;
            var a = order[right] - order[left];
            Println(a);
        }

        static List<int> ReadLines(int n)
        {
            var l = new List<int>();
            for (int i = 0; i < n; i++)
            {
                l.Add(ReadInt());
            }
            return l;
        }

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int SumDigits(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static long Gcd(long a, long b) => b == 0 ? a : Gcd(b, a % b);
        static long Lcm(long a, long b) => a * b / Gcd(a, b);

        static bool IsPrime(int x)
        {
            if (x <= 1 || (x != 2 && x % 2 == 0)) return false;
            if (x == 2) return true;

            for (int i = 3; i < x; i += 2)
                if (x % i == 0) return false;

            return true;
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static List<string> ReadSplit() => Read().Split().ToList();
        static List<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
        static List<long> ReadSplitLong() => Read().Split().Select(long.Parse).ToList();

        static void Print(object value) => Console.Write(value.ToString());
        static void Println(object value) => Console.WriteLine(value.ToString());

        static string Join<T>(IEnumerable<T> list) => string.Join("", list);
    }

    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }
}


Measured memory_bytes: 22112
#include <stdio.h>
 
int main(void){
	int x, sum = 0;
 long long n;
	scanf("%lld", &n);
	x = n;
 
while(n >= 1){
sum = sum + n % 10;
n = n / 10;
 
}
 
if( x % sum == 0) printf("Yes");
else printf("No");
 
return 0;
}


Measured memory_bytes: 128
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

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

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


fn solve(a: usize, b: usize, x: usize) -> usize {
    if a % x == 0 {
        b / x - a / x  + 1
    } else {
        b / x - a / x
    }
}


fn main() {
    input!{
        a: usize,
        b: usize,
        x: usize,
    }

    println!("{}", solve(a, b, x));
}




Measured memory_bytes: 4352
H,W = map(int,input().split())
s = [list(input()) for _ in range(H)]
dp = [[10000]*W for _ in range(H)]
if s[0][0]=='#':
  dp[0][0]=1
else:
  dp[0][0]=0

for i in range(H):
  for j in range(W):
    if (i==0)and(j==0):
      continue
    if i!=0:
      if (s[i-1][j]=='.')and(s[i][j]=='#'):
        dp[i][j]=min(dp[i-1][j]+1,dp[i][j])
      else:
        dp[i][j]=min(dp[i-1][j],dp[i][j])
    
    if j!=0:
      if (s[i][j-1]=='.')and(s[i][j]=='#'):
        dp[i][j]=min(dp[i][j-1]+1,dp[i][j])
      else:
        dp[i][j]=min(dp[i][j-1],dp[i][j])
        
print(dp[-1][-1])

Measured memory_bytes: 3188
#include<algorithm>/*{{{*/
#include<cctype>
#include<cassert>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<ctime>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<vector>
using namespace std;
typedef long long lld;
typedef long double lf;
typedef unsigned long long uld;
typedef pair<int,int> pii;
#define fi first
#define se second
#define pb push_back
#define mk make_pair
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define ROF(i,a,b) for(int i=(a);i>=(b);--i)
namespace RA{
    int r(int p){return 1ll*rand()*rand()%p;}
    int r(int L,int R){return r(R-L+1)+L;}
}/*}}}*/
/******************heading******************/
const int N=2e5+5;

int n;
vector<int> g[N];
map<int,int> q[N];

int Q(int u,int x,int p){
    if(q[u].count(x))return q[u][x];
    int res=0;
    for(int v:g[u])if(v!=p){
        if(v<=x)res+=Q(v,x,u)+1;
    }
    q[u][x]=res;
    return res;
}
int ans[N],m[N];
void dfs(int u,int p){
    if(u>m[p]){
        ans[u]=ans[p]+Q(u,m[u],p)+1;
    }else {
        ans[u]=ans[p]+Q(u,m[u],p)-Q(u,m[p],p);
    }
    for(int v:g[u])if(v!=p){
        m[v]=max(m[u],u);
        dfs(v,u);
    }
}

int main(){
    scanf("%d",&n);
    FOR(i,1,n-1){
        int a,b;
        scanf("%d%d",&a,&b);
        g[a].pb(b),g[b].pb(a);
    }
    dfs(1,0);
    FOR(i,2,n)printf("%d%c",ans[i]-1," \n"[i==n]);
    return 0;
}


Measured memory_bytes: 54784
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int A = scan.nextInt();
		int B = scan.nextInt();
		int m = scan.nextInt();
		int min = Integer.MAX_VALUE;
		int[] a = new int[A];
		int ans = 0;
		for(int i = 0;i < A; ++i){
			a[i] = scan.nextInt();
			min = Math.min(a[i],min);
		}
		ans += min;
		min = Integer.MAX_VALUE;
		int[] b = new int[B];
		for(int i = 0;i  < B; ++i){
			b[i] = scan.nextInt();
			min = Math.min(b[i],min);
		}
		ans += min;
		for(int i = 0;i < m; ++i){
			int x = scan.nextInt();
			int y = scan.nextInt();
			int c = scan.nextInt();
			ans = Math.min(ans, a[x-1]+b[y-1]-c);
		}
		System.out.print(ans);

	}
}


Measured memory_bytes: 61936
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll; typedef long double ld;
const int INF32 = 1e9+10;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N; cin >> N;
  int A[100010], B[100010];
  pair<int, int> D[100010];
  for (int i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
    D[i].first = A[i] + B[i];
    D[i].second = i;
  }
  ll tak = 0, aok = 0;
  sort(D, D+N);
  for (int i = 0; i < N; i++) {
    if (i % 2 == 0) {
      tak += A[D[N-1-i].second];
    } else {
      aok += B[D[N-1-i].second];
    }
  }
  cout << tak - aok << endl;
}


Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
using namespace std;
int main() {
	vector<int> a(3);
	int sya, el,ei=0,tyo=0,don=0;
	while (1) {
		for (int i = 0; i < 3; ++i) {
			cin >> a[i];
		}
		sort(a.begin(), a.end());
		el = pow(a[0], 2) + pow(a[1], 2);
		sya = pow(a[2], 2);
		if (a[0] + a[1] <= a[2])break;
		else if (sya == el)tyo++;
		else if (sya < el)ei++;
		else if (sya > el)don++;
	}
	cout << tyo + ei + don << " " << tyo << " " << ei << " " << don << endl;

	return 0;
}


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

int main(void) {
  int i;
  char s[100010], be, be2;
  scanf("%s", s);
  be2 = s[0], be = s[1];
  if(be == be2) {
    printf("1 2");
    return 0;
  }
  for(i = 2; i < strlen(s); ++i) {
    if(be == s[i] || be2 == s[i]) {
      printf("%d %d", i - 1, i + 1);
      return 0;
    }
    be2 = be, be = s[i];
  }
  printf("-1 -1");
  return 0;
}

Measured memory_bytes: 256
import collections

N = int(input())
S = list(input() for _ in range(N))

c = collections.Counter(S)
cnt = c.most_common()
num = cnt[0][1]

ans = []
for i in range(len(cnt)):
    if num == cnt[i][1]:
        ans.append(cnt[i][0])

ans.sort()
for a in ans:
    print(a)

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

int main() {
  int n, k, x, sum;
  cin >> n >> k;
  sum = 0;
  for(int i=0; i<n; i++){
    cin >> x;
    if(x <= k/2){
      sum += 2*x;
    }
    if(k/2 < x && x < k){
      sum += 2*(k-x);
    }
    if(k <= x){
      sum += 2*(x-k);
    }
  }
  cout << sum;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	cin>>a>>b;
	int p=b;
	int sum=1;
	while(p>0)
	{
		sum*=10;
		p/=10;
	}
	int c=a*sum+b;
	bool f=false;
	for(int i=1;i<=sqrt(c)+10;i++)
		if(i*i==c)
		{
			f=true;
			break;
		}
	if(f)
		cout<<"Yes";
	else
		cout<<"No";
	return 0;
}

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

using namespace std;

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

    int out = min(n*a, b);

    cout << out << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

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

	int n, x;
	cin >> n;
	x = sqrt(n);
	cout << x * x << "\n";

	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;

const int INF = 1001001001;

int main(void){
  int n, m;
  cin >> n >> m;
  vector<int> to[n];
  REP(i, m){
    int a, b;
    cin >> a >> b;
    a--; b--;
    to[a].emplace_back(b);
    to[b].emplace_back(a);
  }
  REP(i, n) cout << to[i].size() << endl;
  return 0;
}

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

ll n;
vector<ll> a, f;

bool solve(ll x, ll k) {
    ll cnt = 0;
    for (int i = 0; i < n; i++) {
        cnt += max(0ll,a[i] - x / f[i]);
    }
    return (cnt <= k);
}

ll binary_search(ll ok, ll ng, ll key) {
    while (abs(ok - ng) > 1) {
        ll mid = (ok + ng) / 2;
        if (solve(mid, key)) {
            ok = mid;
        } else {
            ng = mid;
        }
    }
    return ok;
}

int main() {
    ll k;
    cin >> n >> k;
    for (int i = 0; i < n; i++) {
        ll A;
        cin >> A;
        a.push_back(A);
    }
    for (int i = 0; i < n; i++) {
        ll F;
        cin >> F;
        f.push_back(F);
    }
    sort(a.begin(), a.end());
    sort(f.begin(), f.end(), greater<ll>());

    cout << binary_search(1e12+1, -1, k) << endl;
    return 0;
}

Measured memory_bytes: 6384
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(a) (a).begin(), (a).end()
#define AALL(a, n) (a), a + n
#define FILL(a, n) memset((a), n, sizeof(a))
#define FILLZ(a) FILL(a, 0)

using namespace std;

typedef long long ll;

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

inline int toInt(string s) {
	int v;
	istringstream sin(s);
	sin >> v;
	return v;
}

int main() {
	int n, k;
	scanf("%d %d", &n, &k);
	vector<int> h(n);
	for(auto&& e : h) {
		scanf("%d", &e);
	}
	int result = 0;
	for(auto&& e : h) {
		result += e >= k ? 1 : 0;
	}
	printf("%d\n", result);
	return 0;
}

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

using namespace std;


int main() {
  
    int n;
    scanf("%d",&n);
    int a[n],i,flag=0;
    for(i=0;i<n;++i)
       {
           scanf("%d",&a[i]);
           if(a[i]%2==0)
            {
                if(a[i]%5!=0 && a[i]%3!=0)
                    flag=1;
            }
       }
       
      if(flag==0)
          printf("APPROVED");
          
       else
          printf("DENIED");
	return 0;
}

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

int main() {
    constexpr int inf = 1e9;

    int n;
    cin >> n;
    vector<int> p(n);
    for(int i = 0; i < n; ++i) {
        cin >> p[i];
    }
    int ans = inf;
    for(int l = 0; l <= p[0]; ++l) {
        for(int r = 0; r <= p[n - 1]; ++r) {
            int tans = l + r;
            auto tp = p;
            tp[0] -= l;
            tp[n - 1] -= r;
            for(int i = 0; i < n; ++i) {
                int x = max(tp[i], 0);
                tans += x * 2;
                tp[i] -= x;
                if(i + 1 < n) tp[i + 1] -= x;
            }
            ans = min(ans, tans);
        }
    }
    cout << ans << endl;
}



Measured memory_bytes: 3180
#include <bits/stdc++.h>
#include <unordered_set>
#include <random>
using namespace std;
#define ll long long
#define fr first
#define sc second
#define pll pair<ll, ll>
#define all(v) v.begin(), v.end()

const int MOD = 1e9 + 7;
ll modpow(ll a, ll b) {
	if (b == 0) return 1;
	if (b & 1) return modpow(a, b - 1) * a % MOD;
	ll half = modpow(a, b / 2) % MOD;
	return (half * half) % MOD;
}

ll fact[2200000];
ll nCk(ll N, ll K) {
	ll A = fact[N], B = fact[N-K] * fact[K] % MOD; //A = n!, B = k!(n-k)!
	ll invB = modpow(B, MOD - 2); // B2 = B^(MOD-2)
	ll ans = A * invB;
	ans %= MOD;
	return ans;
}

ll sqrt25[1100000];
ll sqrt26[1100000];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int K; string S;
	cin >> K >> S;
	fact[0] = sqrt25[0] = sqrt26[0] = 1;
	for (int i = 1; i <= 1e6; i++) sqrt25[i] = sqrt25[i - 1] * 25 % MOD;
	for (int i = 1; i <= 1e6; i++) sqrt26[i] = sqrt26[i - 1] * 26 % MOD;
	for (int i = 1; i <= 2e6; i++) fact[i] = fact[i - 1] * i % MOD;

	ll ans = 0;
	for (int i = 0; i <= K; i++) {
		// int comb1 = 25 ^ (K - i) * 26 ^ (i);
		ll comb1 = sqrt25[K - i] * sqrt26[i] % MOD;
		// int comb2 = N+K-i C K-i
		ll comb2 = nCk(S.size() + K - i - 1, S.size() - 1);
		ans = (ans + comb1 * comb2 % MOD) % MOD;
	}
	cout << ans << '\n';
	return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;
struct edge { int u, v; ll w; };
 
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  if (A == B) cout << C << endl;
  if (A == C) cout << B << endl;
  if (C == B) cout << A << endl;
}


Measured memory_bytes: 632
function Main(input) {
  input = input.trim();
  input = input.split("\n");
  var sum=0;
  arr = input[1].split(" ").map(Number);
  for(var i=0;i<input[0];i++){
    sum+=arr[i]-1;
  }
  console.log(sum);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

using namespace std;

#define _CRT_SECURE_NO_WARNINGS
#define REP(i, n) for(LL i=0; i<(n); i++)
#define FOR(i, m, n) for(LL i=(m);i<(n);i++)
#define SZ(x) ((int)(x).size())
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define MP make_pair
#define PB push_back
#define INF INT_MAX

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

int main() {
	string x;
	cin >> x;

	stack<char> s;

	REP(i, SZ(x)) {
		if (x[i] == 'S')s.push('S');
		else if (x[i] == 'T' && (s.empty() || s.top() == 'T'))s.push('T');
		else if (x[i] == 'T'&&s.top() == 'S')s.pop();
	}
	cout << SZ(s) << endl;
}

Measured memory_bytes: 644
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mp(a,b) make_pair(a,b)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
const int MOD=1000000007;
//a^n modをO(logN)で計算
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//a/bをmodで割った余り、フェルマーの小定理
int64_t div(int64_t a,int64_t b,int64_t mod){
    return (a%mod)*(modpow(b,mod-2,mod)%mod)%mod;
}
// a-bをMODで割ったあまり、負にならない工夫
long long sub(long long a,long long b){
    long long ans = ((a%MOD)-(b%MOD))%MOD;
    if(ans>=0){
        return ans;
    }
    else{
        return ans+MOD;
    }
}
//コンビネーションを10^9+7で割った余りを求める
const int MAX = 1000000;
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(){
    int s;
    cin>>s;
    int n = s/3;
    int64_t ans=0;
    COMinit();
    for(int i=1;i<=n;i++){//iは数列のサイズ
        int num = s-3*i;
        ans += COM(num+i-1,num);
        ans %= MOD;
    }
    cout<<ans%MOD<<endl;
}

Measured memory_bytes: 27068
package main

import (
    "fmt"
)

func main() {
    var a, b int 
    fmt.Scan(&a, &b) 
    if a == b { 
        fmt.Println("Draw")
    } else if a == 1 || (b != 1 && a > b) {
        fmt.Println("Alice")
    } else {
        fmt.Println("Bob")
    }   
}


Measured memory_bytes: 512
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
//const long long MOD = 1000000007;
//const long long MOD = 998244353;
long long MOD;
using namespace std;


int main(int argc, char* argv[])
{
    int n; ll K;
    scanf("%d%lld", &n, &K);

    vector<int> a(n),f(n);
    int i;
    for(i=0; i<n; i++) {
        scanf("%d", &a[i]);
    }
    sort(a.rbegin(), a.rend());

    for(i=0; i<n; i++) {
        scanf("%d", &f[i]);
    }
    sort(f.begin(), f.end());

    ll l=-1, r=1000000000000;
    while(r-l>1) {
        ll m=(l+r)/2;

        ll cnt=0;
        for(i=0; i<n; i++) {
            ll tmp0=a[i], tmp1=f[i];
            if(tmp0*tmp1>m) {
                ll tmp=m/tmp1;
                cnt += tmp0-tmp;
            }
        }
        if(cnt>K) {
            l=m;
        }
        else {
            r=m;
        }
    }
    printf("%lld\n", r);

    return 0;
}


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

using namespace std;

int main(){

    int X, Y, Z;
    int K;

    cin >> X >> Y >> Z >> K;

    vector<long> A(X);
    vector<long> B(Y);
    vector<long> C(Z);

    for(int i = 0; i < X; i++){
	cin >> A.at(i);
    }
    for(int i = 0; i < Y; i++){
	cin >> B.at(i);
    }
    for(int i = 0; i < Z; i++){
	cin >> C.at(i);
    }

    sort(A.begin(), A.end()); reverse(A.begin(), A.end());
    sort(B.begin(), B.end()); reverse(B.begin(), B.end());
    sort(C.begin(), C.end()); reverse(C.begin(), C.end());

    vector<long> BC;
    
    for(long b: B){
	for(long c: C){
	    BC.push_back(b + c);
	}
    }
    sort(BC.begin(), BC.end()); reverse(BC.begin(), BC.end());

    vector<long> ABC;
    for(int i = 0; i < min(K, (int)BC.size()); i++){
	for(int j = 0; j < min(K, (int)A.size()); j++){
	    ABC.push_back(A.at(j) + BC.at(i));
	}
    }
    sort(ABC.begin(), ABC.end()); reverse(ABC.begin(), ABC.end());

    for(int i = 0; i < K; i++){
	cout << ABC.at(i) << endl;
    }
    
    
}


Measured memory_bytes: 43112
#include <iostream>
using namespace std;
int main(void){
    int a,b;
    char op;
    while(true){
      
    cin >> a >> op >>b;
    if (op == '+'){
        cout << (a+b) << endl;
    }
    else if (op == '-'){
        cout << (a-b) << endl;
    }
    else if (op == '*'){
        cout << (a*b) << endl;
    }
    else if (op == '/'){
        cout << (a/b) << endl;
    }
    else if (op == '?'){
        break;
    }
    }
}


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

int main(){
    int n,m,s,t;
    cin >> n >> m >> s >> t;
    vector<pair<int,long long>> y[n+1],z[n+1];
    for(int i=0; i<m; i++){
        int u,v;
        long long a,b;
        cin >> u >> v >> a >> b;
        y[u].push_back(make_pair(v,a));
        y[v].push_back(make_pair(u,a));
        z[u].push_back(make_pair(v,b));
        z[v].push_back(make_pair(u,b));
    }
    long long d[2][n+1];
    for(int i=0; i<2; i++){
        for(int j=0; j<n+1; j++){
            d[i][j] = 1000000000000000;
        }
    }
    d[0][s] = 0;
    priority_queue<pair<long long,int>,vector<pair<long long,int>>,greater<pair<long long,int>>> que;
    que.push(make_pair(0,s));
    while(!que.empty()){
        pair<long long,int> p = que.top(); que.pop();
        int u = p.second;
        if(d[0][u] < p.first) continue;
        for(int i=0; i<y[u].size(); i++){
            pair<int,long long> e = y[u][i];
            if(d[0][e.first] > d[0][u]+e.second){
                d[0][e.first] = d[0][u]+e.second;
                que.push(make_pair(d[0][e.first],e.first));
            }
        }
    }
    d[1][t] = 0;
    que.push(make_pair(0,t));
    while(!que.empty()){
        pair<long long,int> p = que.top(); que.pop();
        int u = p.second;
        if(d[1][u] < p.first) continue;
        for(int i=0; i<z[u].size(); i++){
            pair<int,long long> e = z[u][i];
            if(d[1][e.first] > d[1][u]+e.second){
                d[1][e.first] = d[1][u]+e.second;
                que.push(make_pair(d[1][e.first],e.first));
            }
        }
    }
    long long ans[n];
    ans[n-1] = d[0][n] + d[1][n];
    for(int i=n-2; i>=0; i--){
        ans[i] = min(ans[i+1],d[0][i+1]+d[1][i+1]);
    }
    for(int i=0; i<n; i++){
        cout << 1000000000000000 - ans[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 19576