akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

int K;
double P,E,T;

double dfs(int n, double l, double r)
{
    double m = (l+r)/2;
    if(n==K)
    {
        if(abs(T-m)<=E) return 1;
        else return 0;
    }

    // ????????????????????????
    if(r<T-E || T+E<l) return 0;
    // ??????????????¨????????£???
    if(T-E<=l && r<=T+E) return 1;

    double ret = 0;
    if(m>T)
    {
        ret += P*dfs(n+1,m,r);
        ret += (1-P)*dfs(n+1,l,m);
    }
    else
    {
        ret += (1-P)*dfs(n+1,m,r);
        ret += P*dfs(n+1,l,m);
    }
    return ret;
}

int main()
{
    int L,R;
    cin >>K >>L >>R >>P >>E >>T;
    printf("%.10f\n", dfs(0,L,R));
    return 0;
}

Measured memory_bytes: 3272
/* When Talent doesn't work, Hard work beats Talent*/

#include"bits/stdc++.h"

using namespace std;

#define Fast_D cout<<fixed<<setprecision(20);
#define FastIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

#define nl "\n"
#define sp " "
#define int long long
#define double long double
#define scanstr(s) cin>>ws; getline(cin,s);

const double PI=3.141592653589793;
const int L=1e18;

void solve()
{
	int a,b,c,d,ans=0;
	cin>>a>>b>>c>>d;
	if(a!=c) ans=1;
	cout<<ans<<nl;
}

int32_t main()
{
	FastIO;
	Fast_D;
	solve();
	return 0;
}


Measured memory_bytes: 3628
import java.util.*;
import java.util.stream.*;
class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int N;
        N = input.nextInt();
        int[] A = new int[N];
        for (int i = 0; i < N; i++){
            A[i] = input.nextInt();
        }
        int count = selectionSort(A,N);
        for (int i = 0; i < N; i++){
            if (i == N-1){
                System.out.println(A[i]);
            } else {
                System.out.printf("%d ",A[i]);
            }
        }
        System.out.println(count);
    }
    public static int selectionSort(int[] A,int N){
        int minj,count,tmp;
        count = 0;
        for (int i = 0; i < N; i++){
            minj = i;
            for (int j = i; j < N; j++){
                if (A[j] < A[minj]){
                    minj = j;
                }
            }
            if (A[i] != A[minj]){
                tmp = A[i];
                A[i] = A[minj];
                A[minj] = tmp;
                count += 1;
            }
        }
        return count;
    }
}


