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

using namespace std;

#define eb emplace_back
#define ii pair<int, int>
#define OK (cerr << "OK" << endl)
#define debug(x) cerr << #x " = " << (x) << endl
#define ff first
#define ss second
#define int long long
#define tt tuple<int, int, int>
#define all(x) x.begin(), x.end()
#define vi vector<int>
#define vii vector<pair<int, int>>
#define vvi vector<vector<int>>
#define vvii vector<vector<pair<int, int>>>
#define Mat(n, m, v) vector<vector<int>>(n, vector<int>(m, v))
#define endl '\n'

constexpr int INF = 2e18;
constexpr int MOD = 1e9 + 7;
constexpr int MAXN = 2e5 + 3;

// #define MULTIPLE_TEST_CASES
void solve() {
  string s;
  cin >> s;
  if (s.back() == 's')
    cout << s + "es" << endl;
  else
    cout << s + "s" << endl;
}

signed main() {
  // freopen(".in", "r", stdin);
  // freopen(".out", "w", stdout);
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);

  int t = 1;
#ifdef MULTIPLE_TEST_CASES
  cin >> t;
#endif
  while (t--)
    solve();
}

Measured memory_bytes: 3656
#include <iostream>
#include <algorithm>

#define INF 10e12

using namespace std;
int main(void){
    long A,B,Q;
    cin>>A>>B>>Q;
    long s[A+2],t[B+2],x[Q];
    s[0]=-INF; t[0]=-INF; s[A+1]=INF; t[B+1]=INF;
    for(int i=1;i<=A;i++){
        cin>>s[i];
    }
    for(int i=1;i<=B;i++){
        cin>>t[i];
    }
    for(int i=0;i<Q;i++){
        cin>>x[i];
    }
    for(int i=0;i<Q;i++){
        auto iter1=lower_bound(s,s+A,x[i]);
        auto iter2=iter1-1;
        auto iter3=lower_bound(t,t+B,x[i]);
        auto iter4=iter3-1;
        long point1=*iter1,point2=*iter2,point3=*iter3,point4=*iter4;
        long cand1=abs(point1-x[i])+min(abs(point3-point1),abs(point4-point1));
        long cand2=abs(point2-x[i])+min(abs(point3-point2),abs(point4-point2));
        long cand3=abs(point3-x[i])+min(abs(point1-point3),abs(point2-point3));
        long cand4=abs(point4-x[i])+min(abs(point1-point4),abs(point2-point4));
        long ans=min({cand1,cand2,cand3,cand4});
        cout<<ans<<endl;
    }
    return 0;
}


Measured memory_bytes: 3712
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define all(X) X.begin(),X.end()

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   str.substr (x) : returns a substring str[x],... end of string
   str.find(qtr) : returns the first occurenece of qtr in str */

const int M = (1<<20)+5;
const int md = 1e9+7;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

string str;

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

	ll i,n;

	cin >> str;
	n = str.size();
	for(i=1;i<=n;++i)
	{
		if(str[i-1]!=str[n-i])
		{
			cout << "No" << "\n";
			return 0;
		}
	}
	for(i=1;i<=(n-1)/2;++i)
	{
		if(str[i-1]!=str[(n-1)/2-i])
		{
			cout << "No" << "\n";
			return 0;
		}
	}
	for(i=(n+3)/2;i<=n;++i)
	{
		if(str[i-1]!=str[n+(n+3)/2-1-i])
		{
			cout << "No" << "\n";
			return 0;
		}
	}

	cout << "Yes" << "\n";
	return 0;
}
	

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int n,a[100],ans;
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
        if(i&&a[i-1]==a[i]){
            a[i]=-1;
            ans++;
        }
    }
    cout<<ans;
}

Measured memory_bytes: 764
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<iterator>
#include<stack>
#include<queue>
#include<utility>
#include<functional>
#include<bitset>
#include<numeric>
#include<cstring>
#include<tuple>
using namespace std;

string s, ans = "No";
set< char > col;

int main( void )
{
	ios :: sync_with_stdio( 0 );
	cin.tie( 0 );
	
	cin >> s;
	for( char c : s )
	{
		col.insert( c );
	}
	if( col.size() == 2 )
	{
		ans = "Yes";
	}
	cout << ans << "\n";	
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int A = scn.nextInt(), B = scn.nextInt(),C = scn.nextInt(),D = scn.nextInt();
		String ans;
		if(A+B > C+D) {
			ans = "Left";
		}else if(A+B==C+D){
			ans = "Balanced";
		}else {
			ans = "Right";
		}
		System.out.println(ans);
	}

}


Measured memory_bytes: 23124
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <stack>
#include <queue>
#define llong long long
#define INF (__INT32_MAX__ / 2)
#define MAX_N 10000

using namespace std;
typedef pair<int, int> ipair;

llong N;


llong solve() {
    if(N == 2)
        return 0;

    llong res = N - 1;

    for(llong i = 2; i * i < N; ++i)
        if(N % i == 0) {
            //m = i - 1, (N / i) - 1
            llong j = N / i;
            if(N % (i - 1) == N / (i - 1))
                res += i - 1;

            if(N % (j - 1) == N / (j - 1))
                res += j - 1;
        }
    return res;
}

