akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

#define MAX(x,y) (x>y?x:y)
#define MIN(x,y) (x<y?x:y)
#define ABS(x) (x>0?x:-(x))
#define INF 2147483647
#define LLINF 9223372036854775807
#define MOD 1000000007

typedef long long int lli;

void swap(int* a, int* b)
{
    int tmp;
    tmp = *a;
    *a = *b;
    *b = tmp;
}

void ll_swap(lli* a, lli* b)
{
    lli tmp;
    tmp = *a;
    *a = *b;
    *b = tmp;
}

int gcd(int a, int b)
{
    if (a < b)
        swap(&a, &b);

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

int lcm(int a, int b)
{
    return a * b / gcd(a, b);
}

long power(long x, int n) {
    long ans = 1;
    while (n > 0) {
        if ((n & 1) == 1) {
            ans = ans * x;
        }
        x = x * x;
        n >>= 1;
    }
    return ans;
}

long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
		printf("res:%lld a:%lld\n", res,a);
	}
	return res;
}


lli comb(lli n, lli r)
{
    if (n == 0)
        return 0;

    if (r == 0 || r == n)
        return (1);
    else if (r == 1)
        return (n);
    return (comb(n - 1, r - 1) + comb(n - 1, r));
}

/*
#define MAX 100000
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;
}
*/

int main()
{
    int N, K;
    int A[100000];

    scanf("%d%d", &N, &K);

    for (int i = 0; i < N; i++)
        scanf("%d", &A[i]);

    int a;

    if ((N - K) % (K - 1) == 0)
        a = 0;
    else
        a = 1;

    printf("%d", a+(N-K)/(K - 1) + 1);
}



Measured memory_bytes: 640
using System;
using System.Linq;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        int[] a = sc.IntArray();
        var ar = new S[n];
        for (int i = 0; i < n; i++)
        {
            ar[i] = new S(i+1,a[i]);
        }
        
        Array.Sort(ar,(x,y)=>x.Cnt.CompareTo(y.Cnt));
        
        Console.WriteLine(string.Join(" ",ar.Select(x=>x.N)));
    }

    public static void Main(string[] args)
    {
        new Program().Solve();
    }
}

struct S
{
    public int N, Cnt;

    public S(int n, int c)
    {
        N = n;
        Cnt = c;
    }
}

class Scanner
{
    public Scanner()
    {
        _pos = 0;
        _line = new string[0];
    }

    const char Separator = ' ';
    private int _pos;
    private string[] _line;

