akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cmath>
#include <utility>
#define EPS 1e-16

#define COUNTER_CLOCKWISE 	1
#define CLOCKWISE 			-1
#define ON_LINE_BACK		2
#define ON_LINE_FRONT		-2
#define ON_SEGMENT			0

typedef std::pair<double, double> point;

class C{ friend point operator - (point, point); };
point operator - (point p0, point p1)	{ return point(p0.first - p1.first, p0.second - p1.second); }

double cross(point p0, point p1)	{ return p0.first * p1.second - p1.first * p0.second; }
double dot(point p0, point p1)		{ return p0.first * p1.first + p0.second * p1.second; }
double norm(point p)				{ return sqrt(pow(p.first, 2) + pow(p.second, 2));	  }

int ccw(point p0, point p1, point p2)
{
	point a = p1 - p0, b = p2 - p0;
	if( cross(a, b) > EPS ) 	return COUNTER_CLOCKWISE;
	if( cross(a, b) < -EPS )	return CLOCKWISE;
	if( dot(a, b) < -EPS ) 		return ON_LINE_BACK;
	if( norm(a) < norm(b))		return ON_LINE_FRONT;
	return ON_SEGMENT;
}

bool isIntersected(point p0, point p1, point p2, point p3)
{
	return ( (ccw(p0, p1, p2) * ccw(p0, p1, p3) <= 0) &&
			 (ccw(p2, p3, p0) * ccw(p2, p3, p1) <= 0) );
}

int main(void)
{
	int n;
	point p0, p1, p2, p3;
	scanf("%d",&n);
	while(n--)
	{
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &p0.first, &p0.second, &p1.first, &p1.second, &p2.first, &p2.second, &p3.first, &p3.second);
		printf("%d\n", isIntersected(p0, p1, p2, p3));
	}
	return 0;
}

Measured memory_bytes: 1068
#include <iostream>
#include <string>
#include <vector>
#include<sstream>

using namespace std;

int main() {
    int N,A,B,Pass = 0,oversea = 0;
    string str;
    cin >> N >> A >> B >> str;

    for (int i = 0; i < N; i++)
    {
        if (str[i] == 'a')
        {
            if (Pass < A + B)
            {
                cout << "Yes" << endl;

                Pass++;
            }
            else
            {
                cout << "No" << endl;
            }
        }
            //ここから海外
        else if (str[i] == 'b')
        {
            oversea++;
            if (Pass < A + B && oversea <= B)
            {
                cout << "Yes" << endl;

                Pass++;
            }
            else
            {
                cout << "No" << endl;
            }
        }
        else
        {
            cout << "No" << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vll vector<ll>
#define vllv vector<vector<ll>> 
#define sz size()
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)


void solve()
{
    double n;
    cin>>n;
    cout<<2.0*3.14159265358979323846*n;
    return;
}

int main()
{
    ll q;
    q=1;
    // cin>>q;
    while(q--)
    {
        solve();
    }
    return 0;
}


Measured memory_bytes: 3776
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

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

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

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

  return 0;
}


Measured memory_bytes: 1024
//#pragma GCC optimize ("-O3","unroll-loops")
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>


#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define m0(x) memset(x,0,sizeof(x))
#define print(x) cout<<x<<'\n';
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
#define int long long
//#define int unsigned long long
#define all(x) (x).begin(), (x).end()
#define double long double

using namespace std;

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;
}

int MOD = 1e9 + 7;
const ll INF = 1e17;
const double pi = acos(-1);
const double EPS = 1e-10;
typedef pair<int, int>P;
const int MAX = 200020;


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

	int S; cin >> S;
	int X1 = 0, Y1 = 0, X2 = 0, Y2 = 0, X3 = 0, Y3 = 0;
	X2 = 1e9, Y3 = 1e9;

	X2 = (ll)sqrt(S + 1);
	Y3 = (ll)sqrt(S + 1);
	int rem = abs(X2*Y3 - S);
	if (rem == 0) {
		pe(X1)pe(Y1)pe(X2)pe(Y2)pe(X3)print(Y3); return 0;
	}
	else X2++,Y3++;
	rem = abs(X2*Y3 - S);
	FOR(i, 1, 1e9) {
		if (rem%i == 0 && rem / i <= 1e9) {
			X3 = i;
			Y2 = rem / i;
			break;
		}
	}
	pe(X1)pe(Y1)pe(X2)pe(Y2)pe(X3)print(Y3);
	//print(X2*Y3 - Y2 * X3);
}


Measured memory_bytes: 256
import java.util.Scanner;
class Main {

	public void pi() {

		Scanner sc = new Scanner(System.in);

		int i = 1;

		int x = sc.nextInt();

		while(x != 0) {

			System.out.println("Case" + " " + i + ":" + " " + x);

			x = sc.nextInt();

			i++;

		}

	}

	public static void main(String[] args) {

		new Main().pi();

	}

}

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

// definition {{{ 1

// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)

#define Scll(x) scanf("%llu", &x)
#define Scll2(x,y) scanf("%llu%llu", &x, &y)
#define Scll3(x,y,z) scanf("%llu%llu%llu", &x, &y, &z)

#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2

// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2

// systems {{{ 2
#define Rep(x,y) for(int x = 0; x < y; x++)
#define Repe(x,y,z) for(int x = z; x < y; x++)
// }}} 2

// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n");
// }}} 2

