akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>
#include <cmath>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;
const int MAX=1e5;

int main(){
	string S;
	cin>>S;
	bool pos=true;
	while(!S.empty()){
		if(S.back()=='m'){
			S.pop_back();
			if(S.empty()){pos=false;break;}
			char p[4];
			p[3]=S.back();S.pop_back();
			if(S.empty()){pos=false;break;}
			p[2]=S.back();S.pop_back();
			if(S.empty()){pos=false;break;}
			p[1]=S.back();S.pop_back();
			if(S.empty()){pos=false;break;}
			p[0]=S.back();S.pop_back();
			if(p[0]!='d'||p[1]!='r'||p[2]!='e'||p[3]!='a'){pos=false;break;}
		}
		else if(S.back()=='e'){
			S.pop_back();
			if(S.empty()){pos=false;break;}
			char p[4];
			p[3]=S.back();S.pop_back();
			if(S.empty()){pos=false;break;}
			p[2]=S.back();S.pop_back();
			if(S.empty()){pos=false;break;}
			p[1]=S.back();S.pop_back();
			if(S.empty()){pos=false;break;}
			p[0]=S.back();S.pop_back();
			if(p[0]!='e'||p[1]!='r'||p[2]!='a'||p[3]!='s'){pos=false;break;}
		}
		else if(S.back()=='r'){
			S.pop_back();
			if(S.empty()){pos=false;break;}
			char p[6];
			p[5]=S.back();S.pop_back();
			if(S.empty()){pos=false;break;}
			p[4]=S.back();S.pop_back();
          	if(S.empty()){pos=false;break;}
			if(p[4]=='m'){
				p[3]=S.back();S.pop_back();
				if(S.empty()){pos=false;break;}
				p[2]=S.back();S.pop_back();
				if(S.empty()){pos=false;break;}
				p[1]=S.back();S.pop_back();
				if(S.empty()){pos=false;break;}
				p[0]=S.back();S.pop_back();
				if(p[0]!='d'||p[1]!='r'||p[2]!='e'||p[3]!='a'||p[4]!='m'||p[5]!='e'){pos=false;break;}
            }	
			else if(p[4]=='s'){
				p[3]=S.back();S.pop_back();
				if(S.empty()){pos=false;break;}
				p[2]=S.back();S.pop_back();
				if(S.empty()){pos=false;break;}
				p[1]=S.back();S.pop_back();
				if(p[1]!='e'||p[2]!='r'||p[3]!='a'||p[4]!='s'||p[5]!='e'){pos=false;break;}
            }
			else{pos=false;break;}
		}
	}
	if(pos)cout<<"YES";
	else cout<<"NO";
}

Measured memory_bytes: 512
//AUTHOR: RAVAN_2070
//PUNE INSTITUTE OF COMPUTER TECHNOLOGY
/*                                                    
      I LOVE CLARICE STARLING...                                                               
        EXPLAINATION BELOW->
*/
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<pair<ll,ll>> vii;
typedef pair<ll,ll> pii;
typedef map<ll,ll> mii;
#define MOD7 1000000007
#define MOD9 1000000009
#define pi 3.1415926535
#define Test_cases ll TC;cin>>TC;while(TC--)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define sp(x) fixed<<setprecision(x)
#define sz(x) (ll)(x.size())
#define fo(i,a,b) for(i=a;i<b;i++)
#define foe(i,a,b) for(i=a;i<=b;i++)
void solve()
{
  int s,w;cin>>s>>w;
  if(w>=s)cout<<"unsafe\n";
  else cout<<"safe\n";
}
int main()
{
   fastio
   solve();
  return 0;
}
//map<ll,ll,greater<int>> to sort in descending order ,in iterator declaration no greater<int>
//if you want to apply lowerbound on set use s.lower_bound(key),not the one used for vector
// Syntax to create a min heap for priority queue priority_queue <int, vector<int>, greater<int>>; 
/* TIPS FOR DEBUGGING
 * Check if values are not overflowing (use long long where required)
 * Check if ranges are inclusive or not.
 * Check properly if greedy will work or not before using it.
 * Check EDGE CASES!! Seriously, even in 2B, saving 8 points by being
 * 2 minutes faster will bite you in the ass if you don't make sure
 * it works on edge cases.
 * Keep adding to this list.
*/


Measured memory_bytes: 3652
n, s = map(int, input().split())
a = list(map(int, input().split()))
dp = [[k + 1] + [0] * s for k in range(n + 1)] #dp[i][j] : 左からi個使ってぴったりj
for i in range(1, n + 1):
    for j in range(1, s + 1):
        if j - a[i - 1] < 0:
            dp[i][j] = dp[i - 1][j] % 998244353
        else:
            dp[i][j] = (dp[i - 1][j] + dp[i - 1][j - a[i - 1]]) % 998244353
ans = 0
for i in range(1, n + 1):
    ans += dp[i][s]
    ans %= 998244353
print(ans)

Measured memory_bytes: 120924
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
int main()
{
        int n;
        cin >> n;
        if (n == 3)
        {
                cout << "2 5 63" << endl;
                return 0;
        }
        if (n == 6)
        {
                cout << "2 4 6 12 3 9" << endl;
                return 0;
        }
        int two = n / 3;
        if (two > 5000)
        {
                two = 5000;
        }
        else
        {
                if (n % 3 == 0)
                {
                        two -= 2;
                }
        }
        int number2 = two * 3 - ((n - two * 3) % 2 == 1);
        int number3 = n - number2;
        for (int i = 1; i <= number2; i++)
        {
                cout << 2 * i << " ";
        }
        for (int i = 1; i <= number3; i++)
        {
                cout << (2 * i - 1) * 3 << " ";
        }
        cout << endl;
}


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