    #region スペース区切りで取得

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = Console.ReadLine().Split(Separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region 型変換

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region 配列取得

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = Console.ReadLine().Split(Separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion
}

Measured memory_bytes: 31196
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1000000007;
const LL INF=100000000000;
string u="abcdefghijklmnopqrstuvwxyz";


int main(){
    int N,A,B;
    cin >> N >> A >> B;
    (abs(A-B)%2==1)?puts("Borys"):puts("Alice");
    return 0;
}

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

using ll = long long;
using db = double;
using pii = pair < int, int >;
using pll = pair < ll, ll >;
const int N = 2e5 + 10;
const ll inf = 1e15 + 42;
#define endl "\n"

void testCase() {
    string s, t;
    s = '$';
    t = '$';
    string s1;
    cin >> s1;
    int n1 = s1.size();
    s += s1;
    cin >> s1;
    int n2 = s1.size();
    t += s1;
    ll dp[n1+2][n2+2];
    for (int i=0; i<=n1; i++) {
        for (int j=0; j<=n2; j++)
            dp[i][j] = 0;
    }
    for (int i=1; i<=n1; i++) {
        for (int j=1; j<=n2; j++) {
            ll val = 0;
            if (s[i] == t[j])
                val = 1;
            dp[i][j] = max (val+dp[i-1][j-1], max (dp[i-1][j], dp[i][j-1]));
        }
    }
    string ans = "";
    ll len = dp[n1][n2];
    int i = n1; int j = n2;
    while (len) {
        if (s[i] == t[j]) {
            //cout << i << " " << j << endl;
            ans += s[i];
            i--;
            j--;
            len--;
           // cout << ans << " ";
        }
        else {
            if (dp[i][j-1] == dp[i][j])
                j--;
            else if (dp[i-1][j] == dp[i][j])
                i--;
            else {
                i--;
                j--;
            }
        }
    }
    reverse (ans.begin(), ans.end());
    cout << ans << endl;
}

int main() {
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    testCase();
    return 0;
}

Measured memory_bytes: 70656
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<cmath>
#include<vector>
#include<string>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#pragma GCC target("avx")
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC diagnostic error "-std=c++14"

#define isNum(a) (a>='0'&&a<='9')
#define SP putchar(' ')
#define EL putchar('\n')
#define ri register int

template<class T>
inline void in(T&);
template<class T>
inline void out(const T&);

typedef long long ll;
using std::min;
using std::max;
using std::abs;
using std::sort;
using namespace std;

int n,k,s;

int main()
{
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
    in(n);in(k);
    while(n) ++s,n/=k;
    out(s);EL;
    return 0;
}

template<class T>
void in(T &Re)
{
    T k=0;
    char ch=getchar();
    int flag=1;
    while (!isNum(ch))
	{
        if (ch=='-')
		{
            flag=-1;
        }
        ch=getchar();
    }
    while (isNum(ch))
	{
        k=(k<<1)+(k<<3)+ch-'0';
        ch=getchar();
    }
    Re=flag*k;
}

template<class T>
void out(const T &Wr)
{
    if (Wr<0)
	{
        putchar('-');
        out(-Wr);
    }
	else
	{
        if (Wr<10)
		{
            putchar(Wr+'0');
        }
		else
		{
            out(Wr/10);
            putchar((Wr%10)+'0');
        }
    }
}




Measured memory_bytes: 256
def main():
    a, b, k = map(int, input().split())
    if k >= a+b:
        print(0, 0)
    elif a>=k:
        print(a-k, b)
    else:
        b = b - (k - a)
        a = 0
        print(a, b)


# if __name__ == '__main__':
main()


Measured memory_bytes: 2940
#include<iostream>
#include<cstdlib>
#include<string>
using namespace std;

int main() {

	int x, t;

	cin >> x >> t;

	int y = x - t;

	if (y > 0) { cout << y << endl; };

	if (y <= 0) { cout << 0 << endl; };
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
long a=Long.parseLong(sc.next());
long b=Long.parseLong(sc.next());
int count=0;
while(a<=b){a*=2;count++;}
System.out.println(count);
}
}

Measured memory_bytes: 22612
#include <bits/stdc++.h>
typedef long long ll;
#define mod 1000000009
#define MK make_pair
#define EB emplace_back
#define PB push_back
#define F first
#define S second
using namespace std;
int main()
{
	
	ll a,b;
	cin>>a>>b;
	char c;
	cin>>c;
	ll d;
	cin>>d;
	b*=100;
	b+=d;
	ll x=a*b;
	x=x/100;
	cout<<x<<endl;
}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define REP(i,n) for(int i = 0; i < n; i++)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
using namespace std;
 int main () {
     int n;
     cin >> n;
     vector<int> vec(n);
     REP(i,n) cin >> vec[i];
     reverse(vec.begin(),vec.end());
     print_array(vec);
 }


Measured memory_bytes: 3100
/// Kazuki Hoshino


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef pair<ll, ll> pll;
typedef vector<ll> vl;
typedef vector<pi> vpi;
#define inf 1000000000
#define mod 1000000007
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define rep1(i, a, b) for(int i =a; i >=b; i--)
#define f first
#define ss second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple

int n, a[202020], ans;
map<ll,int> mp;
set<ll> v;

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

//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);


cin >> n;

rep(i, 1, n){

cin >> a[i];
v.insert(a[i]);
mp[a[i]]++;

}

for(auto i: v){
if(mp[i]){
if(mp[i]>=i)
ans+= abs(i-mp[i]);
else ans+=mp[i];
}

}

cout << ans << endl;




return 0;}
///.... Maria Otonashi


Measured memory_bytes: 11136
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement, groupby
from math import sqrt, factorial, log
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heappushpop
import sys
stdin = sys.stdin
mod = 10**9 + 7

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

s = deque(ns())
q = ni()
now = 1
for i in range(q):
    qu = ns().split()
    if qu[0] == "1":
        now *= -1
    else:
        if qu[1] == "1":
            r = 1
        else:
            r = -1
        if r * now == 1:
            s.appendleft(qu[-1])
        else:
            s.append(qu[-1])
if now == -1:
    s.reverse()
print(*s, sep="")

Measured memory_bytes: 12252
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();
        int count = 0;
        int y = 1;
        
          for(int i = 0; i <= b; i++) {
              if(i < a) {
                  continue;
              }else if(i >= a && i < b) {
                  if(c % i == 0) {
                      count ++;
                      }                  
              }else if(i == b) {
                  if(c % i == 0) {
                      count ++;
                    }
                }
            }
          if(1 <= a && a <= 10000 &&
             1 <= b && b <= 10000 &&
             1 <= c && c <= 10000 && a <= b) {
              System.out.println(count);
            }
    }
}

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

