akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include<cmath>
#define pb push_back
#define ld long double
#define mp make_pair
#define vl vector<ll> 
#define vd vector<double>
#define vld vector<long double>
#define ll long long int
#define pl pair<ll, ll>
#define all(a) a.begin(), a.end()
#define forr(i, n) for(ll i=0; i<n; i++) 
#define forr1(i, n) for(ll i=1; i<=n; i++)
using namespace std;
const ld PI =3.1415926535897923846;
const ll MOD = 1e9+7;
const ll N=998244353;
vector<bool> prime(10000005+1, true);
const int MAX = 10000005+1;
vector<int> factor(MAX, 0);  
// function to generate all prime factors 
// of numbers from 1 to 10^6 
void generatePrimeFactors() 
{ 
    factor[1] = 1; 
  
    // Initializes all the positions with their value. 
    for (int i = 2; i < MAX; i++) 
        factor[i] = i; 
  
    // Initializes all multiples of 2 with 2 
    for (int i = 4; i < MAX; i += 2) 
        factor[i] = 2; 
  
    // A modified version of Sieve of Eratosthenes to 
    // store the smallest prime factor that divides 
    // every number. 
    for (int i = 3; i * i < MAX; i++) { 
        // check if it has no prime factor. 
        if (factor[i] == i) { 
            // Initializes of j starting from i*i 
            for (int j = i * i; j < MAX; j += i) { 
                // if it has no prime factor before, then 
                // stores the smallest prime divisor 
                if (factor[j] == j) 
                    factor[j] = i; 
            } 
        } 
    } 
} 
  
// function to calculate number of factors 
ll calc(ll n) 
{ 
    if (n == 1) 
        return 1; 
  
    int ans = 1; 
  
    // stores the smallest prime number 
    // that divides n 
    int dup = factor[n]; 
  
    // stores the count of number of times 
    // a prime number divides n. 
    int c = 1; 
  
    // reduces to the next number after prime 
    // factorization of n 
    int j = n / factor[n]; 
  
    // false when prime factorization is done 
    while (j != 1) { 
        // if the same prime number is dividing n, 
        // then we increase the count 
        if (factor[j] == dup) 
            c += 1; 
  
        /* if its a new prime factor that is factorizing n,  
           then we again set c=1 and change dup to the new  
           prime factor, and apply the formula explained  
           above. */
        else { 
            dup = factor[j]; 
            ans = ans * (c + 1); 
            c = 1; 
        } 
  
        // prime factorizes a number 
        j = j / factor[j]; 
    } 
  
    // for the last prime factor 
    ans = ans * (c + 1); 
  
    return ans; 
} 
void solve()
{
    
    ll n;
    cin>>n;
    generatePrimeFactors(); 
    ll sum=1;
    for(ll i=2; i<=n; i++)
    {
        sum+=i*calc(i);
    }
    cout<<sum;
}
int main()
{
    ll test=1;
    //cin>>test;
    while(test--)
        solve();
}

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

int main(){
    using namespace std;
    size_t N, M;
    cin >> N >> M;
    vector<vector<unsigned long>> edge(3 * N);
    for(size_t i = 0, u, v; i < M; ++i){
        cin >> u >> v;
        --u;
        --v;
        edge[u].push_back(v + N);
        edge[u + N].push_back(v + 2 * N);
        edge[u + 2 * N].push_back(v);
    }
    deque<bool> visited(3 * N);
    queue<pair<size_t, size_t>> q;
    size_t S, T;
    cin >> S >> T;
    --S;
    --T;
    q.emplace(S, 0);
    while(!q.empty()){
        auto t = q.front();
        q.pop();
        if(visited[t.first])continue;
        if(t.first == T){
            cout << t.second / 3 << endl;
            return 0;
        }
        visited[t.first] = true;
        for(const auto& i : edge[t.first])if(!visited[i])q.emplace(i, t.second + 1);
    }
    puts("-1");
    return 0;
}

Measured memory_bytes: 16896
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

int n,m;
ll a[100001],b[100001];
int main(){
    cin>>n>>m;
    rep(i,n) cin>>a[i],b[i]=a[i];
    int pre=-1,cnt=0;
    rep(i,n){
        cnt=0;
        while(b[i]%2==0) ++cnt,b[i]/=2;
        if(pre!=-1&&pre!=cnt){
            cout<<0<<endl;
            return 0;
        }
        pre=cnt;
    }
    rep(i,n) a[i]/=2;
    ll lcm=a[0];
    FOR(i,1,n){
        lcm=lcm*a[i]/__gcd(a[i],lcm);
        if(lcm>m){
            cout<<0<<endl;
            return 0;
        }
    }
    cout<<((m/lcm)+1)/2<<endl;
    return 0;
}

Measured memory_bytes: 1792
import sys

input = sys.stdin.readline

S = input().strip()

stack = []
ponds = []

for idx, s in enumerate(S):
    if s == "\\":
        stack.append(idx)
    elif s == "/" and stack:
        _first = stack.pop()
        pond = idx - _first
        ponds.append((_first, pond))

    # concatnate ponds
    while len(ponds) > 1:
        _cur, _size = ponds.pop()
        _prev, _prev_size = ponds.pop()

        if _cur < _prev:
            ponds.append((_cur, _prev_size + _size))
        else:
            ponds.append((_prev, _prev_size))
            ponds.append((_cur, _size))
            break

ans = []
for idx, size in ponds:
    ans.append(size)
if not ans:
    print(0)
    print(0)
else:
    print(sum(ans))
    print("{} ".format(len(ans)) + " ".join([str(s) for s in ans]))



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

int main()
{
    int H, W, h, w;
    while (true)
    {
        cin >> H >> W;

        if (H == 0 && W == 0)
            break;

        for (w = 0; w < W; w++)
        {
            cout << "#";
        }

        cout << endl;

        for (h = 0; h < H - 2; h++)
        {
            cout << "#";
            for (w = 0; w < W - 2; w++)
            {
                cout << ".";
            }
            cout << "#" << endl;
            w = 0;
        }

        for (w = 0; w < W; w++)
        {
            cout << "#";
        }

        cout << endl;
        cout << endl;
    }
}


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

int main() {
	// your code goes here
	int n, k, h, count = 0;
	cin >> n >> k;
	for (int i = 0; i < n; i++) {
		cin >> h;
		if (h >= k) count++;
	}
	cout << count;
	return 0;
}

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

