akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
using namespace std;
long long int gcd(long long int a, long long int b);
long long int lcm(long long int a, long long int b); 
long long int baikan(long long int a, long long int b, long long int c);
void margesort(int a[], int a_len, int left, int right);
int A[200000], B[200000];
int temp[200000];
int temp2[200000];
int main() {

	//D

	int i, n;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> A[i] >> B[i];
	}
	margesort(B, n, 0, n - 1);
	//cout << "Sort" << endl;
	//for (i = 0; i < n; i++) {
	//	cout << A[i] << ' ' << B[i]<< endl;
	//}

	long long int sum = 0;
	for (i = 0; i < n; i++) {
		sum = sum + A[i];
		//cout << sum << ' ' << A[i] << ' ' << B[i] << endl;
		if (sum > B[i]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
	//C
	/*long long int a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << b - a + 1 - baikan(a, b, c) -  baikan(a, b, d) + baikan(a, b, lcm(c, d)) << endl;
	return 0;*/

	//B
	/*int n, l;
	cin >> n >> l;
	int k = n * l + n * (n - 1) / 2;
	//cout << k;
	int i;
	int min = l;
	for (i = 0; i < n; i++) {
		if (abs(l + i) < abs(min)) {
			min =  l + i;
		}
	}
	cout << k - min << endl;
	return 0;
	*/

	//A
	/*
	string s;
	cin >> s;
	for (int i = 0; i < 3; i++) {
		if (s[i] == s[i + 1]) {
			cout << "Bad" << endl;
			return 0;
		}
	}
	cout << "Good" << endl;
	return 0;
	*/
}

long long int gcd(long long int a, long long int b) {
	if (a == 0) {
		return b;
	}
	else if (b == 0) {
		return a;
	}
	else {
		return gcd(b, a % b);
	}
}
long long int lcm(long long int a, long long int b) {
	return a * b / gcd(a, b);
}
long long int baikan(long long int a, long long int b, long long int c) {
	long long int d = b - a + 1;
	if (((b - (d % c)) % c) <= (b % c)) {
		return (d - (d % c)) / c;
	}
	else {
		return (d - (d % c)) / c + 1;
	}
}
void margesort(int a[], int a_len, int left, int right)
{
	int i, j, mid, L, R;

	if (right <= left)
		return;

	mid = (left + right) / 2;
	margesort(a, mid, left, mid);
	margesort(a, a_len - mid, mid + 1, right);

	for (i = left; i <= mid; i++)
	{
		temp[i] = a[i];
		temp2[i] = A[i];
	}
	for (i = mid + 1, j = right; i <= right; i++, j--)
	{
		temp[i] = a[j];
		temp2[i] = A[j];
	}

	L = left;
	R = right;

	for (i = left; i <= right; i++)
	{
		if (temp[L] <= temp[R])
		{
			a[i] = temp[L];
			A[i] = temp2[L];
			L++;
		}
		else
		{
			a[i] = temp[R];
			A[i] = temp2[R];
			R--;
		}
	}
}

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

// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>

ll h[1005][1005],v[1005][1005];

ll fep(ll x, ll y, ll mod)
{ll res=1;while(y>0){if(y&1)res=(res*x)%mod;
    y=y>>1;x=(x*x)%mod;}return res%mod;}

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

	ll n,i,m,j,k,x,y,a,b,mod=1000000007;
	string s[1005];
	
	cin >> n >> m;
	for(i=0;i<=m;i++)
		s[0].pb('#');
	for(i=1;i<=n;i++)
	{
		cin >> s[i];
		s[i]='#'+s[i];
	}
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=m;j++)
		{
//			cout << s[i][j];
			if(s[i][j]=='#')
				h[i][j]=0;
			else
			{
				if(s[i-1][j]=='.' && s[i][j-1]=='.')
					h[i][j]=(h[i-1][j]+h[i][j-1])%mod;
				else if(s[i-1][j]=='.')
					h[i][j]=h[i-1][j];
				else
					h[i][j]=h[i][j-1];
			}
			if(i==1 && j==1 && s[i][j]=='.')
				h[i][j]=1;
//			cout << h[i][j] << " ";
		}
//		cout << endl;
	}
	cout << h[n][m];

	return 0;
}


Measured memory_bytes: 10880
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 300010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

int A, B;

void solve() {
	cin >> A >> B;
	debug(A, B);
	vector<int> vec;
	debug(vec);
	if(A > B) swap(A, B);
	if(A == B) cout << A + B << "\n";
	else cout << 2 * B - 1 << "\n";
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cout.precision(6);
	srand((unsigned int)time(NULL));
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}


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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }



int n, a[22], b[22], c[22];
void solve(){
	cin >> n;
	for(int i = 0; i < n; i++) cin >> a[i];
	for(int i = 0; i < n; i++) cin >> b[i];
	for(int i = 0; i < n-1; i++) cin >> c[i];
	
	int cnt = 0;
	for(int i = 0; i < n; i++){
		cnt += b[a[i]-1];
		if(a[i]+1 == a[i+1]) cnt += c[a[i]-1];
	}
	cout << cnt << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <map>
#include <unordered_map>
#include <string.h>
#include<iomanip>
#include <iterator>
#include <locale>

#define all(a) a.begin(),a.end()
#define VV(T) vector<vector< T > >
#define rep(i,N) for(int i = 0; i <N; i++)
#define repsg(i,s,g) for(int i = s; i <g; i++)
#define name(x) #x
using namespace std;


const int INF = 10000000;
const long long INFL = (1LL<<40);
const int MOD = pow(10,9)+7;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

typedef long long ll,LL;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
typedef pair<int,int> pii;
typedef pair<LL, LL> pLL;


// vector入力
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x: vec) is >> x;
    return is;
}
// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
    for(int i=0; i<vec.size(); i++){
        os << vec[i] << ( i+1 == vec.size() ? "" : " " );
    }
    return os;
}