Measured memory_bytes: 26564
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a;i<(int)b;++i)
int main(){
    ll h,n;cin>>h>>n;
    ll sum=0;
    rep(i,n){
        ll a;cin>>a;
        sum+=a;
    }
    if(h<=sum)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
function min(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<val)val = rest[i];return val}
function max(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>val)val = rest[i];return val}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var n = toInt(input.split('\n')[0]);
	var ans = (n%2===1)? 2*n: n;
	console.log(ans);
}

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
int main () {
  string s;
  cin >> s;
  if (s == "Sunny") {
    cout << "Cloudy" << endl;
  } else if (s == "Cloudy") {
    cout << "Rainy" << endl;
  } else {
    cout << "Sunny" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
N, Y = map(int, input().split())


def solve(N, Y):
    for i in range(N + 1):
        for j in range(N + 1 - i):
            if (Y - (i * 10000 + j * 5000)) // 1000 != N - i - j:
                continue
            if (Y - (i * 10000 + j * 5000)) // 1000 < 0:
                continue
            print(i, j, (Y - (i * 10000 + j * 5000)) // 1000)
            return False
    return True


if solve(N, Y):
    print(-1, -1, -1)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ld long double
#define pb push_back
 
#define mo 1000000007
#define inf 1e18
#define rep(i, s, n) for (ll i = s; i < n; i = i + 1)
#define rrep(i,s,n) for(ll i=s;i>=n;i--)
#define adiii\                               
  ios_base::sync_with_stdio(false);\                                      
  cin.tie(NULL);\
  cout.tie(NULL);									
 
ll mod(ll n) { return (n % (ll)mo + (ll)mo)%(ll)mo;}
ll gcd(ll a,ll b) {if (b == 0) return a;return gcd(b, a % b);}

vector <ll> adj[200005];
vector <ll> s(200005,1);
vector <ll> f(200005,0);
vector <ll> c(200005);
vector <ll> ans(200005,0);
vector <bool> vis(200005,false);

ll tc;
void dfs(ll u){
	vis[u] = true;
	ll eval = f[c[u]];
	
	for(auto v: adj[u]){
		if(vis[v]==false) {
			ll bef = tc - f[c[u]];
			dfs(v);
			ll aft = tc - f[c[u]];
			ll an = aft - bef;
			
			ans[c[u]] -= (an*(an-1))/2;
			s[u] += s[v]; 

		}
	}
	f[c[u]] = eval + s[u];
	tc++;
}
int main(){
	adiii
	ll n;cin>>n;
	
	rep(i,1,n+1) cin>>c[i];
	rep(i,0,n-1) {
		ll u,v;cin>>u>>v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
    dfs(1);
    rep(i,1,n+1){
		//cout<<i<<" "<<ans[i]<<endl;
		ll an  = n - f[i];
		ans[i] -=  (an*(an-1))/2; 
		//cout<<i<<"ggg"<<ans[i]<<endl;
	}
	rep(i,1,n+1) ans[c[i]]++;
	rep(i,1,n+1){
		cout << (n*(n-1))/2 + ans[i] <<endl;
	}
	
}


Measured memory_bytes: 36032
//Name: Patisserie
//Level: 3
//Category: グラフ,Graph,最短経路,動的計画法,DP
//Note: 

/**
 * 半径r1のケーキの右に半径r2のケーキを詰めるとき、中心は sqrt(4*r1*r2) だけずらすことになる。
 * これを利用して、(使ったケーキの集合, 右端の直径)の各状態に対して、右端の中心をおける最小の座標を管理すれば、
 * 最短経路問題（もしくは、DAG性を利用したDP）として解くことが可能である。
 *
 * オーダーは O(N^3 2^N)。
 */
#include <iostream>
#include <vector>
#include <algorithm>
#include <sstream>
#include <string>
#include <cassert>

using namespace std;

vector<int> n_by_popcnt[13];

bool solve() {
    string line;
    if(!getline(cin, line)) return false;

    istringstream is(line);
    int L;
    is >> L;
    vector<int> rs;
    int v;
    while(is >> v) rs.push_back(v);
    const int N = rs.size();

    sort(begin(rs), end(rs));
    vector<vector<double>> memo(N, vector<double>(1<<N, 1.0 / 0.0));
    for(int i = 0; i < N; ++i) {
        memo[i][1<<i] = rs[i];
    }

    for(int i = 1; i < N; ++i) {
        for (const auto& pat : n_by_popcnt[i]) {
            if((pat & ((1<<N)-1)) != pat) continue;
            for(int prev = 0; prev < N; ++prev) {
                for(int j = 0; j < N; ++j) {
                    if(pat & (1<<j)) continue;
                    const double nd = memo[prev][pat] + sqrt(4 * rs[prev] * rs[j]);
                    const int np = pat | (1<<j);
                    memo[j][np] = min(memo[j][np], nd);
                }
            }
        }
    }

    bool res = false;
    for(int i = 0; i < N; ++i) {
        if(memo[i][(1<<N)-1] + rs[i] <= L) {
            res = true;
            break;
        }
    }
    cout << (res ? "OK" : "NA") << endl;
    return true;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout.setf(ios::fixed);
    cout.precision(10);

    for(int i = 0; i < (1<<12); ++i) {
        n_by_popcnt[__builtin_popcount(i)].push_back(i);
    }
    while(solve()) ;
    return 0;
}

Measured memory_bytes: 1648
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
using namespace std;

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



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;



int main() {
	int n, d;
	cin >> n >> d;


	int ans = n / (2 * d + 1);
	if (n % (2 * d + 1) != 0) {
		ans++;
	}

	cout << ans << endl;
}


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

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i,n) cin >> a[i];
	mint sum=0, tot=1, ans=0;;
	rep(i,n-1){
		sum += a[i];
		tot = sum*a[i+1];
		ans += tot;
	}
	cout << ans << endl;
	return 0;
}


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

#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 reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = (a); i < int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ull << (b))

using namespace std;
using i32 = int;
using i64 = long long;
using f64 = double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf64 = vector<f64>;
using vstr = vector<string>;

template<typename T, typename S> void amax(T &x, S y) { if (x < y) x = y; }
template<typename T, typename S> void amin(T &x, S y) { if (y < x) x = y; }

int numofbits(long bits) {
  bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
  bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
  bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
  bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
  return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int ans = 1e9;
int n;
vi32 abc;
vi32 l;
vector<vi32> target(8);
void rec(int bits, int i) {
  if (i == n) {
    rep(i, 3) if (target[i].size() == 0) return;
    vi32 cp(3), mp(3);
    rep(i, 3) rep(j, target[i].size()) {
      cp[i] += target[i][j];
      if (j > 0) mp[i] += 10;
    }
    int sum = abs(cp[0] - abc[0]) + abs(cp[1] - abc[1]) + abs(cp[2] - abc[2]);
    rep(i, 3) sum += mp[i];
    amin(ans, sum);
  } else {
    if ((bits >> i) & 1) {
      rep(k, 3) {
        target[k].push_back(l[i]);
        rec(bits, i + 1);
        target[k].pop_back();
      }
    } else {
      rec(bits, i + 1);
    }
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(16);
  int a, b, c;
  cin >> n >> a >> b >> c;
  abc.push_back(a);
  abc.push_back(b);
  abc.push_back(c);
  l = vi32(n);
  rep(i, n) cin >> l[i];
  rep(i, bit(n)) {
    if (numofbits(i) < 3) continue;
    rec(i, 0);
  }
  cout << ans << endl;
  return 0;
}


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

#define N 600000
#define NIL -1

//array
int key[N];
int parent[N];
int leftc[N];
int rightc[N];
//root
int root=NIL;
//function insert
void insert(int z){
  int x,y;
  
  y=NIL;
  x=root;

  while(x!=NIL){
    y=x;
    if(key[z]<key[x]) x=leftc[x];
    else x=rightc[x];
  }  
  
  parent[z]=y;

  if(y==NIL) root=z;
    
  else if(key[z]<key[y]) leftc[y]=z;

  else rightc[y]=z;
  
  
}

//function search
bool find(int now,int data){
  if(now==NIL) return false;
  if(data==key[now]) return true;
  if(data<key[now]) return find(leftc[now],data);
  else return find(rightc[now],data);
}

//print
void inorderprint(int now){
  if(now!=NIL){
    inorderprint(leftc[now]);
    printf(" %d",key[now]);
    inorderprint(rightc[now]);
  }
}

void preorderprint(int now){
  if(now!=NIL){
    printf(" %d",key[now]);
    preorderprint(leftc[now]);
    preorderprint(rightc[now]);
  }
}



int main(){

  int n,i,j,data;
  int z=0;
  char str[10];
  //initialize array
  for(i=0;i<N;i++){
    parent[i]=NIL;
    key[i]=NIL;
    rightc[i]=NIL;
    leftc[i]=NIL;
  }
  //load n
  scanf("%d",&n);
  //load commnad and key
  for(i=0;i<n;i++){
    scanf("%s",str);
    if(strcmp(str,"insert")==0) {
      scanf("%d",&data);
      key[z]=data;
      insert(z);
      z++;
    }
    else if(strcmp(str,"find")==0){
      scanf("%d",&data);
      if(find(root,data)==true) printf("yes\n");
      else printf("no\n");
    }
    else if(strcmp(str,"print")==0){
      inorderprint(root);
      cout <<endl;
      preorderprint(root);
      cout <<endl;
    }
  }

  return 0;
}

Measured memory_bytes: 10000
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    int N;cin >> N;
    string S; cin >> S;
    int res = 0;
    for (int i=0;i<1000;i++){
        string l = to_string(i);
        while(l.size()<3) l = '0'+l;
        int can = 0;
        for (int j=0;j<S.size();j++){
            if (S[j]==l[can]) can++;
        }
        if (can==3) res++;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5;
#define endl '\n'

int a[N];

int main(){
	ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cout.setf(ios::fixed),cout.precision(3);
	int n,b,c,q,value;
	ll sum;
	cin>>n;
	memset(a,0,sizeof(a));
	sum=0;
	for(int i=0;i<n;i++){
		cin>>value;
		a[value]++;
		sum+=value;
	}
	cin>>q;
	while(q--){
		cin>>b>>c;
		sum+=1ll*(c-b)*a[b];
		a[c]+=a[b];
		a[b]=0;
		cout<<sum<<endl;
	}
	return 0;
}

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

int main(){
  int X,A,B;
  cin >> X >> A >> B;
  if (A >= B){
    cout << "delicious" << endl;
  }
  else if (B - A <= X){
    cout << "safe" << endl;
  }
  else {
    cout << "dangerous" << endl;
  }
}


Measured memory_bytes: 256
/*input
4 3
2
4
8
1
2
9
3
*/
#include <bits/stdc++.h>
using namespace std;

int par[2][100005], distinct[2];
vector<pair<int,int> > e;

inline int find(int offset, int x) { return par[offset][x] != x ? par[offset][x] = find(offset, par[offset][x]) : x; }
void merge(int offset, int x, int y) {
  x = find(offset, x);
  y = find(offset, y);
  if (x != y) {
    par[offset][x] = par[offset][y];
    distinct[offset]--;
  }
}

int main() {
  int w, h;
  scanf("%d%d", &w, &h);
  for (int i = 0; i <= w; ++i) par[0][i] = i;
  for (int j = 0; j <= h; ++j) par[1][j] = j;
  distinct[0] = w + 1;
  distinct[1] = h + 1;

  for (int i = 0; i < w; ++i)
  {
    int p; scanf("%d", &p);
    e.push_back(make_pair(p, -i-1));
  }
  for (int j = 0; j < h; ++j)
  {
    int q; scanf("%d", &q);
    e.push_back(make_pair(q, j+1));
  }

  sort(e.begin(), e.end());

  long long ans = 0;
  for (int i = 0; distinct[0] > 1 || distinct[1] > 1; ++i)
  {
    int cost = e[i].first;
    int rc = e[i].second;
    int offset = (rc >= 0);
    rc = abs(rc);

    ans += (long long)cost * distinct[1 ^ offset];

    merge(offset, rc, rc-1);
  }

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

Measured memory_bytes: 3188
from collections import deque
N, Q = [int(item) for item in input().split()]

tree_list = [input().split() for j in range(1, N)]
query_list = [input().split() for k in range(Q)]


class Node:
    def __init__(self, val):
        self.val = val
        self.child_list = []
        self.cnt = 0

class my_tree:
    def __init__(self, tree_list):
        self.node_list = []

        for i in range(N):
            self.node_list.append(Node(i+1))

        for a, b in tree_list:
            a, b = int(a), int(b)

            child_node = self.node_list[b-1]
            parent_node = self.node_list[a-1]
            self.node_list[a-1].child_list.append(child_node)
            self.node_list[b-1].child_list.append(parent_node)
        
    def adding(self, query_list):
        for a, data in query_list:
            a, data = int(a), int(data)
            self.node_list[a-1].cnt += data

        stack = deque([self.node_list[0]])
        parent_node_list = [self.node_list[0]]*(N + 1)

        while True:
            v = stack.pop()
            for child in v.child_list:
                if child != parent_node_list[v.val -1]:
                    child.cnt += v.cnt
                    parent_node_list[child.val -1] = v
                    stack.append(child)
            
            if not stack:
                break


ins = my_tree(tree_list)
ins.adding(query_list)
print(*[node.cnt for node in ins.node_list])


Measured memory_bytes: 181096
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

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

const int inf = INT_MAX;
const int MOD = 1000000007;
const long long INF = LLONG_MAX;

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

int N, M;
vector<int> Graph[10];

int main() {
  cin >> N >> M;
  rep(i, 0, M) {
    int a, b;
    cin >> a >> b;
    Graph[a].push_back(b);
    Graph[b].push_back(a);
  }

  int p[] = {1, 2, 3, 4, 5, 6, 7, 8};
  ll ans = 0;
  do {
    if (p[0] != 1) continue;

    bool can = true;
    rep(i, 0, N - 1) {
      int cv = p[i];
      int nv = p[i + 1];
      bool ok = false;
      for (auto e : Graph[cv]) {
        if (e == nv) {
          ok = true;
        }
      }
      if (!ok) can = false;
    }
    if (can) ++ans;
  } while (next_permutation(p, p + N));
  cout << ans << endl;
}


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

using namespace std;

int n, a[3010];
long long dp[3010][3010];

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];
	
	for (int i = n - 1; i >= 0; i--) {
		for (int j = i + 1; j <= n; j++) {
			dp[i][j] = max(a[i] - dp[i + 1][j], a[j - 1] - dp[i][j - 1]);
		}
	}
	
	cout << dp[0][n] << '\n';
}


Measured memory_bytes: 70016
#include <iostream>

using namespace std;

int main() {
	int a, b; cin >> a >> b;
	if (b != 1) {
		b -= a; a--;
		if (b < 0) cout << 1 << endl;
		else cout << b / a + (b % a ? 2 : 1) << endl;
	} else cout << 0 << endl;

	return 0;
}

Measured memory_bytes: 256
import sys

def judge(word1, word2):
    lena = len(word1)
    lenb = len(word2)
    for i in range(min(lena,lenb)):
        if word1[i] > word2[i]: return 1
        elif word1[i] < word2[i]: return 2
    if lena > lenb: return 1
    elif lena < lenb: return 2
    else: return 0

p = 0
s = [0, 0, 0]
for line in sys.stdin:
    ls = line.strip('\n')
    if p ==0:
        loop = int(ls)
        p = 1
    elif p == 1:
        if loop <= 0: break
        w1, w2 = ls.split()
        tmp = judge(w1, w2)
        if tmp == 0:
            s[1] += 1
            s[2] += 1
        else:
            s[tmp] += 3
        loop -= 1
print s[1], s[2]

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

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

  int n,m;
  cin>>n>>m;
  int tot = 0;
  for(int i=0; i<m; ++i){
    int x; cin>>x;
    tot += x;
  }
  if( n >= tot ){
    cout << n - tot << endl;
  }else{
    cout << -1 << endl;
  }

	return 0;
}


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


#define EPSILON 1e-9


class vector_t {
public:
  double x;
  double y;
  double z;

public:
  vector_t(double x = 0, double y = 0, double z = 0) : x(x), y(y), z(z) {};

public:
  vector_t operator^(const vector_t& v) const {
    return vector_t(y * v.z - z * v.y,
                    z * v.x - x * v.z,
                    x * v.y - y * v.x);
  };
};


class point_t {
public:
  double x;
  double y;
  double z;
  double w;

public:
  point_t(double x = 0, double y = 0, double z = 0, double w = 1) : x(x), y(y), z(z), w(w) {};
  
public:
  vector_t operator-(const point_t& p) const {
    return vector_t(x - p.x, y - p.y, z - p.z);
  };
};


int main(int argc, char** argv)
{
  int n;

  std::cin >> n;

  for (int i = 0; i < n; i ++) {
    double x1, y1, x2, y2, x3, y3, x4, y4;

    std::cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;

    vector_t AB(point_t(x2, y2) - point_t(x1, y1));
    vector_t CD(point_t(x4, y4) - point_t(x3, y3));

    if (std::abs((AB ^ CD).z) < EPSILON) {
      std::cout << "YES" << std::endl;
    }
    else {
      std::cout << "NO" << std::endl;
    }
  }
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
using namespace std;
typedef bool boolean;

const int N = 305;

int n, m;
int c[N][N];
char s[N][N];

int main() {
	scanf("%d%d%*d", &n, &m);
	for (int i = 1; i <= n; i++) {
		scanf("%s", s[i] + 1);
	}
	int cnt = 0;
	for (int i = 1; i <= n; i++) {
		int l = 0;
		for (int j = 1; j <= m; j++) {
			if (s[i][j] == '#') {
				c[i][l + 1] = ++cnt;
				l = j;
			}
		}
		for (int j = 2; j <= m; j++) {
			if (!c[i][j]) {
				c[i][j] = c[i][j - 1];
			}
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			if (!c[i][j]) {
				c[i][j] = c[i - 1][j]; 
			}
		}
	}
	for (int i = n; i; i--) {
		for (int j = 1; j <= m; j++) {
			if (!c[i][j]) {
				c[i][j] = c[i + 1][j]; 
			}
		}
	}
	for (int i = 1; i <= n; i++, putchar('\n')) {
		for (int j = 1; j <= m; j++) {
			printf("%d ", c[i][j]);
		}
	}
	return 0;
}



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

int main(){
  int n;
  string s;
  cin >> n >> s;
  if(s.size() <= n){
    cout << s << endl;
  }else{
    cout << s.substr(0, n) + "...\n";
  }
  return 0;
}



Measured memory_bytes: 3088
n,m = map(int, input().split())

dist = [[] for i in range(n)]

for i in range(m):
    l,r,d = map(int,input().split())
    l-=1
    r-=1
    dist[l].append([r,d])
    dist[r].append([l,-d])


position = [10**10]*n
for i in range(n):
    if position[i]==10**10:
        stack = [i]
        position[i] = 0
        while stack:
            p = stack.pop()
            for to,d in dist[p]:
                if position[to]==10**10:
                    position[to]=position[p]+d
                    stack.append(to)

for i in range(n):
    for to,d in dist[i]:
        if position[to]-position[i]!=d:
            print('No')
            exit()
print('Yes')




Measured memory_bytes: 106144
#include <iostream>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <string>
#include <memory.h>
#include <queue>
#include <random>
#include <time.h>
#include <stack>
using namespace std;
const int N = 1e5 + 10;
const int inf = 1e18 + 5;
const int mod = 1e9 + 7;
#define fast ios_base::sync_with_stdio(false)


int main(){
    int n, m;
    cin >> n >> m;
    cout << ( 100 * (n - m) + 1900 * m) * (1 << m) << endl;
    return 0;
}


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

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

  map<int, bool> numbers;
  for (int i = 0; i < N; i++) {
    int number = 0;
    cin >> number;
    numbers[number] = !numbers[number];
  }

  int count = 0;
  for (auto itr = numbers.begin(); itr != numbers.end(); itr++) {
    if (itr->second == true) count++;
  }

  cout << count << endl;
}


Measured memory_bytes: 8292
#include <queue>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <map>
#include <stdio.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for(int i = (a); i < (int)(b); i++)
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vint;
typedef vector<string> vstr;
typedef pair<ll, ll> pint;
unsigned long long inf = (1LL << 62);
ll mod = 998244353;
pint dx[4] = { {1, 0}, {-1, 0}, {0, 1}, {0, -1} };

ll min(ll a, ll b) {
	if (a < b)
		return a;


	return b;
}

ll max(ll a, ll b) {
	if (a < b)
		return b;

	return a;
}

ll d[100005], vis[100005];

ll N, K;
vector<ll> a;
vector<ll> child[100005];
ll parent[100005];


void dfs(ll s, ll dist) {
	rep(i, child[s].size()){
	
		if (child[s][i] != s) {
			d[child[s][i]] = dist + 1;
			dfs(child[s][i], dist + 1);
		}
	}

}

bool cut(ll s, ll dist) {

	if (vis[s] == 1)
		return false;

	vis[s] = 1;
	if (dist == K-1) {
		return true;
	}
	else {
		cut(a[s], dist + 1);
	}

}

int main() {
	cin >> N >> K;
	a.resize(N);
	rep(i, N) {
		cin >> a[i];
		a[i]--;

	}
	ll ans = 0;
	if(a[0] != 0){
		ans += 1;
		a[0] = 0;
	}


	rep(i, N) {
		child[a[i]].push_back(i);
	}

	dfs(0, 0);

	priority_queue<pint> q;
	rep(i, N) {
		q.push({ d[i], i });
	}

	rep(i, N) {
		if (q.top().first > K && vis[q.top().second] == 0) {

			if (cut(q.top().second, 0))
				ans += 1;

			
		}

		q.pop();
		
	}

	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 16500
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n, m;
    int a, b;
    cin >> n >> m;
    vector<int> cnt(n);
    for (int i = 0; i < m; i++){
        cin >> a >> b;
        cnt[a-1]++;
        cnt[b-1]++;
    }
    for (int i = 0; i < n; i++){
        cout << cnt[i] << endl;
    }
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] s = ".,!? :abc:def:ghi:jkl:mno:pqrs:tuv:wxyz".split(":");
        char[][] k = new char[9][];
        for (int i = 0; i < 9; i++) {
            k[i] = s[i].toCharArray();
        }
        while (n-- > 0) {
            char[] c = sc.next().toCharArray();
            int l = -1, a = 0;
            for (int i = 0; i < c.length; i++) {
                if (c[i] != '0') {
                    a = c[i] - '1';
                    l = (l + 1) % k[a].length;
                } else if (l >= 0) {
                    System.out.print(k[a][l]);
                    l = -1;
                }
            }
            System.out.println();
        }
    }
}


Measured memory_bytes: 29660
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <map>

using namespace std;

int main()
{
    string s;
    string key = "keyence";

    cin >> s;

    for (int i = 0; i < s.size(); i++) {
        for (int j = 0; j < s.size(); j++) {
            string t(s);
            t.erase(i,j);
            if (key == t) {
                cout << "YES" << endl;
                return (0);
            }
        }
    }
    cout << "NO" << endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		boolean ans = true;
		int n = sc.nextInt(), m = sc.nextInt();
		Map<Integer,Integer> map = new HashMap<>();
		if(m == 0) {
			if(n == 1) {
				pw.print(0);
			}else{
				pw.print(1);
				for(; n > 1; n--) {
					pw.print(0);
				}
			}
			
		}else {
			for(int i = 0; i < m; i++) {
				int a = sc.nextInt(), b = sc.nextInt();
				if(map.containsKey(a)) {
					if(map.get(a) != b) {
						ans = false;
						break;
					}
				}else {
					map.put(a, b);
				}			
			}
			if(ans) {
				for(int i = 1; i <= n; i++) {
					if(map.containsKey(i)) {
						if(i == 1 && map.get(i) == 0 && n !=1) {
							pw.print(-1);
							break;
						}else{
							pw.print(map.get(i));
						}
					}else {
						if(i == 1) {
							if(n == 1) {
								pw.print(0);
							}else {
								pw.print(1);
							}
							
						}else{
							pw.print(0);
						}	
					}
				}
			}else {
				pw.print(-1);
			}
	}
		pw.close();
	}
	
	static class FastScanner {
		private BufferedReader reader = null;
	    private StringTokenizer tokenizer = null;
	    public FastScanner(InputStream in) {
	        reader = new BufferedReader(new InputStreamReader(in));
	        tokenizer = null;
	    }

	    public String next() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }

	    public String nextLine() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                return reader.readLine();
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }

	        return tokenizer.nextToken("\n");
	    }

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

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

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

	    public int[] nextIntArray(int n) {
	        int[] a = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public long[] nextLongArray(int n) {
	        long[] a = new long[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextLong();
	        return a;
	    }
	}
}

