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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = INT_MAX / 2;

ll f(ll A, ll B, ll x) {
  return A * x / B - A * (x / B);
}

int main() {
  ll A, B, N; cin >> A >> B >> N;
  cout << f(A, B, min(B - 1, N)) << "\n";  
}


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

using namespace std;

struct Node
{
    int parent, left, right;
} node;

void preorder(int id, vector<Node> &t)
{
    printf(" %d", id);

    if (t[id].left != -1)
        preorder(t[id].left, t);

    if (t[id].right != -1)
        preorder(t[id].right, t);
}

void inorder(int id, vector<Node> &t)
{
    if (t[id].left != -1)
        inorder(t[id].left, t);

    printf(" %d", id);

    if (t[id].right != -1)
        inorder(t[id].right, t);
}

void postorder(int id, vector<Node> &t)
{
    if (t[id].left != -1)
        postorder(t[id].left, t);
    if (t[id].right != -1)
        postorder(t[id].right, t);

    printf(" %d", id);
}

int findRootId(const vector<Node> &t, const int id)
{
    return t[id].parent < 0 ? id : findRootId(t, id + 1);
}

int main()
{
    int n;
    scanf("%d", &n);
    vector<Node> t(n);
    for (int i = 0; i < n; i++)
    {
        t[i].parent = -1;
        t[i].left = -1;
        t[i].right = -1;
    }

    for (int i = 0; i < n; i++)
    {
        int id;
        scanf("%d", &id);
        scanf("%d %d", &t[id].left, &t[id].right);
        t[t[id].left].parent = id;
        t[t[id].right].parent = id;
    }

    int rootId = findRootId(t, 0);

    printf("Preorder\n");
    preorder(rootId, t);
    printf("\n");

    printf("Inorder\n");
    inorder(rootId, t);
    printf("\n");

    printf("Postorder\n");
    postorder(rootId, t);
    printf("\n");

    return 0;
}



Measured memory_bytes: 3216
#include <bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int MOD = 1e9 + 7;
using namespace std;
vector<int> g[5];
int cnt[10] = {};
int dfs(int n,int p)
{
    if(g[n].size() > 2)
        return 0;
    ++cnt[g[n].size()];
    for(auto i : g[n])
    {
        if(i != p)
        {
            int k = dfs(i,n);
            if(k == 0)
                return k;
        }
    }
    return 1;
}

int32_t main()
{
    IOS
    for(int i =1;i <= 3;i++)
    {
        int a,b;
        cin >> a >> b;
        g[a].pb(b);
        g[b].pb(a);
    }
    int k = 0;
    for(int i = 1;i<=4;i++)
    {
        if(g[i].size() == 1)
        {
            k = dfs(i,-1);
            if(k && cnt[1] ==2 && cnt[2] == 2)
            {
                cout << "YES\n";
                return 0;
            }
        }
    }
    cout << "NO\n";
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void) {
	int n, p[100];
	int i;
	int c;
	c = 0;
	scanf("%d", &n);
	for (i = 1; i <= n; i++) {
		scanf("%d", &p[i]);
	}
	for (i = 1; i <= n; i++) {
		if (p[i] != i) {
			c = c + 1;
		}
	}
	if (c == 0 || c == 2) {
		printf("YES\n");
	}
	else {
		printf("NO\n");
	}
	return 0;
}

Measured memory_bytes: 128
s = input()
q = int(input())
hanten = False
sentou = ""
matubi = ""
query = []
for i in range(q):
    query.append(list(input().split()))

for i in range(q):
    if hanten == False:
        if len(query[i]) == 1:
            hanten = True
        else:
            if int(query[i][1]) == 1:
                #先頭にquery[i][2]を追加
                sentou = query[i][2] + sentou
            else:
                #末尾にquery[i][2]を追加
                matubi = matubi + query[i][2]
        #print(s)
    else:
        if len(query[i]) == 1:
            hanten = False
        else:
            if int(query[i][1]) == 1:
                #末尾にquery[i][2]を追加
                matubi = matubi + query[i][2]
            else:
                #先頭にquery[i][2]を追加
                sentou = query[i][2] + sentou
        #print(s)

s = sentou + s + matubi
if hanten == False:
    print(s)
else:
    print(s[::-1])

Measured memory_bytes: 31156
# -*- coding: utf-8 -*-

import sys
import copy

sys.setrecursionlimit(1000000)


# input = sys.stdin.readline

# ~~~~~~~~~~~~~~~~~~~~~_(＾～＾ ｣ ∠)_~~~~~~~~~~~~~~~~~~~~~

def GCD(x, y):
    return x if y == 0 else GCD(y, x % y)


def LCM(x, y):
    return x // GCD(x, y) * y


A, B, C, D = map(int, input().split())

S = B - A + 1

canC = B // C - (A - 1) // C
canD = B // D - (A - 1) // D
canCD = B // LCM(C, D) - (A - 1) // LCM(C, D)

print(S - (canC + canD) + canCD)


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

#define ll long long
#define pb push_back
#define endl '\n'
#define fcin ios::sync_with_stdio(false); cin.tie(nullptr);
#define inf 0x3f3f3f3f
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

/* 
* stuff you should look for
* int overflow, array bounds
* special cases (n=1?), set tle
*/

map<string, ll> f;
ll fat[20];

void init(){
	fat[0] = fat[1] = 1;
	for(int i = 2; i <= 20; i++) fat[i] = i * fat[i-1];
}

ll choose(ll a, ll b){
	if(a < b) return 0;
	if(a == b) return 1;
	return a*(a-1)/2;
}

int main(){
    fcin;
	int n;
	cin >> n;

	init();

	while(n--){
		string a;
		cin >> a;
		sort(a.begin(), a.end());
		f[a]++;
	}

	ll ans = 0;
	for(auto i : f){
		ans += choose(i.second, 2);
	}
	cout << ans << endl;
    return 0;
}



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

