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

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef pair<ll,pll> plpll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<vector<int>> mat;

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()

const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const ll INF = 1<<30;
const ll mod = 1000000000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;

#define addm(X, Y) (X) = ((X) + ((Y) % mod) + mod) % mod


signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while (true) {
        int n;
        cin >> n;
        if (n == 0) break;
        bool day[n][n] = {};
        vector<vector<int>> fr(32);
        rep(i, n) day[i][i] = true;
        rep(i, n) {
            int f;
            cin >> f;
            rep(j, f) {
                int fre;
                cin >> fre;
                fr[fre].push_back(i);
            }
        }
        int ans = -1;
        rep2(i, 1, 32) {
            rep(j, fr[i].size()) {
                rep(k, fr[i].size()) {
                    if (j == k) continue;
                    rep(l, n) {
                        if (day[fr[i][k]][l]) {
                            day[fr[i][j]][l] = true;
                        }
                    }
                }
            }
            rep(j, n) {
                bool ok = true;
                rep(k, n) {
                    if (!day[j][k]) {
                        ok = false;
                    }
                }
                if (ok) {
                    ans = i;
                    break;
                }
            }
            /*
            rep(j, n){
                rep(k, n) cout << day[j][k] << " ";
                cout << endl;
            }
            cout << "--------" << endl;
            */
            if (ans != -1) break;
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 3236
#include <bits/stdc++.h>
using namespace std;
string arr[10003];
int A,B,ans,C;
int main()
{
    int N;
    scanf("%d",&N);
    for(int i=0; i<N; i++)
    {
        cin>>arr[i];
        for(int j=1;j<arr[i].size();j++)
        {
            string ret="";
            ret+=arr[i][j-1]; ret+=arr[i][j];
            if(ret=="AB") ans++;
        }
        if((arr[i][arr[i].size()-1]=='A') &&(arr[i][0]=='B')) C++;
        else if(arr[i][arr[i].size()-1]=='A') A++;
        else if(arr[i][0]=='B') B++;
    }
    if(C!=0) ans+=C-1;
    if(B!=0 && C!=0) ans+=1, B--;
    if(A!=0 && C!=0) ans+=1, A--;
    ans+=min(A,B);
    printf("%d",ans);
}


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

int main() {
  int n;
  cin>>n;
  int a[n][3];
  for(int i=0;i<n;i++){
    int k,l,m;
    cin>>k>>l>>m;
    a[i][0]=k;
    a[i][1]=l;
    a[i][2]=m;
  }
  long long dp[100010][3];
    dp[0][0]=0;
  dp[0][1]=0;
  dp[0][2]=0;
  for(int i=1;i<n+1;i++){
    dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i-1][0];
    dp[i][1]=max(dp[i-1][0],dp[i-1][2])+a[i-1][1];
    dp[i][2]=max(dp[i-1][1],dp[i-1][0])+a[i-1][2];
  }
  cout<<max(dp[n][0],max(dp[n][1],dp[n][2]))<<endl;
}


Measured memory_bytes: 3712
#include <iostream>
#include <vector>
using namespace std;
int main(void){
    // Your code here!
    int N, sum = 0;
    int l[10] = {};
    
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> l[i];
        sum += l[i];
    }
    
    for(int i = 0; i < N; i++)
        if(sum - l[i] <= l[i]){
            cout << "No" << endl;
            return 0;
        }
        
    cout << "Yes" << endl;
    
    return 0;        
}


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

long long N, cnt;
string S[1 << 18];
map<string, int> Map;

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> S[i];
		sort(S[i].begin(), S[i].end());
		cnt += Map[S[i]];
		Map[S[i]]++;
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 19456
#include <stdio.h>

int main(void){
	int a,b,c,k_1,k_2,k_3;

	k_1=0;
	k_2=0;
	k_3=0;

	scanf("%d %d %d",&a,&b,&c);
	if(a>b){
		k_1 = a;
		a = b;
		b = k_1;
	}
	if(b>c){
		k_2 = b;
		b = c;
		c = k_2;
	}
	if(a>b){
		k_3 = a;
		a = b;
		b = k_3;
	}
	printf("%d %d %d\n",a,b,c);

	return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <fstream>
#include<cstdio>
#include<iomanip>

#define REP(i, n) for(int i=0;i<n;i++)
#define REP2(i, s, n) for(int i=s;i<n;i++)
#define REP_1(i, n) for(int i=1;i<n+1;i++)
#define bitSearch(bit, n) for(int bit = 0; bit < (1 << N); bit++)
using namespace std;

void printAns(int a) { cout << a << endl; }

void yesno(bool a) { if (a)cout << "Yes" << endl; else cout << "No" << endl; }

void YESNO(bool a) { if (a)cout << "YES" << endl; else cout << "NO" << endl; }

typedef long long ll;
typedef unsigned long ul;
typedef long double ld;

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

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

ll INF = 10000000;
ll mod = 1000000007;//10^9+7


//番号ズレ注意！！
int main() {
    char c[5];
    bool type = true;
    REP(i, 4)cin >> c[i];
    REP(i, 3)if (c[i] == c[i + 1])type = false;
    if (type) { cout << "Good" << endl; } else { cout << "Bad" << endl; }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ", "; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ", "; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ", "; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << ", " << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << ": " << v.second << ", "; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << ": " << v.second << ", "; os << "}"; return os; }
template<typename T> void ndarray(vector<T> &vec, int len) { vec.resize(len); }
template<typename T, typename... Args> void ndarray(vector<T> &vec, int len, Args... args) { vec.resize(len); for (auto &v : vec) ndarray(v, args...); }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }
template<typename T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2> &l, const pair<T1, T2> &r) { return make_pair(l.first + r.first, l.second + r.second); }
template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2> &l, const pair<T1, T2> &r) { return make_pair(l.first - r.first, l.second - r.second); }
#define f first
#define s second
 
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int len, tickets;
    cin >> len >> tickets;
    vector<int> arr(len);
    long long ans = 0;
    for(int i = 0; i < len; i++) {
        cin >> arr[i];
        ans += arr[i];
    }
    if(len == 1) {
        cout << (int) (arr[0] / pow(2, tickets));
        return 0;
    }
    while(tickets > 0) {
        sort(arr.begin(), arr.end());
        int target = arr[len - 1] / 2;
        int i = len - 1;
        while(i >= 0 && arr[i] > target) {
            ans -= arr[i] - arr[i] / 2;
            arr[i] = arr[i] / 2;
            i--;
            tickets--;
            if(tickets == 0)
                break;
        }
    }
    cout << ans;
}