int main(int argc, char **argv) {
    cin >> N;

    cout << solve() << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define show(x)  cerr << #x << " = " << (x) << endl;
using namespace std;

const int M = 100000;

int main(){
    int n, m, s;
    while(cin >> n >> m >> s,n){
		vector<vector<int>> cur(n * n + 1, vector<int>(s + 1,0));
		cur[0][0] = 1;
		range(i,1,m + 1){
			for (int j = n * n; j > 0; j--) {
				range(k,i,s + 1){
					(cur[j][k] += cur[j - 1][k - i]) %= M;
				}
			}
		}

        cout << cur[n * n][s] << endl;
    }
}



Measured memory_bytes: 3320
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>


int main()
{
    int A,B;
    std::cin >> A >> B;
    if(A%2==B%2){
        std::cout << (A+B)/2 << std::endl;
    }else{
        std::cout << "IMPOSSIBLE" << std::endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include<map>
#include<string>
#include<algorithm>
#include<sstream>
#include<cmath>
#include<typeinfo>
#include<queue>
using namespace std;
int next_combination(int sub) {
	int x = sub & -sub, y = sub + x;
	return (((sub & ~y) / x) >> 1) | y;
}
int main() {
	int N;
	cin >> N;
	vector<int> x(N), l(N);
	for (int i = 0; i < N; i++) {
		cin >> x[i] >> l[i];
	}
	vector<pair<int, int>> arm(N);
	for (int i = 0; i < N; i++) {
		arm[i].first = x[i] + l[i];
		arm[i].second = x[i] - l[i];
	}
	sort(arm.begin(), arm.end());
	int count = 1;
	int sec_end = arm[0].first;
	for (int i = 0; i < N; i++) {
		if (sec_end <= arm[i].second) {
			sec_end = arm[i].first;
			count++;
		}
	}
	cout << count<<endl;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define int long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
signed main(){
	bitset <4000100> b; 
	int n; cin >> n;
	int sum = 0;
	b[0] = 1;
	for (int i=0; i<n; i++){
		int u; cin >> u;
		sum += u;
		b |= (b<<u);
	}
	int ans = (sum+1)>>1;
	while (ans<=sum){
		if (b.test(ans)){
			cout << ans;
			return 0;
		}
		ans++;
	}
	cout << -1;
}



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

int main() {
	char ca, cb;
	cin >> ca >> cb;
	int a, b;
	a = (int)ca-48;
	b = (int)cb-48;

	string ab, ba;

	for (int i = 0; i < b; i++) {
		ab.push_back(ca);
	}
	for (int i = 0; i < a; i++) {
		ba.push_back(cb);
	}

	if (ab.at(0) > ba.at(0)) {
		cout << ba << endl;
	}
	else if (ab.at(0) > ba.at(0)) {
		cout << ab << endl;
	}
	else {
		cout << ab << endl;
	}
}

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

using namespace std;
typedef long long ll;

int N;
const int MAXN = 20;
const int big = MAXN*MAXN + 1;
int A[MAXN][2];
int dp[(1 << MAXN)][51][2];

int solve(int mask, int last, bool odd) {
	if (mask == 0) {
		return 0;
	}
	if (dp[mask][last][odd] >= 0) {
		return dp[mask][last][odd]; 
	}
	int best = big;	
	int count = 0;
	for (int i = 0; i < N; i++) {
		if (mask & (1 << i)) {
			int t = ((odd + i) % 2 ? A[i][1] : A[i][0]);
			if (t >= last) {
				int val = count + solve(mask ^ (1 << i), t, !odd);
				best = min(val, best);
			}
			count++;
		}
	}
	dp[mask][last][odd] = best;
	return best;
}

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);	
	cin >> N;
	for (int i=0; i < N; i++) {
		cin >> A[i][0];
	}
	int mask = (1 << N) - 1;
	for (int i=0; i < N; i++) {
		cin >> A[i][1];
	}
	memset(dp, -1, sizeof dp);
	int swaps = solve(mask, 0, 0);
	if (swaps >= big) {
		cout << -1 << "\n";
	} else {
		cout << swaps << "\n";
	}
}



Measured memory_bytes: 418176
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
ll INF = 1e18;
#define def 0

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


Measured memory_bytes: 832
#include<iostream>
#include<cstring>
#include<cstdio>
#define MAXN 200001
using namespace std;
int tong[MAXN],a[MAXN];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		tong[a[i]]++;
	}
	long long sum=0;
	for(int i=1;i<=n;i++)
		sum=sum+(long long)tong[i]*(tong[i]-1)/2;
	for(int i=1;i<=n;i++)
		printf("%lld\n",0ll+sum-tong[a[i]]+1);
	return 0;
}

Measured memory_bytes: 3712
#include <stdio.h>

int main (){
    int a,c;
    char b;
    while(1){
        scanf("%d %c %d",&a,&b,&c);
        if (b == '*') printf("%d\n",a*c);
        else if (b == '/') printf("%d\n",a/c);
        else if (b == '+') printf("%d\n",a+c);
        else if (b == '-') printf("%d\n",a-c);
        else if (b == '?') break;
        else break;
    }
    return 0;
}



Measured memory_bytes: 2736
//============================================================================
// Name        : abc126a.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
#include<list>
#include<set>
#include<map>

using namespace std;

int main() {
	int N, K;
	string s;
	cin >> N >> K;
	for(int i = 0; i < N; ++i){
		char c;
		cin >> c;
		if(i + 1 == K){
			c = c + 0x20;
			s += c;
		}
		else{
			s += c;
		}
	}

	cout << s << endl;
	return 0;
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var num int

	fmt.Scan(&num)

	var subordinates = make([]int, num)
	for i := 1; i < num; i++ {
		var a int
		fmt.Scan(&a)
		subordinates[a-1] += 1
	}

	for i := 0; i < len(subordinates); i++ {
		fmt.Println(subordinates[i])
	}
}


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

//a->bread p->meat