const int mod = 1000000007;

struct INT {
	int x;
	INT() {x = 0;}
	INT(int a) {x = a >= mod ? a - mod : a;}
	INT operator + (const INT &A) const {
		return INT(x + A.x);
	}
	INT operator - (const INT &A) const {
		return INT(x + mod - A.x);
	}
	INT operator * (const INT &A) const {
		return INT(1ll * x * A.x % mod);
	}
};

struct Segment_tree {
	INT T[400010];
	void Update(int now, int l, int r, int pos, int x) {
		if (l == r) {
			T[now] = x;
			return ;
		}
		int mid = l + r >> 1;
		if (pos <= mid) Update(now << 1, l, mid, pos, x);
		else Update(now << 1 | 1, mid + 1, r, pos, x);
		T[now] = T[now << 1] + T[now << 1 | 1]; 
	}
	INT Query(int now, int l, int r, int L, int R) {
		if (l == L && r == R) return T[now];
		int mid = l + r >> 1;
		if (R <= mid) return Query(now << 1, l, mid, L, R);
		if (L > mid) return Query(now << 1 | 1, mid + 1, r, L, R);
		return Query(now << 1, l, mid, L, mid) + Query(now << 1 | 1, mid + 1, r, mid + 1, R);
	}
}seg1, seg2;

int f[100010], g[100010];
long long a[100010];

int main () {
	int n; long long A, B; scanf("%d%lld%lld", &n, &A, &B);
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
	}
	f[1] = g[1] = 1;
	seg1.Update(1, 0, n - 1, 0, 1), seg2.Update(1, 0, n - 1, 0, 1);
	int p1 = 0, p2 = 0, z1 = 0, z2 = 0;
	for (int i = 2; i <= n; i++) {
		while (a[i] - a[p1 + 1] >= A) p1++;
		while (a[i] - a[p2 + 1] >= B) p2++;
		seg1.Update(1, 0, n - 1, i - 1, seg2.Query(1, 0, n - 1, 0, min(p1, i - 2)).x);
		seg2.Update(1, 0, n - 1, i - 1, seg1.Query(1, 0, n - 1, 0, min(p2, i - 2)).x);
		if (a[i] - a[i - 1] < A) {
			for (int &j = z1; j < i - 1; j++) {
				seg1.Update(1, 0, n - 1, j, 0);
			}
		}
		if (a[i] - a[i - 1] < B) {
			for (int &j = z2; j < i - 1; j++) {
				seg2.Update(1, 0, n - 1, j, 0);
			}
		}
	}
	printf("%d\n", (seg1.T[1] + seg2.T[1]).x);
	return 0;
}


Measured memory_bytes: 7788
# -*- coding: utf-8 -*-

K = int(input())
print([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][K-1])


Measured memory_bytes: 2940
#pragma GCC optimize("Ofast,inline,unroll-loops,fast-math")
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;

int main(void)
{
    int n;

    scanf("%d", &n);
    printf("%.6f\n", (double)(n / 2 + n % 2) / n);

    return 0;
}


Measured memory_bytes: 256
a, b = map(int, input().split())
s = input()
if not (len(s) == a + b + 1 and '-' in s):
    print('No')
    quit()
sx = s.split('-')
if len(sx[0]) == a and len(sx[1]) == b:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 2940
def lucas(x):
  list = []
  list.append(2)
  list.append(1)
  i = 2
  while i <= x:
    list.append(list[i-1]+list[i-2])
    i += 1
  return list
      
 
if __name__ == '__main__':
  inputstr = input()
  num = int(inputstr)
  list = lucas(num)
  ans = list[num]
  print(ans,flush=True)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 2147483600

int solve(){
  int n,m,a,b;
  cin>>n>>m>>a>>b;
  vector<int> vec(n);
  rep(i,n) cin>>vec[i];

  int cnt =0;
  int i=0;
  while(i<n){
    if(vec[i]>=a) cnt++;
    else break;
    i++;
  }

  if(n - cnt >= m){
    return cnt;
  }
  i--;

  while(i>=0){
    if(vec[i] >= a && vec[i]<=b) cnt--;
    else if(vec[i]>=a && vec[i]>b) break;
    i--;
  }

  return cnt;
}

int main(){
  cout << solve() << endl;

  return 0;
}

Measured memory_bytes: 3112
const int LG = 21;
const int FN = 400005;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;

#include <bits/stdc++.h>

const double PI = acos(-1);

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int> > G;

#define forn(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define fi first
#define se second
#define re return
#define pb push_back
#define uniq(x) sort(all(x)); (x).resize(unique(all(x)) - (x).begin())

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " " << #x << " " << x << endl
#define ln cerr << __LINE__ << endl
#else
#define dbg(x) void(0)
#define ln void(0)
#endif // LOCAL

int cx[4] = {-1, 0, 1, 0};
int cy[4] = {0, -1, 0, 1};
string Yes[2] = {"No", "Yes"};
string YES[2] = {"NO", "YES"};
string Psb[2] = {"Impossible", "Possible"};
string psb[2] = {"impossible", "possible"};

ll inq(ll x, ll y)
{
    if (!y) re 1 % MOD;
    ll l = inq(x, y / 2);
    if (y % 2) re l * l % MOD * x % MOD;
    re l * l % MOD;
}

ll rev(ll x)
{
    return inq(x, MOD - 2);
}

bool __precomputed_combinatorics = 0;
vector<ll> __fact, __ufact, __rev;

void __precompute_combinatorics()
{
    __precomputed_combinatorics = 1;
    __fact.resize(FN);
    __ufact.resize(FN);
    __rev.resize(FN);
    __rev[1] = 1;
    for (int i = 2; i < FN; i++) __rev[i] = MOD - __rev[MOD % i] * (MOD / i) % MOD;
    __fact[0] = 1, __ufact[0] = 1;
    for (int i = 1; i < FN; i++) __fact[i] = __fact[i - 1] * i % MOD, __ufact[i] = __ufact[i - 1] * __rev[i] % MOD;
}

ll fact(int x)
{
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[x];
}

ll cnk(int n, int k)
{
    if (k < 0 || k > n) return 0;
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[n] * __ufact[n - k] % MOD * __ufact[k] % MOD;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll a, b, c, k;
    cin >> a >> b >> c >> k;
    k %= 2;
    if (k == 0) cout << a - b;
    else cout << b - a;
}