Measured memory_bytes: 3828
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979;
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
bool odd(const int &n) { return n & 1; }
bool even(const int &n) { return ~n & 1; }
template<typename T> int len(const T &v) { return v.size(); }
template<typename T = int> T in() { T x; cin >> x; return x; }
template<typename T = int> T in(T &&x) { T z(forward<T>(x)); cin >> z; return z; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &x : v) is >> x; return is; }
template<typename A, typename B> istream &operator>>(istream &is, pair<A, B> &p) { return is >> p.first >> p.second; }
template<typename T> ostream &operator<<(ostream &os, const vector<vector<T>> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : "\n"); return os; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : " "); return os; }
template<typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << p.first << ' ' << p.second; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
// clang-format on

main { cout << (int) log2(in() + 1) << endl; }



Measured memory_bytes: 3252
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        double p = 0;
        int a, c;
        for (int i = 1; i <= n; i++) {
        	a = i;
        	c = 0;
        	while (a < k) {
        		c++;
        		a *= 2;
        	}
        	p += Math.pow(0.5, c) / n;
        }
        System.out.println(p);
    }
    
}

Measured memory_bytes: 22608
N, K = map(int, input().split())

mod = 1000000007

ans = 0
for i in range(K, N+1+1):
    num_min = i*(i-1)//2
    num_max = i*(N+N-i+1)//2
#    print(num_min, num_max)
    ans += (num_max - num_min + 1)%mod
print(ans%mod)

Measured memory_bytes: 63572
import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int r = scn.nextInt(), c = scn.nextInt();
        showTable(createTable(r, c));
    }
    
    private static int[][] createTable(int r, int c) {
        int[][] tbl = new int[r + 1][c + 1];
        for(int i = 0; i < r; i++) {
            for(int j = 0; j < c; j++) {
                int v = scn.nextInt();
                tbl[i][j] += v;
                tbl[i][c] += v;
                tbl[r][j] += v;
                tbl[r][c] += v;
            }
        }
        return tbl;
    }
    
    private static void showTable(int[][] tbl) {
        for(int[] ary : tbl) {
            StringBuilder sb = new StringBuilder();
            for(int elm : ary) {
                sb.append(elm + " ");
            }
            System.out.println(sb.toString().trim());
        }
    }
}

Measured memory_bytes: 41684
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
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; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
// int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  int n;
  cin >> n;
  vector<ll>a(n);
  rep(i,n) cin >> a[i];
  ll ans = 0;
  vector<ll>num(100001);
  rep(i,n){
    ans+=a[i];
    num[a[i]]++;
  }
  int q;
  cin >> q;
  rep(i,q){
    ll b,c;
    cin >> b >> c;
    ll cnt = num[b];
    ans -= b*cnt;
    ans += c*cnt;
    num[b]=0;
    num[c]+=cnt;
    cout << ans << endl;
  }
    
  return 0;
}


Measured memory_bytes: 4780
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define REP(i, n) for (int i = 0; i < (int)n; ++i)
#define RREP(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define FOR(i, s, n) for (int i = s; i < (int)n; ++i)
#define RFOR(i, s, n) for (int i = (int)n - 1; i >= s; --i)
#define ALL(a) a.begin(), a.end()
#define IN(a, x, b) (a <= x && x < b)
template<class T>inline void out(T t){cout << t << "\n";}
template<class T,class... Ts>inline void out(T t,Ts... ts){cout << t << " ";out(ts...);}
template<class T>inline bool CHMIN(T&a,T b){if(a > b){a = b;return true;}return false;}
template<class T>inline bool CHMAX(T&a,T b){if(a < b){a = b;return true;}return false;}
constexpr int INF = 1e18;

#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)

