akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <fstream>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>

using namespace std;

typedef long long ll;
typedef pair<int,int> PP;

/*
    freopen("input","r",stdin);
    freopen("output","w",stdout);
*/

int see[100010];

int main() {
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    vector<vector<int> > G(N + 1);
    memset(see, 0, sizeof(see));
    for (int i = 0;i < M;i++) {
    	int a, b;
    	cin >> a >> b;
    	G[a].push_back(b);
    	G[b].push_back(a);
    }
    ll res = 0;
    ll single = 0;
    ll e = 0, o = 0;
    for (int i = 1;i <= N;i++) {
    	if (see[i] != 0) continue;
    	queue<int> P, Q;
    	see[i] = 1;
    	P.push(i);
    	int sign = 1;
    	bool odds = 0;
    	ll ct = 1;
    	Q.push(sign);
    	while (P.size() > 0) {
    		int t = P.front();
    		int s = Q.front();
    		P.pop();
    		Q.pop();
    		for (int k = 0;k < G[t].size();k++) {
    			int j = G[t][k];
    			if (see[j] == 0) {
    				see[j] = 3 - s;
    				ct++;
    				P.push(j);
    				Q.push(3 - s);
    			}
    			else if (see[j] != 3 - s) odds = 1;
    		}
    	}
    	if (ct == 1) single++;
    	else if (odds == 1) o++;
    	else e++;
    }
    for (int i = 0;i < e;i++) {
    	res += 4 * i;
    	res += 2;
    }
    for (int i = 0;i < o;i++) {
    	res += 2 * e + 2 * i;
    	res++;
    }
    ll tol = N - single;
    for (int i = 0;i < single;i++) {
    	res += 2 * tol + 1;
    	tol++;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 7552
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<ll, ll>pll;
const int N = 2e5 + 5;
ll n, arr[N];
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n;
    for(int i = 1;i <= n;++i)
        cin >> arr[i];
    vector<ll>ans;
    for(int i = n;i >= 0;--i)
    {
        arr[i] %= 2;
        if(arr[i])
        {
            ans.push_back(i);
            for(ll j = 1;j * j <= i;++j)
            {
                if(i % j == 0)
                {
                    arr[j]++;
                    if(j != i / j)
                        arr[i / j]++;
                }
            }
        }
    }
    cout << ans.size() << '\n';
    for(auto &it : ans)
        cout << it << ' ';
    return 0;
}


Measured memory_bytes: 5724
import Control.Applicative
import Control.Monad

type Coord = (Int, Int)

solver :: [Coord] -> String
solver = unwords . (map show) . solver'

solver' :: [Coord] -> [Int]
solver' [(x1, y1), (x2, y2)] =
    let dx = x2 - x1
        dy = y2 - y1
        in [x2-dy, y2+dx, x1-dy, y1+dx]


myRead :: String -> [Coord]
myRead s = [(x, y), (z, w)]
    where (x:y:z:w:_) = (map read) . words $ s

main :: IO ()
main = getLine >>= putStrLn . solver . myRead


Measured memory_bytes: 508
#include <iostream>

using namespace std;

int n;
string s;

int main()
{
	cin >> n;
	getchar();
	cin >> s;
	char last = '\0';
	int count = 0;
	for (size_t i = 0; i < s.length(); i++)
	{
		if (s[i] != last)
		{
			count++;
			last = s[i];
		}
	}
	cout << count;
	return 0;
}

Measured memory_bytes: 512
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if i * 500 + j * 100 + k * 50 == x:
                count += 1
print(count)

Measured memory_bytes: 3060
n = gets.to_i
nums = []
n.times do nums.push(gets.to_i) end
minvalue = nums[0]
maxprofit = -1000000000
for count in 1..(n-1) do
  maxprofit = [maxprofit, nums[count]-minvalue].max
  minvalue = [minvalue, nums[count]].min
  #puts "#{maxprofit} #{minvalue}"
end
puts maxprofit


Measured memory_bytes: 8892
object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  val m  = sc.next().toList.groupMapReduce(identity)(_ => 1)(_ + _)
  if (m.values.toList.forall(v => v % 2 == 0)) {
    println("Yes")
  } else {
    println("No")
  }
}

Measured memory_bytes: 56016
import java.util.Scanner;

public class Main {
	public static void main (String [] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int array[] = new int[n];
		
		for (int i = 0; i < n; i++ ) {
			array[i] = scan.nextInt();
			System.out.print(array[i]);
			if ( i == n - 1) break;
			System.out.print(" ");
		}
		System.out.println();
		scan.close();
		

		
		for (int i = 1; i < n; i++) {
			int v = array[i];
			int j = i - 1;
			
			while ( j >= 0 && array[j] > v) {
				array[j + 1] = array[j];
				j--;
			}
			array[j + 1] = v;
			
			for (int k = 0; k < n; k++ ) {
				if ( k == n - 1) {
					System.out.println(array[k]);
				} else {
					System.out.print(array[k] + " ");
				}
				
			}
		}
		
	}
}



Measured memory_bytes: 31788
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush
from bisect import bisect, bisect_left, bisect_right

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = LIST()
B = LIST()
C = LIST()
A.sort()
B.sort()
C.sort()

# print(A)
# print(B)
# print(C)
ans = 0
for b in B:
    a = bisect_left(A, b)
    c = N - bisect_right(C, b)
    ans += a * c
    # print(a, c)
print(ans)




Measured memory_bytes: 23892
#include<cstdio>

