akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include <queue>
using namespace std;

#define INFTY (1 << 30)

//???????????????
enum Color {
	WHITE,
	GRAY,
	BLACK,
};


//SSSP
void Dijkstra(vector<pair<int, int>> v_w_m[], int verNum) {

	//???????¨????
	priority_queue<pair<int, int>> pQ;
	int distance[10000];
	Color color[10000];
	int parent[10000];
	for (int i = 0; i < verNum; i++) {
		color[i] = WHITE;
		distance[i] = INFTY;
		parent[i] = -1;
	}
	distance[0] = 0;
	pQ.push(make_pair(0, 0));


	//SSSP??????
	while (!pQ.empty()) {

		//??°??¬????????????????????????????°?????????????????????¶
//		int min_cost = INFTY;
		int subScript;
		pair<int, int> wei_sub_map = pQ.top();
		pQ.pop();
		subScript = wei_sub_map.second;
		//for (int i = 0; i < verNum; i++) {
		//	if (color[i] != BLACK && distance[i] < min_cost) {
		//		min_cost = distance[i];
		//		subScript = i;
		//	}
		//}

		//?????????????????????
		color[subScript] = BLACK;

		//???????????????????????°??????????????????????????????????????????
		if (distance[subScript] < wei_sub_map.first * -1)
			continue;

		//??£??\?????°??¬??????
		for (int i = 0; i < v_w_m[subScript].size(); i++) {
			int outV = v_w_m[subScript][i].first;
			if (color[outV] == BLACK) continue;
			if (distance[outV] < distance[subScript] + v_w_m[subScript][i].second) continue;

			distance[outV] = distance[subScript] + v_w_m[subScript][i].second;
			parent[outV] = subScript;
			color[outV] = GRAY;
			pQ.push(make_pair(distance[outV] * -1, outV));
		}
	}

	//??????
	int weight_sum = 0;
	for (int i = 0; i < verNum; i++) {
		cout << i << " " << distance[i] << endl;
	}
}


int main() {

	int verNum;
//	int verValWeight[100][100];
	vector<pair<int, int>> v_w_m[10000];
	int parent[100];

	//???????¨????
//	v_w_m = new vector<pair<int, int>>();
	cin >> verNum;
	//for (int i = 0; i < verNum; i++)
	//	for (int j = 0; j < verNum; j++)
	//		verValWeight[i][j] = INFTY;

	//??\?????????
	for (int i = 0; i < verNum; i++) {
		int verVal, outNum;
		cin >> verVal >> outNum;
		for (int j = 0; j < outNum; j++) {
			int outVerVal, weight;
			cin >> outVerVal >> weight;
//			v_w_m[verVal].push_back(make_pair(outVerVal, weight));
			v_w_m[verVal].push_back(make_pair(outVerVal, weight));
			//			verValWeight[i][outVerVal] = weight;
		}
	}

	//SSSP
	Dijkstra(v_w_m, verNum);

	return 0;
}

Measured memory_bytes: 7988
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
#include <array>
#include <numeric>
#include <regex>
#include <bitset>
#include <deque>

using namespace std;
typedef long long ll;
typedef pair<int, int> p_ii;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;


int main() {
    string n;
    int k;
    cin>>n>>k;
    vector<char> D(k);
    for (int i = 0; i < k; i++) {
        cin>>D[i];
    }
    
    string pay =n;
    while(true){
        bool flg=true;
        for (int i = 0; i < pay.size(); i++) {
            if(!flg)break;
            for (int j = 0; j < k; j++) {
                if(pay[i]==D[j]){
                    flg=false;
                    break;
                }
            }
        }

        if(flg)break;
        
        pay=to_string(stoi(pay)+1);
    }

    cout<<pay<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;
const int maxn=50;
int a[maxn],k,ans[maxn];
long long sum[maxn],dp[12][maxn];
bool f=0;
void dfs(int x,int pre)
{
	if (x==0)
	{
		if (pre==-1) return;
		k--;
		if (!k) 
		{
			f=0;
			for (int i=10;i>=1;i--) ans[i]=a[i];
		}
		return ;
	}
	if (pre==-1)
	{
		a[x]=0; dfs(x-1,-1);
		for (int i=1;i<=9 && !f;i++)
		{
			a[x]=i; dfs(x-1,i);
			if (f) break;
		}
	}
	else
	{
		for (int i=-1;i<=1 && !f;i++)
		if (pre+i>=0 && pre+i<=9) 
		{
			a[x]=pre+i; dfs(x-1,pre+i);
			if (f) break;
		}
	}
}
int main()
{
	for (int i=0;i<=9;i++) dp[i][1]=1;
	sum[1]=9;
	for (int i=2;i<=10;i++)
	{
	 for (int j=1;j<=9;j++)
	  for (int k=-1;k<=1;k++)
	   if (j+k>=0 && j+k<=9) dp[j][i]+=dp[j+k][i-1];
	 long long now=0;
	 for (int j=1;j<=9;j++) now+=dp[j][i];
	 sum[i]=sum[i-1]+now;
	}
	scanf("%d",&k); int lc=1;
	for (int i=1;i<=10;i++) if (sum[i]>=k) {lc=i; break;}
	dfs(lc,-1); int p=10; while (p && !ans[p]) p--;
	for (int i=p;i>=1;i--) printf("%d",ans[i]);
return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pp = pair<ll,ll>;
const ll amari = 1e9+7;
const char BC = 'A' - 'a';
#define ben(a) a.begin(),a.end()
#define pb(a,b) a.push_back(b)
//fixed << setprecision(20)

int main(){
	ll a,b;
	while(true){
		cin >> a >> b;
		if(a == 0 && b == 0)break;
		ll x = max(a,b);
		ll y = min(a,b);
		int count = 0;
		while(y != 0){
			x = x % y;
			ll t = x;
			x = y;
			y = t;
			count++;
		}
		cout << x << " " << count << endl;
	}
	return 0;
} 


Measured memory_bytes: 2992
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pull = pair<ull, ll>;
using pis = pair<int, string>;
#define all(x) (x).begin(), (x).end()
#define INF 1000000000
#define LLINF 10000000000000000ll
#define MOD 1000000007LL

struct UnionFind {
  vector<int> d;
  UnionFind(int n=0): d(n, -1) {}

  //functions
  void init_tree() {
    for (int i = 0; i < d.size(); i++) {
      d[i] = -1;
    }
  }
  
  int find(int x) {
    if (d[x] < 0) return x;
    return d[x] = find(d[x]);
  }

  bool unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x, y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }

  bool same(int x, int y) {
    return find(x) == find(y);
  }

  int size(int x) {
    return -d[find(x)];
  }

  int bls() {
    int ans = 0;
    for (int i = 0; i < d.size(); i++) if (d[i] < 0) ans++;
    return ans;
  }
};

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

  int n, m;
  cin >> n >> m;
  UnionFind uf(n);
  for (int i = 0; i < m; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    x--, y--;
    if (!uf.same(x, y)) uf.unite(x, y);
  }
  cout << uf.bls() << endl;
}


