akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define pb push_back
#define mod 1000000007
#define infi 1900000000
#define infl 1100000000000000000
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
#define csp << " " <<
#define outset(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T> using ve = vector<T>;
template<typename T> using pq2 = priority_queue<T>;
template<typename T> using pq1 = priority_queue<T,vector<T>,greater<T>>;




int main()
{
    string S;
    cin >> S;
    int a = 0;
    rep(i,S.length()){
        if(S[i] == 'o') a++;
    }
    if(15-int(S.length())+a >= 8) cout << "YES" << endl;
    else cout << "NO" << endl;

    
    
    
    

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <map>
#include <queue>
#include <functional>
using namespace std;

typedef pair<double, int> Pdi;
typedef pair<int, int> Pii;
typedef pair<double, Pii> S;

double dist(Pdi p1, Pdi p2) {
	p1.first -= p2.first;
	p1.second -= p2.second;
	return sqrt(p1.first * p1.first + p1.second * p1.second);
}

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

	int n;
	while(cin >> n, n) {
		vector<Pii> point(n);
		vector<int> ys;
		for(int i = 0; i < n; i++) {
			cin >> point[i].first >> point[i].second;
			ys.push_back(point[i].second);
		}
		sort(ys.begin(), ys.end());
		ys.erase(unique(ys.begin(), ys.end()), ys.end());

		vector<Pdi> ps;
		for(int i = 0; i < n - 1; i++) {
			int x1 = point[i].first, y1 = point[i].second;
			int x2 = point[i + 1].first, y2 = point[i + 1].second;
			if(i == 0) ps.push_back(Pdi(x1, y1));
			ps.push_back(Pdi(x2, y2));
			double a = double(y2 - y1) / (x2 - x1), b = y1 - a * x1;
			for(int y : ys) {
				double x = (y - b) / a;
				if(x1 < x && x < x2) ps.push_back(Pdi(x, y));
			}
		}
		sort(ps.begin(), ps.end());
		int P = ps.size();

		map<Pii, double> m;
		priority_queue<S, vector<S>, greater<S> > q;
		S s = S(0, Pii(0, P - 1));
		q.push(s);
		m[s.second] = 0;
		while(q.size()) {
			s = q.top();
			q.pop();
			double d = s.first;
			Pdi p1 = ps[s.second.first];
			Pdi p2 = ps[s.second.second];
			for(int i = -1; i <= 1; i++) {
				for(int j = -1; j <= 1; j++) {
					int ni = s.second.first + i, nj = s.second.second + j;
					if(ni < 0 || P <= ni) continue;
					if(nj < 0 || P <= nj) continue;
					if(ps[ni].second != ps[nj].second) continue;
					double nd = d + dist(p1, ps[ni]) + dist(p2, ps[nj]);
					S ns = S(nd, Pii(ni, nj));
					if(m.count(ns.second) == 0 || m[ns.second] > nd) {
						m[ns.second] = nd;
						if(ni != nj) q.push(ns);
					}
				}
			}
		}

		double ans = 1e9;
		for(int i = 0; i < P; i++) {
			if(m.count(Pii(i, i))) {
				ans = min(ans, m[Pii(i, i)]);
			}
		}
		cout << fixed << setprecision(10) << ans << endl;
	}
}

Measured memory_bytes: 8808
//17
#include<iostream>
#include<algorithm>

using namespace std;

int dx[4],dy[4];

int dfs(bool (*g)[4]){
  int e=find(g[0],g[4],false)-g[0];
  if(e==16)return 1;
  int y=e/4,x=e%4;
  g[y][x]=true;
  int r=0;
  for(int i=0;i<4;i++){
    int ny=y+dy[i];
    int nx=x+dx[i];
    if(0<=min(ny,nx)&&max(ny,nx)<4&&g[ny][nx]==false){
      g[ny][nx]=true;
      r+=dfs(g);
      g[ny][nx]=false;
    }
  }
  g[y][x]=false;
  return r;
}

