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

int main()
{
	//freopen("1.in","r",stdin);
	int n;double d,x;
	cin>>n>>d>>x;
	double ans=0;
	for(;n;--n)
	{
		ans+=d+(n-0.5)*x;
		d=((2*n+2)*d+5*x)/(2*n);
		x=(2*n+4)*x/(2*n);
	}
	printf("%.9f\n",ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
#define ALL(a)  (a).begin(),(a).end()
const ll INF = 1e18+18;
const ll MAX = 200000;
const ll MOD = 1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;



int main(){
   ll N, M;
   cin>>N>>M;
   vector<vector<ll>> A(N, vector<ll>(M));
   vector<bool> C(M, true);
   rep(i, N){
       rep(j, M){
           cin>>A[i][j];
           A[i][j]--;
       }
   }
    ll Ans=N;
    rep(i, M){
        vector<ll> Num(M, 0);
        rep(j, N){
            rep(k, M){
                if(C[A[j][k]]){
                  Num[A[j][k]]++;
                break;
                }
            }
        }
        ll MaxN=0;
        rep(j, M){
          	//cout<<Num[j]<<" ";
            MaxN=max(MaxN, Num[j]);
        }
        Ans=min(Ans, MaxN);
      	//cout<<Ans;
        rep(j, M){
            if(Num[j]==MaxN){
                C[j]=false;
              	//cout<<" "<<j<<endl;
                break;
            }
        }
    }
    cout<<Ans<<endl;
}



Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using static System.Console;
using static System.Convert;
using static System.Math;
using static Extentions;

class IO
{
    int idx;
    string[] input = In.ReadToEnd().Split(new[] { " ", "\n", "\r" },
        StringSplitOptions.RemoveEmptyEntries);

    T Get<T>(Func<string, T> parser) => parser(input[idx++]);

    public string S => Get(s => s);
    public char C => Get(char.Parse);
    public int I => Get(int.Parse);
    public long L => Get(long.Parse);
    public double F => Get(double.Parse);
    public decimal D => Get(decimal.Parse);
    public BigInteger B => Get(BigInteger.Parse);

    T[] Gets<T>(int n, Func<string, T> parser)
        => input.Skip((idx += n) - n).Take(n).Select(parser).ToArray();

    public string[] Ss(int n) => Gets(n, s => s);
    public char[] Cs(int n) => Gets(n, char.Parse);
    public int[] Is(int n) => Gets(n, int.Parse);
    public long[] Ls(int n) => Gets(n, long.Parse);
    public double[] Fs(int n) => Gets(n, double.Parse);
    public decimal[] Ds(int n) => Gets(n, decimal.Parse);
    public BigInteger[] Bs(int n) => Gets(n, BigInteger.Parse);

    public void Write<T>(params T[] xs) => WriteLine(string.Join(" ", xs));
    public void Write(params object[] xs) => WriteLine(string.Join(" ", xs));
}

#region Library

static class Extentions
{
    public const int Mod = 1000000007;
}

#endregion

static class Program
{
    public static void Main()
    {
        var sw = new StreamWriter(OpenStandardOutput()) { NewLine = "\n" };
#if DEBUG
        sw.AutoFlush = true;
#else
        sw.AutoFlush = false;
#endif
        SetOut(sw);
        Solve(new IO());
        Out.Flush();
    }

    static void Solve(IO io)
    {
        var n = io.I;
        var s1 = io.S;
        var s2 = io.S;

        var f = false;
        var p = new List<bool>();

        for (var i = 0; i < n; i++)
        {
            if (f) { f = false; continue; }
            if (s1[i] == s2[i]) { p.Add(true); f = false; }
            else { p.Add(false); f = true; }
        }

        long ans = p[0] ? 3 : 6;

        for (var i = 1; i < p.Count; i++)
        {
            if ( p[i - 1] && !p[i]) ans *= 2;
            if (!p[i - 1] &&  p[i]) ans *= 1;
            if ( p[i - 1] &&  p[i]) ans *= 2;
            if (!p[i - 1] && !p[i]) ans *= 3;
            ans %= Mod;
        }

        io.Write(ans);
    }
}

Measured memory_bytes: 13396
#include <stdio.h>
int max(int x, int y) { return x > y ? x : y; }
int main() {
	int n, m;
	scanf("%d%d", &n, &m);
	if (n == 1 && m == 1) {
		printf("1\n");
	} else if (n == 1 || m == 1) {
		printf("%d\n", max(n, m) - 2);
	} else {
		printf("%lld\n", (long long)(n - 2) * (m - 2));
	}
	return 0;
}

Measured memory_bytes: 128
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <string>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define ANS(ans) cout<<(ans)<<endl;
typedef vector<int> VI;


//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  for (int i = 0; i < (n); ++i)

int twos(int n) {
	int sum = 0;
	while (true)
	{
		if (n % 2 == 0) {
			sum++;
			n /= 2;
		}
		else {
			break;
		}
	}

	return sum;
	
}



int main() {

	int d, n;
	cin >> d >> n;

	long long ans;

	if (n == 100) {
		n = 101;
	}

	
	ans =(long long) pow(100, d)* n;

	
	ANS(ans);


	


	return 0;
}



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

struct edge{lint to,cost;};
lint V;
vector<edge> G[4000000]; // MAX_V
lint d[4000000]; // MAX_V
void dijkstra(lint S,lint K){
    priority_queue<plint,vector<plint>,greater<plint>> que;
    fill(d,d+V,LINF);
    d[S]=0;
    que.push(plint(0,S));
    while(!que.empty()){
        plint p=que.top();
        que.pop();
        lint v=p.second;
        if(d[v]<p.first) continue;
        rep(i,G[v].size()){
            edge e=G[v][i];
            lint now=d[v];
            if(e.cost==1) now++;
            else now=((now+K-1)/K)*K;
            if(d[e.to]>now){
                d[e.to]=now;
                que.push(plint(d[e.to],e.to));
            }
        }
    }
}

int main(void){
    lint H,W,K;
    cin >> H >> W >> K;
    V=H*W*4;
    lint x1,y1,x2,y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x1--,y1--,x2--,y2--;
    char S[H][W];
    rep(i,H) cin >> S[i];
    rep(i,H) rep(j,W){
        if(S[i][j]=='@') continue;
        int now=(i*W+j)*4;
        rep(k,4) rep(l,4){
            if(k!=l) G[now+k].push_back({now+l,2});
        }
        if(i>0) if(S[i-1][j]!='@') G[now].push_back({now-W*4,1});
        if(i<H-1) if(S[i+1][j]!='@') G[now+2].push_back({now+W*4+2,1});
        if(j>0) if(S[i][j-1]!='@') G[now+1].push_back({now-4+1,1});
        if(j<W-1) if(S[i][j+1]!='@') G[now+3].push_back({now+4+3,1});
    }
    dijkstra((x1*W+y1)*4,K);
    lint ans=LINF;
    rep(i,4) if(d[(x2*W+y2)*4+i]!=LINF) ans=min(ans,(d[(x2*W+y2)*4+i]+K-1)/K);
    if(ans==LINF) cout << -1 << endl;
    else cout << ans << endl;
}

Measured memory_bytes: 440760
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <cmath>
#include <algorithm>
#include <vector>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>func(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p;
}

int main(){
  int N,M;
  cin>>N>>M;
  vector<int>P(M);
  vector<int>Y(M);
  for(int i=0;i<M;i++){
    cin>>P[i]>>Y[i];
    P[i]--;
  }
  vector<vector<int>>s(N);
  for(int i=0;i<M;i++){
    s[P[i]].push_back(Y[i]);
  }
  for(int i=0;i<N;i++){
    sort(s[i].begin(),s[i].end());
  }
  for(int i=0;i<M;i++){
    int v=P[i];
    printf("%06d",v+1);
    int id=lower_bound(s[v].begin(),s[v].end(),Y[i])-s[v].begin();
    printf("%06d\n",id+1);
  }
  return 0;
}

Measured memory_bytes: 9428
import heapq
def Dijkstra(adj, source):
    n = len(adj)-1; dist = [float('inf')]*(n+1)
    PQ = []
    for u, d in adj[0]:
        if dist[u] > d: dist[u] = d; heapq.heappush(PQ, (d, u))
    while PQ:
        d, u = heapq.heappop(PQ)
        if dist[u] != d: continue
        for v, c in adj[u]:
            if dist[v] > d+c: dist[v] = d+c; heapq.heappush(PQ, (d+c, v))
    return dist

range = xrange
k = int(raw_input())
adj = [[] for i in range(k+1)]
for i in range(k+1):
    for j in range(10):
        if i==0 and j==0: continue
        adj[i].append(((i*10+j)%k, j))
print(Dijkstra(adj, 0)[0])

Measured memory_bytes: 97052
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        
        int A = sc.nextInt();
        int B = sc.nextInt();
        int sum = A + B;
        
        System.out.println((sum < 10)? sum : "error");
    }
}


