akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>
#include<array>


using namespace std;

#define REP(i, n) for(int i = 0;i < n;++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout<<(x)<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), (n))
#define ub(v,n) upper_bound(v.begin(), v.end(), (n))
#define int long long
//#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
std::random_device rd;
std::mt19937 mt(rd());
constexpr int MOD = 1e9 + 7; constexpr int MAX = 200020;
const double pi = acos(-1); constexpr double EPS = 1e-8;
constexpr ll INF = 1e16;
typedef array<int, 3>arr3;
void die(string s) { cout << s << endl; exit(0); }
int dx[4] = { 0,0,1,-1 }, dy[4] = { 1,-1,0,0 };


void solve() {
	int N; cin >> N;
	int ans = 0;
	FOR(i, 1, N + 1) {
		ans += i;
	}
	print(ans);
}




signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q; cin >> q;
	//while (q--)
		solve();
}



Measured memory_bytes: 256
//#define LOCAL

#include<cstdio>
#include<algorithm>
#include<cstring>

using namespace std;

#define rep(a, b) for(int i = a; i <= b; i++)
#define mst(a) memset(a, 0, sizeof(a))

const int MAX = 1e2 + 10;
const int INF = 0x3f3f3f3f;

int g[MAX][MAX];
int dist[MAX];
bool vis[MAX];

void init(int n)
{
	rep(0, n - 1)
	{
		dist[i] = INF;
		for(int j = 0; j < n; j++)
			g[i][j] = INF;
	}
	mst(vis);
	return;
}

void dijkstra(int n)
{
	rep(0, n - 1)
		dist[i] = INF;
	dist[0] = 0;
	rep(0, n - 1)
	{
		int mnidx = -1, mndist = INF;
		for(int j = 0; j < n; j++)
			if(!vis[j] && dist[j] < mndist)
				mnidx = j, mndist = dist[j];
		vis[mnidx] = true;
		for(int j = 0; j < n; j++)
			if(!vis[j])
				dist[j] = min(dist[j], dist[mnidx] + g[mnidx][j]);
	}
	return;
}

int main()
{

#ifdef LOCAL
	freopen("in.txt", "r", stdin);
#endif

	int n;
	while(~scanf("%d", &n))
	{
		init(n);
		rep(0, n - 1)
		{
			int u, v, w, num;
			scanf("%d%d", &u, &num);
			while(num--)
			{
				scanf("%d%d", &v, &w);
				g[u][v] = w;
			}
		}

		dijkstra(n);

		rep(0, n - 1)
			printf("%d %d\n", i, dist[i]);
	}
	return 0;
}



Measured memory_bytes: 2764
N = int(input())
c = 0
A = 0
B = 0
BA = 0
for i in range(N):
  tmp = input()
  if (tmp[0] == 'B') & (tmp[-1] == 'A'):
    BA += 1
  elif (tmp[0] == 'B'):
    B += 1
  elif (tmp[-1] == 'A'):
    A += 1 
  c += tmp.count('AB')
if BA >= 1:
  c += BA-1
  if B >= 1:
    B -=1
    c += 1
  if A >= 1:
    A -= 1
    c += 1
c += min(A,B)
print(c)

Measured memory_bytes: 3064
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#define ll long long int
#define lim 100010
#define INF 1e9
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define ABS(x) ((x)>0?(x):-(x))