// }}} 1

int main() {

    int D,N;
    Scd2(N,D);

    vector< vector<int> > x( N, vector<int>(D) );

    Rep(i,N){
        Rep(j,D){
            Scd(x[i][j]);
        }
    }


    int ans = 0;
    int d;
    int da;
    int s = 1;
    Rep(i,N){
        Repe(j,N,i+1){
            d = 0;
            Rep(k,D){
                da = x[i][k] - x[j][k];
                d += da*da;
            }
            s = 1;
            while( d >= s*s ){
                if( d == s*s ) ans++;
                s++;
            }
        }
    }

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

    return 0;
}



Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	int i, N, a[101];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(a[i]));
	
	int min = N, max = 0, count[101] = {};
	for (i = 1; i <= N; i++) {
		count[a[i]]++;
		if (a[i] < min) min = a[i];
		if (a[i] > max) max = a[i];
	}
	if (min <= (max - 1) / 2) {
		printf("Impossible\n");
		fflush(stdout);
		return 0;
	}
	for (i = max; i > max / 2; i--) if (count[i] <= 1) break;
	if (i > max / 2) printf("Impossible\n");
	else if (max % 2 == 0 && count[max/2] != 1) printf("Impossible\n");
	else if (max % 2 == 1 && count[(max+1)/2] != 2) printf("Impossible\n");
	else printf("Possible\n");
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1624
NM = input().split(" ")
N = int(NM[0])
M = int(NM[1])
sc = []
for i in range(M):
    sc.append(input().split(" "))
# print(sc)
for i in range(len(sc)):
    sc[i][0] = int(sc[i][0])-1
    sc[i][1] = int(sc[i][1])
if N == 1: s = 0
else: s = 10**(N-1)
for i in range(s,10**(N)):
    n = []
    for j in str(i):
        n.append(int(j))
    # print(n)
    for k in range(len(sc)):
        # print(sc[k], len(n))
        if len(n) - 1 < int(sc[k][0]):
            break
        # print(n, sc[k], n[int(sc[k][0])], sc[k][1])
        if n[sc[k][0]] != sc[k][1]:
            break
    else:
        print(i)
        break
else:
    print(-1)


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

int main(){
	int N;
	int A;
	int B;
	int C;
	string Ans[1000];
	cin>>N;
	for(int i = 0;i<N;i++){
		cin>>A>>B>>C;
		int MAX = max(A,max(B,C));
		if(MAX==A){
			if(A*A == B*B+C*C)
				Ans[i] = "YES";
			else
				Ans[i] = "NO";
		}
		else{
				if(MAX==B){				
					if(B*B==A*A+C*C)
						Ans[i] = "YES";
					else
						Ans[i] = "NO";
				}
				else{					
					if(C*C == A*A+B*B)
					Ans[i] = "YES";
					else
					Ans[i] = "NO";
				}
		}
	}
	for(int o = 0;o<N;o++){
		cout<<Ans[o]<<endl;
	}
}

Measured memory_bytes: 3108
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		if (b-a == c - b){
			System.out.println("YES");
		}
		else{
			System.out.println("NO");
		}

	}

}


Measured memory_bytes: 23764
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <climits>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a,c) memset(a,c,sizeof(a))

#define DEBUG(x) cout<<"#x"<<": "<<x<<endl

using namespace std;

int Partition(int A[],char B[],int p,int r){
    int x = A[r];
    int i = p-1;
    FOR(j,p,r){
        if(A[j] <= x){
            i = i+1;
            swap(A[i],A[j]);
            swap(B[i],B[j]);
        }
    }
    swap(A[i+1],A[r]);
    swap(B[i+1],B[r]);
    return i+1;
}

void Quicksort(int A[100001],char B[100001],int p,int r){
    if( p < r){
        int q = Partition(A,B,p,r);
        Quicksort(A,B,p,q-1);
        Quicksort(A,B,q+1,r);
    }
}

void insertionSort(int A[100001],char B[100001],int n){
    FOR(i,1,n){
        int pos = i;
        while(A[pos-1] > A[pos] && pos > 0){
            swap(A[pos-1],A[pos]);
            swap(B[pos-1],B[pos]);
            pos--;
        }
    }
}

bool isStable(char A[100001],char B[100001],int n){
    REP(i,n){
        if(A[i] != B[i]) return false;
    }
    return true;
}

int temp[100001];
char ctemp[100001];
void merge(int A[100001],char B[100001],int l,int r){
    if(l >= r ) return;

    int i,j,k;
    int m = (l+r)/2;
    merge(A,B,l,m);
    merge(A,B,m+1,r);

    for(i = l;i <= m ;i++){
        temp[i] = A[i];
        ctemp[i] = B[i];
    }
    for(i=m+1,j=r;i<=r;i++,j--){
        temp[i] = A[j];
        ctemp[i] = B[j];
    }
    i = l;
    j = r;
    for(k=l;k<=r;k++){
        if(temp[i]<=temp[j] && i <= m) {
            A[k] = temp[i];
            B[k] = ctemp[i];
            i++;
        }else{
            A[k] = temp[j];
            B[k] = ctemp[j];
            j--;
        }
    }

}