Measured memory_bytes: 23124
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=2e5;
int a[maxn+5],b[maxn+5],vis[maxn+5];

int main(){
	int n,m,flag=0;
	scanf("%d %d",&n,&m);
	for(int i = 1;i <= m;i++){
		scanf("%d %d",&a[i],&b[i]);
	}
	for(int i = 1;i <= m;i++){
		if(a[i]==1) vis[b[i]]=1;
	}
	for(int i = 1;i <= m;i++){
		if(b[i]==n&&vis[a[i]]==1) 
		{
			flag=1;
			break;
		}
	}
	if(flag==1) printf("POSSIBLE\n");
	else printf("IMPOSSIBLE\n");
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define int long long
using namespace std;

int n,x=26,now,nxt,i;

signed main()
{
	cin>>n;
	--n;
	for (;n-x>=0;n-=x,x*=26,i++);
	
	nxt=n;
	if (i==0)  return cout<<char('a'+n)<<endl,0;
	else if (n==0)
	{
		for (int j=1;j<=i+1;j++)  cout<<'a';
	}
	else
	{
		for (int j=1;j<=i+1;j++)
		{
			x/=26;
			now=nxt/x;
			nxt%=x;
			cout<<char('a'+now);
		}
	}
	cout<<endl;
	
	return 0;
}

Measured memory_bytes: 3632
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

fn main() {
    input! {
        o: String,
        e: String,
    }
    for i in 0..o.len() {
        print!("{}", o.chars().nth(i).unwrap());
        if i < e.len() {
            print!("{}", e.chars().nth(i).unwrap());
        }
    }
    println!("");
}


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

using namespace std;

using ll = long long;

#define ALL(A) A.begin(),A.end()

void ALLIN1_NUMBERS(vector<ll>& V)
{
    for(auto& x : V)
    {
        cin >> x;
    }
}

template<class T>
void OUT0(T N)
{
    cout << N << endl;
}

static const double pi = acos(-1.0);

double Cos(double D)
{
    return cos(pi/180 * D);
}

ll Earliest(ll N, ll K, vector<ll> Xs)
{
    vector<ll> ret(N-K+1);
    for(ll i=0;i<N-K+1;i++)
    {
        if(Xs[i+K-1]<=0)
        {
            ret[i] = abs(Xs[i]);
        }
        else if(Xs[i]<=0)
        {
            ret[i] = abs(Xs[i]-Xs[i+K-1]) + min(abs(Xs[i]),Xs[i+K-1]);
        }
        else
        {
            ret[i] = Xs[i+K-1];
        }
    }
    return *min_element(ALL(ret));
}

int main()
{
    ll N,K;
    cin >> N >> K;

    vector<ll> Xs(N);
    ALLIN1_NUMBERS(Xs);

    OUT0(Earliest(N,K,Xs));

    return 0;
}

Measured memory_bytes: 2176
#include <iostream>

using namespace std;

int main() {
	
	int a, b;
	cin >> a>>b;
	if (a == 1) {
		a = 14;
	}
	if (b == 1) {
		b = 14;
	}
	
	if (a > b) {
		cout << "Alice" << endl;
	}
	else if (a < b) {
		cout << "Bob" << endl;
	}
	else {
		cout << "Draw" << endl;
	}
	
		

	return 0;
}

Measured memory_bytes: 256
n = int(input())
import math
def get_primenumber(number):
    prime_list = []
    search_list = list(range(2,number+1))
    while True:
      if search_list[0] > math.sqrt(number):
        prime_list.extend(search_list)
        break
      else:
        head_num = search_list[0]
        prime_list.append(head_num)
        search_list.pop(0)
        search_list = [num for num in search_list if num % head_num != 0]
    return prime_list
p_l = get_primenumber(10**5+1000)


for prime in p_l:
    if prime >= n:
        print(prime)
        exit()

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

void bingo(int a1, int a2, int a3, vector<bool>& judge);

int main(){
  vector<int> A(9);
  for (int i = 0; i < 9; i++){
    cin >> A.at(i);
  }
  
  int N;
  cin >> N;
  
  vector<bool> judge(9, false);
  for (int i = 0; i < N; i++){
    int B;
    cin >> B;
    
    for (int j = 0; j < 9; j++){
      if (A.at(j) == B){
        judge.at(j) = true;
        break;
      }
    }
    
  }
  
  bingo(0,1,2,judge);
  bingo(3,4,5,judge);
  bingo(6,7,8,judge);
  bingo(0,3,6,judge);
  bingo(1,4,7,judge);
  bingo(2,5,8,judge);
  bingo(0,4,8,judge);
  bingo(2,4,6,judge);
  
  cout << "No" << endl;
}

void bingo(int a1, int a2, int a3, vector<bool>& judge){
  if (judge.at(a1) == true && judge.at(a2) == true && judge.at(a3) == true){
    cout << "Yes" << endl;
    exit(0);
  }
}

Measured memory_bytes: 3640
/*Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.

My little horse must think it queer
To stop without a farmhouse near
Between the woods and frozen lake
The darkest evening of the year.

He gives his harness bells a shake
To ask if there is some mistake.
The only other sound’s the sweep
Of easy wind and downy flake.

The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.*/

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
const int maxn= 100010;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=0,q=0;lli s=0ll,t=0ll,x=0ll,d=0ll;
    cin>>n>>q;
    vector<pair<lli, pair<int, lli> > > v;
    for(int i=0;i<n;++i)
    {
        cin>>s>>t>>x;
        v.pb({s-x,{-1,x}});
        v.pb({t-x,{0,x}});
    }
    for(lli i=0ll;i<q;++i)
    {
        cin>>d;
        v.pb({d,{1,i}});
    }
    sort(v.begin(),v.end());
    vector<lli> aux(q);
    multiset<lli> ms;
    for(auto i: v)
    {
        lli temp= i.fi;
        int typ= i.se.fi;
        lli val= i.se.se;
        if(typ==-1)
            ms.insert(val);
        else if(typ==0)
            ms.erase(ms.lower_bound(val));
        else
        {
            if(ms.empty())
                aux[val]=-1ll;
            else
                aux[val]=*(ms.begin());
        }
    }
    for(auto i: aux)
    {
        cout<<i<<endl;
    }
}