int main(){
    int a, b, c, x;
    scanf("%d%d%d%d", &a, &b, &c, &x);
    int count = 0;
    for(int i = 0; i <= a; i++){
        for(int j = 0; j <= b; j++){
            for(int k = 0; k <= c; k++){
                if(i*500+j*100+k*50 == x) count++;
            }
        }
    }
    printf("%d\n", count);
    return 0;
}

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

int main(){
  long n, h;  cin >> n >> h;  
  vector<long> a(n), b(n);
  for(int i=0; i<n; i++)  cin >> a[i] >> b[i];
  sort(a.rbegin(), a.rend());
  sort(b.rbegin(), b.rend());
  long damage = 0, i = 0;
  while(i<n && damage<h && b[i]>=a[0])
    damage += b[i++];
  
  while(damage < h){
    damage += a[0];
    i++;
  }

  cout << i << endl;
  return 0;
}


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

#define ll long long int
using namespace std;

void abc137d();

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

void abc137d(){
    int n,m;
    map<int, vector<ll> > v;

    cin >> n >> m;
    for(int i=0; i<n; i++){
        ll a,b;
        cin >> a >> b;
        v[a].push_back(b);
    }

    priority_queue<ll> q;
    ll ans=0;
    for(int i=1;i<=m;i++){
        int vSize = v[i].size();
        for(int j=0; j<vSize;j++){
            q.push(v[i].at(j));
        }

        if(q.size()==0)continue;
        ans+=q.top();
        q.pop();
    }
    cout << ans << endl;
}


Measured memory_bytes: 10880
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef vector<int>vi;
typedef pair<int,int>pi;
typedef vector<pi>vpi;
typedef vector<vi>vvi;
#define double long double
#define pow powl
#define sqrt sqrtl
#define cbrt cbrtl
#define floor floorl
#define ceil ceill
#define pb push_back
#define ep emplace_back
#define PB pop_back
#define pf push_front
#define ef emplace_front
#define PF pop_front
#define mp make_pair
#define ub(a,b) upper_bound(all(a),b)-a.begin()
#define lb(a,b) lower_bound(all(a),b)-a.begin()
#define bs(a,b) binary_search(all(a),b)
#define mem(a,b) memset(a,b,sizeof(a))
#define in(a,n) FOR(i,0,n-1) cin>>a[i]
#define in1(a,n) FOR(i,1,n) cin>>a[i]
#define ff first
#define ss second
#define out(a,n) FOR(i,0,n-1) cout<<a[i]<<" ";cout<<endl;
#define out1(a,n) FOR(i,1,n) cout<<a[i]<<" ";cout<<endl;
#define clr(a) a.clear()
#define pow2(a) (1LL<<a)
#define all(a) a.begin(),a.end()
#define all1(a) a.begin()+1,a.end()
#define rall(a) a.rbegin(),a.rend()
#define rall1(a) a.rbegin(),a.rend()
#define sz(a) ((int)a.size())
#define FOR(i,a,b) for(auto i=a;i<=b;i++)
#define NFOR(i,a,b) for(auto i=a;i>=b;i--)
const int mod=1e9+7;

inline int add(int a,int b){return (a%mod + b%mod)%mod;}
inline int sub(int a ,int b){return (a%mod - b%mod + mod)%mod;}
inline int mul(int a,int b){a%=mod;b%=mod;return a*b%mod;}
inline int power(int a,int b,int MOD){a%=mod;int res=1;while(b){if(b&1){res*=a;res%=MOD;}a=a*a;a%=MOD;b>>=1;}return res;}

#define trace(x) cout<<#x<<" :: "<<x<<endl;
#define trace2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define trace3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define trace4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;
clock_t time_p = clock();
void time()
{
  time_p = clock() - time_p;
  cerr << "Time elapsed : " << (double)(time_p)/CLOCKS_PER_SEC <<endl;
}
signed main()
{
     SPEED;
     int d,n;
     cin>>d>>n;
     for(int i=1;;i++)
     {
           int x=i;
           int count=0;
           while(x%100==0)
            x/=100,count++;
           if(count==d)
            n--;
           if(n==0)
           {
                cout<<i<<endl;
                return 0;
           }
     }
     time();
     return 0;
}

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

int main(){
    int N;
    cin >> N;
    vector<int> p(N+1), a(N+1, 0);
    for(int i = 1;i <= N;i++)    cin >> p[i];
    int ans = 0;
    for(int i = 1;i <= N;i++){
        if(p[i] > 1)    a[p[i]] = a[p[i]-1]+1;
        else    a[p[i]] = 1;
        ans = max(ans, a[p[i]]);
    }
    cout << (N-ans) << endl;
}

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

int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  int r = 0;
  int bef = 0;
  int tmp = 0;
  for (int i = 0; i < n; i++) {
    tmp = vec.at(i);
    if (tmp != bef) {
      r += 1;
    }
    bef = tmp;
  }
  cout << r << endl;
}

Measured memory_bytes: 3608
N  = int(input())
L = list(map(int, input().split()))

ans = 0
for i in range(N - 2):
    a = [L[i], L[i + 1], L[i + 2]]
    a = sorted(a)
    if a[1] == L[i + 1]:
       ans += 1

print(ans)



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

int main() {
  int N,Z=0;
  cin>>N;
  vector<tuple<int,int,int>> p(2*N);
  for(int i=0;i<N*2;i++){
    int a,b;
    cin>>a>>b;
    p.at(i)=make_tuple(a,b,i/N);
  }
  vector<int> q(2*N);
  sort(p.begin(),p.end());
  for(int i=0;i<2*N;i++){
    int a,b,c;
    tie(a,b,c)=p.at(i);
    if(c==0){
      q.at(b)++;
    }
    else{
      for(int j=b;j>=0;j--){
        if(q.at(j)==1){
          Z++;
          q.at(j)=0;
          break;
        }
      }
    }
  }
  cout<<Z<<endl;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}