void solve(){
	int N,A,B,C,D;
	cin>>N>>A>>B>>C>>D;
	unordered_map<int,int>mp;
	auto dfs = [&](auto&&f,int n) -> unsigned long long{
		if(n == 1)return D;
		if(n == 0)return 0;
		if(mp.count(n))return mp[n];
		unsigned long long ret = D * n;
		FOR(i,-2,2 + 1){
			int cost = abs(i) * D + A;
			int nn = n + i;
			if(nn % 2 == 0){
				if(nn <= 0 || nn / 2 >= n)continue;
				CHMIN(ret,f(f,nn / 2) + cost);
			}
		}
		FOR(i,-3,3 + 1){
			int cost = abs(i) * D + B;
			int nn = n + i;
			if(nn % 3 == 0){
				if(nn <= 0 || nn / 3 >= n)continue;
				CHMIN(ret,f(f,nn / 3) + cost);
			}
		}
		FOR(i,-5,5 + 1){
			int cost = abs(i) * D + C;
			int nn = n + i;
			if(nn % 5 == 0){
				if(nn <= 0 || nn / 5 >= n)continue;
				CHMIN(ret,f(f,nn / 5) + cost);
			}
		}
		return mp[n] = ret;
	};
	out(dfs(dfs,N));
}

signed main(){
	IOS();
	int Q = 1;
	cin >> Q;
	while(Q--)solve();
}

Measured memory_bytes: 4604
#include <bits/stdc++.h>
#define f first
#define s second
#define fore(i,a,b) for(int i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define all(s) begin(s), end(s)
#define _ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define sz(s) int(s.size())
#define ENDL '\n'
using namespace std;
typedef long double ld;
typedef long long lli;
typedef pair<lli,lli> ii;
typedef vector<int> vi;
typedef vector<lli> vl;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
#define deb(x) cout << #x": " << (x) << endl;

const int N = 3e3+5;
const lli INF = 1e18;
const lli MOD = 1e9+7;

vi m;
vi primes(1,2);
vector<vector<ld>>nk;
void sieve(){
	m = vi(N+1,0);
	for(int i = 4; i<N; i+=2)m[i]=1;
	for(int i = 3; i*i<=N; i+=2)if(!m[i])for(int j = i*i; j<N; j+=i)m[j]=1;
	for(int i = 3; i<N; i+=2)if(!m[i])primes.pb(i);
}

void pascal(){
	nk =vector<vector<ld>>(N,vector<ld>(N,0.0));
	fore(i,0,N)nk[i][0]=nk[i][i]=1.0;
	fore(i,1,N)fore(j,1,i)nk[i][j]=nk[i-1][j-1]+nk[i-1][j];
}

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

lli lcm(lli a, lli b){
	if(a<b)swap(a,b);
	lli c = gcd(a,b);
	a/=c;
	return a*b;
}

int popcount(lli x) { return __builtin_popcountll(x); }

lli poww(lli a, lli b){
	lli res =1;
	while(b){
		if(b&1) res = res * a;
		a = a*a;
		b/=2;
	}
	return res;
}

lli powm(lli a, lli b){
	lli res =1;
	while(b){
		if(b&1) res = (res * a)%MOD;
		a = (a*a)%MOD;
		b/=2;
	}
	return res;
}

bool isPrime(lli x){
	if(x==1)return 0;
	for(auto i:primes){
		if(i*i>x)return 1;
		if(x%i==0)return 0;
	}
	return 1;
}

lli SUM(lli a, lli b, lli mod=MOD){
	return (a+b+mod)%mod;
}

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

// ---- コーディングはここから！ ('-')7

void solve(){
	int n,k; cin>>n>>k;
	vvi v(n+1);
	fore(i,0,k){
		int a,b; cin>>a>>b;
		v[a].pb(b);
	}
	vi h(n+1,0);
	auto f=[&](auto f, int u)->void{
		for(auto i:v[u]){
			if(h[i])continue;
			f(f,i);
		}
		h[u]=1;
		for(auto i:v[u])h[u]=max(h[u],h[i]+1);
	};
	int mx=0;
	fore(i,0,n+1){
		if(h[i]==0)f(f,i);
		mx=max(mx,h[i]);
	}
	cout<<mx-1<<ENDL;
}

int main(){_
	//int t; cin>>t; while(t--)
	solve();
}


Measured memory_bytes: 13104
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define P pair<int,int>
#define mp make_pair
#define valid(x,y,h,w) (0<=x&&x<h&&0<=y&&y<w)
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }





int main() {
	int n, ma, mb;
	cin >> n >> ma >> mb;
	vector<int> a(n), b(n), c(n);
	rep(i, n) {
		cin >> a[i] >> b[i] >> c[i];
	}
	vector<vector<int>> x(4001, vector<int>(4001, -1));
	x[0][0] = 0;

	rep(k, n) {
		rrep(i, 4001) {
			rrep(j, 4001) {
				if (x[i][j] >= 0) {
					if (x[i + a[k]][j + b[k]] == -1) {
						x[i + a[k]][j + b[k]] = x[i][j] + c[k];
						
					}
					else {
						x[i + a[k]][j + b[k]] =
							min(x[i + a[k]][j + b[k]],
								x[i][j] + c[k]);
					}

					
				}
			}
		}
	}

	int i = 1;
	int ans = INF;
	while (ma*i <= 4000 && mb*i <= 4000) {
		if (x[ma*i][mb*i] >= 0) {
			ans = min(ans, x[ma*i][mb*i]);
		}

		i++;
	}
	if (ans == INF) {
		cout << -1 << endl;
	}
	else {
		cout << ans << endl;
	}
	return 0;
}



