akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <cmath>
#include <algorithm>
#include <vector>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>func(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p;
}

int main(){
  int N;
  cin>>N;
  int g[20][20];
  for(int i=0;i<N;i++){
    for(int j=0;j<N;j++){
      g[i][j]=-1;
    }
  }
  for(int i=0;i<N;i++){
    int A;
    cin>>A;
    for(int j=0;j<A;j++){
      int x,y;
      cin>>x>>y;
      x--;
      g[i][x]=y;
    }
  }
  int ans=0;
  for(int s=0;s<(1<<N);s++){
    vector<int>d(N);
    for(int i=0;i<N;i++){
      if((s>>i)&1){d[i]=1;}
    }
    bool ok=true;
    for(int i=0;i<N;i++){
      if(d[i]){
      for(int j=0;j<N;j++){
        if(g[i][j]==-1){continue;}
        if(g[i][j]!=d[j]){ok=false;}
      }
    }
  }
    if(ok){ans=max(ans,__builtin_popcount(s));}
  }
  cout<<ans<<endl;
  return 0;
}

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

int n;
long long int w;
long long int w1[105],v1[105];
long long int dp[100002][102];

long long int knap(int i,long long int w2){


	if(i>n || w2<0){
		return 0;
	}

	if(dp[w2][i]!=-1){
		return dp[w2][i];
	}
	
	if(w2<w1[i]){
		return dp[w2][i] = knap(i+1,w2);
	}
	else{
		return dp[w2][i] = max(knap(i+1,w2),knap(i+1,w2-w1[i])+v1[i]);
	}
}

int main(){

	cin>>n>>w;
	for(int i=1;i<=n;i++){
		cin>>w1[i]>>v1[i];
	}
	for(long long int i=0;i<100002;i++){
		for(int j=0;j<102;j++){
			dp[i][j]=-1;
		}
	}
	cout<<knap(1,w)<<endl;
	return 0;
}

Measured memory_bytes: 79872
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define inf 1000000000
#define IOS ios_base::sync_with_stdio(0);cin.tie(0)
#define meM(y,a) memset(y,a,sizeof y)
#define sC(a) scanf("%d",&a)
#define alL(a) a.begin(),a.end()
#define prinT(a,sz)  cout<<a[0];for(int i=1;i<sz;i++)cout<<" "<<a[i];cout<<endl
#define ranD srand(chrono::steady_clock::now().time_since_epoch().count());
typedef pair<int,int>pi;
typedef pair<ll,ll>pll;
//int fx[]={0,0,1,-1};
//int fy[]={1,-1,0,0};
//int gx[]={0,0,1,1,1,-1,-1,-1};
//int gy[]={1,-1,0,1,-1,0,1,-1};
const int N=100010;

int main()
{
    IOS;
    ll n,m;
    cin>>n>>m;
    ll res=0;
    ll sq=sqrt(m);
    for(ll i=1;i<=sq;i++)
    {
        if(m%i==0)
        {
            if(m/i>=n)res=max(res,i);
            if(i>=n)res=max(res,m/i);
        }
    }
    cout<<res<<endl;
}








Measured memory_bytes: 3700
// By Shreehari Bodas

#include <bits/stdc++.h>

using namespace std;

bool search(int a[], int n, int s){
	int start=0,end=n-1;
	bool flag=false;

	while(start<=end){
		int mid=(start+end)/2;
		if(a[mid]==s){
			flag=true;
			break;
		}
		else if(a[mid]>s) end=mid-1;
		else start=mid+1;
	}

	return flag;
}

int main(){

	int x,n; cin>>x>>n;
	int p[n];
	for(int i=0;i<n;i++) cin>>p[i];

	sort(p,p+n);

	int i=0,ans=0;
	while(true){
		int n1=x-i;
		int n2=x+i;

		if(search(p,n,n1)==false){
			ans=n1;
			break;
		}
		else if(search(p,n,n2)==false){
			ans=n2;
			break;
		}

		i++;
	}	

	cout<<ans;

	return 0;
} 

Measured memory_bytes: 3644
#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#include<cstdio>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define ll __int64
#define __int64 long long
#define P pair<int,int>
#define PP pair<P,int>

int h,n;
const int INF=1000000000;
int dp[200001];
int a[1111],b[1111];

int main(){
    cin>>h>>n;
    int MA=h*10;
    rep(i,n)cin>>a[i]>>b[i];
    rep(i,MA)dp[i]=INF;
    dp[0]=0;
    rep(i,n){
        rep(j,MA){
            if(dp[j]!=INF)dp[j+a[i]]=min(dp[j+a[i]],dp[j]+b[i]);
        }
    }
    int ans=INF;
    for(int i=0;i<MA;i++){
        if(i>=h)ans=min(ans,dp[i]);
        //cout<<dp[i]<<" ";
    }
    cout<<ans<<endl;
    return 0;
}


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

