akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#define INF 1 << 20

using namespace std;

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

int main(void) {
	int num, x, y, i, j, k, a, b, c, m, ans = INF;
	cin >> num >> x >> y;
	m = num * 10;
	vector<vector<vector<int>>> dp(num + 1, vector<vector<int>>(m + 1, vector<int>(m + 1, 0)));
	for (i = 0; i < num; i++) {
		for (j = 1; j <= m; j++) {
			for (k = 1; k <= m; k++) {
				dp[i + 1][j][k] = dp[i][j][k];
			}
		}
		scanf("%d%d%d", &a, &b, &c);
		if (dp[i + 1][a][b] == 0)
			dp[i + 1][a][b] = c;
		else
			dp[i + 1][a][b] = min(dp[i + 1][a][b], c);
		for (j = 1; j <= m - a; j++) {
			for (k = 1; k <= m - b; k++) {
				if (dp[i][j][k] > 0) {
					if (dp[i + 1][j + a][k + b] == 0)
						dp[i + 1][j + a][k + b] = dp[i][j][k] + c;
					else
						dp[i + 1][j + a][k + b] = min(dp[i + 1][j + a][k + b], dp[i][j][k] + c);
				}
			}
		}
	}
	a = x;
	b = y;
	while (a <= m && b <= m) {
		if (dp[num][a][b] > 0)
			ans = min(ans, dp[num][a][b]);
		a += x;
		b += y;
	}
	if (ans < INF)
		cout << ans << "\n";
	else
		printf("-1\n");
	return 0;
}

Measured memory_bytes: 27264
EPS = 10**(-10)

N = int(input())
points = [list(map(float,input().split())) for _ in range(N)]

def dist(p0,p1):
    x0,y0 = p0
    x1,y1 = p1
    return ((x1-x0)**2+(y1-y0)**2)**0.5

def canMakeRectangle(p0,p1,p2):
    x0,y0 = p0
    x1,y1 = p1
    x2,y2 = p2
    if (y1-y0)*(x2-x0)-(y2-y0)*(x1-x0)<EPS:
        return False
    else:
        return True

def circumcircle(p0,p1,p2):
    x0,y0 = p0
    x1,y1 = p1
    x2,y2 = p2
    l0,l1,l2 = dist(p1,p2),dist(p2,p0),dist(p0,p1)
    r = l0*l1*l2/(((l0+l1+l2)*(-l0+l1+l2)*(l0-l1+l2)*(l0+l1-l2))**0.5)
    a = ((l0**2)*(l1**2+l2**2-l0**2)*x0+(l1**2)*(l2**2+l0**2-l1**2)*x1+(l2**2)*(l0**2+l1**2-l2**2)*x2)/((l0**2)*(l1**2+l2**2-l0**2)+(l1**2)*(l2**2+l0**2-l1**2)+(l2**2)*(l0**2+l1**2-l2**2))
    b = ((l0**2)*(l1**2+l2**2-l0**2)*y0+(l1**2)*(l2**2+l0**2-l1**2)*y1+(l2**2)*(l0**2+l1**2-l2**2)*y2)/((l0**2)*(l1**2+l2**2-l0**2)+(l1**2)*(l2**2+l0**2-l1**2)+(l2**2)*(l0**2+l1**2-l2**2))
    return r,a,b

def circle(p0,p1):
    x0,y0 = p0
    x1,y1 = p1
    r = dist(p0,p1)/2
    a = (x1-x0)/2+x0
    b = (y1-y0)/2+y0
    return r,a,b

def check(c,P):
    r,a,b = c
    for p in P:
        if dist((a,b),p) > r+EPS:
            return False
    return True

ans = float('inf')

for i in range(N):
    for j in range(N):
        for k in range(N):
            if i==j or j==k or k==i:
                continue
            if canMakeRectangle(points[i],points[j],points[k]):
                r,a,b = circumcircle(points[i],points[j],points[k])
                if check((r,a,b),points):
                    ans = min(ans,r)

for i in range(N):
    for j in range(N):
        if i==j:
            continue
        r,a,b = circle(points[i],points[j])
        if check((r,a,b),points):
            ans = min(ans,r)

print(ans)

Measured memory_bytes: 63964
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
const int mod=1000000007 ;

int d[100000] ;
int visited[100000] ;
int parent[100000] ;

void bfs(int source,vector<vector<int>> &adj,int n){

	queue<int> q ; 
	q.push(source) ;
	d[source]=0 ;
	parent[source]=-1 ;
	visited[source]=1 ;

	while(!q.empty()){

		int t=q.front() ;
		q.pop() ;

		for(auto x: adj[t]){

			if(visited[x]==0){
				q.push(x) ;
				visited[x]=1 ;
				parent[x]=t ;
				d[x]=d[t]+1 ;
			}
		}
	}

	for(int i=1;i<=n;i++){
		if(i!=source && d[i]==0){
			cout<<"No" ;
			return ;
		}
	}

	cout<<"Yes"<<"\n" ;
	
	for(int i=2;i<=n;i++){
		cout<<parent[i]<<"\n" ;
	}		
}

void solve(){
	
	int v,e ;
	cin>>v>>e ;

	vector<vector<int>> adj(v+1) ;

	for(int i=0;i<e;i++){
	
		int l,r ;
		cin>>l>>r ;

		adj[l].push_back(r) ;
		adj[r].push_back(l) ;

	}

	for(int i=1;i<=v;i++){
	
		d[i]=0 ;
		visited[i]=0 ;
		parent[i]=0 ;
	
	}


	bfs(1,adj,v) ;

}


int main(){
	
	int y ;

	y=1 ;
	//cin>>y ;

	while(y--)
	{	
		solve() ;
	}

}

Measured memory_bytes: 11020
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
struct node{
  unsigned int key;
  struct node *next;
  struct node *prev;
};
 
typedef struct node * NodePointer;
 
NodePointer nil;
 
NodePointer listSearch(int key){
  NodePointer x;
  for(x = nil->next;x!=nil;x=x->next){
  if(x->key==key)return x;
  }
  return NULL;
}
 