void OUT(bool b){cout<<(b?"YES":"NO")<<endl;}
void Out(bool b){cout<<(b?"Yes":"No")<<endl;}
void out(bool b){cout<<(b?"yes":"no")<<endl;}
template<class T>
void puta(T&&t){cout<<t<<endl;}
template<class H,class...T>
void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}

int popcnt(int x){return __builtin_popcount(x);}
int popcnt(ll x){return __builtin_popcountll(x);}
int bsr(int x){return 31 - __builtin_clz(x);}
int bsr(ll x){return 63 - __builtin_clzll(x);}
int bsf(int x){return __builtin_ctz(x);}
int bsf(ll x){return __builtin_ctzll(x);}

/*他のライブラリを入れる場所*/

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,m;
	while(cin>>n>>m,n){
		vi a(m,0);
		rep(i,n){
			int d,v; cin>>d>>v;
			a[d-1]=max(a[d-1],v);
		}
		cout<<accumulate(all(a),0)<<endl;
	}
	return 0;
}


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

using namespace std;

int my_max(int a, int b) {
    return a > b ? a : b;
}

int my_abs(int x) {
    return x < 0 ? -x : x;
}

unsigned long long dp[110][100010];

int main() {

    int n, w;
    int datas[100][2];
    cin >> n >> w;
    for(int i=0; i<n; i++) {
        cin >> datas[i][0] >> datas[i][1];
    }

    for(int i=0; i<=w; i++) {
        if(datas[0][0]<=i) {
            dp[0][i] = datas[0][1];
        }
        else {
            dp[0][i] = 0;
        }
    }

    for(int i=1; i<n; i++) {
        for(int j=0; j<=w; j++) {
            if(j-datas[i][0]>=0) {
                dp[i][j] = max(dp[i-1][j], datas[i][1]+dp[i-1][j-datas[i][0]]);
            }
            else {
                dp[i][j] = dp[i-1][j];
            }
        }
    }

    cout << dp[n-1][w] << endl;

    return 0;
}


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

int main(int argc, char const *argv[]) {
    long long l, r;
    cin >> l >> r;

    if ((r+1 - l) >= 2019) {
        cout << 0 << endl;
        return 0;
    }

    long long ans = 2020;
    for (long long i = l; i <= r; i++) {
        for (long long j = i+1; j <= r; j++) {
            ans = min(ans, (i*j)%2019);
        }
    }

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


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

#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define MP make_pair
#define test cout<<"test"<<endl;
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
const ll zero=0;
using P = pair<ll, ll>;
void chmin(ll &a,ll b){if(a>b)a=b;}
void chmax(ll &a,ll b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
void ans(bool x,ll y,ll z){if(x)cout<<y<<endl;else cout<<z<<endl;}
void ans(bool x,string y,string z){if(x)cout<<y<<endl;else cout<<z<<endl;}   
ll gcd(ll x,ll y){ll r;while((r=x%y)!=0){x=y;y=r;}return y;}

int main(){
  ll i,j,o;
  ll res=0,res1=INF,res2=-INF,buf=0;
  bool judge = true;
  ll n;cin>>n;
  vector<ll>a(n);
  for(i=0;i<n;i++)cin>>a[i];
  for(i=0;i<n;i++)res+=a[i]%2;
  ans2(res%2==0);
  return 0;
}

Measured memory_bytes: 1024
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();
		// スペース区切りの整数の入力
        for (int i = 0; i < n; i++) {
            int d = sc.nextInt();
            int x = 0;
            while (d % 2 == 0) {
                d /= 2;
                x++;
            }
            list.add(x);
        }
        Collections.sort(list);
		// 出力
		System.out.println(list.get(0));
	}
}


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

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        int [] vals = sc.nextIntArr(3);
        long sum =1l*vals[0]+vals[1]+vals[2];
        int[][]nxt = new int[3][n+1];
        nxt[0][n]=nxt[1][n]=nxt[2][n]=n;
        char[][]a= new char[n][2];
        for (int i =0;i<n;i++)a[i]=sc.next().toCharArray();
        for (int i =n-1;i>=0;i--){
            for (int j =0;j<3;j++)
                nxt[j][i]=nxt[j][i+1];
            if (i<n-1) {
                nxt[a[i+1][0] - 'A'][i] = i+1;
                nxt[a[i+1][1] - 'A'][i] = i+1;
            }
        }
        if (sum==0)
            pw.println("No");
        else {
            boolean valid = true;
            StringBuilder sol = new StringBuilder();
            for (int i =0;i<n;i++){
                char[]s = a[i];
                int id1=s[0]-'A';
                int id2=s[1]-'A';
                if (vals[id1]==vals[id2]&&vals[id1]==0){
                    valid=false;
                    break;
                }
                if (vals[id1]>vals[id2]){
                     sol.append(s[1]+"\n");
                     vals[id2]++;
                     vals[id1]--;
                }
                else if (vals[id1]<vals[id2]){
                    sol.append(s[0]+"\n");
                    vals[id2]--;
                    vals[id1]++;
                }
                else {
                    if (nxt[id1][i]<nxt[id2][i]){
                        sol.append(s[0]+"\n");
                        vals[id2]--;
                        vals[id1]++;
                    }
                    else {
                        sol.append(s[1]+"\n");
                        vals[id2]++;
                        vals[id1]--;
                    }
                }
            }
            if (valid){
                pw.println("Yes");
                pw.print(sol);
            }
            else pw.println("No");
        }
        pw.close();

    }
    static class Scanner {
        BufferedReader br;
        StringTokenizer st;

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

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

        public int[] nextIntArr(int n) throws IOException {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = Integer.parseInt(next());
            }
            return arr;
        }

    }

}


