akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#define MAX 2000000
int H,A[MAX+1];

void maxHeapify(int);
void swap(int *x ,int *y );

int main(){
int i,k;

scanf("%d", &H);

 for ( i = 1; i <= H; i++ ){
   scanf("%d",&A[i]);
 }

 for ( i = H/2; i >= 1; i-- ){
   maxHeapify(i);
 }

   for ( i = 1; i <= H; i++ ){
   printf(" %d",A[i]);
 }
   printf("\n");

 return 0;
}

void maxHeapify(int i){
  int l,r,largest;

  l=2*i;
  r=2*i+1;

   if (l<=H && A[l]>A[i]){
     largest=l;
   } 
   else{
     largest=i;
   }
   if (r<=H && A[r]>A[largest]){
     largest=r;
   }
 if (largest!=i){
   swap(&A[i],&A[largest]);
   maxHeapify(largest);
   }
}

void swap(int *x, int *y){
    int  work;      

    work = *x;       
    *x = *y;          
    *y = work;      
}

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

int main() {
	string s, k = "CODEFESTIVAL2016";
	int a = 0;
	cin >> s;
	for(int i = 0;i < 16; i++){
		if(s[i] != k[i]){
			a++;
		}
	}
	cout << a << endl;
	return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))

A.sort()
flag = 0

for i in reversed(range(int(A[1])+1)):
    for k in range(N):
        if A[k]%i != 0:
            flag+=1
            if flag >1:
                flag = 0
                break
        if k >= N-1:
            print(i)
            exit()


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

const ll mod = 1e9+7;

int main(){ 
  int n;
  cin>>n;
  vector<int> dp(400,-1);
  dp[0] = 0;
  rep(i,n){
    int s,l,p;
    cin>>s>>l>>p;
    rep(j,399)for(int k=s;k<=l;k++){
      if(j+k<400&&dp[j]>=0) dp[j+k] = max(dp[j+k],dp[j]+p);
    }
  }
  int m;
  cin>>m;
  vector<int> w(m);
  rep(i,m){
    cin>>w[i];
    if(dp[w[i]] == -1){
      cout << -1 << endl;
      return 0;
    }
  }
  rep(i,m) cout<<dp[w[i]]<<endl;
}


Measured memory_bytes: 3096
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > Q;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const ll inf=1e9+7;
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 n;

int main(){
  cin>>n;
  vector<int> d(n);

  rep(i,n) cin>>d[i];

  sort(d.begin(),d.end());
  cout<<d[n/2]-d[n/2-1]<<endl;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define INS(x) x.begin(),x.end()

const int mod=1e9+7;

long long fast_power(long long x,long long y)
{
    long long ans=1;
    while (y)
    {
        if (y&1)
            ans=ans*x%mod;
        x=x*x%mod;
        y>>=1;
    }
    return ans;
}

long long c(int n,int m)
{
	if (m<n-m) m=n-m;
	long long ans=1;
	for (int i=m+1;i<=n;i++) ans=ans*i%mod;
	for (int i=1;i<=n-m;i++) ans=ans*fast_power(i,mod-2)%mod;
	return ans;
}

    
int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n,a,b;
    cin>>n>>a>>b;

	cout<<(mod*2+fast_power(2,n)-c(n,a)-c(n,b)-1)%mod<<'\n';
    
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#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 AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll N;
  cin >> N;
  vvl DP = VVL(N + 2, N + 2, 0);
  REP(j, N) DP[1][j] = 1;
  string S;
  cin >> S;
  FOR(i, 1, N) {
    REP(j, N - i + 1) {
      if (S[i - 1] == '<') {
        DP[i + 1][0] += DP[i][j];
        DP[i + 1][0] %= MOD;
        DP[i + 1][j] += MOD - DP[i][j];
        DP[i + 1][j] %= MOD;
      } else {
        DP[i + 1][j] += DP[i][j];
        DP[i + 1][j] %= MOD;
        DP[i + 1][N - i] += MOD - DP[i][j];
        DP[i + 1][N - i] %= MOD;
      }
    }
    FOR(j, 1, N + 1) DP[i + 1][j] = (DP[i + 1][j] + DP[i + 1][j - 1]) % MOD;
  }
  cout << DP[N][0] << endl;

  return 0;
}


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

cnt = 0
for _ in range(N):
    n = int(input())
    if n!=2 and n%2 == 0:
        cnt += 1
        continue
    i = 3
    while i**2 <= n:
        if n%i == 0:
            cnt += 1
            break
        i += 2

print(N-cnt)



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

int main(){
    int n, x, y;
    cin >> n >> x >> y;
    vector<int> ans(n, 0);

    x--;
    y--;
    for(int i = 0; i < n - 1; i++){
        for(int j = i + 1; j < n; j++){
            if(i < x && j <= x) ans[j - i]++;
            else if(i >= y && j > y) ans[j - i]++;
            else if(i <= x && j >= y) ans[j - y + x - i + 1]++;
            else if(i > x && j >= y) ans[min(j - i, j - y + i - x + 1)]++;
            else if(i <= x && j < y) ans[min(j - i, y - j + x - i + 1)]++;
            else ans[min(j - i, y - j + i - x + 1)]++;
        }
    }

    for(int i = 1; i < n; i++) cout << ans[i] << endl;
    return 0;
}

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

