akhauriyash/Code-Regression huggingface dataset:
/* ---------- STL Libraries ---------- */

// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */

using namespace std;

/* ---------- Type Abbreviation ---------- */

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

using ll = long long;

#define fst first
#define snd second
#define mp make_pair
#define mt make_tuple

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


/* ---------- conversion ---------- */

#define INT(c) static_cast<int>(c)
#define CHAR(n) static_cast<char>(n)
#define LL(n) static_cast<ll>(n)
#define DOUBLE(n) static_cast<double>(n)

/* ---------- container ---------- */

#define ALL(v) (v).begin(), (v).end()
#define SIZE(v) (LL((v).size()))
#define each(itr,v) for(auto (itr):(v))

#define FIND(v, k) (v).find(k) != (v).end()
#define VFIND(v, k) find(ALL(v), k) != (v).end()

#define gsort(b, e) sort(b, e, greater<decltype(*b)>())

/* ----------- debug ---------- */

template <class T>
ostream& operator<<(ostream& os, vector<T> v) {
	os << "[";
	for (auto vv : v)
		os << vv << ",";
	return os << "]";
}

template <class T>
ostream& operator<<(ostream& os, set<T> v) {
	os << "[";
	for (auto vv : v)
		os << vv << ",";
	return os << "]";
}

template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> p) {
	return os << "(" << p.fst << "," << p.snd << ")";
}

/* ---------- Constants ---------- */

// const ll MOD = 1e9 + 7;
// const int INF = 1 << 25;
// const ll INF = 1LL << 50;
// const double PI = acos(-1);
// const double EPS = 1e-10;
// mt19937 mert(LL(time(0)));

/* ---------- Short Functions ---------- */

template <typename T>
T sq(T a) {
	return a * a;
}

template <typename T>
T gcd(T a, T b) {
	if (a > b) return gcd(b, a);
	return a == 0 ? b : gcd(b % a, a);
}

template <typename T, typename U>
T mypow(T b, U n) {
	if (n == 0) return 1;
	if (n == 1) return b /* % MOD */;
	if (n % 2 == 0) {
		return mypow(b * b /* % MOD */, n / 2);
	}
	else {
		return mypow(b, n - 1) * b /* % MOD */;
	}
}

ll pcnt(ll b) {
	return __builtin_popcountll(b);
}



// const ll dx[4] = {0, -1, 1, 0};
// const ll dy[4] = {-1, 0, 0, 1};
// const ll dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
// const ll dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */

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

	ll N;
	cin >> N;
	ll P;
	cin >> P;
	ll i = 1;
	ll ans;
	if (N == 1) {
		cout << P << endl;
		return 0;
	}
	else if (N >= 60) {
		cout << 1 << endl;
		return 0;
	}
	else {
		while (true) {
			ll M = mypow(i, N);
			if (P%M == 0) ans = i;
			if (M >= P) break;
			i++;
		}
		cout << ans << endl;
		return 0;
	}
}


Measured memory_bytes: 256
#include <stdio.h>
int ELEMENTS[10000] = {0};
int RANK[10000] = {0};

void makeSet(int n) {
	int i;
	for (i = 0; i < n; ++i) {
		ELEMENTS[i] = i;
	}
}


void link(int x, int y) {
	if (RANK[x] > RANK[y]) {
		ELEMENTS[y] = x;
	} else {
		ELEMENTS[x] = y;
		if (RANK[x] == RANK[y]) {
			RANK[y]++;
		}
	}
	return;
}

int findSet(int x) {
	if (x != ELEMENTS[x]) {
		ELEMENTS[x] = findSet(ELEMENTS[x]);
	}
	return ELEMENTS[x];
}

void union2(int x, int y) {
	link(findSet(x), findSet(y));
	return;
}

int isSameSet(int x, int y) {
	return findSet(x) == findSet(y);
}


int main() {
	int n, q;
	int i;
	int com, x, y;
	scanf("%d %d", &n, &q);
	makeSet(n);
	
	for (i = 0; i < q; ++i) {
		scanf("%d %d %d", &com, &x, &y);
		if (com == 0) {
			union2(x,y);
		} else {
			if(isSameSet(x, y)) {
				printf("1\n");
			} else {
				printf("0\n");
			}
 		}
	}
	return 0;
}

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


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


    double res = 0;
    while(n--)
    {
        double a;
        cin >> a;
        res += 1/a;
    }

    cout << setprecision(12) << 1/res << endl;

    return 0;
}


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

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a,b;
  cin>>a>>b;
  if(a>0 && b>0)
  {
    int srs=a+b;
    if(srs<10)cout<<srs<<endl;
    else cout<<"error"<<endl;
  }
  return 0;
}


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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intll int long long
const intll INF = 1e9;
const int MOD = 1e9 + 7;

int main() {
  int h,m, H,M, k ;
  cin >> h >> m >> H >> M >> k ;
  
  int a = H*60+M ;
  int b = h*60+m ;
  
  cout << a-k-b ;
  
}


Measured memory_bytes: 3608
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy
from operator import itemgetter

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ni()
A = na()
tmp = 0
now = 1
for i in range(N):
    A[i] *= 2
    tmp += now  * A[i]
    now *= -1

ans = [0] * N
ans[0] = tmp // 2
for i in range(N-1):
    ans[i+1] = A[i] - ans[i]
ans[N-1] = A[N-1] - ans[0]
print(*ans)

Measured memory_bytes: 22496
#include <bits/stdc++.h>
 
 
using namespace std;
 
typedef long long ll;
 
#define MOD 998244353
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>b;--i)
#define vi vector<int>
#define vl vector<ll>
#define ld long double
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795
#define fix(f,n) fixed<<setprecision(n)<<f
#define all(x) x.begin(),x.end()
 
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
ll newmod(ll a,ll b)
 {
  return ((a%b)+b)%b;
}
 
 
ll powM(ll a,ll b,ll m )
{ 
  a%=m;
  ll ans=1;
  while(b)
  {
    if(b&1)ans=ans*a%m;
    a=a*a%m;
    b>>=1;
  }
 
return ans;
}
 