Measured memory_bytes: 58684
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  int A,B;
  cin >> S;
  A = S.find("A");
  B = S.find("B");
  if(A >= 0 && B >= 0){
  	cout << "Yes" << endl;
  }else{
  	cout << "No" << endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        Scanner scanner = new Scanner(System.in);

        int X = scanner.nextInt();
        int Y = scanner.nextInt();
        int Z = scanner.nextInt();




        System.out.println(Z + " " + X + " " + Y);
    }
}


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

using namespace std;

#define IOS 			ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ld			long double
#define ll 			long long
#define ull			unsigned long long
#define si(a)			a.size()
#define pb			push_back
#define mp			make_pair
#define F			first
#define S			second
#define lb			lower_bound
#define ub			upper_bound
#define deb(x)			cout<<"#x "<<x<<"\n";
#define trace(x,y)		cout<<"#x "<<x<<" #y "<<y<<"\n";
#define cn			cout<<"\n";
#define mod			1000000007


bool SBF(const pair<int,int>& a, const pair<int,int>& b){return a.F < b.F;}

bool SBS(const pair<int,int>& a, const pair<int,int>& b){return a.S < b.S;}



ll power(ll x, ll y){
	ll res = 1;
	x = x%mod;
	while(y){
	 	
                if(y&1)res = (res*x)%mod;
		y = y >> 1;
		x = (x*x)%mod;
	}
	return res;
}
ll modInv(ll x){
	return power(x , mod - 2);
}


const int INF = 1e9;





void solve(){ 
     ll d, t, s;
     cin >> d  >> t >> s;
     ll p = (d+s-1)/s;
     cout<<(p > t ? "No\n":"Yes\n");

}











int main(){

    solve();

}
















Measured memory_bytes: 3608
#include "bits/stdc++.h"
using namespace std;

int print(bool ok) {
        if (ok) cout << "Possible" << endl;
        else cout << "Impossible" << endl;
        return 0;
}

static const int INF = 0x3f3f3f3f;

int main() {
        int n;
        cin >> n;
        vector<int> a(n);
        int mi = INF;
        for (int i = 0; i < n; i ++) { 
                cin >> a[i];
                mi = min(mi, a[i]);
        }
        int mincnt = 0;
        for (int i = 0; i < n; i ++) {
                if (a[i] == mi) mincnt ++;
        }
        if (mincnt > 2) {
                return print(0);
        }
        int cnt[200] = { 0 };
        for (int i = 0; i < n; i ++) {
                cnt[a[i]] ++;
        }
        if (mincnt == 1) {
                for (int i = mi + 1; i <= 2 * mi; i ++) {
                        if (cnt[i] < 2) return print(0);
                }
                for (int i = 2 * mi + 1; i < 200; i ++) {
                        if (cnt[i] > 0) return print(0);
                }
                return print(1);
        }
        if (mincnt == 2) {
                for (int i = mi + 1; i < 2 * mi; i ++) {
                        if (cnt[i] < 2) return print(0);
                }
                for (int i = 2 * mi; i < 200; i ++) {
                        if (cnt[i] > 0) return print(0);
                }
                return print(1);
        }
}



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

using namespace std; 

#define pb push_back
#define fi first
#define se second
#define all(vec) vec.begin(),vec.end()
#define f(i,a,b) for(int i=a;i<b;i++)
#define fr(i,a,b) for(int i=a;i>=b;i--)
#define fp(i,a,b,p) for(int i=a;i<b;i+=p)
#define SZ(x) (int)x.size()

typedef  vector<string> vs;
typedef  vector<int> vi;
typedef  vector<long long> vl;	


