akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>

using namespace std;
using ll = long long int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i, a, b)  for(int i = (a); i < (b) ; i++)
#define pb push_back
#define SORT(v,n) sort(v, v+n)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define elif else if
#define itn ll
#define int ll
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
///                →,↑,←,↓,↗,↖,↙,↘
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };

struct Node {
	int key;
	Node *left, *right, *parent;
};

Node *root, *NIL;

Node* treeMin(Node *x) {
	while (x->left != NIL) x = x->left;
	return x;
}


Node* find(Node* u, int k) {
	while (u != NIL && u->key != k) {
		if (k < u->key) u = u->left;
		else u = u->right;
	}
	return u;
}

Node* treeSuccessor(Node* x) {
	if (x->right != NIL) return treeMin(x->right);
	Node *y = x->parent;
	while (y != NIL && x == y->right) {
		x = y;
		y = y->parent;
	}
	return y;
}

void treeDelete(Node *z) {
	Node *y;
	Node *x;
	if (z->left == NIL || z->right == NIL) y = z;
	else y = treeSuccessor(z);
	if (y->left != NIL) {
		x = y->left;
	}
	else {
		x = y->right;
	}
	if (x != NIL) {
		x->parent = y->parent;
	}
	if (y->parent == NIL) {
		root = x;
	}
	else {
		if (y == y->parent->left) {
			y->parent->left = x;
		}
		else {
			y->parent->right = x;
		}
	}
	if (y != z)
		z->key = y->key;
	free(z);
}
void preParse(Node *u) {
	if (u == NIL)
		return;
	cout << ' ' << u->key;
	preParse(u->left);
	preParse(u->right);
}

void inParse(Node* u) {
	if (u == NIL)
		return;
	inParse(u->left);
	cout << ' ' << u->key;
	inParse(u->right);
}

void postParse(Node* u) {
	if (u == NIL)
		return;
	postParse(u->left);
	postParse(u->right);
	cout << ' ' << u->key;
}

void insert(int key) {
	Node *y = NIL;
	Node *x = root;
	Node* z = new Node;
	z->key = key;
	z->left = NIL;
	z->right = NIL;
	while (x != NIL) {
		y = x;
		if (z->key < x->key) {
			x = x->left;
		}
		else {
			x = x->right;
		}
	}
	z->parent = y;
	if (y == NIL) {
		root = z;
	}
	else {
		if (z->key < y->key) {
			y->left = z;
		}
		else {
			y->right = z;
		}
	}
}

signed main() {
	/*int n, i, x;
	string com;
	cin >> n;
	rep(i, n) {
		cin >> com;
		if (com == "find") {
			int k;
			cin >> k;
			auto t = find(root, k);
			if (t == NIL)
				cout << "no" << endl;
			else
				cout << "yes" << endl;
		}
		if (com == "insert") {
			cin >> x;
			insert(x);
		}
		if (com == "print") {
			inParse(root);
			cout << endl;
			preParse(root);
			cout << endl;
		}
		if (com == "delete") {
			cin >> x;
			treeDelete(find(root,x));
		}
	}*/

	int n, i;
	cin >> n;
	map<string, bool> m;
	rep(i, n) {
		string com, str;
		cin >> com >> str;
		if (com == "insert") {
			m[str] = true;
		}
		if (com == "find") {
			if (m[str])
				cout << "yes" << endl;
			else
				cout << "no" << endl;
		}
	}
	return 0;
}


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

mindiv = -1
for a in A:
  if mindiv == -1:
    mindiv = len(bin(a)) - len(bin(a).rstrip('0'))
  else:
    tmp = len(bin(a)) - len(bin(a).rstrip('0'))
    if tmp < mindiv:
      mindiv = tmp

print(mindiv)

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


int main() {
    int N, M, tmp;
    cin >> N >> M;
    vector<int> k(M), p(M);
    vector<vector<int>> s(M);
    rep(i,M) {
        cin >> k.at(i);
        rep(j,k.at(i)) {
            cin >> tmp;
            s.at(i).push_back(tmp);
        }
    }
    rep(i,M) cin >> p.at(i);

    int ans = 0;
    for (int bit = 0; bit < (1<<N); ++bit) {
        bool ok = true;
        rep(i,M) {
            int cnt = 0;
            rep(j,k.at(i)) if (bit & (1<<(s.at(i).at(j)-1))) ++cnt;
            if (cnt % 2 != p.at(i)) {
                ok = false;
                break;
            }
        }
        if (ok) ++ans;
    }
    cout << ans << endl;
}



Measured memory_bytes: 3552
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define _GLIBCXX_DEBUG
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
const ll INF = 9223372036854775807;

int main() {
  int n,a,b;cin >> n >> a >> b;
  string s;cin >> s;
  vector<string> Ans(n,"No");
  int counta = 0;
  int countb = 0;
  rep(i,n) {
    if(s[i] == 'a'&&counta < a+b) {
      Ans[i] = "Yes";
      counta++;
    }
    else if(s[i] == 'b'&&counta < a+b) {
      if(countb < b) {
        Ans[i] = "Yes";
        counta++;
        countb++;
      }
    }
  }
  rep(i,n) cout << Ans[i] << endl;
}

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

typedef long long int ll;
using ii= pair<ll,ll>;
#define all(o) (o).begin(),(o).end()
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define ld long double
#define eps 0.00000000001

class prioritize{
    public: bool operator() (ii &p1,ii &p2){
        return p1.F<p2.F;
    }
};

