akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <map>

using namespace std;

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


int main(){
	int N;
	cin >> N;
	long long dp[N][21];
	FOR(n,0,N) FOR(x,0,21) dp[n][x] = 0;
	dp[0][0]=1;
	FOR(n,1,N){
		int a;
		cin >> a;
		FOR(x,0,21){
			if(x-a>=0) dp[n][x] += dp[n-1][x-a]; if(n==1&&a==0)break;
			if(x+a<=20)dp[n][x] += dp[n-1][x+a];
		}
	}
	int x;
	cin >> x;
	cout << dp[N-1][x] << endl;

	return 0;
}

Measured memory_bytes: 1172
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset

#include <math.h>
#include <stdlib.h>


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

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_MAX	2,147,483,647 = 2*1.0e9

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

  vector<pair<int, int>> vec;
  for(int i = 0; i < N; i++){
    int c,t; cin >> c >> t;
    vec.push_back(make_pair(c, t));
  }

  sort(vec.begin(), vec.end());

  for(int i = 0; i < N; i++){
    if(vec[i].second <= T){
      cout << vec[i].first << endl;
      return 0;
    }
  }

  cout << "TLE" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E18;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

vector<ll> yak;
void yakusuu(ll x){
    for(ll i=1;i*i<=x;i++){
        if(x%i==0){
            yak.push_back(i);
            if(i*i!=x){
                yak.push_back(x/i);
            }
        }
    }
    sort(yak.begin(),yak.end());
}

int main(){fastio
    ll n;cin>>n;
    ll a[n];rep(i,0,n-1)cin>>a[i];
    if(n==1){
        cout<<1<<endl;
        return 0;
    }
    sort(a,a+n);
    bool b[1000001];rep(i,0,1000000)b[i]=false;
    rep(i,0,n-1){
        b[a[i]]=true;
    }
    bool c[1000001];rep(i,0,1000000)c[i]=false;
    rep(i,0,n-2){
        if(a[i]==a[i+1]){
            c[a[i]]=true;
        }
    }
    vector<ll> ans;
    rep(i,0,n-1){
        yak.clear();
        yakusuu(a[i]);
        bool hoge=true;
        rep(j,0,yak.size()-1){
            if(yak[j]==a[i])continue;
            if(b[yak[j]]){
                hoge=false;
                break;
            }
        }
        if(hoge){
            ans.pb(a[i]);
        }
    }
    ll res=ans.size();
    rep(i,0,(ll)ans.size()-1){
        if(c[ans[i]]){
            res--;
        }
    }
    cout<<res<<endl;
    
    return 0;
}





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

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

int main() {
    ll N, M;
    cin >> N >> M;

    ll ans = 1;
    for (ll i = M / N; i >= ans; i--) {
        if (M % i != 0) continue;
        ll amari = M - (i * N);
        ll g     = gcd(i, i + amari);
        ans = max(ans, g);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
# include <iostream>
using namespace std;
int num[1005];
const int Mod = 1e9 + 7;

void gen(int x, int n){
    for (int i = 2; i <= n; ++i){
    while (x % i == 0){
      num[i]++;
      x /= i;
    }
  }
}

int main(void){
  int N;
  cin >> N;
  long long res = 1;
  for (int j = 2; j<= N; ++j) gen(j, N);
  for (int k = 2; k<= N; ++k) res = (res* (num[k]+1)) % Mod;
  cout << res << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

int A, B;

int main() {
	cin >> A >> B;
	int ans = max(max(A+B,A+A-1),B+B-1);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
int main (){
  int a,b,i,j,k;
  cin>>a>>b;
  i=b-a;
  j=i+1;
  k=j%2;
  if(a>0){
    cout<<"Positive"<<endl;
  }else if(b>=0){
    cout<<"Zero"<<endl;
  }else if(a==0){
    cout<<"Zero"<<endl;
  }else if(k==0){
    cout<<"Positive"<<endl;
  }else{
    cout<<"Negative"<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
#define debug(x) cerr << #x << ':' << x << '\n'
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef complex<ld> com;
constexpr int inf = 1000000010;
constexpr ll INF = 1000000000000000010;
constexpr ld eps = 1e-12;
constexpr ld pi = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);

	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	ll val = 1000; ll cnt = 0;
	rep(i, n - 1) {
		if (a[i] < a[i + 1]) {
			cnt += val / a[i];
			val %= a[i];
		}
		else {
			val += cnt * a[i];
			cnt = 0;
		}
	}
	cout << val + cnt * a[n - 1] << '\n';
}

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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> pa;

#define fst first
#define snd second
#define pb push_back

const int maxn=500005,maxm=512;
const double pi=acos(-1.0);
//const ll mod=1000000007;
const ll mod=998244353;
const double eps=1e-8;

int n;

int main()
{
	int i,j;
	scanf("%d",&n);
	printf("%d\n",(1000-n%1000)%1000);
    return 0;
}


Measured memory_bytes: 3784
//↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
#define rall(n) n.rbegin(),n.rend()
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const double pi = acos(-1);
const ll SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
ll fac[200005], finv[200005], inv[200005];
vector<ll>dij;
struct edge { ll to, cost; };
vector<vector<edge> >G;

ll mod_pow(ll a, ll b) {
	ll res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}
	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }

template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }

template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v) {
	for (auto &e : t) fill_v(e, v);
}

template<typename T>
void outp(vector<T>v) {
	for (int i = 0; i < v.size(); ++i) {
		cout << v[i];
		if (i != v.size() - 1) { cout << " "; }
	}
}

//↑template↑


int main() {
	int n, k[100005];
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> k[i];
	}
	sort(k, k + n);

	cout << k[n / 2] - k[n / 2 - 1] << endl;
}

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

