akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
 
using namespace std;
 
#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).rbegin(),(x).rend())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define chmax(x,y) x = max(x,y)

 
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<vector<int> > VVI;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<bool> VB;
typedef vector<LL> VL;
typedef vector<vector<long long>> VVLL;
typedef vector<set<int>> VSI;
const int MOD = 1e9+7;
const int INF = 1e9;
const LL LINF = 1e18;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

int lcm(int a, int b)
{
   return a * b / gcd(a, b);
}
struct UnionFind {
    VI d;
    UnionFind(int n = 0): d(n,-1) {}
    int find(int x) {
        if(d[x] < 0) return x;
        return d[x] = find(d[x]);
    }
    bool unite(int x,int y) {
        x = find(x); y = find(y);
        if(x == y) return false;
        if(d[x] > d[y]) swap(x,y);
        d[x] += d[y];
        d[y] = x;
        return true;
    }
    bool same(int x,int y) { return find(x) == find(y); }
    int size(int x) { return -d[find(x)]; }
};
int deg[100005];
VI to[100005];

struct mint {
  LL x; // typedef long long ll;
  mint(LL x=0):x((x%MOD+MOD)%MOD){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += MOD-a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= MOD;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(LL t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(MOD-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

mint f(int n) {
    if(n == 0) return 1;
    mint x = f(n/2);
    x *= x;
    if(n%2 == 1) x *= 2;
    return x;
}

mint choose(int n,int a) {
    mint x = 1, y = 1;
    rep(i,a) {
        x *= n-i;
        y *= i+1;
    }
    return x/y;
}

int main() {
    int n;
    cin >> n;
    VI p(n);
    rep(i,n) cin >> p[i];
    LL ans = 0;
    int k = -INF;
    // k = p[0];
    int u = INF;
    // ans++;
    for(int i = 0;i < n; i++) {
      u = min(u,p[i]);
      // cout << u << endl;
      if(u >= p[i]) {
        // cout << i << endl;
        ans++;
      }
    }
    cout << ans << endl;
}


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


int main() {
  int n;

  long long sum=0;
  
  cin >> n;

  for(int i=0;i<=n;i++){
    if(i%3==0){}
    else if(i%5==0){}
    else if(i%3==0 && i%5==0){}
    else
      sum += i;
  }

  cout << sum ;

}


Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
#include <tuple>
#include <algorithm>
#include <cmath>
#include <cstdio>

using namespace std;

int main() {
    string s;
    cin >> s;
    if (s[2] == s[3]) {
        if (s[4] == s[5]) {
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main ()
{
    int W,H,x,y,r;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
    if (W>=(x+r) && 0<=(x-r) && H>=(y+r) && 0<=(y-r))
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }


}



Measured memory_bytes: 2676
N, K = map(int, input().split())

cnt = [0] * N
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for j in A:
        cnt[j-1] += 1

ans = 0
for i in cnt:
    if i == 0:
        ans += 1

print(ans)


Measured memory_bytes: 9196
import Control.Applicative
import Control.Monad
import Control.Monad.ST
import qualified Data.ByteString as BS
import Data.Functor
import Data.Function
import Data.Monoid
import Data.Maybe
import Data.List
import qualified Data.Foldable as Foldable
import qualified Data.Set as Set
--import qualified Data.Sequence as Sequence
import Data.List.Split
import Data.Bits
import Data.Char
import Data.Ix
import Data.Ratio
import Data.Ord
import Data.Tuple
import Data.Array
--import Data.Array.Unboxed
--import Data.Array.IArray
import Data.Array.MArray
import Data.Array.IO
import Data.Array.ST
import Data.IORef
import Data.STRef
import GHC.ST
-- import System.IO.Unsafe

-- templete
readInt = read :: String -> Int
readInteger = read :: String -> Integer
readDouble = read :: String -> Double
getInt = readLn :: IO Int
getInts = map readInt . words <$> getLine
getInteger = readLn :: IO Integer
getIntegers = map readInteger . words <$> getLine
getDouble = readLn :: IO Double
getDoubles = map readDouble . words <$> getLine
sjoin :: (Show a) => [a] -> String
sjoin = unwords . map show
tjoin :: (Show a, Show b) => (a, b) -> String
tjoin (x, y) = show x ++ (' ' : show y)
cond :: a -> a -> Bool -> a
cond t f c = if c then t else f
apply2 :: (a -> a -> b) -> [a] -> b
apply2 f [x,y] = f x y
apply3 :: (a -> a -> a -> b) -> [a] -> b
apply3 f [x,y,z] = f x y z
apply4 :: (a -> a -> a -> a -> b) -> [a] -> b
apply4 f [x,y,z,w] = f x y z w
fnTuple :: (a -> b, a -> c) -> a -> (b, c)
fnTuple (f,g) a = (f a, g a)
replace :: (Eq a) => a -> a -> [a] -> [a]
replace x y = map (\z -> if z==x then y else z)
binMap :: (a -> a -> b) -> [a] -> [b]
binMap f (x:xs@(y:_)) = f x y : binMap f xs
binMap _ _ = []
splitRec :: Int -> [a] -> [[a]]
splitRec _ [] = []
splitRec n xs = let (y,ys) = splitAt n xs in y : splitRec n ys
infixl 7 `divCeil`
divCeil :: Integral a => a -> a -> a
x `divCeil` y = (x+y-1) `div` y
coverC :: Ord a => (a, a) -> a -> Bool
coverC (l,r) x = l<=x && x<=r
coverH :: Ord a => (a, a) -> a -> Bool
coverH (l,r) x = l<=x && x<r
ibsearch :: (Int -> Bool) -> (Int,Int) -> Int
ibsearch f (ok,ng) = if abs (ok-ng) <= 1 then ok else let mid = (ok + ng) `div` 2 in ibsearch f (if f mid then (mid,ng) else (ok,mid))
-- templete

f n
  | n<=10 = 1150
  | n<=20 = 1150 + (n-10) * 125
  | n<=30 = 2400 + (n-20) * 140
  | otherwise = 3800 + (n-30) * 160

main = map ((4280-) . f) . takeWhile (/=(-1)) . map readInt . lines <$> getContents >>= mapM_ print


Measured memory_bytes: 4096
#include <bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define nav(...) "[ " << #__VA_ARGS__ ": " << (__VA_ARGS__) << " ] "
#define oo INT_MAX/2
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
template<class T> struct rge { T b, e; };
template<class T> rge<T> range(T i, T j) { return rge<T>{i, j}; }
struct debug {
#ifdef LOCAL
	~debug() {cerr<<endl;}
	template<class T> debug& operator<<(T x) {cerr<<boolalpha<<x; return *this;}
	template<class B, class C> debug& operator<< (pair<B, C> x){return *this<<"("<<x.first<<", "<<x.second<<")";}
	template<class T> debug& operator<<(rge<T> x) {
		*this<<"[";for(auto it=x.b;it!=x.e;it++){*this<<", "+2*(it==x.b)<<*it;}return *this<<"]";}
	template<class T> debug& operator<<(vector<T> x){ return *this<<range(all(x));}
#else
	template<class T> debug& operator <<(const T&) {return *this;}
#endif
};

string s;

int rec(string& cur, int i, int k) {
	int n = cur.length();
	if(i == n) {
		if(k == 0) {
			return cur <= s;
		} else {
			return 0;
		}
	} else if(k == 0){
		return cur <= s;
	} else {
		int ans = rec(cur, i+1, k);
		for(char c = '1'; c <= '9'; c++) {
			cur[i] = c;
			ans += rec(cur, i+1, k-1);
			cur[i] = '0';
		}
		return ans;
	}
}

bool solve(void) {

	int k;
	cin>>s>>k;
	int n = s.length();
	//cout << n << endl;
	string cur(n, '0');

	cout << rec(cur, 0, k)<< endl;
	
	return true;
}

int main(int argc, char* argv[]) {
	
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	solve();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) begin(x), end(x)
using namespace std;
using ll = long long;
constexpr ll Mod = 998244353;
constexpr ll mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;
const double PI = acos(-1);
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) {
    return a < b && (a = b, true);
}
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) {
    return a > b && (a = b, true);
}
/*-------------------------------------------*/

int h, w;
int m;

int cnt1[300001], cnt2[300001];
vector<pair<int, int>> vec;

vector<int> a, b;

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

    cin >> h >> w >> m;
    rep(i, m) {
        int x, y;
        cin >> x >> y;
        x--, y--;
        cnt1[x]++;
        cnt2[y]++;
        vec.emplace_back(x, y);
    }

    sort(ALL(vec));

    int mxa = -1;
    rep(i, h) chmax(mxa, cnt1[i]);
    rep(i, h) if(cnt1[i] == mxa) a.push_back(i);
    int mxb = -1;
    rep(j, w) chmax(mxb, cnt2[j]);
    rep(j, w) if(cnt2[j] == mxb) b.push_back(j);

    for(int i : a)
        for(int j : b)
            if(!binary_search(ALL(vec), make_pair(i, j))) {
                cout << mxa + mxb << endl;
                return 0;
            }

    cout << mxa + mxb - 1 << endl;

    return 0;
}

Measured memory_bytes: 12300
#include <iostream>

using namespace std;

static const int N = 100;
static const long long INF = (1LL << 32);

class APSP {
private:
    long long cost[N][N];
    int n;
public:
    APSP() {}

    APSP(int n)
    {
        this->n = n;

        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
                cost[i][j] = ((i == j) ? 0 : INF);

        int e;
        cin >> e;
        int s, t, d;
        for (int i = 0; i < e; i++)
        {
            cin >> s >> t >> d;
            cost[s][t] = d;
        }
    }

    void warshallFloyd()
    {
        for (int k = 0; k < n; k++)
        {
            for (int i = 0; i < n; i++)
            {
                if (cost[i][k] == INF)
                    continue;

                for (int j = 0; j < n; j++)
                {
                    if (cost[k][j] == INF)
                        continue;

                    cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
                }
            }
        }
    }

    bool negative_cycle()
    {
        for (int v = 0; v < n; v++)
            if (cost[v][v] < 0)
                return true;

        return false;
    }

    void print()
    {
        if(negative_cycle())
            cout << "NEGATIVE CYCLE" << endl;
        else
        {
            for(int i = 0; i < n; i++)
            {
                for(int j = 0; j < n; j++)
                {
                    if(cost[i][j] == INF)
                        cout << "INF";
                    else
                        cout << cost[i][j];
                    if(j == n - 1)
                        cout << endl;
                    else
                        cout << " ";
                }
            }
        }
    }
};

int main()
{
    int n;
    cin >> n;
    APSP apsp(n);
    apsp.warshallFloyd();
    apsp.print();
}



Measured memory_bytes: 3200
#include<bits/stdc++.h>
using namespace std;
int res;
 
int main()
{
    int a,i,j,n,t,b,c;
    string s,s1,s2;
    cin>>a>>b>>c;
    if(a%b==0)
        t=a/b;
    else
        t=(a/b)+1;
    cout<<t*c<<"\n";
 
 
    return 0;
}

Measured memory_bytes: 3588
// E.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <bitset>

using namespace std;

struct UnionFind {
	std::vector<int> _parent;
	std::vector<int> _size;
	UnionFind(int size) : _parent(size, -1), _size(size, 1) { }
	void unite(int a, int b) {
		int ra = root(a), rb = root(b); if (ra == rb) { return; }
		if (_size[ra] >= _size[rb]) { _parent[rb] = ra, _size[ra] += _size[rb]; } else { _parent[ra] = rb, _size[rb] += _size[ra]; }
	}
	int root(int a) {
		int p = _parent[a];
		if (p < 0) { return a; }
		while (_parent[p] >= 0) { p = _parent[p]; }
		return _parent[a] = p;
	}
	int size(int a) { return _size[root(a)]; }
};

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

#ifdef _MSC_VER
	while (true)
#endif
	{
		int n = -1, m, x, y, z, ans = 0;
		cin >> n >> m;
		if (n < 0) return 0;
		UnionFind uf(n);
		for (int i = 0; i < m; ++i) {
			cin >> x >> y >> z;
			uf.unite(x - 1, y - 1);
		}
		ans = n;
		for (int i = 0; i < n; ++i) {
			if (uf.root(i) == i) {
				ans -= uf.size(i) - 1;
			}
		}
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>
#include<string.h>
int def(char X[],char Y[]);
int main()
{
    char A[10000],B[10000];
    scanf("%s %s",A,B);
    int m,n,ans=0;
    m=strlen(A);
    n=strlen(B);
    if(m!=n)
    {
        printf("No\n");
        return 0;
    }
    ans=def(A,B);
    if(ans==1)
    {
        printf("Yes\n");
        return 0;
    }
    if(ans==-1)
    {
        printf("No\n");
        return 0;
    }
    return 0;
}

int def(char X[],char Y[])
{
    int M,i=0,j=0,put=0,K=0;
    char C[100];
    M=strlen(X);

    while(K<M)
    {
j=0;

    for(i=0;i<M;i++)
    {
        if(X[i]==Y[i])
        {
            j++;
        }
    }
    if(j==M)
    {
        put=1;
        return put;
    }

    if(put==1)
    break;
C[0]=X[M-1];
    for(i=M-1;i>0;i--)
    {

        X[i]=X[i-1];
    }
    X[0]=C[0];


    if(put==0 && K==M-1)
    {
        put=-1;
        return put;
    }
    K++;
    }


}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <atcoder/all>
#define INF 1000000007
#define rep(i, N) for(ll i = 0; i < N; i++)
#define rep2(i, j, k) for(ll i = j; i < k; i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define print(x) cout << x << "\n"
#define print2(x, y) cout << x << " " << y << "\n"
#define printv(vec) rep(lp, vec.size()) cout << vec[lp] << " "; print(""); 
#define show(x) cerr << #x << " = " << x << "\n";
#define ALL(v) v.begin(), v.end()
#define SUM(v) accumulate(ALL(v), 0)
#define MAX(v) *max_element(ALL(v))
#define MIN(v) *min_element(ALL(v))
#define SORT(v) sort(ALL(v))
#define REV(v) reverse(ALL(v))
#define pb(x) push_back(x)
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
using namespace std;
using namespace atcoder;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vs = vector<string>;
//using mint = modint998244353;
//ll mod = 998244353;
using mint = modint1000000007;
ll mod = 1000000007;

struct union_find{
 
	vl parent;
	vl sizes;
 
	void init(ll n) {
		rep(i, n) parent.push_back(i);
		rep(i, n) sizes.push_back(1);
	}
 
	ll root(ll n){
		if(parent[n] == n) return n;
		return parent[n] = root(parent[n]);
	}
 
	ll size(ll n) {
		return sizes[root(n)];
	}
 
	bool is_same(ll a, ll b){
		return root(a) == root(b);
	}
 
	void unite(ll a, ll b){
		if(is_same(a, b)) return;
		sizes[root(a)] += size(b);
		parent[root(b)] = root(a);
	}
	
	ll group_count(){
		ll ret = 0;
		rep(i, parent.size()) ret += (parent[i] == i);
		return ret;
	}
};
 
void Main(){

	ll N, M;
	cin >> N >> M;
	vvl v(M, vl(2));
	rep(i, M) cin >> v[i][0] >> v[i][1];
	
	union_find uf;
	uf.init(N);
	
	rep(i, M) uf.unite(v[i][0] - 1, v[i][1] - 1);
	
	ll ans = uf.group_count() - 1;
	print(ans);

}

int main(){
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll t = 1;
	//cin >> t;
	rep(i, t) Main();
	return 0;
	
}





Measured memory_bytes: 11060
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

ll n;
ll len,sum;
int main(){
	scanf("%lld",&n);
	rep(i,0,n){
		ll a,b;
		scanf("%lld%lld",&a,&b);
		len+=b;
		sum+=a*b;
	}
	sum--;
	printf("%lld\n",sum/9+len-1);
}

Measured memory_bytes: 128
#include <iostream>
#include <iomanip>

using namespace std;

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

    double W, H, x, y;

    cin >> W >> H >> x >> y;

    if (W / 2.0 == x && H / 2.0 == y)
    {
        printf("%f", W * H / 2.0);
        printf(" 1\r");
    }
    else
    {
        printf("%f", W * H / 2.0);
        printf(" 0\r");
    }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
map<int,int>mp;
int a[100007];
int main()
{
	int m;
	scanf("%d",&m);
	int i;
	for(i=0;i<m;i++)
		scanf("%d",a+i),mp[a[i]]++;
	sort(a,a+m);
	int lt=0;
	int ans=0;
	for(i=0;i<m;i++)
	{
		if(a[i]!=m-1)
		{
			lt=1;
			break;
		}
	}
	if(lt)
	{
		if(mp.size()==1)
		{
			if(2*a[0]<=m)
				ans=1;
			else
				ans=0;
		}
		else if(mp.size()==2)
		{
			if(a[0]==a[m-1]-1&&mp[a[0]]<a[m-1])
			{
				int d=a[m-1]-mp[a[0]];
				if(2*d<=mp[a[m-1]])
					ans=1;
				else
					ans=0;
			}
			else
				ans=0;
		}
		else
			ans=0;
	}
	else
		ans=1;
	if(ans)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}

Measured memory_bytes: 5376
import sys



towncount = [0, 0, 0, 0]
for i in range(3):
	line = sys.stdin.readline()
	values = line.split(" ")
	for value in values:
		towncount[int(value)-1] += 1

for count in towncount:
	if count > 2:
		print("NO")
		exit()

print("YES")


Measured memory_bytes: 38256
rInt = read :: String -> Int

fn [] = 0
fn ((a,x):[]) = if a==x then 1 else 0
fn ((a,x):((b,y):r)) = if a/=x then fn ((b,y):r) else 1 + fn r


main = do
    n <- rInt <$> getLine
    p <- ((map rInt) . words) <$> getLine
    print $ fn $ zip p [1..n]
    

Measured memory_bytes: 18812
n = int(input())
xs = list(map(int, input().split(' ')))

mn = min(xs)
mx = max(xs)
INF = float('inf')


result = INF
for p in range(mn, mx + 1):
    tmp = 0
    for x in xs:
        tmp += (p - x) ** 2
    if tmp < result:
        result = tmp

print(result)


Measured memory_bytes: 38896
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner scan = new Scanner(System.in)) {
          int num = scan.nextInt();
          int Bsum = 0;
          List<Integer> array = new ArrayList<>();
			List<Integer> Carray = new ArrayList<>();
          
          for (int i = 0; i < num; i++) {
				int a = scan.nextInt();
				array.add(a);
			}
          
          for (int i = 0; i < num; i++) {
				int a = scan.nextInt();
				Bsum += a;
			}
          
          for (int i = 0; i < num-1; i++) {
				int a = scan.nextInt();
				Carray.add(a);
			}
          
          for(int i=1; i<array.size(); i++) {
           		 if(array.get(i-1) == array.get(i)-1) {
                   Bsum += Carray.get(array.get(i-1)-1);
                 }
          }
          
          System.out.println(Bsum);
        }
    }
}

Measured memory_bytes: 21844
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<vector>
#define reg register
#define next kkksc03
#define maxn 1000000
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
inline ll read();
inline void write(ll x);
inline void writesp(ll x);
inline void writeln(ll x);
ll a1,a2,a3;
int main(){
	a1=read();a2=read();a3=read();
	if(a1+a2+a3>=22) puts("bust");
	else puts("win");
}
inline ll read(){
	ll x=0,t=1;char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') t=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*t;
}
inline void write(ll x){
	if(x<0){putchar('-');x=-x;}
	if(x<=9){putchar(x+'0');return;}
	write(x/10);putchar(x%10+'0');
}
inline void writesp(ll x){
	write(x);putchar(' ');
}
inline void writeln(ll x){
	write(x);putchar('\n');
}

Measured memory_bytes: 256
from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
a.sort()

m = len(set(a))
d = defaultdict(int)
for v in a:
    d[v] += 1

cnt = 0
for v in set(a):
    if d[v] % 2 == 0:
        cnt += 1
if cnt % 2 == 1:
    m -= 1
print(m)

Measured memory_bytes: 69032
#include<iostream>
#include<vector>
#include<cassert>

using namespace std;

long long MOD = 1000000007; //prime

vector<long long> fact, fact_inv, inv;
/*  init_nCk :二項係数のための前処理
    計算量:O(n)
*/
void init_nCk(int SIZE) {
    fact.resize(SIZE + 5);
    fact_inv.resize(SIZE + 5);
    inv.resize(SIZE + 5);
    fact[0] = fact[1] = 1;
    fact_inv[0] = fact_inv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < SIZE + 5; i++) {
        fact[i] = fact[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        fact_inv[i] = fact_inv[i - 1] * inv[i] % MOD;
    }
}
/*  nCk :MODでの二項係数を求める(前処理 int_nCk が必要)
    計算量:O(1)
*/
long long nCk(int n, int k) {
    assert(!(n < k));
    assert(!(n < 0 || k < 0));
    return fact[n] * (fact_inv[k] * fact_inv[n - k] % MOD) % MOD;
}

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