int main(){
    int n ;
    int A[100001],AA[100001];
    char B[100001],BB[100001];
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    REP(i,n){
        cin >> B[i] >> A[i];
        AA[i] = A[i];
        BB[i] = B[i];
    }
    A[n] = 2000000000;
    AA[n] = 2000000000;
    B[n] = 'Z';
    BB[n] = 'Z';

    Quicksort(A,B,0,n);
    merge(AA,BB,0,n);

    if(isStable(B,BB,n)) cout << "Stable" << endl;
    else cout << "Not stable" << endl;
    REP(i,n){
        cout << B[i] << " " << A[i]<<endl;
    }

    // cout << "====steble====" << endl;
    //
    // REP(i,n){
    //     cout << BB[i] << " " << AA[i]<<endl;
    // }

    return 0;
}

Measured memory_bytes: 2668
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define pii pair<int,int>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pll pair<ll,ll>
#define mat vector<vector<int>>
const int inf = 1 << 30;
const ll linf = 1e18;
const db EPS = 1e-7;
template<class T> void chmin(T& x, T y){if(x > y) x = y;}
template<class T> void chmax(T& x, T y){if(x < y) x = y;}

int N;

bool check(vector<pii> vs){
    sort(vs.rbegin(), vs.rend());
    int h = 0;
    for(auto u : vs){
        if(h + u.first < 0) return false;
        h += u.second;
    }
    return true;
}


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> N;

    vector<pii> ls, rs;
    int sum = 0;
    for(int i = 0; i < N; ++i){
        string S;
        cin >> S;
        int h = 0, u = 0;
        for(int j = 0; j < S.length(); ++j){
            if(S[j] == '(') h++;
            else h--;
            chmin(u, h);
        }
        if(h > 0) ls.push_back({u, h});
        else rs.push_back({u - h, -h});
        sum += h;
    }
    if(check(ls) && check(rs) && sum == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 18948
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    int a,b,c; cin >> a >> b >> c;
    if(a+b+c >= 22)
        cout << "bust" << endl;
    else
        cout << "win" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m); (i) > (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define R cin>>
#define repr(i, n) REPR(i, n, 0)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define in(a) insert(a)
#define P(p) cout<<(p)<<endl;
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
template<typename T> void co(T e){cout << e << "\n";}
template<typename T> void co(const vector<T>& v){for(const auto& e : v)
{ cout << e << " "; } cout << "\n";}
ll gcd(ll a, ll b) {
    if (a < b)swap(a, b);
    if (b == 0) return a;
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}
ll lcm(ll a, ll b) {
    ll g = gcd(a, b);
    return a * b / g;
}
bool prime(ll n) {
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n%i == 0)return false;
    }
    return n != 1;
}

Vec fac, finv;

ll PowMod(ll a, ll n){
    if(n == 1) return a;
    if(n%2 == 0) return PowMod(a*a%MOD, n/2);
    return a*PowMod(a*a%MOD, n/2)%MOD;
}

ll combi(ll n, ll k){
    if(k>n) return 0;
    return fac[n]*finv[k]%MOD*finv[n-k]%MOD;
}

int main(){
    set<int>se{'A', 'C', 'G', 'T'};
    string s;
    int ans=0, ret=0;
    R s;
    for(auto i:s){
        if(se.count(i)){
            ret++;
            ans = max(ans, ret);
        }
        else ret=0;
    }
    co(ans);
}

Measured memory_bytes: 256
from collections import Counter
N = int(input())
*A, = map(int, input().split())
A.sort()
c = Counter(A)
ans = 0
d = [0]*(10**6+1)
for i in range(N):
    if d[A[i]] == 0:
        if c[A[i]] == 1:
            ans += 1
        j = A[i]
        while j <= (10**6):
            d[j] += 1
            j += A[i]
print(ans)


Measured memory_bytes: 127004
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
amax = a[-1]
tmp1 = amax + 1
for i in a[:n-1]:
    tmp2 = i - amax/2
    if tmp2 > tmp1:
        break
    else:
        r = i
        tmp1 = abs(tmp2)
print(amax, r)

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

typedef long long ll;
#define FOR(i, a, n) for (ll i=(ll)a;i<(ll)n;i++)
#define REP(i, n) FOR(i, 0, n)

ll calc_distance(ll a, ll b){
    ll ans;

    if (a%b==0 || b%a==0){
        ans = (a>=b) ? b*(2*(a/b)-1) : a*(2*(b/a)-1);
    }
    else if (a>=b){
        ans = 2*b*(a/b) + calc_distance(a%b, b);
    }
    else{
        ans = 2*a*(b/a) + calc_distance(a, b%a);
    }
    return ans;
}