int main(void){
	int x,a;
	scanf("%d%d",&x,&a);
	if(x<a)printf("0");
	else printf("10");
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll inf=1000000000000000000;
long double pi=3.14159265358979323846L;
double eps=1e-12;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
#define srep(itr,st) for(auto itr=st.begin();itr!=st.end();itr++)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll popcount(ll n){
    ll ret=0;
    while(n>0){
        ret+=n%2;
        n/=2;
    }
    return ret;
}
ll gya[1000010];
ll kai[1000010];
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll n,W;cin>>n>>W;
    ll w[n],v[n];
    
    vector<ll> r[4];
    
    rep(i,0,n){
        cin>>w[i]>>v[i];
        
        r[w[i]-w[0]].push_back(v[i]);
        
    }
    ll ans=0;
    rep(i,0,4){
        sort(r[i].begin(),r[i].end(),greater<ll>());
    }
    ll sum[4][n+1];
    rep(i,0,4){
        sum[i][0]=0;
        rep(j,0,r[i].size())sum[i][j+1]=sum[i][j]+r[i][j];
    }
    rep(i,0,n+1){
        if(r[0].size()<i)break;
        rep(j,0,n-i+1){
            if(r[1].size()<j)break;
            rep(k,0,n-i-j+1){
                if(r[2].size()<k)break;
                rep(l,0,n-i-j-k+1){
                    if(r[3].size()<l)break;
                    ll sw=i*w[0]+j*(w[0]+1)+k*(w[0]+2)+l*(w[0]+3);
                    if(sw>W)break;
                    ans=max(ans,sum[0][i]+sum[1][j]+sum[2][k]+sum[3][l]);
                }
            }
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;
using namespace std;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int mt[9] = {2,5,5,4,5,6,3,7,6};
const int maxdigit = 50;
ll dp[100][2];
int main(){
    ll n,k;
    cin>>n>>k;
    vector<ll> a(n);
    rep(i,n){
        cin>>a[i];
    }
    rep(i,100)rep(j,2)dp[i][j]=-1;
    dp[0][0]=0;

    for(int d=0;d<maxdigit;d++){

        ll mask=(1ll<<(maxdigit-d-1));
        ll num=0;

        rep(i,n){
            if(mask&a[i])num++;
        }

        ll cost0=num*mask;
        ll cost1=(n-num)*mask;

        if(dp[d][1]!=-1){

            dp[d+1][1]=dp[d][1]+max(cost0,cost1);

        }
        if(dp[d][0]!=-1){
            if(k&mask){
                dp[d+1][1]=max(dp[d+1][1],dp[d][0]+cost0);
            }
        }

        if(dp[d][0]!=-1){
            if(k&mask){
                dp[d+1][0]=max(dp[d+1][0],dp[d][0]+cost1);
//                cout<<1<<" "<<dp[d+1][0]<<endl;
//                cout<<d<<" "<<mask<<endl;
            }else{
                dp[d+1][0]=max(dp[d][0],dp[d][0]+cost0);
//                cout<<2<<" "<<dp[d+1][0]<<endl;
            }

        }

    }

    cout<<max(dp[maxdigit][0],dp[maxdigit][1])<<endl;







return 0;
}


Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, s, e) for(ll i=s; i>=e; i--)
#define reps(i, s, e) for(ll i=s; i<=e; i++)
#define inf 1e18
#define all(v) v.begin(),v.end()
#define ok cout << "ok" << endl;
#define sp << " " <<
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename T> void vdeb(T v){
    cout << "#vector set debug" << endl;
    for(auto vv : v) cout << vv << " ";
    cout << endl;
}
template<typename T1, typename T2> void adeb(T1 arr[], T2 n){
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}
template<typename T1> void mdeb(T1 mp){
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){ fill((T*)array, (T*)(array+N), val); }
void ans(bool b){ cout << (b ? "Yes" : "No") << endl; }
void ans2(bool b){ cout << (b ? "YES" : "NO") << endl; }
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};


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

    string s;
    cin >> s;

    int slen = s.length();
    bool res = false;
    int marker = 0;
    rep(i, slen){
        if(i >= 1 && s[i] == s[i-1]){
            res = false;
            break;
        }
        if(marker == (1<<5)-1 && s[i] != 'A'){
            res = false;
            break;
        }
        if(marker == 1<<0 && s[i] == 'A'){
            res = false;
            break;
        }
        if(marker == (1<<2)-1 && s[i] == 'A'){
            res = false;
            break;
        }

        if(s[i] == 'K' && marker == 0) marker |= 1<<0;
        else if(s[i] == 'I' && marker & 1<<0) marker |= 1<<1;
        else if(s[i] == 'H' && marker & 1<<1) marker |= 1<<2;
        else if(s[i] == 'B' && marker & 1<<2) marker |= 1<<3;
        else if(s[i] == 'R' && marker & 1<<3){
            marker |= 1<<4;
            res = true;
        }else{
            if(s[i] != 'A') marker = 0;
        }
    }

    ans2(res);

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>

using namespace std;
int main (){
    int n;
    cin >> n;
    int max=1;
    int comp;
    for (int i = 1; i < n; i++){
    for (int j = 2; j < n; j++){
        comp=pow(i,j);
        if(comp>max && comp <=n) max=comp;
    }
    }
    cout << max << "\n";
}

Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#define ll long long
#define lson (rt<< 1)
#define rson (rt<< 1 | 1)
#define gmid ((l+r)>> 1 )
using namespace std;

const int maxn=20000050;
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;++i)
	  cout<<"ACL";  
}


Measured memory_bytes: 3588
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <math.h>

using namespace std;
using ll = long long int;

int main()
{
  ll n, p;
  cin >> n >> p;
  vector<ll> divide;
  for(ll i = 1; i * i <= p; i++)
  {
    if(p % i == 0)
    {
      divide.push_back(i);
      divide.push_back(p / i);
    }
  } 
  sort(divide.begin(), divide.end());
  map<ll, int> m;
  for(auto e : divide)
  {
    m[e] = 1;
  }
  ll max_d = 0;
  for(int i = 0; i < divide.size(); i++)
  {
    ll an = pow(divide[i], n);
    if(m.count(an))
    {
      max_d = max(divide[i], max_d);
    }  
  }
  cout << max_d << endl;
	return 0;
}


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

int main() {
	// your code goes here
	int x, y;
	
	
	while(1){
		
		cin >> x >> y;
		
		if(x == 0 && y == 0){
			return 0;
		}
		
		if(x > y ){
			cout << y << " " << x << endl;
		}else {
			cout << x << " " << y << endl;
		}
		
	}
	return 0;
}

Measured memory_bytes: 2996
#include <iostream>

using namespace std;

int main()
{
  int A,B,C,X,Y;
  cin >> A >> B >> C >> X >> Y;

  int c = A*X+B*Y;
  for( int i=0;i<=2*max(X, Y);i+=2 )
    c = min(c, A*max(X-i/2, 0)+B*max(Y-i/2, 0)+C*i);
  cout << c << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#define hani 2000000
#define hani2 10000

int main(){
  short *A,*B;
  int C[hani2+1],n, i, j;

  scanf("%d", &n);

  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);

  for(i=0;i<=hani2;i++) C[i]=0;

  for(i=0;i<n;i++ ){
    scanf("%hu",&A[i + 1]);
    C[A[i+1]]++;
  }

  for(i=1;i<=hani2;i++) C[i]=C[i]+C[i-1];

  for(j=1;j<=n;j++){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }

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

  return 0;
}

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

#define FasterIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(v) v.begin(), v.end()
const int MOD = 1e9+7;

int main(){
    FasterIO;

    int n, m;

    while(cin>>n>>m){
        int l, r, cnt[n+2];

        memset(cnt, 0, sizeof cnt);

        for(int i=0; i<m; i++){
            cin>>l>>r;
            cnt[l]++;
            cnt[r+1]--;
        }

        for(int i=1; i<=n; i++){
            cnt[i]+=cnt[i-1];
        }

        int ans=0;

        for(int i=0; i<=n; i++){
            if(cnt[i]==m)
                ans++;
        }

        cout<<ans<<endl;
    }

    return 0;
}