Measured memory_bytes: 21844
# -*- coding: utf-8 -*-
n = int(input())
li = [int(a) for a in input().split()]
ans = 'Yes'

if n > 1:
  for i in range(n-1):
    if li[-(i+2)] <= li[-(i+1)]:
      pass
    elif li[-(i+2)] - 1 <= li[-(i+1)]:
      li[-(i+2)] = li[-(i+2)] - 1
    else:
      ans = 'No'
      break

print(ans)

Measured memory_bytes: 14396
#include<bits/stdc++.h>
using namespace std;
int main() {
  int n,m,i,a,b,c;
  cin>>n>>m;
  vector<int> h(n),f(n);
  for(i=0;i<n;i++) cin>>h.at(i);
  for(i=0;i<m;i++) {
    cin>>a>>b;
    if (h.at(a-1)<=h.at(b-1)) f.at(a-1)=1;
    if (h.at(a-1)>=h.at(b-1)) f.at(b-1)=1;
  }
  for(i=0;i<n;i++) if(f.at(i)==0) c++;
  cout<<c<<endl;
}

Measured memory_bytes: 4052
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define ll long long int
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define all(x) x.begin(),x.end()
#define sz(x) (ll)x.size() 

ll power(ll x,ll y,ll p) 
{ 
    ll res = 1;      
    x = x % p;  
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1; 
        x = (x*x) % p;   
    } 
    return res; 
} 

int main()
{
    ios_base::sync_with_stdio(false);
	ll n,i,j,k,x,y,t,m;

	string s;
	cin >> s;
	if(s[sz(s)-1]=='2' || s[sz(s)-1]=='4' || s[sz(s)-1]=='5' || s[sz(s)-1]=='7' || s[sz(s)-1]=='9')
		cout<<"hon"<<endl;
	if(s[sz(s)-1]=='0' || s[sz(s)-1]=='1' || s[sz(s)-1]=='6' || s[sz(s)-1]=='8' )
		cout<<"pon"<<endl;
	if(s[sz(s)-1]=='3')
		cout<<"bon"<<endl;
}

Measured memory_bytes: 3656
#include<iostream>
#include<string>
#include<algorithm>

int main(){
  std::string str;
  int n;
  std::cin>>str>>n;
  int k,f,count=0, k_prev=0;
  std::string c, front, back;
  while(n--){
    std::cin>>k;
    if(k==2)
      std::cin>>f>>c;
    if(k==1){
      // std::string str2;
      if(str.length()>1)
        ++count;
      // std::cout<<str<<std::endl;
      // std::copy(str.rbegin(), str.rend(), std::back_inserter(str2));
      // str = str2;
      // std::cout<<str<<std::endl;
    }
    else if(k==2 && str.length()==1){
      if(f==1)
        str=c+str;
      else
        str=str+c;
    }
    else if(k==2){
      if((f==1 && !(count%2)) || (f==2 && (count%2)))
        front= c+front;
      else if((f==1 && (count%2)) || (f==2 && !((count%2))))
        back= back+c;
    }
    k_prev = k;
  }
  str = front+str+back;
  if(count%2){
    std::reverse(str.begin(), str.end());
    std::cout<<str<<std::endl;
  }
  else
    std::cout<<str<<std::endl;
}