int main(){
	
	
	string s;
	
	int cont = 0;
	
	cin >> s; 
	
	f(i,0,SZ(s)){
		if(s[i]=='+'){
			cont++;
		}else{
			cont--;
		}
	}
	
	cout << cont << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double PI = 4*atan(1);
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-6;
const string YES = "Possible";
const string NO = "Impossible";
#define pb push_back
#define mp make_pair

set<int> bad;
int N, K;
int D[15];

bool ok(int n)
{
	while(n){
		int d = n%10;
		if(bad.count(d)) return false;
		n/=10;
	}
	return true;
}

void solve()
{
	for(int i=0;i<K;++i) bad.emplace(D[i]);
	int ans = N;
	while(!ok(ans)){
		ans++;
	}
	printf("%d\n", ans);
}

int main()
{
	cin >> N >> K;
	for(int i=0;i<K;++i) cin >> D[i];
	solve();
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define SORT_INV(c) sort((c).begin(), (c).end(), greater<int>())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false
#define LL long long
// sort(a.begin(), a.end(), std::greater<int>());
using namespace std;

int main()
{
   int a,b;
   cin>>a>>b;
   int ans=0;
   ans=a-1;
   if(a<=b)ans++;
   cout<<ans<<endl;
   return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")

#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define sz size
#define f first
#define s second

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int S;

    cin >> S;

    int first = S / 100;
    int second = S % 100;

    if ((first > 12 || first == 0) && (second > 12 || second == 0))
        cout << "NA\n";
    else if ((first > 12 || first == 0) && (second <= 12 && second != 0))
        cout << "YYMM\n";
    else if ((first <= 12 && first != 0) && (second > 12 || second == 0))
        cout << "MMYY\n";
    else
        cout << "AMBIGUOUS\n";


    return 0;
}


Measured memory_bytes: 256
#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;

vector<bool> isPrime;

void sieve(int MAX) {
  if (MAX + 1 > isPrime.size()) isPrime.resize(MAX + 1, true);
  isPrime[0] = false;
  isPrime[1] = false;
  for (int i = 2; i * i <= MAX; ++i) {
    if (isPrime[i]) {
      for (int j = 2; i * j <= MAX; ++j) isPrime[i*j] = false;
    }
  }
}

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

  sieve(10000010);

  vector<int> cum(10000015);
  for (int i = 1; i <= 10000010; ++i) {
    cum[i] = cum[i-1];
    if (isPrime[i]) ++cum[i];
  }

  i64 n;
  while (cin >> n) {
    cout << cum[n] << "\n";
  }

  return 0;
}


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

int main() {
	int n;
	cin>>n;
	n = n % 10;
	switch(n){
		case 2:
		case 4:
		case 5:
		case 7:
		case 9: cout<<"hon"<<endl;break;
		case 0:
		case 1:
		case 6:
		case 8: cout<<"pon"<<endl;break;
		case 3: cout<<"bon"<<endl;break;
	}
	return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(ll i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
int mdx[8]={0,1,0,-1,1,1,-1,-1},mdy[8]={-1,0,1,0,1,-1,1,-1};


template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

string s;
int k;
int main(){
	cin>>s;
	cin>>k;
	for(int i=0;i<s.size()-1;i++){
		int co=((int)('z'-s[i])+1)%26;
		if(co<=k){
			k-=co;
			s[i]='a';
		}
	}
	k%=26;
	int t=(s[s.size()-1]-'a'+k)%26;
	s[s.size()-1]=(char)(t+'a');
	cout<<s<<endl;
	return 0;
}

Measured memory_bytes: 512
/**
DufauX-XuafuD
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define reset(x) memset(x,-1,sizeof(x))
#define CheckBit(a,b) (a&(1ll<<b))
#define SetBit(a,b) a=(a|(1ll<<b))
#define UnSetBit(a,b) a=(a&(~(1ll<<b)))
#define maxx 10000006
#define PI 2*acos(0.0)
const long long INF = 2000000000000000000LL;	// 2e18
const int inf = 0x3f3f3f3f;	// 1061109567
const long double EPS = 1e-9;
//bitset<maxx/2>vis;
//bitset<maxx>pr;
//int mobi[maxx+10];
//vector<ll>prime;
//void sieve(){
//    ll x=maxx/2, y=sqrt(maxx)/2;
//    for(ll i=1;i<=y;i++){
//        if(vis[i]==0){
//            for(ll j=(i*(i+1)*2);j<x;j+=(2*i)+1)
//                vis[j]=1;
//        }
//    }
//    prime.push_back(2);
//    for(ll i=3;i<maxx;i+=2)
//        if(vis[i/2]==0)
//        prime.push_back(i);
//}
//void generate_mobius()
//{
//    for(int i=0;i<maxx;i++)mobi[i]=1;
//    for(int i=2;i<maxx;i++){
//        if(!pr[i]){
//            mobi[i]*=-1;
//            for(int j=i+i;j<maxx;j+=i){
//                pr[j]=1;
//                mobi[j]*=(j%(i*i)?-1:0);
//            }
//        }
//    }
//}
//bool isprime(ll a)
//{
//    if(a==1)return false;
//    if(a==2)return true;
//    if(a%2==0)return false;
//    for(ll i=0;i<prime.size() && prime[i]*prime[i]<=a;i++)
//        if(a%prime[i]==0)return false;
//    return true;
//}
/* Calculate ( a*b ) %c */
inline ll mulmod(ll a, ll b, ll c) {
    ll ret = 0 , cur = a % c ;
    while(b) { if(b%2) ret=(ret+cur)%c; cur=(cur<<1)%c; b=b>>1; }
    return ret%c;
}
//Calculate (b^p)%m || modular inverse: b^-1 = bigmod(b, m-2, m)
inline ll bigmod(ll b, ll p, ll m){
    ll ret = 1, cur = b % m;
    while(p) { if(p&1) ret=(ret*cur)%m; cur=(cur*cur)%m; p=p>>1; }
    return ret;
}
inline ll modulo(ll a,ll b,ll c) { //Same as big mod, use for numbers over 1e10
    ll ret = 1 , cur = a%c ;
    while(b) { if(b%2) ret=mulmod(ret,cur,c); cur=mulmod(cur,cur,c); b=b>>1; }
    return ret%c ;
}
inline ll power(ll b, ll p){
    ll ret = 1, cur = b;
    while(p) { if(p&1) ret=(ret*cur); cur=(cur*cur); p=p>>1; }
    return ret;
}
ll lcm(ll a,ll b)
{
    return (a/__gcd(a,b))*b;
}
ll gcd(ll a,ll b)
{
    return __gcd(a,b);
}
void Dufaux()
{
    ll n;
    cin>>n;
    cout<<(n*(n+1))/2<<endl;
}
int main()
{
    FastIO;
	///sieve();
	///generate_mobius();
	int test=1;
	while(test--){
        Dufaux();
	}
	return 0;
}






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


int main() {
	int a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;
	if (a + b >= 2 * c) {
		if (x >= y) {
			if (a<=2*c) {
				int ans = 2 * y * c + a * (x - y);
				cout << ans << endl;
			}
			else {
				int ans = 2 * y * c + 2 * c * (x - y);
				cout << ans << endl;
			}
		}
		else {
			if (b<=2*c) {
				int ans = 2 * x * c + b * (y - x);
				cout << ans << endl;
			}
			else {
				int ans = 2 * x * c + 2 * c * (y - x);
				cout << ans << endl;
			}
		}
	}
	else {
		int ans = a * x + b * y;
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 256
tenchi ([]:_) = []
tenchi x =
  let c = map head x
      x'= map (drop 1) x
  in
    c:tenchi x'

sum' [] _ = []
sum' _ [] = []
sum' (a:as) (b:bs) = (a+b):(sum' as bs)

play [] = repeat 0
play (i:is) =
  let n = map (\e -> length $ filter (== e) i) i
      s = map (\(n,e) -> if n == 1
                         then e
                         else 0) $ zip n i
  in
    sum' s (play is)

ans i =
  let i' = tenchi i
  in
    play i'

main = do
  _ <- getLine
  c <- getContents
  let i = map (map read) $ map words $ lines c :: [[Int]]
      o = ans i
  mapM_ print o

Measured memory_bytes: 4260
X, Y, A, B, C = list(map(int, input().split()))

p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

shoku=[]

for i in range(X):
    shoku.append(p[i])

for j in range(Y):
    shoku.append(q[j])

shoku.sort()

r_num=0
for k in range(len(shoku)):
    if r_num == C:
        break

    if shoku[k] < r[r_num]:
        shoku[k] = r[r_num]
        r_num+=1

print(sum(shoku))


Measured memory_bytes: 23328
n,m = map(int,input().split())
x,y,z = [],[],[]
for i in range(n):
    a,b,c = map(int,input().split())
    x.append(a)
    y.append(b)
    z.append(c)
def ans1(x,y,z,m):
    w = []
    for i in range(n):
        w.append(x[i]+y[i]+z[i])
    w.sort(reverse=True)
    return sum(w[:m])
def ans2(x,y,z,m):
    w = []
    for i in range(n):
        w.append(x[i]+y[i]-z[i])
    w.sort(reverse=True)
    return sum(w[:m])
def ans3(x,y,z,m):
    w = []
    for i in range(n):
        w.append(x[i]-y[i]+z[i])
    w.sort(reverse=True)
    return sum(w[:m])
def ans4(x,y,z,m):
    w = []
    for i in range(n):
        w.append(x[i]-y[i]-z[i])
    w.sort(reverse=True)
    return sum(w[:m])
def ans5(x,y,z,m):
    w = []
    for i in range(n):
        w.append(-x[i]+y[i]+z[i])
    w.sort(reverse=True)
    return sum(w[:m])
def ans6(x,y,z,m):
    w = []
    for i in range(n):
        w.append(-x[i]+y[i]-z[i])
    w.sort(reverse=True)
    return sum(w[:m])
def ans7(x,y,z,m):
    w = []
    for i in range(n):
        w.append(-x[i]-y[i]+z[i])
    w.sort(reverse=True)
    return sum(w[:m])
def ans8(x,y,z,m):
    w = []
    for i in range(n):
        w.append(-x[i]-y[i]-z[i])
    w.sort(reverse=True)
    return sum(w[:m])
ans = max(ans1(x,y,z,m),ans2(x,y,z,m),ans3(x,y,z,m),ans4(x,y,z,m),ans5(x,y,z,m),ans6(x,y,z,m),ans7(x,y,z,m),ans8(x,y,z,m))
print(ans)

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

using namespace std;

bool has_only_allowed(int num,set<int>&allowed)
{
    while(num>0)
    {
        if(allowed.find(num%10)==allowed.end())
            return false;
        num/=10;
    }
    return true;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,k,i,j;
    cin>>n>>k;
    set<int>allowed;
    for(int i=0; i<10; i++)
    {
        allowed.insert(i);
    }

//cout<< allowed<< "\n";
for(int i=0; i<k; i++)
{
    int a;
    cin>>a;
    allowed.erase(a);
}


while(true)
{
    if(has_only_allowed(n,allowed))
    {
        cout<<n;
        break;
    }
    n++;
}
cout<< "\n";
return 0;
}



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

using namespace std;

#define int long long
#define  IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

const int INF = 1e9;

signed main() {
    int n;
    cin>>n;
    int x=n-1;
    int ans=0;
    for(int i=1;i*i<=x;i++) {
        if(x%i==0) {
            int f=i;
            int s=x/i;
            ans++;
            if(f!=s) ans++;
        }
    }
    for(int i=2;i*i<=n;i++) {
        int p=i,ch=0;
        while(p<=n) {
            if(p==n) {
                ch=1;
                break;
            }
            if(n%p==0 && ((n/p)-1)%i==0) {
                ch=1;
                break;
            }
            p=p*i;
        }
        if(ch) ans++;
    }
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

namespace A_SMTB2019
{
    class MainClass
    {

        static int[] s, n;

        public static void Main(string[] args)
        {
            s = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);
            n = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);

            if(s[0]==12){
                if(n[0]==1){
                    WriteLine(1);
                }else{
                    WriteLine(0);
                }
            }else{
                if(s[0]+1==n[0]){
                    WriteLine(1);
                }else{
                    WriteLine(0);
                }
            }
        }
    }
}


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




int main(){
    long long int n;
    cin >> n;
    long long int h[5];
    for(int i = 0; i < 5; i++){
        cin >> h[i];
    }
    sort(h,h+5);

    long long int group = n / h[0];

    long long int  remain;

    if(n%h[0] == 0){
        remain = 0;
    }else{
        remain = 1;
    }

    long long int ans = group + 4 + remain;

    cout << ans << endl;
   
}

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

import math

def main():

    a, b, degree = map(int, input().split())

    radian = math.radians(degree)

    S = 0.5*a*b*math.sin(radian)
    x = a + b + math.sqrt(pow(a,2)+pow(b,2)-2*a*b*math.cos(radian))
    print('%.8f' % S)
    print('%.8f' % x)
    print('%.8f' % ((2*S)/a))



if __name__ == '__main__':
    main()

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

using namespace std;

typedef long long int ll;

const int N = 1e5 + 5;

vector < vector < pair < int, int > > > adjy(N, vector < pair < int, int > > ()), adjs(N, vector < pair < int, int > > ());
vector < ll > ds(N, 1e17), dy(N, 1e17);

vector < ll > djsktra(vector < vector < pair < int, int > > > adj, int s){
  vector < ll > d(N, 1e17);
  d[s] = 0;
  priority_queue < pair < ll, int >, vector < pair < ll, int > >, greater < pair < ll, int > > > q;
  q.push({d[s], s});
  while(!q.empty()){
    int u = q.top().second;
    ll d_u = q.top().first;
    q.pop();
    if(d_u != d[u]) continue;
    for(auto edge : adj[u]){
      int to = edge.first, len = edge.second;
      if(d[to] > d[u] + len){
        d[to] = d[u] + len;
        q.push({d[to], to});
      }
    }
  }
  return d;
}

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

  int n, m, s, t;
  cin >> n >> m >> s >> t;
  for (int i = 0; i < m; i++) {
    int u, v, a, b;
    cin >> u >> v >> a >> b;
    adjy[u].push_back({v, a});
    adjy[v].push_back({u, a});
    adjs[u].push_back({v, b});
    adjs[v].push_back({u, b});
  }

  ds = djsktra (adjs, t);
  dy = djsktra (adjy, s);

  vector < ll > ans(n);
  ans[n - 1] = dy[n] + ds[n];
  for(int i = n - 2; i >= 0; i--){
    ans[i] = min(ans[i + 1], dy[i + 1] + ds[i + 1]);
  }

  ll p = 1e15;
  for(int i = 0; i < n; i++){
    cout << p - ans[i] << '\n';
  }
}


Measured memory_bytes: 22640
def unite(rt, x, y):
	tx = x
	ty = y
	if tx > ty:
		tx, ty = ty, tx
	rt[ty] = tx
def find(rt, x):
	if rt[x] == -1 or rt[x] == x:
		return x
	else:
		rt[x] = find(rt, rt[x])
		return rt[x]
def main():
	n, m = map(int, input().split())
	rt = [-1]*(n+1)
	ans = n
	for i in range(m):
		x, y, z = map(int, input().split())
		root_x = find(rt, x)
		root_y = find(rt, y)
		if root_x == -1 or root_y == -1:
			pass
		elif root_x == root_y:
			continue
		ans -= 1
		unite(rt, root_x, root_y)
	print(ans)
main()

Measured memory_bytes: 5316
#include<stdio.h>
#include<math.h>

#define MAX 100

 
int m[MAX][MAX];
 
void Matrix(int p[],int hp){
  int i,j,k,l,q;

  for(i=1;i<=hp;i++) m[i][i] =0;
  for(l=2;l<=hp;l++){
    for(i=1;i<=hp-l+1;i++){
      j=i+l-1;
      m[i][j]=100000;
      for(k=i;k<=j-1;k++){
       q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
       if(m[i][j]>q) m[i][j] =q;
      }
    }
  }
}
 
int main(){
  int i,n;
  int col[MAX],row[MAX],p[MAX+100];
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d %d",&col[i],&row[i]);
    }
  
  for(i=0;i<n+1;i++){
    if(i==0) p[i]=col[0];
    else if(i==n) p[i]=row[n-1];
    else p[i]=col[i];
  }
   Matrix(p,n);
  printf("%d\n",m[1][n]);
}



Measured memory_bytes: 2052
from collections import Counter
from operator import itemgetter
N, K, Q = map(int, input().split())
A = [int(input()) for _ in range(Q)]
D = {i: 0 for i in range(1, N+1)}
D.update(Counter(A))
P = ["Yes" if K - (Q - k) > 0 else "No" for a, k in sorted(D.items(), key=itemgetter(0))]
print(*P, sep="\n")

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


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);

    int N; cin >> N;
    vector<int> A(N); rep(i, N) cin >> A[i];

    set<int> B;
    for (auto a : A) {
        if (B.count(a) == 1) {
            B.erase(a);
        } else {
            B.insert(a);
        }
    }
    int ans = B.size();
    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 8296