int main()
{
    
    #ifndef ONLINE_JUDGE
        freopen("input1.txt","r", stdin);
        freopen("output1.txt","w",stdout);
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    
  string s;
  cin>>s;
  
  ll cc=0;
  if(s[0]=='R'&&s[1]=='R'&&s[2]=='R')
  {
    cout<<3<<"\n";
    return 0;
  }
  else if((s[0]=='R'&&s[1]=='R')||(s[1]=='R'&&s[2]=='R'))
  {
        cout<<2<<"\n";
    return 0;
  }
  else if(s[0]=='R'||s[1]=='R'||s[2]=='R')
  {
    cout<<1<<"\n";
    return 0;
  }
  else cout<<0<<"\n";


}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(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 fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD 1000000007
#define PI 3.1415926535897932384

template <class T>ostream &operator<<(std::ostream &o, const vector<T> &v)
{
	rep(i, v.size()) {
		o << (i > 0 ? " " : "") << v[i];
	}
	return o;
}

int main() {
	ll n, in, step = 0;
	ll sumod = 0, sumev = 0, ans;
	bool s = false;
	vi v, vec, ansv;
	cin >> n;
	rep(i, n) {
		cin >> in;
		if (in >= 0)s = true;
		v.push_back(in);
		if (i % 2)sumod += (ll)max((ll)0, in);
		else sumev += (ll)max((ll)0, in);
	}
	ans = max(sumod, sumev);
	if (!s) {
		ll ans = *max_element(all(v));
		cout << *max_element(all(v)) << endl;
		int i = n - 1; cout << i << endl;
		for (auto itr = v.end() - 1; *itr != ans; itr--) {
			ansv.push_back(i + 1);
			i--;
		}
		rep(j, i) {
			ansv.push_back(1);
		}
		cout << ansv << endl;
		return 0;
	}
	else {
		list<bool> l;
		auto itr = l.begin();
		bool s = (ans != sumev);
		rep(i, n) {
			if ((i % 2 == 1 )^ s)l.push_back(false);
			else if (v[i] <= -1)l.push_back(false);
			else l.push_back(true);
		}
		itr = l.end();
		itr--;
		for (; *itr != true; itr--) {
			step++;
			ansv.push_back(n - step + 1);
			itr = l.erase(itr);
		}
		for (itr = l.begin(); *itr != true; ) {
			ansv.push_back(1);
			for (auto it = l.begin(); it != l.end(); it++) {
				//cout << *it << " ";
			}
			//cout << endl;
			l.pop_front();
			itr=l.begin();
			step++;
		}//return 0;
		for (itr = l.begin(); itr != l.end(); itr++) {
			//cout << *itr << " " ;
		}
		//cout <<endl<< ansv << endl;
		//return 0;
		bool loop = true;
		while (loop) {
			loop = false;
			int i = 0;
			bool b=true,bb=true,cur=true;
			for (itr = l.begin(); itr != l.end(); itr++) {
				bb = b;
				b = cur;
				cur = *itr;
				//cout << bb << b << cur << endl;
				if (i >= 2) {
					//cout << bb << b <<cur << endl;
					if (b == false) {
						if (bb == true && cur == true) {
							loop = true;
							ansv.push_back(i);
							itr--;
							itr = l.erase(itr);
							itr--;
							itr = l.erase(itr);
							l.insert(itr, true);
							itr = l.erase(itr);
							step++;
							break;
						}
						else if (bb == false && cur == false) {
							loop = true;
							ansv.push_back(i);
							itr--;
							itr = l.erase(itr);
							itr--;
							itr = l.erase(itr);
							l.insert(itr, false);
							itr = l.erase(itr);
							step++;
							break;
						}
					}
				}
				i++;
			}
		}
		cout << ans << endl << step<<endl;
		for(auto x: ansv) {
			cout << x << endl;
		}
	}
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define int ll
typedef pair<int,int> pii;
#define fi first
#define se second
#define Sort(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/4
#define INTINF INT_MAX/2
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<": "<<x<<endl
#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl
template<class T> inline bool chmax(T &a, T b){if(a < b){a = b;return true;}return false;}
template<class T> inline bool chmin(T &a, T b){if(a > b){a = b;return true;}return false;}
/*----------------------------------------------------------------*/
const int MOD = 998244353;
// const int MOD = 1000000007;

/*----------------------------------------------------------------*/
signed main(){

	int l,r,d;
	cin >> l >> r >> d;
	int cnt = 0;
	for(int i = l;i <= r;i++)if(i%d==0)cnt++;
	cout << cnt << endl;



	return 0;
}
/*----------------------------------------------------------------*/

// g++ -std=gnu++17 code1.cpp
// sudo pip3 install --upgrade online-judge-tools
// rm -r -f test;oj dl https://code-festival-2018-quala.contest.atcoder.jp/tasks/code_festival_2018_quala_c
// rm -r -f test;oj dl https://pakencamp-2019-day3.contest.atcoder.jp/tasks/pakencamp_2019_day3_c
// rm -r -f test;oj dl https://atcoder.jp/contests/aising2020/tasks/aising2020_a


Measured memory_bytes: 3620
from scipy.sparse.csgraph import floyd_warshall
import numpy as np
import sys

input = sys.stdin.readline

N, M = map(int, input().split())
AB = []
edge = np.zeros((N, N), dtype=int)
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    AB.append((a, b))
    edge[a][b] = 1
    edge[b][a] = 1

ans = 0
for i in range(M):
    graph = np.copy(edge)
    a, b = AB[i]
    graph[a][b] = 0
    graph[b][a] = 0
    fw = floyd_warshall(graph)
    if fw.max() > 10000:
        ans += 1

print(ans)


Measured memory_bytes: 16952
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

mt19937 mrand(random_device{} ()); 

int rnd(int x) {
  return mrand() % x;
}

typedef long double ld;
typedef long long ll;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const ld eps = 1e-9;
const ld pi = acos((ld) -1.0);

void precalc() {
}

string s;
string q = "CODEFESTIVAL2016";

int read() {
  if (!(cin >> s)) {
    return 0;
  }
  return 1;
}

void solve() {
  int res = 0;
  for (int i = 0; i < sz(s); ++i) {
    if (s[i] != q[i]) {
      ++res;
    }
  }
  printf("%d\n", res);
}

int main() {
  precalc();
#ifdef LOCAL
  freopen(TASK ".out", "w", stdout);
  assert(freopen(TASK ".in", "r", stdin));
#endif

  while (1) {
    if (!read()) {
      break;
    }
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 764
n = int(input())+1
a = list(map(int, input().split()))
cnt = []
for i in range(100005):
    cnt.append(0)
sum = 0

for i in a:
    cnt[i] += 1
for i in range(100005):
    sum += i * cnt[i]

q = int(input())

for i in range(q):
    b, c = map(int, input().split())
    sum += (c-b)*cnt[b]
    cnt[c] += cnt[b]
    cnt[b] = 0
    print(sum)






Measured memory_bytes: 21172
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#define int long long

template <class T>
bool INRANGE(T x, T a, T b) { return a <= x && x <= b; }
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 (a > b){ a = b; return 1;}return 0;}
template <class T>
void printv(vector<T> v) {for (T t : v) {cout << t << " ";}cout << '\n';}

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" <<endl;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

int main()
{
    int n; cin >> n;
    vector<double> v(n);
    REP(i,n) cin >> v[i];

    sort(ALL(v));

    double ans = (v[0] + v[1])/2.0;

    REP(i,n-2) {
        ans = (ans + v[i+2])/2.0;
    }
    
    cout << setprecision(12) << ans << endl;
    return 0;
}


Measured memory_bytes: 256
//↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const double pi = acos(-1);
const ll SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
ll fac[200005], finv[200005], inv[200005];
vector<ll>dij;
struct edge { ll to, cost; };
vector<vector<edge> >G;

ll mod_pow(ll a, ll b) {
	ll res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}

	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v) {
	for (auto &e : t) fill_v(e, v);
}

//↑template↑



int main() {
	ll a, b;
	cin >> a;
	set<pair<ll, ll>>s;
	vector<pair<ll, ll>>v;
	for (int i = 0; i < a; ++i) {
		ll n, m;
		cin >> n >> m;
		s.insert(make_pair(n, m));
	}

	cin >> b;
	for (int i = 0; i < b; ++i) {
		ll n, m;
		cin >> n >> m;
		s.insert(make_pair(n, m));
	}

	for (auto i = s.begin(); i != s.end(); ++i) {
		auto mon = *i;
		v.push_back(make_pair(mon.first, mon.second));
	}

	sort(all(v));
	auto mon = v[0];
	cout << v[0].first << ":";
	if (v[0].second < 10) { cout << 0; }
	cout << v[0].second;
	cout << " ";
	for (int i = 1; i < v.size(); ++i) {
		if (mon != v[i]) {
			cout << v[i].first << ":";
			if (v[i].second < 10) { cout << 0; }
			cout << v[i].second;
			if (i != v.size() - 1) { cout << " "; }
			mon = v[i];
		}
	}

	cout << endl;
}


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

#pragma GCC optimize("O2,no-stack-protector,unroll-loops,fast-math")

#define F first
#define S second
#define pb push_back
#define SZ(x) (ll)(x.size())
#define all(x) x.begin(),x.end()
#define MP make_pair

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll maxn=3e2+10, maxm=5e4+10, lg=21, mod=998244353, inf=1e18;

string s;
ll k,n,cnt,a[maxn],d[maxn],dp[maxn][maxn][maxn];

int main(){
	ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	
	cin>>s>>k;
	for(char c:s) (c=='0' ? cnt++:a[n++]=cnt);
	k=min(k,n);
	for(int i=0;i<n;i++) d[a[i]]++;
	dp[cnt+1][0][0]=1;
	for(int i=cnt+1;i;i--)for(int j=0;j<=k;j++)for(int k=0;k<=n;k++)if(dp[i][j][k])for(int t=0;t<=d[i-1]+k;t++) (dp[i-1][j+max(0ll,d[i-1]-t)][d[i-1]+k-t]+=dp[i][j][k])%=mod;
	ll ans=0;
	for(int i=0;i<=k;i++) ans+=dp[0][i][0];
	cout<<ans%mod;
	
	return 0;
}



 


Measured memory_bytes: 31956
#include <stdio.h>

int main(void) {
	int a,b,c,d,e,w=0,x=0,y=0,z=0;
	while(scanf("%d%d%d",&a,&b,&c) != EOF){
		if(a>b){d=a;a=b;b=d;}
		if(b>c){d=b;b=c;c=d;}
		if(a+b>c){w++;}else{break;}
		d=a*a+b*b;
		e=c*c;
		if(d==e) x++;
		if(d>e) y++;
		if(d<e) z++;
	}
	printf("%d %d %d %d\n",w,x,y,z);
	return 0;
}

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

#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++ )
#define repf(i,m,n) for(ll (i)=m;(i)<n;(i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#define vec(name,num) vector<ll> name((num),0);
#define op(i) cout<<(i)<<endl;
#define opf(i) cout<<fixed<<setprecision(10)<<(i)<<endl;
#define ip(i) cin>>(i);
#define opN cout<<"No"<<endl;
#define opY cout<<"Yes"<<endl;
#define opP cout<<"Possible"<<endl;
#define opI cout<<"Impossible"<<endl;
#define mat(name,fnum,snum); vector<vector<ll>> name((fnum),vector<ll>((snum),0));
#define matC(name,fnum,snum); vector<vector<char>> name((fnum),vector<char>((snum),0));
#define debugP int debug_point; cin>>debug_point;
#define FI first
#define SE second
const ll MOD= 1e9 + 7;

//
void solve(long long R, long long G){
  op(R+(G-R)*2)
}

// Generated by 1.1.4 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(){
    long long R;
    scanf("%lld",&R);
    long long G;
    scanf("%lld",&G);
    solve(R, G);
    return 0;
}


Measured memory_bytes: 256
// g++ -std=gnu++1y -O2 -I/opt/boost/gcc/include -L/opt/boost/gcc/lib -o ./a.out ./X.cpp & a.out //
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ull unsigned long long


using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);	
    cin.tie(NULL); cout.tie(NULL);
    
    int n; cin >> n;
    
    vector<int> dp(3);
    
    for(int i = 0; i < n; i++)
    {
		vector<int> new_dp(3, 0);
		vector<int> nums(3);
		for(int &t: nums) cin >> t;
		
		for(int i = 0; i < 3; i++)
		{
			for(int j = 0; j < 3; j++)
			{
				if(i!=j)
				{
					new_dp[j] = max(new_dp[j], dp[i] + nums[i]);
				}
			}
		}
    
		dp = new_dp;
	}
	
	cout << max({dp[0], dp[1], dp[2]}) << '\n';
    
    return 0;
}



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

