akhauriyash/Code-Regression huggingface dataset:
/*---------------------------------------------------------------------*/
#include<bits/stdc++.h>
//#include <cassert>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
/*---------------------------------------------------------------------*/
#define FAST        ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ff          first
#define ss          second
#define ll          long long
#define ull         unsigned long long
#define pii         pair<int,int>
#define mp          make_pair
#define psb         push_back
#define psf         push_front
#define ppb         pop_back
#define ppf         pop_front
#define all(x)      x.begin(),x.end()
#define TESTS       int test;cin>>test;for(int tcase=1;tcase<=test;tcase++)
#define ordered_set tree< int, null_type, less_equal< int >, rb_tree_tag, tree_order_statistics_node_update>
/*--------------------------------------------------------------------*/
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v)
{ os << '{'; string sep;for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T> ostream& operator<<(ostream &os, const set<T> &v)
{ os << '{'; string sep;for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T> ostream& operator<<(ostream &os, const multiset<T> &v)
{ os << '{'; string sep;for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p)
{ return os << '(' << p.first << ", " << p.second << ')'; }
void dbg_out() { cerr << " "; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
#ifndef ONLINE_JUDGE
#define cc(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__);
#define ccm(x)  cerr << "(" << #x <<") : "<<endl;for(auto i : x){ cerr<<"["<<i.ff<<"] = "<<i.ss<<endl;}
#define OK      cerr << "LINE "<<__LINE__<<" :"<<endl;
#define ee      cout<<endl;
#else
#define cc(...)
#define OK
#define ccm(x)
#endif
/*---------------------------------------------------------------------*/
#define MXN (ll)(1e6)
#define MOD (ll)(1e9+7)
#define INF (ll)(4e18)
#define inf (int)(2e9)
vector <vector<int>> V;
ll change(string s)
{
    ll x=0ll;
    for(int i=0;i<s.size();i++)
    {
        if(s[i]=='.') continue;
        x= x*10+(s[i]-'0');
    }
    return x;
}
int main()
{
    ll a;string b;
    cin>>a>>b;
    ll c=change(b);
    cout<<(a*c)/100<<endl;
    return 0;
}
/*--------------------------------------------------------------------*/
/*
>Check Corner Cases (n==1 or T==1)
>Overflow issues?
>LB / UB !!not found!! check?
>slow multi-set operations?try without multi-set
*/
/*--------------------------------------------------------------------*/
/* ---INPUT---
--------(1)------


-------(2)-------



-------(3)-------


-------(4)-------



--------------
*/
/*-----------------------MEHEDI HASAN,CSE-JU--------------------------*/



Measured memory_bytes: 3644
S = input()

is_even = lambda number: number % 2 == 0
is_odd = lambda number: not is_even(number)

even = S[0]
odd = '1' if even == '0' else '0'

answer = 0
for i, Si in enumerate(S):
    if is_even(i) and Si != even:
        answer += 1
    elif is_odd(i) and Si != odd:
        answer += 1

print(answer)


Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
bool a[100005];
int main()
{
	int n,ans=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		int l,r;
		cin>>l>>r;
		for(int j=l;j<=r;j++)a[j]=1;
	}
	for(int i=0;i<100005;i++)
	{
		if(a[i])ans++;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <algorithm>
#include <stack>

using namespace std;

int main(){
	double a = 0,b = 0,c = 0,d = 0,e = 0,f = 0;
	double x = 0,y = 0;
	while(cin >> a >> b >> c >> d >> e >> f){
		if(((f - (e * c / b)) * b) == 0){
			x = 0;
		}
		else{
			x = (f - (e * c / b)) * b / ((b * d) - (e * a));
		}
		y = (c - (a * x)) / b;
		cout << fixed;
		cout.precision(3);
		cout << x << " " << y << endl;
	}
	return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <numeric>
#include <climits>
#include <iterator>
#include <iomanip>
#include <stack>
#include <set>
#include <cstdio>
#include <bitset>
#include <functional>
#include <tuple>
#include <list>
#include <deque>
using namespace std;
typedef pair<int, int> P;

#define FOR(i, a, n) for (ll i = (ll)a; i<(ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)

typedef long long ll;
typedef vector<int> VI;
int GCD(int a, int b){
    if(b==0) return a;
    return GCD(b, a%b);
}

int main() {
    int n;
    while(cin >> n, n){
        map<ll, ll> mp;
        vector<ll> v;
        for(int i=0; i<n; ++i){
            ll e, p, q; cin >> e >> p >> q;
            mp[e]+=p*q;
            v.push_back(e);
        }
        
        bool check[4010];
        for(int i=0; i<4010; ++i) check[i]=false;
        int cnt=0;
        for(int i=0; i<v.size(); ++i){
            if(mp[v[i]]>=1000000&&!check[v[i]]) {
                cnt++;
                cout << v[i] << endl;
                check[v[i]]=true;
            }
        }
        if(cnt==0) cout << "NA" << endl;
    }
    
    
	return 0;
}


Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
using ll = long long;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define endl "\n"
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
constexpr int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    ll W;
    cin >> N >> W;
    vector<ll> w(N), v(N);
    for(int i = 0; i < N; i++) {
        cin >> w[i] >> v[i];
    }
    ll mn = *min_element(ALL(w));
    vector<vector<ll>> a(4, vector<ll>(N, 0));
    for(int i = 0; i < N; i++) {
        a[w[i] - mn][i] = v[i];
    }
    for(int i = 0; i < 4; i++) {
        sort(RALL(a[i]));
        a[i].insert(a[i].begin(), 0);
        for(int j = 1; j < a[i].size(); j++) {
            a[i][j] += a[i][j - 1];
        }
    }
    ll ans = -LLINF;
    for(int i = 0; i < a[0].size(); i++) {
        for(int j = 0; j < a[1].size(); j++) {
            for(int k = 0; k < a[2].size(); k++) {
                ll sum = mn * i + (mn + 1) * j + (mn + 2) * k;
                if(sum > W) {
                    continue;
                }
                int l = (W - sum) / (mn + 3);
                chmin(l, (int)a[3].size() - 1);
                chmax(ans, a[0][i] + a[1][j] + a[2][k] + a[3][l]);
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
A=[[0,0,0],[0,0,255],[0,255,0],[0,255,255],[255,0,0],[255,0,255],[255,255,0],[255,255,255]]
B=['black','blue','lime','aqua','red','fuchsia','yellow','white']
while(l=gets)!="0\n"do
	a=l[1..-1].unpack("a2a2a2").map{|e|e.to_i(16)}
	puts B[A.length.times.map{|i|[A[i].zip(a).map{|e|(e[0]-e[1])**2}.reduce(&:+),i]}.sort[0][1]]
end

Measured memory_bytes: 5024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
#define INF 1e9
typedef long long ll;
using namespace std;
//�I�[�o�[�t���[�ɋC������您����������
//�m�F�Y���Ȃ您����������

int main() {
    while(true) {
        int n; cin >> n;
        if(n==0) return 0;
        vector<int> v(n+1);
        rep(i,n+1) cin >> v[i];
        
        rep(i,n+1) {
            vector<int> v2 = v;
            v2.erase(v2.begin()+i);
            int dis = v2[1] - v2[0];
            bool flag = false;
            REP(i,1,n) {
                if(v2[i]-v2[i-1]!=dis) flag = true;
            }
            if(!flag) {
                cout << v[i] << endl;
                break;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 3128
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define int long long
const int inf = 0x3f3f3f3f;
const int maxn = 201110;
const int M = 1e9+7;
int n,m,k,ok;

signed main()
{
    cin>>n;
    int a = n/500;
    int b = (n-a*500)/5;
    cout<<a*1000+b*5<<endl;
    return 0;
}

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

int cmp( const void *p, const void *q ) {
  return *(int*)p - *(int*)q;
}
int main(void){
  int n, d[100005];
   scanf("%d",&n);
   for(int i=0;i<=n-1;i++){
     scanf("%d",&d[i]);
  }
   qsort(d, n, sizeof(int),cmp);
   printf("%d\n",d[(n+1)/2]-d[((n+1)/2)-1]);

  return 0;
  }

Measured memory_bytes: 2308
def main():
    R, G, B, N = map(int, input().split())
    ans = 0
    #anslist = []
    for r in range(3005):
        rtmp = R*r
        if rtmp > N:
            break
        for g in range(3005):
            gtmp = G*g
            if gtmp > N:
                break
            btmp = N - (rtmp + gtmp)
            if btmp < 0:
                continue
            ans += btmp%B==0
            #if btmp%B==0:
            #    b = btmp//B
            #    anslist.append((r,g,b))
    
    #print(anslist)
    print(ans)

if __name__ == "__main__":
    main()


Measured memory_bytes: 40684
#include <iostream>
#include <vector>

using namespace std;

#define f(i, n) for ( int i = 0; i < n; i++ )

const int M = 1005;
const int N = 100005;

vector <vector <int> > g;
bool viz[N];
int n, m, len, max_len, dist[N];


int dfs ( int x ){
  if (dist[x])
    return dist[x];
  for(auto i : g[x]){
      len =  1 + dfs ( i );
      if (dist[x] < len )
        dist[x] = len;
    }
  return dist[x];
}

void afis (){

    f(i, n){
      f(j, n)
        cout << g[i][j] << " ";
      cout << endl;
    }

}

int main(){

  int x, y;

  cin >> n >> m;
  f(i, n + 1)
    g.push_back(vector<int>( ));

  f (i, m){
    cin >> x >> y;
    g[x].push_back(y);
  }

  //afis();

  f( i, n + 1 ){
    len = 0;
    max_len = max (max_len, dfs( i ));
  }

  cout << max_len;

  return 0;
}

//
// 8 9
// 1 2
// 2 3
// 2 4
// 4 3
// 3 8
// 4 5
// 5 6
// 6 7
// 7 3

//
// 9 11
// 1 2
// 2 3
// 2 4
// 4 3
// 3 8
// 4 5
// 5 6
// 6 7
// 7 3
// 8 7
// 7 9


Measured memory_bytes: 7408
#include<cstdio>
#include<algorithm>
using namespace std;

int main(void){
	int N, R;
	scanf("%d", &N);
	int maxv = -1000000001;
	scanf("%d", &R);
	int minv = R;
	for(int i = 2; i <= N; i++){
		scanf("%d", &R);
		maxv = max(maxv, R - minv);
		minv = min(minv, R);
	}
	printf("%d\n", maxv);
	return 0;
}

Measured memory_bytes: 2712
#include <bits/stdc++.h>
using namespace std;
#define int           long long
#define pb            push_back
#define mp            make_pair
#define PI            3.14159265
#define M             1000000007
#define MM            998244353
#define fr            first
#define sc            second
#define all(v)        (v).begin(),(v).end()
#define rall(v)       (v).rbegin(),v.rend()
#define vc            vector
#define vi            vector<int>
#define pii           pair<int,int>
#define psi           pair<string,int>
#define pis           pair<int,string>
#define mii           map<int,int>
#define msi           map<string,int>

int solve() {
    string s,t; cin>>s>>t;
    int ans=0;
    for (int i = 0; i < 3; ++i)
    {
        if(s[i]==t[i]) ans++;
    }
    cout<<ans;
    return 0;
}

signed main() {
    ios::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t=1;
    //cin>>t;
    while(t--) solve();
    return 0;
}

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

int M;
string S;

int main( void ) {
	
	cin >> M;
	
	while ( M-- ) {
		
		cin >> S;
		
		typedef set<string> set_t;
		set_t all;
		all.insert( S );
		
		for ( size_t i = 1; i < S.size(); i++ ) {
			
			string L = S;
			L.resize( i );
			string R = S.substr( i );
			
			string L2 = L, R2 = R;
			reverse( L2.begin(), L2.end() );
			reverse( R2.begin(), R2.end() );
			
			all.insert( R + L );
			all.insert( R + L2 );
			all.insert( R2 + L );
			all.insert( R2 + L2 );
			all.insert( L + R );
			all.insert( L + R2 );
			all.insert( L2 + R );
			all.insert( L2 + R2 );
			
		}
		
		cout << all.size() << endl;
		
	}
	
	return 0;
	
}

Measured memory_bytes: 1292
n, m = gets.chomp.split.map(&:to_i)

ab = []
n.times do
  ab << gets.chomp.split.map(&:to_i)
end
ab.sort!

i = 0
ans = 0

while m > 0
  if ab[i][1] < m
    m -= ab[i][1]
    ans += ab[i][0] * ab[i][1]
  else
    ans += ab[i][0] * m
    m = 0
  end
  i += 1
end

puts ans

Measured memory_bytes: 10488
#include <bits/stdc++.h>
#define ll long long


using namespace std;

string str;


int main() {
    //fstream cin("A.in");
    //ofstream cout("A.out");
    //int ;
    ios::sync_with_stdio(false);
    cin >> str;
    int ans = 0;
    for(auto it : str)
        if(it == '1')
           ans++;
    cout << ans;
    //cin.close();
    //cout.close();
    return 0;
}


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

#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define vecp(p) int aa;cin>>aa;(p).push_back(aa);
#define vecpl(p) long long aa;cin>>aa;(p).push_back(aa);
#define vecps(p) string aa;cin>>aa;(p).push_back(aa);
#define vecp2(p) cin>>aa;(p).push_back(aa);
#define vecpl2(p) long long a	b;cin>>ab;(p).push_back(ab);
#define vecps2(p) string ab;cin>>ab;(p).push_back(ab);
#define sorts(c) sort((c).begin(),(c).end());
#define reverses(c) reverse((c).begin(),(c).end());
#define vec(b) vector<int> (b);
#define vecl(b) vector<long long> (b);
#define vecs(b) vector<string> (b);
#define pb(b,a) (b).push_back((a));
#define doublece(a,b) cout<<(a)<<' '<<(b)<<endl;
#define pairs(s) vector<pair<int,int>> (s);
#define pairsp(s) int aa,bb;cin>>aa>>bb;(s).push_back(make_pair(aa,bb));
#define MOD 1000000007
#define cey ce("Yes")
#define cen ce("No")
#define ceY ce("YES")
#define ceN ce("NO")

int main()
{
	ll A;
	string B;
	ll C = 0;
	cin >> A >> B;

	fx(B.size()) {
		if (B[x] == '.')continue;
		C = C * 10 + (B[x] - '0');
	}
	ll ans = A * C;
	ce(ans/100)
    return 0;
}



Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <deque>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define ctoi(c) c - '0'
#define tos(s) to_string(s)

typedef long long ll;


int main() {
    string s;
    cin >> s;
    cout << s.substr(0,3) << endl;
    return 0;
}

/*
ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC                                                                              
                                   ******,  .,, .,, ,,,    ****.**              
                                   ** . .,,,,,,,,,,,,,,,,,,,,,. .,*             
                                   **,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.            
                                .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.        
                                .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.        
                    ****      ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,      
              ***************,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,    
         ********************,,,,,,,,,,,,,,@@@,,,,,,,,,,,/@@@,,,,,,,,,,,,,,,    
        ******************,,,,,,,,,,,,,,,,,,(,,.         ,,,,,,,,,,,,,,,,,,,    
       ********************,,,,,,,,,,,*,,,,,.     %&&&     .,,,,*,,,,,,,,,,,,.  
       ***,,,,,,,,,,,,,,*,,,,,,,,,,,,,,,,,,,,               ,,,,,,,,,,,,,,,,,   
       ,,,,,,,,,,,,,,,,,,,**,,,,,,,,,,.......      ##(     ........,,,,,,,,,,.  
     .,,,,,,,,,,,,,,,,,,**,,,,,,,,,,..............    ..............,,,,,,,,    
    .,,,,,,,,,,,,,,,,,,,**,,,,,,,,,.................................,,,,,,,,,   
   ,,,,,,,,,,,,,,,,,,,,***,,,,,,,....................................,,,,,,,,,  
   ,,,,,,,,,,,,,,,,,,,,**,,,,,,,,.....................................,,,,,,,   
   ,,,,,,,,,,,,,,,,,,,,,**,,,,,,,,....................................,,,,,,,   
   ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.....................................,,,,,     
   ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...................................,.,,,,,     
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,.....................................,,,        
     ,,,,,,,,,,,,,,,,,,,,,,,,,,,,....................................,,,        
      ,,,,,,,,,,,,,,,,,,,,,,,,,,,,...................................,          
       ..,,,,,,,,,,,,,,,,,,,,,,,,,,.................................,           
       .........**.....       ,,,,,..............................               
        .......*......                  ****,**,       ,..****                  
        .......*,....                   .......        ......                   
          .......*....                   .....          .....                   
                                         ......          .....                  
*/

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

//define-----------------------------------------------------------------------------------------------------------------------
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)

//typedef----------------------------------------------------------------------------------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
//const------------------------------------------------------------------------------------------------------------------------
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 25;
static const LL LL_INF = 1152921504606846976;
//global-----------------------------------------------------------------------------------------------------------------------
string s, str;
char b[ 1000000 ];
int ans, n, d;
//#define DEBUG
//function-------------------------------------------------------------------------------------------------------------------
int main() {
	while ( scanf( "%d", &n ) != EOF && n ) {
		s = "I";
		scanf( "%d", &d );
		rep( i, n ) {
			s += "OI";
		}
		ans = 0;
		scanf( "%s", b );
		str = ( string ) b;

		rep( i, str.size() - s.size() ) {
			if ( str.substr( i, s.size() ) == s ) {
				ans++;
			}
			/*if ( str[ i ] == 'I' ) {
				i++;
			}*/
		}
		printf( "%d\n", ans );
	}
	return 0;
}

Measured memory_bytes: 3116
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = scanInt()
	}
	return res
}

func debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n, m := scanInt(), scanInt()

	a := factorize(m)
	ans := 1
	combInit(n + 50)
	for _, e := range a {
		ans *= comb(e+n-1, e)
		ans %= mod
	}

	fmt.Fprintln(wr, ans)
}

const mod = 1000000007

var fac, ifac, inv []int

func combInit(n int) {
	fac = make([]int, n+1)
	ifac = make([]int, n+1)
	inv = make([]int, n+1)

	fac[0], fac[1] = 1, 1
	ifac[0], ifac[1] = 1, 1
	inv[1] = 1

	for i := 1; i < n; i++ {
		fac[i+1] = fac[i] * (i + 1) % mod
		inv[i+1] = mod - inv[mod%(i+1)]*(mod/(i+1))%mod
		ifac[i+1] = ifac[i] * inv[i+1] % mod
	}
}

func comb(a, b int) int { return (fac[a] * ifac[b] % mod) * ifac[a-b] % mod }

func factorize(n int) map[int]int {
	res := map[int]int{}
	for i := 2; i*i <= n; i++ {
		for n%i == 0 {
			res[i]++
			n /= i
		}
	}
	if n != 1 {
		res[n] = 1
	}
	return res
}


Measured memory_bytes: 3072
#include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long ll;
const int INF = 1000000000;
const ll LINF = 1000000000000000000; //1e18
const double EPS = 1e-10;

int main(void)
{
    int N, K;
    cin >> N >> K;

    vector<int> p(N);
    for (int i = 0; i < N; i++)
    {
        cin >> p[i];
    }
    sort(p.begin(), p.end());

    ll ans = 0;
    int index = 0;
    while (K > 0)
    {
        ans += p[index];
        index++;
        K--;
    }

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

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define repi(i,a,b) for(int i=a; i<=(b); ++i)
#define rrep(i,n) for(int i=(n-1); i>=0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define pb push_back
#define mp make_pair
#define to_s to_string
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define pr(x) cout<<(x)<<'\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
#define yes "Yes"
#define no "No"
using namespace std;
using ll = long long;
using Edge = pair<int,long long>;
using Graph = vector<vector<Edge>>;
typedef pair<int,int> P;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
int MOD = 1e9 + 7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){
    int N;
    cin >> N;
    vector<int> H(N);
    rep(i,N) cin >> H[i];
    vector<int> ans;
    int sum = 0;
    rep(i,N-1){
        if(H[i+1] <= H[i]) sum++;
        else ans.pb(sum), sum = 0;
    }
    ans.pb(sum);
    pr(*max_element(ALL(ans)));
}


Measured memory_bytes: 1276
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    vector<int> ind[101];
    int n; cin>>n;
    for(int i=0; i<n; i++){
        int a; cin>>a;
        ind[a].push_back(i);
    }
    vector<P> v[101];
    int c=0;
  for(int j=ind[1].size()-1; j>=0; j--){
    v[0].push_back(P(ind[1][j], 1));
  }
    for(int i=2; i<=n; i++){
        for(int j=(int)ind[i].size()-1; j>=0; j--){
            int ct=0;
            bool ok=0;
            for(auto x:v[c]){
                if(x.first<ind[i][j]) ct++;
              if(!ok && ct==i){
                    v[c+1].push_back(P(ind[i][j], i));
                    ok=1;
                }
                v[c+1].push_back(x);
            }
          if(!ok && ct==i-1){
                    v[c+1].push_back(P(ind[i][j], i));
                    ok=1;
                }
            if(!ok){
                cout<<-1<<endl;
                return 0;
            }
            c++;
        }
    }
    for(auto x:v[c]){
        cout<<x.second<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp64 {
    class Program {
        static void Main(string[] args) {
            var st = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int N = st[0];
            int M = st[1];
            int X = st[2];

            var A = Console.ReadLine().Split().Select(int.Parse).ToArray();

            Console.WriteLine(Math.Min(A.Where(x => x <= X).Count(), A.Where(x => x >= X).Count()));

        }
    }
}


Measured memory_bytes: 13396
n = int(input())
a = list(map(int, input().split())) + [0] * 2
rec = []
num, pre = 0, 0
for i in range(n + 1):
    num += abs(a[i] - pre)
    rec.append((abs(a[i] - pre), abs(a[i + 1] - a[i]), abs(a[i + 1] - pre)))
    pre = a[i]

for i in range(n):
    print(num - rec[i][0] - rec[i][1] + rec[i][2])

Measured memory_bytes: 25260
/*
Problem : Atcoder abc 139G
Algorithm : math
Status :
*/
#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;

const int INF = 0x3f3f3f3f;
const int MAXN = 105;

int n;
long double ans;

struct Point{
	int x,y;
	friend bool operator < (const Point &a,const Point &b){
		return atan2(a.y,a.x) < atan2(b.y,b.x);
	}
} p[MAXN];

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
	scanf("%d",&n);
	for(int i = 0;i < n;i++)
	    scanf("%d%d",&p[i].x,&p[i].y);
	sort(p,p + n);
	for(int i = 0;i < n;i++){
		long double x = 0,y = 0;
		for(int j = 0;j < n;j++){
			int k = (i + j) % n;
			x += p[k].x;
			y += p[k].y;
			ans = max(ans,x * x + y * y);
		}
	}
	printf("%.15Lf\n",sqrtl(ans));
	return 0;
}


Measured memory_bytes: 384
package main
 
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)
 
func main() {
	N := getStdinInt()
	if N % 1000 == 0 {
		fmt.Printf("%v\n", 0)
	} else {
		fmt.Printf("%v\n", 1000-N%1000)
	}
}
 
var sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)
 
func getStdin() string {
	return readLine()
}
func getStdinInt() int {
	str := getStdin()
	rtn, _ := strconv.Atoi(str)
	return rtn
}
func getStdinInt2() (int, int) {
	list := getStdinIntArr()
	return list[0], list[1]
}
func getStdinInt3() (int, int, int) {
	list := getStdinIntArr()
	return list[0], list[1], list[2]
}
func getStdinInt64() int64 {
	str := getStdin()
	rtn, _ := strconv.ParseInt(str, 10, 64)
	return rtn
}
func getStdinInt64_2() (int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1]
}
func getStdinInt64_3() (int64, int64, int64) {
	list := getStdinIntArr64()
	return list[0], list[1], list[2]
}
func getStdinIntArr() []int {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	str := getStdin()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}
func readLine() string {
	buf := make([]byte, 0, 0)
	for {
		l, p, _ := sc.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

Measured memory_bytes: 2180
//#include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>
#include <iomanip>


#define int long long
#define REP(i,l,r) REPEAT(i,l,r,true) // [l, r)
#define rep(i,n) REP(i,0,n)           // [0, n)
#define REPEAT(i,l,r,condition) for(int i=(condition)?l:r-1;(condition)?i<r:i>=l;(condition)?++i:--i) // false<-[l, r)->true
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define fs first
#define sc second
#ifdef LOCAL
#define show(...) cerr<<#__VA_ARGS__<<" = ";_DEBUG(__VA_ARGS__)
#define showlr(n,l,r) cerr<<#n<<" = ";for(int i=l;i<r;i++){cerr<<n[i]<<", ";}cerr<<endl // [l, r)
#else
#define show(...)
#define showlr(n,l,r)
#endif

#define YN(condition) puts((condition)?"YES":"NO")
#define Yn(condition) puts((condition)?"Yes":"No")
#define yn(condition) puts((condition)?"yes":"no")
#define YES puts("YES")
#define Yes puts("Yes")
#define yes puts("yes")
#define NO  puts("NO")
#define No  puts("No")
#define no  puts("no")

#define case(i) printf("Case #%lld: ",i)

using namespace std;

using vi=vector<int>;
using pint=pair<int,int>;

struct io{io(){cin.tie(0);ios::sync_with_stdio(false);cout.tie(0);cout<<fixed<<setprecision(20);}}io;

template<class T> istream& operator >>(istream &is, vector<T> &v){for(T &e:v)is>>e;return is;}
template<class T> ostream& operator <<(ostream &os, vector<T> v){os<<"{";for(T &e:v)os<<e<<(v.size()-(int)(&e-&v[0])>1?", ":"");os<<"}";return os;}

void _DEBUG(){}
template<typename H,typename... T> void _DEBUG(H a,T...b){cerr<<a<<(sizeof...(b)?",":"\n");_DEBUG(b...);}

inline void in(){}
template<typename H,typename... T>void in(H &a, T&... b){cin>>a;in(b...);}
inline void out(){}
template<typename H,typename... T> void out(H a, T... b){cout<<a<<(sizeof...(b)?" ":"\n");out(b...);}

template<class T> void resz(int n,T& v){v.resize(n);}
template<class H,class... T> void resz(int n,H& a,T&... b){a.resize(n);resz(n,b...);}

template<typename V,typename H> void resize(vector<V>& v,const H a){v.resize(a);}
template<typename V,typename H,typename... T> void resize(vector<V>& v,const H& a,const T... b){v.resize(a);for(auto &v:v) resize(v,b...);}

const int INF=1LL<<55;
const int MOD=1000000007;
const double EPS=1e-8;
/*------------end of definitions------------*/

string S;

signed main(){

    in(S);
    Yn(S.find('C')!=string::npos&&S.find('F',S.find('C'))!=string::npos);

    return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cmath>
#include <vector>
#include <deque>

typedef long long ll;

using namespace std;

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

    deque<ll> q;

    ll op, dest, tmp;
    for (ll i=0; i<n; i++)
    {
        cin >> op;

        switch (op)
        {
            case 0:
            {
                cin >> dest;
                cin >> tmp;
                switch (dest)
                {
                    case 0:
                        q.push_front(tmp);
                        break;
                    case 1:
                        q.push_back(tmp);
                        break;
                }
                break;
            }
            case 1:
                cin >> dest;
                cout << q[dest] << endl;
                break;
            case 2:
                cin >> dest;
                switch (dest)
                {
                    case 0:
                        q.pop_front();
                        break;
                    case 1:
                        q.pop_back();
                        break;
                }
                break;
        }
    }

    return 0;
}



Measured memory_bytes: 6308
#include<bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("Ofast")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
#define int long long 
typedef pair<int,int>pi;
typedef vector<int>vi;

const int MAXN=200005;
const int MOD=1000000007;

#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define DEC(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
#define db(x) cerr<<#x<<" = "<<x<<"\n"
#define LOW(v,x) (lower_bound(all(v),(x))-(v).begin())
#define UP(v,x) (upper_bound(all(v),(x))-(v).begin())

int N, A[MAXN], cnt[45][45];

main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin>>N;
	FOR(i,1,N){
		double tmp; cin>> tmp;
		int rnded = llround(tmp * 1e9);
		int twos = 0, fives = 0;
		while (rnded>0 && rnded%2==0){
			twos++;
			rnded/=2;
		}
		while (rnded>0 && rnded%5==0){
			fives++;
			rnded/=5;
		}
		cnt[twos][fives]++;
	}
	int ans = 0;
	FOR(i,0,44) FOR(j,0,44) FOR(k,0,44) FOR(l,0,44){
		if (i+k>=18 && j+l>=18){
			if (mp(i,j) == mp(k,l)) ans += cnt[i][j] * (cnt[k][l]-1);
			else ans += cnt[i][j] * cnt[k][l];
		}
	}
	cout<<ans/2;
}


Measured memory_bytes: 3784
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
typedef unsigned long long LL;
map<LL,int>c;
const int N=404;
struct zk{
	int a[4];
	inline zk(int A,int B,int C,int D){a[0]=A,a[1]=B,a[2]=C,a[3]=D;}
	inline zk(){}
	inline LL Hash(){
		LL r=0x3fffffffffffffff;
		for(int i=0;i<4;++i)
		r=min(r,((LL)a[i]<<48)|((LL)a[(i+1)&3]<<32)|((LL)a[(i+2)&3]<<16)|(a[(i+3)&3]));
		return r;
	}
	inline int check(){
		if(a[0]==a[1]&&a[1]==a[2]&&a[2]==a[3])return 4;
		if(a[0]==a[2]&&a[1]==a[3])return 2;
		return 1;
	}
}A[N];
inline istream&operator>>(istream&in,zk&a){in>>a.a[0]>>a.a[1]>>a.a[2]>>a.a[3];return in;}
int n;LL ans;
int main(){
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;++i)cin>>A[i],++c[A[i].Hash()];
	for(int X=1;X<=n;++X)
	for(int X_=0;X_<4;++X_)
	for(int Y=X+1;Y<=n;++Y)
	for(int Y_=0;Y_<4;++Y_){
		zk H=zk(A[X].a[X_],A[X].a[(X_+1)&3],A[X].a[(X_+2)&3],A[X].a[(X_+3)&3]);
		zk T=zk(A[Y].a[Y_],A[Y].a[(Y_+1)&3],A[Y].a[(Y_+2)&3],A[Y].a[(Y_+3)&3]);
		--c[H.Hash()],--c[T.Hash()];
		zk L=zk(T.a[1],H.a[0],H.a[3],T.a[2]),R=zk(H.a[1],T.a[0],T.a[3],H.a[2]);
		zk U=zk(T.a[1],T.a[0],H.a[1],H.a[0]),D=zk(H.a[3],H.a[2],T.a[3],T.a[2]);
		LL r=1;
		r*=c[L.Hash()]--;
		r*=c[R.Hash()]--;
		r*=c[U.Hash()]--;
		r*=c[D.Hash()]--;
		++c[L.Hash()],++c[R.Hash()],++c[U.Hash()],++c[D.Hash()];
		++c[H.Hash()],++c[T.Hash()];
		r*=L.check()*R.check()*U.check()*D.check();
		ans+=r;
	}
	cout<<ans/12<<'\n';
	return 0;
}

Measured memory_bytes: 80128
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>



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

using namespace std;
int n;

int main(){
  cin >> n;
  int ans = 0;
  if(n==1){
    cout << 4 << endl;
    return 0;
  }
  if(n==2){
    cout << 4 << endl;
    return 0;
  }

  while(1){
    ans ++;
    if(n==1) break;
    if(n%2==1) n = 3*n+1;
    else n = n/2;
  }
  cout << ans+1 << endl;
  return 0;
}


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

from functools import reduce

N,X = map(int, input().split())
xN = list(map(int, input().split()))

# 最大公約数
def gcd(a, b):
    while b > 0:
        a, b = b, a%b
    return a
def gcd_list(numbers):
    return reduce(gcd, numbers)

xN2 = [0] * N
for i in range(N):
    xN2[i] = abs(xN[i] - X)

print(gcd_list(xN2))

Measured memory_bytes: 14596
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>
#include <iomanip>
#include <unordered_map>
#include <map>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define reps(i,s,n) for(int i=s, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
typedef long double ld;
const char sp = ' ';

using namespace boost::multiprecision;
using namespace std;

int main(void){
    ll x;
    cin>>x;
    cout<<1-x<<endl;
    return 0;
}


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

int main() {
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
        if (s.at(i) == '1') {
            s.at(i) = '9';
        } else {
            s.at(i) = '1';
        }
    }
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 256
M, D = map(int, input().split())

ans = 0
for i in range(1, M+1):
    for j in range(1, D+1):
        if len(str(j)) == 1:
            continue
        # 日付が二桁以上であることが確定
        d1 = int(str(j)[0])
        d2 = int(str(j)[1])
        if d1 >= 2 and d2 >= 2:
            if i == (d1*d2):
                ans += 1

print(ans)


Measured memory_bytes: 3060
#include<bits/stdc++.h> 
using namespace std; 
#define ll long long 
#define trace(x) cerr<<#x<<" : "<<x<<endl;
ll max(ll a,ll b) 
{
    return (a>b?a:b);
}
int main() 
{ 
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL); 
ll n,k; 
cin>>n>>k; 
ll a[n+1],c[n+1]={0}; 
for (int i = 1; i<=n; ++i)
{
    cin>>a[i];
}
c[1]=0; 
c[2]=abs(a[2]-a[1]); 
for (int i = 3; i<=n; ++i)
{
    c[i]=c[i-1]+abs(a[i]-a[i-1]);
    for(int j=i-2;j>=max(1,i-k);j--)
    c[i]=min(c[i],c[j]+abs(a[i]-a[j]));
}
cout<<c[n];
return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define first_more_idx(ve, num) upper_bound(all(ve), num)-ve.begin() // idx = first_more_idx(ve,num); if(idx = ve.size()) , then not exist
#define first_lessequal_idx(ve, num) lower_bound(all(ve), num)-ve.begin()
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > // only sort first param
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
ll power(ll x, ll n){if(n == 0) return 1;return  (n%2)? x*power(x, n-1)%MOD : power(x*x%MOD, n/2);}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll N ;
    cin >> N ;
    vector<ll> A;
    
    
    rep(i, N){
        ll inp; cin >> inp;
        A.pb(inp);
    }
    
    vector<ll> ans ;

    
    for(ll i = N-1; i >= 0; i--){
        ll moreidx = first_more_idx(ans, A[i]);
        if(moreidx == ans.size()) ans.pb(A[i]);
        else{
            ans[moreidx] = A[i];
        }
    }

    cout << ans.size() << endl;

    //cout << fixed << setprecision(16) << ans << endl;
    return 0;
}


Measured memory_bytes: 2548
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N):
    return N**3


def main():
    N = read_int()
    print(slv(N))


if __name__ == '__main__':
    main()


Measured memory_bytes: 7868
#include<bits/stdc++.h>
#define N 205
#define M 50005
#define oo (1<<29)
using namespace std;
char A[N][N];
int n,m=1,S,T,head[N],nxt[M],cap[M],num[M],h,w,ans,d[N];
int gd(int x,int y){ return (x-1)*w+y;}
void link(int x,int y,int z)
{
	num[++m]=y,cap[m]=z,nxt[m]=head[x],head[x]=m;
	num[++m]=x,cap[m]=z,nxt[m]=head[y],head[y]=m;
}
bool bfs()
{
	int i,x; queue<int> Q;
	for(i=1;i<=h+w;i++) d[i]=0;
	d[S]=1,Q.push(S);
	while(!Q.empty()){
		x=Q.front(),Q.pop();
		for(i=head[x];i;i=nxt[i])
			if(!d[num[i]]&&cap[i]){
				d[num[i]]=d[x]+1;
				Q.push(num[i]);
			  }
	  }
	return d[T]>0;
}
int dfs(int t,int mini)
{
	int i,res,ans=0;
	if(t==T||!mini) return mini;
	for(i=head[t];i;i=nxt[i])
		if(d[num[i]]==d[t]+1&&cap[i]){
			res=dfs(num[i],min(mini,cap[i]));
			ans+=res,mini-=res,cap[i]-=res,cap[i^1]+=res;
			if(!mini) return ans;
		  }
	d[t]=oo; return ans;
}
int main()
{
	int i,j;
	scanf("%d %d\n",&h,&w);
	for(i=1;i<=h;i++){
		scanf("%s",A[i]+1);
		for(j=1;j<=w;j++){
			if(A[i][j]=='o') link(i,j+h,1);
			if(A[i][j]=='S') link(i,j+h,oo),S=i;
			if(A[i][j]=='T') link(i,j+h,oo),T=i;
		  }
	  }
	if(S==T){
		printf("-1");
		return 0;
	  }
	while(bfs())
		ans+=dfs(S,oo);
	if(ans>=oo)
		printf("-1");
	else printf("%d",ans);
	return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) (ll)(a.size())
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll h,n;
	cin>>h>>n;
	ll s=0;
	for(ll i=0;i<n;i++)
	{
		ll x;
		cin>>x;
		s+=x;
	}
	if(s>=h)
		cout<<"Yes\n";
	else
		cout<<"No\n";
	return 0;
}

Measured memory_bytes: 256
n,m = map(int,input().split())
ks = [list(map(int,input().split())) for i in range(m)]
p = list(map(int,input().split()))
lng = 0
for i in range(2**n):
  oz = [0]*n
  for j in range(n):
    if (i>>j)&1:
      oz[j]=1
  for t in range(m):
    count = 0
    for j in range(len(ks[t])):
      if j != 0:
        count += oz[ks[t][j]-1]
    if count % 2 != p[t]:
      break
  else:
    lng += 1
print(lng)

Measured memory_bytes: 3064
#pragma comment(linker, "/STACK:102400000,102400000")
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x.size())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=b-1;i>=a;i--)
#define inf 1000000007
#define mod 1000000007
#define x first
#define y second
#define pi acos(-1.0)
#define DBG(x) cerr<<(#x)<<"="<<x<<"\n";
//#define dprintf(...) 
#define hash _hash
#define next _next
//#define dprintf(...) fprintf(outFile,__VA_ARGS__)
 