int main () {
  int  N;
  cin >> N; 
  
  vector <string> words(N);
  for (int i = 0; i < N; i++) cin >> words.at(i);
  bool ans = true;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++){
      if (i == j) continue;
      if (words.at(i) == words.at(j)) ans = false;
    }
  }
  for (int i = 0; i < N-1; i++){
    string s1 = words.at(i);
    string s2 = words.at(i+1);
   if (s1.at(s1.size()-1) != s2.at(0)) ans = false; 
  }
  if (ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<map>
#include<vector>
#include<set>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#define Max zhi5968
typedef long long ll;
using namespace std;

int main ()
{
	ll n,a=1,b=2;
	cin>>n;
	for(int i=0;i<n-1;i++)
	{
		a=a+b;
		b=a-b;
	//	cout<<a<<endl;
	}
	cout<<a<<endl;
	return 0;
}

Measured memory_bytes: 256
<?php
  
fscanf(STDIN,"%d",$N);

$A = [];

for($i = 1; $i<=2; $i++){
  $arr = explode(" ",trim(fgets(STDIN)));
  foreach($arr as $key =>$elem){
    $A[$i][$key+1] = $elem;
  }
  unset($arr);
}

$count = 0;
$max = 0;

//$indexは下に移動するindexを指す
for($index = 1; $index <=$N; $index++){
  for($i = 1; $i<= $index; $i++){
    $count += $A[1][$i];
  }
  for($j = $index; $j<=$N; $j++){
    $count += $A[2][$j];
  }
  if($count > $max){
    $max = $count;
  }
  $count = 0;
}

echo $max;

Measured memory_bytes: 3956
#include <stdio.h>
#define rep(n)for(i=0;i<n;i++)

int main(){
	int n,i,l=0,r=0;char s[210];
	scanf("%d\n%s",&n,s);
	rep(n){
		if(s[i]=='(')l++;
		else if(s[i]==')')l--;
		if(l<0){r++;l++;}
	}
	rep(r)printf("(");
	printf("%s",s);
	rep(l)printf(")");
	return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstring>
#include <algorithm>
#define P 1000000007
#define ct(x) __builtin_popcount(x)
#define Log(x) (Sym[(x) % 37])

using namespace std;

int n, m, B[15], R[15], Sym[55];

long long F[1 << 15], ans = 1;

int main() {
    for(int i = 0; i < 30; i++) Sym[(1 << i) % 37] = i;
    scanf("%d%d", &n, &m);
    for(int i = 1; i <= m; i++) ans = ans * 2 % P;
    while(m--) {
        int x, y;
        scanf("%d%d", &x, &y);
        B[--x] |= (1 << --y);
        R[y] |= (1 << x);
    }
    F[0] = 1;
    for(int i = 1; i < (1 << n); i++) if(!!(i & 1) ^ !(i & 2))
        for(int j = i; j; j = (j - 1) & i) if(!!(j & 1) ^ !(j & 2)) {
            long long s = (1 << n) - i - 1, tmp = 1;
            for(int k = 0; k < n; k++)
                if((s >> k) & 1) tmp = tmp * ((1 << ct(B[k] & j)) - 1) % P * (1 << ct(R[k] & j)) % P;
            F[i] = (F[i - j] * tmp + F[i]) % P;
        }
    printf("%lld\n", ((ans - F[(1 << n) - 1]) % P + P) % P);
    return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
using namespace std;
#define vel vector<long long>
#define vvel vector<vel>
#define int long long
#define rep(i,n) for(long long i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mkp make_pair
#define pin pair<int,int>
#define V vector
long long p = 998244353;
vel kai(4001, 1);
vel ink(4001, 1);
vel uni(vel &list) {
	if (list.size() == 0) { return list; }
	sort(list.begin(), list.end());
	vel ql(1, list[0]);
	rep(i, list.size() - 1) {
		if (list[i] != list[i + 1]) { ql.push_back(list[i + 1]); }
	}
	return ql;
}
int ru(int a, int r) {
	if (r == 0) { return 1; }
	int ans = ru(a, r / 2);
	ans *= ans; ans %= p;
	if (r % 2 == 1) { ans *= a; }
	return ans % p;
}
int inv(int a) {
	return ru(a, p - 2);
}
void make_kai() {
	rep(i, 4000) { kai[i + 1] = (kai[i] * (i + 1)) % p; }
	rep(i, 4001) { ink[i] = inv(kai[i]); }
}
int com(int n, int r) {
	int ans = kai[n] * ink[r];
	ans %= p; ans *= ink[n - r]; ans %= p;
	return ans;
}
signed main() {
	int n; cin >> n;
	vel a(1 << n);
	rep(i, 1 << n) { cin >> a[i]; }
	vel ans(1 << n, 0);
	V<V<pin>> mx((1<<n), V<pin>(2)); mx[0][0] = mkp(a[0], 0); mx[0][1] = mkp(0, 0);
	for (int i = 1; i < (1 << n); i++) {
		ans[i] = ans[i - 1];
		set<pin> li;
		rep(j, n) {
			if ((i >> j) % 2 == 1) {
				int mi = i ^ (1 << j);
				li.insert(mx[mi][0]);
				li.insert(mx[mi][1]);
			}
		}
		li.insert(mkp(a[i],i));
		auto itr = li.end();itr--;
		mx[i][0] = *itr; itr--; mx[i][1] = *itr;
		int qans = mx[i][0].first + mx[i][1].first;
		ans[i] = max(ans[i], qans);
		cout << ans[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 25600
#include <iostream>
using namespace std;
int main()
{
	int m,k;
	scanf("%d%d",&m,&k);
	int pw=(1<<m);
	if (k>=pw || (m==1 && k==1))
	{
		printf("-1");
		return 0;
	}
	if (m==1)
	{
		printf("0 0 1 1");
		return 0;
	}
	for (int i=0;i<pw;i++)
	{
		if (i!=k)
		printf("%d ",i);
	}
	printf("%d ",k);
	for (int i=pw-1;i>=0;i--)
	{
		if (i!=k)
		printf("%d ",i);
	}
	printf("%d",k);
}

Measured memory_bytes: 1792
class UnionFind:
    def __init__(self,n):
        self.par=[i for i in range(n+1)]
        self.rank=[0]*(n+1)
        self.size=[1]*(n+1)
        self.num=1
        
    def findroot(self,x):
        if self.par[x]==x:
            return x
        else:
            self.par[x]=self.findroot(self.par[x])
            return self.par[x]

    def unite(self,x,y):
        x=self.findroot(x)
        y=self.findroot(y)
        if x!=y:
            self.num+=1
        if self.rank[x]==self.rank[y]:
            self.rank[x]+=1
        if self.rank[x]<self.rank[y]:
            self.par[x]=y
            self.size[y]+=self.size[x]
        else:
            self.par[y]=x
            self.size[x]+=self.size[y]

n,m=map(int,input().split())
G=UnionFind(n)
for _ in range(m):
    x,y,z=map(int,input().split())
    G.unite(x,y)

print(n-G.num+1)

Measured memory_bytes: 8624
#include <stdio.h>

int main(void){
    int n,a = 0,b = 0;
    scanf("%d",&n);
    int import[n];
    for (int i = 0; i < n; ++i) {
        scanf("%d",&import[i]);
    }
    for (int j = 0; j < n; ++j) {
        for (int i = 0; i < n; ++i) {
            if (j == i)continue;
            if (import[j] > import[i]){
                int temp;
                temp = import[i];
                import[i] = import[j];
                import[j] = temp;
            }
        }
    }

    for (int k = 0; k < n; ++k) {
        if (k % 2 == 0){
            a += import[k];
        }
        else{
            b += import[k];
        }
    }

    printf("%d",a-b);
    return 0;
}

Measured memory_bytes: 1684
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int n;
  cin>>n;
  string A[n];
  for(int i=0;i<n;i++) cin>>A[i];
  string C[n];
  for(int i=0;i<n;i++) C[i]=A[i];
  int ans=0;
  for(int i=0;i<n;i++){
    for(int j=n-1;j>i;j--){
      if(C[j][1]<C[j-1][1]){
	swap(C[j],C[j-1]);
      }
    }
  }
  string x[10],y[10];
  for(int i=0;i<n;i++){
    x[A[i][1]-'0']+=A[i][0];
    y[C[i][1]-'0']+=C[i][0];
  }
  ans=1;
  for(int i=0;i<10;i++) ans&=x[i]==y[i]; 
  for(int i=0;i<n;i++) cout<<C[i]<<" \n"[i==n-1];
  cout<<(ans?"Stable":"Not stable")<<endl;
  
  for(int i=0;i<n;i++) C[i]=A[i];
  for(int i=0;i<n;i++){
    int minj=i;
    for(int j=i;j<n;j++){
      if(C[j][1]<C[minj][1]){
	minj=j;
      }
    }
    if(i!=minj) swap(C[i],C[minj]);
  }
  
  for(int i=0;i<10;i++) x[i]=y[i]="";
  for(int i=0;i<n;i++){
    x[A[i][1]-'0']+=A[i][0];
    y[C[i][1]-'0']+=C[i][0];
  }
  ans=1;
  for(int i=0;i<10;i++) ans&=x[i]==y[i]; 
  for(int i=0;i<n;i++) cout<<C[i]<<" \n"[i==n-1];
  cout<<(ans?"Stable":"Not stable")<<endl;
  
  return 0;
}

Measured memory_bytes: 3148
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 25;
const int MOD = 1e9+7;
 
int main() {
	string s;
	cin >> s;
	string ans;
	if (s=="Sunny") ans = "Cloudy";
	else if(s=="Cloudy") ans = "Rainy";
	else ans = "Sunny";
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3556
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
using namespace std;

typedef long long ll;
const int mod=1e9+7;
const int N=1e6+5;
const int MAXN=1e5+5;
char a[5][5];
int main()
{
    for(int i=0; i<2; i++)
        scanf("%s",a[i]);
    if(a[0][0]==a[1][2]&&a[0][1]==a[1][1]&&a[0][2]==a[1][0])
        puts("YES");
    else puts("NO");
    return 0;
}


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

int main(){
  int n,ans=0,cnt=0; cin>>n;
  vector<int> h(n+1);
  for(int i=0;i<n;i++)cin>>h[i];
  h[n]=h[n-1]+1;
  for(int i=0;i<n;i++){
    if(h[i]>=h[i+1]){
      cnt++;
    }else{
      ans=max(ans,cnt);
      cnt=0;
    }
  }
  cout<<ans<<endl;
  return 0;
}

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

rate_list = [0, 0, 0, 0, 0, 0, 0, 0]
perfect = 0

for i in range(n):
    rate = a[i]//400
    if rate < 8:
        if rate_list[rate] == 0:
            rate_list[rate] += 1
    else:
        perfect += 1
        
mini = max(sum(rate_list), 1)
maxi = sum(rate_list)+perfect

print(mini, maxi)

Measured memory_bytes: 3064
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
#define max(x,y)(x>y?x:y)
#define min(x,y)(x>y?y:x)
#define MOD (int)1e9+7
int dx4[]={1,0,-1,0};
int dy4[]={0,-1,0,1};
typedef long long int ll;
typedef unsigned long long int ull;
ll gcd(ll x,ll y){if(!y)return x;return gcd(y,x%y);}
ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
void swap(ll *x,ll *y){ll tmp=*x;*x=*y;*y=tmp;}
int asc_cmp(const void* X,const void* Y){ll x=*(int*)X,y=*(int*)Y;if(x<y)return -1;else if(x==y)return 0;else return 1;}
int desc_cmp(const void* X,const void* Y){ll x=*(int*)X,y=*(int*)Y;if(x<y)return 1;else if(x==y)return 0;else return -1;}
typedef struct pair_{
    int x;
    int y;
}pair_t;

int main(){
    int l;scanf("%d",&l);
    double x=l/3.0;
    printf("%.12lf\n",pow(x,3.0));
}

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

namespace abc166_b
{
    class Program
    {
        static void Main()
        {
            var S = Console.ReadLine().Split(' ');
            var N = int.Parse(S[0]);
            var K = int.Parse(S[1]);
            int[] a = new int[N];

            for (var i = 0; i < K; i++)
            {
                var d = int.Parse(Console.ReadLine());
                var Ad = Console.ReadLine().Split(' ');

                foreach (var j in Ad)
                {
                    var b = int.Parse(j);
                    a[b - 1] ++;
                }
            }

            int answer = 0;

            for (var ii = 0; ii < a.Length; ii++)
            {
                if (a[ii] == 0)
                {
                    answer ++;
                }
            }

            Console.WriteLine(answer);

            Console.Read();

        }
    }
}


Measured memory_bytes: 27664
while True:
     a, op, b = input().split()
     if op == "?":
         break
     elif op == "+":
         print(int(a) + int(b))
     elif op == "-":
         print(int(a) - int(b))
     elif op == "*":
         print(int(a) * int(b))
     elif op == "/":
         print(int(a) // int(b))


Measured memory_bytes: 5596
import java.util.*;
public class Main {

	public static void main(String[] args) {
		int INF = Integer.MAX_VALUE/2;
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int L = sc.nextInt();
		long[][] d = new long[N][N];
		for(int i = 0; i < N; i++)
			for(int j = 0; j < N; j++)
				if(i != j)
					d[i][j] = INF;
		for(int i = 0; i < M; i++) {
			int A = sc.nextInt()-1;
			int B = sc.nextInt()-1;
			int C = sc.nextInt();
			d[A][B] = C;
			d[B][A] = C;
		}
		for(int k = 0; k < N; k++)
			for(int i = 0; i < N; i++)
				for(int j = 0; j < N; j++)
					d[i][j] = Math.min(d[i][j], d[i][k] + d[k][j]);
		int[][] d2 = new int[N][N];
		for(int i = 0; i < N; i++)
			for(int j = 0; j < N; j++) {
				if(i == j)
					continue;
				else if(d[i][j] <= L)
					d2[i][j] = 1;
				else
					d2[i][j] = INF;
			}
		for(int k = 0; k < N; k++)
			for(int i = 0; i < N; i++)
				for(int j = 0; j < N; j++)
					d2[i][j] = Math.min(d2[i][j], d2[i][k] + d2[k][j]);
		int Q = sc.nextInt();
		for(int i = 0; i < Q; i++) {
			int s = sc.nextInt()-1;
			int t = sc.nextInt()-1;
			System.out.println(d2[s][t] == INF ? -1 : d2[s][t] - 1);
		}
	}

}

Measured memory_bytes: 96520
package main

import (
	"fmt"
)

func main(){
	var x, k, d int
	fmt.Scan(&x, &k, &d)


	if x == 0 {
		if k % 2 == 0 {
			fmt.Println(0)
			return
		}
		fmt.Println(d)
		return
	}
	ans := abs(x % d)
	a := abs(x / d)
	if a > k {
		// 試行回数が足りない
		if x > 0  {
			fmt.Println(abs(x - k * d))
			return
		} else if  x < 0 {
			fmt.Println(abs(x +  k * d))
			return
		}
	} else if a <= k && (k - a) % 2 == 0 {
		fmt.Println(abs(ans))
		return
	} else if a <= k && (k-a) % 2 == 1 {
		if ans > 0 {
			ans -= d
		} else {
			ans += d
		}
		fmt.Println(abs(ans))
		return
	}
}

func abs(n int) int {
	y := n >> 63
	return (n ^ y) - y
}


Measured memory_bytes: 1836
#include <iostream>
using namespace std;
void func(int,int,double,int);
int p,q,a,n,cnt;
double k;
 
int main(){
  while(1){
    cin>>p>>q>>a>>n;
    if(!p&&!q&&!a&&!n) break;
    k=1.0*p/q;
    cnt=0;
    func(0,1,0,1);
    cout<<cnt<<endl;
  }
  return 0;
}
 
void func(int x,int w,double y,int I){
  if(-0.00000001<=k-y&&k-y<=0.00000001) cnt++;
  if(x==n) return ;
  for(int i=I;w*i<=a;i++){
    if(y+1.0/i>k+0.1) continue;
    func(x+1,w*i,1.0/i+y,i);
  }
}

Measured memory_bytes: 1160
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
//#include <regex>

/* g++ -g -std=c++0x */
/* g++ -g -std=c++11 */

using namespace std;

// std::ios::sync_with_stdio(false);

// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

int main()
{
/* #ifndef ONLINE_JUDGE */
/*     freopen("foo", "rt", stdin); */
/* #endif */
    string S;
    while (cin >> S) {
        const int n = S.size();
        int ans = n;
        FOR(i,0,n-1) if (S[i] != S[i+1]) {
            ans = min(ans, max(i+1, n-i-1));
        }
        cout << ans << endl;
    }
    return 0;
}


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

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

  if(a < b){
     cout << "a < b" << endl;
     }
  else if(a > b){
     cout << "a > b" << endl;
     }
  else if(a == b){
     cout << "a == b" << endl;
     }
  return 0;
}

  

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

using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define reps(i, m, n) for (int i = m; i <= n; ++i)

using i64 = long long;
using pii = pair<i64, i64>;

template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0;}

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

signed main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  i64 a, b;
  char op;
  cin >> a >> op >> b;
  cout << (op == '+' ? a + b : a - b) << "\n";
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){

    int n, k, h[100000], i, x=0;

    scanf("%d%d", &n, &k);

    for(i=0;i<n;i++){
        scanf("%d", &h[i]);
        if(h[i] >= k)
        x = x + 1;
    }

    printf("%d\n", x);

    return 0;
    
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
 
#define int         long long
#define uint        unsigned int
#define ld          long double
#define showoff     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb          push_back
#define pii         pair<int,int>
#define FOR(i,a,b)  for(int i=a;i<b;++i)
#define RFOR(i,a,b) for(int i=a;i>b;--i)
#define f           first
#define se          second
#define maxn        200005
#define all(v)      v.begin(),v.end()
#define sz(x)       (int)x.size()
#define mod         1000000007
#define pqueue      priority_queue<int>
#define pdqueue     priority_queue< int,vector<int> ,greater< int >>
 
using namespace std;
 
 
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
 
int power(int a,int n)
{
    a %= mod;
    if(n == 1)return a;
    if(n == 0)return 1;
    if(n%2)return (a*(power((a*a)%mod,n/2)%mod))%mod;
    return power((a*a)%mod,n/2)%mod;
}
const int inf = (int) 1e18;
 
int inverse(int x){
    return power(x,mod-2)%mod;//little fermat....
}

signed main()
{
    showoff;
    int n;
    string s;
    cin >> n >> s;
    FOR(i,0,sz(s)){
    	s[i] = (char)('A'+((s[i]-'A'+n)%26));
    }
    cout << s;
    return 0;
}
//*->for large size of matrix take int not long long if possible......
//*->always take maximum as inf for safer side ... 

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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

int N, M;
int T[] = {0, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int A[20];
int dp[10100], used[10100];

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

    std::cin >> N >> M;

    for(int i=0;i<M;++i){
        std::cin >> A[i];
    }

    std::fill(dp + 1, dp + 1 + N, -100100);

    for(int i=0;i<N;++i){
        for(int j=0;j<M;++j){
            int nxt = i + T[A[j]];

            if(nxt > N){
                continue;
            }

            int d = dp[i] + 1;

            if(dp[nxt] < d || (dp[nxt] == d && used[nxt] < A[j])){
                dp[nxt] = d;
                used[nxt] = A[j];
            }
        }
    }

    int cur = N;

    while(cur > 0){
        std::cout << used[cur];
        cur -= T[used[cur]];
    }

    std::cout << std::endl;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		if(a < b && a < c) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 25992
#include <iostream>
using namespace std;
int main() {
    int H, W, N, sr, sc; cin >> H >> W >> N >> sr >> sc;
    sr--; sc--;
    string s, t; cin >> s >> t;
    int left = -1, right = W, top = -1, bot = H;
    for (int i = N-1; i >= 0; i--) {
        if (t[i] == 'L') { if (right < W) right++; }
        else if (t[i] == 'R') { if (left >= 0) left--; }
        else if (t[i] == 'U') { if (bot < H) bot++; }
        else if (top >= 0) top--;
        if (s[i] == 'L') left++;
        else if (s[i] == 'R') right--;
        else if (s[i] == 'U') top++;
        else bot--;
        // cerr << left << ' ' << right << ' ' << top << ' ' << bot << endl;
        if (right - left <= 1 || bot - top <= 1) break;
    }
    if (sc <= left || right <= sc || sr <= top || bot <= sr) {
        cout << "NO\n";
    } else
        cout << "YES\n";
}


Measured memory_bytes: 776
#include<stdio.h>
#include<stdlib.h>
#define N 101
 
 
int main(){
  int i,j,num,num2,num3,num4[N][N],num5[N];
   
  scanf("%d",&num);
  for(i=1;i<=num;i++){
    for(j=1;j<=num;j++){
      num4[i][j] = 0;
    }
  }
  for(i=1;i<=num;i++){
    scanf("%d",&num5[i]);
    scanf("%d",&num2);
    if(num2 == 0)continue;
    
 
    else{
      for(j=0;j<num2;j++){
    scanf("%d",&num3);
    num4[i][num3] = 1; 
      }
    }
     
  }
   
  for(i=1;i<=num;i++){
    for(j=1;j<num;j++){
      printf("%d ",num4[i][j]);
    }
    printf("%d\n",num4[i][num]);
  }
 
 
  return 0;
}

Measured memory_bytes: 632
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		while(true) {
			int n = scan.nextInt();
			int x = scan.nextInt();
			if(n == 0 && x == 0) {
				break;
			}
			int cnt = 0;
			for(int i = 1; i <= n; i++) {
				for(int j = i + 1; j <= n; j++) {
					for(int k = j + 1; k <= n; k++) {
						if( i  + j + k == x) {
							cnt++;
						}
					}
				}
			}
			System.out.println(cnt);
		}
		scan.close();
	}
}


Measured memory_bytes: 26500
#include <iostream>
#include <iomanip>

using namespace std;

int main(){
  int N;
  cin >> N;
  double A[N];
  double d[N];
  double n = 1;
  double de = 0;
  double out = 0.0;
  
  for(int i=0;i<N;i++){
    cin >> A[i];
    n *= A[i];
    d[i] = 1;
  }
  
  for(int i=0;i<N;i++){
    d[i] = n/A[i];
    de += d[i];
  }
  out = n/de;

  cout << setprecision(10) << out << endl;
  

  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
#define fi first
#define se second
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};

lint segdata[(1<<22)-1];
lint lazy[(1<<22)-1];

lint powmod(lint a,lint b){
  return b?powmod(a*a%MOD,b/2)*(b%2?a:1)%MOD:1;
}
lint mod2=powmod(2,MOD-2);

lint neutral(){
    return 0; //単位元
}
lint calc(lint a,lint b){
    return (a+b)%MOD; //演算
}
void seginit(){
    rep(i,(1<<22)-1) segdata[i]=neutral();
}
void update(lint i,lint x){ // i番目の値をxに更新 rangeadd()の後に使ったらだめ 単位元が0以外の時だけ使う
    i+=(1<<21)-1;
    segdata[i]=x;
    while(i>0){
        i=(i-1)/2;
        segdata[i]=calc(segdata[i*2+1],segdata[i*2+2]);
    }
}
void eval(lint k,lint l,lint r){
    if(lazy[k]){
        segdata[k]=(segdata[k]+lazy[k])%MOD;
        if(r-l>1) lazy[2*k+1]=(lazy[2*k+1]+lazy[k]*mod2)%MOD,lazy[2*k+2]=(lazy[2*k+2]+lazy[k]*mod2)%MOD;
        lazy[k]=0;
    }
}
void add(lint a,lint b,lint x,lint k,lint l,lint r){
    eval(k,l,r);
    if(r<=a || b<=l) return;
    if(a<=l && r<=b){
        lazy[k]=(lazy[k]+(r-l)*x)%MOD;
        eval(k,l,r);
    }
    else{
        add(a,b,x,2*k+1,l,(l+r)/2);
        add(a,b,x,2*k+2,(l+r)/2,r);
        segdata[k]=calc(segdata[2*k+1],segdata[2*k+2]);
    }
}
lint seg(lint a,lint b,lint k,lint l,lint r){
    eval(k,l,r);
    if(r<=a || b<=l) return neutral();
    if(a<=l && r<=b) return segdata[k];
    else{
        lint left=seg(a,b,k*2+1,l,(l+r)/2);
        lint right=seg(a,b,k*2+2,(l+r)/2,r);
        return calc(left,right);
    }
}
lint query(lint a,lint b){
    return seg(a,b+1,0,0,1<<21)%MOD; //a~b(閉区間）の範囲での演算
}
void rangeadd(lint a,lint b,lint x){ //a~b(閉区間)にxを加算
    add(a,b+1,x,0,0,1<<21); 
    return;
}

lint other[1100000];
lint fin[1100000];

int main(void){
    seginit();
    lint N;
    cin >> N;
    update(0,1);
    for(int i=0;i<N;i++){
        lint before=query(i,i)%MOD;
        rangeadd(i+1,i+1,before);
        if(i+3<=i+N+1 && i<=N-2) rangeadd(i+3,i+N+1,before);
        other[i+1]=(before*(N-1))%MOD;
        fin[i+1]=(other[i]*(N-1)+fin[i])%MOD;
    }
    cout << (query(N,2*N)+other[N]+fin[N])%MOD << endl;
}

Measured memory_bytes: 82944
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int h, w;
  cin >> h >> w;
  string a[h];
  for(int i; i<h; i++){
    cin >> a[i];
  }
  
  for(int i=0; i<h+2; i++){
    for(int j=0; j<w+2; j++){
      if(i==0||i==h+1||j==0||j==w+1){
        cout << "#";
      }
      else if(j==1){
        cout << a[i-1];
      }
    }
   cout << endl;
  }
}

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

int main()
{
double a , b , x ;
cin >> a >> b >> x ;
if(a*a*b/2>x){
  ans=atan(a*b*b/(2*x));
}
else{
  ans=atan((a*b-x/a)*2/(a*a));
}
ans=ans*180/3.14159265358;
cout<<fixed<<setprecision(12)<<ans<<endl;

return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> num(n);
  vector<int> sorted(n);
  rep(i,n){
    int x;
    cin >> x;
    num[i] = x;
    sorted[i] = x;
  }
  sort(sorted.begin(),sorted.end());
  
  int count = 0;
  rep(i,n){
    if(num[i]!=sorted[i]){
      count++;
    }
  }
  if(count == 2 || count == 0){
    cout << "YES" << endl;
  }
  else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <stdint.h>
#include <cmath>
#include <algorithm>

int main(){
  int64_t X,Y;
  scanf("%ld %ld",&X,&Y);
  printf("%ld\n",std::min(std::abs(X+Y)+1,(X<=Y)?(Y-X):(X-Y+2)));
  return 0;
}


Measured memory_bytes: 128
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
typedef long long ll;
using namespace std;

const int INF = 10e8;

void MixingExperiment() {
	const int mi = 401;

	int dp[2][mi][mi];
	for (size_t t = 0; t < 2; t++)
	{
		for (size_t i = 0; i < mi; i++)
		{
			for (size_t j = 0; j < mi; j++)
			{
				dp[t][i][j] = INF;
			}
		}
	}

	int n, ma, mb;
	cin >> n >> ma >> mb;
	dp[0][0][0] = 0;
	dp[1][0][0] = 0;
	for (size_t i = 0; i < n; i++)
	{
		int a, b, c;
		cin >> a >> b >> c;
		for (size_t j = 0; j <= 400; j++)
		{
			for (size_t k = 0; k <= 400; k++)
			{
				int next = (i + 1) % 2;
				int now = i % 2;
				if (a <= j && b <= k) {
					dp[next][j][k] = min(dp[now][j][k], dp[now][j - a][k - b] + c);
				}
				else {
					dp[next][j][k] = dp[now][j][k];
				}
			}
		}
	}

	int tma = ma;
	int tmb = mb;

	int res = INF;
	while (tma <= 400 && tmb <= 400)
	{
		res = min(dp[n % 2][tma][tmb], res);
		tma += ma;
		tmb += mb;
	}
	if (res == INF)
		cout << -1 << endl;
	else cout << res << endl;
}

int main() {
	MixingExperiment();
	return 0;
}



Measured memory_bytes: 1536
import java.util.*;

public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    String S = sc.next();
    char[]ss = S.toCharArray();

    if(ss[5]==('0') && ss[6]==('1')){
        System.out.println("Heisei");
    }else if(ss[5]==('0') && ss[6]==('2')){
        System.out.println("Heisei");
    }else if(ss[5]==('0') && ss[6]==('3')){
        System.out.println("Heisei");
    }else if(ss[5]==('0') && ss[6]==('4')){
        System.out.println("Heisei");
    }else{
        System.out.println("TBD");
    }
    }
}

Measured memory_bytes: 22484
#include <bits/stdc++.h>
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
#define FOR(i, m, n) for(int i = m;i < n;i++)
int MAX_N = 100000;
#define REP(i, n) for(int i = 0;i < n;i++)
int MAX_W = 100000;
int chnage(int X){
  if( X == 9){
    return 1;
  }else{
    return 9;
  }
}
int main(){
  int N;cin >> N;
  int a,b,c;
  a = N / 100;
  b = (N % 100) / 10;
  c = (N % 10);
  a = chnage(a);
  b = chnage(b);
  c = chnage(c);
  N = 100 * a + 10 * b + c;
  cout << N<< endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();
        if(a<b&&b<c){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
        scan.close();
    }
}


Measured memory_bytes: 26196
import heapq
Q=int(input())

alist=[]
hq_left,hq_right=[],[]
dummy,a1,b1=map(int,input().split())
heapq.heappush(hq_left,-a1)
heapq.heappush(hq_right,a1)
b=b1

min_arg=-hq_left[0]
min_diff=0
#min_value=b      
for _ in range(Q-1):
  query=list(map(int,input().split()))
  if len(query)==3:    
    dummy,ai,bi=query
    b+=bi
    
    max_left=-hq_left[0]
    min_right=hq_right[0]
    if ai<max_left:
      heapq.heappush(hq_left,-ai)
      heapq.heappush(hq_left,-ai)
      heapq.heappop(hq_left)
      heapq.heappush(hq_right,max_left)      
      min_diff+=max_left-ai
    elif min_right<ai:
      heapq.heappush(hq_right,ai)
      heapq.heappush(hq_right,ai)
      heapq.heappop(hq_right)
      heapq.heappush(hq_left,-min_right)      
      min_diff+=ai-min_right
    else:
      heapq.heappush(hq_left,-ai)
      heapq.heappush(hq_right,ai)      
  else:    
    min_arg=-hq_left[0]
    min_value=min_diff+b
    print(min_arg,min_value)

Measured memory_bytes: 18988
n,k = map(int,input().split())
ans = 1
y = sum(list(range(n-k+2,n+1)))
j = n - k + 1
for i in range(k,n+1):
    x = (1+(i-1))*(i-1)//2
    y += j
    j -= 1
    ans += y - x + 1
    ans %= 10 ** 9 + 7
print(ans)

Measured memory_bytes: 16540
#include<iostream>
using namespace std;
int main(){
  	int x=700,i;
  	string s;
  	cin >> s;
  	for(i=0;i<s.size();i++){
    	if(s[i]=='o'){
        	x+=100;
        }
    }
  	cout << x << endl;
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast") 
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define owo ios_base::sync_with_stdio(0);cin.tie(0);
#define MOD (ll)(1e6+3)
#define INF (ll)(1e18)
#define debug(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false);\
debug("%s time : %.4fs\n", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> PII;
typedef pair<int,int> pii;
typedef vector<vector<int>> vii;
typedef vector<vector<ll>> VII;
int gcd(int A,int B) {if(!B)return A;return gcd(B,A%B);}
ld a[300005];
int main()
{
   ll n;
   cin>>n;
   for(int i=0;i<n;i++)cin>>a[i];
   sort(a,a+n);
   ld p = 1;
   for(int i=0;i<n;i++){
	   if(p > (1e18/a[i])){
		   cout<<-1;
		   return 0;
	   }
	   p*=a[i];
   }
   ll z = p;
   cout<<z;
}


Measured memory_bytes: 5348
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long x = sc.nextLong();
		long y = sc.nextLong();
		sc.close();
		long abs = Math.abs(Math.abs(x) - Math.abs(y));
		if(x * y < 0 || (x == 0 && y < 0) || (y == 0 && x > 0)){
            System.out.println(abs + 1);
        }else if((x > 0 && y > 0 && x > y) || (x < 0 && y < 0 && x > y)){
        	System.out.println(abs + 2);
        }else{
        	System.out.println(abs);
        }
	}
}


Measured memory_bytes: 21972
#include <iostream>
#include <vector>

#define INF 1000001

int main() {
    int n, ans=0;
    std::cin >> n;
    std::vector<int> a(n), count(INF, 0);
    for (int i=0; i<n; ++i)
        std::cin >> a[i];

    for (int v : a) {
        if (count[v] != 0) {
            count[v] = 2;
            continue;
        }
        for (int j=v; j<INF; j+=v) ++count[j];
    }
    for (int v : a) {
        if (count[v] == 1) ++ans;
    }
    std::cout << ans << std::endl;
    return 0;
}


Measured memory_bytes: 8024
import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if((a+b) % 2 == 0){
            System.out.println((a+b)/2);
        }else{
            System.out.println("IMPOSSIBLE");
        }
        
    }
}

