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




int main(){
    ll N, K; cin >> N >> K;
    vector<ll> A;  A.push_back(0);
    for(ll i = 0; i < N; i++) {
        ll a; cin >> a; A.push_back(a);
    }
    ll cnt = 0;
    map<ll, ll> M;
    vector<ll> vis(N+1, 0);
    ll cur = 1;
    for(int k = 0; k < K; k++){
        //cout << cur << endl;
        cnt++;
        cur = A[cur];
        M[cnt] = cur;
        if(cur == 1 || vis[cur] != 0){
            if(cur == 1){
                ll loop = cnt;
                ll rem = K % loop;
                if(rem == 0) cout << cur << endl;
                else cout << M[rem] << endl;
                return 0;
            }
            else{
                ll loop = cnt - vis[cur];
                ll rem = (K-vis[cur])%loop;
                for(ll i = 0; i < rem; i++) cur = A[cur];
                cout << cur << endl;
                return 0;

            }
        }
        else vis[cur] = cnt;
    }
    cout << cur << endl;

}


Measured memory_bytes: 16264
#include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;

#define int long long int
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define rep(i,a,b) for (int i = a; i < b; ++i)
#define IOS ios::sync_with_stdio(false); cin.tie(NULL);
#ifndef LOCAL
#define dbg(...) ;
#define endl '\n'
#endif

const int inf = 1e15;
const int MOD = 1e9 + 7;
const int N = 2e5 + 5;

int dp[2019];

