akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
/*
    s.find_by_order(k) ---> returns iterator to the element at index(from 0) k
    s.order_of_key(val) ---> number of elements that are strictly smaller than the given value
*/
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long int> vl;
typedef vector<vector<int>> vvi;
typedef vector<vector<long long int>> vvl;
typedef pair<int, int> pii;
typedef pair<long long int, long long int> pll;
typedef vector<pair<int, int>> vii;
typedef vector<pair<long long int, long long int>> vll;
#define fastIO() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define test() long long int tc; cin >> tc; cin.ignore(); while(tc--) 
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define MOD 1000000007
#define SMOD 998244353
#define HASH 18014398241046527
#define pq priority_queue
#define all(x) x.begin(),x.end()
#define SP(x) setprecision(x)
#define sp " "
#define inp(a) ll a;cin>>a;cin.ignore()
#define inps(a,b) ll a,b;cin>>a>>b;cin.ignore()
#define out(a) cout<<SP(20)<<a<<'\n'
#define outs(a,b) cout<<SP(20)<<a<<" "<<b<<'\n'
#define ins insert
#define er erase
#define lb lower_bound
#define ub upper_bound
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define inpa(a,n) ll a[n]; for(int i=0; i<n; i++){cin>>a[i];}
#define inpv(a,n) vl a; for(int i=0; i<n; i++){inp(x);a.pb(x);}
#define outa(a,n) for(int i=0;i<n;i++){cout<<a[i]<<" ";}cout<<'\n';
#define outv(v) for(auto i:v){cout<<i<<" ";}cout<<'\n';
set<char> vow = {'a','e','i','o','u','A','E','I','O','U'};
ll xpow(ll n, ll m){if(m==0){return 1;}else{ll x = xpow(n, m/2);if(m&1){return x*x*n;}else{return x*x;}}}
ll xmod(ll a, ll m){return (((a%m)+m)%m);}
ll xmodpow(ll n, ll m, ll y){if(m==0){return 1;}else{ll x = xmodpow(n, m/2, y);if(m&1){return xmod((xmod((xmod(x,y)*xmod(x,y)),y)*xmod(n,y)),y);}else{return xmod((xmod(x,y)*xmod(x,y)),y);}}}
template <typename T>
ll SIZEOF(T a){return (ll)a.size();}
ll xlcm(ll a, ll b){return (a/__gcd(a, b))*b;}

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


const int N = 1000005;




void SOLVE(){
    ll ans = 0;
    ll n;
    cin >> n;
    ll a[n];
    for(ll i=0; i<n; i++){
        cin >> a[i];
    }
    ll sum = 0;
    for(ll i=n-1; i>=0; i--){
        ans = xmod(ans + sum*a[i], MOD);
        sum = xmod(sum + a[i], MOD);
    }
    cout << ans << endl;
}

int main() {
	fastIO();
	// #ifndef ONLINE_JUDGE
    //     freopen("i.txt", "r", stdin);
    //     freopen("o.txt", "w", stdout);
	// #endif

    ll TC = 1;
    // cin >> TC;
    for(ll tc1=1; tc1<=TC; tc1++){
        // cout << "Case #" << tc1 << ": ";
        SOLVE();
    }
    printclock;
}

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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

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

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

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  int n, k;
  cin >> n >> k;
  vector<int> p(n);
  rep(i, n) cin>> p[i];

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

  int ans = 0;
  rep(i, k){
    ans += p[i];
  }

  cout << ans << endl;

  return 0;
}


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

struct pt {
	int x, y;
	pt() {}
	pt(int x, int y) : x(x), y(y) {}
	void output () {
		cerr << x << "," << y << endl;
	}
};

const int N = 110000;
pt a[N];
int x[N], xn;

bool operator < (const pt &p1, const pt & p2) {
	if (p1.x != p2.x) return p1.x < p2.x;
	return p1.y < p2.y;
}

pt operator - (pt p1, pt p2) {
	return pt(p1.x - p2.x, p1.y - p2.y);
}

long long vect(pt p1, pt p2) {
	return 1LL * p1.x * p2.y - 1LL * p2.x * p1.y;
}

long long vect(pt p, pt p1, pt p2) {
	return vect(p1 - p, p2 - p);
}

pt up[N], down[N]; int upn, downn;
long long le[N], ri[N];

int main() {
	ios_base::sync_with_stdio(0);
	int n; cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i].x >> a[i].y;
	for (int i = 0; i < n; i++) x[xn++] = a[i].x;
	sort(a, a + n);
	sort(x, x + n);
	xn = unique(x, x + n) - x;
	upn = downn = 0;
	int now = 0;
	long long area = 0;
	for (int i = 0; i < xn; i++) {
		for (; a[now].x == x[i] && now < n; now++) {
			while (upn > 1 && vect(up[upn - 2], up[upn - 1], a[now]) <= 0) {
				area -= vect(up[upn - 2], up[upn - 1]);
				upn--;
			}
			if (upn) area += vect(up[upn - 1], a[now]);
			up[upn++] = a[now];
			while (downn > 1 && vect(a[now], down[downn - 1], down[downn - 2]) <= 0) {
				area -= vect(down[downn - 1], down[downn - 2]);
				downn--;
			}
			if (downn) area += vect(a[now], down[downn - 1]);
			down[downn++] = a[now];
		}
		le[i] = area;
	}
	upn = downn = 0;
	area = 0;
	now = n-1;
	for (int i = xn; i >= 0; i--) {
		for (; a[now].x == x[i] && now >= 0; now--) {
			while (upn > 1 && vect(up[upn - 2], up[upn - 1], a[now]) <= 0) {
				area -= vect(up[upn - 2], up[upn - 1]);
				upn--;
			}
			if (upn) area += vect(up[upn - 1], a[now]);
			up[upn++] = a[now];
			while (downn > 1 && vect(a[now], down[downn - 1], down[downn - 2]) <= 0) {
				area -= vect(down[downn - 1], down[downn - 2]);
				downn--;
			}
			if (downn) area += vect(a[now], down[downn - 1]);
			down[downn++] = a[now];
		}
		ri[i] = area;
	}
	long long ans = ri[0];
	for (int i = 0; i < xn; i++) ans = min(ans, le[i] + ri[i + 1]);
	cout << (ans+1)/2 << endl;
	return 0;
}