Measured memory_bytes: 62976
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		int N = scanner.nextInt();
		String list[] = new String[N];
		
		for(int n = 1; n <= N; n++){
			list[n-1] = scanner.next();
		}
		
		scanner.close();
		
		for(int n = 1; n <= N; n++){
			for(int m = 1; m <= N; m++){

				if(n != m && list[n-1].equals(list[m-1])){
					System.out.println("No");
					return;
				}
			}
		}
		
		for(int n = 1; n <= N-1; n++){
			String head = list[n].substring(0,1);
			String tail = list[n-1].substring(list[n-1].length()-1);
			
			if(!head.equals(tail)){
				System.out.println("No");
				return;
			}	
		}
		
		System.out.println("Yes");
	}
}


Measured memory_bytes: 23380
#include <bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    void solve() {
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        cout << (ll)max({a * c, a * d, b * c, b * d}); 
    }
    int main() {
        solve();
        return 0;
    }

Measured memory_bytes: 3604
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
using namespace std;

typedef pair<int, int> P;
#define rep(i, n) for (int i=0; i<(n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define INF 1145141919
#define MOD 1000000007

int N;
int A[100];
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  cin >> N;
  rep(i, N) cin >> A[i];
  cout << *max_element(A, A+N) - *min_element(A, A+N) << "\n";
  return 0;
}


Measured memory_bytes: 256
def cD():
    D = []
    for bc in BC:
        for i in range(bc[1]):
            D.append(bc[0])
            if len(D) > N:
                return D
    return D


N, M = map(int, input().split())
A = sorted(list(map(int, input().split())))
BC = []
for _ in range(M):
    b, c = map(int, input().split())
    BC.append([c, b])
BC.sort(reverse=True)
D = cD()
for i in range(min(len(A), len(D))):
    if A[i] < D[i]:
        A[i] = D[i]
    else:
        break
print(sum(A))


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