Measured memory_bytes: 3704
#include <bits/stdc++.h>
using namespace std;
int main() {
    #ifdef DEBUG
    std::ifstream in("/home/share/inputf.in");
    std::cin.rdbuf(in.rdbuf());
    #endif
    int N;
    cin >> N;
    vector<int64_t> s(N);
    for(int i = 0; i < N; i++) {
        cin >> s[i];
    }
    int64_t ans = 0;
    for(int C = 1; C < N; C++) {
        int64_t score = 0;
        for(int k = 0; (k + 1) * C < N; k++) {
            score += s[k * C] + s[N - 1 - k * C];
            if ((N - 1) % C != 0 || N - 1 > 2 * k * C) {
                ans = max(ans, score);
            }
        }
    }
    cout << ans << endl;
    return 0;
}

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


int main(){
#ifdef redirect_in
    freopen("b.in", "r", stdin);
#endif
#ifdef redirect_out
    freopen("b.out", "w", stdout);
#endif
    int n, m;
    while(cin>>n>>m){
        vector<int> v(n, 0);
        for(int i=0; i<m; ++i){
            int a, b;
            cin>>a>>b;
            --a; --b;
            ++v[a]; ++v[b];
        }
        bool flag=true;
        for(int i=0; i<n; ++i){
            if(v[i]%2){
                flag=false;
            }
        }
        if(flag){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
    return 0;
}



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

int a[300];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    for(int i=1;i<=n;i++){
        printf("node %d: ",i);
        printf("key = %d, ",a[i]);
        if(i/2>=1) printf("parent key = %d, ",a[i/2]);
        if(i*2<=n) printf("left key = %d, ",a[i*2]);
        if(i*2+1<=n) printf("right key = %d, ",a[i*2+1]);
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 2672
#include <cstddef>
#include <complex>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <array>
#include <list>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <limits>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <bitset>
#include <valarray>
#include <utility>
#include <tuple>
#include <cmath>
#include <memory>
#include <random>
#include <fstream>
#include <locale>

using ll = long long;
using ull = unsigned long long;

//vector
template <class T>
using vec = std::vector<T>;

template <class T>
using vvec = vec<vec<T>>;

constexpr std::size_t operator""_sz(ull n) { return std::size_t(n); }

int main()
{
    using namespace std;

    int x, y, z;
    cin >> x >> y >> z;

    cout << z << " " << x << " " << y << endl;

    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// using namespace __gnu_pbds;
// gp_hash_table<int, int> mapka;

using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

template<class C> void mini(C &a4, C b4) { a4 = min(a4, b4); }
template<class C> void maxi(C &a4, C b4) { a4 = max(a4, b4); }

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<'='<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}

template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.st << "," << P.nd << ")";
}

#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif

const int MAX = 101;
int n;
vector<int> t;
int dajmi(){
  int mi = 1e9;
  int ma = 0;
  R(i,n){
    mini(mi, t[i]);
    maxi(ma, t[i]);
  }
  if(ma > mi * 2){
    return MAX;
  }
  if(ma == mi * 2){
    R(i,n){
      if(t[i] == ma){
        return i;
      }
    }
  }
  return 0;
}

int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(11);
  cerr << fixed << setprecision(6);
  cin >> n;
  t.resize(n);
  R(i,n)cin >> t[i];
  if(dajmi() == MAX){
    cout << "-1\n";
    return 0;
  }
  vector<int> res;
  vector<int> nie(n);
  int ilnie = 0;
  while(1){
    int mi = 1e9;
    int ma = 0;
    R(i,n){
      mini(mi, t[i]);
      maxi(ma, t[i]);
    }
    debug(ilnie);
    
    vector<int> zle(n);
    R(i,n){
      if(t[i] * 2 < ma){
        zle[i] = 1;
      }
    }
    int naj = -1;
    R(i,min(SZ(res),n)){
      if(zle[res[SZ(res) - i - 1]]){
        naj = i;
        zle[res[SZ(res) - i - 1]] = 0;
      }
    }
    R(i,naj + 1){
      zle[res[SZ(res) - i - 1]] = 1;
    }
    
    
    if(ma == 0)break;
    R(i,n)if(!nie[i] && t[i] * 2 > ma && t[i] && !zle[i]){
      debug(ma,t[i],i);
      res.PB(i);
      t[i]--;
      nie[i] = 1;
      ilnie++;
      goto ok;
    }
    debug(res);
    assert(0);
    ok:;
    if(SZ(res) >= n){
      vector<int> cz(n);
      bool nope = 0;
      R(i,n){
        if(cz[res[SZ(res) - i - 1]]){
          nope = 1;
          break;
        }
        cz[res[SZ(res) - i - 1]] = 1;
      }
      if(!nope){
        ilnie = 0;
        R(i,n)nie[i] = 0;
      }
    }
  }
  for(int ak:res){
    cout << ak + 1 << " ";
  }
  cout << "\n";
}


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

using namespace std;

#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define SZ(x) ((ll)(x).size())
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"

typedef long long ll;
typedef unsigned long long ul;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<ll, ll> PL;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll, V, greater<ll>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18;

ll D, G;
VL p, c;

int main() {
    cin >> D >> G;
    REP(i, D) {
        p.emplace_back(IN());
        c.emplace_back(IN());
    }
    ll ans = LINF;
    REP(i, 1 << D) {
        ll tmp = 0, sum = 0;
        REP(j, D) {
            if((i >> j) & 1) {
                tmp += p[j];
                sum += c[j] + p[j] * (j + 1) * 100;
            }
        }
        REPR(j, D - 1) {
            if(sum >= G) break;
            if(!((i >> j) & 1)) {
                ll c = ceil((double)(G - sum) / ((j + 1) * 100));
                ll cnt = min(p[j], c);
                tmp += cnt;
                sum += cnt * (j + 1) * 100;
            }
        }
        if(sum >= G) ans = min(ans, tmp);
    }
    cout << ans << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int , int> P;
typedef pair<ll, ll> PL;
const ll MOD = 1E9+7;
 
ll maxll(ll a, ll b){
    if(a >= b)  return a;
    else    return b;
}

bool SecondCompare(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second<b.second;
}
 
bool SecondCompareDes(const pair<int,int> &a,const pair<int,int> &b)
{
       return a.second>b.second;
}

ll n;
ll x[200000+10], a[200000+10];
int main(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> x[i];
        a[i] = x[i];
    }
    sort(x, x+n);
    ll mid = x[n/2];
    for(int i = 0; i < n; i++){
        if(a[i] < x[n/2]){
            cout << x[n/2] << endl; 
        }
        else{
            cout << x[n/2-1] << endl;
        }
    }
}

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

using namespace std;


long long gcd(long long a, long long b) {
    long long maxv = max(a,b);
    long long minv = min(a,b);

    if(maxv % minv == 0) return minv;
    else return gcd(maxv - minv, minv);
}
int main() {
    int N;
    cin >> N;

    vector<long long> A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    long long cur = gcd(A[0], A[1]);
    for(int i = 2; i < N; i++) {
        cur = gcd(A[i], cur);
    }

    cout << cur << endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define mx *max_element
#define mi *min_element
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ncr(int n,int r){if(n<r)return 0;int p=1,k=1;if(n-r<r)r=n-r;if(r!=0){while(r){p*=n;k*=r;int g=__gcd(p, k);p/=g;k/=g;n--;r--;}}else p=1;return p;}
#define pi 2*acos(0.0)
int ar[N];
int tree[2*N];
int dp[N];
int bit[N];
bool isprime(int n){
	for(int i=2;i*i<=n;i++)if(n%i==0)return 0;
		return 1;
}
signed main(){
 
	SaveTime;
	int T=1;
	// cin >> T;
	while(T--){
		int n,m;
		cin >> n >> m;
		map<int,int>mp;
		for(int i=1;i*i<=n;i++){
			if(n%i==0){
				mp[i]++;
				if(n/i!=0)mp[n/i]++;
			}
		}
		for(int i=1;i*i<=m;i++){
			if(m%i==0){
				mp[i]++;
				if(m/i!=0)mp[m/i]++;
			}
		}
		vector<int>v;
		for(auto i : mp)if(i.se>1)v.pb(i.fi);
		int cnt =0 ;
		for(auto i :v)if(isprime(i))cnt++;
		cout << cnt <<endl;
		// cout << (cnt*(cnt+1))/2 <<endl;

	}
	
	return 0;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i=a; i<n; i++)
#define RREP(i, a, n) for(ll i=n-1; i>=a; i--)
typedef long long ll;
const ll mod =1e9+7;
const ll inf =1e18;
using namespace std;

int main() {
    int n;
    int h[101010];
    cin>>n;
    REP(i, 0, n) cin>>h[i];

    int mx=0, l=0, r=1;
    while(l<=r && l<n && r<n){
        REP(i, r, n){
            if(h[r-1]<h[r]) break;
            r++;
        }
        mx=max(mx, r-l-1);
        l=r;
        r++;
    }
    mx=max(mx, r-l-1);
    cout<<mx<<endl;
    return 0;
}

Measured memory_bytes: 640
#include <iostream>

using namespace std;

typedef long long ll;

ll mod = 1e9 + 7;

ll A[300005];

int main(int argc, char *argv[])
{
	ll N;

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

	ll ans = 0;
	for (int i = 0; i < 60; i++) {
		ll n1 = 0;
		ll b = 1LL << i;
		for (int j = 0; j < N; j++) {
			if (A[j] & (1LL << i)) {
				n1++;
			}
		}
		b %= mod;
		ll n = (n1 * (N - n1)) % mod;
		ans += b * n;
		ans %= mod;
	}

	cout << ans << endl;

	return 0;
}

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

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

ll gcd_my(ll a, ll b) { return b ? gcd_my(b, a % b) : a; }

ll lcm_my(ll a, ll b) { return a / gcd_my(a, b) * b; }

int main() {
    ll n, ans=1;
    cin >> n;

    rep(i, n ) {
        ll tmp;
        cin >> tmp;
        ans = lcm_my(ans, tmp);
    }

    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 3600
n=int(input())
A=list(map(int,input().split()))
O=A[0::2]
E=A[1::2]

from collections import Counter
o=Counter(O).most_common(2)
o.append((0,0))
e=Counter(E).most_common(2)
e.append((0,0))

if o[0][0]!=e[0][0]:
  print(n-o[0][1]-e[0][1])
else:
  print(min(n-o[0][1]-e[1][1],n-o[1][1]-e[0][1]))

Measured memory_bytes: 15908
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
#define testing 1
#define FOR(i,s,e) for(ll i = s; i <= (ll)e; ++i)
#define DEC(i,s,e) for(ll i = s; i >= (ll)e; --i)
#define IAMSPEED ios_base::sync_with_stdio(false); cin.tie(0);
#define db(x) cerr << #x << "=" << x << "\n"
#define db2(x, y) cerr << #x << "=" << x << " , " << #y << "=" << y << "\n"
#define db3(a,b,c) cerr<<#a<<"="<<a<<","<<#b<<"="<<b<<","<<#c<<"="<<c<<"\n"
#define dbv(v) cerr << #v << ":"; for (auto ite : v) cerr << ite << ' '; cerr <<"\n"
#define dbvp(v) cerr << #v << ":"; for (auto ite : v) cerr << "{"  << ite.f << ',' << ite.s << "} "; cerr << "\n"
#define dba(a,ss,ee) cerr << #a << ":"; FOR(ite,ss,ee) cerr << a[ite] << ' '; cerr << "\n"
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long 
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
#define reach cerr << "LINE: " << __LINE__ << "\n";
typedef pair <ll, ll> pi;
typedef tuple<ll,ll,ll> ti3;
string cts(char x) {string t(1,x); return t;}
ll rand(ll a, ll b) { return a + rng() % (b-a+1); }
const int MOD = 1e9 + 7;
const int inf = (int)1e9 + 500;
const long long oo = (ll)1e18 + 500;
template <typename T> void chmax(T& a, T b) { a = max(a, b); }
template <typename T> void chmin(T& a, T b) { a = min(a, b); }
const int MAXN = -1;
#if !testing
#define cerr if(0)cout
#endif

int32_t main() 
{
	IAMSPEED
	ll x; cin >> x;
	vector<pi>v;
	set<ll>s;
	FOR(i,0,1000){
		v.pb(pi(i*i*i*i*i,i));
		//db(v.back().f);
	}
	for(auto i:v)v.pb(pi(-i.f,-i.s));
	for(auto i:v)s.insert(i.f);
	//dbv(s);
	for(auto i:v) {
		ll tar = i.f-x;
		for(auto j:v) {
			if(j.f == tar) {
				cout << i.s << ' ' << j.s;
				return 0;
			}
		}
	}
	
}



Measured memory_bytes: 3788
#include <iostream>


int main(void){
  int change = 0;

  std::string s;
  std::cin >> s;

  char prev = '\0';
  for(int i=0; i<s.size(); i++){
    if(s[i] != prev){
      change++;
      prev = s[i];
    }
  }

  std::cout << change-1 << std::endl;
  
  return 0;
}

Measured memory_bytes: 512
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().splt()))

a,b,c,d=nii()
if a+b<c+d:
  print('Right')
elif a+b==c+d:
  print('Balanced')
else:
  print('Left')

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

using namespace std;

#define llong long long int
#define ldouble long double
#define rep(i, n) for (size_t i = 0; i < n; ++i)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)

const static int MOD = 1000000000 + 7;
const static llong INF = 1LL << 60;
const static int dy[] = {0, 1, 0, -1};
const static int dx[] = {1, 0, -1, 0};

int n, a, b, c;
vector<int> bamboo_length;

int get_sum(int l, int r) {
    int sum = 0;
    for (int i = l; i < r; ++i) {
        sum += bamboo_length[i];
    }

    return sum;
}

int main (int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> n >> a >> b >> c;
    bamboo_length.resize(n);
    rep(i, n) cin >> bamboo_length[i];

    sort(all(bamboo_length));
    int ans = 1000000000;
    do {
        for (int i = 0; i < n; ++i) {
            for (int j = i + 1; j < n; ++j) {
                for (int k = j + 1; k < n; ++k) {
                    for (int l = k + 1; l <= n; ++l) {
                        int len_a = 0, len_b = 0, len_c = 0, tmp_ans = 0;
                        len_a = get_sum(0, i + 1);
                        len_b = get_sum(i + 1, j + 1);
                        len_c = get_sum(j + 1, k + 1);
                        tmp_ans = abs(a - len_a) + abs(b - len_b) + abs(c - len_c) + 10 * (i + j - (i + 1) + k - (j + 1));
                        ans = min(ans, tmp_ans);
                    }
                }
            }
        }
    } while (next_permutation(all(bamboo_length)));

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int 
#define ull unsigned long long int
#define loop(i,a,b) for(ll i=a;i<b;++i)
#define loope(i,a,b) for(ll i=a;i<=b;++i)
#define loopr(i,a,b) for(ll i=a;i>=b;--i)
#define loops(i,a,b,step) for(ll i=a;i<b;i+=step)
#define all(a) a.begin(),a.end()
#define FAST ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define V vector
using namespace std;
typedef string str;
ll vis[55][55]={0};
ll inp[55][55];
set<pair<ll,ll>> points,point;

ll power(ll x, ll y, ll p) 
{ 
    ll res = 1;     
  
    x = x % p;   
    while (y) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1;  
        x = (x*x) % p; 
    } 
    return res; 
} 
 
ll nCrModP(ll n, ll r, ll p) 
{ 
    if (!r) 
      return 1; 
  
	ll fac[n+1]; 
   	fac[0] = 1; 
    for (ll i=1 ; i<=n; i++) 
        fac[i] = fac[i-1]*i%p; 
  
    return (fac[n]* power(fac[r], p-2,p) % p * power(fac[n-r], p-2,p) % p) % p; 
}
void dfs(ll x,ll y,ll k,ll n)
{
    if (x<0 || y<0 || x>n-1 || y>n-1 || inp[x][y]==1 || vis[x][y]==k)
    {
        return ;
    }
    else
    {
        vis[x][y]=k;
        if (k==1)
        {
            points.insert(make_pair(x,y));
        }
        else
        {
            point.insert(make_pair(x,y));            
        }
        dfs(x-1,y,k,n);
        dfs(x,y-1,k,n);
        dfs(x+1,y,k,n);
        dfs(x,y+1,k,n);
    }
    
}
int main ()
{
	FAST;
	//test cases
	str s,t;
    cin>>s>>t;
    ll s1=s.size();
    ll s2=t.size();
    ll num=s1-s2+1;
    ll ans=10000;
    loop(i,0,num)
    {
        ll temp=0;
        loop(j,0,s2)
        {
            if (t[j]!=s[j+i])
            {
                temp++;
            }
        }
        if (temp<ans)
        {
            ans=temp;
        }
    }
    cout<<ans<<endl;
    
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll, ll> pl;
typedef queue<ll> ql;
typedef set<ll> sl;
typedef vector<ll> vl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, n) for(ll i = 1; i <= ll(n); i++)
//#define rep(i, k, n) for(ll i = k-1; i < ll(n); i++)
//#define rep2(i, k, n) for(ll i = k; i <= ll(n); i++)
#define all(v) (v).begin(), (v).end()
bool chmin(ll &a, ll &b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll &b) {if(b > a) {a = b; return 1;} return 0;}
const ll inf = 1LL << 60;
const ll mod = 1e9 + 7;
//const ll mod = 998244353;
const ll max = 500010;
ll num, M, N, ans=0, count=0;
int main() {
  vl S = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  ll K;
  cin >> K;
  
  cout << S[K-1] << endl;
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CompProgLib;

namespace ALDS1_14_B
{
    public class Program

    {

        public static void Main(string[] args)
        {
            string target = ReadSt();
            string pattern = ReadSt();
            StringSearch ss = new StringSearch();
            StringBuilder sb = new StringBuilder();

            ss.RKSearch(target, pattern, sb);
            Console.Write(sb);
        }

        static string ReadSt() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Console.ReadLine()); }
        static long ReadLong() { return long.Parse(Console.ReadLine()); }
        static double ReadDouble() { return double.Parse(Console.ReadLine()); }
        static string[] ReadStAr(char sep = ' ') { return Console.ReadLine().Split(sep); }
        static int[] ReadIntAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => int.Parse(e)); }
        static long[] ReadLongAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => long.Parse(e)); }
        static double[] ReadDoubleAr(char sep = ' ') { return Array.ConvertAll(Console.ReadLine().Split(sep), e => double.Parse(e)); }

    }

}