int main(){
    long long s;
    long long infinity = 1000000000000000000;
    cin>>s;
    if(s<=1000000000){
        cout<<"0 0 ";
        cout<<"1 0 ";
        cout<<"1 "<<s<<endl;
    }
    else if(s==1000000000000000000){
        cout<<"0 0 ";
        cout<<"0 1000000000 ";
        cout<<"1000000000 0"<<endl;
    }
    else{
        long long a = infinity - s;
            if(a%1000000000 == 0){
                a = 1000000000;
            }
            else{
                a %= 1000000000;
            }
        cout<<"0 0 ";
        cout<<"1000000000 1 ";
        cout<<a<<" "<<(s/1000000000)+1<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define f first
#define s second
using namespace std;

long long dp[102][100005];

int main()
{
    int n, w; cin >> n >> w;
    vector<pair< int, int > > a;
    for(int i = 0; i < n; i++)
    {
        int x, y; cin >> x >> y;
        a.push_back({x, y});
    }
    for(int i = 1; i <= n; i++)
    {
        pair<int, int> x = a[i-1];
        for(int j = 0; j <= w; j++)
            if(j < x.f) dp[i][j] = dp[i-1][j];
            else dp[i][j] = 1ll*max(dp[i-1][j], (dp[i-1][j - x.f] + x.s));
    }
    cout << dp[n][w];
}


Measured memory_bytes: 78336
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b;
  cin >> a >> b;

  if (a % 2 == 1 && b % 2 == 1 ){
  cout <<"Odd" << endl;
  }
  else {
  cout <<"Even" << endl;
  }
}


Measured memory_bytes: 256
m1, d1 = gets.chomp.split(' ').map(&:to_i)
m2, d2 = gets.chomp.split(' ').map(&:to_i)

date1 = Time.new(2019, m1, d1)
date2 = Time.new(2019, m2, d2)

puts date1.month == date2.month ? 0 : 1


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

#ifdef DEBUG
#define debug(x) cout << #x << ": " << x << endl
#else
#define debug(x)
#endif

#define REP(i, n) for(int i = 0; i < (n); i++)
#define REPS(i, n) for(int i = 1; i <= (n); i++)
#define ALL(v) (v).begin(), (v).end()

#define pb push_back
#define mp make_pair
#define mt make_tuple

using namespace std;

using ll = long long;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;

const ll INF = 1e18;
const ll MOD = 1e9+7;

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


signed main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    int S, W; cin >> S >> W;
    if(S <= W) cout << "unsafe" << endl;
    else cout << "safe" << endl; 
}

