akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;
int SelectionSort(int A[], int N) {
	int i, j, t, sw = 0, minj;
	for (i = 0;i < N - 1;i++) {
		minj = i;
		for (j = i;j < N;j++) {
			if (A[j] < A[minj]) minj = j;
		}
		t = A[i];A[i] = A[minj];A[minj] = t;
		if (i != minj) sw++;
	}
	return sw;
}

int main() {
	int A[100], N, i, sw;

	cin >> N;
	for (i = 0;i < N;i++) {
		cin >> A[i];
	}
	sw = SelectionSort(A, N);

	for (i = 0; i < N; i++) {
		if (i > 0) cout<<" ";
		cout << A[i];
	}
	cout << endl;
	cout << sw << endl;

	return 0;
}


Measured memory_bytes: 3096
#include<iostream>
using namespace std;
int main()
{
	string s;
	cin>>s;
	if(s=="Sunny") cout<<"Cloudy"<<endl;
	else if(s == "Cloudy") cout<< "Rainy" <<endl;
	else if(s == "Rainy") cout<< "Sunny" <<endl; 
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;
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; }
const long double PI = acos(-1.0);
// cout << fixed << setprecision(14);
 
signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;
	map<int, int> mp;
	vector<int> A(N);
	rep(i,N){
		cin >> A[i];
		mp[A[i]]++;
	}
	sort(A.begin(), A.end());
	int ans = 0;
	vector<int> pow2(60);
	pow2[0] = 1;
	rep(i,59){
		pow2[i+1] = pow2[i] * 2;
	}
	for(int i=N-1;i>=0;i--){
		if(mp[A[i]] <= 0) continue;
		int W = *upper_bound(pow2.begin(), pow2.end(), A[i]) - A[i];
		if(W > A[i]) continue;
		if(mp[W] > 0){
			if(W == A[i]){
				int X = upper_bound(A.begin(), A.end(), A[i]) - lower_bound(A.begin(), A.end(), A[i]);
				i -= X-1;
				ans += mp[W]/2;
				mp[W] -= X/2*2;
			}
			else{
				mp[W]--;
				mp[A[i]]--;
				ans++;
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 29824
#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define pi 3.14159265358979323846264338327950L
using namespace std;

int main() {
  int64_t N, S=0;
  cin >> N;
  vector<int64_t> A(N+2);
  A[0]=0;
  for (int64_t i=1; i<=N; i++) {
    cin >> A[i];
  }
  A[N+1]=0;
  for (int64_t i=0; i<=N; i++) {
    S=S+abs(A[i]-A[i+1]);
  }
  for (int64_t i=1; i<=N; i++) {
    cout << S+abs(A[i-1]-A[i+1])-abs(A[i-1]-A[i])-abs(A[i]-A[i+1]) << endl;
  }
}

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

int main() {
  int N;
  cin>>N;
  vector<int> d(N);
  for(int i=0;i<N;i++)
    cin>>d[i];
  int answer=0;
  for(int i=0;i<N;i++){
    for(int j=i+1;j<N;j++)
      answer+=d[i]*d[j];
  }
  cout<<answer;
}

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

using namespace std;

#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pow(x) x*x
#define ll long long

static const ll MAX = 1000000;
static const ll INFTY = 1e12;
static const ll MOD = 1000000007;

template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };

struct edge {
    ll to, cost;
};

using Graph = vector<vector<int>>;
using _Graph = vector<vector<edge>>;


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

// 深さ優先探索
vector<bool> seen;
vector<int> colors;

int H, W, N;
int sx, sy, gx, gy; 
vector<vector<char>> field;
vector<vector<int>> dist;
//vector<pair<int, int>> gx, gy;
deque<pair<int, int>> que;

typedef vector<vector<int> > Matrix;

const ll INF = 1e18;


int main() {

    ll N;
    cin >> N;
    ll N_ = N;
    map<ll, ll> gcd;
    ll end_ = sqrt(N)+1;
    for(ll i = 2; i < end_; i++){
        while (N % i == 0){
            gcd[i]++;
            N /= i;
        }
    }
    if(N!=1)
    gcd[N]++;
    ll ans = 0;
    for(auto itr = gcd.begin(); itr != gcd.end(); itr++){
        ll n = 1;
        ll tmpans = 1;
        ll tmpn = n;
        
        // cout << itr->second <<"a"<< endl;
        while(1){
            n++;
            if((tmpn + n)>itr->second){
                break;
            }
            tmpans++;
            tmpn += n;
        }
        ans += tmpans;
        // cout << ans << endl;
    }
    // if(ans == 0){
    //     if(N_ == 1){
    //         cout << 0 << endl;
    //     }else{
    //         cout << 1 << endl;
    //     }
    // }else{
    //     cout << ans << endl;
    // }
    if(N_==1)cout << 0 << endl;
    else cout << ans << endl;


}

/*
みんな、くるくるぱーにな〜れ
　∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/



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


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

    int d, t, s;
    cin >> d >> t >> s;
    cout << (s * t >= d ? "Yes" : "No") << endl;

    return 0;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define re register
#define LL long long
#define SIZE 20
using namespace std;
int n;
LL a[SIZE][SIZE];
LL sum[1<<SIZE],dp[1<<SIZE];
int main()
{
	cin>>n;
	for(re int i=1;i<=n;++i)
		for(re int j=1;j<=n;++j)
			cin>>a[i][j];
	for(re int S=0;S<(1<<n);S++)
		for(re int i=1;i<=n;++i)
			if((S&(1<<(i-1)))!=0)
				for(re int j=1;j<=n;++j)
					if((S&(1<<(j-1)))!=0)				
						dp[S]+=a[i][j];
	for(re int S=0;S<(1<<n);++S)
		for(re int K=S;K;K=(K-1)&S)
			dp[S]=max(dp[S],dp[K]+dp[S^K]);
	cout<<dp[(1<<n)-1]/2<<endl;
	return 0;
} 

Measured memory_bytes: 768
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <string>
#include <math.h>
#include <cstdlib>
#include <istream>
#include <sstream>
#include <cctype>
using namespace std;
int main()
{
	int A1,A2,A3;
	vector<int> A;
	cin >> A1 >> A2 >> A3;

	A.push_back(abs(A2-A1)+abs(A3-A2));
	A.push_back(abs(A3-A1)+abs(A2-A3));
	A.push_back(abs(A1-A2)+abs(A3-A1));
	A.push_back(abs(A3-A2)+abs(A1-A3));
	A.push_back(abs(A1-A3)+abs(A2-A1));
	A.push_back(abs(A2-A3)+abs(A1-A2));
	sort(A.begin(),A.end());
	cout << A.front() << endl;

}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstdio>
#define int long long
using namespace std;
inline int read(){int tot=1;char c=getchar();while(c!='-'&&(c<'0'||c>'9'))c=getchar();if(c=='-')tot=-1,c=getchar();
int sum=0;while(c<='9'&&c>='0')sum=sum*10+c-'0',c=getchar();return sum*tot;}
void wr(int x){if(x<0){putchar('-');wr(-x);return;}if(x>=10)wr(x/10);putchar(x%10+'0');}
void wrn(int x){wr(x);putchar('\n');}
struct arr{
    int sum,id;
}a[200005];
bool cmp(arr a,arr b){
    if(a.sum==b.sum)return a.id<b.id;
    return a.sum>b.sum;
}
int ans[200005];
signed main()
{
    int n=read();
    for(int i=1;i<=n;i++)a[i].sum=read(),a[i].id=i;
    int f=1,s=2;
    sort(a+1,a+1+n,cmp);
    while(s<=n){
        while(a[s].sum==a[s-1].sum)s++;
        ans[a[f].id]+=(s-1)*(a[f].sum-a[s].sum);
        if(a[s].id<a[f].id)f=s;
        else a[f].sum=a[s].sum;
        s++;
    }
    ans[a[f].id]+=n*a[f].sum;
    for(int i=1;i<=n;i++)wrn(ans[i]);
}

Measured memory_bytes: 4352
#include <cstdio> 
#include <ctime> 
#include <cmath>   
#include <cstring>
#include <cstdlib>               //a = clock(); b = clock(); time = a - b;
#include <iostream>                                      
#include <map>                   //map<Type, Type>::iterator it;
#include <queue>                 //priority_queue< Type >Name
#include <stack>                 
#include <vector>                //.push_back()
#include <string>  
#include <algorithm>  
#define e 2.718281828459045      //底数
#define pi 3.141592653589793239  //high precision Π
#define swap(a, b) { int temp = a; a = b; b = temp; }
using namespace std;
typedef long long ll;            //>10^18
typedef long double ld;          //3.3621e-4932 ~ 1.18937e4932
typedef unsigned long long ull;  //>10^20
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 5;
const int INF = 0x3f3f3f3f;      
const int INFS = 0xc0c0c0c0;     //无穷小
const double eps = 1e-8;         //or 1e-10
//const double pi = acos(-1.0);
inline int read(){
    int sgn = 1, cnt = 0;        //sgn表示正负号 cnt表示读取的数字
    char ch = getchar();
    while(ch < '0' || ch > '9'){ //读取非数字的字符，保留负号，忽略其余无关符号
        if(ch == '-') sgn = -sgn;
        ch = getchar();
    }
    while('0' <= ch && ch <= '9'){
        cnt = cnt * 10 + (ch - '0');
        ch = getchar();
    }
    return sgn * cnt;
}
int main(int argc, char *argv[]){
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);//使用后无法用scanf, printf
	int a; cin >> a;
	cout << 1 - a; 
	return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll MOD=1e9+7;

vector<P> s;//iもしくはi/nの集合にいくつ属すか
ll dp[101][200000];//現在の要素がjに属するときのi番目までの並べ方
ll ruidp[200001];//dpの累積和
int main()
{
	ll n;
	int k;
	ll ans=0;
	cin>>n>>k;
	for(ll i=1;i*i<=n;i++)
	{
		s.push_back(P(i,0));
		s.push_back(P(n/i,0));//どのような要素が考えうるか記録
	}
	sort(s.begin(),s.end());
	s.erase(unique(s.begin(),s.end()),s.end());
	//それぞれの要素にいくつ数が含まれるか
	s[0].second=1;//1は1のみ
	for(int i=1;i<s.size();i++)
		s[i].second=s[i].first-s[i-1].first;
	// for(int i=0;i<s.size();i++)
	// 	cerr<<s[i].first<<" "<<s[i].second<<endl;
	//start dp
	fill(dp[0],dp[101],0);
	dp[0][0]=1;
	for(int i=0;i<k;i++)
	{
		//累積和を取る
		ruidp[0]=0;
		for(int j=0;j<s.size();j++)
		{
			ruidp[j+1]=ruidp[j]+dp[i][j];
			ruidp[j+1]%=MOD;
		}
		//cerr<<ruidp[s.size()]<<endl;
		for(int j=0;j<s.size();j++)
		{
			dp[i+1][j]=s[j].second*ruidp[(int)s.size()-j];
			dp[i+1][j]%=MOD;
		}
	}
	//end dp
	for(int i=0;i<s.size();i++)
	{
		ans+=dp[k][i];
		ans%=MOD;
	}
	if(ans<0)
		ans+=MOD;
	cout<<ans<<endl;
}

Measured memory_bytes: 159732
#include<cstdio>
#include<vector>
#include<cstring>
#include<algorithm>

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

using namespace std;

int len;
char s[101];

int idx;

int number(){
	int res=0;
	while(idx<len && (s[idx]=='0' || s[idx]=='1')){
		res=(res<<1)+(s[idx]-'0');
		idx++;
	}
	if(res<0 || 1024<=res) return -1;
	return res;
}

int expr(){
	vector<int> nums;
	vector<char> ops;
	while(1){
		if(s[idx]=='0' || s[idx]=='1'){
			int a=number();
			if(a==-1) return -1;
			nums.push_back(a);
		}
		else if(s[idx]=='('){
			// ( ) の中にはネストしてない演算子が必要
			bool ok=false;
			int dep=0;
			for(int i=idx+1;i<len;i++){
				if(dep<0) break;
				if     (s[i]=='(') dep++;
				else if(s[i]==')') dep--;
				if(dep==0){
					if(s[i]=='+' || s[i]=='-' || s[i]=='*') ok=true;
				}
			}
			if(!ok) return -1;

			idx++;
			int a=expr();
			if(a==-1 || idx==len || s[idx]!=')') return -1;
			nums.push_back(a);
			idx++;
		}
		else return -1;

		if(s[idx]=='+' || s[idx]=='-' || s[idx]=='*') ops.push_back(s[idx++]);
		else if(idx==len || s[idx]==')') break;
		else return -1;
	}

	// 掛け算を先にやる
	while(1){
		int i=find(ops.begin(),ops.end(),'*')-ops.begin();
		if(i==ops.size()) break;
		nums[i]*=nums[i+1];
		nums.erase(nums.begin()+i+1);
		ops.erase(ops.begin()+i);
		if(nums[i]<0 || 1024<=nums[i]) return -1;
	}
	// 足し算と引き算をやる
	int res=nums[0];
	rep(i,ops.size()){
		if     (ops[i]=='+'){ res+=nums[i+1]; if(res<0 || 1024<=res) return -1; }
		else if(ops[i]=='-'){ res-=nums[i+1]; if(res<0 || 1024<=res) return -1; }
	}
	return res;
}

int gao(int i,const vector<int> &pos){
	if(i==pos.size()){
		idx=0;
		int a=expr();
		if(idx<len) a=-1;
		return a;
	}

	int res=-1;
	rep(j,7){
		s[pos[i]]="01+-*()"[j];
		res=max(res,gao(i+1,pos));
	}
	return res;
}

int main(){
	scanf("%s",s);
	len=strlen(s);

	vector<int> pos;
	rep(i,len) if(s[i]=='.') pos.push_back(i);

	printf("%d\n",gao(0,pos));

	return 0;
}

Measured memory_bytes: 1028
const val MOD = 1000000007L
fun main(args: Array<String>) {
    val (X, Y) = listOfInt()
    var s = X + Y
    if (s % 3 != 0) return println(0)
    s /= 3
    val x = X - s
    val y = Y - s
    if (x < 0 || y < 0) return println(0)
    val ans = Combi(x + y, x)
    println(ans.toString())
}
fun pow2(n: Int): ModInt {
    if (n == 0) return ModInt(1)
    var x = pow2(n / 2)
    x *= x
    if (n % 2 == 1) x *= 2
    return x
}
fun Combi(n: Int, a: Int): ModInt {
    var x = ModInt(1)
    var y = ModInt(1)
    repeat(a) { i ->
        x *= n - i
        y *= i + 1
    }
    return x / y
}
data class ModInt(private var v: Long) {
    companion object { private const val MOD = 1000000007L }
    init { this.v %= MOD }
    constructor(n: Int): this(n.toLong())
    operator fun plus(other: Int) = ModInt((this.v + other) % MOD)
    operator fun minus(other: Int) = ModInt((this.v + MOD - other) % MOD)
    operator fun minus(other: ModInt) = ModInt((this.v + MOD - other.v) % MOD)
    operator fun times(other: Int) = ModInt(this.v * other % MOD)
    operator fun times(other: ModInt) = ModInt(this.v * other.v % MOD)
    operator fun div(other: ModInt) = ModInt(this.v * pow(other.v, MOD - 2) % MOD)
    private fun pow(a: Long, b: Long): Long {
        if (b == 0L) return 1L
        if (b % 2 == 0L) {
            val d = pow(a, b / 2)
            return (d * d) % MOD
        }
        return a * pow(a, b - 1) % MOD
    }
    override fun toString() = this.v.toString()
}

fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun nextInt(offset: Int = 0) = nextInt() + offset
fun nextLong() = java.lang.Long.parseLong(next())
fun nextLong(offset: Long = 0L) = nextLong() + offset
fun nextDouble() = next().toDouble()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
fun listOfInt(offset: Int = 0) = listOfString().map { Integer.parseInt(it) + offset }
fun listOfLong() = listOfString().map { java.lang.Long.parseLong(it) }
fun listOfLong(offset: Long = 0L) = listOfString().map { java.lang.Long.parseLong(it) + offset }
fun listOfDouble() = listOfString().map { it.toDouble() }


Measured memory_bytes: 44680
N, M = map(int, input().split())
a_list = map(int, input().split())

from heapq import *

que = []
for a in a_list:
    que.append(-a)
heapify(que)

while M > 0:
    M -= 1
    q = heappop(que)
    q = abs(q) // 2
    heappush(que, -q)

print(abs(sum(que)))


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

class TreeNode{
    private:
    int idx;
    vector<TreeNode*> losers;
    public:
    int getIndex(){
        return this->idx;
    }
    vector<TreeNode*> &getLosers(){
        return this->losers;
    }
    void setIndex(const int index){
        this->idx=index;
    }
    void clearLosers(){
        this->losers.clear();
    }
    void addLoser(TreeNode *loser){
        this->losers.push_back(loser);
    }
} treeNode[110000];

int minimumHeight(TreeNode *node, unordered_map<int, int> &cache){
    unordered_map<int, int>::iterator it = cache.find(node->getIndex());
    if(it!=cache.end()){
        return it->second;
    }
    vector<int> sub;
    for(TreeNode *loser : node->getLosers()){
        sub.push_back(minimumHeight(loser, cache));
    }
    sort(sub.begin(), sub.end());
    int foo=-1;
    for(const int h : sub){
        if(foo<h){
            foo=h;
        }else{
            foo++;
        }
    }
    foo++;
    cache.insert(make_pair(node->getIndex(), foo));
    return foo;
}

int main(){
    int n;
    while(scanf("%d", &n)!=EOF){
        for(int i=0; i<n; i++){
            treeNode[i].setIndex(i);
        }
        for(int i=1; i<n; i++){
            int p;
            scanf("%d", &p);
            p--;
            treeNode[p].addLoser(&treeNode[i]);
        }
        unordered_map<int, int> cache;
        printf("%d\n", minimumHeight(&treeNode[0], cache));
    }
    return 0;
}

Measured memory_bytes: 20260
/*
Author: Deep Chaklasiya
 ***************************************   UNAUTHORISED COPYING OF CODE PROHIBITED   **********************************
*/

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

#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update> data_set;
#define fbo find_by_order
#define ook order_of_key




#define int         long long
#define double      long double
#define pb          push_back
#define pf          push_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define piiii       pair<pii,pii>
#define viiii       vector<pair<pii,pii>>
#define mi          map<int,int>
#define mii         map<pii,int>
#define piii           pair<int,pair<int,int> >
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        998244353
#define PI          3.141592653589
#define bs(v,n)     binary_search(all((v)),(n))
#define lb(v,n)     lower_bound(all((v)),(n))
#define ub(v,n)     upper_bound(all((v)),(n))
#define fo(i,l,u)   for(i=l;i<u;i++)
#define rfo(i,l,u)  for(i=l;i>=u;i--)
#define allfo(s)    for(auto it=(s).begin();it!=(s).end();it++)
#define _init(b)     memset(b,-1,sizeof(b))
#define _init0(b)     memset(b,0,sizeof(b))
#define MOD         1000000007
#define ef else if





int gcd(int a, int b) {  if (a == 0)  return b; return gcd(b % a, a); }
bool mod(double a,double b) {return a/b - floor(a/b);}

int occurs(vi v,int n){
auto it=lb(v,n);auto it1=ub(v,n);int x=it1-it;return x;}

int logb(int base, int x) {
    return (log(x) / log(base));
}


template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}

void set_min(int &m,int a){
    if(m==-1||m>a)m=a;
}


signed main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int i,j,x,n,m,k,t;
    cin>>i>>j;
    if(i+j==3) cout<<"3";
    else if(i+j==5) cout<<"1";
    else cout<<"2";
    return 0;
}


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