namespace CompProgLib
{
    public class StringSearch
    {

        public void RKSearch(string target, string pattern, StringBuilder sb)
        {

            const long B = 100000007;

            List<int> hs = new List<int>();
            if (target.Length < pattern.Length) return ;

            long t = 1;
            for (int i = 0 ; i < pattern.Length ; i++) t *= B;

            long tHash = 0;
            long pHash = 0;

            for (int i = 0 ; i < pattern.Length ; i++)
            {
                tHash = tHash * B + target[i];
                pHash = pHash * B + pattern[i];
            }

            for (int i = 0 ; i + pattern.Length <= target.Length ; i++)
            {
                if (tHash == pHash) sb.AppendLine(i.ToString());
                if (i + pattern.Length < target.Length) tHash = tHash * B + target[i + pattern.Length] - target[i] * t;
            }

            return ;
        }

    }
}


Measured memory_bytes: 48536
#include<algorithm>
#include<cmath>
#include<climits>
#include<cstdio>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll MOD = 1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,s,e) for(int i=s;i<e;i++)
#define reple(i,s,e) for(int i=s;i<=e;i++)
#define revrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()

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



int main()
{
	int N, K;
	cin >> N >> K;

	ll ans = 0;
	ll sum_min = 0;
	rep(i, K) sum_min += i;

	ll sum_max = 0;
	rep(i, K) sum_max += N - i;

	reple(i, K, N + 1)
	{
        ans += sum_max - sum_min + 1;
        ans %= MOD;

		sum_min += i;
		sum_max += N - i;
	}

    cout << ans << endl;

	return 0;
}

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