Measured memory_bytes: 3640
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(),v.end()
#define INF INT_MAX;
typedef long long ll;
using namespace std;

int main(){
  int A,B; cin >> A >> B;
  int M; cin >> M;
  vector<int> a(A);
  vector<int> b(B);
  rep(i,A) cin >> a.at(i);
  rep(i,B) cin >> b.at(i);
  int ans=INF;
  for(int i=0;i<M;i++){
    int x,y,c;
    cin >> x >> y >> c;
    ans = min(a.at(x-1) + b.at(y-1) - c,ans);
  }
  sort(all(a));
  sort(all(b));

  ans = min(a.at(0)+a.at(0),ans);

  cout << ans << endl;
}

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

int main(){
    ll n;
    cin>>n;
    vector<ll> a(n);
    ll asum=0,hsum=0,mx=0;
    rep(i,n){
        cin>>a[i];
        mx=max(mx,a[i]);
        hsum+=mx;
        asum+=a[i];
    }
    cout<<hsum-asum<<endl;
    return 0;
}

Measured memory_bytes: 4848
#include <iostream>
#include <vector>
#include <algorithm>
#include <list>
#include <iomanip>
#include <string>
#include <cctype>
#include <cstdio>
#include <cmath>

using namespace std;

int main(){
  int X;
  cin>>X;
  bool sucess=false;
  for(int j=0;j==0;X++){
    for(int i=2;i<X;i++){
      if(X%i==0)
        sucess=true;
    }
    if(!sucess){
      cout<<X<<endl;
      j++;
    }
    sucess=false;
  }
}

