akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#define ll long long
#define mod 1000000007
#define maxn 200010
inline ll read()
{
	ll x=0; char c=getchar(),f=1;
	for(;c<'0'||'9'<c;c=getchar())if(c=='-')f=-1;
	for(;'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
	return x*f;
}
inline void write(ll x)
{
	static int buf[20],len; len=0;
	if(x<0)x=-x,putchar('-');
	for(;x;x/=10)buf[len++]=x%10;
	if(!len)putchar('0');
	else while(len)putchar(buf[--len]+'0');
}
inline void writeln(ll x){write(x); putchar('\n');}
inline void writesp(ll x){write(x); putchar(' ');}
ll a,b,c,d;
inline ll calc(ll l,ll r,ll d){return r/d-(l-1)/d;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int main()
{
	a=read(); b=read(); c=read(); d=read();
	writeln((b-a+1)-calc(a,b,c)-calc(a,b,d)+calc(a,b,lcm(c,d)));
	return 0;
}

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

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)

#define ALL(v) v.begin(), v.end()

int main() {
  std::cout << std::fixed << std::setprecision(20);


  int H1, M1, H2, M2, K;
  cin >> H1 >> M1 >> H2 >> M2 >> K;

  int t = M2 - M1;
  if(t > 0){
    t = t + (H2 - H1)*60;
  }else{
    t = t+60 + (H2 - H1 - 1)*60;
  }

  int ans = t - K;

  cout << ans << endl;

}

Measured memory_bytes: 3632
def primesbelow(N):
    # http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python/3035188#3035188
    #""" Input N>=6, Returns a list of primes, 2 <= p < N """
    correction = N % 6 > 1
    N = {0:N, 1:N-1, 2:N+4, 3:N+3, 4:N+2, 5:N+1}[N%6]
    sieve = [True] * (N // 3)
    sieve[0] = False
    for i in range(int(N ** .5) // 3 + 1):
        if sieve[i]:
            k = (3 * i + 1) | 1
            sieve[k*k // 3::2*k] = [False] * ((N//6 - (k*k)//6 - 1)//k + 1)
            sieve[(k*k + 4*k - 2*k*(i%2)) // 3::2*k] = [False] * ((N // 6 - (k*k + 4*k - 2*k*(i%2))//6 - 1) // k + 1)
    return [2, 3] + [(3 * i + 1) | 1 for i in range(1, N//3 - correction) if sieve[i]]

n=int(input())
primes=primesbelow(n+10)
factor={}

def val(n,d):
    ans=0
    t=d
    while(t<=n):
        ans+=(n//t)
        t*=d
    return ans
g2=0
g4=0
g24=0
g14=0
g74=0
for i in primes:
    k=val(n,i)
    if k>=4:
        g4+=1
    if k>=2:
        g2+=1
    if k>=24:
        g24+=1
    if k>=14:
        g14+=1
    if k>=74:
        g74+=1

a=(g2-2)*((g4*(g4-1))//2)
b=g24*(g2-1)
c=g14*(g4-1)
d=g74
print(a+b+c+d)

Measured memory_bytes: 62744
/*
digu_J - Digvijay Janartha
NIT Hamirpur - INDIA
*/

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

const long long N = 2e3 + 5, MOD = 1e9 + 7;

int n, dp[N], pre[N];

void test() {
    cin >> n;
    pre[0] = pre[1] = pre[2] = 1;
    for (int sum = 3; sum <= n; ++sum) {
        dp[sum] = pre[sum - 3];
        pre[sum] = (pre[sum - 1] + dp[sum]) % MOD;
    }
    cout << dp[n] << "\n";
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #ifdef HOME
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int t = 1;
    // cin >> t;
    for (int i = 0; i < t; ++i) {
        test();
    }
    return 0;
}


Measured memory_bytes: 3648
// vim: set fdm=marker:
// {{{
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <utility>

using namespace std ;

typedef long long ll ;

// }}}

int H, W, A, B;

int oneLessHCnt, oneLessWCnt;

void preCalc() {
    for (int i = 0 ; i <= H ; i++) {
        for (int j = 0 ; j <= W ; j++) {
            if (i*(A) + (H-i)*(W-A) == j*B + (W-j)*(H-B)) {
                oneLessHCnt = i;
                oneLessWCnt = j;
                return;
            }
        }
    }
    cout << -1 << endl;
    exit(0);
}

char ans[1111];

int main()
{
    cin >> H >> W >> A >> B;
    preCalc();
    priority_queue<pair<int, int>> quota;
    for (int c = 0 ; c < W ; c++) {
        if (c < oneLessWCnt)
            quota.push({B, c});
        else
            quota.push({H-B, c});
    }
    for (int r = 0 ; r < H ; r++) {
        memset(ans, 0, sizeof(ans));
        vector<pair<int, int>> buf;
        for (int i = 0 ; i != (r < oneLessHCnt ? A : W-A) ; i++) {
            auto p = quota.top();
            quota.pop();
            ans[p.second] = 1;
            buf.push_back({p.first-1, p.second});
        }
        for (int c = 0 ; c < W ; c++)
            putchar(ans[c] ? '1' : '0');
        putchar('\n');
        for (auto p: buf)
            quota.push(p);
    }
    return 0;
}




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

#define sz(a) (int)a.size()
#define re return
#define fi first
#define se second
#define pb push_back
#define all(a) a.begin(), a.end()
#define gr greater <int>

#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")

using namespace std;

typedef long long ll;
typedef string str;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;

///!!!<3<3<3<3<3!!!
void ProdamGaraje () {
   set <str> s;
   int n;
   cin >> n;
   for (int i = 0; i < n; ++i) {
      str s1;
      cin >> s1;
      s.insert(s1);
   }
   cout << sz(s);
}
///!!!<3<3<3<3<3!!!
int main () {
   //freopen ("input.txt", "r", stdin);
   //freopen ("output.txt", "w", stdout);
   ios::sync_with_stdio(0);
   cin.tie(0); cout.tie(0);
   int tt = 1;
   //cin >> tt;
   while (tt--)
      ProdamGaraje ();
}
///GOOOOOOSE!!!!
/*
     ▄▀▀▀▄
▄███▀░0░░░▌
    ▌░░░░░▐
    ▌░░░░░▐
     ▌▌ ▌▌
     ▌▌ ▌▌
     ▌▌ ▌▌
     ▌▌ ▌▌
     ▌▌ ▌▌
   ▄▄▌▌▄▌▌        */


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

if N / 10 < 1:
	print(N)
elif N / 10 >= 1 and N / 100 < 1:
	print(9)
elif N / 100 >= 1 and N / 1000 < 1:
	print(9 + N - 99)
elif N / 1000 >= 1 and N / 10000 < 1:
	print(9 + 900)
elif N / 10000 >= 1 and N / 100000 < 1:
	print(9 + 900 + N - 9999)
else:
	print(9 + 900 + 90000)

Measured memory_bytes: 3060
#include<iostream>
#include<iomanip>
#include<cassert>
#include<stdexcept>
#include<utility>
#include<functional>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<array>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<complex>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<bitset>
#include<memory>
using namespace std;
using ll=long long;

int main(){
    int s,w;
    cin>>s>>w;
    cout<<(w>=s ? "unsafe" : "safe")<<endl;
    
    return 0;
}


Measured memory_bytes: 3644
#pragma comment(linker, "/stack:336777216")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#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;
typedef long double ld;
typedef unsigned long long ull;
#define X first
#define Y second
#define mp make_pair
template<class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<class T, class X> using indexed_map = tree<T, X, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int M = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

int modpow(int n, int k, int MOD);

/**************** code starts here ****************/

void poppingfever() {
	int n, k; cin >> n >> k;
	for (int i = 1; k > 0; k--, i += 2) {
		if (i > n) {cout << "NO"; return;}
	}
	cout << "YES";
}

/**************************************************/

signed main() {
	#ifdef fastfurioustransform
	freopen("inp.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
	#endif
 
	ios::sync_with_stdio(0); cin.tie(0);
	//cout << fixed << setprecision(12);
 
	int t = 1; //cin >> t;
	for (int i = 1; i <= t; i++) {
		poppingfever();
	}
 
	return 0;
}

int modpow(int n, int k, int MOD) {
	int ans = 1; n %= MOD;
	while (k > 0) {
		if (k & 1) ans = (ans*n) % MOD;
		k >>= 1; n = (n*n) % MOD;
	}
	return ans;
}

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

def kai(kane_kabu, kakaku):
  kabu = int(kane_kabu[0] / kakaku)
  kane = kane_kabu[0] % kakaku
  return [kane, kabu]

def uri(kane_kabu, kakaku):
  kane = kane_kabu[1] * kakaku + kane_kabu[0]
  kabu = 0
  return [kane, kabu]


kane_kabu = [1000, 0]

for i in range(n-1):
  if kane_kabu[1] == 0:
    kae = 1
    ure = 0
  else:
    kae = 0
    ure = 1
  for j in range(i+1, n):
    if a[i] >= a[j] and kane_kabu[1] == 0:
      kae = 0
      break
    elif a[i] < a[j] and kane_kabu[1] == 0:
      break
    if a[i] <= a[j] and kane_kabu[1] > 0:
      ure = 0
      break
    elif a[i] > a[j] and kane_kabu[1] > 0:
      break
  if ure == 1:
    kane_kabu = uri(kane_kabu, a[i])
  elif kae == 1:
    kane_kabu = kai(kane_kabu, a[i])

if kane_kabu[1] > 0:
  kane_kabu = uri(kane_kabu, a[n-1])
print(kane_kabu[0])

Measured memory_bytes: 9260
S = input()
T = input()
min = 100000000 # 変更が必要な文字数の最大値
for i in range(len(S)-len(T)+1):
  s = 0 # 何文字変更が必要か
  for j in range(len(T)):
    if S[i+j] != T[j]:
      s = s + 1
  if s < min:
    min = s

print(min)

Measured memory_bytes: 9016
//#include <fsociety>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <iostream>
//end of libraries ;
#define INF 9999999999
#define N 300003
#define F first
#define S second
#define pb push_back
#define ll long long
#define fcin ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
using namespace std;
bool rv_sort(pair<int,int> a , pair<int,int> b) { if(a.F>b.F) return true; return false; }

int n , a [N] , e_cmax1 , e_cmax2 , o_cmax1 , o_cmax2 , ans; 

pair<int,int> even[N] ,odd[N];

int main(){
fcin;
	cin>>n;
	for(int i = 0 ; i < n ; i++){
		cin>>a[i];
		if(i%2==0) { even[a[i]].F++; even[a[i]].S = a[i]; }
		else { odd[a[i]].F++; odd[a[i]].S = a[i]; }
	}
	sort(even,even+N,rv_sort);
	sort(odd,odd+N,rv_sort);
	e_cmax1 = even[0].F; e_cmax2 = even[1].F;
	o_cmax1 = odd[0].F; o_cmax2 = odd[1].F;
	if(even[0].S != odd[0].S) {
		ans = e_cmax1 + o_cmax1;
	}
	else {
		ans = max(e_cmax2 + o_cmax1, e_cmax1 + o_cmax2);
	}
	cout<<n-ans<<endl;
}

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

int
main(void)
{
	double x[2], y[2];

	scanf("%lf%lf%lf%lf", &x[0], &y[0], &x[1], &y[1]);

	printf("%lf\n", sqrt((x[1] - x[0]) * (x[1] - x[0]) +
			    (y[1] - y[0]) * (y[1] - y[0]) ));

	return 0;
}



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

ll gcd(ll x,ll y){
if(x==0) return y;
return gcd(y%x, x);
}
ll lcm(ll x,ll y) {return x*y/gcd(x,y);}

ll nikou(int n, int m) {
	ll qqq = 1;
	for (ll i = 1; i <= m; i++) 
		qqq = qqq * (n - i + 1) / i;
		return qqq;
	}


int main() {
 int n; cin>>n;
  int que[n];
  int quep[n];
  rep(i, n){cin>>que[i];
        quep[i]=que[i];}
  if(que[0]==100&&que[1]==0){cout<<100<<" "<<0<<endl;
  return 0;}
  
  
  
  sort(que,que+n,greater<int>());
  
  int maxs[n];
  rep(i, n){
      maxs[i]=abs(que[0]/2-quep[i]);}
      int mind=-1;
      int maxdif=1000000001;
  rep(i, n){if (maxs[i]<maxdif){mind=i;maxdif=maxs[i];}}
            cout<<que[0]<<" "<<quep[mind]<<endl;
    

  }


Measured memory_bytes: 1408
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define int long long
void read (int &x) {
    char ch = getchar(); x = 0;
    while (!isdigit(ch)) ch = getchar();
    while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar();
} const int N = 1e6 + 6;
int n; char ch[N];
signed main() {
    scanf ("%s", ch + 1);
    n = strlen (ch + 1);
    for (int i = 1; i <= n; ++i) putchar (ch[i]);
    if (ch[n] == 's') puts ("es");
    else puts ("s"); return 0;
}


Measured memory_bytes: 3684
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    if(N < 10)
    cout << N << endl;
    else if(N >= 10 && N < 100)
    cout << "9" << endl;
    else if(N >= 100 && N < 1000)
    cout << 9 + (N - 99) << endl;
    else if(N >= 1000 && N < 10000)
    cout << 900 + 9 << endl;
    else if(N >= 10000 && N < 100000)
    cout << 9 + 900 + (N - 9999) << endl;
    else if(N == 100000)
    cout << 9 + (999-99) + (99999-9999) << endl;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let s: String = read();

    let c1 = s.chars().nth(0).unwrap();
    let c2 = s.chars().nth(1).unwrap();
    let c3 = s.chars().nth(2).unwrap();

    if c1 == c2 && c2 == c3 {
        println!("No");
    } else {
        println!("Yes");
    }
}


Measured memory_bytes: 4352
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void)
{
    ll n;
    cin >> n;
    int num[100001] = {0};
    ll s = 0;
    for(int i = 0; i < n; i++)
    {
        ll a;
        cin >> a;
        num[a]++;
        s += a;
    }
    ll q;
    cin >> q;
    for(int i = 0; i < q; i++)
    {
        ll b,c;
        cin >> b >> c;
        s += c*num[b] - b*num[b];
        num[c] += num[b];
        num[b] = 0;
        cout << s << endl;
    }
}


Measured memory_bytes: 4024
#include<bits/stdc++.h>
using namespace std;
int n,m;
char a[505][505],b[505][505],c[505][505];
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) scanf("%s",a[i]+1);
	for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) b[i][j]=c[i][j]=a[i][j]=='#'?'#':'.';
	for(int i=1;i<=m;i++) b[1][i]=c[n][i]='#';
	for(int j=1;j<=m;j++) for(int i=2;i<n;i++)  if(j&1) b[i][j]='#';else c[i][j]='#';
	for(int i=1;i<=n;i++) printf("%s\n",b[i]+1); puts("");
	for(int i=1;i<=n;i++) printf("%s\n",c[i]+1);
	return 0;
}

Measured memory_bytes: 1536
// D - Derangement
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define out(x) cout << x << '\n'
#define lli long long int
#define uli unsigned long long int
#define rep(i, m, n) for (lli i = m; i < (n); i++)
#define repe(i, m, n) for (lli i = m; i <= (n); i++)
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((lli)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define _GLIBCXX_DEBUG
const lli INF = 2147483647;
const lli MINF = -2147483648;
const lli LINF = 9223372036854775807;
const lli MOD = 1000000007; //10^9+7
const double PI = acos(-1);
#define SORT(n) sort(n.begin(), n.end())
#define SORTR(n) sort(n.begin(), n.end(), greater<int>())
#define REV(n) reverse(n.begin(), n.end())
#define pb push_back
#define eb emplace_back
#define mp make_pair
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vlli = vector<lli>;
using vvli = vector<vlli>;
using vs = vector<string>;
using vvs = vector<vs>;
using vb = vector<bool>;
using vvb = vector<vb>;
using ll = long long;
//---------------------------------------------------------------------------------------------------
// vector入力
template <typename T>
istream &operator>>(istream &is, vector<T> &vec)
{
  for (T &x : vec)
    is >> x;
  return is;
}
// vector出力
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec)
{
  // os << '{';
  for (int i = 0; i < vec.size(); i++)
  {
    os << vec[i] << (i + 1 == vec.size() ? "" : "");
  }
  // os << '}';
  return os;
}
// aよりもbが大きいならばaをbで更新する(更新されたならばtrueを返す)
template <typename T>
bool chmax(T &a, const T &b)
{
  if (a < b)
  {
    a = b; // aをbで更新
    return true;
  }
  return false;
}
// aよりもbが小さいならばaをbで更新する(更新されたならばtrueを返す)
template <typename T>
bool chmin(T &a, const T &b)
{
  if (a > b)
  {
    a = b; // aをbで更新
    return true;
  }
  return false;
}
//---------------------------------------------------------------------------------------------------
lli a = 0, b = 0, c = 0, h = 0, n = 0, w = 0, ans = 0, count = 0;
string s = "", t = "";
vector<pair<lli, lli>> pr;
map<lli, lli> mp;
set<lli> st;

//---------------------------------------------------------------------------------------------------
lli solve()
{
  lli a = 0, b = 0, c = 0, h = 0, n = 0, w = 0, ans = 0, count = 0;
  string s = "", t = "";
  vector<pair<lli, lli>> pr;
  map<lli, lli> mp;
  set<lli> st;

  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  vlli d(n), e(n);
  rep(i, 0, n)
  {
    cin >> d[i];
    if (d[i] == i + 1 && ans == 0)
    {
      count++;
      ans = 1;
    }
    else if (d[i] == i + 1 && ans == 1)
    {
      ans = 0;
    }
    else
    {
      ans = 0;
    }
  }
  return count;
}

//---------------------------------------------------------------------------------------------------
signed main()
{
  out(solve());
}


Measured memory_bytes: 4764
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            SolveA();
            //SolveB();
            //SolveC();
            //SolveD();
        }
        private const long MOD = 1000000007;

        static void SolveA()
        {
            int n = ReadAndParseInt();
            var a = ReadAndParseIntArr();
            var list = new List<int>(a);
            list.Sort();
            int d = list[list.Count - 1] - list[0];
            Console.WriteLine(d);
        }

        #region よく使う便利関数
        private static bool isPrime(long x)
        {
            if (x == 2) { return true; }
            if (x < 2 || x % 2 == 0) { return false; }
            long i = 3;
            while (i * i <= x)
            {
                if (x % i == 0) { return false; }
                i = i + 2;
            }
            return true;
        }
        private static long lcm(long x, long y)
        {
            return x / gcd(x, y) * y;
        }
        private static long gcd(long x, long y)
        {
            return y > 0 ? gcd(y, x % y) : x;
        }
        private static long pow(long x, long n)
        {
            if (n == 0) { return 1; }
            long res = pow(x * x % MOD, n / 2);
            if (n % 2 == 1)
            {
                res = res * x % MOD;
            }
            return res;
        }
        private static int ReadAndParseInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static int[] ReadAndParseIntArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        }
        private static long ReadAndParseLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadAndParseLongArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        }
        #endregion
    }
}