#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <utility>
#include <functional>
#include <queue>
#include <cmath>
#include <numeric>
#include <unordered_map>
#define REP(i, N) for(int i=0; i<N; i++)
using namespace std;

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

int main() {
	int N;

	cin >> N;

  	vector<int> a(N);
  
  unordered_map<int,int> count;
  set<int> appeared;
  
    for (auto& i : a) {
      cin >> i;
      
      count[i]++;
      appeared.insert(i);
    }
  
  
  if (appeared.size() == 3) {
    int tmp = 0, tmpc = -1;
      for (int i : appeared) {
        tmp ^= i;
        if (tmpc >= 0 && tmpc != count[i]) {
          cout << "No" << endl;
          return 0;
        }
        tmpc = count[i];
      }
    
    if (tmp == 0) {
		cout << "Yes" << endl;
      return 0;
    }
  }
  
  if (appeared.size() == 2 && count[*appeared.rbegin()] == count[0] * 2)
	 cout << "Yes" << endl;
  else if (appeared.size() == 1 && *appeared.rbegin() == 0)
	 cout << "Yes" << endl;
  else
     cout << "No" << endl;
  

	return 0;
}


Measured memory_bytes: 7588
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


int main(){

	int K;
	char buf[105];

	scanf("%d",&K);
	scanf("%s",buf);

	for(int i = 0; buf[i] != '\0'; i++){
		if(i >= K){

			printf("...");
			break;
		}else{

			printf("%c",buf[i]);
		}
	}
	printf("\n");

	return 0;
}