Measured memory_bytes: 23764
# coding: utf-8

a,b,c = map(int, raw_input().split())

p1 = a == b and b != c # a,b
p2 = a == c and c != b # a,c
p3 = b == c and c != a # b,c

print ['No', 'Yes'][p1 or p2 or p3]


Measured memory_bytes: 2568
import java.util.Scanner

fun main(args:Array<String>){

    val cin = Scanner(System.`in`)
    val data = mutableListOf<String>() 
    
    while(true){	
	    data.add(cin.nextLine())
	    if(data[data.lastIndex] == "0"){
	        data.removeAll{it == "0"}
	        break
	    }
    }

    for(i in data.indices){
        var result:Int = 0
	    for(j in data[i].indices){ 
    	    result += data[i][j].toString().toInt()
	    }
        println(result)
    }
}


Measured memory_bytes: 23392
N,S = map(int, input().split())
A = [int(a) for a in input().split()]
mod = 998244353

dp = [[0]*(S+1) for _ in range(N+1)]
#dp[i][j]:集合{A[k]|k=0,1,,,i}の部分集合の部分集合のうち、要素の総和がjになるものの個数
dp[0][0] = 1
for i in range(N):
    for j in range(S+1):
        dp[i+1][j] += 2*dp[i][j] #A[i]を使わない場合、集合{A[k]|k=0,1,,,i}の部分集合の数が2倍だけ増える
        dp[i+1][j] %= mod
        if j+A[i] <= S:
            dp[i+1][j+A[i]] += dp[i][j] #A[i]を使う場合、総和がjになる部分集合にA[i]を足せばよいので、個数はdp[i][j]だけ増える
            dp[i+1][j+A[i]] %= mod