int main() {
int A, B, K; 
cin >> A >> B >> K;
for (int i = min(A, B); i >= 1; i--) {
if (A % i == 0 && B % i == 0) {
K--;
if (K == 0) {
cout << i << endl;
}
}
}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<long>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
using pll = pair<long, long>;
#define fix20 cout << fixed << setprecision(20);
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define MOD 1000000007
#define all(vec) vec.begin(), vec.end()

int main(){
    int n,r;
    cin >> n >> r;
    if(n >= 10) cout << r << endl;
    else cout << r + 100*(10 - n) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) { cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl; }
#define mdebug(m) { cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;} }
#define pb push_back
#define fi first
#define se second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p){ cout << '(' << p.first << ',' << p.second << ')'; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void chOut(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using v_bool = vector<bool>;
using v_Pii = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;



signed main(){

    int K; cin >> K;
    v_bool used(K, false);
    int x = 0;
    REP(i, K){
        x = (10 * x + 7) % K;
        if(used[x]) break;
        used[x] = true;
        if(x == 0){
            Out(i + 1);
            return 0;
        }
    }
    Out(-1);

    return 0;
}


Measured memory_bytes: 3760
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] p = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int cnt = 0;
            for (int i = 0; i < n; i++)
            {
                if (p[i] != i+1)
                {
                    cnt++;
                }
            }
            Console.WriteLine(cnt > 2 ? "NO" : "YES");
        }
    }
}


Measured memory_bytes: 13268
//  SMOKE SHISHA PLAY FIFA  // 
#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef long double ld;

#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define mod 1000000007
#define lp(start,end) for(ll i=start;i<=end;i++) 
#define deb1(a) cout<<#a<<" = "<<(a)<<endl;
#define deb2(a,b) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl;
#define deb3(a,b,c) cout<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;
ll n;
ll a[100007],b[100007],c[100007];
ll dp[100007][4];
ll modu(ll a, ll b)
{
	ll ans =1;
	while(b>0)
	{
		if(b&1)
		ans = (ans*a)%mod;
		b/=2;
		a = (a*a)%mod;
	}
	return ans;
}

ll fun(ll x ,ll val)
{
	if(dp[x][val]!=-1)
		return dp[x][val];
	if(x==1)
	{
		if(val==1){
			dp[x][val] =  a[x];
		}
		else if(val==2)
			 dp[x][val] = b[x];
		else
			dp[x][val] = c[x];

	//	deb3(x,val,dp[x][val]);
		return dp[x][val];
	}
	if(val==1)
	{
		dp[x][val] = max(fun(x-1,2)+a[x],fun(x-1,3)+a[x]);
	}
	else if(val==2)
	{
		dp[x][val] = max(fun(x-1,3)+b[x],fun(x-1,1)+b[x]);
	}
	else
	{
		dp[x][val] = max(fun(x-1,2)+c[x],fun(x-1,1)+c[x]);
	}
	//deb3(x,val,dp[x][val]);
	return dp[x][val];

}
int main()
{
	fastio
	
	cin >> n;
	//ll a[n+1],b[n+1],c[n+1];
	for(ll i=1;i<=n;i++){
		cin >> a[i] >> b[i] >> c[i];
		dp[i][1]=-1;
		dp[i][2]=-1;
		dp[i][3]=-1;
	}

	ll ans = max(fun(n,1),max(fun(n,2),fun(n,3)));
	cout << ans << endl;
	return 0;	
}


Measured memory_bytes: 10368
/*dismint|jjc*/
#include <bits/stdc++.h>
using namespace std;
#define forl(V, S, E) for(int V = S; V < E; V++)
#define ford(V, S, E) for(int V = S; V >= E; V--)
#define fore(E, X) for(auto &E:X)
#define println(X) cout << X << endl
#define printe(X) for(auto &E:X) cout << E << " "; cout << endl
typedef unordered_map<int, unordered_set<int>> graph;
typedef long long ll;

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	double w, h, x, y; cin >> w >> h >> x >> y;
	cout << w*h/2 << " " << (2*x == w and 2*y == h) << endl;
}


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

int main() {
  int a, b;
  cin >> a >> b;
  int sum = 0;
  for(int i = a; i < b+1; i++) {
    if(i/10000 == i%10 && i%100/10 == i%10000/1000) {
      sum++;
    }
  }
  cout << sum << "\n";
}

Measured memory_bytes: 256
s = int(input())

List = []
c = s
while c <= 10**7:
    if c in List:
        ans = len(List)+1
        break
    else:
        List.append(c)
        if c % 2 == 0:
            c = c*0.5
        else:
            c = 3*c+1

print(ans)

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

using namespace std;

#define LL long long
#define DD double
#define Pb push_back
#define Bp pop_back
#define Pf push_front
#define Fp pop_front
#define Ub upper_bound
#define Lb lower_bound
#define In insert
#define All(x) x.begin(), x.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define fast ios_base::sync_with_stdio(0);cin.tie(0)
#define X first
#define Y second
#define mx1 10
#define mx2 110
#define mx3 1010
#define mx4 10010
#define mx5 100010
#define mx6 1000010