Measured memory_bytes: 640
//By TheOneYouWant
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t) int t;cin>>t;while(t--)
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i=0;i<e;++i)
#define forsn(i,s,e) for(int i=s;i<e;++i)
#define rforn(i,s) for(int i=s;i>=0;--i)
#define rforsn(i,s,e) for(int i=s;i>=e;--i)
#define bitcount(a) __builtin_popcount(a) // set bits (add ll)
#define ln '\n'
#define getcurrtime() cerr<<"Time = "<<((double)clock()/CLOCKS_PER_SEC)<<endl
#define dbgarr(v,s,e) cerr<<#v<<" = "; forsn(i,s,e) cerr<<v[i]<<", "; cerr<<endl
#define inputfile freopen("input.txt", "r", stdin)
#define outputfile freopen("output.txt", "w", stdout)
#define dbg(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) { cerr<<endl; }
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << "\t"; err(++it, args...);
}
template<typename T1,typename T2>
ostream& operator <<(ostream& c,pair<T1,T2> &v){
	c<<"("<<v.fi<<","<<v.se<<")"; return c;
}
template <template <class...> class TT, class ...T>
ostream& operator<<(ostream& out,TT<T...>& c){
    out<<"{ ";
    forstl(x,c) out<<x<<" ";
    out<<"}"; return out;
}
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> p64;
typedef pair<int,int> p32;
typedef pair<int,p32> p96;
typedef vector<ll> v64;
typedef vector<int> v32; 
typedef vector<v32> vv32;
typedef vector<v64> vv64;
typedef vector<p32> vp32;
typedef vector<p64> vp64;
typedef vector<vp32> vvp32;
typedef map<int,int> m32;
const int LIM=1e5+5,MOD=1e9+7;
const ld EPS = 1e-9;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main(){
	fastio;

	int n, l;
	cin>>n>>l;

	ll a[n]; 
	forn(i,n) cin>>a[i];

	bool pos = 0;
	int val = -1;

	forn(i,n-1){
		if(a[i]+a[i+1] >= l){
			pos = 1;
			val = i+1;
			break;
		}
	}

	if(!pos){
		cout<<"Impossible"<<ln;
	}
	else{
		cout<<"Possible"<<ln;
		forsn(i,1,val) cout<<i<<ln;
		rforsn(i,n-1,val+1) cout<<i<<ln;
		cout<<val<<ln;
	}

	return 0;
}

Measured memory_bytes: 4420
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main() {
  int N, d[SIZE];

  scanf("%d", &N);

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

  sort(d, d+N);

  int ans = d[N/2] - d[N/2-1];

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007

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

  vector<vector<int>> num(3,vector<int>(0));
  
  for(int i = 0;i < M;i++) {
    int s,c;
    cin >> s >> c;
    num.at(s-1).push_back(c);
  }

  
  vector<char> ch(0);
  for(int i = 0;i < N;i++) {
    if(num.at(i).size() == 0) {
      if(N >= 2 && i == 0) ch.push_back('1');
      else ch.push_back('0');
    }else {
      for(int j = 0;j < num.at(i).size()-1;j++) {
        if(num.at(i).at(j) != num.at(i).at(j+1)) {
          cout << -1 << endl;
          return 0;
        }
      } 
      if(num.at(i).at(0) == 0 && i == 0 && N >= 2) {
        cout << -1 << endl;
        return 0;
      }
      ch.push_back((char)(num.at(i).at(0)+'0'));
    }
  }

  for(int i = 0;i < ch.size();i++) cout << ch.at(i);
  cout << endl;
}


Measured memory_bytes: 256
#include <cmath>

#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

using ll = long long;
using ld = long double;
using vi = vector<int>;

int n;
vi a;

void input() {
  cin >> n;

  a.resize(n);
  for (auto&& i : a)
    cin >> i;
}

bool can(int a, int b, int c) {
  return a + b > c && a + c > b && b + c > a;
}

void solve() {
  int ans = 0;

  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (a[i] == a[j])
        continue;

      for (int k = j + 1; k < n; ++k) {
        if (a[i] == a[k] || a[j] == a[k])
          continue;

        if (can(a[i], a[j], a[k]))
          ++ans;
      }
    }
  }

  cout << ans << '\n';
}

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

  cout.precision(16);
  cout << fixed;

  int _times = 1;

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

  _times = 4;
#endif

  // cin >> _times;

  while (_times--) {
    input();
    solve();
  }
}


Measured memory_bytes: 3660
#include <iostream>
#include<algorithm>
#include<set>
#include<queue>
#define rep(i,j,n) for(int i=j;i<n;i++)
using namespace std;
#define int long long
int mul[214514];
int divi[214514];
#define inf 1000000007
int bit[114514],n;
struct edge{int u,v,cost;};
edge es[214514];
int zero=0;
string alph("abcdefghijklmnopqrstuvwxyz");
signed main(){
    string s;cin>>s;
    s[3]='8';
    cout<<s<<endl;
    return 0;
}


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

using namespace std;

const int MOD = 1000000007;

template <std::uint_fast64_t Modulus>
class Modular {
  using u64 = std::uint_fast64_t;

 public:
  u64 x;

  constexpr Modular(const u64 x = 0) noexcept : x(x % Modulus){};