Measured memory_bytes: 3540
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

def main():
    A, B, C = map(int, input().split())

    print('Yes') if A <= C <= B else print('No')

if __name__ == '__main__':
    main()

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

namespace atcoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var dic = new Dictionary<string, List<T>>();
            var sort = new List<string>();

            for (int i = 0; i < N; i++)
            {
                var buffer = Console.ReadLine().Split();
                if (!dic.ContainsKey(buffer[0]))
                    dic[buffer[0]] = new List<T>();

                dic[buffer[0]].Add(new T(i + 1, int.Parse(buffer[1])));
                sort.Add(buffer[0]);
            }

            sort = sort.Distinct().ToList();
            sort.Sort();
            foreach (var v in sort)
            {
                dic[v].Sort();
                dic[v].Reverse();
                foreach (var v2 in dic[v])
                {
                    Console.WriteLine(v2.No);
                }
            }
        }
    }

    class T : IComparable
    {
        public int No;
        public int Value;

        public T(int No, int Value)
        {
            this.No = No;
            this.Value = Value;
        }

        public int CompareTo(object obj)
        {
            var o = (T)obj;

            if (this.Value < o.Value)
                return -1;
            if (this.Value > o.Value)
                return 1;
            return 0;
        }
    }
}


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

class Point {
public:
  double x;
  double y;
  Point(double x = 0, double y = 0) : x(x), y(y) {}
  bool operator <(const Point &p) const {
    if(x != p.x) return x < p.x;
    if(y != p.y) return y < p.y;
    return false;
  }
};

typedef Point Vector;

double cross(Vector a, Vector b) {
  return a.x*b.y - a.y*b.x;
}

