akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<map>
#include<unordered_map>
#include<set>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<queue>
#include<stack>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef long double ld;
#define mp make_pair
#define pb push_back

#define rep(i, N) for(ll i = 0; i < N; i++)
#define repa(i, a, N) for(ll i = a; i < N; i++)
#define repr(i, N) for(ll i = N-1; i >= 0; i--)

#define drep(i, N, j, M) rep(i, N) rep(j, M)
#define trep(i, N, j, M, k, L) rep(i, N) rep(j, M) rep(k, L)

#define all(A) A.begin(), A.end()

const ll mod = 1e9 + 7;
// const ll mod = 998244353;

const ll LLMAX = numeric_limits<long long>::max();

void No() {
	cout << "No" << endl;
}

void Yes() {
	cout << "Yes" << endl;
}

ll id(char c) {
	return c - 'a';
}

template<class t, class u>
ostream& operator<<(ostream& os, const pair<t, u>& p) {
	return os << "{" << p.first << "," << p.second << "}";
}

template<class t> ostream& operator<<(ostream& os, const vector<t>& v) {
	os << "{";
	for (auto e : v)os << e << ",";
	return os << "}";
}

int main() {
	ll N;
	cin >> N;

	vector<pii> pair;

	rep(i, N) {
		ll a; cin >> a;
		pair.pb(mp(a, i + 1));
	}

	sort(all(pair));

	rep(i, N) {
		cout << pair[i].second << " ";
	}

	cout << endl;
	return 0;
}

Measured memory_bytes: 1780
#include<iostream>
#include<ios>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<vector>

#define ll long long

using namespace std;

const int INF = 1000;

int n; 
vector<string> S;
vector<int> c_num;
vector<int> c_min(26, INF);

int main()
{
    cin >> n;
    S.resize(n);
    c_num.resize(26);
    for (int i=0; i<n; i++) {

        for (int j=0; j<26; j++) {
            c_num[j] = 0;
        }

        cin >> S[i];

        for (int j=0; j<S[i].size(); j++) {
            c_num[S[i][j] - 'a']++;
        }

        for (int j=0; j<26; j++) {
            if (c_num[j] < c_min[j]) {
                c_min[j] = c_num[j];
            }
        }
    }

    for (int i=0; i<26; i++) {
        if (c_min[i] > 0) {
            char out = static_cast<char>(i + 'a');
            for (int j=0; j<c_min[i]; j++) {
                cout << out;
            }
        }
    }

    cout << endl;

    return 0;
}

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