typedef vector<LL> Vl;
typedef vector<DD> Vd;
typedef vector<bool> Vb;
typedef vector<Vl> VVl;
typedef pair<LL, LL> Pll;
typedef pair<DD, DD> Pdd;
typedef vector<Pll> Vpl;
typedef vector<Pdd> Vpd;
typedef queue<LL> Ql;
typedef stack<LL> Sl;
typedef deque<LL> Dl;

LL _set(LL N, LL pos) {return N = N | (1 << pos);}
LL _reset(LL N, LL pos) {return N = N & ~(1 << pos);}
bool _check(LL N, LL pos) {return (bool)(N & (1 << pos));}
bool _upper(char a) {return a >= 'A' && a <= 'Z';}
bool _lower(char a) {return a >= 'a' && a <= 'z';}
bool _digit(char a) {return a >= '0' && a <= '9';}

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

///**************************DONE****************************///

int main()
{
    int x, y, z;
    cin >> x >> y >> z;
    cout << z << ' ' << x << ' ' << y << '\n';
    return 0;
}


Measured memory_bytes: 3564
N, L = (int(x) for x in input().split())
A = []
for i in range(N):
  A.append(L+i)
s = sum(A)
m = 1000
ans = 0
for i in range(N):
  t = A.pop(i)
  if abs(sum(A)-s) <= m:
    m = abs(sum(A)-s)
    ans = sum(A)
  A.insert(i,t)
print(ans)

Measured memory_bytes: 3064
#include <stdio.h>
#include <math.h>
 
int main(int argc, const char * argv[]) {
    double a, b, d, C, S, L, h;
     
    scanf("%lf %lf %lf",&a, &b, &C);
     
    C = C * M_PI / 180;
     
    h = b * sin(C);
     
    S = a * h / 2;
     
    d = sqrt(a * a + b * b - 2 * a * b * cos(C));
     
    L = a + b + d;
     
    printf("%f\n%f\n%f\n",S, L, h);
     
     
    return 0;
}

Measured memory_bytes: 648
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  
  if (A + B > C + D) {
    cout << "Left" << endl;
  }
  else if (A + B == C + D) {
    cout << "Balanced" << endl;
  }
  else {
    cout << "Right" << endl;
  }
}

Measured memory_bytes: 3544
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
   int n[10];
   
   for(int i = 0; i < 10; i++) cin >> n[i];
   sort(n, n+10);
   for(int i = 9; i >6; i--) cout << n[i]<< endl;
   return 0;
}

Measured memory_bytes: 1176
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

int main() {

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

	string temp;
	cin >> temp;

	Int len = temp.size();
	deque<char> s;
	for (Int i = 0; i < len; i++) {
		s.push_back(temp[i]);
	}

	Int q,flag;
	cin >> q;

	flag = 1;
	for (Int i = 0; i < q; i++) {
		Int t;
		cin >> t;
		if (1==t) {
			flag *= -1;
		}
		else {
			Int f;
			char c;
			cin >> f >> c;
			if (1==flag) {
				if (1==f) {
					s.push_front(c);
					//s = c + s;
				}
				else {
					s.push_back(c);
					//s += c;
				}
			}
			else {
				if (1 == f) {
					s.push_back(c);
					//s += c;
				}
				else {
					s.push_front(c);
					//s = c+s;
				}
			}
		}
	}

	if (-1==flag) {
		reverse(s.begin(), s.end());
	}

	//cout << s << "\n";
	len = s.size();
	for (Int i = 0; i < len; i++) {
		cout << s[i];
	}
	cout << "\n";
}


Measured memory_bytes: 976
#include <stdio.h>
#include <algorithm>

#pragma warning(disable: 4996)

using namespace std;

int n, m, a[300000], b[300000]; long long c[300000], s[300001];

int main()
{
	scanf("%d", &n);

	for (int i = 0; i < n; i++) scanf("%d", &a[i]);

	sort(a, a + n);

	for (int i = 1; i <= n; i++) s[i] = s[i - 1] + a[i - 1];

	scanf("%d", &m);

	for (int i = 0; i < m; i++) scanf("%d", &b[i]);
	for (int i = 0; i < m; i++) scanf("%lld", &c[i]);

	for (int i = 0; i < m; i++)
	{
		int ptr = upper_bound(a, a + n, b[i]) - a;

		if (s[ptr] >= c[i])
		{
			printf("Yes\n");
		}
		else
		{
			printf("No\n");
		}
	}
	
	return 0;
}

Measured memory_bytes: 9612
n = int(input())
a = [int(x) for x in input().split()]
b = [0 for _ in range(len(a))]