int main(){
	int a;
	cin>>a;
	int d=0;
	for(int i=1;i<=a;i+=2){
		int b=0;
	for(int j=1;j<=i;j++){
		if(i%j==0){
			b++;
		}
		
	}
	if(b==8){
		d++;
	}
	
}
cout<<d<<endl;

}


Measured memory_bytes: 256
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, combinations
import sys
import math
import bisect


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n, m = LI()

    def P(n, r):
        return math.factorial(n)//math.factorial(n-r)

    def C(n, r):
        return P(n, r)//math.factorial(r)
    if n > 2 and m > 2:
        print(C(n, 2) + C(m, 2))
    elif n < 2 and m < 2:
        print(0)
    elif n < 2:
        print(C(m, 2))
    elif m < 2:
        print(C(n, 2))
    return


# Solve
if __name__ == "__main__":
    solve()


Measured memory_bytes: 38256
#include <iostream>
#include <vector>
#include <cmath>
#include <set>
using namespace std;
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<n;i++)

class C{
public:
	double x;
	double y;
	double r;
};

double euc(C a,C b){
	a.x -= b.x;
	a.y -= b.y;
	return sqrt(a.x*a.x+a.y*a.y);
}

int main(){
	int n;
	C a,b;
	cin >> n;
	while(n--){
		cin >> a.x >> a.y >> a.r >> b.x >> b.y >> b.r;
		
		if( euc(a,b)+b.r < a.r && a.r > b.r ){
			cout << 2 << endl;
		}else if( euc(a,b)+a.r < b.r && b.r > a.r ){
			cout << -2 << endl;
		}else if(euc(a,b)-b.r <= a.r || euc(a,b)-a.r <= b.r){
			cout << 1 << endl;
		}else{
			cout << 0 << endl;
		}
	}
}

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