using namespace std;
using ll = long long;

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

    char s[15];
    stack<int> a;
    int tmp;
    while(scanf("%s", s) != EOF) {
        if(s[0] == '+') {
            tmp = a.top();
            a.pop();
            a.top() += tmp;
        } else if(s[0] == '-') {
            tmp = a.top();
            a.pop();
            a.top() -= tmp;
        } else if(s[0] == '*') {
            tmp = a.top();
            a.pop();
            a.top() *= tmp;
        } else {
            a.emplace(atoi(s));
        }
    }

    printf("%d\n", a.top());

    return 0;
}


Measured memory_bytes: 3224
#include<bits/stdc++.h>
using namespace std;
int a,b;
int main(){
	cin>>a>>b;
	if(a==1) a=14;
	if(b==1) b=14;
	if(a>b) cout<<"Alice";
	else
	   if(a==b)cout<<"Draw";
	   else
	      cout<<"Bob";
	return 0;
}

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

int main() {
  ll N, A, B;
  cin >> N >> A >> B;
  if (A > B || (N == 1 && A != B)) {
    cout << 0 << endl;
    return 0;
  }
  
  cout << (N-2) * (B-A) + 1 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <map>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
  int num;
  cin >> num;
  bool card[4][13];
  REP(i,4){
    REP(j,13){
      card[i][j]=false;
    }
  }
  char code;
  int pat,number;
  REP(i,num){
    cin >>code>>number;
    if(code=='S'){
      pat=0;
       card[pat][number-1]=true;
    }
    if(code=='H'){
      pat=1;
       card[pat][number-1]=true;
    }
    if(code=='C'){
      pat=2;
       card[pat][number-1]=true;
    }
    if(code=='D'){
      pat=3;
      card[pat][number-1]=true;
    }
  }
   REP(i,4){
    REP(j,13){
      if(card[i][j]==false){
        if(i==0)
          cout <<"S " <<j+1;
        else if(i==1)
          cout <<"H "<<j+1;
        else if(i==2)
          cout <<"C "<<j+1;
        else if(i==3)
          cout <<"D "<<j+1;
        cout <<endl;
      }
    }
  }
}

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

#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
struct Grid{int x,y,t;};
struct Edge{int to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
  const ll Inf = llINF;const int MAX_V=1010;vector<ll>d;
  Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
  void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
  void add_edge(int from,int to,int cost){E[from-1].pb({to-1,cost});}
};
int main(){
  string s,s2;
  cin>>s>>s2;
  int ma=0;
  string dp[2][s2.size()+1]={};
  for(int i=0;i<s.size();i++){
    for(int j=0;j<s2.size();j++){
      if(s[i]==s2[j]){
	dp[(i+1)%2][j+1]=dp[i%2][j]+s[i];
      }else{
	int a=i%2,b=(i+1)%2;
	if(dp[a][j+1].size()==0&&dp[b][j].size()==0)continue;
	if(dp[a][j+1].size()>dp[b][j].size())
	  dp[b][j+1]=dp[a][j+1];
	else
	  dp[b][j+1]=dp[b][j];
      }
    }
  }
  cout<<dp[s.size()%2][s2.size()]<<endl;
  return 0;
}

Measured memory_bytes: 16980
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb(x) push_back(x)
#define mp make_pair
#define sz(x) ((int)(x).size())
#define endl "\n"
#define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define all(x) x.begin(),x.end()
#define y1 omg
#define INF 1000000010
#define FOR(x, n) for(int x=0; x<n; x++)
#define ini(x, n) memset(x, n, sizeof(x));
#define ctoi(x) (x - '0')
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
 