long long f(long long N,long long X,vector<long long> a,vector<long long> p) {
	if (N==0) {
    if(X<=0){
      return 0;
    }
		else{
      return 1;
    }}
  else if(X<=(1+a[N-1])){
    return f(N-1,X-1,a,p);
  }
  else{
    return p[N-1]+1+f(N-1,X-2-a[N-1],a,p);
  }
	}

int main(){
  long long N,X,ans;
  cin>>N>>X;
  vector<long long> a;
  vector<long long> p;
  a.push_back(1);
  p.push_back(1);
  long long a_tmp,p_tmp;
  a_tmp=1;
  p_tmp=1;
  for(int i=0;i<60;++i){
    a_tmp=a_tmp*2+3;
    p_tmp=p_tmp*2+1;
    a.push_back(a_tmp);
    p.push_back(p_tmp);
  }
  ans=f(N,X,a,p);
  cout<<ans;
  return 0;
  }

Measured memory_bytes: 384
using System;
namespace ABC175
{
    class Program
    {
        static void Main(string[] args)
        {
            string inp = Console.ReadLine();
            int j = 0;
            if (inp[1] == 'R')
            {
                if (inp[0] == 'R')
                {
                    if (inp[2] == 'R')
                    {
                        j = 3;
                    }
                    else
                    {
                        j = 2;
                    }
                }
                else if (inp[2] == 'R')
                {
                    j = 2;
                }
                else
                {
                    j = 1;
                }
            }
            else
            {
                if (inp[0] == 'R' | inp[2] == 'R')
                {
                    j = 1;
                }
                else
                {
                    j = 0;
                }
            }
            Console.WriteLine(j);
        }
    }
}

Measured memory_bytes: 25864
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100000 + 10;
int n, a[N], dp[N], nxt2[N], nxt1[N];

int calc(int i) {
	if (i == n) return 0;
	int &ret = dp[i];
	if (ret != -1) return ret;
	ret = 1 + min(calc(nxt1[i]), calc(nxt2[i]));
	return ret;
}

int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
		scanf("%d", a + i);
	nxt1[n - 1] = nxt2[n - 1] = n;
	for (int i = n - 2; i >= 0; --i) {
		if (a[i + 1] <= a[i]) nxt1[i] = nxt1[i + 1];
		else nxt1[i] = i + 1;
		if (a[i + 1] >= a[i]) nxt2[i] = nxt2[i + 1];
		else nxt2[i] = i + 1;
	}
	memset(dp, -1, sizeof dp);
	printf("%d\n", calc(0));
	return 0;
}


Measured memory_bytes: 4864
#include<stdio.h>

int main(void){
	int a,b,c,t;
	scanf("%d %d %d",&a,&b,&c);
	while(1){
		if(a>b){
			t=a;
			a=b;
			b=t;
		}else if(b>c){
			t=b;
			b=c;
			c=t;
		}else{
			break;
		}
	}
	printf("%d %d %d\n",a,b,c);
	return 0;
}


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