int main(){
  bool ans=false;
  int N;
  cin >> N;
  for(int  i=0; i<3; i++){
    if((N/(int)pow(10,i))%10 ==7) ans = true;
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3744
#include <iostream>
#include <vector>
#include <iomanip>
#include <stack>
#include <array>
#include <deque>
#include <forward_list>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iterator>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <time.h>
#include <complex>
#include <cmath>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n;i>0;i--)
#define arep(a,i,n) for(int i=(a);i<(n);i++)
#define SORT(v) sort((v).begin(),(v).end())
const ll INF = (1LL << 50);
typedef pair<int, int> P;

int main() {

	int a, b;
	cin >> a >> b;

	if (a <= b * 2) cout << 0 << endl;
	else cout << a - b * 2 << endl;

	return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
int s(int );
int a[100000],anum;
int main(){
int t,tnum,count=0;
  cin>>anum;
  for(int i=0;i<anum;i++)cin>>a[i];
  cin>>tnum;
  for(int i=0;i<tnum;i++){
    cin>>t;
    if(s(t)==1)count++;
  }
  cout<<count<<endl;
  return 0;
}
 
int s(int key){
  int l=0,r=anum,m;
  while(l<r){
    m=(l+r)/2;
    if(key==a[m])return 1;
    else if(key>a[m])l=m+1;
    else r=m;
  }
  return 0;
}

Measured memory_bytes: 1548
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORR(i, a, b) for (int i = b - 1; i >= a; --i)
#define SORT(v) sort(v.begin(), v.end())
#define SORTR(v) sort(v.rbegin(), v.rend())
#define REV(v) reverse(v.begin(), v.end())
#define ITER(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define LB(v, x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define UB(v, x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define SZ(v) (int)v.size()
using namespace std;
using ll = long long;
using P = pair<int, int>;

class Prime {
    ll M;
    vector<ll> D;

public:
    Prime(ll M) : M(M), D(M + 1) {
        for (ll i = 2; i <= M; ++i) {
            if (D[i] > 0) continue;
            D[i] = i;
            for (ll j = i; i * j <= M; ++j) {
                if (D[i * j] == 0) { D[i * j] = D[i]; }
            }
        }
    }
    vector<pair<ll, int>> fact(ll x) {
        assert(x > 0);
        vector<pair<ll, int>> f;
        while (x > 1) {
            if (f.empty() || f.back().first != D[x]) {
                f.emplace_back(D[x], 1);
            } else {
                f.back().second++;
            }
            x /= D[x];
        }
        return f;
    }
};

class Main {
    int N;
    vector<int> A;
    ll gcd(ll a, ll b) { return a ? gcd(b % a, a) : b; }
    void input() {
        cin >> N;
        A.resize(N);
        REP(i, N) { cin >> A[i]; }
    }
    void output() {
        ll g = A[0];
        REP(i, N - 1) { g = gcd(g, A[i + 1]); }
        if (g > 1) {
            cout << "not coprime" << endl;
            return;
        }
        set<ll> st;
        Prime prime(1000000);
        REP(i, N) {
            auto f = prime.fact(A[i]);
            for (auto &p : f) {
                if (st.count(p.first)) {
                    cout << "setwise coprime" << endl;
                    return;
                }
                st.emplace(p.first);
            }
        }
        cout << "pairwise coprime" << endl;
    }

public:
    Main() {
        input();
        output();
    }
};

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

    Main();

    return 0;
}


Measured memory_bytes: 15036
from collections import Counter

N = int(input())
S = input()

ans = 0
for i in range(N-1):
  X = S[:i+1]
  Y = S[i+1:]
  temp = 0
  for s in Counter(X).keys():
    if s in Y:
      temp += 1
  ans = max(ans, temp)
print(ans)

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

int main() {
  //input
  int N;
  string S, T;
  cin >> N >> S >> T;
  //calc & output
  rep(i,N) {
    cout << S.at(i) << T.at(i);
  }
  cout << endl;
}

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

namespace ProblemC
{
    class Program
    {
        static void Main(string[] args)
        {
            var read = Console.ReadLine().Split(' ').ToArray();
            var A = long.Parse(read[0]);
            //var B = long.Parse(read[1].Remove('.'));
            var B_temp = new string(read[1].ToCharArray().Where( c => c != '.').ToArray());
            var B = long.Parse(B_temp);
            var res = (A * B) / 100;
            Console.WriteLine(res);


        }
    }
}


Measured memory_bytes: 28376
import sys,os,io
# input = sys.stdin.readline
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
N = int(input())
edge = [[] for _ in range(N)]
for i in range(N-1):
  a = int(input())
  edge[i+1].append(a-1)
  edge[a-1].append(i+1)

def dfs(start):
  stack = [start]
  parent = [N]*N
  parent[start] = -1
  #記録したい値の配列を定義
  while stack:
    v = stack[-1]
    marker = 0
    lis = []
    for u in edge[v]:
      if u==parent[v]:
        continue
      if parent[u]==N: #子へ降ろす
        marker = 1
        parent[u]=v
        stack.append(u)
      else: #子から吸い上げる
        #吸い上げる際の個々の処理
        lis.append(ans[u])
    if marker==0:
      stack.pop()
      lis.sort(reverse=True)
      for i,l in enumerate(lis):
        ans[v] =  max(ans[v],i+1+l)
  return

ans = [0]*N
dfs(0)
print(ans[0])



Measured memory_bytes: 89688
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define FOR(i,k,n) for(int(i)=(k);(i)<(n);++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v),end(v)
#define debug(x) std::cerr<<#x<<": "<<x<<"\n"
#define debug2(x,y) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<"\n"
#define debug3(x,y,z) std::cerr<<#x<<": "<<x<<", "<<#y<<": "<<y<<", "<<#z<<": "<<z<<"\n"

using ll=long long;
using vi=std::vector<int>;
using vvi=std::vector<vi>;
using vll=std::vector<ll>;
using vvll=std::vector<vll>;
template<typename T> using vvec=std::vector<std::vector<T>>;
template<typename T>
auto make_v(size_t sz){return std::vector<T>(sz);}
template<typename T,typename... Ts>
auto make_v(size_t sz,Ts...ts){return std::vector<decltype(make_v<T>(ts...))>(sz,make_v<T>(ts...));}
template<typename T>
void fill_v(T&var,const T&x){var=x;}
template<typename V,typename T>
void fill_v(V&v,const T&x){for(auto&& w:v){fill_v(w,x);}}

template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::vector<std::vector<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<T>&v){
  int sz=v.size();s<<"\n";rep(i,sz){s<<v[i];if(i<sz-1){s<<"\t";}}s<<"\n";return s;}
template<typename T> std::ostream& operator<<(std::ostream&s,const std::deque<std::deque<T>>&v){
  for(auto&& w:v){s<<w;}return s;}
template<typename T> std::ostream& operator<<(std::ostream&s, const std::set<T>&v){
  s<<"\n";for(auto&& elm:v){s<<elm<<"\t";}s<<"\n";return s;}

inline void scan(int&a){scanf("%d",&a);}
inline void scan(ll&a){scanf("%lld",&a);}
inline void scan(char&a){scanf(" %c",&a);}
inline void scan(double&a){scanf("%lf",&a);}
inline void scan(std::string&s){char BUF[3000000];scanf(" %s",BUF);s=std::string(BUF);}
template<typename T>
inline void scan(std::vector<T>&v){for(auto&& sv:v){scan(sv);}}
template<typename First,typename...Args>
inline void scan(First&f,Args&...args){scan(f);scan(args...);}
inline void print(int a){printf("%d\n",a);}
inline void print(ll a){printf("%lld\n",a);}
inline void print(double a){printf("%.12f\n",a);}
inline void print(std::string s){std::cout<<s<<"\n";}

using namespace std;

int main() {
  int a;
  scan(a);
  string s;
  scan(s);
  if (a >= 3200) {
    print(s);
  } else {
    print("red");
  }

  return 0;
}


Measured memory_bytes: 888
/*
AizuOnline A0111
Title
*/
#include <stdio.h>
// Select Below
//#include <stdlib.h>
#include <string.h>
#include <ctype.h>
 
char heibun[1000];
char angou[5000];
char fukugou[5000];
char *step2table[]={
//  SP ' , - . ?
        "101",
	"000000",
	"000011",
	"10010001",
	"010001",
	"000001",
// A-B
	"100101",
	"10011010",
// C-J
	"0101",
	"0001",
	"110",
	"01001",
	"10011011",
	"010000",
	"0111",
	"10011000",
// K-R
	"0110",
	"00100",
	"10011001",
	"10011110",
	"00101",
	"111",
	"10011111",
	"1000",
// S-Z
	"00110",
	"00111",
	"10011100",
	"10011101",
	"000010",
	"10010010",
	"10010011",
	"10010000"};

char notalpha[]=" .,-'?";
//
void write5bin(char c,char *out)
{
  out[0]  = (c & 16)?'1':'0';
  out[1]  = (c & 8)?'1':'0';
  out[2]  = (c & 4)?'1':'0';
  out[3]  = (c & 2)?'1':'0';
  out[4]  = (c & 1)?'1':'0';
}
void step1()
{
  char *s,*t,c,c1;

  s=heibun;t=angou;
  while(isprint(c=*s++))
    {
      if(isupper(c))
	c1=c-'A';
      else
	c1=26+(strchr(notalpha,c)-notalpha);
      write5bin(c1,t);
      t+=5;
    }
  *t='\0';
}

void step2()
{
  int i,l;
  char *s,*t,c;
  s=angou;
  t=fukugou;

  while(1)
    {
#ifdef DEBUG
      for(i=0;i<8;i++)
	printf("%c",s[i]);
#endif
       for(i=0;i<32;i++)
	if(0==strncmp(step2table[i],s,l=strlen(step2table[i])))
	  {
	    c=" ',-.?ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i];
	    *t++;
	    s+=l;
	    printf("%c",c);
	    goto AAA;
	  }
       break;
    AAA:;
    }
}

main()
{
  //strcpy(heibun,"?D-C'KOPUA");

  while(NULL != fgets(heibun,sizeof(heibun),stdin))
    {
      step1();
      //printf("%s\n",angou);
      step2();
      printf("%s\n",fukugou);
      memset(heibun,0,sizeof(heibun));
      memset(angou,0,sizeof(angou));
    }
return(0);
}

Measured memory_bytes: 532
using namespace std;

#include <cstdint>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>

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

    int     K = 0;
    int     k = 0;
    cin >> K;
    int     ans = 0;
    int     a = 0;
    int     b = 0;
    int     c = 0;
    int     gcd = 0;
    for(a = 1; a < K+1; a++){
        for(b = a + 1; b < K+1; b++){
            for(c = b + 1; c < K+1; c++){
                for(k = 1; k< min(min(a,b),c)+1; k++){
                    if(a%k == 0 && b%k == 0 && c%k ==0){
                        gcd = k;
                        
                    }
                }
                ans = ans + gcd;
            }
        }
    }
    ans = 6 * ans;

    for(a = 1; a < K+1; a++){
        for(b = 1; b < K+1; b++){
            for(k = 1; k< min(a,b)+1; k++){
                if(a%k == 0 && b%k == 0){
                    gcd = k;
                }
            }
            if( a == b){
                ans = ans + gcd;
            }else{
                ans = ans + 3*gcd;
            }
        }
    }

    cout << ans << "\n";
    return 0;
    
}