print(dp[N][S])

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

int main() {
    int N;
    cin >> N;
    
    std::vector<int> arr(N);
    
    for (int i = 0; i < N; i++) cin >> arr.at(i);    
    
    
    int counter = 0;
    
    while (true) {
        bool exist_odd = false;
        for (int i=0; i < N; i++) {
            if (arr.at(i) % 2 != 0) exist_odd = true;
        }
        
            
        if (exist_odd) break;
            
        for (int i=0; i < N; i++) {
            arr.at(i) /= 2;
        }
        counter++;
    }
    cout << counter <<  endl;
    return 0;
}

Measured memory_bytes: 256
loop do
  n, m = gets.split.map(&:to_i)
  break if n == 0
  hit = []
  n.times do
    x, y = gets.split
    hit << [k = x.count('*'), x[k..-1], y.to_i]
  end
  ret = 0
  m.times do
    z = gets.chomp
    hit.each do |i, x, y|
      if z[i..-1] == x
        ret += y
        break
      end
    end
  end
  p ret
end

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

int main() {
  stack<int> s;
  int a, b;
  char c[3];
  while(cin>>c) {
    if (c[0] == '+') {
      b = s.top();
      s.pop();
      a = s.top();
      s.pop();
      s.push(a + b);
    } else if (c[0] == '-') {
      b = s.top();
      s.pop();
      a = s.top();
      s.pop();
      s.push(a - b);
    } else if (c[0] == '*') {
      b = s.top();
      s.pop();
      a = s.top();
      s.pop();
      s.push(a * b);
    } else {
      s.push(atoi(c));
    }
  }
  cout << s.top() << endl;
};



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

