akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

int main() {
	int r, D, x, tmp; cin >> r >> D >> x;
    for (int i = 0; i < 10; i++)
    {
        int ans = r * x - D;
        cout << ans << endl;
        x = ans;
    }
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>

using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> A(N);
    priority_queue<int> que;
    for(int i = 0; i < N; ++i){
        cin >> A[i];
        que.push(A[i]);
    }
    
    for(int i = 0; i < N; ++i){
        int temp = que.top();
        if(temp != A[i]){
            cout << temp << endl;
        }
        else{
            que.pop();
            cout << que.top() << endl;
            que.push(temp);
        }
    }
}


Measured memory_bytes: 3316
#include<iostream>
#include<complex>
#include<array>
#include<vector>
#include<cstdio>
using namespace std;

const double EPS = 1e-10;
template<class T>
bool eq(const T& a, const T& b) {return abs(a - b) < EPS;}

typedef  complex<double> point;
// sort/unique用、setではうまく動かないので使うべからず
namespace std {
	bool operator==(const point &a, const point &b){
		return eq(a, b);
	}
	bool operator<(const point& a, const point& b) {
		return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
	}
}
double cross(const point& a, const point& b) {
	return imag(conj(a)*b);
}
double dot(const point& a, const point& b) {
	return real(conj(a)*b);
}
int ccw(point a, point b, point c) {
	b -= a; c -= a;
	if (cross(b, c) > 0)   return +1;  // counter clockwise
	if (cross(b, c) < 0)   return -1;  // clockwise
	if (dot(b, c) < 0)     return +2;  // c--a--b on line
	if (norm(b) < norm(c)) return -2;  // a--b--c on line
	return 0;  // a--c--b on line or a----bc
}

struct circle {point p; double r;};
typedef vector<point> polygon;
typedef array<point, 2> line;

point projection(const line& l, const point& p) {
	double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
	return l[0] + t*(l[0]-l[1]);
}


int main()
{
  double x0,y0,x1,y1;
  for(;cin>>x0>>y0>>x1>>y1;)
    {
      int n;
      cin>>n;
      for(int i=0;i<n;i++)
	{
	  line l;
	  l[0]=point(x0,y0);
	  l[1]=point(x1,y1);
	  double x,y;
	  cin>>x>>y;
	  point p=point(x,y);
	  point ans=projection(l,p);
	  printf("%.10lf %.10lf\n",ans.real(),ans.imag());
	  //	  cout<<ans.real()<<" "<<ans.imag()<<endl;
	}
    }
}

Measured memory_bytes: 1256
#include <bits/stdc++.h>
using namespace std;
 
int main() {

    long long n,a,b;
    
    cin >> n >> a >> b;
  	long long ans = 0;


if(a == 0 && b == 0){
    ans = 0;
}else{
    long long c = n % (a + b);
    long long d = n / (a + b);

    ans = d * a;

    if(c <= a){
        ans += c;
    }else{
        ans += a;
    }

}

cout << ans << endl;



} 


Measured memory_bytes: 256
/*
AuThOr GaRyMr
*/
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define LL long long
#define IT iterator
#define PB push_back
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define KEEP while(1)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
#define ALL(a) a.begin(),a.end()
#define POB pop_back
#define ff fflush(stdout)
#define fastio ios::sync_with_stdio(false)
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
typedef pair<mp,mp> superpair;
mp each[100000+10];
int n;
map<int,int> OO;
int tot=0;
int dp[100001];
bool cmp(mp A,mp B){
	return A.SEC<B.SEC;
}
int main(){
	fastio;
	cin>>n;
	rb(i,1,n){
		int xi,li;
		cin>>xi>>li;
		each[i]=II(xi-li,xi+li);
	}
	sort(each+1,each+1+n,cmp);
	dp[1]=1;
	rb(i,2,n){
		dp[i]=dp[i-1];
		int l=1,r=i;
		if(each[l].SEC>each[i].FIR) continue;
		while(l<r-1){
			int mid=(l+r)>>1;
			if(each[mid].SEC<=each[i].FIR){
				l=mid;
			}
			else{
				r=mid;
			}
		}
		dp[i]=max(dp[i],dp[l ]+1);
	}
	cout<<dp[n];
	return 0;
}


Measured memory_bytes: 1408
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;