/* Note:
Check constants at the beginning of the code.
    N is set to 4e5 but be careful in problems with large constant factor.
    Setting N in every problem is more effective.
Check corner cases.
    N = 1
No def int long long for now.
Add something here.
*/


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

int main(){
	int h,w;
	cin >> h >> w;
	char m[105][105];
	int count = 0;
	map<int,int> mp;
	rep(i,h)rep(j,w) {
		cin >> m[i][j];
		mp[m[i][j] - 'a']++;
	}
	rep(i,26){
		if(mp[i] % 2 == 1) count++;
	}
	if(h % 2 == 0 && w % 2 == 0){
		bool ok = true;
		if(count >= 1) ok = false;
		rep(i,26){
			if(mp[i] != 0 && mp[i] % 4 != 0) ok = false;
		}
		if(ok){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}else if(h % 2 == 0 && w % 2 == 1){
		bool ok = true;
		if(count >= 1) ok = false;
		int ni = 0;
		rep(i,26){
			if(mp[i] % 4 != 0 && mp[i] % 2 == 0) ni++;
		}
		if(ni > h/2) ok = false;
		if(ok){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	} else if (h % 2 == 1 && w % 2 == 0){
		bool ok = true;
		if(count >= 1) ok = false;
		int ni = 0;
		rep(i,26){
			if(mp[i] % 4 != 0 && mp[i] % 2 == 0) ni++;
		}
		if(ni > w/2) ok = false;
		if(ok){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}else{
		bool ok = true;
		if(count >= 2) ok = false;
		int ni = 0;
		rep(i,26){
			if(mp[i] % 4 != 0 && mp[i] % 2 == 0) ni++;
		}
		if(ni > h/2 + w/2) ok = false;
		if(ok){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}
	
    return 0;
}



Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
using namespace std;
int n,a[210000];
struct node
{
	int x,p;
}sta[210000];int top;
bool pand(int x)
{
	sta[0].p=0;top=1;
	sta[1].x=1;sta[1].p=a[1];
	for(int i=2;i<=n;i++)
	{
		if(sta[top].p<a[i])
		{
			if(sta[top].x==1)sta[top].p=a[i];
			else sta[++top]=(node){1,a[i]};
		}
		else
		{
			while(top>0&&sta[top].p>a[i])top--;
			if(sta[top].p!=a[i])sta[++top]=(node){1,a[i]};
			sta[top].x++;
			while(sta[top].x==x)
			{
				if(sta[top-1].p!=sta[top].p-1)
				{
					sta[top].x=2;
					sta[top].p=sta[top].p-1;
				}
				else
				{
					top--;
					if(top==0)return false;
					sta[top].x++;
				}
			}
			if(sta[top].p!=a[i])sta[++top]=(node){1,a[i]};
		}
	}
	return true;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	int l=2,r=n+1;
	while(l<r)
	{
		int mid=(l+r)/2;
		if(pand(mid))r=mid;
		else l=mid+1;
	}
	printf("%d\n",r-1);
	return 0;
}

Measured memory_bytes: 2520
// #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define String std::string
#define fi first
#define se second
#define mp std::make_pair
#define Pair std::pair<int, int>
#define Map std::map< int, int >
#define Vector std::vector<int>
#define LEAD (lead && !i)
#define LIM (lim && i == buc[pos])
#define ABS(x) (x) < 0 ? (-x) : (x)
#define RG register
 
using std::cin;
using std::cout;
using std::endl;
 
typedef long long ll;
typedef unsigned long long ull;
 
const int N = 100000 + 5;
const int M = 1000 + 5;
const int K = 1e7 + 5;
const int MOD = 1e9 + 7;
const int inv2 = 500000004;
const int LOG = 40;
const ull BASE = 19260817;
const int INF = 0x3f3f3f3f;
const int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };
const int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };
// const double PI = acos(-1);
const double PI = 3.14159;

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
 
template<class T>
inline T readT() {
    T res = 0, f = 1;
    char ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) res = (res << 1) + (res << 3) + ch - '0';
    return res * f;
}
#define read readT<int>

namespace Comb{
const int N = 10 + 5;
inline void exgcd(ll a, ll b, ll &g, ll &x, ll &y) {
    if (!b) g = a, x = 1, y = 0;
    else exgcd(b, a % b, g, y, x), y -= x * (a / b);
}
 
inline ll inv(ll a) {
    ll g, res, tmp;
    exgcd(a, MOD, g, res, tmp);
    return ((res % MOD) + MOD) % MOD;
}
 
ll f[N], invFact[N];
 
inline void prepare() {
    f[0] = 1;
    int n = 200000;
    for (int i = 1; i <= n; i++) f[i] = f[i - 1] * i % MOD;
    invFact[n] = inv(f[n]);
    for (int i = n - 1; i >= 1; i--) invFact[i] = invFact[i + 1] * (i + 1) % MOD;
}
 
inline ll C(int n, int m) {
    if (!m) return 1;
    if (n == m) return 1;
    if (m > n) return 0;
    if (m < 0) return 0;
    return f[n] * invFact[m] % MOD * invFact[n - m] % MOD;
}
}

int n, k;

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
  #include "dbgtoki.hpp"
  #define DUMP(i) DEB dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i)  
#else
  #define DUMP(i)  
#endif

#define GETTYPE(i) 
#define TOSTRING(x) #x
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a):i<(b);i++)
#define SSTR( x ) static_cast< std::ostringstream & >( \
        ( std::ostringstream() << std::dec << x ) ).str()
#define ALL(s) (s).begin(), (s).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()) , v.end());
using namespace std;
typedef long long unsigned int llu;
typedef long long ll;

int main (){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int m,f,b;
  while(cin >> m >> f >> b){
    if(m + f < b) cout << "NA" << endl;
    else cout << max(b-m,0) << endl;
  }
  return 0;
}



Measured memory_bytes: 3220
N = int(input())
_L = list(map(int,input().split()))

L =[(v,i) for i,v in enumerate(_L)]
L = sorted(L,key = lambda x:-x[0])

dp = [[0]*(N+1) for _ in range(N+1)]

