akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n, a, b, f1, f2, c;
    cin >> n;
    c=0;
    f1=0;
    for(int i=0; i<n; i++)
    {
        cin >> a >> b;
        if(a==b)
        {
            c++;
            if(c>=3)
            {
                f1=1;
            }
        }
        else
        {
            if(f1==0)
            {
                c=0;
            }
        }
    }
    if(f1)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    int n=s.length();
    bool maki=false;
    bool niko=false;
    for(int i=0;i<n;i++){
        if(maki){
            if((!niko)&&s[i]=='F')niko=true;
        }
        else{
            if(s[i]=='C')maki=true;
        }
    }
    if(maki&&niko)cout << "Yes"<<endl;
    else cout <<"No" <<endl;
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int c[4]={};
	int a; cin>>a;
	c[a]++;
	cin>>a;
	c[a]++;
	for(int i=1; i<=3; i++){
		if(c[i]==0){
			cout<<i<<endl;
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define MOD 1000000007
#define INF (1<<30)
#define LINF (1LL<<60)
#define endl "\n"
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcount(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
typedef unsigned long long int ull;
typedef long long lint;
 
 int main(void){
     bool alf[26]={};
     string S;
     cin >> S;
     int L=S.length();
     rep(i,L) alf[S[i]-'a']=1;
     bool check=0;
     rep(i,26){
         if(alf[i]==0){
             char ans='a'+i;
             cout << ans << endl;
             check=1;
             break;
         } 
     }
     if(check==0) cout << "None" << endl;
 }

Measured memory_bytes: 512
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int N = Integer.parseInt(scan.nextLine());
    String[] readA = scan.nextLine().split(" ", N);
    List<Integer> a = new ArrayList();
    for(String a_i: readA){
      a.add(Integer.parseInt(a_i));
    }
    
    int count = 0;
    for (int i=0; i<N; i+=2){
      if(a.get(i)%2 == 1){
        count++;
      }
    }
    
    System.out.println(count);
  }
}

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

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

using namespace std;

int main(){
  int N;
  int ac=0;
  int wa=0;
  int tle=0;
  int re=0;
  string check;
  
  cin >> N;
  
  for(int i=0;i<N;i++){
    cin >> check;
    if(check == "AC"){
      ac++;
    }else if(check == "WA"){
      wa++;
    }else if(check == "TLE"){
      tle++;
    }else if(check == "RE"){
      re++;
    }
  }
  
  cout << "AC x " << ac << endl;
  cout << "WA x " << wa << endl;
  cout << "TLE x " << tle << endl;
  cout << "RE x " << re << endl;
  
  return 0;
}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			String nk = sc.nextLine();
			String[] nka = nk.split(" ");
			int n = Integer.parseInt(nka[0]);
			int k = Integer.parseInt(nka[1]);
			if(n == 0 && k == 0) break;
			int[][] all = new int[n+1][k];
			boolean jud = true;
			for(int i = 0 ; i < all.length ; i++){
				String str = sc.nextLine();
				String[] stra = str.split(" ");
				
				for(int j = 0 ; j < stra.length ; j++){
					all[i][j] = Integer.parseInt(stra[j]);
				}
			}
			
			for(int i = 1 ; i < all.length ;i++){
				for(int j = 0 ; j < all[i].length ; j++){
					all[0][j] -= all[i][j];
				}
			}
			for(int i = 0 ; i < all[0].length ;i++){
				if(all[0][i] < 0) jud = false; 
			}
			if(jud){
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
		sc.close();
	}

}

Measured memory_bytes: 67912
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<cmath>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll n;
double sum=0;
bool used[8]={};
ll kaijo(ll n){
  ll res=1;
  for(int i=1;i<=n;i++){
    res*=i;
  }
  return res;
}
signed main(){
  cin >> n;
  double x[n],y[n];
  vector<ll> v;
  for(int i=0;i<n;i++){
    cin >> x[i] >> y[i];
    v.push_back(i);
  }
  do{
    double tmp=0;
    for(int i=1;i<n;i++){
      tmp += sqrt(pow(x[v[i-1]]-x[v[i]],2.0)+pow(y[v[i-1]]-y[v[i]],2.0));
    }
    sum+=tmp;
  }while(next_permutation(v.begin(),v.end()));
  printf("%.10lf\n",sum/kaijo(n));
}


Measured memory_bytes: 256
#! ruby -Ks

while true
	array = [1]
	line = gets
	line = line.split()
	n = line[0].to_i
	if n == 0
		break
	end
	r = line[1].to_i
	
	for i in 2..n
		array.unshift(i)
	end
	#p array
	
	for i in 1..r
		line = gets
		line = line.split()
		p = line[0].to_i
		c = line[1].to_i
		
		b = array.slice!(p-1,c)
		array[0,0] = b
		#p array
	end
	puts array[0]
end

Measured memory_bytes: 6128
#include<bits/stdc++.h>
#define int long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define PI acos(-1)
#define bp __builtin_popcountll
#define all(x) x.begin(),x.end()
#define sp fixed<<setprecision
#define pii pair<long long,long long>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

int MOD = (1e9)+7;
const int N = 1e6+5;