int main(){
    int a;
    int b;
    cin >> a >> b;
    int c;
    int d;
    double f;
    c = a / b;
    d = a % b;
    f = 1.0 * a / b;
    printf("%d %d %.8lf\n",c,d,f);
}


Measured memory_bytes: 3216
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {
  if (a < b) swap(a,b);
  if (b == 0) return a;
  return gcd(b,a%b);
}
int main() {
  ll N; cin >> N;
  ll t[N];
  ll res = 1;
  for (ll i = 0; i < N; i++) {
    cin >> t[i];
    res = res/gcd(res,t[i])*t[i];
  }
  cout << res << endl;
}


Measured memory_bytes: 256
N, M, C = map(int, input().split())
B = list(map(int, input().split()))

ans = 0
for i in range(N):
    A = list(map(int, input().split()))
    t = 0
    for j in range(M):
        t += B[j] * A[j]

    if t + C > 0:
        ans += 1
print(ans)

Measured memory_bytes: 3064
#include<cstdio>
#include<cstdlib>
#include<cctype>
#include<cstring>
#include<algorithm>
#include<set>
#include<ctime>
#define REP(r,x,y) for(register int r=(x); r<(y); r++)
#define REPE(r,x,y) for(register int r=(x); r<=(y); r++)
#define PERE(r,x,y) for(register int r=(x); r>=(y); r--)
#ifdef sahdsg
#define DBG(...) printf(__VA_ARGS__),fflush(stdout)
#else
#define DBG(...) (void)0
#endif
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;