int dx[] = { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
 
int n, ans;
vi v(200010);
unordered_map<int, int> M;
 
int main() {
	fastio;
	cin >> n;
	int b =0;
	int c = 0;
	int d = 0;
	int e = 0;
	int f = 0;
	FOR(i, n) {
		cin >> v[i + 1];
		M[v[i + 1]]++;
	}
	for (int i = 1; i <= n; i++) {
		int flag = 1;
		for (ll j = 1; j * j <= v[i]; j++) {
			if (v[i] % j == 0) {
				//v[i]/j, j
				if (j == v[i] && M[j] >= 2 || j != v[i] && M[j] >= 1 || v[i]/j == v[i] && M[v[i]/j] >= 2 || v[i]/j != v[i] && M[v[i]/j] >= 1) {
					flag = 0;
					break;
				}
			}
		}
		if (flag) ans++;
	}
	cout << ans;
}

Measured memory_bytes: 32420
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <unordered_map>
#include <map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
using namespace std;
typedef long long ll;

string S;

int main(){
    cin>>S;

    string ans="AC";
    if(S[0]!='A') ans="WA";
    int cnt=0;
    for(int i=2;i<S.size()-1;i++){
        if(S[i]=='C') cnt++;
    }
    if(cnt!=1) ans="WA";
    rep(i,S.size()){
        if(!(S[i]=='A' || S[i]=='C')){
            if(!('a'<=S[i] && S[i]<='z')) ans="WA";
        }
    }

    cout<<ans<<endl;
}

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

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

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


def main():
    rr = []

    st = string.digits + string.ascii_uppercase

    while True:
        n,m,q = LI()
        if n == 0:
            break

        a = [LS() for _ in range(q)]
        if n == 1:
            rr.append('0'*m)
            continue
        u = [0] * m
        v = [0] * m
        ms = 0
        mk = 2**n - 1
        for t,s in a:
            mt = int(t[::-1],2)
            tu = ms ^ mt
            tv = mk ^ tu
            for i in range(m):
                if s[i] == '1':
                    u[i] |= tu
                    v[i] |= tv
                else:
                    v[i] |= tu
                    u[i] |= tv
            ms = tu

        r = ''
        for i in range(m):
            t = None
            for ti in range(n):
                if (u[i] & 2**ti) > 0 and (v[i] & 2**ti) == 0:
                    if t is None:
                        t = st[ti]
                    else:
                        t = '?'
                        break
            if not t:
                t = '?'
            r += str(t)

        rr.append(r)

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


print(main())




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

// #define multitest 1
#ifdef Debug
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__);
#define pc(...) PC(#__VA_ARGS__, __VA_ARGS__);
template <typename T, typename U>
ostream &operator<<(ostream &out, const pair<T, U> &p)
{
	out << '[' << p.first << ", " << p.second << ']';
	return out;
}
template <typename Arg>
void PC(const char *name, Arg &&arg)
{
	std::cerr << name << " { ";
	for (const auto &v : arg)
		cerr << v << ' ';
	cerr << " }\n";
}
template <typename Arg1>
void ZZ(const char *name, Arg1 &&arg1)
{
	std::cerr << name << " = " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void ZZ(const char *names, Arg1 &&arg1, Args &&... args)
{
	const char *comma = strchr(names + 1, ',');
	std::cerr.write(names, comma - names) << " = " << arg1;
	ZZ(comma, args...);
}
#else
#define db(...)
#define pc(...)
#endif

using ll = long long;
#define f first
#define s second
#define pb push_back
const long long mod = 1000000007;
auto TimeStart = chrono::steady_clock::now();

const int nax = 2e5 + 10;

void solve()
{
	int n;
	cin >> n;
	vector<int> H(n);
	for (auto &x : H)
		cin >> x;
	for (int i = n - 1; i > 0; --i)
	{
		int diff = H[i] - H[i - 1];
		db(i, diff);
		if (diff < 0)
		{
			if (diff == -1)
			{
				H[i - 1]--;
			}
			else
			{
				cout << "No";
				return;
			}
		}
		db(i, H[i]);
	}
	pc(H);
	if (is_sorted(H.begin(), H.end()))
		cout << "Yes";
	else
		cout << "No";
	return;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int t = 1;
#ifdef multitest
	cin >> t;
#endif
	while (t--)
		solve();
#ifdef TIME
	cerr << "\n\nTime elapsed: " << chrono::duration<double>(chrono::steady_clock::now() - TimeStart).count() << " seconds.\n";
#endif
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i < (n);++i)
using namespace std;
using ll = long long; 
using P = pair<int,int>;
using vv = vector<vector<ll> >;
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;}

const int INF = 2147483647;
const int max_N = 1000000000;
const long long inf = 1ll << 60;
const long long mod = 1000000007;