template< typename T >
struct edge{
    int src, to;T cost;
    edge(int to,T cost) :src(-1),to(to),cost(cost){}
    edge(int src, int to, T cost) :src(src),to(to),cost(cost){}edge
    &operator=(const int &x){
        to =x;
        return *this;
    }
    operator int() const{ return to;}
};



int main() {
    int h,w;cin>>h>>w;
    vector<string> s(h);cin>>s;
    string white(w,'.');
    
    vector<string> s2;
    rep(i,h){
        if(s[i]==white)continue;
        s2.push_back(s[i]);
    }
    h = (int)s2.size();
    
    vector<string> s3(w);
    
    rep(i,h){
        rep(j,w){
            s3[j].push_back(s2[i][j]);
        }
    }
    
    string white2(h,'.');
    vector<string> s4;
    rep(i,w){
        if(white2 == s3[i]) continue;
        s4.push_back(s3[i]);
    }
    
    w = (int)s4.size();
    
    
    vector<string> s5(h);
    
    rep(i,h){
        rep(j,w){
            s5[i].push_back(s4[j][i]);
        }
        cout<<s5[i]<<endl;
    }
    
    
    
    
    

    
    return 0;
}





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

X = sorted([a-b for a, b in zip(A,B)])
Y = [x for x in X if x<0]
ans = len(Y)
Z = sum(Y)

for x in reversed(X):
    if Z>=0: break
    ans += 1
    Z += x

print(ans if Z>=0 else -1)

Measured memory_bytes: 18356
#include<stdio.h>
int main(){

 int a,b;

	scanf("%d",&a);
	scanf("%d",&b);

	if(a < b){
		printf("a < b\n");
	}
	else if(a > b){
		printf("a > b\n");
	}
	else{
		printf("a == b\n");
	}


return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef vector<long> vec;
int main(){
  long h,n,sum,a; cin>>h>>n;
  sum=0;
  rep(i,n) cin>>a,sum+=a;
  cout<<(sum>=h?"Yes":"No");
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main (String[] args) throws IOException
	{
		BufferedReader input = new BufferedReader (new InputStreamReader (System.in));

		Dice dice = new Dice();

		dice.setDice(input.readLine().split(" "));

		dice.Move(input.readLine().toCharArray());

		System.out.println(dice.dice[0]);
	}
}


class Dice{

	public String[] dice;

	private char[] move;

	private String[] over;

	public void setDice (String[] diceStr)
	{
		dice = new String[diceStr.length];

		for(int num = 0; num < diceStr.length; num++)
			dice[num] = diceStr[num];
	}

	public void Move (char[] compass)
	{
		move = compass;

		//move.length回、転がす
		for(int kai = 0; kai < move.length; kai++)
		{
			over = new String[6];

			//東に転がす場合
			if(move[kai] == 'E')
			{
				over[0] = dice[3];
				over[1] = dice[1];
				over[2] = dice[0];
				over[3] = dice[5];
				over[4] = dice[4];
				over[5] = dice[2];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}

			//西に転がす場合
			else if(move[kai] == 'W')
			{
				over[0] = dice[2];
				over[1] = dice[1];
				over[2] = dice[5];
				over[3] = dice[0];
				over[4] = dice[4];
				over[5] = dice[3];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}

			//南に転がす場合
			else if(move[kai] == 'S')
			{
				over[0] = dice[4];
				over[1] = dice[0];
				over[2] = dice[2];
				over[3] = dice[3];
				over[4] = dice[5];
				over[5] = dice[1];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}

			//北に転がす場合
			else if(move[kai] == 'N')
			{
				over[0] = dice[1];
				over[1] = dice[5];
				over[2] = dice[2];
				over[3] = dice[3];
				over[4] = dice[0];
				over[5] = dice[4];

				for(int num = 0; num < over.length; num++)
					dice[num] = over[num];
			}
		}
	}
	
	
}




Measured memory_bytes: 24180
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [$t:tt]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}


#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    ($arg:expr) => (println!("{:?}",$arg));
}


#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}


use std::cmp;
use std::collections::HashMap;





fn main() {

    input! { 
       s: String,
    }

    let mut ans = "";
    if(s == "Sunny"){
        ans = "Cloudy"
    }
    else if(s == "Cloudy"){
        ans = "Rainy"
    }
    else if(s == "Rainy"){
        ans = "Sunny"
    }
    
    
    println!("{}",ans);


}


Measured memory_bytes: 4352
# B
inputs = []
5.times { inputs << gets.to_i }
puts inputs.reduce(0) { |mem, e| e % 10 == 0 ? mem + e : mem + e + (10 - e % 10) } - inputs.map { |e| e % 10 == 0 ? 0 : 10 - e % 10 }.max



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

#define PI 3.14159265