Measured memory_bytes: 3820
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> pi;
#define f first
#define s second
#define FAST ios_base::sync_with_stdio(0); cin.tie(0);
#define all(x) x.begin(),x.end()

const int maxn = 2010;
const int INF = LLONG_MAX/2;

int n,k,q;
int A[maxn];

int32_t main() {
	FAST
	cin >> n >> k >> q;
	int ans = INF;
	for (int i=0;i<n;i++) cin >> A[i];
	for (int i=0;i<n;i++) {
		int x = A[i]; // Fix x value
		
		vector <int> curv,options;
		for (int j=0;j<n;j++) {
			if (A[j] >= x) curv.push_back(A[j]);
			else { //1 segment
				sort(all(curv));
				if (curv.size() >= k) {
					curv.resize(curv.size()-k+1);
					for (auto xd: curv) options.push_back(xd);
				}
				curv.clear();
			}
			//cout << A[i] << " " << A[j] << " " << options.size() << "\n";
		}
		sort(all(curv));
		if (curv.size() >= k) {
			curv.resize(curv.size()-k+1);
			for (auto xd: curv) options.push_back(xd);
		}
		
		sort(all(options));
		if (options.size() >= q) ans = min(ans, options[q-1] - x);
	}
	cout << ans;
}








Measured memory_bytes: 384
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
#define rep(begin, i, end) for (int i = begin; i < (int)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    ll H, W;
    cin >> H >> W;
    vector<vector<char>> grid(H, vector<char>(W));

    queue<Pll> que, que2;

    rep(0, i, H)
    {
        rep(0, j, W)
        {
            cin >> grid.at(i).at(j);
            if (grid.at(i).at(j) == '#')
            {
                que.push(make_pair(i, j));
            }
        }
    }

    ll ans = 0;

    vector<ll> dx(4), dy(4);
    dx = {1, 0, -1, 0};
    dy = {0, 1, 0, -1};

    vector<vector<ll>> memo(H, vector<ll>(W, 0));

    while (!que.empty())
    {
        Pll a = que.front();
        que.pop();
        que2.push(a);

        memo.at(a.first).at(a.second) = 1;

        ll n_b = 1, n_w = 0;

        while (!que2.empty())
        {
            Pll v = que2.front();
            que2.pop();

            ll x = v.first;
            ll y = v.second;

            rep(0, i, 4)
            {
                ll nx = x + dx.at(i);
                ll ny = y + dy.at(i);

                if (nx < 0 || nx >= H || ny < 0 || ny >= W || memo.at(nx).at(ny) == 1 || grid.at(nx).at(ny) == grid.at(x).at(y))
                {
                    continue;
                }
                else
                {
                    if (grid.at(nx).at(ny) == '#')
                    {
                        n_b++;
                    }
                    else
                    {
                        n_w++;
                    }
                    que2.push(make_pair(nx, ny));
                    memo.at(nx).at(ny) = 1;
                }
            }
        }
        
        ans += n_b * n_w;
    }

    cout << ans << endl;
}