int dx[4] = {1,0,-1,0};
int dy[4] = {0,-1,0,1};
int main(){
    int n;cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    int ans=0;
    sort(v.begin(),v.end());
    for(int i=0;i<n;i++){
        for(int j=i+1;j<n;j++){
            for(int k=j+1;k<n;k++){
                if(v[i]==v[j])continue;
                if(v[i]==v[k])continue;
                if(v[j]==v[k])continue;
                if((v[i]+v[j])>v[k]) ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3628
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
using namespace std;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

const int INF = 1001001001;
const int mod = 1000000007;
#define PI 3.14159265359;

void P(int x) {cout << x << endl;}
void P(long x) {cout << x << endl;}
void P(double x) {cout << x << endl;}
void P(ll x) {cout << x << endl;}
void P(string x) {cout << x << endl;}
void P(char x) {cout << x << endl;}

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;
  cin >> n;
  vector<int> v(n);
  int sum = 0;
  rep (i, n) {
    cin >> v[i];
    sum += v[i];
  }
  sort(v.begin(), v.end());
  if (sum % 10 == 0) {
    rep (i, n) {
      if (v[i] % 10 != 0) {
        P(sum - v[i]);
        return 0;
      }
    }
  } else {
    P(sum);
    return 0;
  }
  P(0);
  return 0;
}

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

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

        if (a == 1) a = 14;
        if (b == 1) b = 14;

        if (a == b) cout << "Draw" << endl;
        else if (a > b) cout << "Alice" << endl;
        else  cout << "Bob" << endl;
        
        return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define DEBUG fprintf(stderr, "Passing [%s] line %d\n", __FUNCTION__, __LINE__)
#define File(x) freopen(x".in","r",stdin); freopen(x".out","w",stdout)

using namespace std;

typedef long long LL;
typedef pair <int, int> PII;
typedef pair <int, PII> PIII;

template <typename T>
inline T gi()
{
	T f = 1, x = 0; char c = getchar();
	while (c < '0' || c > '9') {if (c == '-') f = -1; c = getchar();}
	while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return f * x;
}

const int INF = 0x3f3f3f3f, N = 100003, M = N << 1;

int n, fa[N];
char s[N];
bool vis[N];

int main()
{
	//File("");
	scanf("%s", s + 1);
	n = strlen(s + 1);
	if (s[n] == '1' || s[1] == '0' || s[n - 1] == '0') {puts("-1"); return 0;}
	for (int i = 2; i < n - 1; i+=1)
		if (s[i] == '1' && s[n - i] == '0') {puts("-1"); return 0;}
	int nowfa = 2, nowson = 1;
	vis[1] = vis[2] = true;
	fa[1] = 2;
	for (int i = 2; i < n; i+=1)
	{
		if (s[i] == '0')
		{
			while (vis[nowson]) ++nowson;
			fa[nowson] = nowfa;
			vis[nowson] = vis[nowfa] = true;
		}
		else
		{
			nowson = nowfa;
			while (vis[nowfa]) ++nowfa;
			fa[nowson] = nowfa;
			vis[nowson] = vis[nowfa] = true;
		}
	}
	int id = 0;
	for (int i = 1; i <= n; i+=1) if (fa[i] == 0) {id = i; break;}
	for (int i = 1; i <= n; i+=1)
		if (i != id)
			printf("%d %d\n", i, fa[i]);
	return 0;
}


Measured memory_bytes: 4256
import java.util.*;

public class Main {
	static class Factor {
		ArrayList<Long> f = new ArrayList<>();
		ArrayList<Integer> p = new ArrayList<>();
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] s = new long[N];
		for(int i=0; i<N; i++)
			s[i] = sc.nextLong();
		
		long[] norm = s.clone();
		HashMap<Long, Integer> cnt = new HashMap<>();
		HashMap<Long, Factor> map = new HashMap<>();
		for(int i=0; i<N; i++) {
			Factor fac = new Factor();
			long div = s[i];
			for(long j=2; j*j*j<=div; j++) {
				int k=0;
				while(div%j==0) {
					div /= j;
					k++;
					if(k%3==0)
						norm[i] /= j*j*j;
				}
				if(k%3>0) {
					fac.f.add(j);
					fac.p.add(k%3);
				}
			}
			long sqrt = (long)Math.floor(Math.sqrt(div+0.5));
			if(sqrt*sqrt==div && sqrt>1) {
				fac.f.add(sqrt);
				fac.p.add(2);
			} else {
				fac.f.add(div);
				fac.p.add(1);
			}
			if(!cnt.containsKey(norm[i])) {
				cnt.put(norm[i], 1);
				map.put(norm[i], fac);
			} else {
				cnt.put(norm[i], cnt.get(norm[i])+1);
			}
		}
		
		int ans = 0;
		
		for(Long key : cnt.keySet()) {
			if(key==1) {
				ans++;
			} else {
				int normCnt = cnt.get(key);
				long pair = 1;
				Factor cur = map.get(key);
				for(int i=0; i<cur.f.size(); i++) {
					for(int j=0; j<3-cur.p.get(i); j++) {
						double check = (double)pair*cur.f.get(i);
						if(check>10000000000l)
							pair = 0;
						else
							pair *= cur.f.get(i);
					}
				}
				int pairCnt = cnt.containsKey(pair) ? cnt.get(pair) : 0;
				if(normCnt > pairCnt || (normCnt==pairCnt && key>pair))
					ans += normCnt;
			}
		}
		
		System.out.println(ans);
		sc.close();
	}
}

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

int main(void){
    int N;
    cin >> N;
    int cum[N][2];
    for(int i = 0; i < N; i++)
        for(int j = 0; j < 2; j++)
            cin >> cum[i][j];

    int sum = 0;
    for(int i = 0; i < N; i++)
        sum += (cum[i][1]-cum[i][0]+1);

    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
import math

n, k = map(int,input().split())
list = [int(x) for x in input().split()]
list.sort()

l = 0
r = max(list)

while r - l > 1:
  count = 0
  x = (r + l)//2

  for i in range(len(list)):
    if x >= list[i]:
      continue
    count += math.ceil(list[i]/x) - 1

  if count <= k:
    r = x
  else:
    l = x

print(r)



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

const int N = 55;

long long k;

void init() {
	std::cin >> k;
}

void work() {
	static long long answer[N];

	long long n = 50;
	for (int i = 1; i <= n; i++) {
		answer[i] = n - 1 + k / n;
	}
	for (int i = 1; i <= k % n; i++) {
		answer[i] += n;
		answer[i] -= k % n - 1;
	}
	for (int i = k % n + 1; i <= n; i++) {
		answer[i] -= k % n;
	}

	std::cout << n << std::endl;
	for (int i = 1; i <= n; i++) {
		printf("%lld%c", answer[i], " \n"[i == n]);
	}
}

int main() {
	init();
	work();

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
using namespace std;

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

    for (int i = 0; i < T.size(); ++i) {
        if (T[i] == '?') {
            T[i] = 'D';
        }
    }

    cout << T << endl;

    return 0;
}

Measured memory_bytes: 3756
N=int(input())
W=list(map(int, input().split()))
S=sum(W)

M=float('inf')
for i in range(N):
  tmp_l=sum(W[:i+1])
  tmp_r=S-sum(W[:i+1])
  diff=abs(tmp_l-tmp_r)
  M=diff if diff<M else M
  
print(M)  



Measured memory_bytes: 3060
n,k = map(int,input().split())
A = list(map(int,input().split()))
mod = 10**9 + 7
if n ==1: print(0 if k> A[0] else 1);exit()
dp = [[0]*(k+1) for _ in range(n)]
for i in range(A[0]+1):
    dp[0][i] = 1
for i in range(1,n):
    B = [0]
    for j in range(k+1):
        B.append(B[-1] + dp[i-1][j])
        B[-1]%=mod
    for j in range(k+1):
        dp[i][j] += B[j+1]-B[max(0,j-A[i])]
        dp[i][j] %= mod
print(dp[-1][-1]%mod)

Measured memory_bytes: 217296
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).substr((f),(t)-(f)))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;cin >> s;
  ll n = s.size();
  for(int i=1;i<n;i++){
    if((n-i)%2)continue;
    bool fl = true;
    for(int j=0;j<(n-i)/2;j++){
      if(s[j] != s[(n-i)/2+j])fl = false;
    }
    if(fl){
      cout<<n-i<<endl;
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3


def solve(N, M, X, C, A):
    from itertools import product, compress
    ans = float('inf')
    for selectors in product([0, 1], repeat=N):
        cost = sum(compress(C, selectors), 0)
        x = [0] * M
        for a in compress(A, selectors):
            for i, aa in enumerate(a):
                x[i] += aa
        if all(xx >= X for xx in x):
            ans = min(ans, cost)
    return -1 if ans == float('inf') else ans

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    N, M, X = list(map(int, input().split()))
    C, A = [], []
    for _ in range(N):
        c, *a = map(int, input().split())
        C.append(c)
        A.append(a)
    print(solve(N, M, X, C, A))

def test():
    import doctest
    doctest.testmod()

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


Measured memory_bytes: 9028
n, m = map(int, input().split(" "))

count = [0 for i in range(0,n)]

for i in range(0, m):
    a, b = map(int, input().split(" "))
    count[a-1] += 1
    count[b-1] += 1

for i in range(0, n):
    print(count[i])


Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
#include<type_traits>
using namespace std;


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

const int mod = 1000000007;

int main(){
  int n, k;

  cin >> n >> k;

  int ans = 1;
  rep(i, n) ans = min(ans * 2, ans + k);

  cout << ans << endl;
}


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

// 復習場所
int main() {
    ll n;
    cin >> n;
    vector<int> ans;
    if(n==0){
        cout << '0' << endl;
        return 0;
    }
    ll keta;
    if(n>0){
        ll min_n = 0;
        ll max_n = 1;
        keta = 1;
        // 桁数とその範囲を調べる
        while(1){
            // cout << min_n << ':' << max_n << ':' << keta << endl;
            if(min_n<=n and n<=max_n){
                break;
            }
            keta += 2;
            min_n = max_n+1;
            max_n = min_n + pow(2, keta-1)-1;
        }
        ll num = n-min_n+1;
        for(int i=1; i<keta; i++){
            ll tmp_divide = pow(2,i);
            if(i%2){
                if(num%tmp_divide <= (tmp_divide)/2 and num%tmp_divide!=0){
                    ans.push_back(0);
                }else{
                    ans.push_back(1);
                }
            }else{
                if(num%tmp_divide <= (tmp_divide)/2 and num%tmp_divide!=0){
                    ans.push_back(1);
                }else{
                    ans.push_back(0);
                }
            }
        }

        ans.push_back(1);
        reverse(ans.begin(), ans.end());
        for(auto e: ans){
            cout << e;
        }
    }else{
        ll min_n = -2;
        ll max_n = -1;
        keta = 2;
        // 桁数とその範囲を調べる
        while(1){
            // cout << min_n << ':' << max_n << ':' << keta << endl;
            if(min_n<=n and n<=max_n){
                break;
            }
            keta += 2;
            max_n = min_n-1;
            min_n = max_n - pow(2, keta-1)+1;
        }
        ll num = max_n-n+1;
        for(int i=1; i<keta; i++){
            ll tmp_divide = pow(2,i);
            if(i%2){
                if(num%tmp_divide <= (tmp_divide)/2 and num%tmp_divide!=0){
                    ans.push_back(1);
                }else{
                    ans.push_back(0);
                }
            }else{
                if(num%tmp_divide <=(tmp_divide)/2 and num%tmp_divide!=0){
                    ans.push_back(0);
                }else{
                    ans.push_back(1);
                }
            }
        }

        ans.push_back(1);
        reverse(ans.begin(), ans.end());
        for(auto e: ans){
            cout << e;
        }
    }
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef long double ld;
const int INF = 1e9;

int main() {
  ll n, k;
  ld ans = 0, cnt = 0;
  cin >> n >> k;
  vector<ll> p(n);
  vector<ld> e(n);
  rep(i, n) cin >> p[i], e[i] = (1 + p[i]) / 2.0;
  rep(i, k) cnt += e[i];
  ans = max(ans, cnt);
  for (int i = k; i < n; ++i) {
    cnt += e[i] - e[i - k];
    ans = max(ans, cnt);
  }

  printf("%.10Lf", ans);
  return 0;
}


Measured memory_bytes: 7948
#include <utility>
#include <iostream>
#include <algorithm>
#include <cstdio>

class Paper
{
private :
    int data [10] [10];
private :
    static auto isValidX (int x) -> bool
    {
        return 0 <= x && x < 10;
    }
    static auto isValidY (int y) -> bool
    {
        return 0 <= y && y < 10;
    }
public :
    Paper ()
        : data {{{}}}
    {
    }
    auto increase (int x , int y) -> void
    {
        if (isValidX (x) && isValidY (y))
        {
            ++ data [x] [y];
        }
    }
    auto dropSmall (int x, int y) -> void
    {
        increase (x , y);
        increase (x - 1 , y);
        increase (x + 1 , y);
        increase (x , y - 1);
        increase (x , y + 1);
    }
    auto dropMidium (int x , int y) -> void
    {
        dropSmall (x , y);
        increase (x - 1 , y - 1);
        increase (x + 1 , y - 1);
        increase (x - 1 , y + 1);
        increase (x + 1 , y + 1);
    }
    auto dropLarge (int x , int y) -> void
    {
        dropMidium (x , y);
        increase (x - 2 , y);
        increase (x + 2 , y);
        increase (x , y - 2);
        increase (x , y + 2);
    }
    auto getResult () -> std::pair <int , int>
    {
        int zeroCellNum = 0;
        int maxValue = 0;
        for (auto && line : data)
        {
            for (auto && elem : line)
            {
                zeroCellNum += (elem == 0);
                maxValue = std::max (maxValue , elem);
            }
        }
        return std::make_pair (zeroCellNum , maxValue);
    }
};

auto main () -> int
{
    Paper paper;
    int x , y , size;
    while (std::scanf ("%d,%d,%d" , & x , & y , & size) == 3)
    {
        switch (size)
        {
        case 1:
            paper.dropSmall (x , y);
            break;
        case 2:
            paper.dropMidium (x , y);
            break;
        case 3:
            paper.dropLarge (x , y);
            break;
        }
    }
    auto res = paper.getResult ();
    std::cout << res.first << std::endl;
    std::cout << res.second << std::endl;
}

Measured memory_bytes: 3128
fun main() {
    val (N, K) = readLine()!!.split(' ').map(String::toInt)
    val list = IntArray(N)

    repeat(K) {
        readLine()!!
        val x = readLine()!!.split(" ").map { it.toInt() - 1 }
        x.forEach {
            list[it]++
        }
    }

    println(list.filter { it == 0 }.count())
}

Measured memory_bytes: 38848
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define repr4(i,s,n) for(ll i = (n);i>=(s);i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll,ll>>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/
const int mod = 1000000007;



int main(){
string S;
cin>>S;
rep(i,8){
    if((S.substr(0,i)+S.substr(S.size()-7+i,7-i)=="keyence")){
        cout<<"YES"<<endl;
        return 0;
    }

}

cout<<"NO"<<endl;

}

Measured memory_bytes: 3604
import java.util.Arrays;
import java.util.Scanner;
// ABC 085
public class Main {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int mochi = sc.nextInt();
        int[] size = new  int[mochi];
        for(int i = 0; i < mochi; i++) size[i] = sc.nextInt();
        Arrays.sort(size);
        int dan = 0;
        int kagamimochi = 0;
        for(int i = 0; i < mochi; i++) {
            if(kagamimochi < size[i]) {
                dan++;
                kagamimochi = size[i];
            }
        }
        System.out.println(dan);
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()		//sort(all(vi S)) sort(all(string S))
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }

using P = pair<int, int>;		//P.first, P.second
typedef long long ll;
typedef vector<int> vi;
typedef set<int> seti;
typedef vector<string> vs;

const int MOD = 1e9+7;
const int INF = 1e9;

int main() {
	int N,K;
	cin>>N>>K;
	int ans = 0;
	if(K != 1)ans = N-K;
	cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if(n<1000) {
            System.out.println("ABC");
            return;
        }
        n = n%1000+1;
        System.out.println("ABD");
    }
}

Measured memory_bytes: 23764
//minimum operations to reach y from x
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define ll long long

void solve()
{
	int x;
	cin>>x;
	if(x>=30)
	cout<<"Yes";
	else
	cout<<"No";
}

int main()
{
	int t;
	t=1;
	while(t--)
	solve();
}

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

#define REP(i,n) for(auto i=0;i<n;++i)
#define REPR(i,n) for(auto i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(auto i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define ll long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(n,v) {int tmp;for(int i=0;i<n;++i){scanf("%d",&tmp);v.push_back(tmp);}}

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  llong x, y, z;
  cin >> x >> y >> z;
  swap(x, y);
  swap(x, z);
  cout << x << " " << y << " " << z << endl;
  return 0;
}



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

int main(){
    int a[11]={0};
    for(int i=0;i<10;++i)cin >> a[i];
    sort(a, a+10, greater<int>());
    for(int i=0;i<3;++i)cout << a[i] << endl;

    return 0;
}


Measured memory_bytes: 3128
#include<stdio.h>
#define m 45

int N[m];

int F(int n){
  if(n==0 || n==1)return N[n]=1;
  if(N[n]!=-1)return N[n];
  return N[n]=F(n-1)+F(n-2);
}

int main(){
  int i, n;
  for(i=0 ; i<m ; i++)N[i]=-1;
  scanf("%d", &n);
  printf("%d\n", F(n));
  return 0;
}


Measured memory_bytes: 2116
#include<bits/stdc++.h>
#define ll long long
#define F first
#define S second
using namespace std;
int sai[100001];
int sai2[100001];
typedef pair<ll,char> P;

ll saishou(int a,int b){
    for(int i=2;i<100001;i++){
        if(sai[i]==-1) continue;
        while(a%i==0){
            a/=i;
            sai[i]++;
        }
        if(a==1) break;
    }
    
    for(int i=2;i<100001;i++){
        if(sai2[i]==-1) continue;
        while(b%i==0){
            b/=i;
            sai2[i]++;
        }
        if(b==1) break;
    }
    
    ll L=1;
    for(int i=2;i<100001;i++){
        if(sai[i]==-1) continue;
        if(sai[i]>sai2[i]){
            for(int j=0;j<sai[i];j++){
                L*=i;
            }
        }
        else if(sai2[i]>sai[i]){
            for(int j=0;j<sai2[i];j++){
                L*=i;
            }
        }
        else if(sai[i]==sai2[i]){
            for(int j=0;j<sai[i];j++){
                L*=i;
            }
        }
    }
    
    return L;
}

int main(){
    
    ll N,M;
    string S,T;
    
    cin>>N>>M;
    cin>>S>>T;
    
    if(M>N){
        ll tmp=M;
        M=N;
        N=tmp;
        string str=T;
        T=S;
        S=str;
    }
    for(int i=2;i*i<100001;i++){
        sai[i*i]=-1;
        sai2[i*i]=-1;
    }
    
    ll L=saishou(N,M);
    
    bool flag=true;
    
    vector<P> vec1;
    vector<P> vec2;
    
    vec1.push_back(make_pair(1,S[0]));
    vec2.push_back(make_pair(1,T[0]));
    
    for(ll i=1;i<=N;i++){
        vec1.push_back(make_pair(i*L/N+1,S[i]));
    }
    
    for(ll i=1;i<=M;i++){
        vec2.push_back(make_pair(i*L/M+1,T[i]));
    }
    
    int jtmp=0;
    for(int i=0;i<vec1.size();i++){
        for(int j=jtmp;j<vec2.size();j++){
            if(vec1[i].F==vec2[j].F){
                if(vec1[i].S!=vec2[j].S){
                    flag=false;
                    break;
                }
            }
            if(vec1[i].F>vec2[j].F){
                jtmp=j;
            }
            if(vec1[i].F<vec2[j].F) break;
            
        }
        if(!flag) break;
    }
    
    if(flag) cout<<L<<endl;
    else cout<<-1<<endl;
    return 0;
}


Measured memory_bytes: 5812
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void solve()
{
	string s;
	ll i,m=0,s1=0;
	cin>>s;
	for(i=0;i<s.length();i++)
	{
		if(s[i]=='R')
		{
			s1++;
			continue;
		}
		else
		{
			m=max(m,s1);
			s1=0;
		}
	}
	m=max(m,s1);
	cout<<m<<endl;return;



}





int main()
{
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif

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

	while (t--)
	{	
		solve();
	}


	return 0;
}


Measured memory_bytes: 3592
def main():
    from math import floor

    K = int(input())
    A, B = map(int, input().split())

    multiple = floor(B / K) * K  # B以下の最大のKの倍数
    cond = (A <= multiple)  # A以上なら範囲内にある

    print('OK' if cond else 'NG')


if __name__ == '__main__':
    main()
   

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

using namespace std;

int main()
{
  int A,B;
  cin >> A >> B;
  int ans = 0;
  for( int i=A;i<B+1;i++ )
    {
      int a = i;
      vector<int> s;
      while( a>0 )
	{
	  s.push_back(a%10);
	  a /= 10;
	}
      bool flg = true;
      for( int j=0;j<s.size()/2+1;j++)
	{
	  if(s[j] != s[s.size()-1-j] )
	    flg = false;
	}
      if(flg)
	  ans++;
    }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define Phuong ios_base::sync_with_stdio(0); cin.tie(0);

typedef long long ll;
using namespace std;
const int MAXN = 2*1e5 +5;
const int mod = 1e9 + 7;
int n,m;
int k;
vector<ll> a;
vector<int>h;
ll fen[MAXN];


void update(int x, ll v)
{
    while (x<=MAXN)
    {
        fen[x]=max(fen[x],v);
        x+=(x&-x);
    }
}

ll get(int x)
{
    ll res=0;
    while (x>=1)
    {
        res=max(res,fen[x]);
        x-=(x&-x);
    }
    return res;
}

int main()
{
    Phuong;
    //freopen("input.txt", "r", stdin);
    cin >> n;
    a = vector<ll> (n);
    h=  vector<int> (n);
    for(int i=0; i<n; ++i)
        cin >> h[i];
    for(int i=0; i<n; ++i) cin >> a[i];
    ll ans=0;
    for(int i=0; i<n; ++i)
    {
        ll sum =get(h[i]);
        sum+=a[i];
        update(h[i], sum);
        ans=max(ans,sum);
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 4224
#a,b,c = map(int,inpput().split(" "))
#n = int(input())
#print(a,b,c)
t=[]
for i in range(5):
    t.append(int(input()))
#n = int(input())
def dif(x):
    s = int(x/10)
    if s * 10 == x:
        return 0
    else:
        return (s+1)*10 -x

def comp(a,b):
    a1 = dif(a)
    b1 = dif(b)
    return a1 < b1
d = sorted(t, key=lambda x: dif(x))

sum = 0
for i in range(4):
    if int(d[i]/10)*10 ==d[i]:
        sum = sum+d[i]
    else:
        sum += (int(d[i]/10)+1)*10
print(sum + d[4])

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

using namespace std;

int root(vector<int>& uf, int n) {
	if (uf[n] == n) return n;

	return uf[n] = root(uf, uf[n]);
}

int main() {
	int n;
	while ( cin >> n, n ) {
		vector< vector<int> > v(30);
		for (int i = 0; i < n; ++i) {
			int f; cin >> f;
			for (int j = 0; j < f; ++j) {
				int d; cin >> d; --d;
				v[d].push_back(i);
			}
		}

		int ans = -1;
		for (int d = 0; d < 30; ++d) {
			vector<bool> f(n, false);
			for (int i = 0; i < v[d].size(); ++i) {
				f[v[d][i]] = true;
			}
			for (int i = d-1; i >= 0; --i) {
				bool flag = false;
				for (int j = 0; j < v[i].size(); ++j) {
					if (f[v[i][j]]) flag = true;
				}
				if (flag) {
					for (int j = 0; j < v[i].size(); ++j) {
						f[v[i][j]] = true;
					}
				}
			}

			bool flag = true;
			for (int i = 0; i < n; ++i) {
				if ( !f[i] ) {
					flag = false;
				}
			}
			if (flag) {
				ans = d+1;
				break;
			}
		}
		cout << ans << endl;
	}
}

Measured memory_bytes: 1232
k, n = map(int, input().split())
a = list(map(int, input().split()))

a.append(a[0] + k)
x = k - a[-2]
a.insert(0, x)

li = []
for i in range(1, n+1):
    d = min(k - abs(a[i]-a[i-1]), k - abs(a[i]-a[i+1]))
    li.append(d)

ans = min(li)
print(ans)

Measured memory_bytes: 86860
// #pragma GCC optimize("unroll-loops", "omit-frame-pointer", "inline")
// #pragma GCC option("arch=native", "tune=native", "no-zero-upper")
// #pragma GCC
// target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("tree-vectorize","openmp","predictive-commoning")
// #pragma GCC option("D_GLIBCXX_PARALLEL","openmp")

// #pragma GCC optimize("O3")
// #pragma GCC target("avx2")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<ll> vll;
// #define int long long
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000              // 2e9
#define LLINF 2000000000000000000ll // 2e18 (llmax:9e18)
#define fi first
#define sec second
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))
#define dmp(x) cerr << #x << ": " << x << endl;

template <class T>
void chmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, const T &b) {
  if (a < b) a = b;
}

template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template <class T>
vector<T> vect(int len, T elem) {
  return vector<T>(len, elem);
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << p.fi << ',' << p.sec;
  return os;
}
template <class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.fi >> p.sec;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i];
    if (i + 1 < vec.size()) os << ' ';
  }
  return os;
}
template <class T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) is >> vec[i];
  return is;
}
void fastio() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
}