  constexpr Modular operator+(const Modular rhs) const noexcept {
    return Modular(*this) += rhs;
  }
  constexpr Modular operator-(const Modular rhs) const noexcept {
    return Modular(*this) -= rhs;
  }
  constexpr Modular operator*(const Modular rhs) const noexcept {
    return Modular(*this) *= rhs;
  }
  constexpr Modular operator/(const Modular rhs) const noexcept {
    return Modular(*this) /= rhs;
  }
  constexpr Modular &operator+=(const Modular rhs) noexcept {
    x += rhs.x;
    if (x >= Modulus) x -= Modulus;
    return *this;
  }
  constexpr Modular &operator-=(const Modular rhs) noexcept {
    if (x < rhs.x) x += Modulus;
    x -= rhs.x;
    return *this;
  }
  constexpr Modular &operator*=(const Modular rhs) noexcept {
    x = x * rhs.x % Modulus;
    return *this;
  }
  constexpr Modular &operator/=(Modular rhs) noexcept {
    u64 n = Modulus - 2;
    while (n) {
      if (n & 1) *this *= rhs;
      rhs *= rhs;
      n /= 2;
    }
    return *this;
  }
  constexpr Modular operator++(int) noexcept {
    Modular y = *this;
    x += 1;
    return y;
  }
  constexpr Modular operator--(int) noexcept {
    Modular y = *this;
    x -= 1;
    return y;
  }
  constexpr bool operator==(const Modular rhs) noexcept { return x == rhs.x; }
  constexpr bool operator!=(const Modular rhs) noexcept { return x != rhs.x; }

  friend std::istream &operator>>(std::istream &is, Modular &rhs) {
    is >> rhs.x;
    return is;
  }
  friend std::ostream &operator<<(std::ostream &os, const Modular &rhs) {
    os << rhs.x;
    return os;
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M;
  cin >> N >> M;
  vector<int> S(N), T(M);
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  for (int i = 0; i < M; i++) {
    cin >> T[i];
  }

  using mint = Modular<MOD>;

  vector<vector<mint>> dp(N + 1, vector<mint>(M + 1, 0));
  dp[0][0] = 1;

  for (int i = 0; i < N + 1; i++) {
    for (int j = 0; j < M + 1; j++) {
      if (i - 1 >= 0 && j - 1 >= 0 && S[i - 1] == T[j - 1])
        dp[i][j] += dp[i - 1][j - 1];
      if (i - 1 >= 0) dp[i][j] += dp[i - 1][j];
      if (j - 1 >= 0) dp[i][j] += dp[i][j - 1];
      if (i - 1 >= 0 && j - 1 >= 0) dp[i][j] -= dp[i - 1][j - 1];
    }
  }

  cout << dp[N][M] << '\n';
  return 0;
}


Measured memory_bytes: 31616
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int64_t, int64_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

struct Vertex {
  int64_t distance{INT64_MAX};
  vector<pair<int64_t, int64_t>> edges;
};

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

  string S;
  cin >> S;
  int32_t N = static_cast<int32_t>(S.length());
  const char *const text = S.c_str();

  vector<int32_t> loop_left;
  vector<int32_t> final_number(N, 0);
  int32_t store_index = 0;
  for (int32_t i = 0; i < N; ++i) {
    if (i == N - 1) {
      while (store_index < N) {
        const int32_t previous_loop_left = loop_left[loop_left.size() - 1];
        if ((store_index - previous_loop_left) % 2 == 0) {
          final_number[previous_loop_left]++;
        } else {
          final_number[previous_loop_left + 1]++;
        }
        ++store_index;
      }
    } else if (text[i] == 'R' && text[i + 1] == 'L') {
      loop_left.push_back(i);
      while (store_index <= i) {
        if (text[store_index] == 'R') {
          if ((i - store_index) % 2 == 0) {
            final_number[i]++;
          } else {
            final_number[i + 1]++;
          }
        } else {
          const int32_t previous_loop_left = loop_left[loop_left.size() - 2];
          if ((store_index - previous_loop_left) % 2 == 0) {
            final_number[previous_loop_left]++;
          } else {
            final_number[previous_loop_left + 1]++;
          }
        }
        ++store_index;
      }
      final_number[store_index]++;
      ++store_index;
    }
  }
  for (int32_t i = 0; i < N; ++i) {
    if (i != 0) {
      cout << " ";
    }
    cout << final_number[i];
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 1232
import java.util.*;

public class Main{
	public static void main(String[] args) {
		char c;
		int count, _count, ind;
		
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		String[] t = new String[n];
		
		for(int i = 0; i < n; i++) t[i] = s.next();
		
		c = 'a';
		while(c <= 'z') {
			count = 0;
			for(int i = 0; i < n; i++) {
				_count = 0;
				ind = t[i].indexOf(c);
				while(ind != -1) {
					_count++;
					ind = t[i].indexOf(c, ind + 1);
				}
				if(_count == 0) {
					count = 0;
					break;
				}else if(count > _count || i == 0) {
					count = _count;
				}
			}
			
			for(int i = 0; i < count; i++) System.out.print(c);
			c++;
		}
		
		System.out.println("");
	}
}


Measured memory_bytes: 36004
#include <stdio.h>

int main(void){
    int price[]={0,6,4,3,2};
    int t, n;
    
    for (int i=0; i<4; i++){
        scanf("%d %d", &t, &n);
        printf("%d\n", price[t]*n*1000);
    }
    return 0;
}

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

int main( void ) {
    int b,r,g,c,s,t;
    while ( cin >> b >> r >> g >> c >> s >> t ) {
        if ( b == 0 && r == 0 && g == 0 && c == 0 && s == 0 && t == 0 ) break;
        int answer = 100;
        answer -= 3 * ( t - s - ( 5 * b + 3 * r ) );
        answer += ( b + r ) * 15;
        answer += g * 7;
        answer += c * 2;
        answer += ( 5 * b + 3 * r ) * 13;
        cout << answer << endl;
    }
    return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long int lli;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    lli a,v,b,w,t,can;
    cin>>a>>v>>b>>w>>t;
    if(w>=v) cout<<"NO";
    else
    {
        can=v*t;
        can-=w*t;
        
        if(abs(a-b) <= can) cout<<"YES";
        else cout<<"NO";
    }
    return 0;
}

Measured memory_bytes: 3616
from sys import exit, stdin
N, A, B, C = [int(_) for _ in stdin.readline().rstrip().split()]
L = [int(stdin.readline().rstrip()) for _ in range(N)]
INF = 10**9

def rec(i, a, b, c):
    if i == N:
        if min(a, b, c) > 0:
            return abs(a-A)+abs(b-B)+abs(c-C)-30
        else:
            return INF
    ret0 = rec(i+1,a,b,c)
    ret1 = rec(i+1,a+L[i],b,c)+10
    ret2 = rec(i+1,a,b+L[i],c)+10
    ret3 = rec(i+1,a,b,c+L[i])+10

    return min(ret0, ret1, ret2, ret3)

print(rec(0, 0, 0, 0))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9+7;

int main(){
  
  int n,k; cin>>n>>k;
  vector<int>x(n);
  for(int i=0; i<n; i++){
    cin>>x.at(i);
  }
  int ans=1e9;
  for(int i=0; i+k-1<n; i++){
    ans = min(ans,abs(x.at(i))+abs(x.at(i)-x.at(i+k-1)));
    ans = min(ans,abs(x.at(i+k-1))+abs(x.at(i+k-1)-x.at(i)));
  }
  cout << ans << endl;
  
  
  
}

Measured memory_bytes: 3672
G[10000],v[10000];
i,a,b,C;
main(N){
	for(;scanf("%d",&N)*N;){
		for(i=0;i<N*N;i++){
			scanf("%d%d",&a,&b);
			G[i]=a+b*N;
			v[i]=-1;
		}
		C=0;
		for(i=0;i<N*N;i++){
			for(a=i;;){
				if(~v[a]){
					if(v[a]==i){
						C++;
					}
					break;
				}
				v[a]=i;
				a=G[a];
			}
		}
		printf("%d\n",C);
	}
}

Measured memory_bytes: 0
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		while (true)
		{
			String num = sc.next();
			if (num.equals("0"))
			{
				return;
			}

			int sum = 0;
			for (int i = 0; i < num.length(); i++)
			{
				sum += (num.charAt(i) - '0');
			}

			System.out.println(sum);
		}
	}
}