int main() {
    int n;
    cin >> n;
    vvi color(3, vi(n));
    string s;
    cin >> s;
    rep(i, n){
        if(i) {
            rep(j, 3) {
                color[j][i] = color[j][i-1];
            }
        }
        if(s[i] == 'R') {
            ++color[0][i];
        }
        if(s[i] == 'G') {
            ++color[1][i];
        }
        if(s[i] == 'B') {
            ++color[2][i];
        }
    }
    ll ans = 0;
    for(int i=n-1; i>0; --i) {
        for(int j=n-1; j>i; --j) {
            if((s[i] == 'G' && s[j] == 'B') || (s[i] == 'B' && s[j] == 'G')) {
                ans += color[0][i-1];
            }
            if((s[i] == 'R' && s[j] == 'B') || (s[i] == 'B' && s[j] == 'R')) {
                ans += color[1][i-1];
            }
            if((s[i] == 'G' && s[j] == 'R') || (s[i] == 'R' && s[j] == 'G')) {
                ans += color[2][i-1];
            }
            if(j-i <= i && s[i] != s[j] && s[i] != s[2*i-j] && s[j] != s[2*i-j]){
                --ans;
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 3644
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int d = sc.nextInt();
        int n = sc.nextInt();

        if (n == 100)
            n = 101;
        
        if (d == 0)
            System.out.print(n);
        else if (d == 1)
            System.out.print(n * 100);
        else if (d == 2)
            System.out.print(n * 10000);
    }
}


Measured memory_bytes: 25300
/**
 *    author:  FromDihPout
 *    created: 2020-08-11
**/

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


bool check(vector<int> &dist, int mx, int target) {
    if (mx < abs(target)) return false;
    if (mx == abs(target)) return true;
    
    int range = mx * 2 + 1;
    vector<bool> prev(range);
    prev[mx] = true;
    for (int i = 0; i < dist.size(); i++) {
        vector<bool> pos(range);
        for (int j = 0; j < range; j++) {
            if (prev[j]) {
                pos[j - dist[i]] = true;
                pos[j + dist[i]] = true;
            }
        }
        prev = pos;
    }
    if (prev[target + mx]) return true;
    else return false;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s;
    int x, y;
    cin >> s >> x >> y;
    
    vector<int> dx, dy;
    int i = 0;
    for (i = 0; i < s.length() && s[i] == 'F'; i++) {
        x--;
    }
    bool xdir = true;
    int cnt = 0, mx_x = 0, mx_y = 0;
    for (; i < s.length(); i++) {
        if (s[i] == 'T') {
            if (xdir && cnt > 0) {
                dx.push_back(cnt);
                mx_x += cnt;
            }
            else if (!xdir && cnt > 0) {
                dy.push_back(cnt);
                mx_y += cnt;
            }
            xdir = !xdir;
            cnt = 0;
        }
        else {
            cnt++;
        }
    }
    if (xdir && cnt > 0) {
        dx.push_back(cnt);
        mx_x += cnt;
    }
    else if (!xdir && cnt > 0) {
        dy.push_back(cnt);
        mx_y += cnt;
    }
    
    if (check(dx, mx_x, x) && check(dy, mx_y, y)) {
        cout << "Yes" << '\n';
    }
    else {
        cout << "No" << '\n';
    }
    return 0;
}

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

int main(void)
{
   int n, d, x[10][10], i, f, j, s, g, z=0;

   scanf("%d%d",&n,&d);
   for(i=0;i<n;i++)
      for(f=0;f<d;f++)
         scanf("%d",&x[i][f]);

   for(i=0;i<n-1;i++)
      for(f=i+1;f<n;f++){
         s=0;
         for(j=0;j<d;j++)
            s+=pow(x[i][j]-x[f][j],2.0);
         g=sqrt(s);
         if(s==pow(g,2.0))
            z++;
      }

   printf("%d\n",z);
   return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <random>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
typedef map<int, int> mii;
typedef set<int> si;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define STLL(s) strtoll(s.c_str(), NULL, 10)
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int
#define endl '\n';
#define fi first
#define se second
#define NONVOID [[nodiscard]]
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;}
inline string getline(){string s; getline(cin,s); return s;}
inline void yn(const bool b){b?fin("yes"):fin("no");}
inline void Yn(const bool b){b?fin("Yes"):fin("No");}
inline void YN(const bool b){b?fin("YES"):fin("NO");}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;



int main() {
    
    int n,m;
    cin>>n;
    vi v(n);
    rep(i,n)cin>>v[i];
    cin>>m;
    vi w(m);
    rep(i,m)cin>>w[i];

    if(v<w){
        fin(1);
    }else fin(0);
}




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

using namespace std;

const int maxn = 1e5 + 10;
int n,a[maxn],dp[maxn],k;

int main(){
	cin >> n >> k;
	for(int i = 0 ; i<n ; i++){
		cin >> a[i];
	}
	dp[0] = 0;
	dp[1] = abs(a[0]-a[1]);
	for(int i = 2 ; i<n ; i++){
		dp[i] = (dp[i-1] + abs(a[i]-a[i-1]));
		for(int j = i-2 ; j>=0 and j>=i-k ; j--){
			if(dp[j] + abs(a[i]-a[j]) < dp[i]){
				dp[i] = dp[j] + abs(a[i]-a[j]);
			}
		}
	}
	cout << dp[n-1] << endl;
}
	
	
	


Measured memory_bytes: 1024
#define _USE_MATH_DEFINES
#include  <iostream>
#include  <algorithm>
#include  <climits>
#include  <vector>
#include  <string>
#include  <cstring>
#include  <stack>
#include  <queue>
#include  <cmath>
#include  <iomanip>
#include  <set>
#include  <map>
#include  <new>
#include <cstdint>
#include <cctype>
using namespace std;
#define rep(i,n)  for(int i = 0; i < n; i++)
#define lrep(i,n,m)  for(int i = n; i < m; i++)

using ll = long long;
using Vii = vector<vector<int> >;
using Gjudge = vector<vector<bool>>;
using Vi = vector<int>;
using Vl = vector<ll>;
using Vll = vector<vector<ll> >;
using Vs = vector<string>;
using Vb = vector<bool>;
using the = pair<int, int>;
using lthe = pair<ll, ll>;

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

const int Mod = static_cast<int>(1e9 + 7);
const int INF = INT_MAX;
const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };


int main()
{
	int n, k;
	cin >> n >> k;
	Vi A(n);
	rep(i, n)  cin >> A[i];

	if (k >= 50) {
		rep(i, n) {
			if (i)  cout << " " << n;
			else  cout << n;
		}
		cout << endl;
		return 0;
	}

	
	for (int i = 0; i < k; i++) {
		Vi B(n, 0);
		for (int j = 0; j < n; j++) {
			int l = max(0, j - A[j]);
			int r = min(n - 1, j + A[j]);
			B[l]++;
			if (r + 1 <= n - 1)  B[r + 1]--;
		}
		for (int i = 1; i < n; i++) {
			B[i] += B[i - 1];
		}
		rep(i, n)   A[i] = B[i];
	}


	rep(i, n) {
		if (i)  cout << " " << A[i];
		else  cout << A[i];
	}
	cout << endl;
}


Measured memory_bytes: 4848
#include <bits/stdc++.h>
using namespace std;
using ull=unsigned long long;
using ar=array<ull,26>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,a,n) for(int i=a;i<n;i++)
int main(){
	string s1,s2;
	ar ht; ht[0]=1;
	rep(i,25) ht[i+1]=ht[i]*10007;
	
	while(cin>>s1>>s2){
		if(s1.size()>s2.size()) swap(s1,s2);
		int n1=s1.size(), n2=s2.size();
		unordered_set<ull> lst;
		vector<ull> p1(1,0),p2(1,0),p3(n1+1),p4(n2+1);
		for(auto c:s1)p1.push_back(ht[c-'a']);
		for(auto c:s2)p2.push_back(ht[c-'a']);
		partial_sum(p1.begin(), p1.end(), p3.begin());
		partial_sum(p2.begin(), p2.end(), p4.begin());
		
		for(int l=n1;l>=1;l--){
			lst.clear();
			ull tmp=p3[l-1];
			range(i,l,n1+1) {
				tmp+=p1[i]-p1[i-l];
				lst.insert(tmp);
			}
			tmp=p4[l-1];
			range(i,l,n2+1){
				tmp+=p2[i]-p2[i-l];
				if(lst.find(tmp) != lst.end()){
					cout<<l<<endl;
					goto end;
				}
			}
		}
		cout<<0<<endl;
		end: ;
	}
	return 0;
}