int f(int a, int b){
  string x=to_string(a);
  string y=to_string(b);
  return x.size()>y.size() ? x.size() : y.size();
}
int main(){
  long n;
  cin>>n;
  int ans=11;
  for(int i=1;i<=sqrt(n);i++){
    if(n%i==0){
    	int tmp=f(i,n/i);
    	ans=min(ans,tmp);
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
N, M, C = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(N)]


# print(B)
# print(A)
# print(A[0][0])
ans = 0

for j in range(N):
    S = C
    for i in range(M):
        S += A[j][i] * B[i]
    if(S > 0):
        ans += 1
print(ans)



Measured memory_bytes: 3060
N = int(input())
H_list = [int(h) for h in input().split()]

if N == 1:
    print('Yes')

else:
    decrease_allowed = True
    for i in range(N-1):
        h_current = H_list[i]
        h_next = H_list[i +1]
        if decrease_allowed:
            max_grad = h_next - h_current + 1
        else:
            max_grad = h_next - h_current
        
        if max_grad > 0:
            decrease_allowed = True
        elif max_grad == 0:
            decrease_allowed = False
                
        else:
            print('No')
            break
            
        if i == N - 2:
            print('Yes')

Measured memory_bytes: 14224
//AOJ-GRL-6-A
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;

template <typename T>
struct FordFulkerson{
    struct edge{
        int to;
        T cap;
        int rev;
        edge(int to, T cap, int rev) : to(to), cap(cap), rev(rev) {}
    };
    
    vector<vector<edge>> G;
    vector<bool> used;

    FordFulkerson(int n) : G(n), used(n) {}

    void add_edge(int from, int to, T cap){
        G[from].emplace_back(to, cap, G[to].size());
        G[to].emplace_back(from, 0, G[from].size() - 1);
    }

    T dfs(int v, int t, T f){
        if(v == t) return f;
        used[v] = true;
        for(int i = 0; i < G[v].size(); i++){
            edge & e = G[v][i];
            if(!used[e.to] && e.cap > 0){
                T d = dfs(e.to, t, min(f, e.cap));
                if(d > 0){
                    e.cap -= d;
                    G[e.to][e.rev].cap += d;
                    return d;
                }
            }
        }
        return 0;
    }

    T flow(int s, int t, T INF = 1e9){
        int fl = 0;
        while(true){
            fill(used.begin(), used.end(), false);
            T f = dfs(s, t, INF);
            if(f == 0) break;
            fl += f;
        }
        return fl;
    }
};

signed main(){
    int V,E;
    cin >> V >> E;
    FordFulkerson<ll> f(V);
    int u, v;
    ll c;
    REP(i,E){
        cin >> u >> v >> c;
        f.add_edge(u, v, c);
    }
    cout << f.flow(0, V - 1, LINF) << endl;
    return 0;
}


Measured memory_bytes: 3212
n = int(input())
h = [int(i) for i in input().split()]

ans = 0
tmp = 0

for i in range(n-1):
    #print(ans,tmp,i,h[i+1],h[i])
    if h[i] >= h[i+1]:
        tmp += 1
    else:
        ans = max(ans,tmp)
        tmp = 0
        
print(max(ans,tmp))

Measured memory_bytes: 14252
#include <bits/stdc++.h>
using namespace std;
const int mod = 1'000'000'007;
int mul(long long a, long long b){
	return a * b % mod;
}
int add(int a, int b){
	a += b;
	if(a >= mod) a -= mod;
	return a;
}
int main(){
	int n, m; cin >> n >> m;
	int sumx = 0;
	for(int i = 0; i < n; i++){
		int v; cin >> v;
		if(v < 0) v += mod;
		sumx = add(sumx, mul(v, i));
		sumx = add(sumx, mod - mul(v, (n - i - 1)));	
	}
	int res = 0;
	for(int i = 0; i < m; i++){
		int v; cin >> v;
		if(v < 0) v += mod;
		res = add(res, mul(mul(sumx, v), i));
		res = add(res, mod - mul(mul(sumx, v), m - i - 1));
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <functional> 
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>

using namespace std;

typedef long long LL;

#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 
#define rep(i,n) for (int i = 0; i < (n); ++i)

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

    int D;
    cin >> D;
    vector<int> c(26), cc(26);
    rep(i, 26) {
        cin >> c[i];
        cc[i] = c[i];
    }
    vector<vector<int>> s(D);
    rep(i, D) {
        s[i].resize(26);
        rep(j, 26) cin >> s[i][j];
    }

    vector<int> t(D);
    rep(i, D) {
        cin >> t[i];
        --t[i];
    }
    vector<int> lst(26);

    int v = 0;
    rep(d, D) {
        v += s[d][t[d]];
        lst[t[d]] = d+1;
        rep(i, 26) {
            v -= ((d+1)-lst[i]) * c[i];
        }
        cout << v << endl;

        // int x = -1;
        // int best = -1000000;
        // rep(i, 26) {
        //     int tmp = s[d][i] - cc[i];
        //     if (best < tmp) {
        //         x = i;
        //         best = tmp;
        //     }
        // }
        // cout << (x+1) << endl;
        // rep(i, 26) {
        //     if (i == x) {
        //         cc[i] = c[i];
        //     } else {
        //         cc[i] += c[i];
        //     }
        // }
    }

    return 0;
}




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

typedef long long ll;
typedef unsigned long long ull;
typedef string st;
typedef double db;
typedef vector<long long> vecll;
typedef vector<char> vechar;
typedef vector<string> vecst;

int main(){
    ll N;
    cin >> N;
    vecll d(N);
    for(auto& i : d) cin >> i;
    sort(d.begin(), d.end());
    ll ans = d.at(N / 2) - d.at(N / 2 - 1);
    cout << ans << endl;
}

Measured memory_bytes: 1024
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			String alphabet = "abcdefghijklmnopqrstuvwxyz";
			Map<Character, Integer> map = new HashMap<Character, Integer>();
			// init
			for (int i = 0; i < alphabet.length(); i++) {
				map.put((char) alphabet.charAt(i), 0);
			}

			char[] N = scanner.next().toCharArray();
			Arrays.sort(N);

			for (char c : N) {
				if (map.containsKey(c)) {
					map.put(c, 1);
				}
			}
			boolean flg = true;
			for (Entry<Character, Integer> entry : map.entrySet()) {
				if (entry.getValue() == 0) {
					System.out.println(entry.getKey());
					flg = false;
					break;
				}
			}
			if (flg)
				System.out.println("None");
		}
	}
}