char ch; int si;
char buf[1<<21],*p1=buf,*p2=buf;
int beof = 0;
#define gc() (beof?EOF:(p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?(beof=EOF):*p1++))
#define gl(x) {char*s=x;while(isspace(*s=gc()));s++;while(!isspace(*s=gc()))s++;*s=0;}

template<class T>
inline void read(T &x) {
    x=0; si=1; for(ch=gc();!isdigit(ch) && ch!='-';ch=gc()) if(beof) return;
    if(ch=='-'){si=-1,ch=gc();} for(;isdigit(ch);ch=gc())x=x*10+ch-'0';
    x*=si;
}
template<class T, class...A> inline void read(T &x, A&...a){read(x); read(a...);}
char k[17];
LL ans=0;

int main() {
#ifdef sahdsg
    freopen("in.txt","r",stdin);
#endif
    ULL n; read(n);
    for(ULL i=1; i*i<=n; i++) {
        if(n%i==0) {
            if(i>1) {
                LL m=i-1;
                if(n%m==n/i) ans+=m;
            }
            if(i*i==n) break;
            LL m=n/i-1;
            if(n%m==i) ans+=m;
        }
    }
    printf("%llu\n", ans);
    return 0;
}


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

using ll = long long;
using vi = vector<int>;
using vi2 = vector<vector<int>>;
#define MP(a,b) make_pair((a),(b))
#define MT(...) make_tuple(__VA_ARGS__)

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define DCOUT(x,n) cout << fixed << setprecision(n) << (x) << endl;