int main()
{
    int count = 0;
    string s, t;
    cin >> s >> t;
    
    
    
    for (int i=0; i<3; i++){
        if(s[i] == t[i]){
            count++;
        }
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream> 
#include<vector>
#include<algorithm>
#include<map>
#include<iomanip>
#include<set>
#include<queue>
#include<deque>
#include<iomanip>
#include<sstream>
#include<cmath>
#include<tuple>
#include<bitset>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
#define rrep(i,n) for(int i = n -1;i >= 0;i--)
#define ALL(obj) begin(obj), end(obj)
typedef long long int ll;
typedef long double ld;
const ll INF = pow(10,15);
int k, x, m, n, h, r, w; ll sum = 0,d = 0,c; string s;
const ll MOD= 1000000007;
const ld PI = acos(-1);
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
    std::fill((T*)array, (T*)(array + N), val);
} 
int main() {
    cin >> m;
    rep(i, m) {
        cin >> k >> c;
        sum += k * c; d += c;
    }d--; sum--;
    cout << d + sum / 9 << endl;
}

Measured memory_bytes: 256
A, B, C = list(map(int, input().split()))
ABC = [A, B, C]
ABC.sort()
A = ABC[0]
B = ABC[1]
C = ABC[2]
ans = 0

if (C-A) >= 2:
    ans += (C-A)//2
    A += 2*((C-A)//2)
if (C-B) >= 2:
    ans += (C-B)//2
    B += 2*((C-B)//2)
 
if A == B == C:
    print(ans)
elif A ==B:
    print(ans+1)
else:
    print(ans+2)

Measured memory_bytes: 3064
#include <stdio.h>

int main(){

    int n,x,i,j,k,l,count[1000]={0},c=0;
    
    for (l=0; ; l++)
    {
    scanf("%d %d",&n,&x);
        c++;
        if (n==0&&x==0)
        {
            break;
        }
    
    for (i=1; i<=n; i++)
    {
            for (j=1; j<=n; j++)
            {
                for (k=1; k<=n; k++)
                {
                    if (i+j+k==x)
                    {
                        if (i==j||i==k||j==i||j==k||k==i||k==j)
                        {
                            
                        }
                        else
                            count[l]=count[l]+1;
                    }
                }
            }
        }
    }
    
    for (i=0; i<c-1; i++)
    {
        count[i]=count[i]/6;
        printf("%d\n",count[i]);
    }
    
    return 0;

}

Measured memory_bytes: 604
#include <bits/stdc++.h>
#define int unsigned long long

using namespace std;

bool flag=true;

signed main() {
//	freopen("input.txt", "r", stdin);
	cin.tie(0);
	int n;cin>>n;
	
	int ans=1,ma=1e18;
	while(n--) {
		int x;
		cin>>x;
		if(x==0){
			puts("0");
			return 0;
		}
		if(ma%ans==0){
			if(ma/ans<x){
//				printf("%lld %lld\n",ma/ans,x);
//				puts("-1");
				flag=false;
//				return 0;
			}
		}else{
			if(ma/ans<x){
//				printf("%lld %lld %lld %lld\n",n,ans,ma/ans,x);
//				puts("-1");
				flag=false;
//				return 0;
			}
		}
		if(flag)ans*=x;
	}
	if(!flag)puts("-1");
	else printf("%lld\n",ans);
	return 0;
}


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

// 総数を1000000007（素数）で割った余り
const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int r;
    cin >> r;
    double ans = 2 * PI * r;
    printf("%.10f\n", ans);
    return 0;
}


Measured memory_bytes: 3764
// By Mohit Gupta
#include <bits/stdc++.h>
using namespace std;
#define printint(v) copy(begin(v), end(v), ostream_iterator<int>(cout," "))
#define printintv(s,e) copy(s,e, ostream_iterator<int>(cout," "))
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define clz(a) __builtin_clz(a) // count leading zeroes
#define ctz(a) __builtin_ctz(a) // count trailing zeroes
#define popc(a) __builtin_popcount(a) // count set bits (for ints only diff for ll)
//https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html for other in built
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define int long long
#define se second
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
typedef pair<int,int> p32; 
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
typedef map<int,int> m32;
#pragma GCC optimize ("-O2")
const int LIM = 5e5+5, MOD = 1e9+7;
int t,n,m,k,x,y;
 
 
int32_t main()
{
	IOS;
	cin>>n;
	ll x,d;
	cin>>x>>d;
	if(d==0){
		if(x==0)
			cout<<1<<ln;
		else
			cout<<n+1<<ln;
	}
	else{
		if(d<0){
			x=-1*x;
			d=-1*d;
		}
		vector<vector<pair<ll,ll> > > ranges;
		map<int,int> mymap;
		forn(k,n){
			ll L = (k+1)*x*1LL + 1LL*d*(((k+1)*1LL*k)/2);
			// dbg(L);
			ll R = L + 1LL*(n-k-1)*(k+1)*d;
			int f = (L%d + d)%d;
			// dbg(f);
			if(mymap.find(f)!=mymap.end())
				ranges[mymap[f]].pb({L,R});
			else{
				mymap[f]=ranges.size();
				vector<pair<int,int> > v;
				v.pb({L,R});
				ranges.pb(v);
			}
		}
		if(mymap.find(0)==mymap.end()){
			mymap[0]=ranges.size();
			vector<pair<int,int> > v;
			v.pb({0,0});
			ranges.pb(v);
		}
		else{
			ranges[mymap[0]].pb({0,0});
		}
		ll ans=0;
		forn(i,ranges.size()){
			if(!ranges[i].size())
				continue;
			//merge the vector for i
			// dbg(i);
			ll curr=-1e18;
			// dbg(curr);
			sort(ranges[i].begin(),ranges[i].end());
			for(auto rng: ranges[i]){
				ll L = rng.fi;
				ll R  = rng.se;
				// cout<<L<<" "<<R<<ln;
				if(L<=curr && curr<=R){
					ans+=(R-curr)/d;
					curr=R;
				}
				else if(curr<L){
					ans+=(R-L)/d + 1;
					curr=R;
				}				
			}
			// dbg(ans);
		}
		cout<<ans<<ln;
	}
}

Measured memory_bytes: 25004
class UnionFind():
    # 作りたい要素数nで初期化
    # 使用するインスタンス変数の初期化
    def __init__(self, n):
        self.n = n
        # root[x]<0ならそのノードが根かつその値が木の要素数
        # rootノードでその木の要素数を記録する
        self.root = [-1]*(n+1)
        # 木をくっつける時にアンバランスにならないように調整する
        self.rnk = [0]*(n+1)

    # ノードxのrootノードを見つける
    def Find_Root(self, x):
        if(self.root[x] < 0):
            return x
        else:
            # ここで代入しておくことで、後の繰り返しを避ける
            self.root[x] = self.Find_Root(self.root[x])
            return self.root[x]
    # 木の併合、入力は併合したい各ノード
    def Unite(self, x, y):
        # 入力ノードのrootノードを見つける
        x = self.Find_Root(x)
        y = self.Find_Root(y)
        # すでに同じ木に属していた場合
        if(x == y):
            return 
        # 違う木に属していた場合rnkを見てくっつける方を決める
        elif(self.rnk[x] > self.rnk[y]):
            self.root[x] += self.root[y]
            self.root[y] = x

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            # rnkが同じ（深さに差がない場合）は1増やす
            if(self.rnk[x] == self.rnk[y]):
                self.rnk[y] += 1
    # xとyが同じグループに属するか判断
    def isSameGroup(self, x, y):
        return self.Find_Root(x) == self.Find_Root(y)

    # ノードxが属する木のサイズを返す
    def Count(self, x):
        return -self.root[self.Find_Root(x)]



N,M=map(int,input().split())
island=UnionFind(N)
bridge=[list(map(int,input().split())) for i in range(M)]

ans=[0]*M
x=N*(N-1)//2

for i in range(M-1,-1,-1):
    ans[i]=x
    a,b=bridge[i][0],bridge[i][1]
    if not island.isSameGroup(a,b):
        x-=island.Count(a)*island.Count(b)
        island.Unite(a,b)

for i in range(M):
    print(ans[i])

Measured memory_bytes: 34268
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef vector<int> vi;
typedef vector<double> di;
typedef vector< vi > vvi;
typedef pair<int, int> pii;  // pair<int, int> に pii という別名を付ける
typedef long long ll;

int main(){
  double A, B, C, D;
  cin >> A >> B >> C >> D;
  double tk, ao;
  ao= ceil(A/D*1.0);
  tk = ceil(C/B*1.0);

//  cout << tk << ao;  
  if (ao < tk){
	  cout << "No" << endl;
  }
  else{
	  cout << "Yes" << endl;
  }

}


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

public class Main {
	public static void main(String[] args) {
		MyScanner sc = new MyScanner();
		out = new PrintWriter(new BufferedOutputStream(System.out));

		int a = sc.nextInt(), b = sc.nextInt();
		char[] s = sc.next().toCharArray();
		String ans = "Yes";
		if (s.length != a+b+1) {
			ans = "No";
		}else{
			for (int i = 0; i < s.length; i++) {
				char l = s[i];
				if (i==a) {
					if (l!='-') {
						ans = "No";
						break;
					}
				}else{
					if (l < '0' || l > '9') {
						ans = "No";
						break;
					}
				}
			}
		}
		out.println(ans);
		out.close();
	}

	//-----------http://codeforces.com/blog/entry/7018---------------------------------
	public static PrintWriter out;

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}
	//--------------------------------------------------------

}



Measured memory_bytes: 21332
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int n = in.nextInt();
		long[] a = getLongArr(in, n);
		long r = solve(a, n);
		System.out.println(r);
		in.close();
	}

	private static long solve(long[] a, int n) {
		long[][] dp = new long[n][n];
		long[] prefixSum = new long[n];
		prefixSum[0] = a[0];
		for (int i = 1; i < a.length; i++) {
			prefixSum[i] = prefixSum[i - 1] + a[i];
		}
		for (int i = 2; i <= n; i++) {
			for (int j = 0; j <= n - i; j++) {
				dp[j][j + i - 1] = Long.MAX_VALUE;
				for (int k = j; k < j + i - 1; k++) {
					dp[j][j + i - 1] = Math.min(dp[j][j + i - 1], dp[j][k] + dp[k + 1][j + i - 1]);
				}
				dp[j][j + i - 1] += prefixSum[j + i - 1];
				if (j > 0) {
					dp[j][j + i - 1] -= prefixSum[j - 1];
				}
			}
		}
		return dp[0][n - 1];
	}

	static String str(int[] a) {
		String[] str = new String[a.length];
		for (int i = 0; i < a.length; i++) {
			str[i] = a[i] + "";
		}
		return String.join(" ", str);
	}

	static long[] getLongArr(Scanner in, int size) {
		long[] arr = new long[size];
		for (int i = 0; i < size; i++) {
			arr[i] = in.nextLong();
		}
		return arr;
	}

	static char[] getCharArr(Scanner in, int size) {
		char[] arr = in.next().toCharArray();
		return arr;
	}

	static String[] getStringArr(Scanner in, int size) {
		String[] arr = new String[size];
		for (int i = 0; i < size; i++) {
			arr[i] = in.next();
		}
		return arr;
	}

	static Map<Integer, List<Integer>> getEdges(Scanner in, int size, boolean directed) {
		Map<Integer, List<Integer>> edges = new HashMap<>();
		for (int i = 0; i < size; i++) {
			int from = in.nextInt();
			int to = in.nextInt();
			if (!edges.containsKey(from)) {
				edges.put(from, new ArrayList<Integer>());
			}
			edges.get(from).add(to);
			if (!directed) {
				if (!edges.containsKey(to)) {
					edges.put(to, new ArrayList<Integer>());
				}
				edges.get(to).add(from);
			}

		}
		return edges;
	}
}