void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;

}
 
void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}
 
void deleteNode(NodePointer t){
 
 
  t->next->prev=t->prev;
  t->prev->next=t->next;
 
  free(t);
}
 
void deleteFirst(){
  NodePointer t = nil->next;
  if ( t == nil ) return;
  deleteNode(t);
}
 
void deleteLast(){
  NodePointer t = nil->prev;
  if (t==nil)return;
  deleteNode(t);
}
 
void delete(int key){
  NodePointer t=listSearch(key);
  if(t==NULL)return;
  deleteNode(t);
}
 
 
void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;
 
  x->next=nil->next;
  nil->next->prev=x;
  nil->next=x;
  x->prev=nil;
 
 
}
 
int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {insert(key); np++; size++;}
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
    if ( com[6] == 'F' ) deleteFirst();
    else if ( com[6] == 'L' ) deleteLast();
      } else {
    delete(key); nd++; 
      }
      size--;
    }
  }
 
  printList();
  return 0;
}



Measured memory_bytes: 32936
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

int main(void) {

	long long int H;
	cin >> H;

	// 何回？
	long long int count = 0;
	while (H != 1) {
		H /= 2;
		count++;
	}
	count++;

	// 回数を計算
	long long int ans = 0;
	for (long long int i = 0; i < count; i++) {

		long long int ans_ = 1;
		for (long long int j = 0; j < i; j++) {
			ans_ *= 2;
		}

		ans += ans_;
	}

	cout << ans;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> p;
const int inf=100000000;
#define rep(i,a,n)	for(int i=a;i<n;i++)
#define rrep(i,a,n) for(int i=(a-1);i>=n;i--)
 
ll gcd(ll a,ll b){
	if(b==0)return a;
	return gcd(b,a%b);
}
ll lcm(ll a,ll b){
	ll g=gcd(a,b);
	return a/g*b;
}
 
ll digitsum(ll a){
	ll x=0;
	while(a>0){
		x+=a%10;
		a/=10;
	}
	return x;
}
int r,c;
char s[55][55];
int d[55][55];
int mazebfs(){
	int sx=0,sy=0,gx=r-1,gy=c-1;
	int dx[4]={1,0,-1,0} ,dy[4]={0,1,0,-1};
	queue<p> que;
	rep(i,0,r){
		rep(j,0,c){
			d[i][j]=inf;
		}
	}
	que.push(p(sx,sy));
	d[sx][sy]=0;
	while(que.size()){
		p pf=que.front();
		que.pop();
		
		if(pf.first==r-1&&pf.second==c-1) break;
		rep(i,0,4){
			int nx=pf.first+dx[i],ny=pf.second+dy[i];
			if(nx>=0&&nx<r&&ny>=0&&ny<c&&s[nx][ny]!='#'&&d[nx][ny]==inf){
				que.push(p(nx,ny));
				d[nx][ny]=d[pf.first][pf.second]+1;
			}
		}
	}
	return d[r-1][c-1];
}
int main(){
		ll n,t;
	cin>>n>>t;
	ll ans=inf;
	rep(i,0,n){
		ll x,y;
		cin>>x>>y;
		if(y<=t)ans=min(ans,x);
	}
	if(ans==inf)cout<<"TLE"<<endl;
	else cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

class Main{
	public static void main(String[] args){
		solve();
	}
	public static void solve(){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for(int i=0;i<n;i++){
			a[i] = sc.nextInt();
		}
		Arrays.sort(a);
		int max = a[n-1];
		int min = (max+1)/2;
		int now = 0;
		for(int i=1;i<n-1;i++){
			if((int)Math.abs(min-a[i])<(int)Math.abs(min-a[now])){
				now = i;
			}
		}
		System.out.println(max+" "+a[now]);
	}
}



Measured memory_bytes: 50248
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define F first
#define S second
//cout<<fixed<<setprecision(11);
const string nl="\n";
const ll MOD=1000000007;
const ll ARR_MAX = 1e5+1;

void solve(){
    string s,t;
    cin>>s>>t;
    int n=s.size(),m=t.size();
    int dp[n+1][m+1]={}; //dp[i][j] = max common sequnce of s[0..i],t[0..j]
    for(int i=0;i<n;i++){
    	for(int j=0;j<m;j++){
    		if(s[i]==t[j]){
    			dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j]+1);
    		}
    		dp[i+1][j]=max(dp[i+1][j],dp[i][j]);
    		dp[i][j+1]=max(dp[i][j+1],dp[i][j]);
    	}
    }
    int li=n,lj=m;
    int mx=dp[n][m];
    for(int i=0;i<n;i++){
    	if(dp[i][m]>mx){
    		li=i;lj=m;
    		mx=dp[i][m];
    	}
    }
    for(int j=0;j<m;j++){
    	if(dp[n][j]>mx){
    		li=n;lj=j;
    		mx=dp[n][j];
    	}
    }
    // cout<<mx<<nl;
    if(mx==0){
    	cout<<"";
    	return;
    }
    // li--;lj--;
    vector<int> indices;
    while(li>0 && lj>0){
    	// cout<<li<<" "<<lj<<" "<<dp[li][lj]<<nl;
    	if(dp[li][lj]==dp[li-1][lj-1]){
    		li--;lj--;
    		continue;
    	}
    	if(s[li-1]==t[lj-1]){
    		indices.pb(li);
    		li--;lj--;
    	}
    	else if(dp[li][lj]==dp[li-1][lj]){
    		li--;
    	}
    	else{
    		lj--;
    	}
    }
    // cout<<li<<" "<<lj<<" "<<dp[li][lj]<<nl;
    // while(li>0 || lj>0){
    // 	if(s[li]==t[lj]){
    // 		indices.pb(li+1);
    // 		li--;lj--;
    // 		break;
    // 	}
    // 	else if(li==0) lj--;
    // 	else if(lj==0) li--;
    // }
    sort(indices.begin(),indices.end());
    string ans="";
    for(int i=0;i<indices.size();i++){
    	ans+=s[indices[i]-1];
    }
    cout<<ans<<nl;
}

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

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

