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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
ll max(ll a, ll b){ 
	if(a >= b) return a;
	else if(a < b) return b;
}

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

int main(){
	ll a, b;
	cin >> a >> b;
	string ans;
	if(a == 1 || b == 1){
		if(a == b)ans = "Draw";
		if(a != 1)ans = "Bob";
		if(b != 1)ans = "Alice";
	}else if(a != 1 && b != 1){
		if(a > b)ans = "Alice";
		else if(a < b) ans ="Bob";
		else if(a == b) ans = "Draw";
	}
	cout << ans << endl;

}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//List<String> list= new ArrayList<String>(Arrays.asList(s.split("")));
		//List<Integer> list=new ArrayList<Integer>();
		//Integer[] array = new Integer[m];
		int n = sc.nextInt();
		Integer[] array = new Integer[n];
		for(int i=0;n>i;i++) {
			int a = sc.nextInt();
			array[a-1] =i;
		}
		for(int i=0;n>i;i++) {
			System.out.print(array[i]+1);
			if(i!=n-1)
				System.out.print(" ");
		}
	}
}

Measured memory_bytes: 65272
#include <iostream>
#include <algorithm>
using namespace std;
using ll = long long;

ll n;
char mp[512][512];
ll d[512];

int main() {
    bool f = false;
    
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cin >> mp[i][j];

            if (mp[i][j] == '#') {
                d[j]++;
                f = true;
            }
        }
    }

    if (!f) {
        cout << -1 << endl;
        return 0;
    }

    ll p = 1ll << 60ll;
    ll q = 0;

    for (int j = 0; j < n; j++) {
        for (int i = 0; i < n; i++) {
            if (mp[i][j] == '.') {
                q++;
                break;
            }
        }
    }

    for (int i = 0; i < n; i++) {
        ll cnt1 = 0;
        if (d[i] == 0) cnt1++;
        
        for (int j = 0; j < n; j++) {
            
            if (mp[i][j] == '.') {
                cnt1++;
            }
        }
        
        p = min(p, cnt1);
    }
    cout << p + q << endl;
    
    return 0;
}


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

int main() {
    int A, B, C, D;
    cin >> A >> B >> C >> D;
    if (A+B>C+D) cout << "Left\n";
    else if (A+B<C+D) cout << "Right\n";
    else cout << "Balanced\n";
}

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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q>
ostream& operator << (ostream& os, pair<P, Q> p)
{
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

int f(string s, char c)
{
  if (count(s.begin(), s.end(), c) == 0)  return 1 << 29;
  int cnt = 0;
  while (count(s.begin(), s.end(), c) != s.size()) {
    string t(s.size() - 1, '@');
    for (int i = 0; i < t.size(); ++i) {
      t[i] = s[i];
      if (s[i + 1] == c) t[i] = c;
    }
    s = t;
    ++cnt;
  }
  return cnt;
}

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

  string s;
  while (cin >> s) {
    int mn = 1 << 29;
    for (char c = 'a'; c <= 'z'; ++c) {
      mn = min(mn, f(s, c));
    }
    cout << mn << endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <string.h>
#include <math.h>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <deque>
#include <queue>
#include <functional>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i, n) for(int i = 0; i < n; ++i)
#define REP(i, m, n) for(int i = m; i < n; ++i)
#define rrep(i,n) for(int i = n; i >= 0; --i)
#define RREP(i, m, n) for(int i = n; i >= m; --i)
#define llrep(i, n) for(ll i = 0; i < n; ++i)
#define llREP(i, m, n) for(ll i = m; i < n; ++i)
#define llrrep(i,n) for(ll i = n; i >= 0; --i)
#define llRREP(i, m, n) for(ll i = n; i >= m; --i)

using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
using pil = std::pair<int, long long>;
using pli = std::pair<long long, int>;
using plpii = std::pair<long long, std::pair<int, int>>;
using pdd = std::pair<double, double>;

const long long INF = 1000000000000000001;
const long long _MOD = 1000000007;
const long long MOD = 998244353;
const int ALPHABET = 27;
const double pi = 3.14159265358979;

using namespace std;
namespace mp = boost::multiprecision;

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

	mp::cpp_int x, k, d;
	cin >> x >> k >> d;

	if (abs(x) < k*d) {
		mp::cpp_int t = abs(x) / d;
		if ((k - t) % 2 == 0) {
			cout << abs(abs(x) - d * t) << "\n";
		}
		else {
			cout << abs(abs(x) - d * (t + 1)) << "\n";
		}
	}
	else {
		cout << abs(x) - k * d << "\n";
	}

	return 0;
}


Measured memory_bytes: 3732
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();

int main() {
    int n;
    cin >> n;
    vector<bool> dp(n+1, false);
    dp[0] = true;
    vector<int> cand = {100, 101, 102, 103, 104, 105};
    for(int i = 100; i <= n; i++) {
        for(int price: cand) {
            if (i - price >= 0 && dp[i-price] == true) {
                dp[i] = true;
                break;
            }
        }
    }
    cout << dp[n] << endl;
    return 0;
}




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

        try (Scanner sc = new Scanner(System.in)) { 
            int w = sc.nextInt();
            int n = sc.nextInt();
            int[] values = new int[w];
            for (int i = 0; i < values.length; i++) { 
                values[i] = i + 1;
            }
            for (int i = 0; i < n; i++) {
                String str = sc.next();
                String[] ab = str.split(",");
                int a = Integer.parseInt(ab[0]) - 1; 
                int b = Integer.parseInt(ab[1]) - 1; 
                int k;
                k=values[a];
                values[a]=values[b];
                values[b]=k;
            }
            for(int i=0;i<w;i++){
                System.out.printf("%d\n",values[i]);
            }
        }       
    }
}