Measured memory_bytes: 25940
#include<bits/stdc++.h>
using namespace std;
int main(){

    std::ios_base::sync_with_stdio(0),cin.tie(0),cin.tie(0);

    int a,b,k,cnt=0;
    cin >> a >> b >> k;
    for(int i=0;i<k;i++){
        if(i%2==0)b += a/2,a /= 2;
        else a += b/2,b/=2;
    }
    cout << a << ' ' << b << endl;
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
# -*- coding: utf-8-*-

n, m = map(int, input().split(" "))

l = []

for i in range(n):
    t1, t2 = map(int, input().split(" "))
    l.append((t1, t2))
l.sort(key=lambda x:x[0])
sum = 0
for i in l:
    if m < i[1]:
        sum += (i[0] * m)
        break
    sum += (i[0] * i[1])
    m -= i[1]

print(sum)


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

const int maxn = 100000;
long long a[maxn+5];
long long prefix[maxn+5];
int n;

long long compute(int f) {
    long long ans = 0;
    long long offset = 0;
    for (int i = 1; i <= n; ++i) {
        long long temp = prefix[i] + offset;
        if (f == 1) {
            if (i % 2 == 1 && temp <= 0) {
                ans += 1 - temp;
                offset += 1 - temp;
            } else if (i % 2 == 0 && temp >= 0) {
                ans += temp + 1;
                offset -= temp + 1;
            }
        } else {
            if (i % 2 == 0 && temp <= 0) {
                ans += 1 - temp;
                offset += 1 - temp;
            } else if (i % 2 == 1 && temp >= 0) {
                ans += temp + 1;
                offset -= temp + 1;
            }
        }
    }
    return ans;    
}

int main() {
    cin>>n;
    memset(prefix, 0, sizeof prefix);
    for (int i = 0; i < n; ++i) {
        cin>>a[i];
        prefix[i+1] = prefix[i] + a[i];
    }
    cout<<min(compute(1), compute(-1))<<endl;
    return 0;
}

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

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int, int> P;

const int MOD = 1000000007;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

int main()
{
    int n;
    cin >> n;
    vector<pair<ll, ll>> task;
    rep(i, n)
    {
        ll a, b;
        cin >> a >> b;
        task.push_back(make_pair(b, -a));
    }
    sort(task.begin(), task.end());

    ll t = 0;
    rep(i, n)
    {
        t += -task[i].second;
        if (t > task[i].first) {
            cout << "No" << endl;
            return 0;
        }
    }

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

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

int main()
{
    ll n, d, ans = 0;
    cin >> n >> d;
    rep(i, n)
    {
        ll x, y;
        cin >> x >> y;
        if (x * x + y * y <= d * d)
            ans++;
    }
    cout<<ans<<endl;
    return 0;
}

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

Measured memory_bytes: 1024
import sys
sys.setrecursionlimit(1000000)
 
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0
 
def modinv(a, m):
    g, x, y = xgcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m
 
def combination(n,r,q):
    if r==0:
        return 1
 
    return ((n*combination(n-1,r-1,q)%q)*modinv(r,q))%q
 
def _input():
    return list(map(int, input().split()))
 
def main():
    i=_input()
    x,y=i[0],i[1]
    if 2*y>=x and 2*x>=y and (2*y-x)%3==0 and (2*x-y)%3==0:
        n=(2*y-x)//3
        m=(2*x-y)//3
        print(int(combination(n+m,min(m,n),1000000007)))
    else:
        print(0)
 
if __name__ == "__main__":
    main()


Measured memory_bytes: 300148
import sys
import math
from collections import defaultdict

def ep(*params):
    print(*params,file=sys.stderr)

def gcd(s1,s2):
    s = (s1,s2)
    global total,hit
    return math.gcd(s1,s2)
    
K = int(input().rstrip())
ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        ab = gcd(a,b)
        if ab == 1:
            ans += 1*K
        else:
            for c in range(1,K+1):
                ans += gcd(ab,c)

print(ans)

Measured memory_bytes: 9252
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>

using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
typedef long long ll;

int main()
{
	string s1, s2, s3;
	cin >> s1 >> s2 >> s3;
	printf("%c%c%c\n", s1[0] - 0x20, s2[0] - 0x20, s3[0] - 0x20);

	return 0;
}


Measured memory_bytes: 256
import sys
from bisect import bisect
F = sys.stdin
A, B, Q = map(int, F.readline().strip("\n").split(" "))
S, T =[None] * (A+2), [None] * (B+2)
S[0], T[0] = -10**20, -10**20
for i in range(A):
    S[i+1] = int(F.readline().strip("\n"))
for i in range(B):
    T[i+1] = int(F.readline().strip("\n"))
S[A+1] = 10**20
T[B+1] = 10**20
 
lenS, lenT = len(S), len(T)
Out = ""
for _ in range(Q):
    x = int(F.readline().strip("\n"))
    si, ti = bisect(S, x, 0, lenS), bisect(T, x, 0, lenT)
    sLength0, sLength1 = x - S[si-1], S[si] - x
    tLength0, tLength1 = x - T[ti-1], T[ti] - x
    Ans = min(max(sLength0, tLength0), max(sLength1, tLength1), sLength0 + tLength1 + min(sLength0, tLength1), sLength1 + tLength0 + min(sLength1, tLength0))
    Out += str(Ans) + "\n"
print(Out)

Measured memory_bytes: 14280
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   // 0-indexed昇順

int main() {
    string s;
    cin >> s;
    int K;
    cin >> K;
    set<string> m;
    rep(i,s.size()) {
      for (int j = 1; j <= K; j++) {
          m.insert(s.substr(i,j));
      }
    }
    cout << *next(m.begin(), K-1) << endl;
}


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

/* メモリ食い過ぎ注意 */
#define int long long

typedef long long ll;

/* define const */
const ll INF = (1ll << 60);
const ll MOD = (ll)1e9 + 7;
/* end defineing */

signed main()
{
    int n, c, k;
    int t[100001];
    cin >> n >> c >> k;
    for (int i = 0; i < n; i++)
        cin >> t[i];
    sort(t, t + n);

    int bus = 0;
    for (int i = 0; i < n;)
    {
        int cnt = 1;
        int j = i + 1;
        int tmax = t[i] + k;
        while (cnt < c && tmax >= t[j])
        {
            cnt++;
            j++;
        }
        i = j;
        // cout << "," << j << endl;
        bus++;
    }
    cout << bus << endl;
}


Measured memory_bytes: 1024
#include<cstdio>
#include<algorithm>


int main(){
using namespace std;
        int m[10] = {0};
        int i;
        for(i = 0; i < 10; i++){
                scanf("%d", &m[i]);
        }
        sort(m, m + 10);
        reverse(m, m + 10);

        for(i = 0; i < 3; i++){
                printf("%d\n", m[i]);
        }
        return 0;
}
 

Measured memory_bytes: 1044
n, k = gets.split(" ").map(&:to_i)
ary = (k*2).times.map{gets.split(" ").map(&:to_i)}
d_ary = ary.each_slice(2).map(&:first)
a_ary = ary.each_slice(2).map(&:last)
a_ary.flatten!.uniq!
n_ary = []
(1..n).each{|i| n_ary.push(i)}
num = 0
n_ary.each do |j|
  a_ary.include?(j) ? num += 0 : num += 1
end
p num

Measured memory_bytes: 14376
import java.awt.*;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(),k=sc.nextInt();
        int h[]=new int[n];
        for (int i=0;i<n;i++)h[i]=sc.nextInt();
        int dp[]=new int[n];Arrays.fill(dp,(int)1e9+5);dp[0]=0;
        for (int i=1;i<n;i++){
            for (int j=1;j<=k;j++) {
                if (i-j<0)break;
                dp[i] = Math.min(dp[i - j] + Math.abs(h[i-j] - h[i]), dp[i]);
            }
        }
        System.out.println(dp[n-1]);
    }
}

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