for i in range(N):#i番目の数字まで見た
    for k in range(N):#k回(i-pi)のパターン
        if k>i:
            continue
        val,ind = L[i]
        dp[i+1][k+1] = max(dp[i+1][k+1],dp[i][k] + val * abs(ind-k))#先頭からk番目に動かす
        dp[i+1][k] = max(dp[i+1][k],dp[i][k]+val * abs(N-1-(i-k)-ind))#すでに後ろからi-k個は使ってる=>後ろからN- (i-k)+1番目に動かす
print(max(dp[-1]))




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

int f(int n, vector<int> &v)
{
    
    vector<int> dp(n+1);
    dp[0]=0;
    dp[1]=0;
    dp[2]=abs(v[2]-v[1]);
    
    for(int i=3; i<=n; i++)
        dp[i] = min(dp[i-1]+ abs(v[i]-v[i-1]), dp[i-2] + abs(v[i]-v[i-2]));
    return dp[n];
}

int main()
{
  int n;
  cin >> n;
  vector<int> v(n+1);
  v[0]=0;
  for(int i=1; i<=n; i++)
      cin >> v[i];
  cout << f(n, v) << endl;
}

Measured memory_bytes: 1024
S=list(input())
A=[]
for i in range(len(S)):
    for j in range(len(S)):
        if i<j and S[i]==S[j]:
            A.append('no')
            break
        else:
            A.append('yes')
if 'no' in A:
    print('no')
else:
    print('yes')

Measured memory_bytes: 61972
using System;

namespace CSharp
{
    class Program
    {
        static void Main()
        {
            var H = long.Parse(Console.ReadLine());
            var l = Math.Floor(Math.Log(H) / Math.Log(2));

            Console.WriteLine(Math.Pow(2, l + 1) - 1);
        }
    }
}

Measured memory_bytes: 11092
#include<cstdio>

int main(){
    int X, N;
    scanf("%d %d", &X, &N);
    int candidate[101];
    candidate[0] = X;
    for (size_t i = 1; i <= 50; i++){
        candidate[i*2 - 1] = X - i;
        candidate[i*2] = X + i;
    }
    
    int answer = 200;
    for (size_t i = 0; i < N; i++){
        int tmp;
        scanf("%d", &tmp);
        if(tmp == X) candidate[0] = 300;
        else if(tmp < X){
            if(2*(X - tmp) - 1 <= 100) candidate[2*(X - tmp) - 1] = 300;
        }
        else if(2*(tmp - X) <= 100) candidate[2*(tmp - X)] = 300;
    }
    for (size_t i = 0; i < 101; i++){
        if(candidate[i] != 300){
            printf("%d\n", candidate[i]);
            return 0;
        }
    }
	return 0;
}

Measured memory_bytes: 1732
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define vmax 10000
constexpr ll inf = 100000000000000;
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/

int main(){
  int a,b;
  cin>>a>>b;
  cout<<6-a-b<<endl;
  return 0;
}


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



int main() {
    int N;
    cin >> N;
    vector<int> H(N);
    vector<int> dp(N, 0);
    for(int i=0; i<N; i++) cin >> H.at(i);

    dp.at(0) = 0;
    dp.at(1) = abs(H.at(1) - H.at(0));
    for(int i=2; i<N; i++) {
        dp.at(i) = min(
            dp.at(i-2) + abs(H.at(i) - H.at(i-2)),
            dp.at(i-1) + abs(H.at(i) - H.at(i-1))
        );
    }
    cout << dp.at(N - 1) << endl;

}

Measured memory_bytes: 1024
#include<stdio.h>
#include<string.h>
int x[15],l[15],r[15];
int kase;
void dfs(int i,int j,int k)//i 是当前下落的球，j是左?的桶的第几个球，k 是右?放入
{
	if(i>10)//如果可以全部下落，肯定?足
	{
		kase=1;
		return;
	}
	if(kase)
	{
		return;
	}
	if(x[i]>l[j-1])//??落在左?
	{
		l[j]=x[i];dfs(i+1,j+1,k);
	}
	if(x[i]>r[k-1])//??落在右?
	{
		r[k]=x[i];dfs(i+1,j,k+1);
	}
}
int main()
{
	int t; 
	//freopen("shuju.txt","r",stdin);
	scanf("%d",&t);
	while(t--)
	{
		for(int i=1;i<=10;++i)
		{
			scanf("%d",&x[i]);
		}
		kase=0;
		dfs(1,1,1);
		if(kase)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
	}
	return 0;
} 

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