#define sz(x) (int)(x).size()
#define HOGE cout << "hoge" << endl;
using P = pair<ll,ll>;

template<typename T>inline istream& operator>>(istream&i,vector<T>&v)
{REP(j,sz(v))i>>v[j];return i;}

const int INF = 1e9;
const ll m = 1e9+7;

int main(){
    ll n, m;
    cin >> n >> m;
    vi2 fri(n);
    ll ans = 0;
    REP(i,m){
        ll a,b;
        cin >> a >> b;
        a--;
        b--;
        fri[a].push_back(b);
        fri[b].push_back(a);
    }
    vi che(n,INF);
    queue<int> que;
    REP(i,n){
        if(che[i]!=0){
            ll cnt = 0;
            que.push(i);
            while(!que.empty()){
                int x = que.front();
                que.pop();
                cnt++;
                REP(j,fri[x].size()){
                    if(che[fri[x][j]]!=0){
                        que.push(fri[x][j]);
                        che[fri[x][j]] = 0;
                    }
                }
            }
            ans = max(ans,cnt);
        }
    }
    if(ans>1) ans --;
    cout << ans << endl;
}

Measured memory_bytes: 15480
#include <stdio.h>
int main(void)
{
    char a[51];
    scanf("%s",a);
    int p=0;
    while(a[p]!=NULL)
    {
        p++;
    }
    for(int q=p-8;q<52;q++)
      a[q]=NULL;
    printf("%s",a);
}


Measured memory_bytes: 128
s=input()
for i in range(len(s)-1):
  if s[i]==s[i+1]:
    print(i+1,i+2)
    exit(0)
  if i+2<len(s) and s[i]==s[i+2]:
    print(i+1,i+3)
    exit(0)
    
print(-1,-1)

Measured memory_bytes: 3188
using System;

namespace CC
{
    class Output
    {
        public int dep(Node[] node, int id)
        {
            if (node[id].p == -1)
            {
                return 0;
            }
            return dep(node, node[id].p) + 1;
        }

        public void preorder(Node[] node, int i)
        {
            if (i != -1) {
                Console.Write(" " + node[i].id);
                preorder(node, node[i].left);
                preorder(node, node[i].right);
            }
        }

