akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

signed main(){

  int64_t n;
  cin>>n;

  auto count = [](int64_t n){
    int res = 0;
    while(n){
      res+=n%10;
      n/=10;
    }
    return res;
  };

  if(n<1e6){
    int ans = 0;
    for(int i=0;i<=n;++i)ans = max(ans,count(i));
    cout<<(ans)<<endl;
    return 0;
  }

  int ans = 0;
  for(int i=0;i<1e6;++i)ans = max(ans,count(n-i));
  int dig = to_string(n).size()-1;
  int64_t tmp = to_string(n)[0]-'0'-1;
  for(int i=0;i<dig;++i)tmp = tmp*10+9;
  for(int64_t i=-1e6;i+tmp<=n&&i<1e6;++i)ans = max(ans,count(i+tmp));
  cout<<(ans)<<endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0};
const ld PI=abs(acos(-1));
int n,m,a,b,c,d,e;
string s,w;

int main(){
	cin >> a >> b;
	
	cout << 2*b-a << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  ll a,b,c,k;
  cin>>a>>b>>c>>k;
  if(k<=a)
  {
    cout<<k;
  }
  else
  {
    ll sum=0;
    sum=a;
    k=k-a;
    if(k<=b)
    {
      cout<<sum;
    }
    else
    {
      k=k-b;
      cout<<sum-(1*k);
    }
  }
}

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






#define pf                  printf
#define sf(a)               scanf("%d",&a)
#define sfl(a)              scanf("%lld",&a)
#define sff(a,b)            scanf("%d %d",&a,&b)
#define sffl(a,b)           scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)         scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)        scanf("%lld %lld %lld",&a,&b,&c)
#define sffff(a,b,c,d)      scanf("%d %d %d %d",&a,&b,&c,&d)
#define sffffl(a,b,c,d)     scanf("%lld %lld %lld %lld",&a,&b,&c,&d)
#define sfffff(a,b,c,d,e)   scanf("%d %d %d %d %d",&a,&b,&c,&d,&e)
#define sfffffl(a,b,c,d,e)  scanf("%lld %lld %lld %lld %lld",&a,&b,&c,&d,&e)
#define sfc(a)              scanf("%c",&a)
#define pii                 pair<int,int>
#define ms(a,b)             memset(a,b,sizeof(a))
#define pb(a)               push_back(a)
#define pbp(a,b)            push_back({a,b})
#define db                  double
#define ft                  float
#define ll                  long long
#define ull                 unsigned long long
#define pii                 pair<int,int>
#define ff                  first
#define ss                  second
#define sz(x)               x.size()
#define all(x)              x.begin(),x.end()
#define CIN                 ios_base::sync_with_stdio(0); cin.tie(0)
#define max3(a, b, c)       max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c)       min(a, b) < min(b, c) ? min(a, b) : min(b, c)
#define for0(i,n)           for(int i=0;i<n;i++)
#define for1(i,n)           for(int i=1;i<=n;i++)
#define forrev(i,n)         for(int i=n-1; i>=0; i--)
#define forab(i,a,b)        for(int i=a;i<=b;i++)
#define forba(i,b,a)        for(int i=b;i>=a;i--)
#define stlloop(x)          for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define gcd(a, b)           __gcd(a, b)
#define lcm(a, b)           ((a)*((b)/gcd(a,b)))
#define case1(z)            cout<<"Case "<<z<<": "
#define case2(z)            printf("Case %d: ",z)
#define PI                  acos(-1) //3.14159265358979323846264338328
#define valid(tx,ty)        tx>=0 && tx<row && ty>=0 && ty<col
#define intlim              2147483648
#define N                   200005
#define inf                 100000008
#define mod                 1000000007

/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/









int main()
{
    string s,t;
    ll n=0,i;
    cin>>s>>t;
    for(i=0;i<3;i++)
	{
		if(s[i]==t[i])
			n++;
		//cout<<s[i]<<" "<<t[i]<<endl;
	}
	cout<<n<<endl;
	return 0;
}
































Measured memory_bytes: 256
import bisect

Q = int(input())

L = [1 for i in range(100001)]
L[0] = 0
L[1] = 0
for i in range(100001):
	if L[i] == 1:
		c = 2
		while True:
			if i * c <= 100000:
				L[i * c] = 0
				c += 1
			else:
				break
