akhauriyash/Code-Regression huggingface dataset:
/*
  Vivek Rathi
  CSE 3rd Year
  MNNIT
  THUMB RULE - THINK FOR DP FIRST AND THEN GREEDY!!!
*/
#include<bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ll long long int
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define present(c,x) ((c).find(x) != (c).end())
#define null NULL
#define mp make_pair
#define sz(x)	(ll)x.size()
#define fi first
#define se second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define inf 1e18
#define flush fflush(stdout);
#define endl '\n'
//unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
//shuffle (foo.begin(), foo.end(), std::default_random_engine(seed));
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<ll, null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>
ll modpower(ll a,ll b,ll c)
{
	ll res=1;
	while(b)
	{
		if(b&1LL)
			res=(res*a)%c;
		a=(a*a)%c;
		b>>=1;
	}
	return res;
}
//-------------------------------Template--Above-----------------------------------------------
ll h,w,k;
string s[7];
ll solve(ll i,ll mask1,ll mask2)
{
	if(i==max(h,w))
	{
		ll co=0;
		for(ll i=0;i<h;i++)
		{
			for(ll j=0;j<w;j++)
			{
				if(s[i][j]=='#'&&((1LL<<i)&mask1)==0&&((1LL<<j)&mask2)==0)
					co++;
			}
		}
		if(co==k)
			return 1;
		else
			return 0;
	}
	ll ans1=solve(i+1,mask1,mask2);
	ll ans2=0;
	if(i<h)
		ans2=solve(i+1,mask1|(1LL<<i),mask2);
	ll ans3=0;
	if(i<w)
		ans3=solve(i+1,mask1,mask2|(1LL<<i));

	ll ans4=0;
	if(i<w&&i<h)
		ans4=solve(i+1,mask1|(1LL<<i),mask2|(1LL<<i));
	return ans1+ans2+ans3+ans4;
}
int main()
{
	boost
	cin>>h>>w>>k;
	for(ll i=0;i<h;i++)
		cin>>s[i];
	cout<<solve(0,0,0)<<endl;
	return 0;	
}

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