ans = ""
anscount = 0
for i in range(n-1, -1, -1):
  ai = a[i]
  j = i + 1
  while i < n:
    if b[i]:
      ai ^= 1
    i += j
    b[j-1] = ai
res = []
for i, one in enumerate(b):
  if one==1:
    res.append(i+1)
print(len(res))
print(*res)
    
    

Measured memory_bytes: 69984
#include<iostream>

using namespace std;

int tama[10],n;

bool Haireruka(int i,int left,int right){
	if(i==10)return true;
	if(tama[i]>left){
		if(Haireruka(i+1,tama[i],right))return true;
	}
	if(tama[i]>right){
		if(Haireruka(i+1,left,tama[i]))return true;
	}
	return false;
}

int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		for(int i=0;i<10;i++){
			cin>>tama[i];
		}
		if(Haireruka(0,0,0))cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}return 0;
}

Measured memory_bytes: 1152
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;
// int a[1000010]={0};

int solve(int n){
	rep(i,1000010){
		if(i*i*i>n) break;
		rep(j,1000010){
			if(i*i*i+j*j>n) break;
			rep(k,1000010){
				if(i*i*i+j*j+k>n) break;
				if(n==i*i*i+j*j+k){
					cout<<i+j+k<<endl;
					return 0;
				}
			}
		}
	}
}
void mainmain(){
	vector<pii> a;
	vector<pii> b;
	rep(i,INF){
		if(i*i*i>1000000) break;
		a.PB(mkp(i*i*i,i));
	}
	rep(i,INF){
		if(i*i>1000000) break;
		b.PB(mkp(i*i,i));
	}
	int n;
	while(cin>>n,n){
		int ans=0;
		vector<pii>::iterator it1=upper_bound(ALL(a),mkp(n,INF));
		it1--;
		pii t1=*it1;
		cout<<t1.F<<" "<<t1.S<<endl;
		ans+=t1.S;
		n-=t1.F;
		vector<pii>::iterator it2=upper_bound(ALL(b),mkp(n,INF));
		pii t2=*it2;
		it2--;
		ans+=t2.S;
		n-=t2.F;
		cout<<ans+n<<endl;
	}
}
int a[1000010]={0};
void foo(){
	int c=1;
	bool f=false;
	while(1){
		f=false;
		rep(i,c){
			if(i*i*i>=1000010) break;
			rep(j,c-i){
				if(i*i*i+j*j>=1000010) break;
				rep(k,c-j){
					int t=i*i*i+j*j+k;
					if(t>=1000010){
						break;
					}
					else{
						f=true;
						a[t]=i+j+k;
					}
				}
			}
		}
		if(!f){
			break;
		}
		c++;		
	}
}
void mainmain2(){
	int n;
	// foo();
	while(cin>>n,n){
		int ans=INF;
		rep(z,n){
			if(z*z*z>n) break;
			int y=sqrt(n-z*z*z);
			ans=min(ans,z+y+(n-z*z*z-y*y));
		}
		cout<<ans<<endl;
	}

}



}
main() try{
    mainmain2();
}
catch(...){
}

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


def lcm(x: int, y: int):
    '''
    See:
    https://note.nkmk.me/python-gcd-lcm/
    '''
    from fractions import gcd
    return (x * y) // gcd(x, y)


def main():
    n, m = map(int, input().split())
    s = input()
    t = input()
    size = lcm(n, m)
    dn = size // n
    dm = size // m
    part_s = [s[0]]
    part_t = [t[0]]
    i = dm
    j = dn

    while i < n:
        part_s.append(s[i])
        i += dm

    while j < m:
        part_t.append(t[j])
        j += dn

    for si, ti in zip(part_s, part_t):
        if si != ti:
            print(-1)
            exit()

    print(size)


if __name__ == '__main__':
    main()


Measured memory_bytes: 5844
#include"bits/stdc++.h"
using namespace std;
using ll = int64_t;