Measured memory_bytes: 26444
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <valarray>
#include <utility>
#include <cctype>
#include <numeric>
#include <memory>
#include <functional>
using namespace std;
int n,m;
map<pair<int,int>,bool> way;
int main()
{
	scanf("%d%d",&n,&m);
	for (int i=0;i<m;++i)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		way[make_pair(x,y)]=true; 
		way[make_pair(y,x)]=true; 
	}
	for (int i=2;i<=n-1;++i)
	{
		if (way[{1,i}] && way[{i,n}])
		{
			puts("POSSIBLE");
			return 0;
		}
	}
	puts("IMPOSSIBLE");
	return 0;
}

Measured memory_bytes: 37760
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>

#define REP(n) for(int i = 0;i < n;i++)
#define LLREP(n) for(long long int  i = 0;i < n;i++)
typedef long long int ll;
using namespace std;
#define MAX_A 100005

int main(){

    int n,tmp,sum=0,ans;
    cin >> n;
    vector<int> place(MAX_A,0);
    for(int i = 1;i <= n+1;i++){
        cin >> place[i];
        sum+=abs(place[i]-place[i-1]);
    }

    for(int i = 1;i <= n;i++){
        int tmp1 = abs(place[i+1]-place[i-1]);
        int tmp2 = (abs(place[i+1]-place[i])+abs(place[i]-place[i-1]));
        //cout << tmp1-tmp2 << endl;
        ans = sum - abs(tmp1-tmp2);
        cout << ans << endl;
    }


    return 0;
}

Measured memory_bytes: 1664
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s

n = load()

p = []
for i in range(n):
    x, y = load_list()
    p.append((x, y))

perms = perm_li([i for i in range(0, n)])

leng = []
for perm in perms:
    l = 0
    for i in range(1, len(perm)):
        e1, e2 = perm[i-1], perm[i]
        x1, y1 = p[e1][0], p[e1][1]
        x2, y2 = p[e2][0], p[e2][1]
        l += math.sqrt(math.pow(x2-x1, 2) + math.pow(y2-y1, 2))
    leng.append(l)

print(sum(leng) / len(leng))
    
        
    




Measured memory_bytes: 30460
#include<bits/stdc++.h>
#define mod 998244353
using namespace std;
typedef long long int ll;
const int maxn=2E5+5;
int n;
string str;
ll ans,f[maxn];
inline ll solve(int x)
{
	string base1,base2,s;
	ll g=0;
	for(int i=0;i<x;++i)
	{
		base1+=str[i],base2+='1'-(str[i]-'0');
		g=(g*2+str[i]-'0')%mod;
	}
	s=base1;
	++g;
	for(int i=0;i<(n/x-1)/2;++i)
		s+=base2+base1;
	g-=s>str;
	return g;
}
int main()
{
	ios::sync_with_stdio(false);
	cin>>n>>str;
	for(int i=1;i<=n;++i)
		if(n%i==0&&(n/i)%2==1)
			f[i]=solve(i);
	for(int i=1;i<=n;++i)
		for(int j=i*2;j<=n;j+=i)
			f[j]=(f[j]-f[i]+mod)%mod;
	for(int i=1;i<=n;++i)
		if(n%i==0)
			ans=(ans+f[i]*2*i)%mod;
	ans=(ans%mod+mod)%mod;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 5324
#include <stdio.h>
#define MAX(maxN,m) ((maxN) > (m) ? (maxN) : (m))

int main(){
    int n;

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

    int maxN = 0, total = 0;
    for (int i = 0; i<n; i++) {
        int m;

        (void)scanf("%d", &m);

        maxN = MAX(maxN, m);
        total += m;
    }

    printf("%s", maxN < total - maxN ? "Yes" : "No");

    return 0;
}

Measured memory_bytes: 128
n = int(input())
node = {i:[] for i in range(1, n+1)}
ans = {i:0 for i in range(1, n+1)}

for _ in range(n-1):
  u,v,w = map(int, input().split())
  node[u].append([v,w])
  node[v].append([u,w])

stack = [1]
memory = set()

while stack:
  x = stack.pop()
  memory.add(x)
  
  for node_i, len_i in node[x]:
    if node_i not in memory:
      if len_i%2==0:
        ans[node_i] = ans[x]
      else:
        ans[node_i] = 1-ans[x]
      stack.append(node_i)  
    
for v in ans.values():
  print(v)

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

int main()
{
    int H, W;
    cin >> H >> W;
    string S[H], O[H];
    rep (i, H) cin >> S[i];
    rep(i, H) {
        string o = "";
        int is = max(0, i - 1);
        int ie = min(H - 1, i + 1);
        rep(j, W) {
            if (S[i][j] == '#') {
                o += "#";
                continue;
            }
            int count = 0;
            int js = max(0, j - 1);
            int je = min(W - 1, j + 1);

            for (int i2 = is; i2 <= ie; i2++) {
                for (int j2 = js; j2 <= je; j2++) {
                    if (S[i2][j2] == '#') {
                        count += 1;
                    }
                }
            }
            o += to_string(count);
        }
        O[i] = o;
    }
    for (auto o : O) {
        cout << o << endl;
    }
    return 0;
}

Measured memory_bytes: 256
from bisect import bisect
n = int(input())
a = list(map(int, input().split()))
a.sort()
ai = a[-1]
mid = ai / 2
i = bisect(a, mid) - 1
j = i + 1
if j == n - 1:
    j = i
if abs(a[i] - mid) < abs(a[j] - mid):
    aj = a[i]
else:
    aj = a[j]
print(ai, aj)

Measured memory_bytes: 19860
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        A solver = new A();
        solver.solve(1, in, out);
        out.close();
    }

    static class A {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int n = Integer.parseInt(in.next());
            int ans = 0;
            for (int i = 1; i <= n; i++) {
                ans += i;
            }

            // 出力
            out.println(ans);

        }

    }
}



Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD 1000000007ll
#define pb push_back
#define vl vector<ll>
#define pll pair<ll,ll>
#define mp make_pair
using namespace std; 
ll gcdExtended(ll a, ll b, ll *x, ll *y); 
  