int main(){
    ll n; cin >> n;
    ll x; cin >> x;

    ll ans = n + calc_distance(n-x, x);

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define rep(i,a,b) for(int i = (a);i<(b);i++)
#define REP(i,a,b) for(int i = (a);i<=(b);i++)
#define pb push_back
#define mk make_pair
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<< #x << " = " << x << endl;
#define debug2(x,y) cout << #x <<" = "<< x << " --- "<<#y<< " = "<<y<<endl;
typedef pair<int, int> ii;
typedef long long ll;
const int INF = 0x3f3f3f3f;

int solve(int n){
	int ret=0,aux=0;
	rep(i,1,n+1){
		if(i%2==0) continue;
		aux=0;
		rep(j,1,i/2+1){
			if(i%j==0)aux++;
		}
		aux++;
		if(aux==8) ret++;
	}
	return ret;
}

int main(){
	int n;
	cin>>n;
	int ans=solve(n);
	cout<<ans<<endl;
}

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

int main(){
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;
    int max_length=0, r=0, l=0, count=0;
    while(r < n){
        while (count < k && r < n){
            if (s[r] == '0') {
                count++;
                //convert all 0 and add all 1 upto that value to final len
                while(s[r] == '0' && r < n) r++;
                while(s[r] == '1' && r < n) r++;
            }
            else{
                //if not 0 then count them as they contribute to max len
                while(s[r] == '1' && r < n) r++;
            }
        }
        max_length = max(max_length, r - l);
        count--;
        while(s[l] == '1') l++;
        while(s[l] == '0') l++;
    }
    cout << max_length << endl;
    return 0;
}

Measured memory_bytes: 512
N = int(input())
A = list(map(int, input().split()))

L = []
res = "No"

for a in A:
    if a % 4 == 0:
        L.append(4)
        continue
    elif a % 2 == 0:
        L.append(2)
        continue
    else:
        L.append(1)

if L.count(2) == 0:
    if L.count(1) <= (L.count(4) + 1):
        res = "Yes"
elif L.count(1) <= L.count(4):
    res = "Yes"

print(res)


Measured memory_bytes: 14252
package main

import (
	"bufio"
	. "fmt"
	"io"
	"os"
)

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()
	gcd := func(a, b int) int {
		for a != 0 {
			a, b = b%a, a
		}
		return b
	}
	abs := func(x int) int {
		if x < 0 {
			return -x
		}
		return x
	}

	const mod int = 1e9 + 7
	pow := func(x, n int) int {
		res := 1
		for ; n > 0; n >>= 1 {
			if n&1 == 1 {
				res = res * x % mod
			}
			x = x * x % mod
		}
		return res
	}

	type pair struct{ x, y int }
	var n int
	Fscan(in, &n)
	cnts := map[pair]int{}
	cnts2 := map[pair]int{}
	centerCnt := 0
	for i := 0; i < n; i++ {
		var x, y int
		Fscan(in, &x, &y)
		if x == 0 && y == 0 {
			centerCnt++
			continue
		}

		if y < 0 {
			y = -y
			x = -x
		}
		if y == 0 {
			if x < 0 {
				x = -x
			}
		}

		g := gcd(abs(x), abs(y))
		x /= g
		y /= g
		if x > 0 {
			cnts[pair{x, y}]++
		} else {
			x, y = y, -x
			cnts2[pair{x, y}]++
		}
	}

	ans := 1
	for p, c := range cnts {
		c2 := cnts2[p]
		delete(cnts2, p)
		cc := 1 + pow(2, c) - 1 + pow(2, c2) - 1
		ans = ans * cc % mod
	}
	for _, c := range cnts2 {
		ans = ans * (pow(2, c) ) % mod
	}

	if centerCnt > 0 {
		ans = (ans + centerCnt) % mod
	}

	ans-- // todo remove empty
	if ans < 0 {
		ans +=mod
	}

	Fprintln(out, ans)
}

func main() { run(os.Stdin, os.Stdout) }


Measured memory_bytes: 17464
#!/usr/bin/env python3

import sys
# import math
# from string import ascii_lowercase, ascii_upper_case, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)


def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1               # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    s = input()
    print('ARC') if s == 'ABC' else print('ABC')


if __name__ == "__main__":
    main()


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

s = input()
t = [0] * (n+1)
p = []
for i in range(n):
	t[i+1] = t[i] + (1 if s[i:i+2] =='AC' else 0)

for _ in range(q):
	l,r= map(int,input().split())
	p.append(t[r-1]-t[l-1])

for i in p:
	print(i)

Measured memory_bytes: 11852
fun main() = Thread(null, ::abc169a, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun abc169a() {
    val (a, b) = readLine()!!.split(' ').map { it.toInt() }

    val answer = a * b

    println(answer)
}


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

int main() {
	int x,y;
    char le;
    while (le != '?'){
        cin >> x >> le >> y;
        if (le == '+')
            cout << x+y <<endl;
        else if (le == '-')
            cout << x-y <<endl;
        else if (le == '*')
            cout << x*y <<endl;
        else if (le == '/')
             cout << x/y <<endl;
    }
	return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define show(x) cout<<x<<'\n'
#define showh(x) cout<<x<<' '
#define go(i,a,n) for(ll i=a;i<n;i++)
#define gor(i,a,n) for(ll i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define mod 1000000007
bool prime[100001];
bool ispoweroftwo(ll x)
{
    return x && !(x & (x-1));
}
ll xorcal(ll n)
{
    if(n%4==0)
        return n;
    if(n%4==1)
        return 1;
    if(n%4==2)
        return n+1;
    if(n%4==3)
        return 0;
}
void sieve(ll n)
{
    memset(prime,true,sizeof(prime));
    prime[0]=false;
    prime[1]=false;
    for(ll i=2;i*i<=n;i++)
    {
        if(prime[i]==true)
        {
            for(ll j=i*i;j<=n;j+=i)
            {
                prime[j]=false;
            }
        }
    }
}
bool isprime(ll n)
{
    if (n<=1) return false;
    if (n<=3) return true;

    if(n%2==0 or n%3==0) return false;

    for(ll i=5;i*i<=n;i+=6)
    {
        if(n%i==0 or n%(i+2)==0) return false;
    }
    return true;
}

ll modinverse(ll a,ll m)
{
    ll m0 = m;
    ll y = 0, x = 1;

    if (m == 1)
      return 0;

    while (a > 1)
    {
        ll q = a / m;
        ll t = m;

        m = a % m; a = t;
        t = y;

        y = x - q * y;
        x = t;
    }

    if (x < 0)
       x += m0;

    return x;
}

ll gcd(ll a,ll b)
{
    if(a==0)
    {
        return b;
    }
    return(b%a,a);
}
int main()
{
    fast
    ll a;
    string s;
    cin>>a>>s;
    if(a>=3200){
        show(s);
    }
    else{
        show("red");
    }
    return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);
		
		int n=s.nextInt();
		
		int last=n%10;
		
		if(last==2||last==4||last==5||last==7||last==9)
		{
			System.out.println("hon");
		}
		else if(last==0||last==1||last==6||last==8)
		{
			System.out.println("pon");
		}
		else
		{
			System.out.println("bon");
		}
		
	}
	
}

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