Measured memory_bytes: 24660
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
const long double PI = (acos(-1));
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int ctoi(char c)
{
    switch (c)
    {
    case '0':
        return 0;
    case '1':
        return 1;
    case '2':
        return 2;
    case '3':
        return 3;
    case '4':
        return 4;
    case '5':
        return 5;
    case '6':
        return 6;
    case '7':
        return 7;
    case '8':
        return 8;
    case '9':
        return 9;
    default:
        return 0;
    }
}
int main()
{
    string a, b;
    cin >> a >> b;
    string ab = a + b;
    int c = stoi(ab);
    for (int i = 0;;i++){
        if(c==i*i){
            cout << "Yes" << endl;
            break;
        }
        if(c<i*i){
            cout << "No" << endl;
            break;
        }
    }
}

Measured memory_bytes: 256
import math


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def dec(digits):
    answer = 0
    for d in digits:
        answer = (answer<<1) + d
    return answer

def bitcount(n):
    answer = 0
    while n != 0:
        answer += n&1
        n >>= 1
    return answer

def solve():
    N = read_int()
    F = []
    P = []
    for _ in range(N):
        F.append(dec(read_ints()))
    for _ in range(N):
        P.append(read_ints())
    max_profit = -math.inf
    for day in range(1, 1<<10):
        profit = 0
        for i in range(N):
            profit += P[i][bitcount(F[i]&day)]
        max_profit = max(max_profit, profit)
    return max_profit


if __name__ == '__main__':
    print(solve())


Measured memory_bytes: 74004
#include <iostream>
#include <cstdio>
#define ll long long
using namespace std;

inline char gc(){
	static char buf[100000],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x=0;char ch=gc();bool positive=1;
	for(;!isdigit(ch);ch=gc())if(ch=='-')positive=0;
	for(;isdigit(ch);ch=gc())x=x*10+ch-'0';
	return positive?x:-x;
}

inline void write(ll x){
	if(x<0)x=-x,putchar('-');
	if(x>9)write(x/10);putchar(x%10+'0');
}

inline void writeln(ll x){
	write(x);puts("");
}

inline ll pow(ll x,ll y){
	ll ans=1;
	while(y){
		if(y&1)ans=ans*x;
		x=x*x;
		y>>=1;
	}
	return ans;
}

ll a,b,c,k;