Measured memory_bytes: 1464
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define sb __builtin_popcount
#define MOD (ll)1000000007
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    string s;
    cin >> s;
    string t(s.size(), 'x');
    cout << t << endl;
}

Measured memory_bytes: 256
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>
#include <iomanip>

using namespace std;

#define FOR(i, a, b) for(int (i)=(a);(i)<(b);(i)++)
#define IFOR(i, a, b) for(int (i)=(a);(i)<=(b);(i)++)
#define RFOR(i, a, b) for(int (i)=(a);(i)>=(b);(i)--)
#define REP(i, n) FOR((i), 0, (n))

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int main() {
    string t;
    cin >> t;
    REP(i, t.size()){
        if(t[i] == '?')
            t[i] = 'D';
    }
    cout << t << endl;


    return 0;
}

Measured memory_bytes: 3372
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














int N; ll A[201010];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N;
	rep(i, 0, N) cin >> A[i];

	ll tot = 0;
	rep(i, 0, N) tot += A[i];

	ll ans = infl;
	ll lft = 0;
	rep(i, 0, N) {
		chmin(ans, abs(tot - lft - lft));
		lft += A[i];
	}
	cout << ans << endl;
}







Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<set>
#include<math.h>
#include<vector>
#include<sstream>
#include<queue>
#include<functional>
#include<bitset>
#include<cstdio>
#include<iomanip>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include <string.h>

using ll = long long;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, x) for(int i=1;i<=(int)(x);i++)
#define rrep(i, x) for(int i=((int)(x)-1);i>=0;i--)
#define rreps(i, x) for(int i=(int)(x);i>0;i--)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define vpi vector<pair<int,int>>
#define mod 1000000007
#define put2darr(arr, row, col) rep(i, row) { rep(j, col) { printf("%18d", arr[i][j]); } cout << endl; }

using namespace std;

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

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

/* 1..10
 * rep:   0 1 2 3 4 5 6 7 8 9
 * reps:  1 2 3 4 5 6 7 8 9 10
 * rrep:  9 8 7 6 5 4 3 2 1 0
 * rreps: 10 9 8 7 6 5 4 3 2 1
 */
int dp[100001];
int d[100001];
int main() {
    int n, q, l, r;
    string s;
    cin >> n >> q>> s;
    reps(i, n-1){
        if(s[i-1]== 'A' && s[i] == 'C'){
            dp[i-1] = 1;
            dp[i] = 1;
        }
    }
    ll cur = 0;
    rep(i, n) {
        cur += dp[i];
        d[i] = cur / 2;
    }
    rep(i, q){
        cin >> l >> r;
        cout << d[r-1] - d[l-1] << endl;
    }

}





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

int main(){
  int n;
  cin >> n;
  vector<vector<int>> h(n, vector<int>(3));
  for (int i = 0; i< n; i++){
  	cin >> h.at(i).at(0) >> h.at(i).at(1) >> h.at(i).at(2);
  }
  vector<vector<int>> dp(n, vector<int>(3));
  dp.at(0) = h.at(0);
  int temp;
  for (int i = 1; i < n; i++){
  	dp.at(i).at(0) = max(dp.at(i-1).at(1), dp.at(i-1).at(2)) + h.at(i).at(0);
    dp.at(i).at(1) = max(dp.at(i-1).at(0), dp.at(i-1).at(2)) + h.at(i).at(1);
    dp.at(i).at(2) = max(dp.at(i-1).at(1), dp.at(i-1).at(0)) + h.at(i).at(2);
  }
  cout << *max_element(dp.at(n-1).begin(), dp.at(n-1).end()) << endl;
}

Measured memory_bytes: 11136
from collections import defaultdict

n = int(input())
d = defaultdict(int)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

for i in range(1, n+1):
    for x in prime_factorize(i):
        d[x] += 1

#print(d)



e = defaultdict(int)

l = [2, 4, 14, 24, 74]

#74
for k, v in d.items():
    for x in l:
        if v >= x:
            e[x] += 1

#print(e)

ans = 0

ans += e[74]
ans += e[24] * (e[2] - 1)
ans += e[14] * (e[4] - 1)
ans += (e[4] * (e[4]-1) // 2) * (e[2] - e[4]) + (e[4] * (e[4]-1) * (e[4]-2) // 2)

print(ans)

Measured memory_bytes: 9420
#include <iostream>

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    
    if (a > b)
        cout << "a > b" << endl;
    else if (a < b)
        cout << "a < b" << endl;
    else
        cout << "a == b" << endl;
        
    return 0;
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
int main()
{
    long int n,m;cin>>n>>m;
    vector<pair<long int,long int> > x(n+m);
	for (int i = 0; i < n; i++) {
        cin>>x[i].first;
        x[i].second=1;
    }
    for (int i = n; i < m+n; i++) {
        cin>>x[i].second;
        cin>>x[i].first;
    }
    sort(x.rbegin(),x.rend());
    long int count=n,ans=0;
    for (int i = 0; i < count; i++) {
        ans+=x[i].first*min(count-i,x[i].second);
        count-=x[i].second-1;
    }
    cout<<ans;

}


Measured memory_bytes: 3328
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		String s = sc.next();
		String ans = "AC";
		int cnt = 0;

		if (!s.startsWith("A")) {
			ans = "WA";
		} else {
			for (int i = 1; i < s.length(); i++) {
				if (i == 1) {
					if (Character.isUpperCase(s.substring(i).charAt(0))) {
						ans = "WA";
						break;
					}
				} else if (i > 1 && i < s.length() - 1) {
					if (s.substring(i, i + 1).equals("C")) {
							cnt++;
					}
				} else {
					if (Character.isUpperCase(s.substring(i).charAt(0))) {
						ans = "WA";
						break;
					} else if (cnt != 1) {
						ans = "WA";
						break;
					}
				}
			}
		}
		System.out.println(ans);

		sc.close();
	}
}


Measured memory_bytes: 23760
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")

#include <stdio.h>
#include <bits/stdc++.h>

using namespace std;