int main(void) {
	int x,n;
	int p[110];
	int np[110];
	int i,j;
	int flag = 0;
	int ans;
	
	for(i=0;i<105;i++){
		np[i]=i;
	}
	
	scanf("%d",&x);
	//printf("%d\n",x);
	scanf("%d",&n);
	//printf("%d\n",n);
	for(i=1;i<n+1;i++){
		scanf("%d",&p[i]);
		np[p[i]] = -5;
		//printf("%d %d\n",p[i], np[p[i]]);
	}
	
	for(i=1;i<101;i++){
		if(np[i] == x){
			ans = x;
			flag = 1;
		}
	}
	
	if(flag == 0){
		for(i=1;i<101;i++){
			if(np[x+i] == -5 && np[x-i] == -5){
				//printf("NG");
			}
			else if(np[x-i] == -5){
				ans = np[x+i];
				break;
			}
			else {
				ans = np[x-i];
				break;
			}
		}
	}
	
	printf("%d",ans);
	printf("\n");	
	return 0;
}


Measured memory_bytes: 1732
n, x = gets.chomp.split(" ").map(&:to_i)
aa = gets.chomp.split(" ").map(&:to_i)
sum0 = aa.inject(:+)
if aa[0] > x then
  aa[0] = x
end
(1..(n-1)).each do |i|
  if aa[i - 1] + aa[i] > x
    aa[i] = x - aa[i -1]
  end
end
sum1 = aa.inject(:+)
puts sum0 - sum1

Measured memory_bytes: 9612
#include <cstdio>
#include <string>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <iomanip>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <numeric>

typedef unsigned long long ULONG;
typedef long long LONG;
using namespace std;

#define PI 3.1415926535897932384626433
#define _DBG_

#define BIG 10000000000 //10

#define LAST 10000000 //10^7

#define MOD (LONG)(10e8 + 7)


int main(void) {
	ULONG X;
	cin >> X;

	if (X >= 400 && X < 600) {
		cout << 8 << endl;
	}
	else if(X >= 600 && X < 800) {
		cout << 7 << endl;
	}
	else if(X >= 800 && X < 1000) {
		cout << 6 << endl;
	}
	else if(X >= 1000 && X < 1200) {
		cout << 5 << endl;
	}
	else if(X >= 1200 && X < 1400) {
		cout << 4 << endl;
	}
	else if (X >= 1400 && X < 1600) {
		cout << 3 << endl;
	}
	else if (X >= 1600 && X < 1800) {
		cout << 2 << endl;
	}
	else if (X >= 1800 && X < 2000) {
		cout << 1 << endl;
	}



	return 0;
}

Measured memory_bytes: 3628
from collections import Counter, defaultdict
import sys
sys.setrecursionlimit(10 ** 5 + 10)
input = sys.stdin.readline
from math import factorial
import heapq, bisect
import math
import itertools
# from copy import deepcopy, copy

import queue
from collections import deque




def main():
    num_bangumi, num_channel = map(int, input().split())
    data = [list(map(int, input().split())) for i in range(num_bangumi)]
    max_len = 10 ** 5 + 10

    ans_list = [[0 for i in range(max_len)] for j in range(num_channel)]

    for i in range(num_bangumi):
        s, t, c = data[i]
        ans_list[c - 1][s] += 1
        ans_list[c - 1][t] -= 1
    #
    # for i in range(num_channel):
    #     print(ans_list[i])
    # print()

    for i in range(num_channel):
        for j in range(1, max_len):
            if ans_list[i][j] == 1:
                ans_list[i][j - 1] += ans_list[i][j]
                ans_list[i][j] = 0

    # for i in range(num_channel):
    #     for j in range(max_len - 1)[::-1]:
    #         if ans_list[i][j] == -1:
    #             ans_list[i][j + 1] += ans_list[i][j]
    #             ans_list[i][j] = 0
    #
    # for i in range(num_channel):
    #     print(ans_list[i])
    #     print()



    ans = 0
    now_bangumi = 0

    for j in range(max_len):
        for i in range(num_channel):
            now_bangumi += ans_list[i][j]
        ans = max(ans, now_bangumi)

    print(ans)















if __name__ == '__main__':
    main()