Measured memory_bytes: 26984
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define tez ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main()
{
    tez;
    int vis[4]={0};
    int a,b;
    cin>>a;
    vis[a]={1};
    cin>>b;
    vis[b]={1};
  if(a==b)
    return 0;
    for(int i=1;i<4;i++)
    {
        if(vis[i]==0)
        {cout<<i<<"\n";
        break;
    }}
    
  
  
  
}

Measured memory_bytes: 256
N = int(input())
p = list(map(int, input().split()))

ans = 0
for idx in range(N-1):
    if p[idx] == idx+1:
        p[idx], p[idx+1] = p[idx+1], p[idx]
        ans += 1

if p[N-1] == N:
    ans += 1

print(ans)

Measured memory_bytes: 14008
import sys
sys.setrecursionlimit(500000)
N, Q = map(int, input().split())

class Uf:
    def __init__(self, N):
        self.Par = list(range(N + 1))

    def root(self, x):
        if self.Par[x] == x:
            return x
        else:
            self.Par[x] = self.root(self.Par[x])
            return self.Par[x]

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x != y:
            self.Par[x] = y

uf = Uf(N)
for i in range(Q):
    com, x, y = map(int, input().split())
    if com==0:
        uf.unite(x, y)
    else:
        print(int(uf.same(x, y)))