// Function to find modulo inverse of a 
ll modInverse(ll a, ll m) 
{ 
    ll x, y; 
    ll g = gcdExtended(a, m, &x, &y); 
    if (g != 1) 
        cout << "Inverse doesn't exist"; 
    else
    { 
        // m is added to handle negative x 
        ll res = (x%m + m) % m; 
        return  res; 
    } 
} 
  
// C function for extended Euclidean Algorithm 
ll gcdExtended(ll a, ll b, ll *x, ll *y) 
{ 
    // Base Case 
    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
  
    ll x1, y1; // To store results of recursive call 
    ll gcd = gcdExtended(b%a, a, &x1, &y1); 
  
    // Update x and y using results of recursive 
    // call 
    *x = y1 - (b/a) * x1; 
    *y = x1; 
  
    return gcd; 
} 
ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;      // Initialize result 
    x = x % p;  // Update x if it is more than or 
                // equal to p 
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 
ll nCr(ll n,ll r,ll m)
{
    ll res = 1;
    for (ll i = 1; i <= r; ++i)
    {
        res = (res*(n-i+1)%MOD)*modInverse(i,MOD);
        res%=MOD;
    }
    return res;
}
int main()
{
    ll a,b;
    cin>>a>>b;
    for(ll i=1;i<1000000;i++)
    {
    	if(floor((double)i*0.08)==a)
    		if(floor((double)i*0.1)==b)
    		{
    			cout<<i<<endl;
    			return 0;
    		}
    }
    cout<<-1<<endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
string ans="";
int n; int k;
string S;
int r,s,p;
const int N=1e5+7;
bool win[N];
int move(int i){
	if(S[i]=='r') {
		if(i-k>=0) {
			if(ans[i-k]=='p'&&win[i-k]==1) {
				ans+='r';
				return 0;
			}
			else{
				ans+='p';
				win[i]=1;
				return p;
			}
		}
		else{
			ans+='p';
			win[i]=1;
			return p;
		}
	}
	else if(S[i]=='s') {
		if(i-k>=0) {
			if(ans[i-k]=='r'&&win[i-k]==1) {
				ans+='s';
				return 0;
			}
			else{
				ans+='r';
				win[i]=1;
				return r;
			}
		}
		else{
			ans+='r';
			win[i]=1;
			return r;
		}
	}
	else{
		if(i-k>=0) {
			if((ans[i-k]=='s')&&win[i-k]==1) {
				ans+='p';
				return 0;
			}
			else{
				ans+='s';
				win[i]=1;
				return s;
			}
		}
		else{
			ans+='s';
			win[i]=1;
			return s;
		}
	}
}
int main()
{

	ios_base:: sync_with_stdio(false); cin.tie(0);
	cin>>n;
	cin>>k;
	cin>>r>>s>>p;
	cin>>S;
	ll sum=0;
	for(int i=0; i<n; i++) {
		sum+=move(i);
		//cout<<ans<<endl;
	}
	cout<<sum<<endl;
	//cout<<ans<<endl;

	return 0;
}


Measured memory_bytes: 720
#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
using namespace std;
int input(){
  int x;
  cin>>x;
  return x;
}
int abs(int x){
  if(x>=0){
    return x;
  }else{
    return -x;
  }
}
int gcd(int x, int y){
	if(x<y){
    return gcd(y,x);
  }
  if(y==0){
    return x;
  }
  return gcd(y,x%y);
}
int moji(char i){
  if(i=='a'){
    return 1;
  }
  if(i=='b'){
    return 2;
  }
  if(i=='c'){
    return 3;
  }
  if(i=='d'){
    return 4;
  }
  if(i=='e'){
    return 5;
  }
  if(i=='f'){
    return 6;
  }
  if(i=='g'){
    return 7;
  }
  if(i=='h'){
    return 8;
  }
  if(i=='i'){
    return 9;
  }
  if(i=='j'){
    return 10;
  }
  if(i=='k'){
    return 11;
  }
  if(i=='l'){
    return 12;
  }
  if(i=='m'){
    return 13;
  }
  if(i=='n'){
    return 14;
  }
  if(i=='o'){
    return 15;
  }
  if(i=='p'){
    return 16;
  }
  if(i=='q'){
    return 17;
  }
  if(i=='r'){
    return 18;
  }
  if(i=='s'){
    return 19;
  }
  if(i=='t'){
    return 20;
  }
  if(i=='u'){
    return 21;
  }
  if(i=='v'){
    return 22;
  }
  if(i=='w'){
    return 23;
  }
  if(i=='x'){
    return 24;
  }
  if(i=='y'){
    return 25;
  }
  if(i=='z'){
    return 26;
  } 
  return 100;
  
}





int main() {
  int N,A,B;
  cin>>N>>A>>B;
  int x=B-A;
  if(x%2==1){
    cout<<"Borys"<<endl;
  }else{
    cout<<"Alice"<<endl;
  }
  





  

  
  
  


  
  


  

  




  
  
}

  

  



Measured memory_bytes: 256
#include <iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<map>
#include<set>
#include<vector>
#include<cmath>

using namespace std;
const int maxn = 1005;
int zm[7];
long long power2(long long a, long long b, long long c)
{
     long long res = 1;
     a %= c;
     while(b)
     {
         if (b & 1)res = (res * a) % c;
         a = (a * a) % c;
         b >>= 1;
     }
     return res;
}
long long C(int a,int b){
long long temp=1;
for(int i=0;i<b;i++){
    temp=temp*(a-i)/(i+1);
}
return temp;
}
int main()
{
    int n,p;
    cin>>n>>p;
    int ji=0;
    int ou=0;
    int read=0;
    long long ans=0;
    long long inf = 1<<60;
    for(int i=0;i<n;i++){
        scanf("%d",&read);
        if(read%2)ji++;
        else ou++;
    }
    if(p==0){
        for(int i=0;i<=ji;i=i+2){
            ans+=C(ji,i);
        }
        ans*=pow(2,ou);
    }
    else{
        for(int i=1;i<=ji;i=i+2){
            ans+=C(ji,i);
        }
        ans*=pow(2,ou);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; 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 ll long long
#define pb(a) push_back(a)

ll mod = 1e09;

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

  ll n, a;
  cin >> n >> a;

  cout << n * n - a << endl;

  return 0;
}


Measured memory_bytes: 256
def bubbleSort(list):
  j = len(list) - 1
  bcnt = 0
  while j:
    for i in range(j):
      if list[i] > list[i + 1]:
        list[i], list[i + 1] = list[i + 1], list[i]
        bcnt += 1
    j -= 1
  return bcnt
 
while True:
  n = int(input())
  if n == 0:
    break
  A = []
  for _ in range(n):
    A.append(int(input()))
  print(bubbleSort(A))


Measured memory_bytes: 5596
#include <bits/stdc++.h>
#define int long long
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define ff first
#define ss second
#define frr(i,n) for(int i=0;i<n;i++)
#define td(v) v.begin(),v.end()
#define inf 1000000000 // 1e9
#define M   998244353 // 1e9 + 7
#define MAXN 200100
using namespace std;
typedef vector<int> vi;
typedef set<int> se;
typedef pair<int,int> pii;
inline int mod(int n, int m){if(n%m==0)return m;
int ret = n%m; if(ret < 0) ret += m; return ret; }
int gcd(int a, int b){return (b == 0 ? a : gcd(b, a%b));}
int exp(int a,int b,int m){
    if(b==0) return 1;
    if(b==1) return mod(a,m);
    int k = mod(exp(a,b/2,m),m);
    if(b&1){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}
int p[100];
int n;
int check(){
	for(int i=0;i<n;i++){
		if(p[i]!=i+1)return false;
	}
return true;
}
int32_t main(){
    fastio;
    //int n;
    cin>>n;
    
    for(int i=0;i<n;i++)cin>>p[i];
    
    if(check()){
		cout<<"YES"<<endl;
		return 0;
	}
    
    for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			swap(p[i],p[j]);
			if(check()){
				cout<<"YES"<<endl;
				return 0;
			}
			swap(p[i],p[j]);
		}
	}
    
    	
    	cout<<"NO"<<endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <vector>

using namespace std;

int64_t solve(vector<int64_t>& as, int64_t n, int64_t x)
{
    int64_t ans = 0;
    for (int i = 0; i < n - 1; i++)
    {
        if (as[i] + as[i + 1] > x)
        {
            const auto sum_to_dec = max<int64_t>(0, as[i] + as[i + 1] - x);
            const auto right_dec = min<int64_t>(sum_to_dec, as[i + 1]);
            const auto left_dec = sum_to_dec - right_dec;
            as[i] -= left_dec;
            as[i + 1] -= right_dec;
            ans += sum_to_dec;
        }
    }
    return ans;
}

int main()
{
    int64_t n, x;
    cin >> n >> x;

    vector<int64_t> as(n);
    for (auto& a : as)
    {
        cin >> a;
    }
    vector<int64_t> as2(n);
    copy(as.begin(), as.end(), as2.begin());
    auto ans1 = solve(as, n, x);
    reverse(as2.begin(), as2.end());
    auto ans2 = solve(as2, n, x);

    cout << min(ans1, ans2) << endl;
}


Measured memory_bytes: 1792
#include <iostream>
#include <cstdint>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
    string S, T;
    cin >> S >> T;

    const int n = S.length();
    const char *ps = S.c_str();
    const char *pt = T.c_str();

    bool single = true;
    char s2t[26];
    char t2s[26];
    for (int i = 0; i < 26; i++)
    {
        s2t[i] = t2s[i] = '*' - 'a'; // undefined
    }

    for (int i = 0; i < n; i++)
    {
        char from = ps[i] - 'a';
        char to = pt[i] - 'a';

        if (s2t[from] == '*' - 'a')
        {
            s2t[from] = to;
        }
        else if (s2t[from] != to)
        {
            single = false;
        }

        if (t2s[to] == '*' - 'a')
        {
            t2s[to] = from;
        }
        else if (t2s[to] != from)
        {
            single = false;
        }
    }

    cout << (single ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 776
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
#include <functional>
using namespace std;
typedef long long ll;

#define fi first
#define se second
#define rep(i, n) for (ll i = 0; i < n; i++)
#define debugA cerr << "AAAAA" << endl
#define debug_ cerr << "-------------" << endl
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    cout << #v << endl;                \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;
#define debug_vec2(v)                         \
    cout << #v << endl;                       \
    for (int i = 0; i < v.size(); i++)        \
    {                                         \
        for (int j = 0; j < v[i].size(); j++) \
        {                                     \
            cout << v[i][j] << " ";           \
        }                                     \
        cout << endl;                         \
    }

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

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

template <typename T>
void quit(T a)
{
    cout << a << endl;
    exit(0);
}

using Graph = vector<vector<int>>;
using P = pair<int, int>;
using P1 = pair<int, pair<int, int>>; // クラスカル法とかで、{cost, {from, to}}的に使う。
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double pi = acos(-1);

int main()
{
    int a,b;
    cin>>a>>b;
    if(a>=1&&a<=9&&b>=1&&b<=9){
        cout<<a*b<<endl;
    }
    else{
        cout<<-1<<endl;
    }

    return 0;
}


Measured memory_bytes: 3640
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Comparator;
import java.util.List;

public class Main { // Template for CF
    public static class ListComparator implements Comparator<List<Integer>> {

        @Override
        public int compare(List<Integer> l1, List<Integer> l2) {
            for (int i = 0; i < l1.size(); ++i) {
                if (l1.get(i).compareTo(l2.get(i)) != 0) {
                    return l1.get(i).compareTo(l2.get(i));
                }
            }
            return 0;
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        String str = f.readLine();
        long k = Long.parseLong(f.readLine());
        int[] chars = new int[str.length()];
        for (int i = 0; i < str.length(); i++) {
            if (26 - (str.charAt(i) - 'a') <= k && (str.charAt(i) - 'a') != 0) {
                chars[i] = 0;
                k -= (26 - (str.charAt(i) - 'a'));
            } else {
                chars[i] = str.charAt(i) - 'a';
            }
        }
        int left = (int) k % (26);
        chars[str.length() - 1] += left;
        for (int i = 0; i < chars.length; i++) {
            out.print((char) (chars[i] + 'a'));
        }
        out.close();
    }

}


Measured memory_bytes: 23636
#include <cstdio>
#include <cmath>

#define FOR( i, l, r) for(int i = (l)    ; i <  (r); i++)
#define FOR1(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define REV( i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define REV1(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define INC( i, n) FOR( i, 0, n)
#define INC1(i, n) FOR1(i, 1, n)
#define DEC( i, n) REV( i, 0, n)
#define DEC1(i, n) REV1(i, 1, n)

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

template<typename T> void swap(T &x, T &y) { T t = x; x = y; y = t; return; }
template<typename T> T abs(T x) { return (0 <= x ? x : -x); }
template<typename T> T max(T a, T b) { return (b <= a ? a : b); }
template<typename T> T min(T a, T b) { return (a <= b ? a : b); }
template<typename T> bool setmin(T &a, T b) { if(a <= b) { return false; } else { a = b; return true; } }
template<typename T> bool setmax(T &a, T b) { if(b <= a) { return false; } else { a = b; return true; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int n, a, b, ans;

int main() {
	scanf("%d%d%d", &n, &a, &b);
	INC(i, n) { int t; scanf("%d", &t); if( ! (a <= t && t < b) ) { ans++; }  }
	
	printf("%d\n", ans);
	
	return 0;
}


Measured memory_bytes: 128
package main

import (
        "fmt"
        "strconv"
)

func main() {
        var str string
        fmt.Scanln(&str)

        n, _ := strconv.Atoi(str)
        s := 0
        for i := range str {
                s += int(str[i] - '0')
        }

        if n%s == 0 {
                fmt.Println("Yes")
                return
        }
        fmt.Println("No")
}

Measured memory_bytes: 512
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int sum=0;
		int a = 0;
		for(int i = 0; i < 5 ; i ++){
			a=scan.nextInt();
			if(a<40)
				sum+=40;
			else
				sum+=a;
		}
		System.out.println(sum/5);
	}
}

Measured memory_bytes: 17160
package main
import . "fmt"
import "sort"
func main() {
  var n,k,s int
  var l []int
  Scan(&n,&k)
  l = make([]int,n)
  for i:=0;i<n;i++ { Scanf("%d",&l[i]) }
  sort.Sort(sort.Reverse(sort.IntSlice(l)))
  s = 0
  for i:=0;i<k;i++ {
    s += l[i]
  }
  Println(s)
}

Measured memory_bytes: 512
use proconio::input;
fn main() {
    input!{
        n: usize,
        l: [i64; n],
    };
    let mut ans = 0;
    if n < 3 {
        println!("{}", ans);
        std::process::exit(0);
    }
    for i in 0..n {
        for j in i..n {
            if i == j || l[i] == l[j] {
                continue;
            }
            for k in j..n {
                if i == j || j == k {
                    continue;
                }
                let hen = [l[i], l[j], l[k]];
                if hen[2] != hen[1] && hen[1] != hen[0] && hen[2] != hen[0] && hen[2] < ( hen[1] + hen[0] ) && hen[1] < (hen[2] + hen[0]) &&
                        hen[0] < (hen[2] + hen[1]) {
                    ans += 1;
                }
            }
        }
    }
    println!("{}", ans);
}

Measured memory_bytes: 2172
use feature 'say';
my $line = <STDIN>;
my $s = int($line);
my $i = 1;
my %seen = ($s => 1);
while (1) {
	++$i;
    if ($s % 2) {
    	$s = 3 * $s + 1;
    } else {
    	$s = int($s / 2);
    }
    if ($seen{$s}) {
		last;
    }
    $seen{$s} = 1;
}
print $i;

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1e18
#define PI 3.14159265358979

using namespace std;

ll gcd(ll a, ll b);
ll power(ll n, ll k);
ll inv(ll n);
ll genfact(ll n, ll k);
ll fact(ll n);
ll nck(ll n, ll k);

vector<int> prime_map = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};

int main(void){
  int n;
  cin >> n;
  int l = prime_map.size();

  vector<int> prime_num(l, 0);
  for (int j = 2; j <= n; j++){
    int a = j;
    for (int i = 0; i < l; i++){
      while (a % prime_map[i] == 0){
        prime_num[i]++;
        a /= prime_map[i];
      }
    }
  }

  int ret = 0;
  int num2 = 0, num24 = 0, num4 = 0, num14 = 0, num74 = 0;
  for (int i = 0; i < l; i++){
    if (prime_num[i] >= 2)
      num2++;
    if (prime_num[i] >= 4)
      num4++;
    if (prime_num[i] >= 14)
      num14++;
    if (prime_num[i] >= 24)
      num24++;
    if (prime_num[i] >= 74)
      num74++;
  }
  cout << (num2 - 1) * num24 + (num2 - 2)*num4*(num4 - 1)/2 + num14*(num4 - 1) + num74 << endl;

 

  return 0;
}

ll gcd(ll a, ll b){
  if (a < b)
    return gcd(b, a);
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}

ll power(ll n, ll k){
  ll res = 1;
  while(k > 0){
    if (k & 1) 
      res = res * n % MOD;
    n = n * n % MOD;
    k >>= 1;
  }
  return res;
}

ll genfact(ll n, ll k){

  ll res = 1;
  while (k >= 0){
    res = (res * (n - k)) % MOD;
    k--;
  }

  return res;
}

ll inv(ll n){
  return power(n, MOD - 2);
}

ll fact(ll n){
  return genfact(n, n - 1);
}

ll nck(ll n, ll k){
  if (k == 0)
    return 1;
  if (n <= 0)
    return 0;

  return ((genfact(n, k) % MOD) * inv(fact(k))) % MOD;
}


Measured memory_bytes: 256
import sys
from collections import Counter

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

n = ni()
v = nl()
odd = Counter(v[0::2])
even = Counter(v[1::2])
odd["$"] = 0
even["#"] = 0
ans = 0
if odd.most_common()[0][0] == even.most_common()[0][0]:
    if odd.most_common()[1][1] > even.most_common()[1][1]:
        ans = n - odd.most_common()[1][1] - even.most_common()[0][1]
    else:
        ans = n - odd.most_common()[0][1] - even.most_common()[1][1]
else:
    ans = n - odd.most_common()[0][1] - even.most_common()[0][1]
"""if len(odd) == 1:
    pass
else:
    for v in odd.values():
        max_odd = max(max_odd, v)
    ans += len(odd) - max_odd

if len(even) == 1:
    pass
else:
    for v in even.values():
        max_even = max(max_even, v)
    ans += len(even) - max_even"""

print(ans)

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

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


Measured memory_bytes: 640
// #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES	// M_PI=3.1415...
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>	// 20桁出力 cout << setprecision(20) << double;
#include <queue>
#include <bitset>	// bitset<8> bs1(131uL); // 10000011 bs1[0]は1 01stringからビット集合生成可
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VL;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef vector<pair<int, int> > VPII;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<int, int> P;
typedef pair<int, pair<P, P> > PP;

#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FOR_REV(i,a,b) for(int i=(a);i>=(b);i--)
//for gcc (未test)
// #define FOREACH_IT(it,c) for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(),c_end=c.end();it!=c_end;++it)
#define FOR_ITR(d) for(auto itr=d.begin(),d_end=d.end();itr!=d_end;++itr)	// C++11
// for Debug.
#define DUMP_VVI(b) FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}
// 入力をpush_back(d)やarray[d]に使う時に1行で書ける
// int INPUT_INT() {int d;cin>>d;return d;}
template<class T>T IN() { T d; cin >> d; return d; }
// 最大公約数（Greatest Common Divisor）
LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a%b) : a; }
// 最小公倍数（Least Common Multiple）
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; }
// Y年はうるう年か否か
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); }

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