int main() {
  while(1) {
    int n;
    cin >> n;
    if(n == 0) break;

    vector<Point> P;
    for(int i = 0; i < n; i++) {
      double x, y;
      scanf("%lf,%lf", &x, &y);
      P.push_back(Point(x, y));
    }

    int ans;
    if(P.size() == 3) {
      ans = 0;
    } else {
      sort(P.begin(), P.end());

      vector<Point> upper;
      upper.push_back(P[0]);
      upper.push_back(P[1]);
      for(int i = 2; i < n; i++) {
	while(upper.size() != 1 &&
	      cross(Vector(upper.rbegin()->x - (upper.rbegin()+1)->x,
			   upper.rbegin()->y - (upper.rbegin()+1)->y ),
		    Vector(P[i].x-upper.rbegin()->x,
			   P[i].y-upper.rbegin()->y)                   ) > 0) {
	  upper.pop_back();
	}
	upper.push_back(P[i]);
      }

      vector<Point> lower;
      lower.push_back(P[n-1]);
      lower.push_back(P[n-2]);
      for(int i = n-3; i >= 0; i--) {
	while(lower.size() != 1 &&
	      cross(Vector(lower.rbegin()->x - (lower.rbegin()+1)->x,
			   lower.rbegin()->y - (lower.rbegin()+1)->y ),
		    Vector(P[i].x-lower.rbegin()->x,
			   P[i].y-lower.rbegin()->y)                   ) > 0) {
	  lower.pop_back();
	}
	lower.push_back(P[i]);
      }
      ans = n - (int)(upper.size() + lower.size() - 2);
    }

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

Measured memory_bytes: 0
#include<cstdio>
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        int point=0;
        int base=0;
        int out=0;
        while(out!=3){
            char s[8];
            scanf(" %s",s);
            switch(s[1]){
                case 'I':
                    base++;
                    if(base==4){
                        point++;
                        base--;
                    }
                    break;
                case 'U':
                    out++;
                    break;
                case 'O':
                    point+=base+1;
                    base=0;
                    break;
            }
        }
        printf("%d\n",point);
    }
    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<string>
using namespace std;
int main() {
	string s; cin >> s;
	short int sum = 0;
	for (size_t i = 0; i < s.size() / 2; i++) {
		if (s[i] == 'i'&&s[s.size() - 1 - i] == 'i');
		else if (s[i] == 'w'&&s[s.size() - 1 - i] == 'w');
		else if (s[i] == '('&&s[s.size() - 1 - i] == ')');
		else if (s[i] == ')'&&s[s.size() - 1 - i] == '(');
		else sum++;
	}
	if (s.size() % 2 == 1) {
		if (s[(s.size() - 1) / 2] == 'i' || s[(s.size() - 1) / 2] == 'w');
		else sum++;
	}
	cout << sum << endl;
}

Measured memory_bytes: 3224
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string a;
    int b;
    int c;
    cin>>a;
    for(b=a.size()-1;a[b]!='F'&&b>=0;b--);
    for(c=0;a[c]!='C'&&c<a.size();c++);
    if(c<b) cout<<"Yes";
    else cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;

int x,m,a[100005],l,r;
long long f[100005],ans,sum,n;

int main()
{
	scanf("%lld%d%d",&n,&x,&m);
	f[1]=x%m;a[f[1]]=1;
	for (int i=2;i<=n;i++) {
		f[i]=f[i-1]*f[i-1]%m;
		if (a[f[i]]) {
			l=a[f[i]];r=i;break;
		}else a[f[i]]=i;
	}
	if (!r) {
		for (int i=1;i<=n;i++) ans+=f[i];
	}else {
		for (int i=1;i<l;i++) ans+=f[i];
		for (int i=l;i<r;i++) sum+=f[i];
		ans+=sum*((n-l+1)/(r-l));
		int t=(n-l+1)%(r-l);
		for (int i=1;i<=t;i++) ans+=f[i+l-1];
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 4544
import java.util.Scanner;

public class Main {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        if (a < b && b < c) System.out.println("Yes");
        else System.out.println("No");
    }
}


Measured memory_bytes: 26240
#include <bits/stdc++.h>
using namespace std;
 
#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
 
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;
 
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
 
const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

int main() {
    int N;
    int ans = INF, tmp;
    cin >> N;
    REP(i, N) {
        cin >> tmp;
        int cnt = 0;
        while(tmp % 2 == 0) {
            cnt++;
            tmp /= 2;
        }
        ans = min(ans, cnt);
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>                                          
using namespace std;                                         
                                                             
int main() {                                                 
  while (true) {                                             
    int x, y;                                                
    cin >> x >> y;                                           
    if (x==0 && y==0) {                                      
      break;                                                 
    }                                                        
    if (x>y) {                                               
      swap(x,y);                                             
    }                                                        
    cout << x << " " << y << endl;                           
  }                                                          
  return 0;                                                  
}             

Measured memory_bytes: 3004
n,L = map(int,input().split())
if L > 0:
         print(((L+(L+(n-1)))*n)//2-L)
elif ((-L)-n )>= 0:
         print((((L+(L+(n-1)))*n)//2)-(L+(n-1)))
else:
         print(((L+(L+(n-1)))*n)//2)


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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int N;
int A[222],ope[222],bef[222],aft[222];


const int INF=1001001001001001001ll;
int mi[222][222];
int ma[222][222];

signed main(){
    string S;cin>>S;
    rep(i,S.size()){
        if(!isdigit(S[i]))continue;
        A[N]=S[i]-'0';
        if(i+1<S.size()&&S[i+1]==')')aft[N]=1;
        ope[N]=1;
        int t=i;
        while(t&&S[t-1]=='(')t--,bef[N]=1;
        if(t&&S[t-1]=='-')ope[N]=-1;
        N++;
    }

    fill_n(*ma,222*222,-INF);
    fill_n(*mi,222*222,INF);
    rep(i,N){
        if(!bef[i])mi[i][i+1]=ma[i][i+1]=A[i]*ope[i];
    }


    for(int len=2;len<=N;len++){
        for(int i=0;i+len<=N;i++){
            int j=i+len;
            for(int k=i+1;k<j;k++){
                chmax(ma[i][j],ma[i][k]+ma[k][j]);
                chmin(mi[i][j],mi[i][k]+mi[k][j]);
            }
            if(!aft[i]){
                if(ope[i]==1){
                    chmax(ma[i][j],A[i]+ma[i+1][j]);
                    chmin(mi[i][j],A[i]+mi[i+1][j]);
                }
                else{
                    chmax(ma[i][j],-A[i]-mi[i+1][j]);
                    chmin(mi[i][j],-A[i]-ma[i+1][j]);
                }
            }
        }
    }

    cout<<ma[0][N]<<endl;
    return 0;
}

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

//#define int long long
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define yn(x) ((x) ? "Yes" : "No")

typedef pair <int, int> ii;
typedef pair <int, ii> iii;

const int siz = 80 + 1;
const int SIZ = 2 * 6400 + 1;
const int mod = 1e9 + 7;
const int maxx = 2e9;
const int MAXX = 1e18;
const string file = "1";

int a[siz][siz];
bool f[siz][siz][SIZ];

int32_t main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

//    freopen ((file + ".inp").c_str(), "r", stdin);
//    freopen ((file + ".out").c_str(), "w", stdout);

    int m, n;
    cin >> m >> n;
    for (int i = 1; i <= m; i++) {
        for (int j = 1; j <= n; j++) {
            cin >> a[i][j];
        }
    }

    for (int i = 1; i <= m; i++) {
        for (int j = 1; j <= n; j++) {
            int x;
            cin >> x;

            a[i][j] = abs(a[i][j] - x);
        }
    }

    f[1][1][a[1][1]] = true;
    for (int i = 1; i <= m; i++) {
        for (int j = 1; j <= n; j++) {
            for (int k = 0; k < SIZ; k++) {
                if (f[i][j][k] == true) {
                    if (i < m) {
                        f[i + 1][j][abs(k - a[i + 1][j])] = true;
                        f[i + 1][j][k + a[i + 1][j]] = true;
                    }

                    if (j < n) {
                        f[i][j + 1][abs(k - a[i][j + 1])] = true;
                        f[i][j + 1][k + a[i][j + 1]] = true;
                    }
                }
            }
        }
    }

    for (int k = 0; k < SIZ; k++) {
        if (f[m][n][k] == true) {
            return cout << k << "\n", 0;
        }
    }

//    cerr << "Time: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";

    return 0;
}


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

int main() {
    int N, T, A;
    int H[1100];
    int res;
    cin >> N;
    cin >> T >> A;
    double diff = 10000;
    for(int i = 0; i < N; ++i) {
        cin >> H[i];
        double averageT = T - H[i] * 0.006;
        if(abs(averageT - A) < diff) {
            diff = abs(averageT - A);
            res = i;
        }
    }
    cout << res+1 << endl;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
from collections import Counter

N = int(input())

c = Counter((int(x) for x in input().split()))

# 0がある場合
# 0,x,x,0,x,x
# あるいは
# 0,0,0,0 (any length is ok)

if c[0] > 0:
    if len(c) == 1:
        bl = True
    else:
        if len(c) > 2:
            bl = False
        else:
            bl = (N == 3 * c[0])
else:
    # 0がない場合
    # x,y,z,x,y,z で3つとも異なる
    se = set(c.keys())
    if len(se) != 3:
        bl = False
    else:
        bl = True
        xor = 0
        for key in se:
            xor ^= key
            if c[key] * 3 != N:
                bl = False
        if xor != 0:
            bl = False

answer = 'Yes' if bl else 'No'
print(answer)

Measured memory_bytes: 15624
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <numeric>

using namespace std;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
	if (a.second != b.second) {
		return a.second < b.second;
	}
	else {
		return a.first < b.first;
	}
}

void func()
{
	long long X, K, D;
	cin >> X >> K >> D;

	X = abs(X);

	long long tmp = X/D;

	if(tmp>=K)
		cout << X - D*K << endl;
	else if((K - tmp) % 2==0)
		cout << X % D << endl;
	else
		cout << abs(X % D - D) << endl;



}

int main() {

//	while (1)
		func();
	return 0;
}


Measured memory_bytes: 3192
#include <iostream>
#include <vector>
//#include <string>
//#include <algorithm>
//#include <math.h>
//#include <queue>
//#include <stack>
//#include <iomanip>

// sometimes used
//#include <set>
//#include <map>
//#include <numeric>
//#include <list>
//#include <deque>
//#include <unordered_map>

typedef long long LL;
//typedef long double LD;
using namespace std;
 
#define MOD 1000000007
//#define MAX 100100
//#define NIL -1
//#define INFTY 1000000000000000000

int main(){
    LL n;
    LL ans=0;
    cin >> n;
    vector<LL> a(n);
    vector<LL> a_sum(n,0);

    for(LL i=0; i<n; i++){
        cin >> a[i];
    }

    a_sum[n-1]=a[n-1];
    for(LL i=n-2; i>=0; i--){
        a_sum[i]=(a_sum[i+1]+a[i])%MOD;
    }
    for(LL i=0; i<n-1; i++){
        ans=(ans+(a[i]*a_sum[i+1])%MOD)%MOD;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 6432
// clang-format off
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i,n) for(ll i=n-1; i>=0; --i)
#define rrep1(i,n) for(ll i=n; i>0; --i)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define SORT_DESC(x) sort(all(x), greater<>())
#define pb push_back
#define mp make_pair
#define coutl cout<<fixed<<setprecision(10)
#define ANS(ans) cout<<ans<<endl;
#define INF 1e9;
#define LINF 1e18;
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;}
// clang-format on

void solve(long long N, long long M, std::vector<long long> p, std::vector<std::string> S) {
  ll ACs = 0;
  ll WAs = 0;
  vector<bool> AC(N, false);
  vector<ll> WA(N);
  rep(i, M) {
    if (AC[p[i] - 1])
      continue;
    if (S[i] == "WA")
      WA[p[i] - 1]++;
    else {
      AC[p[i] - 1] = true;
      ACs++;
      WAs += WA[p[i] - 1];
    }
  }
  ANS(ACs << " " << WAs);
}

// clang-format off
int main() {
  long long N;
  scanf("%lld",&N);
  long long M;
  scanf("%lld",&M);
  std::vector<long long> p(M);
  std::vector<std::string> S(M);
  for(int i = 0 ; i < M ; i++){
    scanf("%lld",&p[i]);
    std::cin >> S[i];
  }
  solve(N, M, std::move(p), std::move(S));
  return 0;
}


Measured memory_bytes: 7296
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <iterator>      // std::next prev
#include <utility>      // std::pair, std::make_pair

using namespace std;

int main() 
{   
	std::ios::sync_with_stdio(false);

	unordered_map<int,int> g1;

	g1[1] = g1[3] = g1[5] = g1[7] = g1[8] = g1[10] = g1[12] = 1;
	g1[4] = g1[6] = g1[9] = g1[11] = 2;
	g1[2] = 3;
	int a,b;
	cin>>a>>b;
	if(g1[a]==g1[b])
	{
		cout<<"Yes";
	}
	else
	{
		cout<<"No";
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int dx[]={0,0,1,-1},dy[]={-1,1,0,0};
int h,w;
char s[55][55];
int main()
{
    ios::sync_with_stdio(false);
    cin>>h>>w;
    rep(i,h)
    	rep(j,w)
			cin>>s[i][j];
	rep(i,h)
		rep(j,w)
		{
			if(s[i][j]=='.') continue;
			bool flag=false;
			rep(k,4)
			{
				int x2=i+dx[k],y2=j+dy[k];
				if(s[i][j]=='#'&&s[x2][y2]=='#')
					flag=true;
			}
			if(!flag)
			{
				cout<<"No"<<endl;
				return 0;
			}
		}
	cout<<"Yes"<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,k;
    cin>>a>>b>>c;
    cin>>k;
    while(b<=a && k>0)
    {
        b*=2;
        k--;
    }
    while(c<=b && k>0)
    {
        c*=2;
        k--;
    }
    if(b>a && c>b)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 3632
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;
typedef long long LL;
char a[100];
int main()
{
	scanf("%s",a+1);
if((a[1] == a[2] && a[2] == a[3]) || (a[2] == a[3] && a[3] == a[4])){
		printf("Yes");
	}
	else printf("No");

}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <numeric>

using namespace std;

int a[26]; string w;
int main(){
    int n, a, b;
    cin >> n >> a >> b;

    cout << min(a*n, b) << endl;
    return 0;
}

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

int a, b, m, cost;

int main(){
    cin >> a >> b >> m;
    int x[a], y[b];
    for(int i=0; i<a; i++){
        cin >> x[i];
    }
    for(int i=0; i<b; i++){
        cin >> y[i];
    }
    cost = *min_element(x, x+a) + *min_element(y, y+b);
    for(int i=0, idxX, idxY, c; i<m; i++){
        cin >> idxX >> idxY >> c;
        cost = min(cost, x[idxX-1]+y[idxY-1]-c);
    }
    cout << cost << endl;
}


Measured memory_bytes: 1024
#include<iostream>
using namespace std;
int n,m,c[200+2],k;

void cut(int x){
	int d[200+2];
	for(int i=0;i<x;i++){
		d[i]=c[i];
	}
	for(int i=0;i<2*n-x;i++){
		c[i]=c[i+x];
	}
	for(int i=2*n-x;i<2*n;i++){
		c[i]=d[i+x-2*n];
	}
}

void r(){
	int d[200+2];
	for(int i=0;i<2*n;i++){
		d[i]=c[i];
	}
	for(int i=0;i<n;i++){
		c[2*i]=d[i];
		c[2*i+1]=d[n+i];
	}
}

int main(){
	scanf("%d%d",&n,&m);
	for(int i=0;i<2*n;i++)c[i]=i+1;
	for(int i=0;i<m;i++){
		scanf("%d",&k);
		if(k==0)r();
		else cut(k);
	}
	for(int i=0;i<2*n;i++){
		printf("%d\n",c[i]);
	}
}

Measured memory_bytes: 1172
/*
 *  author : Atul Anand   
 *  created on : Wed Apr 01 2020
 */

import java.io.*;
import java.util.*;

public class Main{

    public static void main(String[] args) throws IOException {
        String S = in.next();
        char ch[] = new char[S.length()];
        Arrays.fill(ch, 'x');
        println(String.valueOf(ch));
        
        in.close();
        out.close();
    }

    static int MIN = Integer.MIN_VALUE;
    static int MAX = Integer.MAX_VALUE;
    static Reader in = new Reader();
    static PrintWriter out = new PrintWriter(System.out);

    static void read(int arr[], int N) throws IOException { 
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    }
    
    static void read(long arr[], int N) throws IOException { 
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    }
    
    static void read(String arr[], int N) throws IOException { 
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    }
    
    static void print(Object O) {  
    	out.print(O); 
    }
    
    static void println(Object O) { 
    	out.println(O); 
    }
    
    static void println(int arr[]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i]+" "); 
    	} 
    	println(""); 
    }

    static void println(int arr[][]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		println(arr[i]); 
    	}
    }
    
    static void debug(Object O) { 
    	System.out.println(O); 
    }
}

class Reader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    Reader() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException { 
        return Integer.parseInt(next()); 
    }
    
    double nextDouble() throws IOException { 
        return Double.parseDouble(next());
    }
    
    long nextLong() throws IOException { 
        return Long.parseLong(next()); 
    }
    
    String nextLine() throws IOException { 
        return reader.readLine(); 
    }
    
    void close() throws IOException { 
        reader.close(); 
    }
}

Measured memory_bytes: 22868
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include <iomanip>
using namespace std;

int main(){
	int n,k=0,d=0;
	cin>>n;
	vector<int>a(1000);
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	for(int i=0;i<10000;i++){
		for(int j=0;j<n;j++){
			if(a[j]%2==0){
				a[j]=a[j]/2;
			}
			else{
				k=1;
				break;
			}
		}
		if(k==1){
			break;
		}
		else{
			d++;
		}
	}

	cout<<d<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
	string S;
	getline( cin, S );
	cout << "A" << S[ 8 ] << "C" << endl;
	return 0;
}

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

int main(){
  int i,count=0,max=0,N;
  scanf("%d",&N);
  int H[N],T[N-1];
  
  for(i=0;i<N;i++){
    scanf("%d",&H[i]);
    if(i!=0){
      if(H[i-1]>=H[i]){
	T[i-1]=1;
      }else{
        T[i-1]=0;
      }
    }
  }
  for(i=0;i<N-1;i++){
    if(T[i]==1){
      count++;
    }else{
      count = 0;
    }
    if(max<count) max=count;
  }
  printf("%d\n",max);
  return 0;
}


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

#include <math.h>
#include <stdlib.h>


#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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

//INT_MAX	2,147,483,647 = 2*1.0e9

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    ll N; cin >> N;
    vector<ll> A(N), B(N), C(N);
    for(ll i = 0; i < N; i++) cin >> A[i];
    for(ll i = 0; i < N; i++) cin >> B[i];
    for(ll i = 0; i < N; i++) cin >> C[i];

    sort(A.rbegin(), A.rend());
    sort(B.rbegin(), B.rend());
    sort(C.rbegin(), C.rend());

    vector<ll> Bcnt(N);
    ll pos = 0;
    for(ll i = 0; i < N; i++){
        while(B[i] < C[pos] && pos < N) pos++;
        Bcnt[i] = pos;
    }
    
    vector<ll> sum(N+1);
    for(ll i = 1; i < N+1; i++) sum[i] = sum[i-1] + Bcnt[i-1];

    ll ans = 0;
    pos = 0;
    for(ll i = 0; i < N; i++){
        while(A[i] < B[pos] && pos < N) pos++;
        ans += sum[pos];
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 4224
#include<stdio.h>
int main(void)
{
	double f;
	int a,b,d,r;
	scanf("%d %d",&a,&b);
	d=a/b;
	r=a%b;
	f=(double)a/b;
	printf("%d %d %lf\n",d,r,f);
	return 0;
}

Measured memory_bytes: 2708
#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main()
{
    double A, B;
    double H, M;
    cin >> A >> B >> H >> M;

    double diff_rad = 4 * asin(1.) * ((60 * H + M) / 12. / 60. - (M / 60.));

    cout << fixed << setprecision(15) << sqrt(A * A + B * B - 2 * A * B * cos(diff_rad)) << endl;
}

Measured memory_bytes: 4124