akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

int main()
{
    int a, b;
    cin >> a >> b;
    LL s = 0;
    int p = 100000, q = 200000, r = 300000;
    if(a == 1 && b == 1){
        cout << r + r + 400000 <<"\n";
        return 0;
    }
    if(a == 1){
        s += r;
    }
    if(a == 2){
        s += q;
    }
    if(a == 3){
        s += p;
    }
    if(b == 1){
        s += r;
    }
    if(b == 2){
        s += q;
    }
    if(b == 3){
        s += p;
    }

    cout << s << "\n";
}


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

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;

ll ragetree[200005 * 4];
int n;

void ragetreeupd(int idx, int l, int r, int i, ll v) {
  if(l == r) {
    ragetree[idx] = v;
  }
  else {
    int m = (l+r)/2;
    if(i <= m) ragetreeupd(2*idx, l, m, i, v);
    else ragetreeupd(2*idx+1, m+1, r, i, v);
    ragetree[idx] = max(ragetree[2*idx], ragetree[2*idx+1]);
  }
}
void ragetreeupd(int idx, ll val) {
  ragetreeupd(1, 0, n-1, idx, val);
}
ll ragetreequery(int idx, int l, int r, int lhs, int rhs) {
  if(l >= lhs && r <= rhs) return ragetree[idx];
  ll ret = 0;
  int m = (l+r)/2;
  if(m >= lhs) ret = max(ret, ragetreequery(2*idx, l, m, lhs, rhs));
  if(m+1 <= rhs) ret = max(ret, ragetreequery(2*idx+1, m+1, r, lhs, rhs));
  return ret;
}
ll ragetreequery(int lhs, int rhs) {
  if(lhs > rhs) return 0;
  return ragetreequery(1, 0, n-1, lhs, rhs);
}

int h[200005];
int a[200005];

void solve() {
  cin >> n;
  for(int i = 0; i < n; i++) cin >> h[i];
  for(int i = 0; i < n; i++) cin >> a[i];
  for(int i = 0; i < n; i++) {
    h[i]--;
    ragetreeupd(h[i], ragetreequery(0, h[i]-1) + a[i]);
  }
  cout << ragetreequery(0, n-1) << endl;
}

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


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

int main(){
  using psi=pair<string,int>;
  int N;
  cin >> N;
  vector<pair<psi,int>> R(N);
  for(int i=0;i<N;i++){
    string s;
    int p;
    cin >> s >> p;
    R.at(i)=make_pair(make_pair(s,-p),i);
  }
  sort(R.begin(),R.end());
  for(int i=0;i<N;i++){
    cout << R.at(i).second+1 << endl;
  }
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int i, j, max, sum, N, A[2][100] = {{0}};
    scanf("%d", &N);
    for(i=0;i<N;i++)scanf("%d", &(A[0][i]));
    for(i=0;i<N;i++)scanf("%d", &(A[1][i]));
    max = 0;
    for(i=0;i<N;i++){
        sum = 0;
        for(j=0;j<N;j++){
            if(j<=i)sum+=A[0][j];
            if(i<=j)sum+=A[1][j];
        }
        if(sum > max)max = sum;
    }
    printf("%d\n", max);
    return 0;
}


Measured memory_bytes: 128
/*
        _            _                  _            _       _     _         _   _          _          _             _        
       / /\         / /\               / /\         / /\    / /\  /\ \      /\_\/\_\ _     /\ \       /\ \     _    /\ \      
      / /  \       / /  \             / /  \       / / /   / / /  \ \ \    / / / / //\_\   \ \ \     /  \ \   /\_\ /  \ \     
     / / /\ \__   / / /\ \           / / /\ \__   / /_/   / / /   /\ \_\  /\ \/ \ \/ / /   /\ \_\   / /\ \ \_/ / // /\ \_\    
    / / /\ \___\ / / /\ \ \         / / /\ \___\ / /\ \__/ / /   / /\/_/ /  \____\__/ /   / /\/_/  / / /\ \___/ // / /\/_/    
    \ \ \ \/___// / /  \ \ \        \ \ \ \/___// /\ \___\/ /   / / /   / /\/________/   / / /    / / /  \/____// / / ______  
     \ \ \     / / /___/ /\ \        \ \ \     / / /\/___/ /   / / /   / / /\/_// / /   / / /    / / /    / / // / / /\_____\ 
 _    \ \ \   / / /_____/ /\ \   _    \ \ \   / / /   / / /   / / /   / / /    / / /   / / /    / / /    / / // / /  \/____ / 
/_/\__/ / /  / /_________/\ \ \ /_/\__/ / /  / / /   / / /___/ / /__ / / /    / / /___/ / /__  / / /    / / // / /_____/ / /  
\ \/___/ /  / / /_       __\ \_\\ \/___/ /  / / /   / / //\__\/_/___\\/_/    / / //\__\/_/___\/ / /    / / // / /______\/ /   
 \_____\/   \_\___\     /____/_/ \_____\/   \/_/    \/_/ \/_________/        \/_/ \/_________/\/_/     \/_/ \/___________/    
                                                                                                                              
*/
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for(int i = 0;i < (n);++i)

#define endl '\n'
#define pb emplace_back
#define mkp make_pair
#define p_q priority_queue
#define INF 2000000000
#define PI 3.1415926

const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};
const int dx_8[]={1,1,0,-1,-1,-1,0,1}, dy_8[]={0,-1,-1,-1,0,1,1,1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long

template <typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template <typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template <typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}

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

  string s; cin >> s;
  int cnt[3] = {0};
  REP(i, s.size()) cnt[(int)(s[i]-'a')]++;

  if(abs(cnt[0]-cnt[1])<=1 and abs(cnt[1]-cnt[2])<=1 and abs(cnt[2]-cnt[0])<=1) cout << "YES" << endl;
  else cout << "NO" << endl;
  
  return 0;
}