Measured memory_bytes: 13116
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <limits>
#include <string>
#include <algorithm>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include "math.h"
#include "assert.h"

using namespace std;

#define ll long long

#define BUFF ios::sync_with_stdio(false)
#define epsilon 1e-07
#define pi 2 * acos(0.0);
#define mod 1000000007   // 1e9+7
#define cerr if(false)cerr
#define watch(x) cerr << #x << " = " << x << endl;

#define inf std::numeric_limits<int>().max();

int main() {
	int n;
	cin >> n;
	cout << pow(n, 3) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>

using namespace std;

int main(){
    int M1, M2, D1, D2;
    cin >> M1 >> D1 >> M2 >> D2;
    if(M1 != M2) cout << 1 << endl;
    else cout << 0 << endl;
    return 0;
}

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


using namespace std;

using ll   = long long;
using ii   = pair   < int , int >;
using i3   = pair   < int , ii  >;
using li   = pair   < ll  , int >;
using lii  = pair   < ll  , ii  >;
using pll  = pair   < ll  , ll  >;
using vi   = vector < int       >;
using vl   = vector < ll        >;
using vii  = vector < ii        >;
using vli  = vector < li        >;
using vpll = vector < pll       >;
using vi3  = vector < i3        >;
using vlii = vector < lii       >;


const int N = 2e5 + 5;
const ll INF = 1e17 + 7;
const double eps = 1e-9 , PI = acos(-1);



int n , m;


void solve(int testCase){

    string s , t;
    cin >> s >> t;
    cout << t + s << endl;

}

main(){

    int t = 1;
    // scanf("%d" , &t);

    for(int testCase = 1 ; testCase <= t ; testCase ++){
            solve(testCase);
    }

    return 0;
}


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

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define BIT(X,i) ((X>>i)&1)
#define REP(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(a))
#define ina(x,n) rep(x_i,n) cin>>x[x_i]
#define outa(x,n) rep(x_i,n) cerr<<x[x_i]<<" \n"[x_i==n-1]

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> pll;
typedef vector<pll> vll;

const int mod = 1e9+7;
const int inf = (1<<28);
const ll infl = (1LL<<60);

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


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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(c) (c).begin(), (c).end()
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;}
const int MOD = 1000000007;