	int N = S / 3;
	
	long long total = 0;
	init_nCk (S * 4 / 3 + 1);
	
	for (int k = 1; k <= N; k++)
	{
		int Seffective = S - k * 3;
		total = (total + nCk (Seffective+k-1, Seffective)) % MOD;
	}
	
	cout << total << endl;
	return 0;
}

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

using i32 = int32_t;
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;

using f64 = double;
using f128 = long double;

template <typename T> using Vec = vector<T>;
template <typename K, typename V> using HashMap = unordered_map<K, V>;
template <typename T> using HashSet = unordered_set<T>;

using StrView = string_view;

auto solve(i64 const N, i64 const M, Vec<i64> H, Vec<i64> const A,
           Vec<i64> const B) -> void {
  HashSet<i64> good(N);
  for (i64 i = 1; i <= N; ++i) {
    good.insert(i);
  }

  for (i64 i = 0; i < M; ++i) {
    i64 HA = H[A[i] - 1];
    i64 HB = H[B[i] - 1];

    if (HA > HB) {
      good.erase(B[i]);
    } else if (HA < HB) {
      good.erase(A[i]);
    } else {
      good.erase(A[i]);
      good.erase(B[i]);
    }
  }

  cout << good.size() << "\n";
}

auto main() -> int {
  i64 N;
  scanf("%" SCNd64, &N);
  i64 M;
  scanf("%" SCNd64, &M);
  Vec<i64> H(N);
  for (i64 i = 0; i < N; ++i) {
    scanf("%" SCNd64, &H[i]);
  }
  Vec<i64> A(M);
  Vec<i64> B(M);
  for (i64 i = 0; i < M; ++i) {
    scanf("%" SCNd64, &A[i]);
    scanf("%" SCNd64, &B[i]);
  }
  solve(N, M, move(H), move(A), move(B));
  return 0;
}