#define endl "\n"

void solve() {
  int k;
  cin >> k;
  string ans;
  for (int i = 0; i < k; i++) ans += "ACL";
  cout << ans << endl;
  return;
}

signed main() {
  fastio();
  solve();
  // int t; cin >> t; while(t--)solve();

  // int t; cin >> t;
  // for(int i=1;i<=t;i++){
  //   cout << "Case #" << i << ": ";
  //   solve();
  // }
  return 0;
}


Measured memory_bytes: 3568
N, D = [int(x) for x in input().split()]
X = [input() for i in range(N)]
answer = 0
for i in range(N):
    for j in reversed(range(N)):
        if i == j:
            break
        else:
            answer_list = []
            X_list = [int(x) for x in X[i].split()]
            X_list_rev = [int(x) for x in X[j].split()]
            for k in range(D):
                answer_list.append(abs(X_list[k] - X_list_rev[k])**2)
            if sum(answer_list)**0.5 % 1 == 0:
                answer += 1
print(answer)

Measured memory_bytes: 3188
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <stdlib.h>
#include <math.h>

using namespace std;

//nが素数かどうかを判定する関数
int isPrime(int n) {
	if(n == 0) return 0;
	if(n == 1) return 0;

	int flg = 1;
	for(int i = 2; i < (int)sqrt((double)n) + 1; i++) {
		if( n % i == 0 ) {
			flg = 0;
			break;
		}
	}
	return flg;
}

