akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define intarr(arr, n)  ll arr[n];  for (ll i = 0; i < n; i++)  cin >> arr[i]
#define inpvec(vec,n) for(ll i=0;i<n;i++){ll var;cin>>var;vec.push_back(var);}
#define ff first
#define ss second
#define pb push_back
#define mkp make_pair
#define vec vector<ll>
#define pi pair<ll,ll>
#define changeline cout<<endl
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define rev(i,a,b) for(ll i=a;i>=b;i--)
#define all(v) v.begin(),v.end()
#define mod2 998244353
#define NO cout << "NO" <<endl
#define YES cout << "YES" <<endl
#define mem(arr,val) memset(arr,val,sizeof(arr));
const ll mod=1e9+7;
#define piii 3.14159265358979323846264338327950
#define print(a, n, m)     for (ll i = n; i < m; i++) {  cout << a[i] << " "; }  cout << endl
#define con continue

bool prime(ll n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (ll i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
bool subsequence_checker(string str1, string str2, ll m, ll n) 
{ 
    if (m == 0) return true; 
    if (n == 0) return false; 
    if (str1[m-1] == str2[n-1]) 
        return subsequence_checker(str1, str2, m-1, n-1); 
    return subsequence_checker(str1, str2, m, n-1); 
}
bool cmp(const pair<int,int> &a,  const pair<int,int> &b) 
{ 
    if(a.ff == b.ff)
        return a.ss>b.ss;
    return (a.ff < b.ff); 
} 

//////////////////////////////////////////////////// Lets Do It ////////////////////////////////////////////////////////

void solve(){

    ll n ;
    cin>>n;

    ll r =  n%1000;

    if(r==0)
    {
        cout<<0; return;
    }

    cout<< 1000-r;

    return;
}
 
 
int main()
{
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
    IOS;
    ll t;
    //cin>>t;
    t=1;

    while(t--){
        solve();
       // cout<<endl;
    }

    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
} 

Measured memory_bytes: 3676
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int i,n,suu[10],ba,p;
	char s[101];
	while(1)	{
		scanf(" %d",&n);
		if(n==0)	break;
		scanf("%s",s);
		ba=0;
		for(i=0;i<n;i++)	suu[i]=0;
		p=0;
		for(i=0;i<100;i++)	{
			if(s[i]=='S')	{
				ba+=suu[p]+1;
				suu[p]=0;
			}
			else if(s[i]=='L')	{
				suu[p]+=ba+1;
				ba=0;
			}
			else {
				suu[p]++;
			}
			p++;
			if(p>=n)	p=0;
		}
		sort(suu,suu+n);
		
		
		for(i=0;i<n;i++)	{
			printf("%d ",suu[i]);
		}
		printf("%d\n",ba);
	}
	return 0;
}


Measured memory_bytes: 1048
#include <cstdio>
#include <iostream> 
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
 
using namespace std;
using ll = long long;
 
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };


int main()
{
    int n, a, x = 0, y = 0, z = 0, i;

    cin >> n;
    for(i = 0; i < n; i++){
        cin >> a;
        if(a % 4 == 0)x++;
        else if(a % 2 == 0)y++;
        else z++;
    }

    if(x + 1 >= z + y % 2)cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		ArrayList<Integer> inputNumList = new ArrayList<Integer>();
    	Scanner scan = new Scanner(System.in);

    	float sum = 0;
    	int count = scan.nextInt();

    	for(int i=0; i<count; i++) {

        	inputNumList.add(scan.nextInt());
        	sum = sum + (float)(1.0/inputNumList.get(i));

    	}

    	scan.close();
     	System.out.println(1.0/sum);

	}

}

Measured memory_bytes: 23764
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main()
{
	int n;
	cin >> n;
	for (int i = 1;; i++) {
		if (i * 1000 >= n) {
			cout << 1000 * i - n << endl;
			break;
		}
	}
	return 0;
}



Measured memory_bytes: 3628
#16D8101012J 伊藤惇 dj Python3
import math

def Prime_Numbers_Check(x):
    i=2
    flag=True
    while i <= math.sqrt(x):
        if x%i==0:
            flag=False  
            break
        i+=1
    return flag
def Prime_Numbers_Count(A):
    sum=0
    for i in A:
        if Prime_Numbers_Check(i):
            sum+=1
    return sum

if __name__ == "__main__":
    A=[]
    n=int(input())
    for i in range(n):
        A.append(int(input()))
    sum=Prime_Numbers_Count(A)
    print(sum)



Measured memory_bytes: 6008
#include<cstdio>
#include<string>
#include<iostream>
using namespace std;