ll pow(ll a,ll b)
{ 
  
  ll ans=1;
  while(b)
  {
    if(b&1)ans=ans*a;
    a=a*a;
    b>>=1;
  }
 
return ans;
}
 
 
 
/*const int N=200000;
 
ll fac[N+1];
ll inv[N+1];
ll p=998244353;
 
ll c(ll a, ll b,ll m)
{
  if(a<b)return 0;
  return (fac[a]*inv[b]%m)*(inv[a-b])%m;
}
 
*/

ll dp[2005][2005];

int main()
{ fast

ll n;cin>>n;

vpll a(n+1);

for(int i=1;i<=n;i++)
{
  cin>>a[i].ff;
  a[i].ss=i;
}

sort(a.begin()+1,a.end(),greater<>());

for(ll i=1;i<n;i++)
{
  for(ll j=n;j>i;j--)
  {
    ll pos=n+i-j;
    dp[i+1][j]=max(dp[i+1][j],dp[i][j]+(a[pos].ff)*abs(a[pos].ss-i));
    dp[i][j-1]=max(dp[i][j-1],dp[i][j]+a[pos].ff*abs(a[pos].ss-j));
  }
}

ll ans=0;

for(int i=1;i<=n;i++)
{
  ans=max(ans,dp[i][i]+a[n].ff*abs(a[n].ss-i));
}

cout<<ans<<endl;




 return 0;
 
 
}

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

int fa[10010];
int n, q, x, y, z;

int Get(int x)
{
    if(x == fa[x]) return x;
    return fa[x] = Get(fa[x]);
}

void Merge(int x, int y)
{
    fa[Get(x)] = Get(y);
}

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

    cin >> n >> q;
    for(int i = 0; i <= n; ++i) fa[i] = i;
    while(q--)
    {
        cin >> z >> x >> y;
        switch(z)
        {
        case 0:
            Merge(x, y);
            break;
        case 1:
            cout << (Get(x) == Get(y)) << endl;
            break;
        }
    }
    return 0;
}



Measured memory_bytes: 3312
#include <cstdio>
#include <algorithm>

using namespace std;

int main()
{
	long long P, C[500000];

	int N, Q;

	scanf("%d", &N);

	scanf("%lld", &P);

	scanf("%d", &Q);

	long long zenbugaishoku = 0;

	for (int i = 0; i < N; i++)
	{
		scanf("%lld", &C[i]);

		zenbugaishoku += C[i];

		C[i] = C[i] - (Q - i) * P;
	}

	long long *E = C + N;

	sort(C, E);

	long long Answer = zenbugaishoku;

	long long sum = zenbugaishoku;

	long long V = 2 * P;

	for (int i = 0; i < N; i++)
	{
		sum += V * i - C[i];

		Answer = max(sum, Answer);
	}

	printf("%lld\n", Answer);

	return 0;
}

Measured memory_bytes: 6652
#include <iostream>

#ifdef _DEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#else
#define debug(x)
#endif

using namespace std;

uint64_t comb(uint64_t n, uint64_t k) {
    if (n < k) return 0;
    uint64_t r = 1;
    for (uint64_t d = 1; d <= k; ++d) {
        r *= n--;
        r /= d;
    }
    return r;
}

int ctoi(char c) { return c - '0'; }

int pow(int n, int m) {
    if (m == 0) return 0;
    int r = 1;
    for (int i = 0; i < m; ++i) r *= n;
    return r;
}

uint64_t ncases(int n, int m) {
    if (m > 0 && n >= m) {
        return pow(9, m) * comb(n, m);
    } else if (m == 0) {
        return 1;
    } else {
        return 0;
    }
}

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

    uint64_t ans = 0;
    for (int i = 1; i <= N.size() - 1; ++i) {
        uint64_t x = 9 * ncases(i - 1, K - 1);
        debug(x);
        ans += x;
    }

    uint64_t x = (ctoi(N[0]) - 1) * ncases(N.size() -1, K - 1);
    debug(x);
    ans += x;

    int nz = 1;
    for (int i = 1; i < N.size(); ++i) {
        if (N[i] != '0') {
            uint64_t x = ncases(N.size() - i - 1, K - nz);
            uint64_t y = (ctoi(N[i]) - 1) * ncases(N.size() - i - 1, K - nz - 1);
            debug(x); debug(y);
            ans += x + y;
        }
        nz = nz + (N[i] != '0' ? 1 : 0);
    }
    if (nz == K) ans++;

    cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] arg) {
        Scanner scan = new Scanner(System.in);
        int a = Integer.parseInt(scan.next());
        int b = Integer.parseInt(scan.next());
        int c = Integer.parseInt(scan.next());
        if(a==b) {
            if(a==c) {
                System.out.println("No");
            }
            else {
                System.out.println("Yes");
            }
        } else if(a==c) {
            System.out.println("Yes");
        } else if(b==c) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


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

int main()
{
   int N;
   int a[100];
   int i,count=0;
   scanf("%d\n",&N);
   for(i=1;i<N+1;i++)
   {
       scanf("%d",&a[i]);
   }
   for(i=1;i<N+1;i++)
   {
       if((i%2!=0)&&a[i]%2!=0)
      count++;
   }
   printf("%d",count);
    return 0;
}


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

using namespace std;

int main(void) {
  int n;
  cin >> n;
  int a[n + 1];
  for(int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]--;
  }

  int count = 0;
  for(int i = 0; i < n; i++) {
    if(a[a[i]] == i) {
      count++;
    }
  }

  cout << count / 2 << endl;
}

Measured memory_bytes: 640
#include<stdio.h>
#include<stdlib.h>
#define VMAX 20000