int main(void){
	//FILE* fp_in = freopen("data.txt", "r", stdin);

	while(1) {
		int n, ans = 0;
		cin >> n;
		if( n == 0 ) break;
		for(int i = n + 1 ; i <= 2 * n; i ++) 
			if(isPrime(i)) ans ++;

		cout << ans << endl;
	}

	
	//while(1){}
	return 0;
}

Measured memory_bytes: 1160
N, K = map(int, input().split())
As = list(map(int, input().split()))
As = [A-1 for A in As]
Vs = [False]*N
p = 0
Rs = [p]
Vs[p] = True
for i in range(N+3):
  n = As[p]
  Rs.append(n)
  if Vs[n]:
    break
  p = n
  Vs[p] = True
p0 = Rs.index(Rs[-1])
#print(Rs, p0)
if K <= p0:
  r = Rs[K]
else:
  r = Rs[p0+(K-p0)%(len(Rs)-p0-1)]
print(r+1)


Measured memory_bytes: 32376
/// You just can't beat the person who never gives up
/// ICPC next year


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sz(x) ((long long)(x).size())
#define all(x)  x.begin(),x.end()
#define rall(x) (x).rbegin(), (x).rend()
#define endl "\n"
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define leastsigbit(x)     __builtin_ffs(x)
#define mod             1000000007
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define pii pair<ll,ll>
#define vpii vector<pii>
#define tt ll tt;cin >> tt;while(tt--)
#define  fio ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define D1(x) { cerr << " [" << #x << ": " << x << "]\n"; }
#define D2(x) { cerr << " [" << #x << ": "; for(auto it:x) cerr << it << " "; cerr << "]\n";}
const double PI = acos(-1);
ll power(ll a,ll b,ll m=mod){ ll ans=1; a=a%m;  while(b>0) {  if(b&1)  ans=(1ll*a*ans)%m; b>>=1;a=(1ll*a*a)%m;}return ans;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll lcm( ll x, ll y) { return (x*y)/gcd(x,y);}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
bool isPowerOfTwo(int x)
{
    /* First x in the below expression is for the case when x is 0 */
    return x && (!(x&(x-1)));
}
void offset(vector<int>&a,int x) {
    for(int i = 0; i < sz(a);i++) {
        a[i] = x;
    }
}
struct cmp {
    bool operator() (const pair<int,int>& lhs, const pair<int,int>& rhs) const {
        return lhs.ff * rhs.ss < lhs.ss * rhs.ff;
    }
//for map<pii,int>
};


// auto cmp = [](pair<int,int>a,pair<int,int>b) {if(a.first==b.first)return a.second>b.second;
//      else return a.first > b.first;
//  };
//  multiset<pair<int,int>,decltype(cmp)>fc(cmp);
double distform(int x, int y, int z, int w) {//(x1,y1,x2,y2)
    return sqrt(1. * pow(x-z,2) + 1. * pow(y-w,2));
}
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
    //unordered_map<long long, int, custom_hash> safe_map;
};

const int MAXN = 2e5+ 10;

#define int long long
bool cmps(pair<int,int>p1,pair<int,int>p2) {
    return p1.ss > p2.ss;
}
int32_t main() {
    fio
    int x;
    cin >> x;
    if(x >= 30) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    };

    cerr <<endl <<"[ Time : " << (float)clock() / CLOCKS_PER_SEC << " secs ]" << endl;


}






Measured memory_bytes: 3860
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int X = sc.nextInt();
    int Y = sc.nextInt();
    int Z = sc.nextInt();
    int a = X - Z;
    int b = Y + Z;
    System.out.println(a/b);
  }
}

Measured memory_bytes: 21972
n,k = map(int,input().split())
l = list(map(int,input().split()))
mod = 10**9+7
a = 0
for i in range(n):
  b = l[i]
  t = (len([1 for m in l if  m<b])%mod)*(int( (k-1)%mod*k//2)%mod)%mod
 # print(i,b,t)
  s = (len([1 for m in l[i:] if m<b])%mod)*k%mod
#  print(s)
  a += (s+t)%mod
print(a%mod)

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

int main() {
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    sort(a,a+3);
    cout << a[0] << " " << a[1] << " " << a[2] << endl;
    return 0;
}

Measured memory_bytes: 1180