int main() {
	ll x, k, d;
    cin >> x >> k >> d;
    x = abs(x);
    ll times = x / d;
    if(times > k) {
        x -= d*k;
        cout << abs(x) << endl;
        return 0;
    }

    k -= times;
    k %= 2;
    x -= d*times;
    if(k > 0) {
        x -= d;
    }
    cout << abs(x) << endl;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define dump(a) cout << (a) << '\n';
typedef int64_t Int;
Int mod = 1e9+7;
Int INF = 1e17;
// Int MOD = 998244353;

int main() {
    ios::sync_with_stdio(false);
    Int N, W;
    cin >> N >> W;
    vector<Int> v(N), w(N);
    for (Int i = 0; i < N; i++) cin >> v[i] >> w[i];
    //Int dp[105][10005] = {};
    vector< vector<Int> > dp(N + 1, vector<Int>(W + 1, 0));
    for (Int i = 0; i < N; i++) {
        for (Int j = 0; j <= W; j++) {
            dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
            if (j + w[i] <= W) {
                dp[i + 1][j + w[i]] = max(dp[i + 1][j + w[i]], dp[i + 1][j] + v[i]);
            }
        }
    }
    /* for (Int i = 0; i <= N; i++) {
        for (Int j = 0; j <= W; j++) {
            cout << dp[i][j] << " ";
        }
        cout << endl;
    } */
    dump(dp[N][W]);
    return 0;  
} 


Measured memory_bytes: 10792
#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <stack>
#include <queue>
using namespace std;
#define ll long long
#define INF 1000000007
using P = pair<int, int>;
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int main(){
    int n;
    cin>>n;
    int a[114514];
    int f[114514];
    int d[114514];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    f[0]=a[0];
    d[n-1]=a[n-1];
    for(int i=1;i<n;i++){
        f[i]=gcd(a[i],f[i-1]);
        d[n-i-1]=gcd(a[n-i-1],d[n-i]);
    }
    int ans=max(f[n-2],d[1]);
    for(int i=1;i<n-1;i++){
        ans=max(ans,gcd(f[i-1],d[i+1]));
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1408
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package poisonouscookies;
import java.util.*;

/**
 *
 * @author Dheeresh
 */
public class Main {
    Scanner scanner;
    int a,b,c,d,i,j,k;
    String str;
    String[] strs;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        new Main();
    }
    
    public Main(){
        scanner = new Scanner(System.in);
        strs=scanner.nextLine().split(" ");
        a=Integer.parseInt(strs[0]);
        b=Integer.parseInt(strs[1]);
        c=Integer.parseInt(strs[2]);
        p(Math.min(a+b+1,c)+b);
    }
    
    void p(String s){
        System.out.println(s);
    }
    
    void p(long l){
        System.out.println(l);
    }
    
    void p(double d){
        System.out.println(d);
    }
    
    void p(int i){
        System.out.println(i);
    }
    
    void p(Object o){
        System.out.println(o);
    }
    
    void p(char c){
        System.out.println(c);
    }
    
    void p(){
        System.out.println();
    }
    
    void pp(String s){
        System.out.print(s);
    }
    
}


Measured memory_bytes: 23380
N = int(input())
H = list(map(int, input().split()))

ans = 0
prev = H[0]
cnt = 0
for i in range(1,N):
  if prev >= H[i]:
    cnt += 1
    ans = max(ans, cnt)
  else:
    cnt = 0
  prev = H[i]    
    
print(ans)

Measured memory_bytes: 14252
import sys
from io import StringIO
import unittest

def resolve():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    if n - sum(a) < 0:
        print(-1)
    else:
        print(n - sum(a))

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """41 2
5 6"""
        output = """30"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """10 2
5 6"""
        output = """-1"""
        self.assertIO(input, output)
    def test_入力例_3(self):
        input = """11 2
5 6"""
        output = """0"""
        self.assertIO(input, output)
    def test_入力例_4(self):
        input = """314 15
9 26 5 35 8 9 79 3 23 8 46 2 6 43 3"""
        output = """9"""
        self.assertIO(input, output)

if __name__ == "__main__":
    # unittest.main(
    resolve()

Measured memory_bytes: 72532
#include "bits/stdc++.h"
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define mFOR(i, a, b) for (int i = a; i > b; i--)
#define MP make_pair
#define PB push_back
#define ALL(v) v.begin(), v.end()
#define N 100007
#define INF 1000000007
using namespace std;

typedef long long ll;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll fceil(ll a, ll b) { return (a % b == 0 ? a / b : a / b + 1); }
int main()
{
   int n, w, s[101] = {}, ans = INF;
   cin >> n;
   for (int i = 1; i <= n; i++)
   {
      cin >> w;
      s[i] = s[i - 1] + w;
   }
   for (int i = 1; i < n; i++)
      ans = min(ans, abs(s[n] - 2 * s[i]));
   cout << ans << endl;
   return 0;
}


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

#define MAX 200000
#define SEN 2000000000
typedef long long llong;

int L[MAX/2+2],R[MAX/2+2];

llong merge(int A[],int n,int l,int m,int r){
  int i,j,k;
  llong cnt=0;
  int n1=m-l;
  int n2=r-m;
  for(i=0;i<n1;i++) L[i]=A[l+i];

  for(i=0;i<n2;i++) R[i]=A[m+i];
  L[n1]=R[n2]=SEN;
  i=j=0;
  for(k=l;k<r;k++){

    if(L[i]<=R[j]){
      A[k]=L[i++];
    }
    else{
      A[k]=R[j++];
      cnt += n1 -i;
    }
  }
  return cnt;
}


llong mS(int A[],int n,int l,int r){
  int m;
  llong v1,v2,v3;
  if(l+1<r){
    m=(l+r)/2;
    v1=mS(A,n,l,m);
    v2=mS(A,n,m,r);
    v3=merge(A,n,l,m,r);
    return v1+v2+v3;
  }
  else return 0;
}



int main(){

  int A[MAX],n,i;

  cin >> n;
  for(i=0;i<n;i++){
    cin >> A[i];
  }

  llong ans=mS(A,n,0,n);
  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 4664
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

typedef int keytype;

//quicksort(<#keytype *a#>, <#int first#>, <#int last#>)

void quicksort(keytype a[], int first, int last){
    int i, j;
    keytype x, t;
    
    x = a[(first + last) / 2];
    i = first;  j = last;
    for ( ; ; ) {
        while (a[i] < x) i++;
        while (x < a[j]) j--;
        if (i >= j) break;
        t = a[i];  a[i] = a[j];  a[j] = t;
        i++;  j--;
    }
    if (first  < i - 1) quicksort(a, first , i - 1);
    if (j + 1 < last) quicksort(a, j + 1, last);
}

int gcd(int x, int y){
    if (y == 0) return x;
    else        return gcd(y, x % y);
}

int main() {
    int m,n,mm,nn;
    int ans;
    scanf("%d %d",&n,&m);
    mm=m*(m-1)/2;
    nn=n*(n-1)/2;
    ans=mm+nn;
    printf("%d",ans);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define pii 3.14
#define mod (ll)(1e9 + 7)
#define inf (ll)(1e18)
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ordered_set tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update>
#define pi pair<int,int>
#define N (ll)(2e5+5)

void solve()
{
    ll n,k;
    cin>>n>>k;
    ll arr[n+1];
    for(ll i=1;i<=n;i++)
        cin>>arr[i];

    vector<ll> path;
    path.push_back(1);

    set<ll> used;
    used.insert(1);

    ll cp=-1;

    while(1)
    {
        ll nxt = arr[path.back()];
        if(used.find(nxt) != used.end())
        {
            cp = nxt;
            break;
        }

        path.push_back(nxt);
        used.insert(nxt);
    }

    ll pre=0;
    for(int i=0;i<path.size();i++)
    {
        if(path[i] == cp)
            break;
        pre++;
    }

    if(k<path.size())
    {
        cout<<path[k]<<"\n";
        return;
    }

    k-=pre;
    ll cl = path.size() - pre;

    k%=cl;
    cout<<path[pre+k]<<"\n";

}

int main()
{
    fio;
    ll tc = 1;
    //cin>>tc;

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


Measured memory_bytes: 15468
#include <stdio.h>

int main()
{
    int n,reminder;

   do{
   scanf("%d",&n);
   }while(n<10 || n>99);

    while(n!=0){
        if((n%10)==9){
            printf("Yes");
            exit(0);
        }
        n/=10;
    }
    printf("No");
    return 0;
}


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

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

int main()
{
    string S;
    cin >> S;
    if(S[2] == S[3] && S[4] == S[5]){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const ll MAXM = 1e3+9;
const ll MAXN = 13;
const ll inf = 1e9;
ll n, m, a[MAXM], b[MAXM], dp[MAXM][1<<MAXN], c[MAXM][MAXN];

ll solve(int box, int mask){
    if (dp[box][mask] != -1) return dp[box][mask];
    if (box == m){
        //cout << mask  << " " << (1<<n)<< '\n';
        if (mask != (1 << n)  -1 )
            return inf;
        return 0;
    }
    int tmask = 0;
    rep(i, 0, b[box]){
        tmask |= (1 << (c[box][i]-1));
    }
    return dp[box][mask] = min(solve(box+1, mask), a[box] + solve(box+1, mask | tmask));
}

int main() {
    cin.sync_with_stdio(0); cin.tie(0);
    cin.exceptions(cin.failbit);
    memset(dp , -1, sizeof dp);
    cin >> n >> m;
    rep(i, 0, m){
        cin >> a[i] >> b[i];
        rep(j, 0, b[i])
            cin >> c[i][j]; 
    }
    int ans = solve(0, 0);
    cout << (ans == inf ? -1: ans)  << '\n';
    return 0;
}

Measured memory_bytes: 65024
a,b,c,d=map(int,input().split())

def gcd(x,y):
	if y==0:return x
	return gcd(y,x%y)

def lcb(a,b):
	return a*b//gcd(a,b)

def slice(n,c,d):
    ans=n
    ans-=(n//c)
    ans-=(n//d)
    ans+=(n//lcb(c,d))
    return ans

kai=slice(b,c,d)-slice(a-1,c,d)
print(kai)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <math.h>
#include <cstdio>
#include <stdio.h>
#include <queue>
#include <cstdlib>
#include <deque>
#include <cassert>
#include <stack>
using namespace std;
 
#define max3(a, b, c) max(a, max(b, c))
#define min3(a, b, c) min(a, min(b, c))
#define mp make_pair
#define f first
#define se second
#define pb push_back
#define ppb pop_back
#define ll long long
#define ull unsigned long long
#define cntbit(x) __builtin_popcount(x)
#define endl '\n'
#define uset unordered_set
#define umap unordered_map
#define pii pair<int, int>
#define ld long double
#define pll pair<long long, long long>

const int inf = 2e9; 
const int N = 2e2 + 15;
int n, m, a[N][N], color[N * N], mt[N], b[N][N], cnt[N][N], c[N][N];
bool used[N];
vector <int> g[N];
stack <int> pos[N][N];

bool dfs(int v) {
	if(used[v])
		return false;
	used[v] = true;
	for(int to : g[v])
		if(cnt[v][to] && !mt[to]) {
			mt[to] = v,
			mt[v] = to;
			return true;
		}
	for(int to : g[v]) {
		if(cnt[v][to] && dfs(mt[to])) {
			mt[to] = v,
			mt[v] = to;
			return true;
		}
	}
	return false;
}

int main() {
    scanf("%d%d", &n, &m);
    for(int i = 1; i <= n; ++i)
    	for(int j = 1; j <= m; ++j) {
    		scanf("%d", &a[i][j]);
    		color[a[i][j]] = (a[i][j] - 1) / m + 1;

    		cnt[i][color[a[i][j]] + n]++;
    		cnt[color[a[i][j]] + n][i]++;

			g[i].pb(color[a[i][j]] + n);
    		g[color[a[i][j]] + n].pb(i);

    		pos[i][color[a[i][j]]].push(a[i][j]);
    	}
    for(int j = 1; j <= m; ++j) {
    	memset(mt, 0, sizeof(mt));
	    for(bool flag = 1; flag; ) {
	    	flag = false, memset(used, 0, sizeof(used));
	        for(int i = 1; i <= (n << 1); ++i)
	            if(!mt[i] && dfs(i))
	                flag = true;
	    }
    	for(int i = n + 1; i <= (n << 1); ++i)
    		if(mt[i]) {
    			cnt[mt[i]][i]--;
    			cnt[i][mt[i]]--;
    			b[mt[i]][j] = pos[mt[i]][i - n].top();
				pos[mt[i]][i - n].pop();
    		}
    }
    for(int i = 1; i <= n; ++i, puts(""))
    	for(int j = 1; j <= m; ++j) {
    		printf("%d ", b[i][j]);
    		c[color[b[i][j]]][j] = b[i][j];
    	}
    for(int i = 1; i <= n; ++i, puts(""))
    	for(int j = 1; j <= m; ++j)
    		printf("%d ", c[i][j]);
    return 0;
}

Measured memory_bytes: 32128
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll maxn = 100000 + 10;
const ll DEBUG = 1;

ll n, X;
struct anode{
	ll b, l, r;
	anode() {}
	anode(ll _b, ll _l, ll _r):b(_b), l(_l), r(_r) {}
}a[maxn];

inline bool check(ll k) {
	ll t1 = k / X;
	ll t2 = k % X;
	ll tmp = 0;
	for(ll i = 1;i <= t1;i ++) {
		tmp = (ll)tmp + (X - a[i].b) * a[i].r;
	}
	for(ll i = t1 + 1;i <= n;i ++) {
		tmp = (ll)tmp - (ll)a[i].b * a[i].l;
	}
	if(t2 == 0) return tmp >= 0;
	ll mx = 0;
	for(int i = 1;i <= t1;i ++) {
		ll now = (X - a[t1 + 1].b) * a[t1 + 1].r - (X - a[i].b) * a[i].r + a[t1 + 1].b * a[t1 + 1].l;
		if(t2 > a[i].b) now += (t2 - a[i].b) * a[i].r;
		else now += (t2 - a[i].b) * a[i].l;
		mx = max(mx,now);
	}
	for(int i = t1 + 1;i <= n;i ++) {
		ll now = 0;
		if(t2 > a[i].b) now = (t2 - a[i].b) * a[i].r;
		else now = (t2 - a[i].b) * a[i].l;
		now += (ll)a[i].b * a[i].l;
		mx = max(mx,now);
	}
	tmp += mx;
	return tmp >= 0;
}

inline bool cmp(anode a, anode b) {
	ll t1 = (ll)(X - a.b) * a.r + (ll)a.b * a.l;
	ll t2 = (ll)(X - b.b) * b.r + (ll)b.b * b.l;
	return t1 > t2;
}

int main() {
	scanf("%lld%lld", &n, &X);
	for(ll i = 1;i <= n;i ++) {
		ll x, y, z;
		scanf("%lld%lld%lld", &x, &y, &z);
		a[i] = anode(x,y,z);
	}
	sort(a + 1,a + n + 1,cmp);
	ll L = 0, R = 1LL * X * n, Ans = -1;
//	if(DEBUG) check(1664);
	while(L <= R) {
		ll mid = (L + R) / 2;
		if(check(mid)) R = mid - 1, Ans = mid;
		else L = mid + 1;
	}
	printf("%lld\n", Ans);
	return 0;
}

Measured memory_bytes: 2560
use strict;
use List::Util qw(sum);
my($n,$k)=glob <>;
chomp $n;
chomp $k;
my $x = <>;
chomp $x;
my @a = split(' ',$x);
@a = sort {$a <=> $b} @a;
my @b = splice @a, 0, $k;
my $sum = sum @b;
print "$sum";

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

int main(){
    int k,n;
    string s;
    cin>>k>>s;

    n=s.length();

    if(n<=k){
        cout<<s<<endl;
    }else{
        for(int i=0; i<k; i++){
            cout<<s[i];
        }
        cout<<"..."<<endl;
    }
}


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

using namespace std;

#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end)for(int i=start;i<end;i++)
#define SORT(v) sort(v.begin(),v.end())
typedef long long ll;

int main()
{
    int n,a,b,c;
    cin>>n;
    if(n/100==7||(n%100)/10==7||n%10==7)
    {
        cout<<"Yes";
    }
    else
    cout<<"No";
    

}


Measured memory_bytes: 3592
import math
n = int(input())
li = list(map(int,input().split()))
flag = "No"
li_uniq = list(set(li))
if(n % 3 == 0):
  if(len(li_uniq) == 3):
    check = li_uniq[0] ^ li_uniq[1]
    if(check == li_uniq[2]):
      a1 = li.count(li_uniq[0])
      a2 = li.count(li_uniq[1])
      a3 = li.count(li_uniq[2])
      if(a1 == a2 == a3):
        flag = "Yes"
  elif(len(li_uniq) == 2):
    bmax = max([li_uniq[0] , li_uniq[1]])
    bmin = min([li_uniq[0] , li_uniq[1]])
    b1 = max([li.count(li_uniq[0]) , li.count(li_uniq[1])])
    b2 = min([li.count(li_uniq[0]) , li.count(li_uniq[1])])
    if(b1 == 2 * b2):
      check2 = bmax ^ bmax
      if(check2 == bmin):
        flag = "Yes"
      
if(len(li_uniq) == 1):
  if(li_uniq[0] == 0):
    flag = "Yes"
print(flag)



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

typedef long long LL;

int main(int argc, char const *argv[])
{
	int a, b, c;
	cin >> a >> b >> c;
	
	if(a + b + c >= 22){
        printf("bust\n");
	}
	else{
        printf("win\n");
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define F first
#define S second
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define pb push_back
#define fastIO ios::sync_with_stdio(0), cin.tie(0);
#define endl '\n'
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
int main() {
#ifdef LOCAL
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);
#else
    fastIO;
#endif
    int n, m;
    cin >> n >> m;
    char A[n][n];
    char B[m][m];
    forn(i, n) {
        string row;
        cin >> row;
        forn(j, n) {
            A[i][j] = row[j];
        }
    }
    forn(i, m) {
        string row;
        cin >> row;
        forn(j, m) {
            B[i][j] = row[j];
        }
    }
    bool ok = 0;
    forn(i, n - m + 1) {
        forn(j, n - m + 1) {
            int cnt = 0;
            forn(k, m) {
                forn(l, m) {
                    if (B[k][l] == A[i + k][j + l]) cnt++;
                }
            }
            if (cnt == m * m) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}


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

using namespace std;
int n,h,da;
string s;
int main()
{
	cin>>n>>s;
	for(int i=0;i<n;i++)
	{
		if(s[i]=='I')h++;
		else h--;
		da=max(h,da);
	}
	cout<<da;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define loop for(int i=0;i<n;i++)
using namespace std;
int main()
{
int n;
int m;
cin>>n>>m;
int ans=((n-1)*n)/2;
ans+=(m*(m-1))/2;


cout<<ans;



}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <stack>

using namespace std;

#define INF 1010001000
#define EPS 1e-10
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back

typedef pair<int, int> i_i;
typedef long long int llong;
typedef pair<llong, llong> ll_ll;
typedef struct edge {int f, t;}Edge;

int q;

int main()
{
    cin >> q;
    rep(lp, q) {
        int n, cnt = 0;
        cin >> n;
        char data[20] = "";
        sprintf(data, "%d", n);
        while (strlen(data) != 1 && cnt < 101000) {
            int len = strlen(data), ret = -1;
            for (int i = 1; i < len; i++) {
                int a = atoi(data);
                a /= pow(10, (len - i));
                int b = atoi(&data[i]);
                ret = max(ret, a*b);
            }
            sprintf(data, "%d", ret);
            cnt++;
        }
        if (cnt < 101000) {
            cout << cnt << endl;
        } else {
            cout << -1 << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 3384
n,a,b,c,d = gets.split.map {|x| x.to_i}
$s = gets.chop
$s = " " + $s

def check(a,d, ch)
  i = a
  while i < d-1
    if $s[i] == ch and $s[i+1] == ch
      return true
    end
    i += 1
  end
  return false    
end

def check2(a,d, ch)
  i = a
  while i < d-2
    if $s[i] == ch and $s[i+1] == ch and $s[i+2] == ch
      return true
    end
    i += 1
  end
  return false    
end

if c < d
  if check(a,d,"#")
    puts "No"
  else
    puts "Yes"
  end
else
  if check(a,c,"#")
    puts "No"
  elsif check2(b-1,d+2,".")
    puts "Yes"
  else
    puts "No"
  end
end


Measured memory_bytes: 2300
#include <iostream>
using namespace std; 
int bubblesort(int a[], int n) {
	bool flag=1;
	int sw = 0;
	for (int i = 0; flag; i++) {
		flag = 0;
		for (int j = n - 1; j >= i + 1; j--) {
			if (a[j] < a[j - 1]){ swap(a[j], a[j - 1]);
			sw++;
			flag = 1;
}
		}
	}
	return sw;
}


int main()
{
	int a[100];
	int n;
	int sw;
	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];
	sw=bubblesort(a, n);

	for (int i = 0; i < n; i++) {
		if (i > 0) cout << " ";
		cout << a[i];
	}
	cout << endl;
	cout << sw<<endl;
	
	return 0;
	
}




Measured memory_bytes: 3108
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;
int main(){
	string str[3];
	for(int i=0;i<3;i++)
		cin >> str[i];
	printf("%c%c%c\n",str[0][0] - 'a' + 'A',str[1][0] - 'a' + 'A',str[2][0] - 'a' + 'A');
}

Measured memory_bytes: 256
#include <stdio.h>
 
int main(void)
{   int a,b,i;
    char op;
    for(i=1;i>0;i++){
        scanf("%d %c %d",&a,&op,&b);
        if(op=='+')
        {printf("%d\n",a+b);
        }
        else if(op=='-')
        {printf("%d\n",a-b);
        }
        else if(op=='*')
        {printf("%d\n",a*b);
        }
        else if(op=='/'){
            printf("%d\n",a/b);
        }else if(op=='?') {
            break;
        }
    }
    return 0;
}



  

 



Measured memory_bytes: 2044
#include<iostream>
#include <algorithm>
using namespace std;
int num[2005];
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>num[i];
	}
	int sum=0;
	sort(num,num+n);

	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			int a=num[i]+num[j];
			int k=j+1;
			while(num[k]<a&&k<n){
				sum++;
				k++;
			//	cout<<num[i]<<" "<<num[j]<<" "<<num[i]+num[j]<<endl;
			}
				
		}
		
	} 
	cout<<sum;
	return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <stack>
#include <queue>
#include <bitset>
#include <numeric>
#include <cassert>
#include <random>
#ifdef DEBUG
#include "./Lib/debug.hpp"
#include "./Lib/Timer.h"
#else
#define dump(...)
template<class T>inline auto d_val(T a, T b) { return a; }
#endif

/* (=＾o＾=) */
#define int ll

/* macro */
#define FOR(i, b, e) for(ll i = (ll)(b); i < (ll)(e); ++i)
#define RFOR(i, b, e) for(ll i = (ll)(e-1); i >= (ll)(b); --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define REPC(x,c) for(const auto& x:(c))
#define REPI2(it,b,e) for(auto it = (b); it != (e); ++it)
#define REPI(it,c) REPI2(it, (c).begin(), (c).end())
#define RREPI(it,c) REPI2(it, (c).rbegin(), (c).rend())
#define REPI_ERACE2(it, b, e) for(auto it = (b); it != (e);)
#define REPI_ERACE(it, c) REPI_ERACE2(it, (c).begin(), (c).end())
#define ALL(x) (x).begin(),(x).end()
#define cauto const auto&
/* macro func */
#define SORT(x) do{sort(ALL(x));}while(false)
#define RSORT(x) do{sort((x).rbegin(),(x).rend());}while(false)
#define UNIQUE(v) do{v.erase( unique(v.begin(), v.end()), v.end() );}while(false)
#define MAX(x,y) do{x = std::max(x,y);}while(false)
#define MIN(x,y) do{x = std::min(x,y);}while(false)
#define BR do{cout<<"\n";}while(false)

/* type define */
using ll = long long;
using PAIR = std::pair<ll, ll>;
using VS = std::vector<std::string>;
using VL = std::vector<long long>;
using VVL = std::vector<VL>;
using VVVL = std::vector<VVL>;
using VD = std::vector<double>;
template<class T>
using V = std::vector<T>;

/* using std */
using std::cout;
constexpr char endl = '\n';
using std::cin;
using std::sort;
using std::pair;
using std::string;
using std::stack;
using std::queue;
using std::vector;
using std::list;
using std::map;
using std::unordered_map;
using std::multimap;
using std::unordered_multimap;
using std::set;
using std::unordered_set;
using std::unordered_multiset;
using std::multiset;
using std::bitset;
using std::priority_queue;

/* constant value */
constexpr ll MOD = 1000000007;
//constexpr ll MOD = 998244353;

/* Initial processing  */
struct Preprocessing { Preprocessing() { std::cin.tie(0); std::ios::sync_with_stdio(0); }; }_Preprocessing;

/* Remove the source of the bug */
signed pow(signed, signed) { assert(false); return -1; }

/* define hash */
namespace std { template <>	class hash<std::pair<ll, ll>> { public:	size_t operator()(const std::pair<ll, ll>& x) const { return hash<ll>()(1000000000 * x.first + x.second); } }; }

/* input */
template<class T> std::istream& operator >> (std::istream& is, vector<T>& vec) { for (T& x : vec) is >> x; return is; }

//=============================================================================================

signed main() {
	ll n;
	cin >> n;
	VL v(n);
	cin >> v;

	VL ans(n);
	REP(i, n) { ans[v[i] - 1] = i + 1; }

	REPC(x, ans) {
		cout << x << " "; 
	}BR;
}

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

int main(){
    string b;
    cin >> b;
    if(b == "A") cout << 'T' << endl;
    else if(b == "C") cout << 'G' << endl;
    else if(b == "G") cout << 'C' << endl;
    else cout << 'A' << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
const long long int m=pow(10,9)+7;

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll k,a,b,ans=0;
    cin>>k>>a>>b;
    ll diff=b-a;
    if(a+2>=b||k-a<1)
        {cout<<1+k<<endl;return 0;}
    else
    {
        k -= a - 1;
        ll ans = a;
        if(k % 2 == 1)ans++, k--;
        ans += (b - a) * (k / 2);
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3652
#include<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using pii=pair<int,int>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vc=vector<char>;
using vvc=vector<vc>;


void min_u(int&m, int v)
{
	if(m>v) m=v;
}


int hoge(vvc&s, int x, int y, int x_, int y_)
{
	if(s[y][x]=='.') return 0;
	if(s[y][x]==s[y_][x_]) return 0;
	if(s[y][x]==s[y_][x_]) return 0;
	return 1;
}


int main(void)
{
	int h, w;

	while(scanf("%d%d\n", &h, &w)==2)
	{
		vvc s(h+1);
		vvi dp(h+1);

		for(auto&ms:s)
		{
			ms.assign(w+4, 'x');
		}
		for(int i=1;i<=h;i++)
		{
			scanf("%[.#]\n", &s[i][1]);
		}

		for(int i=0;i<dp.size();i++)
		{
			dp[i].assign(w+1, 999999999);
		}

		s[0][1]='.';
		dp[0][1]=0;
		for(int i=1;i<=h;i++)
		{
			for(int j=1;j<=w;j++)
			{
				int plus=0;

				plus=hoge(s, j, i, j, i-1);
				min_u(dp[i][j], dp[i-1][j  ]+plus);
				plus=hoge(s, j, i, j-1, i);
				min_u(dp[i][j], dp[i  ][j-1]+plus);
			}
		}
if(0)
{
for(int i=0;i<dp.size();i++)
{
	for(int j=0;j<dp[i].size();j++) printf("%d ", dp[i][j]);
	printf("\n");
}
}

		printf("%d\n", dp[h][w]);
	}
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <set>
#include <iostream>
#include <stack>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <random>
#include <chrono>
using namespace std;

int n;

const int maxn = 1005;

int a[maxn];

bool vis[maxn];

int main(){
    cin >> n;
    for(int i = 1;i <= n;i++){
        scanf("%d", &a[i]);
    }
    long long ans = -1e18;
    int l = -1, r = -1;
    for(int i = 1;i <= n;i++){
        if(a[i] > ans){
            ans = a[i];
            l = i, r = i;
        } 
    }
    for(int i = 1;i <= n;i++){
        long long sum = 0;
        if(a[i] <= 0)
            continue;
        for(int j = i;j <= n;j += 2){
            if(a[j] > 0){
                sum += a[j];
                if(sum > ans){
                    ans = sum;
                    l = i, r = j;
                }
            }
        }
    }
    cout << ans << endl;
    if(ans <= 0){
        cout << n - 1 << endl;
        for(int i = n;i > r;i--){
            cout << i << endl;
        }
        for(int i = 1;i < l;i++){
            cout << 1 << endl;
        }
        return 0;
    }
    vector<int> op;
    for(int i = n;i > r;i--){
        op.push_back(i);
    }
    for(int i = 1;i < l;i++){
        op.push_back(1);
    }
    memset(vis, false, sizeof(vis));
    int cur = 0;
    for(int i = l;i <= r;i += 2){
        if(a[i] < 0){
           op.push_back((i - l + 1) - cur); 
           if(i - 1 >= l){
               vis[i - 1] = true;
               cur++;
           }
           if(i + 1 <= r){
               vis[i + 1] = true;
               cur++;
           }
        } 
    }
    for(int i = 2;i <= (r - l + 1) - cur;i += 2){
        op.push_back(2);
    }
    cout << op.size() << endl;
    for(auto v : op){
        cout << v << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

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




int main() {
    ll d, g;
    cin >> d >> g;
    
    vector<ll> p(d), c(d);
    REP(i, d){
        cin >> p[i] >> c[i];
    }
    
    ll ans = INF;
    REP(i, pow(2, d)){
        ll sum = 0, cnt = 0;
        REP(j, d){
            if(i >> j & 1){
                sum += 100 * (j + 1) * p[j] + c[j];
                cnt += p[j];
            }
        }
        REP(j, d){
            if(!(i >> (d - j - 1) & 1)){
                ll r = p[d - j - 1] - 1;
                while(sum < g && r--){
                    sum += 100 * (d - j);
                    cnt++;
                }
                break;
            }
        }
        if(sum >= g){
            ans = min(ans, cnt);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
n=int(input())
s=str(input())
ans=0
for _ in range(1000):
  t=str(_).zfill(3)
  #print(t)
  if s.find(t[0])==-1:
    continue
  check=s[s.find(t[0])+1:]
  if check.find(t[1])==-1:
    continue
  fin=check[check.find(t[1])+1:]
  if fin.find(t[2])==-1:
    continue
  ans+=1
print(ans)
                

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

int main() {
	int n, k[4] ; 
	memset(k,0,sizeof(k)) ; 
	cin>>n ; 
	for(int i=0;i<n;i++){
		int temp ; cin>>temp ; 
		k[temp%4]++ ; 
	}
	if( ( (k[1] + k[3] <= k[0] + 1) && (k[2] == 0) ) || (k[1] + k[3] <= k[0]) ){
		cout<<"Yes" ; 
	}
	else{
		cout<<"No" ; 
	}
	return 0;
}

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

int main(){
    int n; cin>>n;
    vector<tuple<string,int,int>> sp(n);

    for(int i=0; i<n; i++){
        string s;
        int p;
        cin >> s >> p;
        sp.at(i) = make_tuple(s,p,i+1);
    }
    sort(sp.begin(), sp.end());
    for(int j=0; j<n; j++){
        for(int i=1; i<n-j; i++){
            if(get<0>(sp.at(i))==get<0>(sp.at(i-1)) && get<1>(sp.at(i))>get<1>(sp.at(i-1))){
                swap(sp.at(i),sp.at(i-1));
            }
        }
    }
    for(int i=0; i<n; i++){
        string s; int p; int num;
        tie(s,p,num)=sp.at(i);
        cout << num << endl;
    }
}

Measured memory_bytes: 256
program main
	implicit none
	character(4) S
	integer counter, i
	read(*, *) S
	counter = 0
	do i = 1, 4
		if(S(i:i) == '+') then
			counter = counter + 1
		else
			counter = counter - 1
		end if
	end do
	write(*, *) counter
end program main

Measured memory_bytes: 768
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>


using namespace std;

int a, b;


int main()
{


	cin >> a;
	cin >> b;

	if (a > b) { swap(a,b); }

	string ans = "";
	
	for (int i = 0; i < b; i++) {
		ans += '0' + a;
	}
	



	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define lp(i, x, y) for(int i = x ; i < y ; i++)
#define lp_rev(i, x, y) for(int i = x ; i >= y ; i--)
#define ff first
#define ss second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(v)  v.begin(), v.end()
#define vll vector<long long int>
#define vi vector<int>
#define Fasttt ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
typedef unsigned long long ull;
typedef long long ll;
#define endl "\n"
ll mod = 1000000007;
 
int main()
{
	Fasttt;
	string s, t, tmp;
	ll k, cnt = 0, cnt1 = 0, cnt2 = 0, ans;
	cin>> s>> k;
	tmp = s;
	sort(all(tmp));
	if(tmp[0] == tmp[s.size() - 1])
		return cout<< k*tmp.size()/2, 0;
	t = s + s;
	int n = s.size();
	lp(i, 1, s.size())
	{
		if(s[i] == s[i - 1])
		{
			cnt++;
			if(s[i] == s[i + 1])
				i++;
		}
	}
	lp(i, 1, t.size())
	{
		if(t[i] == t[i - 1])
		{
			cnt1++;
			if(t[i] == t[i + 1])
				i++;
		}
	}
	t = t + s;
	lp(i, 1, t.size())
	{
		if(t[i] == t[i -
		 1])
		{
			cnt2++;
			if(t[i] == t[i + 1])
				i++;
		}
	}
	if(k == 1)
		cout<< cnt;
	else if(k == 2)
		cout<< cnt1;
	else if(k == 3)
		cout<< cnt2;
	else
	{
		ans = cnt2 + (k - 3) * (cnt2 - cnt1);
		cout<< ans;
	}

	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    
    Scanner sc = new Scanner(System.in);
    
    void run(){
        int[] lst = init();
        System.out.println(count(lst));
    }
    
    int[] init(){
        int n = sc.nextInt();
        int[] lst = new int[n+2];
        for(int i=0;i<n+2;i++){
            if(i==0 || i==n+1) lst[i]=0;
            else lst[i]=sc.nextInt();
        }
        return lst;
    }
    
    int count(int[] lst){
        int ans = 0 , rec0 = 0;
        for(int i=0;i<lst.length;i++){
            if(lst[i]==0){
                ans = Math.max(ans,i-rec0);
                rec0 = i;
            }
        }
        return ans;
    }
    
    public static void main(String[] args) throws Exception {
        new Main().run();
    }
}


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

using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using vs = vector<string>;
using pll = pair<ll, ll>;
const ll oo = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define FOR(i, a, b) for(ll i=(a); i<(b); i++)
#define FORD(i, a, b) for(ll i=ll(b)-1;i>=(a);i--)
#define TR(X) ({if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main() {
    cin.sync_with_stdio(0);
    cin.tie(0);
    
    ll d, t, s; cin >> d >> t >> s;
    if(d <= s * t) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3660
s = gets.chomp!
a = [*'a'..'z']
n = Array.new(26, 0)
h = Hash[*[a,n].transpose.flatten]
flag = false

s.each_char {|c| h[c] += 1 }
h.each do |k,v|
  if v == 0
    puts k
    flag = true
    exit
  end
end

puts "None" if flag == false


Measured memory_bytes: 1916
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>

using namespace std;

int main(){
    int N,ans;
    cin >> N;

    ans = pow(N,3);

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


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

int main() {
    int n,k,x,y;
    cin>>n>>k;
    while(k--) {
        cin>>x>>y;
        int dx = min(x,n+1-x),dy = min(y,n+1-y);
        int d = min(dx,dy);
        cout<<(d+2)%3+1<<endl;
    }
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <math.h>
using namespace std;

int main(){
    int N;
    cin >> N;
    int a[N];
    int num = 0;
    for(int i = 0; i < N; i++){
        cin >> a[i];
        while(a[i] % 2 == 0){
            a[i] /= 2;
            num +=1;
        }
    }
    cout << num << endl;
   return 0;

}

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

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

  int h1, m1, h2, m2, k;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  int m = (h2 - h1) * 60 + (m2 - m1);
  cout << max(m - k, 0) << "\n";
}


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


int main(void)
{
    string S;
    cin >> S;
    
    if (S[0] == 'R') {
        if (S[1] == 'R') {
            if (S[2] == 'R') {
                cout << 3 << endl;
                return 0;
            }
            cout << 2 << endl;
            return 0;
        }
        cout << 1 << endl;
        return 0;
    }
    if (S[1] == 'R') {
        if (S[2] == 'R') {
            cout << 2 << endl;
            return 0;
        }
        cout << 1 << endl;
        return 0;
    }
    if (S[2] == 'R') {
        cout << 1 << endl;
        return 0;
    }
    cout << 0 << endl;
}


Measured memory_bytes: 3620
MOD = 10 ** 9 + 7

N = int(input())

S1 = list(input())
S2 = list(input())

if S1[0] == S2[0]:
    flag = True #前が縦
    ans = 3
    i = 1
else:
    flag = False #前が横
    ans = 6
    i = 2

while i < N:
    if flag:
        if S1[i] == S2[i]: #縦のとき
            ans *= 2
            i += 1
        else:
            flag = False
            ans *= 2
            i += 2
    else:
        if S1[i] == S2[i]:
            flag = True
            i += 1
        else:
            ans *= 3
            i += 2
    ans %= MOD

print (ans)



Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1<<30;
int main(){
	int n;
	cin>>n;
	vp in(n);
	rep(i,n)cin>>in[i].first>>in[i].second;
	sort(all(in));
	int mi=inf;
	rep(i,n)loop(j,max(0,i-30),min(n,i+30))if(i!=j)
		mi=min(mi,(in[i].first-in[j].first)*(in[i].first-in[j].first)+
			(in[i].second-in[j].second)*(in[i].second-in[j].second));
	cout<<mi<<endl;
}

Measured memory_bytes: 4896
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 3e5+5;
const int INF = 0x3f3f3f3f;

ll a[4][maxn];
ll len[4];
ll sum[4][maxn];
ll ma[maxn];
ll mb[maxn];

bool cmp(ll a,ll b){
	return a>b;
}

int main() {
	int x,y;
	cin>>x>>y>>len[1]>>len[2]>>len[3];
	for(int l=1;l<=3;l++)
		for(int i=1;i<=len[l];i++)	
			cin>>a[l][i];
	for(int l=1;l<=3;l++)	sort(a[l]+1,a[l]+1+len[l],cmp);
	for(int i=1;i<=3;i++){
		for(int j=1;j<=len[i];j++){
			sum[i][j] = sum[i][j-1]+a[i][j];
		}
	}
	int cnt1 = 1;
	int cnta = 1;
	int cntc = 1;
	while(cnt1<=(x+len[3])&&cnta<=x&&cntc<=len[3]){
		if(a[1][cnta]>=a[3][cntc]){
			ma[cnt1] = ma[cnt1-1]+a[1][cnta];
			cnt1++;
			cnta++;
		}
		else {
			ma[cnt1] = ma[cnt1-1]+a[3][cntc];
			cnt1++;
			cntc++;
		}
	}
	while(cnta<=x){
		ma[cnt1] = ma[cnt1-1]+a[1][cnta];
		cnt1++;
		cnta++; 
	}
	while(cntc<=len[3]){
		ma[cnt1] = ma[cnt1-1]+a[3][cntc];
		cnt1++;
		cntc++; 
	}
	int cnt2 = 1;
	int cntb = 1;
	cntc = 1;
	while(cnt2<=(y+len[3])&&cntb<=y&&cntc<=len[3]){
		if(a[2][cntb]>=a[3][cntc]){
			mb[cnt2] = mb[cnt2-1]+a[2][cntb];
			cnt2++;
			cntb++;
		}
		else {
			mb[cnt2] = mb[cnt2-1]+a[3][cntc];
			cnt2++;
			cntc++;
		}
	}
	while(cntb<=y){
		mb[cnt2] = mb[cnt2-1]+a[2][cntb];
		cnt2++;
		cntb++; 
	}
	while(cntc<=len[3]){
		mb[cnt2] = mb[cnt2-1]+a[3][cntc];
		cnt2++;
		cntc++; 
	}
	int ba = max(1LL,x-len[3]);
	int bb = max(1LL,y-len[3]);
	ll ans = 0;
	for(int i=ba;i<=x;i++){
		ans = max(ans,sum[1][i]+mb[x+y-i]);
	}
	for(int i=bb;i<=y;i++){
		ans = max(ans,sum[2][i]+ma[x+y-i]);
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 18176
#pragma region header
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <stdio.h>
#include <string.h>
#include <string>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <algorithm>
using namespace std;
typedef long long ll;
template <class T> ll size(const T& x) { return x.size(); }
#define rep(i,a,b) for(ll i = (a); i < (b); i++)
#define iter(it,c) for(auto it = (c).begin(); it != (c).end();++it)
#define pb push_back
#define fs first
#define sc second
#define MOD 1000000007;
#define MOD2 998244353;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
template <class T> T smod(T a, T b) {
	return (a % b + b) % b;
}

const int INF = ~(1 << 31);
const double pi = acos(-1);
const double EPS = 1e-9;

#pragma endregion

/*vector<int> edg[100100];
bool active[100100];
int depth[100100];
bool vis[100100];
bool print = false;
vector<int> ans;
void dfs(int at, int dep){
	if(vis[at]) return;
	if(print){
		ans.pb(at);
		return;
	}
	if(active[at] && dep-depth[at] >= 2){
		print = true;
		ans.pb(at);
		return;
	}
	depth[at] = dep;
	active[at] = true;
	vis[at] = true;
	rep(i,0,edg[at].size()){
		dfs(edg[at][i],dep+1);
	}
	active[at] = false;
}*/




int main() {
	ll X, Y, Z;
	cin >> X >> Y >> Z;
	swap(X, Y);
	swap(X, Z);
	cout << X << ' ' << Y << ' ' << Z << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 100000;

	void run() {
		for (;;) {
			int w = sc.nextInt();
			int h = sc.nextInt();
			if((w | h) == 0) return;
			// 0:?????£???????????????
			// 1:?????£????????±??????
			// 2:????????£????????????
			// 3:????????£?????±??????
			int[][][] dp = new int[h][w][4];
			dp[0][0][2] = 1;
			dp[0][0][3] = 1;
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					if (i + 1 < h) dp[i + 1][j][0] = (dp[i + 1][j][0] + dp[i][j][0] + dp[i][j][2]) % MOD;
					if (i + 1 < h) dp[i + 1][j][2] = (dp[i + 1][j][2] + dp[i][j][1]) % MOD;
					if (j + 1 < w) dp[i][j + 1][1] = (dp[i][j + 1][1] + dp[i][j][1] + dp[i][j][3]) % MOD;
					if (j + 1 < w) dp[i][j + 1][3] = (dp[i][j + 1][3] + dp[i][j][0]) % MOD;
				}
			}
			int ans = 0;
			for (int i = 0; i < 4; i++) ans += dp[h - 1][w - 1][i];
			System.out.println(ans % MOD);
		}
	}

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

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

using namespace std;

typedef long long LL;
typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

int main(){
	int N; cin >> N;
	vector<vector<int>> a(N,vector<int>(N));
	repp(i,0,N) repp(j,0,N) cin >> a[i][j];
	vector<LL> dp(1<<N,0);
	dp[0] = 1;
	const LL mod = 1e9+7;
	repp(i,0,(1<<N)-1){
		int m = 0;
		for(int k = i ; k > 0 ; k /= 2) if(k&1) ++m;
		repp(k,0,N) if(!(i&(1<<k)) && a[m][k]) (dp[i^(1<<k)] += dp[i]) %= mod;
	}
	cout << dp[(1<<N)-1] << endl;
	return 0;
}


Measured memory_bytes: 16640
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let n: usize = read();
    let mut second: u64 = 2;
    let mut first: u64 = 1;
    for i in 2..n+1 {
      let tmp = second;
      second = first;
      first = first + tmp;
    }
    println!("{}", first);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
const int N=100+7;
int arr[N];
int arr1[N];
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n-1;i++) scanf("%d",&arr[i]);
	arr1[1]=arr[1];
//	cout<<arr1[1]<<endl;
	for(int i=2;i<=n-1;i++){
		arr1[i]=min(arr[i],arr[i-1]);
//		cout<<arr1[i]<<endl;
	}
	arr1[n]=arr[n-1];
	int sum=0;
	for(int i=1;i<=n;i++)
		sum+=arr1[i]; 
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 256