Measured memory_bytes: 3656
#include<stdio.h>
int main(){
  int n,ai,i,max=-1000001,min=1000001;
  long long sum=0;

  scanf("%d",&n);

  for(i = 0;i < n;i++){
    scanf("%d",&ai);
    
    if(ai > max){
      max = ai;
    }
    if(ai < min){
      min = ai;
    }
    sum = ai + sum;
  }
  printf("%d %d %lld\n",min,max,sum);

  return 0;
}

Measured memory_bytes: 600
h, w = map(int, input().split())


def area(s):
    ans = max(s) - min(s)
    return ans


if h % 3 == 0 or w % 3 == 0:
    ans = 0
else:
    temp = []
    s1 = [round(w / 3) * h, (w - round(w / 3)) * round(h / 2), round(w - w / 3) * (h - round(h / 2))]
    s2 = [round(h / 3) * w, (h - round(h / 3)) * round(w / 2), round(h - h / 3) * (w - round(w / 2))]
    temp.append(area(s1))
    temp.append(area(s2))
    if w > 2:
        s3 = [round(w / 3) * h, (w - round(w / 3) * 2) * h]
        temp.append(area(s3))
    if h > 2:
        s4 = [round(h / 3) * w, (h - round(h / 3) * 2) * w]
        temp.append(area(s4))
    ans = min(temp)
print(ans)


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

char mp[1005][1005];
int dist[1005][1005];

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