#define FOREACH(it,x) for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define ull unsigned long long
#define ll long long
#define N 100005
 
template <class T,class U>inline void Max(T &a,U b){if(a<b)a=b;}
template <class T,class U>inline void Min(T &a,U b){if(a>b)a=b;}
 
//FILE* outFile;
inline void add(int &a,int b){a+=b;while(a>=mod)a-=mod;}


int pow(int a,int b){
    int ans=1;
    while(b){
        if(b&1)ans=ans*(ll)a%mod;
        a=(ll)a*a%mod;b>>=1;
    }
    return ans;
}

vector<pii>g[N];
ll c[3];
int f,e,vis[N];
void dfs(int u,int d){
    c[d]++;vis[u]=d+1;
    FOREACH(it,g[u]){
        int j=it->x,k=it->y;e++;
        if(vis[j]){
            f&=((d+k)%3==vis[j]-1);
        }
        else dfs(j,(d+k)%3);
    }
}
int main(){
    //freopen("1.txt","w",stdout);
    //cout<<setprecision(3)<<fixed;
    int T,i,j,k,n,m=0,K=0;
    scanf("%d%d",&n,&m);
    while(m--){
        scanf("%d%d",&i,&j),i--,j--;
        g[i].pb({j,1});
        g[j].pb({i,2});
    }
    ll ans=0;
    rep(i,0,n)if(!vis[i]){
        e=0;f=1;c[0]=c[1]=c[2]=0;
        dfs(i,0);
        if(f){
            if(c[1]&&c[2])ans+=c[0]*c[1]+c[1]*c[2]+c[2]*c[0];
            else ans+=e/2;
        }
        else ans+=(c[0]+c[1]+c[2])*(c[0]+c[1]+c[2]);
    }
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 10752
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

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

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;

int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

template <typename T, typename E, typename F, typename G>
struct SegmentTree{
    int n;
    F f;
    G g;
    T ti;
    vector<T> dat;
    SegmentTree(){};
    SegmentTree(F f, G g, T ti) : f(f), g(g), ti(ti){}

    void init(int n_){    
        n = 1;
        while(n < n_) n <<= 1;
        dat.assign(n << 1, ti);
    }

    void build(const vector<T> &v){
        int sz = v.size();
        init(sz);
        for(int i=0; i<sz; i++) dat[n + i] = v[i];
        for(int i=n-1; i>=0; i--) dat[i] = f(dat[(i << 1) | 0], dat[(i << 1) | 1]);
    }

    void set_val(int k, T x){
        dat[k += n] = x;
        while(k >>= 1) dat[k] = f(dat[(k << 1) | 0], dat[(k << 1) | 1]);    
    }

    T query(int a,int b){
        T vl = ti, vr = ti;
        for(int l=a+n,r=b+n;l<r;l>>=1,r>>=1) {
            if(l & 1) vl = f(vl, dat[l++]);
            if(r & 1) vr = f(dat[--r], vr);
        }
        return f(vl, vr);
    }
};

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

    using T = int;
    using E = int;
    auto f = [](T a, T b){
        return a | b;
    };
    auto g = [](T a, E b){
        return b;
    };
    T ti = 0;
    SegmentTree<T, E, decltype(f), decltype(g)> seg(f, g, ti);

    int n; cin>>n;
    string s; cin>>s;
    seg.build(vector<int>(n, 0));

    for(int i=0; i<n; i++){
        seg.set_val(i, 1 << (s[i] - 'a'));
    }

    int q; cin>>q;
    while(q--){
        int ty; cin>>ty;
        if(ty == 1){
            int i; cin>>i;
            char c; cin>>c;
            i--;
            seg.set_val(i, 1 << (c - 'a'));
        }
        else{
            int l, r; cin>>l>>r;
            l--, r--;
            int ans = __builtin_popcount(seg.query(l, r + 1));
            cout << ans << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 6940