int main(){
	a=read();b=read();c=read();k=read();
	if(a>=b&&a>=c){
		a=pow(2,k)*a;
		writeln(a+b+c);
		return 0;
	}
	if(b>=a&&b>=c){
		b=pow(2,k)*b;
		writeln(a+b+c);
		return 0;
	}
	if(c>=a&&c>=b){
		c=pow(2,k)*c;
		writeln(a+b+c);
	}
	return 0;
}

Measured memory_bytes: 256
import sys,queue,math,copy,itertools,bisect,collections,heapq
LI = lambda : [int(x) for x in sys.stdin.readline().split()]

N,K = LI()
A = LI()

sa = list(itertools.accumulate([0]+A))
b = []
for i in range(N):
    for j in range(i+1,N+1):
        b.append(sa[j]-sa[i])
#b.sort(reverse=True)
max_b = max(b).bit_length()

mask = 0
for i in range(max_b-1,-1,-1):
    bit = 2**i
    cnt = 0
    for x in b:
        if x & mask == mask:
            cnt += (x & bit > 0)
    if cnt >= K:
        mask += bit
print (mask)

Measured memory_bytes: 67832
#include <iostream>
using namespace std;
unsigned int dist[100000];
int main(){
	int n,m,i,d;
	cin>>n>>m;
		for(i=0;i<n;i++){
			dist[i]=0;
		}
		for(i=1;i<n;i++){
			cin>>d;
			dist[i]=dist[i-1]+d;
		}
		unsigned long long sum=0;
		int p=0;
		for(i=0;i<m;i++){
			cin>>d;
			sum+=(d>0)?(dist[p+d]-dist[p]):(dist[p]-dist[p+d]);
			p+=d;
		}
		cout<<(sum%100000)<<endl;
	return 0;
}

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