Measured memory_bytes: 3332
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
constexpr int mod = 998244353;
void add(long long &x, long long y) {
  x += y;
  if (x >= mod) x -= mod;
}
long long dp1[301][300 * 302] = {}, dp2[301][300 * 302] = {};
signed main() {
  ios::sync_with_stdio(false); cin.tie(0);
  int n;
  cin >> n;
  int sum = 0;
  vector<int> in(n);
  for (int i = 0; i < n; i++) {
    cin >> in[i];
    sum += in[i];
  }
  dp1[0][0] = 1;
  dp2[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= 300 * 300; j++) {
       add(dp1[i + 1][j + in[i]], dp1[i][j]);
       add(dp1[i + 1][j], 2 * dp1[i][j] % mod);
       add(dp2[i + 1][j + in[i]], dp2[i][j]);
       add(dp2[i + 1][j], dp2[i][j]);
    }
  }
  long long ng = 0;
  for (int i = (sum + 1) / 2; i <= 300 * 300; i++) {
    add(ng, dp1[n][i]);
  }
  if (sum % 2 == 0) {
    add(ng, mod - dp2[n][sum / 2]);
  }
  ng *= 3;
  ng %= mod;
  long long tot = 1;
  for (int i = 0; i < n; i++) {
    tot *= 3;
    tot %= mod;
  }
  add(tot, mod - ng);
  cout << tot << endl;
  return 0;
}


Measured memory_bytes: 425600
#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
#define incID(i, l, r) for(int i = (l)    ; i <  (r); ++i)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); --i)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); ++i)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); --i)
#define inc(i, n)  incID(i, 0, n)
#define dec(i, n)  decID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define dec1(i, n) decII(i, 1, n)
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))
#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define FI first
#define SE second
#define FR front()
#define BA back()
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
auto setmin   = [](auto & a, auto b) { return (b <  a ? a = b, true : false); };
auto setmax   = [](auto & a, auto b) { return (b >  a ? a = b, true : false); };
auto setmineq = [](auto & a, auto b) { return (b <= a ? a = b, true : false); };
auto setmaxeq = [](auto & a, auto b) { return (b >= a ? a = b, true : false); };
#define SI(v) static_cast<int>(v.size())
#define RF(e, v) for(auto & e: v)
#define until(e) while(! (e))
#define if_not(e) if(! (e))
#define ef else if
#define UR assert(false)
#define IN(T, ...) T __VA_ARGS__; IN_(__VA_ARGS__);
void IN_() { };
template<typename T, typename ... U> void IN_(T &  a, U &  ... b) { cin >> a; IN_(b ...); };
template<typename T                > void OUT(T && a            ) { cout << a << endl; }
template<typename T, typename ... U> void OUT(T && a, U && ... b) { cout << a << " "; OUT(b ...); }

// ---- ----

template<typename T> using LPQ = priority_queue<T, vector<T>, greater<T>>;
template<typename T> using GPQ = priority_queue<T, vector<T>,    less<T>>;

int main() {
	IN(int, t);
	inc(tt, t) {
		IN(LL, n, a, b, c, d);
		LPQ<pair<LL, LL>> q;
		map<LL, LL> mp;
		q.emplace(0, n);
		until(q.empty()) {
			auto [s, v] = q.top(); q.pop();
			if(v == 0) { break; }
			if(s != mp[v]) { continue; }
			auto add = [&](LL s, LL v) {
				if(mp.count(v) == 0 || s < mp[v]) { mp[v] = s; q.emplace(s, v); }
			};
			auto f = [&](LL m, LL k) {
				add(s +      v % m  * d + k, v / m);
				add(s + (m - v % m) * d + k, v / m + 1);
				if(s + 1.0 * (v - v / m) * d > 2e18) { return; }
				add(s + (v - v / m) * d    , v / m);
			};
			f(2, a);
			f(3, b);
			f(5, c);
		}
		OUT(mp[0]);
	}
}


Measured memory_bytes: 4724
//***Little by little one travels far***
 
#include<bits/stdc++.h>
using namespace std;
 
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i,n) for(i=0;i<n;i++)
#define forn(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i)
#define ford(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define fora(it,x) for(auto it:x)
#define PI 3.14159265
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl "\n"
 
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef long double ld;
 
template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
vector<pair<double,double>> p;
vector<vector<ll>> perm;

void fun(vector<ll> v,ll n){
    if(v.size()==n){
        perm.pb(v);
        return;
    }

    vector<ll> vis(n+1,0);
    for(ll i=0;i<v.size();i++)
    vis[v[i]]=1;

    for(ll i=1;i<=n;i++){
        if(!vis[i]){
            v.pb(i);
            fun(v,n);
            v.pop_back();
        }
    }
}

double dis(ll i,ll j){
    double s=(p[i-1].fi-p[j-1].fi)*(p[i-1].fi-p[j-1].fi)+(p[i-1].se-p[j-1].se)*(p[i-1].se-p[j-1].se);
    s=sqrt(s);
    return(s);
}

