akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#define int long long
#define endl '\n'
#define INF 1000000000000000000
#define EPS 1e-10
#define PI 3.141592653589793238
#define all(a) a.begin(),a.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define double long double
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<P, ll> PP;
typedef complex<double> com;
template<class T, class S> bool chmax(T &a, const S &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class S> bool chmin(T &a, const S &b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); }
ll lcm(ll n, ll m) { return n / gcd(n, m)*m; }


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

	string s;
	cin >> s;
	int n = s.size();
	int ans = 0;
	rep(i, (1 << (n - 1))) {
		int idx = 0;
		rep(j, n - 1) {
			if ((i >> j) & 1) {
				string t = s.substr(idx, j - idx + 1);
				ans += stoll(t);
				idx = j + 1;
			}
		}
		string t = s.substr(idx);
		ans += stoll(t);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
open System
// 標準入力からスペース、タブ区切りでトークン列を読み込む
let stdinTokens = seq {
    while true do
        let line =  Console.ReadLine() 
        let tokens = line.Split([|' '; '\t'|], StringSplitOptions.RemoveEmptyEntries)
        yield! tokens
}
let readn n = stdinTokens |> Seq.take n |> List.ofSeq
let readInts n = readn n |> List.map int
let readInt () = readInts 1 |> List.head
let N = readInt()
let r1 = readInts N
let r2 = readInts N
let sum n = (r1 |> List.take n |> List.sum) + (r2 |> List.skip (n-1) |> List.sum)
seq{1..N} |> Seq.map sum |> Seq.max |> printfn "%d"

Measured memory_bytes: 14300
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define reps(i,s,n) for(int i=s, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
const char sp = ' ';


using namespace std;

int main(void){
    string S;
    cin>>S;
    ll su[300000], di[300000];
    su[0]=S[S.size()-1]-'0';
    di[0]=1;
    rep1(i, S.size()-1){
        di[i]=(di[i-1]*10)%2019;
        ll th=S.size()-1-i;
        su[i]=(su[i-1]+(S[th]-'0')*di[i])%2019;
    }
    ll cosu[2019];
    MEMSET(cosu, 0);
    rep(i, S.size()){
        cosu[su[i]]++;
    }
    ll count=cosu[0];
    rep(i, 2019){
        //cout<<cosu[i]<<endl;
        count+=cosu[i]*(cosu[i]-1)/2;
    }
    cout<<count<<endl;
    return 0;
}


Measured memory_bytes: 6908
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<n; i++)
#define rep1(i, n) for(int i=1; i<=n; i++)
#define rrep(i, n) for(int i=n-1; i>=0; i--)
#define rrep1(i, n) for(int i=n; i>=1; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
    string s;
    cin >> s;
    bool ok = true;
    if (s == "AAA" || s == "BBB") ok = false;
    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void) {
    int a, b, c;
    
    scanf("%d %d %d", &a, &b, &c);
    
    if(a < b && b < c) {
        printf("Yes\n");
    }
    
    else {
        printf("No\n");
    }
    
    return 0;
}


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

#include <algorithm>
using namespace std;
struct Fast {
    Fast() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} fast;

long long mod = 1000000007;

long long modpow(long long m, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2);
        return (t * t) % mod;
    } else {
        return (modpow(m, n - 1) * m) % mod;
    }
}

void yes() {
    cout << "Yes" << endl;
    exit(0);
}
void no() {
    cout << "No" << endl;
    exit(0);
}
#define REP(i, n) for (long long i = 0; i < (n); i++)

struct UnionFind {
    vector<int> parent, size;

    UnionFind(int n) {
        parent.resize(n, -1);
        size.resize(n, 1);
    }
    void unite(int x, int y) {
        if (same(x, y)) {
            return;
        }
        x = root(x);
        y = root(y);
        if (size[x] <= size[y]) {
            swap(x, y);
        }
        parent[y] = x;
        size[x] += size[y];
    }
    bool same(int x, int y) { return (root(x) == root(y)); }
    int root(int x) {
        while (parent[x] != -1) {
            x = parent[x];
        }
        return x;
    }
    int getsize(int x) { return size[root(x)]; }
};

long long n;
vector<vector<long long>> fs;
vector<vector<long long>> bs;

signed main() {
    long long m, k;
    cin >> n >> m >> k;
    fs.resize(n);
    bs.resize(n);
    UnionFind uf(n);
    REP(i, m) {
        long long a, b;
        cin >> a >> b;
        a--;
        b--;
        fs[a].push_back(b);
        fs[b].push_back(a);
        uf.unite(a, b);
    }
    REP(i, k) {
        long long a, b;
        cin >> a >> b;
        a--;
        b--;
        bs[a].push_back(b);
        bs[b].push_back(a);
    }
    vector<int> bk(n);
    REP(i, n) {
        for (int j = 0; j < bs[i].size(); j++) {
            if (uf.same(i, bs[i][j])) {
                bk[i]++;
            }
        }
    }
    REP(i, n) { cout << uf.getsize(i) - fs[i].size() - bk[i] - 1 << " "; }
}

Measured memory_bytes: 14068
#include <bits/stdc++.h>
using namespace std;
//using Graph = vector<vector<edge>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

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