Measured memory_bytes: 128004
#include<bits/stdc++.h>
using namespace std;
#define forr(x,n) for(int x = 0; x < n; ++x)
#define pr pair<int,int>
#define ll long long int
const ll mod=998244353;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;
    cin>>s;
    string ans="Yes";
    int i=0,n=s.length();
    int j=n-1;
    while(i<j)
    {
        if(s[i]!=s[j])
        ans="No";
        i++;
        j--;
    }
    int m=n/2;
    i=0;
    j=m-1;
    while(i<j)
    {
        if(s[i]!=s[j])
        ans="No";
        i++;
        j--;
    }
    i=m+1;
    j=n-1;
    while(i<j)
    {
        if(s[i]!=s[j])
        ans="No";
        i++;
        j--;
    }
    cout<<ans;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef std::int_fast64_t i64;
typedef std::uint_fast64_t u64;
typedef std::int_fast32_t i32;
typedef std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(std::vector<T>& vector, const typename std::vector<T>::size_type size) {
    vector.reserve(size);
    std::copy_n(std::istream_iterator<T>(std::cin), size, std::back_inserter(vector));
  }

  template <typename T, std::size_t N>
  void read(std::array<T, N>& array) {
    std::copy_n(std::istream_iterator<T>(std::cin), N, array.begin());
  }
}

#endif

// main.cpp