double fun1(ll n){
    double s=0;
    for(ll i=0;i<perm[n].size()-1;i++){
        s+=dis(perm[n][i],perm[n][i+1]);
    }
    return(s);
    //cout<<s<<" ";
}

int main(){
    ll n;
    cin>>n;
    double s=0;

    forn(i,n){
        double x,y;
        cin>>x>>y;
        p.pb(mp(x,y));
    }
    vector<ll> v;
   fun(v,n);
   forn(i,perm.size()) s+=fun1(i);
   //cout<<s<<" ";
   printf("%0.6f",(double)s/(double)perm.size()); 
}

Measured memory_bytes: 4408
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>

using namespace std;
#define vsort(v) sort(v.begin(), v.end());
#define vsort_reverse(v) sort(v.begin(), v.end(), greater<int>());
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vector<int> a;
	for(int i = 0; i < N; i++) {
		int x;
		cin >> x;
		a.push_back(x);
	}

	vsort_reverse(a);
	int alicePoint = 0;
	int bobPoint = 0;
	bool turn = true;
	for(int i = 0; i < a.size(); i++) {
		if(turn) alicePoint += a[i];
		else bobPoint += a[i];
		turn = !turn;
	}
	int rslt = alicePoint - bobPoint;
	cout << rslt << endl;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
//#include <math.h>
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <complex>
#include <set>
#include <list>
#include <iomanip>
#include <map>
#include <functional>
#include <string.h>

using namespace std;
static const double EPS = 1e-9;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a,0,sizeof(a))
#define minus(a) memset(a,0xff,sizeof(a))
#define chmax(a,b) a=min((a),(b))
#define chmin(a,b) a=max((a),(b))


#define MOD 1000000007

typedef pair<int,int>P;
#define INF (1<<29)
 
struct edge{
	int dst;
	ll cost;
	edge(int dst, ll cost){
		this->dst=dst; this->cost=cost;
	}

};


 
int V,E;
typedef vector<edge> edges;
vector<edges> g;


int r, c, n;
vector<P> Y0, Xr, Yc, X0;

bool check(int x, int y) {
	if (x != 0 && x != r && y != 0 && y != c)
		return false;
	return true;
}
void Set(int x, int y, int i) {
	if (y == 0)
		Y0.push_back(P(x, i));
	else if (x == r) {
		Xr.push_back(P(y, i));
	}
	else if (y == c) {
		Yc.push_back(P(x, i));
	}
	else if (x == 0) {
		X0.push_back(P(y, i));
	}
}
stack<int> s;
void go(vector<P> p) {
	for (auto u : p) {

		if(s.size() && s.top() == u.second) {
			s.pop();
		}
		else {
			s.push(u.second);
		}
	}
}

int main(){

	scanf("%d %d %d ", &r, &c, &n);
	int x, y, z, w;
	rep(i, n) {
		scanf("%d %d %d %d", &x, &y, &z, &w);
		if (check(x, y) && check(z, w)) {
			Set(x, y, i+1);
			Set(z, w, i+1);
		}

	}
	sort(Y0.begin(), Y0.end());
	sort(Xr.begin(), Xr.end());
	sort(Yc.begin(), Yc.end(), greater<P>());
	sort(X0.begin(), X0.end(), greater<P>());
	
	go(Y0);
	go(Xr);
	go(Yc);
	go(X0);
	if (s.size())
		cout << "NO" << endl;
	else
		cout << "YES" << endl;

	return 0;
}


Measured memory_bytes: 2880
import sys


def input():
    return sys.stdin.readline().strip()


N, M = map(int, input().split())
str_N = str(N)
g = {str(i): set() for i in range(1, N + 1)}
for _ in range(M):
    A, B = input().split()
    if A == '1' or B == str_N:
        g[A].add(B)
        g[B].add(A)

if g['1'].intersection(g[str_N]):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')