int main() {
    string S;
    cin >> S;
    if (S[5] == '1' || S[6] >= '5') {
        cout << "TBD" << endl;
    } else {
        cout << "Heisei" << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define Mod(n) n % 1000000007
const int dx[8] = {1, 0, -1, 0, -1, 1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, -1, 1};

int main()
{
    int A,B;
    cin >> A >> B;
    if(B == 1)
    {
        cout << "0\n";
        return 0;
    }
    A--;
    B--;
    if(B % A == 0)
        cout << B / A << '\n';
    else
        cout << B / A + 1 << '\n';
    
}

Measured memory_bytes: 256
#include<iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>

using namespace std;



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

    vector<double> x(n, 0), y(n, 0);

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

    int count = 0;
    double s;

    for (int i = 0; i < n; i++) {
        s = sqrt(x[i] * x[i] + y[i] * y[i]);
        if (s <= d) {
            count++;
        }
    }

    cout << count;

    return 0;
}



Measured memory_bytes: 6492
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
int popcount(int n,int x){
    int i, c=0;
    for(i=0;i<n;i++){
        if(1<<i > x)break;
        if(1<<i&x)c++;
    }
    return c;
}
int main(){
    int n;
    string s;
    cin >> n >> s;
    int i;
    int pcs = 0, pc = 0;
    for(i=0;i<n;i++){
        if(s[i]=='1'){
            pcs++;
        }
    }
    
    int vmp[n]={0}, vmm[n]={0};
    vmp[n-1]=1;
    vmm[n-1]=1;
    for(i=2;i<=n;i++){
        vmp[n-i] = (vmp[n-i+1]*2)%(pcs+1);
        if(pcs>1) vmm[n-i] = (vmm[n-i+1]*2)%(pcs-1);
    }
    int snp=0, snm = 0;
    for(i=0;i<n;i++){
        if(s[i]=='1'){
            snp = (snp + vmp[i])%(pcs+1);
            if(pcs>1) snm = (snm + vmm[i])%(pcs-1);
        }
    }
    int sn, sm, c;
    int pct[n+1];
    for(i=0;i<=n;i++)pct[i]=-1;
    pct[1]=1;
    pct[2]=1;
    pct[3]=2;
    pct[4]=1;
    for(i=0;i<n;i++){
        if(s[i]=='0'){
            sn = (snp + vmp[i])%(pcs+1);
        }else if(pcs<=1){
            cout << 0 << endl;
            continue;
        }else{
            sn = (snm - vmm[i]+pcs-1)%(pcs-1);
        }
        c=1;
        while(sn>0){
            if(pct[sn]>0){
                sm = pct[sn];
            }else{
                sm = popcount(n,sn);
                pct[sn]=sm;
            }
            sn = sn % sm;
            c++;
        }
        cout << c << endl;
    }
    return 0;
}

Measured memory_bytes: 6068
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+9
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    def f(ks):
        a = []
        while 1:
            try:
                s = S()
                if s == '':
                    break
                a.append(s)
            except:
                break
        y = {}
        keys = []
        for l in a:
            while 1:
                yi = y
                for k in keys:
                    yi = yi[k]
                ti = 0
                for c in l:
                    if c != ' ':
                        break
                    ti += 1
                if '_ind' not in yi:
                    yi['_ind'] = ti
                if yi['_ind'] != ti:
                    keys = keys[:-1]
                    continue
                k = l.split(':')[0].split(' ')[-1]
                if l[-1] == ':':
                    keys.append(k)
                    yi[k] = {}
                else:
                    yi[k] = l.split(':')[1][1:]
                break
        ka = ks.split('.')[1:]
        yi = y
        for k in ka:
            if isinstance(yi, str) or k not in yi:
                return 'no such property'
            yi = yi[k]
        if isinstance(yi, str):
            return 'string "{}"'.format(yi)
        return 'object'

    while 1:
        n = S()
        if n == 0:
            break
        rr.append(f(n))
        break

    return '\n'.join(map(str, rr))


print(main())



Measured memory_bytes: 9156
import sys
import numpy as np
import random
from decimal import Decimal
import itertools
import re
import bisect
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(10**9)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
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)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')
def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]
def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]
MOD = 1000000007

def main():
	n = I()
	a_list = LI()
	q = I()
	a_sum = sum(a_list)
	a_list_counter = Counter(a_list)
	for _ in range(q):
		b, c = LI()
		a_sum += (c-b)*a_list_counter[b]
		a_list_counter[c] += a_list_counter[b]
		a_list_counter[b] = 0
		print(a_sum)



if __name__ == '__main__':
    main()

Measured memory_bytes: 41640
#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
inline bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
inline bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  ll x;
  cin >> x;
  x /= 200;
  print(10 - x);
}


Measured memory_bytes: 3592
from itertools import accumulate
def resolve():
    MOD = 10**9+7
    N = int(input())
    A = list(map(int, input().split()))

    Acc = [0] + list(accumulate(A))

    ans = 0
    for i in range(N):
        ans += A[i] * (Acc[N] - Acc[i+1])
        ans %= MOD

    print(ans)


if __name__ == "__main__":
    resolve()


Measured memory_bytes: 31528
#include <iostream>
#include <vector>