Measured memory_bytes: 26232
#import collections
# c = collections.Counter()
#import itertools as it
#import math
#import numpy as np
#import sys 
#sys.exit()
 
#  = input()
k  = int(input())
a, b  = map(int, input().split())
'''
#  = list(map(int, input().split()))
'''
'''
n = input()
a = [int(input()) for i in range(n)]
'''
'''
n,m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(m)]
'''

#-------------------------------#

if a%k==0 or b%k==0 or a//k!=b//k:
	print('OK')
else:
  	print('NG')

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

int main(){
    string str;
    cin >> str;
    str += "Z";
    string S = "";
    for(int i = 0; i < str.length(); i++){
        if(str[i] == 'A')S = S + 'A';
        else if(str[i] == 'B' && str[i + 1] == 'C'){
            S = S + "B";
            i++;
        }
        else S = S + "Z";
    }
    
    long long A = 0;
    long long ans = 0;
    for(int i = 0; i < S.length(); i++){
        if(S[i] == 'Z'){
            A = 0;
        }else{
            if(S[i] == 'A')A++;
            else ans += A;
        }
    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1436
S = input()
d = []
cnt = 1
cur = 1
flg = False
while cur < len(S):
  if flg == True:
    cur += 1
    cnt += 1
    flg = False
    continue
  if cur == len(S)-1:
    if S[cur] == S[cur-1]:
      cur += 1
      continue
  cnt += 1
  if S[cur] == S[cur-1]:
    cur += 1
    flg = True
  cur += 1

print(cnt)
    
    

Measured memory_bytes: 3500
# -*- coding: utf-8 -*-
import math

class KochCurve(object):
	x = 0.0
	y = 0.0

	# ?§£???
	def koch(self, n, a, b):
		if n == 0:
			return 

		s = KochCurve()
		t = KochCurve()
		u = KochCurve()
		th = math.pi * 60.0 / 180.0

		s.x = (2.0 * a.x + 1.0 * b.x) / 3.0
		s.y = (2.0 * a.y + 1.0 * b.y) / 3.0
		t.x = (1.0 * a.x + 2.0 * b.x) / 3.0
		t.y = (1.0 * a.y + 2.0 * b.y) / 3.0
		u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
		u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y
		
		KochCurve().koch(n - 1, a, s)
		msg = "%.8f %.8f" % (s.x, s.y)
		print(msg)
		KochCurve().koch(n - 1, s, u)
		msg = "%.8f %.8f" % (u.x, u.y)
		print(msg)
		KochCurve().koch(n - 1, u, t)
		msg = "%.8f %.8f" % (t.x, t.y)
		print(msg)
		KochCurve().koch(n - 1, t, b)


if __name__ == '__main__':
	a = KochCurve()
	b = KochCurve()

	n = int(input())

	a.x = 0
	a.y = 0
	b.x = 100
	b.y = 0

	msg = "%.8f %.8f" % (a.x, a.y)
	print(msg)
	KochCurve().koch(n, a, b)
	msg = "%.8f %.8f" % (b.x, b.y)
	print(msg)

Measured memory_bytes: 8088
n = int(input())
l =list(map(int, input().split())) 
l.sort()
list_a = []
list_m =[0]*n*2
for i in l[::-1]:
  list_a.append(i)
count =list_a[0]
for i in range(0,n):
  list_m[2*(i-1)] = list_a[i]
  list_m[2*(i-1)+1] = list_a[i]
  
for i in range(n-2):
  count+=list_m[i]

print(count)

Measured memory_bytes: 31508
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;

int main(){
    int n, m;
    cin >> n >> m;
    vector<ll> v(n+1);
    map<ll, ll> cnt;
    rep(i, n) cin >> v[i];
    rep(i, n){
        v[i+1] += v[i];
        v[i] %= m;
        cnt[v[i]]++;
    }

    ll ans = cnt[0];
    for(auto p: cnt){
        ans += cnt[p.first] * (cnt[p.first] - 1) / 2;
    }

    cout << ans << endl;
}

Measured memory_bytes: 4992
n = gets.to_i
A = gets.split.map(&:to_i)
even,odd = n.times.partition(&:even?)

if n.even?
  puts (odd.reverse + even).map{|i| A[i]}.join(' ')
else
  puts (even.reverse + odd).map{|i| A[i]}.join(' ')
end

Measured memory_bytes: 29208
#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int a[100005], b[100005], c[100005];
int f[100005][3];
int main() 
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> a[i] >> b[i] >> c[i];
	for (int i = 1; i <= n; i++)
	{
		f[i][0] = max(f[i - 1][1], f[i - 1][2]) + a[i];
		f[i][1] = max(f[i - 1][0], f[i - 1][2]) + b[i];
		f[i][2] = max(f[i - 1][0], f[i - 1][1]) + c[i];
	}
	cout << max(f[n][0], max(f[n][1], f[n][2])) << endl;
	return 0;
}

Measured memory_bytes: 2560
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int main(){
	vector<int> a(3);
	cin >> a[0] >> a[1] >> a[2];
	cout << *max_element(a.begin(), a.end()) - *min_element(a.begin(), a.end());
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define vi vector<int>
#define vvi vector<vector<int>>
#define pii pair<int,int>
#define tii tuple<int,int,int>
#define all(v) (v).begin(),(v).end()
#define ll long long
#define ull unsigned long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define ld long double
#define mod 1000000007
#define PI 3.141592653589793238
#define phi 1.638
#define eps 1e-7
//#define endl "\n"
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int32_t main() 
{
    fastio
    string s;
    cin>>s;
    int n = s.length();
    map<int, ll> mp;
    ll last = 0;
    ll cur = 1;
    vector<ll> vec(n);
    for(int i = n-1; i>=0; --i) {
        last += cur*(s[i]-'0');
        last %= 2019;
        mp[last] += 1;
        cur *= 10;
        cur %= 2019;
        vec[i] = last;
    }

    ll ans = mp[0];
    ll num = 0;
    cur = 1;
    for(int i = n-1; i>=3; --i) {
        int dig = s[i]-'0';
        num += dig*cur;
        num %= 2019;

        mp[num] -= 1;
        ans += mp[num];

        cur *= 10;
        cur %= 2019;
    }
    cout<<ans<<endl;
}   

Measured memory_bytes: 5188
import os

def main():
    n, k = map(int, input().split())
    res = 0
    if k % 2 == 0 :
        kk = k // 2
        knum = n // k
        kknum = n // kk - knum
        res = knum ** 3 + kknum ** 3
    else:
        knum = n // k
        res = knum ** 3
    print(res)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner in=new Scanner(System.in);
		String s;
		int n,cnt=0;
		String[] str=new String[30000];
		for(int i=0;i<30000;i++)
			str[i]="zzzzzz";
		s=in.nextLine();
		n=in.nextInt();
		for(int i=0;i<n;i++)
		{
			for(int j=0;i+j<s.length();j++)
			{
				str[cnt++]=s.substring(j,i+j+1);
			}
		}
		Arrays.sort(str);
		int k=0;
		for(int i=0;i<cnt;i++)
		{
			if(!str[i].equals(str[i+1]))
				k++;
			if(k==n)
				{System.out.println(str[i]);break;}
		}
	}

}