int main(){
  float X,Y;
  cin >> X >> Y;
  float a,b;
  a=(4*X-Y)/2;
  b=(Y-2*X)/2;
  if(ceil(a) == floor(a) && ceil(b) == floor(b) && a>=0 && b>=0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3700
#include <bits/stdc++.h>
using namespace std;
const long INF=1000000000000;

//関数



int main() {
    
    
    //入力
    long N,K;
    cin>>N>>K;
    vector<pair<long,long>> ins(0);
    for(int i=0;i<N;i++){
        long a,b;
        cin>>a>>b;
        
        ins.emplace_back(a,b);
    }
    
    //計算
    sort(ins.begin(),ins.end());
    
    //出力
    for(int i=0;i<N;i++){
        K-=ins.at(i).second;
        if(K<=0){
            cout<<ins.at(i).first<<endl;
            return 0;
        }
    }
}


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

int main()
{
    char t;
    cin >> t;
    if (t == 'A')
        cout << 'T' << endl;
    if (t == 'T')
        cout << 'A' << endl;
    if (t == 'C')
        cout << 'G' << endl;
    if (t == 'G')
        cout << 'C' << endl;
    return 0;
}


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


int main(){

  string a, b;
  cin>>a>>b;
  int cnt = 0;
  for(int i=0;i<a.length();i++){
    if(a[i]!=b[i]){
      cnt++;
    }
  }

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

Measured memory_bytes: 3888
#include <iostream>
#include <cmath>
#include <climits>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string.h>
#include <iomanip>
#include <ctype.h>

#define ll          long long int
#define ull         unsigned long long int
#define pb          push_back
#define pii         pair<int,int>
#define F           first
#define S           second
#define vi          vector<int>
#define vli          vector<ll>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define M_PI        3.14159265358979323846
#define mp          make_pair
#define sz(x)       (int)x.size()
//#define hell        1000000007
#define matrix      vector<vector<ll>>
#define forn(i,a,b)  for(int i=a;i<b;i++)
#define eps 0.0000000001
#define all(a)      (a).begin(),(a).end()
const long long INF = (long long) 1e7+1;
const long long mod = (long long) 998244353 ;
const long long hell = (long long) 1000000007;

using namespace std;
#include <stdio.h>

ll power(ll x,ll y)
{
  ll res=1;
  while(y>0){
    if(y%2) res=(x%hell*res%hell)%hell;
    x=(x%hell*x%hell)%hell;
    y=y/2;
  }
  return res;
}

ll modinv(ll x){
  return power(x,hell-2);
}

void solve();


void fastIO() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

int main(){
   fastIO();
    solve();
}
//void sieve();
ll pw(ll k,ll x);
ll gcd(ll x,ll y);

/*
  For freq or prime factors

for(auto pri:prime){
  while(k%pri==0){
    pcnt[pri]++;
    k/=pri;
  }
}*/


void solve(){
  int test;
  //cin>>test;
  test=1;
  
  while(test--){
        set<int> st;
        for(int i=0;i<3;i++)
        {
            int x;
            cin>>x;
            st.insert(x);
        }
        if(st.size()==2)
        cout<<"Yes\n";
        else
        cout<<"No\n";
  }         
}    

    




///Before submit=>
///    *check for integer overflow,array bounds
///    *check for n=1

ll gcd(ll a,ll b)
{
    while( b != 0)
	{
		ll  t = b;
		b= a %t;
		a = t;
	}
	return a;
}


ll pw(ll k,ll x){
  if(x==0)
  return 1;
  if(x&1)
  return ((pw(k,x-1))*k);
  else
  return ((pw(k,x/2))*(pw(k,x/2)));
}





Measured memory_bytes: 256
N,K=map(int,input().split())
A=[list(map(int,input().split())) for _ in range(N)]
B=[0]*(10**5+1)
for i in range(N):
  B[A[i][0]]+=A[i][1]

x=0
for i in range(10**5+1):
  x+=B[i]
  if x>=K:
    print(i)
    exit()

Measured memory_bytes: 30160
from collections import Counter
n = int(input())
v = list(map(int, input().split()))
a = Counter(v[::2]).most_common()
b = Counter(v[1::2]).most_common()
if len(a) ==1:
  a.append([0,0])
if len(b) == 1:
  b.append([0,0])
if a[0][0] == b[0][0]:
  if a[1][1]>b[1][1]:
    print(n-a[1][1] - b[0][1])
  else:
    print(n-a[0][1]-b[1][1])
else:
  print(n-a[0][1]-b[0][1])

Measured memory_bytes: 20692
import java.util.*;

public class Main {
	
	
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(),b=sc.nextInt();
		int ans=b;
		
		if(a<13) {
			ans =ans/2;
		}
		if(a<6) {
			ans = 0;
		}
		
		System.out.println(ans);
		
	}

}


Measured memory_bytes: 23892
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int a[31]={},b;
  for(int i=0; i<28; i++) {
      cin >> b;
      a[b]=1;
  }
  for(int i=1; i<31; i++) {
      if(a[i]==0) {
          cout << i << endl;
      }
  }
  return 0;
}


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

using namespace std;
long long int n;
vector <vector<long long int>> A(100000);
long long int dpdp[3][3][3][100000];
long long int dp(long long int,long long int,long long int,long long int);

long long int dp(long long int x,long long int y,long long int z,long long int p)
{long long int ans,xx,yy;
    if(p==n)
        return(0);

        if(dpdp[y][z][x][p+1]!=-1)
            xx=dpdp[y][z][x][p+1];
        else
            {xx=dp(y,z,x,p+1);
             dpdp[y][z][x][p+1]=xx;}

        if(dpdp[x][z][y][p+1]!=-1)
            yy=dpdp[x][z][y][p+1];
        else
            {yy=dp(x,z,y,p+1);
             dpdp[x][z][y][p+1]=yy;}

        ans=max(A[p][x]+xx,A[p][y]+yy);
        return(ans);
}

int main()
{
memset(dpdp,-1,sizeof(dpdp));
    long long int i,j,x,ans;
    cin>>n;
    A.resize(n);
    for(i=0;i<n;i++)
    {
        for(j=0;j<3;j++)
        {
            cin>>x;
            A[i].push_back(x);
        }
    }
    ans=max(A[0][0]+dp(1,2,0,1),A[0][1]+dp(0,2,1,1));
    ans=max(ans,A[0][2]+dp(0,1,2,1));
    cout<<ans;

    return(0);
}


Measured memory_bytes: 36224
#include<stdio.h> 

const int INF = 1 << 29;

int min(a,b){
    if(a<b) return a;
    return b;
    }
int main()
{
	int n;
	scanf("%d", &n);
    
	int left[100], right[100];
	int m[100][100];
    int i,j,l,k;

    for( i = 0; i < n; i++)
		for( j = 0; j < n; j++)
			m[i][j] = INF;

	for( i = 0; i < n; i++)
        {
            scanf("%d%d", left + i, right + i);
		m[i][i] = 0;
        }
    
	for( l = 1; l < n; l++)
        {
            for( i = 0; i < n - l; i++)
                {
                     j = i + l;
                    for( k = i; k < j; k++)
                        {
                            m[i][j] = min(m[i][j], m[i][k] + m[k + 1][j] + left[i] * right[k] * right[j]);
                        }
                }
        }
    
	printf("%d\n", m[0][n - 1]);	
return 0;
}

Measured memory_bytes: 636
const arr = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];

function Main(input) {
  const inputs = input.split('\n')
    .filter(v => v);
  const i = arr.indexOf(inputs[0]);
  console.log((7 - i) + '\n');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21064
import java.io.File;
import java.io.FileInputStream;
import java.util.Scanner;
import java.util.Map.Entry;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.NoSuchElementException;

public class Main {
	
	public static void main(String[] args) throws IOException {
		FastScanner sc = new FastScanner(System.in);
		
		System.out.println("" + sc.next().charAt(0) + sc.next().charAt(0) + sc.next().charAt(0));
	}
}

class FastScanner {
    private InputStream in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    public FastScanner(InputStream in) {
		this.in = in;
	}
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() {
    	if (hasNextByte()) return buffer[ptr++];
    	else return -1;
    }
    private static boolean isPrintableChar(int c){
    	return 33 <= c && c <= 126;
    }
    public boolean hasNext() {
    	while(hasNextByte() && !isPrintableChar(buffer[ptr]))
    		ptr++; return hasNextByte();
    }
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() {
    	return Double.parseDouble(next());
    }
}

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

using namespace std;

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

	int a;
	int b;
	int k;
	cin >> a >> b >> k;
	int i = 0;
	int divisor = 1;
	vector<int> div;

	while (divisor <= a and divisor <= b)
	{
		if (a % divisor == 0 and b % divisor == 0)
		{
			div.push_back(divisor);
			++i;
		}
		++divisor;
	}

	cout << div[div.size() - k] << endl;

	return 0;
}

Measured memory_bytes: 256