const long long mod=1000000007;
int main(){
  int N,M;
  std::cin >> N >> M;

  std::vector<long long> x_arr(N), y_arr(M);
  for(int i = 0; i < N; i++) std::cin >> x_arr[i];
  for(int i = 0; i < M; i++) std::cin >> y_arr[i];

  long long x_sum = 0, x_sum_sum = 0;
  for(int i = 1; i < N; i++){
    (x_sum += i*(x_arr[i]-x_arr[i-1])) %= mod;
    (x_sum_sum += x_sum) %= mod;
  }
  long long y_sum = 0, y_sum_sum = 0;
  for(int i = 1; i < M; i++){
    (y_sum += i*(y_arr[i]-y_arr[i-1])) %= mod;
    (y_sum_sum += y_sum) %= mod;
  }

  std::cout << (x_sum_sum*y_sum_sum)%mod << std::endl;


  return 0;
}



Measured memory_bytes: 1792
n = int(input())
otl = [input().split() for i in range(n)]

sum = 0
for m in range(len(otl)):
  if otl[m][1] == 'JPY':
    sum += float(otl[m][0])
  elif otl[m][1] == 'BTC':
    sum += float(otl[m][0])*380000.0
print(sum)

Measured memory_bytes: 3060
#include <iostream>
using namespace std;
 
int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    if ( (a + b == c) ||
         (b + c == a) ||
         (c + a == b) )
         cout << "Yes" << endl;
    else
         cout << "No" << endl;
 
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main(void){
  char *p;
  p=malloc(100);
  scanf("%s",p);
  int f=0;
  int i;
  for(i=0;i<100;i++){
    if(*(p+i)=='C'){
      f++;
      break;
    }
  }
  
  for(int j=i;j<100;j++){
    if(*(p+j)=='F'){
      f++;
      break;
    }
  }
  if(f==2){
    printf("Yes");
  }else{printf("No");
  }
  free(p);
}


Measured memory_bytes: 128
def resolve():
    n=int(input())
    # int型mをとって、素因数をkeyに乗数をvalueに格納した辞書型pfを返す関数
    def prime_factorization(m):
        pf = {}  # keyをvalue乗

        for i in range(2, int(m ** 0.5) + 1):
            # iで割れる回数をpfに格納
            while m % i == 0:
                # get関数の第2引数はキーが存在しない場合に返すデフォルト値
                pf[i] = pf.get(i, 0) + 1
                m //= i

        # 割り切れずに残ったものは素数なのでpfにぶち込む
        if m > 1:
            pf[m] = 1

        return pf
    print('{}:'.format(n),end='')
    ans=[]
    for k, v in prime_factorization(n).items():
        for i in range(v):
            print(' {}'.format(k), end='')
    print()

resolve()


Measured memory_bytes: 5640
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repp(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;

signed main(){
    int n, m;
    while(1){
        cin >> n >> m;
        if(n + m == 0) break;
        vector<pair<int, int> > data;
        int d, p, sum = 0;
        rep(i, 0, n){
            cin >> d >> p;
            sum += d*p;
            data.push_back(make_pair(p, d));
        }
        sort(all(data));
        reverse(all(data));
        rep(i, 0, n){
            if(m - data[i].second >= 0){
                sum -= data[i]. second * data[i]. first;
                m -= data[i].second;
            }else{
                sum -= m * data[i]. first;
                break;
            }
        }
        cout << sum << endl;
    }
}

Measured memory_bytes: 1576
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
using namespace std;
#define pb push_back
#define pf push_fron
#define INF 1000000000
typedef long long ll;


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

	string s = "MARCH";
	ll cnt[5] = { 0 };

	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string t;
		cin >> t;
		for (int j = 0; j < 5; j++) {
			if (t[0] == s[j]) cnt[j]++;
		}
	}

	ll ans=0;
	for (int i = 0; i < 5; i++) {
		for (int j = i + 1; j < 5; j++) {
			for (int k = j + 1; k < 5; k++) {
				ans += (cnt[i] * cnt[j] * cnt[k]);
			}
		}
	}
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define M 1000000