int main() {
  int h, w, ch, cw, dh, dw;
  cin >> h >> w >> ch >> cw >> dh >> dw;
  ch--;
  cw--;
  dh--;
  dw--;
  rep(y, h) rep(x, w) {
    cin >> mp[x][y];
    dist[x][y] = INF;
  }
  deque<P> q;
  dist[cw][ch] = 0;
  q.emplace_back(cw, ch);
  while (!q.empty()) {
    int x = q.front().first;
    int y = q.front().second;
    q.pop_front();
    int d = dist[x][y];
    rep(v, 4) {
      int nx = x + dx[v];
      int ny = y + dy[v];
      if (nx < 0 || w <= nx || ny < 0 || h <= ny) continue;
      if (mp[nx][ny] == '#') continue;
      if (dist[nx][ny] <= d) continue;
      dist[nx][ny] = d;
      q.emplace_front(nx, ny);
    }
    for (int ex = -2; ex <= 2; ex++) {
      for (int ey = -2; ey <= 2; ey++) {
        int nx = x + ex;
        int ny = y + ey;
        if (nx < 0 || w <= nx || ny < 0 || h <= ny) continue;
        if (mp[nx][ny] == '#') continue;
        if (dist[nx][ny] <= d + 1) continue;
        dist[nx][ny] = d + 1;
        q.emplace_back(nx, ny);
      }
    }
  }
  int ans = dist[dw][dh];
  if (ans == INF) ans = -1;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 8548
//#pragma GCC optimize ("-O3","unroll-loops")
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>


#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define m0(x) memset(x,0,sizeof(x))
#define print(x) cout<<x<<'\n';
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
#define int long long
#define all(x) (x).begin(), (x).end()
//#define double long double

using namespace std;

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

//const int MOD = 1e9 + 7;
const ll INF = 1e17;
const int INT_INF = 1e9;
const double pi = acos(-1);
const double EPS = 1e-10;
typedef pair<int, int>P;
const int MAX = 200020;


vector<int>G[303];
bool possible[303][303];
bool vis[303];
void dfs(int pa,int n) {
	vis[n] = true;
	for (auto nex : G[n]) {
		possible[n][nex] = true;
		possible[pa][nex] = true;
		if (vis[nex])continue;
		dfs(pa,nex);
	}
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N, M; cin >> N >> M;
	REP(i, M) {
		int x, y; cin >> x >> y; x--, y--;
		G[x].pb(y);
	}
	REP(i, N) {
		REP(j, N)vis[j] = false;
		dfs(i,i);
	}
	REP(i, N) {
		vector<int>ans; ans.pb(i);
		REP(j, N) {
			if (j == i)continue;
			if (possible[i][j] && possible[j][i]) {
				ans.pb(j);
			}
		}
		int n = ans.size();
		VSORT(ans);
		REP(j, ans.size()) {
			if (j == n - 1) {
				print(ans[j]+1);
			}
			else pe(ans[j]+1);
		}
	}
}



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

template<typename A, typename B> bool chmin(A &a, const B &b){ return b < a && (a = b, true); }
template<typename A, typename B> bool chmax(A &a, const B &b){ return a < b && (a = b, true); }

int main(){
  int a,b;
  cin >> a >> b;
  cout << max({a + b,a - b,a * b}) << '\n';
  return 0;
}

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

using namespace std;

const ll mod=1000000007;
const ll inf=1e18;

int main(){

  ll n,d;
  cin >> n>> d;
  long double x[n][d];
  for(int i=0;i<n;i++){
    for(int j=0;j<d;j++)cin >> x[i][j];
  }

  ll s=0;

  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      long double t=0;
      for(int k=0;k<d;k++)t+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
      t=sqrt(t);
      if(abs(t-floor(t))<0.00001)s++;
    }
  }
  cout << s << endl;

}

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

const ll MOD = 1000000007;
const ll MAX = 100100;
const double PI = 3.1415926;

#define vll vector<ll>
#define max_heap priority_queue<int>
#define min_heap priority_queue<int , vector<int>, greater<int> >
#define pb push_back
#define all(container) container.begin(), container.end()
#define pll pair<ll,ll>
#define printArr(name,from,to) for(int x = from; x < to; x++) cout << name[x] << " ";
// #define traverse( container, it) for( typeof(container.begin()) it = container.begin(); it!=container.end(); it++)
int n;
vll adj[MAX];
ll dp[MAX][2];

ll f(ll s, ll p, bool c)
{
	if (adj[s].empty())
		return 1;
	if (adj[s].size() == 1 && p != -1)
		return 1;
	if (dp[s][c] != -1)
		return dp[s][c];

	ll temp = 1;
	for(ll x : adj[s])
	{
		if (x == p)
			continue;
		if(c)
			temp *= f(x,s,!c);
		else
			temp *= (f(x,s,c) + f(x,s,!c));
		temp %= MOD;
	}
	dp[s][c] = temp;
	return temp;
}

int main()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	memset(dp,-1,sizeof(dp));
	cin >> n;
	int x,y;
	for(int i = 0; i < n-1; i++)
	{
		cin >>x>>y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	cout << (f(1,-1,0) + f(1,-1,1))%MOD << endl;
	return 0;
}


Measured memory_bytes: 15616
import Control.Applicative
import Control.Monad
import Control.Monad.ST
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import qualified Data.Foldable as Foldable
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
--import Data.Array
import Data.Array.Unboxed
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
-- import System.IO.Unsafe
 
readInt = read :: String -> Int
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
getDouble = readLn :: IO Double
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
fnBin :: (b -> c -> d) -> (a -> b) -> (a -> c) -> a -> d
fnBin op f g x = op (f x) $ g x
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
modifyArray :: (Ix i, MArray a e m) => a i e -> i -> (e -> e) -> m ()
modifyArray arr ix f = readArray arr ix >>= writeArray arr ix . f
-- end of templete