int main(){
  for(;;){
    for(int i=0;i<4;i++){
      cin>>dx[i]>>dy[i];
      if(dx[i]>4)return 0;
    }
    bool g[4][4]={{}};
    cout<<dfs(g)<<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main(void){
    int a;
    while(cin>>a){
        if(a==-1)break;
        double q = (double)a;
        double x = q/2;
        while(abs(x*x*x-q)>=0.00001*q){
            double nx = x-(x*x*x-q)/(3*x*x);
            x = nx;
        }
        printf("%.6lf\n",x);
    }
    return 0;
}

Measured memory_bytes: 1192
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<string> VS;
typedef vector< vector<int> > VVI;
typedef vector< vector<ll> > VVL;
typedef pair<int,int> PII;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
#define ub upper_bound
#define lb lower_bound

int main(){
  int N,K;
  cin>>N>>K;
  VL A(N);
  rep(i,N) cin>>A[i];
  VL Y;
  rep(i,N){
    ll tmp=0;
    rep(j,N-i){
      tmp+=A[i+j];
      Y.pb(tmp);
    }
  }
  ll ans=0;
  rep(i,40){
    ll X=1ll<<(39-i);
    int cnt=0;
    rep(j,Y.size()){
      if(((ans+X)&Y[j])==(ans+X)) cnt++;
    }
    if(cnt>=K) ans+=X;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 6260
//Bouquet problem

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define sd second
#define ft first
#define ios                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);

const int p = 1e9 + 7;

// Fast Exponentiation

int fast_pow(int a, int n, int p)
{
    int res = 1;
    a %= p;
    if (a == 0)
        return 0;
    while (n > 0)
    {
        if (n & 1)
            res = (res * a) % p;
        n >>= 1;
        a = (a * a) % p;
    }
    return res;
}

// Modular Inverse

int modInverse(int a, int p)
{
    return fast_pow(a, p - 2, p);
}

// Fermat's Little Method ncr calculation

int ncrfermat(int n, int r, int p)
{
    if (r == 0)
        return 1;

    if (r > (n - r))
        r = n - r;

    int x = 1, y = 1;

    for (int i = 0; i < r; i++)
    {
        x = (x * (n - i)) % p;
        y = (y * (i + 1)) % p;
    }
    return (x * (modInverse(y, p) % p)) % p;
}

int32_t main()
{
    ios;
    int n, a, b;
    cin >> n >> a >> b;
    int sum = fast_pow(2, n, p) - 1;
    sum = (sum - (ncrfermat(n, a, p) + ncrfermat(n, b, p))) % p;
    cout << (sum + p) % p << endl;
    return 0;
}


Measured memory_bytes: 3656
//EatingSymbolsEasy2.java
import java.util.Scanner;
class Main
{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
        String s=sc.next();
        
        int ans=0;
        for(int i=0; i<4; i++){
            if(s.charAt(i)=='+'){
                ans++;
            }
            else{
                ans--;
            }
        }

        System.out.println(ans);
        sc.close();
    }
}

Measured memory_bytes: 23764
function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  var S = input[1];
  var ans =0;
  for(var i =0;i<S.length-2;i++){
    if(S.substr(i,3)=="ABC"){
      ans++;
    }
  }

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 20296
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define in insert
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
int main(){
    ll n;
    cin >> n;
    cout << n*(n-1)/2;

}   

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

ans = 0
for i in range(n):
    if A[i] % 2 == 1:
        continue

    while A[i] > 1:
        if A[i] % 2 == 0:
            A[i] = A[i] // 2
            ans += 1
        else:
            break

print(ans)


Measured memory_bytes: 4148
#include <sstream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cassert>
#include <ctime>
#include <map>
#include <math.h>
#include <cstdio>
#include <set>
#include <deque>
#include <memory.h>
#include <queue>

#pragma comment(linker, "/STACK:64000000")
typedef long long ll;

using namespace std;

const int MAXN = 1 << 18;
const int MOD = 1; // 1000 * 1000 * 1000 + 7;
const int INF = 2e9;
const double PI = acos(-1.0);

int main() {
#ifdef _MSC_VER
	freopen("input.txt", "r", stdin);
#endif

	int n, k;
	while (cin >> n >> k) {
		vector<int> a(n);
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}

		vector<ll> suf(n + 1);
		suf[n] = 0;
		for (int i = n - 1; i >= 0; i--) {
			suf[i] = suf[i + 1] + max(0, a[i]);
		}

		ll ans = 0;

		ll pref = 0;
		ll csum = 0;
		for (int i = 0; i < k; i++) csum += a[i];
		for (int i = 0; i + k <= n; i++) {
			ans = max(ans, pref + suf[i + k] + max(0LL, csum));
			csum -= a[i];
			if (i + k < n) csum += a[i + k];
			pref += max(0, a[i]);
		}
		cout << ans << endl;
	}

	return 0;
}

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;

const int mod = 1000000007;

struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) {}

    void init(int n) { par.assign(n, -1); }

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

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

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

int main() {
    int N, M;
    cin >> N >> M;

    UnionFind uf(N);
    int A, B;
    rep(i, M) {
        cin >> A >> B;
        A--, B--;
        uf.merge(A, B);
    }
    int ans = 1;
    rep(i, N) chmax(ans, uf.size(i));
    cout << ans << endl;
}


Measured memory_bytes: 4020
#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<tuple>
#include<utility>
#define rep(i,n) for(ll i=0; i<n; i++)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define mod 1000000007
using ll = long long;
using namespace std;

int main(){
  int a,b;  cin >> a >> b;
  int ans = 0;
  if(b < a){
    ans += a;
    a--;
  }else{
    ans += b;
    b--;
  }

  if(b < a){
    ans += a;
  }else{
    ans += b;
  }
  cout << ans;
  return 0;
}


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

//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;

void setfspattern_core(int floor,int number,int degree){
  if(floor==degree){
    fspattern.at(fspcnt) = fspattern_draft;
    fspcnt++;
  }else{
    rep(i,number){
      fspattern_draft.at(floor) = i;
      setfspattern_core(floor+1,number,degree);
    }
  }
}

void setfspattern(int number,int degree){
  int64_t array_num = 1;
  rep(i,degree){
    array_num *= number;
  }
  fspattern = vector<vector<int>>(array_num,vector<int>(degree));
  fspattern_draft = vector<int>(degree);
  setfspattern_core(0,number,degree);
}

//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);

/*void setmodfact(){
  for(int i=0;i<factnum;i++){
    if(i == 0){
      modfact.at(i) = 1;
    }else{
      modfact.at(i) = (modfact.at(i-1)*i)%univMod;
    }
  }
}

int64_t calcmodpower(int64_t a,int64_t n){
  int64_t res = 1;
  while(n != 0){
    if(n & 1){
      res = (res * a) % univMod;
    }
    a = (a*a) % univMod;
    n = n >> 1;
  }
  return res;
}

int64_t calcinverse(int64_t n){
	return calcmodpower(n,univMod-2);
}

void setmodinvfact(){
  for(int i=0;i<factnum;i++){
    if(i==0){
      modinvfact.at(i) = 1;
    }else{
      modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
    }
  }
}

int64_t calcmodcomb(int64_t n,int64_t r){
  return (((modfact.at(n)*modinvfact.at(r))%univMod)*modinvfact.at(n-r))%univMod;
}

int64_t calcmodpositive(int64_t n){
  return (n + ((abs(n)+univMod-1)/univMod)*univMod)%univMod;
}
  
    */


/*
int64_t calcGCD(int64_t a,int64_t b){
	int64_t p = a;
	int64_t q = b;
	int64_t c = a%b;
	while(c != 0){
		p = q;
		q = c;
		c = p%q;
	}
	return q;
}
*/

int main(){
  int a,b;
  cin >> a >> b;
  if(a >= 13){
    cout << b << endl;
  }else if(6 <= a && a <= 12){
    cout << b/2 << endl;
  }else{
    cout << 0 << endl;
  }
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<sstream>
#include<utility>
#include<map>
#include<ctime>
#include<cstdio>
#include<cassert>
#include<functional>




using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;
typedef pair<double, double> pdd;

#define show(x) cerr << x
#define debug(x) show(#x << ": " << (x) << endl)

const long double PI = 3.14159265358979323846;
const long double eps = 1e-5;
const int INF = numeric_limits<int>::max();
const ll LINF = numeric_limits<ll>::max();
const ll mod = 1000 * 1000 * 1000 + 7;

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

void solve() {
    ll n, m;
    cin >> n >> m;
    string s, t;
    cin >> s >> t;
    ll d = gcd(m, n);
    ll m1 = m / d, n1 = n / d;
    for (int i = 0, j = 0; i < n; i += n1, j += m1) {
        if (s[i] != t[j]) {
            cout << -1 << endl;
            return;
        }

    }
    
    cout << n / gcd(m, n) * m << endl;
    
}

//#define LOCAL

int main() {
    ios_base::sync_with_stdio(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    solve();


#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif	
    return 0;
}

Measured memory_bytes: 764
N, S = map(int,input().split())
A = list(map(int,input().split()))
mod = 998244353
dp = [[0 for j in range(S + 1)] for i in range(N + 1)]
dp[0][0] = 1
for i in range(N) : 
    for j in range(S + 1) : 
        dp[i + 1][j] += 2 * dp[i][j]
        dp[i + 1][j] %= mod 
        if j + A[i] <= S : 
            dp[i + 1][j + A[i]] += dp[i][j]
            dp[i + 1][j + A[i]] %= mod
print(dp[N][S])

Measured memory_bytes: 147424
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
#define Inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
char s[110];
char ans[100];
char ans1[110];

int main()
{
    while(~scanf("%s",s))
    {
        int len=strlen(s);
        int k=0,q=0;
        for(int i=0; i<len; i++)
        {
            if(s[i]=='0')
                ans[k++]='0';
            else if(s[i]=='1')
                ans[k++]='1';
            else
            {
                if(k)
                    k--;
            }
        }
        for(int i=0;i<k;i++)
            printf("%c",ans[i]);

        printf("\n");
    }
    return 0;
}


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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define UB upper_bound
#define LB lower_bound
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

LL n, s;
vector<LL> vec;

bool f(LL x) {
	LL nn = n, v = 0;
	while(nn) { v += nn % x; nn /= x; }
	return (v == s);
}

LL solve() {
	if(n < s) { return -1; }
	
	incII(i, 1, 320000) {
		if((n - s) % i == 0) {
			LL j = (n - s) / i;
			vec.PB(i + 1);
			if(i >= j) { break; }
			vec.PB(j + 1);
		}
	}
	vec.PB(n + 1);
	sort(ALL(vec));
	
	LL ans = -1;
	inc(i, vec.size()) {
		if(f(vec[i])) { ans = vec[i]; break; }
	}
	
	return ans;
}

int main() {
	cin >> n >> s;
	
	cout << solve() << endl;
	
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<map>
using namespace std;
#define int long long
#define rep(i,n) for(int i = 0; i < n; i++)
#define YN(f) (f?"YES":"NO")
#define yn(f) (f?"Yes":"No")	
#define INF 123456789123456
#define MOD (int)(1e9+7)
#define MAX_N 1
#define MAX_V 1



signed main(){
	int N, a, count = 0;
	map<int,int> s;
	
	cin>>N;
	
	rep(i,N){
		cin>>a;
		s[a]++;
		if(s[a]%2==1)count++;
		else count--;
	}
	
	cout<<count<<endl;
	
	return 0;
}

Measured memory_bytes: 6528
use v5.18; # strict say state
use warnings;
use List::Util qw(reduce first max min sum0);

chomp (my ($n, $x) = split / /, <STDIN>);
chomp (my @a = split / /, <STDIN>);
@a = sort { $a <=> $b } @a;
my ($sum, $cnt) = (0, 0);
for my $i (0..$n-1) {
  $sum += $a[$i];
  $cnt++;
  last if $sum >= $x;
}
$cnt-- if $sum != $x;
say $cnt;

Measured memory_bytes: 768
function Main(input) {
    input = input.split(" ");
    var k = input[0];
    var x = input[1];

    if (500*k >= x) {
        console.log("Yes");
    } else {
        console.log("No");
    }
  }
   
  Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 22336
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1)
#define IOS ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
#define ff first
#define ss second
#define pb push_back
#define debug(val) cerr << "The value of " << #val << " is = " << val << '\n';
typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9 + 7;
const ll inf = 0x3f3f3f3f;
const ll mininf = -922337203685477;
const ll nax = 0;
unordered_map<int, int>color;
int sabeb=0;

int main(){
	IOS
	int n;
	cin >> n;
	while(n--){
		int x;
		cin >> x;
		if(x<400) color[1]=1;
		else if(x<800) color[2]=1;
		else if(x<1200) color[3]=1;
		else if(x<1600) color[4]=1;
		else if(x<2000) color[5]=1;
		else if(x<2400) color[6]=1;
		else if(x<2800) color[7]=1;
		else if(x<3200) color[8]=1;
		else sabeb++;
	}
	int mins=0;
	for(int i=1;i<=8;i++){
		mins+=color[i];
	}
	cout << max(mins, 1) << ' ' << mins+sabeb << '\n';
}


Measured memory_bytes: 3604
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;
typedef long long ll;

vector<ll>h;

int main(){

	int N;
	ll A,B;

	scanf("%d %lld %lld",&N,&A,&B);

	int i;

	for(i=0;i<N;i++){
		ll hi;
		scanf("%lld",&hi);
		h.push_back(hi);
	}

	ll l,r,mid;

	l=0;
	r=1000000000;

	while(l<r){

		ll sum=0;

		mid=(l+r)/2;

		for(i=0;i<N;i++){
			if(h[i]-(mid*B)>0){
				if((h[i]-(mid*B))%(A-B)==0){
					sum+=(h[i]-(mid*B))/(A-B);
				}
				else{
					sum+=((h[i]-(mid*B))/(A-B))+1;
				}
			}
		}
		if(sum<=mid){
			r=mid;
		}
		else{
			l=mid+1;
		}
	}
	printf("%lld\n",l);
	return 0;
}

Measured memory_bytes: 1400
# coding: utf-8
# Your code here!
import math

num = int(input())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

result = 0
for i in range(num):
    result += abs(y[i]-x[i])
print(result)

result = 0
for i in range(num):
    result += abs(y[i] - x[i]) ** 2
result = math.sqrt(result)
print(result)

result = 0
for i in range(num):
    result += abs(y[i] - x[i]) ** 3
result = math.pow(result,1.0/3.0)
print(result)

result = 0
for i in range(num):
    if i == 0:
        result = abs(y[i] - x[i])
    else:
        if abs(y[i] - x[i]) > result:
            result = abs(y[i] - x[i])
print(result)



Measured memory_bytes: 5704
#include<bits/stdc++.h>
using namespace std;
void pre(){}
void solve(){
    long long int n,k,c;cin>>n>>k>>c;
    string s;cin>>s;
    bool flag[n];
    for(long long int i=0;i<n;i++){
        if(s[i]=='o'){
            flag[i]=1;
        }else{
            flag[i]=0;
        }
    }
    set<long long int>greed,breed;
    long long int rem = 0;
    for(long long int i=0;i<n;i++){
        if(rem>0){
            rem--;
            continue;
        }
        if(flag[i]){
            greed.insert(i);
            rem=c;
        }
    }
    rem = c;
    for(long long int i = n-1;i>=0;i--){
        if(rem<c){
            rem++;
            continue;
        }
        if(flag[i]){
            breed.insert(i);
            rem=0;
        }
    }
    if(greed.size()!=k && breed.size()!=k){
        return;
    }
    for(auto i:greed){
        if(breed.find(i)!=breed.end()){
            cout<<i+1<<"\n";
        }
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    pre();
    long long int num = 1;
    //cin>>num;
    for(long long int i=0;i<num;i++){
       	solve();
    }   
}


Measured memory_bytes: 20628
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <math.h>
using namespace std;

int main() {
	uint64_t A, B;
	cin >> A >> B;
	uint64_t S = A - (A + 1) % 2 + 1;
	uint64_t E = B - (B + 1) % 2;
	uint64_t x;
	if ((E - S + 1) % 4 == 0) {
		x = 0;
	}
	else x = 1;
	if (A % 2 == 0 && B % 2 == 0) {
		uint64_t n = x ^ B;
		cout << n << endl;
	}
	if (A % 2 == 0 && B % 2 == 1) {
		cout << x << endl;
	}
	if (A % 2 == 1 && B % 2 == 1) {
		uint64_t n = x ^ A;
		cout << n << endl;
	}
	if (A % 2 == 1 && B % 2 == 0) {
		uint64_t n1 = x ^ A;
		uint64_t n2 = n1 ^ B;
		cout << n2 << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); ++i)
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
const ll INF = 1LL << 60;

int main(){
	int n, k, x, y;
	cin >> n >> k >> x >> y;
	if(n <= k) cout << n*x;
	else cout << k*x + (n-k)*y;
}


Measured memory_bytes: 256
// Union Find 木
package main

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

func find(parent []int, i int) int {
	if parent[i] < 0 {
		return i
	}
	parent[i] = find(parent, parent[i])
	return parent[i]
}

func unite(parent []int, i, j int) {
	i = find(parent, i)
	j = find(parent, j)
	if i == j {
		return
	}
	parent[j] += parent[i]
	parent[i] = j
}

func reverseInts(a []int) {
	l := len(a)
	for i := 0; i < l/2; i++ {
		a[i], a[l-1-i] = a[l-1-i], a[i]
	}
}

func main() {
	N := readInt()
	M := readInt()
	AB := make([]struct{ A, B int }, M)
	for i := 0; i < M; i++ {
		AB[i].A = readInt() - 1
		AB[i].B = readInt() - 1
	}

	parent := make([]int, N)
	for i := 0; i < N; i++ {
		parent[i] = -1
	}
	inconvenience := N * (N - 1) / 2
	var result []int
	for i := M - 1; i > -1; i-- {
		a := AB[i].A
		b := AB[i].B
		result = append(result, inconvenience)
		pa := find(parent, a)
		pb := find(parent, b)
		if pa != pb {
			inconvenience -= parent[pa] * parent[pb]
		}
		unite(parent, a, b)
	}

	reverseInts(result)
	printIntln(result...)
}

const (
	ioBufferSize = 1 * 1024 * 1024 // 1 MB
)

var stdinScanner = func() *bufio.Scanner {
	result := bufio.NewScanner(os.Stdin)
	result.Buffer(make([]byte, ioBufferSize), ioBufferSize)
	result.Split(bufio.ScanWords)
	return result
}()

func readString() string {
	stdinScanner.Scan()
	return stdinScanner.Text()
}

func readInt() int {
	result, err := strconv.Atoi(readString())
	if err != nil {
		panic(err)
	}
	return result
}

func printIntln(v ...int) {
	b := make([]byte, 0, 4096)
	for i := 0; i < len(v)-1; i++ {
		b = append(b, strconv.Itoa(v[i])...)
		b = append(b, " "...)
	}
	b = append(b, strconv.Itoa(v[len(v)-1])...)
	fmt.Println(string(b))
}


Measured memory_bytes: 11776
#include<bits/stdc++.h>
using namespace std;
#define ld long double
#define ll long long
const int N=7,C=55;
ll f[N*C][1<<N];
int l[N],n,c,a[N];
ll getans()
{
    memset(f,0,sizeof(f));
    f[n*l[n]][0]=1;
    for(int i=0;i<n*c;i++)
        for(int j=i;j<=n*c;j++)
            for(int k=0;k<(1<<n-1);k++)
                if(i%n&&!(k&(1<<a[i%n]-1)))
                    f[min(n*c,max(j,i+n*l[a[i%n]]))][k|(1<<a[i%n]-1)]
                        +=f[j][k];
    return f[n*c][(1<<n-1)-1];
}
int main()
{
    scanf("%d%d",&n,&c);
    for(int i=1;i<=n;i++)scanf("%d",&l[i]),a[i]=i;
    sort(l+1,l+n+1);
    ld ans=0;
    do{ans+=getans();}while(next_permutation(a+1,a+n));
    for(int i=1;i<n;i++)ans/=1.0*c*i;
    printf("%.20Lf\n",ans);
}


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

int main(){
  int64_t n;cin>>n;
  vector<int64_t> a(n);
  int64_t ans = 0,mn=1e9+1,cnt=0;
  for(int i=0;i<n;++i) {
    cin>>a[i];
    ans += abs(a[i]);
    mn = min(abs(a[i]),mn);
    if(a[i]<0) ++cnt;
  }
  
  if (cnt%2==1) ans -= 2*mn;
  cout<<ans<<endl;

}

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

int main (){
  vector <int> a(1000),b(1000);
  int i,s;
  for(i=0;i>=0;i++){
    cin >> a[i] >> b[i];
    if (a[i]==0 && b[i]==0){
      break;
    }
    }
    for(i=0;i>=0;i++){
    if(a[i]==0 && b[i]==0)
{ break;
} else {
  string s1(b[i],'#');
  cout <<  s1 << endl;
  for(s=0;s<a[i]-2;s++){
    cout << '#' ;
    string s2(b[i]-2,'.');
    cout << s2 << '#' << endl;
}    cout << s1 << endl;

}
  cout << endl;
  }
  return 0;}



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

int main(){

  string s;
  cin>>s;
  if(s.substr(0,1)=="7" || s.substr(1,1)=="7" || s.substr(2,1)=="7")cout<<"Yes"<<endl;
  else cout<<"No"<<endl;

}


Measured memory_bytes: 3632
#include<cstdio>
#include<cstring>
#include<vector>
#include<utility>
using namespace std;
int main(){
    vector<pair<int,int> > a;
    int n,l,r,flag,flag2;
    long long ans=0;
    char s[200010];
    scanf("%s",s);
    n=strlen(s);
    for(int i=n-1;i>=0;i--){
        if(s[i]=='A'){
            a.push_back(make_pair(i,1));
            while(i>=0&&s[i-1]=='A'){
                a.back().second++;
                i--;
            }
        }
    }
    flag=1;
    //while(flag){
        flag=0;
        for(int i=0;i<a.size();i++){
            if(s[a[i].first]=='A'&&s[a[i].first+1]=='B'&&s[a[i].first+2]=='C'){
                s[a[i].first+1-a[i].second]='B';
                s[a[i].first+1+1-a[i].second]='C';
                s[a[i].first+2]='A';
                ans+=a[i].second;
                flag=1;
                a[i].first+=2;
                flag2=1;
                while(flag2){
                    if(a[i].first+2<n&&s[a[i].first+1]=='B'&&s[a[i].first+2]=='C'){
                        s[a[i].first+1-a[i].second]='B';
                        s[a[i].first+1+1-a[i].second]='C';
                        s[a[i].first+2]='A';
                        ans+=a[i].second;
                        flag=1;
                        a[i].first+=2;
                    }
                    else{
                        flag2=0;
                    }
                }
            }
        }
    //}
    printf("%lld\n",ans);
}

Measured memory_bytes: 1020
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string s;
  cin>>n>>s;
  for(int i=0; i<s.size(); i++){
    s[i]+=n;
    if(s[i]>'Z'){
      s[i] = s[i]-'Z'+'A'-1;
    }
  }
  cout<<s<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner( System.in );

        int n = sc.nextInt();
        int[] a = new int[n];
        for( int i = 0 ; i < n ; i++ ){
            a[i] = sc.nextInt();
        }
        sc.close();
        Sort s = new Sort( n, a );
        s.bubblesort();
        s.printA();
        System.out.println( s.count );
    }
}

class Sort {
    public int N;
    public int[] A;
    public int count;

    Sort( int N, int[] A ){
        this.N = N;
        this.A = A;
        this.count = 0;
    }

    public void bubblesort(){
        int tmp = 0;
        boolean flag = true;
        while( flag ){
            flag = false;
            for( int j = this.N-1; j > 0 ; j-- ){
                if( this.A[j] < this.A[j - 1] ){
                    tmp = this.A[j];
                    this.A[j] = this.A[j - 1];
                    this.A[j -1] = tmp;
                    flag = true;
                    this.count++;
                }
            }
        }
    }

    public void printA(){
        for( int i = 0; i < this.N; i++ ){
            System.out.print( this.A[i] );
            if( i != this.N - 1 ){
                System.out.print(  " " );
            }
        }
        System.out.println("");
    }
}


Measured memory_bytes: 26360
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main(){
    int n;
    cin >> n;
    vector<ll> a(n+1);
    rep(i, n+1) cin >> a[i];
    vector<ll> b(n);
    rep(i, n) cin >> b[i];
    ll ans = 0;
    rep(i, n) {
        if ( b[i] < a[i] ) {
            ans += b[i];
            a[i] -= b[i];
        }
        else if ( b[i] == a[i] ) {
            ans += b[i];
            a[i] = 0;
        }
        else if ( b[i] < a[i] + a[i+1]) {
            ans += b[i];
            a[i+1] -= (b[i] - a[i]);
            a[i] = 0;
        }
        else {
            ans += a[i] + a[i+1];
            a[i+1] = 0;
            a[i] = 0;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1792
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X, Y, Z = MAP()

# 1
tmp = X
X = Y
Y = tmp

# 2
tmp = X
X = Z
Z = tmp

print(X, Y, Z)


Measured memory_bytes: 5700
import numpy as np
from bisect import bisect_right

alp = [[] for _ in range(26)]

s = input()
t = input()
#s = 'contest'
#t = 'programming'

for i, x in enumerate(s):
    alp[ord(x) - 97].append(i)

ind_prev = -1
loop = 0
flag = True
for x in t:
    letter = alp[ord(x) - 97]

    if len(letter) == 0:
        print(-1)
        flag = False
        break
        
    if ind_prev >= letter[-1]:
        ind_prev = -1
        ind_prev_each_letter = [0 for _ in range(26)]
        loop += 1

    ind = bisect_right(letter, ind_prev)
    ind_prev = letter[ind]

if flag:
    print(loop * len(s) + ind_prev + 1)



Measured memory_bytes: 16800
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <cstring>
#include <math.h>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; i++)
#define rep(i,b) Rep(i,0,b)
#define rrep(i,a) for(int i = a; i >= 0; i--)
#define allof(a) (a).begin(), (a).end()

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1ll << 60ll;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

/*
// 最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

// 最小公倍数
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}*/


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

	int n;
	cin >> n;

	vector<pair<int, int>> ab(n), cd(n);
	rep(i, n) {
		cin >> ab[i].first >> ab[i].second;
	}
	rep(i, n) {
		cin >> cd[i].first >> cd[i].second;
	}

	vector<int> used(n, false);

	sort(allof(ab));
	sort(allof(cd));

	int maxNum = 0;
	int maxHeight = 0;
	bool can = false;
	int ans = 0;
	rep(i, n) {
		// 青い点を順に消していく
		can = false;
		maxHeight = 0;
		rep(j, n) {
			if (used[j]) continue;
			if (cd[i].first > ab[j].first && cd[i].second > ab[j].second) {
				if (maxHeight <= ab[j].second) {
					//cout << j << endl;
					can = true;
					maxHeight = ab[j].second;
					maxNum = j; // maxNumを使う
				}
			}
		}
		if (can) {
			//cout << maxNum << endl;
			ans++;
			used[maxNum] = true;
		}
	}


	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0; i<n; i++)
int main()
{
	string A;
	ll sum = 0;
	int dig;
	cin >> A;
	ll leng = A.size();

	vector<char> B(leng);
	rep(i,leng){
		B[i] = A[i];
	}

	rep(i,leng){
		dig = B[i] - '0';
		sum = sum + dig;
	}

	if(sum%9==0)
		cout << "Yes";
	else
		cout << "No";
	
	cin >> A;
	
	return 0;	
}


Measured memory_bytes: 3848
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

N = int(readline())

for i in range(1,1000):
    if i*(i-1)//2 == N:
        k = i
        print('Yes')
        break
    if i == 999:
        print('No')
        exit()

print(k)
ans = [[] for i in range(k)]

now = 1

import itertools
L = [i for i in range(k)]
for v in itertools.combinations(L,2):
    ans[v[0]].append(now)
    ans[v[1]].append(now)
    now += 1
for aaa in ans:
    print(len(aaa),' '.join(map(str,aaa)))


Measured memory_bytes: 9204
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
using namespace std;
#define MAX 1000

int main(){
  int n;
  cin>>n;
  string a,b;
  for(int i=0;i<n;i++){
    cin>>a>>b;
    int C[MAX+1][MAX+1]={0};
    for(int i=1;i<=a.size();i++){
      for(int j=1;j<=b.size();j++){
        if(a[i-1]==b[j-1]) C[i][j]=C[i-1][j-1]+1;
        else{
          C[i][j]=max(C[i-1][j],C[i][j-1]);
        }
      }
    }
    cout<<C[a.size()][b.size()]<<endl;
  }

}



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

string s = "ACGT", t = "TGCA";
map<char, char> p;

void prepare() {
  for (int i = 0; i < 4; i++) {
    p[s[i]] = t[i];
  }
}

int main() {
  prepare();
  char b;
  cin >> b;
  cout << p[b] << endl;
  return 0;
}

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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) ((int)(x).size())
#define pb push_back
#define fst first
#define snd second
#define PI (acos(-1))
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))

#define MAXN 1123456
#define MOD 1000000007

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vii;
typedef vector<vi> vvi;

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


  int h, a;
  cin>>h>>a;
  cout << (h+a-1)/a << endl;
}