        public void inorder(Node[] node, int i)
        {
            if (i!=-1)
            {
                inorder(node, node[i].left);
                Console.Write(" " + node[i].id);
                inorder(node, node[i].right);
            }
        }

        public void postorder(Node[] node, int i)
        {
            if (i != -1)
            {
                postorder(node, node[i].left);
                postorder(node, node[i].right);
                Console.Write(" " + node[i].id);
            }
        }
    }

    class Node
    {
        public int id;
        public int left;
        public int right;
        public int p;
        public int dep;
        public void node()
        {
            id = left = right = dep = 0;
            p = -1;
        }
    }

    class C
    {
        static void Main(string[] args)
        {
            String input1 = Console.ReadLine();
            int n = int.Parse(input1), i, rootid=0;
            Node[] node = new Node[n];
            string[] input2 = new string[3];
            Output output = new Output();
            for (i = 0; i < n; i++)
            {
                node[i] = new Node();
            }
            for (i = 0; i < n; i++)
            {
                node[i].id = i;
                node[i].p = -1;
            }
            for (i = 0; i < n; i++)
            {
                input2 = Console.ReadLine().Split(' ');
                node[int.Parse(input2[0])].left = int.Parse(input2[1]);
                node[int.Parse(input2[0])].right = int.Parse(input2[2]);
            }

            for (i = 0; i < n; i++)
            {
                if (node[i].left != -1)
                {
                    node[node[i].left].p = node[i].id;
                }
                if (node[i].right != -1)
                {
                    node[node[i].right].p = node[i].id;
                }
            }
            for (i = 0; i < n; i++)
            {
                node[i].dep = output.dep(node, i);
                if (node[i].dep == 0)
                {
                    rootid = node[i].id;
                }
            }

            Console.WriteLine("Preorder");
            output.preorder(node, rootid);
            Console.WriteLine("\nInorder");
            output.inorder(node, rootid);
            Console.WriteLine("\nPostorder");
            output.postorder(node, rootid);
            Console.WriteLine();

        }
    }
}



Measured memory_bytes: 9152
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

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

using namespace std;

int main(){
	int L, R, d;
	cin >> L >> R >> d;
	int cnt = 0;
	for (int i = L; i <= R; i++) {
		if (i % d == 0) cnt++;
	}
	cout << cnt << endl;
}

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


void solveCase() {
   int n;
   cin >> n;
   vector <int> v(3 * n);

   for(int i = 0; i < 3 * n; i++) {
      cin >> v[i];
   }

   sort(v.begin(), v.end());
   deque <int> d(v.begin(), v.end());
   ll ans = 0;
   while(!d.empty()) {
      d.pop_back();
      d.pop_front();
      ans += d.back();
      d.pop_back();
   }
   cout << ans << endl;
}

int main() {
   cin.tie(0);
   cin.sync_with_stdio(0);
   
   int testcase = 1;
   // cin >> testcase;
 
   for(int i = 0; i < testcase; i++) {
      solveCase();
   }
 
   return 0;
}

Measured memory_bytes: 5576
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) throws IOException {
        // TODO 自動生成されたメソッド・スタブ
        BufferedReader  br = new  BufferedReader(new InputStreamReader(System.in));
        String[] inputCoodinate = br.readLine().split(" ");
        double x1 = Double.parseDouble(inputCoodinate[0]);
        double y1 = Double.parseDouble(inputCoodinate[1]);
        double x2 = Double.parseDouble(inputCoodinate[2]);
        double y2 = Double.parseDouble(inputCoodinate[3]);
        double xdistance = Math.pow(x2 - x1, 2);
        double ydistance = Math.pow(y2 - y1, 2);
        double ansdistance = Math.sqrt(xdistance+  ydistance);
        System.out.println(ansdistance);



    }

}


Measured memory_bytes: 24436
h,w=map(int,input().split())
num=[list(map(int,input().split())) for i in range(h)]
ctrl=[]
cnt=0
for i in range(h):
  for j in range(w):
    if i==h-1:
      if j==w-1:pass
      else:
        if num[i][j]%2==1:
          num[i][j]-=1
          num[i][j+1]+=1
          ctrl.append([i+1,j+1,i+1,j+2])
          cnt+=1
    else:
      if num[i][j]%2==1:
        num[i][j]-=1
        num[i+1][j]+=1
        ctrl.append([i+1,j+1,i+2,j+1])
        cnt+=1
print(cnt)
for i in range(cnt):
  print(ctrl[i][0],ctrl[i][1],ctrl[i][2],ctrl[i][3])


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

int A[200005];
int B[200005];

int ft[200005];

int rsq(int b){
    int res = 0;
    while(b){
        res += ft[b];
        b -= b&(-b);
    }
    return res;
}

void update(int k, int v){
    while(k <= 200002){
        ft[k] += v;
        k += k&(-k);
    }
}

void update2(int a, int b, int v){
    update(a, v);
    update(b+1, -v);
}

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

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

    for(int i = 0; i < K; i ++){
        memset(ft, 0, sizeof(ft));
        for(int j = 0; j < N; j ++){
            update2(1+max(j-A[j], 0), 1+min(j+A[j], N-1), 1);
        }

        for(int j = 0; j < N; j ++){
            A[j] = rsq(j+1);
        }

        bool canStop = true;
        for(int j = 0; j < N; j ++){
            if(A[j] != N){
                canStop = false;
                break;
            }
        }

        if(canStop){break;}

        /*for(int j = 0; j < N; j ++){
            printf("%d ", A[j]);
        }
        printf("\n");*/
    }

    for(int j = 0; j < N; j ++){
        printf("%d ", A[j]);
    }
    printf("\n");

    return 0;
}


Measured memory_bytes: 5372
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <vector>
using namespace std;
int main() {
    long double A,B;
    long long C;
    cin>>A>>B;
    C=floor(A*B);
    cout<<C<<endl;
    
    return 0;
}

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

using namespace std;

int n;
string s, c;

int main () {
    cin >> n;
    cout << 0 << '\n';
    cout.flush();
    cin >>s;
    if(s == "Vacant") {
        cout << 0 << '\n';
        cout.flush();
    }
    else {
        int l = 1, r = n - 1;
        while(l < r) {
            int mid = l + r >> 1;
            cout << mid << '\n';
            cout.flush();
            cin >> c;
            if(c == "Vacant") {
                cout << mid << '\n';
                cout.flush();
                return 0;
            }
            string rem;
            if(mid % 2 == 0) rem = s;
            else {
                if(s == "Male") rem = "Female";
                else rem = "Male";
            }
            if(c == rem) l = mid + 1;
            else r = mid;
        }
        cout << l << '\n';
        cout.flush();
    }

    return 0;
}