signed main()
{
    FAST
    int tc=1;
    //cin>>tc;
    for(int ti=1;ti<=tc;ti++)
    {
        int n;
        cin>>n;
        string s;
        cin>>s;
        int ok = 1-(n%2);
        for(int i=0,j=n/2;ok && i<n/2;i++,j++)if(s[i]!=s[j])ok=0;
        cout<<((ok)?"Yes":"No")<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cmath>
#include <functional>
#include <queue>
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
using namespace std;
typedef long long ll;
//typedef unsigned long long ull;

const ll INF = 9223372036854775807;
const int inf = 2147483647;

ll max(ll a,ll b){
    if(a>b)return a;
    else return b;
}

/*****************************
 バグの原因は、条件分岐で使ってるmを変化させてしまったため、m=奇数×２みたいな数だと両方のif分岐に入っている
 解決策
 1. elseをつける
 2. 別の変数を用意して、mの変化を防ぐ
******************************/


int n;
ll a[100000];
ll m = -1;
ll res[2]={0};
ll dif = INF;
int d;
int main() {
    cin >> n;
    REP(i,n){
        cin >> a[i];
        if(m<a[i]){
            m = a[i];
            res[0] = a[i];
            d = i;
        }
    }
    if(m%2==0){
        m /= 2;
        REP(i,n){
            if(d!=i){
                /*put(i);
                put(":");
                put(abs(m-a[i]));*/
                if(abs(m-a[i])<dif){
                    dif = abs(m-a[i]);
                    res[1] = a[i];
                }
            }
        }
    }else{
        m /= 2;
        ll m2 = m+1;
        REP(i,n){
            if(d!=i){
                if(abs(m-a[i])<dif){
                    dif = abs(m-a[i]);
                    res[1] = a[i];
                }
                if(abs(m2-a[i])<dif){
                    dif = abs(m2-a[i]);
                    res[1] = a[i];
                }
            }
        }
    }
    cout << res[0] << " " << res[1] <<endl;
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <set>
#include <map>
#include <cstdio>
using namespace std;
using ll = long long;


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


int L[10];
int R[10];

bool Map[200007];
int K;
bool in(int x) {
    for (int i = 0; i < K; i++) {
        if (L[i] <= x && x <= R[i])return true;

    }
    return false;
}

int path(int from, int to) {
    int ans = 0;
    if (from > to)return 0;
    if (from == to)return 1;
    for (int i = 0; i < K; i++) {
        for (int j = L[i]; j <= R[i]; j++) {
            ans += path(from + j, to);
            ans %= 998244353;
        }
    }
    return ans;
}

int ans[200007];
int FirstAp[100007];
ll A[100007];
int main() {

    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,X,M;

    cin >> N >> X >> M;
    
    int lpoint = 0;
    int lpointi = 0;
    ll sum = X;
    A[1] = X;
    FirstAp[X] = 1;
    for (int i = 2; i <= M; i++) {
        A[i] = (A[i - 1] * A[i - 1]) % M;
        int a = A[i];
        if (FirstAp[a]) {
            lpoint = a;
            lpointi = i;
            break;
        }
        FirstAp[a] = i;
        sum += a;
        if (i == N) {
            cout << sum << endl; return 0;
        }
    }
    int loopstart = FirstAp[lpoint];
    int looplength = lpointi - loopstart;
    ll intersum = 0;
    for (int i = loopstart; i < lpointi; i++) {
        intersum += A[i];
    }
    ll restloop = N - lpointi + 1;
    int restloopm = restloop % looplength;
    sum += intersum * (restloop / looplength);
    for (int i = loopstart; i < loopstart + restloopm; i++) sum += A[i];
    //rep1(i, N)cout << i << ": " << ans[i] << endl;
    cout << sum<< endl;
    return 0;
}

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

int main() {
  int N,bsum = 0 ,asum = 0;
  cin >> N;
  vector<int> card(N);
  
  for(int i=0; i<N; i++) cin >> card.at(i);                   
  sort(card.begin(),card.end());
  reverse(card.begin(),card.end());
  
  for(int i=0; i<N; i++){
  if(i%2 == 0) asum += card.at(i);
    else bsum += card.at(i);
  }
  cout << asum-bsum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(ll i = (begin); i < (end); i++)
#define rep(i, n) FOR(i, 0, n)
using ll = long long;
using namespace std;
#define all(x) (x).begin(),(x).end()
using pii = pair<int, int>; using vi = vector<int>; using vl = vector<ll>;

ll dp[102][100005];
constexpr int V = 100005;

signed main() {
    int n, W;
    cin >> n >> W;
    vi w(n), v(n);
    rep(i,n) cin>>w[i]>>v[i];
    rep(i,102) rep(j, V) dp[i][j] = W+2;
    dp[0][0] = 0;
    dp[0][v[0]] = w[0];
    // FOR(i,1,v[i]+1) dp[0][i] = w[0];
    FOR(i,1,n) {
        rep(j, v[i]) dp[i][j] = dp[i-1][j];
        rep(j,V-v[i]) {
            dp[i][j+v[i]] = min(dp[i-1][j] + w[i], dp[i-1][j+v[i]]);
        }
    }
    int ans = 0;
    rep(i,V) if(dp[n-1][i] <= W) ans = i;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 80000
import math
A, B, H, M = map(int, input().split())
m = H*60 + M
a_rad = m / (60 * 12) * math.pi * 2
b_rad = M / 60 * math.pi * 2
ans = (A*A + B*B - 2*A*B*math.cos(a_rad-b_rad))**0.5
print(ans)


Measured memory_bytes: 9440
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n + 1];
		int[] sum = new int[n + 1];
		a[0] = 0;
		sum[0] = 0;
		for(int i = 1; i < n + 1; i++) {
			a[i] = sc.nextInt();
			sum[i] = sum[i - 1] + Math.abs(a[i] - a[i - 1]);
		}
		for(int i = 1; i < n + 1; i++) {
			long ans = 0;
			if(i != n) {
				ans += Math.abs(a[i + 1] - a[i - 1]);
				ans += sum[n] - sum[i + 1];
				ans += sum[i - 1];
				ans += Math.abs(a[n]);
			} else {
				ans += sum[n - 1] + Math.abs(a[n - 1]);
			}
			System.out.println(ans);
		}
	}

}


Measured memory_bytes: 65568
#include "iostream"
#include "algorithm"
#include "vector"
using namespace std;

int main(void) {
  int N;
  cin >> N;
  vector<int> a;
  for (int i = 0; i < N; i++) {
    int t;
    cin >> t;
    a.push_back(t);
  }

  sort(a.begin(), a.end(), greater<int>());
  int A = 0, B = 0;
  for (int i = 0; i < N; i++) {
    (i & 1 ? B : A) += a[i];
  }

  cout << A - B << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
using namespace std; 
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#define rep(i,a,b) for(ll i=(a);i<=(b);i++)
#define pb push_back
#define ll long long
const ll mod=1e9+7;

ll jc[200005];
ll app(ll a,ll b)
{
	return ((a%mod)*(b%mod))%mod;
}
ll add(ll a,ll b)
{
	return (((a%mod)+(b%mod))%mod+mod)%mod;
}

ll ksm(ll a,ll b)
{
	ll res=1;
	while(b)
	{
		if(b%2==1)
		res=app(res,a);
		a=app(a,a);
		b/=2;
		
	}
	return res;
}
ll C(ll a,ll b)
{
	return app(jc[a],app(ksm(jc[b],mod-2),ksm(jc[a-b],mod-2)));
}



int main(int argc, char** argv) {
	int n,k;
	cin>>n>>k;
	int p;
	jc[0]=1;
	rep(i,1,n)
	jc[i]=app(jc[i-1],i);
	
	ll ans=0;
	for(int i=0;i<=min(n,k);i++)
	{
		ans=add(ans,app(C(n,i),C(n-1,n-i-1)));
	}
	//cout<<app(C(n,2),C(n-1,n-3))<<endl;
	cout<<ans;
	return 0;
}

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

int main() {
  int a, cnt;
  cin >> a;
  if (a >= 100) {
    cnt++;
    a -= 100;
  }
  if (a >= 10) {
    cnt++;
    a -= 10;
  }
  if (a >= 1) {
    cnt++;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
S = [False if s == "<" else True for s in input()]

N = len(S)

a = [0] * (N+1)

for i in range(N):
    if not S[i]:
        a[i+1] = max(a[i+1], a[i] + 1)

for i in range(N-1, -1, -1):
    if S[i]:
        a[i] = max(a[i], a[i+1] + 1)

print(sum(a))

Measured memory_bytes: 27452
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <cmath>

#define	MOD 1000000007;
#define PI 3.14159265358979323846;
#define rep(i,n) for(ll i = 0;i<(ll)n;i++)
using namespace std;
typedef long long ll;
ll mod = 1000000007;
//
static const int INFTY = (1 << 21);
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int n;
static const int MAX = 300;
vector<pair<int, int>> adj[MAX];
vector<pair<int, int>> edge;
map<pair<int, int>, int> usedEdge;

int d[MAX];
int p[MAX];
void dijkstra(int s) {
	priority_queue<pair<int, int>>PQ;
	int color[MAX];

	rep(i, n) {
		d[i] = INFTY;
		color[i] = WHITE;
		p[i] = 0;
	}

	d[s] = 0;
	p[s] = -1;
	PQ.push(make_pair(0, s)); // ?reverse?
	color[s] = GRAY;

	while (!PQ.empty()) {
		pair<int, int> f = PQ.top(); PQ.pop();
		int u = f.second;

		color[u] = BLACK;

		if (d[u] < f.first * (-1)) continue;

		rep(j, adj[u].size()) {
			int v = adj[u][j].first;
			if (color[v] == BLACK) continue;
			if (d[v] > d[u] + adj[u][j].second) {
				d[v] = d[u] + adj[u][j].second;
				PQ.push(make_pair(d[v] * (-1), v));
				p[v] = u;
				color[v] = GRAY;
			}
		}
	}
	//rep(i, n) cout << i << " " << (d[i] == INFTY ? -1 : d[i]) << endl;
	//rep(i, n) cout << i << " " << (p[i] == INFTY ? -1 : p[i]) << endl;
}

vector<int> get_path(int t) {
	vector<int> path;
	for (; t != -1; t = p[t])path.push_back(t);
	reverse(path.begin(), path.end());
	return path;
}
bool e[MAX][MAX];

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

	rep(i, m) {
		int a, b, c;
		cin >> a >> b >> c;
		adj[a - 1].push_back(make_pair(b - 1, c));
		adj[b - 1].push_back(make_pair(a - 1, c));

		edge.push_back(make_pair(a - 1, b - 1));
		edge.push_back(make_pair(b - 1, a - 1));
	}

	rep(i, n) {
		dijkstra(i);
		//rep(i, n) {
		//	cout << i << " " << (p[i] == INFTY ? -1 : p[i]) << endl;
		//}
		rep(j, n) {
			if (p[j] == -1) {
				continue;
			}

			for (vector<pair<int, int>>::iterator it = edge.begin(); it != edge.end(); it++) {
				if (j == it->first && p[j] == it->second)
				{
					usedEdge[make_pair(j, p[j])]++;
				}
			}
		}
	}
	cout << (edge.size() - usedEdge.size()) / 2 << endl;
	return 0;
}

Measured memory_bytes: 384
import sys
input = sys.stdin.readline
from collections import deque

nn = 200200
mod = 10**9+7

fa = [1] * (nn+1)
fainv = [1] * (nn+1)
inv = [1] * (nn+1)
for i in range(nn):
    fa[i+1] = fa[i] * (i+1) % mod
fainv[-1] = pow(fa[-1], mod-2, mod)
for i in range(nn)[::-1]:
    fainv[i] = fainv[i+1] * (i+1) % mod
for i in range(1, nn)[::-1]:
    inv[i] = fainv[i] * fa[i-1]

C = lambda a, b: fa[a] * fainv[b] % mod * fainv[a-b] % mod if 0 <= b <= a else 0

N = int(input())
X = [[] for i in range(N)]
for i in range(N-1):
    x, y = map(int, input().split())
    X[x-1].append(y-1)
    X[y-1].append(x-1)

P = [-1] * N
Q = deque([0])
R = []
while Q:
    i = deque.popleft(Q)
    R.append(i)
    for a in X[i]:
        if a != P[i]:
            P[a] = i
            X[a].remove(i)
            deque.append(Q, a)

BU = [1] * N
TD = [1] * N
SI = [1] * N
for i in R[::-1]:
    a = 1
    s = 1
    for j in X[i]:
        a = a * BU[j] % mod
        s += SI[j]
    SI[i] = s
    BU[i] = inv[s] * a % mod

for i in R:
    c = len(X[i])
    AR = [1] * (c + 1)
    AL = 1
    for k in range(c-1, 0, -1):
        j = X[i][k]
        AR[k] = AR[k+1] * BU[j] % mod
    for k, j in enumerate(X[i]):
        TD[j] = TD[i] * AL % mod * AR[k+1] % mod * inv[N - SI[j]] % mod
        AL = AL * BU[j] % mod

for i in range(N):
    print(BU[i] * fa[SI[i]] % mod * TD[i] % mod * fa[N - SI[i]] % mod * C(N-1, SI[i] - 1) % mod)

Measured memory_bytes: 128780
h, w, k = gets.split.map(&:to_i)
c = Array.new(h){gets.chomp.bytes}
cnt = 0
[0, 1].repeated_permutation(h).each do |x|
  m = Marshal.load(Marshal.dump(c))
  x.each_with_index do |y, i|
    if y == 1 then
      w.times do |j|
        m[i][j] = '.'.ord
      end
    end
  end
  [0, 1].repeated_permutation(w) do |u|
    mc = Marshal.load(Marshal.dump(m))
    u.each_with_index do |v, j|
      if v == 1
        h.times do |i|
          mc[i][j] = '.'.ord
        end
      end
    end
    cnt += 1 if mc.flatten.count('#'.ord) == k
  end
end
puts cnt

Measured memory_bytes: 14360
//@author yash2040
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long
//#define int long long
#define pb push_back
#define mod 1000000007
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
int main()
{
	fast();
	int r;
	cin>>r;
	double ar=2*(3.14)*r;
	cout<<ar<<endl;	
}




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

int h, w, d;
char col[1100][505];

int main() {
	cin >> h >> w >> d;
	if (d%2 == 1) {
		for (int i = 0; i < h; ++i) {
			for (int j = 0; j < w; ++j) {
				if ((i+j)%2 == 0)
					cout << "R";
				else
					cout << "G";
			}
			cout << "\n";
		}
		return 0;
	}

	int k = d/2;
	for (int i = 0; i < h + w; i += d) {
		if ((i/d)%2 == 0) {
			for (int j = 0; j < d; ++j) {
				//color first j ones B
				int p = d-j/2;
				for (int n = 0; n < min(h+w-i-j, w); n++) {
					if (n%d >= p || n%d <= (p+k+d-1)%d)
						col[i+j+n][n] = 'Y';
					else
						col[i+j+n][n] = 'B';
				}
			}
		} else {
			for (int j = 0; j < d; ++j) {
				//color first j ones B
				int p = d-j/2;
				for (int n = 0; n < min(h+w-i-j, w); n++) {
					if (n%d >= p || n%d <= (p+k+d-1)%d)
						col[i+j+n][n] = 'R';
					else
						col[i+j+n][n] = 'G';
				}
			}
		}
	}

	for (int i = w; i < h+w; ++i) {
		for (int j = 0; j < w; ++j)
			cout << col[i][j];
		cout << "\n";
	}
}


Measured memory_bytes: 1024
def make_divisors(n):
  kuku = 'No'
  for i in range(1, int(n**0.5)+1):
    x = 100
    y = 100
    if n % i == 0:
      x = i
      y = n//i
    if x<=9 and y<=9:
      kuku = 'Yes'
      break
  return kuku
  
n = int(input())
kuku = make_divisors(n)
print(kuku)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
template<class T>void chmax(T &a,T b){if(a<b)a=b;}
template<class T>void chmin(T &a,T b){if(a>b)a=b;}
constexpr int INF=1000000000000000000;
int Random(int mi,int ma){
    random_device rnd;
    mt19937 mt(rnd());//32bit
    //[mi,ma]
    uniform_int_distribution<int>engine(mi,ma);
    return engine(mt);
}
int d,c[26],s[400][26],t[400];
set<int>st[26];
int toscore(int dd,int q){
    int from=t[dd],to=q;
    int score=s[d][to]-s[d][from];
    auto it=st[from].upper_bound(dd);
    int r=*it;
    it=st[from].lower_bound(dd);
    it--;
    int l=*it;
    score-=(r-dd)*(dd-l);
    it=st[to].upper_bound(dd);
    r=*it;
    it=st[to].lower_bound(dd);
    it--;
    l=*it;
    score+=(r-dd)*(dd-l);
    return score;
}
int score=0;
void init(){
    vector<pair<int,pair<vector<int>,vector<int>>>>last={{0,{vector<int>(26,-1),{}}},{0,{vector<int>(26,-1),{}}}};
    rep(i,d){
        vector<pair<P,int>>ma={{{-INF,-1},-1},{{-INF,-1},-1}};
        rep(j,26){
            rep(l,2){
            int score=s[i][j];
            int memo=last[l].se.fi[j];
            last[l].se.fi[j]=i;
            rep(k,26)score-=c[k]*(i-last[l].se.fi[k]);
            last[l].se.fi[j]=memo;
            ma.pb({{score,j},l});
            sort(all(ma),greater<>());
            ma.resize(2);
            }
        }
        vector<pair<int,pair<vector<int>,vector<int>>>>next;
        for(auto p:ma){
            vector<int>v=last[p.se].se.fi;
            vector<int>u=last[p.se].se.se;
            v[p.fi.se]=i;
            u.pb(p.fi.se);
            next.pb({last[p.se].fi+p.fi.fi,{v,u}});
        }
        sort(all(next));
        last=next;
    }
    rep(i,d){
        t[i]=last[0].se.se[i];
        st[t[i]].insert(i);
    }
    rep(i,26){
        st[i].insert(-1);
        st[i].insert(d);
    }
}
signed main(){
    cin.tie(0);ios::sync_with_stdio(false);
    cin>>d;
    rep(i,26)cin>>c[i];
    rep(i,d){
        rep(j,26){
            cin>>s[i][j];
        }
    }
    init();
    int score=0,last[26];
    fill(last,last+26,-1);
    rep(i,d){
        score+=s[i][t[i]];
        last[t[i]]=i;
        rep(j,26)score-=c[j]*(i-last[j]);
    }
    /*
    rep(_,150000){
        int dd=Random(0,d-1),q=Random(0,24);
        if(t[dd]<=q)q++;
        int to=toscore(dd,q);
        if(to>0){
            score+=to;
            int from=t[dd],to=q;
            t[dd]=to;
            st[from].erase(dd);
            st[to].insert(dd);
        }
    }*/
    rep(i,d)cout<<t[i]+1<<endl;
    return 0;
}

Measured memory_bytes: 3892
#!/usr/bin/env php
<?php
// Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
function solve(int $N, array $H)
{
    $max = array_shift($H);
    $count = 1;
    foreach ($H as $i) {
        if ($i >= $max) {
            $count++;
            $max = $i;
        }
    }
    echo $count.PHP_EOL;
}

fscanf(STDIN, '%d', $N);
$H = explode(' ', fgets(STDIN)); // array
solve($N, $H);



Measured memory_bytes: 4604
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stdio.h>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <math.h>
#include <iomanip>
using namespace std;
#define Would
#define you
const int INF = 9999999;
const int MOD = 1e9 + 7;

int a, b, k[20], l[20], ma, ans = 1e9, sum, mon;
int main() {
	cin >> a >> b;
	for (int i = 0; i < a; ++i) { cin >> k[i] >> l[i]; }
	for (int bit = 0; bit < (1 << a); ++bit) {
		sum = 0; ma = -1; mon = 0;
		for (int i = 0; i < a; ++i) {
			if (bit&(1 << i)) {
				sum += k[i] * (i + 1) * 100 + l[i];
				mon += k[i];
			}
			else { ma = i; }
		}
		if (sum < b) {
			int n = (ma + 1) * 100, m = (b + n - sum - 1) / n;
			if (m >= k[ma]) { continue; }
			mon += m;
		}
		ans = min(ans, mon);
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int,int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
#define rep(i,n) for(int i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define P 1000000007
#define STI(s) atoi(s.c_str())//string to int
#define mp(p,q) make_pair(p,q)
#define Sort(a) sort(a.begin(),a.end())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z temp.cpp
//./a.exe


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

int n,a[50]={},b[50]={},c[50]={},ans = 0;

cin >> n;

rep(i,n) cin >>a[i];
rep(i,n) cin >> b[i];
rep(i,n-1) cin >> c[i];

rep(i,n){

    if (a[i]+1 == a[i+1])
    {
        ans += b[a[i]-1]+c[a[i]-1];
    }else
    {
        ans += b[a[i]-1];
    }

}

cout << ans << 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;
using p = pair<int,int>;

int main(){
  int H,N;
  cin >> H >> N;
  
  vector<int>a(N);
  int sum = 0;
  
  rep(i,N) {
    cin >> a[i];
    sum += a[i];
  }
  if ( H <= sum )cout << "Yes" << endl;
  if ( H > sum )cout << "No" << endl;
}

  


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef pair<int,int> pii;
typedef pair<long long, int> pli;

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

ll mod = 1000000007;

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

ll inv(ll x){
  ll res = 1;
  ll k = mod - 2;
  ll y = x;
  while(k){
    if(k&1)res = (res*y)%mod;
    y = (y*y) % mod;
    k /= 2;
  }
  return res;
}


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

  int n;
  ll d;
  cin >> n >> d;
  
  int ret = 0;
  rep(i,n){
    ll x,y;
    cin >> x >> y;
    if(x*x + y*y <= d*d) ret++;
  }
  cout << ret << endl;
}

Measured memory_bytes: 3652
n,y=map(lambda x:int(x),input().strip().split())
y//=1000
res =[-1]*3
flag=False

for i in range(n+1):
    if flag:
        break
    for j in range(n-i+1):
        yen=i*10+j*5+(n-i-j)

        if yen ==y:
            res=[i,j,n-i-j]
            flag=True
            break
print(res[0],"",res[1],"",res[2])

Measured memory_bytes: 3188
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

vector<int> Zalgorithm(string s){
    int n = s.size();
    vector<int> a(n);
    a[0] = n;
    int i = 1, j = 0;
    while(i < n){
        while(i + j < n && s[j] == s[i+j]) ++j;
        a[i] = j;
        if(j == 0){++i; continue;}
        int k = 1;
        while(i + k < n && k + a[k] < j) a[i+k] = a[k], ++k;
        i += k; j -= k;
    }

    return a;
}

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

    int n; cin>>n;
    string s; cin>>s;

    int ans = 0;
    for(int i=0; i<n; i++){
        string t = s.substr(i);
        auto v = Zalgorithm(t);
        for(int j=0; j<v.size(); j++){
            if(j >= v[j]) chmax(ans, v[j]);
        }
    }

    cout << ans << endl;

    return 0;
}

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

using namespace std;
#define IOS ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define ll long long
#define ld long double
#define endl "\n"

int main()
{
	IOS;
	int n;
	string s,t;
	cin >>n>>s>>t;
	for(int i=0;i<n;i++)
	{
		cout <<s[i]<<t[i];
	}
	cout <<endl;
	return 0;
}

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

using namespace std;

int main()
{
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  for(int i = 0; i <= s.length() - 3; ++i)
  {
    if(s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C')
      ++ans;
  }
  cout << ans << endl;
  return 0;
}


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


int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  
  if (n % 3 != 0){
    int term = 0;
    for ( int i = 0 ; i < n ; i++){
      if (a[i] != 0) {
        term = 1;
        break;
      }
    }
    if (term == 1){
      printf("No\n");
    }
    else {
      printf("Yes\n");
    }
  }
  
  if ( n % 3 == 0) {
    /*
    ll sum = 0;
    ll term = 2 * n / 3;
    for (int i = 0; i < n; i++) {
      sum += a[i] % term;
    }
    if (sum % term == 0 ) {
      printf("Yes\n");
    }
    else {
      printf("No\n");
    }
    */
    
    int get = 2 * n / 3;
    vector<int> bit(30);
    for (int i = 0; i < n; i++) {
      int tmp = a[i]; 
      for (int j = 0; j < 30; j++){
        bit[j] += tmp % 2;  
        tmp = tmp / 2;
      }
    }
    int term = 0;
    for ( int i = 0 ; i < 30 ; i++){
      if (bit[i] != get && bit[i] != 0) {
        term = 1;
        break;
      }
    }
    if (term == 1){
      printf("No\n");
    }
    else {
      printf("Yes\n");
    }   
  }
   

}


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

struct Edge {
	int to;
	long double dist{1};
};
using EdgeVec = std::vector<Edge>;
using EdgeLists = std::vector<EdgeVec>;

///////////////////
// ダイクストラ法 //
///////////////////

// 負辺を含まないグラフの最短経路アルゴリズム
// Edgeは{to, dist}
template <typename Metric = int64_t>
std::vector<Metric> dijkstra(const EdgeLists& edges, const int source)
{
	std::vector<Metric> distance(edges.size(), 1e18);
	using DistPoint = std::pair<Metric, int>;
	std::priority_queue<DistPoint, std::vector<DistPoint>, std::greater<DistPoint>> updatedQueue;
	distance[source] = 0;
	updatedQueue.push({0, source});
	while (!updatedQueue.empty())
	{
		DistPoint now{updatedQueue.top()};
		updatedQueue.pop();
		if (now.first > distance[now.second]) continue;
		for (const Edge& next: edges[now.second])
			if (now.first + next.dist < distance[next.to])
			{
				distance[next.to] = now.first + next.dist;
				updatedQueue.push({distance[next.to], next.to});
			}
	}
	return std::move(distance);
}

int main()
{
	using Point = std::complex<long double>;
	Point start, goal;
	{
		long double x[2], y[2];
		for (int i{}; i < 2; i++)
			scanf("%Lf%Lf", x + i, y + i);
		start = {x[0], y[0]};
		goal = {x[1], y[1]};
	}
	int N;
	scanf("%d", &N);
	std::vector<Point> points(N);
	std::vector<long double> r(N);
	for (int i{}; i < N; i++)
	{
		long double x, y;
		scanf("%Lf%Lf%Lf", &x, &y, &r[i]);
		points[i] = {x, y};
	}
	// {points, start, goal}
	EdgeLists edges(N + 2);
	for (int i{}; i < N; i++)
		for (int j{}; j < N; j++)
		{
			if (i == j) continue;
			edges[i].push_back({j, std::max<long double>(0, std::abs(points[i] - points[j]) - r[i] - r[j])});
		}
	for (int i{}; i < N; i++)
	{
		edges[N].push_back({i, std::max<long double>(0, std::abs(points[i] - start) - r[i])});
		edges[i].push_back({N + 1, std::max<long double>(0, std::abs(points[i] - goal) - r[i])});
	}
	edges[N].push_back({N + 1, std::max<long double>(0.0, std::abs(start - goal))});
	auto distance{dijkstra<long double>(edges, N)};
	printf("%.10Lf\n", distance[N + 1]);

	return 0;
}

Measured memory_bytes: 42752
#include <iostream>
using namespace std;
int main()
{
	int t, n, h[100], i, j, up, down;
	cin >> t;
	for (i = 0; i < t; i++)
	{
		cin >> n;
		for (j = 0; j < n; j++)
			cin >> h[j];
		for (j = 0, up = down = 0; j < n-1; j++)
		{
			if (h[j] < h[j+1] && h[j+1]-h[j] > up)
				up = h[j+1] - h[j];
			if (h[j] > h[j+1] && h[j]-h[j+1] > down)
				down = h[j] - h[j+1];
		}
		cout << up << " " << down << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

int main()
{
    int n, target_xor;
    cin >> n >> target_xor;

    if(target_xor == 0 && n == 0)
    {
        cout << "0 0";

        return 0;
    }

    if(target_xor == 0 && n == 1)
    {
        cout << " 0 0 1 1";

        return 0;
    }

    if(n <= 1 || target_xor >= (1 << n))
    {
        cout << "-1";

        return 0;
    }

    for(int i = 0; i < (1 << n); i++)
        if(i != target_xor)
            cout << i << " ";

    cout << target_xor << " ";

    for(int i = (1 << n) - 1; i >= 0; i--)
        if(i != target_xor)
            cout << i << " ";

    cout << target_xor << " ";

    return 0;
}


Measured memory_bytes: 1792
import java.util.*;
public class Main{
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		int N=sc.nextInt();
		int D=sc.nextInt();
		sc.close();
		if(N%(2*D+1)==0) {
			System.out.println(N/(2*D+1));
		}else {
		System.out.println(N/(2*D+1)+1);
		}
	}
}

Measured memory_bytes: 21844
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.ExceptionServices;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = Read();
            var total = 0;
            for (int i = 0; i < N.Length; i++)
            {
                total += int.Parse(N[i].ToString());
            }
            if (total % 9 == 0)
            {
                WriteLine("Yes");
            }
            else
            {
                WriteLine("No");
            }
        }

        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 32964
s = input().rstrip()
t = input().rstrip()
s_anum = [0] * len(s)
t_anum = [0] * len(s)
val = 0
for i, ch in enumerate(s):
    if ch == "A":
        val += 1
    elif ch == "B":
        val += 2
    s_anum[i] = val % 3
s_anum = [0] + s_anum
val = 0
for i, ch in enumerate(t):
    if ch == "A":
        val += 1
    elif ch == "B":
        val += 2
    t_anum[i] = val % 3
t_anum =  [0] + t_anum

q = int(input())
for i in range(q):
    a, b, c, d = [int(item) for item in input().split()]
    if (s_anum[b] - s_anum[a-1] + 3) % 3 == (t_anum[d] - t_anum[c-1] + 3) % 3:
        print("YES")
    else:
        print("NO")

Measured memory_bytes: 5748
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで

#include <bits/stdc++.h>
#define mod 1000000007
#define INF LLONG_MAX
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};
map< int64_t, int > prime_factor(int64_t n) {
  map< int64_t, int > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

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

    ll a,b,d,n,maxi=0,f=0,mini=INF,sum=0;
    string str;
    cin>>a>>n;
    set<ll> s;
    map<ll,ll> m;
    //cout << n << ":";
    sum=1;
    for(auto p : prime_factor(n)) {
        while(p.second>=a){
            sum*=p.first;
            (p.second-=a);
        }
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
//#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD 1000000007
#define MOD2 998244353
#define MOD3 1000000009
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e9)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
//ifstream cinn("in.in");ofstream coutt("out.out");
int poww(const int &a,int b,const int &m=MOD){if(b==0)return 1;int x=poww(a,b/2,m);x=x*x%m;if(b&1)x=x*a%m;return x;}
int ceil(const int &a,const int &b){return (a+b-1)/b;}
////Read:
//Check corner cases, n==1;
//
////Some function:
//__builtin_popcountll(), is_sorted(),

int r,c;
int a[80][80],b[80][80];
int dp[80][80][160*80+1];


int f(int i,int j,int diff){
    if(i>=r || j>=c){
        if(abs(r-i)+abs(c-j)==1)return diff;
        return INF;
    }
    int &ans=dp[i][j][diff];
    if(ans!=-INF)return ans;
    ans=INF;
    
    int p,q;
    
    //a
    p=a[i][j]-b[i][j];
    if(diff+p<0)p=-(diff+p);
    else p=p+diff;
    
    //b
    q=b[i][j]-a[i][j];
    if(diff+q<0)q=-(diff+q);
    else q=q+diff;
    
    ans=min(ans,f(i+1,j,p));
    ans=min(ans,f(i,j+1,p));
    ans=min(ans,f(i+1,j,q));
    ans=min(ans,f(i,j+1,q));
    
    return ans;
}

signed main(){
    FASTER;
    cin>>r>>c;
    for(int i=0;i<r;i++)for(int j=0;j<c;j++)cin>>a[i][j];
    for(int i=0;i<r;i++)for(int j=0;j<c;j++)cin>>b[i][j];
    
    for(int i=0;i<80;i++)
        for(int j=0;j<80;j++)
            for(int k=0;k<160*80+1;k++)
                    dp[i][j][k]=-INF;
    
    cout<<f(0,0,0);
}



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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define Abs(x)((x) < 0 ? (x) * -1 : (x))

#define rep(x, y) for ((x) = 0; (x) < (y); (x)++)
#define repin(x, y) for ((x) = 0; (x) <= (y); (x)++)
#define nep(x, y) for ((x) = (y) - 1; 0 <= (x); (x)--)
#define nepi(x, y, z) for ((x) = (y) - 1; (z) <= (x); (x)--)
#define repi(x, y, z) for ((x) = (z); (x) < (y); (x)++)
#define repiin(x, y, z) for ((x) = (z); (x) <= (y); (x)++)
#define reps(x, y, z) for ((x) = 0; (x) < (y); (x) += (z))
#define repis(x, y, z, s) for ((x) = (z); (x) < (y); (x) += (s))
#define repit(x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define nepit(x) for (__typeof((x).rbegin()) it = (x).rbegin(); it != (x).rend(); it++)

#define All(x) (x).begin(),(x).end()

#define Mem0(x) memset(x, 0, sizeof(x))
#define Mem1(x) memset(x, -1, sizeof(x))

#define Unique(v) v.resize(unique(All(v)) - v.begin())

#define peq(p0, p1)(p0.first == p1.first && p0.second == p1.second)

#define End '\n'
#define Out(x) cout<<(x)<<End
#define OutP(p, sep, end) cout<<p.first<<sep<<p.second<<end

template<typename T> inline bool Max(T &x, const T &y) { return x < y ? x = y, 1 : 0; }
template<typename T> inline bool Min(T &x, const T &y) { return x > y ? x = y, 1 : 0; }
template<typename T> using V = vector<T>;
template<typename T> using VV = V<V<T> >;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define lb std::lower_bound
#define ub std::upper_bound

#define lbi(v, x) lb(All(v), (x))-v.begin()
#define ubi(v, x) ub(All(v), (x))-v.begin()

static const ll MOD = 1e9 + 7;
static const double PI = 3.141592653589793;

#define LOCAL 0

int main()
{
#if LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#endif

    cin.tie(0);
    ios::sync_with_stdio(false);
	//std::cout.precision(18);

    int a[3];

	cin >> a[0] >> a[1] >> a[2];

	sort(a, a + 3);

	if (a[0] + a[1] == a[2]) Out("Yes");
	else Out("No");
	
	return 0;
}


Measured memory_bytes: 256
[N, X] = [int(i) for i in input().split()]
Ls = [int(i) for i in input().split()]

flag = True
D = 0
for i in range(N):
    D += Ls[i]
    if D > X:
        print(i+1)
        flag = False
        break

if flag == True:
    print(N+1)


Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main(void){
    // Your code here!
    long long int N,H,W,x,i,j,k,ans,count,cost,tmp;
    long long int S[200010];
    long long int Ssum[200010];
    string T,U,V,ans2;
    bool flag;
    count=0;
    ans=std::pow(10,18);
    flag=false;
    while (true){
        cin >> N >>x;
        if (N==0 && x==0){
            return 0;
        }
        count=0;
        for (i=1;i<=N-2;i++){
            for (j=i+1;j<=N-1;j++){
                for (k=j+1;k<=N;k++){
                    if (i+j+k == x){
                        count+=1;
                    }
                }
            }
                    
                
        }
        cout << count<<endl;

    }
    
    //cout << ans<<endl;

    return 0;
    
}



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

#define int long long
#define forn(i,a,n) for (int i=a; i<n; i++)

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

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

	string s,t,res;
	cin>>s>>t;
	reverse(s.begin(),s.end());
	reverse(t.begin(),t.end());
	forn(i,0,s.size()-t.size()+1){
		bool re=1;
		string ans=s;
		forn(j,0,t.size()){
			if (s[i+j]==t[j] || s[i+j]=='?'){
				ans[i+j]=t[j];
				continue;
			}
			re=0;
			break;
		}
		if (!re) continue;
		forn(j,0,ans.size())
			ans[j]=(ans[j]=='?'?'a':ans[j]);
		reverse(ans.begin(),ans.end());
		if (res=="" || res>ans)
			res=ans;
	}
	if (res=="")
		res="UNRESTORABLE";
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 3624
x = int(input())
a = 1
true = True
while true:
    if a**5-x < 0:
        b = -1*int((-1*(a**5-x))**(1/5))
    else:
        b = int((a**5-x)**(1/5))
    if a**5 -b**5 == x:
        true = False
        break
    a += 1
    
print(a ,b)

Measured memory_bytes: 9452
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//typedef
//------------------------------------------
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstring;
typedef pair<int, int> pint;
typedef pair<pint, int> ppint;
typedef pair<int, pint> pintp;
typedef unsigned int uint;
typedef long long llint;
typedef unsigned long long int ullint;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const int INF = 100000000;

//clear memory
#define clear(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main() {
	int a, b;
	while(cin >> a >> b)
		cout << a + b << endl;
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll N, i, ans, temp;
int main()
{
    cin >> N;
    i = 2;
    while(i*i<=N)
    {
        temp = i;
        if(N%temp==0)
        {
            while(N%temp==0)
            {
                N /= temp;
                temp = temp*i;
                ans++;
            }
            while(N%i==0)
                N/=i;
        }
        i++;
    }
    if(N>1)
        ans++;
    cout << ans;
}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define INF INT_MAX
#define ll  long long
#define ull unsigned long long
#define rep(i,n) for(ll i=0; i<n; ++i)
#define FOR(i, s, e) for(ll i=s; i<e; ++i)
#define MOD 1000000007
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 main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  double D;
  cin>>N>>D;
  int ans = 0;
  rep(i,N) {
    double x, y;
    cin>>x>>y;
    if( sqrt(x*x+y*y) <= D ) ++ans;
  }
  cout << ans << endl;
}

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

using namespace std;
#define int long long


signed main(){
    string s;
    cin >> s;
    
    string ans;
    for(int i=0;i<s.length();i++){
        if(s[i] != 'B') ans.push_back(s[i]);
        else if(ans.length() > 0) ans.erase(ans.length()-1);
    }
    
    cout << ans << endl;
    
    return 0;
}


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

using ll = long long;
#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 INF 1e9
// const ll INF = 1LL << 60;

int N;
vector<int> A;
int main(){
  cin >> N;
  A.resize(N);
  REP(i, N){
    cin >> A[i];
  }
  vector<int> L(N, -1);
  REP(i, N){
    int ng = -1, ok = N-1;
    while(abs(ng-ok) > 1){
      int mid = (ok+ng) /2;
      if(L[mid] < A[i]){
        ok = mid;
      }
      else{
        ng = mid;
      }
    }
    L[ok] = A[i];
  }
  int ans = 0;
  REP(i, N){
    if(L[i] != -1){
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
using PP = pair<int,pair<int,int>>;
using T = tuple<string,int,int>;
const ll INF = 1LL<<60;
 
int main(){
  ull a; cin >> a;
  double b; cin >> b;
  ull bb = b*100+0.5;
  ull ans = a*bb;
  ans /= 100;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3704