#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define query int qq;std::cin >> qq;rep(qqq,qq)
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
//#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvector(name,typ,m,n)vector<vector<typ> > name(m,vector<typ> (n))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define res resize
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout << a<<" "<<b <<" "<< c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define ssum(a) accumulate(a,0ll) 

typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
//typedef long long T;
ll ceil(ll a,ll b){
    return ((a+b-1)/b);
}
const int INF = 1000000000;
const ll INF64 = 9223372036854775807ll;
const ll MOD = 1000000007ll;
const dou pi=3.141592653589793;
//mapは、if関数などで覗いただけで構成されるので注意しよう！
itn main(){
    string s;
    std::cin >> s;
    if(s[0]==s[2])std::cout << Yes << std::endl;
    else std::cout << No << std::endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
  ll a;
  cin>>a;
  if(a>=3200){
    string b;
    cin>>b;
    cout<<b<<endl;
    return 0;
  }
  cout<<"red"<<endl;
  return 0;
}
    
  


Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

ll n, p[20008], a[20008], b[20008], aa[20008], bb[20008];
string s;

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	cin >> n;
	rep(i, 1, n){
		cin >> p[i];
		a[i] = i;
		b[i] = n-i+1;
	}
	
	memset(aa, 0, sizeof(aa));
	memset(bb, 0, sizeof(bb));
	rep(i, 1, n){
		aa[p[i]+1] = n-i;
		bb[p[i]-1] = n-i;
	}
	
	rep(i, 2, n){aa[i] += aa[i-1];}
	rrep(i, n-1, 1){bb[i] += bb[i+1];}
	rep(i, 1, n){cout << a[i]+aa[i] << " ";}
	cout << endl;
	rep(i, 1, n){cout << b[i]+bb[i] << " ";}
	cout << endl;
	return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
ll n, p[100001];

int main() {
	cin >> n;
	for(ll i = 1; i <= n; i++){cin >> p[i];}
	
	bool flag = false;
	ll ans = 0;
	for(ll i = 1; i <= n; i++){
		if(!flag){
			if(i == p[i]){flag = true;}
		}
		else{
			flag = false;
			ans++;
		}
	}
	if(flag){ans++;}
	
	cout <<ans;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ll long long int
#define mk make_pair
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define mod 1000000007
using namespace std;

void fast(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
}

int main(){
    fast();
    ll t=1;
//    cin>>t;
    while(t--){
    	ll l,r,d,ans=0;
    	cin>>l>>r>>d;
    	while(l<=r){
    		if(l%d==0)
    		++ans;
    		l++;
		}
		cout<<ans;
	}
}

Measured memory_bytes: 3608
#input
N = int(input())
a = [0] * N
b = [0] * N
c = [0] * N
for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())

#output
import numpy as np
d = np.array((a, b, c))

dp = np.zeros((3, N), int)
dp[:, 0] = d[:, 0]

for i in range(N-1):
    dp[0, i+1] = d[0, i+1] + max(dp[1, i], dp[2, i])
    dp[1, i+1] = d[1, i+1] + max(dp[2, i], dp[0, i])
    dp[2, i+1] = d[2, i+1] + max(dp[0, i], dp[1, i])

print(max(dp[:, -1]))

Measured memory_bytes: 30688
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
using namespace std;
int main()
{
    ll n;
    cin>>n;
    ll h[n];
    for(int i=0;i<n;i++)cin>>h[i];
    ll dp[n];
    memset(dp,0,n);
    dp[0]=0;
    dp[1]=abs(h[0]-h[1]);
    for(int i=2;i<n;i++){
        dp[i]=min(dp[i-2]+abs(h[i]-h[i-2]),dp[i-1]+abs(h[i]-h[i-1]));
    }
    cout<<dp[n-1];
    return 0;
}


Measured memory_bytes: 1792
n = int(input())
a = [8]; b = [1]; c = [1]; d = [0]; m = 10**9+7
for _ in range(n-1):
    d.append((b[-1]+c[-1]+d[-1]*10)%m)
    c.append((a[-1]+c[-1]*9)%m)
    b.append((a[-1]+b[-1]*9)%m)
    a.append(a[-1]*8%m)
print(d[-1])

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

int main(){
    int n,k;
    cin >> n >> k;
    bool isp = true;
    if(k>(n-1)*(n-2)/2) isp = false;
    int cnt = (n-1)*(n-2)/2;
    int x = n-1 + (cnt-k);
    if(isp){
        cout << x << endl;
        for(int i = 2;i <= n;i ++){
            cout << 1 << " " << i << endl;
        }
        for(int i = 2;i <= n && cnt>k;i ++){
            for(int j = i+1;j <= n && cnt>k;j ++){
                cout << i << " " << j << endl;
                cnt --;
            }
        }
    }else cout << "-1" << endl;
    return 0;
}

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

int main(){
  int N,i;
  cin>>N;
  long long a[N+2];
  for(i=1;i<=N;i++){
	cin>>a[i];
  }
  a[0]=0;
  a[N+1]=0;
  long long dis=0;
  for(i=1;i<=N+1;i++) {
	dis+=abs(a[i]-a[i-1]);
  }
  for(i=0;i<N;i++) {
	if((a[i+2]-a[i+1])*(a[i+1]-a[i])<0) {
		cout<<dis-2*min(abs(a[i+1]-a[i]),abs(a[i+2]-a[i+1]))<<endl;
	}
	else cout<<dis<<endl;
  }
  return 0;
} 

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