Measured memory_bytes: 852
n,t[999],a,b;
int main(i){
  for(;n*=scanf("%d",&n);puts("")){
    for(i=999;t[i]=i--;);
    for(;n--;t[a]=b)scanf(" %c %c",&a,&b);
    for(scanf("%d", &n);n--;putchar(t[a]))scanf(" %c",&a);
  }
}

Measured memory_bytes: 592
#include <iostream>
#include <vector>
#include <string>
using namespace std;

int main() {
	int n; cin >> n;
	vector<long double>a(n);
	vector<string>u(n);
	for (int i = 0; i < n; i++) {
		cin >> a.at(i) >> u.at(i);
	}

	long double sum = 0;
	for (int i = 0; i < n; i++) {
		if (u.at(i) == "JPY") sum += a.at(i);
		else if (u.at(i) == "BTC") sum += a.at(i) * 380000;
	}

	cout << sum << endl;
}

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

using namespace std;

#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
typedef long long ll;
typedef pair<int, int> pi;
const int INF = 0x3f2f1f0f;
const ll LINF = 1ll * INF * INF;

const bool local = false;

ll localAns;

string toStr(ll n) {
	char str[99]; sprintf(str, "%lld", n);
	return string(str);
}

bool query(char c, ll n) {
	if(not local) printf("%c %lld\n", c, n);
	fflush(stdout);
	if(c == '?') {
		if(local) {
			return (n <= localAns and toStr(n) <= toStr(localAns)) or (n > localAns and toStr(n) > toStr(localAns));
		}else{
			char s[9]; scanf("%s", s);
			return s[0] == 'Y';
		}
	}else{
		if(local) {
			return n == localAns;
		}else{
			return true;
		}
	}
}

ll Ans = 0;
using pli = pair<ll, int>;

ll getExpand(ll n) {
	int l = SZ(toStr(n));
	ll res = 1e17, plus = res - 1;;
	for(int i=0; i<l; i++) res /= 10, plus /= 10;
	res *= n;
	return res + plus;
}
int main() {
	if(local) scanf("%lld", &localAns);
	
	vector<pli> list;
	int l9 = -1, r9 = 9;
	for(int k=0; k<12; k++) {
		ll pre = Ans;
		int add = 0;
		for(int l=0, r=9; l<=r; ) {
			int m = (l+r) >> 1;
			if(query('?', pre * 10 + m)) l = m+1, add = m; else r = m-1;
		}
		Ans *= 10; Ans += add;
		list.emplace_back(Ans, add);
		if(add == 9) l9 = add;
	}
	for(int k=11; k>=0; k--) {
		ll now; int add; tie(now, add) = list[k];
		//printf("%d [%lld]\n", k, getExpand(now/10*10));
		if(add == 9 && k > 0 && query('?', getExpand(now/10*10))) continue;
		if(add != 9) {
			Ans = now * 10 + 0;
			break;
		}
		int up = 0;
		ll pre = now / 10;
		for(int l=(k>0?0:1), r=9; l<=r; ) {
			int m = (l+r) >> 1;
			if(query('?', getExpand(pre * 10 + m))) r = m-1, up = m; else l = m+1;
		}
		if(up <= 8) {
			Ans = pre * 10 + up;
			break;
		}else{
			Ans = pre * 10 + up;
			int l = SZ(toStr(Ans));
			ll val = 1; for(int i=0; i<l; i++) val *= 10;
			if(query('?', val)) Ans *= 10;
			break;
		}
	}
	
	
	if(not query('!', Ans)) {
		printf("%lld\n", Ans);
		puts("WRONG");
	}
	return 0;
}


Measured memory_bytes: 596
// abc131c.cpp : Anti-Division
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll gcd(ll a, ll b){
  if(a<b) swap(a,b);
  while(b){
    ll r = a%b;
    a = b; b = r;
  }
  return a;
}

int main(){
  ll A,B,C,D; cin>>A>>B>>C>>D;
  ll E = C/gcd(C, D)*D;
  ll count = (B/C - A/C) + (B/D - A/D) - (B/E - A/E);
  if(A%C==0) count++;
  if(A%D==0) count++;
  if(A%E==0) count--;
  cout<< B-A+1-count <<endl;
}

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

int main() {
  int r, d, x2000;

  cin >> r >> d >> x2000;
  int xip1 = r * x2000 - d;
  int xipn;

  for (int i=0; i<10; i++) {
    if (i==0) {
      printf("%d\n", xip1);
      xipn = xip1;
    } else {
      xipn = r * xipn - d;
      printf("%d\n", xipn);
    }
  }

  return 0;
}

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