Measured memory_bytes: 101200
#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int n){
	par= vector<int>(n, -1);
  }
  int find(int x){
    if(par[x]<0)
      return x;
    else
      return par[x]=find(par[x]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
/*struct aa{
	vector<int> gt;
  aa(int n){
	gt= vector<int>(n, 1);
  }
	void c(V<int> d,int b){
	if(d[b]==0){
		gt[d[b]-1]++;
		gt[gt.sz-1]++;
	}
	else{
		gt[d[b]-1]++;
		c(d,d[d[b]]-1);
	}
}
void cok(int a){
	cout<<gt[a-1]<<endl;
	fo(i,a-1)
	cout<<gt[i]<<endl;
}
};
*/
signed main(){
	string a;
	cin>>a;
	int b=0,c=0;
	fo(i,a.sz){
		if(a[i]=='C')
			b=1;
		if(b&&a[i]=='F')
			c=1;
	}
	if(c)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <map>
#include <queue>
#define rep(i,n) for (int i=0;i<(n);i++)

using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	int ans = -1;
	for (int i = 1;i <= 1000;i++) {
		if ((int)(i * 0.08) == a && (int)(i * 0.1) == b) {
			ans = i;
			break;
		}
	}
	cout << ans << endl;

	return 0;
}

//BBBBBBBBBBBBBBBBB
//int main() {
//	long long n, a, b;
//	cin >> n >> a >> b;
//	long long ans = 0;
//	long long tmp = a * (n / (a + b));
//	if (n % (a + b) < a) {
//		ans = tmp + n % (a + b);
//	}
//	else ans = tmp + a;
//
//	cout << ans << endl;
//
//	return 0;
//}

//AAAAAAAAAAAAAAAAA
//int main() {
//	string s;
//	cin >> s;
//
//	if (s[0] != s[1] || s[1] != s[2] || s[2] != s[0])
//		cout << "Yes" << endl;
//	else
//		cout << "No" << endl;
//
//	return 0;
//}

Measured memory_bytes: 3576
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

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

template <class T, class F>
struct segment_tree{
    int sz;
    vector<T> seg;
    const F f;
    const T M;
    segment_tree(int n, const F f, const T &M) : f(f), M(M) {
        sz = 1;
        while(sz < n) sz <<= 1;
        seg.assign(2*sz, M);
    }

    void set(int k, const T &x){
        seg[k + sz] = x;
    }

    void build(){
        for (int i = sz-1; i > 0; --i) seg[i] = f(seg[2*i], seg[2*i+1]);
    }

    void update(int k, const T &x){ // 0-indexed
        k += sz;
        seg[k] = x;
        while (k >>= 1){
            seg[k] = f(seg[2*k], seg[2*k+1]);
        }
    }

    T query(int a, int b){ // 0-indexed
        T l = M, r = M;
        for(a += sz, b += sz; a < b; a >>=1, b>>=1){
            if(a & 1) l = f(l, seg[a++]);
            if(b & 1) r = f(seg[--b], r);
        }
        return f(l, r);
    }

    T operator[](const int &k) const { // 0-indexed
        return seg[k + sz];
    }
};
/*
Use this template
auto f = [](int a, int b){ return min(a, b); };
segment_tree<int, decltype(f)> seg(n, f, INF<int>);
 */

int main() {
    int n;
    cin >> n;
    using P = pair<int, int>;
    vector<P> u(n);
    int mi2 = INF<int>, Ma1 = 0;
    int mi1 = INF<int>, Ma2 = 0;
    for (int i = 0; i < n; ++i) {
        int a, b;
        scanf("%d %d", &a, &b);
        chmin(mi2, a); chmin(mi2, b);
        chmax(Ma1, a); chmax(Ma1, b);
        chmin(mi1, max(a, b)); chmax(Ma2, min(a, b));
        u[i] = make_pair(min(a, b), max(a, b));
    }
    ll ans = (ll)(Ma2-mi2)*(Ma1-mi1);
    sort(u.begin(), u.end());
    auto f = [](int a, int b){ return min(a, b); };
    segment_tree<int, decltype(f)> seg1(n, f, INF<int>);
    auto g = [](int a, int b){ return max(a, b); };
    segment_tree<int, decltype(g)> seg2(n, g, 0);
    for (int i = 0; i < n; ++i) {
        seg1.set(i, u[i].first);
        seg2.set(i, u[i].first);
    }
    seg1.build(); seg2.build();
    int ans2 = INF<int>;
    chmin(ans2, seg2.query(0, n)-seg1.query(0, n));
    for (int i = 0; i < n; ++i) {
        seg1.update(i, u[i].second);
        seg2.update(i, u[i].second);
        chmin(ans2, seg2.query(0, n)-seg1.query(0, n));
    }
    cout << min(ans, (ll)ans2*(Ma1-mi2)) << "\n";
    return 0;
}


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

using namespace std;

int i,n,x;
map<int,int> mem;

int main() {
	scanf("%d",&n);
	for (i=0 ; i<n ; i++) {
		scanf("%d",&x);
		mem[x]++;
	}
	
	scanf("%d",&n);
	for (i=0 ; i<n ; i++) {
		scanf("%d",&x);
		if (mem[x] == 0) {
			printf("NO\n");
			return 0;
		}
		mem[x]--;
	}
	
	printf("YES\n");
}


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

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            ulong N = ulong.Parse(Console.ReadLine());
            const int a = 97;
            
            string ans = "";
            List<ulong> int_names = new List<ulong>();
            ulong tmpN = N - 26;
            
            ulong k = N;
            ulong x = k;
            do {
                x--;
                ulong q = 0;
                if(x != 0) q = x / 26;
                ulong r = x % 26;
                int_names.Add(r);
                x = q;
            } while(x != 0);

            int_names.Reverse();
            foreach(int int_name in int_names) ans += (char)(a + int_name);

            Console.WriteLine(ans);
            Console.ReadLine();
        }
    }
}


Measured memory_bytes: 28020
n = gets.to_i
d = gets.split.map(&:to_i)
if d[0] != 0
    ans = 0
else
    if n == 1
        ans = 1
    elsif n == 2
        ans = 1 if d[1] == 1
        ans = 0 if d[1] != 1
    else
        d.sort!
        c = 1
        now = 1
        prev = 1
        ans = 1
        1.upto(n-2) do |i|
            if d[i] == now
                if d[i] == d[i+1]
                    c += 1
                    ans = ans * (prev**c) if i == n-2
                else
                    ans = ans * (prev**c)
                    ans = ans * c if i == n-2 
                    prev = c
                    c = 1
                    now += 1
                end
            else
                ans = 0
                break
            end
        end
    end    
end
puts ans%998244353

Measured memory_bytes: 62452
str = gets
arr = []
prev, n = str[0], 1
str[1..-1].each_char{|c|
    if c == prev
        n += 1
    else
        arr << [prev, n]
        prev, n = c, 1
    end
}
max, level, match = 0, level = 0, "J"
arr.each{|c, n|
    if c == "J"
        level = n
        match = "O"
    elsif c == "O"
        if match == "O" && n <= level
            level = [level, n].min
            match = "I"
        end
    else
        if match == "I" && n >= level
            level = [level, n].min
            max = level if max < level
        end
        match = "J"
    end
}
puts max