int main()
{
    map<string, int> dict;

    int n, num_max = 0;
    cin >> n;

    for (string x; n--; dict[x]++)
    {
        cin >> x;
    }

    for (auto i = dict.begin(); i != dict.end(); i++)
    {
        // cout << i->first << i->second << endl;
        if (num_max < i->second)
        {
            num_max = i->second;
        }
    }

    for (auto i = dict.begin(); i != dict.end(); i++)
    {
        if (num_max == i->second)
        {
            cout << i->first << endl;
        }
    }
}

Measured memory_bytes: 25216
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

K = INT()
A = LIST()
if A[-1] != 2:
	print(-1)
	exit()

ma = 3
mi = 2

for x in A[::-1]:
	if x > ma:
		print(-1)
		exit()
	elif mi <= x <= ma:
		mi = x
		ma = 2*x-1
	else:
		tmp_mi = -(-mi//x)*x
		tmp_ma = ma//x*x
		if tmp_mi > tmp_ma:
			print(-1)
			exit()
		ma = tmp_ma+x-1
		mi = tmp_mi

print(mi, ma)


Measured memory_bytes: 16324
main = sol . words <$> getContents >>= putStrLn

sol [a,b,c] = f 'a' a b c

f 'a' [] _ _ = "A"
f 'b' _ [] _ = "B"
f 'c' _ _ [] = "C"
f 'a' (x:a) b c =  f x a b c
f 'b' a (x:b) c =  f x a b c
f 'c' a b (x:c) =  f x a b c

Measured memory_bytes: 508
#include <bits/stdc++.h>
using namespace std;
#define COUT(x) cout<<(x)<<"\n"
#define REP(i,n) for(int i=0;i<n;i++)

int a,b;
const int h=100,w=100;
char g[h][w];

int main() {
  cin >> a >> b;
  a--; b--;

  REP(i,h) REP(j,w) g[i][j] = i<h/2 ? '#' : '.';

  int swaped = 0;
  for (int i = 0; i < h; i+=2) {
    if (h/2 < i && !swaped) {
      swap(a,b);
      swaped = 1;
    }
    for (int j = 0; j < w; j+=2) {
      if (a==0) break;
      g[i][j] = g[i][j] == '.' ? '#' : '.';
      a--;
    }
  }

  cout << h << " " << w << endl;
  REP(i,h) REP(j,w) {
    cout << g[i][j];
    j == w-1 && cout << endl;
  }
  return 0;
}

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

// syntax sugar: `for (int i = 0; i < N; ++i)`
#define rep(i, N) for (int i = 0; i < (int)(N); ++i)
#define rep2(i, startValue, N) for (int i = (int)(startValue); i < (int)(N); ++i)
// syntax sugar: `for (int i = 0; i < N; ++i)`
#define REP(type, name, beginValue, endCondValue) \
  for (type name = beginValue; name < endCondValue; ++name)
// syntax sugar: 多次元vector
#define VECTOR_DIM3(T, name, d1, d2, d3, initValue) \
    std::vector<std::vector<std::vector<T>>> name(d1, std::vector<std::vector<T>>(d2, std::vector<int>(d3, initValue)));
#define VECTOR_DIM2(T, name, d1, d2, initValue) \
    std::vector<std::vector<T>> name(d1, std::vector<T>(d2, initValue));
#define VECTOR_DIM1(T, name, d1, initValue) \
    std::vector<T> name(d1, initValue);
#define ll long long
#define ld long double


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

  int total = 0;
  deque<int> distances;
  deque<pair<int,int>> lakes; // d, area
  rep(i,s.length()) {
    const char& c = s[i];
    if (c == '\\') {
      distances.push_back(i);
    } else if (c == '/') {
      if (distances.empty()) {
        continue;
      }
      const int d = distances.back();
      distances.pop_back();
      total += i - d;
      int area = i - d;
      while(lakes.size() > 0 && lakes.back().first > d) {
        area += lakes.back().second;
        lakes.pop_back();
      }
      lakes.emplace_back(d, area);
    } else if (c == '_') {
      // noop
    }
  }

  cout << total << endl;
  cout << lakes.size();
  for(const auto& p: lakes) {
    cout << " ";
    cout << p.second;
  }
  cout << endl;

  return 0;
}



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

// マクロ //
#define rep(v,times) for(int v = 0; v < (int)(times); v++)
#define req(v,first,endplus1) for(int v = first; v < (int)(endplus1); v++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define uniq(x) x.erase(unique(all(x)), x.end())
#define vsum(x) accumulate(all(x), 0)
#define cou(x) cout << x << endl
#define y() cout << "Yes" << endl
#define n() cout << "No" << endl
#define Y() cout << "YES" << endl
#define N() cout << "NO" << endl
#define x2(x) (x) * (x)

// 型エイリアス //
using lint = long long;
using pii = pair<int, int>;
using vpii = vector<pii>;
using plili = pair<lint, lint>;
using vplili = vector<plili>;
using vi = vector<int>;
using vli = vector<lint>;
using vc = vector<char>;
using vs = vector<string>;
using vb = vector<bool>;
using vvi = vector<vi>;
using vvli = vector<vli>;
using vvb = vector<vb>;
using vvc = vector<vc>;
using vvs = vector<vs>;
using mii = map<int, int>;
using mili = map<int, lint>;
using mci = map<char, int>;
using mcli = map<char, lint>;
using msi = map<string, int>;
using msli = map<string, lint>;