Measured memory_bytes: 6620
/*
ID: leezhen
TASK: practice
LANG: C++11
*/
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<pair<int, int> > vii;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define inf 1e9
#define REP(i, a, b) for (int i = int(a); i < int(b); i++)

// struct

// data
int n;
int d[100010];
int cnt[100010];
const int mod = 998244353;

int my_pow(int base, int e) {
  if (e == 1) return base % mod;
  if (e % 2 == 1) {
    return (1LL * base * my_pow(base, e - 1)) % mod;
  } else {
    return my_pow((1LL * base * base) % mod, e / 2);
  }
}

void solve() {
  REP(i, 0, n) { cnt[d[i]]++; }
  ll ans = 1;
  if(cnt[0] != 1 || d[0] != 0) {
      printf("0\n");
      return;
  }
  REP(i, 1, n) {
    if (cnt[i] != 0 && cnt[i - 1] == 0) {
      printf("0\n");
      return;
    }
  }
  REP(i, 1, n) {
    if (cnt[i] == 0) break;
    ans *= my_pow(cnt[i - 1], cnt[i]);
    ans %= mod;
  }
  printf("%lld\n", ans);
}

int main() {
  scanf("%d", &n);
  REP(i, 0, n) scanf("%d", &d[i]);
  solve();
  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair

using namespace std;

typedef long long LL;
typedef pair<int, int> pii;

template <typename T> inline int Chkmax (T &a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> inline int Chkmin (T &a, T b) { return a > b ? a = b, 1 : 0; }

template <typename T> inline T read(){
    T sum = 0;
    int fl = 1,ch = getchar();
    for(; !isdigit(ch); ch = getchar()) if(ch == '-') fl = -1;
    for(; isdigit(ch); ch = getchar()) sum = (sum << 3) + (sum << 1) + ch - '0';
    return sum * fl;
}

string s;

inline void Solve (){
	if(s[0] == 'S'){
		printf("Cloudy\n");
	}
	if(s[0] == 'C'){
		printf("Rainy\n");
	}
	if(s[0] == 'R'){
		printf("Sunny\n");
	}
}

inline void Input (){
	cin >> s;
}

int main(){
	Input();
	Solve();
	return 0;
}

Measured memory_bytes: 256