Measured memory_bytes: 256
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

d = {'r': P, 's': R, 'p': S}
result = 0
wins = [False] * K
for i in range(len(T)):
    if not wins[i % K] or T[i] != T[i - K]:
        result += d[T[i]]
        wins[i % K] = True
    else:
        wins[i % K] = False
print(result)


Measured memory_bytes: 3956
n,m,x = map(int,input().split())
a = [list(map(int,input().split())) for i in range(n)]
ans = 10000000000000000000000
for i in range(2**n):
  l = [0]*m
  c = 0
  for j in range(n):
    if ((i>>j)&1):
      aj = a[j]
      c += aj[0]
      for k in range(m):
        l[k]+=aj[k+1]
  if all([i>=x for i in l]):
      ans = min(ans,c)
if ans==10000000000000000000000:
  print(-1)
else:
  print(ans)

Measured memory_bytes: 9220
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
using namespace std;

int main(){
	int a, b;
	cin >> a >> b;
	if ((a * b) % 2) cout << "Odd"  << endl;
	else cout << "Even" << endl;
}

Measured memory_bytes: 256
c = [[0] * 3 for i in range(3)]
for i in range(3):
    c[i][0], c[i][1], c[i][2] = map(int, input().split(' '))


a_list = [0] * 3
b_list = [0] * 3
for a0 in range(c[0][0] + 1):
    a_list[0] = a0
    b_list[0] = c[0][0] - a_list[0]
    a_list[1] = c[1][0] - b_list[0]
    a_list[2] = c[2][0] - b_list[0]
    b_list[1] = c[0][1] - a_list[0]
    b_list[2] = c[0][2] - a_list[0]
    if not all([tmp >= 0 for tmp in a_list]):
        continue
    if not all([tmp >= 0 for tmp in b_list]):
        continue
    
    tmp = [[0] * 3 for i in range(3)]
    for i in range(3):
        for j in range(3):
            tmp[i][j] = a_list[i] + b_list[j]

    for n, m in zip(c, tmp):
        if not n == m:
            break
    else:
        print('Yes')
        exit()