int main() {
	string s;
	cin >> s;
	if (s[2] == s[3] && s[4] == s[5]) {
		printf("Yes");
	}
	else {
		printf("No");
	}
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <string>
#include <utility>

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

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

  int q;
  std::cin >> q;

  std::string t;

  rep(qi, q) {
    int u;
    std::cin >> u;
    if (u == 1) {
      swap(s, t);
    } else {
      int f;
      char c;
      std::cin >> f >> c;
      if (f == 1) {
        t += c;
      } else {
        s += c;
      }
    }
  }

  reverse(t.begin(), t.end());
  t += s;

  std::cout << t << '\n';
  return 0;
}


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

namespace AtTest.AGC_Challenge
{
    class _004_B
    {
        static void Main(string[] args)
        {
            Method(args);
            Console.ReadLine();
        }

        static void Method(string[] args)
        {
            int[] nx = ReadInts();
            int n = nx[0];
            long x = nx[1];
            int[] array = ReadInts();
            Array.Reverse(array);
            long resTime = long.MaxValue;
            var times = new long[n];
            for (int i = 0; i < n; i++)
            {
                long time = 0;
                for(int j = 0; j < n; j++)
                {
                    if (i == 0) times[j] = array[j];
                    else times[j] = Math.Min(times[j], array[(j + i) % n]);
                    time += times[j];
                }
                resTime = Math.Min(resTime, time + x * i);
            }
            Console.WriteLine(resTime);
        }