string s;
int main() {
	cin >> s;
	sort(s.begin(), s.end());
	cout << (s[0]==s[1] && s[1]!=s[2] && s[2]==s[3] ? "Yes" : "No");
	return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

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

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

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

int main(){
  string S; cin >> S;
  string T; cin >> T;
  int n = S.length();

  vector<int> s(26), t(26);
  rep(i, n){
    s[S[i] - 'a']++;
    t[T[i] - 'a']++;
  }
  sort(s.begin(), s.end());
  sort(t.begin(), t.end());
  rep(i, 26){
    if (s[i] != t[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 776
a = [[0]*3]*3
b = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
for i in range (0,3):
    a[i] = list(map(int,input().split()))

s = set()
n = int(input())
for i in range(0,n):
    s.add(int(input()))
    
for i in range(0,3):
    for j in range(0,3):
        if a[i][j] in s:
            b[i][j] = 1
        else:
            b[i][j] = 0
            
b1 = b[0][0]*b[0][1]*b[0][2]
b2 = b[1][0]*b[1][1]*b[1][2]
b3 = b[2][0]*b[2][1]*b[2][2]
b4 = b[0][0]*b[1][0]*b[2][0]
b5 = b[0][1]*b[1][1]*b[2][1]
b6 = b[0][2]*b[1][2]*b[2][2]
b7 = b[0][0]*b[1][1]*b[2][2]
b8 = b[2][0]*b[1][1]*b[0][2]


if (b1 or b2 or b3 or b4 or b5 or b6 or b7 or b8) == 1:
	print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
 
typedef long long i64;
 
struct Edge
{
    int nxt, to;
} e[200010];
int head[100010], cnt;
int val[100010];
bool ok = 1;
 
void add_edge(int a, int b)
{
    e[++cnt] = { head[a], b };
    head[a] = cnt;
}
 
int dfs(int nod, int tata)
{
    int sum(0);
    int vmax(0);
    for (int i(head[nod]); i; i = e[i].nxt) {
        if (e[i].to == tata)
            continue;
        int x = dfs(e[i].to, nod);
        sum += x;
        vmax = max(vmax, x);
    }
    if (e[head[nod]].nxt == 0)
        return val[nod];
 
    if (sum < 0 || sum > 2 * val[nod])
        ok = 0;
 
    vmax = max(1ll * vmax, 2ll * val[nod] - sum);
    if (vmax > val[nod])
        ok = 0;
    return 2 * val[nod] - sum;
}
 
int main()
{
    int n, a, b;
    cin >> n;
 
    for (int i(1); i <= n; i++)
        cin >> val[i];
 
    for (int i(1); i < n; i++) {
        cin >> a >> b;
        add_edge(a, b);
        add_edge(b, a);
    }
 
    if (n == 2) {
        if (val[1] == val[2])
            cout << "YES\n";
        else
            cout << "NO\n";
        return 0;
    }
 
    int root = 0;
    for (int i(n); i >= 1; i--)
        if (e[head[i]].nxt)
            root = i;
 
    int x = dfs(root, 0);
 
    if (x || !ok)
        cout << "NO\n";
    else
        cout << "YES\n";
    return 0;
}

Measured memory_bytes: 7936
#include <iostream>
#include <string>
#include <cstdio>
using namespace std;

int main()
{
    string s;
    cin >> s;
    int sum = 700;
    for (int i = 0; i < 3; i++) {
        if (s[i] == 'o') {
            sum += 100;
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define int long long
#define all(a) a.begin(), a.end()
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, a, b;
    cin >> n >> a >> b;
    if(abs(a - b) % 2 == 0) cout << "Alice" << endl;
    else cout << "Borys" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;

const int inf = 99999999;
const ll linf = 999999999999999999;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.end(), v.begin());
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

///////////////////////////////////////////////////////////////////////////

int main(){
/*	int n;
	map<int,int> m;
	cin >> n;
	int a[1005] = {};

	rep(i,0,n){
	    cin >> a[i];
        
        if(a[i] >= 3200)m[0]++;
        else if(a[i] >= 2800)m[1]++;
        else if(a[i] >= 2400)m[2]++;
        else if(a[i] >= 2000)m[3]++;
        else if(a[i] >= 1600)m[4]++;
        else if(a[i] >= 1200)m[5]++;
        else if(a[i] >= 800)m[6]++;
        else if(a[i] >= 400)m[7]++;
        else m[8]++;
    }

    int cnt = sz(m);
    if(m[0] > 0){
        cnt--;
        int ma = cnt+m[0];
        //if(ma > 9)ma = 9;
        cout << cnt << " " << ma << endl;
    }else{
        cout << cnt << " " << cnt << endl;
    }
  */
  int n;
  cin >> n;
  string s;
  cin >> s;

  int num = 0;
  int cnt = 0;

  rep(i,0,n){
    if(s[i] == '(')num++;
    else{
        if(num > 0)num--;
        else{
            cnt++;
        }
    }
  }
  rep(i,0,cnt)cout << '(';
  cout << s ;
  rep(i,0,num)cout << ')';
  cout << endl;
  
  
   
	return  0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include <cstdlib>  
#include <cmath>   
#include<cctype>
#include<string>
#include<set>
#include<iomanip>
#include <map>
#include<algorithm>
#include <functional>
#include<vector>
#include<climits>
#include<stack>
#include<queue>
#include <deque>
#include <climits>
#include <typeinfo>
#include <utility> 
#define all(x) (x).begin(),(x).end()
#define rep(i,m,n) for(int i = m;i < n;++i)
#define pb push_back
#define fore(i,a) for(auto &i:a)
#define rrep(i,m,n) for(int i = m;i >= n;--i)
#define INF INT_MAX/2
using namespace std;
using ll = long long;
using R = double;
using Data = pair<ll, vector<int>>;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 50;
struct edge { ll from; ll to; ll cost; };

int main() {
	int n;
	cin >> n;
	vector<int>v(n);
	vector<int>c(n);
	rep(i, 0, n)cin >> v[i];
	rep(i, 0, n)cin >> c[i];

	int ans = 0;
	rep(i, 0, n) {
		if (v[i] > c[i])ans += v[i] - c[i];
	}
	cout << ans << endl;


	return 0;
}

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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define MAXN 100001


int main() {
    int n;
    string s, t;
    ll dp[MAXN], sm[26];
    // 集約　遷移元の数をまとめて保存しておく配列を用意しておけば、遷移元がバラバラでも計算が楽。
    // sm[a] 入り口がaであるような星にたどり着ける道順の総和 入り口が同じものが遷移元だから遷移元を保存する。
    // dp[i]: 星iにたどり着ける道順の総和

    cin >> n;
    cin >> s >> t;

    dp[0] = 1;
    sm[s[0]-'a'] = 1;

    for (int i=1; i<n; i++) {
        dp[i] = sm[t[i]-'a'];
        dp[i] %= (ll(INF)+7);
        sm[s[i]-'a'] += dp[i];
        sm[s[i]-'a']  %= (ll(INF)+7);
    }
    /*
    for (int i=1; i<n; i++) {
        cout << dp[i] << endl;
    }
    */
    cout << dp[n-1] << endl;
}




Measured memory_bytes: 4056
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int main() {
	int n, cntdwn[17]={}, ans[100];
	queue<int> q;
	for (int m=0; m<600; ++m) {
		if (m%5==0 && m/5<100) q.push(m/5);
		for (int i=0; i<17; ++i) --cntdwn[i];
		while ( ! q.empty()) {
			int num = (q.front()%5==1 ? 5 : 2);
			int c = 0, k = -1;
			for (int i=0; i<17; ++i) {
				c = (cntdwn[i]<=0 ? c+1 : 0);
				if (c==num) {
					k = i-num+1;
					break;
				}
			}
			if (k < 0) break;
			for (int i=k; i<k+num; ++i) {
				cntdwn[i] = 17*(q.front()%2)+3*(q.front()%3)+19;
			}
			ans[q.front()] = m-5*q.front();
			q.pop();
		}
	}
	while (cin >> n) {
		cout << ans[n] << endl;
	}
	return 0;
}

Measured memory_bytes: 1200
a =int(input())
K =[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(K[a-1])


Measured memory_bytes: 2940
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)

struct INIT{
    INIT(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(0);
        cout << fixed << setprecision(13);
    }
}INIT;

char c;

int main(){
    cin >> c;
    cout << (char)(c + 1) << endl;
}

Measured memory_bytes: 384
sum = 0
number = 0
i = 0
while ! $stdin.eof?
  line = $stdin.gets.chomp.split(",").map(&:to_i)
  sum += line[0] * line[1];
  number += line[1]
  i += 1
end
puts sum
puts (number.to_f / i.to_f).round

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

int main(void) {
    int N;cin>>N;
    int even = 0; // 4の倍数ではない偶数
    int odd = 0; //奇数
    int even4 = 0; // 4の倍数
    for (int i = 0; i < N; i++) {
        int a;cin>>a;
        if (a % 4 == 0) even4++;
        else if (a % 2 == 0) even++;
        else odd++;
    }
    if (odd <= even4) cout << "Yes" << endl;
    else if (odd == even4 + 1) {
        if (odd + even4 == N) cout << "Yes" << endl;
        else cout << "No" << endl;
    } else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 888
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <complex>
#include <set>
#include <list>
#include <iomanip>
#include <map>
#include <functional>
#include <string.h>

using namespace std;
static const double EPS = 1e-9;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a,0,sizeof(a))
#define minus(a) memset(a,0xff,sizeof(a))
#define chmax(a,b) a=min((a),(b))
#define chmin(a,b) a=max((a),(b))


#define MOD 1000000007

typedef pair<ll,ll>P;
#define INF (1LL<<61)
 
int n;
template <typename T>
class Rmq {
public:
	int n;
	vector<T> dat;

	void init(int _n) {
		n = 1;
		while (n < _n) {
			n *= 2;
		}
		dat.resize(2 * n - 1, INF);//

	}

	void update(int k, T x) {
		k += n - 1;
		dat[k] = x;
		while (k > 0) {
			k = (k - 1) / 2;//k/2でない注意
			dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
		}

	}
	T find(int a, int b) {
		return find0(a, b, 0, 0, n);
	}
	T find0(int a, int b, int k, int l, int r) {
		if (r <= a || b <= l)//等号が必要
			return INF;
		if (a <= l && r <= b)
			return dat[k];
		else {
			T x1, x2;
			x1 = find0(a, b, k * 2 + 1, l, (l + r) / 2);//ここはl,r
			x2 = find0(a, b, k * 2 + 2, (l + r) / 2, r);
			return min(x1, x2);
		}
	}
};

int main(){
	scanf("%d ", &n);
	vector<P> v(n);
	rep(i, n) {
		scanf("%lld %lld ", &v[i].first, &v[i].second);
		if (v[i].first > v[i].second)
			swap(v[i].first, v[i].second);
	}
	
	
	sort(all(v));

	ll ans=INF; 
	
	
	Rmq<ll> lmin, lmax, rmin, rmax;
	lmin.init(n); lmax.init(n); rmin.init(n); rmax.init(n);
	rep(i, n) {
		lmin.update(i, v[i].first);
		lmax.update(i, -v[i].first);
		rmin.update(i, v[i].second);
		rmax.update(i, -v[i].second);

	}
	ans = min(ans, (-lmax.find(0, n) - lmin.find(0, n)) * (-rmax.find(0, n) - rmin.find(0, n)));
	rep(i, n) {
		lmin.update(i, v[i].second);
		lmax.update(i, -v[i].second);
		rmin.update(i, v[i].first);
		rmax.update(i, -v[i].first);
		ans = min(ans, (-lmax.find(0, n) - lmin.find(0, n)) * (-rmax.find(0, n) - rmin.find(0, n)));
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 19712
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solve(in, out);
        out.close();
    }

    class Node{
        int v;
        Node next;
        Node(int v){
            this.v=v;
            next=null;
        }
    }

    public static void solve(InputReader sc, PrintWriter pw) {
        int i,j=0;
        int t=1;
        // int t=sc.nextInt();
        u:while(t-->0){
            int h=sc.nextInt();
            int w=sc.nextInt();
            int n=sc.nextInt();
            pw.println((n+Math.max(h,w)-1)/Math.max(h,w));
        }
    }

    static class Pair implements Comparable<Pair>{
        int a;int b;
        Pair(int a,int b){
            this.a=a;
            this.b=b;
            //this.z=z;
        }   
        public int compareTo(Pair p){
            return (a-p.a);
        }
    }

    static boolean isPrime(int n) { 
        if (n <= 1) 
            return false; 
        if (n <= 3) 
            return true; 
        if (n % 2 == 0 || n % 3 == 0) 
            return false; 
        for (int i = 5; i * i <= n; i = i + 6) 
            if (n % i == 0 || n % (i + 2) == 0) 
                return false; 
        return true; 
    } 
    static long gcd(long a, long b) { 
        if (b == 0) 
            return a; 
        return gcd(b, a % b);  
    } 
    static long fast_pow(long base,long n,long M){
        if(n==0)
           return 1;
        if(n==1)
        return base;
        long halfn=fast_pow(base,n/2,M);
        if(n%2==0)
            return ( halfn * halfn ) % M;
        else
            return ( ( ( halfn * halfn ) % M ) * base ) % M;
    }
    static long modInverse(long n,long M){
        return fast_pow(n,M-2,M);
    }
 
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
 
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }
 
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}

Measured memory_bytes: 23252
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define Sort(a) sort(a.begin(), a.end())
#define fin(ans) cout << (ans) << endl
const int INF = 1<<30;
const ll MOD = 1000000007;

int main() {
  string s,t,u;
  int a, b;
  cin >> a >> b;
  //cin >> s >> t >> u;
  
  cout << (a+b)*(a+b-1)/2-(a*b) << endl; 
  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
void *wmem;
template<class T1, class T2> void sortA_L(int N, T1 a[], T2 b[], void *mem = wmem){
  int i;
  pair<T1, T2> *arr=(pair<T1, T2> *) mem;
  for(i=0;i<N;i++){
    arr[i].first = a[i];
    arr[i].second = b[i];
  }
  sort(arr, arr+N);
  for(i=0;i<N;i++){
    a[i] = arr[i].first;
    b[i] = arr[i].second;
  }
}
void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
void wt_L(char a){
  putchar_unlocked(a);
}
void wt_L(long long x){
  char f[20];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class S, class T> inline S min_L(S a,T b){
  return a<=b?a:b;
}
char memarr[96000000];
int N;
int M;
int A[100000];
int B[100000];
int main(){
  int i, j;
  long long res=0;
  wmem = memarr;
  rd(N);
  rd(M);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<N;Lj4PdHRW++){
      rd(A[Lj4PdHRW]);
      rd(B[Lj4PdHRW]);
    }
  }
  sortA_L(N,A,B);
  for(i=0;i<N;i++){
    j =min_L(B[i], M);
    M -= j;
    res += (long long)A[i] * j;
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190227-1 [beta]

// --- original code ---
// int N, M, A[1d5], B[1d5];
// {
//   int i, j;
//   ll res = 0;
//   rd(N,M,(A,B)(N));
//   sortA(N,A,B);
//   rep(i,N){
//     j = min(B[i],M);
//     M -= j;
//     res += (ll)A[i] * j;
//   }
//   wt(res);
// }


Measured memory_bytes: 1792
#include<stdio.h>
int main(void){
int n;
  scanf("%d",&n);
  for(int i=9;i>=1;i--){
if(n%i==0){
  if(n/i>=1&&n/i<=9){
    printf("Yes");
    return 0;
  }
}
  }
     printf("No");
    return 0;
  }

Measured memory_bytes: 128
#include <stdio.h>
#define TEST 0
int par[100001];
bool marked[100001];
int find_marked(int id)
{
    if(marked[id])return id;
    return find_marked(par[id]);
}
int main(void)
{
    int n,q;
    while(scanf("%d%d",&n,&q)==2 && (n!=0 || q != 0))
    {
        par[1]=0;
        marked[1]=true;
        long long int sum=0;
        for(int i=0;i<n-1;i++)
        {
            scanf("%d",par + i+2);
            marked[i+2]=false;
        }
        for(int j=0;j<q;j++)
        {
            char str[8];
            int num;
            scanf("\n%[QM]%d",str,&num);
#if TEST
            printf("%c:%d\n",str[0],num);
#endif
            switch(str[0])
            {
            case 'Q':
                    sum+=find_marked(num);
                    break;
            case 'M':
                    marked[num]=true;
                    break;
            }
        }
        printf("%lld\n",sum);
    }
    return 0;
}

Measured memory_bytes: 1252
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <limits.h>
#include <cstring>
#include <tuple>
#include <cassert>
#include <numeric>
using namespace std;
// type alias
typedef long long LL;
typedef vector < int > VI;
typedef unordered_map < int, int > MAPII;
typedef unordered_set < int > SETI;
typedef pair< int , int > II;
typedef tuple< int, int, int > III;
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// minmax
#define SMAX(a,b) a = max(a,b)
#define SMIN(a,b) a = min(a,b)
// debug cerr
#define TRACE true
#define dump(x) if(TRACE) { cerr << #x << " = " << (x) << endl; }
#define dump2(x,y) if(TRACE) { cerr << #x << " = " <<setprecision(15)<< (x) << ", " << #y << " = " <<setprecision(15)<< (y) << endl; }
#define dump3(x,y,z) if(TRACE) { cerr << #x << " = " <<setprecision(15)<< (x) << ", " << #y << " = " <<setprecision(15)<< (y) << ", " << #z << " = " <<setprecision(15)<< (z) << endl; }
#define dump4(x,y,z,a) if(TRACE) { cerr << #x << " = " <<setprecision(15)<< (x) << ", " << #y << " = " <<setprecision(15)<< (y) << ", " << #z << " = " <<setprecision(15)<< (z) << ", " << #a << " = " <<setprecision(15)<< (a) << endl; }
#define dumpAR(ar) if(TRACE) { FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }

/*
 
 8/10/2018
 
 17:15-17:25 analysis
 17:45 1WA
 
 19:00-19:33 AC after precision adjustment (sum by LL and use long doulbe instead of double)
 
 */

// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG x.cpp && ./a.out
const int MAX_N=50+1;
int N,A,B;
LL V[MAX_N];
LL C[MAX_N][MAX_N];
long double eps=1e-6;
void solve() {
//  sort(V,V+N);
//  REP(i,N) dump2(i,V[i]);
  
  ZERO(C);
  REP(i,MAX_N) {
    C[i][0]=1;
    FORE(j,1,i)C[i][j]=C[i-1][j]+C[i-1][j-1];
  }
  
  long double res1=-1;
  LL res2=0;
  FORE(n,A,B) {
    vector<pair<long double,int>> A(N); REP(i,N) A[i]={(long double)V[i]/n,i};
    sort(A.rbegin(),A.rend());
    LL sum=0;
    REP(i,n) sum+=V[A[i].second];
    long double a=(long double)sum/n;
    
    // NG if divided value is used
//    long double a=0;
//    REP(i,n) a+=A[i].first;

    if(a-res1>eps) res1=a,res2=0;
    if(abs(res1-a)<eps) {
      int l=n-1;
      while(l>=0&&V[A[l].second]==V[A[n-1].second]) --l;
      int k=n-1-l;
      int r=n-1;
      while(r<N&&V[A[r].second]==V[A[n-1].second]) ++r;
      int nn=k+r-n;
      res2+=C[nn][k];
    }
  }
  cout<<setprecision(15)<<res1<<endl;
  cout<<res2<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  
  cin>>N>>A>>B;
  REP(i,N) cin>>V[i];
  solve();
  return 0;
}


Measured memory_bytes: 632
import math
x = int(input())
if x == 1 or x== 2 or x==3:
  print(1)
  exit()

s = math.floor(math.sqrt(x))

def l(k,p):
    return(int(math.floor(math.log(p)/math.log(k))))

ans = 0
for i in range(2,s+1):
  if i ** (1 + l(i,x)) <= x:
    ans = max(ans, i ** (1+l(i,x)))
  else:
    ans = max(ans, i ** l(i,x))
  if ans == x:
    print(x)
    exit()
  
print(ans)

Measured memory_bytes: 3064
s = input()
a = []
prev = cnt = 0
for i in s:
        if i==prev: cnt+=1
        else:
                if prev: a.append([prev,cnt])
                cnt = 1
        prev = i
a.append([prev, cnt])

ans = [0] * (len(s)+1)
idx = 0
for t, c in a:
        for j in range(c+1):
                if t=='<': ans[idx+j] = max(ans[idx+j], j)
                else: ans[idx+j] = max(ans[idx+j], c-j)
        idx += j
print(sum(ans))

Measured memory_bytes: 32924
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<iomanip>
#include<cstring>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define waste ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define inf 1e9+1
#define inf1 1e18+1
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 1000005
#define mid(l,r) l+(r-l)/2
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(a>b)swap(a,b);if(!a)return b;return gcd(b%a,a);}

void solve(){
	ll r;
	cin>>r;
	cout<<3ll*r*r;
}
int main()
{
	waste;
	int t;
	//cin>>t;
	t=1;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 764
//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <cstring>
#define pb push_back
typedef long long ll;
using namespace std;

const int maxn = 1e6+5;

int main()
{
    int a, b; cin >> a >> b;
    for(int i = 1; i <= 1250; i++) {
        int q = i*0.08;
        int p = i*0.1;
        if(a == q&&b == p) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}


Measured memory_bytes: 256
/*
ID: anonymo14
TASK: wormhole
LANG: C++                 
*/
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int>> vpii;

#define F first
#define S second
#define PU push
#define PUF push_front
#define PUB push_back
#define PO pop
#define POF pop_front
#define POB pop_back

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

#define MOD 1000000007

void solve(int test_case) {
		string s;
		cin>>s;
		string req = "keyence";
		for(int i=0;i<s.length();i++) {
			for(int j=i;j<=s.length();j++) {
				if(s.substr(0,i)+s.substr(j)==req) {
					cout<<"YES";
					return;
				}
			}
		}
		cout<<"NO";
}

int main() {
	
	////// FILE BASED IO////
	//freopen("wormhole.in", "r", stdin);
	//freopen("wormhole.out", "w", stdout);
	///////////////
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t=1;
	//cin>>t;
	REP(i,1,t) {
		solve(i);
	}
	return 0;
}	


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

//関数
//main関数
int main() {
    
    
    //入力
    long N,M,C;
    cin>>N>>M>>C;
    vector<long> B(M);
    for(int i=0;i<M;i++){
        cin>>B.at(i);
    }
    //計算
    long ans=0;
    for(int i=0;i<N;i++){
        vector<long> A(M);
        for(int i=0;i<M;i++){
            cin>>A.at(i);
        }
        long value=C;
        for(int i=0;i<M;i++){
            value+=A.at(i)*B.at(i);
        }
        
        if(value>0) ans++;
    }
    //出力
    cout<<ans<<endl;
}





Measured memory_bytes: 256
def r(a,s)
(1..13).each{|i|
if !(a.include?(s+" #{i}\n"))
puts s+" #{i}"
end
}
end

n=gets.to_i
a=[]
n.times{a.push(gets)}
r(a,"S")
r(a,"H")
r(a,"C")
r(a,"D")

Measured memory_bytes: 8624
import           Data.List

longest :: [[a]] -> [a]
longest = maximumBy (\a b -> compare (length a) (length b))

mrw :: String -> String
mrw = head . longest . group . sort . words

mlw :: String -> String
mlw = longest . words

main :: IO ()
main = getContents >>= mapM_ f . lines
  where f s = putStrLn $ mrw s ++ " " ++ mlw s

Measured memory_bytes: 3716
//C
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

//C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

//Others
template<class T> inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T> inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
const int dx[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };
const int dy[8] = { 1, 1, 1, 0, 0, -1, -1, -1 };
const int lr[4] = { 0, 1, 0, -1 };
const int ud[4] = { 1, 0, -1, 0 };



//LOVE Ayane Sakura



using namespace std;

int main() {
	int N;
	cin >> N;
	map<int, int>mp;
	for (int i = 0; i < N; i++) {
		int n;
		cin >> n;
		if (mp[n] == 0) {
			mp[n] = 1;
		}
		else {
			mp[n] = 0;
		}
	}
	int ans = 0;
	for (auto it = mp.begin(); it != mp.end();  ++it) {
		if (it->second == 1) {
			ans++;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 4992
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <cassert>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define srep(i,n,m) for(int i=n;i<m;i++)
#define elif else if
#define INF 1000000007
#define pi 3.141592653589793
using namespace std;
int saidaikouyakusuu(int a,int b){
    if(b==0) return a;
    return saidaikouyakusuu(b,a%b);
}
int saisyoukoubaisuu(int a,int b){
    return a*b/saidaikouyakusuu(a,b);
}
int n,m,cnt=0,aa[220000],ab[220000],o;
pair<int,int> pp[220000];
string s,ss[220000];
char c,ca;
queue<int> que;
signed main(){
    cin>>n>>m;
    rep(i,m){
        cin>>aa[i];
    }
    cnt=n;
    while(1){
        rep(i,m){
            if(aa[i]==cnt){
                goto noa;
            }
        }
        o=cnt;
        break;
        noa:;
        cnt++;
    }
    cnt=n;
    while(1){
        rep(i,m){
            if(aa[i]==cnt){
                goto nob;
            }
        }
        if(abs(cnt-n)>abs(o-n)){
            cout<<o;
        }else{
            cout<<cnt;
        }
        break;
        nob:;
        cnt--;
    }

}


Measured memory_bytes: 10516
import java.util.*;
import java.math.BigInteger;

public class Main {
  public static void main(String[] args) {
    new Main().run();
  }

  private void run() {
    while(sc.hasNext()) {
      final int n = sc.nextInt();

      if(n == 0) break;

      final List<Integer> employees = new ArrayList<Integer>();
      final Map<Integer, BigInteger> sales = new HashMap<Integer, BigInteger>();

      for(int i = 0; i < n; i++) {
        final int id = sc.nextInt();
        final long price = sc.nextInt();
        final long num = sc.nextInt();

        final BigInteger total = BigInteger.valueOf(price * num);

        if(sales.containsKey(id)) sales.put(id, sales.get(id).add(total));
        else {
          employees.add(id);
          sales.put(id, total);
        }
      }

      final BigInteger border = BigInteger.valueOf(1000000L);

      boolean na = true;
      for(int id : employees) {
        if(sales.get(id).compareTo(border) >= 0) {
          na = false;
          System.out.println(id);
        }
      }

      if(na) System.out.println("NA");
    }
  }

  private final Scanner sc = new Scanner(System.in);
}

Measured memory_bytes: 13000
#include<bits/stdc++.h>
const unsigned int M = 1000000007; 
#define all(v) (v).begin(), (v).end()
#define rall(v) v.rbegin(),v.rend()
#define  pb push_back
#define mpp make_pair
#define int  long long
#define N 998244353
#define endl "\n"
#define fr(i,n) for(int i=0;i<n;i++)
int power(int x,int y){int res=1;while(y>0){if(y&1)res=x*res; y=y>>1;x=x*x;}return res;}
int power(int x,int y,int mod){int res=1;while(y>0){if(y&1)res=x*res%mod; y=y>>1;x=x*x%mod;}return res;}

using namespace std;


void nik()
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);

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


#define F first
#define S second

 signed main()
{
//nik();

int t=1;
//cin>>t;

while(t--)
{	
	string s;
	cin>>s;

	if(s.size()<5)cout<<"No\n";
	else if(s[2]==s[3] and s[4]==s[5])cout<<"Yes\n";
	else cout<<"No";


}
 return 0;
}



Measured memory_bytes: 256
if __name__ == '__main__':
    n, k = map(int, input().split())
    a_list = list(map(int, input().split()))
    
    now = 1
    check = [0] * n
    check[0] = 1
    move = [1]
    for i in range(k):
        now = a_list[now-1]
        move.append(now)
        if check[now-1] == 0:
            check[now-1] = 1
        else: 
            break

    point = (move.index(now))
    roop_len = sum(check) - point

    if k <= sum(check):
        print(move[k])
    else:
        k_ = k - point
        point_ = k_ % roop_len
        print(move[point+point_])

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

#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define vs vector<string>
#define pii pair<int,int>
#define pll pair<ll,ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return a[0]<b[0];});

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define RREP(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define FOR(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define FORR(i,a,b) for(ll (i)=(b)-1;(i)>=(a);(i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a,b) a=max((a),(b))
#define CHMIN(a,b) a=min((a),(b))
/*}}}*/

struct data_t{
  int num;
  string str;
  int P;
};

bool asc( const data_t& left, const data_t& right ) {
    return left.str == right.str ? left.P > right.P : left.str < right.str;
}

int main() {
  ll N;
  cin >> N;
  vector<data_t> D(N);
  REP(i,N){
    string sin;
		int x;
    cin >> sin;
		cin >> x;
    D[i].num = i+1;
    D[i].str = sin;
		D[i].P = x;
	}
  sort(D.begin(), D.end(), asc);
  REP(i,N){
    cout << D[i].num <<endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int k;
    cin >> k;
    string s;
    while (k--) {
        s += "ACL";
    }
    cout << s << endl;
}

Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define F(i,a,b) for(int i=a;i<b;i++)
#define RF(i,a,b) for(int i=a;i>b;i--)
#define mp(a,b) make_pair(int a,int b)
#define ll long long
const int mxn=1e5+10,mxm=4e5+10;
const ll modl=998244353;
int nm,n,m,p,t,k;
int ans,sum;
int a[mxn],b[mxn],h[mxn];
int l,r;
int main(){
    ios_base::sync_with_stdio(false);
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);
//    cin>>nm;
//    string s,s1,s2;char c;
    while(cin>>n){
//        priority_queue<dp,vector<dp>,cmp>q;
        p=(n/500)*1000+(n%500/5*5);
        cout<<p;
        cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define MAX 100005
#define NIL -1
struct Node_struct{int p, l, r;}; /*p: 親(parent), l: 一番左の子(left child), r:右の兄弟(right sibling)*/
typedef struct Node_struct Node;
Node T[MAX];
int D[MAX];

void print(int u){
 int i, c;
 printf("node %d: parent = %d, depth = %d, ", u, T[u].p, D[u]);

 if(T[u].p == NIL) printf("root, ");
 else if(T[u].l == NIL) printf("leaf, ");
 else printf("internal node, ");

 printf("[");
 for (i=0, c = T[u].l; c != NIL; i++, c = T[c].r){
    if(i) printf(", ");
 printf("%d", c);
 }
  printf("]\n");

}

void calcDepth(int u, int p){
  D[u] = p;
  if(T[u].l != NIL) calcDepth(T[u].l,p+1);
  if(T[u].r != NIL) calcDepth(T[u].r,p);
}

int main(){
  int i, j, k;
  int n;
  int id, sib, child;
  int root = NIL;
  scanf("%d", &n);
  for(i=0; i<n; i++) T[i].p = T[i].l = T[i].r = NIL;

  for(i=0; i<n; i++){
    scanf("%d %d", &id, &k);
    for(j = 0, sib = NIL; j<k; j++){ //子を入力する (input children)
      scanf("%d", &child);
      T[child].p = id;
      if(j == 0) T[id].l = child; //idの一番左の子 (the most left child of id)
      else T[sib].r = child; //左の兄弟に繋げる (connect to left sibling)
      sib = child;//次の子供の左の兄弟 (the left sibling of the next child)
      }
    }

  //根を求める (find the root)
     for(i=0; i<n; i++){
    if(T[i].p == -1) root = i;
    }

  //それぞれのノードの深さを求める (find depth of each node)
        calcDepth(root, 0);

  //出力 (output)
          for(i=0; i<n; i++) print(i);

  return 0;
}


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

namespace abc051_b
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            int k = int.Parse(str[0]);
            int s = int.Parse(str[1]);
            int sum = 0;
            for(int i = 0; i <= k; ++i)
            {
                for(int j = 0; j <= k; ++j)
                {
                    int z = s - j - i;
                    if(z>=0 && z <= k)
                    {
                        sum++;
                    }
                }
            }
            Console.WriteLine(sum);
        }
    }
}


Measured memory_bytes: 13140
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <fstream>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <time.h>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) (min(a,b) <= (x) && (x) <= max(a,b)) //hei
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007LL
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589


#define izryt bool
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
	std::fill((T*)array, (T*)(array + N), val);
}
pll Dir[4] = {
	{ -1 ,0 },{ 0 , 1 },{ 1 ,0 },{ 0 ,-1 }
};

//[a, b)
#define Getsum(ar, a,b) (ar[b] - ar[a])
#define chmax(a,b) a = max(a,b)
#define chmin(a,b) a = min(a,b)

struct Edge {
	int from, to;
	ll w;
	bool operator<(const Edge& rhs) const {
		return MP(w, MP(from, to)) < MP(rhs.w, MP(rhs.from, rhs.to));
	}

};
typedef vector<vector<Edge>> Graph;

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

ll facmemo[200000] = {};

ll factorial(ll n) {//階乗
	if (facmemo[n] != 0) return facmemo[n];
	if (n == 0) return 1;
	ll ret = n * factorial(n-1);
	ret %= MODU;
	return facmemo[n] = ret;
}

ll mod_pow(ll x, ll n, ll mod) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x %mod;
		x = x * x%mod;
		n >>= 1;
	}
	return res;
}
ll divmod(ll a, ll b, ll m) { // a/b(mod m)
								  // a/b (mod m)
								  // a*b^-1
								  // b^-1 * b = 1
								  // b^(m-1) = 1 
								  // b^(m-2) * b = 1
								  // b^-1 = b^(m-2)

								  // a/b = a * b^(m-2)

	return (a * 1LL * mod_pow(b, m - 2, m)) % m;
}
ll ncr(ll n, ll r) {
	if (r == 0) return 1;
	if (n < r) return 1;
	return divmod(factorial(n), (factorial(r) * (factorial(n - r))) % MODU, MODU);
}

bool sankaku(int a, int b, int c) {
	return a <= b + c && b <= a + c && c <= b + a;
}
using ld = double;
using P = complex<ld>;
using G = vector<P>;
const ld pi = acos(-1);
const ld eps = 1e-10;
const ld inf = 1e12;

ld cross(const P& a, const P& b) { return a.real()*b.imag() - a.imag()*b.real(); }
ld dot(const P& a, const P& b) { return a.real()*b.real() + a.imag()*b.imag(); }

signed main() {
	char c;
	
	scanf("%c",&c);
	printf("%c\n",c + 1);
	return 0;
}


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

using namespace std;

int main() {
	int l, k; cin >> l >> k;
	vector<vector<long long> > dp(2, vector<long long>(l + k));
	dp[1][1] = 1, dp[1][k] = 1;
	for (int i = 1; i <= l; ++i) {
		if (i + 1 <= l) {
			dp[0][i + 1] += dp[1][i];
			dp[1][i + 1] += dp[0][i];
		}
		if (i + k <= l) dp[1][i + k] += dp[0][i];
	}
	cout << accumulate(dp[1].begin(), dp[1].begin() + l + 1, 0LL) << endl;

	return 0;
}


Measured memory_bytes: 3148
N,K = map(int, input().split())

A = list(map(int, input().split()))

A.sort()

if A[-1] < K:
    print("IMPOSSIBLE")
    exit()

if K in A or 1 in A:
    print("POSSIBLE")
    exit()

def gcd(a,b):
    x = max([a,b])
    y = min([a,b])
    while y:
        x, y = y, x % y
    return x

g = A[0]
for n in A[1:]:
    g = gcd(n, g)
    

print("POSSIBLE" if K % g == 0 else "IMPOSSIBLE")

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

#define INF 1e9
using namespace std;

int main() {

    int N; cin >> N;

    vector<pair<string, int>> R(N);

    for (int i = 0; i < N; ++i) {
        string S; cin >> S;
        int P; cin >> P;

        R[i] = make_pair(S, 100 - P);
    }

    vector<size_t> indices(R.size());
    iota(indices.begin(), indices.end(), 0);

    sort(indices.begin(), indices.end(), [&R](size_t i1, size_t i2) {
        return R[i1] <= R[i2];
    });

    for (int v : indices) {
        cout << v + 1 << endl;
    }
}

Measured memory_bytes: 256