int main(){
    int n, k; cin >> n >> k;
    int f[n]; for(int i=0;i<n;i++) cin>>f[i];

    sort(f, f+n);

    cout << accumulate(f, f+k, 0) << endl;
    return 0;
}

Measured memory_bytes: 3640
#include<iostream>

using namespace std;

int main(){
  int x,mx=1;
  cin >> x;
  for(int i=2;i*i<=x;i++){
    int tmp=i;
    for(int j=0;j<=x;j++){
      if(tmp>x){
        break;
      }
      else{
        mx = max(mx, tmp);
        tmp*=i;
      }
    }
  }
  cout << mx << endl;
}

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

int d[2] = { 0,255 };
int b(char c) {
	if (c <= '9')return c - '0';
	return c - 'a' + 10;
}
int c(string d) {
	return b(d[0]) * 16 + b(d[1]);
}
int main() {
	string a;
	while (cin >> a, a != "0") {
		int o = 0, p = 0, q = 0;
		int x = c(a.substr(1, 2)), y = c(a.substr(3, 2)), z = c(a.substr(5, 2));
		int MIN = 1 << 29;
		for (int e = 0; e < 2; e++) {
			for (int f = 0; f < 2; f++) {
				for (int g = 0; g < 2; g++) {
					if ((x - d[e])*(x - d[e]) + (y - d[f])*(y - d[f]) + (z - d[g])*(z - d[g]) < MIN) {
						MIN = (x - d[e])*(x - d[e]) + (y - d[f])*(y - d[f]) + (z - d[g])*(z - d[g]);
						o = e; p = f; q = g;
					}
				}
			}
		}
		if (o) {
			if (p) {
				if (q) {
					puts("white");
				}
				else {
					puts("yellow");
				}
			}
			else {
				if (q) {
					puts("fuchsia");
				}
				else {
					puts("red");
				}
			}
		}
		else {
			if (p) {
				if (q) {
					puts("aqua");
				}
				else {
					puts("lime");
				}
			}
			else {
				if (q) {
					puts("blue");
				}
				else {
					puts("black");
				}
			}
		}
	}
}

Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ULL;
typedef long long LL;
#define FOR(i, a, b) for(LL i=(LL)(a);i<(LL)(b);i++)
#define REP(i,x) for(LL i=0;i<(LL)(x);i++)

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    // cout << fixed << setprecision(10);
    LL x, y, a, b, c;
    cin >> x >> y >> a >> b >> c;
    multiset<LL> sRedApple, sBlueApple, sTransApple, sAllApple;
    REP(i, a)
    {
        LL temp;
        cin >> temp;
        sRedApple.insert(temp);
    }

    // 食べられる分の赤りんごを対象に突っ込む
    auto itRedApple = sRedApple.rbegin();
    REP(i, x)
    {
        LL temp = *itRedApple;
        sAllApple.insert(temp);
        itRedApple++;
        if(itRedApple == sRedApple.rend())
        {
            break;
        }
    }

    REP(i, b)
    {
        LL temp;
        cin >> temp;
        sBlueApple.insert(temp);
    }

    // 食べられる分の青りんごを対象に突っ込む
    auto itBlueApple = sBlueApple.rbegin();
    REP(i, y)
    {
        LL temp = *itBlueApple;
        sAllApple.insert(temp);
        itBlueApple++;
        if(itBlueApple == sBlueApple.rend())
        {
            break;
        }
    }

    // 透明りんごは無条件に全部突っ込む
    REP(i, c)
    {
        LL temp;
        cin >> temp;
        sAllApple.insert(temp);
    }

    // 美味しさの大きい順に食べる
    LL ret = 0;
    auto itAllApple = sAllApple.rbegin();
    REP(i, x + y)
    {
        ret += *itAllApple;
        itAllApple++;
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 22784
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<cstring>
using namespace std;

int main()
{
	char std[5] = "YAKI" ;
	char s[14] = {'0'};
	scanf("%s",s);
	if(strncmp(s,std,4) == 0) printf("Yes");
	else printf("No");
	return 0;
	
}

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

using namespace std;

typedef long long ll;

const int N = 110;

ll Dp[N][N];

ll Rec(int i, int j)
{
    if(i == 0)  return 1;

    if(Dp[i][j] + 1)    return Dp[i][j];

    ll Res = 0;

    for(int k = -1; k <= +1; k++)
        if(0 <= j + k && j + k <= 9)
            Res += Rec(i - 1, j + k);

    return Dp[i][j] = Res;
}

ll Solve(int i, int j, ll r, ll Res = 0)
{
    Res = 10 * Res + j;

    if(i == 0)  return Res;

    for(int k = -1; k <= +1; k++)
    {
        if(0 <= j + k && j + k <= 9)
        {
            if(Rec(i - 1, j + k) >= r)
                return Solve(i - 1, j + k, r, Res);

            r -= Rec(i - 1, j + k);
        }
    }

    assert(0);
}

int main()
{
    memset(Dp, -1, sizeof(Dp));

    ll k;   cin >> k;

    for(int Len = 1; Len < N; Len++)
    {
        for(int j = 1; j <= 9; j++)
        {
            if(Rec(Len - 1, j) >= k)
                return cout << Solve(Len - 1, j, k) << endl, 0;

            k -= Rec(Len - 1, j);
        }
    }
}


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

#define FOR(i,b,e) for(int i=(b); i <= (e); ++i)
#define FORD(i,b,e) for(int i=(b); i >= (e); --i)
#define SIZE(c) (int) (c).size()
#define FORE(i,c) FOR(i,0,SIZE(c)-1)
#define FORDE(i,c) FORD(i,SIZE(c)-1,0)

#define pb push_back
#define mp make_pair
#define st first
#define nd second


using namespace std;

typedef long long ll;
typedef pair <int,int> pii;
typedef pair <ll,ll> pll;

typedef vector <int> VI;
typedef vector <bool> VB;
typedef vector <pii> VP;
typedef vector <ll> VL;
typedef vector <pll> VPL;

typedef vector <VI> VVI;
typedef vector <VL> VVL;
typedef vector <VB> VVB;
typedef vector <VP> VVP;

const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000000000000001LL;


/*************************************************************************/

int main() {
    ios_base::sync_with_stdio(0);
    
    string s;
    cin >> s;
    
    int ans = INF;
    
    for (char c = 'a'; c <= 'z'; c++) {
        string t = s + string(1, c);
        
        int cnt = 0;
        int here = 0;
        
        for (char d : t) {
            if (d == c) {
                here = max(here, cnt);
                cnt = 0;
            } else {
                cnt++;
            }
        }
        
        ans = min(ans, here);
    }
    
    cout << ans;

    return 0;
}

/*************************************************************************/


Measured memory_bytes: 764
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Scanner;
class Main{
	public static void main(String[] args)throws NumberFormatException, IOException{
//		System.out.println(" ");
		Scanner scan = new Scanner(System.in);
		String text = scan.next();
		LinkedList<Character> tikei = new LinkedList<Character>();
		LinkedList<Integer> underpos = new LinkedList<Integer>();
		ArrayList<Integer> leftpos = new ArrayList<Integer>();
		ArrayList<Integer> leftmenseki = new ArrayList<Integer>();
		ArrayList<Integer> mizuHyouji = new ArrayList<Integer>();
		int mizuAmount = 0;
		int allMizuArea = 0;
		int kyori = 0;
		int area= 0;


		for(int textpos=0; textpos<text.length(); textpos++){
			tikei.addLast(text.charAt(textpos));
		}
		//??????????????????????????§??°?????????
		for(int textpos=0; textpos<text.length(); textpos++){

//			?????????????????§?¨?????¨????????????????
			if(tikei.get(textpos) == '\\' ){
				underpos.addLast(textpos);
				leftpos.add(textpos);
				leftmenseki.add(0);
			}
			
//			?????????????????¢???????¨?????????????
			else if(tikei.get(textpos) == '/' ){
//					??????????????????=??????????±±?????´???
				if(underpos.size() == 0){
//						System.out.println("???????????????????????????????????????");
				}
				else{
//						?????±?????????????£?????????¢?????¬???
					kyori = textpos;
					int leftnaname = underpos.pollLast();
					kyori -= leftnaname;
					area = kyori ;
					int ser = leftpos.indexOf(leftnaname);
					leftmenseki.set(ser,area);
				}
			}
//			??´?????????????????????
			else if(tikei.get(textpos) == '_' ){
			}
		}
		int x=0;
		//
		for (int i=0;i<leftpos.size();i++){
			area = 0;
			if(leftmenseki.get(i) == 0){
			}
			else if (x <leftpos.size()){
				
					//?°´???????????????????????§??????
					while(true){
						if((leftmenseki.get(i))+(leftpos.get(i)) >= leftpos.get(x)){
//							System.out.println("?°´?????????????????¢???????¶????");
							area += leftmenseki.get(x);
							x++;
							if(x == leftpos.size()){
								break;
							}
						}
						else{
//							System.out.println("?°´??????????????????");
							break;
						}
					}
				
			}
//			?°´??????????????£?????´???
			if(area != 0.0){
				mizuAmount += 1;
				allMizuArea += area;
//				System.out.println("???????°´???????????¢?????? "+area);
				mizuHyouji.add(area);
			}
		}
		
		
		
//		System.out.println("????????° "+mizuAmount);
//		System.out.println("?????¢?????? "+allMizuArea);
		System.out.println(allMizuArea);
		System.out.print(mizuAmount);
		for(int i=0; i<mizuHyouji.size();i++){
			System.out.print(" "+mizuHyouji.get(i));
		}
		System.out.println("");
	}
}

Measured memory_bytes: 31336
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <functional>
#include <map>
#include <set>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long
#define PI 3.14159265359
#define INF 10e9

using namespace std;
using P = pair<int, int>;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

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

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

double a, b, x;
int main () {
  cin >> a >> b >> x;

  double cri = a * a * b / 2.0;

  if (x >= cri) {
    double y = 2 * x / (a * a) - b;
    double ans = std::atan((b-y)/a) * 180 / PI;
    printf("%.10f\n", ans);
  } else {
    double z = 2 * x / (a * b);
    double ans = std::atan(b/z) * 180 / PI;
    printf("%.10f\n", ans);
  }
}

Measured memory_bytes: 256
n = int(input())
sta = []
for i in range(n-1):
    c,s,f = map(int,input().split())
    sta.append([c,s,f])

for i in range(n-1):
    t = 0
    for j in range(i,n-1):
        if t <= sta[j][1]:
            t += sta[j][1]-t
        else:
            if not (t-sta[j][1])%sta[j][2]==0:
                t += sta[j][2]-(t-sta[j][1])%sta[j][2]
        t += sta[j][0]
    print(t)



print(0)

Measured memory_bytes: 3188
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int A, B, C;
    cin >> A >> B >> C;
    
    if(A == B && B != C)
    {
        cout << "Yes" << endl;
    }
    else if (A != B && B == C)
    {
        cout << "Yes" << endl;
    }
    else if ( A == C&& A != B)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    
}


Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;