Measured memory_bytes: 118916
N = int(input())

dp = [100000] * (10**6)
dp[0] = 0

for n in range(N):
  count = 1
  while(True):
    if count > N:
      break

    dp[n+count] = min(dp[n+count], dp[n]+1)
    count *= 6

  count = 1
  while(True):
    if count > N:
      break

    dp[n+count] = min(dp[n+count], dp[n]+1)
    count *= 9

print(dp[N])

Measured memory_bytes: 50156
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed as V
main=do
    (n:k:_)<-map read.words<$>getLine::IO[Int]
    xs<-unfoldr (B.readInt.B.dropWhile(==' '))<$>B.getLine
    --
    print $ minimum $ if elem 0 xs then solve (k-1) (filter (/=0) xs) else solve k xs
--
solve 0 _ = [0]
solve k xs@(x:_)
    | x > 0 = [xs !! (k-1)]
    | la < 0 = [negate $ (reverse xs) !! (k-1)]
    | True = solve' k xs (drop (k-1) xs)
    where la = last xs

solve' _ _ [] = []
solve' k (l:ls) (r:rs)
    | r<0 = (solve' k ls rs)
    | l>0 = []
    | True = (min (r*2-l) (r-l*2) ) : (solve' k ls rs)

Measured memory_bytes: 9468
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque, defaultdict
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right


def solve():
    N = II()
    S = LS()

    left_black = 0
    right_white = 0
    for i in range(N):
        if S[i] == '.':
            right_white += 1

    ans = left_black + right_white
    for i in range(N):
        if S[i] == '#':
            left_black += 1
        else:
            right_white -= 1
        ans = min(ans, left_black + right_white)
    print(ans)

if __name__ == '__main__':
    solve()



Measured memory_bytes: 10860
// Problem : D - Flat Subsequence
// Contest : AtCoder - ACL Beginner Contest
// URL : https://atcoder.jp/contests/abl/tasks/abl_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
 
// Macros
 
template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long
#define db long double
#define pb push_back
#define eb emplace_back
#define pii pair<int, int>
#define vi vector<int>
#define vii vector<pii>
#define mi map<int, int>
#define mii map<pii, int>
#define fi first
#define se second
#define all(a) (a).begin(), (a).end()
#define sz(x) (int) x.size()
#define mod 1000000007
#define EPS 1e-9
#define inf 1e10
#define PI acos(-1.0)
#define int long long
#define N 300005
 
// Solution
 
class SegTree {
  int tl, tr, sum;
  SegTree *left, *right;
 
 public:
  SegTree(int l, int r) {
    sum = 0;
    tl = l;
    tr = r;
    left = nullptr;
    right = nullptr;
  }
 
  void makeChildren() {
    int tm = (tl + tr) / 2;
    left = new SegTree(tl, tm);
    right = new SegTree(tm + 1, tr);
  }
 
  void update(int pos, int val) {
    sum = max(sum, val);
    if (tl == tr) return;
    if (right == nullptr) makeChildren();
    if (pos <= left->tr)
      left->update(pos, val);
    else
      right->update(pos, val);
  }
 
  int get(int l, int r) {
    if (l > tr || r < tl) return 0;
    if (tl >= l && tr <= r) return sum;
    if (left == nullptr) return 0;
    return max(left->get(l, r), right->get(l, r));
  }
};
 
void solve() {
  int n, k;
  cin >> n >> k;
  vi a(n);
  for (int &x : a) cin >> x;
  SegTree *st = new SegTree(0, N);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int cur = st->get(max(0ll, a[i] - k), min((ll)N, a[i] + k));
    cur++;
    ans = max(ans, cur);
    st->update(a[i], cur);
  }
  cout << ans << '\n';
}
 
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  // freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
 
  int tests;
  tests = 1;
  // cin>>tests;
 
  for (int test = 1; test <= tests; test++) {
    // cout<<"Case #"<<test<<": ";
    solve();
  }
 
  return 0;
}

Measured memory_bytes: 31716
/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_C&lang=jp
  * Structure and Class - Dice III
  */
object Main {

  case class Dice(numbers: IndexedSeq[Int]) {
    def apply(number: Int): Int = {
      numbers(number)
    }

    def rotateTo(direction: Char): Dice = {
      direction match {
        case 'N' => Dice(IndexedSeq(numbers(1), numbers(5), numbers(2), numbers(3), numbers(0), numbers(4)))
        case 'S' => Dice(IndexedSeq(numbers(4), numbers(0), numbers(2), numbers(3), numbers(5), numbers(1)))
        case 'W' => Dice(IndexedSeq(numbers(2), numbers(1), numbers(5), numbers(0), numbers(4), numbers(3)))
        case 'E' => Dice(IndexedSeq(numbers(3), numbers(1), numbers(0), numbers(5), numbers(4), numbers(2)))
      }
    }

    def find(number: Int): Int = {
      // returns -1 if not found
      numbers.indexWhere(_ == number)
    }

    def adjustWith(dice: Dice): Dice = {
      val operationsToTop = Seq("", "", "N", "W", "E", "S", "NN")
      val operationsToFront = Seq("", "S", "", "WSE", "ESW", "SEEN", "N")
      val dice2 = operationsToTop(this.find(dice(0)) + 1).foldLeft(this)(_.rotateTo(_))
      val dice3 = operationsToFront(dice2.find(dice(1)) + 1).foldLeft(dice2)(_.rotateTo(_))
      dice3
    }
  }