#define ll long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rep(i,n) for(int i = 0; i < int(n); i++)

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
const int MOD = 1000000007;

int n;
int matrix[21][21];
int dp[21][2097159];

int fun(int i, int num) {
    if(i == n) {
        if(num == (1 << n) - 1) return 1;
        return 0;
    }
    if(dp[i][num] != -1) return dp[i][num];
    ll ans = 0;
    for(int j = 0; j < n; j++) {
        if(matrix[i][j] && !(num & (1 << j))) {
            ans += fun(i + 1, (num | (1 << j)));
            ans %= MOD;
        }
    }
    return dp[i][num] = ans;
}

int main() {
    IOS;
    memset(dp, -1, sizeof(dp));
    cin >> n;
    rep(i, n) rep(j, n) cin >> matrix[i][j];
    cout << fun(0, 0);
    return 0;
}

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

int main() {
  int N, A, B, x, y, sum=0;
  cin >> N >> A >> B;

  for(int i=1; i<=N; i++){
    x=0;
    y=i;
    while(y > 0){
      x += y % 10;
      y /= 10;
    }
    if(x >= A && x <= B)
      sum += i;
  }
  
  cout << sum << endl;
  
  return 0;
}

Measured memory_bytes: 256
package main

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

var stdInScanner = bufio.NewScanner(os.Stdin)