Measured memory_bytes: 11348
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

vector<ll> a = {1};
vector<ll> p = {1};

ll dfs(ll N, ll X) {
    if (N == 0) return (X <= 0) ? 0 : 1;
    if (X <= 1 + a[N - 1]) return dfs(N - 1, X - 1);
    else return p[N - 1] + 1 + dfs(N - 1, X - a[N - 1] - 2);
}

int main() {
    ll N, X; cin >> N >> X;
    a.resize(N + 1);
    p.resize(N + 1);
    for (int i = 0; i < N; ++i) {
        a[i+1] = 2 * a[i] + 3;
        p[i+1] = 2 * p[i] + 1;
    }
    cout << dfs(N, X) << endl;
    return 0;
}


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

int main() {
  long long a,b,c;
  cin>>a>>b>>c;
  bool ans=true;
  if(a+b>c)ans=false;
  else{
    if(4*a*b>=(c-a-b)*(c-a-b))ans=false;
  }
  if(ans)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.*;
import java.awt.Point;

public class Main {
    // static int INF = (1 << 30) - 1;
    // static long L_INF = (1L << 62) - 1;
    // static long MOD = (long) 1e9 + 7;

    static class Solver {
        int A, B, C, D;
        // int[] A;

        // write your code
        void solve(InputReader in, PrintWriter out) {
            A = in.nextInt();
            B = in.nextInt();
            C = in.nextInt();
            D = in.nextInt();

            boolean win = false;
            while (true) {
                C = C - B;
                if (C <= 0) {
                    win = true;
                    break;
                }
                A = A - D;
                if (A <= 0) {
                    win = false;
                    break;
                }
            }

            if (win) {
                out.println("Yes");
            } else {
                out.println("No");
            }
        }

        void debug(Object... os) {
            System.err.println(Arrays.deepToString(os));
        }
    }

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(in, out);
        out.close();
    }

    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


Measured memory_bytes: 32984
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>

using namespace std;

int main() {
  int N;

  cin >> N;
  int yen = 0;
  double btc = 0.0;
  for (int i = 0; i < N; ++i) {
    string x, y;
    cin >> x >> y;
    if (y[0] == 'B') {
      btc += atof(x.c_str());
    } else {
      yen += atoi(x.c_str());
    }
  }

  btc *= 380000.0;

  yen += btc / 1;
  btc = fmod(btc, 1);

  stringstream ss;
  ss << fixed;
  ss << setprecision(8) << btc;

  cout << to_string(yen) << "." <<  ss.str().substr(2) << endl;
  
  return 0;
}


Measured memory_bytes: 512
#include<stdio.h>
#define NIL 0.1

typedef struct node{
  int parent; /*?????????????????????????????????????????????????????\???????????¨?????????*/
  int left;
  int right;
  int key;
}Node;

int parent(int );
int left(int );
int right(int );
Node A[251];

main()/*???????????\??????????????????????????????????????????*/
{
  int i,num;
  scanf("%d",&num);

  for(i=1;i<251;i++)
    {
      A[i].key = NIL;
    }


  for(i=1;i<num+1;i++) /*?????????1????????????*/
    {
      scanf("%d",&A[i].key);
 
      A[i].parent = parent(i);
      A[i].left = left(i);
      A[i].right = right(i);
    }

  for(i=1;i<num+1;i++)
    {
      printf("node %d: key = %d, ",i,A[i].key);
      if(i!=1)printf("parent key = %d, ",A[A[i].parent].key);
      if(A[i].left<= num)printf("left key = %d, ",A[A[i].left].key);
      if(A[i].right<= num)printf("right key = %d, ",A[A[i].right].key);
      printf("\n");
    }
  return 0;

}

int parent(int i)
{
  return i/2;
}

int left(int i)
{
  return 2*i;
}

int right(int i)
{
  return (2*i+1);
}

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

using namespace std;

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

int main() {
    int K;
    cin >> K;

    if (K % 2 == 0) {
        cout << (K / 2) * (K / 2) << endl;
    } else {
        cout << (K / 2) * (K / 2 + 1) << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = acos(-1);
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

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

	ll a, b;
	cin >> a >> b;
	if (a > 0) cout << "Positive" << endl;
	else if (a <= 0 && 0 <= b) cout << "Zero" << endl;
	else {
		if ((b - a + 1) % 2 == 0) cout << "Positive" << endl;
		else cout << "Negative" << endl;
	}
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;

int main() {
    int a, b, c, d, e,ans =5;
    cin >> a >> b >> c >> d >> e;
    if (a == 0)ans = 1;
    if (b == 0)ans = 2;
    if (c == 0)ans = 3;
    if (d == 0)ans = 4;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3636
import re

def main():
    s = list(input())
    sr = ''.join(list(reversed(s)))
    t = ['dream', 'dreamer', 'erase', 'eraser']
    tr = list()
    for i in t:
        tr.append(''.join(list(reversed(i))))
    while sr:
        flag = False
        for i in tr:
            if sr.startswith(i):
                sr = sr.replace(i ,'', 1)
                flag = True
        if not flag:
            print('NO')
            break
        if sr == '':
            print('YES')
            break
if __name__ == '__main__':
    main()

Measured memory_bytes: 4900
# -*- coding: utf-8 -*-
"""
Contents   : AtCoder Regular Contest 095 c問題
Author     : Kitaura Hiromi
LastUpdate : 20180414
Since      : 20180414
"""
import random
import copy

N = int(input())
X = list(map(int, input().split(" ")))
sorted_X = sorted(X)
med1 = sorted_X[N//2-1]
med2 = sorted_X[N//2]
for i in range(N):
    if X[i] <= med1:
        print(med2)
    else:
        print(med1)

Measured memory_bytes: 27108
import java.util.*;

class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int re = 0; //結果用
        for(int i = 0; i < 2; i++){
            if(a > b){
                re = re + a;
                a--;
            }else if(a < b){
                re = re + b;
                b--;
        
            }else if(a == b){
                //減らすのはどっちでもいい
                re = re + a;
                a--;

            }
        }
        System.out.println(re);
    }
}

Measured memory_bytes: 21332
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

int main()
{
    int h, w;
    cin >> h >> w;
    vector<vector<char>> s(h, vector<char>(w));
    rep(i,h) rep(j, w) cin >> s[i][j];
    rep(i,h)rep(j,w){
        if(s[i][j] == '#' && i != 0 && j != 0 && i != h-1 && j != w-1){
            if(s[i+1][j] != '#' && s[i-1][j] != '#' && s[i][j-1] != '#' && s[i][j+1] != '#'){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

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

int main(){
    int N;
    cin >> N;
    int count = 0;
    int min_val = INF;
//  vector<int> nums;
	int nums[200005];
    rep(i,N){
        cin >> nums[i];
//        min_val = min(INF,min_val);
        if(min_val > nums[i]){
            count++;
            min_val = nums[i];
        }
    }
    cout << count << endl;
    return 0;
}



Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
#include <cmath>
#include <climits>
#include <iomanip>
#include <queue>
#include <stack>

using namespace std;

typedef long long ll;

int main() {
    ll n, m;    cin >> n >> m;
    ll *h = new ll[n];
    for (int i = 0; i < n; i++)   {
        cin >> h[i];
    }

    vector<bool> flag(n, true);

    for (int i = 0; i < m; i++) {
        ll a, b;    cin >> a >> b;
        a--, b--;
        if (h[a] > h[b])
            flag[b] = false;
        else if (h[a] < h[b])
            flag[a] = false;
        else  {
            flag[a] = false;
            flag[b] = false;
        }
    }

    ll ans = 0;
    for (int i = 0; i < n; i++) {
        if (flag[i])
            ans++;
    }

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

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

using namespace std;

const int MAXN = 105;

int G[MAXN][MAXN], vis[MAXN], matchl[MAXN], matchr[MAXN];

int a[MAXN], b[MAXN], c[MAXN], d[MAXN];

int n;

int find(int u)
{
	for (int v = 1; v <= n; v++)
	{
		if (!vis[v] && G[u][v])
		{
			vis[v] = 1;
			if (!matchr[v] || find(matchr[v]))
			{
				matchl[u] = v, matchr[v] = u;
				return 1;	
			}
		}
	}
	return 0;
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> a[i] >> b[i];
	for (int i = 1; i <= n; i++)
		cin >> c[i] >> d[i];
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			if (a[i] <= c[j] && b[i] <= d[j])
				G[i][j] = 1;
	int res = 0;
	for (int i = 1; i <= n; i++)
	{
		memset(vis, 0, sizeof(vis));
		if (find(i))
			++res;
	}
	cout << res << endl;
	return 0;	
}


Measured memory_bytes: 256
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
#include<random>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=1e9;
const ll INF=1e18;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  ll n,a[100005]={},x=0,y=0;
  cin >> n;
  for(int i=0; i<n; i++) {
    cin >> a[i];
  }
  sort(a,a+n,greater<ll>());
  for(int i=0; i<n; i++) {
    if(a[i]==a[i+1]) {
      y=x;
      x=a[i];
      i++;
    }
    if(x&&y) {
      cout << x*y << endl;
      return 0;
    }
  }
  cout << 0 << endl;
 }

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

int main(){

    int n,k;
    cin >> n >> k;

    string s;
    cin >> s;

    if(s[k-1]=='A'){
        s[k-1]='a';
    }else if(s[k-1]=='B'){
        s[k-1]='b';
    }else{
        s[k-1]='c';
    }

    cout << s << endl;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	char S[5];
	scanf("%s", S);
	int a = (S[0] - '0') * 10 + S[1] - '0', b = (S[2] - '0') * 10 + S[3] - '0';
	if (a >= 1 && a <= 12 && b >= 1 && b <= 12) printf("AMBIGUOUS\n");
	else if (a >= 1 && a <= 12) printf("MMYY\n");
	else if (b >= 1 && b <= 12) printf("YYMM\n");
	else printf("NA\n");
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1640
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;

int main() {
    string s;
    cin >> s;

    int start = 1e9;
    int end = 0;
    rep(i,s.size()){
        if(s[i] == 'A') start=min(start,i);
        if(s[i] == 'Z') end=max(end,i);
    }
    cout << end - start +1 << endl;
}


Measured memory_bytes: 3756
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>

int main(){
	int N; std::cin >> N;
	std::vector<int> B(N - 1);
	for (auto& r : B) std::cin >> r;

	int sum = B[0] + B[N - 2];
	for (int i = 0; i < N - 2; ++i)
		sum += std::min(B[i], B[i + 1]);
	std::cout << sum << std::endl;

	return 0;
}

Measured memory_bytes: 3628
# -*- coding: utf-8 -*-
n, m= map(int, input().split())
ks=[]
for i in range(m):
  ks.append(list(map(int, input().split())))
p= list(map(int, input().split()))
k=[0]*n
count=0
for i in range(2**n):
  for j in range(n):
    k[j]=i%2
    i=i//2
  for a in range(m):
    sm=0
    for j in range(ks[a][0]):
      sm = sm + k[ks[a][j+1]-1]
    if sm%2 != p[a]:
      break
  else:
    count = count + 1
print(count)

Measured memory_bytes: 41968
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <numeric>
#include <regex>
#include <tuple>
#include <iomanip>
#include <math.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007 // 10^9 + 7
#define INF 1000000000 // 10^9
#define LLINF 1LL<<60
const double PI = 3.14159265358979323846;

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

	int num[3];
	for (int i = 0; i < 3; i++) cin >> num[i];
	int X; cin >> X;
	int count = 0;
	for (int i = 0; i <= num[0]; i++) {
		for (int j = 0; j <= num[1]; j++) {
			for (int k = 0; k <= num[2]; k++) {
				if (500 * i + 100 * j + 50 * k == X) count++;
			}
		}
	}
	cout << count << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<stack>
#include<queue>
#include<string>
#include<set>
#include<map>
using namespace std;
#define rep(i,n) for(int i=0;(i)<(n);(i)++)
#define FOR(i,m,n) for(int i=(m);(i)<(n);(i)++)
typedef long long ll;

int main(){
    int n,h;
    int a[100010],b[100010];
    cin >> n >> h;
    for(int i=0;i<n;i++){
        cin >> a[i] >> b[i];
    }
    sort(a,a+n);
    sort(b,b+n);
    int p = n-1,ans =0;;
    while(b[p]>a[n-1]){
        h-=b[p];
        p--;
        ans++;
        if(h<=0){
            cout << ans << endl;
            return 0;
        }
    }
    ans += h/a[n-1];
    if(h%a[n-1]!=0)ans++;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
typedef long long ll;
#define REP(i,n) for(int i=0;i<(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE cout << -1 << endl;return 0
#define int ll
#define Endl endl


signed main(void){
    int N;
    double x[114];string u[514];
    cin >> N;
    REP(i,N){
        cin >> x[i] >> u[i];
    }
    double Ans=0;
    int conv=380000;
    REP(i,N){
        if(u[i][0]=='B'){
            x[i]*=conv;
        }
        Ans+=x[i];
    }
    printf("%.10f",Ans);
    return 0;
}


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

using namespace std;

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

struct edge { ll to, cost; };
const int MAX_V = 100000;
const ll INF = 1000000000000000000;
const ll B = 1000000000000000;

int V;
vector<edge> G[2][MAX_V];
ll d[2][MAX_V];
ll sum[MAX_V];

void dijkstra(int s, int ab) {
  priority_queue<P, vector<P>, greater<P> > que;
  fill(d[ab], d[ab] + V, INF);
  d[ab][s] = 0;
  que.push(P(0, s));

  while (!que.empty()) {
    P p = que.top(); que.pop();
    ll v = p.second;
    if (d[ab][v] < p.first) continue;
    for (int i = 0; i < G[ab][v].size(); i++) {
      edge e = G[ab][v][i];
      if (d[ab][e.to] > d[ab][v] + e.cost) {
        d[ab][e.to] = d[ab][v] + e.cost;
        que.push(P(d[ab][e.to], e.to));
      }
    }
  }
}

int main() {
  int n, m, s, t; cin >> n >> m >> s >> t; s--; t--;
  V = n;
  for (int i = 0; i < m; i++) {
    ll u, v, a, b; cin >> u >> v >> a >> b; u--; v--;
    edge tmp1 = {v, a};
    edge tmp2 = {u, a};
    G[0][u].push_back(tmp1);
    G[0][v].push_back(tmp2);
    edge tmp3 = {v, b};
    edge tmp4 = {u, b};
    G[1][u].push_back(tmp3);
    G[1][v].push_back(tmp4);
  }
  dijkstra(s, 0);
  dijkstra(t, 1);
  
  for (int i = 0; i < n; i++) {
    sum[i] = d[0][i] + d[1][i];
    // cout << sum[i] << endl;
  }

  ll mn = INF, ans[n];
  for (int i = 0; i < n; i++) {
    mn = min(mn, sum[n-i-1]);
    ans[n-i-1] = mn;
  }

  for (int i = 0; i < n; i++) {
    cout << B - ans[i] << endl;
  }

  return 0;
}
  

Measured memory_bytes: 19908
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <set> 
#include <map>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstring>
#include <iomanip>
#define REP(i,n) for(int i=0; i<(n); ++i)
#define FOR(i,a,b) for(int i=(a); i<(b); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 100100100;
const ll INFLL = 1001001001001001001;  // > 10^18
const int MOD = (int)1e9 + 7;
const ll MODLL = (ll)1e9 + 7;
const double EPS = 1e-9;

int main() {

    int n,m; cin >>n>>m;

    vector<int> c(n);
    for (int i = 0; i < m; i++) {
        int a,b; cin >>a>>b;
        c[--a]++;
        c[--b]++; 
    }

    for (int i = 0; i < n; i++) {
        cout << c[i] << endl;
    }
    
    return 0;
}


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

using namespace std;

const int inf = 2e9;

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

    int n;
    cin >> n;
    vector<vector<int>> dp(3, vector<int> (n, 0));
    vector<int> a[3];
    a[0].resize(n);
    a[1].resize(n);
    a[2].resize(n);
    for (int i = 0; i < n; i++) {
        cin >> a[0][i] >> a[1][i] >> a[2][i];
    }
    dp[0][0] = a[0][0];
    dp[1][0] = a[1][0];
    dp[2][0] = a[2][0];
    for (int i = 0; i < n - 1; i++) {
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < 3; k++) {
                if (j == k) continue;
                dp[k][i + 1] = max(dp[k][i + 1], dp[j][i] + a[k][i + 1]);
            }
        }
    }
    cout << max(max(dp[0][n - 1], dp[1][n - 1]), dp[2][n - 1]);

    return 0;
}


Measured memory_bytes: 2556
#include <stdio.h>

int main(){
    int i;
    int n,x,count;
    int d[110] = {0},l[110];
    count = 0;
    scanf("%d %d",&n,&x);
    
    
    for(i = 1; i <= n ; i++){
        scanf("%d",&l[i]);
    }
    count = 1;
    for(i = 2 ; i <= n+1 ; i++){
        d[i] = d[i-1] + l[i-1];
        if(d[i] <= x){
            count++;
        }
        if(d[i] > x)
            break;
    }
    printf("%d\n",count);
    return 0;

}

Measured memory_bytes: 128
N=int(input())
data=[input() for i in range(N)]
ac=0
wa=0
tle=0
re=0
for i in range(N):
    if data[i]=="AC":
        ac+=1
    elif data[i]=="WA":
        wa+=1
    elif data[i]=="TLE":
        tle+=1
    else:
        re+=1
print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))

Measured memory_bytes: 16320
/*
Author: Babin Dutta
*/
 
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
#define mp make_pair
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define f(i,n) for(int i=0;i<n;i++)
#define ff(i,a,b) for(int i=a;i<=b;i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define endl "\n"
#define inf 1e18
#define mm 998244353
 
ll power(ll x, ll y, ll p)
{
    ll res = 1;  
    x = x % p;  
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1; 
        x = (x*x) % p;  
    }
    return res;
}
ll modInverse(ll A,ll M)
{
    return power(A,M-2,M);
}

void solve(){
    ll ans = 1ll;
    ll n; cin>>n;
    ans = n*n*n;
    cout<<ans<<endl;
}
 
int main(){
	#ifdef JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
    #endif
	boost;
	int t=1; //cin>>t;
	for(int i=1;i<=t;i++) solve();
	return 0;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define eps 1e-3
#define pi acos(-1.0)
#define inf 0x3f
#define INF 0x3f3f3f3f
#define pb push_back
#define debug1 cout<<"&&";
#define debug2 cout<<"**";
#define ms(a, x) memset(a, x, sizeof(a))
#define for0(i, n) for(int i = 0; i < n; ++i)
#define for1(i, n) for(int i = 1; i <= n; ++i)
using namespace std;
typedef double db;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, int> pli;
typedef pair<long long, long long> pll;
const int mod = 1e9 + 7;
const int N = 1e5+10;
const int M = 1e6+10;
/*=================================================================================*/

char chr;

int main() {
   cin>>chr;
   if(isupper(chr)) puts("A");
   else puts("a");
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <numeric>
#include <algorithm>
#include <utility>


using std::cout;
using std::cin;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;


ll gcd(ll a, ll b) {
    while (b != 0) {
        auto tmp = a;
        a = b;
        b = tmp % a;
    }
    return a;
}

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

int isPrime(int a) {
    for (int i = 2; i * i <= a; ++i) {
        if (a % i == 0) {
            return 0;
        }
    }
    return 1;
}





void oneCase () {
    int a, b;
    cin >> a >> b;
    if (a + b >= 10) {
        cout << "error";
    } else {
        cout << a + b;
    }

    cout <<  "\n";
}




int main() {
    int t = 1;
//    cin >> t;
    while (t > 0) {
        oneCase();
        --t;
    }

    return 0;
}

Measured memory_bytes: 256
from collections import deque
N,M=map(int,input().split())
numbers=[[] for _ in range(N)]
for _ in range(M):
    A,B=map(int,input().split())
    numbers[A-1].append(B-1)
    numbers[B-1].append(A-1)
visited=[-1 for _ in range(N)]
visited[0]=1
stack=deque([0])
inf=pow(10,9)
distances=[inf for _ in range(N)]
distances[0]=0
visited=[0 for _ in range(N)]
while len(stack) > 0:
    x=stack.pop()
    for a in numbers[x]:
        if distances[a]>distances[x]+1:
            visited[a]=x+1
            distances[a]=distances[x]+1
            stack.appendleft(a)
distances[0]=0
print('Yes')
for a in range(1,N):
    print(visited[a])
    

Measured memory_bytes: 37676
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>

using namespace std;
using namespace __gnu_pbds;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> myds;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define F first
#define S second
#define vec(x) vector<x> 
#define pi(x,y) pair<x,y>
#define pqq(x) priority_queue<x> 
#define min_heap(x) priority_queue<x, vector<x>, greater<x> >
#define all(x) x.begin(),x.end()
#define rep(i,x,y) for(int i=x;i<y;i++)
#define repd(i,x,y,k) for(int i=x;i<y;i+=k)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define rev(x) reverse(all(x))
#define full(x,a) memset(x,a,sizeof(x))
#define lcm(x,y) ((x*y)/__gcd(x,y))
#define mod 1000000007
#define bitcount __builtin_popcountll
#define pb push_back
#define indexof order_of_key
#define valueat find_by_order

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
int dxx[8]={0,0,1,-1,-1,-1,1,1};
int dyy[8]={1,-1,0,0,-1,1,1,-1};


main(){
	fastio;
	int n;
	cin>>n;
	int sum=0;
	rep(i,1,n+1){
		if(i%3==0 || i%5==0)
			continue;
		else
			sum+=i;
	}
	cout<<sum<<endl;
}


Measured memory_bytes: 3648
#include <iostream>
#include <math.h>
#include <algorithm>

using namespace std ;

int main(void){
    int x1,y1,x2,y2;

    cin >> x1 >> y1 >> x2 >> y2;
    int x = x2 - x1;
    int y = y2 - y1;

    cout << x2 - y << " " << y2 + x << " " << x1 - y << " " << y1 + x << endl;

    return 0;
}


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

using namespace std;

#define fore(i, s, e) for(int i = s; i < e; i++)

int main() {
    int a[5];
    fore(i, 0, 5) cin >> a[i];
    sort(a, a + 5);
    int res = 1e9;
    do {
        int t = 0;
        fore(i, 0, 5) {
            t += a[i];
            if(i != 4) {
                while(t % 10) t++;
            }
        }
        res = min(res, t);
    } while(next_permutation(a, a + 5));
    
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
nhw = input().split(" ")
n = nhw[0]
h = nhw[1]
w = nhw[2]

cnt = 0
for i in range(int(n)):
  b = input().split(" ")
  hb = b[0]
  wb = b[1]
  if int(h) <= int(hb) and int(w) <= int(wb):
    cnt += 1

print(cnt)

Measured memory_bytes: 3064
n = int(input())
a = list(map(int,input().split()))
counter = 0
flag = 1
while flag == 1:
	flag = 0
	for i in range(1,n):
		if a[i] < a[i-1]:
			ii = a[i]
			a[i] = a[i-1]
			a[i-1] = ii
			counter += 1
			flag = 1
ans = list(map(str,a))
print(" ".join(ans))
print(counter)


Measured memory_bytes: 5596
#include<stdio.h>

int main (void){
  
  int n,i[1001]={0};
  int p[1001]={0};
  int q[1001]={0};
  int r[1001]={0};
  int P,Q,R,C,j,flag=0;
  
  for(;;){
    flag=0;
    //テ」ツ?甘ィツ渉禿・ツュツ静」ツ?ョテ・ツ?凝ヲツ閉ー
    scanf("%d",&n);
    if(n==0)break;
    //テ」ツ?甘ィツ渉禿・ツュツ静」ツ?ョテヲツδ?・ツ?アテ」ツ?ョテ・ツ?・テ・ツ環?
    for(j=0;j<n;j++){
      scanf("%d %d %d %d",&i[j],&p[j],&q[j],&r[j]);
    }
    //テ・ツ按カテゥツ卍静」ツ?ョテ・ツ?・テ・ツ環?
    scanf("%d %d %d %d",&P,&Q,&R,&C);
    //テ・ツ按、テ・ツョツ?
    for(j=0;j<n;j++){
      if(p[j]<=P && q[j]<=Q && r[j]<=R && 4*p[j]+9*q[j]+4*r[j]<=C){
	//printf("%d %d %d %d\n",p[j],q[j],r[j],4*p[j]+9*q[j]+4*r[j]);
	printf("%d\n",i[j]);
	flag = 1;
      }
    }
    //テ」ツ?凖」ツ?ケテ」ツ?ヲテ」ツδ?」ツδ。テ」ツ?ェテ」ツ?ィテ」ツ?? 
    if(flag == 0){
      printf("NA\n");
    }
  }
  return 0;
}

Measured memory_bytes: 624
///usr/bin/g++ -O2 $0 -o ${0%.cpp} && echo "----------" && ./${0%.cpp}; exit;
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int, int> ii; 
 
const int N = 1005; 
const int mod = 1e9 + 7;
 
#define mul(a, b) ((ll) (a) * (b) % mod)
 
int f[N][N], n, a, b, c, d, fact[N], inv[N][N];
 
inline int Pow(int a, int p) {
    int ret = 1; while(p) {
        if(p & 1) ret = mul(ret, a); 
        a = mul(a, a); 
        p >>= 1;
    } return ret;
}
 
void precalc() {
    fact[0] = 1; 
    for(int i = 1; i < N; ++i) 
        fact[i] = mul(fact[i - 1], i); 
    inv[N - 1][1] = Pow(fact[N - 1], mod - 2); 
    for(int i = N - 2; i >= 0; --i) 
        inv[i][1] = mul(inv[i + 1][1], i + 1); 
    for(int i = 0; i < N; ++i) {
        inv[i][0] = 1; 
        for(int j = 2; j < N; ++j) {
            inv[i][j] = mul(inv[i][j - 1], inv[i][1]); 
        }
    }
}
 
 
int main(int argc, char const *argv[]) {
    precalc();
    scanf("%d %d %d %d %d", &n, &a, &b, &c, &d); 
 
    for(int i = 0; i <= n; ++i) f[0][i] = 1;  
    for(int i = 1; i <= n; ++i) {
        for(int j = a; j <= b; ++j) {
            f[i][j] = f[i][j - 1]; 
            for(int k = c; k <= d && j * k <= i; ++k) {
                f[i][j] += mul(fact[i], mul(f[i-j*k][j-1], mul(inv[i-j*k][1], mul(inv[j][k], inv[k][1])))); 
                if(f[i][j] >= mod) f[i][j] -= mod; 
            } 
        }
    }
    printf("%d\n", f[n][b]);
}

Measured memory_bytes: 8064