maximumOrDefault d xs = if null xs then d else maximum xs

pillars :: [(Int, Int)] -> UArray (Int, Int) Bool
pillars xs = runSTUArray $ do
    arr <- newArray ((0,0), (5000, 5000)) False :: ST s (STUArray s (Int,Int) Bool)
    forM_ xs $ flip (writeArray arr) True
    return arr

main = do
    n <- getInt
    when (n/=0) $ do
        ds <- map (apply2 (,)) <$> replicateM n getInts
        let arr = pillars ds
        print $ maximumOrDefault 0 [dx ^ 2 + dy ^ 2| (x1,y1) <- ds, (x2,y2) <- ds, (x1/=x2 || y1/=y2), let dx = x2 - x1, let dy = y2 - y1, let (x3,y3) = (x1-dy,y1+dx), let (x4,y4) = (x2-dy,y2+dx), 0<=x3, x3<=5000, 0<=y3, y3<=5000, 0<=x4, x4<=5000, 0<=y4, y4<=5000, arr!(x3,y3), arr!(x4,y4)]
        main

Measured memory_bytes: 64460
#!/usr/bin/env python3
import sys

def solve(N: int):
    ans=0
    for i in range(1,N+1):
        ans+=i if i%3!=0 and i%5!=0 else 0
    print(ans)
    return

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


Measured memory_bytes: 64244
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    int a,b,c;
    cin >> a >> b >> c;
    if(a==b) print(c);
    if(b==c) print(a);
    if(a==c) print(b);
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

Measured memory_bytes: 3688
N = int(input())
P = int(''.join(input().split()))
Q = int(''.join(input().split()))
import itertools

perm = []
for num in itertools.permutations(list(range(1,N+1)),N):
    num = [str(n) for n in num]
    num = int(''.join(num))
    perm.append(num)
perm.sort()
p_ind = perm.index(P)
q_ind = perm.index(Q)

print(abs(p_ind-q_ind))





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