Measured memory_bytes: 25172
s = input()
q = int(input())
 
rev = False
fore = []
end = []
 
for i in range(q):
    l = input().split()
    if l[0] == "1":
        rev ^= True
    else:
        if l[1] == "1":
            if rev == False:
                fore.append(l[2])
            else:
                end.append(l[2])
        else:
            if rev == False:
                end.append(l[2])
            else:
                fore.append(l[2])
 
if rev == False:
    print("".join(reversed(fore)) + s + "".join(end))
else:
    print("".join(reversed(end)) + "".join(reversed(s)) + "".join(fore))

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

using namespace std;

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

int main(void){
	int q;
	cin >> q;
	ll sum=0;
	rep(i,q){
		int p,n;
		char c;
		cin >> p >> c >> n;
		int sign=(c=='(')?1:-1;
		sum+=sign*n;
		if(sum==0)
			puts("Yes");
		else
			puts("No");
	}
	return 0;
}

Measured memory_bytes: 1120
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<=n;i++)
const ll MOD = 1000000007;
long long modinv(long long a, long long m=MOD) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
    /*MODの割り算の際に
    a/＝b;
    を
    a *= modinv(b,MOD);
    とする。
        */
}

int N;
const int MAXN = 200001;
char c[MAXN];

int main(){
    cin >> N;
    bool red = false;
    bool white = false;
    int red_num = 0;
    int white_num = 0;
    rep(i,N){
        cin >> c[i];
        if(c[i] == 'W'){
            white_num++;
        }
        if(c[i] == 'R'){
            red_num++;
        }
    }
    int count = 0;
    for(int i=0;i<red_num;i++) {
        if(c[i] == 'W')count++;
    }
    cout << count << endl;


    return 0;
}