using namespace std;
using ll = long long;

const int N = 1e6 + 5, M = 1e9 + 7;

int a[N];

void solve() {            
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
    }    
    ll res = 0;
    for (int i = 2; i <= n; ++i) {     
        if (a[i - 1] > a[i]) {
            res += a[i - 1] - a[i];
            a[i] = a[i - 1];
        }
    }
    cout << res;
}

main() {
    ios :: sync_with_stdio(0);
    cin.tie(0);
    int tt = 1;
    //cin >> tt;
    while (tt--) {
        solve();
        cout << '\n';
    }
    return 0;
}

Measured memory_bytes: 4376
#include <bits/stdc++.h>
#include <iomanip>
#include<algorithm>
#define ll long long
using namespace std;

int main() {
  ll N, M, X, sumprice = 0, min = 10000000;
  cin >> N >> M >> X;
  vector<ll> C(12, 0), sum(M, 0);
  vector<vector<ll>> A(12, vector<ll>(M));
  bool judge = 1;
  for(ll i = 0; i < N; i++) {
    cin >> C.at(i);
    sumprice += C.at(i);
    for(ll j = 0; j < M; j++) {
      cin >> A.at(i).at(j);
      sum.at(j) += A.at(i).at(j);
      if((i == N - 1) && (sum.at(j) < X)) judge = 0;
    }
  }
  if(judge == 0) cout << -1 << endl;
  else {
    vector<ll> sumcharge(M);
    ll sumpricecharge;
    for(ll i = 0; i < M; i++) sumcharge.at(i) = sum.at(i);
    sumpricecharge = sumprice;
    for(ll i = 0; i < pow(2, N); i++) {
      for(ll k = 0; k < M; k++) sum.at(k) = sumcharge.at(k);
      sumprice = sumpricecharge;
      for(ll l = 0; l < 12; l++) {
        if(long(i / pow(2, l)) % 2 == 1) {
          for(ll j = 0; j < M; j++) sum.at(j) -= A.at(l).at(j);
          sumprice -= C.at(l);
        }
      }
      for(ll j = 0; j < M; j++) {
        if(sum.at(j) < X) break;
        if((j == M - 1) && (sumprice < min)) min = sumprice;
      }
    }
    cout << min << endl;
  }
}


Measured memory_bytes: 4036
A, B, C, X = 4.times.map { gets.to_i }

output = 0

(0..A).each do |a|
  break if a > A
  (0..B).each do |b|
    break if b > B
    (0..C).each do |c|
      break if c > C
      output += 1 if (500 * a + 100 * b + 50 * c) == X
    end
  end
end

puts output


Measured memory_bytes: 1788
// includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  string s;
  while(getline(cin, s)){
    FOR(i, 1, 27){
      string t = s;
      string res = "";
      rep(j, t.size()){
        if(!('a' <= s[j] && s[j] <= 'z')){
          res += t[j];
        }else{
          res += char(((int(t[j] - 'a') + i) % 26) + 'a');
        }
      }
      string tmp = "";
      bool flag = false;
      rep(j, res.size()){
        if(res[j] != ' ' && res[j] != '.')tmp += res[j];
        else{
          if(tmp == "the" || tmp == "this" || tmp == "that"){
            flag = true;
            break;
          }
          tmp = "";
        }
      }
      if(tmp == "the" || tmp == "this" || tmp == "that"){
        flag = true;
      }
      if(flag){
        cout << res << endl;
        break;
      }
    }
  }
	return 0;
}



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

int main()
{
    string S;
    cin>>S;
    string result = "None";
    map<char,int> d;
    for(int i = 0;i<S.size();i++){
        d[S[i]] += 1;
    }
    for(char i = 'a';i<='z';i++){
        if(d[i]==0){
            result = i;
            break;
        }
    }
    cout<<result<<endl;
}

Measured memory_bytes: 3768
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(ll i = 0; i < (ll) n; i++)
#define xrep(i,x,n) for(ll i = (ll) x; i < (ll) n; i++)
#define vl vector<long long>
#define vs vector<string>
#define SORT(A) sort(A.begin(),A.end())

int main() {
    string S; cin >> S;
    ll count = 0;
    rep(i,3){
        if(S[i] == 'R') count ++;
    }
    if(count == 2 && S[1] == 'S') count = 1;
    cout << count << endl;
}

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

int main(){
	int a,b,c,d,e,f;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	e = a + b + c + d;
	cout << e/60 << endl;
	cout << e%60 << endl;

	return 0;
}

Measured memory_bytes: 3084
#include <bits/stdc++.h>
using namespace std;
//NOT TO SUBMIT IN WRONG PLACE OR BY WRONG COMPILER
//ABC128, task C, 2020/05/01
//ms,
/*
bit全探索をマスターするぜ！精進精進！！！！
*/

int main(void){
  int light_num;//M
  int switch_num;//N

  vector<int> k(10);//k
  int s[10][10];//s
  vector<int> p(10);//p
  int tmp_on_swt;
  int ans=0;

  //input
  cin >>switch_num >>light_num;
  for(int i=0;i<light_num;i++){
    cin >>k.at(i);
    for(int j=0;j<k.at(i);j++) cin >>s[i][j];
  }

  for(int i=0;i<light_num;i++) cin >>p.at(i);

  //bit全探索するぜ！
  for(int bit=0;bit<(1<<switch_num);bit++){
    for(int i=0;i<light_num;i++){
      tmp_on_swt=0;
      for(int j=0;j<k.at(i);j++){
        if(bit & (1<<(s[i][j]-1)) ) tmp_on_swt++;
      }
      if(tmp_on_swt%2 != p.at(i)) goto OUT;
    }
    ans++;
    OUT:
      continue;
  }

  cout <<ans <<endl;
  return 0;
}
/*
switchのonoff、いかにもbit全探索だ。
*/


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