int main(){
    int P, Q, R;
    cin >> P >> Q >> R;

    int sum = P + Q + R;
    
    vector<int> v;
    auto it = v.begin();

    it = v.insert(it, sum - P);
    it = v.insert(it, sum - Q);
    it = v.insert(it, sum - R);

    int min = *min_element(v.begin(), v.end());

    cout << min << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
	string o, e;
	cin >> o >> e;

	for (int i = 0; i < o.size(); i++) {
		cout << o[i];
		if (e.size() > i) {
        cout << e[i];
		}
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
typedef priority_queue<ll> pq;

const int MOD = 1e9+7;
const int INF = 2e9;
const int MAX_N = 1;

int main() {
  int N;
  cin >> N;
  if (N < 1000) {
    cout << "ABC" << endl;
  } else if (N < 1999) {
    cout << "ABD" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
# coding: utf-8
# input  : 30
# otuput : 3 6 9 12 13 15 18 21 23 24 27 30
num = int(input())
ans = ""
for num in range(3, num + 1):
    if num % 3 == 0 or num % 10 == 3 or '3' in list(str(num)):
        ans += ' ' + str(num)
print(ans)


Measured memory_bytes: 5636
#if defined(DAIJOBU)
#include "/home/ichigo/includes.hpp"
#include "PP.hpp"
#define deb(x...) cerr << "[" << #x << "] = " << x << "\n";
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long lint;
typedef vector<lint> vlint;
typedef vector<vlint> vvlint;
typedef pair<lint, lint> plint;
typedef double ld;

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

int main() {
    ios::sync_with_stdio(false);
	cin.tie(0);
  	
	int a, b, c;
	cin >> a >> b >> c;
	cout << max(-a + (c + b), 0);
    return 0;
}



Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9 + 7);
constexpr ll INF = 1LL << 60;

int main(void) {
	int n, m;
	cin >> n >> m;
	
	vector< vector<int> > G(n);
	vector<int> d(n, 0);
	for(int i = 0; i < m; ++i) {
		int x, y;
		cin >> x >> y;
		x--; y--;
		G[x].push_back(y);
		d[y]++;
	}
	
	queue<int> q;
	for(int i = 0; i < n; ++i) {
		if( d[i] == 0 ) q.push(i);
	}
	
	vector<int> dp(n + 1, 0);
	
	while( !q.empty() ) {
		int now = q.front();
		q.pop();

		for(auto& v : G[now]) {	
			d[v]--;
			
			if( d[v] == 0 ) {
				q.push(v);
				dp[v] = max(dp[v], dp[now] + 1);
			}
		}
	}
	
	int ans = 0;
	for(int i = 0; i < n; ++i) {
		ans = max(ans, dp[i]);
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 9500
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef long double ld;
const double pi=acos(-1.0);
const ll mod=pow(10,9)+7;
const ll INF=pow(2,31)-1;
using str=string;
typedef pair<int,int> P;
typedef vector<int> vi;

ll gcd(ll a,ll b){
    ll v0=a,v1=b,v2=a%b;
    while(v2!=0){
        v0=v1;
        v1=v2;
        v2=v0%v1;
    }
    return v1;
}

ll lcm(ll a,ll b){
    return (a*b/gcd(a,b));
}

int main(){
    ios::sync_with_stdio(false);
    ll n,a,b; cin >> n >> a >> b;
    if(a%2==b%2) cout << (b-a)/2 << endl;
    else cout << min(a-1,n-b)+1+(b-a-1)/2;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
from collections import deque
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    S=input()
    Q=int(input())
    f=False
    ans=deque(list(S))
    for _ in range(Q):
        Query=list(input().split())
        if Query[0]=='1':
            f=not f
        else:
            F,C=Query[1],Query[2]
            if F=='1':
                if not f:
                    ans.appendleft(C)
                else:
                    ans.append(C)
            else:
                if not f:
                    ans.append(C)
                else:
                    ans.appendleft(C)
    if f:
        ans=list(reversed(ans))
    print(''.join(ans))
        
    

if __name__ == '__main__':
    main()


Measured memory_bytes: 71784
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <ccomplex>
#include <unordered_map>
#include <cstring>
#include <iostream>
#include <numeric>
#include <sstream>
#include <set>
#include <map>
#include <iomanip>

using namespace std;
#define MAX 1LL << 60
#define MOD 1000000007

typedef long long ll;

#define rep(i, s, e) for(ll i = s; i < e; i++)
#define repR(i, s, e) for(ll i = s; i > e; i--)
#define reft0(i, j) setfill('0') << setw(i) << j

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

int main(){
    ll N;
    vector<ll> L;
    cin >> N;
    rep(i, 0, N){
        ll temp;
        cin >> temp;
        L.push_back(temp);
    }
    sort(begin(L), end(L), greater<ll>());
    ll ans = 0;
    rep(i, 0, N){
        rep(ii, i + 1, N){
            rep(iii, ii + 1, N){
                if (L[i] >= (L[ii] + L[iii])) break;
                if (L[ii] >= (L[iii] + L[i])) continue;
                if (L[iii] >= (L[i] + L[ii])) continue;
                ans++;
            }
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repI(i, d, n) for (int i = (d); i < (n); ++i)
#define reps1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using ll = long long;
using P = pair<int, int>;
using Pl = pair<ll, ll>;
using M = map<int, int>;
using Ml = map<ll, ll>;
ll const INF = 1ll<<61;
double pi = 3.141592653589793238;

int main() {
  ll d;
  cin >> d;
  if (d == 25) cout << "Christmas" << endl;
  if (d == 24) cout << "Christmas Eve" << endl;
  if (d == 23) cout << "Christmas Eve Eve" << endl;
  if (d == 22) cout << "Christmas Eve Eve Eve" << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define repi(i, x) \
	for (auto i = (x).begin(), i##_fin = (x).end(); i != i##_fin; i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
string solve(bool a) { return ((a) ? "Yes" : "No"); }
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int, int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long, long long> P;
typedef vector<P> VP;
template <class T>
inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return 1;
	}
	return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return 1;
	}
	return 0;
}
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
	os << "{";
	rep(i, v.size()) {
		if (i) os << ",";
		os << v[i];
	}
	os << "}";
	return os;
}
template <class T, class U>
istream& operator>>(istream& is, pair<T, U>& p) {
	is >> p.first >> p.second;
	return is;
}
template <class T>
istream& operator>>(istream& is, vector<T>& v) {
	rep(i, v.size()) { is >> v[i]; }
	return is;
}
const long long INFLL = 1LL << 60;
const int INF         = 1 << 30;
const double PI       = acos(-1);
// union by size + path having
class UnionFind {
public:
	vector<long long> par;  // 各元の親を表す配列
	vector<long long> siz;  // 素集合のサイズを表す配列(1 で初期化)

	// Constructor
	UnionFind(long long sz_) : par(sz_), siz(sz_, 1LL) {
		for (long long i = 0; i < sz_; ++i) par[i] = i;  // 初期では親は自分自身
	}
	void init(long long sz_) {
		par.resize(sz_);
		siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
		for (long long i = 0; i < sz_; ++i) par[i] = i;  // 初期では親は自分自身
	}
	// Member Function

	// Find
	long long root(long long x) {  // 根の検索
		while (par[x] != x) {
			x = par[x] = par[par[x]];  // x の親の親を x の親とする
		}
		return x;
	}
	// 結合(Unite, Merge)
	bool merge(long long x, long long y) {
		x = root(x);
		y = root(y);
		if (x == y) {
			return false;
		}
		// merge technique（データ構造をマージするテク．小を大にくっつける）
		if (siz[x] < siz[y]) {
			swap(x, y);
		}
		siz[x] += siz[y];
		par[y] = x;
		return true;
	}

	// 連結判定(つながっているときはture,つながっていなければfalse)
	bool issame(long long x, long long y) { return root(x) == root(y); }

	// 素集合のサイズ
	long long size(long long x) { return siz[root(x)]; }
};
int main() {
	int n, m;
	int ans = 0;
	cin >> n >> m;
	VPi path(m);
	cin >> path;
	UnionFind tri(n);
	for (int i = 0; i < m; i++) {
		tri.init(n);
		rep(j, m) {
			if (j == i) continue;
			tri.merge(path[j].F-1, path[j].S-1);
		}
		ans += (tri.size(0) != n);
	}
	cout << ans << endl;
}

Measured memory_bytes: 3516
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif




#define int long long
#define rng(i,l,r) for(size_t i=(l);i<(r);++i)
#define rep(i,n) rng(i,0,n)
#define gnr(i,l,r) for(size_t i=(r)-1;i>=(l);i--)
#define per(i,b) gnr(i,0,b)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()

using namespace std;
//using ll = long long;


const int MOD = 1000000007;
const int INF = 1e18;

const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1,1,0,-1,-1,-1,0,1};
const int dy8[8] = {0,1,1,1,0,-1,-1,-1};

const double pi = acos(-1);



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


using Graph = vector<vector<int>>;


void solve(){
    
    // remove the bottom 3 lines when you submit this code.
    std::ifstream in("sample.txt");
    std::cin.rdbuf(in.rdbuf());

    cin.tie(0);
    ios::sync_with_stdio(false);
    
    
    int n,m; cin >> n >> m;
    int L[100010];
    int R[100010];
    
    
    for (int i = 0; i < m; i++) cin >> L[i] >> R[i];
    
    
    int maxL = -1;
    int minR = INF;
    
    for (int i = 0; i < m; i++) {
        maxL = max(maxL,L[i]);
        minR = min(minR,R[i]);
    }
    
    cout << ((minR-maxL>=0)?minR-maxL+1:0) << endl;
    
    
    
    
    
    
}



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



Measured memory_bytes: 1792
n,t = map(int,input().split())
l = []

for j in range(n):
    l.append([int(i) for i in input().split()])

c = 1001
c_i = -1

for i in range(n):
    # print('check',l[i])
    if l[i][1] <= t:
        # print('clear condition of time')
        if l[i][0] < c:
            # print('clear condition of cost')
            c = l[i][0]
            c_i = i
            # print(l[c_i],'is top now')

if c_i != -1:
    print(l[c_i][0])
else:
    print('TLE')

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

using ll = long long;

// 区間の情報を二分木で管理
struct LazySegmentTree{
    // 配列サイズを 2 べきにしたときのサイズ
    int sz;
    // 1-indexed で管理
    vector<ll> data;
    vector<ll> lazy;

    LazySegmentTree(int n){
        sz = 1;
        while(sz < n)   sz <<= 1;
        data.assign(sz << 1, 0);
        lazy.assign(sz << 1, 0);
    }

    void set(int idx, const int& x){
        data[idx + sz] = x;
    }

    // k : セグメント木上のインデックス
    //     (set された配列のどの区間かを表す)
    void build(){
        for(int k = sz - 1; k >= 0; --k){
            data[k] = max(data[k << 1], data[k << 1 | 1]);
        }
    }

    // 子ノードへの伝播
    void propagate(int k){
        if(lazy[k] == 0)    return;

        if(k < sz){
            lazy[k << 1] += lazy[k];
            lazy[k << 1 | 1] += lazy[k];
        }
        data[k] += lazy[k];
        lazy[k] = 0;
    }

    // [a, b) の各要素に対して x を一様加算
    ll update(int a, int b, const ll x, int k = 1, int l = 0, int r = -1){
        if(r == -1) r = sz;
        
        propagate(k);

        // 更新する範囲が今見ている区間内にない
        if(b <= l || r <= a)    return data[k];

        // 更新する区間が今見ている区間を内包している
        else if(a <= l && r <= b){
            lazy[k] += x;
            propagate(k);
            return data[k];     // 子ノードの更新は遅延させる
        }

        else{
            return data[k] = max(update(a, b, x, k << 1, l, (l + r) >> 1),
                                update(a, b, x, k << 1 | 1, (l + r) >> 1, r));
        }
    }

    // [a, b) における最大値を取得
    ll query(int a, int b, int k = 1, int l = 0, int r = -1){
        if(r == -1) r = sz;
        
        propagate(k);
        
        if(b <= l || r <= a)    return 0;
        else if(a <= l && r <= b)   return data[k];
        else{
            return max(query(a, b, k << 1, l, (l + r) >> 1),
                        query(a, b, k << 1 | 1, (l + r) >> 1, r));
        }
    }

    ll operator[](const int& idx){
        return query(idx, idx + 1);
    }
};

int main(){
    int n, m;
    cin >> n >> m;
    vector<vector<pair<int, int>>> table(n + 1);
    for(int i = 0; i < m; ++i){
        int l, r, a;
        cin >> l >> r >> a;
        table[r].emplace_back(l, a);
    }
    LazySegmentTree dp(n + 1);
    for(int i = 1; i <= n; ++i){
        dp.update(i, i + 1, dp.query(0, i));
        for(auto p : table[i]){
            int l = p.first;
            ll a = p.second;
            dp.update(l, i + 1, a);
        }
    }
    cout << dp.query(0, n + 1) << endl;
}

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

using namespace std;

int n,i,j,par[100005],go[100005],siz[100005];
vector <int> edge[100005];
bool mark[100005];

void pre(int id, int p){
	par[id] = p;
	siz[id] = 1;
	
	for(int k = 0; k < edge[id].size(); k++){
		int to = edge[id][k];
		if(to == p) continue;
		
		pre(to, id);
		siz[id] += siz[to];
		
		if(mark[to]){
			mark[id] = 1;
			go[id] = to;
		}
	}
	
	if(id == n) mark[id] = 1;
}

int main(){
	scanf("%d", &n);
	
	for(i = 0; i < n - 1; i++){
		int x,y;
		scanf("%d%d", &x, &y);
		edge[x].push_back(y);
		edge[y].push_back(x);
	}
	
	pre(1, -1);
	
	int l = 1;
	int r = n;
	int sizl = 0;
	int sizr = 0;
	bool turn = 0;
	
	while(true){
		if(turn == 0){
			if(go[l] == r) break;
			l = go[l];
		}
		else{
			if(par[r] == l) break;
			r = par[r];
		}
		turn ^= 1;
	}
	
	sizr = siz[r];
	sizl = siz[1] - sizr;
	
	if(turn == 0){
		if(sizl > sizr)
		printf("Fennec\n");
		else
		printf("Snuke\n");
	}
	else{
		if(sizl > sizr)
		printf("Fennec\n");
		else
		printf("Snuke\n");
	}
}


Measured memory_bytes: 14848
#include "bits/stdc++.h"

using namespace std;

void solve()
{
	int N;
	string S;
	cin >> N >> S;
	vector<int> ws(N+1), es(N+1);
	for (int i = 0; i < N; i++)
	{
		ws[i+1] = ws[i] + (S[i] == 'W');
	}
	for (int i = N-1; i >= 0; i--)
	{
		es[i] = es[i+1] + (S[i+1] == 'E');
	}
	int ans = N;
	for (int i = 0; i < N; i++)
	{
		ans = min(ans, es[i]+ws[i]);
	}
	cout << ans << endl;
}

int main(void)
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 3076
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <map>
#include <vector>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;

int main() {
    int n, r;
    char s;
    std::map<char, int> mark{{'S', 0}, {'H', 1}, {'C', 2}, {'D', 3}};
    string revm = "SHCD";

    cin >> n;
    vector<vector<bool>> deck(4, vector<bool>(13, true));
    rep(i, n) {
        cin >> s >> r;
        deck[mark.at(s)][r - 1] = false;
    }
    rep(i, 4) rep(j, 13) {
        if(deck[i][j]) {
            cout << revm.at(i) << " " << j + 1 << endl;
        }
    }
}



Measured memory_bytes: 3156
H, W = [int(x) for x in input().split()]

if H % 3 == 0 or W % 3 == 0:
	ans = 0
else:
	ans1 = min(H, W)
	if H % 2 == 0:
		ans2 = max((W // 3 + 1) * H, H // 2 * (W - W // 3 - 1)) - min((W // 3 + 1) * H, H // 2 * (W - W // 3 - 1))
		ans3 = max(W // 3 * H, H // 2 * (W - W // 3)) - min(W // 3 * H, H // 2 * (W - W // 3))
	else: 
		ans2 = max((W // 3 + 1) * H, H // 2 * (W - W // 3 - 1), (H // 2 + 1) * (W - W // 3 - 1)) - min((W // 3 + 1) * H, H // 2 * (W - W // 3 - 1), (H // 2 + 1) * (W - W // 3 - 1))
		ans3 = max(W // 3 * H, H // 2 * (W - W // 3), (H // 2 + 1) * (W - W // 3)) - min(W // 3 * H, H // 2 * (W - W // 3), (H // 2 + 1) * (W - W // 3))
	if W % 2 == 0:
		ans4 = max((H // 3 + 1) * W, W // 2 * (H - H // 3 - 1)) - min((H // 3 + 1) * W, W // 2 * (H - H // 3 - 1))
		ans5 = max(H // 3 * W, W // 2 * (H - H // 3)) - min(H // 3 * W, W // 2 * (H - H // 3))
	else:
		ans4 = max((H // 3 + 1) * W, W // 2 * (H - H // 3 - 1), (W // 2 + 1) * (H - H // 3 - 1)) - min((H // 3 + 1) * W, W // 2 * (H - H // 3 - 1), (W // 2 + 1) * (H - H // 3 - 1))
		ans5 = max(H // 3 * W, W // 2 * (H - H // 3), (W // 2 + 1) * (H - H // 3)) - min(H // 3 * W, W // 2 * (H - H // 3), (W // 2 + 1) * (H - H // 3))
	ans = min(ans1, ans2, ans3, ans4, ans5)

print(ans)
	

Measured memory_bytes: 3192
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
int n;
int main() {
	int i, j, k;
	int s0 = 0, s1 = 0, s2 = 0;
	scanf("%d", &n);
	for(i = 1; i <= n; i++){
		int x;
		scanf("%d", &x);
		int ss = 0;
		while(x%2 == 0) ss++, x /= 2;
		if(ss == 0) s0++;
		else if(ss == 1) s1++;
		else s2++;
	}
	if(s0 == 0 && s2 == 0){ printf("Yes\n"); return 0; }
	if(s1) s0++;
	if(s0-s2 > 1) printf("No\n");
	else printf("Yes\n");
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, 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;}

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

int main(){
  int n; cin >> n;
  vector<int> a(n); rep(i, n) cin >> a[i];

  vector<int> ans;
  ans.push_back(a[0]);
  for (int i = 1; i < n; ++i){
    if (i % 2 == 0) ans.insert(ans.begin(), a[i]);
    else ans.push_back(a[i]);
  }
  if (n % 2 == 0) reverse(ans.begin(), ans.end());
  rep(i, n) cout << ans[i] << " ";
  cout << endl;
}


Measured memory_bytes: 3828
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define eps 1e-13
#define PI 3.14159265359
#define sp printf(" ")
#define vi vector<int>
#define vl vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pcc pair<char, char>
#define mp make_pair
#define FF first
#define SS second
#define pb(x) push_back(x)
#define sd(x) scanf("%d", &(x))
#define pd(x) printf("%d", (x))
#define pdn(x) printf("%d\n", (x))
#define sld(x) scanf("%ld", &(x))
#define pld(x) printf("%ld", (x))
#define pldn(x) printf("%ld\n", (x))
#define slf(x) scanf("%lf", &(x))
#define plf(x) printf("%.9lf", (x))
#define plfn(x) printf("%.9lf\n", (x))
#define sch(x) scanf("%c", &(x))
#define pch(x) printf("%c", (x))
#define pchn(x) printf("%c\n", (x))
#define gtl(x) getline(cin, (x))
#define flsh fflush(stdout)
#define sws ios::sync_with_stdio(false); cin.tie(0)
#define endl '\n'
int main()
{
    string s;
    cin>>s;
    for(long i=0;i<s.size();i++)
    {
        if(s[i]==',')cout<<" ";
        else cout<<s[i];
    }
    cout<<endl;




}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int X;
  cin>>X;
  int number;
  vector<int> vec(2);
  int MAX=0;
  
  if(X<4)
    cout<<1<<endl;
  else{
  for(int i=2;i<sqrt(X)+1;i++){
    number=i;
  	for(int j=0;j<10;j++){
    	number=number*i;
      if(number>X){
      	number=number/i;
        break;
      }
      MAX=max(number,MAX);
    }
  }
  cout<<MAX<<endl;
  }
}

Measured memory_bytes: 256
N, K = 3, 4
ARR = [
    [1, 1],
    [2, 2],
    [3, 3],
]

# N,K = 10, 500000
# ARR = [
#     [1, 100000],
#     [1, 100000],
#     [1, 100000],
#     [1, 100000],
#     [1, 100000],
#     [100000, 100000],
#     [100000, 100000],
#     [100000, 100000],
#     [100000, 100000],
#     [100000, 100000]
# ]

N, K = map(int, input().split())
ARR = []
for i in range(N):
    ARR.append(list(map(int,input().split())))

def calculate(n, k, arr):
    dict = {}
    for ar in arr:
        if dict.get(int(ar[0])) == None:
            dict.__setitem__(int(ar[0]), int(ar[1]))
        else:
            dict.__setitem__(int(ar[0]), dict.__getitem__(ar[0]) + ar[1])

    kkk = 0
    for key in sorted(dict.keys()):
        kkk = kkk + dict.get(key)
        if kkk >= k:
            print(key)
            break


calculate(N, K, ARR)


Measured memory_bytes: 32484
/*Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.

My little horse must think it queer
To stop without a farmhouse near
Between the woods and frozen lake
The darkest evening of the year.

He gives his harness bells a shake
To ask if there is some mistake.
The only other sound’s the sweep
Of easy wind and downy flake.

The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.*/

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
const int maxn= 100010;
lli a[55];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=0,k=0;lli res=0ll;
    cin>>n>>k;
    for(int i=0;i<n;++i)
        cin>>a[i];
    for(int i=0;i<=min(n,k);++i)
        for(int j=0;(i+j)<=min(n,k);++j)
        {
            vector<lli> aux;
            lli temp=0ll;
            for(int l=0;l<i;++l)
            {
                aux.pb(a[l]);
                temp+=a[l];
            }
            for(int l=0;l<j;++l)
            {
                aux.pb(a[n-l-1]);
                temp+=a[n-l-1];
            }
            sort(aux.begin(),aux.end());
            for(int l=0;l<min(k-i-j,(int)aux.size());++l)
                if(aux[l]<0)
                    temp-=aux[l];
            res=max(res,temp);
        }
    cout<<res<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pi;
#define trace3(x, y, z) cerr << #x << ": " << x << ", " << #y < ": " << y << ", " << #z << ": " << z << endl;
#define all(v) v.begin(), v.end()
#define MOD 998244353

int main() {
	int n, s;
	cin >> n >> s;
	vi a(n + 1);
	for(int i = 1; i <= n; i++) cin >> a[i];
	vvll dp(n + 1, vll(s + 1, 0)), dpsum(n + 1, vll(s + 1, 0));
	for(int i = 1; i <= n; i++) {
		for(int j = 0; j <= s; j++) {
			if(a[i] == j) {
				dp[i][j] = i;
			}
			else if(a[i] < j) {
				dp[i][j] = dpsum[i - 1][j - a[i]];
			}
			(dpsum[i][j] = dpsum[i - 1][j] + dp[i][j]) %= MOD;
		}
	}
	ll ans = 0;
	for(int i = 1; i <= n; i++) {
		(ans += dp[i][s] * (n - i + 1)) %= MOD;
	}
	cout << ans << endl;
}

Measured memory_bytes: 141184
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <bitset>
#include <tuple>
#include <stack>
#include <utility>

using namespace std;
typedef long long ll;

int main(){
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int dx = x2 - x1, dy = y2 - y1;
    int x3 = x2 - dy, y3 = y2 + dx;
    int x4 = x3 - dx, y4 = y3 - dy;
    cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
    return 0;
}

Measured memory_bytes: 256
x,k,d= map(int,input().split())
if x<0:
    x= -1*x

if x>= k*d:
    print(x-k*d)
else:
    y= k -(x//d)
    if y% 2==0:
        print(x%d)
    else:
        print(d-(x%d))

Measured memory_bytes: 9180
X = int(input())

num = X // 100 + 1
calc = X % 100

for a in range(num):
    for b in range(num - a):
        for c in range(num - a - b):
            for d in range(num - a - b - c):
                for e in range(num - a - b - c - d):
                    for f in range(num - a - b - c - d - e):
                        if calc == 0*a + 1*b + 2*c + 3*d + 4*e + 5*f:
                            print(1)
                            exit()


print(0)

Measured memory_bytes: 9088
#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

int dfs(string str){
    if(str==""||str=="i"||str=="w")
        return 0;
    if(str[0]=='i')
        return ((str[str.size()-1]=='i')?0:1)+(dfs(str.substr(1,str.size()-2)));
    else if(str[0]=='w')
        return ((str[str.size()-1]=='w')?0:1)+dfs(str.substr(1,str.size()-2));
    else if(str[0]=='(')
        return ((str[str.size()-1]==')')?0:1)+dfs(str.substr(1,str.size()-2));
    else if(str[0]==')')
        return ((str[str.size()-1]=='(')?0:1)+dfs(str.substr(1,str.size()-2));
    return dfs(str.substr(1,str.size()-2))+1;
}

int main(){

    string str;
    cin>>str;
    cout<<dfs(str)<<endl;

    return 0;
}

Measured memory_bytes: 0
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt(),b = sc.nextInt(),c = sc.nextInt();
    int result = 0;
    int ans = 0;
    for(int i = 0;i < b;i++){
      result = (a * i) % b;
      if(result == c){
        ans = 1;
        break;
      }
    }
    if(ans == 1){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  }
}


Measured memory_bytes: 21844
#include<iostream>
#include<cmath>
#include<string>
#include<cstdlib>
#include<ctime>
#include<map>
#include<vector>
#include<list>
#include<set>
#include<string>
using namespace std;

#define ll long long
#define ld long double
#define uint unsigned int
#define alloc(n,type) (type*)calloc(n,sizeof(type))
#define MODULE 1
#define RAND(min,max) (rand()%(max-min+1)+min)
#define repeat(i,condition) for(int i = 0; condition; i++)
#define LOG(log) cout<<#log<<" : "<<log<<'\n'
#define DEBUG() {cout<<"DEBUG "<<num_debug<<'\n'; num_debug++;}
int num_debug = 0;
bool* IsPrime;
vector<int> Prime;

int compare_int(const void* a, const void* b);
void PrimeEnable(int n);
class Math;
class Module;

int main(void) {
	srand((unsigned)time(NULL));

	string s;
	cin >> s;
	
	//LOG(s[s.length()-1]);
	if (s[s.length()-1] == 's')
		s += "es";
	else
		s += "s";

	cout << s;
	return 0;
}

int compare_int(const void* a, const void* b) {
	//昇順
	return *(int*)a - *(int*)b;
}
void PrimeEnable(int n) {
	//initialize IsPrime
	IsPrime = (bool*)calloc(n + 1, sizeof(bool));
	for (int i = 0; i <= n; i++)
		IsPrime[i] = true;

	//IsPrime 
	IsPrime[0] = IsPrime[1] = false;
	for (int i = 2; i * i <= n; i++) {
		if (IsPrime[i])
			for (int j = i; i * j <= n; j++) {
				IsPrime[i * j] = false;
			}
	}

	//push back to Prime
	for (int i = 0; i <= n; i++) {
		if (IsPrime[i])
			Prime.push_back(i);
	}
}
class Math {
public:
	template<typename T> static T Fac(int n) {
		T ans = 1;
		for (int i = 2; i <= n; i++) {
			ans *= i;
		}
		return ans;
	}
public:
	template<typename Tout, typename Tin> static Tout P(Tin n, Tin r) {
		Tout ans = 1;
		for (Tin i = 0; i < r; i++) {
			ans *= n - i;
		}
		return ans;
	}
public:
	template<typename T>static T C(int n, int r) {
		T nmr = 1;
		T dnm = 1;
		if (n - r < r)
			r = n - r;
		for (int i = 0; i < r; i++) {
			nmr *= n - i;
			dnm *= r - i;
		}
		return nmr / dnm;
	}
};
class Module {
public:
	static const int mod = MODULE;

public:
	static int add(int a, int b) {
		long ans = (long)a + b;
		if (ans < 0)
			ans += mod;
		ans %= mod;
		return ans;
	}
public:
	static int mult(int a, int b) {
		long ans = (long)a * b;
		return ans % mod;
	}

public:
	static int Pow(int a, int b) {
		int base = a % mod;
		if (mod / 2 < abs(base))
			if (base < 0) {
				base += mod;  //negative
			}
			else {
				base -= mod;  //positive
			}

		return pow(base, b);
	}
};
//template name is "AtCoder_C++"

Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



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

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin>>n;
  int res=0;
  map<int,int>ma;
  rep(i,n)
  {
    int a;
    cin>>a;
    ma[a]++;
    ma[a-1]++;
    ma[a+1]++;
  }
  for(auto tp:ma)
  {
    chmax(res,tp.second);
  }
  cout<<res<<endl;
  return 0;

}


Measured memory_bytes: 4736
import sys
import numpy as np
import math


class remainder():
    def __init__(self, mod=(10**9 + 7)):
        self.mod = mod
    
    def add(self, a, b):
        
        return (a + b) % self.mod
    
    def sub(self, a, b):

        return (a + self.mod - b) % self.mod
    
    def mul(self, a, b):

        return ((a % self.mod) * (b % self.mod)) % self.mod

    def pow(self, a, b):
        bp = []
        #bp.append(1)
        bp.append(a)

        n = len(bin(b)) - 2
        for x in range(n):
            bp.append(bp[x]**2 % self.mod)

        res = 1
        for x in range(n):
            if b >> x & 1:
                res = (res * bp[x]) % self.mod
        
        return res

    def div(self, a, b):
        
        return self.mul(a, self.pow(b, self.mod - 2))

    def power(self, a, b):#?

        return self.pow(a % self.mod, b % (self.mod - 1)) % self.mod

    # Combination Part1
    ## 最初に十分に大きいfactorical, invFactoricalのテーブルを作って、様々なcomに対応
    def comInit(self, MAX=1000000):
        self.fac = [0] * MAX
        self.invFac = [0] * MAX
        self.inv = [0] * MAX
        
        self.fac[0] = self.fac[1] = 1
        self.invFac[0] = self.invFac[1] = 1
        self.inv[1] = 1

        for x in range(2, MAX):
            self.fac[x] = self.fac[x - 1] * x % self.mod
            self.inv[x] = self.mod - self.inv[self.mod % x] * (self.mod // x) % self.mod
            self.invFac[x] = self.invFac[x - 1] * self.inv[x] % self.mod
    
    def com(self, n, k):
        if (n < k):
            return 0

        if  (n < 0 or k < 0):
            return 0

        return self.fac[n] * (self.invFac[k] * self.invFac[n - k] % self.mod) % self.mod
    # Combination part2
    ## combinationのnの枠が決まっていたり、数回くらいしか計算しないなら、一気にテーブルと計算を行う
    
    # n,kが小さい時(2000程度),動的計画法で、nCkのテーブルを作る(mod pが素数でなくていい)   

    def dpComInit(self, MAX=2000):
        dpCom = [[0] * (MAX + 1) for _ in range(MAX + 1)]
        dpCom[0][0] = 1

        for i in range(1, MAX + 1):
            dpCom[i][0] = 1
            for j in range(1, MAX + 1):
                dpCom[i][j] = (dpCom[i - 1][j - 1] + dpCom[i - 1][j]) % self.mod

        return dpCom

re = remainder()
re.comInit()

X, Y = map(int, input().split())

if (X + Y) % 3 != 0:
    print(0)
    sys.exit()

# X = n + 2 * m
# Y = 2 * n + m

A = np.array([[1, 2],[2, 1]])
B = np.array([X, Y])

x = np.linalg.solve(A, B)

if np.where(x>=0, True, False).all():
    ans = re.com(int(x[0] + x[1]), int(x[0]))
    print(ans)

else:
    print(0)


Measured memory_bytes: 132812
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;

int main(void)
{
    int a,b;
    while(scanf("%d%d",&a,&b)==2)
    {
        if(a == 1)
            a = 14;
        if(b == 1)
            b = 14;
        if(a > b)
            printf("Alice\n");
        else if(a == b)
            printf("Draw\n");
        else
            printf("Bob\n");
    }

    return 0;
}


Measured memory_bytes: 256
from numpy import prod

n = int(input())

def solve(l:list):
  now = [i + 1 for i in range(n)]
  res = 0
  for i in range(n):
    res += now.index(l[i]) * prod([j+1 for j in range(len(now)-1)])
    now.remove(l[i])
  return res

l_p = list(map(int, input().split()))
l_q = list(map(int, input().split()))

print(int(abs(solve(l_p) - solve(l_q))))


Measured memory_bytes: 12480
#include <bits/stdc++.h>
using namespace std;
long long mod(long long a){
  if(a<0)
    a=-a;
  return a;
}
int main(){
  long long n,k;
  cin>>n>>k;
  long long h[n];
  for(long long i=0;i<n;i++){
    cin>>h[i];
  }
  long long b[n];
  b[0]=0;
  for(long long i=1;i<n;i++){
  		b[i]=mod(h[i]-h[i-1])+b[i-1];
    	for(long long j=i-2;j>=i-k&&j>=0;j--){
   			b[i]=min(b[i],mod(h[i]-h[j])+b[j]);     
        }
  }
  cout<<b[n-1];
}

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

#define PI 3.14159265359
#define rep(i,a,n) for(int i=a;i<(int)n;++i)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define descsort(a) sort(a.begin(),a.end(),std::greater<int>())
using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;

int main(void)
{
    int a,b;
    cin>>a>>b;
    if(a+b==15)cout<<"+"<<endl;
    else if(a*b==15)cout<<"*"<<endl;
    else cout<<"x"<<endl;
    return 0;
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=1000000007,MAX=200000005,INF=1<<30;

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N,K;cin>>N>>K;
    string S;cin>>S;
    
    char ma='{';
    
    for(int i=0;i<N;i++){
        chmin(ma,S[i]);
    }
    
    for(int i=0;i<K;i++){
        
        string T=S;
        reverse(all(S));
        T+=S;
        reverse(all(S));
        
        if(i==K-1){
            string ans=S;
            for(int j=0;j<=N;j++){
                string U=T.substr(j,N);
                chmin(ans,U);
            }
            cout<<ans<<endl;
            return 0;
        }else{
            reverse(all(T));
            string to(N,'z');
            
            for(int j=0;j<=N;j++){
                string U=T.substr(j,N);
                chmin(to,U);
            }
            bool check=true;
            for(int j=0;j<N;j++) if(to[j]!=ma) check=false;
            if(check) break;
            S=to;
            reverse(all(S));
        }
    }
    
    for(int i=0;i<N;i++) cout<<ma;
    cout<<endl;
}



Measured memory_bytes: 384
#include <bits/stdc++.h>
#define pb push_back
#define Int long long
using namespace std;

const int MAXN=500005;
const int NAX=1005;
const long long  MOD=(long long)(1e9+7);

Int N,M,K;
Int X,Y,Z;
Int H,W;
Int perform(Int x){
    return (x*(x+1))/2LL;
}
vector<Int> A;
vector<int> adj[MAXN];
using D=long double;

bool inRange(Int a,Int b){
    return a*b<=0;
}

long long ModExpo(long long x,unsigned long long y,long long M){
    Int ans=1;
    ans=(long long)ans;
    
    while(y>0){
        if(y&1) ans=((ans%M)*(x%M))%M;
        y>>=1LL;
        x=((x%M)*(x%M))%M;
    }
    return ans%M;
}
long long dp[MAXN];
long long C[1000005];
Int solve(Int N){
    if(N<0) return 0;
    if(N==0) return 1;
    if(dp[N]!=-1) return dp[N];
    Int ans=0;
    for(int i=3;i<=N;++i){
        ans=(ans+solve(N-i))%MOD;
    }
    return dp[N]=ans;
}

void compute(){
        C[0]=0;
        for(int i=1;i<1000005;++i) C[i]=(C[i-1]+i-1)%MOD;
    }
int main()
{
    cin>>N;
    Int ans=ModExpo(10LL,N,MOD);
    Int sub=ModExpo(9LL,N,MOD);
    Int more=ModExpo(8LL,N,MOD);
    Int netAdd=((more%MOD)-(2*sub%MOD)+MOD)%MOD;
    ans=((ans%MOD)+(netAdd%MOD))%MOD;
    cout<<ans%MOD<<"\n";
}


Measured memory_bytes: 15412
/*
  Contest 079
  A - Good Integer
  Rakesh Kumar --> 13/09/2020
 */

#include <bits/stdc++.h>

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

    std::string s;
    std::getline(std::cin, s);
    if ((s[0] == s[1] &&
         s[1] == s[2] &&
         s[0] == s[2]) ||
        (s[1] == s[2] &&
         s[2] == s[3] &&
         s[1] == s[3]))
        std::cout << "Yes" << std::endl;
    else
        std::cout << "No" << std::endl;

    return 0;
}


Measured memory_bytes: 3648
n = int(input())
a = list(map(int, list(input().split())))

a1 = 0

for i in range(n):
    if i % 2 == 0:
        a1 = a1 + a[i]
    else:
        a1 = a1 - a[i]

answer = []
nowa = a1
for i in range(n):
    if i != 0:
        nowa = 2 * a[i - 1] - nowa
    answer.append(nowa)

print(" ".join(list(map(str, answer))))

Measured memory_bytes: 19144
import java.io.*;

public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        long X = Long.parseLong (reader.readLine());
        long cur = 100L;
        int ans = 0;
        while (cur < X) {
            cur += cur / 100;
            ans++;
        }
        System.out.println (ans);
        return;
    }
}

Measured memory_bytes: 32384
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const ll dx[4] = { 0, -1, 1, 0 };
const ll dy[4] = { -1, 0, 0, 1 };
const int INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}
void mul(ll a, ll b) {
	a = a * b % INF;
}
using Graph = vector<vector<int>>;
ll mypow(ll x, ll n, ll m) {
	if (n == 0) {
		return 1;
	}
	if (n % 2 == 0) {
		return mypow(x*x%m, n / 2, m);
	}
	else {
		return x * mypow(x, n - 1, m) % m;
	}
}
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
const int MAX = 510000;
ll fac[MAX], finv[MAX], inv[MAX];
//テーブルをつくる前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;//mod pにおける1,2,,,nの逆元
	for (int i = 2; i < MAX; ++i) {
		fac[i] = fac[i - 1] * i%INF;
		inv[i] = INF - inv[INF%i] * (INF / i) % INF;
		finv[i] = finv[i - 1] * inv[i] % INF;
	}
}

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


int main() {
	int n; cin >> n;
	if (n <= 3) {
		cout << 0 << endl;
		return 0;
	}
	string s; cin >> s;
	vector<int>cntr, cntg, cntb;
	cntr.push_back(0);
	cntg.push_back(0);
	cntb.push_back(0);
	for (int i = 0; i < n; ++i) {
		if (s[i] == 'R') {
			cntr.push_back(cntr[i] + 1);
			cntg.push_back(cntg[i]);
			cntb.push_back(cntb[i]);
		}
		else if (s[i] == 'G') {
			cntr.push_back(cntr[i]);
			cntg.push_back(cntg[i] + 1);
			cntb.push_back(cntb[i]);
		}
		else {
			cntr.push_back(cntr[i]);
			cntg.push_back(cntg[i]);
			cntb.push_back(cntb[i] + 1);
		}
	}
	ll sum = 0;
	for (int i = 1; i <= n - 2; ++i) {
		if (s[i] == 'R') {
			sum += cntg[i] * (cntb[n] - cntb[i + 1]);
			sum += cntb[i] * (cntg[n] - cntg[i + 1]);
			for (int j = 1; i - j >= 0 && i + j < n; ++j) {
				if (s[i - j] != 'R'&&s[i + j] != 'R'&&s[i - j] != s[i + j]) {
					sum -= 1;
				}
			}
		}
		else if (s[i] == 'G') {
			sum += cntr[i] * (cntb[n] - cntb[i + 1]);
			sum += cntb[i] * (cntr[n] - cntr[i + 1]);
			for (int j = 1; i - j >= 0 && i + j < n; ++j) {
				if (s[i - j] != 'G'&&s[i + j] != 'G'&&s[i - j] != s[i + j]) {
					sum -= 1;
				}
			}
		}
		else {
			sum += cntr[i] * (cntg[n] - cntg[i + 1]);
			sum += cntg[i] * (cntr[n] - cntr[i + 1]);
			for (int j = 1; i - j >= 0 && i + j < n; ++j) {
				if (s[i - j] != 'B'&&s[i + j] != 'B'&&s[i - j] != s[i + j]) {
					sum -= 1;
				}
			}
		}
	}
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 3708
#include <stdio.h>

int main(void){
  int a, b, d, r;
  double f;

  scanf("%d%d", &a, &b);
  d = a / b;
  r = a % b;
  f = (double)a / b;
  printf("%d %d %f\n", d, r, f);
  return 0;
}

Measured memory_bytes: 636
s = list(str(input()))
t = list(str(input()))

s.sort()
t.sort()
t.reverse()

def cond1(s,t):
    n = len(s)
    m = len(t)
    if(n >= m):
        return False
    else:
        for i in range(n):
            if(ord(s[i]) != ord(t[i])):
                return False
        return True

def cond2(s,t):
    m = min(len(s),len(t))
    for i in range(m):
        if(ord(s[i]) < ord(t[i])):
            return True
        elif(ord(s[i]) > ord(t[i])):
            return False
    return False

ans = (cond1(s,t) or cond2(s,t))

if(ans):
    print("Yes")
else:
    print("No")

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) begin(v), end(v)

using int64 = long long;
const int INF = 1 << 30;
const int mod = 1e9 + 7;


int main()
{
  string s, t;
  cin >> s >> t;
  sort(all(s));
  sort(all(t));
  reverse(all(t));
  if(s < t) puts("Yes");
  else puts("No");
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double b = sc.nextDouble();
        Long c = (long) (a /b);
        Long d = (long) (a % b);
        double e = a / b;
        System.out.println(c + " " + d + " " + String.format("%.8f", e));
    }

}



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

int main(){
  vector<int> N={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

  int K;
  cin >> K;
  int ans = N.at(K-1);

  cout << ans << endl;
}

Measured memory_bytes: 256