#include <x86intrin.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <typename T> using ordered_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(x) x.begin(), x.end()

#define mp make_pair
#define in insert
#define er erase
#define con continue
#define pb push_back
#define sc scanf
#define pr printf
#define ub upper_bound
#define lb lower_bound
#define s second
#define f first
#define int long long

const long long infl = 1e18; 
const int N = 3e5 + 300, N2 = 2e3, inf = 1e9 + 200;

set <int> S;
vector <int> g;
int n, m, k;
int a[N];
string s;

void bad(){
	cout << -1;
	exit(0);
}

main (){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> s;
	if (s[0] == '0' || s.back() == '1') bad();
	vector <int> v;
	for (int i = 0; i < s.size() - 1; i++){
		if (s[i] != s[s.size() - 2 - i]){
			bad();
		}
		if (s[i] == '1'){
			v.pb(i + 1);
		}
	}
	k = v.size();
	for (int i = 2; i <= k + 1; i++){
		cout << i << " " << i - 1 << endl;
 	}
 	int last = k + 2;
 	for (int i = 2; i <= k; i++){
 		int col = v[i - 1];
 		for (int j = 0; j < col - v[i - 2] - 1; j++){
 			cout << i << " " << last++ << endl;
 		}
 	}
	return 0;
}












Measured memory_bytes: 2372
#include <stdio.h>
int main() {
	int h,w;
	scanf("%d %d",&h,&w);
	char square[h][w];
	for(int count = 0;count < h;count++) scanf("%s",square[count]);
	for(int counth = 0;counth < h;counth++) for(int countw = 0;countw < w;countw++) {
		if(square[counth][countw] == '#') {
			int check[4] = {0,0,0,0};
			if(counth != 0) if(square[counth - 1][countw] == '.') check[0] =1;
			if(counth != h - 1) if(square[counth + 1][countw] == '.') check[1] =1;
			if(countw != 0) if(square[counth][countw - 1] == '.') check[2] =1;
			if(countw != w - 1) if(square[counth][countw + 1] == '.') check[3] =1;
			if(check[0] && check[1] && check[2] && check[3]) {
				printf("No\n");
				return 0;
			}
		}
	}
	printf("Yes\n");
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H,A,B,N,R,M,K,X,Y,Z,C;
  string S,T,U;
  cin >> S;

  if((S[2] == S[3])&&(S[4] == S[5])){
    cout << "Yes" << endl;
  }else{
        cout << "No" << endl;
  }
  


}

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

int main(){
    int a,b,c,d,e,sum=0;
    cin >> a >> b >> c >> d >> e ;
    sum=a/10+b/10+c/10+d/10+e/10;
    sum*=10;
    if(a%10!=0){sum+=10;}
    if(b%10!=0){sum+=10;}
    if(c%10!=0){sum+=10;}
    if(d%10!=0){sum+=10;}
    if(e%10!=0){sum+=10;}

    for(int i=1;i<=9;i++){
        if(a%10==i){sum-=10;sum+=i;break;}
        if(b%10==i){sum-=10;sum+=i;break;}
        if(c%10==i){sum-=10;sum+=i;break;}
        if(d%10==i){sum-=10;sum+=i;break;}
        if(e%10==i){sum-=10;sum+=i;break;}
    }
    cout << sum << endl;
}

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

using namespace std;

int pesomax,qtd;
int Pesos[100009] , Valor[100009];
long long dp[109][100009];

long long knapsack(int i,int peso){
	if(peso==0 || i==qtd){
		return 0;
	}

	if(dp[i][peso]>=0){
		return dp[i][peso];
	}

	long long nao = knapsack(i+1,peso);

	if(peso - Pesos[i] >= 0){
		long long coloca = knapsack(i+1,peso-Pesos[i]) + Valor[i];
		return dp[i][peso] = max(nao,coloca);
	}

	return dp[i][peso] = nao;
}


int main(){

	cin >> qtd >> pesomax;

	int weight , value;

	for(int i=0;i<qtd;i++){
		cin >> weight >> value;
		Pesos[i] = weight;
		Valor[i] = value;
	}

	memset(dp,-1,sizeof(dp));

	long long vc;

	vc = knapsack(0,pesomax);

	cout << vc << endl;

	return 0;
}