signed main(){
    IOS;
    string s;
    cin >> s;
    int n = s.length();
    int ans = 0;
    for (int i = 0; i < n; i++) {
        int c = s[i] - '0';
        int newdp[2019] = {0};
        for (int j = 0; j < 2019; j++) {
            newdp[(j * 10 + c) % 2019] = dp[j];
        }
        newdp[c]++;
        for (int j = 0; j < 2019; j++)
            dp[j] = newdp[j];
        ans += newdp[0];
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  string s,t;
  cin>>s>>t;
  vector<int> p[30];
  rep(i,s.size()) p[s[i]-'a'].push_back(i);
  int now=-1;
  ll ans=0;
  for (auto x: t) {
    int c=x-'a';
    if (p[c].size()==0) {
      cout<<-1<<endl;
      return 0;
    }
    int i=upper_bound(p[c].begin(),p[c].end(),now)-p[c].begin();
    if (i==p[c].size()) {
      ans+=(ll)s.size();
      i=0;
    }
    now=p[c][i];
  }
  ans+=(ll)now+1;
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 1216
/*************************************
 * @contest:      ABC149.
 * @user_name:    hkxadpall.
 * @time:         2019-12-29.
 * @language:     C++.
 * @upload_place: AtCoder.
*************************************/ 

#include <bits/stdc++.h>
using namespace std;

typedef signed char          int8;
typedef unsigned char       uint8;
typedef short                int16;
typedef unsigned short      uint16;
typedef int                  int32;
typedef unsigned            uint32;
typedef long long            int64;
typedef unsigned long long  uint64;

template <typename Int>
inline Int read()       
{
    Int flag = 1;
    char c = getchar();
    while ((!isdigit(c)) && c != '-') c = getchar();
    if (c == '-') flag = -1, c = getchar();
    Int init = c & 15;
    while (isdigit(c = getchar())) init = (init << 3) + (init << 1) + (c & 15);
	return init * flag;
}

template <typename Int>
inline Int read(char &c)       
{
    Int flag = 1;
    c = getchar();
    while ((!isdigit(c)) && c != '-') c = getchar();
    if (c == '-') flag = -1, c = getchar();
    Int init = c & 15;
    while (isdigit(c = getchar())) init = (init << 3) + (init << 1) + (c & 15);
	return init * flag;
}

template <typename Int>
inline void write(Int x)
{
    if (x < 0) putchar('-'), x = ~x + 1;
    if (x > 9) write(x / 10);
    putchar((x % 10) | 48);
}  

template <typename Int>
inline void write(Int x, char nextch)
{
    write(x);
    putchar(nextch);
}

string S, T;

int main()
{
    cin >> S >> T;
    cout << T + S;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer"
string to_string_keta(const long long int l, const int keta) {
	ostringstream oss;

	oss << std::setw(keta) << std::setfill('0') << l;

	return oss.str();
}
int getnum(const int a) {
	if (a >= 11)return 0;
	else if (a >= 6)return 1;
	else if (a >= 2)return 2;
	else return 3;
}

int main() {
	ld a, b;
	vector<int>lnum(4);
	vector<int>rnum(4);
	while (cin >> a>>b) {
		a += eps; b += eps;
		a *= 10; b *= 10;
		lnum[getnum(a)]++;

			rnum[getnum(b)]++;
		
	}
	for (int i = 0; i < 4; ++i) {
		cout << lnum[i] << " "<<rnum[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 3176
import java.util.*;

class Main{

    Main(){
        Scanner SC = new Scanner(System.in);
        long N = Long.parseLong(SC.next());

        if( (N&1) == 1){
            System.out.println(0);
            return;
        }

        long R = 0;
        long D = 10;
        while(N >= D){
            R += N/D;
            D *= 5;
        }

        System.out.println(R);
    }

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


Measured memory_bytes: 21716
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <array>
#include <vector>
#include <utility>
#include <bitset>
#include <queue>
#include <unordered_map>
#include <unordered_set>

using namespace std;

using ll = long long;
using p = pair<ll, ll>;

constexpr ll MAX_N = 1000;
constexpr ll INF = 1e18;

struct edge {
    ll to;
    ll score;
    edge(){}
    edge(ll to, ll score) : to(to), score(score) { }
};

ll N, M;
vector<edge> G[MAX_N + 1];

void solve() {
    ll score[MAX_N + 1];
    for (ll i = 1; i <= N; i++) {
        score[i] = INF;
    }

    score[1] = 0;

    for (ll i = 1; i <= N - 1; i++) {
        for (ll v = 1; v <= N; v++) {
            for (auto& e : G[v]) {
                if (score[v] != INF && score[e.to] > score[v] + e.score) {
                    score[e.to] = score[v] + e.score;
                }
            }
        }
    }

    bool neg[MAX_N + 1];
    memset(neg, 0, sizeof(neg));

    for (ll i = 1; i <= N; i++) {
        for (ll v = 1; v <= N; v++) {
            for (auto& e : G[v]) {
                if (score[v] == INF) {
                    continue;
                }

                if (neg[v] || score[e.to] > score[v] + e.score) {
                    neg[e.to] = true;
                }
            }
        }
    }

    if (neg[N]) {
        cout << "inf" << endl;
    } else {
        cout << -score[N] << endl;
    }
}

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

    cin >> N >> M;

    for (ll i = 0; i < M; i++) {
        ll a, b, c;
        cin >> a >> b >> c;
        G[a].push_back(edge(b, -c));
    }

    solve();

    return 0;
}



Measured memory_bytes: 384
n = int(input())
a = list(map(int,input().split()))
a.sort()
count = 0
x = 0
tmp_count = 0
for i in a:
    if i != x:
        if tmp_count < x:
            count += tmp_count
        else:
            count += tmp_count - x
        tmp_count = 1
        x = i
    else:
        tmp_count += 1
if tmp_count < x:
    count += tmp_count
else:
    count += tmp_count - x
print(count)

Measured memory_bytes: 14268
#include <bits/stdc++.h>
using namespace std;
int main()
{
	char k[17];//CODEFESTIVAL2016
	gets(k);
	int h=strlen(k);
	int sum=0;
	if(k[0]!='C') sum++;
	if(k[1]!='O') sum++;
	if(k[2]!='D') sum++;
	if(k[3]!='E') sum++;
	if(k[4]!='F') sum++;
	if(k[5]!='E') sum++;
	if(k[6]!='S') sum++;
	if(k[7]!='T') sum++;
	if(k[8]!='I') sum++;
	if(k[9]!='V') sum++;
	if(k[10]!='A') sum++;
	if(k[11]!='L') sum++;
	if(k[12]!='2') sum++;
	if(k[13]!='0') sum++;
	if(k[14]!='1') sum++;
	if(k[15]!='6') sum++;
	cout<<sum<<endl;
	return 0;
 } 

Measured memory_bytes: 256
#include <algorithm>
#include<stdio.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stack>
#include <queue>
#include<map>
#include <set>
#include<math.h>
using namespace std;
#define int long long
#define ll long long
#define double long double
#define rep(i,n) for(ll i=0;i<n;++i)
#define Rep(i,n) for(ll i=1;i<=n;++i)
#define loop(i,m,n) for(ll i=m;i<n;++i)
#define ggr getchar(); getchar();return 0;
#define pie 3.141592653589793238462643383279
#define elif else if
#define P pair<ll,ll>
#define prique priority_queue<ll>
#define ALL(a)  (a).begin(),(a).end()
const int mod = 1000000007;
const int mod2 = 998244353;
int bin(int bina) {
	int ans = 0;
	for (int i = 0; bina > 0; i++)
	{
		ans = ans + (bina % 2) * pow(10, i);
		bina = bina / 2;
	}
	return ans;
}
bool prime(int n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x * y / gcd(x, y);
}
int kai(int x) {
	if (x == 0)return 1;
	return kai(x - 1) * x % mod;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int nCr(int n, int r) {
	int ans = 1;
	for (ll i = n; i > n - r; --i) {
		ans = ans * i;
	}
	for (ll i = 1; i < r + 1; ++i) {
		ans = ans / i;
	}
	return ans;
}
int per(int n, int r) {
	r = n - r;
	int sum = 1;
	int i;
	for (i = n; i >= r + 1; i--)sum *= i;
	return sum;
}
struct union_find {
	int par[200010], size_[200010];
	void init(int x) {
		rep(i, x) { par[i] = i; size_[i] = 1; }
	}
	int find(int x) {
		if (par[x] == x)return x;
		return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y)return;
		if (size_[x] < size_[y]) {
			par[x] = y;
			size_[y] += size_[x];
		}
		else {
			par[y] = x;
			size_[x] += size_[y];
		}
	}
};

signed main() {
	string s, t;
	cin >> s >> t;
	cout << t << s << endl;
}


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

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

const ll md = 1000000007;

const int N = 100005;

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    string s;
    cin >> s;
    ll ans = 0;
    ll acc = 1;
    FORD(i, SZ(s) - 1, 0) {
        if (s[i] == '1') {
            ans = (2 * max(ans, (ll) 1)) % md;
            ans = (ans + acc) % md;
        }         
        acc = (acc * 3) % md;
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
import sys

def forward(s1, c):
    for s in s1:
        if s > c:
            return False
    return True

def get_char(s, c):
    return sorted(list(filter(lambda x: x > c, s)))[0]
    
S = sys.stdin.readline().strip()

c_list = [chr(i) for i in range(97, 97+26)]
#num_list = [int(chr(s)) for s in S]
s_list = [s for s in S]
all_char = "abcdefghijklmnopqrstuvwxyz"

if S == "zyxwvutsrqponmlkjihgfedcba":
    print("-1")
elif len(S) != 26:
    for c in c_list:
        if c not in s_list:
            print(S + c)
            break
else:
    for i in reversed(list(range(25))):
        sub = S[i+1:]
        if forward(sub, S[i]):
            # S[i]が最大
            pass
        else:
            #m = max(sub)
            m = get_char(sub, S[i])
            print(S[:i] + m)
            break


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

const int M = 1000005;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  vector<int> cnt(M);
  for (int x : a) {
    if (cnt[x] != 0) {
      cnt[x] = 2;
      continue;
    }
    for (int i = x; i < M; i += x) cnt[i]++;
  }
  int ans = 0;
  for (int x : a) {
    if (cnt[x] == 1) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 8024
#include <stdio.h>

int linearsearch (int A[], int n, int key) {
    int i = 0;
    A[n] = key;
    while ( A[i] != key ) i++;
    return i != n;
    
}

int main () {
    int i, n, A[10000 + 1], q, key, sum = 0;
    scanf("%d", &n);
    for ( i = 0; i < n; i++ ) {
        scanf ( "%d", &A[i]);
    }
    
    scanf ("%d", &q);
    for ( i = 0; i < q; i++ ){
        scanf ( "%d", &key );
        if ( linearsearch ( A, n, key ) ) {
            sum++;
        }
    }
    printf ( "%d\n", sum);
    
    return 0;
    
}





Measured memory_bytes: 2060
n, m = map(int, input().split())
A = [input() for i in range(n)]
B = [input() for i in range(m)]

ans = 'No'
for i in range(n - m + 1):
    for j in range(n - m + 1):
        C = []
        for k in range(m):
            C.append(A[i + k][j : j + m])
        if B == C:
            ans = 'Yes'
            
print(ans)

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

class PaizaSample
{

    static void Main()
    {
        int n = int.Parse(Console.ReadLine());



        for (int i = 0; i < n; i++)
        {
            string input = Console.ReadLine();
            
            string train = "";
            train += input[0];
            int now = 0;

            for (int j = 1; j < input.Length; j += 3)
            {
                if (input[j] == '<')
                {
                    if (now == 0)
                    {
                        train = input[j + 2] + train;
                    }
                    else
                    {
                        now--;
                    }
                }
                else
                {
                    if (now == train.Length - 1)
                    {
                        train += input[j + 2];
                    }
                    now++;
                }
            }

            Console.WriteLine(train);

        }

        // Console.ReadKey();

    }
}

Measured memory_bytes: 8868
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

#define debug(x) cout << #x << ": " << x << endl;
#define ll long long
#define mod 1000000007

int N, M;
string s;
int dp[1<<20];
multiset<int> ma;

int main() {
  //freopen("input.in","r",stdin);
  //freopen("output.out","w",stdout);
  cin >> N >> M >> s;

  if(M >= N) {
    cout << N << endl;
    return 0;
  }

  dp[N] = 0;
  ma.insert(0);

  for(int j = 1;j < M;j++) {
    int ans = 1;
    if(s[N-j] == '1') {
      ans = INT_MAX;
    }

    dp[N-j] =  ans;
    ma.insert(ans);
  }

  for(int i = N-M;i >= 0;i--) {
    int ans = *ma.begin();
    if(ans != INT_MAX and s[i] != '1') {
      ans += 1;
    } else {
      ans = INT_MAX;
    }

    dp[i] = ans;
    ma.insert(ans);

    ma.erase(ma.find(dp[i+M]));
  }

  if(dp[0] == INT_MAX) {
    cout << -1 << endl;
    return 0;
  }

  vector<int> ans;
  int num = dp[0];
  for(int i = 0;i <= N;i++) {
    if(dp[i] == num) {
      ans.push_back(i);
      num -= 1;
    }
  }

  for(int i = 1;i < ans.size();i++) {
    cout << ans[i]-ans[i-1] << " ";
  }

  // cout << endl;
  // for(int i = 0;i <= N;i++) cout << dp[i] << " ";

  return 0;
}


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

#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

using namespace std;

typedef long long LL;

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
    os << "[ ";
    REP(i, vec.size()) {
        os << vec[i] << " ";
    }
    os << "]";

    return os;
}

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

    int N, K; cin >> N >> K;
    string S; cin >> S;

    vector<int> idxs;
    idxs.push_back(0);
    FOR(i, 1, S.size()) {
        if (S[i] != S[i-1]) {
            idxs.push_back(i);
        }
    }

    idxs.push_back(N);

    // [left, right)
    int res = 0;
    int right;
    REP(left, idxs.size()) {
        if (S[idxs[left]] == '0') {
            right = min(left + 2 * K, int(idxs.size()) - 1);
        } else {
            right = min(left + 2 * K + 1, int(idxs.size()) - 1);
        }

        res = max(res, idxs[right] - idxs[left]);
    }

    cout << res << endl;
}


Measured memory_bytes: 1020
YEAR = 2019  # 3 * 673
l, r = map(int, input().split())

ans = 10e8

for sr in range(l + 1, r + 1):
    for sl in range(l, sr):
        ans = min(ans, sl * sr % YEAR)
        if ans == 0:
            break
    if ans == 0:
        break

print(ans)


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

#define rep(i, x, n) for (int i = x; i < n; i++)
typedef long long ll;

const int INF = 1e9 + 7;

using namespace std;

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

    int n;
    cin >> n;

    vector<int> A(n + 1);
    rep (i, 0, n+1)
	cin >> A[i];

    vector<int> B(n);
    rep (i, 0, n)
	cin >> B[i];
    
    ll count = 0;
    rep (i, 0, n) {
	int tmp1 = A[i] - B[i];
	if (tmp1 >= 0) {
	    count += B[i];
	    continue;
	}
	count += A[i];

	int tmp2 = A[i + 1] - abs(tmp1);
	if (tmp2 >= 0) {
	    count += abs(tmp1);
	    A[i + 1] -= abs(tmp1);
	    continue;
	}
	count += A[i + 1];
	A[i + 1] = 0;
    }

    cout << count << endl;

    return 0;
}


Measured memory_bytes: 1024
N = int(input())
P =list(map(int,input().split()))
cnt = 1
minPi = P[0]
for i in range(1,N):
  if minPi > P[i]:
    minPi = P[i]
  
  if minPi < P[i]:
    cnt = cnt
  else:
    cnt += 1
print(cnt)
  

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

int main() {
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N);
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.rbegin(), A.rend());

    auto minOp = [&](ll x) {
        //Aを全てxで割り切れるようにするときにかかる最小回数
        vector<ll> mod(N);
        for (ll i = 0; i < N; i++) {
            mod[i] = A[i] % x;
        }
        sort(mod.begin(), mod.end());
        ll back = N - 1;
        ll num = 0;
        for (ll i = 0; i < back; i++) {
            //mod[i]は減らす,mod[back]は増やす
            if (mod[i] == x - mod[back]) {
                ll curr_op_num = mod[i];
                num += curr_op_num;
                mod[i] -= curr_op_num;
                mod[back] += curr_op_num;
                back--;
            } else if (mod[i] > x - mod[back]) {
                ll curr_op_num = x - mod[back];
                num += curr_op_num;
                mod[i] -= curr_op_num;
                mod[back] += curr_op_num;
                back--;
                i--;
            } else {
                ll curr_op_num = mod[i];
                num += curr_op_num;
                mod[i] -= curr_op_num;
                mod[back] += curr_op_num;
            }
        }
        for (ll i = 0; i < N; i++) {
            assert(mod[i] % x == 0);
        }

        return num;
    };

    ll sum = accumulate(A.begin(), A.end(), (ll)0);

    ll ans = 0;
    for (ll i = 1; i * i <= sum; i++) {
        if (sum % i != 0) {
            continue;
        }

        if (minOp(sum / i) <= K) {
            ans = max(ans, sum / i);
            continue;
        }
        if (minOp(i) <= K) {
            ans = max(ans, i);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
from itertools import product
s = input()
ans = 0
for p in product(range(2),repeat=len(s)-1):
    tmp = ''
    for i in range(len(s)-1):
        if p[i] == 1:
            tmp += s[i]+'+'
        else:
            tmp += s[i]
    ans += eval(tmp+s[-1])
print(ans)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int a,b,cnt=0;
    cin>>a>>b;
    while(a<=b)
    {
        if(to_string(a).at(0)==to_string(a).at(4))
            if(to_string(a).at(1)==to_string(a).at(3))cnt++;
        a++;
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		if (s.equals("ani")) {
		    System.out.println("square1001");
		} else {
		    System.out.println("e869120");
		}
	}
}



Measured memory_bytes: 26096
// Hovalhagh
// Ya Aziz & Hakim
// AliReza Kaboli

#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 100;

int dp[N][4];

int main() {
	int n;
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		int a, b, c;
		cin >> a >> b >> c;
		dp[i][1] = max(dp[i - 1][2], dp[i - 1][3]) + a;
		dp[i][2] = max(dp[i - 1][1], dp[i - 1][3]) + b;
		dp[i][3] = max(dp[i - 1][1], dp[i - 1][2]) + c;
	}
	cout << max(dp[n][1], max(dp[n][2], dp[n][3])) << '\n';
}


Measured memory_bytes: 1792
a,b,c=gets.split.map(&:to_i)

c2=c/2
if c.odd? then
	c2+=1
end
x=a*b*c2
x2=a*b*(c/2)

if x<x2 then
	x=x2-x
else
	x-=x2
end


b2=b/2
if b.odd? then
	b2+=1
end
y=a*b2*c
y2=a*c*(b/2)

if y<y2 then
	y=y2-y
else
	y-=y2
end

a2=a/2
if a.odd? then
	a2+=1
end
z=b*c*a2
z2=b*c*(a/2)

if z<z2 then
	z=z2-z
else
	z-=z2
end

if x>y then
	x=y
end
if x>z then
	x=z
end

puts x




Measured memory_bytes: 1788
#include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<math.h>
#include<string>
#include<numeric>
using namespace std;




int main() {
	char x[2][3];
	for (int i = 0;i < 2;i++) {
		for (int t = 0;t < 3;t++) {

			cin >> x[i][t];
		}
	}

	if (x[0][0] == x[1][2] && x[1][1] == x[0][1] && x[0][2] == x[1][0]){
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}






	}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
signed main(){
    long long N, A[N];
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }

    long long maximum = 0;
    for(int i = 0; i < N; i++){
        maximum = max(A[i], maximum);
    }
    long long minimum = INT_MAX;
    for(int j = 0; j < N; j++){
        minimum = min(A[j], minimum);
    }

    cout << maximum - minimum << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
	    int min = 1000000000, profit = -1000000000;
	    int getNum = scan.nextInt();
	    min = getNum;

		for(int i = 0; i < n-1; i++) {
		 getNum = scan.nextInt();

		 if(profit < getNum-min) {
				profit = getNum-min;
		}

			if(min > getNum) {
				min = getNum;
			}
		}

		System.out.println(profit);
		}
	}


Measured memory_bytes: 69404
// Task Scheduling Problem

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <ios>
#include <iomanip>
#include <string>
#include <numeric>

using namespace std;

int main() {
    vector<int> a(3);
    cin >> a[0] >> a[1] >> a[2];
    sort(a.begin(), a.end());
    cout << abs(a[0] - a[1]) + abs(a[1] - a[2]) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
 
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}
 
long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
//using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;

class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    std::vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = std::vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) std::swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

std::vector<int> Gf[100'010];
std::vector<int> Gb[100'010];

int main(){
  using namespace std;
  int n, m, k;
  cin>>n>>m>>k;
  int a[m], b[m];
  int c[k], d[k];
  UnionFind uf(n);
  REP(i, m){
    cin>>a[i]>>b[i];
    a[i]--;b[i]--;
    Gf[a[i]].push_back(b[i]);
    Gf[b[i]].push_back(a[i]);
    uf.connect(a[i], b[i]);
  }
  REP(i, k){
    cin>>c[i]>>d[i];
    c[i]--;d[i]--;
    Gb[c[i]].push_back(d[i]);
    Gb[d[i]].push_back(c[i]);
  }
  int ans[n];
  REP(i, n){
    ans[i] = uf.size(i) - 1 - Gf[i].size();
    int ib = Gb[i].size();
    REP(j, ib){
      if(uf.root(i) == uf.root(Gb[i][j])){
        ans[i]--;
      }
    }
  }
  REP(i, n){
    cout<<ans[i]<<' ';
  }
  cout<<endl;
  
  return 0;
}


Measured memory_bytes: 14200
#include <cstdio>
#include <iostream>

using namespace std;

struct Node {
	int p, l, r;
};

int NIL = -1;

void Preorder(Node T[], int u) {
	if (u == NIL)
		return;
	cout << " " << u;
	Preorder(T, T[u].l);
	Preorder(T, T[u].r);
}

void Inorder(Node T[], int u) {
	if (u == NIL)
		return;
	Inorder(T, T[u].l);
	cout << " " << u;
	Inorder(T, T[u].r);
}

void Postorder(Node T[], int u) {
	if (u == NIL)
		return;
	Postorder(T, T[u].l);
	Postorder(T, T[u].r);
	cout << " " << u;
}

int main() {

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

	Node T[n];
	for (int i = 0; i < n; ++i)
		T[i].p = T[i].l = T[i].r = NIL;

	int id, left, right;
	for (int i = 0; i < n; ++i) {
		scanf("%d %d %d", &id, &left, &right);
		T[id].l = left;
		T[id].r = right;
		T[left].p = id;
		T[right].p = id;
	}

	int root;
	for (int i = 0; i < n; ++i) {
		if (T[i].p == NIL)
			root = i;
	}

	cout << "Preorder" << endl;
	Preorder(T, root);
	cout << endl;

	cout << "Inorder" << endl;
	Inorder(T, root);
	cout << endl;

	cout << "Postorder" << endl;
	Postorder(T, root);
	cout << endl;

	return 0;
}

Measured memory_bytes: 3148
#include "bits/stdc++.h"
using namespace std;

#define ul unsigned long int
#define ull unsigned long long
#define li long long int

int main()
{
  string s;
  ul a[26];
  fill(a,a+26,0);

  int i1,i2;
  while (cin>>s)
  {
    for (ul i = 0; i < s.length(); i++)
    {
      i1 = s[i] - 'a';
      i2 = s[i] - 'A';
      if (i1 >= 0 && i1 < 26)
        a[i1]++;
      else if (i2 >= 0 && i2 < 26)
        a[i2]++;
    }
  }

  for (char i=0;i<26;i++) {
    cout << (char)('a'+i) << " : "<<a[(unsigned)i]<<endl;
  }

  return 0;
}



Measured memory_bytes: 3172
#include <iostream>
#include <iomanip>
#include <queue>
#include <deque>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <bitset>

#define REP(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define FILL(x, y) memset(x, y, sizeof(x))
#define pb push_back
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) 42
#endif

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;
}

using namespace std;
using ll = long long;

const int kInf = 2e9;
const ll kLInf = 2e18;

int gcd (int a, int b) {
   return b ? gcd(b, a % b) : a;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

ll N;

int main()
{
   cout << fixed << setprecision(10);
   cin >> N;
   if (N%2) {
      cout << 0 << endl;
      return 0;
   }
   ll tmp = N;
   ll div = 10;
   ll ans = 0;
   while (tmp / div) {
      ans += tmp / div;
      div *= 5;
   }
   cout << ans << endl;
            
   return 0;
}



Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;

ll n, p, dp[101][50001], sum[101][50001];

int main() {
  while (scanf("%lld", &n), n) {
    for (ll j = 1; j <= n*500; j++) dp[0][j] = -10000, sum[0][j] = 100000000000LL;
    for (ll i = 1; i <= n; i++) {
      scanf("%lld", &p);
      ll temp = (1000 - p % 1000);
      if (temp == 1000) temp = 0;
      if (temp >= 500) {
        for (ll j = 0; j < temp-500; j++) dp[i][j] = -10000, sum[i][j] = 100000000000LL;
        for (ll j = temp-500; j <= n*500; j++) {
          dp[i][j] = dp[i-1][j-(temp-500)]+1, sum[i][j] = sum[i-1][j-(temp-500)] + p;
        }
      } else {
        for (ll j = 0; j <= n*500; j++) {
          dp[i][j] = dp[i-1][j], sum[i][j] = sum[i-1][j];
        }
        for (ll j = temp; j <= n*500; j++) {
          if (dp[i][j] < dp[i-1][j-temp]) {
            dp[i][j] = dp[i-1][j-temp];
            sum[i][j] = sum[i-1][j-temp] + p;
          } else if (dp[i][j] == dp[i-1][j-temp]) {
            sum[i][j] = min(sum[i][j], sum[i-1][j-temp] + p);
          }
        }
        for (ll j = 0; j <= n*500+temp-500; j++) {
          if (dp[i][j] < dp[i-1][j-temp+500]+1) {
            dp[i][j] = dp[i-1][j-temp+500]+1;
            sum[i][j] = sum[i-1][j-temp+500] + p;
          } else if (dp[i][j] == dp[i-1][j-temp+500]+1) {
            sum[i][j] = min(sum[i][j], sum[i-1][j-temp+500] + p);
          }
        }
      }
    }
    ll ans1 = 0, ans2 = 100000000000LL;
    for (ll j = 0; j <= n*500; j++) {
      if (ans1 < dp[n][j]) {
        ans1 = dp[n][j];
        ans2 = sum[n][j];
      } else if (ans1 == dp[n][j]) {
        ans2 = min(ans2, sum[n][j]);
      }
    }
    printf("%lld %lld\n", ans1, ans2);
  }
}



Measured memory_bytes: 81512
#include<stdio.h>

int main(){
	long a,b;
	scanf("%ld%ld",&a,&b);
	if(a>0){
		puts("Positive");
		return 0;
	}else if(a==0||b==0){
		puts("Zero");
		return 0;
	}else {
		if(b>0){
			puts("Zero");
			return 0;
		}else {
			if((b-a)%2==0)puts("Negative");
			else puts("Positive");
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 128
N,K=(int(x) for x in input().split())
A=list(input())

if A[K-1]=='A':
    A[K-1]='a'
if A[K-1]=='B':
    A[K-1]='b'
if A[K-1]=='C':
    A[K-1]='c'
print(''.join(A))


Measured memory_bytes: 2940
#include <iostream>
#include <array>

int main ()
{
  std::array<int, 250> heap;
  int n;
  std::cin >> n;

  for (int i=0; i<n; ++i)
    {
      std::cin >> heap[i];
    }

  for (int i=0; i<n; ++i)
    {
      std::cout << "node " << i+1;
      std::cout << ": key = " << heap[i] << ", ";
      auto parent = (i+1)/2;
      if (parent > 0)
        std::cout << "parent key = " << heap[parent-1] << ", ";
      auto left = 2*(i+1);
      if (left <= n)
        std::cout << "left key = " << heap[left-1] << ", ";
      auto right = left + 1;
      if (right <= n)
        std::cout << "right key = " << heap[right-1] << ", ";
      std::cout << std::endl;
    }
}



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

using namespace std;

bool is_same(string x, string y)
{
    for (string::size_type i = 0; i <= y.length(); i++)
    {
        if (tolower(x[i]) != tolower(y[i]))
        {
            return false;
        }
    }
    return true;
}

bool mystrcmp(const char *s1, const char *s2) //s1にs2が含まれていればbreakするようにしたい
{
    while (*s2)
    {
        if (*s1 != *s2)
        {
            return false;
        }
        s1++;
        s2++;
    }
    return true;
}

bool count_string(const char *s1, const char *s2) //文字列s1の中に文字列s2が何個含まれるかカウント
{
    while (*s1)
    {
        if (::is_same(s1, s2))
        {
            return true;
        }
        s1++;
        s2++;
    }
    return false;
}

int main(void)
{
    string W;
    string T;
    string end = "END_OF_TEXT";
    int count_W = 0;

    cin >> W;
    cin >> T;

    while (!mystrcmp(T.c_str(), end.c_str()))
    {
        if (count_string(T.c_str(), W.c_str()))
        {
            count_W++;
        }
        cin >> T;
    }
    cout << count_W << endl;
}



Measured memory_bytes: 3160
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
#define repd(i, n) for (ll i = (n)-1; i >= 0; --i)
#define INF 10e12
#define MOD 1000000000 + 7
#define MAX 51000
#define all(x) (x).begin(), (x).end()
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))

using namespace std;

int main(void)
{
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll a, b;
    cin >> a >> b;
    if ((a + b) % 2 == 0)
        cout << (a + b) / 2 << endl;
    else
        cout << "IMPOSSIBLE" << endl;
}

Measured memory_bytes: 3600
n, m = map(int, input().split())
ng = False
n1 = -1
n2 = -1
n3 = -1
while m > 0:
    s, c = map(int, input().split())
    if s == 1:
        if n1 == -1 or n1 == c:
            n1 = c
        else:
            ng = True
    elif s == 2:
        if n2 == -1 or n2 == c:
            n2 = c
        else:
            ng = True
    else:
        if n3 == -1 or n3 == c:
            n3 = c
        else:
            ng = True
    m = m - 1
if n1 == -1:
    if n == 1:
        n1 = 0
    else:
        n1 = 1
if n2 == -1:
    n2 = 0
if n3 == -1:
    n3 = 0
if n != 1 and n1 == 0:
    ng = True
if ng:
    print(-1)
elif n == 1:
    print(n1)
elif n == 2:
    print(n1 * 10 + n2)
else:
    print(n1 * 100 + n2 * 10 + n3)


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

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int main(){
  int sum, p;
  while(scanf("%d", &sum) && sum){
    rep(i, 9){
      scanf("%d", &p);
      sum -= p;
    }

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

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

int main() {
  int N;
  cin >> N ;
  int sum =0;
  
  for (int i=0;i<N;i++){
    int l , r;
    cin >> l >> r ;
    sum += r-l+1;
    
  }
cout << sum <<endl;
  
}

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

A=list()

for i in range(2):
    A.append(list(map(int,input().split())))


dp = [[0 for i in range(N + 1)] for j in range(2)] 

dp[0][0]=A[0][0]
dp[1][0]=A[0][0]+A[1][0]

for j in range(N-1):
    dp[0][j+1]=dp[0][j]+A[0][j+1]

for j in range(N-1):
    dp[1][j+1]=max(dp[0][j+1]+A[1][j+1],dp[1][j]+A[1][j+1])


print(dp[1][N-1])

Measured memory_bytes: 3064
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ll = long long;
using Pi_i = pair<int, int>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;

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


int partition(VI &A, int p, int r){//[p, r]
    int x = A[r]; //基準
    int i = p - 1;
    FOR(j, p, r){
        if(A[j] <= x){
            if(++i != j){
                A[i] ^= A[j];
                A[j] ^= A[i];
                A[i] ^= A[j];
            }
        }
    }
    if(++i != r){
        A[i] ^= A[r];
        A[r] ^= A[i];
        A[i] ^= A[r];
    }
    return i;
}



int main(){
    int n; cin >> n;
    VI A(n);
    REP(i, n) cin >> A[i];
    int idx = partition(A, 0, n-1);
    REP(i, n){
        if(i) cout << " ";
        if(i != idx) cout << A[i];
        else cout << "[" << A[i] << "]";
    }
    cout << "\n";
    return 0;
}



Measured memory_bytes: 3120
#include<bits/stdc++.h>
#define speedio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;

typedef long long       ll;
typedef long double     ld;

typedef vector<int>     vi;
typedef vector<bool>    vb;
typedef vector<ll>      vll;
typedef vector<vi>      vvi;
typedef vector<vll>     vvll;
typedef vector<string>  vs;

typedef pair<int, int>  pii;
typedef pair<ll, int>   pli;
typedef pair<ll, ll>    pll;
typedef vector< pii >   vpi;
typedef vector< pll >   vpll;

// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;

#define pb           push_back
#define mod          1000000007
#define INF          1e17
#define mini         INT_MIN
#define maxo         INT_MAX
#define eb           emplace_back
#define ff           first
#define ss           second
#define re           return 
#define endl         "\n" 

#define all(c)       c.begin(),c.end()
#define be           begin()
#define en           end()
#define sz(x)        (ll)x.size()
#define mem(a,val)   memset(a,val,sizeof(a))
#define mk(x,y)      make_pair(x,y)
#define mid(s,e)     ((s)+((e)-(s))/2) 

#define fo(i,a,b)     for(ll i = (ll)(a); i <= (ll)(b); i++)
#define rf(i,a,b)    for(ll i = (ll)(a); i >= (ll)(b); i--)
#define read(a,n)    for(int i=0;i<n;i++)cin>>a[i];
#define show(a,n)    for(int i=0;i<n;i++)cout<<a[i]<<' ';cout<<endl;
#define p2(n)        (1LL << (n))
#define deb(x) cout <<#x << " = " << x << " | " << "LINE: "<<__LINE__<< endl;
template<typename... T> void rd(T&... args) { ((cin >> args), ...); }
template<typename... T> void pp(T... args) { ((cout << args << " "), ...); cout<<"\n"; }

void add(ll &x, ll y){ x += y; if(x>=mod) x %= mod; if(x<0) x = x%mod + mod; }

//============== *** START OF CODE ***

int cnt[10000];


void solve()
{
    int n;rd(n);
    fo(i,1,100){
        fo(j,1,100){
            fo(k,1,100){
                int z = i*i+j*j+k*k+i*j+j*k+k*i;
                if(z<=n)cnt[z]++;
            }
        }
    }
    fo(i,1,n)pp(cnt[i]);
}


void prep(){}

//=============== *** END OF CODE ***

int main(){
    speedio; cout<<fixed<<setprecision(12);

// #ifndef ONLINE_JUDGE
//     freopen("input.txt", "r", stdin);
//     freopen("output.txt", "w", stdout);
// #endif

    prep();
    int t = 1;
    // cin >> t;
    while(t--)
        solve();

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

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

using namespace std;
const int INF=1000000007;

int N;
int a[123];

int main(){

cin>>N; 

int Min=INF;

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

for(int i=-100; i<=100; i++){
    int ans=0;
    for(int j=0; j<N; j++){
        ans+=(i-a[j])*(i-a[j]);
    }
    Min=min(Min,ans);
}

cout<<Min<<endl;

return 0;
 
}

Measured memory_bytes: 256
import math
def combination(n,r):
    if r<n:
        o=math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    else:
        o=1 if r==n else 0
    return o

N=int(input())
A=list(map(int,input().split()))
l=[0]*N
m=[0]*N
s=0
for i in A:l[i-1]+=1
for i in range(N):
    c=combination(l[i],2)
    s+=c
    m[i]=c-combination(l[i]-1,2)
for i in A:print(s-m[i-1])

Measured memory_bytes: 32240
package main

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

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() []int {
	n := readInt()
	return readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func minInt(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func minUint(a, b uint) uint {
	if a < b {
		return a
	}
	return b
}

func minInt64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func minUint64(a, b uint64) uint64 {
	if a < b {
		return a
	}
	return b
}

func maxInt(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func maxUint(a, b uint) uint {
	if a < b {
		return b
	}
	return a
}
func maxInt64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func maxUint64(a, b uint64) uint64 {
	if a < b {
		return b
	}
	return a
}

func absInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absInt64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int
func main() {
	defer stdout.Flush()
	n := readInt()

	ans := 1
	for i := 1; i <= n; i++ {
		ans = ans * i % 1000000007
	}
	println(ans)
}


Measured memory_bytes: 640
N, A, B = map(int, input().split())
grand_sum = 0

for num in range(1, N+1):
    sum = 0
    num_copy = num
    while True:
        if num_copy==0:
            break
        sum += num_copy % 10
        num_copy = (num_copy - num_copy % 10) // 10
    
    if sum >= A and sum <= B:
        grand_sum += num

print(grand_sum)

Measured memory_bytes: 2940
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<functional>
#include<queue>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
typedef long long int ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<signed(n);i++)
#define EREP(i,n) for(int i=1;i<=signed(n);i++)
#define ALL(a) (a).begin(),(a).end()
using namespace std;
//#define EVEL 1
#ifdef EVEL
#define DEB(X) cout << #X <<":" <<X<<" " ;
#define TF(f) f ? cout<<"true  " : cout<<"false ";
#define END cout<<"\n";
#else
#define DEB(X) {}
#define TF(f) {}
#define END {}
#endif
const ll MOD = 1000000007;
const ll INF = 9e14;
typedef std::pair<ll,ll> P;
struct edge{ int to,cost; };
#define VMAX 100000

ll N,M,X,K,Q;
ll A,B,C,D;
string S;
ll ans;
int main(){
    cin>>S;


    cout<<(S=="ARC"?"ABC":"ARC")<<endl;
}


Measured memory_bytes: 3636
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<time.h>
#include<tuple>
#include<set>
#include<map>
#include<cctype>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define vint vector<int> 
#define vvint vector<vint>
#define ct(a) cout<<a<<endl
#define tget(a,b) get<a>(b)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;
const int MOD = 1e9 + 7;
string a;
int main(void) {
	cin >> a;
	a[5] = ' '; a[13] = ' ';
	ct(a);
	return 0;
}

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

signed main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    //freopen("input.txt", "r", stdin);
    int n,x,t; cin>>n>>x>>t;
    int y=n/x;
    if(n%x) y++;
    cout<<t*y<<endl;


    
}

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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define fst first
#define snd second
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define EPS (1e-9)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

bool LT(double a,double b) { return !equals(a,b) && a < b; }
bool LTE(double a,double b) { return equals(a,b) || a < b; }

const string YES = "";
const string NO  = "";

typedef long long ll;

void solve() {

}

int main() {
  string s;
  cin >> s;
  map<char,int> mp;
  rep(i,(int)s.size()) {
    ++mp[s[i]];
  }
  if( mp.size() != 2 ) {
    puts("No");
    return 0;
  } else {
    vector<int> vec;
    for(auto v : mp) {
      vec.pb(v.snd);
    }
    if( vec.size() == 2 && vec[0] == 2 && vec[1] == 2 ) {
      puts("Yes");
      return 0;
    }
  }

  return 0;
}


Measured memory_bytes: 256