int main() {

	unsigned short *A, *B;

	int C[VMAX + 1], n, i;
	scanf("%d", &n);

	A = (unsigned short*)malloc(sizeof(short) * n + 1);
	B = (unsigned short*)malloc(sizeof(short) * n + 1);

	for (i = 0; i <= VMAX; i++) C[i] = 0;

	for (i = 0; i < n; i++) {
		scanf("%hu", &A[i+1]);
		C[A[i+1]]++;
	}

	for (i = 1; i <= VMAX; i++) C[i] += C[i-1];

	for (i = 1; i <= n; i++) {
		B[C[A[i]]] = A[i];
		C[A[i]]--;
	}

	printf("%d", B[1]);
	for (i = 2; i <= n; i++) {
		printf(" %d", B[i]);
	}
	printf("\n");

	free(A);
	free(B);

	return 0;
}


Measured memory_bytes: 10240
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, s, n) for (int i = (s); i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  string s;
  cin >> s;
  ll sum = 0;
  rep(i, s.size()) sum += s[i] - '0';
  if (sum % 9 == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3724
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e5+5;

int n,a[N];
ll L,R;

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",a+i);
	
	L=R=2;
	for(int i=n;i;i--){
		L=(L-1)/a[i]+1,R=R/a[i];
		if(L>R){ puts("-1"); return 0;}
		L*=(ll)a[i],R=(R+1)*(ll)a[i]-1;
	}

	printf("%lld %lld\n",L,R);
	return 0;
}

Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;

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

const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const int ddx[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int ddy[] = {0, 1, 1, 1, 0, -1, -1, -1};

ll gcd(ll a, ll b) {
    if(b == 0) return a;
    return gcd(b, a % b);
}

int extgcd(int a, int b, int& x, int&y) {
    int d = a;
    if(b != 0) {
        d = extgcd(b, a % b, y, x);
        y -= (a / b) * x;
    }else {
        x = 1;
        y = 0;
    }
    return d;
}

int inv(int a) {
    int x, y;
    extgcd(a, MOD, x, y);
    return (x + MOD) % MOD;
}

int main() {
    int n, m;
    cin >> n >> m;
    int* a = new int[m];
    int* c = new int[m];
    rep(i, m) {
        c[i] = 0;
        int ai, bi;
        cin >> ai >> bi;
        a[i] = ai;
        rep(j, bi) {
            int ci;
            cin >> ci;
            c[i] += (1 << (ci - 1));
        }
    }

    int** dp = new int*[m + 1];
    rep(i, m + 1) {
        dp[i] = new int[1 << n];
        fill(dp[i], dp[i] + (1 << n), INF);
    }
    dp[0][0] = 0;

    rep(i, m) {
        rep(j, 1 << n) {
            int k = (j & ~(c[i]));
            dp[i + 1][j] = min(dp[i][j], dp[i][k] + a[i]);
        }
    }

    if(dp[m][(1 << n) - 1] == INF) cout << -1 << endl;
    else cout << dp[m][(1 << n) - 1] << endl;
}


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

int main() {
  ll a[10000];
  int N, ans;
  ans = 0;
  cin >> N;
  for(int i = 0;i < N;i++) cin >> a[i];
  for(int i = 0;i < N;i++) {
    while(1){
      if((a[i] % 2) == 1 || a[i] == 0){
        break;
      } else {
        ans++;
        a[i] = a[i] / 2;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
  

Measured memory_bytes: 3704
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <numeric>
#include <limits>
#include <type_traits>
#include <locale>

using namespace std;
#define SAY_YES cout << "YES" << endl;
#define SAY_Yes cout << "Yes" << endl;
#define SAY_NO cout << "NO" << endl;
#define SAY_No cout << "No" << endl;
#define IFYES(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "YES" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "NO" << endl;  \
    }
#define IFYes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "Yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "No" << endl;  \
    }
#define IFyes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "no" << endl;  \
    }
#define DEBUG_OUTPUT_ARRAY(XXX, ONE)                            \
    for (int i = 0; i < (ONE); i++)                             \
    {                                                           \
        cout << "DEBUG: i = " << i << " -> " << XXX[i] << endl; \
    }
#define DEBUG_OUTPUT_ARRAY2(XXX, ONE, TWO)                             \
    for (int i = 0; i < (ONE); i++)                                    \
    {                                                                  \
        cout << "<<< i = " << i << " >>>" << endl;                     \
        for (int j = 0; j < (TWO); j++)                                \
        {                                                              \
            cout << "DEBUG: j = " << j << " -> " << XXX[i][j] << endl; \
        }                                                              \
    }
#define DEBUG_OUTPUT_ARRAY2_BOX(XXX, ONE, TWO) \
    for (int i = 0; i < (ONE); i++)            \
    {                                          \
        cout << i << "  ";                     \
        for (int j = 0; j < (TWO); j++)        \
        {                                      \
            cout << XXX[i][j] << " ";          \
        }                                      \
        cout << endl;                          \
    }

typedef pair<long long int, long long int> pll;
typedef pair<long long int, pll> lpll;


const long long int mod = 998244353;
const long long int INF = 1e18;
const long double PI=3.14159265358979323; 
const long long int pl=1000000;

long long int x,sum=15;

int main(){

    cout << fixed << setprecision(18);
    cin>>x;
    sum-=x;
    cin>>x;
    sum-=x;
    cin>>x;
    sum-=x;
    cin>>x;
    sum-=x;
    cin>>x;
    sum-=x;
    cout<<sum<<endl;

}




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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    int N;
    cin >> N;
    vector<vector<int>> info(N, vector<int>(N));
    rep(i, N) {
        rep(j, N) {
            cin >> info[i][j];
        }
    }
    ll S = 1 << N;
    vector<vector<ll>> dp(N + 1, vector<ll>(S));
    dp[0][0] = 1;
    rep(i, N) {
        rep(j, S) {
            if (__builtin_popcount(j) != i) continue;
            rep(w, N) {
                if (info[i][w] == 1 && (j & (1 << w)) == 0) {
                    dp[i + 1][j | (1 << w)] += dp[i][j];
                    dp[i + 1][j | (1 << w)] %= MOD;
                }
            }
        }
    }
    cout << dp[N][S - 1] << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


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

using namespace std;
int main(){
  int n,k;
  cin >> n >> k;
  int p[n];
  double s[n+1],answer = -1,a;s[0] = 0;
  for(int i = 0;i < n;i++){
    cin >> p[i];
  }
  for(int i = 1;i <= n;i++){
    s[i] = s[i-1] + (double)(p[i-1]+1)/2;
  }
  for(int i = 0;i <= n-k;i++){
    answer = max(answer,s[i+k]-s[i]);
  }
  cout << fixed << setprecision(16);
  cout << answer;
  return 0;
}

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

using namespace std;
typedef long long ll;

#define pb push_back
#define forn(i, n) for (int i = 0; i < (int)(n); i++)
#define forrn(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
#define PYMOD(a, m) ((((a) % (m)) + (m)) % (m))
#define all(v) v.begin(), v.end()
#define mp make_pair
#define ff first
#define ss second

const int mod = 1e9 + 7;

int main() {
    // Code here:

    string a[3];
    forn(i, 3)
        cin >> a[i];
    cout << a[0][0] << a[1][1] << a[2][2] << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF LLONG_MAX
#define ll  long long
#define ull unsigned long long
#define rep(i,n) for(int i=0; i<n; ++i)
#define MOD 1000000007
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if(a>b) {a=b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) { if(a<b) {a=b; return true;} return false;}

int main() {
  int N; cin >> N;
  vector<int> h(N);
  rep(i, N) cin >> h[i];
  int l=0, ans=0;
  while(l < N) {
    if(h[l] == 0){
      ++l;
    } else {
      for(int i=l; h[i]!=0 && i<N; ++i) {
        h[i]--;
      }
      ++ans;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;

int main() {
  ll n;
  cin >> n;
  bool flag=true;
  for(ll i=0;i<n;i++) {
    ll temp;
    cin >> temp;
    if(temp%2==0) {
      if(temp%3&&temp%5) {
        flag=false;
      }
    }
  }
  if(flag) {
    cout << "APPROVED" << endl;
  }
  else {
    cout << "DENIED" << endl;
  }
}

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

def findSet(x):
  if x == parent[x]:
    return x
  else:
    return findSet(parent[x])

def link(x, y):
  if rank[x] < rank[y]:
    parent[x] = y
  else:
    parent[y] = x
    if rank[x] == rank[y]:
      rank[y] += 1

def union(x, y):
  link(findSet(x), findSet(y))

n, q = list(map(int, input().split()))

data = (i for i in range(n))
rank = [0 for i in range(n)]
parent = [i for i in range(n)]

for i in range(q):
  f, x, y = list(map(int, input().split()))
  if f == 0:
    union(x, y)
  else:
    if findSet(x) == findSet(y):
      print(1)
    else:
      print(0)


Measured memory_bytes: 6036
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <cassert>
#include <random>


double ternary_search(
        const std::function<double(double)> &fn,
        double lo=0., double hi=1e9) {
    for (int iter = 0; iter < 1000; iter++) {
        double midl = lo + (hi - lo) / 3;
        double midr = lo + 2*(hi - lo) / 3;
        if (fn(midl) < fn(midr)) hi = midr;
        else lo = midl;
    }
    return lo;
}

constexpr double EPS = 1e-12;

double binary_search_left(
        const std::function<double(double)> &fn,
        double t, double lo = 0., double hi = 1e9) {
    hi = t;
    double targ = fn(t);
    for (int iter = 0; iter < 1000; iter++) {
        double mid = lo + (hi - lo)/2;
        if (std::abs(fn(mid) - targ) < EPS) hi = mid;
        else lo = mid;
    }
    return lo;
}

double binary_search_right(
    const std::function<double(double)> &fn,
    double t, double lo = 0., double hi = 1e9) {
    lo = t;
    double targ = fn(t);
    for (int iter = 0; iter < 1000; iter++) {
        double mid = lo + (hi - lo) / 2;
        if (std::abs(fn(mid) - targ) < EPS) lo = mid;
        else hi = mid;
    }
    return lo;
}

int main() {
    int n; std::cin >> n;
    std::vector<double> x(n), y(n);
    std::vector<double> dx(n), dy(n);
    for (int i = 0; i < n; i++) {
        std::cin >> x[i] >> y[i];
        char c; std::cin >> c;
        if (c == 'R') dx[i] = 1;
        if (c == 'L') dx[i] = -1;
        if (c == 'U') dy[i] = 1;
        if (c == 'D') dy[i] = -1;
    }
    auto fxmax = [&](double t) {
        double ret = -1e9;
        for (int i = 0; i < n; i++) {
            ret = std::max(ret, x[i] + t*dx[i]);
        }
        return ret;
    };
    auto fxmin = [&](double t) {
        double ret = 1e9;
        for (int i = 0; i < n; i++) {
            ret = std::min(ret, x[i] + t*dx[i]);
        }
        return -ret;
    };
    auto fymax = [&](double t) {
        double ret = -1e9;
        for (int i = 0; i < n; i++) {
            ret = std::max(ret, y[i] + t*dy[i]);
        }
        return ret;
    };
    auto fymin = [&](double t) {
        double ret = 1e9;
        for (int i = 0; i < n; i++) {
            ret = std::min(ret, y[i] + t*dy[i]);
        }
        return -ret;
    };

    std::vector<double> cand;
    auto push = [&](const auto& fn) {
        double t = ternary_search(fn);
        cand.push_back(binary_search_left(fn, t));
        cand.push_back(binary_search_right(fn, t));
    };
    push(fxmax);
    push(fxmin);
    push(fymax);
    push(fymin);

    double ans = 2e18;
    for (double t : cand) {
        ans = std::min(ans, (fxmax(t) + fxmin(t))*(fymax(t) + fymin(t)));
    }
    printf("%.14f\n", ans);
    return 0;
}


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

using namespace std;

typedef long long int ll;

#define FOR(i,l,r) for(i=l;i<r;i++)

#define REP(i,n) FOR(i,0,n)

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

#define P pair<ll,ll>

#define F first

#define S second

signed main(){

  ll W,S;cin>>S>>W;

  if(S<=W)cout<<"un";
  cout<<"safe"<<endl;

  return 0;

}

Measured memory_bytes: 3620
#include <stdio.h>
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <math.h>
#include <ctype.h>
using namespace std;
int a,b;
int main(void)
{
    cin >> a;
    
    if(a%2 == 0){
        cout << a/2 * a/2;
    }else{
        cout << a/2 * (a+1)/2;
    }
    
    return 0;
}

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

int main ()
{
	//輸入
	int n, q;
	cin >> n;
	int S[n+1];
	for (int i = 0;i < n;i++)
	{
		cin >> S[i];
	}
	cin >> q;
	int T[q+1];
	for (int i = 0;i < q;i++)
	{
		cin >> T[i];
	}
	
	int C = 0; //ans
	//處理
	for (int i = 0;i < q;i++)
	{
		for (int j = 0;j < n;j++)
		{
			if (S[j] == T[i])
			{
				C++;
				break;
			}
		}
	}
	
	//輸出 
	cout << C << endl;
	return 0;
 } 


Measured memory_bytes: 3144
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define rep2(i, x, n) for(ll i = x, i##_len = (n); i < i##_len; ++i)
#define all(n) begin(n), end(n)
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};

const int mod = 1000000007;
struct mint {
  ll x;  // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if(!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if(t & 1) a *= *this;
    return a;
  }
  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
mint fact(int n) {
  if(n == 1 || n == 0) return 1;
  mint res = n;
  return res * fact(n - 1);
}

int main() {
  ll n;
  cin >> n;
  vl t(n), a(n);
  rep(i, n) cin >> t[i];
  rep(i, n) cin >> a[i];
  vl h(n, 0);
  bool ok = true;
  rep(i, n) {
    if(i != 0 && t[i - 1] == t[i]) continue;
    if(t[i] > a[i]) ok = false;
    h[i] = 1;
  }
  for(ll i = n - 1; i >= 0; i--) {
    if(i != n - 1 && a[i + 1] == a[i]) continue;
    if(t[i] < a[i]) ok = false;
    h[i] = 1;
  }
  if(!ok) {
    cout << 0 << endl;
    return 0;
  }
  mint ans = 1;
  rep(i, n) if(h[i] == 0) ans *= min(t[i], a[i]);
  cout << ans << endl;
}

Measured memory_bytes: 5640
N = int(input())
X = list(map(int, input().split()))
X.sort()

ans = 0
i = X[0]
while i <= X[N-1]:
    eng=0
    for k in range(N):
        eng += (X[k]-i)**2
    if i == X[0] or eng < ans:
        ans = eng
    i += 1
print(ans)

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

from collections import Counter

ans = 0
b = Counter()
for j in range(n):
    if j - a[j] in b:
        ans += b[j - a[j]]

    b[a[j] + j] += 1

ans = 0
c = Counter()
for i in range(n):
    if i - a[i] in c:
        ans += c[i - a[i]]

    c[a[i] + i] += 1


print(ans)


Measured memory_bytes: 130316
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define ve vector
#define pq priority_queue
#define vi vector<int>
#define vl vector<long long>
#define vii vector<vector<int>>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1000000007;



int main()
{
    int m,n;
    cin >> n >> m;
    
    if(n==m) out("Yes");
    else out("No");

    


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long i,j,t,a,b,n,temp;
    t=1;
    // cin>>t;
    while(t--)
    {
       cin>>n;
       temp=0;
       j=1;
       set<long>s={1};
       long arr[n+1];
       for(i=1;i<=n;i++)cin>>arr[i];
       j=1;
       while(1)
       {
          
          j=arr[j]; 
        //   cout<<j<<" ";
          s.insert(j);
          temp++;
          if(j==2)break;
          if(s.count(arr[j]))
          {
              cout<<-1;
              return 0;
          }
       }
       
       cout<<temp;
        
    }
}

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

using namespace std;
#define rep(i, n) for(int i = 0 ; i < (int)(n) ; i++)
typedef long long ll;
typedef long double Double;

#ifndef INPUTS_DIR
#define INPUTS_DIR "./"
#endif


ll f(ll N) {
    if (N == 0) return 1;
    set<ll> w;
    ll ans = 0;
    for (int i = 0; i <= N; i++) {
        w.insert((N - i) ^ i);
    }
//    cout << N << ">>>";
//    for (j : w) {
//        cout << j << " ";
//    }
//    cout << endl;

    return ans + w.size();
}

map<ll, ll> dp;

ll g(ll N) {
    if (dp.count(N)) return dp[N];
    if (N == 0) return 1;
    if (N == 1) return 2;
    if (N % 2 == 1) {
        return dp[N] = (g(N / 2 - 1) + 2 * g(N / 2)) % 1000000007;
    } else {
        return dp[N] = (g(N / 2) + 2 * g(N / 2 - 1)) % 1000000007;
    }
}


void solve(ll N) {
    cout << g(N) << endl;
//    cout << g(N) << endl;
////    f(60);
////    f(30);
////    f(29);
////    f(58);
////    return;
//    ll sm = 0;
//    for (int i = 0; i < 130; i++) {
//        sm += f(i);
//        int df = i;
//        for (int j = 31; j >= 0; j--) {
//            if (df >> j & 1) {
//                df -= (1 << j);
//                break;
//            }
//        }
////        cout << i << ":" << f(i) << "->" << f(i / 2) << "|" << f(i / 2 - 1) << " " << endl;
//        cout << i << ": " << f(i) << "|" << g(i) << " " << sm << endl;
//    }
//    cout << f(N) << endl;
}


void main_(istream &cin) {
    ll N;
    cin >> N;
    solve(N);
}

int main() {
#ifdef INTELLIJ
    ifstream ifs(string(INPUTS_DIR) + "in_1.txt");
    if (ifs.is_open()) {
        main_(ifs);
        ifs.close();
    } else {
        cerr << "Error: no input." << endl;
    }
#else
    ios::sync_with_stdio(false);
    cin.tie(0);
    main_(cin);
#endif
}





Measured memory_bytes: 256
MOD=10**9+7
cnt=0; sum=0; prev=nil; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def desc(ar) ar.sort!{|x,y|y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end

def puts_yesno(can) puts(can ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def debug(k,v) puts "#{k}:#{v}" end
########### ( ˘ω˘ )ｽﾔｧ… ###########
n, k = gsmi
a = gsmi.sort

if k==0
  putsend(a.inject(:+))
end
# 下からi桁目が1のもの
vote = Array.new(100,0)
n.times do |i|
  bin = a[i].to_s(2).reverse
  l = bin.length
  l.times do |j|
    if bin[j] == "1"
      vote[j] += 1
    end
  end
end

# 多数決から期待kを出す
ex_k = ""
bin = k.to_s(2)
l = bin.length
l.times do |i|
  if n/2 < vote[l-i-1]
    ex_k<<"0"
  else
    ex_k<<"1"
  end
end

# 期待kがkより大きい場合は補正する
real_k=""
l.times do |i|
  if bin[i]=="1"
    if ex_k[i]=="0"
      real_k<<ex_k[i..-1]
      break
    else
      real_k<<"1"
    end
  else
    real_k<<"0"
  end
end

# puts vote[0..30].to_s
# puts ex_k
# puts real_k

# sum
vote.size.times do |i|
  num =
    if i<l && real_k[l-i-1]=="1"
      n-vote[i]
    else
      vote[i]
    end
  sum += 2**i * num
  #puts sum
end

puts sum


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

#define rep(i,n) for(ll i=0;i<(n);++i)
#define reps(i,n) for(ll i=1;i<=(n);++i)
using ll = long long;
using str = string;
constexpr long long INF = (1LL<<60);
constexpr long long MOD = (1e9+7);
template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
template<class T>inline bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
inline void dump(){cout<<endl;}
template<class Head,class... Tail>inline void dump(Head&& head, Tail&&... tail){cout<<head<<", ";dump(forward<Tail>(tail)...);}
template<typename T>inline istream &operator>>(istream&input,vector<T>&v){for(auto &elemnt:v)input>>elemnt;return input;}

main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout<<fixed<<setprecision(10);
  
  ll n,m;
  cin>>n>>m;
  vector<ll> a(n);
  cin>>a;

  priority_queue<ll> que;
  rep(i,n)que.push(a[i]);
  rep(i,m){
    ll mx=que.top();
    que.pop();
    mx/=2;
    que.push(mx);
  }

  ll ans=0;
  while(!que.empty()){
    ans+=que.top();
    que.pop();
  }
  cout<<(ans)<<endl;


}


Measured memory_bytes: 2168
#include<iostream>

using namespace std;
int map[150][150];
int main(){
	int n;
	while(cin>>n &&n){
		fill((int*)map,(int*)map+150*150,0);
		int w,h;
		cin>>w>>h;
		
		for(int i=0;i<n;i++){
			int x,y;
			cin>>x>>y;
			map[y][x]++;
		}
		for(int i=0;i<150;i++){
			for(int j=1;j<150;j++){
				map[i][j]+=map[i][j-1];
			}
		}
		
		int s,t;
		cin>>s>>t;
		int ans=0;
		for(int i=0;i+t-1<=h;i++){
			for(int j=1;j+s-1<=w;j++){
				int tmp=0;
				for(int k=0;k<t;k++){
					tmp+=map[i+k][j+s-1]-map[i+k][j-1];
				}
				ans=max(ans,tmp);
			}
		}
		cout<<ans<<endl;
	}
}

Measured memory_bytes: 1248
#include <stdio.h>
int main(void)
{
    int m[51], t[51], r[51];
    int sum[51];
    int i = 0;
    int j;

    while (1)
    {
        scanf("%d %d %d", &m[i], &t[i], &r[i]);
        sum[i] = m[i] + t[i];
        if (m[i] == -1 && t[i] == -1 && r[i] == -1)
        {
            break;
        }
        i++;
    }

    for (j = 0; j < i; j++)
    {
        if (m[j] == -1 || t[j] == -1)
        {
            puts("F");
        }
        else if (sum[j] >= 80)
        {
            puts("A");
        }
        else if (65 <= sum[j] && sum[j] < 80)
        {
            puts("B");
        }
        else if (50 <= sum[j] && sum[j] < 65)
        {
            puts("C");
        }
        else if (30 <= sum[j] && sum[j] < 50)
        {
            if (r[j] >= 50)
            {
                puts("C");
            }
            else
            {
                puts("D");
            }
        }
        else
        {
            puts("F");
        }
    }

    return 0;
}


Measured memory_bytes: 2540
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/B-TempleteMatching.py
#
n, m = map(int, input().split())
a = []
b = []
is_contain = True

for i in range(n):
    a.append(input())

for i in range(m):
    b.append(input())

for i in range(n-m+1):
    for j in range(n-m+1):
        count = 0
        for k in range(m):
            for l in range(m):
                if a[i+k][j+l] == b[k][l]:
                    count += 1

        # print(count)
        if count == m*m:
            print("Yes")
            exit()


print("No")


Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {

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

		int n = sc.nextInt();

		int count = 0;
    	for (int i = 0; i < n; i++) {
    		int data = sc.nextInt();
    		if (checkPrimeNum(data)) {
    			count++;
    		}
    	}

    	System.out.println(count);
    	
        sc.close();
	}

	private static boolean checkPrimeNum(int data) {
		if (data == 2) {
			return true;
		}
		if (data % 2 == 0) {
			return false;
		}
		for (int i = 3; i <= (int)Math.sqrt(data) + 1; i += 2) {
			if (data % i == 0) {
				return false;
			}
		}
//		System.out.println("prime: " + data);
		return true;
	}
}

Measured memory_bytes: 31216
#include <stdio.h>
#define N 30

int main(void){
    int flg[N+1];
    int id;
    
    for (int i=1; i<=N; i++) flg[i]=0;
    while (scanf("%d", &id)!=EOF){
        flg[id]=1;
    }
    
    for (int i=1; i<=N; i++){
        if (flg[i]==0) printf("%d\n",i);
    }
    
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>

using namespace std;

const int MAXA = 100 * 1000 + 10;

int cnt[MAXA];

int main()
{

	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		int a;
		cin >> a;
		cnt[a]++;
		cnt[a - 1]++;
		cnt[a + 1]++;
	}
	int res = 0;
	for (int i = 0; i < MAXA; i++)
		res = max(res, cnt[i]);
	cout << res << endl;
}

Measured memory_bytes: 640
X, Y, A, B, C = gets.split.map{|i|i.to_i}
P = gets.split.map{|i|i.to_i}.sort_by{|i|-i}
Q = gets.split.map{|i|i.to_i}.sort_by{|i|-i}
R = gets.split.map{|i|i.to_i}.sort_by{|i|-i}
#warn P.inspect
#warn Q.inspect
#warn R.inspect
s = 0
red = P[0, X]
green = Q[0, Y]
#warn red.inspect
#warn green.inspect
loop{
    break if R.empty?
    break if red[-1] >= R[0] and green[-1] >= R[0]
    if red[-1] < green[-1]
        red.unshift(R.shift)
        red.pop
    else
        green.unshift(R.shift)
        green.pop
    end
}
puts red.inject(:+) + green.inject(:+)


Measured memory_bytes: 26728
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let line = read_as_string();
    let mut it = line.split_whitespace();
    let s: String = it.next().unwrap().to_owned();
    let t: String = it.next().unwrap().to_owned();

    let line = read_as_vec::<i32>();
    let (a, b) = (line[0], line[1]);

    let u = read_as_string();

    if u == s{
        println!("{} {}", cmp::max(0, a-1), b);
    }else{
        println!("{} {}", a, cmp::max(0, b-1));
    }
}


Measured memory_bytes: 4352
if __name__ == "__main__":
    n = int(input())
    r0 = int(input())
    r1 = int(input())
    minv = r0 if r0 <= r1 else r1
    maxv = r1 - r0
    for i in range(2, n):
        r = int(input())
        maxv = max(maxv, (r-minv))
        minv = min(minv, r)
    print(maxv)



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

int dp[100];

//最大公約数
int gcd(int x, int y){
  if(x % y == 0) return 1;
  return gcd(y, x % y);
}
//最小公倍数
int lcm(int x, int y){
  return x * y / gcd(x, y);
}
//フィボナッチ数列
//配列dpを-1で初期化する
int fib(int n){
  if(n == 0 || n == 1) return dp[n] = 1;
  if(dp[n] != -1) return dp[n];
  return dp[n] = fib(n - 1) + fib(n - 2);
}
//階乗計算(factorial)
int fact(int n){
  if(n = 1) return 1;
  return n * fact(n - 1);
}
//累乗計算(Exponentiation)
//x**y
ll expo(int x, int y){
  ll ans = 1;
  rep(i, y){
    ans *= x;
  }
  return ans;
}
//桁数
int keta(ll x){
  if(x == 0) return 1;
  int res = 0;
  while(x){
    x /= 10;
    res++;
  }
  return res;
}


int main(){
  int n;
  cin >> n;
  cout << expo(n, 3) << endl;
}


/*





















*/


Measured memory_bytes: 256
import static java.lang.System.*;

import java.lang.reflect.Array;
import java.util.*;
import java.util.Map.Entry;

public class Main {

	public void run() {
		while (true) {
			String m=sc.next();
			if (m.equals("0"))return;
			char[] c = (m+"").toCharArray();
			int len=c.length;
			int[] mmap=new int[len];
			for(int i=0;i<len;i++){
				mmap[i]=c[i]-'0';
				if(i%2==1)mmap[i]*=-1;
			}

			int[][] dp=new int[len+1][11];
			for(int i=0;i<len;i++){
				//induction
				for(int j=0;j<11;j++)
					dp[i+1][(j+mmap[i]+11)%11]+=dp[i][j];

				//new
				if(mmap[i]%11!=0)dp[i+1][(mmap[i]+11)%11]++;
			}

			int res=0;
			for(int i=1;i<len+1;i++)res+=dp[i][0];
			ln(res);
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}

	static Scanner sc = new Scanner(in);

	// output lib
	static final String br = System.getProperty("line.separator");
	static final String[] asep = new String[] { "", " ", br, br + br };

	static String str(Boolean o) {
		return o ? "YES" : "NO";
	}

	// static String str(Double o){
	// return String.format("%.8f",o);
	// }
	static <K, V> String str(Map<K, V> map) {
		StringBuilder sb = new StringBuilder();
		boolean isFirst = true;
		for (Entry<K, V> set : map.entrySet()) {
			if (!isFirst)
				sb.append(br);
			sb.append(str(set.getKey())).append(":")
					.append(str(set.getValue()));
			isFirst = false;
		}
		return sb.toString();
	}

	static <E> String str(Collection<E> list) {
		StringBuilder sb = new StringBuilder();
		boolean isFirst = true;
		for (E e : list) {
			if (!isFirst)
				sb.append(" ");
			sb.append(str(e));
			isFirst = false;
		}
		return sb.toString();
	}

	static String str(Object o) {
		int depth = _getArrayDepth(o);
		if (depth > 0)
			return _strArray(o, depth);
		Class<?> c = o.getClass();
		if (c.equals(Boolean.class))
			return str((Boolean) o);
		// if(c.equals(Double.class))return str((Double)o);

		return o.toString();
	}

	static int _getArrayDepth(Object o) {
		if (!o.getClass().isArray() || Array.getLength(o) == 0)
			return 0;
		return 1 + _getArrayDepth(Array.get(o, 0));
	}

	static String _strArray(Object o, int depth) {
		if (depth == 0)
			return str(o);
		StringBuilder sb = new StringBuilder();
		for (int i = 0, len = Array.getLength(o); i < len; i++) {
			if (i != 0)
				sb.append(asep[depth]);
			sb.append(_strArray(Array.get(o, i), depth - 1));
		}
		return sb.toString();
	}

	static void pr(Object... os) {
		boolean isFirst = true;
		for (Object o : os) {
			if (!isFirst)
				out.print(" ");
			out.print(o);
			isFirst = false;
		}
	}

	static void ln() {
		out.println();
	}

	static void ln(Object... os) {
		for (Object o : os) {
			pr(o);
			ln();
		}
	}
}

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

int main(){
  long n,count;
  cin >> n;
  count = 0;
  vector<long> a(n+1),b(n);
  for(int i; i < n+1; i++){
    cin >> a.at(i);
  }
  for(int j; j<n;j++){
    cin >> b.at(j);
  }
  for(int p; p<n;p++){
    if(a.at(p) >= b.at(p)){
      count += b.at(p);
      continue;
    }
    else{
      if(a.at(p) + a.at(p+1) >= b.at(p)){
      count += b.at(p);
      a.at(p+1) -= b.at(p) - a.at(p);
    }
    else if(b.at(p) > a.at(p) + a.at(p+1)){
      count += a.at(p) + a.at(p+1);
      a.at(p+1) = 0;
      }
    }
  }
  cout << count << endl;

}
             
            
          
      
    


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> p(n);
  rep(i, n) cin >> p[i];
  sort(p.begin(), p.end());
  
  int ans = 0;
  rep(i, k) ans += p[i];
  cout << ans << endl;
  
return 0;
}



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

using ll=long long;
const ll MOD=1000000007;

int main() {
  string n;
  cin >> n;
  bool a=false;
  for(int i=0;i<3;i++){
    if(n[i]=='7')
      a=true;
  }
  if(a)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 3624
/*
          , -- 、
        /;;;;;;', 　　　
        i二二二i
      , ' 　    ヽ ???
     i　ﾉﾉﾉﾉﾉﾍ .', 　　
     〉ﾘi' ﾟ ヮﾟﾉﾚく　 WAyon..........
  ○⊂}〈lﾄ--ｲl〉{つ● 　　
      ,ｒ/ー i-ヽヽ 　　　
     ｀｀i_ﾗi_ﾗ
*/

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
const int INF=(int)1e12;
const int mod=(int)1e9+7;
#define all(a) (a).begin(),(a).end()
typedef vector<vector<int>> graph;

#define pb push_back

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

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

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

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

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

int gcd(int a,int b){
    if(a%b==0)return b;
    return gcd(b,a%b);
}



signed main () {
int n;cin >>n;
cout <<(10000-n)%1000<<endl;
}





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

int main(){
    // input
    int a, b, k;
    cin >> a >> b >> k;

    // calc
    for(int i=0; i<k; i++){
        if(i%2 == 0){
            // takahashi's turn
            if(a % 2 == 1){
                a--;
            }
            int give = a/2;
            a -= give;
            b += give;
        }else{
            // aoki's turn
            if(b % 2 == 1){
                b--;
            }
            int give = b/2;
            a += give;
            b -= give;
        }
    }

    // out
    cout << a << " " << b << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef pair<int, int> P;

signed main(){
    while(1){
        int m, nmin, nmax;
        cin >> m >> nmin >> nmax;
        if(m + nmin + nmax == 0) break;
        vector<int> p(m);
        rep(i, 0, m){
            cin >> p[i];
        }
        int ans = 0, MAX = 0;
        rep(i, nmin, nmax + 1){
            int diff = p[i - 1] - p[i];
            if(diff >= MAX){
                MAX = diff;
                ans = i;
            }
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 2996
#include "bits/stdc++.h"
using namespace std;
typedef long long LL;
const LL MOD = 1000000007LL;
LL A[200000];
LL sum[200001];
struct SegTree {
	vector<LL> dat[(1 << 19) - 1];
	void init(int k, int l, int r) {
		if (r - l == 1) {
			dat[k].push_back(sum[l]);
		}
		else {
			int lch = k * 2 + 1, rch = k * 2 + 2;
			init(lch, l, (l + r) / 2);
			init(rch, (l + r) / 2, r);
			dat[k].resize(r - l);
			merge(dat[lch].begin(), dat[lch].end(), dat[rch].begin(), dat[rch].end(), dat[k].begin());
		}
	}
	int query(int i, int j, LL x, int k, int l, int r) {
		if (j <= l || r <= i) return 0;
		if (i <= l&&r <= j) {
			return upper_bound(dat[k].begin(), dat[k].end(), x) - dat[k].begin();
		}
		int lc = query(i, j, x, k * 2 + 1, l, (l + r) / 2);
		int rc = query(i, j, x, k * 2 + 2, (l + r) / 2, r);
		return lc + rc;
	}
};
SegTree S;
int main() {
	int N;
	LL K;
	cin >> N >> K;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		A[i] -= K;
	}
	for (int i = 0; i < N; i++) {
		sum[i + 1] = sum[i] + A[i];
	}
	S.init(0, 0, N + 1);
	LL ans = 0;
	for (int i = 1; i <= N; i++) {
		ans += S.query(0, i, sum[i], 0, 0, N + 1);
	}
	cout << ans << endl;
}

Measured memory_bytes: 52096