func nextInt() int {
	stdInScanner.Scan()
	i, _ := strconv.Atoi(stdInScanner.Text())
	return i
}

func main() {
	stdInScanner.Split(bufio.ScanWords)

	X := nextInt()

	money := 100
	year := 0
	for {
		money = int(float64(money) * 1.01)
		year++
		if X <= money {
			break
		}
	}
	fmt.Println(year)
}


Measured memory_bytes: 1756
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int kosu = sc.nextInt();
        int l[]  = new int[kosu];
        int m[]  = new int[kosu];
        boolean endFlg = false;

        for (int i = 0; i < kosu; i++) {
            l[i] = sc.nextInt();
        }
        int count = 0;
        while(!endFlg){
            for (int i = 0; i < l.length; i++){
                if(l[i]%2 == 0){
                    m[i] = l[i]/2;
                }
                else{
                    endFlg = true;
                    break;
                }
            }
            if(!endFlg){
                count++;
                l = m;
            }
        }
        System.out.println(count);
    }
}


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

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define fst first
#define snd second
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define EPS (1e-9)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

bool LT(double a,double b) { return !equals(a,b) && a < b; }
bool LTE(double a,double b) { return equals(a,b) || a < b; }

const string YES = "";
const string NO  = "";

typedef long long ll;