Measured memory_bytes: 9592
#include <iostream>
#include <vector>
#include <algorithm>
 
#define rep(i, n) for(int i = 0; i < (n); ++i)
 
using namespace std;

int n;
int a[200000];
int b[200000];

int main(){
    cin >> n;
    rep(i, n){
        cin >> a[i];
    }

    if(n % 2){
        rep(j, n / 2 + 1){
            b[j] = a[n - 2 * j - 1];
        }
        rep(j, n / 2){
            b[n / 2 + j + 1] = a[2 * j + 1];
        }
    }
    else{
        rep(j, n / 2){
            b[j] = a[n - 2 * j - 1];
        }
        rep(j, n / 2){
            b[n / 2 + j] = a[2 * j];
        }
    }

    rep(i, n){
        if(i){
            cout << ' ';
        }
        cout << b[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3712
import java.util.*;
import java.io.*;

/**
 * Made by egor https://github.com/chermehdi/egor.
 * 
 * @author Azuz
 * 
 */
public class Main {

    void solve(Scanner in, PrintWriter out) {
        HashSet<String> set = new HashSet<>();
        int n = in.nextInt();
        while (n-->0) {
          set.add(in.next());
        }

        out.println(set.size());
    }

    public static void main(String[] args) {
        try(Scanner in = new Scanner(System.in);
            PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
        }
    }
}


Measured memory_bytes: 77044
#include <iostream>
#include <cstdio>
#include <string.h>
#include <vector>
#include <limits>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#include <deque>
#include <set>
#include <map>
#include <queue>
#include <assert.h>
#include <sstream>
#include <type_traits>
#define SET(x,y) x |= (1 << y)
#define CLEAR(x,y) x &= ~(1<< y)
#define READ(x,y) ((0u == (x & (1<<y)))?0u:1u)
#define TOGGLE(x,y) (x ^= (1<<y))
#define watch(x) cout << (#x) << " is " << (x) << endl
#define pb push_back
#define mp make_pair
#define si(n) scanf("%d",&n)
#define sf(n) scanf("%f",&n)
#define sl(n) scanf("%lld",&n)
#define slu(n) scanf("%llu",&n)
#define sd(n) scanf("%lf",&n)
#define ss(n) scanf("%s",n)
#define pnl printf("\n")
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pF first
#define pS second
#define CL(a,b) memset(a,b,sizeof(a))
#define sqr(x) ((x)*(x))
#define intLIMIT numeric_limits<int>
#define longLIMIT numeric_limits<long long>
#define GCD(a,b) __gcd((a),(b))
#define dbl(x) (double)(x)
#define vi vector <int>
#define vii vector < pair <int, int> >
#define vll vector <long long>
#define allof(x) (x).begin(), (x).end()
#define fastCin cin.sync_with_stdio(0);cin.tie(0)
#define scanUnsigned(x) do{while((x=getchar())<'0'); for(x-='0'; '0'<=(_=getchar()); x=(x<<3)+(x<<1)+_-'0');}while(0)
#define printArr(a,l) cout<<#a<<": ";for(int i=0;i<(l);i++){cout<<a[i]<<" ";}cout<<endl
#define print2dArr(a,r,c) cout<<#a<<":\n";for(int i=0;i<(r);i++){for(int j=0;j<(c);j++){cout<<a[i][j]<<" ";}cout<<endl;}
char _;
using namespace std;
void PRINT (int x, int y) { for (int i = y-1; i >= 0; i--) { cout << READ(x,i); } cout << endl; }

vector<string>vec_splitter(string s){s+=',';vector<string>res;while(!s.empty()){res.push_back(s.substr(0,s.find(',')));s=s.substr(s.find(',')+1);}
return res;}
void debug_out(vector<string>__attribute__((unused))args,__attribute__((unused))int idx,__attribute__((unused))int LINE_NUM){cerr<<endl;}
template<typename Head,typename...Tail>void debug_out(vector<string>args,int idx,int LINE_NUM,Head H,Tail...T){if(idx>0)cerr<<", ";else cerr<<"Line("<<LINE_NUM<<") ";stringstream ss;ss<<H;cerr<<args[idx]<<" = "<<ss.str();debug_out(args,idx+1,LINE_NUM,T...);}
#ifdef LOCAL_DBG
#define dbg(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define dbg(...) 42
#endif

int main () {
	fastCin;
	int n;
	cin >> n;
	// n = 80;
	ll a[100] = {0};
	for (int x = 1; x <= n; x++) {
		// if (x%2==1) {
		// 	a[x]=100;
		// } else {
		// 	a[x] = 200;
		// }
		cin >> a[x];
	}
	ll y = 1000, s = 0;
	for (int x = 1; x <= n; x++) {
		if (x==n) {
			y += s * a[x];
			continue;
		}
		bool l = false, g = false;
		for (int i = x+1; i <= n; i++) {
			if (a[i] > a[x]) {
				g = true;
				break;
			} else if (a[i] < a[x]) {
				l = true;
				break;
			}
		}
		if (g) {
			s += y/a[x];
			y -= (y/a[x]) * a[x];
		} else if (l) {
			y += s*a[x];
			s = 0;
		}
	}
	cout << y << "\n";
	return 0;
}

Measured memory_bytes: 3172
using System;
using System.IO;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        Console.ReadLine();
        var X = Console.ReadLine().Split().Select(int.Parse).ToArray();
        var Ps = Enumerable.Range(1, 100);
        var answer = Ps.Min(p => X.Sum(x => (x - p) * (x - p)));
        var writer = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
        Console.SetOut(writer);
        Console.WriteLine(answer);
        Console.Out.Flush();
    }
}

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

#define rep(i,m) for(int i = 0; i < m; i++)


int main(){
  string a,b,c;
  cin >> a >> b >> c;
  reverse(a.begin(),a.end());
  if(a.at(0)==b.at(0)){
    reverse(b.begin(),b.end());
    if(b.at(0)==c.at(0))cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
  }else cout<<"NO"<<endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
   
#define lol long long
using namespace std;
 
lol mem[1010][1010];
int dp(int x, int y);
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  int a,b;
  cin >>a>>b;
  memset(mem,-1,sizeof(mem));
  vector<string> s(a);
  for(int i=0;i<a;i++) cin >>s[i];
  for(int i=0;i<a;i++){
    for(int j=0;j<b;j++){
      if(s[i][j]=='#') mem[i+1][j+1]=0;
    }
  }
  cout <<dp(a,b)<<'\n';
  return (0);
}
int dp(int x,int y){
  if(x<=0||y<=0) return 0;
  if(x==1&&y==1) return 1;
  if(mem[x][y]!=-1) return mem[x][y];
  mem[x][y]=dp(x-1,y)+dp(x,y-1);
  mem[x][y]%=1000000007;
  return mem[x][y];
}

Measured memory_bytes: 12748
#include<stdio.h>
#include<string.h>
//言語は「C++14(GCC 5.4.1)」
//AtCoder Beginner Contest 63-A

int main(void)
{
	int A, B;
	scanf("%d", &A);
	scanf("%d", &B);
	if (A+B < 10)
		printf("%d", A+B);
	else
		printf("error");
	return 0;
}

Measured memory_bytes: 128
import sys
from collections import defaultdict

n, k, *ab = map(int, sys.stdin.read().split())
ab = zip(*[iter(ab)] * 2)

def main():
    cnt = defaultdict(int)
    for a, b in ab:
        cnt[a] += b
    
    s = 0
    for v, c in sorted(cnt.items()):
        s += c
        if s >= k:
            return v

if __name__ == '__main__':
    ans = main()
    print(ans)

Measured memory_bytes: 25972
#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main()
{
	string x;
	cin>>x;
	int n=753,mins=7533;
	for(int i=0;i<x.length()-2;i++){
		int t=(x[i]-'0')*100+(x[i+1]-'0')*10+(x[i+2]-'0');
		int tt=abs(t-n);
		mins=min(mins,tt);
	}
	cout<<mins<<endl;
	return 0;
}

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

int main() {
  string S;
  cin >> S;
  int price = 700;
  for (int i = 0; i < 3; i++) {
    if (S.at(i) == 'o') {
      price += 100;
    }
  }
  cout << price << endl;
}

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

int main() {
  int N, D;
  cin >> N >> D;
  vector<vector<int>> X(N, vector<int>(D));
   for (int i = 0; i < N; i++) {
     for (int j = 0; j < D; j++) {
       cin >> X.at(i).at(j);
     }
   }
  int count = 0;
   for (int i = 0; i < N-1; i++) {
     for (int j = i+1; j < N; j++) {
       int total = 0;
       for (int k = 0; k < D; k++) {
         int Y = pow((X.at(i).at(k) - X.at(j).at(k)), 2);
         total += Y;
       }
       double Z = sqrt(total);
       if(floor(Z) == Z)count++;
     }   
   }
  
  cout << count << endl;
}

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

int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;

    int ct,ca;
    ct = 0;
    ca = 0;

    while(c > 0){
        c = c-b;
        ct += 1;
    }

    while(a > 0){
        a = a-d;
        ca += 1;
    }

    if(ct <= ca){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }

    return 0;
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<P> VP;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#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)
const ll INF = 1e18+18;
const ll MAX = 100005;
const ll MOD = 1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a, b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n, m, arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n, arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define Uniq(v) v.erase(unique(v.begin(), v.end()), v.end())
#define fi first
#define se second

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

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

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

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len = v.size();
    for(int i = 0; i < len; ++i) {
        s<<v[i];
        if(i < len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len = vv.size();
    for(int i = 0; i < len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    ll n;
    cin>>n;
    VV g(n, Vec(n));
    rep(i, n)rep(j, n)cin>>g[i][j];


    rep(k, n)
        rep(i, n)
            rep(j, n) {
                if(i == k)continue;
                if(j == k)continue;
                if(g[i][k] == 0)continue;
                if(g[k][j] == 0)continue;
                if(g[i][k]+g[k][j] == g[i][j]) {
                    g[i][j] = 0;
                }
            }
    rep(k, n)
        rep(i, n)
            rep(j, n) {
                if(i == k)continue;
                if(j == k)continue;
                if(g[i][k] == 0)continue;
                if(g[k][j] == 0)continue;
                if(g[i][k]+g[k][j] < g[i][j]) {
                    cout<<-1<<endl;
                    return 0;
                }
            }

    ll ans = 0;
    rep(j, n)rep(i, j)ans += g[i][j];
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1024
#m-solutions2020 d
import sys,math,collections,itertools
input = sys.stdin.readline

N=int(input())
A=list(map(int,input().split()))

cashe = 1000
stake = 0

a =[]
for i in range(N-1):
    a.append(A[i+1]-A[i])

for i in range(N-1):
    if a[i]>0:
        stake += cashe//A[i]
        cashe = cashe%A[i]
    elif a[i]==0:
        continue
    else:
        cashe += stake*A[i]
        stake = 0
cashe += stake*A[-1]
print(cashe)


Measured memory_bytes: 9476
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] d = new int[N];

        for (int i = 0; i < N; i++) {
            d[i] = sc.nextInt();
        }
        Arrays.sort(d);


        int pivot = (d.length-1)/2;
        System.out.println(d[pivot + 1] - d[pivot]);

        return;
    }

}

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

diff = A[0] + K - A[-1]
ans = A[-1] - A[0]
for i in range(1, N):
    dist = K - A[i] + A[i - 1]
    if dist < ans:
        ans = dist

print(ans)


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

using namespace std;

int w, h;
int gx, gy;
int vx[] = {0, 1, 0, -1};
int vy[] = {1, 0, -1, 0};
int block[100][100];
bool check[100][100];
bool flag;

void dfs(int y, int x) {

  /*
  for(int i = 0; i < h; ++i) {
    for(int j = 0; j < w; ++j) {
      if(i == y && j == x) cout << 'P';
      else if(i == gy && j == gx) cout << 'G';
      else cout << block[i][j];
    }
    cout << endl;
  }
  cout << endl;
  */

  if(y == gy && x == gx) {
    
    flag = true;
    return;

  } else {
    
    for(int i = 0; i < 4; ++i) {
      
      int ny = y + vy[i];
      int nx = x + vx[i];
      
      if(ny >= 0 && ny < h && nx >= 0 && nx < w && !check[ny][nx] && block[ny][nx] && block[ny][nx] == block[y][x]) {
	
	check[ny][nx] = true;
	dfs(ny, nx);
	//check[ny][nx] = false;

      }

    }

  }

}

int main() {

  int sx, sy;
  int n;
  int c, d, x, y;

  while(cin >> w >> h) {

    if(w == 0 && h == 0) break;

    cin >> sx >> sy;
    cin >> gx >> gy;
    cin >> n;

    --sx;
    --sy;
    --gx;
    --gy;

    for(int i = 0; i < h; ++i) {
      for(int j = 0; j < w; ++j) {
	block[i][j] = 0;
	check[i][j] = false;
      }
    }

    for(int i = 0; i < n; ++i) {
	
	cin >> c >> d >> x >> y;

	--x;
	--y;
	
	int bw, bh;

	if(d) {
	  bw = 2;
	  bh = 4;
	} else {
	  bw = 4;
	  bh = 2;
	}

	for(int j = 0; j < bh; ++j) {
	  for(int k = 0; k < bw; ++k) {
	    block[y + j][x + k] = c;
	  }
	}

    }

    flag = false;
    check[sy][sx] = true;
    dfs(sy, sx);

    cout << (flag ? "OK" : "NG") << endl;

  }

}

Measured memory_bytes: 1200
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cmath>
#include<list>
#include<set>
#include<map>

using namespace std;
long long MOD = 1000000007LL;

int main() {
	map<long long, bool> mp;
	int N;
	cin >> N;
	for (int i = 0; i < N; ++i) {
		long long a;
		cin >> a;
		if (mp[a] == true) {
			cout << "NO" << endl;
			return 0;
		}
		mp[a] = true;
	}
	cout << "YES" << endl;
	return 0;
}


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

int main(void)
{
    int H,N;
    int A;
    int maximum_damage;
    
    std::cin >> H >> N;

    for(int i =0;i < N;i++){
        std::cin >> A;
        maximum_damage = maximum_damage +  A;
    }

    if(maximum_damage >= H){
        std::cout << "Yes";
        return 0;
    }
    std::cout << "No";

    return 0;
}


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

using namespace std;
static const int INF = 1e9;
static const int MAX_V = 15;
int V;
int d[MAX_V][MAX_V];
int dp[1 << MAX_V][MAX_V];


int rec(int S, int v)
{
	if (dp[S][v] >= 0)
	{
		return(dp[S][v]);
	}
	if (S == (1 << V) - 1 && v == 0)
	{
		return(0);
	}
	int res = INF;
	for (int u = 0; u < V; ++u)
	{
		if (!(S >> u & 1))
		{
			res = min(res, rec(S | 1 << u, u) + d[v][u]);
		}
	}
	return(dp[S][v] = res);
}

void solve()
{
	int E;
	cin >> V >> E;
	for (int i = 0; i < V; ++i)
	{
		for (int j = 0; j < V; ++j)
		{
			d[i][j] = INF;
		}
	}
	for (int i = 0; i < E; ++i)
	{
		int s, t, cost;
		cin >> s >> t >> cost;
		d[s][t] = cost;
	}
	memset(dp, -1, sizeof(dp));
	int ans = rec(0, 0);
	if (ans == INF)
	{
		cout << -1 << endl;
	}
	else
	{
		cout << ans << endl;
	}
}

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

Measured memory_bytes: 3092
N = list(input())
m = list(map(int,N))
a = 10*m[0] + m[1]
b = 10*m[2] + m[3]
 
if 1<=a<=12 and 1<=b<=12:
  print("AMBIGUOUS")
elif 1<=a<=12:
  print("MMYY")
elif 1<=b<=12:
  print("YYMM")
else:
  print("NA")

Measured memory_bytes: 3188
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

k=int(input())
s=input()
n=len(s)

# MOD combination
def cmb(n, r, mod=10**9+7):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

N = 10**6*2+10
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

# print(n,k)
# print(pow(26,n+k,mod)-cmb(n+k,n)*(pow(26,n,mod)-1))
# print(pow(26,n+k,mod),cmb(n+k,n),pow(26,n,mod))
ans=0
for i in range(n):
    ans+=cmb(n+k,i)*pow(25,n+k-i,mod)
print((pow(26,n+k,mod)-ans)%mod)

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

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


void solve(long long H, long long A){
    int ans;
    ans = (H / A);
    if (H % A != 0) {
        ans++;
    }
    cout << ans << endl;

}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long H;
    cin >> H;
    long long A;
    cin >> A;
    solve(H, A);
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int x[7],n,a,i;

  while(scanf("%d",&n),n){

    for(i=0;i<7;i++)
      x[i]=0;

    for(i=0;i<n;i++){
      scanf("%d",&a);
      if(a<10)x[0]++;
      else if(10<=a && a<20)x[1]++;
       else if(20<=a && a<30)x[2]++;
       else if(30<=a && a<40)x[3]++;
       else if(40<=a && a<50)x[4]++;
       else if(50<=a && a<60)x[5]++;
       else if(60<=a)x[6]++;
    }

    for(i=0;i<7;i++)
      printf("%d\n",x[i]);
  }
  return 0;
}