else:
    print('No')


Measured memory_bytes: 3064
#include<bits/stdc++.h>
     
using namespace std;
     
typedef long long ll;
typedef pair<int,int>P;

#define INF INT_MAX;
#define F first
#define S second

int main(){
  ll n;
  ll ans=0;
  ll v[100005];
  scanf("%lld",&n);
  for(ll i=1;i<=n;i++){
    scanf("%lld",&v[i]);
    ans+=v[i]-i;
  }

  printf("%lld\n",ans);
  
  return 0;
}



Measured memory_bytes: 3980
#include <stdio.h>

int main() {


    int x,n,i;
    scanf("%d",&n);

    for(i=1; i <= n; i++){
        x = i;
        if(x % 3 == 0){
            printf(" %d",x);
        }else{
            do{
                if(x % 10 == 3){
                    printf(" %d",i);
                    x = 0;
                }x /= 10;
            }while(x);
        }
    }
    printf("\n");

    return 0;
}


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

typedef vector<int> vi;
typedef long long int ll;
#define clr(v, d)           memset(v, d, sizeof(v))
#define all(v)   (v.begin()),(v.end())
#define lp(i,n)     for(int i=0;i<n;i++)
#define sz(v)       v.size()
#define F           first
#define S           second
#define pb          push_back
#define MP          make_pair
#define pii         pair<int, int>