Measured memory_bytes: 3728
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
const ll LINF=0x1fffffffffffffff;
const int INF=0x3fffffff;
const int MOD=1000000007;
#define VAR(type,...) type __VA_ARGS__;in(__VA_ARGS__)
#define VEC(type,name,size) vector<type> name(size);each(x, name)in(x)
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,a,b) for(int i=(a-1);i>=(b);--i)
#define each(x,v) for(auto &x:(v))
#define all(x) (x).begin(),(x).end()
#define print(x) cout<<(x)<<endl
void in(){} template<class T,class... U> void in(T &t,U &...u){cin>>t;in(u...);}
void solve();
int main(){cin.tie(0);ios::sync_with_stdio(0);solve();}

void solve() {
  VAR(int, A, B);
  print((A + B) % 24);
}


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

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int,int> P;
typedef std::pair<int,P> State;

const int INF = 1001001001;

// S N E W(南北東西)
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

int counter[3][10], A[50];
char C[50];

int toIndex(char c){
    std::string s = "RGB";
    REP(i, 3){if(c == s[i]){return i;}}
}

int can(int x, int y){
    if(x > 9){return 0;}
    
    int res = 0;
    int c = counter[y][x];
    if(c > 0){
        if(c >= 3){
            counter[y][x] -= 3;
            res = std::max(res, can(x, y) + 3);
            counter[y][x] += 3;
        }
        if(x+2 <= 9 && counter[y][x+1] > 0 && counter[y][x+2] > 0){
            counter[y][x]   -= 1;
            counter[y][x+1] -= 1;
            counter[y][x+2] -= 1;
            res = std::max(res, can(x, y) + 3);
            counter[y][x]   += 1;
            counter[y][x+1] += 1;
            counter[y][x+2] += 1;
        }
    }
    return std::max(res, can(x+1, y));
}

int main(){
    int N;
    std::cin >> N;

    REP(_, N){
        REP(i, 3){
            REP(j, 10){
                counter[i][j] = 0;
            }
        }

        REP(i, 9){
            std::cin >> A[i];
        }

        REP(i, 9){
            std::cin >> C[i];
        }

        REP(i, 9){
            counter[toIndex(C[i])][A[i]]++;
        }

        if(can(0, 0) + can(0, 1) + can(0, 2) == 9){
            puts("1");
        }else{
            puts("0");
        }
    }
}

Measured memory_bytes: 1176
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    for (ll a = -1000; a <= 1000; a++) {
        for (ll b = -1000; b <= 1000; b++) {
            if (a * a * a * a * a - b * b * b * b * b == x) {
                cout << a << ' ' << b << endl;
                exit(0);
            }
        }
    }

    return 0;
}

Measured memory_bytes: 3596
s = input()[::-1]
a = "maerd"
b = "remaerd"
c = "esare"
d = "resare"
while len(s)!=0:
  if s[:5]==a:
    s = s[5:]
  elif s[:7]==b:
    s = s[7:]
  elif s[:5]==c:
    s = s[5:]
  elif s[:6]==d:
    s = s[6:]
  else:
    print("NO")
    exit()
print("YES")

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define range(a) a.begin(), a.end()
#define endl "\n"
#define Yes() cout << "Yes" << endl
#define No() cout << "No" << endl
using Graph = vector<vector<int>>;
const unsigned long long mod = 1e9 + 7;
const long long INF = 1LL<<60;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
void chmin(long long &a, long long b) { if (a > b) a = b; }
void chmax(long long &a, long long b) { if (a < b) a = b; }

int main(void){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int A,B;	cin>>A>>B;
	if(A>9||B>9)	cout<<"-1"<<endl;
	else	cout<<A*B<<endl;

    return 0;
}




Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define sp pair<string,string>

int N;
string S;
map<sp,int> mp;

void dfs1(string r, string b, int idx){
    if(idx == N){
        mp[{r, b}]++;
    }else{
        dfs1(r + S[idx], b, idx + 1);
        dfs1(r, b + S[idx], idx + 1);
    }
}

ll dfs2(string r, string b, int idx){
    if(idx == N - 1){
        return mp[{b,r}];
    }else{
        return dfs2(r + S[idx], b, idx - 1) + dfs2(r, b + S[idx], idx - 1);
    }
}

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

    dfs1("", "", 0);
    cout << dfs2("", "", 2 * N - 1) << endl;
    return 0;
}

Measured memory_bytes: 87808
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define str string
#define all(x) (x).begin(),(x).end()
#define rep(x,b,c) for(int x=b;x<c;x++)
#define  pb(x) push_back(x)
int main(){
	vector<int>v;
    int n;
    cin>>n;
    rep(i,0,n){
        int a;
        cin>>a;
        v.pb(a);
        if(v[i]%2==0){
        	if(v[i]%3!=0&&v[i]%5!=0){
        	    cout<<"DENIED";
        	    return 0;
			}
		}
	}
	cout<<"APPROVED";
	return 0;
}

Measured memory_bytes: 764
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>

#define F first
#define S second
#define vsort(v) sort((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;