Measured memory_bytes: 404
#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>

using namespace std;

using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define Rep(i, n) for (long long i = 0; i< (long long)(n); i++)
#define RRep(i,n) for (long long i = ((long long)(n)-1); i>=0; i--)

struct Edge{
    int to;
    int weight;
    Edge(int t, int w) : to(t), weight(w){ }
};

using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;

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

template <class T>
T gcd(T a, T b){
    if( b==0 ) return a;
    else return gcd(b, a%b);
}

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

int INF = 1e9+7;

vector<int> dx = {-1,0,1,0};
vector<int> dy = {0,-1,0,1};

struct UnionFind {
    vector<int> par, rank;

    UnionFind(int n) : par(n , -1), rank(n, 1) { }
    void init(int n) { par.assign(n, -1), rank.assign(n, 1); }

    int find(int x) {
        if (par[x] == -1) return x;
        else return par[x] = find(par[x]);
    }

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

    bool merge(int x, int y) {
        x = find(x); y = find(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        rank[x] += rank[y];
        par[y] = x;
        return true;
    }

    vector<int> roots(){
        vector<int> d;
        rep(i,par.size()){
            if(par[i]<0) d.emplace_back(i);
        }
        return d;
    }

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

    int count_group(){
        return roots().size();
    }
};

int main(){
    int n,m;
    cin >> n >> m;
    UnionFind uf(n);
    rep(i,m){
        int x,y,z;
        cin >> x >> y >> z;
        x--;
        y--;
        uf.merge(x,y);
    }
    cout << uf.count_group() << endl;
}

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

Measured memory_bytes: 1796
//初めての尺取り

#include<stdio.h>
#include<iostream>
using namespace std;

#define GOMAE (long long)50000
#define EPS (long long)4000
#define TO_OUTSIDE (long long)1500
#define IS_NOT_EVEN_HOBBY (long long)573
int N;
long long input;
long long A[300010];
long long ans;

//A[i]-A[st] >= A[ed]-A[i]となる最小のiを返す。
int seach1( int st, int ed, int i ){
	
	for( ; i < ed; i++ ){
		if( A[i]-A[st] >= A[ed]-A[i] )
			break;
	}
	return i;
}
//A[i]-A[st] >= Xとなる最小のiを返す。
int seach2( int st, int ed, long long X, int i ){
	
	for( ; i < ed; i++ ){
		if( A[i]-A[st] >= X )
			break;
	}
	return i;
}

int solve( long long X ){
	int i,j=0,k=0;
	
	if( X >= (A[N]>>1) )
		return 0;
	for( i = 0; i < N; i++ ){
		//大きさがX以上になるように切る
		for( ; j < N+i; j++ ){
			if( A[j]-A[i] >= X )
				break;
		}
		//できるだけ真ん中で切る
		for( ; k < N+i; k++ ){
			if( A[k]-A[j] >= A[N+i]-A[k] )
				break;
		}
		if( min( A[j]-A[i], min( A[k]-A[j], A[i+N]-A[k] ) ) >= X )
			break;
		k--;
		if( min( A[j]-A[i], min( A[k]-A[j], A[i+N]-A[k] ) ) >= X )
			break;
	}
	if( i < N )
		return 1;
	return 0;
}
				
int main(){
	int i,j,k;
	long long s = 0, e = GOMAE * EPS * TO_OUTSIDE * IS_NOT_EVEN_HOBBY * EPS;
	scanf("%d",&N);
	if( N > 100000 )
		return 0;
		
	for( i = 1; i < N+1; i++ ){
		scanf("%d",&input);
		A[i] = A[i-1]+input;
	}
	for( i = N+1; i < 3*N+1; i++ ){
		A[i] = A[i-N] + A[N];
	}
	
	//printf("%lld %lld\n",s,e);
	while( s <= e ){
		ans = (s+e)>>1;
		if( solve(ans) ){
			if( solve(ans+1) )
				s = ans+1;
			else
				break;
		}
		else{
			e = ans-1;
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 3532
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	int n;
	cin>>n;
	if(n<1200){
		cout<<"ABC"<<endl;
	}else{
		if(n<2800){
			cout<<"ARC"<<endl;
		}else{
			cout<<"AGC"<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#import sys
#input = sys.stdin.readline

import math
from collections import defaultdict,deque
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

t=1
for _ in range(t):
    n=ii()
    a=ll()
    ans=0
    for i in range(n):
        if (i+1)%2 and a[i]%2:
            ans+=1
    print(ans)        

Measured memory_bytes: 65176
#include<stdio.h>
#include<math.h>
int main(){
    int a, b, c, d, i, j, n;
    int count = 0;
    scanf("%d %d %d", &a, &b, &c);
    d = a-b;
    count = c -d;
    if(count < 0){
        count = 0;
    }
    printf("%d\n", count);
    return 0;
}


Measured memory_bytes: 128