int main(){
  string S;
  cin >> S;
  if((S[0]==S[1] && S[2]==S[3] && S[0]!=S[2])||(S[0]==S[2] && S[1]==S[3] && S[0]!=S[1])||(S[0]==S[3]&& S[1]==S[2] && S[0] !=S[1])) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
tmp = []

for i in range(4):  #物理，化学，生物，地学の 4 科目から 3 科目
    a = int(input())
    tmp.append(a)

list.sort(tmp,reverse=True)
sum1 = tmp[0]+tmp[1]+tmp[2]

b = int(input())
c = int(input())

print(sum1+max(b,c))



Measured memory_bytes: 5600
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 210000;
long long fact[C_SIZE];
long long finv[C_SIZE];
long long inv[C_SIZE];
// long long C(int a,int b){
// 	if(a<b||b<0)return 0;
// 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
// }
void init_C(int n){
	fact[0]=finv[0]=inv[1]=1;
	for(int i=2;i<n;i++){
		inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
	}
	for(int i=1;i<n;i++){
		fact[i]=fact[i-1]*i%mod;
		finv[i]=finv[i-1]*inv[i]%mod;
	}
}
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
double ABS(double a){return max(a,-a);}
// ここから編集しろ
long long t[5];
int main(){
	long long n;
	scanf("%lld",&n);
	for(int i=0;i<5;i++)scanf("%lld",t+i);
	long long at=inf;
	for(int i=0;i<5;i++){
		at=min(at,t[i]);
	}
	printf("%lld\n",5+n/at+!!(n%at)-1);
}

Measured memory_bytes: 128
#escape_ck_ans
c=[]
for i in range(3):
    c.append(list(map(int,input().split())))
a=[0]*3
b=[0]*3
a[0]=0#一つ固定する
a[1]=c[1][1]-c[0][1]
a[2]=c[2][2]-c[0][2]
b[0]=c[0][0]
b[1]=c[0][1]
b[2]=c[0][2]
flag=True
for i in range(3):
    for j in range(3):
        if c[i][j]!=a[i]+b[j]:
            flag=False
if flag==True:
    print("Yes")
else:
    print("No")
""" 
print("Yes") if flag(is true) else print("No")
"""

Measured memory_bytes: 3064
#include <iostream>


class Vector {
  public:
    Vector(){}
    Vector(int x, int y): x(x), y(y) {}
    int dot(Vector v) {
        return v.x * x + v.y * y;
    }

    int norm() {
        return x * x + y * y;
    }

    Vector operator+(Vector v) { return Vector(v.x + x, v.y + y); }
    Vector operator-(Vector v) { return Vector(x - v.x, y - v.y); }

    int x, y;
};


class Line {
  public:
    Line() {}
    Line(Vector p1, Vector p2): p1(p1), p2(p2) {
        direction = p1 - p2;
    }

    Vector p1, p2;
    Vector direction;
};


int main() {
    int q;
    std::cin >> q;

    for (int i = 0; i < q; i++) {
        Vector p0, p1, p2, p3;
        std::cin >> p0.x >> p0.y >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y;
        Line l1(p0, p1), l2(p2, p3);
        int dot = l1.direction.dot(l2.direction);

        if (dot == 0) {
            std::cout << 1 << std::endl;
        } else if (dot * dot == l1.direction.norm() * l2.direction.norm()) {
            std::cout << 2 << std::endl;
        } else {
            std::cout << 0 << std::endl;
        }
    }
}



Measured memory_bytes: 3100
h, w = map(int, input().split())
m = []
for i in range(h):
    inp = input()
    tmpa = inp.replace('.', '0')
    tmpb = tmpa.replace('#', '1')
    m.append(tmpb)
# print(m)

ans = [[0] * w for i in range(h)]
for y in range(h):
    for x in range(w):
        if y == 0 and x == 0:
            if m[0][0] == '1':
                ans[0][0] += 1

        elif y == 0:
            ans[y][x] = ans[y][x - 1]
            if m[y][x - 1] == '0' and m[y][x] == '1':
                ans[y][x] += 1

        elif x == 0:
            ans[y][x] = ans[y - 1][x]
            if m[y - 1][x] == '0' and m[y][x] == '1':
                ans[y][x] += 1

        else:
            ans[y][x] = min((ans[y][x - 1] + int(bool(m[y][x - 1] == '0' and m[y][x] == '1')),
                             ans[y - 1][x] + int(bool(m[y - 1][x] == '0' and m[y][x] == '1'))))
# print(ans)
print(ans[h - 1][w - 1])


Measured memory_bytes: 43948
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll dp[52][52][3000] ;
int arr[52];
int n , a;
ll recur(int pos , int nisi , int sum ){
  if(pos==n){
    if((double)sum/nisi==a){
      return 1;
    }
    else
     return 0;
  }
  if(dp[pos][nisi][sum]!=-1){
    return dp[pos][nisi][sum];
  }
  ll way1 =0,way2= 0;
  way1=recur(pos+1,nisi+1,sum+arr[pos]);
  way2=recur(pos+1,nisi,sum);
  dp[pos][nisi][sum]=way1+way2;
  return dp[pos][nisi][sum];
}
int main(){
 cin >> n >> a ;
 for(int i=0;i<n;i++){
    cin >> arr[i];
 }
 memset(dp,-1,sizeof(dp));
 ll res = recur(0,0,0);
 cout << res <<endl;
 return 0;
}


Measured memory_bytes: 67012
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef int ll;
typedef long double ld;
const ll N = 100005;
char en = '\n';
ll inf = 1e16;
ll mod = 1e9 + 7;
ll power(ll x, ll n, ll mod) {
  ll res = 1;
  x %= mod;
  while (n) {
    if (n & 1)
      res = (res * x) % mod;
    x = (x * x) % mod;
    n >>= 1;
  }
  return res;
}

int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll n;
  cin >> n;
  ll deg[n + 5];
  memset(deg, 0, sizeof(deg));

  for (ll i = 2; i <= n; i++) {
    ll x;
    cin >> x;
    deg[x]++;
  }

  for (ll i = 1; i <= n; i++)
    cout << deg[i] << en;

  return 0;
}


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

int r, d, x0;
int arr[12];

void f(int a, int i)
{
    arr[i] = r * a - d;
}

int main()
{
    while(scanf("%d %d %d", &r, &d, &x0) == 3)
    {
        memset(arr, 0, sizeof(arr));
        arr[0] = x0;
        for(int i = 1; i < 11; i++)
        {
            f(arr[i - 1], i);
            printf("%d\n", arr[i]);
        }
    }
    return 0;
}


Measured memory_bytes: 256