int main() {
    int n, m;
    cin >> n >> m;

    map<int, int> p;
    int a, b;
    REP(i, m) {
        cin >> a >> b;
        p[a]++;
        p[b]++;
    }

    for (const auto s : p) {
        if (s.second % 2 != 0) {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
}


Measured memory_bytes: 4352
N,K = map(int,input().split())
AB =[]
for n in range(N):
    a,b = map(int,input().split())
    AB.append([a,b])
AB.sort(key=lambda x:x[0])
cnt = 0
for i,a in enumerate(AB):
    if cnt < K:
        cnt +=a[1]
    if cnt >=K:
        print(a[0])
        exit()

Measured memory_bytes: 21248
#include<stdio.h>
int main()
{
	int n,a[1000],i,f,k,m=0;
	scanf("%d",&n);
	f=0;
	while(scanf("%d",&k)==1){
		a[m]=k;
		m=m+1;
		continue;
	}
	for(i=0;i<=n;i++){ 
		if(a[i]%2!=0&&(i-1)%2!=0)
		f=f+1;
	} 
	printf("%d",f);
}

Measured memory_bytes: 1728
n,k=map(int,input().split())
pl=list(map(int,input().split()))
cl=[0]*2*n
res=[]
next=0
for x in range(k):
  if cl[next]==0:
    cl[next]=1
    next=pl[next]-1
  elif cl[next]==1:
    res.append(next+1)
    cl[next]+=1
    next=pl[next]-1
  else:
    lroop=len(res)
    k-=cl.count(1)
    num=k%lroop
    print(res[num])
    break
else:
  print(next+1)


Measured memory_bytes: 32316
#include<iostream>
#include<algorithm>
 
using namespace std;
 
int cv(int t){
  return t/100*60+t%100;
}
 
int main(){
  for(int n,p,q;cin>>n>>p>>q,n|p|q;){
    int pg[24*60]={};
    for(int i=0;i<n;i++){
      int k;
      cin>>k;
      while(k--){
    int s,t;
    cin>>s>>t;
    for(int i=cv(s);i<cv(t);i++){
      pg[i]++;
    }
      }
    }
    int m=0;
    int c=0;
    for(int i=cv(p);i<cv(q);i++){
      c=(pg[i]!=n)?c+1:0;
      m=max(m,c);
    }
    cout<<m<<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
using System;


public class A{
	
	public static void Main(){
	
		string[] args = Console.ReadLine().Split(' ');
		int a = Int32.Parse(args[0]);
		int b = Int32.Parse(args[1]);
		Console.WriteLine( ((a%2 == 1) && (b%2 == 1) ) ? "Yes" : "No" );
		
	}
	
}

Measured memory_bytes: 13140
import sys

n=int(input())
x=input()

if n==1:
    if x=="0":
        print(1)
    else:
        print(0)
    sys.exit()


lis=[0,1]

for i in range(2,n+1):
    ni=i
    cnti=0
    while ni!=0:
        if ni%2==1:
            cnti+=1
        ni=ni//2
    lis.append(lis[i%cnti]+1)

cnt=0
for i in range(len(x)):
    if x[i]=="1":
        cnt+=1

cpls=cnt+1
cmns=cnt-1

cplis=[1]
if cpls!=0:
    for i in range(n):
        cplis.append((cplis[i]*2)%cpls)
cmlis=[1]
if cmns!=0:
    for i in range(n):
        cmlis.append((cmlis[i]*2)%cmns)

cpsum=0
cmsum=0
for i in range(n):
    if x[i]=="1":
        cpsum=(cpsum+cplis[n-1-i])%cpls
        if cmns!=0:
            cmsum=(cmsum+cmlis[n-1-i])%cmns

for i in range(n):
    if x[i]=="0":
        Xi=(cpsum+cplis[n-1-i])%cpls
        print(lis[Xi]+1)
    else:
        if cmns==0:
            print(0)
        else:
            Xi=(cmsum-cmlis[n-1-i])%cmns
            print(lis[Xi]+1)

Measured memory_bytes: 27028
#include <iostream>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
using namespace std;
#define int long long

signed main(){
    string s;
    cin >> s;
    sort(s.begin(), s.end());

    bool ok = true;
    for(int i = 0; i < s.length() - 1; i++){
       if(s[i] == s[i + 1])ok = false;
    }
    cout << (ok ? "yes" : "no") << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

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

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

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

ll N;
string c;

int main() {
  //
  cin >> N;
  cin >> c;

  ll rcnt = 0;
  for (auto e : c) {
    if (e == 'R') {
      rcnt++;
    }
  }

  ll rinvl = 0;
  for (ll i = rcnt; i < c.size(); ++i) {
    if (c[i] == 'R') {
      rinvl++;
    }
  }

  cout << rinvl;
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < n; ++i)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define stl_repr(itr, x) for (auto itr = x.rbegin(); itr != x.rend(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()

using llong = long long int;

const static int MOD = 1000000000 + 7;
const static int inf = INT_MAX / 2;
const static llong INF = 1LL << 31;
const static int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int main (int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    string S, T;
    cin >> S >> T;

    cout << T << S << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    string s;
    while (getline(cin, s)) {
        if (s.size() > 0 && s[s.size()-1] == '\r') s.resize(s.size()-1);
        rep (i, s.size()) if (islower(s[i])) s[i] = toupper(s[i]);
        cout << s << endl;
    }
    return 0;
}

Measured memory_bytes: 0
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
	n = int(input())
	a = list(map(int,input().split()))
	a_1 = 0
	a_2 = 0
	a_4 = 0
	for i in a:
		if(i%4==0):
			a_4+=1
		elif(i%2==0):
			a_2+=1
		else:
			a_1+=1
	if(a_2>0):
		a_1+=1
	if(a_4>=a_1-1):
		print('Yes')
	else:
		print('No')

main()

Measured memory_bytes: 88428