const ll MOD = 1e9 + 7;

int main() {
  ll N;
  while (cin >> N) {
    vec<ll, 2> dp = make_v(2, 2, 0ll);
    dp[0][1] = 1;
    for (int b = 0; b < 70; b++, N /= 2) {
      int cur = N & 1;
      vec<ll, 2> ndp = make_v(2, 2, 0ll);
      for (int c = 0; c < 2; c++) {
        for (int p = 0; p < 2; p++) {
          for (int a = 0; a <= 2; a++) {
            int dig = (a + c) % 2;
            int nc = (a + c) / 2;
            int np;
            if (dig < cur) {
              np = 1;
            } else if (dig > cur) {
              np = 0;
            } else {
              np = p;
            }
            (ndp[nc][np] += dp[c][p]) %= MOD;
          }
        }
      }
      dp = ndp;
    }
    cout << dp[0][1] << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>



int main()
{
    int32_t nums;
    std:: cin >> nums;

    int32_t val = nums % 10;

    switch (val)
    {
    case 0:
    case 1:
    case 6:
    case 8:
        std::cout << "pon";
        return 0;
    case 2:
    case 4:
    case 5:
    case 7:
    case 9:
        std::cout << "hon";
        return 0;
    case 3:
        std::cout << "bon";
        return 0;
    default:
        return 0;
    }
}

Measured memory_bytes: 3124
#include <stdio.h>
#include <string.h>

int main(int argc, const char * argv[]) {
    char C[201];
    char c[201];
    char c2[201];
    
    int m,h;
    
    int a=0,b=0;
    
    while(1){
        
        scanf("%s",C);
        
        if(C[0]=='-'){
            break;
        }//-でプログラム終了
        
        scanf("%d",&m);//シャッフル回数
        
        b=(int)strlen(C);
        
        for(a=0;a<m;a++){//入れ替え部分
            scanf("%d",&h);//下から何枚目か指定
            
            strncpy(c,&C[0],h);
//            printf("c: %s\n",c);
            strncpy(c2,&C[h],b-h);
//            printf("c2: %s\n",c2);
            strncpy(C,c2,b-h);
//            printf("A: %s\n",C);
            strncpy(&C[b-h],c,h);
//            printf("A2: %s\n",C);
            
        }
        printf("%s\n",C);
        
    }
    return 0;
}



Measured memory_bytes: 2024
from operator import itemgetter

n, m = map(int, input().split())
yp = []
for i in range(m):
  p_, y_ = map(int, input().split())
  yp.append([y_, p_, i+1])
py = sorted(yp)
ken = [0]*n
res = []
for i in range(m):
  ken[py[i][1]-1] += 1
  p, q, r = py[i][1], ken[py[i][1]-1], py[i][2]
  res.append([p, q, r])
#print(yp)
#print(py)

res.sort(key=itemgetter(2))
#print(res)
for i in range(m):
  ans1 = [0]*(6-len(str(res[i][0])))
  ans1.append(res[i][0])
  ans2 = [0]*(6-len(str(res[i][1])))
  ans2.append(res[i][1])
  print(*ans1, *ans2, sep='')

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

fn main() {
    let n: usize = read();
    println!(
        "{}",
        if (0..n).map(|_| read::<i64>() % 2).sum::<i64>() % 2 == 0 {
            "YES"
        } else {
            "NO"
        }
    );
}

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


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

int main(void) {
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  vector<int> sa = atcoder::suffix_array(S);
  int64_t answer = sa.size() * (sa.size() + 1L) / 2L;
  for (auto n : atcoder::lcp_array(S, sa)) {
    answer -= n;
  }
  cout << answer << endl;
  return 0;
}


Measured memory_bytes: 15604
#include<stdio.h>

int main(){
  int n,m,s,t,i,j;
  scanf("%d",&n);
  int Adj[n][n];
 
 for(i = 0;i < n;i++){
   for(j = 0;j < n;j++){
      Adj[i][j] = 0;
    }
 }
 
 for(i = 0;i < n;i++){
   scanf("%d%d",&t,&m);
    for(j = 0;j < m;j++){
      scanf("%d",&s);
      Adj[t-1][s-1] = 1;
    }
 }
 
 for(i = 0;i < n;i++){
   for(j = 0;j < n;j++){
     if(j != 0){
       printf(" ");
     }
     printf("%d",Adj[i][j]);
   }
   printf("\n");
 }
 
 return 0;
   
}

Measured memory_bytes: 636
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define fi first
#define se second
#define pb push_back
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define forr(i,n) for(int i=n;i>=0;i--)
#define all(x) x.begin(), x.end()
const int MAXN = 1e5 +5;

void fio(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

LL co[MAXN];
int main(){
  fio();
  LL n,m,x; cin>>n>>m>>x;
  vector <vector <LL> > v(n);
  forn(i,n){
  	cin>>co[i];
  	forn(j,m){
  		LL xx; cin>>xx;
  		v[i].pb(xx);
  	}
  }

LL  an  =1e18;
  forn(msk,1<<n){
  	vector <LL> mm(m);
  	LL kk= 0;
  	forn(i,n){
  		if(msk>>i&1){
  			kk+=co[i];
  			forn(j,m){
  				mm[j]+=v[i][j];
  			}
  		}
  	}
  	int bb = 1;
  	forn(i,m){
  		bb &= mm[i]>=x;
  	}
  	if(bb){
  		an = min(an,kk);
  	}
  }
  if(an==1e18) cout<<-1<<endl;
  else cout<<an<<endl;
  return 0;
}

Measured memory_bytes: 3604
import sys

mod = 10**9 + 7

N, K = map(int, sys.stdin.readline().split())
A = list(map(int, sys.stdin.readline().strip().split()))

# 0も入れておく
pos_list = []
neg_list = []
zero_count = 0
for a_i in A:
    if a_i > 0:
        pos_list.append(a_i)
    elif a_i == 0:
        zero_count += 1
    else:
        neg_list.append(a_i)

lp = len(pos_list)
ln = len(neg_list)

if min(2 * (ln // 2), 2 * (K // 2)) + lp >= K:
    # 降順
    pos_list.sort(reverse = True)
    neg_list.sort()

    pos_twins = [pos_list[2 * i] * pos_list[2 * i + 1] for i in range(lp // 2)] + [0]
    neg_twins = [neg_list[2 * i] * neg_list[2 * i + 1] for i in range(ln // 2)] + [0]
    pos_twins.sort()
    neg_twins.sort()
 
    ans = 1
    pos_select = 0
    for i in range(K // 2):
        if pos_twins[-1] <= neg_twins[-1]:
            ans *= neg_twins[-1]
            ans %= mod
            neg_twins.pop()
        else:
            ans *= pos_twins[-1]
            ans %= mod
            pos_twins.pop()
            pos_select += 1
 
    if K % 2 == 1:
        if K == 1:
            ans = pos_list[2 * pos_select]
        else:
            ans *= pos_list[2 * pos_select]
    print(ans % mod)    
elif zero_count > 0:
	print(0)
# マイナスになるため、最小化する
else:
    ans = 1
    abs_list = sorted([abs(a) for a in A])
    for a in abs_list[:K]:
        ans *= a
        ans %= mod
    print((-1) * ans % mod)

Measured memory_bytes: 120148
#include <stdio.h>
int main(void){
    int a,n,i,min=1000000,max=-1000000;
    long long sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a);
        sum=sum+a;
        if(min>a) {
            min=a;
        }
        if(max<a){
            max=a;
        }
    }
    printf("%d %d %lld\n",min,max,sum);   
    return 0;
}



Measured memory_bytes: 2104
INF = int(1e9+7)


def main():
    N, *An = map(int, open(0).read().split())
    An.sort()
    if N % 2:
        if [0] + [i for i in range(2, N, 2) for j in range(2)] == An:
            print(2 ** (N // 2) % INF)
            return
    else:
        if [i for i in range(1, N, 2) for j in range(2)] == An:
            print(2 ** (N // 2) % INF)
            return
    print(0)
    return


main()


Measured memory_bytes: 13940
#include <bits/stdc++.h>
using namespace std;
#define ROUNDUP(divisor,dividend) (divisor + (dividend - 1)) / dividend
int a,b,c,d,e,f,g;
string s1,s2,s3,s4,s5;
int main(){
  cin >> a >> b;
  cout << (a>=13 ? b : a>=6 ? b/2 : 0) << endl; 
}


Measured memory_bytes: 256
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = list(map(int, sys.stdin.readline().split()))
    lines = [line.rstrip() for line in sys.stdin.readlines()]

    ret = -1
    MIN = 0 if N == 1 else pow(10, N - 1)
    MAX = 10 if N == 1 else pow(10, N)
    for n in range(MIN, MAX):
        flg = True
        for line in lines:
            s, c = map(int, line.split())
            t = str(n)

            if t[s - 1] != str(c):
                flg = False

        if flg:
            ret = n
            break

    print(ret)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7+1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;

ll n,m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

/*--------------------template--------------------*/


int main()
{
	cin >> n;
	if (n == 1) {
		cout << 2 << endl;
	} else if (n == 0 || n == 2) {
		cout << 1 << endl;
	} else {
		cout << 0 << endl;
	}
}

Measured memory_bytes: 3160
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] aline = br.readLine().split(" ");
		int a1 = Integer.parseInt(aline[0]);
		int a2 = Integer.parseInt(aline[1]);
		int a3 = Integer.parseInt(aline[2]);

		int max = Math.max(a1, Math.max(a2, a3));
		int min = Math.min(a1, Math.min(a2, a3));

		System.out.println(max - min);

	}

}


Measured memory_bytes: 21204
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
int main(){   
   vector<int> s;
   string a;
   cin>>a;
   rep(i,a.size()){
      s.push_back(a[i]-'0');
   }
   int ans=1000;
   rep(i,s.size()-2){
      ans=min(ans,abs(753-(100*s[i]+10*s[i+1]+s[i+2])));
   }
   cout<<ans;

   return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, K;
  cin >> N >> K;
  vector<int> vec(N);
  for(int i=0; i<N; i++){
    cin >> vec[i];
  }
  for(int i=0; i<K; i++){
    vector<int> left(N,0);
    vector<int> right(N,0);
    for(int j=0; j<N; j++){
      //leftの処理
      if(j != N-1){
        left[j+1]++;
      }
      if(j + vec[j] + 1 <= N-1){
        left[j + vec[j] + 1]--;
      }
      //rightの処理
      if(j != 0){
        right[j-1]++;
      }
      if(j - vec[j] - 1 >= 0){
        right[j - vec[j] - 1]--;
      }
    }
    for(int j=1; j<N; j++){
      left[j] += left[j-1];
      right[N-j-1] += right[N-j];
    }
    bool n = true;
    for(int j=0; j<N; j++){
      vec[j] = left[j] + right[j] + 1;
      if(vec[j] != N){
        n = false;
      }
    }
    if(n){
      break;
    }
  }
  
  for(int i=0; i<N; i++){
    cout << vec[i] << endl;
  }
}

Measured memory_bytes: 5548
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set <int>
#define sll set <ll>
#define spii set <pii>
#define vs vector <string>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define forn(i, n) for (int i = 0; i < (n); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()


using namespace std;
const ll INFLL = 1e18;
const int MAXN = 2e6+100;
const ll INF = 1e9;
const ll mod1=1e9+7;
const ll mod2=2e9+11;
ll bin_pow(ll base,ll deg)
{
    if (deg==0)
        return 1;
    ll t=bin_pow(base,deg/2);
    if (deg&1)
        return (((t*t)%mod1)*base)%mod1;
    else
        return (t*t)%mod1;
}
ll fact[MAXN];
ll ans(ll a,ll b)
{
    if (a==0&&b==0)
        return 1;
// число в a+1,b+1 - 1 <=> (a+b+2,a+1)-1
//cout<<a<<" "<<b<<'\n';
ll anss=1;
anss=fact[a+b+2];
//cout<<anss<<'\n';
anss*=bin_pow(fact[b+1],mod1-2);
anss%=mod1;
//cout<<anss<<'\n';
    anss*=bin_pow(fact[a+1],mod1-2);
    anss%=mod1;
//cout<<anss<<'\n';
return anss-1;
}
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("a.in","r",stdin);
#endif
    ll r1,r2,c1,c2;
    cin>>r1>>c1>>r2>>c2;
   // cout<<r2<<" "<<c2<<'\n';
    ll f=1;
    for (ll i=0;i<MAXN;i++)
        fact[i]=f,f*=(i+1),f%=mod1;
   // cout<<fact[3]<<'\n';
   // cout<<fact[2]<<'\n';
  //  cout<<r2<<" "<<c2<<'\n';
  //cout<<ans(1,1)<<'\n';
  //cout<<ans(r2,c2)<<'\n';
   // cout<<r2<<" "<<c1<<'\n';
   // cout<<ans(2,1)<<'\n';
   //cout<<ans(r2,c2)<<'\n';
   // cout<<ans(r2,c2)<<'\n';
  // cout<<ans(2,0)<<'\n';
    cout<<((ans(r2,c2)-ans(r2,c1-1)-ans(r1-1,c2)+ans(r1-1,c1-1))%mod1+mod1)%mod1;





}

Measured memory_bytes: 15872
program main
    implicit none
    integer(8) a,b,x,i,j
    read(*,*) x
    do i = 0, 1000
        do j = 0, 1000
            if ( j**5-i**5==x ) then
                a=j
                b=i
                exit
            else if ( j**5+i**5==x ) then
                a=j
                b=-i
                exit
            end if
        end do
    end do
    write(*,*) a,b
end program main

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

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

using namespace std;

typedef long long ll;

int main()
{
    int N, X, Y;
    cin >> N >> X >> Y;
    X--;
    Y--;
    vector<pair<int, int>> G[N];
    REP(i, N - 1)
    {
        G[i].push_back(make_pair(i + 1, 1));
        G[i + 1].push_back(make_pair(i, 1));
    }
    G[X].push_back(make_pair(Y, 1));
    G[Y].push_back(make_pair(X, 1));

    int ans[N] = {0};
    REP(i, N)
    {
        queue<int> q;
        vector<bool> isVisited(N, false);
        vector<int> dist(N, INT32_MAX);
        q.push(i);
        dist[i] = 0;
        while(!q.empty())
        {
            int v = q.front();
            q.pop();
            if (!isVisited[v])
            {
                isVisited[v] = true;
                for (auto iter = G[v].begin(); iter != G[v].end(); ++iter)
                {
                    int next = (*iter).first;
                    int w = (*iter).second;
                    dist[next] = min(dist[next], dist[v] + w);
                    q.push(next);
                }
            }
        }
        REP(i, N) ans[dist[i]]++;
    }

    for(int i = 1; i < N; ++i) cout << ans[i] / 2 << endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

int main(){
	int a,b,c,count;
	count =0;
	int a1,b1,c1;
	cin >> a >> b >> c;
	while(1){
		if(a%2!=0||b%2!=0||c%2!=0){
			break;
		}
		if(a==b&&b==c){
			count =-1;
			break;
		}
		a1 = (b+c)/2;
		b1 = (a+c)/2;
		c1 = (a+b)/2;
		a = a1;
		b = b1;
		c = c1;
		count +=1;
	}
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 764
package main

import (
	"fmt"
)

func main() {
	var str string
	fmt.Scan(&str)

	var q int
	fmt.Scan(&q)

	for i := 0; i < q; i++ {
		var op string
		fmt.Scan(&op)

		switch op {
		case "replace":
			var a, b int
			var repStr string
			fmt.Scan(&a, &b, &repStr)
			str = str[0:a] + repStr + str[b+1:]
		case "reverse":
			var a, b int
			fmt.Scan(&a, &b)
			reverseStr := reverse(str[a : b+1])
			str = str[0:a] + reverseStr + str[b+1:]
		case "print":
			var a, b int
			fmt.Scan(&a, &b)
			fmt.Println(str[a : b+1])
		}
	}
}

func reverse(str string) string {
	rs := []rune(str)
	for i, j := 0, len(str)-1; i < j; i, j = i+1, j-1 {
		rs[i], rs[j] = rs[j], rs[i]
	}
	return string(rs)
}



Measured memory_bytes: 1312
#include <stdio.h>
#define P_MAX 100

int main(void)
{
    int length[P_MAX + 1], n, m, d, p, sum;

    while(scanf("%d %d", &n, &m), n + m)
    {
        for(p = 0; p <= P_MAX; p++)
            length[p] = 0;

        while(n--)
        {
            scanf("%d %d", &d, &p);
            length[p] += d;
        }

        for(p = P_MAX; p >= 0 && m > 0; p--)
            if(length[p] <= m) m -= length[p], length[p] = 0;
            else length[p] -= m, m = 0;

        for(sum = p = 0; p <= P_MAX; p++)
            sum += p * length[p];

        printf("%d\n", sum);
    }

    return 0;
}

Measured memory_bytes: 596
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 1e9 + 7;
typedef long long ll;
typedef long long LL;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ll> pdl;
typedef pair<ld, ld> pdd;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
//typedef boost::multiprecision::cpp_int bigint;

string base("abcdefghijklnmopqrstuvwxyz");

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	string c;
	cin >> c;
	for (LL n = 0; n < base.size(); n++) {
		if (base.substr(n, 1) == c) {
			cout << base.substr(n + 1, 1) << "\n";
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

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

        while (sc.hasNextLong()) {
            long x = sc.nextLong();
            long y = sc.nextLong();
            long ans = 0;
            long ai = x;

            while (ai <= y) {
                ai *= 2L;
                ans++;
            }

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


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

using namespace std;

int main() {
    size_t a, b;
    cin >> a >> b;
    for (auto e : { 1, 2, 3 }) {
        if (e != a && e != b) {
            cout << e << endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>

using namespace std;

#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define pb(a) push_back(a)
#define print(x) cout<<(x)<<endl
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), n)
#define ub(v,n) upper_bound(v.begin(), v.end(), n)
//#define int long long
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
#define fi first
#define se second
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
const int MOD = 998244353; const int MAX = 200020;
const double pi = 3.141593; const double EPS = 1e-12;
const ll INF = 2e18;
const int INT_INF = 1e9;
typedef pair<double, double>Pd;
double dist(P& p1, P& p2) {
	return sqrt((p1.first - p2.first) * (p1.first - p2.first) + (p1.second - p2.second) * (p1.second - p2.second));
}
double dist(Pd& p1, Pd& p2) {
	return sqrt((p1.first - p2.first) * (p1.first - p2.first) + (p1.second - p2.second) * (p1.second - p2.second));
}

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

void solve() {
	string S; cin >> S;
	int N = S.size();
	cout << S[0] << N - 2 << S[N - 1] << endl;
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q;cin>>q;
	//while(q--)
	solve();
}




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

N, M = map(int, input().split())

# 入力値の頂点ペア(辺)を格納する配列
a = [0] * 50
b = [0] * 50
# 頂点ペアが隣接しているかどうかを格納する配列
graph = [[False for i in range(50)] for j in range(50)]
# ある頂点が訪問済かどうかを格納する配列
visited = [False] * N

# 入力値の頂点ペア(辺)を格納していくループ
for i in range(M):
    a[i], b[i] = map(int, input().split())
    # 添字に合わせて入力値から1減らしておく
    a[i] -= 1
    b[i] -= 1
    # 入力値の内容に合わせて、隣接していることを記録
    graph[a[i]][b[i]] = True
    graph[b[i]][a[i]] = True

# 連結かどうか(全ての頂点が訪問済かどうか)を判定するDFS
def dfs(v):
    # 関数内で使用する変数のglobal宣言
    global graph
    global visited
    # 通った頂点は訪問済にする
    visited[v] = True
    for v2 in range(N):
        # 隣接していないor訪問済はやる意味ないのでcontinue
        if graph[v][v2] == False or visited[v2] == True:
            continue
        # 調べる必要のある箇所は再帰的に調べていく
        dfs(v2)

ans = 0
# 各辺について、橋かどうかを判定していくループ
for i in range(M):
    # まず該当の辺を外す(この状態で連結ではなくなってしまえばそれは橋)
    graph[a[i]][b[i]] = False
    graph[b[i]][a[i]] = False
    # 訪問済判定を初期化
    for j in range(N):
        visited[j] = False
    # 連結かどうか(全ての頂点が訪問済かどうか)を判定するDFS
    dfs(0)
    # 各頂点について、訪問済かどうかを確認していく
    bridge = False
    for j in range(N):
        # 頂点で一つでも未訪問の箇所があれば橋と判定する
        if visited[j] == False:
            bridge = True
    if bridge:
        ans += 1
    # 外した辺を元に戻す
    graph[a[i]][b[i]] = True
    graph[b[i]][a[i]] = True

print(ans)

Measured memory_bytes: 3064
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)

	scanner.Scan()
	N, err := strconv.Atoi(scanner.Text())

	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(N * N * N)
}


Measured memory_bytes: 1836
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            new Program().Solve(new MyInputStream(Console.In, ' '));
            Console.Out.Flush();
        }

        public void Solve(MyInputStream cin)
        {
            WriteLine((cin.ReadInt() - 1) * (cin.ReadInt() - 1));
        }
    }

    public class MyInputStream
    {
        private readonly System.IO.TextReader _stream;
        private char separator = ' ';
        private Queue<string> inputStream;
        public MyInputStream(System.IO.TextReader s, char separator = ' ')
        {
            this.separator = separator;
            this._stream = s;
            inputStream = new Queue<string>();
        }
        public string Read()
        {
            if (inputStream.Count != 0) return inputStream.Dequeue();
            string[] tmp = _stream.ReadLine().Split(separator);
            for (int i = 0; i < tmp.Length; ++i)
                inputStream.Enqueue(tmp[i]);
            return inputStream.Dequeue();
        }
        public string ReadLine() { return _stream.ReadLine(); }
        public int ReadInt() { return int.Parse(Read()); }
        public long ReadLong() { return long.Parse(Read()); }
        public double ReadDouble() { return double.Parse(Read()); }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read(); return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt(); return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong(); return ret;}
    }
}



Measured memory_bytes: 13268
#include <iostream>
#include <vector>
#include <map>
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> A(N+1,0);
    for(int i=1;i<=N;i++) cin >> A[i];
    map<int,int> m;
    int ans = 0;
    for(int i=1;i<=N;i++){
        map<int,int>::iterator it = m.upper_bound(-A[i]);
        if(it==m.end()){
            m[-A[i]]++;
            ans++;
        }else{
            it->second--;
            if(it->second==0) m.erase(it);
            m[-A[i]]++;
        }
    }
    cout << ans << endl;
}

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

int gcd(int a,int b){
    if(a<b){swap(a,b);}
    if(!b){return a;}
    return gcd(b,a%b);
}

int main(){
    int a=1,p,q,i,gc;
    cin>>p>>q;
    gc=gcd(p,q);
    p/=gc;q/=gc;
    for(i=2;i<sqrt(q)+1;i++){
        if(!(q%i)){
            a*=i;
            while(!(q%i)){q/=i;}
        }        
    }
    a*=q;
    cout<<a<<endl;
    return 0;
}


Measured memory_bytes: 3096
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		String[] arr = line.split(" ");
		int a = Integer.parseInt(arr[0]);
		int b = Integer.parseInt(arr[1]);
		System.out.printf("%d %d%n", a * b, a * 2 + b * 2);
	}
}

Measured memory_bytes: 16900
A = sorted(list(map(int,input().split())))
cnt = 0
n = (A[2]-A[0])//2
cnt += n
A[0] += 2*n
n = (A[2]-A[1])//2
cnt += n
A[1] += 2*n
A = sorted(A)
if A[0]<A[1]==A[2]:
    cnt += 2
elif A[0]==A[1]<A[2]:
    cnt += 1
print(cnt)

Measured memory_bytes: 61984
#include <stdio.h>
int gcd(int x, int y) {
	int r;
	while ((r = x % y) != 0) {
		x = y;
		y = r;
	}
	return y;
}
int lcm(int x, int y) {
	return (x / gcd(x, y) * y);
}
int main() {
	int x;
	scanf("%d", &x);
	printf("%d\n", lcm(x, 360) / x);
	return 0;
}

Measured memory_bytes: 1728
#include <iostream>
#include <sstream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <string>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#define pie 3.141592653589793238
using namespace std;
 
int main(void){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int x;
  cin >> x;
  
  long long map[121];
  for(long long i=0; i<121; i++){
    map[i]=i*i*i*i*i;
  }
  
  for(int i=0; i<121; i++){
    for(int j=0; j<121; j++){
      if(map[i] - map[j] == x){
        cout << i << " " << j << endl;
        return 0;
      }
      if(map[i] + map[j] == x){
        cout << i << " " << j*-1 << endl;
        return 0;
      }
    }
  }
  
  return 0;
}

Measured memory_bytes: 3172
/*Hey, What's up?*/

#include<bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
vector<long long>v,vc;
int main()
{
    fastio;
    long long a=0,b=0,c,d,e,f=0,l,g,m,n,k,i,j,t,p,q;
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a;
        v.push_back(a);
        vc.push_back(a);
    }
    sort(v.begin(),v.end());
    for(i=0;i<n;i++){
        if(vc[i]<v[n-1])cout<<v[n-1]<<'\n';
        else cout<<v[n-2]<<'\n';
    }

    return 0;
}


Measured memory_bytes: 4964
#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define dbug(x) cout<<#x<<"="<<x<<endl
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> VP;
typedef long long ll;
typedef pair<ll, ll> pll;

template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
  for(T& x: vec) is >> x;
  return is;
}


int main(){

  int N,L;
    string str;
  cin>>N>>L;

  std::multiset<string> s;
rep(i,N){
  cin>> str;
  s.insert(str);
}
for(auto itr = s.begin(); itr != s.end(); ++itr) {
        std::cout << *itr;      // イテレータの指す先のデータを表示
    }




  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,a, b) for (int i = (a); i < (b); i++ )

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

const int INF = 100000000;
const double PI=3.14159265358979323846;

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

    int ans = 0;
    int now = 0;
    rep(i,1,X+10) {
        now+=i;
        ans++;
        if (now>=X) {
            break;
        }

    }

    cout << ans << endl;


}

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

int main(void){
  int n,m,x; cin >> n >> m >> x;
  const int INF = 1001001001;
  vector<vector<int>> cost(n,vector<int>(m+1,0));
  rep(i,n){
    cin >> cost[i][0];
    for(int j=1;j<=m;j++) cin >> cost[i][j];
  }

  /*cout << endl;
  rep(i,n){
    rep(j,m+1) cout << cost[i][j] << " ";
    cout << endl;    
  }
  */
  //vector<int> money(4100,0);
  int min_cost = INF;
  for(int bit = 0;bit<(1<<n);bit++){
    vector<int> ability(m,0);
    //money[bit]=0;
    int money=0;
    for(int i=0;i<n;i++){
      if(bit>>i&1){
	//money[bit]+=cost[i][0];
	money+=cost[i][0];
	for(int j=1;j<=m;j++) ability[j-1]+=cost[i][j];
      }
    }
    bool test=true;
    rep(j,m)
      if(ability[j]<x) test = false;
    //if(test) min_cost = min(min_cost,money[bit]);
    if(test) min_cost = min(min_cost,money);
  }

  if(min_cost == INF) cout << -1 << endl;
  else cout << min_cost << endl;
  
  return 0;
}


Measured memory_bytes: 3644
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <string>
#include <math.h>
#include <set>
using namespace std;
typedef long long ll;
 
int main() {
	ios::sync_with_stdio(false);
	int a, b;
	cin >> a >> b;
	if ((a + b) % 3 == 0 || a % 3 == 0 || b % 3 == 0) cout << "Possible";
	else cout << "Impossible"; 
}

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

int main(void){
    int n;
    cin>>n;
    vector<int> v(n);
    rep(i, n){
        cin>>v[i];
    }

    int ans=0;
    sort(v.begin(), v.end());
    
    for(int i=n-1;i>=2;i--){
        int max=v[i];
        rep(j, i){
            for(int k=j+1;k<i;k++){
                if(v[j]+v[k]>max) ans++;
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>

int main(){
    std::string s;
    std::cin >> s;
    int y,m,d;
    y = std::atoi(s.substr(0,4).c_str());
    m = std::atoi(s.substr(5,2).c_str());
    d = std::atoi(s.substr(8).c_str());
    if(y > 2019) std::cout << "TBD" << std::endl;
    else if(y == 2019){
        if(m > 4)std::cout << "TBD" << std::endl;
        else if(m <= 4) std::cout << "Heisei" << std::endl;
    }else if(y < 2019) std::cout << "Heisei" << std::endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
 
int main() {
  int n,i,j,l;
  double s[10020];
  double a2,m,a;
   
  while(1) {
    m=0;
    a2 = 0;
    scanf("%d" , &n);
    if(n == 0) {
      break;
    }
 
    for(i=0;i<n;i++) {
      scanf("%lf", &s[i]);
    m=m+s[i];
    //printf("m[%d] = %lf\n",i ,m);
    }
    m=m/n;
 
    for(i=0; i<n; i++) {
      a2 =a2+(s[i]-m)*(s[i]-m);
    }
    a2 = a2/n;
 
    printf("%.11lf\n",sqrt(a2));
 
  }
 
  return 0;
 
}


Measured memory_bytes: 2056