Measured memory_bytes: 85504
#include<iostream>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= (int)end; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return 0;}
template<typename T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return 0;}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    vector<int> val;
    for (auto& c : S) {
        val.push_back(c - '0');
    }
    rep(mask, 0, 1 << 3) {
        string now;
        int eval = val.front();
        now += val.front() + '0';
        rep(i, 0, 3) {
            if ((mask >> i) & 1) {
                eval += val[i + 1];
                now += '+';
            } else {
                eval -= val[i + 1];
                now += '-';
            }
            now += val[i + 1] + '0';
        }
        if (eval == 7) {
            cout << now << "=7" << endl;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
  int i, j, n, a[100], tmp, flag, count = 0;
  flag = 1;
  scanf("%d", &n);
  for(i = 0; i < n; i++)
    {
      scanf("%d", &a[i]);
    }
  while(flag)
    {
      flag = 0;
      for(j = n - 1; j >= 1; j--)
	{
	  if(a[j] < a[j-1])
	    {
	      tmp = a[j-1];
	      a[j-1] = a[j];
	      a[j] = tmp;
	      flag = 1;
	      count++;
	    }
	}
    }
  for(i = 0; i < n-1; i++)
    {
      printf("%d ", a[i]);
    }
  printf("%d\n", a[n-1]);
  printf("%d\n", count);
  return 0;
}



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

#define pb push_back
#define fst first
#define snd second
#define ALL(s) s.begin(),s.end()
#define fill(a,c) memset(&a, c, sizeof(a))
#define fore(i,x,y) for(ll i=x;i<y;i++)
#define SZ(x) ((int)(x).size())
#define PI 3.1415926535897932384626433832795
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

typedef long long ll;
using namespace std;

int n,k;
const int MAXN = 1e5+5;
vector<int> g[MAXN];
ll ans = 0, mod = 1e9+7;

void dfs(int u, int p){
    ll cnt = k-1;
    if(p != -1) cnt--;
    for(auto v: g[u]){
        if(v == p) continue;
        ans*=cnt;
        ans%=mod;
        cnt--;
        dfs(v,u);
    }
}

int main() {FIN;
    cin>>n>>k;
    fore(i,0,n-1){
        int u,v; cin>>u>>v; u--; v--;
        g[u].pb(v); g[v].pb(u);
    }
    ans = k;
    dfs(0,-1);
    cout<<ans<<"\n";
    return 0;
}



Measured memory_bytes: 9216
#include <stdio.h>

int main (){

  int n,i,j,x;

  scanf("%d",&n);

    for(i=1;i<=n;i++){

      x=i;

      if(i%3==0){

        printf(" %d",i);

      }else{
        while(x>0){
          if(x%10==3){

         printf(" %d",i);

         break;

          }else{
            x=x/10;
          }
        }
      }
    }

    printf("\n");
    return 0;
}



Measured memory_bytes: 2104
#include <bits/stdc++.h>
#define ll long long
#define ld long double

using namespace std;
const ll mod = (ll)1e9+7;
const int INF = 0x3f3f3f3f;
ll max(ll a, ll b){return a > b ? a : b;}
ll min(ll a, ll b){return a < b ? a : b;}

ll dp[3001][3001];
ll a[3001];

ll R(int i, int j)
{
    if(dp[i][j]) return dp[i][j];
    if(i==j) return a[i];
    ll c = a[i] - R(i+1, j);
    ll d = a[j] - R(i, j-1);
    dp[i][j] = max(c, d);
    return dp[i][j];
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
   
    int n;
    cin >> n;
    for(int i=1; i<=n; i++) cin >> a[i];
    ll ans = R(1, n);
    cout << ans;
}



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

int main()
{
    string s;

    while (cin >> s && s != "-") {
        int m, h;
        cin >> m;
        while (m-- && cin >> h)
            s = s.substr(h, s.size() - h) + s.substr(0, h);
        cout << s << endl;
    }

    return 0;
}



Measured memory_bytes: 3180
#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;

# define mp make_pair
# define pb push_back
# define PI acos(-1)
# define ff first 
# define ss second 
# define endl '\n'
# define vt vector
# define all(c) (c).begin(), (c).end()
# define rep(i,a,b) for(int i = a ; i < b ; ++i)

typedef long long ll ; 
typedef long double ld ; 
typedef pair<int,int> pii ; 
typedef pair<ll,ll> pll ;

template<class T> bool umin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool umax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

const int MOD = 1e9+9 ;
const ll inf = 1e18 ;  
const ll mod = 1e9+7 ;  

ll nCr(ll n,ll r){ll t=1;if(r>n)return 0;if(r>n-r)r=n-r;for(ll i=0;i<r;i++){t*=(n-i);t/=(i+1);}return t;}
ll power(ll a, ll n) { ll r=1;while(n){if(n&1)r=(r*a)%MOD;n>>=1;a=(a*a)%MOD;}return r%MOD;}



vt<pii> dir =  {{-1,0} , {1, 0} , {0,-1} , {0,1}} ; 

// ==========Start Here==============

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL) ; 
 	int n ;
 	cin >> n  ; 
 	vt<int> a(n) ; 
 	rep(i,0,n) cin >> a[i] ; 
 	ll res = 0 ; 
 	set<int> ans ; 
 	for(int i = 0 ; i< n ; ++i) {
 		ans.insert(a[i]) ; 
 		if(*ans.begin() == a[i])
 			res++;
 	}
 	cout << res ; 
	return 0 ; 
}

Measured memory_bytes: 13452
import sys
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()

def main():
    N = II()
    W = LI()
    a = 0
    b = sum(W)
    ans = INF
    for w in W:
        ans = min(ans, abs(a - b))
        a += w
        b -= w
    ans = min(ans, abs(a - b))
    return ans

print(main())

Measured memory_bytes: 3064
import java.io.*;
 
class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String[] line = br.readLine().split(" ");
            int a = Integer.parseInt(line[0]);
            int b = Integer.parseInt(line[2]);
            if (line[1].equals("+")) System.out.println(a + b);
            else if (line[1].equals("-")) System.out.println(a - b);
            else if (line[1].equals("*")) System.out.println(a * b);
            else if (line[1].equals("/")) System.out.println(a / b);
            else break;
        }
    }
}

Measured memory_bytes: 16912
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <algorithm>
#include <utility>
#include <functional>
#include <fstream>
#define debug(x) cout << #x << " = " << x << endl
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,n) for(int i = (n); i > -1; i--)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const double EPS = 1e-9;


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

  int n;
  cin>>n;
  int p[n];
  rep(i,n) cin>>p[i];
  sort(p, p + n);
  int ans = 0;
  rep(i,n-1) {
    ans += p[i];
  }
  ans += p[n-1] / 2;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<queue>
#include<vector>
#define MAX 100005
#define INF 100000005
#define pb push_back
using namespace std;

int n;
vector<vector<int> > g(MAX);

vector<int> func(int s)
{
	int f,t;
	int i;
	vector<int> d(MAX);
	 
	queue<int> q;
	
	for (i=1;i<=n;i++)
	{
		d[i]=INF;
	}
	q.push(s);
	d[s]=0;
	while (!q.empty())
	{
		f=q.front();
		q.pop();
		for (i=0;i<g[f].size();i++)
		{
			t=g[f][i];
			if (d[t]>d[f]+1)
			{
				d[t]=d[f]+1;
				q.push(t);
			}
		}
	}
	
	return d;
}
int main()
{
	
	int i,j;
	int x,y;
	int n1,n2;
	vector<int>d1,d2;
	
	cin>>n;
	for (i=1;i<=n-1;i++)
	{
		cin>>x>>y;
		g[x].pb(y);
		g[y].pb(x);
	}
	
	d1=func(1);
	
	d2=func(n);
	
	
	n1=0;
	n2=0;
	for (i=2;i<=n-1;i++)
	{
		if (d1[i]<=d2[i])
		{
			n1++;
		}
		else
		{
			n2++;
		}
	}
	if (n1>n2)
	{
		cout<<"Fennec";
	}
	else
	{
		cout<<"Snuke";
	}
	return 0;
}