int		main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	string s;
	cin >> s;
	int n = (s.size() - 1) / 2;
	string t = s;
	reverse(all(t));
	string s1 = s.substr(0, n);
	string s2 = s.substr(n + 1);
	if (s == t && s1 == s2)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

Measured memory_bytes: 256
@s=<>=~/./g;
$"='';
for$a(a..z){
	for$i(0..$#s){
		if($s[$i]eq$a){
			++$h{$_}for"@s[$i]",
			"@s[$i..$i+1]",
			"@s[$i..$i+2]",
			"@s[$i..$i+3]",
			"@s[$i..$i+4]"
		}
	}
}
print+(sort keys%h)[<>-1]


Measured memory_bytes: 3456
#include <bits/stdc++.h>
using namespace std;
using pii=pair<int,int>;
using ll=long long;

#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i=0; i<(int)(n); i++)

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

int main() {
	ll n,k;
	cin >> n >> k;
	ll t;
	ll ans;
	if(n % k == 0) {
		ans = 0;
	} 
	else if(n > k) {
		t = (n-k)/k;
		ans = n - t * k;
		ans -= k;
		if(k < 2*ans) ans = k-ans;
	}
	else if(n < k) {
		if(k < 2*n) ans = k-n;
		else ans = n;
	}
	cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,j,k) for(int i = (int)j;i <= (int)k;i ++)