int main() {
    int a,b,c;
    cin>>a>>b>>c;
    if(a==b&&a!=c){
            cout<<"Yes";
    }
    else if(a==c&&a!=b){
        cout<<"Yes";
    }
    else if(b==c&&a!=b){
        cout<<"Yes";
    }
    else{
        cout<<"No";
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (rint i = 1; i <= (n); i ++)
#define re0(i, n) for (rint i = 0; i < (int) n; i ++)
#define travel(i, u) for (rint i = head[u]; i; i = e[i].nxt)
#define rint register int
using namespace std;

typedef long long lo;

template<typename tp> inline void read(tp &x) {
    x = 0; char c = getchar(); int f = 0;
    for (; c < '0' || c > '9'; f |= c == '-', c = getchar());
    for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
    if (f) x = -x;
}

#define pb push_back
#define p pair <int, int>
const int N = 6666;
int n, ans = 1e9;
vector <p> a, b;
char s[N], t[N];

inline void doit() {
    for (int add0 = 0; add0 <= 2 * n + 1; add0++) {
        if ((add0 + (a.front() == b.front())) % 2 == 0)
            continue;
        vector <p> na(add0, p('0', 1));
            for (p v : a) na.pb(v);
        int i = 0, j = 0;
        bool valid = true;
        int now = 0;
        while (!(i == na.size() && j == b.size())) {
            if (i == na.size()) now += n + 1 - b[j++].second;
            else if (j == b.size()) now += n + 1 - na[i++].second;
            else {
                valid &= na[i].first == b[j].first;
                now += abs(na[i++].second - b[j++].second);
            }
        }
        ans = min(ans, now);
    }
}

int main(void) {
    read(n);
    scanf("%s%s", s + 1, t + 1);
    re0 (i, n) {
        if (s[i + 1] != s[i]) a.pb(p(s[i + 1], i + 1));
        if (t[i + 1] != t[i]) b.pb(p(t[i + 1], i + 1));
    }
    // for (p v : a) cout << v.first << " "; cout << "\n";
    // for (p v : b) cout << v.first << " "; cout << "\n";
    doit();
    swap(a, b);
    doit();
    cout << ans << "\n";
}


Measured memory_bytes: 692
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
    string s,t;
    int cnt=0;
    cin>>s;
    while(cin>>t){
        if(t=="END_OF_TEXT")break;
        rep(i,t.size())if('A'<=t[i]&&t[i]<='Z')t[i]+=32;
        if(s==t)cnt++;
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 3112
n=int(input())
a=list(map(int,input().split()))

t=sum(a)
m=10**9
flag=0
for i in range(len(a)-1):
    t-=2*a[i]
    if i==0:
        m=abs(t)
    else:
        m=min(abs(t),m)
print(m)

Measured memory_bytes: 30492
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

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

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,x;
    cin>>n>>x;
    VI a(n);
    REP(i,n)cin>>a[i];
    SORT(a);
    int ans=0;
    REP(i,n)
    {
        if(a[i] <= x)
        {
            ans++;
            x -= a[i];
        }
        else
        {
            x = 0;
            break;
        }

    }
    if(x != 0)ans--;
    PUTS(ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
int dp[3001][3001];
int main(int argc, char const *argv[]) {
    string s, t;
    cin >> s >> t;
    string ans = "";
    int now = t.length();
    REP(i,3001) REP(j,3001) dp[i][j] = 0;
    for(int i = 0; i < s.length(); ++i) for(int j = 0; j < t.length(); ++j) {
        if (s[i] == t[j]) dp[i+1][j+1] = max(dp[i][j]+1, dp[i+1][j+1]);
        else dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
    }
    int ci = s.length(); int cj = t.length();
	while(1){
		if(ci == 0 or cj == 0) break;
 
		if(s[ci-1] == t[cj - 1] and dp[ci - 1][cj -1] + 1 == dp[ci][cj]){
			ans += s[ci - 1];
			ci--,cj--;
		} else if(dp[ci - 1][cj] == dp[ci][cj]){
			ci--;
		} else if(dp[ci][cj - 1] == dp[ci][cj]){
			cj--;
		}
	}

    reverse(ans.begin(), ans.end());
    cout << ans << std::endl;
    //cout << dp[s.length()][t.length()] << std::endl;
    return 0;
}

Measured memory_bytes: 35456
#include <stdio.h>


// I/O
int get_uint() {
    int n = 0;
    int c = getchar_unlocked();
    if(c < 48 || 57 < c) return c;
    while(47 < c && c < 58) n = 10 * n + (c & 0xf), c = getchar_unlocked();
    return n;
}
int get_str(char *str) {
    int c;
    while((c = getchar_unlocked()) > 32) *str++ = (char)c;
    *str = 0;
    return c;
}
void put_uint(int n) {
    if(!n) {
        putchar_unlocked('0');
        return;
    }
    char buf[11];
    int i = 0;
    while(n) buf[i++] = (char)(n % 10 + '0'), n /= 10;
    while(i--)putchar_unlocked(buf[i]);
}
void put_str(char *str) { while(*str) putchar_unlocked(*str++); }
//


// priority queue
typedef struct MaxHeap {
    int A[2000001];
    size_t len;
} MaxHeap;
void maxheap_init(MaxHeap *H) { H->len = 0; }
void maxheap(MaxHeap *H, const int i) {
    const size_t N = H->len;
    int l = i * 2;
    int r = i * 2 + 1;
    int max = i;
    if(l <= N && H->A[l] > H->A[max]) max = l;
    if(r <= N && H->A[r] > H->A[max]) max = r;
    if(max != i) {
        int tmp = H->A[i];
        H->A[i] = H->A[max];
        H->A[max] = tmp;
        maxheap(H, max);
    }
}
void maxheap_insert(MaxHeap *H, int key) {
    size_t i = ++H->len;
    H->A[i] = key;
    while(i > 1 && H->A[i / 2] < H->A[i]) {
        int tmp = H->A[i/2];
        H->A[i/2] = H->A[i];
        H->A[i] = tmp;
        i /= 2;
    }
}
int maxheap_pop(MaxHeap *H) {
    if(!H->len) return -1;
    int max = H->A[1];
    H->A[1] = H->A[H->len--];
    maxheap(H, 1);
    return max;
}
//


int main(int argc, char **argv) {
    int key;
    char c[8];
    MaxHeap H;
    maxheap_init(&H);
    while(1) {
        get_str(c);
        if(*c == 'e') {
            if(c[1] == 'n') break;
            put_uint(maxheap_pop(&H));
            putchar_unlocked('\n');
        } else {
            key = get_uint();
            maxheap_insert(&H, key);
        }
    }
    return 0;
}



Measured memory_bytes: 5444