// 関数 //
template<class T, class Q> lint gcd_(T a, Q b) {
    int t;
    while (b != 0) {
        t = a % b;
        a = b;
        b = t;
    }
    return a;
}

template<class T, class Q> lint lcm_(T a, Q b) {
    return a * b / gcd_(a, b);
}

template<class T, class Q> double distance(T a, Q b) {
    double dist;
    dist = sqrt(x2(a.first - b.first) + x2(a.second - b.second));
    return dist;
}

lint perm(int a) {
    lint perm = 1;
    for (int i = a; i >= 1; i--) {
        perm *= i;
    }
    return perm;
}

lint combination(int n, int m) {
    long double c = 1;
    for (int i = n, k = 1; i > m; i--, k++) {
        c *= i;
        c /= k;
    }
    return (lint)c;
}

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

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

// 定数 //
const double pi = acos(-1);
const int mod = 1000000007;
const int inf = 1045141919;
const lint linf = ((1LL << 62) - 1);
const int dx4[4] = { 1,0,-1,0 };
const int dy4[4] = { 0,1,0,-1 };
const int dx8[8] = { 1,1,0,-1,-1,-1,0,1 };
const int dy8[8] = { 0,1,1,1,0,-1,-1,-1 };

// End of Template //



int main() {

    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
        
    int N, M;
    cin >> N >>M;
    cou(N * M);



}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define endl "\n"
    #define ll long long int
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define f first
    #define s second
    
    using namespace std;
    int main()
    {
        std::ios::sync_with_stdio(false);
        ll arr[1000000],N,flag=0;
        cin>>N;
        for (ll i = 0; i < N; ++i)
            cin>>arr[i];

        

        for (int i = 0; i < N; ++i)
        {
            if(arr[i]%2==0)
            {
                if(arr[i]%3==0 or arr[i]%5 ==0)
                    continue;
                else
                {
                    flag=1;
                    break;
                }
            }
        }
        if(flag)
            cout<<"DENIED";
        else 
            cout<<"APPROVED";
      
        return 0;
    }


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long n,a,c[1<<17],MOD=1e9+7,ans=1,i;
int main(void){
	cin>>n;
	c[0]=3;
	for(i=0;i<n;i++){
		cin>>a;
		ans=ans*c[a]%MOD;
		c[a]--;
		c[a+1]++;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <cstring>

int main(void)
{
    int n;
    int num[5001];
    int sum;
    int max;
    
    while (scanf("%d", &n)){
        if (n == 0) break;
        
        memset(num, 0, 5001);
        for (int i = 0; i < n; i++){
            scanf("%d", &num[i]);
        }
        max = num[0];
        
        for (int i = 0; i < n; i++){
            sum = 0;
            for (int j = i; j < n; j++){
                sum += num[j];
                if (max < sum) max = sum;
            }
        }
        
        printf("%d\n", max);
    }
}

Measured memory_bytes: 0
#include<stdio.h>
int main(){
	int n,i,j,k,c=0,x=0;
	int a[1001]={0};
	scanf("%d",&n);
	for(i=1;i<=n;i++)scanf("%d",&a[i]);
	for(i=1;i<=n;i++){
		for(k=1;k<=n;k++){
			printf("%d",a[k]);
			if(k!=n)printf(" ");
		}
		printf("\n");
		j=i+1;
		if(a[i]>a[j]){
			while(a[i]>a[j] && i!=0){
				x=0;
				x=a[i];
				a[i]=a[j];
				a[j]=x;
				i--;
				j--;
				c++;
			}
		}
		i=i+c;
		c=0;
	}
	return 0;
}


Measured memory_bytes: 1992
import sys
input = sys.stdin.readline
S = int(input())
li = [S]
count = 0
while True:
    count += 1
    if S%2 == 0:
        S //=2
    else:
        S = 3*S + 1

    if S in li:
        print(count+1)
        break
    else:
        li.append(S)

Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define countof(array) (sizeof(array) / sizeof(array[0]))
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rep2(i,n) for(int i = 1; i <= (n); ++i)
#define rrep2(i,n) for(int i = (n); i > 0; --i)
#define srep(i,s,n) for(int i = s; i < (n); ++i)
#define rsrep(i,s,n) for(int i = (n)-1; i >= s; --i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define aall(a) (a), (a)+countof(a)//for array sorting
#define raall(a) (a), (a)+countof(a), greater<>()
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define vfind(v, a) find(all(v), a) != v.end()
#define yn(f) { if (f) puts("YES"); else puts("NO"); }
#define yns(f) { if (f) puts("Yes"); else puts("No"); }
#define show_ary(...) { cout<<#__VA_ARGS__<<" = "; for (const auto& x : (__VA_ARGS__)) { cout<<x<<" "; } cout<<endl; }
#define show_pair(...) cout<<#__VA_ARGS__<<" = "<<endl; for (const auto& x : (__VA_ARGS__)) { cout<<"  "<<x.fi<<" : "<<x.se<<endl; }
#define out_ary(...) { int n = (__VA_ARGS__).size(); rep(i, n) printf("%d%s", (__VA_ARGS__)[i], i != n-1 ? " " : "\n"); }
#define argmax(v) distance((v).begin(), max_element(all(v)))
#define argmin(v) distance((v).begin(), min_element(all(v)))
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<P> vpair;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<string> vstr;
typedef vector<bool> vbool;
typedef vector<vint> vvint;
typedef vector<vll> vvll;
typedef vector<vstr> vvstr;
typedef vector<vbool> vvbool;
const ll LINF = 2000000000000000000ll;
const int INF = 1000000100;
const ll MOD = 1e9+7;


int main() {
    int x;
    cin >> x;

    int ans = x/500*1000;
    x %= 500;
    ans += x/5*5;

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

Measured memory_bytes: 256
import collections


def solve(N, M, ABs):
    nextrooms = []
    for _ in range(N):
        nextrooms.append(-1)

    ways = {}
    for a, b in ABs:
        ways.setdefault(a - 1, []).append(b - 1)
        ways.setdefault(b - 1, []).append(a - 1)

    queue = collections.deque()
    queue.append(0)
    while queue:
        room = queue.popleft()
        for nextroom in ways[room]:
            if nextrooms[nextroom] == -1:
                nextrooms[nextroom] = room + 1
                queue.append(nextroom)

    nextrooms[0] = "Yes"
    return "\n".join(str(r) for r in nextrooms)


if __name__ == "__main__":
    N, M = tuple(map(int, input().split(" ")))
    ABs = [tuple(map(int, input().split(" "))) for _ in range(M)]
    print(solve(N, M, ABs))


Measured memory_bytes: 78252
/*ヽ｀、ヽ｀｀、ヽ｀ヽ｀、、ヽ ｀ヽ 、ヽ｀🌙｀ヽヽ｀ヽ、ヽ｀
ヽ｀、ヽ｀｀、ヽ 、｀｀、 ｀、ヽ｀ 、｀ ヽ｀ヽ、ヽ ｀、ヽ｀｀、
ヽ、｀｀、｀、ヽ｀｀、 、ヽヽ｀、｀、、ヽヽ、｀｀、 、 ヽ｀、
ヽ｀｀、 ヽ｀ヽ｀、、ヽ ｀ヽ 、 🚶ヽ｀｀｀｀ヽヽヽ｀、、ヽ｀、、ヽ*/
#include <bits/stdc++.h> 
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long   ll;
typedef long double ld;
typedef complex< ld > cd;
 
typedef pair<int, int> pi;
typedef pair<ll, ll>   pl;
typedef pair<ld, ld>   pd;
 
typedef vector< int > vi;
typedef vector< ld >  vd;
typedef vector< ll >  vl;
typedef vector< pi >  vpi;
typedef vector< pl >  vpl;
typedef vector< cd >  vcd;
 
#define l00p(i, a, b) for (int i=a; i<(b); i++)
#define loop(i, a)    for (int i=0; i<(a); i++)
#define rep1(i, a, b) for (int i = (b)-1; i >= a; i--)
#define rep(i, a)     for (int i = (a)-1; i >= 0; i--)
#define trav(a, x)    for (auto& a : x)
#define uid(a, b)     uniform_int_distribution<int>(a, b)(rng)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f  first
#define s  second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
//#define MOD 998244353
 
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ld pii=3.14159265359; 
const int MOD = 1000000007;
const char nl = '\n';
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
vi a;
vi dp(MX);
void SieveOfEratosthenes(int n) 
{ 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        {
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          a.pb(p); 
} 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); 
	int n;
	SieveOfEratosthenes(n+100000);
	cin>>n;
	int val=a[lb(all(a),n)-a.begin()];
	cout<<val;
	return 0;
}
// read the question correctly (ll vs int)
// template by bqi343

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

int main(){
	string s;
  	cin >> s;
  	
  	int res = 0;
	rep(i, s.size()){      	
    	res += s[i]-48;
    }
  
  	if(res % 9 == 0) cout << "Yes" << endl;
  	else cout << "No" << endl;
}

Measured memory_bytes: 3704
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    int mx=0, mx2=0;
    for(int i=0;i<n;i++){
        cin >> a[i];
        if(a[i] > mx){
            mx2 = mx;
            mx = a[i];
        }else if(a[i] > mx2){
            mx2 = a[i];
        }
    }
    for(int i=0;i<n;i++){
        cout << (mx != a[i]?mx:mx2) << endl;
    }
}

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

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


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


int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    string s; cin >> s;
    if(s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys
sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(R, C, K, RCV):
    V = [[0] * C for _ in range(R)]
    for r, c, v in RCV:
        V[r-1][c-1] = v
    memo = [[[0] * (C+1) for _ in range(R+1)] for __ in range(4)]

    for i in range(R):
        for j in range(C):
            for p in range(4):
                memo[p][i][j+1] = max(memo[p][i][j+1], memo[p][i][j])
                memo[0][i+1][j] = max(memo[0][i+1][j], memo[p][i][j])
                if p != 3:
                    memo[p+1][i][j+1] = max(memo[p+1][i][j+1], memo[p][i][j] + V[i][j])
                    memo[0][i+1][j] = max(memo[0][i+1][j], memo[p][i][j] + V[i][j])

    return max(memo[0][-1])


def main():
    R, C, K = read_int_n()
    RCV = [read_int_n() for _ in range(K)]
    print(slv(R, C, K, RCV))


if __name__ == '__main__':
    main()


Measured memory_bytes: 454636
import math
N = 0
arr = []
while True:
    N = int(input())
    if N==0:
        break
    arr = list(map(float,input().split()))
    m = 0
    for i in range(len(arr)):
        m += arr[i]
    m /= N
    
    a2 = 0
    for i in range(len(arr)):
        a2 += (arr[i]-m)**2
    a2 = a2/N
    a = math.sqrt(a2)
    print("%.4f"%a)


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

int main() {
  int A, B, C, D;
  int L, R;
  std::cin >> A >> B >> C >> D;
  
  L = A + B;
  R = C + D;
  
  if (L > R) {
    std::cout << "Left" << std::endl;
  } else if (L == R){
    std::cout << "Balanced" << std::endl; 
  } else {
    std::cout << "Right" << std::endl; 
  }
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
struct Fast {
    Fast() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} fast;

int main() {
    long a, b, k, ans = 0;
    string s, t;
    cin >> s >> t;
    cout << t + s << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cstring>
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
const long double EPS = 1e-9;
const ll mod = 1e9 + 7;
const ll INF = 1e9;
 
#define rep(i, n) for(ll i = 0; i < n ; i++ )
#define For(i, a, b) for(ll i = (a); i < (b) ; i++ )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
 
const ll MAX_N = 100000;
 
int main(void){
    ll a,b,c,d;
    string s,t;
 
    cin >> a >> b;//>> c >> d;
    //cin >> s >> t;

    if (a == 4 && b == 6) cout << "Yes";
    else if (a == 4 && b == 9) cout << "Yes";
    else if (a == 4 && b == 11) cout << "Yes";
    else if (a == 6 && b == 9) cout << "Yes";
    else if (a == 6 && b == 11) cout << "Yes";
    else if (a == 9 && b == 11) cout << "Yes";
    else if (a == 1 && b == 3) cout << "Yes";
    else if (a == 1 && b == 5) cout << "Yes";
    else if (a == 1 && b == 7) cout << "Yes";
    else if (a == 1 && b == 8) cout << "Yes";
    else if (a == 1 && b == 10) cout << "Yes";
    else if (a == 1 && b == 12) cout << "Yes";
    else if (a == 3 && b == 5) cout << "Yes";
    else if (a == 3 && b == 7) cout << "Yes";
    else if (a == 3 && b == 8) cout << "Yes";
    else if (a == 3 && b == 10) cout << "Yes";
    else if (a == 3 && b == 12) cout << "Yes";
    else if (a == 5 && b == 7) cout << "Yes";
    else if (a == 5 && b == 8) cout << "Yes";
    else if (a == 5 && b == 10) cout << "Yes";
    else if (a == 5 && b == 12) cout << "Yes";
    else if (a == 7 && b == 8) cout << "Yes";
    else if (a == 7 && b == 10) cout << "Yes";
    else if (a == 7 && b == 12) cout << "Yes";
    else if (a == 8 && b == 10) cout << "Yes";
    else if (a == 8 && b == 12) cout << "Yes";
    else if (a == 10 && b == 12) cout << "Yes";
    else cout << "No";

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main () {
  int N,sum=0;
  cin>>N;
  vector<int> a(N);
  for(int i=0;i<N;i++){
    cin>>a[i];
  }
  sort(a.begin(),a.end());
  a[N-1]=a[N-1]/2;
  for(int i=0;i<N;i++){
    sum=sum+a[i];
  }
  cout<<sum<<endl;
}

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

#define MAXN 100010

using namespace std;

vector<int> g[MAXN];
int vis[MAXN], d[MAXN], in_degree[MAXN];

void DFS(int u) {
    vis[u] = 1;
    for (auto v : g[u]) {
        d[v] = max(d[v], d[u] + 1);
        --in_degree[v];
        if (in_degree[v] == 0) DFS(v);
    }
}

int main(void) {
    int n, m;

    cin >> n >> m;

    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
        in_degree[v]++;
    }

    for (int i = 1; i <= n; i++) {
        if (!vis[i] && in_degree[i] == 0) {
            DFS(i);
        }
    }

    int ans = 0;
    for (int i = 1; i <= n; i++) {
        ans = max(ans, d[i]);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 9984
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <map>
#include <cmath>
#include <string>
using namespace std;

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

int main() {
  ll n;
  cin >> n;
  ll pos = 1;
  ll count = 0;
  rep (i, n) {
    int a;
    cin >> a;
    if (a == pos) { 
         pos++;
    }
    else {
        /* code */
        count++;
    }
  }

//   if (pos == 0) {
//       cout << -1 << endl;
//       return -1;
//   }
  cout << (count == n ? -1 : count) << endl;
  return 0;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define ins insert

#define debug(a) cerr<<(a)<<endl
#define dbrep(a,n) rep(_i,n) cerr<<(a[_i])<<" "; cerr<<endl
#define dbrep2(a,n,m) rep(_i,n){rep(_j,m) cerr<<(a[_i][_j])<<" "; cerr<<endl;}

using namespace std;

template<class A, class B>
ostream &operator<<(ostream &os, const pair<A,B> &p){return os<<"("<<p.fi<<","<<p.se<<")";}
template<class A, class B>
istream &operator>>(istream &is, pair<A,B> &p){return is>>p.fi>>p.se;}

/* Some Libraries */

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin>>N;
    vi a(N),A(N+1),B(N+1),D(N+1);
    rep(i,N){
        cin>>a[i];
        A[a[i]]++; D[a[i]]++;
    }
    rep(i,N){
        int b; cin>>b;
        B[b]++; D[b]++;
    }

    if (*max_element(all(D))>N){
        cout<<"No\n";
        return 0;
    }
    cout<<"Yes\n";

    auto solve = [&](vector<pi> &vp){
        int V = vp.size();
        vi next(N+1,-1);
        rep(i,V){
            next[vp[i].se] = vp[(i+1)%V].se;
        }

        vector<queue<int> > ans(N+1);
        int cur=vp[0].se;
        rep(i,V){
            int t = vp[i].se;
            if (cur == t){
                cur = next[cur];
            }
            int cnt=B[t];
            while(cnt>0){
                if (cur == t) return;
                while(A[cur]>0 && cnt>0){
                    A[cur]--; cnt--;
                    ans[cur].push(t);
                }
                if (cnt==0) break;
                cur = next[cur];
            }
        }
        rep(i,N){
            if (i>0) cout<<" ";
            cout<<ans[a[i]].front();
            ans[a[i]].pop();
        }
        cout<<"\n";
        exit(0);
        return;
    };

    vector<pi> vec;
    rep(i,N+1)if(D[i]>0) vec.pb({D[i],i});
    sort(rall(vec));
    solve(vec);

    vec = vector<pi>();
    rep(i,N+1)if(D[i]>0) vec.pb({A[i],i});
    sort(rall(vec));
    solve(vec);

    vec = vector<pi>();
    rep(i,N+1)if(D[i]>0) vec.pb({B[i],i});
    sort(rall(vec));
    solve(vec);

    vec = vector<pi>();
    rep(i,N+1)if(D[i]>0) vec.pb({A[i]-B[i],i});
    sort(rall(vec));
    solve(vec);

    vec = vector<pi>();
    rep(i,N+1)if(D[i]>0) vec.pb({B[i]-A[i],i});
    sort(rall(vec));
    solve(vec);

    return 0;
}


Measured memory_bytes: 143400
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const int mod=1e9+7;
int main() {
string s;
cin>>s;
bool flag=false,check=true;
if(s.at(0)=='A'){
   for(int i=1;i<s.size();i++){
      if(1<i&&i<s.size()-1&&s.at(i)=='C'&&check){
         check=false;
         flag=true;
         continue;
      }
  if(s.at(i)<='Z'){
         flag=false;
         break;
      }
   }
}
if(flag)cout<<"AC"<<endl;
else cout<<"WA"<<endl;
}


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

int main(){
  long long int x, y, z, k;
  cin >> x >> y >> z >> k;
  vector<long long int> a(x), b(y), c(z), ans;
  rep(i, x, 0) cin >> a[i];
  rep(i, y, 0) cin >> b[i];
  rep(i, z, 0) cin >> c[i];
  
  sort(a.rbegin(), a.rend());
  sort(b.rbegin(), b.rend());  
  sort(c.rbegin(), c.rend());
  
  rep(p, x, 0){
    rep(q, y, 0){
      rep(r, z, 0){
        if((p+1)*(q+1)*(r+1) <= k) ans.push_back(a[p]+b[q]+c[r]);
        else break;
      }
    }
  }
  sort(ans.rbegin(), ans.rend());
  rep(i, k, 0) cout << ans[i] << endl;
}

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

int main() {
    char c;
    cin >> c;
    if(c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o'){
        cout << "vowel" << endl;
    }
    else{
        cout << "consonant" << endl;
        
    }
    return 0;
}

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

typedef long long ll;
using namespace std;

int gcd(int a, int b) { //最大公約数
  if (b==0) return a;
  else return gcd(b, a%b);
}

int lcm(int a, int b) { //最小公倍数
  return a * b / gcd(a, b);
}


int main()
{
  ll n,a;
  cin>>n>>a;

  cout<<n*n-a<<endl;
  return 0;
}


Measured memory_bytes: 3620
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define LL long long

using namespace std;
int a[6]={100,101,102,103,104,105};
int dp[100001];
int main()
{
    int n;
    cin>>n;
    dp[0]=1;
    for(int i=0;i<=n;i++)
    {
        if(!dp[i])continue;
        for(int j=0;j<6;j++)
        {
            if(i+a[j]<=n)
            {
                dp[i+a[j]]=1;
            }
        }
    }
    printf("%d\n",dp[n]);
    
    return 0;
}



Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int n;
  long int a[1000010];
  int i;
  int j = 0;
  int ans = 1;
  long int sum = 0;
  cin >> n;
  for (i = 0;i < n;i++)
  {
    cin >> a[i];
    sum += a[i];
  }
  sort(a,a+n);
    sum -= a[n-1];
  for(i = n-2; i >= 0; i--)
  {
    //cout << sum << a[i+1] << endl;
    if(2*sum >= a[i+1])
    {
      ans++;
      sum -= a[i];
    }
    else break;
  }
  cout << ans << endl;
}


Measured memory_bytes: 2944
# include <iostream>
# include <vector>
# include <string>
# include <algorithm>
using namespace std;
int main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (max(a, max(b, c)) == a + b + c - max(a, max(b, c))) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <time.h>
#define INF 1000000009
#define LINF 1000000000000000009
#define all(a) a.begin(),a.end()
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
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; }
ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); }
ll lcm(ll n, ll m) { return n / gcd(n, m)*m; }

int main() {
	int n, k;
	cin >> n >> k;
	vector<ll> h(n);
	for (int i = 0; i < n; i++) cin >> h[i];
	ll ans = 0;
	sort(all(h));
	for (int i = 0; i < max(0, n - k); i++) ans += h[i];
	cout << ans << endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<math.h>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
typedef pair<int,int> pii;
const int N=100000;
const db pi=acos(-1.0);
#define lowbit(x) (x)&(-x)
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define go(u,i) for (register int i=head[u];i;i=sq[i].nxt)
#define fir first
#define sec second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define maxd 998244353
#define eps 1e-8
int n,a[120];

int read()
{
    int x=0,f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

int main()
{
	n=read();
	int mn=-100,mx=100;
	rep(i,1,n)
	{
		a[i]=read();
		mn=min(a[i],mn);mx=max(a[i],mx);
	}
	int ans=maxd;
	rep(i,mn,mx)
	{
		int now=0;
		rep(j,1,n) now+=sqr(a[j]-i);
		ans=min(now,ans);
	}
	printf("%d",ans);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int s[3][3];
int check()
{
    if(s[0][1] - s[0][0] != s[1][1] - s[1][0] || s[0][1] - s[0][0] != s[2][1] - s[2][0])return 0;
    if(s[0][2] - s[0][0] != s[1][2] - s[1][0] || s[0][2] - s[0][0] != s[2][2] - s[2][0])return 0;
    if(s[0][1] - s[0][2] != s[1][1] - s[1][2] || s[0][1] - s[0][2] != s[2][1] - s[2][2])return 0;
    if(s[0][0] - s[1][0] != s[0][1] - s[1][1] || s[0][0] - s[1][0] != s[0][2] - s[1][2])return 0;
    if(s[0][0] - s[2][0] != s[0][1] - s[2][1] || s[0][0] - s[2][0] != s[0][2] - s[2][2])return 0;
    if(s[2][0] - s[1][0] != s[2][1] - s[1][1] || s[2][0] - s[1][0] != s[2][2] - s[1][2])return 0;
    return 1;
}
int main()
{
    for(int i = 0;i < 3;i ++)
    {
        for(int j = 0;j < 3;j ++)
        {
            cin>>s[i][j];
        }
    }
    if(check())cout<<"Yes";
    else cout<<"No";
}


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

int main() {
    string s;
    cin >> s;
    int cnt = 0, k = s.size();
    for(char c : s){
        if (c == 'o') cnt++;
    }
    cnt += 15 - k;
    puts((cnt >= 8 ? "YES" : "NO"));
}

Measured memory_bytes: 3596
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		long k = sc.nextLong();
		if(k==0) {
			System.out.println(a + " " + b);
		return;
		}
		if(a >= k) {
			System.out.println(a-k + " " + b);
			return;
		}
		k -= a;
		if(b >= k) {
			System.out.println("0 " + (b-k));
		return;
		}
		System.out.println("0 0");
	}

}


Measured memory_bytes: 21844
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication51
{
    class Program
    {
        static void Main()
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());
            int d = int.Parse(Console.ReadLine());
            int e = int.Parse(Console.ReadLine());
            int X = a * e;
            int Y = b;
            if (e > c)
            {
                Y += (e - c) * d;
            }
            if (X< Y) Console.WriteLine(X);
            else Console.WriteLine(Y);
            
        }
    }
}

Measured memory_bytes: 9176
#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <stdlib.h>
long long N,W;

int 
main(){
	long long X,K;
	char st[100];

	scanf("%s",st);
	
	if(st[0] =='S')printf("Cloudy\n");
	else if(st[0]=='C')printf("Rainy\n");
	else printf("Sunny\n");

 return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll I,O,T,J,L,S,Z;
int main()
{
	scanf("%lld%lld%lld%lld%lld%lld%lld",&I,&O,&T,&J,&L,&S,&Z);
	ll ans=(I/2)*2+O+(J/2)*2+(L/2)*2;
	if((I&1)&&(J&1)&&(L&1))ans+=3;
	if((I&1)&&(J&1)&&(L>0&&!(L&1)))ans+=1;
	if((I&1)&&(J>0&&!(J&1))&&(L&1))ans+=1;
	if((I>0&&!(I&1))&&(J&1)&&(L&1))ans+=1;
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 384
#include <stdio.h>

int main () {

	int N, X, T;
	scanf("%d%d%d", &N, &X, &T);

  	int total_tako = 0;
    int total_time = 0;
	while(1) {      	
      	if(total_tako >= N) {
          break;
        }    
      	total_tako += X;
        total_time += T;
    }
  	printf("%d", total_time);
}

Measured memory_bytes: 1732