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

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

#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())

#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).begin(),(c).end(),greater<int>())

#define PB(a) push_back(a)

#define ALL(x) (x).begin(),(x).end()
#define MAX_EL(c) *max_element((c).begin(),(c).end())
#define MIN_EL(c) *min_element((c).begin(),(c).end())
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef string str;
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int n,q;
vector <char> t,d;
str s;

int bisec(int pos){
  REP(i,q){
    if(t[i]==s[pos]) (pos += d[i]=='L'?-1:1); 
  }
  if(pos==0) return -1;
  if(pos==n+1) return 1;
  return 0;
}

int main(){
// magic spell------------------------------
  cin.tie(0);
  ios::sync_with_stdio(false);
//------------------------------------------
  cin >> n >> q;
  cin >> s;
  s = "0"+s+"0";
  REP(i,q){
     char x,y;
     cin >> x >> y;
     t.PB(x);
     d.PB(y);
  }
  int l=0,r=n+1;
  while(r-l!=1){
    int c=(l+r)/2;
    if(bisec(c)==-1) l=c;
    else r=c;
  }
  int ansl=r;
  l=0;
  r=n+1;
  while(r-l!=1){
    int c=(l+r)/2;
    if(bisec(c)==1) r=c;
    else l=c;
  }
  int ansr=l;
  cout << ansr-ansl+1 << endl;
  return 0;
}


Measured memory_bytes: 1232
import sys
from itertools import combinations_with_replacement, product
import numpy as np
def input(): return sys.stdin.readline().rstrip()

def main():
    n, m, x = map(int, input().split())
    data = np.zeros((n,m),int)
    clist = np.zeros(n, int)
    ans=10**10
    for i in range(n):
        ca = list(map(int, input().split()))
        clist[i]=ca[0]
        data[i]=np.array(ca[1:])
    for bit in list(product([0,1],repeat=n)):
        if all(np.dot(np.array(bit), data)>=x):
            ans=min(ans,np.dot(np.array(bit),clist.T))
    
    if ans==10**10:
        print(-1)
    else:
        print(ans)


if __name__ == '__main__':
    main()

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