bool f(ll v, ll k) {
  if( v <= 1 ) {
    if( v == 1 ) return true;
    return false;
  }
  if( v % k == 0 ) return f(v/k,k);
  else return f(v-k,k);
}

bool check(ll N, ll K) {
  while( N >= K ) {
    if( N % K == 0 ) N = N / K;
    else N = N - K;
  }
  return N == 1LL;
}

bool fcheck(ll N, ll K) {
  while( N >= K ) {
    if( N % K == 0 ) N = N / K;
    else N = N % K;
  }
  return N == 1LL;
}


int main() {
  ll N;
  cin >> N;
  /*
  REP(_,2,1000) {
  N = _;
  puts("");
  cout << "N = " << N << endl;
  cout << "sqrt(" << N<< ") = " << pow(N,0.5) << endl;
  ll cnt = 0;
  REP(K,2,N+1) {
    bool res = check(N,K);
    if( res ) {
      cout << "f(" << N << "," << K << ") = " << res << endl;
      ++cnt;
    }
  }
  puts("----");
  */
  vector<ll> ans;
  ans.pb(N);
  if( N-1 >= 2LL ) {
    ans.pb(N-1);
  }
  ans.pb(2);
  if( fcheck(N,3) ) ans.pb(3);
  if(  (N/2LL) >= 2LL && fcheck(N,N/2LL) ) ans.pb(N/2LL);
  for(ll i = 2LL; i <= (ll)pow(N,0.5)+1LL;++i) {
    if( fcheck(N,i) ) {
      ans.pb(i);
      ll v = N / i;
      if( v >= 2LL && fcheck(N,v) ) {
	ans.pb(v);
      }
    }
  }
  sort(ALL(ans));
  ans.erase(unique(ALL(ans)),ans.end());
  cout << ans.size() << endl;
  /*
  puts("--");
  rep(i,(int)ans.size()) {
    cout << ans[i] << endl;
  }
  */
  //cout << ans.size() << " == " << cnt << endl;
  //assert( ans.size() == cnt );
  //}
  return 0;
}


Measured memory_bytes: 512
/* Author: $%U%$
 * Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
**/
#include <bits/stdc++.h>
using namespace std;
#define fore(i, a, b) for (int i = a, to = b; i < to; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
typedef pair<int, int> Pair;
const int MX = (1e5);
vector<int> g[MX + 2];
bool vis[MX + 2];
vector<Pair> H;
int alt[MX + 2];
int n, m;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> m;
  H.resize(n);
  fore(i, 0, n) {
    cin >> H[i].first;
    H[i].second = i;
    alt[i] = H[i].first;
  }
  fore(i, 0, m) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].pb(b);
    g[b].pb(a);
  }
  sort(rall(H));
  int ans = 0;
  fore(i, 0, n) {
    int nodo = H[i].second;
    if (!vis[nodo]) {
      vis[nodo] = true;
      bool ok = true;
      for (int x : g[nodo]) {
        vis[x] = true;
        if (alt[x] >= alt[nodo]) ok = false;
      }
      if (ok) ans++;
    }
  }
  cout << ans << '\n';

  return 0;
}

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

void solve()
{
    ll a, b, c, d; cin >> a >> b >> c >> d;
    cout << max({a * c, a * d, b * c, b * d}) << '\n';
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}

Measured memory_bytes: 3516
#include <cstdio>

using namespace std;

int main() {
  char a[43];
  scanf("%s", &a[0]);
  if (a[0] >= 'A' && a[0] <= 'Z') {
    printf("A\n");
  } else {
    printf("a\n");
  }
  return 0;
}

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

int D;