Measured memory_bytes: 512
//IIT Kanpur FacelessMen India
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define REP(i,a) for(int i=0;i<a;++i)
#define REPP(i,a,b) for(int i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define foreach( gg,itit )  for( typeof(gg.begin()) itit=gg.begin();itit!=gg.end();itit++ )
#define mp make_pair
#define pb push_back
#define all(s) s.begin(),s.end()
#define present(c,x) ((c).find(x) != (c).end())
const double EPS = 1e-8;
const int mod = 1e9+7;
const int N = 1e6+10;
const ll INF = 1e18;

//#define DEBUG
ll power(ll x,ll y){
  ll t=1;
  while(y>0){
    if(y%2) y-=1,t=t*x%mod;
    else y/=2,x=x*x%mod;
  }
  return t;
}
#ifdef DEBUG
#define dprintf(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#else
#define dprintf(fmt,...)
#endif

int main(){
  // freopen("product.in","r",stdin);
  // freopen("product.out","w",stdout);
  ll a,b,c; scanf("%lld%lld%lld",&a,&b,&c);
  int tm=0;
  while(tm<N&&a%2==0&&b%2==0&&c%2==0){
    tm++;
    ll s=(a+b+c)/2;
    a=s-a/2; b=s-b/2; c=s-c/2;
  }
  if(tm==N) tm=-1;
  printf("%d\n",tm);  
  return 0;
}


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

int main()
{
    int n,mi,ma,k,i;
    while(scanf("%d",&n)!=EOF)
    {
        scanf("%d",&k);
        mi=k;
        ma=k;
        for (i=0;i<n-1;i++)
        {
            scanf("%d",&k);
            if (k<mi) mi=k;
            if (k>ma) ma=k;
        }
        printf("%d\n",ma-mi);
    }
    return 0;
}


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

int main(){
   ll x,ans;
   cin >> x;
   ans = 0;

   ans += (x/500) * 1000;
   x -= (x/500) * 500;

   ans += (x/5) * 5;
   
   cout << ans;

   return 0;  
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  int H, W, K;
  
  std::cin >> H >> W >> K;

  if (W == 1) {
    std::cout << 1 << std::endl;
    
    return 0;
  }

  std::vector<std::vector<int>> a(W - 1), b(W);

  for (int i = 0; i < (1 << (W - 1)); i ++) {
    if (i & (i << 1)) {
      ;
    }
    else {
      for (int j = 0; j < W - 1; j ++)
        if (i & (1 << j))
          a[j].push_back(i);

      for (int j = 0; j < W; j ++) {
        if (j == 0) {
          if ((i & 1) == 0)
            b[j].push_back(i);
        }
        else {
          if ((i & (3 << (j - 1))) == 0)
            b[j].push_back(i);
        }
      }
    }
  }

  long long dp[2][8], *curr = dp[0], *next = dp[1];

  memset(curr, 0, sizeof(dp[0]));

  curr[0] = 1;

  for (int i = 0; i < H; i ++) {
    memset(next, 0, sizeof(dp[0]));

    for (int j = 0; j < W; j ++)
      if (j == 0) {
        (next[j    ] += b[j].size() * curr[j] % MOD) %= MOD;
        (next[j + 1] += a[j].size() * curr[j] % MOD) %= MOD;
      }
      else if (j == W - 1) {
        (next[j - 1] += a[j - 1].size() * curr[j] % MOD) %= MOD;
        (next[j    ] += b[j    ].size() * curr[j] % MOD) %= MOD;
      }
      else {
        assert(j - 1 >= 0);
        assert(j + 1 < W);
    
        (next[j - 1] += a[j - 1].size() * curr[j] % MOD) %= MOD;
        (next[j    ] += b[j    ].size() * curr[j] % MOD) %= MOD;
        (next[j + 1] += a[j    ].size() * curr[j] % MOD) %= MOD;
      }

    std::swap(curr, next);
  }

  std::cout << curr[K - 1] << std::endl;
  
  return 0;
}


Measured memory_bytes: 256
using System;
class Pg{
  static void Main(string[] args){
    string[] sz = Console.ReadLine().Split(' ');
    int x = int.Parse(sz[0]);
    int y = int.Parse(sz[1]);
    string kk = (x * y) % 2 == 0 ? "Even" : "Odd";
    Console.WriteLine(kk);
  }
}


Measured memory_bytes: 11092
N = int(input())
A = [int(a) for a in input().split()]

check = []

if N % 2 == 0:
    for i in range(1, N, 2):
        check += [i, i]
else:
    check += [0]

    for i in range(2, N, 2):
        check += [i, i]

if check == sorted(A):
    print((2 ** (N // 2)) % (10 ** 9 + 7))
else:
    print(0)

Measured memory_bytes: 13880
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ; i ++)
#define loop(i,a,b) for(int i = a ; i < b ; i ++)

int main(void){
  vector<long long> a(3);
  rep(i,3)cin>>a[i];
  long long ret = 1e18;
  sort(a.begin(),a.end());
  rep(i,3)if(a[i]%2==0)ret=0;
  ret = min(a[0]*a[1],ret);
  ret = min(a[0]*a[2],ret);
  ret = min(a[2]*a[1],ret);
  cout<<ret<<endl;

}

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

using namespace std;

int main(void){

  int num,target,judge,size=0,count=0;
  vector<vector<int>> vec(2);
  while(true){

    cin>>num>>target;
    if(num+target==0) break;
    vec.at(0).push_back(num);
    vec.at(1).push_back(target);
    size++;
  }
  for(int a=0;a<size;a++){
    num=vec.at(0).at(a);
    for(int i=1;i<=num-2;i++){
      for(int j=i+1;j<=num-1;j++){
//        if(i==j) continue;
        judge=vec.at(1).at(a)-i-j;
        if(judge==i||judge==j) continue;
        else if(j<=judge&&num>=judge){
          count++;
  //        cout<<i<<"  "<<j<<endl;
      }
      }
    }
    cout<<count<<endl;
    count=0;
  }
  return 0;


}



Measured memory_bytes: 3144
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define INF INT_MAX
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a * b / gcd(a, b);};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
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;};