  def main(args: Array[String]): Unit = {
    val dice1 = Dice(io.StdIn.readLine().split(" ").map(_.toInt))
    val dice2 = Dice(io.StdIn.readLine().split(" ").map(_.toInt))
    if (dice1 == dice2.adjustWith(dice1))
      println("Yes")
    else
      println("No")
  }
}

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

using namespace std;

struct UnionFind {
    vector<long long> par;
    vector<long long> sizes; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(long long N) : par(N) { //最初は全てが根であるとして初期化
        for(long long i = 0; i < N; i++) par[i] = i;
        for(long long i = 0; i < N; i++) sizes.push_back(1);
    }

    long long root(long long x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(long long x, long long y) { // xとyの木を併合
        long long rx = root(x); //xの根をrx
        long long ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
        sizes[ry] += sizes[rx];
    }

    bool same(long long x, long long y) { // 2つのデータx, yが属する木が同じならtrueを返す
        long long rx = root(x);
        long long ry = root(y);
        return rx == ry;
    }
    long long size(long long x) {
        return sizes[root(x)];
    }
};

void solve(long long N, long long M, std::vector<long long> A, std::vector<long long> B){
    vector<long long> ans(M);
    UnionFind tree(N);
    ans[M-1] = N * (N - 1) / 2;
    for (int i = M - 2; i >= 0; i--) {
        if (tree.same(A[i+1]-1, B[i+1]-1)) {
            ans[i] = ans[i+1];
        } else {
            ans[i] = ans[i+1] - tree.size(A[i+1]-1) * tree.size(B[i+1]-1);
            tree.unite(A[i+1]-1, B[i+1]-1);
        }
    }
    for (int i = 0; i <= M-1; i++) {
        cout << ans[i] << endl;
    }
}

int main(){
    long long N;
    cin >> N;
    long long M;
    cin >> M;
    std::vector<long long> A(M);
    std::vector<long long> B(M);
    for(int i = 0 ; i < M ; i++){
        cin >> A[i];
        cin >> B[i];
    }
    solve(N, M, A, B);
    return 0;
}


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

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

constexpr int atcoder_mod = 1e9+7;

using namespace std;
using ll = long long;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

class Data{
public:
	int index,height;
};

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

	string S=in<string>();
	int N=S.size();
	vector<int> H(N);
	vector<pair<int,int>> P;
	int h=0;
	REP(i,N){
		char now = S[i];
		if(now=='/'){
			H[i] = h+1;
		}
		else{
			H[i] = h;
		}
		if(now=='/') h++;
		else if(now=='\\') h--;
	}

	REP(i,N){
		if(S[i]=='\\'){
			for(int j=i+1;j<N;j++){
				if(H[i]==H[j]){
					P.emplace_back(i,j);
					i = j;
					break;
				}
			}
		}
	}

	int K=P.size();
	int sum=0;
	vector<int> L(K,0);
	REP(i,K){
		int startH = H[P[i].first];
		for(int j=P[i].first;j<=P[i].second;j++){
			switch(S[j]){
			case '\\':
				L[i] += 1+2*(startH-H[j]);
				break;
			case '/':
				L[i] += 1+2*(startH-H[j]);
				break;
			default:
				L[i] += 2*(startH-H[j]);
			}
		}
		sum+=L[i];
	}
	
	out(sum/2);
	if(!K){
		out(0);
		return 0;
	}
	cout << K << ' ';

	REP(i,K-1){
		cout << L[i]/2 << ' ';
	}
	out(L[K-1]/2);

	return 0;
}



Measured memory_bytes: 3332
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <map>
#include <set>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <iomanip>
#include <assert.h>
#include <math.h>
#include <stack>
#include <queue>
#include <list>
using namespace std;

// #define __DEBUG__

#ifdef __DEBUG__
bool debug_disabled = false;
#else
bool debug_disabled = true;
#endif

#define dbg if (debug_disabled) {} else cerr

void solve() {
    long long X;
    cin >> X;
    long long cur = 100;
    int years = 0;
    while (cur < X) {
        long long interest = cur / 100;
        ++years;
        cur += interest;
    }
    cout << years << endl;
}

int main() {
    cout.setf(ios::fixed, ios::floatfield);
    cout.setf(ios::showpoint);
    cout.precision(12);
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);

    int T = 1;
    // cin >> T;
    for (int i = 1; i <= T; ++i) {
        solve();
    }

    return 0;
}

Measured memory_bytes: 3656
from collections import Counter
import sys

for line in sys.stdin:
    card = sorted(list(map(int, line.split(','))))
    pair = Counter(card).most_common()

    if pair[0][1] == 4:
        print('four card')
    elif pair[0][1] == 3 and pair[1][1] == 2:
        print('full house')
    elif pair[0][1] == 3:
        print('three card')
    elif pair[0][1] == pair[1][1] == 2:
        print('two pair')
    elif pair[0][1] == 2:
        print('one pair')
    elif [x - card[0] for x in card] == [0,1,2,3,4] or card == [1,10,11,12,13]:
        print('straight')
    else:
        print('null')

Measured memory_bytes: 6736
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
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; }