int main() {
  i64 N, M, K;
  std::cin >> N >> M >> K;

  for (i64 h = 0; h <= N; ++h) {
    for (i64 w = 0; w <= M; ++w) {
      if ((N - h) * w + (M - w) * h == K) {
        std::cout << "Yes" << std::endl;
        return 0;
      }
    }
  }
  std::cout << "No" << std::endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>




int main(){
int X,Y,q,r,Q,R;
scanf("%d%d",&X,&Y);

q = (Y-2*X)/2;
r = (4*X-Y)/2;

Q = (Y-2*X)%2;
R = (4*X-Y)%2;

if(q<0 || r<0){
    printf("No");
    }
else{
        if(Q==0 && R==0){
        printf("Yes");
}
        else{printf("No");}
}
return 0;
}




Measured memory_bytes: 1728
#include<iostream>
#include<stdio.h>
#include<string.h>
int main()
{
	using namespace std;
    int n,m;
    int a[110]{},b[110]{};
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    cin>>m;
    for(int j=0;j<m;j++)
    {
        int k;
        long long int total=0;
        cin>>k;
        cin>>b[k];
        for(int f=1;f<=n;f++)
        {
            if(f==k)
            {
                total=total+b[f];
            }
            else
            {
                total=total+a[f];
            }
        }
        cout<<total<<endl;
    }
    return 0;
}


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

using namespace std;

#define REP(i,n)	for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPS(i,s,n)	for(int i=(s), i##_len=(n); i<i##_len; ++i)

#define ALL(obj)	(obj).begin(),(obj).end()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define VEC vector

typedef unsigned int 			uint;
typedef unsigned long long int	ull;
typedef long long int 			ll;

typedef pair<int,int>			P;
typedef vector<int>				Vint;
typedef vector<Vint>			VV;

template<typename T>string join(const v(T)&v)
{stringstream s;REP(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define MAX 		400010

const ll LINF = (ll)9e18+7;		//
const int INF = 100100100;			//2,147,483,647 (Max int)
const ll MOD = 1e9+7;
// テンプレ終了
//====================================================================//

// int DP[MAX];


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

	int X = (int)n*100/108;
	if(n == (int)((double)X*1.08))cout << X << endl;
	else if(n == (int)((double)(X+1)*1.08))cout << X+1 << endl;
	else { cout << ":(" << endl; }



	return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> llP;

ll mod(ll a, ll b){
  ll ret=a%b;
  if(ret<0) ret+=b;
  return ret;
}

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

int main() {
  int n;
  cin>>n;
  ll a[n+1];
  for(int i=0;i<n+1;i++) cin>>a[i];
  ll b[46];
  b[0]=1;
  for(int i=1;i<46;i++) b[i]=b[i-1]*2;
  for(int i=0;i<(n>45 ? 46 :n+1);i++){
    if(a[i]>b[i]) {
      cout<<-1<<endl;
      return 0;
    }
  }
  ll c[100000];
  c[0]=1;
  int ret;
  for(int i=1;;i++){
    c[i]=2*(c[i-1]-a[i-1]);
    if(i==n or c[i]>1e13) {
      ret=i;
      break;
    }
  }
  ll ans=a[n],cur=a[n];
  if(n<=ret and (a[n]>c[n])){
    cout<<-1<<endl;
    return 0;
  }
  for(int i=n-1;i>=0;i--){
    ll temp=cur+a[i];
    if(i>ret){
      if(temp>c[ret]){
        if(c[ret]>=(cur+1)/2+a[i]) temp=c[i];
        else{
          cout<<-1<<endl;
        }
      }
    }
    if(i<=ret){
      if(c[i]<temp){
        if(c[i]>=(cur+1)/2+a[i]) temp=c[i];
        else{
          cout<<-1<<endl;
          return 0;
        }
      }
    }
    cur=temp;
    ans+=cur;
  }
  cout<<ans<<endl;
  return 0;
}


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

int main()
{
    ll N;
    cin >> N;
    vector<ll> A(N);
    for(ll i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    
    sort(A.begin(),A.end());
    reverse(A.begin(),A.end());

    ll N1 = 0;
    ll N2 = 0;
    for(ll i = 0; i < N-1; i++)
    {
        if(N1 != 0 && A[i] == A[i+1])
        {
            N2 = A[i];
            break;
        }
        else if(N1 == 0 && A[i] == A[i+1])
        {
            N1 = A[i];
            i++;
        }

    }

    cout << N1 * N2 << endl;
    return 0;
}

Measured memory_bytes: 1024
#pragma region _head

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<stack>
#include<numeric>
#include<utility>
#include<regex>

void Init() {
	std::cin.tie(0); std::ios::sync_with_stdio(false);
	struct Init_caller { Init_caller() { Init(); } }caller;
}

#pragma region _define

#define int LL
#define f(i,a,b) for(LL i=a;i<b;i++)
#define f_vI(v,n) f(i,0,n)cin>>v[i]
#define f_v2I(v1,v2,n) f(i,0,n)cin>>v1[i]>>v2[i]
#define f_v3I(v1,v2,v3,n) f(i,0,n)cin>>v1[i]>>v2[i]>>v3[i]
#define f_vO(v,n) f(i,0,n)cout<<v[i]<<endl
#define ei else if
#define all(a) a.begin(),a.end()
#define size(s) ((LL)s.size())
#define F first
#define S second
#define check() cout<<"! ! !"
#define endl "\n"
#define _y() cout<<"Yes"<<endl
#define _Y() cout<<"YES"<<endl
#define _n() cout<<"No"<<endl
#define _N() cout<<"NO"<<endl
#define INT_INF 1<<29
#define LL_INF 1LL<<60
#define MOD 1000000007

#pragma endregion

#pragma region _using

using namespace std;

using LL = long long;
using st = string;
using vi = vector<LL>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<st>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using qi = queue<LL>;
using qc = queue<char>;
using qs = queue<st>;
using si = stack<LL>;
using sc = stack<char>;
using ss = stack<st>;
using pi = pair<LL, LL>;
using ppi = pair<pi, LL>;
using mll = map<LL, LL>;
using mcl = map<char, LL>;
using vpi = vector<pi>;
using vppi = vector<ppi>;

#pragma endregion

struct edge {
	int from, to, cost;
};

void y_n(bool p) {
	p ? _y() : _n();
}

void Y_N(bool p) {
	p ? _Y() : _N();
}

LL vmax(vi v, LL n) {
	int MAX = 0;
	f(i, 0, n) {
		MAX = max(MAX, v[i]);
	}
	return MAX;
}

LL vmin(vi v, LL n) {
	int MIN = LL_INF;
	f(i, 0, n) {
		MIN = min(MIN, v[i]);
	}
	return MIN;
}

LL gcd(LL a, LL b) {
	LL r;
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}
LL lcm(LL a, LL b) {
	return (a / gcd(a, b) * b);
}

//素数判定
bool is_prime(int n) {
	for (int i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			return false;
		}
	}
	return true;
}

//エラトステネスの篩
void sieve(LL n) {
	vb s(n + 1, true);
	f(i, 2, n + 1) {
		for (int j = 2; i*j <= n; j++) {
			s[i*j] = false;
		}
	}
	cout << "2から" << n << "までの素数" << endl;
	f(i, 2, n + 1) {
		if (s[i]) {
			cout << i << " ";
		}
	}
}

//階乗計算
LL factorial(LL n) {
	LL a = 1, ret = 1;
	while (a < n) {
		a++;
		ret *= a;
		ret %= MOD;
	}
	return ret;
}


#pragma endregion 


/*****************************************************************************/
signed main(void) {
	int n;
	cin >> n;
	vi a(n), b(n);
	f_vI(a, n);
	f_vI(b, n);
	int sa = 0, sb = 0;
	f(i, 0, n) {
		if (a[i] > b[i]) {
			sb += a[i] - b[i];
		}
		if (b[i] > a[i]) {
			sa += (b[i] - a[i]) / 2;
		}
	}
	y_n(sa >= sb);
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <string> 
using namespace std;
 
int main() {
 	
 	int cont = 0;
    string S;
    cin >> S;
    
    for (int i = 0; i < 4; ++i)
    {
    	for (int j = 0; j < 4; ++j)
    	{
    		if (S[i] == S[j])
    		{
    			cont++;
    		}
    	}
    }
    if (cont == 8)
    {
    	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++)
#define rrep(i,n) for(int i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
using namespace std;


int main(){
    int n,a,b;
    cin>>n>>a>>b;
    cout<<((b-a)%2==0? "Alice":"Borys")<<endl;
    return 0;
}

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

using namespace std;
using ll = long long;

int N, M;
int X[100010];

int main(){

    cin >> N >> M;
    ll tot = 0;
    for(int i = 0; i < M; i++){
        cin >> X[i];
    }
    vector<int> v;
    sort(X, X+M);
    for(int i = 1; i < M; i++){
        tot += X[i] - X[i-1];
        v.push_back(X[i] - X[i-1]);
    }
    sort(v.begin(), v.end());
    
    int cnt = N - 1;
    for(int i = (int)v.size() - 1; i >= 0 && cnt > 0; i--){
        tot -= v[i];
        cnt--;
    }
    cout << tot << endl;
    

    return 0;
}


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

//関数
//main関数
int main() {
    
    
    //入力
    long H,W,h,w;
    cin>>H>>W>>h>>w;
    //計算
    //出力
    cout<<H*W-h*W-w*H+h*w<<endl;
}





Measured memory_bytes: 892
#include<iostream>
#include<vector>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;

int main(){
    int N;
    int A[20], B[20], C[20];
    int sum=0, old;

    cin >> N;
    rep(i,N) cin >> A[i];
    rep(i,N) {
        cin >> B[i];
        sum += B[i];
    }
    rep(i,N-1) cin >> C[i];

    for(int i=0; i<N-1; i++){
        if(A[i]+1==A[i+1]){
            sum+=C[A[i]-1];
        }
    }

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
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; }

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;

constexpr long double PI = 3.14159265358979323846264338327950288L;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

class CRally {
public:
    void solve(istream& cin, ostream& cout) {
      SPEED;
      int n; cin >> n;
      vector<int> x(n);
      rep(i, n) {
        cin >> x[i];
      }
      int ret = INT_MAX;
      for(int i=1; i<=100; i++) {
        int now = 0;
        rep(j, n) {
          now += (x[j]-i)*(x[j]-i);
        }
        chmin(ret, now);
      }
      cout << ret << endl;
    }
};

signed main() {
  CRally solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fi first
#define se second
#define int long long
using namespace std;
signed main(){
  priority_queue<int,vector<int>,greater<int> > q;
  int a,b,c[1000000]={};
  int d,e;
  int f;
  vector<pair<int,int> > p;
  cin>>a>>b;
  for(int i=0;i<a;i++){
    cin>>c[i];
    q.push(c[i]);
  }
  sort(c,c+a);
  for(int i=0;i<b;i++){
    cin>>d>>e;
    p.push_back(make_pair(e,d));
  }
  sort(p.begin(),p.end(),greater<pair<int,int> >());
  for(int i=0;i<b;i++){
    f=q.top();
    if(f<p[i].fi){
      for(int j=0;j<p[i].se;j++){
        //cout<<f<<" "<<e<<"\n";
        f=q.top();
        if(f<p[i].fi){
          q.pop();
          q.push(p[i].fi);
        }
        else break;
      }      
    }
    else break;
  }
  f=0;
  for(int i=0;i<a;i++){
    f+=q.top();
    q.pop();
  }
  cout<<f<<"\n";
}

Measured memory_bytes: 10996
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <vector>
#include <set>
#include <cassert>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <sstream>
#include <functional>
#include <iomanip>
#include <unordered_map>
//#include <windows.h>  //Should be deleted when using AtCoder&POJ
using namespace std;

#define ll long long
#define pii pair<int,int>
#define map unordered_map
/**==Info==
*Program:1
*Problem:すぬけ君の地下鉄旅行 / Snuke's Subway Trip
*Date:2018-7-15
*Algorithm:Teacher's Dijkstra
*Stats:Unknown*/

bool debug=false;

int n,m;
map<int,vector<int>> nei[100005]; //at station [] the train <1> can get <2>
map<int,int> d[100005]; //at station [] the train <1>'s dis is <2>
vector<int> lines[100005]; //lines at []

template<typename T> struct pq_small{
	priority_queue<T,vector<T>,greater<T> > pq;
	void push(T x){
		pq.push(x);
	}

	void pop(){
		pq.pop();
	}

	int size(){
		return pq.size();
	}

	bool empty(){
		return pq.empty();
	}

	T top(){
		return pq.top();
	}
};

int main(int argc,char* argv[]){
	scanf("%d%d",&n,&m);
	for(int i=0;i<m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		a--;b--;
		nei[a][c].push_back(b);
		nei[b][c].push_back(a);
		lines[a].push_back(c);
		lines[b].push_back(c);
	}
	
	pq_small<pair<int,pii>> pq; //first -> cost second -> station third -> line
	d[0][0]=0;
	pq.push(make_pair(0,make_pair(0,0)));
	while(!pq.empty()){
		pair<int,pii> last=pq.top();
		int c=last.first,p=last.second.first,q=last.second.second;
		
		if(debug)cout<<c<<" "<<p<<" "<<q<<endl;
		
		pq.pop();
		
		if(d[p][q]!=c){
			continue;
		}
		
		//Situation 1
		if(d[p].count(0)==0 || d[p][0]>c){
			d[p][0]=c;
			pq.push(make_pair(c,make_pair(p,0)));
		}
		
		//Situation 2
		if(q==0){
			for(int i=0;i<lines[p].size();i++){
				if(d[p].count(lines[p][i])==0 || d[p][lines[p][i]]>c+1){
					d[p][lines[p][i]]=c+1;
					pq.push(make_pair(c+1,make_pair(p,lines[p][i])));
				}
			}
		}
		
		//Situtation 3
		for(int i=0;i<nei[p][q].size();i++){
			if(d[nei[p][q][i]].count(q)==0 || d[nei[p][q][i]][q]>c){
				d[nei[p][q][i]][q]=c;
				pq.push(make_pair(c,make_pair(nei[p][q][i],q)));
				
				//cout<<"3 -> "<<c<<" "<<nei[p][q][i]<<" "<<q<<endl;
			}
		}
	}
	
	int mn=d[n-1][0];
	
	if(mn==0){
		cout<<-1;
	}else{
		cout<<mn;
	}
	return 0;
}



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

int N, A[100009];

int main() {
	cin >> N;
	for (int i = 0; i < N; i++) cin >> A[i];
	sort(A, A + N);
	cout << A[N - 1] - A[0] << endl;
	return 0;
}

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

Measured memory_bytes: 128