Measured memory_bytes: 6656
/*****include*****/
#include <iostream>
#include <fstream>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return;
	}
#endif
	/*****変数置き場*****/
	int year;
	long int money = 100000;
	/*****処理部*****/
	cin >> year;
	for(int i=1;i<=year;i++){
		money += money*0.05;
		if(money % 1000 > 0){
			money /= 1000;
			money++;
			money *= 1000;
		}
	}
	cout << money << endl;
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

Measured memory_bytes: 1160
//g++ -std=c++11 -Wall -O2 -o main.exe main.cpp
//g++ -std=c++14 -Wall -O2 -o main.exe main.cpp

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <tuple>
#include <functional>
#include <algorithm>
#include <complex>
#include <numeric>

using namespace std;

//#define spc " "
#define MOD 1000000007

typedef long long ll;
typedef long double ld;
typedef pair<int, int> p_ii;
typedef tuple<int, int, int, int> tup;

ll divc(ll a, ll b){ //割り算(切り上げ)
    return (a + b - 1) / b;
}

//------------------------------------------------------------------------------

int main(){
    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;

    int m = (h2 - h1) * 60 + (m2 - m1);
    cout << (m - k) << endl;

    return 0;
}


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

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define INTMAX 1000000000
using namespace std;
typedef long long ll;
typedef pair<ll,ll> p;

int n;

ll gcd(ll x, ll y){
  if(y==0)return x;
  else return gcd(y, x%y);
}

int main(){
  cin >> n;
  vector<ll> a(n);
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  vector<ll> l(n+2, 0),r(n+2, 0);
  for(int i = 0; i<n; i++){
    l[i+1] = gcd(l[i], a[i]);
    r[n-i] = gcd(r[n-(i-1)], a[n-i-1]);
    // cout << l[i+1] << " " << r[n-i] << endl;
  }
  // for(int i=0; i<n+1; i++)cout << r[i+1] << " ";
  ll ans = 0;
  for(int i=1; i < n+1; i++){
    // cout <<i<<": "<<l[i-1] << " " << r[i+1] << endl;
    ans = max(ans, gcd(l[i-1], r[i+1])); //なぜこのlの添え字がi-1なのか？
  }
  cout << ans << endl;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int c=0;
	for(int i=0;i<3;i++)
	{
		if(s[i]=='7')
		{
			c=1;
			break;
		}
		else{
			continue;
		}
	}
	if(c==0)
	{
		cout<<"No"<<"\n";
		
	}
	else{
		cout<<"Yes"<<"\n";
	}
	
}

Measured memory_bytes: 3592
H, N = map(int, input().split())
A = []
B = []
for i in range(N) :
    p, q = map(int,input().split())
    A.append(p)
    B.append(q)

dp = [10**10]*(H+max(A))
dp[0] = 0

for i in range(H+max(A)) :
    for j in range(N) :
        if i >= A[j] :
            dp[i] = min(dp[i], dp[i-A[j]]+B[j])
    if dp[i] == 10**10 :
        dp[i] = min(B)

print(min(dp[H:H+max(A)]))


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

int N;
int ans=0;