p2017 = []
for i in range(3, 100001):
	if i % 2 != 0:
		if L[i] == 1 and L[int((i + 1) // 2)] == 1:
			p2017.append(i)


for i in range(Q):
	l, r = list(map(int, input().split()))
	a = bisect.bisect_left(p2017, l)
	b = bisect.bisect_right(p2017, r)
	print(b - a)

Measured memory_bytes: 4272
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>

using namespace std;
int helper(int N);
int main(){
    int n;
    cin >> n;
    for(int N=1;N<=n;N++){
        cout << helper(N) << endl;
    }

    return 0;
}



int helper(int N){
    int cnt=0;

    for(int x=1;x<=58;x++){
        for(int y=x;y<=100;y++){
            if(x*x+y*y+x*y > N){continue;}
            for(int z=y;z<=100;z++){
                if(x*x + y*y + z*z + x*y + y*z + z*x == N){
                    if(x == y && y == z){
                        cnt += 1;
                    }else if(x == y || y == z || z == x){
                        cnt += 3;
                    }else{
                        cnt += 6;
                    }
                }
            }
        }
    }
    return cnt;

}


Measured memory_bytes: 3588
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>

int main(){
    long n, k, i;
    long s[200000];

    scanf("%ld %ld", &n, &k);

    for(i = 0;i < n;i++){
        scanf("%ld", &s[i]);

        if(i >= k){
            if(s[i - k] < s[i]) puts("Yes");
            else puts("No");
        }
    }

    return 0;
}

Measured memory_bytes: 3192
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; ++i)
#define repin(a, n)  \
	vector<ll> a(n); \
	rep(i, n) { cin >> a[i]; }
#define repins(a, n)     \
	vector<string> a(n); \
	rep(i, n) { cin >> a[i]; }
#define repind(a, n)     \
	vector<double> a(n); \
	rep(i, n) { cin >> a[i]; }
#define in(a) \
	ll a;     \
	cin >> a;
#define ins(a) \
	string a;  \
	cin >> a;
#define ind(a) \
	double a;  \
	cin >> a;
template <class T>
inline void out(T a)
{
	cout << a << endl;
}
inline void out(double a) { printf("%.10f\n", a); }
#define all(x) (x).begin(), (x).end()
#define rep2(i, a, b) for (ll i = (a); i < (b); ++i)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
#define yes out("Yes")
#define no out("No")
#define degtorad(deg) (deg * M_PI / 180.0)
#define radtodeg(rad) (rad * 180.0 / PI)

int main()
{
	in(a);
	in(b);
	out(a*b);
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = ll(1e12);
const ll mod = ll(1e9+7);
const double pi = acos(-1);
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define pf(x) cout << (x) << endl
#define all(x) (x).begin(),(x).end()
#define yes pf("Yes")
#define no pf("No")
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,1,-1};

ll gcd(ll a,ll b){
    if(a < b)swap(a, 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 factorial(ll n){
    ll ans = 1;
    rep1(i, n){
        ans *= i;
        ans %= mod;
    }
    return ans;
}

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

vector<ll> FactorialInv, Factorial;

void init_combination(ll MAX){
    Factorial.resize(MAX + 1);
    FactorialInv.resize(MAX + 1);
    Factorial[0] = 1;
    for(int i = 1; i <= MAX; i++){
        Factorial[i] = Factorial[i - 1] * i % mod;
    }
    FactorialInv[MAX] = power(Factorial[MAX], mod - 2);
    for(ll i = MAX - 1; i >= 0; i--) {
        FactorialInv[i] = FactorialInv[i+1] * (i+1) % mod;
    }
}

ll combination(ll a, ll b){
    if((a == b) || (b == 0)){
        return 1;
    }
    if(a < b) return 0;
    if(b < 0) return 0;
    ll ans = Factorial[a] * FactorialInv[b] % mod;
    ans = ans * FactorialInv[a - b] % mod;
    return ans;
}

//modの値の確認をすること
int main(){
    ll n;
    cin >> n;
    vector<ll> a(n),c(3,0);
    rep0(i, n)cin >> a[i];
    ll ans = 1;
    rep0(i, n){
        ll cnt = 0,k = -1;
        rep0(j, 3){
            if(a[i] == c[j]){
                ++cnt;
                k = j;
            }
        }
        if(k == -1){
            pf(0);
            return 0;
        }
        ans *= cnt;
        ans %= mod;
        ++c[k];
    }
    pf(ans);
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int P[10] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 2};
int Q[10] = {1, 1, 1, 2, 2, 3, 2, 2, 3, 3};
int R[10] = {2, 3, 4, 3, 4, 4, 3, 4, 4, 4};
int main() {
    ll N; cin >> N;
    ll D[5] = {0,0,0,0,0};
    for (ll i=0; i<N; ++i){
        string s; cin >> s;
        if (s[0]=='M') D[0]++;
        if (s[0]=='A') D[1]++;        
        if (s[0]=='R') D[2]++;
        if (s[0]=='C') D[3]++;
        if (s[0]=='H') D[4]++;        
    }
    ll res = 0;
    for (ll i=0; i<10; ++i) res += D[P[i]]*D[Q[i]]*D[R[i]];
    cout << res << endl;
    return 0;
}

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

string binary(int a){
	string s = "";
	while(a > 0){
		s = (char)((a%2)+'0') + s;
		a /= 2;
	}
	while(s.size() < 5)s = '0' + s;
	return s;
}

int main(){
	map<char, string> input;
	map<string, char> output;
	
	output["101"] = ' ';
    output["000000"] = '\'';
    output["000011"] = ',';
    output["10010001"] = '-';
    output["010001"] = '.';
    output["000001"] = '?';
    output["100101"] = 'A';
    output["10011010"] = 'B';
    output["0101"] = 'C';
    output["0001"] = 'D';
    output["110"] = 'E';
    output["01001"] = 'F';
    output["10011011"] = 'G';
    output["010000"] = 'H';
    output["0111"] = 'I';
    output["10011000"] = 'J';
    output["0110"] = 'K';
    output["00100"] = 'L';
    output["10011001"] = 'M';
    output["10011110"] = 'N';
    output["00101"] = 'O';
    output["111"] = 'P';
    output["10011111"] = 'Q';
    output["1000"] = 'R';
    output["00110"] = 'S';
    output["00111"] = 'T';
    output["10011100"] = 'U';
    output["10011101"] = 'V';
    output["000010"] = 'W';
    output["10010010"] = 'X';
    output["10010011"] = 'Y';
    output["10010000"] = 'Z';
	
	for(char a = 'A';a <= 'Z';a++)input[a] = binary(a-'A');
	input[' '] = "11010";
    input['.'] = "11011";
    input[','] = "11100";
    input['-'] = "11101";
    input['\''] = "11110";
    input['?'] = "11111";
	
	string s;
	while(getline(cin, s)){
		string code;
		for(int i = 0;i < s.size();i++){
			code += input[s[i]];
		}
		
		string res = "", tmp = "";
		for(int i = 0;i < code.size();i++){
			tmp += code[i];
			if(output[tmp]){
				res += output[tmp];
				tmp = "";
			}
		}
		cout << res << endl;
	}
}

Measured memory_bytes: 3032
#include <stdio.h>
#include <stack>

using namespace std;

int main(void){
	int n = 0;
	int a[10];
	stack<int> b, c;
	bool r = true;

	scanf("%d", &n);
	for(int i=0;i<n;++i){
		for(int j=0;j<10;++j){
			scanf("%d", a+j);
		}
		b = stack<int>();
		c = stack<int>();
		r = true;

		for(int j=0;j<10;++j){
			if(b.empty() ||
				(c.empty() && b.top() < a[j])){
				b.push(a[j]);
			}else if(c.empty()){
				c.push(a[j]);
			}else if(b.top() < a[j] && c.top() < a[j]){
				if(b.top() > c.top()){
					b.push(a[j]);
				}else{
					c.push(a[j]);
				}
			}else if(b.top() < a[j]){
				b.push(a[j]);
			}else if(c.top() <a[j]){
				c.push(a[j]);
			}else{
				r = false;
				break;
			}
		}
		puts(r ? "YES": "NO");
	}
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define inf 1000000007
#define mod 1000000007
//#pragma GCC optimize(2)
//#define int long long
using namespace std;
template <typename T> void read(T &x){
	x=0;char ch=getchar();int fh=1;
	while (ch<'0'||ch>'9'){if (ch=='-')fh=-1;ch=getchar();}
	while (ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();
	x*=fh;
}
template <typename T> void write(T x) {
	if (x<0) x=-x,putchar('-');
	if (x>9) write(x/10);
	putchar(x%10+'0');
}
template <typename T> void writeln(T x) {
	write(x);
	puts("");
}
signed main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	double l;
	cin>>l;
	l/=3;
	cout<<fixed<<setprecision(12)<<l*l*l<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<algorithm>
#include<vector>
#include<deque>
#include <numeric>
#include<cmath>
using namespace std;
#define ll long long

int main(void){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    int before[n+1],after[n+1];
    before[0]=0,after[n]=0;
    for(int i=1;i<n+1;i++){
        before[i]=before[i-1]+a[i-1];
    }
    for(int i=n-1;0<=i;i--){
        after[i]=after[i+1]+a[i];
    }
    int ans=10000;
    for(int i=0;i<n;i++){
        int tmp=abs(after[i]-before[i]);
        if(tmp<ans){
            ans = tmp;
        }
    }
    cout << ans<<endl;
}


Measured memory_bytes: 256
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <tuple>
#include <set>
#include <map>
#include <unordered_map>
#include <complex>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long ll;

int main()
{
  int n, cnt[4] = {0};
  cin >> n;
  char c;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (c == 'P') cnt[0] = 1;
    if (c == 'Y') cnt[1] = 1;
    if (c == 'W') cnt[2] = 1;
    if (c == 'G') cnt[3] = 1;
  }
  string ans = "Three";
  if (cnt[0] + cnt[1] + cnt[2] + cnt[3] == 4) ans = "Four";
  cout << ans << endl;
}
  

Measured memory_bytes: 256
from math import *
from collections import *
test = 1
#test = int(input())
for __ in range(test):
	n = int(input())
	a = list(map(int,input().split()))
	d = Counter(a)
	for i in range(1,n+1):
		if i not in d:
			print(0)
		else:
			print(d[i])


Measured memory_bytes: 116640
#include <stdio.h>
int main(void){
	int a,b,d,r;
	double f;
	scanf("%d %d",&a,&b);
	d=a/b;
	r=a%b;
	f=(double)a/(double)b;
	printf("%d %d %lf\n",d,r,f);
	return 0;
}

Measured memory_bytes: 636
import java.util.Scanner;

class Main {
    private static long gcd(long a, long b) {
        if (a % b == 0) {
            return b;
        } else {
            return gcd(b, a % b);
        }
    }

    private static long lcm(long a, long b) {
        long gcd = gcd(a, b);
        return a * b / gcd;
    }

    private static void solve() {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextLong()) {
            long a = scanner.nextLong();
            long b = scanner.nextLong();
            System.out.println(gcd(a, b) + " " + lcm(a, b));
        }
    }

    public static void main(String... args) {
        solve();
    }
}

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

int main() {
    int N;
    cin >> N;
    vector<int> P(N), a(N);
    for(int i = 0; i < N; ++i) {
        cin >> P[i];
        --P[i];
        a[P[i]] = i;
    }

    ll ans = 0;
    set<int> st;
    for(int i = N - 1; i >= 0; --i) {
        st.insert(a[i]);
        vector<int> l(2, -1), r(2, N);
        auto litr = st.find(a[i]);
        auto ritr = litr;
        for(int j = 0; j < 2; ++j) {
            if(litr == st.begin())
                break;
            --litr;
            l[j] = *litr;
        }
        for(int j = 0; j < 2; ++j) {
            ++ritr;
            if(ritr == st.end())
                break;
            r[j] = *ritr;
        }
        ll sec = (l[0] - l[1]) * (r[0] - a[i]) + (r[1] - r[0]) * (a[i] - l[0]);
        ans += sec * (i + 1);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 5760
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int minSum = 0;

		if(n%10 == 0) {
			System.out.println(10);
		}else {
			while(n > 0) {
				minSum = minSum + (n%10);
				n = n/10;
			}
			System.out.println(minSum);
		}

	}

}


Measured memory_bytes: 23508
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
using namespace std;
#define N (1000000000+7)
#define M (998244353)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;
 


int main(void){
    int x,y,z;
    cin>>x>>y>>z;
    cout<<z<<" "<<x<<" "<<y<<endl;
    return 0;
}



Measured memory_bytes: 256
// C++ 14
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
//  cout.precision(15); cout << fixed;

int main() {
  int n; cin >> n;
  vector<int> A(n+1);
  loop(i,1, n+1) cin >> A[i];
  int cnt = 0;
  loop(i,1,n+1) {
    cnt += i % 2 == 1 and A[i] % 2 == 1;
  }
  cout << cnt << endl;
  return 0;
}


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

using namespace std;

#define fastio cin.tie(NULL);cout.tie(NULL);ios_base::sync_with_stdio(0);
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define MAXN 200005
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3f
#define MOD 1000000007
#define pb push_back
#define int long long
#define endl '\n'

typedef long long ll;
typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <pii> vii;
typedef vector <vi> matriz;
typedef vector <pair <string, int>> vis;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// auto timer_start = chrono::steady_clock::now().time_since_epoch().count();

int a, b, c, l, m, n, k;
string s, t;
int v1[MAXN], v2[MAXN];

int32_t main(){
    fastio
    cin >> n >> m >> k;
    int ptrA = 0, ptrB = 0;
    for(int i = 1; i <= n; i++) cin >> v1[i];
    for(int i = 1; i <= m; i++) cin >> v2[i];

    int sumA = 0, sumB = 0;
    for(int i = 1; i <= n; i++){
        if(sumA + v1[i] > k) break;
        ptrA++;
        sumA += v1[i];
    }

    for(int i = 1; i <= m; i++){
        if(sumA + sumB + v2[i] > k) break;
        ptrB++;
        sumB += v2[i];
    }

    int res = ptrA + ptrB;
    while(ptrA > 0){
        sumA -= v1[ptrA--];
        while(sumA + sumB + v2[ptrB + 1] <= k and ptrB < m){
            ptrB++;
            sumB += v2[ptrB];
        }
        res = max(res, ptrA + ptrB);
    }
    cout << res << endl;

    return 0;
}

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

using namespace std;

vector<bool> v(100005);
void dfs(int now,int d,vector<int> &t,vector<vector<int>> &to){
	v[now] = 1;
	t[now] = d;
	for(auto next:to[now]){
		if(v[next]==0){
			v[next]=1;
			dfs(next,d+1,t,to);
			v[next]=0;
		}
	}
	v[now] = 0;
}
int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vector<vector<int>> to(N);
	rep(i,N-1){
		int x,y;
		cin >> x >> y;
		x--;y--;
		to[x].push_back(y);
		to[y].push_back(x);
	}
	vector<int> adis(N);
	vector<int> bdis(N);
	//まずは0からのdisを調べる
	dfs(0,0,adis,to);
	dfs(N-1,0,bdis,to);
	int cnt = 0;
	for(int i=0;i<N;i++){
		if(adis[i]<=bdis[i])cnt++;
	}
	if(cnt>N/2)cout << "Fennec" << endl;
	else cout << "Snuke" << endl;
}


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

int main (void){
        int n;
        cin >> n;
        ll m[n+5];
        ll min = inf;
        for (int i = 0; i < n;i++){
                cin >> m[i];
                if(m[i]<min){
                        min = m[i];
                }
        }
        bool ok = true;
        ll kari=min;
        while(ok){
                min = kari;
                ok = false;
                for (int i = 0; i < n;i++){
                        if(m[i]!=min) m[i] %= min;
                        
                        if(m[i]<kari&&m[i]!=0){
                                kari = m[i];
                                ok = true;
                        }
                }
        }

        cout << min << endl;
        return 0;
}

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

using namespace std;

int main() {
    int c[4] = { 0 };

    for (int i = 0; i < 6; i++) {
        int tmp;
        cin >> tmp;
        c[tmp - 1]++;
    }

    for (int i = 0; i < 4; i++) {
        if (c[i] == 0 || c[i] > 2) {
            cout << "NO" << endl;
            return 0;
        }
    }

    cout << "YES" << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define loop(n, i) for(int i=0;i<n;i++)
#define loop1(n, i) for(int i=1;i<=n;i++)
#define rloop(n, i) for(int i=n;i;i++)
#define HERE cout << "HERE: " << __LINE__ << endl;
#define INSP(v) cout << v << " at " << __LINE__ << endl;
using namespace std;
using ll = long long;
template <class T>
using V = vector<T>;

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

    int n = s.size();
    int dp[200010][3] = {};
    dp[0][1] = 1;
    for (int i = 1; i < n; i++) {
        if (s[i] != s[i - 1]) {
            dp[i][1] = max(dp[i - 1][1], dp[i - 1][2]) + 1;
        } else {
            dp[i][1] = dp[i - 1][2] + 1;
        }

        if (i == 1) continue;
        if (s[i] != s[i - 2] || s[i - 1] != s[i - 3]) {
            dp[i][2] = max(dp[i - 2][1], dp[i - 2][2]) + 1;
        } else {
            dp[i][2] = dp[i - 2][1] + 1;
        }
    }
    cout << max(dp[n - 1][1], dp[n - 1][2]) << endl;
    return 0;
}



Measured memory_bytes: 2948
while True:
    things = {}
    count = input()
    if count == 0: break
    for i in range(count):
        fuga = raw_input().split()
        things[fuga[0]] = int(fuga[1])
    for i in range(input()):
        fuga = raw_input().split()
        money =0
        for j in range(int(fuga[1])):
            hoge = things[fuga[j+2]] if fuga[j+2] in things else 0
            money+= hoge
        things[fuga[0]] = things[fuga[0]] if money > things[fuga[0]] else money
    ans = raw_input()
    fin = things[ans] if ans in things else 0
    print fin

Measured memory_bytes: 4260
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
#include <map>
using namespace std;
typedef long long int lli;
#define urept(soeji, start, n) for (int soeji = start; soeji < n; soeji++)
#define drept(soeji, start, n) for (int soeji = start; soeji > n; soeji--)
int main(void)
{
    int n,L;
    vector<string> s;
    cin >> n >> L;
    string tmp;
    for (int i = 0; i < n; i++)
    {
        cin >> tmp;
        s.push_back(tmp);
    }
    sort(s.begin(), s.end());
    for (int i = 0; i < n; i++)
    {
        cout << s[i];
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int (i)=0 ;i <(n); ++(i))
#define REP(i,m,n) for(int (i) = (m); (i) <= (n); ++(i))
#define yorn(f) puts((f)?"Yes":"No")
#define YORN(f) puts((f)? "YES":"NO")
typedef long long ll;
using namespace std;

int main() {
  int a, b;
  cin >> a >> b;
  bool f = false;
  if(a%3 == 0) f = true;
  if(b%3 == 0) f = true;
  if((a+b)%3 == 0) f = true;
  f ? cout << "Possible" << endl : cout << "Impossible" << endl;
  return 0;
}

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

int main(){
    string s;
    cin >> s;
    if(s=="hi" || s=="hihi" || s=="hihihi" || s=="hihihihi" ||s=="hihihihihi") {
        cout << "Yes" << endl;

    } else cout << "No" << endl;
     return 0;
}

Measured memory_bytes: 256
def check(book, width, m):
    d = 1
    sumv = 0
    for i in range(len(book)):
        if (book[i] > width):
            return False
        if (sumv + book[i] <= width):
            sumv += book[i]
        else:
            sumv = book[i]
            d += 1
    if (d > m):
        return False
    else:
        return True

            
        


if __name__ == "__main__":
    while True:
        m,n = map(int, raw_input().split())
        if (m == 0 and n == 0):
            break
        book = [0 for i in range(n)]
        for i in range(n):
            book[i] = input()
        left,right = 0,1500000
        while (right - left > 1):
            med = (right + left) / 2
            if (check(book, med, m) == True):
                right = med
            else:
                left = med
        print right
            

Measured memory_bytes: 4256
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
const long long mod = 1e9+7;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
const int ddx[4] = {1,1,-1, -1};
const int ddy[4] = {1,-1,-1,1};
//////////////////////////////////

int main(){
  string s; cin >> s;
  if(s == "SUN") cout << 7 << endl;
  if(s == "MON") cout << 6 << endl;
  if(s == "TUE") cout << 5 << endl;
  if(s == "WED") cout << 4 << endl;
  if(s == "THU") cout << 3 << endl;
  if(s == "FRI") cout << 2 << endl;
  if(s == "SAT") cout << 1 << endl;

  return 0;
}

// EOF


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

int main()
{
    int N, M;
    cin >> N >> M;
    vector<pair<int, int>> road(M);
    for (int i = 0; i < M;++i){
        int A, B;
        cin >> A >> B;
        road[i] = make_pair(A, B);
    }
    for (int j = 0; j < N; ++j){
        int ans = 0;
        for (int i = 0; i < M; ++i)
        {
            if (road[i].first -1 == j or road[i].second-1==j){
                ans++;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
long long int N,M;
long long int ans;
int main(){
  cin >> N >> M;
  if(N>=M/2){
    ans=M/2;
  }
  else{
    ans=N+(M/2);
    ans/=2;
  }
  cout << ans;
  return 0;
}


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

int main()
{
    long long N;
    cin >> N;

    long long ans = 0;
    for (int i = 1; i*i <= N; ++i)
    {
        ans = i*i;
    }

    cout << ans << endl;

    return 0;
}



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

int main(void){
  string w;
  cin >> w;

  int character['z' - 'a' + 1] = {0};
  for(int i = 0; i < (int)w.size(); i++){ ++character[w[i] - 'a']; }
  for(int i = 0; i <= ('z' - 'a'); i++){
    if(character[i] % 2 != 0){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


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

int main(){
  
  string s, t;
  cin >> s >> t;
  sort(s.begin(), s.end());
  sort(t.begin(), t.end());
  reverse(t.begin(), t.end());
  
  int i, Min = min(s.size(), t.size());
  for(i=0; i<Min; i++){

    if(s[i]==t[i]) continue;
    if(s[i]>t[i]){
      cout << "No" << endl;
      return 0;
    }
    if(s[i]<t[i]){
      cout << "Yes" << endl;
      return 0;
    }
  }
  if(s.size() < t.size()){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}



Measured memory_bytes: 3632
#include<stdio.h>

int main(){
  int s;
  
  scanf("%d",&s);
  
  if(s / 1000 == (s % 1000) / 100)
    printf("Bad");
  else if((s % 1000) / 100 == (s % 100) / 10)
    printf("Bad");
  else if((s % 100) / 10 == s % 10)
    printf("Bad");
  else
    printf("Good");
  
}
    
    
  

Measured memory_bytes: 128
#include <iostream>
#define REP(i, a, n) for(int i = a; i < n; i++)
using namespace std;


string S;

int main(void) {
  cin >> S;
  cout << (S.length() % 2 == 0 ^ S[0] == S[S.length() - 1] ? "Second" : "First") << endl;

  return 0;
}


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

typedef long long ll;
const int INF = 1e9;
vector<int> extract(int num){
	if(num==0){
		return vector<int>(1,0);
	}
	vector<int> ans;
	while(num>0){
		ans.push_back(num%10);
		num/=10;
	}
	reverse(ans.begin(), ans.end());
	return ans;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n,m;
	cin>>n>>m;
	vector<pair<int,int>> cond(m);
	for (int i = 0; i < m; i++) {
		cin>>cond[i].first>>cond[i].second;
		cond[i].first--;
	}
	for (int i = 0; i < 2000; i++) {
		vector<int> digits = extract(i);
		if(digits.size() == n){
			bool ok = true;
			for (auto it: cond) {
				if (digits[it.first] != it.second){
					ok = false;
				}
			}
			if (ok){
				cout<<i<<'\n';
				return 0;
			}
		}
	}
	cout<<"-1\n";
	return 0;
}

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



void trace(vector<int>&a, int n) {
    for(int i=0; i<n; ++i) {
        if(i > 0) printf(" ");
        printf("%d", a[i]);
    }
    printf("\n");
}

void insertSort(vector<int>&a, int n) {
    for(int i=1; i<n; ++i) {
        int v = a[i];
        int j=i-1;
        while(j>=0 && a[j]>v) {
            a[j+1] = a[j];
            j--;
        }
        a[j+1] = v;
        trace(a, n);
    }
}

int main() {
    int n;
    cin >> n;
    vector<int>a(n);
    rep(i,n) cin >> a[i];
    //rep(i,n); cin >> a[i];
    
    trace(a, n);
    insertSort(a, n);
    
    return 0;
}



Measured memory_bytes: 3152
#include <cstring>
#include <iostream>

using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
int dp[3][100005];
int main() {
	int n, k, r, s, p;
	string t;
	cin >> n >> k >> r >> s >> p >> t;
	rep(i, n) {
		if (i < k) {
			if (t[i] == 'r')
				dp[2][i] = p;
			else if (t[i] == 's')
				dp[0][i] = r;
			else
				dp[1][i] = s;
		} else {
			if (t[i] == 'r') {
				dp[0][i] = max(dp[1][i - k], dp[2][i - k]);
				dp[1][i] = max(dp[0][i - k], dp[2][i - k]);
				dp[2][i] = max(dp[0][i - k], dp[1][i - k]) + p;
			} else if (t[i] == 's') {
				dp[0][i] = max(dp[1][i - k], dp[2][i - k]) + r;
				dp[1][i] = max(dp[0][i - k], dp[2][i - k]);
				dp[2][i] = max(dp[0][i - k], dp[1][i - k]);
			} else {
				dp[0][i] = max(dp[1][i - k], dp[2][i - k]);
				dp[1][i] = max(dp[0][i - k], dp[2][i - k]) + s;
				dp[2][i] = max(dp[0][i - k], dp[1][i - k]);
			}
		}
	}
	int ans = 0;
	for (int i = n - k; i < n; i++) ans += max(dp[0][i], max(dp[1][i], dp[2][i]));
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 1664
#include<iostream>
#include<string>
#include<math.h>
using namespace std;
#include<vector>
int main() {
    int n, k;
    cin >> n >> k;
    //vector<int> vec = { 0 };
    //vec.resize(n);
    //int min_index = 0;
    //for (size_t i = 0; i < n; i++)
    //{
    //    cin >> vec[i];
    //    if (vec[i] == 1)
    //        min_index = i;
    //}

    int ret = (n - 1 + k - 1 - 1) / (k - 1);
    cout << ret << endl;
 }

Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI 3.141592653589793
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REP(i, a, n) for (int i = a; i < (n); i++)
#define rrep(i, n, k) for (int i = (n); i >= (k); i--);
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
template<class T>vector<T> make_vector(size_t a){return vector<T>(a);}
template<class T, class... Ts>auto make_vector(size_t a, Ts... ts){return vector<decltype(make_vector<T>(ts...))>(a, make_vector<T>(ts...));}
const int MOD = 998244353;
const int INF = 2e18;

signed main() {
    int N;
    cin >> N;
    vector<pair<int, int>> AB, BA;
    {
        vector<int> A(3), B(3);
        cin >> A >> B;
        for (int i = 0; i < 3; i++) {
            AB.emplace_back(A[i], B[i] - A[i]);
            BA.emplace_back(B[i], A[i] - B[i]);
        }
    }
    int ans = N;
    vector<int> dp(N + 1, N);
    // A -> B
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j <= N - AB[i].first; j++) {
            dp[j + AB[i].first] = max(dp[j + AB[i].first], dp[j] + AB[i].second);
        }
    }
    int M = dp[N];
    // B -> A
    dp = vector<int>(M + 1, M);
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j <= M - BA[i].first; j++) {
            dp[j + BA[i].first] = max(dp[j + BA[i].first], dp[j] + BA[i].second);
        }
    }
    cout << dp[M] << endl;
}


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

// 次の注文までにかかる時間
int mt(int x){
    return (x+9)/10 * 10;
}

// 次の注文までの待ち時間
int wt(int x){
    return mt(x) - x;
}

int main(){
    int A, B, C, D, E;
    cin >> A >> B >> C >> D >> E;

    int sum = mt(A) + mt(B) + mt(C) + mt(D) + mt(E);

    // 次の注文までの待ち時間が一番長いものを最後に注文する
    sum -= max({wt(A), wt(B), wt(C), wt(D), wt(E)});

    cout << sum << endl;
}

Measured memory_bytes: 256
require 'matrix'

n, m, = gets.split.map(&:to_i)

a = n.times.map do
      gets.split.map(&:to_i)
    end

b = m.times.map do
      gets.split.map(&:to_i)
    end

ma = Matrix.rows(a)
mb = Matrix.rows(b)
mc = ma * mb

puts mc.to_a.map {|r| r.join ' ' }.join ?\n




Measured memory_bytes: 9216
n = int(input())

arr = []
temp = n

for i in range(2, int(-(-n**0.5//1))+1):
  if temp%i==0:
    cnt=0
    while temp%i==0:
      cnt+=1
      temp //= i
    arr.append([i, cnt])

if temp!=1:
  arr.append([temp, 1])

if arr==[]:
  arr.append([n, 1])

count = 0

if n == 1:
  print(0)
else:
  for i in range(len(arr)):
    temp = 1
    temp2 = arr[i][1]
    while temp2 > 0:
      count += 1
      temp += 1
      temp2 -= temp
  print(count)

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

int main(){
  int n,d;
  cin>>n>>d;
  //long long dp2=d*d;
  int cnt=0;
  for(int i=0;i<n;i++){
    long long x,y;
    cin>>x>>y;
    long long xp2=x*x;
    long long yp2=y*y;
    if(sqrt(xp2+yp2)<=d) cnt++;
  }
  cout<<cnt;
}


Measured memory_bytes: 3676
import java.util.Scanner;
public class Main {
@SuppressWarnings("resource")
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int max=0;
	int count=0;
	int H=sc.nextInt();
	int W=sc.nextInt();
	int masu[][]=new int[H][W];
	int h=sc.nextInt();
	int w=sc.nextInt();
	for(int i=0;i<h;i++) {
		while(max<W) {
		masu[i][max]=1;
		max++;
		}
		max=0;
	}
	for(int i=0;i<w;i++) {
		while(max<H) {
			masu[max][i]=1;
			max++;
		}
		max=0;
	}
	for(int j=0;j<H;j++) {
		for(int i=0;i<W;i++) {
			if(masu[j][i]==0) {
				count++;
			}

		}

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

Measured memory_bytes: 23764
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
using namespace std;

long long f(long long n,long long x);

int main(){
    long long a,b,x;
    cin >> a >> b >> x;

    long long count;
    count = f(b,x)-f(a-1,x);

    cout << count << endl;
}

long long f(long long n,long long x){
    if(n==-1){
        return 0;
    }else{
        return n/x+1;
    }
}

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

int main () {
  ll n, k;
  cin >> n >> k;
  ll h[n + 1];
  for (ll i = 1; i <= n; i++) cin >> h[i];
  ll dp[n + 1];
  for (ll i = 1; i <= n; i++) dp[i] = -1;
  dp[1] = 0;
  for (ll i = 2; i <= n; i++) {
    ll min = -1;
    for (ll j = 1; j <= k; j++) {
      ll l = i - j;
      if (l >= 1) {
      	if (min == -1 || (dp[l] + abs(h[i] - h[l])) < min) {
          min = dp[l] + abs(h[i] - h[l]);
        }  
      }
    }
    dp[i] = min;
  }
  cout << dp[n] << endl;
}


Measured memory_bytes: 1920
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include <iomanip>
#include <queue>
#include <cctype>
#include <stack>


#define rep(i,p,q) for(ll i = p;i < q;++i)
#define ll long long

using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll npk(ll n, ll k) {
	ll ret = 1;
	if (n < k || n < 0)return 0;
	rep(i, 0, k) {
		ret *= (n - i);
		ret %= MOD;
	}
	if (ret < 0) ret = 0;
	return ret;
}

//134 A
int main(void) {
	ll a;
	cin >> a;
	cout << 3 * a * a << endl;
}

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

using namespace std;

int n;
int l[12];
vector<int> V;
int maximum;
int sum = 0;

int main(){
  cin >> n;
  for(int i = 0; i < n; ++i){
    cin >> l[i];
    sum += l[i];
    V.push_back(l[i]);
  }
  sort(V.begin(), V.end());
  maximum = V.back();
  V.pop_back();
  sum -= maximum;
  if(sum > maximum){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 888
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] c = sc.next().toCharArray();
		int cnt = 0;
		int ans = 0;

		sc.close();

		for (char d : c) {
			if (d != 'A' && d != 'C' && d != 'G' && d != 'T') {
				cnt = 0;
				continue;
			}
			cnt++;
			ans = Math.max(ans, cnt);
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 21972
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#define ll long long int
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(x, a) for (auto &(x) : (a))
#define ALL(a) (a).begin(), (a).end()
#define OUT(x) out << (x) << endl;
#define M0(x) memset(x, 0, sizeof(x))
#define MINF(x) memset(x, 0x3f, sizeof(x))
#define MMINUS(a) memset(a, 0xff, sizeof(a))
#define ten(n) ((int)1e##n)

const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
const double EPS = 1.0 / INF;
const char ENDL = '\n'; // for JetBrains IDE only supports yen

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

using namespace std;

//===================================== template =========================================================

int main()
{
    cin.tie(nullptr); ios_base::sync_with_stdio(false);
    int N, Q; string S; cin >> N >> Q; cin >> S;
    vector<int> csum(N+1, 0);
    FOR(i, 2, N)
        csum[i] = csum[i-1] + (S[i-2] == 'A' && S[i-1] == 'C');
    REP(i, Q) {
        int l, r; cin >> l >> r;
        cout << csum[r] - csum[l] << endl;
    }
}


Measured memory_bytes: 1488
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef pair<int,int>P;
#define F first
#define S second

signed main(){

  int n;
  cin>>n;
  cout<<n*n*n<<endl;

}

Measured memory_bytes: 256
#include <stdio.h>
int main (){
  int N;
  int L[200];
  int temp;
  int i,j;
  int sum=0;
  scanf("%d",&N);
  for( i=0; i<2*N; i++){
    scanf ("%d",&L[i]);
  }

  for(i=0; i<2*N-1; i++)
    for( j=2*N-1; j>i; j--){
      if(L[j-1]>L[j]){
	temp = L[j-1];
	L[j-1] = L[j];
	L[j] = temp;
      }
    }

  for(i=0; i<N; i++){
    sum+=L[2*i];
}

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


Measured memory_bytes: 128
import java.text.DecimalFormat;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);

        AtCoder problem = new AtCoder(sc);
        problem.solve(out);

        out.flush();
    }

}

class AtCoder {

    final int N, D;

    AtCoder(FastScanner sc) {
        N = sc.nextInt();
        D = sc.nextInt();
    }

    void solve(PrintWriter out) {
        out.println(N % (2 * D + 1) == 0 ? N / (2 * D + 1) : N / (2 * D + 1) + 1);
    }

}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
class FastScanner {

    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    private int readByte() {
        if (hasNextByte()) {
            return buffer[ptr++];
        } else {
            return -1;
        }
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }

    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


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

using namespace std;

int main(){
    while(1){
        int n, x;
        cin >> n >> x;
        if(n + x == 0) break;
        int i, j, ret = 0;
        for(i = 1; i < n;i++){
            for(j = i + 1; j <= n;j++){
                int k = x - i - j;
                if(k<=n && k > j && k != i && k != j) ret++;
            }
        }
        cout << ret << endl;
    }
    return 0;
}


Measured memory_bytes: 3108
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <utility>
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

#define INF (1 << 30)
#define INFL (1LL << 62)
#define MOD7 1000000007
#define MOD9 1000000009
#define EPS 1e-10

#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pul pair<ull, ull>
#define all(a) (a).begin(), (a).end()
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

void YES() { cout << "YES" << endl; }
void NO() { cout << "NO" << endl; }
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void yes() { cout << "yes" << endl; }
void no() { cout << "no" << endl; }
void Taka() { cout << "Takahashi" << endl; }
void Aoki() { cout << "Aoki" << endl; }
void digit(int d) { cout << fixed << setprecision(d); }
void IOup() { cin.tie(0); ios::sync_with_stdio(false); }

int main() {
	int n;
	vector<int> v(3);
	set<vector<int>> st;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < 3; ++j)
			cin >> v[j];
		sort(all(v));
		st.insert(v);
	}
	
	cout << n - st.size() << endl;

	return 0;
}

Measured memory_bytes: 3244
local function gcd(a,b)
    if b>0 then
        return gcd(b,a%b)
    else
        return a
    end
end

local function lcm(a,b)
    return (a//gcd(a,b))*b
end

local time=1
local n=io.read("*n")
for i=1,n do
    time=lcm(time,io.read("*n"))
end
print(time)

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

using namespace std;

int main() {
  string t;
  string s[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
  cin >> t;
  for (int i = 0; i < 7; i++)
    if (s[i] == t)
      printf("%d\n", 7 - i);
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    string s;
    std::cin >> s;
    int first=0,end=0;
    for (int i = 0; i < s.length(); i++) {
        if(s[i]=='A'){
            first=i;
            break;
        }
    }
    for (int i = s.length()-1; i >=0 ; i--) {
        if(s[i]=='Z'){
            end=i;
            break;
        }
    }
    std::cout << end-first+1 << std::endl;
}


Measured memory_bytes: 640
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
  int i;
  int c[128],m,n;
  char s[256],*t;  
  for(;;){
    fgets(s,256,stdin);
    s[strlen(s)-1]='\0';
    t=strtok(s," ");
    c[0]=atoi(t)<10?atoi(t):10;
    if(c[0]==0)
      break;
    for(n=1;(t=strtok(NULL," "))!=NULL;n++)
      c[n]=atoi(t)<10?atoi(t):10;
    m=0;
    for(i=0;i<n;i++)
      m+=c[i];
    for(i=0;i<n;i++){
      if(m<12&&c[i]==1)
	m+=10;
    }
    if(m>21)
      m=0;
    printf("%d\n",m);
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
using namespace std;

int main(){
  map<char,int> alph;
  string  str;
  cin >> str ;
  for(int i = 0; i < str.size(); i++) alph[str[i]]++;
  for(int i = 0; i < 26; i++) if(alph[(char)('a' + i)] == 0) {cout << (char)('a' + i) << endl; return 0; }
  cout << "None" << endl;

}


Measured memory_bytes: 512
MOD = 10 ** 9 + 7
n = int(input())
s = input()
dp = [1] * n
for i, c in enumerate(s):
    sz = n - i
    ndp = [0] * (sz - 1)
    if c == '<':
        now = 0
        for k in range(sz - 1):
            now = (now + dp[k]) % MOD
            ndp[k] = now
    else:
        now = 0
        for k in range(sz - 2, -1, -1):
            now = (now + dp[k+1]) % MOD
            ndp[k] = now
    dp = ndp
print(dp[0])

Measured memory_bytes: 73432
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        if(b/a >= c) System.out.println(c);
        else System.out.println(b/a);
        sc.close();
    }

}


Measured memory_bytes: 21844