        private static string Read() { return Console.ReadLine(); }
        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: 13192
#include <bits/stdc++.h>
using namespace std;

int main(void){
  int r, D, x2000;
  cin >> r >> D >> x2000;
  int i = 0;
  while( i < 10){
    int j = r * x2000 - D;   
   cout << j << endl;
   x2000 = j; 
   i ++;
  }
   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 ll = long long;
const int MX = 100005;
int n, m, a, b, dep[MX];
ll cnt[2];
bool f;
queue<int> qu;
vector<int> G[MX];
int main(){
	scanf("%d%d", &n, &m);
	rep(i,m){
		scanf("%d%d", &a, &b);a--; b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	qu.push(0); cnt[0] = 1;
	fill(dep+1, dep+n, -1);
	while(!qu.empty()){
		int t = qu.front(); qu.pop();
		for(int nx: G[t]){
			if(dep[nx] == -1){
				dep[nx] = !dep[t];
				cnt[dep[nx]]++;
				qu.push(nx);
			}else if(dep[nx] == dep[t]) f = true;
		}
	}
	printf("%lld\n", (f ? (ll)n*(n-1)/2 : cnt[0]*cnt[1]) - m);
}

Measured memory_bytes: 6272
#include <iostream>
#include <string>

int main() {
  int N, Q;
  std::string S;
  int l, r;
  std::cin >> N >> Q >> S;
  int cumulativeAC[100001];
  cumulativeAC[1] = 0;
  int count = 0;
  for (int i = 2; i <= N; ++i) {
    if (S[i - 2] == 'A' && S[i - 1] == 'C') {
      ++count;
    }
    cumulativeAC[i] = count;
  }
  for (int i = 1; i <= Q; ++i) {
    std::cin >> l >> r;
    std::cout << cumulativeAC[r] - cumulativeAC[l] << "\n";
  }
  return 0;
}

Measured memory_bytes: 1408
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<queue>
#include<vector>
typedef long long int ll;
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR_IN(i, a, b) for(int i = (a); i < (b); i++)
#define BETWEEN(x, a, b) ((x) >= (a) && (x) <= (b))
#define BIT(b, i) (((b) >> (i)) & 1)
#define LOG_F 1
#define LOG(...) if(LOG_F) fprintf(stderr, __VA_ARGS__)

using namespace std;

ll pow(int x, int n){
  return n == 0 ? 1 : x * pow(x, n - 1);
}


/*

 */
int n,a[100];

int main(){
  cin>>n;
  REP(i,n){
    cin>>a[i];
  }

  int pre=0;
  int ans=0;
  REP(i,n){
    if(a[i] == pre){
      ans++;
      pre = 0;
    } else {
      pre = a[i];
    }
  }

  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase

/*
cout<<fixed<<setprecision(20);
cin.tie(0);
ios::sync_with_stdio(false);
*/
const llint mod=1000000007;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	llint i,j,n,K,ans=0;cin>>n>>K;
	vector<llint>wa(n+1);
	for(i=1;i<=n;i++){llint x;cin>>x;wa[i]=wa[i-1]+x;}
	for(llint h=39;h>=0;h--){
		ans+=(1LL<<h);
		llint kaz=0;
		for(i=0;i<n;i++){
			for(j=i+1;j<=n;j++){
				if(((wa[j]-wa[i])&ans)==ans){kaz++;}
			}
		}
		if(kaz<K){ans-=(1LL<<h);}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
// vim: shiftwidth=2 expandtab foldmethod=marker

// include {{{
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <cmath>
#include <utility>
#include <cstdlib>
#include <random>
#include <chrono>
// }}}

// debug(...) {{{
#ifdef LOCAL_DEBUG
#include "./debug.h"
#else
#define debug(...)
#define debugn(...)
#define debug_reset()
#endif

#include <cstdio>

template<class T>
std::string bin(int bits, const T& x) {
  char buf[bits + 1];
  buf[bits] = '\0';
  for(int i = 0; i < bits; i++) {
    if((x >> i) & 1) {
      buf[bits - i - 1] = '1';
    } else {
      buf[bits - i - 1] = '0';
    }
  }
  return std::string(buf);
}
std::string bin(int x) {
  if(x < 0) return bin(32, x);
  for(int i = 4; i < 31; i++) {
    int y = 1 << i;
    if(x < y) return bin(i, x);
  }
  return bin(32, x);
}
// }}}

// misc {{{
using namespace std;
template<class T, class U>

using umap = unordered_map<T, U>;
template<class T>
using uset = unordered_set<T>;

typedef long long ll;

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

template<class T>
void sort(T& arr) {
  std::sort(arr.begin(), arr.end());
}
template<class T, class By>
void sort_by(T& arr, By by) {
  std::sort(arr.begin(), arr.end(), [by](auto l, auto r){return  by(l) < by(r); });
}

template<class T>
void reverse(T& arr) {
  std::reverse(arr.begin(), arr.end());
}

class Random {
  public:
  std::uniform_int_distribution<> uniform_int;
  std::mt19937 rnd;
  std::bernoulli_distribution bern_dist;
  int uniform(int l, int r) {
    return uniform_int(rnd, std::uniform_int_distribution<>::param_type(l, r));
  }
  int next(int N) {
    return uniform(0, N - 1);
  }
  int bern(double p) {
    return bern_dist(rnd, std::bernoulli_distribution::param_type(p));
  }
};
// }}}

// main {{{
void solve();
int main() {
  solve();
}
// }}}

void solve() {
  int N, M;
  cin >> N >> M;
  vector<int> A(N);
  rep(i, N) {
    cin >> A[i];
  }

  multiset<int> X;
  rep(i, N) {
    X.insert(A[i]);
  }
  rep(i, M) {
    auto it = X.end();
    it--;
    int a = *it;
    X.erase(it);
    X.insert(a / 2);
  }
  ll ans = 0;
  for(int x: X) ans += x;
  cout << ans << endl;
}


Measured memory_bytes: 5376
#include <stdio.h>
#define N 100

int main () {
	int M[N][N], n, u, k, v, i, j;
	scanf ( "%d", &n );
	
	for ( i = 0; i < n; i++ ) {
		for ( j = 0; j < n; j++ ) {
			M[i][j] = 0;
		}
	}
	
	for ( i = 0; i < n; i++ ) {
		scanf ( "%d %d", &u, &k );
		u--;
		for ( j = 0; j < k; j++ ) {
			scanf ( "%d", &v );
			v--;
			M[u][v] = 1;
		}
	}
	
	for ( i = 0; i < n; i++ ) {
		for ( j = 0; j < n; j++ ) {
			printf ( "%d", M[i][j] );
			if ( j != n - 1 ) printf (" ");
		}
		printf ( "\n" );
	}
	
	return 0;
}


Measured memory_bytes: 2128
import sys
from collections import deque
 
H,W = map(int,input().split())

town = []
visited = [[0 for i in range(W)] for j in range(H)]
 
for i in range(H): 
    c = input().strip()
    w = list(c)
    town.append(w)
            
def bfs(x,y) :
    q = deque()
    q.append([x,y,0])
    max_dist=0
    s=x
    t=y
    while q : #キューが空でない場合
        tx,ty,dist = q.popleft()
        if visited[ty][tx] == 0 :
            visited[ty][tx] = 1
            if town[ty][tx] == '#' :
                pass
            else :
                #周辺4マスを調べる
                for r in range (4):
                    nx = tx + dx[r]
                    ny = ty + dy[r]
                    count=0
                    if 0 <= nx < W and 0 <= ny < H and visited[ny][nx] == 0:
                        q.append([nx,ny,dist+1])
                        count+=1
                    if count==0 and dist>max_dist:
                        max_dist=dist
    return max_dist
                        
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
max_dist=0
for k in range(H):
    for l in range(W):
        max_dist=max(max_dist,bfs(l,k))
        visited = [[0 for i in range(W)] for j in range(H)]
print(max_dist)

Measured memory_bytes: 3316
from collections import Counter
X,M = map(int, input().split())

A = list(map(int, input().split()))
C = Counter(A)
P = [0] * M # mod iの数
Q = [0] * M # mod iの同一数字のペアの数

for k,v in C.items():
  P[k % M] += v
  Q[k % M] += v//2

#print(P)
#print(Q)
ans = 0
for i in range(1,(M+1)//2):
  p1, p2 = P[i], P[M-i]
  q1, q2 = Q[i], Q[M-i]
  if p1 > p2:
    p1,p2 = p2,p1
    q1,q2 = q2,q1
  #print(ans, p1,p2,q1,q2)
  ans += p1
  ans += min((p2-p1)//2, q2)
ans += P[0] // 2
if M%2 == 0:
  ans += P[M//2] // 2
  
print(ans)

Measured memory_bytes: 24128
N, M = map(int, input().split())
X = list(map(int, input().split())) # len(X) = M
X.sort()

if N >= M:
  print(0)
else:
  m = M - N
  diff = []
  for xl, xr in zip(X, X[1:]):
    diff.append(xr - xl)
  
  diff.sort()
  print(sum(diff[:m]))

Measured memory_bytes: 13968
#include <cstdio>
#include <cctype>
#include <utility>
#include <deque>
using namespace std;

#define _gp(l) const auto gcu{getchar##l}; const auto pcu{putchar##l}
#ifdef __linux
_gp(_unlocked);
#else
_gp();
#endif
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template <typename T>
#define _HT template <typename H,typename... T>
_T _DEF(T,in,int c){T n=0;int m=1;while(isspace(c)){c=gcu();}if(c=='-')m=-1,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
_DEF(int,in,){return in<int>(gcu());}
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
_T _SCAN(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_DEF(bool, scan, int &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_SCAN(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=(char)c;}}
#endif
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);} _OUT(const char *s){while(*s)pcu(*s++);} _OUT(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_OUT(string s){for(char c:s)pcu(c);}
#endif
_T _OUT(T n){static char b[20];char *p=b;T m=n<0?pcu('-'),-1:1;
	if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}
_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _OUT(vector<T> v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}
#endif
_HT _OUT(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _OUTL(T&&... t){out(move(t)...);outl();}
struct range{
	int e,b=0,s=1; range(int _b,int _e,int _s):e(_e),b(_b),s(_s){} range(int _b,int _e): e(_e), b(_b){} range(int _e):e(_e){}
	struct it { int v, s; it (int _v, int _s) : v(_v), s(_s) {} operator int()const{return v;} operator int&(){return v;} int operator*()const{return v;}
		it& operator++(){v+=s;return *this;} }; it begin() {return {b, s};} it end() {return {e, s};}};

int main() {
	for (int n {in()}; n; n--) {
		deque<int> l = {gcu()};
		for (int c, i {}; (c = gcu()) != '\n';) {
			int d {c == '-' ? 1 : -1};
			gcu();
			int n {gcu()};
			if (i + d == (int)l.size()) {
				l.push_back(n);
				i++;
			} else if (i + d < 0)
				l.push_front(n);
			else
				i += d;
		}
		for (int i: l)
			out((char)i);
		outl();
	}
}


Measured memory_bytes: 2592
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#include<bitset>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
bool dead[300000]={};
int ans[300000];
vpint waitpush[300000];
priority_queue<pint,vector<pint>,greater<pint> > yoyunum;
int main(){
	int N,x[502];
	int nokori[2][502];
	scan(N);
	rep(i,N){
		scan(x[i]);
		x[i]--;
		ans[x[i]]=i;
		dead[x[i]]=1;
		if(i!=0) yoyunum.push({x[i],i});
		if(i!=N-1) waitpush[x[i]+1].push_back({2*N*N-x[i],i});
	}
	rep(i,N){
		nokori[0][i]=i;
		nokori[1][i]=N-i-1;
	}
	rep(i,N*N){
		//printf("i:%d\n",i+1);
		//if(dead[i]==1) printf("ans:%d\n",ans[i]+1);
		rep(j,waitpush[i].size()){
			yoyunum.push(waitpush[i][j]);
		}
		if(dead[i]==0){
			//printf("yoyusize:%d\n",yoyunum.size());
			if(yoyunum.empty()){
				prin("No");
				return 0;
			}
			int yoyu=yoyunum.top().first;
			int kazu=yoyunum.top().second;
			//printf("yoyu:%d kazu:%d\n",yoyu,kazu+1);
			yoyunum.pop();
			ans[i]=kazu;
			if(i<x[kazu]){
				nokori[0][kazu]--;
				if(nokori[0][kazu]>0) yoyunum.push({yoyu,kazu});
			}
			else{
				nokori[1][kazu]--;
				if(nokori[1][kazu]>0) yoyunum.push({yoyu,kazu});
			}
		}
	}
	int flag=1;
	rep(i,N) if(nokori[0][i]!=0||nokori[1][i]!=0) flag=0;
	if(flag){
		prin("Yes");
		rep(i,N*N){
			printf("%d ",ans[i]+1);
		}
		kaigyo;
	}
	else prin("No");
	return 0;
}


Measured memory_bytes: 9600
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<string>
#include<vector>
#include<stack>
#include<iomanip>
#include<map>
using namespace std;
//def lib
#define rep(i,n) for(int i=0;i<((int)n);i++)
#define drep(i,n) for(int i=((int)n)-1;i>-1;i--)
#define Rep(i,n0,n) for(int i=n0;i<((int)n);i++)
#define dRep(i,n0,n) for(int i=((int)n)-1;i>n0-1;i--)
#define Com(i,j,n) for(int i=0;i<n-1;i++)for(int j=i+1;j<((int)n);j++)
#define W(x) cout<<x<<endl;
#define print(x) cout<<x<<endl;
#define Debug(x) cout<<"#DEBUG "<<x<<endl;
#define INF (1<<29)
#define INF2 (long long)8*(long long)INF*(long long)INF
#define mod 1000000007
//def end
typedef long long ll;
// lib
int min(int x,int y){if(y<x)return y;else return x;}
int max(int x,int y){if(y>x)return y;else return x;}
int fact(int x){int i=1;rep(j,x){i*=(j+1);} return i;}
int mfact(int x){int i=1;rep(j,x){i*=(j+1);} return i%mod;}
int modulo(int x){return x%mod;}
long long fact(long long x){long long i=1;rep(j,x){i*=(j+1);} return i;}
long long mfact(long long x){long long i=1;rep(j,x){i*=(j+1);} return i%mod;}
long long modulo(long long x){return x%mod;}
int gcd(int x, int y){if(x%y==0)return y;else if(y%x==0)return x;else return gcd(x%y,y%x);}
ll gcd(ll x, ll y){if(x%y==0)return y;else if(y%x==0)return x;else return gcd(x%y,y%x);}
void say(bool x){if(x){cout<<"Yes"<<endl;}else {cout<<"No"<<endl;}return;}
//lib end

int main()
{
    int a,b;
    cin>>a>>b;
    say((a*b)%2);
    return 0;
}

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

int main(){
  int N;
  int i,j,k;
  int a,b,c;
  cin >> N;
  int d[2][3];
  cin >> d[0][0] >> d[0][1] >>d[0][2];
  for(i=1;i<N;i++){
    cin >> a >> b >> c;
    j = i % 2;
    k = 1-j;
    d[j][0] = max(d[k][1]+a,d[k][2]+a);
    d[j][1] = max(d[k][0]+b,d[k][2]+b);
    d[j][2] = max(d[k][0]+c,d[k][1]+c);
  }
  i = (N-1) % 2;
  cout << max(d[i][0],max(d[i][1],d[i][2])) << endl;
  
  return 0;
}


Measured memory_bytes: 3624
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    A, B, C, D = LI()

    print(max(A * B, C * D))

if __name__ == '__main__':
    resolve()


Measured memory_bytes: 10040
#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(deprecated)]

use std::cell::{Cell, Ref, RefCell, RefMut};
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;
use std::usize;

const MOD_10_9_7: u64 = 1_000_000_007;
const INF: i64 = 1_000_000_000_000;
const MIN_INF: i64 = -1_000_000_000_000;

/// FYI: https://github.com/vain0x/scan-bench
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
    let (n, m): (usize, usize) = read!(usize, usize);

    if n == 1 {
        println!("{}", m);
        return;
    }

    // a1, a2, ..., aNの公約数をDとすると、SUM(a)もDを約数にもつ。
    // よってMの正の約数のうちMではないものを大きい順から m1, m2, ..., 1として、
    // 順に「Mをm_iで割った余りが0 かつ 商がN以上」であるかどうかを検証していく
    // この条件を満たす最初のm_iが答えである

    let mut d = Vec::new(); // Mの約数リスト
    let root_m = (m as f64).sqrt();
    for i in 1..(root_m.floor() as usize) {
        if m % i == 0 {
            let q = m / i;
            d.push(q);
            d.push(i);
        }
    }
    d.sort();
    d.reverse();

    let d_without_m = &d[1..];

    for &e in d_without_m {
        if m % e == 0 && m / e >= n {
            println!("{}", e);
            return;
        }
    }
}


Measured memory_bytes: 4352
#include <iostream>

using namespace std;

#define MAX 20

int n, m;
int ary_n[MAX] = {0};

int solver( int i, int number ) {
	if ( number == 0 ) {
		return 1;
	} else if ( i >= n ) {
		return 0;
	}
	int ret = solver( i+1, number ) || solver( i+1, number - ary_n[i] );
	return ret;

}

int main() {
	int tmp = 0;
	cin >> n;
	for ( int i = 0 ; i < n ; i++ ) {
		cin >> ary_n[i];
	}

	cin >> m;
	for ( int i = 0 ; i < m ; i++ ) {
		cin >> tmp;
		if ( solver(0, tmp) ) {
			cout << "yes" << endl;
		} else {
			cout << "no" << endl;
		}	
	}
	return 0;
}



Measured memory_bytes: 3100
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
int col[4005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    string ch;
    cin>>ch;
    vector<int>node[26];

    for(int i=0; i<n; i++)
    {
        if(ch[i]=='R')
        {
            col[i]=0;
            node[0].push_back(i);
        }
        else if(ch[i]=='G')
        {
            col[i]=1;
            node[1].push_back(i);
        }
        else{
            node[2].push_back(i);col[i]=2;}
    }
    ll ans=0;
    for(int i=0; i<3; i++)
    {
        for(int j=0; j<3; j++)
        {
            if(j!=i)
            {
                int sz=node[i].size();
                vector<int> tmp;
                int id;
                int a=min(i,j);
                int b=max(i,j);
                if(a==0 && b==1)
                {
                    id=2;
                }
                else if(a==0 && b==2)
                {
                    id=1;
                }
                else
                    id=0;
                for(int l=0; l<sz; l++)
                {
                    int sz1=node[j].size();
                    int val=node[i][l];
                    for(int m=0; m<sz1; m++)
                    {
                        int val1=node[j][m];
                        if(val<val1)
                        {
                            int d=val1-val;
                            ans += (int) (upper_bound(node[id].begin(),node[id].end(),4005)-lower_bound(node[id].begin(),node[id].end(),val1));
                            int newpos=val1+d;
                            if(newpos<n)
                            {
                                if(col[newpos]==id)
                                {
                                    ans--;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3660
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


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;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b) {
  return b ? GCD(b,a%b) : a;
}


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




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

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  while(1){
    ll d,e;
    cin>>d>>e;
    if(d==0 && e==0) return 0;
    double ans=1000000000;
    rep(i,d){
      chmin(ans,(double)(abs(sqrt(i*i+(d-i)*(d-i))-e)));
    }
    cout<<setprecision(10)<<ans<<endl;
  }
}


Measured memory_bytes: 3260
#include<bits/stdc++.h>
using namespace std;
 
#define ff              first
#define fo(i,n)         for(i=0;i<n;i++)
#define Fo(i,k,n)       for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define deb(x)          cout << #x << "=" << x << endl
#define deb2(x, y)      cout << #x << "=" << x << "," << #y << "=" << y << endl
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define w(x)            int x; cin>>x; while(x--)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
 
 
const int N = 3e5, M = N;
//=======================
 
 
void solve() {
	string s;
	cin>>s;
	int n = s.length();
	if(s[n-1]=='s'){
		s=s+"es";
	}else
		s=s+"s";
	cout<<s;
}
 
int32_t main()
{
  FIO;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  solve();
  return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h> 
using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

int main(){
    std::ios::sync_with_stdio(false);
    
    int A, B, C, D; 
    cin>> A >> B >> C >> D;

    int t = min(A,B); int b = min(C,D);
    cout << t+b << endl;
    return 0;
    
}


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

int main() {
    string s;
    int q;
    cin >> s >> q;
    int ans = 0;
    deque<char> s1;
    rep(i,s.size()) s1.push_back(s.at(i));
    rep(i,q) {
        int t;
        cin >> t;
        if(t == 1) ans++;
        if(t == 2) {
            int f;
            char c;
            cin >> f >> c;
            if((ans%2 == 0 && f == 1) || (ans%2 == 1 && f == 2)) {
                s1.push_front(c);
            } else s1.push_back(c);
        }
    }
    if(ans%2 == 0) {
         rep(i,s1.size()){
         cout << s1.at(i);
    }
    cout << endl;
    }
    else {
        rep(i,s1.size()) cout << s1.at(s1.size() - 1 -i);
        cout << endl;
    }
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
int d[10];
int f(int n)
{
	if(n==0)return d[0]==0;
	while(n)
	{
		if(d[n%10])return 0;
		n/=10;
	}
	return 1;
	
}
int main()
{
int n,m,a;
cin>>n>>m;
while(m--){cin>>a;d[a]=1;}
for(;;n++)
if(f(n))return 0 & printf("%d\n",n);
}



Measured memory_bytes: 3748
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	X := getStdinInt()
	if X >= 30 {
		fmt.Printf("Yes\n")
	} else {
		fmt.Printf("No\n")
	}
}

var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)

func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinIntU64() uint64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return uint64(rtn)
}
func getStdinInt64_2() (int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1]
}
func getStdinInt64_3() (int64, int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}
func getStdinIntArrU64() []uint64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]uint64, len(list))
	for idx, val := range list {
		r, _ := strconv.ParseInt(val, 10, 64)
		rtn[idx] = uint64(r)
	}
	return rtn
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func min64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}
func max64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}
func abs(n int) int {
	if n < 0 {
		return -n
	}
	return n
}
func abs64(n int64) int64 {
	if n < 0 {
		return -n
	}
	return n
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}


Measured memory_bytes: 2180
from math import sqrt
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
result=0
nums=[x for x in range(n)]
for i in nums:
  for j in nums:
    if(i!=j):
      result += sqrt((l[i][0] - l[j][0]) * (l[i][0] - l[j][0]) + (l[i][1] - l[j][1]) * (l[i][1] - l[j][1]))
print(result/n)
      

Measured memory_bytes: 3064
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()
            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

s = arr_data[0][0]

cnt=0
posi=0
    
while s.find("BW",posi)>=0 or s.find("WB",posi)>=0:

    if s.find("BW",posi)>=0 and s.find("WB",posi)>=0 :
        
        posi=min(s.find("BW",posi),s.find("WB",posi))+1
    
    elif s.find("BW",posi)>=0 and s.find("WB",posi)==-1 :
        
        posi=s.find("BW",posi)+1
        
    elif s.find("BW",posi)==-1 and s.find("WB",posi)>=0 :
        posi=s.find("WB",posi)+1
        
    cnt+=1
        
print(cnt)
        


Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pi M_PI
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  int n,m;
  cin >> n >> m;
  int c[m];mem(c);
  map<int,int> ma[m];
  rep(i,n) {
    int x;
    R x;
    ma[x%m][x]++;
  }
  priority_queue<P> que[m];
  rep(i,m) {
    que[i].push(P(0,0));
    que[i].push(P(0,0));
    tr(it,ma[i]) que[i].push(P(it->S%2,it->S));
  }
  int ans=0;
  rep(i,m/2+1) {
    int j=(m-i)%m;
    while(1) {
      P p=que[i].top();que[i].pop();
      P q=que[j].top();que[j].pop();
      int x=min(p.S,q.S);
      if(!x||!p.F&&!q.F) {
        que[i].push(P(p.S%2,p.S));
        que[j].push(P(q.S%2,q.S));
        break;
      }
      ans++;
      p.S--;
      q.S--;
      que[i].push(P(p.S%2,p.S));
      que[j].push(P(q.S%2,q.S));
    }
  }
  rep(i,m) {
    while(!que[i].empty()) {
      P p=que[i].top();que[i].pop();
      ans+=p.S/2;
    }
  }
  pr(ans);
}

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


Measured memory_bytes: 17792
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#define rep(i,n) for(int i = 0; i < (n); i++)
using ll = unsigned long long;
using P = std::pair<int, int>;
namespace mp = boost::multiprecision; 

int main() {
  mp::cpp_int a, b, c;
  std::cin >> a >> b >> c;
  if(c-a-b<0) std::cout << "No" << std::endl;
  else {
    mp::cpp_int d = (c-a-b)*(c-a-b);
    mp::cpp_int e = 4*a*b;
    if(d > e) std::cout << "Yes" << std::endl;
    else std::cout << "No" << std::endl;
  }
  return 0;
}

Measured memory_bytes: 256
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)

getInts :: IO [Int]
getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine

solve::[Int]->Int
solve an | all even an = 1 + (solve $ map (`div` 2) an)
         | otherwise = 0
main = do
  getLine
  an <- getInts
  print $ solve an

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

int main() {

	int k;
	cin >> k;
	vector<int> a(32);
	a = { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };

	cout << a.at(k-1);

	
	
	}


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

int main(){
    int N;
    cin >> N;
    vector<int> p(N);
    for(int i = 0; i < N; i++){
        cin >> p.at(i);
    }
    int count = 0;
    for(int i = 0; i < N; i++){
        if(p.at(i) != i+1) count ++;
    }

    if(count >2) cout << "NO" <<endl;
    else cout << "YES" <<endl; 
}

Measured memory_bytes: 256
n = int(input())
alst = list(map(int, input().split()))
raised = [False] * n
count = 0
ans = 0
pre_height = 10 ** 10
sorted_alst = sorted(zip(alst, range(n)))

while sorted_alst:
    height, number = sorted_alst.pop()
    if height != pre_height:
        ans = max(ans, count)
    if height <= 0:
        break

    count += 1
    raised[number] = True
    
    if number > 0 and raised[number - 1]:
        count -= 1
    if number < n - 1 and raised[number + 1]:
        count -= 1
    
    pre_height = height

ans = max(ans, count)
print(ans)



Measured memory_bytes: 21072
#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(int i=s;i<t;i++)
#define pii pair<int,int>
int num[222222];pii q[2][222222];
int top[2],front[2];
int main()
{
    int n,k;scanf("%d%d",&n,&k);
    rep(i,1,n+1)scanf("%d",&num[i]);
    int flag=0;
    rep(i,1,k)
    {
        while(top[0]&&q[0][top[0]-1].first<num[i])top[0]--;
        while(top[1]&&q[1][top[1]-1].first>num[i])top[1]--;
        q[0][top[0]++]={num[i],i};
        q[1][top[1]++]={num[i],i};
    }
    int res=0;
    rep(i,k,n+1)
    {
        int x=2;
        if(i!=k&&q[1][front[1]].second==i-k)x--;
        while(top[0]!=front[0]&&q[0][front[0]].second<=i-k)front[0]++;
        while(top[1]!=front[1]&&q[1][front[1]].second<=i-k)front[1]++;
        while(top[0]!=front[0]&&q[0][top[0]-1].first<num[i])top[0]--;
        while(top[1]!=front[1]&&q[1][top[1]-1].first>num[i])top[1]--;
        q[0][top[0]++]={num[i],i};
        q[1][top[1]++]={num[i],i};
        if(i!=k&&q[0][front[0]].second==i)x--;
        if(top[1]-front[1]==k)flag=1;
        else if(x)res++;
    }
    res+=flag;
    printf("%d\n",res);
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	vll a(5), b;
	ll ans=0;
	rep(i, 5){
		cin>>a[i];
		ans+=a[i];
		b.pb((a[i]%10==0)?0:10-a[i]%10);
	}
	sort(all(b));
	rep(i, 4){
		ans+=b[i];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;

int main() {
    int N, K;
    cin >> N >> K;

    vec<ll> x(N), y(N),xs(N),ys(N);
    rep(i, N) cin >> x[i] >> y[i];
    xs = x;
    ys = y;
    sort(all(xs));
    sort(all(ys));

    ll ans = (1LL << 62);
    rep(i, N - 1) for (int j = i + 1; j < N; ++j)
        rep(k, N - 1) for (int l = k + 1; l < N; ++l) {
        ll xmin = xs[i], xmax = xs[j], ymin = ys[k], ymax = ys[l];
        
        int cnt = 0;
        rep(p,N){
            if(xmin <= x[p] && x[p] <= xmax && ymin <= y[p] && y[p] <= ymax) ++cnt;
        }
        if(cnt >= K) ans = min(ans,1LL*(xmax-xmin)*(ymax-ymin));
    }

    cout << ans << endl;
}


Measured memory_bytes: 3584
class itp1_2c:
    def sort(self,f,s,t):
        if(f>s):
            tmp=f
            f=s
            s=tmp
        if(s>t):
            tmp=s
            s=t
            t=tmp
        if(f>s):
            tmp=f
            f=s
            s=tmp
        print(str(f)+" "+str(s)+" "+str(t))     
if __name__=="__main__":
    num=map(int,raw_input().split(" "))
    run=itp1_2c()
    run.sort(num[0],num[1],num[2])

Measured memory_bytes: 4228
#include<stdio.h>

int main()
{
	int n,x;
	scanf("%d%d",&n,&x);
	int i,a[n],s,sum;
	scanf("%d",&a[0]);
	sum=s=a[0];
	for(i=1;i<n;i++)
	{
		scanf("%d",&a[i]);
		s=s<a[i]?s:a[i];
		sum+=a[i];
	}
	printf("%d\n",n+(x-sum)/s);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

void ABC169F()
{
	const ll MOD = 998244353;
	int N, S;
	cin >> N >> S;
	vi A(N+1);
	for (int i = 1; i <= N; ++i)
		cin >> A[i];

	vvl dp(N+1, vl(3001));
	dp[0][0] = 0;
	ll z = 1;
	for (int i = 1; i <= N; ++i)
	{
		for (int j = 0; j <= 3000; ++j)
		{
			dp[i][j] = dp[i - 1][j] * 2;
			dp[i][j] %= MOD;
		}
		for(int j = 0; j <= 3000-A[i]; ++j)
		{
			dp[i][j + A[i]] += dp[i - 1][j];
			dp[i][j + A[i]] %= MOD;
		}
		dp[i][A[i]] += z;
		dp[i][A[i]] %= MOD;
		z *= 2;
		z %= MOD;
	}
	cout << dp[N][S] << endl;
}

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


Measured memory_bytes: 73696
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int n,m,R;
    cin>>n>>m>>R;
    vector<int> r(R);
    rep(i,R){
        cin>>r[i];
        r[i]--;
    }
    sort(begin(r),end(r));
    vector<vector<int>> dp(n,vector<int>(n,INF));
    rep(i,m){
        int a,b,c;
        cin>>a>>b>>c;
        a--,b--;
        dp[a][b]=c;
        dp[b][a]=c;
    }
    rep(i,n) dp[i][i]=0;
    rep(k,n)rep(i,n)rep(j,n) chmin(dp[i][j],dp[i][k]+dp[k][j]);
    int ans=INF;
    do{
        int now=0;
        rep(i,R-1){
            now+=dp[r[i]][r[i+1]];
        }
        chmin(ans,now);
    }while(next_permutation(begin(r),end(r)));
    cout<<ans<<endl;
}

Measured memory_bytes: 384