int main() {
  cin>>N;
  vector<int> d(N);
  
  for(int i=0;i<N;i++){
    cin>>d[i];
  }
  
  sort(d.begin(), d.end());
  
  int a=0;
  vector<int> e;
  for(int i=0;i<N;i++){
    if(a!=d[i]){
      e.push_back(d[i]);
      a=d[i];
    }
  }
  
  cout<<e.size()<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(x,y,z) for(int x=y;x<=z;x++)
#define MSET(x,y) memset(x,y,sizeof(x))
#define M 305
using namespace std;
int n;
double dp[M][M][M];
double calc(int x,int y,int z) {
    if (x<0 || y<0 || z<0) return 0.0;
    if (dp[x][y][z] != -1) return dp[x][y][z];

    double fp = (double)(n-x-y-z) / n;
    dp[x][y][z] = calc(x-1,y,z)*((double)x/n) + calc(x+1,y-1,z)*((double)y/n) + calc(x,y+1,z-1)*((double)z/n) + 1.0;
    dp[x][y][z] /= (1.0-fp);
    return dp[x][y][z];
}
int main()
{
    while (~scanf("%d",&n)) {
        int c[3] = {0,0,0};
        REP(i,1,n) {
            int x;
            scanf("%d",&x);
            c[x-1]++;
        }

        REP(i,0,n)REP(j,0,n)REP(k,0,n) dp[i][j][k] = -1.0;
        dp[0][0][0] = 0.0;
        printf("%.10f\n", calc(c[0],c[1],c[2]));
    }
    
    return 0;
}




Measured memory_bytes: 219392
from collections import defaultdict

n = int(input())
dictnumbers = defaultdict(int)
res = 0

numbers = [int(i) for i in input().split()]

for i in range(n):
    dictnumbers[numbers[i]] += 1

for i, j in dictnumbers.items():
    if i < j:
        res += j - i
    elif i > j:
        res += j

print(res)

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

#include <boost/range/adaptors.hpp>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;
using namespace boost::adaptors;

int main() {
    int64_t a, b, h, m;
    cin >> a >> b >> h >> m;

    cout << setprecision(20)
         << sqrt(a * a + b * b -
                 2 * a * b *
                         cos(2.0 * M_PI / 720 * (60 * h + m) -
                             2.0 * M_PI / 60 * m))
         << endl;
}

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

class UnionFind {
public:
  vector<int> parent;

  UnionFind(int n) {
    parent = vector<int>(n,-1);
  }

  int root(int x) {
    if (parent[x] < 0) return x;
    return parent[x] = root(parent[x]);
  }

  int size(int x) {
    return -parent[root(x)];
  }

  bool unite(int x, int y) {
    x = root(x);
    y = root(y);
    if(x == y) return false;
    if(size(x) < size(y)) swap(x,y);
    parent[x] += parent[y];
    parent[y] = x;
  }

  bool isMate(int x, int y) {
    return root(x) == root(y);
  }
};

int main() {
  int n,m;
  cin>>n>>m;
  vector<int> x(m),y(m),z(m);
  for (size_t i = 0; i < m; i++) {
    cin>>x[i]>>y[i]>>z[i];
  }
  UnionFind Uf(n);
  for (size_t i = 0; i < m; i++) {
    Uf.unite(x[i]-1,y[i]-1);
  }
  int c = 0;
  for (size_t i = 0; i < n; i++) {
    if(Uf.parent[i]<0) c++;
  }
  cout<<c;
}



Measured memory_bytes: 1792
#include <stdio.h>
#include <string.h>

int main(void){
	int n, i, inning=0;
	char com[10];
	
	scanf("%d", &n);
	
	while(inning < n){
		int count = 0;
		int base[3] = {0};
		int score = 0;
		
		while(count<3){
			//printf("base 1 2 3 ? %d %d %d , score: %d\n",base[0], base[1], base[2], score); 
		
			scanf("%s", com);
			if(strcmp(com, "HIT") == 0){
				if(base[2]==1) {
					score++;
					base[2]=0;
				}
				for(i=1; i>=0; i--){
					if(base[i]==1){
						base[i+1]=1;
						base[i]=0;
					}
				}
				base[0]=1;
			}
			else if(strcmp(com, "HOMERUN") == 0){
				score++;
				for(i=0; i<3; i++) {
					if(base[i]==1) {
						score++;
						base[i]=0;
					}
				}
			}
			else if(strcmp(com, "OUT") == 0){
				count++;
			}

		}
		
		printf("%d\n", score);
		inning++;

	}

	return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back

using namespace std;
typedef long long ll;

const int MAXN = 1000*1000 + 7;
const int SS = 1<<20;
const int INF = 1000*1000*1000 + 7;

int t[MAXN];
int n, m, q;

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

	int T;
	//cin >> T;
	T = 1;
	while(T--)
	{
		cin >> n;
		for(int i=1; i<=n; i++)
			cin >> t[i];
		sort(t+1, t+1+n);
		int res = 0;
		for(int i=1; i<=n; i++)
		{
			for(int j=i+1; j<=n; j++)
			{
				for(int k=j+1; k<=n; k++)
				{
					if(t[i] == t[j] || t[j] == t[k] || t[i] == t[k])
						continue;
					if(t[i] + t[j] > t[k])
						res++;
				}
			}
		}
		cout << res << '\n';
	}
	return 0;
}


Measured memory_bytes: 3644
#include<cstdio>
#include<iostream>
int n,x,y,t;
using namespace std;
int main()
{
	scanf("%d",&n);
    for(int i=1;i<=n;i++)
	{
		cin>>t>>x>>y;
		if(x+y>t||(t-x-y)%2!=0)
		{
			cout<<"No";
            return 0;   
        }
    }
    cout<<"Yes";
    return 0;
}

Measured memory_bytes: 256
program main
  implicit none
  integer :: N, M
  integer,allocatable :: H(:), A(:), B(:)
  type neig
     integer, allocatable :: cand(:)
  end type neig
  type(neig), allocatable :: obs(:)
  integer, allocatable :: cnt(:)
  logical, allocatable :: flag(:)
  integer :: i,j,k


  read(*,*) N,M
  allocate(H(N),A(M),B(M))
  allocate(obs(N))
  allocate(cnt(N))
  read(*,*) H(:)
  do i = 1,M
     read(*,*) A(i),B(i)
  end do

  cnt(:) = 0
  do i = 1,M
     cnt(A(i)) = cnt(A(i)) + 1
     cnt(B(i)) = cnt(B(i)) + 1
  end do
  do i = 1,N
     allocate( obs(i)%cand(cnt(i)) )
  end do
  cnt(:) = 0
  do i = 1,M
     cnt(A(i)) = cnt(A(i)) + 1
     obs(A(i))%cand(cnt(A(i))) = B(i)
     cnt(B(i)) = cnt(B(i)) + 1
     obs(B(i))%cand(cnt(B(i))) = A(i)
  end do
  allocate(flag(N)) 
  flag(:) = .true.
  do i = 1,N
     do j = 1,cnt(i)
        if ( H(i) <= H( obs(i)%cand(j) ) ) then
           flag(i) = .false.
           exit
        end if
     end do
  end do
  write(*,'(i0)') count(flag)
  stop
end program main


Measured memory_bytes: 14780
N, T = map(int, input().split())
t = list(map(int, input().split()))
X = [0 for i in range(N)]

for i in range(1, N):
    if t[i] - t[i-1] < T:
        X[i] = X[i-1] + t[i] - t[i-1]
    else:
        X[i] = X[i-1] + T

print(X[-1]+T)


Measured memory_bytes: 25196
#include<bits/stdc++.h>
using namespace std;
 
typedef long long int ll;
typedef long double ld;
 
//****************************************************                
#define f(var,start,end) for(ll var = start; var <end ; ++var)
#define rf(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define vvll vector<vector<ll>>
#define mtp make_tuple
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll,ll> 
#define vpll vector<pll>
#define all(X) X.begin(),X.end()
#define nl cout<<"\n"
#define trace1(a) cerr << #a << ": " << a << endl;
#define trace2(a,b) cerr << #a << ": " << a << " " << #b << ": " << b << endl;
#define trace3(a,b,c) cerr << #a << ": " << a << " " << #b << ": " << b << " " << #c << ": " << c << endl;
#define trace4(a,b,c,d) cerr << #a << ": " << a << " " << #b << ": " << b << " " << #c << ": " << c << #d << ": " << d << endl;
#define OC freopen("input.txt" , "r", stdin); freopen("output.txt" , "w", stdout) 
#define MOD (ll)1e9+7; //change it for other mods
#define FAST_IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
        //*******************************************************
//Some Functions
void solve();

int binary(int a[],int l,int r,int find)
{
    if(l>r)
    {
        return -1; 
    }else
    {
        int mid=(l+r)/2;
        if(a[mid]==find)
        {
            return mid+1;
        }else if(a[mid]>find)
        {
            binary(a,l,mid-1,find);
        }else
        {
            binary(a,mid+1,r,find);
        }   
    }   
}

int main()
{
    FAST_IO;
    ll testcases = 1;
    // cin >> testcases; //comment for 1 test case
    while(testcases--)
    {
        solve();
    }
}
ll md=1000000007;
ll powmod(ll a,ll b)
{
	ll ans=1;
	while(b>0)
	{
		if(b%2)
		{
			ans=((ans%md)*(a%md))%md;
			b--;
		}else
		{
			a=((a%md)*(a%md))%md;
			b=b/2;
		}
	}
	return ans%md;
}
void solve()
{
	ll k;
	cin>>k;
	string s;
	cin>>s;
	ll n=s.length();
	ll N=n+k;
	vll mult(k+1);
	vll fact(k+1);
	fact[0]=1LL;
	mult[0]=1LL;
	f(x,1,k+1)
	{
		mult[x]=((mult[x-1]%md)*((N-(x-1))%md))%md;
		fact[x]=((fact[x-1]%md)*(x%md))%md;
	}
	// f(x,0,k+1)
	// {
	// 	cout<<mult[x]<<" ";
	// }
	// nl;
	// f(x,0,k+1)
	// {
	// 	cout<<fact[x]<<" ";
	// }
	// nl;
	ll ans=0;
	f(x,0,k+1)
	{
		ll dd = (mult[x]*powmod(fact[x],md-2))%md;
		dd = (dd*powmod(25,x))%md;
		ans = ((ans%md) + (dd%md))%md;
		// ans=((ans%md) + ((mult[x]%md) * (powmod(fact[x],md-2)%md) * (powmod(25,x)%md)))%md;
	}
	cout<<ans%md;
	nl;
}








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

int main(){
    int A,B,K;
    cin>>A>>B>>K;
    int count = 0;
    for(int i = min(A,B);i>=0;i--){
        if(A%i==0 && B%i==0){
            count++;
        }
        if(count==K){
            cout<<i<<endl;
            return 0;
        }
    }
}



Measured memory_bytes: 256
l, r = map(int,input().split())
if  r - l >= 2019:
    print(0)
else:
    ans = 2019
    for i in range(l,r+1):
        for j in range(i+1,r+1):
            ans = min(ans, (i*j)%2019)
    print(ans)
                

Measured memory_bytes: 2940
#include <iostream>
#include <cstdio>
#include <map>
#include <cmath>
#include <algorithm>
#define ab(a) ((a) > 0 ? (a) : -(a))
#define rep(i,a,b) for(int i = a; i <= b; i++)
#define dep(i,a,b) for(int i = a; i >= b; i--)
typedef long long LL;
using namespace std;
const int N = 2210;
map<LL, int> cnt;
map<LL, LL> rev;

int p[N], l = 0; bool a[N];
void init() {
    rep(i,2,N - 10) {
        if (!a[i]) p[++l] = i;
        rep(j,1,l) {
            int k = i * p[j]; if (k > N - 10) break;
            a[k] = true;
            if (i % p[j] == 0) break;
        }
    }
}

int main() {
    int n; scanf("%d",&n);
    init();
    int ans = 0;
    rep(i,1,n) {
        LL a; scanf("%lld",&a);

        LL t1 = 1, t2 = 1;
        rep(j,1,l) {
            if (p[j] > a) break;
            int c = 0;
            while (a % p[j] == 0) {
                a /= p[j];
                c++;
            }
            if (c % 3 == 1) t1 *= p[j], t2 *= p[j] * p[j];
            else if (c % 3 == 2) t1 *= p[j] * p[j], t2 *= p[j];
        }

        t1 *= a;
        int t = (int)sqrt(a) - 1;
        while (1LL * t * t < a) t++;
        if (1LL * t * t != a) t2 *= a * a;
        else t2 *= t;

        if (t2 == 1) ans = 1;
        else {
            rev[t1] = t2, rev[t2] = t1;
            if (cnt.find(t1) == cnt.end()) cnt[t1] = 1;
            else cnt[t1] += 1;
            if (cnt.find(t2) == cnt.end()) cnt[t2] = 0;
        }
    }
    for(map<LL, int>::iterator it = cnt.begin(); it != cnt.end(); it++) {
        LL x = it->first; LL y = rev[x];
        if (x < y) ans += max(cnt[x], cnt[y]); 
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 25216
import java.util.*;

public class Main{
	
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int h1=sc.nextInt(),m1=sc.nextInt(),h2=sc.nextInt(),m2=sc.nextInt(),k=sc.nextInt(),x;
    x=(h2-h1)*60+m2-m1;
    System.out.println(x-k);


  }
}


Measured memory_bytes: 35796
#include <iostream>
#include <bitset>
#include <math.h>
#include <algorithm>
#include <vector>;
using namespace std;

int main() {
	
	int d, s, t;
	cin >> d >> s >> t;

	int m = d / s;
	if (d % s != 0) m++;

	if (m <= t) {
		cout << "Yes\n";
	}
	else {
		cout << "No\n";
	}


	return 0;
}

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

typedef long long int ll;
const int maxn = 2e5 + 10;
int a[maxn];
void solved(){
	long long n,k;cin>>n>>k;
	for(int i = 1; i <= n; i++)cin>>a[i];
	map<int,bool>mp;
	vector<int>cyc,sta;
	for(int i = 1; ;i = a[i]){
		if(!mp[a[i]]){
			mp[a[i]] = true;
			sta.push_back(a[i]);
		}else{
			bool flag = false;
			for(int k = 0; k < sta.size(); k++){
				if(a[i] == sta[k])flag = true;
				if(flag){
					cyc.push_back(sta[k]);
				}
			}
			break;
		}
	}
	if(k <= sta.size())cout<<sta[k - 1]<<endl;
	else {
		k -= sta.size();
		k %= cyc.size();
		cout<<cyc[(k - 1 + (int)cyc.size()) % (int)cyc.size()]<<endl;
	}
}
int main(){
	solved();
	return 0;
} 

Measured memory_bytes: 14984