#define debug(x) cerr<<#x<<":"<<x<<endl
const int maxn=(int)1e6+5;
map<string,int> mp;
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int q;cin>>q;while(q--){
        int op;cin>>op;
        if(op==3){
            string l,r;
            cin>>l>>r;
            auto ed=mp.upper_bound(r);
            for(auto it=mp.lower_bound(l);it!=ed;it++){
                cout<<it->first<<' '<<it->second<<endl;
            }
        }else{
            string s;cin>>s;
            if(op==0){
                int x;cin>>x;
                mp[s]=x;
            }
            if(op==1)cout<<(mp.count(s)?mp[s]:0)<<endl;
            if(op==2)mp.erase(s);
        }
        
    }
}
/* 
- insert(keykey, xx): Insert an element formed by a pair of keykey and xx to MM.
- get(keykey): Print the value with the specified keykey. Print 0 if there is no such element.
- delete(keykey): Delete the element with the specified keykey.
- dump(LL, RR): Print all elements formed by a pair of the key and the value such that the key is greater than or equal to LL and less than or equal to RR in lexicographic order..
 9
0 blue 4
0 red 1
0 white 5
1 red
1 blue
2 red
1 black
1 red
3 w z
 */



Measured memory_bytes: 25940
/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0008
  * Sum of 4 Integers
  */
object Main {
  def main(args: Array[String]): Unit = {
    Iterator.continually(io.StdIn.readLine()).takeWhile(_ != null).map(_.toInt)
      .map((n) => {
        (for (a <- 0 to 9; b <- 0 to 9; c <- 0 to 9; d <- 0 to 9 if a + b + c + d == n)
          yield {
            a + b + c + d
          })
          .count(_ == n)
      })
      .foreach(println)
  }
}

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

int main(){
    int n; cin >> n;
    vector<int> a(n,0);
    for(auto& v:a){
        cin >> v; v--;
    }
    int ans = 0;
    for(int i=0; i<n; i++){
        if(a[a[i]] == i){ans++;}
    }
    cout << ans / 2 << endl;
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
template <typename A, typename B>
string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string &s)
{
    return '"' + s + '"';
}

string to_string(const char *s)
{
    return to_string((string)s);
}

string to_string(bool b)
{
    return (b ? "true" : "false");
}

string to_string(vector<bool> v)
{
    bool first = true;
    string res = "{";
    for (int i = 0; i < static_cast<int>(v.size()); i++)
    {
        if (!first)
        {
            res += ", ";
        }
        first = false;
        res += to_string(v[i]);
    }
    res += "}";
    return res;
}

template <size_t N>
string to_string(bitset<N> v)
{
    string res = "";
    for (size_t i = 0; i < N; i++)
    {
        res += static_cast<char>('0' + v[i]);
    }
    return res;
}

template <typename A>
string to_string(A v)
{
    bool first = true;
    string res = "{";
    for (const auto &x : v)
    {
        if (!first)
        {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p)
{
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p)
{
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p)
{
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{
    cerr << " " << to_string(H);
    debug_out(T...);
}

typedef long long ll;
typedef pair<int, int> pii;
#define mp make_pair
#define fst first
#define snd second
#define fr(i, a, b) for(int i=a; i<b; i++)
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
    cin.tie(nullptr); ios::sync_with_stdio(false);
    int n; cin >> n;
    V<int> a(n), b(n); for(int i=0; i<n; i++) cin >> a[i];
    for(int i=0; i<n; i++) cin >> b[i];
    V<int> c(n); for(int i=1; i<=n; i++) c[i-1] = i;
    int cnt = 0;
    int r1=0, r2 = 0;
    do {
        int ok = 1;
        for(int i=0; i<n; i++) {
            if(a[i] != c[i]) {
                ok = 0; break;
            }
        }
        if(ok) {
            r1 = cnt;
        }
        ok = 1;
        for(int i=0; i<n; i++) {
            if(b[i] != c[i]) {
                ok = 0; break;
            }
        }
        if(ok) {
            r2 = cnt;
        }
        cnt++;

    } while(next_permutation(c.begin(), c.end()));
    cout << abs(r1 - r2 ) << endl;
}


Measured memory_bytes: 256