// vector注意
// vec[i][j]の形に入力を入れるとき、vecは初期化してある必要がある.

// ------------------- include, typedef, define END. -------------------

int main() {
	FAST_IO;
	// for D_OUT(str, value)  ... cout<< str <<" : "<< value <<endl;
	bool dbgF = true;

	//コードはここから書く.

	LL N, K;
	LL allgcd,maxA=-1;
	VL A;
	string ans = "IMPOSSIBLE";
	
	cin >> N >> K;
	FOR(i, 0, N) {
		LL temp = IN<LL>();
		A.push_back(temp);
		maxA = max(maxA, temp);
	}

	allgcd = gcd(A[0], A[1]);
	FOR(i, 2, N) {
		allgcd = gcd(allgcd, A[i]);
	}

	if (maxA >= K && K % allgcd == 0)
		ans = "POSSIBLE";

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

Measured memory_bytes: 1400
#include <bits/stdc++.h>
#define rep(a,n) for (ll a = 0; a < (n); ++a)
using namespace std;
using ll = long long;
typedef pair<ll,ll> P;
typedef pair<P,ll> PP;
typedef vector<vector<ll> > Graph;
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 ll INF = 1e18;

//入力
string s;

int main(){
    cin >> s;
    int l = s.size();
    rep(i,l-1){
        if(s[i]==s[i+1]){
            printf("%d %d",i+1,i+2);
            return 0;
        }
    }
    rep(i,l-2){
        if(s[i]==s[i+2]){
            printf("%d %d",i+1,i+3);
            return 0;
        }
    }
    cout << -1 << ' ' << -1 << endl;
    return 0;
}


Measured memory_bytes: 3824
from bisect import bisect
n = int(input())
A = [int(input()) for i in range(n)]
ans = []
for a in A:
    i = bisect(ans,-a)
    if len(ans) == i:
        ans.append(-a)
    else:
        if -a<ans[i]: ans[i]=-a
print(len(ans))


Measured memory_bytes: 11036
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <utility>
#include <stack>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <climits>
#include <set>
#include <cmath>
#include <numeric>
#include <iomanip>

using namespace std;
const long long MOD = 1000000007;
long long three_power[100001];
int main(void){
  string L;
  cin >> L;
  three_power[0] = 1;
  for(int i = 1; i < L.size(); i++){
    three_power[i] = (three_power[i - 1] * 3) % MOD;
  }
  long long ans = 0;
  long long tmp = 1;
  for(int i = 0; i < L.size(); i++){
    if(L[i] == '1'){
      ans = (ans + (tmp * three_power[L.size() - i - 1]) % MOD) % MOD;
      tmp = (tmp * 2) % MOD;
    }
  }
  ans = (ans + tmp) % MOD;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1280
#include<cstdio>
#define N 200002
int d[N],e[N][2],f[N],g[N],i,k,n,s[N],t;
inline void swap(int&u,int&v){k=u,u=v,v=k;}
inline bool cmp(int u,int v){return(long long)e[u][1]*e[v][0]<(long long)e[v][1]*e[u][0];}
inline void up(int u){while(u>1&&cmp(s[u],s[u>>1]))swap(s[u],s[u>>1]),d[s[u]]=u,u>>=1,d[s[u]]=u;}
inline void put(int v){s[d[v]=++t]=v,up(t);}
inline int get()
{
    int u=1,v=2,w=s[1];
    for(d[w]=0,d[s[1]=s[t--]]=1;v<=t;swap(s[u],s[v]),d[s[u]]=u,d[s[u=v]]=v,v=u<<1)
    {
        if(v<t&&cmp(s[v|1],s[v]))v++;
        if(!cmp(s[v],s[u]))return w;
    }
    return w;
}
int find(int u){return f[u]?f[u]=find(f[u]):u;}
int j,u,v;long long x;
int main()
{
    scanf("%d",&n);
    for(i=2;i<=n;i++)scanf("%d",g+i);
    for(i=1;i<=n;i++)scanf("%d",&k),e[i][k]++;
    for(i=2;i<=n;i++)if(e[i][0])put(i);
    for(i=2;i<=n;i++)if(e[i][1])put(i);
    for(i=1;i<n;i++)u=get(),f[u]=v=find(g[u]),x+=(long long)e[v][1]*e[u][0],e[v][1]+=e[u][1],e[v][0]+=e[u][0],up(d[v]);
    return 0&printf("%lld\n",x);
}

Measured memory_bytes: 4864
import sys
import os
import math
import bisect
import collections
import itertools
import heapq
import re
import queue

# import fractions

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def dfs(S, N):
    if int(S) > N:
        return 0

    ret = 1 if all(S.count(s) for s in '753') else 0
    for s in '753':
        ret += dfs(S+s, N)
    return ret


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    print(dfs('0', N))


if __name__ == '__main__':
    main()


Measured memory_bytes: 3932
#!/usr/bin/env ruby

while line = gets
  cards = Hash.new(1)
  (1..10).each{ |num| cards[num] = 1}

  hA, hB, a = line.chomp!.split.map(&:to_i)
  cards[hA], cards[hB], cards[a] = 0, 0, 0

  myHands = hA + hB
  remain = 20 - myHands

  sum = 0
  bestCard = cards.select{|k,v| v==1 && k <= remain}.length
  puts bestCard > 3 ? "YES" : "NO"

end

Measured memory_bytes: 8600
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define ll long long
#define ld long double
#define fi first
//#define endl "\n"
#define se second
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define initialize(array,size,value) for(ll i=0;i<size;i++) array[i]=value
#define couta(array,size) for(ll i=0;i<size;i++) cout<<array[i]<<" "
#define debug(x) cout<<"x: "<<x<<endl
#define dbug(x,y) cout<<"x: "<<x<<"    "<<"y: "<<y<<endl
#define inf (long long int) 1e18
#define eps 0.000001
#define vl vector<ll> 
#define sl set<ll>
#define pll pair<ll, ll>
#define mll map<ll, ll> 
#define pq priority_queue<ll>
#define mod 1000000007
#define MAXN 100001
typedef tree<pll,null_type,less<pll>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
ll spf[MAXN]; 
ll gcd(ll a,ll b);
ll palindrome(string s);
ll modexp(ll a,ll b,ll m);
void sieve();
ll ceil(ll a, ll b);
vl getFactorization(ll x);
void getZarr(string str, ll Z[]);
vector<ll> prefix_function(string s);


int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    /*#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif*/
        
    ll a, b, c;
    cin>>a>>b>>c;
    if(a==b && b==c && c==a) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

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

ll palindrome(string s){
    ll l = 0;
    ll h = s.length() - 1;
    while (h > l){
        if (s[l++] != s[h--]){
            return 0;
        }
    }
    return 1;
}

ll modexp(ll a, ll b, ll m){
    if (b==0)
        return 1;
    ll temp = modexp(a,b/2,m);
    temp = (temp*temp)%m;
    if (b&1)
        return (temp*(a%m))%m; // if b is odd a^b = a^(b/2)*a^(b/2)*a
    return temp;
}

void sieve() { 
    spf[1] = 1; 
    for (ll i=2; i<MAXN; i++) 
        spf[i] = i; 
    for (ll i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (ll i=3; i*i<MAXN; i++) { 
        if (spf[i] == i) { 
            for (ll j=i*i; j<MAXN; j+=i) 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
} 


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

int main(){
  string S,T;
  cin >> S;

  string divide[4] = {"dream", "dreamer", "erase", "eraser"};
  
  reverse(S.begin(),S.end());
  for (int i = 0; i < 4; i++){reverse( divide[i].begin(),divide[i].end() );}

  bool can = true;
  /*
  for (int i = 0; i < S.size(); i++){
  手癖でi++にした結果1時間悩んだ
  */
  for(int i=0; i < S.size();){
    bool can2 = false;
    for (int j = 0; j < 4; j++){
      string d = divide[j];
      if(S.substr(i, d.size()) == d){
        can2 = true;
        i += d.size();
        //cout<<d<<"|"<<can2<<endl;
      }
    }
    if(!can2){
      can=false;
      break;
    }
  }
  
  if(can) cout << "YES" << endl;
  else cout << "NO" << endl;

}

/*
むずいので答えを見ました
思いつかん

☆substr関数 str.substr(start,longs) で使用
文字列strの内start文字目からlongsの長さ分だけ文字列を取得する。
*/

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define ll          long long int
#define uu          first
#define vv          second
#define pii         pair<int,int>
#define pll         pair<ll,ll>
#define fastio      ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const int INF = 1e9;
const ll MOD = 1e9 + 7;

const int N = 1e6 + 6;

int main()  {
    fastio;
    string s;
    cin>>s;
    int rem = 0;
    for(auto x : s) {
        rem *=10;
        rem += (x-'0');
        rem %=9;
    }
    if(rem) cout<<"No\n";
    else cout<<"Yes\n";
    return 0;
    
}

Measured memory_bytes: 3744
#include <bits/stdc++.h>
#include <vector>
#define rep(i,n) for(int i = 0; i < n; i++)
using ll = long long;
using namespace std;
int main(){
  char a[3];
  rep(i, 3) cin >> a[i];
  rep(i, 3){
    char b;
    cin >> b;
    if(b != a[2 - i]){
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}

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

int main(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if ((a+b)>(c+d)) {
        cout<<"Left"<<endl;
    }else if (a+b==c+d){
        cout<<"Balanced"<<endl;
    }else{
        cout<<"Right"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
/**
 * @author      : omgursocute
 * @created     : 2020-02-23 23:09 (UTC+7)	
 * @task        : D
 */

#include <bits/stdc++.h>

using namespace std;

#define int long long
const int mod = 1e9 + 7;

int add(int a, int b) {
	int ret = a + b;
	if(ret >= mod) return ret - mod;
	else return ret;
}

int sub(int a, int b) {
	int ret = a - b;
	if(ret >= 0) return ret;
	else return ret + mod;
}

int mul(int a, int b) {
	return (a * b) % mod;
}

int powmod(int a, int b) {
	int ret = 1;
	while(b) {
		if(b & 1) ret = mul(ret, a);
		b >>= 1;
		a = mul(a, a);
	}
	return ret;
}

int divide(int a, int b) {
	return mul(a, powmod(b, mod - 2));
}

int comb(int n, int k) {
	int ret = 1;
	for(int i = 1; i <= k; i++)
		ret = mul(ret, divide(sub(add(n, 1), i), i));
	return ret;
}

template <typename T>
inline void Read(T &x) {
	bool Neg = false;
	char c;
	for(c = getchar(); c < '0' || c > '9'; c = getchar())
		if(c == '-') Neg = !Neg;
	x = c - '0';
	for(c = getchar(); c >= '0' && c <= '9'; c = getchar())
		x = x * 10 + c - '0';
	if(Neg) x = -x;
}

template <typename T>
inline void Write(T x) {
	if(x < 0)
		putchar('-'); x = -x;
	T p = 1;
	for(T temp = x / 10; temp > 0; temp /= 10)
		p *= 10;
	for(; p > 0; x %= p, p /= 10)
		putchar(x / p + '0');
}

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

	int n, a, b;
	Read(n); Read(a); Read(b);
	int ans = sub(powmod(2, n), 1);
	ans = sub(ans, comb(n, a));
	ans = sub(ans, comb(n, b));
	cout << ans;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>	
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ld long double
#define pii pair <int, int>
#define sz(a) (int)(a.size()) 
#define resize(v) v.resize(unique(all(v)) - v.begin()); 
#define all(a) a.begin(), a.end()
#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)

// random_device rd; mt19937 g(rd());    
                                        	
using namespace std;
using namespace __gnu_pbds;
 
void Fast_Read_Out()
{
    ios_base::sync_with_stdio(0);
    cin.tie(), cout.tie();
}
 
void Random()
{
    unsigned int seed;                                                                        
    asm("rdtsc" : "=A" (seed));
    srand(seed);        
}
 
unsigned int Time()
{
     unsigned int time = clock() / 1000.00;                           
     return time;
}

template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; 
 
const int mod = (int)1e9 + 7;
const int N = (int)1e5 + 132;
 
int n, m;
int d[N], x[N], y[N], z[N];
int ans;
int p[N];

int Get(int v)
{
	if(p[v] == v) return v;
	return p[v] = Get(p[v]);
}

void Merge(int x, int y)
{
	x = Get(x), y = Get(y);
	if(x == y) return;
	p[x] = y;
}

int main ()
{
	#ifdef JUDGE
		freopen("input.txt", "r", stdin);
	#endif		
	Fast_Read_Out();
	Random();   
	cin >> n >> m;
	for(int i = 1; i <= n; i++) p[i] = i;
	for(int i = 1; i <= m; i++)
	{
		cin >> x[i] >> y[i] >> z[i];
		Merge(x[i], y[i]);
	}
	for(int i = 1; i <= n; i++) if(Get(i) == i) ans++;
	cout << ans;
}                                

Measured memory_bytes: 2304