Measured memory_bytes: 6680
N=int(input())
A1=list(map(int, input().split()))
A2=list(map(int, input().split()))
ans=A1[0]+sum(A2)
tmp=A1[0]+sum(A2)
for i in range(1, N):
  tmp+=A1[i]-A2[i-1]
  ans=max(tmp, ans)
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <stdio.h>
#include <math.h>

int main()
{
	double x1, y1, x2, y2;
	scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2);
	double d = sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
	printf("%lf\n",d);
}


Measured memory_bytes: 3208
#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<climits>
#include<algorithm>
using namespace std;

int main(void)
{
	string S;
	cin >> S;

	int ans = INT_MAX;
	string color = "01";
	for (int i = 0; i < 2; i++) {
		int cnt = 0;
		int index = i;
		for (int j = 0; j < (int)S.size(); j++) {
			if (S[j] != color[index])
				cnt++;

			index++;
			index %= 2;
		}

		ans = min(ans, cnt);
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 512
#include<stdio.h>                                                         
                                                                          
int main(void){                                                           
                                                                          
  int a,b;                                                                
                                                                          
  scanf("%d %d",&a,&b);                                                   
                                                                          
  if(a < b) {                                                             
    printf("a < b\n");                                                      
  } else if (a > b) {                                                     
    printf("a > b\n");                                                      
  } else {                                                                
    printf("a == b\n");                                                     
  }                                                                       
                                                                          
  return 0;                                                               
}                                                                         
 

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

using namespace std;

const int N = 50;

typedef complex<long double> point;
#define EPS 1e-9
#define X real()
#define Y imag()
#define cross(a,b) ((conj(a)*(b)).imag())
#define vec(a,b) ((b)-(a))
#define dot(a,b) ((conj(a)*(b)).real())
#define lengthSqr(v) (dot(v,v))
#define length(v) ((long double)hypot((v).Y,(v).X))
#define mid(a,b) (((a)+(b))/point(2,0))
#define perp(a) (point(-(a).Y,(a).X))

point p[N], r[3], cen;
int ps, rs;
long double rad;

enum STATE {
  IN, OUT, BOUNDRY
};

bool intersect(const point &a, const point &b, const point &p, const point &q, point &ret) {
  //handle degenerate cases
  long double d1 = cross(p - a, b - a);
  long double d2 = cross(q - a, b - a);
  ret = (d1 * q - d2 * p) / (d1 - d2);
  if (fabs(d1 - d2) > EPS)
    return 1;
  return 0;
}

void circle2(const point& p1, const point& p2, point& cen, long double& r) {
  cen = mid(p1, p2);
  r = length(vec(p1, p2)) / 2;
}

bool circle3(const point& p1, const point& p2, const point& p3, point& cen, long double& r) {
  point m1 = mid(p1, p2);
  point m2 = mid(p2, p3);
  point perp1 = perp(vec(p1, p2));
  point perp2 = perp(vec(p2, p3));
  bool res = intersect(m1, m1 + perp1, m2, m2 + perp2, cen);
  r = length(vec(cen, p1));
  return res;
}

STATE circlePoint(const point & cen, const long double & r, const point& p) {
  long double lensqr = lengthSqr(vec(cen, p));
  if (fabs(lensqr - r * r) < EPS)
    return BOUNDRY;
  if (lensqr < r * r)
    return IN;
  return OUT;
}

void mec() {
  if (rs == 3) {
    circle3(r[0], r[1], r[2], cen, rad);
    return;
  }
  if (rs == 2 && ps == 0) {
    circle2(r[0], r[1], cen, rad);
    return;
  }
  if (!ps) {
    cen = r[0];
    rad = 0;
    return;
  }
  ps--;
  mec();
  if (circlePoint(cen, rad, p[ps]) == OUT) {
    r[rs++] = p[ps];
    mec();
    rs--;
  }
  ps++;
}

int main() {
  cin >> ps;
  for(int i = 0; i < ps; ++i) {
    int x, y; cin >> x >> y;
    p[i] = point(x, y);
  }
  random_shuffle(p, p + ps);
  mec();
  printf("%.17Lf\n", rad);
  return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<cstdio>
using namespace std;
int n;
int main()
{
	scanf("%d",&n);
	if(n==1) puts("No");
	else if(n&1)
	{
		puts("Yes");
		for(int i=2;i<=n;i+=2)
		printf("%d %d\n%d %d\n%d %d\n%d %d\n",n+i,i+1,i+1,1,1,i,i,n+i+1);
		printf("%d %d\n",n+2,n+1);
	}
	else 
	{
		for(int j=2;j<n;j++)
		if((n^j^1)<n)
		{
			puts("Yes");
			for(int i=2;i<n;i+=2)
			printf("%d %d\n%d %d\n%d %d\n%d %d\n",n+i,i+1,i+1,1,1,i,i,n+i+1);
			printf("%d %d\n%d %d\n",n,j,n+n,n^j^1);
			printf("%d %d\n",n+2,n+1);
			return 0;
		}
		puts("No");
	}
	return 0;
}
		

Measured memory_bytes: 2304
//
//  main.cpp
//  D - Menagerie
//
//  Created by teddywang on 2017/2/18.
//  Copyright © 2017年 teddywang. All rights reserved.
//

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int n;
char s[100019];
char t[100010];
int main()
{
    while(cin>>n)
    {
        memset(t,0,sizeof(t));
        scanf("%s",s);
        int flag=0;
        for(int k=0;k<4;k++)
        {
            if(flag==1)
            {
                //printf("%s\n",t);
                break;
            }
            if(k>=2) t[0]='S';
            else t[0]='W';
            if(k%2) t[1]='S';
            else t[1]='W';
            for(int i=1;i<n-1;i++)
            {
                if((s[i]=='o'&&t[i]=='S')||(s[i]=='x'&&t[i]=='W'))
                {
                    t[i+1]=t[i-1];
                }
                else
                {
                    if(t[i-1]=='W') t[i+1]='S';
                    else
                    {
                        t[i+1]='W';
                    }
                }
            }
            int flag1=0,flag2=0;
            char buf;
            if((s[0]=='o'&&t[0]=='S')||(s[0]=='x'&&t[0]=='W'))
            {
                buf=t[1];
            }
            else
            {
                if(t[1]=='W') buf='S';
                else
                {
                    buf='W';
                }
            }
            if(buf==t[n-1]) flag1=1;
            //cout<<buf<<" "<<t[n-1]<<endl;
            if((s[n-1]=='o'&&t[n-1]=='S')||(s[n-1]=='x'&&t[n-1]=='W'))
            {
                buf=t[n-2];
            }
            else
            {
                if(t[n-2]=='W') buf='S';
                else
                {
                    buf='W';
                }
            }
            if(buf==t[0]) flag2=1;
            if(flag1==1&&flag2==1) flag=1;
        }
        if(flag==1) printf("%s\n",t);
        if(flag==0)
            cout<<-1<<endl;
    }
}

Measured memory_bytes: 512
fun main(args: Array<String>) {
    abc145e()
}

private data class Food(val time: Int, val point: Int)

fun abc145e() {
    val (n, t) = readLine()!!.split(' ').map { it.toInt() }
    val foods = (1..n).map { readLine()!!.split(' ').map { it.toInt() } }
        .map { Food(it[0], it[1]) }
        .sortedBy { it.time }
        .toMutableList()

    // [何番目までの料理の中から選んだか][この時間以内に完食] = pointの最大値
    val dp = Array(n + 1) { IntArray(t) { 0 } }
    dp[0][0] = 0
    var answer = 0

    for (i in 1..n) {
        val f = foods[i - 1]
        for (time in 0 until t) {
            dp[i][time] = dp[i - 1][time]
            answer = Math.max(answer, dp[i][time] + f.point)
            if (time - f.time >= 0) {
                dp[i][time] = Math.max(dp[i][time], dp[i - 1][time - f.time] + f.point)
            }
        }
    }

    println(answer)
}


Measured memory_bytes: 86512
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<utility>
#include<array>
#include<cassert>
#include<list>
#include<experimental/any>
#include<cstring>
#include<cctype>
#include<ctime>
#include<cstdbool>
#include<cstdint>
#include<cstddef>
#include<set>
#include<unordered_set>
#include<bitset>
 
using namespace std;
using experimental::any;
 
#define SPEEDY cin.tie(0);ios::sync_with_stdio(false);
 
#define REP(i,n) for(int i=0;i<(n);i++)
#define ARREP(i,n,X) for(int i=0;i<(n);i++)cin>>X[i]
#define FOR(i,X,n) for(int i=(X);i<(n);i++)
#define EREP(i,n) for(int i=1;i<=n;i++)
#define BitFOR(N) REP(Bit,1<<(N))
 
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define DEB2(X) cout<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define TFDEB(f) (f)? cout<<"true ":cout<<"false ";
#define FORDEB(n,X) for(int i=0;i<(n);i++)ARDEB(i,X)
#define END cout<<endl;
#else
#define DEB(X) {}
#define DEB2(X) {}
#define ARDEB(i,X) {}
#define TFDEB(f) {}
#define FORDEB(n,X) {}
#define END {}
#endif
 
typedef long long int ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
#define ALL(X) X.begin(),X.end()
struct edge{int to,cost;};
//struct edge{int from,cost,to;};
struct P2{int x,y;};
#define BIT(Bit,n) bitset<n>(Bit)
#define Endl endl
 
const int MOD7=1000000007;
const int INF=100000000;
const int SET=1000;
 
int main(){
	int n,a,b;
	cin>>n>>a>>b;
	cout<<(n-a)%b<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
while(1){
    int x;
    x=getchar();
    
    if(x==-1)
    break;
    else if(65<=x&&90>=x)
    x+=32;
    else if(97<=x&&122>=x)
    x-=32;
  
    putchar(x);
}
printf("\0\n");

    return 0;
}

Measured memory_bytes: 2476
# 054_a
A, B = map(int, input().split())
if (1 <= A & A <= 13) & (1 <= B & B <= 13):
    if A == B:
        print('Draw')
    elif A == 1:
        print('Alice')
    elif B == 1:
        print('Bob')
    elif A > B:
        print('Alice')
    elif A < B:
        print('Bob')


Measured memory_bytes: 9008
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	int n; cin >> n;
	int k, q; cin >> k >> q;
	vector<int>p(n,k);
	vector<int>a(q); for (auto& e : a) cin>>e;

	for (int i = 0; i < q; ++i) {
		++p[a[i]-1];
	}

	for (auto& e : p) e = e-q;

	for (int i = 0; i < n;++i) {
		if (p[i] > 0)cout << "Yes";
		else cout << "No";
		if (i != n - 1)cout << endl;
	}
	return 0;
}

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

int main() {
  int n, m, x, S = 0, min = 10e7;
  bool c = true;
  cin >> n >> m >> x;
  vector<vector<int>> v(n, vector<int>(m + 1));
  for(int i = 0;i < n;i++) {
    for(int j = 0;j <= m;j++) {
      cin >> v[i][j];
    }
  }
  for(int i = 0;i < (1 << 12);i++) {
    bitset<12> b(i);
    vector<int> s(m);
    c = true;
    S = 0;
    for(int j = 0;j < n;j++) {
      if(b.test(j)) {
        S += v[j][0];
        for(int k = 0;k < m;k++) {
          s[k] += v[j][k + 1];
        }
      }
    }
    for(int j = 0;j < m;j++) {
      if(s[j] < x) {
        c = false;
        break;
      }
    }
    if(c && S < min) min = S; 
  }
  cout << (min < 10e7 ? min : -1) << endl;
}

Measured memory_bytes: 3560
#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<n;i++)
#define For(i,n1,n2) for(int i=n1;i<n2;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define RREP(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<"\n"
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}

int main(){
    double t,x;
    cin >> t >> x;
    cout << setprecision(100) << t/x << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>

int main(){
    int a, b;
    std::string s;
    std::cin>>a>>b>>s;

    std::string ans = "Yes";
    if(s[a] != '-'){
        ans = "No";
    }else{
        s.erase(s.begin() + a);
        for(const auto x : s){
            if(x < '0' || '9' < x){
                ans = "No";
            }
        }
    }
    std::cout<<ans<<std::endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    int a;
    string s;
    cin >> a >> s;
    if(a < 3200) s = "red";
    cout << s << endl;
    return 0;
}


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

int a,b;
int main(){
	scanf("%d%d",&a,&b);
	int c=0;
	c=a+b;
	if(c>=24)c-=24;
	printf("%d\n",c);
/*
for(int i=1;i<=x;i++){
	ans++;
	plus+=i;
	if(plus>=x)break;
}
printf("%d\n",ans);
*/
	
//	printf("%lld\n",ans);
}

Measured memory_bytes: 256
n, q= map(int, input().split())
s = input()

li = [list(map(int, input().split())) for _ in range(q)]
pos = [0]*n
count=0
for i in range(1, n):   
    if s[i-1] == "A" and s[i]=="C":
        count+=1
    pos[i] = count

for i in li:
    print(pos[i[1]-1]-pos[i[0]-1])

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

using namespace std;

#define long long long
#define INF 1e18
#define MOD (long) (1e9 + 7)

int main()
{
    long a, b, c, k;
    cin >> a >> b >> c >> k;

    while (b <= a) {
        b *= 2;
        k--;
        if (k < 0) {
            puts("No");
            return 0;
        }
    }
    while (c <= b) {
        c *= 2;
        k--;
        if (k < 0) {
            puts("No");
            return 0;
        }
    }
    puts("Yes");
}


Measured memory_bytes: 3632
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
 
	public static void main(String[] args) {
 
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		Set<Long> numSet = new HashSet<>();
		boolean hasSame = false;
		for(int i = 0; i < n; i++) {
			Long num = sc.nextLong();
			if(numSet.contains(num)) {
				hasSame = true;
				break;
			}else {
				numSet.add(num);
			}
		}
		
		System.out.println(hasSame ? "NO" : "YES");
		sc.close();
	}

}

Measured memory_bytes: 71936
#include <iostream>
#include <cmath>

using namespace std;

int main()
{
    string k;
    cin>>k;
    if(k[2] == k[3]&& k[4]== k[5])
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0; i<n; i++)
#define eb(t) emplace_back(t)
typedef long long ll;
typedef long long unsigned int llu;
ll INF = 1000000009;
ll MOD = 1000000007;


void solve(){

    double d,t,s;
    cin >> d >> t >> s;
    if(d/s<=t) cout << "Yes" << endl;
    else cout << "No" << endl;

}

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


Measured memory_bytes: 3700
#define rep(i,x) for (int i = 0; i < x; i++)
#define mod 1000000007
#define MOD 998244353
#define INF 1<<62
#define inf 1<<30
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <math.h>
#include <complex>
#include <cassert>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> p;
typedef complex<double> com;


int main() {
	int n;
	cin >> n;
	if (n % 2 == 0) {
		cout << n * (n - 2) / 2 << endl;
		rep(i, n) {
			rep(j, n ) {
				if (j != (n - i-1)&&i<j) {
					cout << (i + 1) << " " << (j + 1) << endl;
				}
			}
		}
	}
	else {
		cout << (n - 1)*(n - 1) / 2 << endl;
		rep(i, n) {
			rep(j, n) {
				if (j != (n - i-2)&&i<j) {
					cout << (i + 1) << " " << (j + 1) << endl;
				}
			}
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#define MN 200000
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
long long ans=0;
int n,m,head[MN+5],cnt=0,no,bip,nobip,c[MN+5],flag,vis[MN+5];
struct edge{int to,next;}e[MN*2+5];
inline void ins(int f,int t)
{
	e[++cnt]=(edge){t,head[f]};head[f]=cnt;
	e[++cnt]=(edge){f,head[t]};head[t]=cnt;	
}
void dfs(int x)
{
	vis[x]=1;
	for(int i=head[x];i;i=e[i].next)
		if(!vis[e[i].to]) c[e[i].to]=c[x]^1,dfs(e[i].to);
		else if(c[e[i].to]^c[x]^1) flag=0;
}
int main()
{
	n=read();m=read();
	for(int i=1;i<=m;++i) ins(read(),read());
	for(int i=1;i<=n;++i) if(!vis[i])
		if(!head[i]) ++no;
		else 
		{
			flag=1;dfs(i);	
			flag?++bip:++nobip;
		}
	ans=1LL*n*n-1LL*(n-no)*(n-no);
	ans+=2*bip+nobip;
	ans+=2LL*bip*(bip-1);
	ans+=2LL*bip*nobip+1LL*nobip*(nobip-1);
	cout<<ans;
	return 0;
}



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

int main(void){

  string s;
  while(getline(cin,s)){
    if(s==".")break;

    stack<char>st;
    for(int i=0;i<s.size();i++){
      if(s[i]=='(' || s[i]=='[')st.push(s[i]);
      else if(((s[i]==')' || s[i]==']') && st.empty()) ||
	      (s[i]==')' && st.top()=='[') ||
	      (s[i]==']' && st.top()=='(')){
	cout << "no" << endl;
	goto end;
      }
      else if(s[i]==')' || s[i]==']')st.pop();
    }
    if(st.empty())cout << "yes" << endl;
    else cout << "no" << endl;
  end:;
  }
  
  return 0;
}

Measured memory_bytes: 2988
#include<stdio.h>
#include<string.h>
int M[1<<16],X[4],Y[4];
int G(int x,int y){return y*4+x;}
int F(int f)
{
	if(M[f]>=0)return M[f];
	if(!f)return 1;
	int r=0,x,y,i,j,k;
	for(i=0;i<4;++i)for(j=0;j<4;++j)
	{
		if(!(f&(1<<G(j,i))))continue;
		for(k=0;k<4;++k)
		{
			y=i+Y[k];x=j+X[k];
			if(0<=y&&y<4&&0<=x&&x<4&&(f&(1<<G(x,y))))r+=F(f^(1<<G(j,i))^(1<<G(x,y)));
		}
		return M[f]=r;
	}
	return M[f]=0;
}
int main()
{
	for(;;)
	{
		memset(M,-1,sizeof(M));
		for(int i=0;i<4;++i)if(scanf("%d%d",X+i,Y+i)-2)return 0;
		printf("%d\n",F(65535));
	}
}

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

#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define ll long long
template<typename T, typename U> 
static inline void amin(T &x, U y){
	if(x>y)
		x = y;
}
template<typename T, typename U> 
static inline void amax(T &x, U y){
	if(x<y)
		x = y;
}
#define rep(i,n) for(int i = 0; i < n; ++i)
#define REP(i,k,n) for(int i = k; i <= n; ++i)
#define REPR(i,k,n) for(int i = k; i >= n; --i)

int inf = 2e9;
ll INF = 2e18;
const int mod = 1e9+7;

int main(){
	int n, k;
	cin >> n>> k;
	vector<bool> dp(k+1,false);
	vi a(n);
	rep(i,n){
		cin >> a[i];
	}
	for(int stones=0;stones<=k;++stones){
		for(int i=0;i<n;++i){
			if(a[i]<=stones && !dp[stones-a[i]]){
				dp[stones] = true;
			}
		}
	}
	if(dp[k]){
		cout<<"First\n";
	}else{
		cout<<"Second\n";
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define IOS                                                                    \
  ios::sync_with_stdio(0);                                                     \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define pb push_back
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const ll MOD = 1000000007LL;
ll bpow(ll b, ll p, ll m = 1000000007LL) {
  ll rt = 1;
  for (; p; p >>= 1, b = b * b % m)
    if (p & 1)
      rt = rt * b % m;
  return rt;
}
ll a[200005];
ll psum[200005];
ll sqr[200005];
int main() {
  IOS;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++)
    cin >> a[i];
  for (int i = 1; i <= n; i++) {
    psum[i] = (psum[i - 1] + a[i]) % MOD;
    sqr[i] = (sqr[i - 1] + a[i] * a[i] % MOD) % MOD;
  }
  cout << (psum[n] * psum[n] % MOD - sqr[n] + MOD) % MOD * bpow(2, MOD - 2) %
              MOD
       << endl;
}


Measured memory_bytes: 8308
#include <iostream>

int main(){
  long long K,A,B;
  std::cin>>K>>A>>B;
  long long sum = 1;
  if(K<=A){
    sum = sum + K;
    K = 0;
  }else{
    sum = A;
    K -= A-1;
  }
  if((B-A)<=2){
    sum += K;
  }else{
    sum += K/2 * (B-A);
    K-=K/2 *2;
    if(K==1){
      sum += 1;
    }
  }
  std::cout<<sum<<std::endl;
  return 0;

}


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

int main() {
 int n;cin >> n;
 ll sum=0;
 vector<ll> t(n);
  for(int i=0;i<n;i++){
  cin >> t[i];
   sum+=t[i];
  }
  ll m; cin >> m;
  vector<pair<ll, ll>> p(m);
  for(int i=0;i<m;i++){
  cin >> p[i].first >> p[i].second;
  }
  vector<ll>ans(m);
  for(int i=0;i<m;i++){
  ans[i]=sum-(t[p[i].first-1]-p[i].second);
  }

  for(int i=0;i<m;i++){
  cout << ans[i] << endl;
  }
}

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

public class MainClass
{
	public const long Giri = 1000000007;

	public class Pair
	{
		public int X {get;set;}
		public int Y {get;set;}


		public override int GetHashCode()
		{
		    return (int)(X^Y);
		}
		
		public override bool Equals(object obj)
		{
		    return ((Pair)obj).X == X && ((Pair)obj).Y == Y;
		}
	}
	
	public static void Main(string[] args)
	{
		var u = Input().ToInt();
		var n = u[0];
		var k = u[1];
		var l = u[2];
		
		var roads = new UnionFind(n);
		var rails = new UnionFind(n);
		
		for(int i = 0; i < k; i++)
		{
			u = Input().ToInt();
			var x = u[0];
			var y = u[1];
			
			roads.Unite(x-1, y-1);
		}
		
		for(int i = 0; i < l; i++)
		{
			u = Input().ToInt();
			var x = u[0];
			var y = u[1];
			
			rails.Unite(x-1, y-1);
		}
		
		var list = new Dictionary<Tuple<int,int>, int>(n);
		
		for(int i = 0; i < n; i++)
		{
			var pair = new Tuple<int,int>(roads.Root(i), rails.Root(i));
			
			if(!list.ContainsKey(pair))
				list.Add(pair, 0);
			list[pair]++;
		}
		for(int i = 0; i < n; i++)
		{
			Console.Write("{0} ", list[new Tuple<int,int>(roads.Root(i),rails.Root(i))]);
		}
		Console.WriteLine();
	}

	
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(' '); }
	public static int Clamp(int val, int max, int min = 0) { return Math.Min(max, Math.Max(min, val)); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt();
		return r;
	 }
}
public class UnionFind
{
	private int[] par;
	public UnionFind(int n)
	{
		par = new int[n];
		for(int i = 0; i < n; i++)
			par[i] = i;
	}
	public int Root(int x)
	{
		if(par[x] == x) return x;
		par[x] = Root(par[x]);
		return par[x];
	}
	public void Unite(int x, int y)
	{
		int rx = Root(x);
		int ry = Root(y);
		if(rx == ry) return;
		par[rx] = ry;
	}
	public bool InSameTree(int x, int y)
	{
		return Root(x) == Root(y);
	}
}

Measured memory_bytes: 28220
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char const *argv[]) {
  unsigned long long N, K, *A;
  scanf("%llu %llu", &N, &K);
  A = malloc(sizeof(unsigned long long) * N);
  for (size_t i = 0; i < N; i++) {
    scanf("%llu", &A[i]);
  }
  for (size_t i = K; i < N; i++) {
    if (A[i - K] < A[i]) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
}


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

int main() {
  double d;
  cin >> d;
  printf("%.20f\n",max((int)d + 1.0, d * sqrt(2)));
}

Measured memory_bytes: 1236
#include <stdio.h>

int abs(int a) {
  return a > 0 ? a : -a;
}

int min(int a, int b) {
  return a < b ? a : b;
}

int main(void) {
  int i, j, k, l, h, w, ans = 100000000;
  scanf("%d%d", &h, &w);
  int a[h][w];
  for(i = 0; i < h; ++i) for(j = 0; j < w; ++j) scanf("%d", &a[i][j]);
  for(i = 0; i < h; ++i) for(j = 0; j < w; ++j) {
    int now = 0;
    for(k = 0; k < h; ++k) for(l = 0; l < w; ++l) now += a[k][l] * min(abs(k - i), abs(l - j));
    if(ans > now) {
      ans = now;
    }
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 2744
#include<bits/stdc++.h>
#define maxl 110

using namespace std;

const double pi=acos(-1.0);
const int inf=0x3f3f3f3f;

int n,m,ans=0;
char a[maxl],b[maxl],c[maxl];

inline void prework()
{
	scanf("%d",&n);
	scanf("%s%s%s",a+1,b+1,c+1);
}

inline void mainwork()
{
	for(int i=1;i<=n;i++)
	{
		if(a[i]==b[i] && b[i]==c[i])
			ans+=0;
		else if(a[i]!=b[i] && a[i]!=c[i] && b[i]!=c[i])
			ans+=2;
		else
			ans+=1;
	}
}

inline void print()
{
	printf("%d",ans);
}

int main()
{
	prework();
	mainwork();
	print();
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
int a,b,c,d;
  int suml,sumr;
  scanf("%d %d %d %d",&a,&b,&c,&d);
  suml=a+b;
  sumr=c+d;
  if(suml==sumr){printf("Balanced\n");}
  if(suml>sumr){printf("Left\n");}
  if(suml<sumr){printf("Right\n");}
return 0;
}

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

int main() {
  // 入力
  int N, M;
  cin >> N >> M;
  vector<pair<long, long>> AB(N);
  for (int i = 0; i < N; i++) {
    cin >> AB.at(i).first >> AB.at(i).second;
  }
  
  // Aの小さい順に並び替え
  sort(AB.begin(), AB.end());
  
  // 買い占め
  long price = 0;
  for (int i = 0; i < N; i++) {
    if (AB.at(i).second < M) {
      price += AB.at(i).first * AB.at(i).second;
      M -= AB.at(i).second;
    } else {
      price += AB.at(i).first * M;
      break;
    }
  }
  
  // 出力
  cout << price << endl;
  
  return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<map>
#include<cstdint>
#include<unordered_map>
#include<boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < ( int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define F first
#define S second

int GCD(int x, int y) {
	return x ? GCD(y % x, x) : y;
}

namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using uint1024_t = mp::uint1024_t;
using namespace std;
int main() {
	vector<int> ss(26), tt(26);
	string s, t;
	cin >> s >> t;
	bool ans = true;
	rep(i, s.size()) {
		int a = s[i] - 97;
		int b = t[i] - 97;
		ss[a]++;
		tt[b]++;
	}
	sort(all(ss));
	sort(all(tt));
	rep(i, 26) {
		if (ss[i] != tt[i]) {
			ans = false;
			break;
		}
	}
	if (ans) {
		puts("Yes");
	}
	else {
		puts("No");
	}
}


Measured memory_bytes: 776
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cassert>
#include <memory>
#include <stack>
#include <set>

#define MAX_SIZE 100000000
typedef unsigned long long ull;
using namespace std;

int main() {
  int N; cin >> N;
  vector<int> vec;
  for(int i = 1; i <= 9; i++) {
    vec.push_back(111 * i);
  }

  int ans = 0;
  for(int i = 0; i < 9; i++) {
    if(N <= vec[i]) {
      ans = vec[i];
      break;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstring>
#include<cmath>

#define LL long long
const LL INF = 9e20;
using namespace std;
#define MAXN 60
#define MAXA 60

int N, M, S;

struct e
{
    int u, v, a, b;
};
vector<e> edge;
int C[MAXN], D[MAXN];
LL dp[MAXN][MAXA * MAXN];
LL ans;

int main()
{
    scanf("%d%d%d", &N, &M, &S);
    int u, v, a, b;
    for (int i = 1; i <= M; i++)
    {
        scanf("%d%d%d%d", &u, &v, &a, &b);
        edge.push_back({u, v, a, b});
        edge.push_back({v, u, a, b});
    }
    for (int i = 1; i <= N; i++)
    {
        scanf("%d%d", &C[i], &D[i]);
    }

    memset(dp, 0x3f, sizeof(dp));
    if (S > 2500)
        S = 2500;
    dp[1][S] = 0;
    while (true)
    {
        bool update = false;

        for (int i = 0; i < edge.size(); i++)
        {
            int u = edge[i].u;
            int v = edge[i].v;
            int a = edge[i].a;
            int b = edge[i].b;
            for (int j = 0; j <= 2500; j++)
            {
                if (j >= C[v])
                {
                    if (dp[v][j] > dp[v][j - C[v]] + D[v])
                    {
                        update = true;
                        dp[v][j] = dp[v][j - C[v]] + D[v];
                    }
                }
                if (dp[v][j] > dp[u][j + a] + b)
                {
                    update = true;
                    dp[v][j] = dp[u][j + a] + b;
                }
            }
        }

        if (!update)
            break;
    }

    for (int i = 2; i <= N; i++)
    {
        LL ans = INF;
        for (int j = 0; j <= 2500; j++)
        {
            if (dp[i][j] < ans)
            {
                ans = dp[i][j];
            }
        }
        cout << ans << endl;
    }

    return 0;
}

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

void solve(){
    int N,K,Q;
    cin>>N>>K>>Q;
    vector<int> count(N+1,0);
    for(int i=1;i<=Q;i++){
        int a;
        cin>>a;
        count[a]++;
    }
    int total = K-Q;
    for(int j=1;j<=N;j++){
        if(total + count[j] > 0) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

}


int main(){
   solve();
}

Measured memory_bytes: 1024
n = int(input())
a = list(map(int,input().split()))
a.append(-1)

a.sort()
ans = 114514191981036436433-4
s = 0
nn = a[n]/2
for i in range(n+1):
    if ans > abs(nn-a[i]):
        ans = abs(nn-a[i])
        s = i
        
print(a[n],a[s])

Measured memory_bytes: 62704
n,m = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(m)]

for j in range(1000):
    a = str(j)
    if len(a) == n:
        ans = "y"
        for i in range(m):
            if a[sc[i][0]-1:sc[i][0]] != str(sc[i][1]):
                ans = "n"
                break
        if ans == "y":
            print(a)
            break
if j == 999 and ans == "n":
    print(-1)

Measured memory_bytes: 3064
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <iomanip>

typedef long long ll;
typedef long double ld;

using namespace std;
using Graph = vector<vector<ll>>;

#define rep(i, N) for (ll i = 0; i < (ll)(N); ++i)
#define ALL(a) (a).begin(),(a).end()

const ll inf = 1e18+7;
const ll mod = 1e9+7;

ll GetDigit(ll num){
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}

int main(){
    ll N,M;
    cin >> N >> M;
    cout << (N*(N-1)/2)+(M*(M-1)/2) << endl;
    	return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

public class AtCoder
{
  public static void Main()
  {
    var n = int.Parse(Console.ReadLine().Trim());
  
    var x = new ModInt(1);

    for(var i=1; i <= n; i++)
    {
      x = x * i;
    }

    Console.WriteLine(x);
  }
}

  class ModInt
  {
    public const long Mod = 1000000007;

    public long num;

    public ModInt(long n) { num = n; }

    public override string ToString() { return num.ToString(); }
    public static ModInt operator +(ModInt l, ModInt r) { l.num += r.num; if (l.num >= Mod) l.num -= Mod; return l; }
    public static ModInt operator -(ModInt l, ModInt r) { l.num -= r.num; if (l.num < 0) l.num += Mod; return l; }
    public static ModInt operator *(ModInt l, ModInt r) { return new ModInt(l.num * r.num % Mod); }
    public static implicit operator ModInt(long n) { n %= Mod; if (n < 0) n += Mod; return new ModInt(n); }

    public static ModInt Pow(ModInt v, long k) { return Pow(v.num, k); }

    public static ModInt Pow(long v, long k)
    {
      long ret = 1;
      for (k %= Mod - 1; k > 0; k >>= 1, v = v * v % Mod)
        if ((k & 1) == 1) ret = ret * v % Mod;
      return new ModInt(ret);
    }

    public static ModInt Inverse(ModInt v) { return Pow(v, Mod - 2); }
  }


Measured memory_bytes: 15184
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

  public static void main(String[] args) throws Exception {
    try (final var stdin = new InputStreamReader(System.in);
         final var br = new BufferedReader(stdin)) {
      br.readLine();
      final var n = Arrays.stream(br.readLine().split(" "))
        .mapToLong(Long::parseLong).toArray();

      var count = 0;
      for (int i = 0; i < n.length; i++) {
        if (i % 2 == 0 && n[i] % 2 == 1) {
          count++;
        }
      }

      System.out.println(count);
    }
  }
}


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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

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

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

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  int n;
  cin >> n;

  int now = 0;
  int X = 0, Y = 0;
  bool ok = true;
  rep(i, n){
    int t, x, y;
    cin >> t >> x >> y;

    int dist = abs(x-X) + abs(y-Y);
    if(dist > (t-now) || dist%2 != (t-now)%2){
      ok = false;
    }
    now = t;
    X = x;
    Y = y;

  }

  if(ok){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }



  return 0;
}


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

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int a,b,c; cin>>a>>b>>c;
	cout<<max({a,b,c})-min({a,b,c})<<endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int sum=0,n,x,k,ans=0;
int a[1000001];
map<int,int> m; 
int main()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&x);
        m[x]++;
    }
    int q=m.size();
    map<int,int>::iterator it=m.begin();
    for(it;it!=m.end();it++)
    {
        a[++sum]=(*it).second;
    }
    sort(a+1,a+sum+1);
    for(int i=1;i<=q-k;i++)
    {
        ans+=a[i];
    }
    cout<<ans<<endl;
    return 0;
 }

Measured memory_bytes: 10368
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;
#define fi first
#define se second
set<string> c;
const ll mod=1000000007;
const ll mod2=998244353;
const ll inf=100000000000000000;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
map<ll,ll> mp;
int main(){
ll n,k;
cin>>n>>k;
vector<ll> a(n),res(n,0),check(n,0);
for(int i=0;i<n;i++)cin>>a.at(i);
for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
        if(a.at(i)>a.at(j))res.at(i)++;
    }
}
 for(int i=0;i<n;i++){
    for(int j=0;j<i;j++){
        if(a.at(i)>a.at(j))check.at(i)++;
    }
}
ll ans=0;
for(int i=0;i<n;i++){
    ans+=(k*(k+1)/2%mod*res.at(i))+(k*(k-1)/2%mod*check.at(i));
    ans%=mod;
}

ans%=mod;
cout<<ans<<endl;
}




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

#define dump(...) do{print_vars(cout<<"# "<<#__VA_ARGS__<<'=',__VA_ARGS__);cout<<endl;}while(0)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

using uint=unsigned;
using ll=long long;
using ull=unsigned long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vd=vector<double>;
using vvd=vector<vd>;
using vs=vector<string>;

template<typename T,typename U>bool chmin(T& a,const U& b){return a>b?(a=b,1):0;}
template<typename T,typename U>bool chmax(T& a,const U& b){return a<b?(a=b,1):0;}

void print_vars(ostream&){}
template<typename Car,typename... Cdr>
void print_vars(ostream& os,const Car& car,const Cdr&... cdr){
	print_vars(os<<car<<(sizeof...(cdr)?",":""),cdr...);
}

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}

template<int I,typename Tuple>
void print_tuple(ostream&,const Tuple&){}
template<int I,typename Car,typename... Cdr,typename Tuple>
void print_tuple(ostream& os,const Tuple& t){
	os<<get<I>(t)<<(sizeof...(Cdr)?",":"");
	print_tuple<I+1,Cdr...>(os,t);
}
template<typename... Args>
ostream& operator<<(ostream& os,const tuple<Args...>& t){
	print_tuple<0,Args...>(os<<'(',t);
	return os<<')';
}

template<typename Ch,typename Tr,typename C>
basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){
	os<<'[';
	for(auto i=begin(c);i!=end(c);++i)
		os<<(i==begin(c)?"":" ")<<*i;
	return os<<']';
}

constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-9;

int main()
{
	#ifndef _GLIBCXX_DEBUG
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	constexpr char endl='\n';
	#endif

	for(int n;cin>>n&&n;){
		string a,b,c; cin>>a>>b>>c;
		int res=0;
		rep(i,n){
			set<char> s={a[i],b[i],c[i]};
			res+=s.size()-1;
		}
		cout<<res<<endl;
	}
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
 
/**
 * Created by Ayushi on 22 Aug 2020.
 * Problem:
 * Round:
 */
 
public class Main {
    public static void main(String[] args) throws IOException {
        StringTokenizer st;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        st = new StringTokenizer(br.readLine(), " ");
        int n = Integer.parseInt(st.nextToken());
        int x = Integer.parseInt(st.nextToken());
        int t = Integer.parseInt(st.nextToken());
        br.close();
        int ans = n/x;
        if (n % x > 0) ans++;
      
        System.out.println(ans*t);
    }
}

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

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


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

ll n, m, MOD = 1e9 + 7;
vector<vector<char> > v;
void solve() {
    cin >> n >> m;
    v.resize(n);
    fill(v.begin(), v.end(), vector<char>(m));
    for (int i = 0; i < n; i++) 
        for (int j = 0; j < m; j++)
            cin >> v[i][j];
    vector<vector<ll> > dp(n, vector<ll>(m, 0));
    dp[n - 1][m - 1] = 1;
    for (int j = m - 2; j >= 0; j--)
        dp[n - 1][j] = v[n - 1][j] == '.' ? dp[n - 1][j + 1] : 0;
    for (int i = n - 2; i >= 0; i--)
        dp[i][m - 1] = v[i][m - 1] == '.' ? dp[i + 1][m - 1] : 0;
    for (int i = n - 2; i >= 0; i--) {
        for (int j = m - 2; j >= 0; j--) {
            if (v[i][j] != '.')
                dp[i][j] = 0;
            else {
                dp[i][j] = dp[i + 1][j] + dp[i][j + 1];
                dp[i][j] = dp[i][j] % MOD;
            }
        }
    }
    cout << dp[0][0] << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}

Measured memory_bytes: 12140
N = STDIN.gets.chomp.to_i
A = STDIN.readlines.map(&:to_i)


arr1 = A.sort
arr2 = arr1.dup.reverse
# puts arr.join(',')

last1, last2 = nil, nil

result1 = [arr1.shift]
result2 = [arr2.shift]

i = 0

while arr1.length > 0
  break if i % 2 == 0 && arr1.length == 1

  case i % 4
  when 0
    result1.push(arr1.pop)
    result2.push(arr2.pop)
  when 1
    result1.unshift(arr1.pop)
    result2.unshift(arr2.pop)
  when 2
    result1.unshift(arr1.shift)
    result2.unshift(arr2.shift)
  when 3
    result1.push(arr1.shift)
    result2.push(arr2.shift)
  end
  i += 1
  # puts result.join(',')
end

# puts result1.join(',')
# puts result2.join(',')

diff1 = 0
diff2 = 0

result1.each_cons(2) do |arr|
  diff1 += (arr[0] - arr[1]).abs
end


result2.each_cons(2) do |arr|
  diff2 += (arr[0] - arr[1]).abs
end

if arr1.length == 1
  d1a = (arr1[0] - result1[0]).abs
  d1b = (arr1[0] - result1.last).abs
  diff1 += (d1a > d1b ? d1a : d1b)

  d2a = (arr2[0] - result2[0]).abs
  d2b = (arr2[0] - result2.last).abs
  diff2 += (d2a > d2b ? d2a : d2b)
end


puts diff1 > diff2 ? diff1 : diff2



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

int solve(int n){
    int ans=1;
    vector<int> cnt;
    for(int i=2;i*i<=n;i++){
        int tmp=0;
        while(n%i==0){
            n/=i;
            tmp++;
        }
        if(tmp!=0) cnt.push_back(tmp+1);
    }
    if(n!=1) cnt.push_back(2);
    for(int x:cnt){
        ans*=x;
    }
    if(ans==8) return 1;
    else return 0;
}

int main(){
    int n;
    cin>>n;
    int ans=0;
    rep(i,n){
        if((i+1)%2==0) continue;
        ans+=solve(i+1);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 3604