using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
const ll mod = ll(1e9) + 7;
const int INF = int(1e9);
int main()
{
    vector<double> ans;
    while (1)
    {
        int D, E;
        cin >> D >> E;
        if (D == 0 && E == 0)
            break;
        double x = 1e9;
        rep(i, D + 1)
        {
            rep(j, D + 1)
            {
                if (i + j != D)
                    continue;
                double tmp = abs(sqrt(i * i + j * j) - E);
                x = min(x, tmp);
            }
        }
        ans.push_back(x);
    }
    rep(i, ans.size())
    {
        cout << fixed << setprecision(10) << ans[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 3244
#include <iostream>
using namespace std;
 
int main(void)
{
  string S;
  cin >> S;
  bool f[3] = { false, false, false };
  for(int i = 0; i < 3; i++) {
    if(S[i] == 'a') {
      f[0] = true;
    }
    if(S[i] == 'b') {
      f[1] = true;
    }
    if(S[i] == 'c') {
      f[2] = true;
    }
  }
  if(f[0] && f[1] && f[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


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

using namespace std;

int N, K, H[200005];
long long ans;

int main() {
  scanf("%d %d", &N, &K);
  for (int i = 0; i < N; i++) {
    scanf("%d", &H[i]);
  }
  sort(H, H+N);
  for (int i = 0; i < N - K; i++) {
    ans += H[i];
  }
  printf("%lld\n", ans);
}


Measured memory_bytes: 896
#include<iostream>
using namespace std;
int main(){
  int mon,cnt;
  while(1){
    cin >> mon;
    if(mon==0)break;
    cnt=0;
    mon=1000-mon;
    while(1){
      if(mon<5)break;
      if(mon>=500){mon-=500;cnt++;}
      else if(mon>=100 && mon<500){mon-=100;cnt++;}
      else if(mon>=50 && mon<100){mon-=50;cnt++;}
      else if(mon>=10 && mon<50){mon-=10;cnt++;}
      else if(mon>=5 && mon<10){mon-=5;cnt++;}
    }
    cnt+=mon;
    cout<< cnt << endl;
  }
  return 0;
}

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

namespace AtCoder.Abc
{
    //https://atcoder.jp/contests/abc141/tasks/abc141_a
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 文字列の入力
            //string s = Console.ReadLine();

            // 整数の入力
            //long n = long.Parse(Console.ReadLine());

            // 文字列配列の入力
            //string[] inputStrArray = Console.ReadLine().Split(' ');

            // 整数配列の入力
            var inputLongArray = Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();

            var a = inputLongArray[0];
            var b = inputLongArray[1];

            string result = (a * b).ToString();

            Console.WriteLine(result);

            Console.Out.Flush();
        }
    }
}

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

#define rep(i,N) for(int i=0; i<(N); i++)
#define pb push_back

typedef long long ll;
typedef pair<int,int> P;
const ll mod=1e9+7;

ll N,K;
ll H[200005];
ll ans;

int main(){

cin.tie(0);
ios::sync_with_stdio(false);

cin>>N>>K;

rep(i,N){
	cin>>H[i];
}

sort(H,H+N);

for(int i=N-1; i>=0; i--){
	if(K>0){
		K--;
	}else{
		ans+=H[i];
	}
}

cout<<ans<<endl;

}
	


Measured memory_bytes: 1792
const main = arg => {
    let input = arg.trim();

    const a = BigInt(input.split(' ')[0]);
    const b = BigInt(input.split(' ')[1].replace('.', ''));
    let ret = a * b / 100n
    
    console.log(String(ret).replace('n', ''));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));  

Measured memory_bytes: 30120
#include <iostream>

using namespace std;

double n, m, x, y;

int main()
{
	cin >> n >> m >> x >> y;
	cout << n * m / 2 << " ";
	if (x == n / 2 && y == m / 2) cout << 1 << endl;
	else cout << 0 << endl;
	return 0;
} 

Measured memory_bytes: 256
import itertools

N = int(input())
lst = [0]*N
for x,y,z in itertools.product(list(range(1,int(N**0.5))),repeat=3):
    val = x*x + y*y + z*z + x*y + y*z + z*x
    if val <= N:
        lst[val-1] += 1
print(*lst,sep="\n")

Measured memory_bytes: 74944
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
using namespace std;

typedef int64_t ll;
const ll INF = 1000000000000000000;
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define vll vector<ll>
#define all(v) v.begin(), v.end()


int main() {
	ll a, b, c;
	cin >> a >> b >> c;

	cout << min(c, b / a) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include <algorithm>
#include<deque>

//マクロ
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
#define REPS(i,n) for(int i=1; i<=(int)(n); ++i)
#define RREP(i,n) for(int i=(int)(n)-1; i>=0; --i)
#define RREPS(i,n) for(int i=(int)(n); i>0; --i)
#define FOR(i,s,e) for(int i=(int)(s); i<(int)(e); ++i)
#define RFOR(i,s,e) for(int i=(int)(e)-1; i>=(int)(s); --i)

#define All(a) (a).begin(),(a).end()

//定数
#define INF 1e9
#define MOD (int)(1e9+7)

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

//とりあえず書いておく変数
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

//今回の変数

//使用する関数
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 (a > b) { a = b; return 1; }
	return 0;
}


int main()
{
	int n;
	cin >> n;
	cout << n*n*n <<endl;
}

Measured memory_bytes: 256
n = gets.to_i
x = gets.split.map(&:to_f)
y = gets.split.map(&:to_f)

p1, p2, p3, pmax = 0,0,0,0

(0...n).each do |i|
  p1 += (x[i] - y[i]).abs
  p2 += ((x[i] - y[i]).abs)**2
  p3 += ((x[i] - y[i]).abs)**3
  pmax = ((x[i] - y[i]).abs) if pmax < ((x[i] - y[i]).abs)

  i += 1
end

puts p1
puts p2**(1/2.0)
puts p3**(1/3.0)
puts pmax

Measured memory_bytes: 6208
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <string.h>
#include <string>
#include <queue>
#include <stack>
using namespace std;
typedef long long int ll;
char s[111111];
int n,k;
int main(void)
{
	int i, j;
	scanf("%s",&s[1]);
	n=strlen(&s[1]);
	cin>>k;
	for(int i=1 ; i<=n-1 ; i++)
	{
		if(s[i]=='a')
		{
			continue;
		}
		else if(26-s[i]+'a'<=k)
		{
			k-=(26-s[i]+'a');
			s[i]='a';
		}
	}
	k%=26;
	for(i=1 ; i<=k ; i++)
	{
		if(s[n]=='z')
		{
			s[n]='a';
		}
		else
		{
			s[n]++;
		}
	}
	for(i=1 ; i<=n ; i++)
	{
		printf("%c",s[i]);
	}
cout<<endl;
	return 0;
}

Measured memory_bytes: 512
import sys
from collections import defaultdict as dd
input = sys.stdin.readline
N, M = map(int, input().split())
e = dd(list)
reve = dd(list)
for _ in range(M):
  u, v = map(int, input().split())
  e[u].append(v)
  reve[v].append(u)
vis = set()
inc = [0] * (N + 1)
def dfs(x, l):
  global vis
  global inc
  vis.add(x)
  ok = 0
  for y in reve[x]:
    if y in vis: inc[x] += 1
  if inc[x] > 1:
    inc[x] = 0
    vis.discard(x)
    return
  for y in e[x]:
    if y == l:
      ok = 1
      continue
    if y in vis:
      inc[x] = 0
      vis.discard(x)
      return
  if ok:
    print(len(vis))
    for v in vis: print(v)
    #print(vis, inc)
    exit(0)
  for y in e[x]:
    dfs(y, l)
  vis.discard(x)

for s in range(1, N + 1):
  dfs(s, s)
print(-1)

Measured memory_bytes: 46044
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) \
  SORT(var);       \
  REVERSE(var)
#define OPTIMIZE_STDIO         \
  ios::sync_with_stdio(false); \
  cin.tie(0);                  \
  cout.precision(10);          \
  cout << fixed
#define endl '\n'

const int INF = 1e9;
const ll MOD = 1e9 + 7;
const ll LINF = 1e18;
struct mint {
  ll x;
  mint() : x(0) {
  }
  mint(ll x) : x((x % MOD + MOD) % MOD) {
  }
  mint& operator+=(const mint& r) {
    if ((x += r.x) >= MOD) {
      x -= MOD;
    }
    return *this;
  }
  mint& operator-=(const mint& r) {
    if ((x -= r.x) < 0) {
      x += MOD;
    }
    return *this;
  }
  mint& operator*=(const mint& r) {
    if ((x *= r.x) > MOD) {
      x %= MOD;
    }
    return *this;
  }
  mint& operator++() {
    if ((++x) >= MOD) {
      x -= MOD;
    }
    return *this;
  }
  mint operator++(int) {
    mint ret = x;
    if ((++x) >= MOD) {
      x -= MOD;
    }
    return ret;
  }
  mint& operator--() {
    if ((--x) < 0) {
      x += MOD;
    }
    return *this;
  }
  mint operator--(int) {
    mint ret = x;
    if ((--x) < 0) {
      x += MOD;
    }
    return ret;
  }
  mint operator+(const mint& r) {
    mint ret;
    return ret = x + r.x;
  }
  mint operator-(const mint& r) {
    mint ret;
    return ret = x - r.x;
  }
  mint operator*(const mint& r) {
    mint ret;
    return ret = x * r.x;
  }
  mint operator-() {
    return mint() - *this;
  }
  bool operator<(const mint& a) {
    return x < a.x;
  }
  bool operator>(const mint& a) {
    return x > a.x;
  }
  bool operator<=(const mint& a) {
    return x <= a.x;
  }
  bool operator>=(const mint& a) {
    return x >= a.x;
  }
  bool operator==(const mint& a) {
    return x == a.x;
  }
  bool operator!=(const mint& a) {
    return x != a.x;
  }
};
ostream& operator<<(ostream& os, const mint& r) {
  os << r.x;
  return os;
}
ostream& operator>>(ostream& os, const mint& r) {
  os >> r.x;
  return os;
}

void solve(istream& cin, ostream& cout) {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  REP(i, m) cin >> a[i];
  int ans = n;
  REP(i, m) {
    ans -= a[i];
  }
  if (ans < 0) cout << -1 << endl;
  else
    cout << ans << endl;
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
  return 0;
}
#endif


Measured memory_bytes: 3660
N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = list(input())

def jk(n):
    if n == "r":
        return "p"
    elif n == "s":
        return "r"
    else:
        return "s"

def sc(n):
    if n == "r":
        return R
    elif n == "s":
        return S
    else:
        return P

ans = 0

hand = [[] for _ in range(K)]
for i in range(N):
    hand[i%K].append(T[i])

fight = [[] for _ in range(K)]
for i in range(K):
    for j in range(len(hand[i])):
        if j == 0:
            fight[i].append(jk(hand[i][j]))
            ans += sc(jk(hand[i][j]))
        elif hand[i][j] == hand[i][j-1]:
            if fight[i][j-1] == jk(hand[i][j]):
                fight[i].append(0)
            else:
                fight[i].append(jk(hand[i][j]))
                ans += sc(jk(hand[i][j]))
        else:
            fight[i].append(jk(hand[i][j]))
            ans += sc(jk(hand[i][j]))

print(ans)

Measured memory_bytes: 64928
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<utility>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

using ll = long long;

void read();
template<typename First, typename... Rest> void read(First& first, Rest&... rest);
void write();
template<typename First, typename... Rest> void write(First first, Rest... rest);
template<typename T> void write_vec(vector<T>& v, char divider);

int main(){
    int N;
    read(N);
    vector<int> A(N);
    for(int i = 1; i < N; i++){
        read(A[i]);
    }
    map<int, int> mp;
    for(int i = 1; i < N; i++){
        mp[A[i]]++;
    }
    for(int i = 1; i <= N; i++){
        cout << mp[i] << endl;
    }
    return 0;
}

//配列以外の入力を受け取る
void read(){

}
template<typename First, typename... Rest>
void read(First& first, Rest&... rest){
    cin >> first;
    read(rest...);
}
//
//配列以外を出力する
void write(){

}
template<typename First, typename... Rest>
void write(First first, Rest... rest){
    cout << first << " ";
    write(rest...);
}
//
//配列を区切って出力する
template<typename T>
void write_vec(vector<T>& v, char divider){
    for(size_t i = 0; i < v.size(); i++){
        cout << v[i] << divider;
    }
}
//

Measured memory_bytes: 13488
/**
 *   author: Shubham Srivastava
 *   created: 10 August 2019  17:39:07
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;

int main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
    ll t;cin>>t;
    string s[t];
    for(ll i=0;i<t;i++){
        cin>>s[i];
        sort(&s[i][0],&s[i][0]+s[i].size());
    }
    sort(&s[0],&s[0]+t);
    ll count=1;
    ll sum=0;
    for(ll i=1;i<t;i++)
    {
        if(s[i] == s[i-1]){
            count++;
        }
        else{
            sum += ((count)*(count-1))/2;
            count=1;
        }
    }
    sum += ((count)*(count-1))/2;
    cout<<sum;
return 0;
}

Measured memory_bytes: 7808
n, y = map(int, input().split())

for a in range(n, -1, -1):
    b_max = n-a
    for b in range(b_max, -1, -1):
        c = b_max-b
        sum = a*10000 + b*5000 + c*1000
        if sum == y :
            print(a, b, c)
            break
    else:
        continue
    break
else:
    print("-1 -1 -1")

        
    

Measured memory_bytes: 2940
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;

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

Measured memory_bytes: 256