int main(void){
	double a,b,c,d;
	double r = 6378.1;
	double x1,x2,y1,y2,z1,z2;
	double theta1,theta2,phi1,phi2,dist;

	while(scanf("%lf %lf %lf %lf",&a,&b,&c,&d) && a!=-1){
		theta1 = PI * a / 180;
		theta2 = PI * c / 180;
		phi1 = PI * b / 180;
		phi2 = PI * d / 180;

		x1 = r * cos(theta1) * cos(phi1);
		x2 = r * cos(theta2) * cos(phi2);
		y1 = r * cos(theta1) * sin(phi1);
		y2 = r * cos(theta2) * sin(phi2);
		z1 = r * sin(theta1);
		z2 = r * sin(theta2);

		dist = sqrt( pow(x2-x1,2) + pow(y2-y1,2) + pow(z2-z1,2) );

		printf("%.0lf\n",r*acos(1 - dist*dist/(2*r*r)));
	}

	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<stack>
#include<set>
#include<map>
#include<utility>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

#define MOD 1000000007;

int main(){
	int n,p,sum=0,max=0;
	cin >> n;
	for(int i=0; i<n;i++){
		cin >> p;
		sum+=p;
		if(p>max)
			max=p;
	}
	sum = sum-max+max/2;
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>
#include <numeric>
#include <set>

using namespace std;
struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v){o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
#define debug(v) {cerr<<"\033[1;36m[debug]\033[m "<<#v<<" : "<<v<<endl;}

using int64 = long long;
using tu = tuple<int64,int64,int64>;
using P = pair<int64, int64>;

int main() {
    int64 n,k;
    cin >> n >> k;
    vector<int64> a(n);
    for (int64 i=0; i<n; i++) cin >> a[i];

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

    auto c = [&](int64 num) {
        int64 cnt = 0;

        for (int64 i=0; i<n; i++) {
            int64 l = -1;
            int64 r = n;

            while(l+1 < r) {
                int64 m = (l+r) / 2;
                if (a[i]*a[m] <= num) {
                    (a[i] < 0? r : l) = m;
                } else {
                    (a[i] < 0? l : r) = m;
                }
            }

//            cout << num << " " << i << " " << a[i] << " " << l << " " << r << endl;
            if (a[i] < 0) cnt += n - r;
            else cnt += l + 1;

            if (a[i] * a[i] <= num) cnt--;
        }
        return cnt;
    };

    int64 l = LONG_MIN / 2;
    int64 r = LONG_MAX / 2;
    while(l+1 < r) {
        int64 m = (l+r) / 2;
        if (c(m)/2 < k) l = m;
        else r = m;
    }
    cout << r << endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9+7;
#define REP(i,j,n) for(int i=j;i<n;i++)
#define rep(i,n) REP(i,0,n)


// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;cin>>n;
    ll ary[n];
    rep(i,n) cin >> ary[i];
    ll ans=0;
    ll nx = ary[0];
    rep(i,n)
    {
        ans += max((ll)(0), nx-ary[i]);
        nx = max(nx, ary[i]);
    }
    cout << ans << endl;

}


Measured memory_bytes: 5212
#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
typedef pair<ll,ll> prl;
typedef vector<ll> vcl;
typedef map<ll,ll> mapl;
typedef unordered_map<ll,ll> umap;
#define pb push_back
#define all(v) v.begin(), v.end()
#define rep(i,a,b) for(ll i=a;i<=b;i++)
#define repi(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(ll i=a;i>=b;i--)
#define reps(i,v) for(ll i=0;i<v.size();i++)
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
const ll mod = 1e9+7;

int main() {
    // your code goes here
    ll n,l[500];
    cin >> n;
    rep(i,1,n){
    	cin >> l[i];
    }
    ll ans=0;
    rep(i,1,n){
    	rep(j,i+1,n){
    		rep(k,j+1,n){
    			if(l[i]==l[j]||l[j]==l[k]||l[k]==l[i]) continue;
    			if(l[i]+l[j]>l[k]&&l[j]+l[k]>l[i]&&l[k]+l[i]>l[j]) ans++;
    		}
    	}
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    ll ans = 0LL;
    cin >> n;
    vector<int> a(n);
    for (int &i : a)
    {
        cin >> i;
        ans += i;
    }
    int q;
    cin >> q;
    while (q--)
    {
        int i, v;
        cin >> i >> v;
        cout << ans - (a[i - 1] - v) << "\n";
    }
}

Measured memory_bytes: 256
/*********************************************************************************\
*  _________  _      _  ________  _       _       __       ________               *
* |___   ___|| |    | ||  ______|| |     | |     /  \     |  ____  |              *
*     | |    | |    | || |______ | |_____| |    / /\ \    | |____| |              *
*     | |    | |    | ||______  ||  _____  |   / /__\ \   |  __  __|              *
*     | |    | |____| | ______| || |     | |  / ______ \  | |  \ \                *
*     |_|    |________||________||_|     |_| /_/      \_\ |_|   \_\               *
*  ________       __      ________  _    __       __       ________               *
* |  ______|     /  \    |  ____  || |  / /      /  \     |  ____  |              *
* | |______     / /\ \   | |____| || |_/ /      / /\ \    | |____| |              *
* |______  |   / /__\ \  |  __  __||  __ \     / /__\ \   |  __  __|              *
*  ______| |  / ______ \ | |  \ \  | |  \ \   / ______ \  | |  \ \                *
* |________| /_/      \_\|_|   \_\ |_|   \_\ /_/      \_\ |_|   \_\               *
*                                                                                 *
*                                                                                 *
*   Department of Computer Science & Engineering                                  *
*   Student ID : 18CSE035                                                         *
*   Bangabnadhu Sheikh Mujibur Rahman Science & Technology University,Gopalgonj.  *
*                                                                                 *
\*********************************************************************************/

//Now Write to Code ___________________________


#include<bits/stdc++.h>
using namespace std;

const int N = (int) 1e5 + 5;



int main() {

    string str;
    int i,x,cnt=0;

    cin >> str;
    x = str.size();

    if(x%2 != 0)
    {
    	cout << "No" << endl;
    }
    else
    {
        for(i = 0; i < x-1; i++)
        {
    	    if(str[i] == 'h' && str[i+1] == 'i') 
    	    {
    	   	    i++;
    	   	    continue;
    	    }
    	    else
    	    {
    		    cnt++;
    		    break;
    	    }
        }

        if(cnt == 0) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int main() {
    string S; cin >> S;
    bool ok = true;

    if (S[0] != 'A')
        ok = false;

    int cnt = 0;
    for (int i = 1; i < S.size(); i++) {
        if (isupper(S[i])) {
            if (i == 1 || i == S.size() - 1 || S[i] != 'C')
                ok = false;
            cnt++;
        }
    }

    if (cnt != 1)
        ok = false;

    if (ok)
        cout << "AC" << endl;
    else
        cout << "WA" << endl;

}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <limits>
#include <iterator>
#include <cmath>
#include <numeric>
#include <stack>
#include <queue>
#include <cassert>
#include <forward_list>
#include <chrono>
#include <deque>
#include <list>
#include <random>
#include <cstdio>
#include <sstream>

using namespace std;

//最大公約数
template<class T>
T GCD(T m, T n)
{
	T temp;
	while (m % n != 0)
	{
		temp = n;
		n = m % n;
		m = temp;
	}
	return n;
}

//最小公倍数
template<class T>
T LCM(T m, T n)
{
	return m * n / GCD(m, n);
}

int main()
{
	long long int a, b, c, d;
	cin >> a >> b >> c >> d;
	long long int e = LCM(c, d);
	
	long long int all = b - b / c - b / d + b / e;
	long long int parts = (a-1) - (a-1) / c - (a-1) / d + (a-1) / e;

	cout << all - parts << endl;
	return 0;
}

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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll x, a;
  cin >> x >> a;

  cout << (x < a ? 0 : 10) << "\n";
}

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
)

var sc = bufio.NewScanner(os.Stdin)

const inf = 1 << 60
const mod int = 1e9 + 7

type pqe struct {
	v interface{}
	p int
}
type Pq []pqe

func ri() (n int) {
	sc.Scan()
	for _, v := range sc.Bytes() {
		n = n*10 + int(v-48)
	}
	return
}
func init() {
	sc.Split(bufio.ScanWords)
}
func (pq *Pq) size() int { return len(*pq) - 1 }
func (pq *Pq) heapify(i int) {
	for {
		lc, rc := 2*i, 2*i+1
		var x int
		if lc < len(*pq) && (*pq)[lc].p > (*pq)[i].p {
			x = lc
		} else {
			x = i
		}
		if rc < len(*pq) && (*pq)[rc].p > (*pq)[x].p {
			x = rc
		}
		if x == i {
			break
		}
		(*pq)[i], (*pq)[x] = (*pq)[x], (*pq)[i]
		i = x
	}
}
func (pq *Pq) insert(v int, p int) {
	*pq = append(*pq, pqe{v: v, p: p})
	for i := len(*pq) - 1; i > 1 && (*pq)[i].p > (*pq)[i/2].p; i = i / 2 {
		(*pq)[i], (*pq)[i/2] = (*pq)[i/2], (*pq)[i]
	}
}
func (pq *Pq) extract() interface{} {
	if len(*pq) <= 1 {
		return nil
	}
	me := (*pq)[1]
	(*pq)[1] = (*pq)[len(*pq)-1]
	*pq = (*pq)[:len(*pq)-1]
	(*pq).heapify(1)
	return me.v
}
func (pq *Pq) clear() { *pq = (*pq)[:1] }
func newPq(c int) Pq {
	p := make(Pq, 1, c)
	p[0] = pqe{v: -1, p: -1}
	return p
}
func (pq *Pq) peek() interface{} {
	if len(*pq) <= 1 {
		return nil
	}
	return (*pq)[1].v
}

func main() {
	n, m := ri(), ri()
	ab := make([][]int, 1e5+10)
	for i := 0; i < n; i++ {
		a, b := ri(), ri()
		ab[a] = append(ab[a], b)
	}
	ans := 0
	pq := newPq(1e5)
	for i := 1; i <= m; i++ {
		for _, v := range ab[i] {
			pq.insert(v, v)
		}
		if get, ok := pq.extract().(int); ok {
			ans += get
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 8832
#include <bits/stdc++.h>
using namespace std;
int main() {
 int x,flag,ans;
 ans=0;
 flag=0;
 vector<string> title;
 vector<int> length;
 int int_tmp;
 string str_tmp,title_mark;
 cin>>x;
 for(int i=0;i<x;i++){
  cin>>str_tmp>>int_tmp;
  title.push_back(str_tmp);
  length.push_back(int_tmp);
 }
 cin>>title_mark;
 for(int i=0;i<x;i++){
  if(flag==1){
    ans+=length[i];
  }
  if(title_mark==title[i]){
    flag=1;
  }
 }
 cout<<ans<<endl;
}

Measured memory_bytes: 256
import { readFileSync } from 'fs'

const zip = <T, U>(a: T[], b: U[]): [T, U][] =>
  a.map((v, i) => [v, b[i]])

function main(input: string) {
  const [s, t] = input.split('\n').map(v => v.split(''))

  const result = zip(s, t).filter(([a, b]) => a !== b)

  console.log(result.length)
}

main(readFileSync('/dev/stdin', 'utf8').trim())


Measured memory_bytes: 74624
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  ll i,G=0;string S;cin>>S;
  REP(i,S.size())if(S[i]=='g')G++;
  cout<<(2*G-S.size())/2<<endl;
  return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<vector>
#include<stdio.h>
#include<cstring>
#include<math.h>
#include<map>
#include<bitset>
#include<iomanip>
#include<queue>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
using P = pair<int, int>;

int H, N;
int dp[10001] = {0};
int a[1000], b[1000];
const int INF = 1000000000;


int main() {
  cin >> H >> N;
  rep(i, H) {
    dp[i+1] = INF;
  }
  dp[0] = 0;
  rep(i, N) {
    cin >> a[i] >> b[i];
  }

  for(int i = 0; i <= H; i++) {
    for(int j = 0; j < N; j++) {
      int temp = i - a[j];
      if(temp <= 0) {
        temp = 0;
      }
      dp[i] = min(dp[temp] + b[j], dp[i]);
    }
  }
  cout << dp[H] << endl;
  return 0;
}

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

namespace atcorder2
{
    class Program
    {
        public static long Read()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] Reads()
        {
            return Console.ReadLine().Split().Select(long.Parse).ToArray();
        }

        
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var s = Console.ReadLine().ToCharArray();
            var answer="None";
            for (int i = 'a'; i <='z'; i++)
            {
                bool f = false;
                for (int j = 0; j < s.Length; j++)
                {
                    if (s[j] == (char)i)
                        f = true;
                }
                if (!f)
                {
                    answer = Convert.ToString((char)i);
                    break;
                }

            }
            Console.WriteLine(answer);


            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VRSORT(v) sort(v.begin(), v.end(),greater<int>());
#define INF 999999999
#define MOD 1000000007
#define M_PI 3.14159265358979323846
#define ALL(X) (X).begin(),(X).end()

#ifdef __LOCAL
    #define DBG(X) cout << #X << " = " << (X) << endl;
    #define SAY(X) cout << (X) << endl;
#else
    #define DBG(X)
    #define SAY(X)
#endif

#ifdef __LOCAL
    #include <filesystem>
    namespace fs = std::filesystem;
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 0};
int dy[]={0, 1, 0, -1, 0};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
 
std::string pad(int num){ char buffer[4]; std::snprintf(buffer, sizeof(buffer), "%03d", num); return buffer;}
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }



ll N,K;
vector<ll> A;
void input(){
  #ifdef __LOCAL
    fs::path p = __FILE__;
    fs::path input,output;
    input = output = p.parent_path();
    input += string("/input/") + string(p.stem()) + string(".txt");
    output += string("/output/") + string(p.stem()) + string(".txt");
    freopen(input.c_str(), "r", stdin);
    freopen(output.c_str(), "w", stdout);
  #endif
  cin >> N >> K;
  A = fetch_vec<ll>(N);
}


int solve(){
  input();
  ll ans=0;
  int M=41;
  K++;
  for(int j=M;j>=0;j--){
    ll X=0;
    ll ansj=0;
    if(!((K>>j)&1)) continue;
    for(int k=M;k>j;k--) X |= K&(1LL<<k);
    for(int i=(j-1);i>=0;i--){
      int chk=0;
      for(auto a:A) chk += (a>>i)&1;
      if(2*chk >= N) continue;
      else X |= (1LL<<i);
      }
    REP(i,N) ansj += X^A[i];
    ans = max(ans,ansj);
  }
  // ll X = K;
  // ll ansj=0;
  // REP(i,N) ansj += X^A[i];
  // ans = max(ans,ansj);

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

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


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define pvec(v) rep(i,v.size()){cout << v[i] << " ";};cout<<endl;
#define pb push_back
#define pf push_front
#define mod 1e9+7
#define m_p make_pair
 
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
const double pi = acos(-1.0);
 
ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
    return true;
}

int main()
{
    ll h,w,ans=999999999,a,b,c;
    cin >> h >> w;
    if(h%3==0 || w%3==0) ans=0;
    else{
        if(w%3==1){
            a=(w/3)*h;
            b=(w/3)*h;
            c=((w+2)/3)*h;
            ans=min(ans,max({a,b,c})-min({a,b,c}));
        }
        else if(w%3==2){
            a=(w/3)*h;
            b=((w+1)/3)*h;
            c=((w+1)/3)*h;
            ans=min(ans,max({a,b,c})-min({a,b,c}));
        }
        if(h%3==1){
            a=(h/3)*w;
            b=(h/3)*w;
            c=((h+2)/3)*w;
            ans=min(ans,max({a,b,c})-min({a,b,c}));
        }
        else if(h%3==2){
            a=(h/3)*w;
            b=((h+1)/3)*w;
            c=((h+1)/3)*w;
            ans=min(ans,max({a,b,c})-min({a,b,c}));
        }
        for(ll i=1;i<w;i++){
            a=i*h;
            b=(w-i)*(h/2);
            c=(w-i)*((h+1)/2);
            ans=min(ans,max({a,b,c})-min({a,b,c}));
        }
        for(ll i=1;i<h;i++){
            a=i*w;
            b=(h-i)*(w/2);
            c=(h-i)*((w+1)/2);
            ans=min(ans,max({a,b,c})-min({a,b,c}));
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
/*

*/
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define rep(i,a,n) for (ll i=a;i<n;i++)
#define per(i,a,n) for (ll i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((ll)(x).size())
#define cin1(x) cin >> x
#define cin2(x, y) cin >> x >> y
#define cin3(x, y, z) cin >> x >> y >> z
#define cin4(x, y, z, _) cin >> x >> y >> z >> _
#define cin5(x, y, z, p, q) cin >> x >> y >> z >> p >> q
#define cou(x) cout << x
#define cous(x) cout << x << " "
#define coul(x) cout << x << "\n"
#define ret(x) return x
#define MAX 5000001
#define start int main() {   fastio
#define finish ret(0); }
#define Test ll _t cin1(_t); rep(i, 0, _t)

struct point{    int x, y, ind;   char ch;  };
typedef long long ll;
typedef vector<ll> VI;
typedef pair<ll,ll> PII;
typedef double db;
//mt19937 mrand(random_device{}());
const ll mod=1000000007;
//ll rnd(ll x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}ret(res);}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll fact[13];
void factorial() {   fact[0]=1;  rep(i, 1, 12) fact[i]=(fact[i-1]*i);  }
vector <ll> sie; //for sieve function
ll spf[MAX+7];  //for sieve function
void sieve() {    rep(i, 2, MAX)  {  if (spf[i] == 0) {  spf[i] = i;   sie.pb(i);  }    for (ll j=0; j<SZ(sie) && i*sie[j] <= MAX && sie[j] <= spf[i]; j++)   spf[i * sie[j]] = sie[j]; }   }
bool cmp(point A, point B){   if(A.x != B.x) ret(A.x < B.x);  ret(A.y < B.y);   }
// head collected

ll n, _, __, m;
vector < ll > adj[10];
bool vis[10];

ll solve(ll s)
{
    bool ok = true;

    rep(i, 1, n+1)
        if ( !vis[ i ] )
            ok = false;

    if ( ok ) ret( 1 );

    ll an = 0;

    rep(i, 0, SZ( adj[ s ]))
        if ( !vis[ adj[ s ][ i ] ] ){
            vis[ adj[ s ][ i ] ] = true;
            an += solve( adj[ s ][ i ] );
            vis[ adj[ s ][ i ] ] = false;
        }

    ret( an );
}

start;

    cin2(n, m);

    rep(i, 0, m) {
        cin2( _, __ );
        adj[ _ ].pb( __ );
        adj[ __ ].pb( _ );
    }

    vis[ 1 ] = true;
    coul(solve(1));

finish


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;
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;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N; cin >> N;
	vector<int>vec(N - 1);
	rep(i, 0, N - 1)cin >> vec[i];
	int ans = vec[0] + vec[N - 2];
	rep(i, 0, N - 2) {
		ans += min(vec[i], vec[i + 1]);
	}
	cout << ans << "\n";

	return 0;
}

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

int main() {
  char c;
  cin >> c;
  if ((c == 'a') || (c == 'e') || (c == 'i') ||
    (c == 'o') || (c == 'u')) {
    cout << "vowel" << endl;
  }
  else {
    cout << "consonant" << endl;
  }  
}


Measured memory_bytes: 256
a,b,n = map(int,input().split())


x = 2

def hantei(x,a,b):
    rr = 0
    rr = int(a*x//b) - a * int(x//b)
    return rr



mx = n//b
ans = 0
ans_n = hantei(n,a,b)
ans_0 = hantei(0,a,b)

if(mx == 0):
    x = n
    ans = hantei(x,a,b)
else:
    flag = 1
    x = 2*b - 1
    ans = max(ans,hantei(x,a,b))
    #print(ans)

asn = max(ans,ans_n,ans_0)    
print(ans)
        
    


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

int main()
{   
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int x;
    cin>>x;
    if(x>=30)
    cout<<"Yes";
    else
    cout<<"No";
    return 0;   
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) for(int i = 0; i < (b); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 29)
using namespace std;

int main(){
    string s;
    bool isUsed[100005] = {0};
    int cnt = 0;
    cin >> s;
    for(int i = s.size() - 1; i >= 0; i--){
        if(s[i] == 'p'){
            cnt++;
            isUsed[i] = 1;
        }
        if(s[i] == 'g' && cnt > 0){
            cnt--;
            isUsed[i] = 1;
        }
    }
    int gcnt = 0;
    rep(i,s.size()){
        if(s[i] == 'g' && isUsed[i] != 1) gcnt++;
    }
    cout << gcnt / 2 + cnt << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <string.h>
using namespace std;

int n,q,a;
int dp[2010];
int main(){
	cin >> n;
	int A[25] = {0};
	for(int i=0;i<n;i++){
		cin >> A[i];
	}
	memset(dp,-1,sizeof(dp));
	dp[0] = 0;
	for(int i=0;i<n;i++){
		for(int j=0;j<=2000;j++){
			if(dp[j] >= 0){
				dp[j] = 1;
			}else if(j<A[i] || dp[j-A[i]] <= 0) dp[j] = -1;
			else dp[j] = dp[j-A[i]] - 1;
		}
	}
	cin >> q;
	for(int i=0;i<q;i++){
		int a;
		cin >> a;
		if(dp[a] >= 0) cout << "yes" << endl;
		else cout << "no" << endl;
	}
}


Measured memory_bytes: 3120
#include <bits/stdc++.h>
#define r(i,n) for(int i = 1; i<=n; i++)
typedef long long ll;
using namespace std;
const ll mod=1000000007;

int main() {
  ll n,sum=0;
  cin >> n;
  r(i,n){
    if(i%3!=0&&i%5!=0)sum+=i;
  }
  cout<<sum<<endl;
}

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

#define ll long long int
#define pb push_back
#define mk make_pair
#define ff first
#define ss second
#define finput ifstream cin;cin.open("in.txt")
#define foutput ofstream cout;cout.open("out.txt")  
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define mod 1000000007

ll gcd(ll x, ll y){ 
	if(x<y) 
		swap(x,y); 
	if(x%y==0)
		return y;
	return gcd(y, x%y);
}

ll pwm(ll a, ll n){
	ll ans = 1;
	while(n>0){
		if(n%2==1){
			ans = (ans * a)%mod;
		}
		a = (a*a)%mod;
		n /= 2;
	}
	return ans%mod;
}

const int pwn = 100010;
ll pw[pwn];
void pwtwo(){
	pw[0] = 1;
	for(int i=1; i<pwn; i++){
		pw[i] = (pw[i-1]*2)%mod;
	}
}


ll gcdExtended(ll a, ll b, ll *x, ll *y); 
  
ll modInverse(ll a, ll m) 
{ 	
	if(a==1)
		return 1;
	//cout<<"mi "<<a<<" "<<m<<" ";
    ll x, y; 
    ll g = gcdExtended(a, m, &x, &y); 
    if (g != 1){
        //cout << "Inverse doesn't exist"<<endl; 
        return -1;
    }
    else
    { 
        // m is added to handle negative x 
        ll res = (x%m + m) % m; 
        //cout<<res<<endl;
        return res;
        // cout << "modular multiplicative inverse is " << res; 
    } 
} 
  
ll gcdExtended(ll a, ll b, ll *x, ll *y) 
{ 
    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
  
    ll x1, y1;
    ll gcd = gcdExtended(b%a, a, &x1, &y1); 
  
    *x = y1 - (b/a) * x1; 
    *y = x1; 
  
    return gcd; 
} 

ll fact[1010];
ll init(){
	fact[0] = 1;
	for(int i=1; i<1010; i++)
		fact[i] = (fact[i-1]*i)%mod;
}

ll ncr(ll n, ll r){
	ll ans = fact[n];
	if(r>n)
		return 0;
	//if(r!=0)
	ans = (ans*modInverse(fact[r], mod))%mod;
	// if(n-r!=0)
	ans = (ans*modInverse(fact[n-r], mod))%mod;

	return ans;
}

int main(){
	// finput;
	// foutput;
	fast;

	int n, k, i, j, x, m;
	ll ans;
	string s;
	cin>>s;


	if(s.size()<26){
		int arr[26] ={0};
		for(i=0; i<s.size(); i++)
			arr[s[i]-'a']++;
		// cout<<s;
		for(i=0; i<26; i++){
			if(arr[i]==0){
				s += 'a' + i;
				// cout<<i;
				break;
			}
		}
		cout<<s;
		return 0;
	}

	if(s=="zyxwvutsrqponmlkjihgfedcba"){
		cout<<"-1";
		return 0;
	}
	int arr[26] ={0};
	for(i=0; i<26; i++){
		arr[s[i]-'a']=i+1;
	}

	int p[26] = {0};
	for(i=25; i>=0; i--){
		x = s[i] -'a';
		bool chk =true;
		for(j=x+1; j<26; j++){
			if(p[j]!=0){
				chk = false;
				m = j;
				break;
			}
		}

		p[x] = 1;
		if(!chk){
			s[i] = 'a' + m;
			break;
		}
	}

	for(j=0; j<=i; j++){
		cout<<s[j];
	}

	// cout<<s;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
using namespace std;

int main(){

double r;
cin>>r;

double menseki,ensyuu;
menseki = r*r*3.141592653589;
ensyuu = 2*3.141592653589*r;

printf("%.5f %.5f\n",menseki,ensyuu);

}


Measured memory_bytes: 3152
import java.util.Scanner;

class Main{
	public static void main(String[] args) {

						Scanner scanner = new Scanner(System.in);
						int A = scanner.nextInt();
						int B = scanner.nextInt();
						int C = scanner.nextInt();
						int D = scanner.nextInt();
						
						if(A+B > C+D){
							System.out.println("Left");
						}else if(A+ B <C+D ){
							System.out.println("Right");
						}else{
							System.out.println("Balanced");
						}
	}

}



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

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
//typedef pair<ll, ll> P;
typedef pair<double, double> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<string> &o) {
    string a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

int main() {
    vector<bool> v(200000, false);
    v[0] = true;
    rep(i, 100500) {
        if (!v[i]) continue;
        rep(j, 6) v[i + (100 + j)] = true;
    }
    int x;
    cin >> x;
    bool b = v[x];
    cout << (b ? 1 : 0) << endl;
}


Measured memory_bytes: 256
// DSL_1_A.cpp
// Set - Disjoint Set???Union Find Tree

#include <iostream>
#include <vector>
using namespace std;

class UF {
public:
    vector<int> id, rank;
    UF() {}
    UF(int size) {
        id.resize(size, 0);
        rank.resize(size, 0);
        for (int i = 0; i < size; i++) {
            id[i] = i;
        }
    }

    int root(int x) {
        if (x != id[x]) {
            id[x] = root(id[x]);
        }
        return id[x];
    }

    void same(int x, int y)
    {
        if (root(x) == root(y)) {
            cout << 1 << endl;
        }
        else cout << 0 << endl;
    }

    void unite(int x, int y)
    {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        if (rank[rx] <= rank[ry]) {
            id[rx] = ry;
            if (rank[rx] == rank[ry]) {
                rank[ry]++;
            }
        }
        else {
            id[ry] = rx;
        }
    }
};

int main()
{
    int n, q;
    cin >> n >> q;
    UF uf = UF(n);
    int cmd, x, y;
    while (q--) {
        cin >> cmd >> x >> y;
        if(cmd) {
            uf.same(x, y);
        }
        else uf.unite(x, y);
    }
    return 0;
}

Measured memory_bytes: 3196
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

#define DBG cerr << '!' << endl;
#define REP(i,n) for(int (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(int (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(int (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(10)

using namespace std;

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

double mp[111][111];
bool L[111];
bool B[111];
int n,t,l,b;

int main()
{
	while(cin >> n >> t >> l >> b,n|t|l|b)
	{
		REP(i,111)REP(j,111)mp[i][j] = 0;
		REP(i,111)L[i] = B[i] = false;
		mp[0][0] = 1;
		
		REP(i,l)
		{
			int tmp;cin >> tmp;L[tmp] = true;
		}
		REP(i,b)
		{
			int tmp;cin >> tmp;B[tmp] = true;
		}
		
		REP(i,t)
		{
			REP(j,n)
			{
				if(mp[i][j] > 0)
				{
					REP(k,6)
					{
						int tmp = j + k + 1;
						int turn = i+1;
						if(tmp > n)tmp = 2*n - tmp;
						if(L[tmp])turn++;
						if(B[tmp])tmp = 0;
						mp[turn][tmp] += mp[i][j] / 6;
					}
				}
			}
		}
		
		//SHOW2d(mp,t+1,n+1);
		
		
		double ans = 0;
		REP(i,t+1)
		{
			ans += mp[i][n];
		}
		
		cout << Decimal << ans << endl;
	}

	return 0;
}

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

int main(){
	int n, a[3];
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[0] >> a[1] >> a[2];
		sort(a, a+3, greater<int>());
		if(a[0]*a[0] == a[1]*a[1] + a[2]*a[2]) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
}

Measured memory_bytes: 1164
#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<string>
#include<climits>
#include<unordered_map>
#include<set>

#define loopi(x,y) for(int i = x;i<(y);i++)
#define loopj(x,y) for(int j = x;j<(y);j++)


#define nl cout<<"\n";
#define ll long long int
using namespace std;
#define mod  1000000007


int main() {

	ios :: sync_with_stdio(false);
	cin.tie(nullptr);
	// ios_base :: sync_with_stdio(false);
	// cin.tie(NULL)

// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif


	int n;
	cin >> n;
	int a, b, c;
	int dp[n][3];
	cin >> dp[0][0] >> dp[0][1] >> dp[0][2];
	loopi(1, n)
	{
		cin >> a >> b >> c;

		dp[i][0] = a + max(dp[i - 1][1], dp[i - 1][2]);
		dp[i][1] = b + max(dp[i - 1][0], dp[i - 1][2]);
		dp[i][2] = c + max(dp[i - 1][0], dp[i - 1][1]);

	}

	cout << max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2]));

	return 0;
}


Measured memory_bytes: 1408
from collections import deque
import sys

d=deque()

n=int(input())

for i in range(n):
    s=input()
    if s=='deleteFirst':
        d.popleft()
    elif s=='deleteLast':
        d.pop()
    else:
        ss,num=s.split()
        if ss == 'insert':
            d.appendleft(num)
        else:
            try:
                d.remove(num)
            except:
                pass

print(' '.join(d))

"""
def main():
    num2 = 5
    plus(num2)
    print(num2)

def plus(num2):
    num2 += 2
    return num2

if __name__=="__main__":
    main()
    """


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

int main () {

    int i, j, n, x, c;
    double m;

    c = 0;

    scanf("%d", &n);

    for (i = 1; i <= n; i++) {

        scanf("%d", &x);
        m = sqrt(x);

        if (x == 2 || x == 3)
            c += 1;

        for (j = 2; j <= m + 1; j++) {

            if (x % 2 == 0 || x % 5 == 0 || x % j == 0) {
                break;
            } else if (j >= m) {
                c += 1;
                break;
            }

        }

    }

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

    return 0;

}


Measured memory_bytes: 2124
#include <iostream>
#include <cstdio>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

int main() {
	int n, ans;

	while (scanf("%d", &n), n != 0) {
		ans = 0;
		while (n != 1) {
			if (n & 1) n = n * 3 + 1;
			else n /= 2;
			ans++;
		}
		printf("%d\n", ans);
	}
	return 0;
}

Measured memory_bytes: 1188