int main() {
    cin >> D;
    cout << "Christmas ";
    int limit = 25 - D;
    for (int i = 0; i < limit; i++) cout << "Eve ";
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,M;
  int S=0;
  long double L=0;
  cin>>N>>M;
  vector<int>vec(N);
  for(int X=0;X<N;X++){
    cin>>vec.at(X);
    L+=vec.at(X);
  }
  sort(vec.begin(),vec.end());
  for(int X=N-1;X>=0;X--){
    if(vec.at(X)>=L/(M*4)){
      S++;
    }
    else{
      break;
    }
  }
  if(S>=M){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}


Measured memory_bytes: 3628
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#define all(x) (x).begin(),(x).end()

void solve(){

}
int main(){
    int n;
    cin >> n;
    int x;
    vector<int> a;
    for (int i = 0; i < n; i++){
        cin >> x;
        a.push_back(x);
    }
    sort(all(a));
    int i = 0;
    int ans = 0;
    while(i < n){
        int tmp = a[i],cnt = 0;
        while(i < n && a[i] == tmp){
            i++;
            cnt++;
        }
        ans += cnt % 2;
    }
    cout << ans << endl;

}


Measured memory_bytes: 892
import itertools
n,m=map(int,input().split())
ks=[[int(i) for i in input().split()]for i in range(m)]
p=[int(i) for i in input().split()]
swi=list(itertools.product([0,1], repeat=n))
cnt=0

for SWI in range(len(swi)):
    DK=[0 for i in range(m)]
    for onoff in range(len(swi[SWI])):
        if swi[SWI][onoff]==1:
            for i in range(m):
                for kkk in ks[i][1:]:
                    if kkk-1==onoff:
                        DK[i]+=1
                DK[i]%=2
    if DK==p:
        cnt+=1
print(cnt)

Measured memory_bytes: 3188
#include <iostream>

using namespace std;



int main()
{
  int N, res;

  cin >> N;
  res = 0;
  for (int i = 0; i < N; i++)
  {
    for (int j = 0; j < N; j++)
    {
      for (int k = 0; k < N; k++)
        res++;
    }
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define ll long long int
#define M 1000000007
#define mod 998244353
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pi pair<ll,ll>
using namespace std;
const ll N=500010;

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

    char x;
    cin>>x;
    x+=1;
    cout<<x;

    return (0);
}


Measured memory_bytes: 256
import sys
L = list(list(map(int,input().split())) for i in range(3))
n = int(input())
ls = [int(input()) for j in range(n)]
lsls = [0]
lsls[0] = L[0] + L[1] + L[2]
for k in range(n):
    for l in range(9):
        if ls[k] == lsls[0][l]:
            lsls[0][l] = 0
for r in range(3):
    b = [e for e in lsls[0]]
    a = b[r::3]
    if (sum(b[0:3]) ==0) or (sum(b[3:6]) ==0) or(sum(b[6:9]) ==0) or(sum(a) ==0):
        print("Yes")
        sys.exit()
if (lsls[0][0]+lsls[0][4]+lsls[0][8] == 0) or (lsls[0][2]+lsls[0][4]+lsls[0][6] == 0):
    print("Yes")
    sys.exit()
print("No")
    


Measured memory_bytes: 3064
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    int m = (n-1)*(n-2)/2;
    if(k > m){
        cout << -1 << endl;
        return 0;
    }
    cout << n-1 + m-k << endl;
    for(int i = 2; i <= n; ++i) cout << 1 << " " << i << endl;
    int x = 2, y = 3;
    rep(i,m-k){
        if(y > n){
            ++x;
            y = x + 1;
        }
        cout << x << " " << y << endl;
        ++y;
    }
	return 0;
}

Measured memory_bytes: 3628
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREP1(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(c) begin(c), end(c)

int _ = (
#ifndef LOCAL
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
#endif
    std::cout.precision(10), std::cout.setf(std::ios::fixed));

using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T> using vec = std::vector<T>;
using namespace std;

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

  const regex re{"[ATCG]+"};
  int answer = 0;
  for (sregex_iterator it(ALL(S), re), end; it != end; ++it) {
    auto &&m = *it;
    answer = max(answer, static_cast<int>(m.length()));
  }
  cout << answer << endl;

  return 0;
}


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

sticks = {}
for i in range(n):
    if not a[i] in sticks.keys():
        sticks[a[i]] = 1
    else:
        sticks[a[i]] += 1

edge1, edge2 = 0, 0
lengths = sorted(sticks.keys())[::-1]
for l in lengths:
    if sticks[l] >= 4:
        if edge1 == 0:
            edge1, edge2 = l, l
            break
        else:
            edge2 = l
            break
    elif sticks[l] >= 2:
        if edge1 == 0:
            edge1 = l
        else:
            edge2 = l
            break

print(edge1*edge2)


Measured memory_bytes: 17932
import numpy as np
n = int(input())
def is_prime(x):
	if x <= 1:
		return False
	root_n = int(np.sqrt(x))
	for i in range(2,root_n):
		if x%i == 0:
			return False
	return True

p = n

while not is_prime(p):
	p += 1
print(p)

Measured memory_bytes: 21144
#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>;

// auto mod int

// https://youtu.be/L8grWxBlIZ4?t=9858

// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize

// https://youtu.be/8uowVvQ_-Mo?t=1329 : division


const int mod = 998244353;

struct mint {

  ll x; // typedef long long ll;

  mint(ll x=0):x((x%mod+mod)%mod){}

  mint operator-() const { return mint(-x);}

  mint& operator+=(const mint a) {

    if ((x += a.x) >= mod) x -= mod;

    return *this;

  }

  mint& operator-=(const mint a) {

    if ((x += mod-a.x) >= mod) x -= mod;

    return *this;

  }

  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}

  mint operator+(const mint a) const { return mint(*this) += a;}

  mint operator-(const mint a) const { return mint(*this) -= a;}

  mint operator*(const mint a) const { return mint(*this) *= a;}

  mint pow(ll t) const {

    if (!t) return 1;

    mint a = pow(t>>1);

    a *= a;

    if (t&1) a *= *this;

    return a;

  }



  // for prime mod

  mint inv() const { return pow(mod-2);}

  mint& operator/=(const mint a) { return *this *= a.inv();}

  mint operator/(const mint a) const { return mint(*this) /= a;}

};