void solve() {
    VVI a(3,VI(3));
    REP(i,0,3) REP(j,0,3)  cin >> a[i][j];
    int n,b;
    cin >> n;
    REP(i,0,n) {
        cin >> b;
        REP(j,0,3) REP(k,0,3) if (a[j][k] == b) a[j][k] = 0;
    }
    bool bo = false;
    REP(i,0,3) {
        bool tmp = true;
        REP(j,0,3) if (a[i][j] != 0) tmp = false;
        bo |= tmp;
    }
    REP(i,0,3) {
        bool tmp = true;
        REP(j,0,3) if (a[j][i] != 0) tmp = false;
        bo |= tmp;
    }
    bo |= (a[0][0] == 0 && a[1][1] == 0 && a[2][2] == 0);
    bo |= (a[0][2] == 0 && a[1][1] == 0 && a[2][0] == 0);
    if (bo) cout << "Yes" << endl;
    else cout << "No" << endl;
}

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

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

int main(void){
    string str;
    while(getline(cin, str)){
        for(int i=0; i<26; i++){
            for(int j=0; j<str.size(); j++){
                if(str[j]!=' ' && str[j]!='.'){
                    str[j]++;
                    if(str[j]>'z') str[j]-=26;
                }
            }
            if(str.find("the")!=string::npos){
                cout<<str<<endl;
                break;
            }else if(str.find("this")!=string::npos){
                cout<<str<<endl;
                break;
            }else if(str.find("that")!=string::npos){
                cout<<str<<endl;
                break;
            }
        }
    }
}


Measured memory_bytes: 3200
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    set<string> s;
    int t;
    string str;
    cin>>t;
    while(t--)
    {
        cin>>str;
        s.insert(str);
    }
    cout<<s.size();

}



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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 

#define ll long long
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define pu push
#define pp pop_back
#define in insert
#define ld long double
#define forn(low,high,i) for(i = low;i < high;i++)
#define forrev(high,low,i) for(i = high; i >= low;i--)
#define all(v) v.begin(),v.end()
#define sz(v) (int)v.size()
#define line cout << __LINE__;
#define prv(a) for(auto x : a) cout << x << ' ';cout << '\n';
#define prvp(a) for(auto x : a) cout << "{" << x.ff << ',' << x.ss << "}";cout << '\n';
#define decimal_digits cout << fixed << setprecision(15);
string to_string(string s) { return '"' + s + '"';}
string to_string(char s) { return string(1, s);}
string to_string(const char* s) { return to_string((string) s);}
string to_string(bool b) { return (b ? "true" : "false");}
template <typename A> string to_string(A);
template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}
template <typename A> string to_string(A v) {bool f = 1; string r = "{"; for (const auto &x : v) {if (!f)r += ", "; f = 0; r += to_string(x);} return r + "}";}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {cerr << " " << to_string(H); debug_out(T...);}
#define pr(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

typedef unordered_map<int,int> umi;
typedef unordered_map<ll,ll> uml;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

const int inf = 1e9;
const ll INF = 1e18;
const int mod = 1e9 + 7;
const int bit32 = log2(inf) + 3;
const int bit64 = log2(INF) + 3;

inline int add(int a, int b){a += b; if(a >= mod) a -= mod; return a;}
inline int sub(int a, int b){a -= b; if(a < 0) a += mod; return a;}
inline int mul(int a, int b){return (int)((long long) a * b % mod);}
inline int modexpo(int a, int b){int res = 1; while(b > 0){ if(b & 1) res = mul(res, a); a = mul(a, a); b /= 2;} return res;}
inline int divide(int a, int b){ return mul(a, modexpo(b, mod - 2));}

clock_t time_p = clock();

void ktj(){
  time_p = clock() - time_p;
  cerr << "Time elapsed : " << (float)(time_p)/CLOCKS_PER_SEC << "\n";
}

void pre(){ // Reset each global variable (esp. for graphs)
  
}

void solve(){
  ll a, b;
  cin >> a >> b;
  cout << (a + b - 1) / b << '\n';
}

int main(){
  fastio

  pre();

  int t = 1;
  // cin >> t;
  while(t--){
    solve();
  }

  ktj();
}


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

typedef long long ll;

int main(){
  int n;
  cin >>n;
  vector<string> S(n);
  vector<pair<string,int>> Ans;
  rep(i,n) cin >> S[i];
  sort(S);
  int cnt = 0;
  rep(i,n){
    cnt ++;
    if(i == n-1){
      pair<string,int> tmp = make_pair(S[i],cnt);
      Ans.push_back(tmp);
      break;
    }
    if(S[i] != S[i+1]){
      pair<string,int> tmp = make_pair(S[i],cnt);
      Ans.push_back(tmp);
      cnt = 0;
    }
  }
  int max_ = 0;
  rep(i,Ans.size()) max_ = max(max_,Ans[i].second);
  rep(i,Ans.size()){
    if(Ans[i].second == max_) cout << Ans[i].first << endl;
  }
}

Measured memory_bytes: 18928
# -*- coding: utf-8 -*-
N = int(input())
A = list(map(int,input().split()))

B = list(range(1, N+1))
mulL = []

for i in range(N):
  L = []
  L.append(B[i])
  L.append(A[i])
  mulL.append(L)
mulL.sort()
mulL.sort(key=lambda x:x[1], reverse=False)

answer = []
for i in range(N):
  answer.append(mulL[i][0])
  
print(*answer)

Measured memory_bytes: 26036