int main(void){
  int i,j;
  int num[M];
  int n,s;

  num[0]=0;
  for(i=1;i<M;i++)
    num[i]=1;
  for(i=1;i<M;i++)
    if(num[i]==1){
      for(j=i;j<M;j+=i+1)
        num[j]=0;
      num[i]=1;
    }

  for(;;){
    scanf("%d",&n);
    if(n==0)
      break;

    s=0;
    for(i=1,j=0;j<n;i++)
      if(num[i]==1){
        s+=i+1;
        j++;
      }

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

  return 0;
}

Measured memory_bytes: 0
while True:
    H, W = map(int, input().split())
    x = "#"
    for i in range(H):
        for j in range(W):
            if i ==0 or i == H-1 or j==0 or j == W-1:
                print("#",end="")
            else:
                print(".", end="")
        print()
    if H == 0 and W ==0 :
        break
    print()
    


Measured memory_bytes: 7004
N = int(input())
from collections import defaultdict
arr = defaultdict(int)
for i in range(2,N+1):
    temp = i
    f = True
    for j in range(2, int(-(-i**0.5//1))+1):
        if temp%j==0:
            cnt=0
            while temp%j==0:
                cnt+=1
                temp //= j
            f = False
            arr[j] += cnt
    if temp!=1:
        f = False
        arr[temp] += 1
    if f:
        arr[i] += 1
ans = 1
for i in arr.values():
    ans *= i+1
    ans %= 10**9 + 7
print(ans)

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

typedef long long ll;

int main() {
    /*
    vector<bool> prime(1000001, true);
    prime[0] = false;
    prime[1] = false;
    for (int i = 2; i * i < 1000001; i++) {
        if (!prime[i]) continue;
        for (int j = i * 2; j < 1000001; j += i) {
            prime[j] = false;
        }
    }
    vector<int> primes;
    rep(i, 1000001) {
        if (prime[i]) primes.push_back(i);
    }
    cout << primes.size() << "\n";
    */
    int N, A;
    cin >> N;
    map<int, int> mp;
    rep(i, N) {
        cin >> A;
        for (int i = 2; i * i <= A; i++) {
            if (A % i) continue;
            mp[i]++;
            while (A % i == 0) A /= i;
        }
        if (A > 1) mp[A]++;
    }
    string ans = "pairwise coprime\n";
    for (auto i : mp) {
        //cout << i.first << " " << i.second << "\n";
        if (i.second == N) {
            cout << "not coprime\n";
            return 0;
        }
        if (i.second > 1) ans = "setwise coprime\n";
    }
    cout << ans;
}

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

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)


int main()
{
  ll x;
  cin >> x;
  vecll f(200);
  forll (i, 0, 200)
	f[i] = pow(i, 5);
  
  forll(i, 0, 200){
	forll(j, 0, 200){
	  if(f[i] + x == f[j]){
		cout << j << " " << i << endl;
		return 0;
	  }
	  if(-f[i] + x == f[j]){
		cout << j << " " << -i << endl;
		return 0;
	  }
	}
  }
}


Measured memory_bytes: 4080
#include<iostream>
#include<stdio.h>
//#include <bits/stdc++.h>
#include<vector>
#include<float.h>
#include<iomanip>
#include<algorithm>
#include<string>
#include<cstring>
#include<math.h>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include <cassert>
#include <cmath>
#include<cstdint>

#define INF 1e9
#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define vec(type,n) vector<type>(n)
#define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
#define ALL(a)  (a).begin(),(a).end()

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using P = pair<int,ll>;

vector<int>bitSearch(int bit,int n){
    vector<int>S;
    rep(i,n)if(bit&(1<<i))S.push_back(i);
    return S;
}

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




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



Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int a = sc.nextInt(),b=sc.nextInt(),c=sc.nextInt();
    String result = a<=c && c<=b ? "Yes":"No";
    System.out.println(result);
    
  }
}

Measured memory_bytes: 21460
import java.util.*;

class Main{           
  
   public static void main(String[] args){
         Scanner sc = new Scanner(System.in);  
         
         int N = sc.nextInt();
          String S[] = new String[N];
          
          for(int i = 0;i < N;i++){
              S[i] = sc.next();
          }
         
          int countA = 0;
          boolean ok = true;
          
          for(int i = 0;i < S.length;i++){
              if(S[i].charAt(0) == 'A'){
                  countA++;
              }
              else{
                  if(countA == 0){
                      ok = false;
                  }
                  countA--;                  
              }                            
          }
          
          if(countA != 0 || !ok){
              System.out.println("NO");
          }else{
              System.out.println("YES");
          }
          
         
   }         
         
 }

Measured memory_bytes: 26308
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a), i##_max = (b); i < i##_max; ++i)
#define RFOR(i, a, b) for (int i = (b)-1, i##_min = (a); i >= i##_min; --i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define RREP(i, n) for (int i = (n)-1; i >= 0; --i)
#define ALL(obj) (obj).begin(), (obj).end()

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

using namespace std;
using i64 = int64_t;
using u64 = uint64_t;
using vb = vector<bool>;
using vi = vector<int>;
using vl = vector<i64>;
using vd = vector<double>;
using pi = pair<int, int>;
using pl = pair<i64, i64>;
using pd = pair<double, double>;

constexpr int INF = 1 << 30;
constexpr int MOD = 1000000007;

template <typename T>
inline void chmin(T &a, T b) {
  a = min(a, b);
}
template <typename T>
inline void chmax(T &a, T b) {
  a = max(a, b);
}
template <typename T>
void print(T &v) {
  for (auto it = v.begin(); it != v.end(); ++it) {
    if (it != v.begin()) cout << " ";
    cout << *it;
  }
  cout << endl;
}

int main() {
  int a, b;
  cin >> a >> b;
  cout << __gcd(a, b) << endl;
}


Measured memory_bytes: 3100