istream& operator>>(istream& is, const mint& a) { return is >> a.x;}

ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}



// combination mod prime

// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619

struct combination {

  vector<mint> fact, ifact;

  combination(int n):fact(n+1),ifact(n+1) {

    assert(n < mod);

    fact[0] = 1;

    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;

    ifact[n] = fact[n].inv();

    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;

  }

  mint operator()(int n, int k) {

    if (k < 0 || k > n) return 0;

    return fact[n]*ifact[k]*ifact[n-k];

  }

}c(2000005);


 int main(){
   int n , m, k;
   cin >> n >> m>>k;
   mint ans = 0;
   mint col = m;
   for(int x =n-1; x>=0; --x){
     mint now = col;
    now *= c(n-1,x);
     if(x <= k) ans += now;
     col *= m-1;
   }
   cout << ans << endl;
   return 0;

 }

Measured memory_bytes: 34200
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s,t;
  cin>>s>>t;
  int k=0;
  for(int i=0;i<s.size();i++){
	if(s[i]!=t[i]){
      k++;
      break;
    	}
  }
  if(k)
    cout<<"No";
  else
    cout<<"Yes";
}

Measured memory_bytes: 3624
package main

import (
	"fmt"
	"math"
)

func main() {

    var pA, pB, pAB int //price
    var rA, rB int //required
    fmt.Scan(&pA, &pB, &pAB, &rA, &rB)
	var cA, cB int //cooked

	sum := 0
	if 2*pAB < pA+pB {
		toCreate := int(math.Min(float64(rA), float64(rB)))
		sum += toCreate * 2 * pAB
		cA += toCreate
		cB += toCreate
	}

	if 2*pAB < pA {
		toCreate := rA - cA
		sum += toCreate * 2 * pAB
		cA += toCreate
		cB += toCreate

	}

	if 2*pAB < pB {
		toCreate := rB - cB
		sum += toCreate * 2 * pAB
		cA += toCreate
		cB += toCreate
	}

	if (rA - cA) > 0 {
		toCreate := rA - cA
		sum += toCreate * pA
	}

	if (rB - cB) > 0 {

		toCreate := rB - cB
		sum += toCreate * pB
	}

	fmt.Println(int(math.Ceil(float64(sum))))
}

Measured memory_bytes: 512
'use strict'
function main(i) {
  i = i.trim().split(' ').map(v => Number(v))
  let sum = (((1 + i[0]) / 2) + i[1] - 1) * i[0]
  if (!(i[1] <= 0 && i[0]+i[1]-1 > 0)) {
    sum -= (i[1] > 0) ? i[1] : i[1] + i[0] - 1
  }
  console.log(sum)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


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

using LL = long long;

#define ALL(a) begin((a)), end((a))
#define FOR(i, a, b) for (int(i) = (a); (i) < (b); (i)++)
#define RFOR(i, a, b) for (int(i) = (a); (i) > (b); (i)--)
#define debug(x) cout << #x << " : " << x << '\n'

const int INF = 1e9;

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

  int ans;
  int A, B, C;
  cin >> A >> B >> C;

  int temp = max(max(A, B), C);

  int sub;
  if (temp == A) {
    sub = (A - B) + (A - C);
  }
  if (temp == B) {
    sub = (B - A) + (B - C);
  }
  if (temp == C) {
    sub = (C - A) + (C - B);
  }

  if (sub % 2) {
    ans = sub / 2 + 2;
  } else {
    ans = sub / 2;
  }

  cout << ans << '\n';

  return 0;
}

Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <math.h> // sqrt
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <iomanip> // setprecision
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vb = vector<bool>;
using vll = vector<long long>;
using pii = pair<int, int>;
using psi = pair<string, int>;

int main() {
    int N;
    cin >> N;
    vll a(N), b(N), c(N);
    for (int i = 0; i < N; i++) {
        cin >> a.at(i);
    }
    for (int i = 0; i < N; i++) {
        cin >> b.at(i);
    }
    for (int i = 0; i < N; i++) {
        cin >> c.at(i);
    }
    sort(a.begin(), a.end());
    sort(c.begin(), c.end());
    ll ans = 0;
    for (int i = 0; i < N; i++) {
        ll ansa = lower_bound(a.begin(), a.end(), b.at(i)) - a.begin();
        ll ansc = c.end() - upper_bound(c.begin(), c.end(), b.at(i));
        ans += ansa * ansc;
    }
    cout << ans << endl;
}

Measured memory_bytes: 5612
//
//	Created by shamim_nik
//

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

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

#define br printf("\n")

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

//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int a, b, k;
	cin >> k >> a >> b;
	for(int i = a; i <= b; i++) {
		if(i % k == 0) {
			cout << "OK" << endl;
			return 0;
		}
	}
	cout << "NG" << endl;
	return 0;
}

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

using namespace std;

#define int long long
#define MOD 1000000007

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()

#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
template <typename T>
void print(T x)
{
    std::cout << x << '\n';
}

//typedef long long ll;
#define TENNINE 1000000005
#define TENFIVE 100005
//#define int long long

int a, b, c;

signed main()
{
    cin >> a >> b >> c;

    int x = 4 * a * b;
    int y = (c - a - b) * (c - a - b);

    if (c - a - b < 0)
    {
        cout << "No" << endl;
        return 0;
    }

    if (x < y)
    {
        cout << "Yes" << endl;
        return 0;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	nums := []int{1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51}
	var K int
	fmt.Scan(&K)
	fmt.Println(nums[K-1])
}


Measured memory_bytes: 512