int main(){
    int N;
    cin>>N;
    vector<int> v,wa;
    int tmp;
    for(int i=0;i<N;i++){
        cin>>tmp;
        v.push_back(tmp);
        if(i==0){
            wa.push_back(abs(v[i]));
        }else{
            tmp=wa[i-1];
            wa.push_back(tmp+abs(v[i]-v[i-1]));
        }
    }
    tmp=wa[N-1];
    wa.push_back(tmp+abs(v[N-1]));
    
    for(int i=0;i<N;i++){
        if(i==0){
            cout<<abs(v[1])+wa[N]-wa[1]<<endl;
        }else if(i==N-1){
            cout<<wa[N-2]+abs(v[N-2])<<endl;
        }else{
            cout<<wa[N]-wa[i+1]+wa[i-1]+abs(v[i+1]-v[i-1])<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 2164
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(_,v.size())cout<<" "<<v[_];cout<<endl;
#define show2d(v) rep(_,v.size()){rep(__,v[_].size())cout<<" "<<v[_][__];cout<<endl;}cout<<endl;
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 1e18+10 : 1e9+10;
int dx[]={0,1,0,-1,1,1,-1,-1};
int dy[]={1,0,-1,0,1,-1,1,-1};//RDLU

signed main(){
	int d,n,b;
	cin>>d>>n>>b;
	vd p(n),h(n);
	rep(i,n)cin>>p[i]>>h[i];
	double out=inf;
	loop(i,1,b+2){		
		
		double l=sqrt((double)d/i/2),r=1000000;
		while(r-l>EPS){
			double vy=(l+r)/2;
			double vx=(double)d/i/2/vy;
			double x=0;
			bool ok=true;
			int t=0;
			rep(j,i){
				double nx=x+(double)d/i;
				while(t!=n&&p[t]<nx){
					// cout<<t<<" "<<p[t]-x<<" "<<-0.5*(p[t]-x)*(p[t]-x)/vx/vx<<" "<<vy*(p[t]-x)/vx<<endl;
					double y=-0.5*(p[t]-x)*(p[t]-x)/vx/vx+vy*(p[t]-x)/vx;
					// cout<<vx<<" "<<vy<<" "<<y<<endl;
					if(y<h[t])ok=false;
					t++;
				}
				x=nx;
			}
			if(ok)r=vy;
			else l=vy;
		}
		double vy=l,vx=(double)d/i/2/vy;
		cmin(out,hypot(vx,vy));
	}	
	cout<<shosu(9)<<out<<endl;
}











Measured memory_bytes: 3352
#include <bits/stdc++.h>
using namespace std;
template<typename Ty>
struct SuffixArray
{
	vector<Ty> in;
	vector<int> out;
	vector<int> height;
	template<typename Pt>
		SuffixArray(Pt begin, Pt end) : in(begin, end) {}

	vector<int> build() {
		int n = (int)in.size(), c = 0;
		vector<int> temp(n), pos2bckt(n), bckt(n), bpos(n);
		out.resize(n);
		for (int i = 0; i < n; i++) out[i] = i;
		sort(out.begin(), out.end(), [&](int a,int b) { return in[a] < in[b];});
		for(int i = 0; i < n; i++) { bckt[i] = c; if (i+1 == n || in[out[i]] != in[out[i+1]]) c++; }
		for(int h = 1; h < n && c < n; h <<= 1) {
			for (int i = 0; i < n; i++) pos2bckt[out[i]] = bckt[i];
			for (int i = n-1; i>=0; i--) bpos[bckt[i]] = i;
			for (int i = 0; i < n; i++) if (out[i] >= n-h) temp[bpos[bckt[i]]++] = out[i];
			for (int i = 0; i < n; i++) if (out[i] >= h) temp[bpos[pos2bckt[out[i]-h]]++] = out[i]-h;
			c = 0;
			for (int i = 0; i + 1 < n; i++) {
				int a = (bckt[i] != bckt[i+1]) || (temp[i] >= n-h) || pos2bckt[temp[i+1]+h] != pos2bckt[temp[i]+h];
				bckt[i] = c;
				c += a;
			}
			bckt[n-1] = c++;
			temp.swap(out);
		}
		return out;
	}

	vector<int> lcparray() {
		if (in.size() != out.size()) build();
		int n = (int)in.size();
		if (n == 0)
			return vector<int>();
		vector<int> rank(n); // temporary

		height.resize(n-1); // output lcp array
		for(int i = 0; i < n; i ++) rank[out[i]] = i;
		int h = 0;
		for(int i = 0; i < n; i ++) {
			if(rank[i] == 0) continue;
			int j = out[rank[i]-1];
			while(i+h < n && j+h < n && in[i+h] == in[j+h]) h++;
			height[rank[i]-1] = h;
			if(h > 0) h--;
		}
		return height;
	}
};
string s;
int K;
vector<int>v;
int main(){
    cin>>s>>K;
	SuffixArray<char> sa(s.begin(), s.end());
    sa.build();
    sa.lcparray();
    v.push_back(0);
    for(int idx = 0 ; idx < sa.out.size() ; idx++){
        if(K <= s.size() - sa.out[idx]){
            for(int i=0;i<K;i++){
                cout<<sa.in[sa.out[idx]+i];
            }
            cout<<'\n';
            return 0;
        }
        K -= s.size() - sa.out[idx] - sa.height[idx];
    }
    return 0;
}


Measured memory_bytes: 384
#ifndef LOCAL
#pragma GCC optimize("O3")
#endif
#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
#define endl '\n'
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7 ;
const ll N = 1e5 + 10 ;

int main(){
    fastio
   int a,b,c,d;
   cin>>a>>b>>c>>d;
   cout<<(a-c)*(b-d)<<endl;
    return 0 ;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define long long long
#define read cin >>
#define echo cout <<
#define fin << endl
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

// data想定: vector<string>
// 例 max_h 3 max_w 3 の場合
// ...
// .#.
// ...
// 関数にはdata自体はコピーで渡してしまっているため、もし複数回呼ぶ可能性があるなら
// &dataにしてポインタ渡しに変更すること
// 初期ではstring中の'.'が進めるところ扱いにしている。
// 求めるべき値は指定した場所から最短経路でいくことができる最大距離になっているため、
// 問題ごとに適宜変更すること
// また初期のlibraryとしては上下左右のみ。斜めが必要であればその分変更すること
int map_search(int now_h, int now_w, int max_h, int max_w,
               vector<string> data) {
  // initial value
  int fx[] = {0, 1, 0, -1};
  int fy[] = {1, 0, -1, 0};
  int forward_count = 4;
  char forwardable = '.';
  vector<vector<bool>> visited(max_h, vector<bool>(max_w, false));
  vector<vector<int>> dist(max_h, vector<int>(max_w, 0));
  queue<pair<int, int>> q;

  // start
  q.push(make_pair(now_h, now_w));
  visited[now_h][now_w] = true;

  int move_dist = 0;
  while (!q.empty()) {
    pair<int, int> p = q.front();
    q.pop();
    REP(i, forward_count) {
      int next_h = p.first + fx[i];
      int next_w = p.second + fy[i];
      if (next_h >= 0 && next_h < max_h && next_w >= 0 && next_w < max_w &&
          !visited[next_h][next_w] && data[next_h][next_w] == forwardable) {
        visited[next_h][next_w] = true;
        int next_dist = dist[p.first][p.second] + 1;
        dist[next_h][next_w] = next_dist;
        q.push(make_pair(next_h, next_w));
        move_dist = max(move_dist, next_dist);
      }
    }
  }
  return move_dist;
}

int main() {
  int h, w;
  vector<string> data(25);
  read h >> w;
  REP(i, h) { read data[i]; }
  int ans = 0;
  REP(i, h) {
    REP(j, w) {
      if (data[i][j] == '.') {
        ans = max(ans, map_search(i, j, h, w, data));
      }
    }
  }
  echo ans fin;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<fstream>
#include<algorithm>
using namespace std;
using ll = long long;


int main(){
    ll n;
    ll cnt = 0;
    cin >> n;
    vector<char> str(10);
    vector<string> s(n);
    map<string,ll> mp;
    for(ll i=0;i<n;i++){
        cin >> s[i];
        for(ll j=0;j<10;j++){
            str[j] = s[i][j];
        }
        sort(str.begin(),str.end());
        for(ll j=0;j<10;j++){
            s[i][j] = str[j];
        }
    }
    for(ll i=0;i<n;i++){
        mp[s[i]]++;
    }
    ll sum = 0;
    for(auto itr = mp.begin(); itr != mp.end(); itr++){
        ll temp = itr->second;
        sum += (temp*(temp-1)/2);
    }
    cout << sum << endl;
}

Measured memory_bytes: 18176
N=int(input())
B=list(map(int, input().split()))
INF=float('inf')
A=[(-1)*INF]*N
A[0]=A[1]=B[0]
for i in range(1,N-1):
    A[i+1]=B[i]
    A[i]=min(A[i],A[i+1])
print(sum(A))

Measured memory_bytes: 62036
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		for (int i = 0; i < arr.length - 1; i++) {
			if (arr[i] == arr[i + 1]) {
				System.out.println((i + 1) + " " + (i + 2));
				return;
			}
			if (i < arr.length - 2 && arr[i] == arr[i + 2]) {
				System.out.println((i + 1) + " " + (i + 3));
				return;
			}
		}
		System.out.println("-1 -1");
	}
}


Measured memory_bytes: 27564
a,b,c,x,y=map(int,input().split())
p1=a*x+b*y
p2=max(x,y)*c*2
if x>y:
    p3=y*c*2+(x-y)*a
else:
    p3=x*c*2+(y-x)*b
print(min(p1,p2,p3))


Measured memory_bytes: 3060
#include <iostream>
#include<bits/stdc++.h>
#define int long long int
#define vi vector<int>
#define vvi vector<vector<int>>
using namespace std;
int res(int a,int b)
{
    int sum=0;
    while(1)
    {
        if(b>a)
        return sum;
        b*=2;
        sum++;
    }
}

int32_t main() {
	// your code goes here
	int t,x=1;
	
	  //cout<<"Case #"<<x++<<":\n";
	  int n,i,j,k,a,b,c;
	cin>>a>>b>>c>>k;
	if(res(a,b)+res(b*pow(2,res(a,b)),c)<=k)
	cout<<"Yes\n";
	else cout<<"No\n";
	  
	    
	  
	
	
	return 0;
}


Measured memory_bytes: 3800
use proconio::{fastout, input};

fn pow(mut x: u64, mut y: u64, z: u64) -> u64 {
    let mut a = 1;
    while y > 0 {
        if y & 1 == 1 {
            a = a * x % z;
        }
        x = x * x % z;
        y = y >> 1;
    }
    a
}

fn inv(x: u64, m: u64) -> u64 {
    pow(x, m - 2, m)
}

// fn comb(n: u64, r: u64, m: u64, fact: &Vec<u64>) -> u64 {
//     if r < 0 || r > n {
//         0
//     } else {
//         fact[n] * inv(fact[r], m) % M * inv(fact[n - r], m) % M
//     }
// }

#[fastout]
fn main() {
    input! {
        n: u64, m: u64, k: u64,
    }
    const M: u64 = 998244353;
    let mut fact = vec![0; 200_100];
    fact[0] = 1;
    for i in 1..fact.len() {
        fact[i] = i as u64 * fact[i - 1] % M;
    }
    let mut ans = 0;
    for i in 0..=k {
        let cnt = m * pow(m - 1, n - 1 - i, M) % M;
        let nn = (n - i) as usize;
        let rr = i as usize;
        let nr = nn + rr - 1;
        let comb = fact[nr] * inv(fact[rr], M) % M * inv(fact[nr - rr], M) % M;
        ans = (ans + cnt * comb % M) % M;
    }
    println!("{}", ans);
}


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

int cmp(const void *a,const void *b){
  return *(int *)a-*(int *)b;
}

void run(void){
  int n;
  scanf("%d",&n);
  int *a=(int *)calloc(n,sizeof(int));
  int i;
  for(i=0;i<n;i++) scanf("%d",a+i);
  qsort(a,n,sizeof(int),cmp);
  int ans=0;
  for(i=30;i>=1;i--){
    int p=0;
    int q=n-1;
    while(p<q){
      if(a[p]+a[q]==(1<<i)){
	ans++;
	a[p++]=0;
	a[q--]=0;
      } else if(a[p]+a[q]<(1<<i)){
	p++;
      } else {
	q--;
      }
    }
    int len=0;
    for(p=0;p<n;p++){
      if(a[p]){
	a[len++]=a[p];
      }
    }
    n=len;
  }
  printf("%d\n",ans);
}

int main(void){
  run();
  return 0;
}


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


int a[100005] ;
int main(){
	int N , K , Q , x ;
	cin >> N >> K >> Q ;
	for( int i = 0 ; i < Q ; i++ ){
		cin >> x ;
		if( x > 1 ){
			a[1] += -1 ;
			a[x] += 1 ;
		}
		if( x < N ){
			a[x+1] += -1 ;
		}
		// for( int i = 1 ; i <= N ; i++ ){
		// 	cout << a[i] << " " ;
		// }
		// puts("");
	}

	for( int i = 1 ; i <= N ; i++ ){
		a[i] = a[i] + a[i-1] ;
		// cout << a[i] << " " ;
		if( K + a[i] > 0 ) puts("Yes");
		else puts("No");
	}


	return 0 ;
}

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    vector<int> A(N+1),B(N+1,0);
    for (int i=0;i<N;++i) cin >> A[i+1];
    for (int i=N;i>0;--i){
        int cnt=0;
        for (int j=i*2;j<=N;j+=i) cnt^=B[j];
        B[i]=cnt^A[i];
    }
    vector<int> b;
    for (int i=1;i<=N;++i) if (B[i]){
        b.emplace_back(i);
    }
    int s=b.size();
    cout << s << endl;
    for (int i=0;i<s;++i){
        cout << b[i];
        if (i!=s-1) cout << ' ';
        else cout << endl;
    }
}

Measured memory_bytes: 3192
#coding:utf-8

a, b, c = map(int, raw_input(). split())
L = []
for i in xrange(a, b + 1):
    L.append(i)
y = 0
div = 0
for n in L:
    x = c % L[y]
    y += 1
    if x == 0:
        div += 1

print(div) 

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

int main() {
  string S,T;
  cin>>S>>T;
  int Z=0;
  for(int i=0;i<3;i++){
    if(S.at(i)==T.at(i)){
      Z++;
    }
  }
  cout<<Z<<endl;
}

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

using namespace std;

bool a[1000000];

int main()
{
    memset(a, true, sizeof(a));

    int n;
    while (~scanf("%d", &n)) {
        for (int i = 2; i * i <= n; ++i) {
            if (!a[i]) continue;
            for (int j = i + i; j <= n; j += i) a[j] = false;
        }
        int cnt = 0;
        for (int i = 2; i <= n; ++i) cnt += a[i];
        printf("%d\n", cnt);
    }
}

Measured memory_bytes: 2172
#include <iostream>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
using ll = long long;

int main()
{
    int n;
    cin >> n;
    int a[n+1];
    rep(i,n) cin >> a[i+1];

    int ans[n+1] = {0};
    int num[n+1] = {0};
    
    for( int i = n; i >= 1; i-- ){
        int tmp = 0;
        for( int j = 1; j < n+1; j++ ){
            if( i*j > n ) break;
            tmp += ans[i*j];
        }
        if( tmp%2 != a[i] ){
            ans[i] ++;
        }
    }

    int check=0;
    for( int i = n; i >= 1; i-- ){
        int tmp = 0;
        for( int j = 1; j < n+1; j++ ){
            if( i*j > n ) break;
            tmp += ans[i*j];
        }
        if( tmp%2 != a[i] ){
            check = -1;
            break;
        }
    }

    int m = 0;
    for( int i = 1; i < n+1; i++ ){
        if( ans[i] > 0 ){
            m++;
        }
    }

    if( check == -1 ){
        cout << "-1" << endl;
    }else{
        if ( m == 0 ){
            cout << m << endl;
        } else {
            cout << m << endl;
            for( int i = 1; i < n+1; i++ ){
                if( ans[i] != 0 ){
                    cout << i << " ";
                    
                }
            }
            cout << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 3200
#include<iostream>
#include<cmath>
#include<vector>
#include<set>
#include<algorithm>
#include<tuple>
#include<utility>
#include<cctype>
#include<climits>
#include<map>
#include<queue>
#include<functional>

using namespace std;
template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}

#define REP(i,a,n) for(int i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define REV(v) reverse(v.begin(),v.end())
#define SRT(v) sort(v.begin(),v.end())
#define MOD 1000000007

typedef long long ll;
typedef tuple<int,int,bool> Tb;

int atcoder(){
    //入力
    int n;
    cin >> n;
    string a[110];
    bool ans = false;
    REP(i,0,n){
        cin >> a[i];
        if(a[i]=="Y") ans =true;
    }
    //処理
    //出力
    if(ans) cout << "Four" << ENT;
    else cout << "Three" << ENT;
    return 0;
}

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


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>

#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <math.h>

using namespace std;


int main() {
  int N;
  scanf("%d", &N);

  vector<int> a(N);
  for(int i = 0; i < N; i++){
    scanf("%d", &a[i]);
  }

  int ans = 0;
  for(int each: a){
    int tmp = each;

    while(true){
      if(tmp % 2 == 1){
        break;
      }else{
        tmp /= 2;
        ans++;
      }
    }
  }

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

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#define ll long long
const int cnt=1e6+7;
using namespace std;
int main()
{


    int k;
    cin>>k;
    bool flag=0;
    ll sum=0;
    int ans;
	for(int i=0;i<cnt;i++)
	{
		sum=(sum*10+7)%k;
		if(sum%k==0)
		{
			flag=1;
			ans=i+1;

			break;
		}
	}
	if(flag) cout<<ans;
    else cout<<"-1";

	return 0;
}


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

#define in cin
#define out cout

#define REP(i,n) for(int i=0; i<n; i++)
#define REP2(i,s,e) for(int i=s; i<e; i++)
#define REPE(i,s,e) for(int i=s; i<=e; i++)
#define REPR(i,s,e) for(int i=s; i>=e; i--)

#define all(v) v.begin(), v.end()
#define pb push_back

#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define rd(n) scanf("%d", &n)

#define x first
#define y second
#define intINF 2147483647
#define llINF 9223372036854775807LL
#define MOD 1000000007

int main()
{

    ll h, w; int n; scanf("%lld%lld%d", &h, &w, &n);
    pii v[101010];
    set<pii> MP, DONE;
    REP(i, n)
    {
        scanf("%d%d", &v[i].x, &v[i].y);
        MP.insert({v[i].x, v[i].y});
    }

    ll ans[10]; memset(ans, 0, sizeof(ans));
    REP(i, n)
    {
        REPE(dx,-2,0) REPE(dy,-2,0)
        {
            int sx = v[i].x+dx;
            int sy = v[i].y+dy;
            if(DONE.find({sx, sy}) != DONE.end()) continue;
            if(sx <= 0 || sx > h-2 || sy <= 0 || sy > w-2) continue;

            char count = 0;
            REPE(x,sx,sx+2) REPE(y,sy,sy+2)
            {
                count+=(MP.find({x, y}) != MP.end());
            } ans[count]++;

            DONE.insert({sx, sy});
        }
    }

    ll sum = 0;
    REP2(i, 1, 10) sum += ans[i];
    ans[0] = (h-2LL)*(w-2LL) - sum;
    REP(i, 10) out << ans[i] << "\n";


    return 0;
}


Measured memory_bytes: 47872
use proconio::{input, fastout};
use proconio::marker::Usize1;

macro_rules! chmin {
    ($base:expr, $($cmps:expr),+ $(,)*) => {{
        let cmp_min = min!($($cmps),+);
        if $base > cmp_min {
            $base = cmp_min;
            true
        } else {
            false
        }
    }};
}

macro_rules! chmax {
    ($base:expr, $($cmps:expr),+ $(,)*) => {{
        let cmp_max = max!($($cmps),+);
        if $base < cmp_max {
            $base = cmp_max;
            true
        } else {
            false
        }
    }};
}

macro_rules! min {
    ($a:expr $(,)*) => {{
        $a
    }};
    ($a:expr, $b:expr $(,)*) => {{
        std::cmp::min($a, $b)
    }};
    ($a:expr, $($rest:expr),+ $(,)*) => {{
        std::cmp::min($a, min!($($rest),+))
    }};
}

macro_rules! max {
    ($a:expr $(,)*) => {{
        $a
    }};
    ($a:expr, $b:expr $(,)*) => {{
        std::cmp::max($a, $b)
    }};
    ($a:expr, $($rest:expr),+ $(,)*) => {{
        std::cmp::max($a, max!($($rest),+))
    }};
}

fn dfs(g: &Vec<Vec<usize>>,
        dp: &mut Vec<usize>,
        used: &mut Vec<bool>,
        i: usize,
        cnt: &mut usize)
-> usize {
    *cnt += 1;
    if used[i] {
        return dp[i];
    }

    used[i] = true;
    let mut res: usize = 0;
    for j in &g[i] {
        chmax!(res, dfs(g, dp, used, *j, cnt) + 1);
    }
    dp[i] = res;
    dp[i]
}

#[fastout]
fn main() {
    input! {
        n: usize,
        m: usize,
        xy: [(Usize1, Usize1); m],
    }

    let mut g: Vec<Vec<usize>> = vec![vec![]; n];
    let mut dp: Vec<usize> = vec![0; n];
    let mut used: Vec<bool> = vec![false; n];

    for item in xy {
        g[item.0].push(item.1);
    }

    let mut cnt: usize = 0;
    let mut ans = 0;
    for i in 0..n {
        chmax!(ans, dfs(&g, &mut dp, &mut used, i, &mut cnt));
    }
    println!("{}", ans);

}


Measured memory_bytes: 12572
#include <iostream>
using namespace std;
typedef long long ll;
ll n, m, a[210000], b[210000], x, y, res;
int main(void){
    // Your code here!
    cin >> n >> m;
    for (ll i = 1; i <= n; i++) a[i] = 1;
    b[1] = 1;
    for (ll j = 0; j < m; j++) {
        cin >> x >> y;
        if (b[x] == 1) {
            b[y] = 1;
            if (a[x] == 1) b[x] = 0;
        }
        a[x]--; a[y]++;
    }
    for (ll i = 1; i <= n; i++) res += b[i];
    cout << res << endl;
}


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

using namespace std;
#define FOR(i,a,b) for(int (i) = (a); (i) < (b); (i)++)
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)

int main(){
  int n;
  const int max_n = 2 * 1e5;
  cin >> n;
  string s[n];
  for(int i = 0; i < n; i++) cin >> s[i];

  map<string, int> mp;
  vector<string> ans;

  for(int i = 0; i < n; i++){
    mp[s[i]] = 0;
  }
  for(int i = 0; i < n; i++){
    mp[s[i]] += 1;
  }
  int max_count = 0;
  for(int i = 0; i < n; i++){
    max_count = max(max_count, mp[s[i]]);
  }
  // cout << max_count << endl;

  for(int i = 0; i < n; i++){
    if(mp[s[i]] == max_count) ans.push_back(s[i]);
  }
  sort(ans.begin(), ans.end());
  cout << ans[0] << endl;
  for(int i = 1; i < ans.size(); i++){
    if(ans[i] != ans[i-1]) cout << ans[i] << endl;
  }



  return 0;
}

Measured memory_bytes: 28404
#include<bits/stdc++.h>
using namespace std;
typedef long long hey;
#define hi string
#define pi 3.141592653589793238
#define fi first
#define mod 1000000007
#define se second
#define pb push_back 
#define pop pop_back 
#define bs binary_search
#define mp make_pair
#define ma map< hey,hey >
#define vi vector < hey > 
#define vs vector < hi > 
#define all(v) v.begin(),v.end()
#define qu priority_queue< hey >
#define endl '\n'
#define forn(a,b) for (hey i = a; i <hey(b); ++i)
#define yorn(i, n) for (hey i = 0; i <hey(n); ++i)
#define vp vector< pair<hey,hey> >
// lower bound - first element equal to or greater than given value.
// upper bound - first element greater than given value.
        // 2 Pointers is love
hey prime(hey n)
{
    if(n<=1)
	return 0;
	if(n<=3)
	return 1;
	if(n%2==0 || n%3==0)
	return 0;
	for(hey i=5;i*i<=n;i=i+6)
	{
		if(n%i==0 || n%(i+2)==0)
		return 0;
	}
	return 1;
}

void curious()
{
    hey x,y,p=0;
    cin>>x>>y;
    hey a[y];
    hey b[105]={0};
    forn(i,y)
    {
        cin>>a[i];
        b[a[i]]=1;
    }
    hey l=x,r=x;
    while(1)
    {
        if(!b[l])
        {
            cout<<l;
            return;
        }
        if(!b[r])
        {
            cout<<r;
            return;
        }
        l--;r++;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t=1;
	//cin>>t;
	while(t--)
	{
	    curious();
	}
	return 0;
}


Measured memory_bytes: 3608
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define REP(X, Y, Z) for (ll(X) = (Y); (X) < (Z); (X)++)

using namespace std;
using ll = long long;
using dll = deque<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using usll = unordered_set<ll>;
using umll = unordered_map<ll, ll>;
using sll = stack<int>;
using vll = vector<ll>;
using vvll = vector<vll>;

constexpr ll kMod = 1e9 + 7;

ll gcd(ll a, ll b) {
  if (a < b) {
    return gcd(b, a);
  }
  ll c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}

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

void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

int main() {
  init();

  ll N;
  cin >> N;
  vll D(N);
  REP(i, 0, N) {
    ll d;
    cin >> d;
    D[i] = d;
  }
  sort(D.begin(), D.end(), less<>());

  ll idx1 = D.size() / 2 - 1;
  ll idx2 = D.size() / 2;
  cout << D[idx2] - D[idx1] << endl;

  return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int H1 = sc.nextInt();
		int M1 = sc.nextInt();
		int H2 = sc.nextInt();
		int M2 = sc.nextInt();
		int K = sc.nextInt();
		sc.close();
		int okiruMin = (H1 * 60) + M1;
		int neruMin = (H2 * 60) + M2;
		int okiteruMin = neruMin - okiruMin;
		int answer = 0;
		// System.out.println(okiteruMin);
		if(okiteruMin > 0) {
			answer = okiteruMin - K;
		}
		System.out.println(answer);
	}
}


Measured memory_bytes: 27080
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <numeric>
 
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
 
int main() {
    int n;
    unsigned long long ans = 0, temp = 0;
 
    cin >> n;
 
    ans = ((ll)(n) * (ll)(n-1)) / 2;
 
    cout << ans << endl;
}

Measured memory_bytes: 256