ll n;
string s[100010];
signed main() {
	cin >> n;
	rep(i, n) {
		cin >> s[i];
		sort(s[i].begin(), s[i].end());
	}
	sort(s, s + n);
	ll ans = 0;
	rep(i, n) {
		ans += upper_bound(s, s + n, s[i]) - lower_bound(s, s + n, s[i]) - 1;
	}
	cout << ans / 2 << endl;
	return 0;
}


Measured memory_bytes: 7296
#include<bits/stdc++.h>
using namespace std;
int n, k, pos, len;
string s, t;
int main()
{
	cin >> n >> k >> s;
	if (k > 16 || n <= (1 << (k - 1)))
	{
		cout << string(n, *min_element(s.begin(), s.end())) << endl;
		return 0;
	}
	t = s;
	s = s + string(s.rbegin(), s.rend());
	for (int i = 0; i < n; i++)
		t = min(t, s.substr(i, n));
	while (pos < n && t[pos] == t[0])pos++;
	len = min(n, pos << (k - 1));
	cout << string(len, t[0]) << t.substr(pos, n - len) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>

using namespace std;

void solve() {
    int a,b;
    cin >> a;
    cin >> b;

    int count = 1;
    while(true){
        if(count*a-count+1 >= b){
            break;
        }
        count++;
    }

    if(b == 1) cout << 0 << endl;
    else cout << count << endl;

}

int main() {
    solve();
    return 0;
}

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

#pragma GCC optimize("O3")
using namespace std;
#define ll long long
#define ull unsigned long long
#define rep(i,n,N) for(int i=n;i<=N;++i)
#define rap(i,n,N) for(int i=n;i>=N;--i)
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define ff fi.fi
#define fs fi.se
#define sf se.fi
#define ss se.se
#define lc (id<<1)
#define rc ((id<<1)|1)
#define db(x) cout << ">>>>>> " << #x << " -> " << x << endl;
#define all(x) x.begin(),x.end()
#define pii pair<int,int> 
#define pll pair<ll,ll>
#define piii pair<int,pii>
#define piiii pair<pii,pii>
#define psi pair<string,int>
#define endl "\n"
const int MAX = 5e3+5;
const ll MAX2 = 11;
const ll MOD = 1000000007;
const ll INF = 2e18;
const int dr[]={1,0,-1,0,1,1,-1,-1,0};
const int dc[]={0,1,0,-1,1,-1,1,-1,0};
const double pi = acos(-1);
const double EPS = 1e-9;
const int block = 450;

ll n,dp[MAX][MAX],ans;
pll x[MAX];

inline bool cmp(pll a,pll b){
	if(a.fi+a.se==b.fi+b.se)return a.fi>b.fi;
	return a.fi+a.se<b.fi+b.se;
}

int main(){
//	cout<<fixed<<setprecision(10);
//    freopen("input.txt", "r", stdin);
//	freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin>>n;
    rep(i,1,n)cin>>x[i].fi>>x[i].se;
    sort(x+1,x+1+n,cmp);
    rep(i,0,n)rep(j,1,n)dp[i][j] = MOD<<4;
    rep(i,1,n){
    	rep(j,1,n){
    		if(dp[i-1][j-1]<=x[i].fi)dp[i][j] = min(dp[i-1][j],dp[i-1][j-1]+x[i].se);
    		else dp[i][j] = dp[i-1][j];
		}
	}
	rep(j,1,n)rep(i,1,n)if(dp[i][j]!=MOD<<4)ans = j;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 195968
n=int(input())
a=list(map(int,input().split()))
o=0;f=0
x='Yes'
for i in a:
  if i%4==0:
    f+=1
  elif i%2==1:
    o+=1
if o>f:
  if o!=f+1 or o+f!=n:
    x='No'
print(x)

Measured memory_bytes: 14252
n,x=map(int,input().split())
a=list(map(int,input().split()))
ans=0
if a[0]>x:
  ans=a[0]-x
  a[0]=x
for i in range(1,n):
  if a[i-1]+a[i]>x:
    ans+=a[i-1]+a[i]-x
    a[i]=x-a[i-1]
print(ans)

Measured memory_bytes: 14252
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
#define MOD 1000000007
ll dp[300][300];
int n;
char c[300];
int main()
{
	scanf("%d",&n);
	for(int i=0;i<n;i++)cin >> c[i];
	dp[0][0]=1ll;
	for(int i=0;i<n;i++)
	{
		if(c[i]=='-')for(int j=0;j<=n;j++)dp[i+1][j]=dp[i][j];
		if(c[i]=='D')
		{
			for(int j=0;j<=i;j++)
			{
				if(j>0)dp[i+1][j-1] = (dp[i+1][j-1]+(((dp[i][j]*j)%MOD)*j%MOD))%MOD;
				dp[i+1][j] = (dp[i+1][j]+((dp[i][j]*j)%MOD))%MOD;
			}
		}
		if(c[i]=='U')
		{
			for(int j=0;j<=i;j++)
			{
				dp[i+1][j+1] = (dp[i+1][j+1]+dp[i][j])%MOD;
				dp[i+1][j] = (dp[i+1][j]+((dp[i][j]*j)%MOD))%MOD;
			}
		}
	}
	printf("%lld\n",dp[n][0]);
	return 0;
}

Measured memory_bytes: 1676
#include <iostream>
#include <algorithm>

using namespace std;

int main() {
    int n, m, x, y;
    int a;

    cin >> n >> m >> x >> y;

    int max = -1000;
    int min = 1000;

    for (int i = 0; i < n; i++) {
        cin >> a;
        max = std::max(max, a);
    }

    for (int i = 0; i < m; i++) {
        cin >> a;
        min = std::min(min, a);
    }

    bool flag = false;

    if (max >= min) {
        flag = true;
    }
    else if (max >= y) {
        flag = true;
    }
    else if (min <= x) {
        flag = true;
    }

    if (flag) {
        cout << "War" << endl;
    }
    else {
        cout << "No War" << endl;
    }
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
    int a,b,c;
    int i = 101, count = 0;

    scanf("%d%d%d" ,&a,&b,&c);

    while(1){
        i--;
        if(a % i == 0 && b % i == 0){
            count++;
        }
        if(count == c){
            break;
        }
    }
    printf("%d\n" ,i);

    return 0;  
}




Measured memory_bytes: 128
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
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;
}
int main(){
    int n,d;cin>>n>>d;
    int y=ceil((double)n/(2*d+1));
    cout<<y<<endl;
}


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

int main() {
	int n; cin >> n;
	int c0 = 0,c1 = 0,c2 = 0,c3 = 0;
	for(int i=0;i<n;i++)
	{
	    string s; cin >> s;
	    if(s == "AC") c0++;
	    else if(s == "WA") c1++;
	    else if(s == "TLE") c2++;
	    else if(s == "RE") c3++;
	}
	cout << "AC x " << c0 << "\n";
	cout << "WA x " << c1 << "\n";
	cout << "TLE x " << c2 << "\n";
	cout << "RE x " << c3 << "\n";
	return 0;
}

Measured memory_bytes: 3620
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <set>
#include <assert.h>
#include <sstream>
#include <string>
//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#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,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater <>())
#define rn return
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
using namespace std;
using ll = long long;
typedef std::pair<ll,ll> P;
//#include <boost/multiprecision/cpp_int.hpp>
//using bint = boost::multiprecision::cpp_int;



int main(){
    int n;
    cin >> n;
    vector<int> x(n);
    rep(i,n) cin >> x[i];
    int ans = 1e8;
    FOR(loc,1,101){
        int temp = 0;
        rep(i,n){
            temp += (loc - x[i])*(loc-x[i]);
        }
        ans = min(ans,temp);
    }
    cout << ans;
}



Measured memory_bytes: 256
N = int(input())
S = input()
ans = ''
count = 0
for i in range(N):
    if S[i] == '(':
        count += 1
    else:
        count -= 1
    if count < 0:
        ans = '(' + ans
        count += 1
    ans += S[i]
if count > 0:
    ans += ')' * count
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <unordered_map>


int main(int argc, char const *argv[])
{
    int N;
    std::cin >> N;
    std::string S;
    std::cin >> S;

    std::unordered_map<char, std::vector<int>> dict;
    for (int i = 0; i < N; i++) {
        dict[S[i]].push_back(i);
    }
    int count = 0;

    for (int i = 1000; i < 2000; i++) {
        std::string new_pin = std::to_string(i);
        
        if (dict.count(new_pin[1]) > 0) {
            int j = dict[new_pin[1]][0];
            std::vector<int>::iterator it;
            
            if (dict.count(new_pin[2]) > 0) {
                std::vector<int> start2 = dict[new_pin[2]];

                it = std::upper_bound(start2.begin(), start2.end(), j);
                if (it == start2.end()) continue;
                j = *it;
            } else {
                continue;
            }

            if (dict.count(new_pin[3]) > 0) {
                std::vector<int> start3 = dict[new_pin[3]];

                it = std::upper_bound(start3.begin(), start3.end(), j);
                if (it == start3.end()) continue;
                count++;
            }
        }
    }
    std::cout << count << std::endl;
    return 0;
}


Measured memory_bytes: 640
import java.util.*;

class Main {
   public static void main(String[] args)
   {
      Scanner scan   = new Scanner(System.in);
      int     n      = scan.nextInt();
      String  yellow = "Y";

      String[] color = new String[n];
      for(int i = 0; i < n; i++){
          color[i] = scan.next();
          if(color[i].contains("Y")){
             System.out.println("Four");
             return;
             }
          }
      System.out.println("Three");
   }
}


Measured memory_bytes: 21844
#include <stdio.h>

int main() {
	char str[1024];
	int i;

	fgets(str, 1024, stdin);
	i = 0;
	while(str[i] != '\n') {
		if(str[i] == ' ')
			putchar(' ');
		else if(str[i] == '.')
			putchar('.');
		else
			putchar(str[i] + 'A' - 'a');

		i++;
	}

	putchar('\n');

	return 0;
}

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

#define pb         push_back

typedef long long ll;
const ll INF = 1000000000ll;
const ll MOD = 1000000007ll;
const double EPS = 1e-8;

int main(void) {
	//ios_base::sync_with_stdio(false);
	//cin.tie(0);
	
	int n;
	vector<int> a;
	cin >> n;
	for(int i=0; i<n; i++){
		int t;
		cin >> t;
		t--;
		a.push_back(t);
	}

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

	cout << ans / 2 << endl;

	

	return 0;
}


Measured memory_bytes: 892
import math
import copy

n = int(input())
h =list(map(int, input().split()))

cnt = 0
cnt_max = 0
for i in range(len(h)-1):
  # print(h[i])
  if h[i] - h[i+1] >= 0:
    cnt += 1
  else:
    cnt_max = copy.copy(max(cnt, cnt_max))
    cnt = 0
cnt_max = copy.copy(max(cnt, cnt_max))
print(cnt_max)

Measured memory_bytes: 14764
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
//グリッド：（典型）dp,dfs,bfs,最短経路,その他
ll cnt[26];
int main(){
    int h,w;cin>>h>>w;
    rep(i,h){
        rep(j,w){
            char c;cin>>c;
            cnt[c-'a']++;
        }
    }
    vl req;
    rep(i,(h+1)/2){
        rep(j,(w+1)/2){
            int i2=h-1-i,j2=w-1-j;
            ll tmp=(i2==i?1:2)*(j2==j?1:2);
            req.push_back(tmp);
        }
    }
    sort(req.rbegin(),req.rend());
    rep(i,(int)req.size()){
        bool ok=false;
        rep(j,26){
            if(cnt[j]>=req[i]){
                cnt[j]-=req[i];
                ok=true;
                break;
            }
        }
        if(!ok){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
A = list(map(int, input().split()))
q = int(input())
m = list(map(int, input().split()))
combi = set()

for i in range(1<<n):
    total = 0
    for j in range(n):
        if (i >> j) & 1:
            total += A[j]
    combi.add(total)

for num in m:
    if num in combi:
        print('yes')
    else:
        print('no')



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

int N;
vector<int> arr;

int main() {
    scanf("%d", &N);
    arr.resize(N);
    for(int i = 0; i < N; i++) {
        scanf("%d", &arr[i]);
    }
    sort(arr.begin(), arr.end());

    int cnt = 0;
    for(int i = 0; i < N; i++) {
        if(arr[i] == arr[0]) cnt++;
        if(arr[i] != arr[0] && arr[i] != arr[0] + 1) {
            printf("No");
            return 0;
        }
    }

    if(cnt == N) {
        if(arr[0] == N - 1 || arr[0] <= (N / 2)) printf("Yes");
        else printf("No");
    }
    else {
        if(cnt <= arr[0] && arr[0] - cnt <= ((N - cnt) / 2) - 1) printf("Yes");
        else printf("No");
    }
}


Measured memory_bytes: 640
#include<iostream>
#include<stdio.h>
#include<cmath> 
#include<stack> 
#include<algorithm> 
#include <string.h>
using namespace std;
typedef long long  ll;
int main() {
	long long a,b,c,d;
	cin>>a>>b>>c>>d;
	if((a>=0&&c>=0)||(a<=0&&b>=0&&c>=0)||(c<=0&&d>=0&&a>=0)){
		printf("%lld\n",b*d);
	}
	else if((b<=0&&d<=0)||(a<=0&&b>=0&&d<=0)||(c<=0&&d>=0&&b<=0)){
		printf("%lld\n",a*c);
	}
	else if(a>=0&&d<=0){
		printf("%lld\n",a*d);
	}
	else if(c>=0&&b<=0){
		printf("%lld\n",b*c);
	}
	else{
		if(a*c>b*d) printf("%lld\n",a*c);
		else printf("%lld\n",b*d);
	}
	return 0;
}

Measured memory_bytes: 3760
/*
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <string>
#include <cmath>
#include <numeric>

using namespace std;

int main()
{
    int n, d;
    cin >> n >> d;

    cout << (n + 2 * d) / (2 * d + 1) << endl;
    return 0;
}

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

using namespace std;
typedef long long ll;
const long double pi=3.14159265358979323846;
#define x  first
#define y  second
#define deb(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
ll isPar(string s)
{
    ll n=s.size();
    for(int i=0;i<n/2;i++)
    {
        if(s[i]!=s[n-i-1])
        {
            return 0;
        }
    }
    return 1;
}

ll isP(ll x)
{
    for(int i=2;i<=sqrt(x);i++)
    {
        if(x%i==0)return 0;
    }
    return 1;
}

int main()
{
    cin.tie(0);
    cin.sync_with_stdio(0);
    //freopen("op.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        cout<<n+(n*n)+(n*n*n);
    }
    return 0;
}


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



int main(){
    int h, w;   cin >> h >> w;
    vector<vector<char>> g(h, vector<char>(w));
    int white=0;
    for(int i=0; i<h; i++)
        for(int j=0; j<w; j++){
            cin >> g.at(i).at(j);
            if(g.at(i).at(j)=='.') white+=1;
        }
    
    queue<pair<int, int>> que;
    vector<vector<int>> cost(h, vector<int>(w, -1));
    que.push({0, 0});
    cost[0][0] = 0;
    int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};

    while(!que.empty()){
        int x = que.front().first, y = que.front().second;
        if(x+1==h && y+1==w) break;
        que.pop();
        for(int i=0; i<4; i++){
            int nx = x+dx[i], ny = y+dy[i];
            if(nx<0 || ny<0 || h<=nx || w<=ny || g[nx][ny]=='#') continue;
            if(cost[nx][ny]!=-1) continue;
            cost[nx][ny] = cost[x][y] + 1;
            que.push({nx, ny});
        }
    }
    ll ans=0;
    if(cost[h-1][w-1]<0) ans = -1;
    else ans = white-(cost[h-1][w-1]+1);
    cout << ans << endl;
    
}




Measured memory_bytes: 256
from sys import stdin

def main():
    n = int(stdin.readline().rstrip())
    xs = [int(stdin.readline().rstrip()) for _ in range(n)]

    max_1, max_2 = sorted(xs)[-1], sorted(xs)[-2]

    for i in range(n):
        if xs[i] == max_1:
            print(max_2)
        else:
            print(max_1)
            
if __name__ == '__main__':
    main()

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

int main(){
  int n,v,si,ni;
  cin>>n;
  vector<int> dist(100001,-1);
  queue<int> q;
  dist[0]=0;
  q.push(0);
  while(!q.empty()){
    v=q.front();
    q.pop();
    if(v+1<=100000 && dist[v+1]==-1){
      dist[v+1]=dist[v]+1;
      q.push(v+1);
    }
    si=6;
    while(v+si<=100000){
      if(dist[v+si]==-1){
        dist[v+si]=dist[v]+1;
        q.push(v+si);
      }
      si*=6;
    }
    ni=9;
    while(v+ni<=100000){
      if(dist[v+ni]==-1){
        dist[v+ni]=dist[v]+1;
        q.push(v+ni);
      }
      ni*=9;
    }
  }
  cout<<dist[n]<<endl;
}


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

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
const int MOD = 1000000007;

const int CASES = 3;

void solve(){
    int N, M, L; cin >> N >> M >> L;

    // initialization of Floyd-Warshall
    vector<vector<ll> > dp(N, vector<ll>(N, INF64));
    for (int i = 0; i < N; ++i) dp[i][i] = 0;

    // input
    for (int e = 0; e < M; ++e) {
        int a, b, c; cin >> a >> b >> c;
        --a; --b;
        dp[a][b] = c;
        dp[b][a] = c;
    }

    // Floyd-Warshall
    for (int k = 0; k < N; ++k)
        for (int i = 0; i < N; ++i)
            for (int j = 0; j < N; ++j)
                dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);

    for (int i = 0; i < N; ++i){
        for (int j = 0; j < N; ++j){
            if(dp[i][j] <= L){
                dp[i][j] = 1;
            }
            else{
                dp[i][j] = INF64;
            }
        }
    }

    // Floyd-Warshall
    for (int k = 0; k < N; ++k)
        for (int i = 0; i < N; ++i)
            for (int j = 0; j < N; ++j)
                dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);


    int Q; cin >> Q;
    for(int i = 0; i < Q; ++i){
        int s, t; cin >> s >> t; --s; --t;
        if(dp[s][t] < INF64){
            cout << dp[s][t] -1 << endl;
        }
        else{
            cout << -1 << endl;
        }
    }

    // output
    /*
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < N; ++j) {
            if (dp[i][j] < INF64) cout << dp[i][j];
            else cout << "INF";
            if (j != N-1) cout << " ";
        }
        cout << endl;
    }
     */
}

int main() {
    #ifdef MYLOCAL
    vector<string> filenames {"input1.txt", "input2.txt", "input3.txt", "input4.txt"};
    cout << "------------\n";
    for(int i = 0; i < CASES; ++i){
        ifstream in(filenames[i]);
        cin.rdbuf(in.rdbuf());
        solve();
        cout << "------------\n";
    }
    #else

    solve();

    #endif
    return 0;
}



Measured memory_bytes: 1280
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

int main() {
	int N, K;
	cin >> N >> K;
	vector<ll> A(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	for (int i = 0; i < N - K; i++) {
		if (A[i] < A[i + K]) {
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 4796
#include "bits/stdc++.h"

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;++i)
#define REP(i,s,n) for(int i=(s);i<(n);++i)
#define repr(i,n) for(int i=n-1;i>=0;--i)
#define REPR(i,s,n) for(int i=(s);i>=(n);--(i))
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define DOUBLE fixed << setprecision(10)
#define fi first
#define se second
const double pi = acos(-1.0);
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef deque<ll> dll;
typedef pair<ll, ll> P;
typedef vector<P> vP;
const ll mod = 1e9 + 7;
ll dx[4] = { 1,0,-1,0 };
ll dy[4] = { 0,1,0,-1 };
template <typename T>
bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
};
template <typename T>
bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
};
void Pvll(vll v) {
	cout << "------------------------------------------------\n";
	rep(i, v.size()) cout << v[i] << " ";
	cout << endl;
	cout << "------------------------------------------------\n";
}
void Pvvll(vvll v) {
	cout << "------------------------------------------------\n";
	rep(i, v.size()) {
		rep(j, v[i].size()) {
			cout << v[i][j] << " ";
		}
		cout << endl;
	}
	cout << "------------------------------------------------\n";
}

void Ps(string s) {
	cout << "------------------------------------------------\n";
	rep(i, s.size()) cout << s[i] << " ";
	cout << endl;
	cout << "------------------------------------------------\n";
}

void Pvs(vs s) {
	cout << "------------------------------------------------\n";
	rep(i, s.size()) {
		rep(j, s[i].size()) {
			cout << s[i][j] << " ";
		}
		cout << endl;
	}
	cout << "------------------------------------------------\n";
}

void Yes(bool x) {
	if (x) cout << "Yes\n";
	else cout << "No\n";
}

void YES(bool x) {
	if (x) cout << "YES\n";
	else cout << "NO\n";
}

void yes(bool x) {
	if (x) cout << "yes\n";
	else cout << "no\n";
}

void Yay(bool x) {
	if (x) cout << "Yay!\n";
	else cout << ":(\n";
}


ll  n, m, r, l, k, h, ans = 0, ret = M;
bool flag = false, flag2 = false, flag3 = false;
string s,t;

void INIT() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << DOUBLE;
}

vector<bool> IsPrime;

void sieve(ll max) {
	if (max + 1 > IsPrime.size()) {     // resizeで要素数が減らないように
		IsPrime.resize(max + 1, true); // IsPrimeに必要な要素数を確保
	}
	IsPrime[0] = false; // 0は素数ではない
	IsPrime[1] = false; // 1は素数ではない

	for (ll i = 2; i*i <= max; ++i) // 0からsqrt(max)まで調べる
		if (IsPrime[i]) // iが素数ならば
			for (ll j = 2; i*j <= max; ++j) // (max以下の)iの倍数は
				IsPrime[i*j] = false;      // 素数ではない
}


int main() {
	INIT();
	ll a, b, c;
	cin >> a >> b >> c;
	cout << max(c - (a-b),(ll)0) << endl;
}

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

int main() {
  int N, A;
  string op;
  cin >> N >> A;

  if (A >= 500) {
    cout << "Yes" << endl;
  } else if ((N % 500) <= A) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  } 
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    String s=sc.next();//味玉・チャーシュー・ねぎ
    int count=0;
    for (int i=0;i<3;i++) {
      if (s.charAt(i)=='o') {
        count++;
      }
    }

    System.out.println(700+count*100);
  }
}


Measured memory_bytes: 21972
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
#include <iomanip>
#define M_PI acos(-1)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1000000007;
const int MAX_V = 201;
int now = 0;

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
struct edge {
	int t;
	edge(int _t) : t(_t) {}
};
bool use[100010];


vector<edge> te[100010];
vector<edge> fe[100010];
int t[64];
int d[100100];
ll rec(int num) {
	if (num == 0) return 0;
	return rec(num - 1) + num;
}

void Solve() {

	int a, b;
	cin >> a >> b;
	if (b % a == 0) {
		cout << (a + b) << endl;
	}else
		cout << (b - a) << endl;
}


int main() {
	Solve();
	return 0;
}



Measured memory_bytes: 6016
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define PB push_back
#define SP << " " <<

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VLL;

__attribute__((constructor))
void initial(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed <<setprecision(15);
}


int main(void){
	int N;
    VI A;
    cin >> N;
    string ans = "APPROVED";
    rep(i,N){
        int a;
        cin >> a;
        A.PB(a);
        if(a%2 == 0){
            if(a%3 == 0 || a%5 == 0){
                ans = "APPROVED";
            }else{
                ans = "DENIED";
                break;
            }
        }
    }
    cout << ans << endl;


    return 0;
}


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

using namespace std;

int serveTime[5];
int endTime = 0;

bool cmp(int a, int b)
{
	if (a % 10 == 0 && b % 10 == 0) return a < b;
	if (a % 10 == 0) return true;
	if (b % 10 == 0) return false;
	return a % 10 > b % 10;
}

void addTime(int t)
{
	if (endTime % 10 != 0)
	{
		endTime = ((endTime / 10) + 1) * 10;
	}
	
	endTime += t;
}

int main()
{
	for (int i = 0; i < 5; i++) cin >> serveTime[i];

	sort(serveTime, serveTime + 5, cmp);

	for (int i = 0; i < 5; i++)
	{
		addTime(serveTime[i]);
	}

	cout << endTime;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-9;
const long double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
long double ABS(long double a){return max(a,-a);}
char in[1100000];

int main(){
	scanf("%s",in);
	int l=0;
	for(int i=0;in[i];i++){
		if(in[i]=='x')l++;
	}
	if(l<8)printf("YES\n");else printf("NO\n");
}

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

using namespace std;

int main() {
	string s;
	cin >> s;
	int num_s1, num_s2;
	char s1[3];
	char s2[3];
	
	s1[0] = s[0];
	s1[1] = s[1];
	s1[2] = 0x00;
	
	s2[0] = s[2];
	s2[1] = s[3];
	s2[2] = 0x00;
	
	num_s1 = atoi(s1);
	num_s2 = atoi(s2);
	
	if (num_s1 >= 1 && num_s1 <= 12) {
		if (num_s2 >= 1 && num_s2 <= 12) {
			cout << "AMBIGUOUS";
		} else {
			cout << "MMYY";
		}
	} else {
		if (num_s2 >= 1 && num_s2 <= 12) {
			cout << "YYMM";
		} else {
			cout << "NA";
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<unordered_map>
#include<algorithm>
#include<vector>
#include<string>
#include<string.h>
#include<unordered_set>
#include<set>
#include<map>
#include<queue>
#include<iomanip>
#include<tgmath.h>
#include<stdlib.h>
#include<assert.h>
#include<stdio.h>



#define ll long long


/*
_
_._ _..._ . - ',     _.._(`))
'-. `     ' / -._. - '    ', /
)         \            '.
/ _    _ | \
| a    a    /              |
\   . - .;
'-('' ).-', '       ;
'-;           |      .'
\           \    /
| 7.__  _. - \   \
| |  |  ``/ / `  /
/, _|  |   /, _/   /
/, _ / '`-'
*/
using namespace std;


int main()
{
    int n;
    cin >> n;
    ll sum = 0;
    ll i;
    for (i = 1; i <= n; ++i) {
        if (i % 3 == 0 || i % 5 == 0) {

        }
        else {
            sum += i;
        }
            
           
    }
    cout << sum;
}


Measured memory_bytes: 3592
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<cstdlib>
#include<algorithm>
#include<map>
using namespace std;
int n;
int main() {
	scanf("%d", &n);
	printf("%d\n", n / 3);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = int64_t;
// cout << "\t" << endl;

int main() {
  string s;
  cin >> s;
  if (s.at(2) == s.at(3) && s.at(4) == s.at(5))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256
// warm heart, wagging tail,and a smile just for you!
//                                                                     ███████████   
//                                                                   ███╬╬╬╬╬╬╬╬╬╬███
//                                                                ███╬╬╬╬╬████╬╬╬╬╬╬███
//                                            ███████████       ██╬╬╬╬╬████╬╬████╬╬╬╬╬██
//                                      █████████╬╬╬╬╬████████████╬╬╬╬╬██╬╬╬╬╬╬███╬╬╬╬╬██
//                               ████████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬██╬╬╬╬╬╬╬██
//                             ████╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████████╬╬╬╬╬╬╬╬╬╬╬██
//                           ███╬╬╬█╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬███╬╬╬╬╬╬╬█████
//                         ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬████████╬╬╬╬╬██
//                       ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬╬╬╬╬███
//                     ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬██
//                 ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬████
//     █████████████╬╬╬╬╬╬╬╬██╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬██████
//   ████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬██████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████╬╬╬╬╬╬╬███████████╬╬╬╬╬╬╬╬██╬╬╬██╬╬╬██
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████╬╬╬╬╬╬╬╬╬╬╬█╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬██
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬▓▓▓▓▓▓╬╬╬████╬╬████╬╬╬╬╬╬╬▓▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬███
// ██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██████▓▓▓▓▓▓▓╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██╬╬╬╬█████
// ███╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████████
//   ███╬╬╬╬╬╬╬╬╬╬╬╬╬█████╬╬╬╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬███╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬██
//       ██████████████  ████╬╬╬╬╬╬███████████████████████████╬╬╬╬╬██╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬████
//                         ███████                           █████  ███████████████████  
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
const double EPS = 1e-9;
#define INF (1LL<<60)
#define fs first
#define sc second
#define pb push_back
#define int long long
#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(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<vector<P> > Graph;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

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

  string s;
  cin >> s;

  int ans = 0;
  int cnt = 0;
  REP(i,s.size()){
    if(s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') cnt++;
    else ans = max(ans,cnt), cnt = 0;
  }

  cout << max(ans,cnt) << endl;

  return 0;
}

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

#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set

using namespace std;

const ll MOD = 1000000007;
const ll INF = (1LL << 62);

// A:1
// B:2
// C:4

ll dp[100005][4];

int main() {
  ll N;
  scanf("%lld", &N);
  // fill(dp[0], dp[10004], -9999);

  vector<tuple<ll, ll, ll>> list(N + 1);
  for (ll i = 0; i < N; i++) {
    ll a, b, c;
    scanf("%lld %lld %lld", &a, &b, &c);
    list[i] = make_tuple(a, b, c);
  }

  for (ll i = 0; i < N; i++) {
    ll a = get<0>(list[i]);
    ll b = get<1>(list[i]);
    ll c = get<2>(list[i]);

    for (ll f = 0; f <= 3; f++) {
      if (f != 1) {
        dp[i + 1][1] = max(dp[i + 1][1], dp[i][f] + a);
      }
      if (f != 2) {
        dp[i + 1][2] = max(dp[i + 1][2], dp[i][f] + b);
      }
      if (f != 3) {
        dp[i + 1][3] = max(dp[i + 1][3], dp[i][f] + c);
      }
    }
  }

  ll ans = 0;

  for (ll i = 1; i <= 3; i++) {
    // cout << dp[N][i] << endl;
    ans = max(ans, dp[N][i]);
  }

  cout << ans << endl;
}


Measured memory_bytes: 5760
#include <bits/stdc++.h>
 
#define f(i,a,b) for( ll i = a; i < (ll) b ; i++ ) 
#define af(i,a,b) for( ll i = a; i >= (ll) b ; i--)
#define rep(i,a,b,k) for(ll i = a; i < b ; i+= k )
#define arep(i,a,b,k) for( ll i = a; i >= b ; i-= k)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define sz(a) (ll) a.size()
#define all(a) a.begin(), a.end()
#define sor(a) sort( a.begin(), a.end() )
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL)
#define inter ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ii ;
typedef vector<ll>  vi ;
typedef vector<ii> vii ;
 
const int MAX= 1e6+100;



int main(){
	fastio;
	ll tc,n,a,b,c,x,k,q,l,r;
	cin>>a>>b>>c;
	cout<<c<<" "<<a<<" "<<b<<endl;

  	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

#include<stdlib.h>

#include<string.h>

int main(void)

{

char num_str[1002];

int num;

long sum = 0;

int i; 

char tmp;




    while (1)

  {  

  fgets(num_str, sizeof(num_str), stdin); 

      if (num_str[0] == '0')  break;

     for (i = 0; i < strlen(num_str)-1; i++)

   { 


  tmp = num_str[i];     num = atoi(&tmp);    sum = sum + num; 

  }  

    printf("%ld\n", sum); 

     sum=0; 

  memset(num_str, 1002,0); 

 } 

   return 0;

}

Measured memory_bytes: 532
N,K = map(int,input().split())
d = list(map(int,input().split()))

while(True):
    n = str(N)
    flag = True
    for i in range(len(n)):
        if(int(n[i]) in d):
            flag = False
            break
    if(flag):
        break
    else:
        N += 1
print(N)

Measured memory_bytes: 2940
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    String A[] =new String[N];
    int x=0;int y=0;int z =0; int w=0;
    for(int i=0;i<N;i++){
      A[i]=sc.next();
      if(A[i].equals("AC")){x=x+1;}
      else if(A[i].equals("WA")){y=y+1;}
      else if(A[i].equals("TLE")){z=z+1;}
      else{w=w+1;}}
    System.out.println("AC"+" "+"x"+" "+x);
    System.out.println("WA"+" "+"x"+" "+y);
    System.out.println("TLE"+" "+"x"+" "+z);
    System.out.println("RE"+" "+"x"+" "+w);
  }
}

Measured memory_bytes: 64096