int main(int argc, const char * argv[]) {
    string s;
    cin >> s;
    if (s[0] == '9' || s[1] == '9') {
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
from fractions import gcd
import sys
sys.setrecursionlimit(4100000)

def ols(): return input()
def oli(): return map(int, input().split())
def olai(): return list(map(int, input().split()))
def olas(): return list(input().split())
def mlai(L): return [int(input()) for _ in range(L)]
def mlas(L): return [input() for _ in range(L)]

def ar(a, b, c=-1, d=-1, INIT=0):
    if(c==-1): return [[INIT]*b for _ in range(a)]
    if(d==-1): return [[[INIT]*c for _ in range(b)] for __ in range(a)]
    return [[[[INIT]*d for _ in range(c)] for __ in range(b)] for ___ in range(a)]

def lcm(a, b): return (a*b)//gcd(a, b)
#MOD
"""
P = 10**9 + 7
N = 700000 #使う最大値+1以上にする、値に注意3*10^5とかにしとくと安心
inv = [0] + [1] # 1/x
finv = [1] + [1] # 1/x!
fac = [1] + [1] # x!
for i in range(2, N):
  inv += [inv[P % i] * (P - int(P / i)) % P]
  fac += [(fac[i-1] * i) % P]
  finv += [(finv[i-1] * inv[i]) % P]

def comb(a, b):
    if a<b: return 0 # error
    return (fac[a] * ((finv[b] * finv[a-b]) % P)) %P
"""

l, = oli()
print((l/3)**3)


Measured memory_bytes: 5176
#define DEBUG 0

/**
 * File    : C.cpp
 * Author  : Kazune Takahashi
 * Created : 3/3/2019, 9:05:49 PM
 * Powered by Visual Studio Code
 */

#include <iostream>
#include <iomanip>   // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple>
#include <queue>
#include <stack>
#include <map> // if (M.find(key) != M.end()) { }
#include <set>
#include <functional>
#include <random> // auto rd = bind(uniform_int_distribution<int>(0, 9), mt19937(10101010));
#include <chrono> // std::chrono::system_clock::time_point start_time, end_time;
// start = std::chrono::system_clock::now();
// double elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end_time-start_time).count();
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;

typedef long long ll;

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

// const int C = 1e6+10;
// const ll M = 1000000007;

string S;

int main()
{
  cin >> S;
  int cnt[2] = {0, 0};
  for (auto x : S)
  {
    cnt[x - '0']++;
  }
  cout << min(cnt[0], cnt[1]) * 2 << endl;
}

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

int a[100010];

int main () {

int n;
cin>>n;
int cet=0,dva=0;
for (int i=0; i<n; i++) {
	cin>>a[i];
	if (a[i]%4==0) {cet++;}
	else if (a[i]%2==0) {dva++;}
}
if (cet+(dva/2)>=(n/2)) {cout<<"Yes";} else {cout<<"No";}

return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;

const int INF = 1e9;
const ld EPS = 1e-8;

int A4[4][3] = {
  {1, 2, 3},
  {2, 3, 0},
  {3, 1, 0},
  {0, 2, 1}
};

vector<vector<int>> solve(const vector<int> &idx) {
  int N = idx.size();
  vector<vector<int>> res(N, vector<int> (N - 1));
  if(N % 2 == 1) {
    REP(i,N)REP(j,N - 1) res[i][j] = idx[(i + j + 1) % N];
  }else if(N == 4) {
    REP(i,N)REP(j,N - 1) res[i][j] = idx[A4[i][j]];
  }else{
    REP(i,N) res[i][0] = idx[(i + 1) % N];
    vector<int> odd(N / 2), even(N / 2);
    REP(i,N / 2) odd[i] = idx[2 * i + 1];
    REP(i,N / 2) even[i] = idx[2 * i];
    vector<vector<int>> idx_odd = solve(odd);
    vector<vector<int>> idx_even = solve(even);
    REP(i,N)REP(j,N / 2 - 1) {
      if(i % 2 == 0) res[i][j + 1] = idx_even[i / 2][j];
      else res[i][j + 1] = idx[(i + 2 * j + 3) % N];
    }
    REP(i,N)REP(j,N / 2 - 1) {
      if(i % 2 == 1) res[i][j + N / 2] = idx_odd[i / 2][j];
      else res[i][j + N / 2] = idx[(i + 2 * j + 3) % N];
    }
  }
  return res;
}

int main(){
  int N;
  cin >> N;
  if(N == 2) {
    cout << -1 << endl;
  }else{
    vector<int> idx(N);
    iota(ALL(idx), 0);
    vector<vector<int>> A = solve(idx);
    REP(i,N) {
      REP(j,N - 1) {
        if(j) cout << " ";
        cout << A[i][j] + 1;
      }
      cout << endl;
    }
  }
  return 0;
}



Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
struct P
{
    //string r;
    int x,y,z;

    bool operator<(const P &a)const{
       // if(y!=a.y)
       // return y>a.y;
       return x>a.x;
//        return z>a.z;
    }
};
struct S
{
    //double a;
    int x,y;
};
vector<int> v[311210];

int a,b,c,i,k,d,n,m,e,dy[15]={0,0,-1,1,-1,1,-1,1},dx[15]={-1,1,0,0,1,1,-1,-1};
int l[333][55];
int o[1131][555];
//int dy[10]={1,0,-1,-1,-1,0},dx[10]={0,1,1,0,-1,-1};
//int dy1[10]={1,1,0,-1,0,1},dx1[10]={0,1,1,0,-1,-1};
long long x,y,z,mod=100000007;
P u[1600];
long long j[100][1333];
queue<P> q;
//queue<int> q;
stack<int> s,s1;
//queue<P> q;

deque<int> de;
//'1'==49;
//'A'==65;
//'a'==97;
//unordered_map<int, int > p;
//string r,r1;
char r[310];
//char r1[222][555];
bool as(P a,P b)
{
    if(a.x!=b.x)
        return a.x<b.x;
    return a.z<b.z;
}

int f(int a)
{
    int t;
    for(t=1;a<10;a/=10,t++);
    return t*a;
}

int main()
{
    scanf("%d %d %d",&a,&b,&c);
    printf("%d",(a-b)%c);
}
//1 1 2 3 5 8 13 21 34


Measured memory_bytes: 9216