int main()
{
	int64_t n;
	cin >> n;
	vector<int64_t> hs(n);
	for (auto &&h : hs)
	{
		cin >> h;
	}

	hs[0]--;

	bool f = true;
	for (int64_t i = 1; i < n; i++)
	{
		f &= (hs[i - 1] <= hs[i]);

		if (hs[i - 1] <= hs[i] - 1)
		{
			hs[i]--;
		}
	}

	cout << (f ? "Yes" : "No") << endl;

	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define loop(i,x,z) for (int i=x;i<z;i++)
int cnt=0, l, r, d;
int main()
{
	cin >> l >> r>>d;
	loop(i, l, r + 1)
	{
		if (i % d == 0)cnt++;
	}
	cout << cnt;
}


Measured memory_bytes: 3620
N = int(input())
A = list(map(int,input().split()))
ans = {}
for i in range(N):
    ans[i+1] = A[i]
ans = sorted(ans.items(), key=lambda x:x[1])
ans2 = []
for i in ans:
    ans2.append(i[0])
print(*ans2)

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

int main() {
  char b;
  cin >> b;
  
  if ( b == 'A') cout << 'T' << endl;
  else if ( b == 'T') cout << 'A' << endl;
  else if ( b == 'C') cout << 'G' << endl;
  else cout << 'C' << endl;
  
}


Measured memory_bytes: 256
def main():
    N = int(input())
    A = list(map(int,input().split()))
    ans = "APPROVED"
    for i in range(N):
        if A[i]%2 == 0:
            if A[i]%3 != 0 and A[i]%5 != 0:
                ans ="DENIED"
    print(ans)

if __name__ == '__main__':
    main()

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

points = [None] * N
for i in range(0, N):
    points[i] = list(map(int, input().split()))

h_max = max([h for x, y, h in points])

for H in range(h_max + 100, h_max - 1, -1):
    for Cx in range(101):
        for Cy in range(101):
            ok = True
            for X, Y, h1 in points:
                h2 = max(H - abs(X - Cx) - abs(Y - Cy), 0)
                if h1 != h2:
                    ok = False
                    break
            if ok:
                print('{} {} {}'.format(Cx, Cy, H))
                exit()


Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
char s[20][2010];
int cnt[12];
int main(){
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    int minn = INF;
    for(int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
    for(int i = 0; i < (1 << (n - 1)); i++) {
        int ans = 0, flag = 0;
        memset(cnt, 0, sizeof(cnt));
        //printf("i = %d\n", i);
        for(int y = 1; y <= m; y++) {
            int num = 0;
            cnt[num] += s[1][y] - '0';
            for(int x = 2; x <= n; x++) {
                if(i & (1 << (x - 2))) num++;
                cnt[num] += s[x][y] - '0';
            }
            for(int j = 0; j <= num; j++) {
                //printf("j = %d cnt[j] = %d\n", j, cnt[j]);
                if(cnt[j] > k) {
                    flag = 1;
                    break;
                }
            }
            if(flag) {
                memset(cnt, 0, sizeof(cnt));
                num = 0; flag = 0;
                ans ++;
                cnt[num] += s[1][y] - '0';
                for(int x = 2; x <= n; x++) {
                    if(i & (1 << (x - 2))) num++;
                    cnt[num] += s[x][y] - '0';
                }
                for(int j = 0; j <= num; j++) {
                    if(cnt[j] > k) {
                        flag = 1;
                        break;
                    }
                }
                if(flag) break;
            }
            if(flag) break;
        }
        if(!flag) minn = min(minn, ans + __builtin_popcount(i));
    }
    printf("%d\n", minn);
    return 0;
}

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

int N, bil, freq[100100], total;

int main() {
    cin >> N;
    for(int i=1; i<=N; i++){
        cin >> bil;
        if (bil>100000){
            total++;
        } else {
            freq[bil]++;
        }
    }
    for (int i=1; i<=100000; i++){
        if(freq[i]>=i){
            total += freq[i]-i;
        }
        else {
            total += freq[i];
        }
    }
    cout << total <<endl;
}


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

#define rep(i,s,n) for (int i = (int)s; i < (int)n; i++)
#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
#define lbidx(x, y) lower_bound(x.begin(), x.end(), y) - x.begin()
#define ubidx(x, y) upper_bound(x.begin(), x.end(), y) - x.begin()
#define llbidx(x, y, z) lower_bound(x.begin(), x.end(), z) - lower_bound(x.begin(), x.end(), y) // 二要素間の距離
#define deg2rad(deg) ((((double)deg)/((double)360)*2*M_PI))
#define rad2deg(rad) ((((double)rad)/(double)2/M_PI)*(double)360)
#define Find(set, element) set.find(element) != set.end()
#define Decimal(x) printf("%.10f\n", x) // 小数点を10桁まで表示
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << "\n";
#define debug(x) cerr << #x << ": " << (x) << "\n";
#define endl "\n"
// gcj print用
#define Case(x) printf("Case #%d: ", x);

typedef pair<int, int> PI;
typedef pair<ll, ll> PLL;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<int>>> vvvl;
typedef vector<PI> vpi;
typedef vector<vector<PI>> vvpi;
typedef vector<vector<vector<PI>>> vvvpi;
typedef vector<PLL> vpl;
typedef vector<vector<PLL>> vvpl;
typedef vector<vector<vector<PLL>>> vvvpl;

int POWINT(int x, int n) {
  int ret = 1;
  while (n > 0) {
    if (n & 1) ret *= x;
    x *= x;
    n >>= 1;
  }
  return ret;
};

ll POWLL(ll x, int n) {
  ll ret = 1;
  while (n > 0) {
    if (n & 1) ret *= x;
    x *= x;
    n >>= 1;
  }
  return ret;
};

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

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

  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int ans = a * b;
  chmax(ans, c*d);
  cout << ans << endl;


  return 0;
};


Measured memory_bytes: 256
program ABC071B
    implicit none
    integer(8)::i
    integer(8)::flg=0
    integer(8),dimension(26)::L
    character(100000)::S
    L=0
    read(5,*)S

    do i=1,len_trim(S)
        L(ichar(S(i:i))-96)=1
    end do

    do i=1,26
        if(L(i)==0)then
            flg=1
            print'(A)',char(i+96)
            exit
        end if
    end do

    if(flg==0)then
        print'(A)',"None"
    end if
end program ABC071B

Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using v = vector<ll>;
using p = pair<ll,ll>;
#define rep(i,n) for(ll i=0;i<(n);i++)
template<typename T> void chmin(T &a, T b){ return a = min(a,b);}
template<typename T> void chmax(T &a, T b){ return a = max(a,b);}


int main(){
    ll n,m;
    cin >> n >> m;
    auto a= v(n,0);
    auto v= vector<p>(m);
    for(ll i=0;i<n;i++) cin >> a[i];
    for(ll i=0;i<m;i++){
        ll b,c;
        cin >> b >> c;
        v[i] = make_pair(c,b);
    }
    sort(a.begin(),a.end());
    sort(v.begin(),v.end(),greater<p>());   
    ll j=0;
    rep(i,m)
    	while(j<n&&a[j]<v[i].first&&v[i].second-- >0) a[j++] = v[i].first;
    
  	cout << accumulate(a.begin(),a.end(),(ll)0);

    return 0;
}

Measured memory_bytes: 2560
import java.util.*;
import static java.lang.System.*;

public class Main {

	Scanner sc = new Scanner(in);
	
	void run() {
		int n = sc.nextInt();
		int m = 100000;
		for (int i = 0; i < n; i++) {
			m += (int)Math.ceil(m*0.05/1000)*1000;
		}
		out.println(m);
	}
	
	public static void main(String[] args) {
		new Main().run();
	}

}

Measured memory_bytes: 17164
#include<bits/stdc++.h>
using namespace std;
long long int ar[2000000],ar1[2000000];
int main()
{
    long long int x, n,i,j,ans,a,b,mn=2232434343;
    cin>>n;
    cin>>x;
    ar[0]=x;
    ans=x;
//    cout<<ans<<endl;
    for(i=1;i<n;i++)
    {
        cin>>a;
        ans=ans+a;
        ar[i]=ans;

    }
//    cout<<ans<<endl;
    for(i=0;i<n;i++)
    {
        ar1[i]=ans-ar[i];
    }
    for(i=0;i<n-1;i++)
    {
        b=abs(ar[i]-ar1[i]);
        if(b<mn)
        {
            mn=b;
        }
    }
    cout<<mn<<endl;
}


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

long long int fastexpo(long long int a, long long int b)
{
    long long int ans = 1;
    while (b)
    {
        if (b & 1)
            ans = (ans * a) % m;
        b = b / 2;
        a = (a * a) % m;
    }
    return ans;
}
int main()
{
    ll h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    ll sum = 60 * (h2 - h1) + (m2 - m1);
    cout << sum - k << "\n";

    return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>                                                           
#define rep(i,a,b) for(int i=a;i<b;i++)                                            
#define rrep(i,a,b) for(int i=a;i>=b;i--)                                          
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;

int main(){
    ll r;
    cin >> r;

    cout << 3*r*r << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
int main() {
	int num;	// ??¨????????????????????°????¨????
	std::cin >> num;

	char *Mark = new char[num];
	int *Num = new int[num];
	// ????????¶???
	int Trump[4][13] = { 0 };

	// ????????????
	for (int i = 0; i < num; i++)
	{
		std::cin >> Mark[i] >> Num[i];
	}


	// ??????????????°
	for (int i = 0; i < num; i++)
	{
		if (Mark[i] == 'S')
		{
			Trump[0][Num[i] - 1] = 1;
		}
		else if (Mark[i] == 'H') {
			Trump[1][Num[i] - 1] = 1;
		}
		else if (Mark[i] == 'C') {
			Trump[2][Num[i] - 1] = 1;
		}
		else if (Mark[i] == 'D') {
			Trump[3][Num[i] - 1] = 1;
		}
	}

	// ??????
	for (int i = 0; i < 4; i++)
	{
		for (int j = 0; j < 13; j++)
		{
			if (Trump[i][j] == 0) {
				switch (i)
				{
				case 0:
					std::cout << "S ";
					break;
				case 1:
					std::cout << "H ";
					break;
				case 2:
					std::cout << "C ";
					break;
				case 3:
					std::cout << "D ";
					break;
				default:
					break;
				}
				std::cout << j + 1 << std::endl;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const int inf = 1e9;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, b, a) for (int i = a - 1; i >= b; i--)
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dxx[8] = {1, 1, 1, 0, 0, -1, -1, -1}, dyy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

int main() {
    char a;
    cin >> a;
    if (a - 'Z' > 0) cout << 'a' << "\n";
    else
        cout << "A\n";
}

Measured memory_bytes: 3596
s = input().strip()

counts = {
    'N': 0, 'W': 0, 'S': 0, 'E': 0
}

for c in s:
    counts[c] += 1


def judge():
    if counts['N'] > 0 or counts['S'] > 0:
        if counts['N'] * counts['S'] == 0:
            return False

    if counts['W'] > 0 or counts['E'] > 0:
        if counts['W'] * counts['E'] == 0:
            return False

    return True


if judge():
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

int ans[1<<19];
int main(){
    int m,k;
    cin>>m>>k;
    int m2=1;
    rep(i,m) m2*=2;
    if(m2<=k){
        cout<<-1<<endl;
        return 0;
    }
    if(m==1){
        if(k==0){
            cout<<"0 0 1 1"<<endl;
        }
        else{
            cout<<-1<<endl;
        }
        return 0;
    }
    ans[m2-1]=k;
    ans[m2*2-1]=k;
    rep(i,m2){
        if(k!=i){
            ans[(k>i?i:i-1)]=i;
            ans[(k>i?m2*2-2-i:m2*2-i-1)]=i;
        }
    }
    rep(i,m2*2) cout<<ans[i]<<" ";
    cout<<endl;
    return 0;
}


Measured memory_bytes: 2944
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

struct fast_io {
	fast_io(){
		std::cin.tie(nullptr);
		std::ios::sync_with_stdio(false);
	};
} fio;

signed main(){
	cout<<fixed<<setprecision(10);
	
	int N;
	int R = 0, G = 1, B = 2;
	int ans = 0;
	string S;
	vector<vector<int>> dp;
	
	cin>>N>>S;
	
	dp.resize(3, vector<int>(N+1));
	
	
	for(int i = 0; i < N; i++){
		if(S[i] == 'R') dp[R][i+1]++;
		if(S[i] == 'G') dp[G][i+1]++;
		if(S[i] == 'B') dp[B][i+1]++;
		
		for(int j = 0; j < dp.size(); j++){
			dp[j][i+1] += dp[j][i];
		}
	}
	
	for(int i = 0; i < N; i++){
		for(int j = i + 1; j < N; j++){
			if(S[i] == S[j]) continue;
			
			if(S[i] == 'R' && S[j] == 'G' || S[j] == 'R' && S[i] == 'G') {
				int con = dp[B][N] - dp[B][j];
				
				if(j+(j-i) < N && S[j+(j-i)] == 'B') con--;
				
				ans += con;
			}
			if(S[i] == 'R' && S[j] == 'B' || S[j] == 'R' && S[i] == 'B') {
				int con = dp[G][N] - dp[G][j];
				
				if(j+(j-i) < N && S[j+(j-i)] == 'G') con--;
				
				ans += con;
			}
			if(S[i] == 'B' && S[j] == 'G' || S[j] == 'B' && S[i] == 'G' ) {
				int con = dp[R][N] - dp[R][j];
				
				if(j+(j-i) < N && S[j+(j-i)] == 'R') con--;
				
				ans += con;
			}
			
			
		}
	}
	
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 3688
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
typedef long long ll;
typedef pair<ll,int> P;
int main(){
    float t,x;
    cin>>t>>x;
    cout<<t/x<<endl;
    
    return 0;
}

Measured memory_bytes: 256