int main(){
    string s;
    cin >> s;
    string rs(s);
    reverse(rs.begin(), rs.end());
    bool flag = false;
    rep(i, 0, s.size()){
        if(s[i] != rs[s.size()-1-i]){
            flag = true;
        }
    }
    rep(i, 0, (s.size()-1)/2){
        if(s[i] != rs[(s.size()-1)/2-1-i]){
            flag = true;
        }
    }
    rep(i, (s.size()+3)/2, s.size()){
        if(s[i] != rs[(s.size()-1)-i]){
            flag = true;
        }
    }
    if(flag){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

mt19937 mrand(random_device{} ()); 

int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int maxn = (int) 1e5 + 5;
int n, m;
int deg[maxn];

int read() {
  if (scanf("%d%d", &n, &m) < 2) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    deg[i] = 0;
  }
  for (int i = 0; i < m; i++) {
    int v, u;
    scanf("%d%d", &v, &u);
    v--;
    u--;
    deg[v] ^= 1;
    deg[u] ^= 1;
  }
  return true;
}

void solve() {
  for (int i = 0; i < n; i++) {
    if (deg[i]) {
      printf("NO\n");
      return;
    }
  }
  printf("YES\n");
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 640
import std.stdio;
import std.algorithm;

int[8][8] cost;
int[8][8] d;

void main(){
	int a, b, h1, m1, h2, m2, s1, s2, ans;
	cost[1][2..8] = [300, 500, 600, 700, 1350, 1650];
	cost[2][3..8] = [350, 450, 600, 1150, 1500];
	cost[3][4..8] = [250, 400, 1000, 1350];
	cost[4][5..8] = [250, 850, 1300];
	cost[5][6..8] = [600, 1150];
	cost[6][7..8] = [500];
	d[2][1..2] = [6];
	d[3][1..3] = [13, 7];
	d[4][1..4] = [18, 12, 5];
	d[5][1..5] = [23, 17, 10, 5];
	d[6][1..6] = [43, 37, 30, 25, 20];
	d[7][1..7] = [58, 52, 45, 40, 35, 15];
	while (readf("%d\n", &a), a) {
		readf("%d %d\n", &h1, &m1);
		readf("%d\n", &b);
		readf("%d %d\n", &h2, &m2);
		s1 = h1*60+m1;
		s2 = h2*60+m2;
		ans = cost[a][b];
		if (d[b][a] <= 40 && ((s1 >= 17*60+30 && s1 <= 19*60+30) || (s2 >= 17*60+30 && s2 <= 19*60+30))) {
			ans /= 2;
			if (ans%50 != 0) ans = ans/50*50+50;
		}
		writeln(ans);
	}
}

Measured memory_bytes: 984
#include <bits/stdc++.h>
#define ll long long int
#define fr(i, a, b) for (ll i = a; i < b; i++)
#define pb(v, a) v.push_back(a)
#define Sort(v) sort(v.begin(), v.end())
#define For(m) for (auto it = m.begin(); it != m.end(); it++)
#define mod 1000000007
#define PI 3.14159265358979323846
using namespace std;

int main()
{
    ll n,k;
    cin >> n >> k;
    if(n>=(2*k-1))
    {
        cout << "YES";
    }
    else
    cout << "NO";
 
  return 0;
}


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

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

	// freopen("input.txt","r",stdin);
	
	long long n,m;
	cin >> n >> m;

	long long array[n];
	vector<long long> v;
	long long sum = 0;
	long long count = 0;
	for (int i = 0; i < n; ++i)
	{
		cin >> array[i];
		sum += array[i];
		sum %= m;
		if (sum == 0) count++;
		v.push_back(sum);
	}

	long long pairs = 0;
	sort(v.begin(), v.end());

	for (int i = 0; i < v.size(); ++i)
	{
		long long freq = 0;
		i = lower_bound(v.begin(), v.end(), v[i]) - v.begin();
		int temp = upper_bound(v.begin(), v.end(), v[i]) - v.begin();
		freq = temp - i;
		i = upper_bound(v.begin(), v.end(), v[i]) - v.begin();
		i--;
		if (freq > 1)
		{
			pairs += (freq*(freq - 1))/2;
		}
	}
	pairs += count;

	cout << pairs << endl;


	return 0;
}


Measured memory_bytes: 1912
import sys
input = sys.stdin.readline

def main():
    MOD = 1000000007
    n, k = map(int, input().split())

    n_li = list(range(n+1))

    ans = 0

    while(k <= n+1):
        p = (k - 1) * k / 2
        q = ((n + n - k + 1) * k) / 2

        ans += q - p + 1
        ans %= MOD
        k += 1

    print(int(ans))

if __name__ == '__main__':
    main()


Measured memory_bytes: 16796
#include <iostream>
using namespace std;
int main()
{
    string S;
    cin >> S;
    if (S[0] != S[1] || S[0] != S[2] || S[1] != S[2])
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

ans = 0
for i in range(n):
    if A[i] >= B[i]:
        ans += B[i]
        A[i] -= B[i]
    else:
        ans += A[i]
        B[i] -= A[i]
        ans += min(A[i+1], B[i])
        A[i+1] = max(0, A[i+1]-B[i])

print(ans)


Measured memory_bytes: 18468
N=int(input())
A=list(map(int,input().split()))
ex=[0]*1000001
for a in A:ex[a]+=1
cnt=0
for i in range(1,1000001):
    if ex[i]>0:
        for j in range(i+i,1000001,i):ex[j]=0
        if ex[i]==1:
            cnt+=1
print(cnt)


Measured memory_bytes: 32372
#include<iostream>
#include<string>
#include<vector>
#include<map>
using namespace std;
#define ll long long
int main(){
  ll N;
  cin >> N;
  int i;
  ll S=0;
  ll tmp =N;
  for(i=0;i<10;i++){
    S+=tmp%10;
    tmp=tmp/10;
  }
  if (N%S==0){
    cout << "Yes";
  }else{
    cout << "No";
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#define ll long long
#define BUF 1e5
#define INF 1<<30
#define EPS 1e-5
#define all(a) (a).begin(),(a).end()
constexpr ll mod = 1e9 + 7;
using namespace std;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;

int main() {
	cin >> X >> Y >> Z;
	swap(X, Y);
	swap(X, Z);
	cout << X << " " << Y << " " << Z << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define i(a,n) int a=n;
#define l(a,n) ll a=n;
#define d(a,n) double a=n;
#define s(a) string a;
#define c(a) ll a; cin>>a;a
#define cd(a) double a; cin>>a;
#define cs(a) string a; cin>>a;
#define ci(a) cin>>a;
#define co(a) cout<<a;
#define cos(a) cout<<a<<" ";
#define con(a) cout<<a<<endl;
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define nl cout<<endl;
#define ca(arr,n) for(ll i=0;i<n;i++) cin>>arr[i];
#define f0(i,a,n) for(ll i=a;i>=n;i--)
#define f(i,n) for(ll i=0;i<n;i++)
#define f1(i,a,n) for(ll i=a;i<n;i++)
#define T ll t=1; cin>>t; while(t--)
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;

int main()
{
    fast;
    ll n,k,count=0;
    cin>>n>>k;
    ll a,b;
    f(i,n)
    {
        cin>>a>>b;
        double temp=sqrt((a*a)+(b*b));
      	//cout<<temp<<endl;
        if(temp<=k) count++;
    }
    con(count);

    return 0;
}

/*It's not who I am underneath, but what I do that defines me

MMMMMMMMMMMMMMMMMMMMM.                             MMMMMMMMMMMMMMMMMMMMM
 `MMMMMMMMMMMMMMMMMMMM           M\  /M           MMMMMMMMMMMMMMMMMMMM'
   `MMMMMMMMMMMMMMMMMMM          MMMMMM          MMMMMMMMMMMMMMMMMMM'
     MMMMMMMMMMMMMMMMMMM-_______MMMMMMMM_______-MMMMMMMMMMMMMMMMMMM
      MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
      MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
      MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
     .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM.
    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
                   `MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM'
                          `MMMMMMMMMMMMMMMMMM'
                              `MMMMMMMMMM'
                                 MMMMMM 
                                  MMMM
                                   MM
*/


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

int main(){
int N,p,w,g,y,c;
p = 0;
w = 0;
g = 0;
y = 0;

string color;

cin >> N;

for(int i = N;i>0;i--){
	cin >> color;
	if(color == "P"){
		p=1;
		}
	else if(color == "W"){
		w=1;
		}
	else if(color == "G"){
		g = 1;
		}
	else{
		y = 1;
		}
	}

c =p+w+g+y;

if(c>3){
	cout << "Four" <<endl;
	}
else{
	cout << "Three" <<endl;
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7;
const ll LINF=1e18;
using namespace std;
#define int long long
//template
//main
signed main(){
  string A;cin>>A;
  std::vector<int> anki;
  set<char> s;
  for(int i=A.size()-1;i>=0;i--){
    s.insert(A[i]);
    if(s.size()==26){
      anki.push_back(i);
      s.clear();
    }
  }
  reverse(anki.begin(),anki.end());
  string ans;char ch;
  //if(anki.size()&&anki[0]==0)ans="a";
  int i=-1;
  for(int p:anki){
    //cout<<p<<endl;
    s.clear();
    for(i++;i<p;i++)s.insert(A[i]);
    for(ch='a';ch<='z';ch++){
      if(s.count(ch)==0){
        ans.push_back(ch);
        break;
      }
    }
    while(A[i]!=ch)i++;
  }
  s.clear();
  for(i++;i<A.size();i++)s.insert(A[i]);
  for(ch='a';ch<='z';ch++){
    if(s.count(ch)==0){
      ans.push_back(ch);
      break;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 640
def check(nums):
    for i in range(9):
        if(nums[i]>4):return False

    for head in range(9):
        anums=nums[:]
        if(anums[head]<2):continue
        anums[head]-=2

        for i in range(9):
            if(anums[i]>=3):
                anums[i]-=3
            while(anums[i]>0):
                if i>=7:break
                ok=True
                for j in range(i,i+3):
                    if anums[j]<=0:
                        ok=True
                if not ok:
                    break
                for j in range(i,i+3):
                    anums[j]-=1
        if not any(anums):
            return True
    return False


while True:
    st=""
    try:
        st=input()
        if st=="":break
    except:break
    nums=[0 for i in range(9)]
    for c in st:
        nums[int(c)-1]+=1

    anss=[]
    for n in range(0,9):
        nums[n]+=1
        if(check(nums[:])):anss.append(n+1)
        nums[n]-=1

    if(len(anss)==0):anss.append(0)
    
    print(" ".join(map(str,anss)))



Measured memory_bytes: 5604
#include <stdio.h>
#define MAX 1000000
int isPrime[MAX];
int main(){
int num;
int i, j;
int count;
// 配列の初期化
isPrime[0] = isPrime[1] = 0;
for(i = 2; i < MAX; i++){
isPrime[i] = 1;
}
// エラストテネスのふるい
for(i = 2; i * i < MAX; i++){
if(isPrime[i]){
// iの倍数は素数じゃないのでフラグ変更
for(j = 2 * i; j < MAX; j+=i){
isPrime[j] = 0;
}
}
}
while(scanf("%d", &num) != EOF){
count = 0;
while(num){
count += isPrime[num--];
}
printf("%d\n", count);
}
return 0;
}

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

int main()
{
    string s;
    cin >> s;
    string t;
    int ans = 0;
    t = ".";
    bool flg;
    int p;
    for(int i = 0 ; i < s.length() - 1 ; i++){
        if(t.length() > 1){
            //cout << "1" << endl; 
            t = s[i];
            flg = true;
        }else if(t[0] == s[i]){
            t = s.substr(i , 2);
            i += 1;
            flg = false;
            //cout << "2" << endl; 
        }else{
            t = s[i];
            flg = true;
            //cout << "3" << endl; 
        }
        ans += 1;
        p = i;
    }
    if(flg){
        if(t[0] == s[s.length() - 1] && t.length() == 1){
        }else{
        ans += 1;
        }
    }else{
        if(p != s.length() - 1){
            ans += 1;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <string.h>
#define rep(i, n) for(int i = 0; i<(n); i++)
using namespace std;
typedef long long ll;
static const int MAX = 200000; 
//pi = 3.14159265358979323846

int main() {

    int n;
    cin >> n;
    int count = 0;
    for(int i = 1; i <= n; i++){
        if(1 <= i && i < 10)count++;
        if(100 <= i && i < 1000)count++;
        if(10000 <= i && i < 100000)count++;
    }
    cout << count << endl;

}




Measured memory_bytes: 256
#include <iostream>
#include <vector>
typedef long long ll;
using namespace std;

int main(void) {
    string A, B;
    cin >> A >> B;
    
    int i = 0;
    int flag = 0;
    
    if (A.length() > B.length()){
        cout << "GREATER" << endl;
        return 0;
    }
    else if(A.length() < B.length()){
        cout << "LESS" << endl;
        return 0;
    }
        
    while (flag && (A[i] == B [i])) {
        cout << A[i];
        i++;
    }
    
    if (A[i] > B[i])
        cout << "GREATER" << endl;
    else if(A[i] < B[i])
        cout << "LESS" << endl;
    else
        cout << "EQUAL" << endl;
    
    return 0;
}

Measured memory_bytes: 3560
#include <iostream>
#include <ios>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <utility>
#include <typeinfo>
#include <tuple>
using namespace std;

#define MOD 1000000007
#define INF 1e9+7
#define INF_LONG 1e18
#define rep(i, n) for(int i=0; i<n; ++i)
#define rep1(i, n) for(int i=1; i<=n; ++i)
#define rrep(i, m, n) for(int i=m; i<n; ++i)
#define countof(array) (sizeof(array) / sizeof(array[0]))
typedef long long ll;

#define MAX_N 100000
#define MAX_M 100000
#define MAX_V 100
#define MAX_E 100
#define MAX_Q 100000

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

int ddx[] = {-1, 0, 1, 0, -1, 1, -1, 1};
int ddy[] = {0, -1, 0, 1, 1, 1, -1, -1};

string ab = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
string as = {"abcdefghijklmnopqrstuvwxyz"};

ll gcd(ll x, ll y) {
  if(y==0) return x;
  else return gcd(y, x%y);
}

ll lcm(ll x, ll y) {
  return (x*y)/gcd(x, y);
}

void yes() {
  cout << "Yes" << endl;
}

void no() {
  cout << "No" << endl;
}

void print_array(int array[], int len) {

  for(int i=0; i<len; ++i) {
    cout << array[i] << endl;
  }

}

ll absolute(ll x) {
  return (x<0)? (-1)*x : x;
}

//g++ AtCoder.cpp -o AtCoder
//AtCoder

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



int main() {

  int n, x;
  cin >> n >> x;
  int l[n];
  rep(i, n) cin >> l[i];

  int res = 0;
  int cnt = 1;
  rep(i, n) {
    res += l[i];
    if(res<=x) {
      ++cnt;
    }else {
      break;
    }
  }

  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int dx[]={1,0,0,-1,1,-1,-1,1};
const int dy[]={0,1,-1,0,1,1,-1,-1};
const int INF = 1<<30;
const double EPS = 1e-8;
#define PB push_back
#define mk make_pair
#define fr first
#define sc second
#define reps(i,j,k) for(int i = (j); i < (k); ++i)
#define rep(i,j) reps(i,0,j)
#define MOD 1000000007
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> Pii;
typedef pair<int,vi > P;
typedef long long ll;
bool number(string& ,int& );
bool rev(string& ,int& );
bool term(string& ,int& );
bool number(string &s,int& i){
    if(s[i++] == 'T'){
        return true;
    }
    else{
        return false;
    }
}

bool rev(string& s,int& i){
    if(isalpha(s[i]))return number(s,i);
    if(s[i] == '-'){
        while(s[i] == '-'){
            i++;
            return !rev(s,i);
        }
    }
    i++;
    bool ret = term(s,i);
    i++;
    return ret;
}
bool term(string& s ,int& i){
    bool val = rev(s,i);
    while(s[i] == '+' || s[i] == '*' || s[i] == '&'){
        char op = s[i];
        i++;
        bool val2 = rev(s,i);
        if(op == '+'){
            val |= val2;
        }
        else if(op == '*'){
            val &= val2;
        }
        else if(op == '&'){
            val = !(val & !val2);
        }
    }
    return val;
}
map < string , int > memo;
bool select(string a,string b,int depth){
    bool ans = true;
    if(memo[a+b])return (bool)(memo[a+b]-1);
    if(depth == 11){
        
        int idx = 0;
        bool p = term(a,idx);
        //cout << "*" << idx << " ";
        idx = 0;
        bool q = term(b,idx);
        //cout << "*" << idx << " ";
        /*if(false){
            cout << a << " " << b << " ";
            cout << p << " " << q  << "\n";
        }*/
        ans &= (p==q);
        memo[a+b] = 1+(int)ans;
        return ans;
    }
    string aT,aF;
    aT = "";
    aF = "";
    rep(i,a.size()){
        if(a[i] == depth+'a'){
            aT += "T";
            aF += "F";
        }
        else{
            aT += a[i];
            aF += a[i];
        }
    }
    string bT,bF;
    bT = "";
    bF = "";
    rep(i,b.size()){
        if(b[i] == depth+'a'){
            bT += "T";
            bF += "F";
        }
        else{
            bT += b[i];
            bF += b[i];
        }
    }
    ans &= select(aT,bT,depth+1);
    ans &= select(aF,bF,depth+1);
    memo[a+b] = 1+(int)ans;
    return ans;
}
int main(){
    string tmp;
    while(true){
        memo.clear();
        string a;
        string b;
        cin >> tmp;
        if(tmp == "#")break;
         
        int idx = 0;
        while(tmp[idx] != '='){
            if(tmp[idx] == '-' && tmp[idx+1] == '>'){
                a += "&";
                idx+=2;
                continue;
            }
            a += tmp[idx]; 
            idx++;
        }
        reps(i,idx+1,tmp.size()){
            if(tmp[i] == '-' && tmp[i+1] == '>'){
                b += "&";
                i++;
                continue;
            }
            b += tmp[i];
        }
        select(a,b,0) ? puts("YES") : puts("NO");
    }
    return 0;
}

Measured memory_bytes: 2552
#include <stdio.h>
main(void){
	int a,b,c,d,e,f;
	scanf("%d%d%d",&a,&b,&c);
	if(a > b){ 
	d=a;
	a=b;
	b=d;
	}
	if(b > c){
	e=b;
	b=c;
	c=e;
	}
	if(a > b){
	f=a;
	a=b;
	b=f;
	}
	printf("%d %d %d\n",a,b,c);  
  return 0;
}


Measured memory_bytes: 2104
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;++i)
#define REP(i,n) FOR(i,0,n)
#define F first
#define S second
typedef pair<int,int> pii;

int main(){
int n,t,min=1e9;
  cin>>n>>t;
  vector<pii> v(n);
  REP(i,n){
  cin>>v[i].F>>v[i].S;
    if(v[i].S<=t&&v[i].F<min){
    min=v[i].F;
    }
  }
  if(min==1e9)cout<<"TLE"<<endl;
  else cout<<min<<endl;
return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
		int S, h, m, s;
		scanf("%d", &S);
		h = S / 3600;
		m = (S % 3600) / 60;
		s = (S % 3600) % 60;
		printf("%d:%d:%d\n", h, m, s);
	return 0;
}


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

using namespace std;
typedef long long ll;

int main(){
  int n; cin >> n;
  ll x; cin >> x;
  ll s = 0;
  vector<ll> a;
  for(int i=0;i<n;i++) { ll t; cin >> t; a.push_back(t); s += t; }
  sort(a.begin(), a.end());
  if(x > s){
    cout << n-1 << "\n";
    return 0;
  }
  if(x == s){
    cout << n << "\n";
    return 0;
  }
  s = 0;
  for(int i=0;i<n;i++){
    s += a[i];
    if(s > x){
      cout << i << "\n";
      return 0;
    }
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<queue>
#define REP(i,a) for (int i = 0;i < (a);++i)
#define FOR(i,a,b) for (int i = (a);i < (b); ++i)
#define FORR(i,a,b) for (int i = (a);i >= (b); --i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SORT(list) sort(ALL((list)));
#define MOD 1000000007
using namespace std;
using ll = long long;
int main(){
    ll n;
    cin >> n;
    ll a[n];
    ll b[n];
    REP(i,n){
        cin>>a[i];
        b[i] = a[i]-i;
    }
    sort(b,b+n);
    ll answer = 0;
    ll median = b[n/2];
    REP(i,n){
        answer += abs(b[i]-(median));
    }
    
    cout << answer << endl;
    return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
    int N;
    cin >> N;
    vector<int> arr(N);
    for (int i = 0; i < N; i++) {
        cin >> arr[i];
    }
    vector<int> arr1;
    arr1 = arr;
    sort(arr.begin(), arr.end());

    int di = 0;
    for (int j = 0; j < N; j++) {
        if (arr1[j] != arr[j]) {
            di++;
        }
    }

    cout << ((di <= 2) ? "YES" : "NO") << endl;
    return 0;
}


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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define sf scanf
#define pf printf
#define pb push_back
#define mp make_pair
#define PI ( acos(-1.0) )
#define mod 1000000007LL
#define maxn 100005
#define IN freopen("C.in","r",stdin)
#define OUT freopen("output.txt","w",stdout)
#define FOR(i,a,b) for(i=a ; i<=b ; i++)
#define DBG pf("Hi\n")
#define INF 1000000000
#define i64 long long int
#define eps (1e-8)
#define xx first
#define yy second
#define ln 17
#define off 2

using namespace __gnu_pbds;
using namespace std ;

typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef pair<i64, i64> pii;

int main()
{
    int n , m , c ;

    cin>>n>>m ;

    int p =1 ;

    for(int i=1 ; i<=m; i++) p=p*2 ;

    cout<<p*( m*1900+(n-m)*100 )<<endl ;

    return 0 ;
}


Measured memory_bytes: 256
a=int(input())
b=int(input())
c=int(input())
x=int(input())
count=0
A=x//500
B=x//100
for i in range(min(a+1,A+1)):
    rest=x-500*i
    for j in range(min(b+1,B+1)):
        rest1=rest-100*j
        if rest1/50<=c and rest1>=0:
            count+=1
print(count)

Measured memory_bytes: 3064
//! ----------------------------------------------
//! Framework <https://github.com/vain0x/procon>
//!
//! See the bottom of file for solution.
//! ----------------------------------------------

#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Display, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

/// Print values to standard error if debug mode.
#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), stderr());
            writeln!(err, "\x1B[33m{}\x1B[0m = {:?}", e, $e).unwrap()
        })*
    };
}

/// Read from standard input and parse each word.
/// - `read!(T, U, ..)` parses a line as a tuple of words.
/// - `read![[T]]` parses a line as an array of words.
/// - `read![..; N]` parses `N` lines, using `read!(..)` repeatedly.
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

/// Read a line from standard input.
#[allow(dead_code)]
fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();

    #[allow(deprecated)]
    buf.trim_right().to_owned()
}

// -----------------------------------------------
// Solution
// -----------------------------------------------

fn main() {
    let c = read![[i32]; 3];

    let mut ok = true;

    for y in 0..2 {
        ok = ok && (0..2).all(|x| c[y + 1][x] - c[y][x] == c[y + 1][0] - c[y][0]);
    }

    for x in 0..2 {
        ok = ok && (0..3).all(|y| c[y][x + 1] - c[y][x] == c[0][x + 1] - c[0][x]);
    }

    println!("{}", if ok { "Yes" } else { "No" })
}


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

using namespace std;

struct expand_type {
    template <typename... T>
    expand_type (T&&...) {}
};
template <typename... ArgTypes>
void print (ArgTypes... args) {
    expand_type {0, (cerr << args << ", ", 0)...};
    cerr << "\b\b \n";
}
#define printv(x) cerr << "["; for(auto i : (x)) cerr << i << ", "; cerr << "\b\b]\n";
#define __lcm(a,b) a * b / __gcd(a, b)

typedef unsigned long long ull;
typedef long double ld;


ull m = (ull)1e18;

int main () {
    std::ios::sync_with_stdio (false);
    cin.tie (nullptr);
    cout.tie (nullptr);
    int n;
    cin >> n;
    ull p = 1;
    bool f = true;
    for (int i = 0; i < n; i++) {
        ull in;
        cin >> in;
        if (in == 0) {
            p = 0;
            f = 1;
            break;
        } else if (p && (ull)(m / p) < in) {
            f = false;
            p = 0;
        } else {
            p *= in;
        }
    }
    if (f) {
        cout << p << endl;
    } else {
        cout << -1 << endl;
    }
    return 0;
}


Measured memory_bytes: 3648
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <complex>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;
 
typedef pair<ll,ll> P;

int main(){
  ll H,W,N;
  cin >> H >> W >> N;
  vector<P> v(N);
  for(int i=0;i<N;i++){
	  ll y,x;
	  cin >> y >> x;
	  v[i]=P(y-1,x-1);
  }
  sort(v.begin(),v.end());
  set<P> viewed;
  vector<ll> ans(10,0);
  for(int i=0;i<N;i++){
	  for(int dx=-1;dx<=1;dx++)
		  for(int dy=-1;dy<=1;dy++){
			  ll x=v[i].second+dx;
			  ll y=v[i].first+dy;
			  if(x<=0 || x>=W-1 || y<=0 || y>=H-1 || viewed.find(P(y,x))!=viewed.end())
				  continue;
			  viewed.insert(P(y,x));
			  int count=0;
			  count+=upper_bound(v.begin(),v.end(),P(y-1,x+1))-lower_bound(v.begin(),v.end(),P(y-1,x-1));
			  count+=upper_bound(v.begin(),v.end(),P(y,x+1))-lower_bound(v.begin(),v.end(),P(y,x-1));
			  count+=upper_bound(v.begin(),v.end(),P(y+1,x+1))-lower_bound(v.begin(),v.end(),P(y+1,x-1));
			  ans[count]++;
		  }
  }
  ll sum=0;
  for(int i=1;i<10;i++)
	  sum+=ans[i];
  ans[0]=(W-2)*(H-2)-sum;
  for(int i=0;i<10;i++)
	  cout << ans[i] << endl;
  return 0;
}

Measured memory_bytes: 58112
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,m,MOD=1e9+7,a,b,ans,tw[200001],ch[200000],ch2[200000],ch3[200000],tot;
vector<ll> v[200000],u[200000];
ll f(ll x,ll y){
    if(y==0)return 1;
    if(y%2==0)return f(x,y/2)*f(x,y/2)%MOD;
    return x*f(x,y-1)%MOD;
}
void dfs(ll x){
    for(auto y:v[x]){
        //cout<<y<<endl;
        if(ch[y]==0){
            ch[y]=1;
            //cout<<x<<" "<<y<<endl;
            u[x].push_back(y);
            //cout<<"u"<<x<<y<<endl;
            dfs(y);
        }
    }
    return ;
}
ll dfs2(ll x){
    ll cnt=0;
    for(auto y:u[x]){
        cnt+=dfs2(y);
    }
    cnt++;
    ch2[x]=cnt;
    return cnt;
}
void dfs3(ll x){
    ll ans=tw[n-1]-(tw[n-ch2[x]]-1)-1;
    for(auto y:u[x]){
        //cout<<"y"<<y<<endl;
        ans-=tw[ch2[y]]-1;
        ans%=MOD;
        dfs3(y);
    }
    ch3[x]=ans;
    tot+=ans;
    tot%=MOD;
    //cout<<x<<" "<<tw[n-1]<<ch2[x]<<endl;
    return ;
}
int main(void){
    cin>>n;
    //cout<<f(n,MOD-2)*m%MOD<<endl;
    tw[0]=1;
    for(int i=1;i<=200000;i++)tw[i]=tw[i-1]*2%MOD;
    for(int i=0;i<n-1;i++){
        cin>>a>>b;
        a--,b--;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    ch[0]=1;
    dfs(0);
    dfs2(0);
    for(int i=0;i<n;i++){
        //cout<<ch2[i]<<endl;
    }
    dfs3(0);
    //cout<<endl;
    for(int i=0;i<n;i++){
        //cout<<ch3[i]<<endl;
    }
    tot=(tot+MOD)%MOD;
    cout<<f(tw[n],MOD-2)*tot%MOD<<endl;
}


Measured memory_bytes: 34688
use std::io::*;
use std::str::FromStr;

fn prime_check(n: usize) -> bool {
    let mut j = 2;
    while j * j <= n {
        if n % j == 0 {
            return false;
        }
        j += 1;
    }
    true
}

fn main() {
    let n: usize = read();
    let mut vec: Vec<usize> = vec![0; 110];
    let mut prime: Vec<usize> = Vec::new();
    for i in 2..n + 1 {
        if prime_check(i) {
            prime.push(i);
            vec[i] += 1;
        } else {
            for j in &prime {
                let mut po = i;
                while po % *j == 0 {
                    vec[*j] += 1;
                    po /= *j;
                }
            }
        }
    }
    let mut value: Vec<i64> = vec![0; 110];
    for i in 2..n + 1 {
        value[vec[i]] += 1;
    }
    for i in 1..n {
        value[n - i - 1] += value[n - i];
    }
    let mut ans = 0;
    if value[4] >= 2 && value[2] >= 3 {
        ans += value[4] * (value[4] - 1) / 2 * (value[2] - 2);
    }
    if value[24] >= 1 && value[2] >= 2 {
        ans += value[24] * (value[2] - 1);
    }
    if value[74] >= 1 {
        ans += value[74];
    }
    if value[14] >= 1 && value[4] >= 2 {
        ans += value[14] * (value[4] - 1);
    }
    println!("{}", ans);
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 4352
n = int(input())
v = list(map(int, input().split()))

app = {}
for i, j in zip(v[::2], v[1::2]):
    if i not in app:
        app[i] = [1, 0]
    else:
        app[i][0] += 1
    if j not in app:
        app[j] = [0, 1]
    else:
        app[j][1] += 1

max_o = [0, 0]
secmax_o = [0, 0]
max_e = [0, 0]
secmax_e = [0, 0]
for i in app:
    if app[i][0] > max_o[1]:
        secmax_o = max_o[:]
        max_o = [i, app[i][0]]
    elif app[i][0] > secmax_o[1]:
        secmax_o = [i, app[i][0]]
    if app[i][1] > max_e[1]:
        secmax_e = max_e[:]
        max_e = [i, app[i][1]]
    elif app[i][1] > secmax_e[1]:
        secmax_e = [i, app[i][1]]

if max_o[0] != max_e[0]:
    print(n - max_o[1] - max_e[1])
else:
    del0 = max_o[1] - secmax_o[1]
    del1 = max_e[1] - secmax_e[1]
    print(n + min(del0, del1) - max_o[1] - max_e[1])

Measured memory_bytes: 25184
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using pii=pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
#define all(c) begin(c),end(c)
#define rall(c) rbegin(c),rend(c)
#define fore(x,c) for(auto &&x:c)
#define rep(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define rrep(i, a, n) for(int i=(int)(n-1);i>=a;--i)
#define sz(c) ((int)c.size())
#define contains(c,x) (c.find(x)!=end(c))
#define inseg(l,x,r) ((l)<=(x)&&(x)<(r))
#define dump(...)
#define pb push_back
#define _ 0
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    for (auto i = begin(v); i != end(v); i++) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template <class T> void psum(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(nullptr); ios::sync_with_stdio(0);
        cout << setprecision(15) << fixed;
        // #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    int N;
    cin >> N;
    if (N % 2 == 0) {
        cout << N / 2 - 1 << endl;
    } else {
        cout << N / 2 << endl;
    }
    return (0^_^0);
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
float fun(float a, float b , float c , float d){
	return sqrt((a - c) * (a - c) + (b - d)*(b - d));
}

int main(){	
	ios_base::sync_with_stdio(false);
	    cin.tie(NULL);
	   	int n;
	   	cin >> n;
	   	int x[n],y[n];
	   	for(int i = 0 ; i < n ; i++){
	   		cin >> x[i] >> y[i];
	   	}
	   	float ans = 0;
	   	for(int i = 0 ; i < n ; i++){
	   		for(int j = i+1 ; j < n ; j++){
	   			ans += fun(x[i] , y[i] , x[j] , y[j]);
	   		}
	   	}
	   	cout<< fixed << setprecision(12) << (ans * 2)/n << endl;
		return 0; 
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ITP1_1_D
{
	class Program
	{
		static void Main(string[] args)
		{
			int second = int.Parse(Console.ReadLine());

			int hour = second / 3600;
			second = second % 3600;

			int minute = second / 60;
			second = second % 60;

			Console.WriteLine(hour + ":" + minute + ":" + second);
			
		}
	}
}

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

int a,b,c;
int aa,bb,cc;
int n;

int main(){
    scanf("%d%d%d",&n,&a,&b);
    for(int i=0;i<n;i++){
        scanf("%d",&c);
        if(c<=a)aa++;
        else if(c>a&&c<=b)bb++;
        else cc++;
    }
    printf("%d\n",min(aa,min(bb,cc)));
    return 0;
}

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

int main()
{
    int N,A[1100]={0},B[1100]={0},ma=-1;
    string S;
    cin >> N >> S;
    for(int i=0; i<N; i++){
        A[S[i]] = 1;
        for(int l=0; l<1100; l++){
            B[l] = 0;
        }
        for(int j = i+1; j<N; j++){
            B[S[j]] = 1;
        }
        int cnt = 0;
        for(int k=0; k<1100; k++){
            if(A[k] ==1 && A[k] == B[k]){
                cnt++;
            }
        }
        ma = max(ma,cnt);
    }
    cout << ma << 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++)
typedef long long llong;

int main() {
  int n;
  string s;
  cin >> n >> s;
  string t = "ABC";
  int cnt = 0;
  rep(i, n - 2) {
    if (s[i] == t[0] && s[i + 1] == t[1] && s[i + 2] == t[2]) cnt++;
  }
  cout << cnt << endl;

  return 0;
}


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

int main(){
	int D;
	cin >> D;
	string ans = "Christmas";
	if(D <= 24)
		ans += " Eve";
	if(D <= 23)
		ans += " Eve";
	if(D <= 22)
		ans += " Eve";
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
/*---> 04 May 2020 <--- > 22:15:59 <---*/
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("unroll-loops")
// #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//#pragma GCC target ("sse4")
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
//template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
#define int long long
#define F first
#define S second
#define mod 1000000007
#define inf (int)1e18+5
#define sz(x) (int)x.size()
#define PI 3.141592653589793238510
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define __ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define vi vector<int>
#define vpii vector<pair<int,int> > 
#define vvi vector<vector<int> >
#define PRINT_TIME cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s." <<endl;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename   enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
typedef long double ld;
typedef pair<int,int> pii;
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
const int N=1e5+5;

int32_t main(){__
	int x;
	cin>>x;
	for(int i=-1000;i<=1000;i++){
		for(int j=-1000;j<=1000;j++){
			if(i*i*i*i*i-j*j*j*j*j==x){
				return cout<<i<<" "<<j<<"\n",0;
			}
		}
	}
return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
 
#define mod 1000000007
#define inf 1000000000
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define popcount(x) __builtin_popcountll(x)
 
const long double PI = acos(-1);
 
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}

int main(){
  ll c[10] = {0};
  ll t = 0;
  for(ll i = 0; i < 3; i++){
    ll n;
    cin >> n;
    t += c[n];
    c[n]++;
  }
  cout << (t-1?"No":"Yes") << endl;
  return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

class Main {
	static final int M = 2;

	public static void main(String[] args) throws Exception {
		final Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();

		List<Integer>[] ss = new List[m];

		for (int i = 0; i < m; i++) {
			int k = sc.nextInt();
			ss[i] = new ArrayList<>();
			while (k-- > 0) {
				ss[i].add(sc.nextInt());
			}
		}
		int[] ps = new int[m];
		for (int i = 0; i < m; i++) {
			ps[i] = sc.nextInt();
		}

		long count = 0;
		for (int i = 0; i < (1 << n); i++) {
			boolean ok = true;
			for (int j = 0; j < m; j++) {
				int p = 0;
				for (Integer s : ss[j]) {
					if (((i >> (s - 1)) & 1) == 1) {
						p++;
					}
				}
				if (p % 2 != ps[j]) {
					ok = false;
					break;
				}
			}
			if (ok) count++;
		}

		System.out.println(count);
	}
}


Measured memory_bytes: 21844
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

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

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

// Self settings
// clang-format off
#define MAX_N 1000
#define MAX_M 1000
#define REP(i, N) for (int i = 0; i < (int)(N); ++i)
#define SLN(i,N) (i == N-1 ? "\n" : " ")
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
const ll MOD = 1e9+7;
const ll INF = 1LL << 60;
const int inf = 1 << 31;
// clang-format on

// i 番目までで M 個を達成するときの
// 0 : 最大値, 1: 最小値
int N, M;
ll x[MAX_N], y[MAX_N], z[MAX_N];

int main(void)
{
  cin >> N >> M;
  REP(i, N) { cin >> x[i] >> y[i] >> z[i]; }

  ll ans = 0;
  // 1 なら -1 とする
  for (int i = 0; i < (1 << 3); i++) {
    priority_queue<ll> q;
    for (int j = 0; j < N; j++) {
      ll sum = 0;
      sum += (int)pow(-1, (i & 1)) * x[j];
      sum += (int)pow(-1, ((i & 2) >> 1)) * y[j];
      sum += (int)pow(-1, ((i & 4) >> 2)) * z[j];
      q.push(sum);
    }
    ll sum = 0;
    for (int j = 0; j < M; j++) {
      ll p = q.top();
      q.pop();
      sum += p;
    }
    ans = max(ans, sum);
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
import heapq
N = int(input())
v = list(map(int,input().split()))
heapq.heapify(v)
for i in range(N-1):
    a = heapq.heappop(v)
    b = heapq.heappop(v)
    heapq.heappush(v, (a+b)/2)
print(v[0])

Measured memory_bytes: 38512
/**
 * ????????¢????????????

????????¢?????????????????????????????????????????????????????°?????????????????????????????????????¬????????????????????????¢?????????????????????????????¨??????????????????????????§?¨?
(W,H) ????????????????????????????????????????????????????????§?¨? (x,y) ??¨?????? r ??§?????????????????????


Input
???????????´??° W???H???x???y???r ????????????????????§??????????????????????????????

Output
??????????????¢????????¨????????????????????? Yes ??¨????????¨??§???????????????????????° No
??¨????????????????????????????????????

Constraints
???100???x,y???100
0<W,H,r???100

Sample Input 1
5 4 2 2 1
Sample Output 1
Yes
Sample Input 2
5 4 2 4 1
Sample Output 2
No

 */

#include <iostream>
#include <sstream>

int main(int argc, char const *argv[]) {
  int x, y;
  x = y = 0;
  unsigned int W, H, r;
  W = H = r = 0;

  while (true) {
  std::string param;

  getline(std::cin, param);
  std::istringstream iss(param);
  iss >> W >> H >> x >> y >> r;

  if (W > 100 || H > 100 || r > 100) {
    std::cout << "Error: 0 <= W, H, r <= 100" << std::endl;
  } else if ((x < -100 || x > 100) || (y < -100 || y > 100)) {
    std::cout << "Error: -100 <= x, y <= 100" << std::endl;
  } else {
    break;
  }
}

if (((x - (int)r) >= 0 && (x + r) <= W) && ((y - (int)r) >= 0 && (y + r) <= H)) {
  std::cout << "Yes" << std::endl;
} else {
  std::cout << "No" << std::endl;
}

  return 0;
}

Measured memory_bytes: 3184
#include <bits/stdc++.h>
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/algorithm/string/classification.hpp> // is_any_of
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/replace.hpp>
#include <boost/math/tools/minima.hpp>

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

namespace adaptor = boost::adaptors;
using namespace std;
using boost::math::tools::brent_find_minima;
using boost::irange;
using boost::algorithm::join;
using boost::algorithm::split;
using boost::algorithm::replace_all;
using boost::multiprecision::cpp_int;
using ll = long long;
using P = pair<int, int>;

// TOP
void	Main()
{
	string	s;
	cin >> s;

	deque<char>	S;
	rep(i, s.size())
	{
		if (s.at(i) == '0' || s.at(i) == '1')
			S.push_back(s.at(i));
		else
		{
			if (S.size())
				S.pop_back();
		}
	}
	rep(i, S.size())
		cout << S.at(i);
	cout << endl;
}
// END

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


Measured memory_bytes: 256
let readCharArray () = stdin.ReadLine().ToCharArray()

stdin.ReadLine()

let uniq arr = arr |> Array.groupBy id |> Array.map fst

let countSameElement arr1 arr2 =
    let x = arr1 |> uniq
    arr2
    |> uniq
    |> Array.filter (fun z -> x |> Array.contains z)
    |> Array.length


()
|> readCharArray
|> fun x ->
    [ 0 .. (x.Length - 1) ]
    |> List.map (fun i -> countSameElement (x.[0..i]) (x.[(i + 1)..(x.Length - 1)]))
    |> List.max
    |> printfn "%d"


Measured memory_bytes: 32212
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = 1; i < (int)(n+1); i++)
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 (long long 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(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
  	if(n==k){
      return 1;
    }
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// vector<vector<int>> A(3, vector<int>(4));
int main() {
    ll k,s;
    cin>>k>>s;
    ll ans=0;
    for(int i=0; i<k+1; i++){
        for(int j=0; j<k+1; j++){
            if(s-i-j<=k&&0<=s-i-j){
                ans++;
            }
        }
    }
    cout<<ans<<endl;
}



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

typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
template <class T = ll>
T in()
{
    T x;
    cin >> x;
    return (x);
}

struct sushi
{
    ll t, d;
};
vector<sushi> menu, selected, unselected;

void sort2vectors_custom(vector<sushi> &menu_x)
{
    ll n = menu_x.size();
    vector<ll> p(n);
    vector<sushi> menu_x2(n);
    iota(all(p), 0);
    sort(all(p), [&](ll a, ll b) { return menu_x[a].d < menu_x[b].d; });
    rep(i, n)
    {
        menu_x2[i] = menu_x[p[i]];
    }
    menu_x = menu_x2;
}

int main()
{
    ll n = in();
    ll k = in();

    menu.resize(n);
    rep(i, menu.size())
    {
        cin >> menu[i].t >> menu[i].d;
    }
    ll cnt = 0, p_satisfied = 0;
    set<ll> selected_type;

    sort2vectors_custom(menu);
    reverse(all(menu));

    rep(i, n)
    {
        if (selected_type.count(menu[i].t) == 0 && cnt < k)
        {
            selected_type.emplace(menu[i].t);
            ++cnt;
            selected.push_back(menu[i]);
        }
        else
        {
            unselected.push_back(menu[i]);
        }
    }
    sort2vectors_custom(unselected);

    while (cnt < k && unselected.size() > 0)
    {
        p_satisfied += unselected.back().d;
        unselected.pop_back();
        ++cnt;
    }

    while (true)
    {
        ll t_cnt = selected.size();
        if (selected.size() == 0 || unselected.size() == 0)
        {
            break;
        }
        if (t_cnt * t_cnt + selected.back().d > (t_cnt - 1) * (t_cnt - 1) + unselected.back().d)
        {
            break;
        }
        p_satisfied += unselected.back().d;
        unselected.pop_back();
        selected.pop_back();
    }

    for (sushi v : selected)
    {
        p_satisfied += v.d;
    }
    cout << p_satisfied + selected.size() * selected.size() << endl;
}

Measured memory_bytes: 7508