int main(){
	int a, b;cin >> a >> b;
	if((int)round(12.5*(a+1)) <= 10*b || (int)round(12.5*(a)) >= 10*(b+1)){
		cout << -1;
	}else{
		int ans = max((int)round(12.5*a), 10*b);
		cout << ans;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <functional>

using namespace std;
 
#define mod 1000000007
#define FOR(x,to) for(int x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define long long long
inline int rei(){int x;cin>>x;return x;}
inline long rel(){long x;cin>>x;return x;}
inline string res(){string x;cin>>x;return x;}
//------------------------------------------------------- 
void Calc(){
	int N = rei();
	int M = rei();
	int L = 1;
	int R = N;
	for(int i=0;i<M;i++){
		int l = rei();
		int r = rei();
		L = max(L,l);
		R = min(R,r);
	}
	cout << max(0,R-L+1) << endl;
}
int main(int argc,char** argv){
	ios::sync_with_stdio(false), cin.tie(0);
	cout.tie(0); Calc(); return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
    char to_upper (string x){
    	if(x[0]>=97){
    		return x[0]-32;
		}
    	
    	
	}
int main(){
    string s1,s2,s3;
    cin>>s1>>s2>>s3;
    
     cout<<to_upper(s1)<<to_upper(s2)<<to_upper(s3)<<endl;
    
	return 0;
}

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

int main() {
  int k;
  cin >> k;
  
  if(k%2 == 0)
    cout << k*k/4 << endl;
  else
    cout << (k+1)*(k-1)/4 << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int n,m;
    int a[50],b[50];
    cin >> n >> m;
    for(int i=0 ; i<m ; i++){
        cin >> a[i] >>b[i];
        a[i] -= 1;
        b[i] -= 1;
    }

    int ans[50];
    for(int i = 0 ; i < n ; i++){
        ans[i] = 0  ;
    }
    for(int  i = 0 ; i < n ; i++){ 
        for(int j = 0 ; j < m ; j++){
            if(a[j] == i || b[j] == i){
                ans[i] += 1;
            }
        }
    }
    for(int i = 0; i < n; i++){
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//#include<boost/multiprecision/cpp_int.hpp>
//#include<boost/multiprecision/cpp_dec_float.hpp>
//namespace mp=boost::multiprecision;
//#define mulint mp::cpp_int
//#define mulfloat mp::cpp_dec_float_100
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
constexpr int MOD=1000000007;
//constexpr int MOD=998244353;
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcountll(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
#define fi first
#define se second
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};
const int MAX_N=2e5+5;
//struct edge{lint to,num;};

vector<int> edge[MAX_N];
bool reach[MAX_N];
lint dis[MAX_N];

void dfs(int now){
    if(reach[now]) return;
    reach[now]=true;
    rep(i,edge[now].size()){
    }
}

bool lis[8][8];

int main(void){
    int N,M;
    cin >> N >> M;
    rep(i,M){
        int u,v;
        cin >> u >> v;
        u--,v--;
        lis[u][v]=true;
        lis[v][u]=true;
    }
    int path[N];
    rep(i,N) path[i]=i;
    int ans=0;
    do{
        bool chk=true;
        if(path[0]!=0) continue;
        rep(i,N-1) if(!lis[path[i]][path[i+1]]) chk=false;
        if(chk) ans++;
    }while(next_permutation(path,path+N));
    cout << ans << endl;
}

Measured memory_bytes: 8304
import java.util.*;

class Main{

    public static void main(String[] args){

	Scanner sc = new Scanner(System.in);

	int A = sc.nextInt();

	int B = sc.nextInt();

	if((A-B)>=(A*B) && (A-B)>=(A+B)){

	System.out.println(A-B);	

  }

	else if((A*B)>=(A-B) && (A*B)>=(A+B)){

	System.out.println(A*B);	

  }	

	else if((A+B)>=(A-B) && (A+B)>=(A*B)){

	System.out.println(A+B);	

  }

 }
}

Measured memory_bytes: 23380
//Jay Shree Krishna

#include"bits/stdc++.h"
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ll long long int
#define inf 1e18+5
#define sr string
#define M 1000000007
#define start int t;cin>>t;while(t--)
#define db(x) cout<<#x<<"="<<x<<"\n"
#define db2(a,b)cout<<#a<<": "<<a<<" , "<<#b<<": "<<b<< endl;
#define db3(a,b,c)cout<<#a<<": "<<a<<" , "<<#b<<": "<<b<<" , "<<#c<<": "<<c<<endl;
#define forr(i, n) for (int i = 0; i < n; i++)
#define fr(i, n) for (int i = 1; i <= n; i++)
#define rep(i,j,k) for(int i = j; i < k; i++)
#define rp(i,j,k) for(int i = j; i <=k; i++)
#define nn "\n"
#define en "\n"
#define vvi vector<vector<int>>
#define vi vector<int>
#define si set<int>
#define mlsi multiset<int>
#define vc vector<char>
#define vli vector<long long int>
#define vpii vector<pair<ll,ll>>
#define pii pair<ll,ll>
#define mii map<ll,ll>
#define msi map<string,int>
#define mci map<char,int>
#define umii unordered_map<int,int>
#define umsi unordered_map<string,int>
#define umci unordered_map<char,int>
#define mkp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define sortv(x) sort(x.begin(),x.end())
#define sorta(x,n) sort(x,x+n)
#define sorted(x) is_sorted(x.begin(),x.end())
#define print_all(x) for(auto t:x) cout<<t<<" ";cout<<en;
#define mxe(x) *max_element(all(x))
#define mne(x) *min_element(all(x))
#define ub upper_bound
#define lb lower_bound
#define go(x) for(auto &[u,v]:x)
#define in(x) cin>>x
#define in2(x,y) cin>>x>>y
#define in3(x,y,z) cin>>x>>y>>z
#define in4(x,y,z,v) cin>>x>>y>>z>>v
#define oo(x) cout<<x<<en
#define oo2(x,y) cout<<x<<" "<<y<<en
#define oo3(x,y,z) cout<<x<<" "<<y<<" "<<z<<en
#define ood(n,x) cout<<fixed<<setprecision(n)<<x<<"\n"
#define sz(x) x.size()
#define ff first
#define ss second
#define ooy cout<<"YES\n"
#define oon cout<<"NO\n" 
#define rr return
#define cc continue

using namespace std;

template<class T> bool ckmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<class T> bool ckmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }
 
void read(vli &a,int n){
    a.resize(n);
    forr(i,n) cin>>a[i];
}

bool fine=0;
vli a,b;
ll n,m;
ll ans=0;

void solve(){
    in(n);
    while(n--){
        cout<<"ACL";
    }
}

int main(){
   #ifndef ONLINE_JUDGE 
    freopen("input1.txt", "r", stdin); 
    freopen("error.txt", "w", stderr); 
    freopen("output1.txt", "w", stdout); 
    #endif
    fast;
    if(fine){
        start{
            solve();
        }
   }
   else solve();
    return 0;
}


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

int seen[100][100];
int pic[4][50][50];

int main(){
  int n,m;

  for(;;){
    cin >> n >> m;
    if(!n && !m)break;

    for(int i=0;i<n;i++)
      for(int j=0;j<n;j++)cin >> seen[i][j];

    for(int i=0;i<m;i++)
      for(int j=0;j<m;j++)cin >> pic[0][i][j];

    for(int i=1;i<4;i++)
      for(int j=0;j<m;j++)
	for(int k=0;k<m;k++)pic[i][j][k] = pic[i-1][m-k-1][j];

    int ansx = -1,ansy = -1;
    for(int i=0;i+m-1<n;i++)
      for(int j=0;j+m-1<n;j++)
	for(int k=0;k<4;k++){
	  int tmpx = -1,tmpy = -1;
	  bool f = true;
	  for(int l=0;l<m;l++)
	    for(int h=0;h<m;h++)
	      if(pic[k][l][h]>=0){
		if(pic[k][l][h] != seen[i+l][j+h]){
		  f = false;
		  break;
		}else if(tmpx<0){
		  tmpy = i+l;
		  tmpx = j+h;
		}
	      }

	  if(f){
	    if(ansx<0 || ansy>tmpy || (ansy==tmpy && ansx>tmpx)){
	      ansy = tmpy;
	      ansx = tmpx;
	    }
	  }
	}
    if(ansx<0)cout << "NA\n";
    else cout << ansx+1 << " " << ansy+1 << endl;
  
  }
}

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

#define rep(i, m, n) for(int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for(int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9 + 7;
//constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;

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

struct Edge {
    ll to, rev;
    long double cap;
    Edge(ll _to, long double _cap, ll _rev) {
        to = _to;
        cap = _cap;
        rev = _rev;
    }
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph &G, ll from, ll to, long double cap, bool revFlag,
              long double revCap) {
    G[from].push_back(Edge(to, cap, (ll)G[to].size()));
    if(revFlag)
        G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1LL;
    while(n > 0) {
        if(n & 1)
            res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

ll mod_inv(ll x, ll mod) {
    return mod_pow(x, mod - 2, mod);
}

void solve() {
    int p;
    cin >> p;
    vec<ll> a(p);
    REP(i, p) {
        cin >> a[i];
    }

    vec<ll> fact(p, 1);
    REP(i, p - 1) {
        fact[i + 1] = fact[i] * (i + 1) % p;
    }
    vec<ll> inv(p, 0);
    REP(i, p) {
        inv[i] = mod_inv(fact[i], p);
    }

    auto nCr = [&](int n, int r) {
        return fact[n] * inv[r] % p * inv[n - r] % p;
    };

    vec<ll> b(p, 0);
    REP(i, p) {
        if(!a[i])
            continue;
        vec<int> f(p, 0);
        REP(j, p) {
            b[j] += p - mod_pow((p - i) % p, p - 1 - j, p) * nCr(p - 1, j) % p;
            b[j] %= p;
        }
        b[0]++;
        b[0] %= p;
    }
    for(auto i : b)
        cout << i << " ";
    cout << en;
}

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

    solve();
    /*
    ll t;
    cin >> t;
    REP(i, t) { solve(); }*/

    return 0;
}


Measured memory_bytes: 3720
package main

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

func readLine(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func readInt(sc *bufio.Scanner) (res int) {
	res, _ =strconv.Atoi(readLine(sc))
	return
}

func readInts(sc *bufio.Scanner, n int) []int {
	ns := strings.Split(readLine(sc), " ")
	res := make([]int, n)

	for i, n := range ns {
		res[i], _ = strconv.Atoi(n)
	}
	return res
}

func readInt64s(sc *bufio.Scanner, n int) []int64 {
	ns := strings.Split(readLine(sc), " ")
	res := make([]int64, n)

	for i, n := range ns {
		res[i], _ = strconv.ParseInt(n, 10, 64)
	}
	return res
}

func readMatrix(sc *bufio.Scanner, rows, cols int) [][]int {
	res := make([][]int, rows)
	for i := 0; i < rows; i ++ {
		res[i] = readInts(sc, cols)
	}
	return res
}

func main() {
	sc := bufio.NewScanner(os.Stdin)

	xs := readInts(sc, 3)

	w := xs[0]
	a := xs[1]
	b := xs[2]

	if a <= b + w && b <= a + w {
		fmt.Println(0)
	} else if a > b + w {
		fmt.Println(a - (b + w))
	} else {
		fmt.Println(b - (a + w))
	}
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rep1(i, n) for (ll i = 1; i <= (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#define to_s to_string
#define len(v) (ll)v.size()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define print(x) cout << (x) << '\n'
#define debug(x) cout << #x << ": " << (x) << '\n'
using namespace std;
using ll = long long;
typedef pair<ll, ll> P;
ll MOD = 1e9 + 7;
ll devc(ll x, ll y) { return 1 + (x - 1) / y; }

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);

    string S;
    cin >> S;
    string ans = "";
    rep(i, len(S)) ans += 'x';
    print(ans);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ll l,r;
    cin >> l >> r;
    if((l - 1)/2019 != (r )/2019){
    	cout << 0 << endl;
    	return 0;
    }
    ll L = l % 2019;
    ll R = r % 2019;
    ll ans = 2018;
    for(ll i = L ; i <= R ; i++ ){
    	for(ll j = i + 1 ; j <= R ; j++){
    		ans = min(ans , ((i) *(j))%2019);
    	}
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    string s1,s2;
    for(int i=0;i<a;i++)
        s1+='0'+b;
    for(int i=0;i<b;i++)
        s2+='0'+a;
    cout<<min(s1,s2);
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main()
{
	string s; cin>>s;
  int check=0;
  for(int i=0;i<s.size();i++)
    if(s[i]=='A')check++;
       
   if(check==0||check==3)cout<<"No";
   else cout<<"Yes";
       
       return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

map<ll, int> prime_factor(ll n){
    map<ll, int> res;
    for(ll i = 2; i*i <= n; i++){
        while (n % i == 0){
            res[i]++;
            n /= i;
        }
    }
    if(n != 1) res[n]++;
    return res;
}

int main(void)
{
    ll N,P;
    cin >> N >> P;

    if(N >= P){
        pr(1);
        return 0;
    }
    if(N == 1){
        pr(P);
        return 0;
    }
    if(P == 1){
        pr(1);
        return 0;
    }
    auto d = prime_factor(P);

    ll ans = 1;
    for(auto&& i : d) {
        // pr(i.fi, i.se);
        // pr(i.fi, i.se);
        ans *= pow(i.fi, i.se/N);
        // while(i.se >= N){
        //     ans *= i.fi;
        //     i.se -= N;
        // }
    }


    pr(ans);
}

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

int a, b;

int main(){
  cin >> a >> b;
  int x_1, x_2;
  int tax_1, tax_2;
  
  x_1 = ceil(a * 12.5);
  tax_1 = floor(x_1 * 0.1);
  
  x_2 = ceil(b * 10);
  tax_2 = floor(x_2 * 0.08);
  
  if(tax_1 == b && tax_2 != a){
    cout << x_1 << endl;
  }
  else if(tax_2 == a && tax_1 != b){
    cout << x_2 << endl;
  }
  else if(tax_1 == b && tax_2 == a){
    if(x_1 < x_2){
      cout << x_1 << endl;
    }
    else{
      cout << x_2 << endl;
    }
  }
  else{
    cout << -1 << endl;
  }
}

Measured memory_bytes: 256
import sys

A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = int(input())
index_A1 = -1
index_A2 = -1
index_A3 = -1
result_A1 = [0, 0, 0]
result_A2 = [0, 0, 0]
result_A3 = [0, 0, 0]

for i in range(N):
    b = int(input())
    try:
        index_A1 = A1.index(b)
        if index_A1 > -1:
            result_A1[index_A1] = 1
    except ValueError:
        index_A1 = -1

    try:
        index_A2 = A2.index(b)
        if index_A2 > -1:
            result_A2[index_A2] = 1
    except ValueError:
        index_A2 = -1

    try:
        index_A3 = A3.index(b)
        if index_A3 > -1:
            result_A3[index_A3] = 1
    except ValueError:
        index_A3 = -1

if sum(result_A1) == 3 or sum(result_A2) == 3 or sum(result_A3) == 3:
    print('Yes')
    sys.exit()

for i in range(3):
    if result_A1[i] + result_A2[i] + result_A3[i] == 3:
        print('Yes')
        sys.exit()

if result_A1[0] + result_A2[1] + result_A3[2] == 3:
    print('Yes')
    sys.exit()

if result_A3[0] + result_A2[1] + result_A1[2] == 3:
    print('Yes')
    sys.exit()

print('No')


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

int main() {
  int n;
  cin >> n;
  int odd = 0;
  for(int i=0;i<n;i++) {
    int a;
    cin >> a;
    if(a % 2 == 1) odd++;
  }
  if(odd % 2 == 0) cout << "YES" << endl;
  else cout << "NO" << endl;
}

Measured memory_bytes: 256
n, m, l = map(int, input().split())

arr_a = []
arr_b = []

for _ in range(n):
    vector = list(map(int, input().split()))
    arr_a.append(vector)
    
for _ in range(m):
    vector = list(map(int, input().split()))
    arr_b.append(vector)

arr_result = [[0 for _ in range(l)] for _ in range(n)]

for i in range(n):
    for j in range(l):
        for k in range(m):
            arr_result[i][j] += arr_a[i][k] * arr_b[k][j]

for arr in arr_result:
    print(" ".join(map(str, arr)))
        
        



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

int mod=10000;

int main(){
	int n, k;
	cin >> n >> k;
    vector<int> c(n+1, -1);
	for(int i=0; i<k; i++){
        int tmp1, tmp2;
        cin >> tmp1 >> tmp2;
        c[tmp1]=tmp2-1;
    }

    vector<vector<vector<long long>>> dp(n+1, vector<vector<long long>>(3, vector<long long>(3, 0)));
    if(c[1]==-1){
        dp[1][0][1]=1;
        dp[1][1][1]=1;
        dp[1][2][1]=1;
    }else{
        dp[1][c[1]][1]=1;
    }
    for(int i=2; i<=n; i++){
        if(c[i]==-1){
            dp[i][0][1]=(dp[i-1][1][1]+dp[i-1][1][2]+dp[i-1][2][1]+dp[i-1][2][2])%mod;
            dp[i][1][1]=(dp[i-1][0][1]+dp[i-1][0][2]+dp[i-1][2][1]+dp[i-1][2][2])%mod;
            dp[i][2][1]=(dp[i-1][0][1]+dp[i-1][0][2]+dp[i-1][1][1]+dp[i-1][1][2])%mod;
            dp[i][0][2]=dp[i-1][0][1]%mod;
            dp[i][1][2]=dp[i-1][1][1]%mod;
            dp[i][2][2]=dp[i-1][2][1]%mod;
        }else{
            dp[i][c[i]][1]=(dp[i-1][(c[i]+1)%3][1]+dp[i-1][(c[i]+1)%3][2]+dp[i-1][(c[i]+2)%3][1]+dp[i-1][(c[i]+2)%3][2])%mod;
            dp[i][c[i]][2]=dp[i-1][c[i]][1]%mod;
        }
    }
    long long ans=0;
    ans=(dp[n][0][1]+dp[n][0][2]+dp[n][1][1]+dp[n][1][2]+dp[n][2][1]+dp[n][2][2])%mod;
    cout << ans << endl;
}


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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll s;
  cin >> s;
  // 0 x1  x2
  // 0 y1  y2
  // s = | 1e9 * y2 - 1 * y1 |
  
  // s = 1e9 * y2 - x2
  if(s == 1e18){
    cout << 0 << " " << 0 << " ";
    cout << 1000000000 << " " << 0 << " ";
    cout << 0 << " " << 1000000000 << "\n";
    return 0;
  }
  ll mod = s % (ll)(1e9);
  ll ss = s / (ll)(1e9);
  ll y = ss + 1;
  ll x = 1e9 - mod;

  cout << 0 << " " << 0 << " ";
  cout << 1000000000 << " " << 1 << " ";
  cout << x << " " << y << "\n";
  
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int[] divisors = {1, 6, 9, 36, 81, 216, 729, 1296, 6561, 7776, 46656, 59049};

		int amount = Integer.parseInt(scanner.nextLine());
		short[] numProcedures = new short[amount + 1];
		numProcedures[0] = 0;

		for (int aIdx = 1; aIdx <= amount; aIdx++) {
			short minNumProcedure = Short.MAX_VALUE;
			for (int dIdx = 0; dIdx < divisors.length && divisors[dIdx] <= aIdx; dIdx++) {
				short tmpNumProcedure = (short) (numProcedures[aIdx - divisors[dIdx]] + 1);
				if (minNumProcedure > tmpNumProcedure) minNumProcedure = tmpNumProcedure;
			}
			numProcedures[aIdx] = minNumProcedure;
		}

		System.out.println(numProcedures[amount]);
	}
}


Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define si set <ll>
#define vi vector <ll>
#define popcount(x) __builtin_popcountll(x)
#define mii map <ll,ll>
#define vpi vector <pair <ll,ll> >
#define sz(c) (int)c.size()
#define fr first
#define ll long long
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define mem0(a) memset(a,0,sizeof(a))
#define rep(i,a,n) for(ll i=a ; i<n ; i++)
#define ld long double
#define rall(a) (a).rbegin(),(a).rend()
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
 
 
 
ll power(ll b,ll e,ll m)
{
  if(b==0) return 0;
  if(e==0) return 1;
  if(e&1) return b*power(b*b%m,e/2,m)%m;
  return power(b*b%m,e/2,m);
}
ll power( ll b, ll e)
{
  if(b==0) return 0;
  if(e==0) return 1;
  if(e&1) return b*power(b*b,e/2);
  return power(b*b,e/2);
}  
bool isPowerOfTwo(ll x)
{
    // x will check if x == 0 and !(x & (x - 1)) will check if x is a power of 2 or not
    return (x && !(x & (x - 1)));
}


void solve()
{
  ll n,k;
  cin>>n>>k;
  cout<<k*power(k-1,n-1);
}

int main()
{
  ll tt=1;
  // cin>>tt;
  while(tt--)
  {
    solve();
    cout<<"\n";
  }
}

Measured memory_bytes: 3632
n,m,k = map(int,input().split())

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

uf = UnionFind(n)
from collections import defaultdict
dic = defaultdict(int)


for _ in range(m):
    a,b = map(int,input().split())
    uf.union(a-1, b-1)
    dic[a-1] += 1
    dic[b-1] += 1
for _ in range(k):
    c,d = map(int,input().split())
    if uf.same(c-1, d-1):
        dic[c-1] += 1
        dic[d-1] += 1

for i in range(n):
    print(uf.size(i) - dic[i]-1)




Measured memory_bytes: 114776
from math import floor, ceil

num_arr = input().split(" ")
X = int(num_arr[0])
K = int(num_arr[1])
D = int(num_arr[2])

if abs(X) >= K*D:  
    print(abs(X) - K*D)
else:
    steps_needed = floor(abs(X)/D)
    
    if (K - steps_needed)%2 == 0:
        print(abs(abs(X) - steps_needed * D))
    else:
        print(abs(abs(X) - (steps_needed+1)*D))

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

const long long md = 1e9 + 7;

long long pw(long long a, long long b){
  long long res = 1;
  for (int i=0; i<b; i++){
    res *= a;
    res %= md;
  }
  return res;
}

int main(){
  long long N, K;
  cin >> N >> K;
  vector<vector<long long>> com(2010, vector<long long>(2010,0));
  com[0][0] = 1;
  for (int i=1; i<=2005; i++){
    for (int j=0; j<=i; j++){
      if (j==0||j==i) com[i][j] = 1;
      else com[i][j] = com[i-1][j]+ com[i-1][j-1];
      com[i][j] %= md;
    }
  }

  for (int i=1; i<=K; i++){
    cout << (com[N-K+1][i]*com[K-1][i-1]%md) << endl;
  }
}


Measured memory_bytes: 31872
A, B, C, D = map(int, list(input()))


import operator, itertools, sys

ops = {
    '+': operator.add,
    '-': operator.sub
}
ans = ops['-'](ops['+'](ops['-'](A, B), C), D)

for keys in itertools.product(ops, repeat=3):
    total = ops[keys[2]](ops[keys[1]](ops[keys[0]](A, B), C), D)
    if total == 7:
        ans = '{a}{op1}{b}{op2}{c}{op3}{d}=7'.format(a=A, op1=keys[0], b=B, op2=keys[1], c=C, op3=keys[2], d=D)
        print(ans)
        sys.exit(0)


Measured memory_bytes: 38256
#include <stdio.h>

int main(void)
{
    char buf[10000];
    int n;
    int i = 0;

    scanf("%d", &n);
    scanf("%s", buf);

    while (buf[i] != '\0' && buf[i] != '\n')
    {
        buf[i] = 'A' + ((buf[i] - 'A' + n) % 26);
        i++;
    }

    printf("%s", buf);

    return 0;

}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// 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())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch Dodecagon | diff Dodecagon.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address Dodecagon.cpp && ./a.out

/*
 
 7/20/2019
 
 5:00-
 
 */

int N;

void solve() {
  cout<<3*N*N<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;
  
  cin>>N;
  solve();
  
  return 0;
}


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

typedef long long s64;
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
const int N=3e5+5,D=998244353;
s64 mi(s64 x,int y=D-2)
{
	s64 ans=1;
	while(y)
	{
		if(y&1)ans=ans*x%D;
		x=x*x%D;y>>=1;
	}
	return ans;
}
s64 jie[N],niv_jie[N];

int main()
{
	//freopen("1.in","r",stdin);
	int n;cin>>n;
	jie[0]=1;
	rep(i,1,n)jie[i]=jie[i-1]*i%D;
	niv_jie[n]=mi(jie[n]);
	per(i,n,1)niv_jie[i-1]=niv_jie[i]*i%D;
	int a,b;s64 k,ans=0;
	cin>>a>>b>>k;
	int d=__gcd(a,b);
	a/=d;b/=d;
	if(k%d){puts("0");exit(0);}
	k/=d;
	if(a==b)
	{
		rep(x,0,n)
		{
			int y=k-x;
			if(y%2||y<0)continue;
			y/=2;
			if(x+y>n)continue;
			(ans+=niv_jie[x]*niv_jie[y]%D*niv_jie[n-x-y]%D*mi(2,x))%=D;
		}
		cout<<ans*jie[n]%D;
		exit(0);
	}
	rep(ca,0,n)
	{
		s64 now=k-(s64)ca*a;
		if(now%b||now<0)continue;
		int cb=now/b;
		if(cb>n)continue;
		(ans+=niv_jie[ca]*niv_jie[n-ca]%D*niv_jie[cb]%D*niv_jie[n-cb])%=D;
	}
	cout<<jie[n]*jie[n]%D*ans%D;
}

Measured memory_bytes: 4992
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#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>
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
constexpr ll INF = 1e18;

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

    vector<ll> visited_num(N);
    ll current = 1;
    ll num = 1;
    ll rem = K;
    visited_num[current-1] = num;
    num++;
    bool has_loop = false;
    for (int i = 0; i < K; i++, num++) {
        ll next = A[current-1];
        rem--;

        if (!has_loop) {
            if (visited_num[next-1] > 0) {
                // ループした時
                ll loop_num = num - visited_num[next-1];
                rem %= loop_num;
            } else {
                visited_num[next-1] = num;
            }
        }
        current = next;

        if (rem == 0) {
            // K回移動時
            cout << current << endl;
            return 0;
        }

    }
    return 0;
}



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

int main() {
  unsigned N;
  std::cin >> N;
  std::vector<std::vector<unsigned>> c(N, std::vector<unsigned>('z' - 'a' + 1, 0u));
  for (unsigned i = 0; i < N; ++i) {
    std::string s;
    std::cin >> s;
    for (auto &j : s) { ++c[i][j - 'a']; }
  }
  for (int i = 0; i < 'z' - 'a' + 1; ++i) {
    unsigned min = 100000;
    for (unsigned j = 0; j < N; ++j) {
      min = std::min(min, c[j][i]);
    }
    for (unsigned j = 0; j < min; ++j) {
      std::cout << static_cast<char>('a' + i);
    }
  }
  std::cout << std::endl;
  return 0;
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional> // for less 
#define pb push_back
#define For(i,s,e) for (ll i=(s); i<(e); i++)
#define Debug_array(a,n) for (ll i=(0); i<(n); i++) cout<<a[i]<<" "
#define Foe(i,s,e) for (ll i=(s); i<=(e); i++)
#define Fod(i,s,e) for (ll i=(s)-1; i>=(e); i--)
#define pii pair<ll,ll>
#define fi first
#define se second
#define endl "\n"
#define mp make_pair
#define big_prime 15486277
#define bigger_prime 179424697
#define biggest_prime 32416188691
//#define random_shuffle(indices.begin(), indices.end());
//std::random_device rd;
//std::mt19937 g(rd());
//std::shuffle(v.begin(), v.end(), g);
using namespace __gnu_pbds; 
using namespace std;
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
// template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 0
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE


typedef int ll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,tree_order_statistics_node_update> ordered_set; 

#define MOD 1000000007
#define MAX 100010

ll n;
ll a[MAX];
ll Pow10[MAX+1];
ll dp[MAX][13];

ll f(ll index,ll m){
	if(index==n){
		if(m==5) return 1;
		else return 0;
	}
	if(dp[index][m]!=-1) return dp[index][m];

	ll c = Pow10[n-1-index];

	if(a[index]!=-1) {
		ll C = (c*a[index])%13;
		return f(index+1,(C+m)%13);
	}

	ll ans = 0;
	For(i,0,10){
		ll C = (c*i)%13;
		ll t = f(index+1,(C+m)%13);
		ans = (ans+t)%MOD;
	}
	dp[index][m] = ans;
	return ans;
}

void fill(){
	Pow10[0]=1;
	For(i,1,MAX+1) Pow10[i]=(10*Pow10[i-1])%13;
}

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	fill();
	memset(dp,-1,sizeof(dp));
	string input;
	cin>>input;

	n = input.size();
	For(i,0,n){
		if(input[i]=='?') a[i]=-1;
		else a[i]=input[i]-'0';
	}

	cout<<f(0,0)<<endl;































	
}

Measured memory_bytes: 14160
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define era(t) t.erase(unique(be(t)),t.end())
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;
typedef long long ll;
using namespace std;
const ll mod=1000000007,mod9=1000000009;
template <class T>inline T lcm(T a,T b){return (a*b/__gcd(a,b));}

ll uni[100001];
ll root(ll u){
    if(uni[u]<0)return u;
    return uni[u]=root(uni[u]);
}
void connect(int a,int b){
    a=root(a);
    b=root(b);
    if(a==b)return;
    if(uni[a]>uni[b]){
        a^=b;
        b^=a;
        a^=b;
    }
    uni[a]+=uni[b];
    uni[b]=a;
    return;
}
ll size(ll u){
    return -uni[root(u)];
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    memset(uni,-1,sizeof(uni));
    ll n,m;
    cin>>n>>m;
    int x,y,z;
    for(int i=0;i<m;i++){
    	cin>>x>>y>>z;
    	connect(x,y);
    }
    int ans=0;
    for(int i=1;i<=n;i++){
    	if(uni[i]<0){
    		ans++;
    	}
    }
    cout << ans<<endl;
    return 0;
}





Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ll long long
#define mx 200009
#define pb push_back
using namespace std;
void f(int n)
{
   int x[mx],y[mx],ans;
   vector<int>a;
   vector<int>b;
   for(int i=1;i<=n;i++)
   {
      scanf("%d%d",&x[i],&y[i]);
      a.pb(x[i]+y[i]);
      b.pb(x[i]-y[i]);
   }
   sort(a.begin(),a.end());
   sort(b.begin(),b.end());
   int ans1=a[a.size()-1]-a[0];
   int ans2=b[b.size()-1]-b[0];
   ans=max(ans1,ans2);
   printf("%d\n",ans);
}
int main()
{
      int n;
      while(scanf("%d",&n)!=EOF)
      {
         f(n);
      }
      return 0;
}


Measured memory_bytes: 6532
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
//auto Tuple = tuple<int,int,int>;
//typedef pair<int,int> P;
class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;
    vector<int> Rank;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N);
        Rank = vector<int> (N,1);
        for(int i = 0;i < N;i++){
            Parent[i] = i;
        }
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] == A) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	/*int size(int A) {
		return -Parent[root(A)];//親をとってきたい]
	}*/

	//AとBをくっ付ける
	void connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return ;
		}

		if (Rank[A] < Rank[B]) Parent[A] = B;
		
		else{
            Parent[B] = A;
            if(Rank[A] == Rank[B]) Rank[A]++;
        }
		return;
	}
    bool find(int A,int B){
        return root(A) == root(B);
    }
};
//tuple<int,int,int> test;
bool compare1(tuple<int,int,int> x,tuple<int,int,int> y){
    if(get<0>(x) == get<0>(y)) {return get<1>(x) < get<1>(y);}
    return get<0>(x) < get<0>(y);
}

int main(){
    cin.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(10);
    int N,K,L;
    cin >> N>>K>>L;
    int p[K], q[K], r[L], s[L];
    REP(i,K){
        cin >> p[i]>> q[i];
    }
    REP(i,L){
        cin >> r[i] >> s[i];
    }

    UnionFind road(N),train(N);
    vector<tuple<int,int,int> > uni;
    //int ans[N];
    REP(i,K){
        road.connect(p[i]-1,q[i]-1);
    }
    REP(i,L){
        train.connect(r[i]-1,s[i]-1);
    }
    REP(i,N){
         //p(road.root(i), train.root(i));
        uni.push_back(make_tuple(road.root(i), train.root(i), i));
    }
    sort(ALL(uni),compare1);
    
    int front = 0;
    int back = 1;
    vector<int> ans(N,0);
    while(front < N-1){
        while(get<0>(uni[front]) == get<0>(uni[back]) && get<1>(uni[front]) == get<1>(uni[back]) && back < N){
            back++;
        }
        for(int i = front; i <back;i++){
            ans[get<2>(uni[i])] += back-front;
        }
        front = back;
        back++;
        if(front == N - 1){
            ans[get<2>(uni[N-1])]++;
        }
    }
    REP(i,N){
        cout << ans[i] << endl;
    }
    /*map<pair<int, int>, int> ma;
	rep(i, n) {
		pair<int, int> p(uf.root(i), uf2.root(i));
		ma[p]++;
	}
 
	rep(i, n) {
		pair<int, int> p(uf.root(i), uf2.root(i));
		cout << ma[p] << " ";
	}*/ //こんな書き方もあります…
 
}



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

int main() {
    unsigned long long a, b;
    char s[6];

    scanf("%lld%s", &a, s);
    b = (s[0]-'0')*100 + (s[2]-'0')*10 + (s[3]-'0'); 

    printf("%llu\n", a*b/100);

    return 0;
}

Measured memory_bytes: 3816
def func(a,b):
    digit_a=len(str(a))
    digit_b=len(str(b))
    if digit_a>=digit_b:
        return digit_a
    else:
        return digit_b

N=int(input())

INF=float('inf')
ans=INF


for i in range(1,int(N**0.5)+1):
    if N%i==0:
        ans=min(ans,func(i,N//i))

print(ans)

Measured memory_bytes: 3060
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Abx solver = new Abx();
        solver.solve(1, in, out);
        out.close();
    }

    static class Abx {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            out.println("ABC" + in.nextInt());
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 23124