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

template<class like_bool> inline void YES(like_bool condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class like_bool> inline void Yes(like_bool condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class like_bool> inline void POSS(like_bool condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class like_bool> inline void Poss(like_bool condition){ if(condition)cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class like_bool> inline void First(like_bool condition){ if(condition)cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
long gcd(long a, long b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }}
#define mod long(1e9 + 7)
#define bitcount(n) __builtin_popcount(n)

int main(){
    int N, S;
    cin >> N >> S;
    int nums_cumulative_sum[N + 1];
    nums_cumulative_sum[0] = 0;
    for(int i = 1; i <= N; i++){
        int num;
        cin >> num;
        nums_cumulative_sum[i] = nums_cumulative_sum[i - 1] + num;
    }
    if(nums_cumulative_sum[N] < S){
        cout << 0 << endl;
        return 0;
    }
    int ans = 1e9;
    for(int i = 0; nums_cumulative_sum[N] - nums_cumulative_sum[i] >= S; i++){
        ans = min(ans, int(lower_bound(nums_cumulative_sum, nums_cumulative_sum + N + 1, nums_cumulative_sum[i] + S) - nums_cumulative_sum) - i);
    }
    cout << ans << endl;
}




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

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

  int ans;

  if (n % 1000 == 0) cout << 0 << endl;
  else {
    n = n % 1000;
    ans = 1000 - n;
    cout << ans << endl;
  }

  return 0;
}


Measured memory_bytes: 3632
matches = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]

n, m = map(int, input().split())
alist = list(map(int, input().split()))
alist.sort(reverse=True)

dp = [-1 for _ in range(n + 1)]
dp[0] = 0
for a in alist:
    match = matches[a]
    for i in range(n - match + 1):
        if dp[i] == -1: continue
        dp[i + match] = max(dp[i + match], dp[i] * 10 + a)

print(dp[-1])


Measured memory_bytes: 67292
N, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

MOD = 10 ** 9 + 7

fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]


def cmb(n, k, p):
    if (k < 0) or (n < k):
        return 0
    r = min(k, n - k)
    return fact[n] * factinv[k] * factinv[n - k] % p


# N = 10 ** 6
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % MOD)
    inv.append((-inv[MOD % i] * (MOD // i)) % MOD)
    factinv.append((factinv[-1] * inv[-1]) % MOD)

A.sort()

ans = 0
for i in range(N - K + 1):
    ans += A[-1 -i] * cmb(N - i - 1, K - 1, MOD)
    ans -= A[i] * cmb(N - i - 1, K - 1, MOD)
    ans %= MOD

print(ans % MOD)


Measured memory_bytes: 25808
package main

import (
	"fmt"
)

func main() {
	var s string
	fmt.Scan(&s)

	count := 0
	maxCount := 0
	for i := range s {
		if s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T' {
			count++
			if maxCount < count {
				maxCount = count
			}
		} else {
			count = 0
		}
	}
	fmt.Println(maxCount)
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int a[200];
set<char>se;
int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++)
    cin>>a[i];
    int couts=0;
for(int i=1;i<n-1;i++)
{

    if((a[i]>a[i-1]&&a[i]<a[i+1])||(a[i]<a[i-1]&&a[i]>a[i+1]))
        couts++;
}
cout<<couts<<endl;
    return 0;
}


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

using namespace std;

int main(void){
    long long A, B, C;
    long long sum;
    cin >> A >> B >> C;
    sum = A + B + C;

    int ans;
    
    if(A % 2 > 0 or B % 2 > 0 or C % 2 > 0){
        ans = 0;
        cout << ans << endl;
        return 0;

    }
    else if(A -B == 0 and B - C == 0){
        ans = -1;
        cout << ans << endl;
        return 0;
    }
    else{
        while(true){
            if(A % 4 > 0 or B % 4 >0 or C % 4 > 0){
                ans = ans + 1;
                cout << ans << endl;
                return 0;
            }
            A = (sum - A) / 2;
            B = (sum - B) / 2;
            C = (sum - C) / 2;
            ans = ans + 1;
        }
    }
}

Measured memory_bytes: 256
h,w = list(map(int, input().split()))
board = []
dp = []
INF=10**18
for _ in range(h):
    board.append(input())
    dp.append([INF]*w)

dxy=[(0,1), (0,-1), (1,0), (-1,0)]

dp[0][0]=1 if board[0][0] == '#' else 0
for y in range(h):
    for x in range(w):
        dp_list=[dp[y][x]]
        if x>0:
            dp_left = dp[y][x-1]
            if board[y][x-1] != board[y][x] and board[y][x] == '#':
                dp_left += 1
            dp_list.append(dp_left)
        if y>0:
            dp_up=dp[y-1][x]
            if board[y-1][x] != board[y][x] and board[y][x] == '#':
                dp_up += 1
            dp_list.append(dp_up)
        dp[y][x]=min(dp_list)

print(dp[h-1][w-1])

Measured memory_bytes: 3188
n, m = map(int, input().split())
x = sorted(list(map(int, input().split())))
xx = sorted([x[i+1] - x[i] for i in range(m-1)])

for i in range(n-1):
    if len(xx) == 0:
        break
    xx.pop()

ans = sum(xx)
print(ans)



Measured memory_bytes: 13960
//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
using namespace std;

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (ll)(m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,-1,0,0,1,1,-1,-1};
vector<ll>dy={0,0,1,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}
//mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());
template<typename T>
map<T,ll> compress(vector<T> &v){
  sort(ALL(v));
  v.erase(unique(ALL(v)),v.end());
  map<T, ll> ret;
  for(ll i=0;i<(ll)v.size();i++)
    ret[v[i]]=i;
  return ret;
}
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  vector<ll>val;
  ll n;cin>>n;
  vector<ll>a(n),b(n);
  rep(i,0,n)cin>>a[i]>>b[i];
  sort(ALL(a));
  sort(ALL(b));
  if(n&1)cout<<b[n/2]-a[n/2]+1<<endl;
  else{
    ll r=b[n/2-1]+b[n/2];
    ll l=a[n/2-1]+a[n/2];
    cout<<r-l+1<<endl;
  }
  return 0;
}

Measured memory_bytes: 6348
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func main() {
	sc.Split(bufio.ScanWords)
	h := nextInt()
	n := nextInt()
	damage := make([]int, n)
	magic := make([]int, n)
	dp := make([]int, h+1)
	for i := range damage {
		damage[i] = nextInt()
		magic[i] = nextInt()
	}
	for i := range dp {
		dp[i] = math.MaxInt32
	}

	dp[0] = 0
	for i := 1; i <= h; i++ {
		for j := 0; j < n; j++ {
			if i < damage[j] {
				//j番目の攻撃で与えるダメージが体力hを超える場合
				dp[i] = min(dp[i], dp[0]+magic[j])
			} else {
				dp[i] = min(dp[i], dp[i-damage[j]]+magic[j])
			}
		}
	}
	fmt.Println(dp[h])
}

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

int main(){
    string S,T;
    int a, b;
    string U;

    cin >> S >> T >> a >> b >> U;

    if(S == U) --a;
    else --b;
    cout << a << " " << b << endl;

    return 0; 

}

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

int main(){
    long long n,r,l;
    cin >> n;
    long long sum = 0;
    for (long long i=0; i<n; i++){
        cin >> l >> r;
        sum += r - l + 1;
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
    int T;scanf("%d",&T);
    for(int k,a,b,c,d;T--;puts("")){
        scanf("%d%d%d%d",&a,&b,&c,&d);
        int l=0,r=a+b+1;k=(max(a,b)-1)/(min(a,b)+1)+1;
        for(int mid;l<r;){
            mid=(l+r)>>1;
            if(b-mid/(k+1)<=1ll*(a-mid/(k+1)*k-mid%(k+1))*k)
                l=mid+1;else r=mid;
        }
        r=l+b-l/(k+1)-(a-l/(k+1)*k-l%(k+1))*k+1;
        for(int i=c;i<=min(d,l);++i)
            putchar(i%(k+1)?'A':'B');
        for(int i=max(c,l+1);i<=d;++i)
            putchar((i-r)%(k+1)?'B':'A');
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef long long ll;

int main() {
	ll N,K,x,d1=-1,d2=-1;
	cin >> N >> K;
	set<ll> s;
	vector<ll> A(N),t(N,0);
	rep(i,N)
		cin >> A.at(i);

	s.insert(0);
	rep(i,N*2-1) {
		t.at(i+1) = A.at(t.at(i))-1;
		if(s.count(t.at(i+1))) {
			x = t.at(i+1);
			break;
		}
		s.insert(t.at(i+1));
	}

	rep(i,N)
		if(t.at(i)==x)
			if(d1 == -1) {
				d1 = i;
			} else {
				d2 = i;
				break;
			}

	// rep(i,N)
	// 	cout << t.at(i)+1 << endl;
	// cout << endl;

	if(K <= d1)
		cout << t.at(K)+1ll << endl;
	else
		cout << t.at(((K-d1)%(d2-d1))+d1)+1ll << endl;
}

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

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define iter(v, i) for (__typeof__((v).begin()) i = (v).begin(); i != (v).end(); i++)
#define fast_io_without_cstdio ios_base::sync_with_stdio(false), cin.tie(NULL)
#define all(v) (v).begin(), (v).end()
#define rep(i, s, e) for (int i = s; i < e; i++)

// START for segment tree
#define params int p, int L, int R
#define housekeep int mid = (L + R) >> 1, left = p << 1, right = left | 1
// END

#ifdef __linux__
#define gc getchar_unlocked
#define pc putchar_unlocked
#else
#define gc getchar
#define pc putchar
#endif

#if __cplusplus <= 199711L
template<class BidirIt>
BidirIt prev(BidirIt it, typename iterator_traits<BidirIt>::difference_type n = 1) {
    advance(it, -n);
    return it;
}

template<class ForwardIt>
ForwardIt next(ForwardIt it, typename iterator_traits<ForwardIt>::difference_type n = 1) {
    advance(it, n);
    return it;
}
#endif

typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ldouble;

const double EPS = 1e-9;
const double PI = 3.141592653589793238462;

template<typename T>
inline T sq(T a) { return a * a; }

//#ifdef LOCAL_MACHINE
//#endif

const int MAXN = 2e5 + 5;

char str[MAXN];
vi pos[300];
int bit[MAXN];

#define lsone(s) (s & (-s))

void add(int b, int val) {
    while (b < MAXN) {
        bit[b] += val;
        b += lsone(b);
    }
}

int ask(int b) {
    int res = 0;
    while (b > 0) {
        res += bit[b];
        b -= lsone(b);
    }
    return res;
}

int main() {
    //freopen("", "r", stdin);
    //freopen("", "w", stdout);
    scanf("%s", str + 1);
    int n = strlen(str + 1);
    for (int i = 1; i <= n; i++) {
        pos[str[i]].pb(i);
    }
    int odd = 0;
    for (int i = 0; i < 300; i++)
        if (pos[i].size() & 1)
            odd++;
    if (odd > 1) {
        puts("-1");
        return 0;
    }
    ll ans = 0;
    int who = -1;
    if (odd == 1) {
        for (int i = 0; i < 300; i++)
            if (pos[i].size() & 1)
                who = i;
    }
    for (int i = 1; i <= n; i++) {
        bit[i] = lsone(i);
    }
    bool found = false;
    for (int i = 1; i <= n; i++) {
        if (pos[str[i]].size() > 0 && i < pos[str[i]].back()) {
            ans += ask(n) - ask(pos[str[i]].back());
            add(pos[str[i]].back(), -1);
            pos[str[i]].pop_back();
            if (found) ans++;
            //printf("running at pos %d with found = %d\n", i, (int)found);
        } else if (str[i] == who) {
            found = true;
        }
    }
    printf("%lld\n", ans);
    return 0;
}



Measured memory_bytes: 2296
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
#define rep(i,s,n)for(int i = s;i<n;i++)
#define repe(i,s,n)for(int i = s;i<=n;i++)
typedef long long ll;
static const ll MOD = 1e9 + 7;
static const ll INF = (ll)1 << 62;

static const int MAX = 100001;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
vector<pair<int, int>> adj[MAX];

ll p[MAX];
ll d[MAX];
ll color[MAX];
priority_queue<pair<int, int>>PQ;
ll n;
void dijkstra(int s) {
	repe(i, 1, n) {
		d[i] = INF;
		p[i] = INF;
		color[i] = WHITE;
	}

	d[s] = 0;
	p[s] = -1;
	PQ.push(make_pair(s, s)); // ?reverse?
	//color[s] = GRAY;

	while (!PQ.empty()) {
		pair<ll, ll> f = PQ.top(); PQ.pop();
		ll u = f.second;

		color[u] = BLACK;

		if (d[u] < f.first * (-1)) continue;

		rep(j, 0, adj[u].size()) {
			ll v = adj[u][j].first;
			if (color[v] == BLACK) continue;
			if (d[v] > d[u] + adj[u][j].second) {
				d[v] = d[u] + adj[u][j].second;
				PQ.push(make_pair(d[v] * (-1), v));
				p[v] = u;
				//color[v] = GRAY;
			}
		}
	}
	//rep(i, 0, n) cout << i << " " << (d[i] == INF ? -1 : d[i]) << endl;
	//rep(i, 0, n) cout << i << " " << (p[i] == INF ? -1 : p[i]) << endl;
}

vector<ll> get_path(int t) {
	vector<ll> path;
	for (; t != -1; t = p[t])path.push_back(t);
	reverse(path.begin(), path.end());
	return path;
}

int main()
{
	cin >> n;
	rep(i, 0, n - 1) {
		ll a, b, c; cin >> a >> b >> c;
		adj[a].push_back(make_pair(b, c));
		adj[b].push_back(make_pair(a, c));
	}
	ll q, k; cin >> q >> k;

	dijkstra(k);

	rep(i, 0, q) {
		ll x, y; cin >> x >> y;
		cout << d[x] + d[y] << endl;
	}
	return 0;
}

Measured memory_bytes: 10868
#include<bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define repk(i,k,n) for (ll i = k; i < (ll)(n); ++i)
#define MAX 500000001000000000
#define MOD 1000000007
typedef long long  ll;

using namespace std;

int ans, cnt;

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

	vector<vector<int>> c(3, vector<int>(3));
	rep(i, 3) {
		rep(j, 3) {
			cin >> c[i][j];
		}
	}

	
	if ((c[0][0] - c[1][0] == c[0][1] - c[1][1]) && (c[0][1] - c[1][1] == c[0][2] - c[1][2])) {
		if ((c[1][0] - c[2][0] == c[1][1] - c[2][1]) && (c[1][1] - c[2][1] == c[1][2] - c[2][2])) {
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;
	return 0;
}

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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
typedef long long ll;
typedef pair<int, int> pii;
const int inf=1010001000;
const ll  INF=1001000100010001000;
const int mod=(int)1e9+7;
int n,m,q;
vector<ll>a,b,c,d;
ll ans;
void dfs(vector<int>v){
    if(v.size()==n){
        ll sum=0;
        rep(i,0,q){
            if(v.at(b.at(i))-v.at(a.at(i))==c.at(i))sum+=d.at(i);
        }
        ans=max(ans,sum);
        return;
    }
    
    int pre=(v.empty()?1:v.back());
    rep(i,pre,m+1){
        v.push_back(i);
        dfs(v);
        v.pop_back();
    }
}
int main(){
    cin>>n>>m>>q;
    a=b=c=d=vector<ll>(q);
    vector<int>A;
    rep(i,0,q){
        cin>>a.at(i)>>b.at(i)>>c.at(i)>>d.at(i);
        a.at(i)--;
        b.at(i)--;
    }
    ans=0;
    dfs(A);
    cout<<ans<<endl;
return 0;
}

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

using namespace std;

#define LL long long
#define DD double
#define Pb push_back
#define Bp pop_back
#define Pf push_front
#define Fp pop_front
#define Ub upper_bound
#define Lb lower_bound
#define In insert
#define All(x) x.begin(), x.end()
#define mem(a, b) memset(a, b, sizeof(a))
#define fast ios_base::sync_with_stdio(0);cin.tie(0)
#define X first
#define Y second
#define mx1 10
#define mx2 110
#define mx3 1010
#define mx4 10010
#define mx5 100010
#define mx6 1000010

typedef vector<LL> Vl;
typedef vector<DD> Vd;
typedef vector<bool> Vb;
typedef vector<Vl> VVl;
typedef pair<LL, LL> Pll;
typedef pair<DD, DD> Pdd;
typedef vector<Pll> Vpl;
typedef vector<Pdd> Vpd;
typedef queue<LL> Ql;
typedef stack<LL> Sl;
typedef deque<LL> Dl;

LL _set(LL N, LL pos) {return N = N | (1 << pos);}
LL _reset(LL N, LL pos) {return N = N & ~(1 << pos);}
bool _check(LL N, LL pos) {return (bool)(N & (1 << pos));}
bool _upper(char a) {return a >= 'A' && a <= 'Z';}
bool _lower(char a) {return a >= 'a' && a <= 'z';}
bool _digit(char a) {return a >= '0' && a <= '9';}

LL dx[] = {1, -1, 0, 0, -1, -1, 1, 1};
LL dy[] = {0, 0, 1, -1, -1, 1, -1, 1};

///**************************DONE****************************///

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

    int L = s.size();
    for(int i = 0; i < L; i++){
        string x;
        x.Pb(s[L - 1]);
        s = x + s.substr(0, L - 1);

        if(s == t)
            return cout << "Yes\n", 0;
    }
    cout << "No\n";
    return 0;
}


Measured memory_bytes: 256
N = int(input())

num = [0]*(10**5)

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            ans = x**2 + y**2 + z**2 + x*y + y*z + z*x
            num[ans] += 1
            
print(*num[1:N+1], sep ='\n')

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

int main()
{
    int n, AC=0, WA=0, TLE=0, RE=0;
    cin >> n;
    string s;
    while(n--)
    {
        cin >> s;
        if(s=="AC") AC++;
        else if(s=="WA") WA++;
        else if(s=="TLE") TLE++;
        else if(s=="RE") RE++;
    }
    cout << "AC x " << AC << endl;
    cout << "WA x " << WA << endl;
    cout << "TLE x " << TLE << endl;
    cout << "RE x " << RE << endl;


    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<math.h>
using namespace std;
#define ll long long
int main(){
    ll N;
    cin >> N;
    ll d[N];
    ll i,j;
    for(i=0;i<N;i++){
        cin >> d[i];
    }
    ll ans=0;
    for(i=0;i<N-1;i++){
        for(j=i+1;j<N;j++){
            ans+=d[i]*d[j];
        }
    }
    cout << ans;
    return 0;
}


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

#define EPS 1e-6
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define llinf 0x3f3f3f3f3f3f3f3f

#define fi first
#define se second
#define pb push_back
#define ende '\n'

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define mset(x, y) memset(&x, (y), sizeof(x))

using namespace std; 

using ll = long long;
using ii = pair<int,int>;

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

  int n; cin >> n;
  bool poss = true;
  for (int i = 0; i < n; ++i) {
    int x; cin >> x;
    if (x % 2 == 0)
      poss &= ((x % 3 == 0) || (x % 5 == 0));
  }

  cout << (poss ? "APPROVED" : "DENIED") << ende;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%lld",&x)
#define ss(s)	scanf("%s",s)
#define pi(x)	printf("%d\n",x)
#define pl(x)	printf("%lld\n",x)
#define ps(s)	printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
const int mod = 1'000'000'007;
const int N = 3e5, M = N;
//=======================

void solve() {
  int i, j, n, m;
  cin >> n;
  vi a(n);
  fo(i,n) cin >> a[i];
  sortall(a);
  auto flag = 1;
  ll alice=0,bob=0;
  Fo(i,n-1,-1){
    if(flag){
      alice+=a[i];
      flag = 0;
    }
    else{
      bob+=a[i];
      flag=1;
    }
  }
  cout << abs(alice-bob);
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

    int t = 1;
    //cin >> t;
    while(t--) {
      solve();
    }

    return 0;
}


Measured memory_bytes: 3620
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
	int H, W;
	cin >> H >> W;
	string S[H];
	rep(i, H) cin >> S[i];
	rep(i, W + 2) cout << "#";
	cout << endl;
	rep(i, H) {
		cout << '#' << S[i] << '#' << endl;
	}
	rep(i, W + 2) cout << "#";



    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;

ll b_search(ll N, ll S[], ll target)
{
    ll ok = -1;
    ll ng = N;

    while (ok + 1 < ng)
    {
        ll mid = (ok + ng) / 2;
        if (S[mid] >= target)
        {
            ng = mid;
        }
        else
        {
            ok = mid;
        }
    }

    return ok + 1;
}

ll b_search2(ll N, ll S[], ll target)
{
    ll ng = -1;
    ll ok = N;

    while (ng + 1 < ok)
    {
        ll mid = (ok + ng) / 2;
        if (S[mid] <= target)
        {
            ng = mid;
        }
        else
        {
            ok = mid;
        }
    }

    return N - ok;
}

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

    ll A[N], B[N], C[N];
    rep(i, N) cin >> A[i];
    rep(i, N) cin >> B[i];
    rep(i, N) cin >> C[i];
    sort(A, A + N);
    sort(B, B + N);
    sort(C, C + N);

    // Bを固定して考える
    ll ans = 0;
    rep(i, N)
    {
        ll b = B[i];
        // 許容されるAの種類 * 許容されるCの種類
        ans += b_search(N, A, b) * b_search2(N, C, b);
    }

    cout << ans << endl;

    return 0;
}

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

using namespace std;

struct Edge {
    int src, dst;
    Edge(int f, int t) :
        src(f), dst(t) {}
};
using Edges = vector<Edge>;
using Graph =  vector<Edges>;

bool Augment(const Graph& g, int u,
             vector<int>& matchTo, vector<bool>& visited) {
    if (u < 0) return true;

    for (auto e : g[u])
        if (!visited[e.dst]) {
            visited[e.dst] = true;
            if (Augment(g, matchTo[e.dst], matchTo, visited)) {
                matchTo[e.src] = e.dst;
                matchTo[e.dst] = e.src;
                return true;
            }
        }

    return false;
}

int BipartiteMaximumMatching(const Graph& g, int L) {
    const int n = g.size();
    Edges matching;
    vector<int> matchTo(n, -1);
    int match = 0;

    for (int u = 0; u < L; ++u) {
        vector<bool> visited(n);
        if (Augment(g, u, matchTo, visited))
            ++match;
    }

    for (int u = 0; u < L; ++u)
        if (matchTo[u] >= 0) // make explicit matching
            matching.emplace_back(Edge(u, matchTo[u]));

    return match;
}

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

    int m, n;

    while (cin >> m >> n, m) {
        vector<int> b(m), r(n);
        for (auto &x : b) cin >> x;
        for (auto &x : r) cin >> x;

        Graph g(m + n);
        for (int i = 0; i < m; ++i)
            for (int j = 0; j < n; ++j)
                if (__gcd(b[i], r[j]) != 1)
                    g[i].emplace_back(Edge(i, j + m));

        cout << BipartiteMaximumMatching(g, m) << '\n';
    }

    return 0;
}



Measured memory_bytes: 4472
#include<bits/stdc++.h>
using namespace std;
const int _max = 2e6 + 10;
const int mod = 1e9 + 7;
typedef long long ll;


int main() {
    ll max_count;
    ll n,m,k;
    cin>>n>>m>>k;
    ll a[n];
    ll b[m];
    for(ll i=0;i<n;i++){
        cin>>a[i];
    }
    for(ll i=0;i<m;i++){
        cin>>b[i];
    }
    ll num=0;
    ll count=0;
    ll i=0;
    while(1){
        if(i>=n||num+a[i]>k){
            break;
        }
        num+=a[i];
        count++;
        i++;
    }
    i--;
    max_count=count;
    ll j=0;
    while(1){
        if(j>=m||num+b[j]>k){
            break;
        }
        num+=b[j];
        count++;
        j++;
        max_count=max(count,max_count);
    }
    for(ll kk=i;kk>=0;kk--){
        num=num-a[kk];
        count--;
        while(1){
            if(j>=m||num+b[j]>k){
                break;
            }
            num+=b[j];
            count++;
            j++;
            max_count=max(count,max_count);
        }
    }

    /*

    ll B_num=0;
    ll B_count=0;
    ll B_i=0;
    while(1){
        if(B_i>=m||B_num+b[B_i]>k){
            break;
        }
        B_num+=b[B_i];
        B_count++;
        B_i++;
    }
    B_i--;
    max_count=max(B_count,max_count);
    ll B_j=0;
    while(1){
        if(B_j>=n||num+a[B_j]>k){
            break;
        }
        B_num+=a[B_j];
        B_count++;
        B_j++;
        max_count=max(B_count,max_count);
    }
    for(ll kk=B_j;kk>=0;kk--){
        num=num-b[i];
        count--;
        while(1){
            if(j>=m||num+b[j]>k){
                break;
            }
            num+=b[j];
            count++;
            j++;
            max_count=max(count,max_count);
        }
    }
*/

    cout<<max_count;
    return 0;
}


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

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

if (str.at(2) == str.at(3) && str.at(4) == str.at(5))
{
  cout << "Yes" << endl;
}
else {
  cout << "No" << endl;
}
}


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

int main() {
  int n, m;
  cin >> n >> m;
  int input;
  int ans = 0;

  for (int i = 0; i < m; i++) {
    cin >> input;
    ans += input;
  };

  if (n-ans < 0){
    cout << -1 << endl;
    return 0;
  } else {
    cout << n-ans << endl;
    return 0;
  }
};

Measured memory_bytes: 3592
#include <iostream>
using namespace std;
int dp[100005][3];
int main(int argc, char** argv) {
	int n;
	cin >> n;
	for(int i=1;i<=n;i++)
	{
		int x,y,z;
		cin >> x >> y >> z;
		dp[i][0]=max(dp[i-1][1],dp[i-1][2])+x;
		dp[i][1]=max(dp[i-1][0],dp[i-1][2])+y;
		dp[i][2]=max(dp[i-1][1],dp[i-1][0])+z;
	}
	cout << max(dp[n][0],max(dp[n][1],dp[n][2]));
	return 0;
}

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

// https://atcoder.jp/contests/abc123/tasks/abc123_a

using namespace std;

int main() {
  int a[5], k;
  for (int i; i < 5; i++) {
    cin >> a[i];
  }
  cin >> k;

  int x = numeric_limits<int>::max();
  int y = 0;

  for (int i = 0; i < 5; i++) {
    x = min(a[i], x);
    y = max(a[i], y);
  }
  if (y - x > k) {
    cout << ":(" << endl;
  } else {
    cout << "Yay!" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>

int main()
{
    int mid, fin, re;
    int cnt = 0;
    while (std::cin >> mid >> fin >> re) {
        if (mid == -1 and fin == -1 and re == -1) {
            break;
        }
        if (mid == -1 or fin == -1) {
            std::cout << "F" << std::endl;
            continue;
        }
        int mf_sum = mid + fin;
        if (mf_sum >= 80) {
            std::cout << "A" << std::endl;
        } else if (mf_sum >= 65) {
            std::cout << "B" << std::endl;
        } else if (mf_sum >= 50) {
            std::cout << "C" << std::endl;
        } else if (mf_sum >= 30) {
            if (re >= 50) {
                std::cout << "C" << std::endl;
            } else {
                std::cout << "D" << std::endl;
            }
        } else {
            std::cout << "F" << std::endl;
        }
    }
    return 0;
}

Measured memory_bytes: 3084
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    uint N, L;
    cin >> N >> L;

    vector<string> S(N, string(L, 'a'));
    for (auto &x: S) cin >> x;

    sort(S.begin(), S.end());
    string T;
    for (auto &x: S) T = T + x;
    cout << T << endl;
}


Measured memory_bytes: 3676
import java.util.*;
import java.util.Map.Entry;
import java.lang.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main{

	Scanner sc;

	static final int INF=1<<28;
	static final double EPS=1e-9;

	class R{
		int r;
	}

	void run(){
		sc=new Scanner(System.in);
		String[] ss=sc.nextLine().split(" ");
		HashMap<String, R> map=new HashMap<String, R>();
		String ans2="";
		for(String s : ss){
			if(!map.containsKey(s))
				map.put(s, new R());
			map.get(s).r++;
			if(s.length()>ans2.length())
				ans2=s;
		}
		String ans="";
		int max=0;
		for(Entry<String, R> entry : map.entrySet()){
			if(entry.getValue().r>max){
				ans=entry.getKey();
				max=entry.getValue().r;
			}
		}
		println(ans+" "+ans2);
		sc.close();
	}

	void print(String s){
		System.out.print(s);
	}

	void println(String s){
		System.out.println(s);
	}

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

Measured memory_bytes: 11000
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	static final PrintStream out = System.out;
	static final Scanner sc = new Scanner(System.in);
	static final long Mod = 1000_000_007L;
	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
		System.exit(0);
	}

	void solve() {
		int N = nextInt();
		long K = nextLong();
		int[] A = nextIntArray(N);

		long bef = 0;
		long aft = 0;
		for(int i=0;i<N;i++) {
			for(int j = 0; j<N;j++) {
				if(A[i]>A[j]) {
					if (i < j) bef++;
					else aft++;
				}

			}
		}
		long b = K*(K+1)/2%Mod;
		long c = K*(K-1)/2%Mod;
		long ans = bef*b%Mod+aft*c%Mod;
		out.println(ans%Mod);
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)a[i] = nextInt();
		return a;
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String next() {
		return sc.next();
	}

}

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

void solve(long long N, std::vector<std::string> S){
    map<string, ll> mp;
    for (ll i = 0; i < N; i++)
    {
        mp[S[i]]++;
    }
    cout << mp.size() << endl;
    return;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<std::string> S(N);
    for(int i = 0 ; i < N ; i++){
        std::cin >> S[i];
    }
    solve(N, std::move(S));
    return 0;
}


Measured memory_bytes: 25100
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <cctype>

using namespace std;

map<string, vector<string> > grp;
map<string, bool> prn;
vector<string> split(string str)
{
  vector<string> vec;
  string s;

  for(int i = 0; i < str.size(); i++){
    s = "";
    while(i < str.size() && isalpha(str[i])) s += str[i++];

    if(s.size()) vec.push_back(s);
  }

  return vec;
}

int search(string tg)
{
  int ln = 0;
  vector<string> vec = grp[tg];
  prn[tg] = true;

  for(int i = 0; i < vec.size(); i++){
    if(!prn[vec[i]] && grp.find(vec[i]) != grp.end()) ln += search(vec[i]);
    else if(!prn[vec[i]]){
      ln++;
      prn[vec[i]] = true;
    }
  }

  return ln;
}

int main()
{
  int n;
  string str, tg;

  while(cin>>n && n){
    bool f = true;
    while(n--){
      cin >> str;
      vector<string> vec = split(str);
      str = vec[0];
      vec.erase(vec.begin());
      grp[str] = vec;

      if(f){
	tg = str;
	f = false;
      }
    }

    cout << search(tg) << endl;
    grp.clear();
    prn.clear();
  }

  return 0;
}

Measured memory_bytes: 0
$n = <>;chomp $n;

for my $i (0..$n-1) {
    my $input = <>;
    chomp $input;

    my ($t, $x, $y) = split / /, $input;

    my $sum = $x + $y;
    unless ($t >= $sum && $t % 2 == $sum % 2) {
        print "No";
        exit;
    }
}

print "Yes";


Measured memory_bytes: 384
def listup(number, n):

    if number > 10 ** 9:
        return
    else:
        number = 10 * number + n
        if "7" in str(number):
            if "5" in str(number):
                if "3" in str(number):
                    list753.append(number)
        listup(number, 3)
        listup(number, 5)
        listup(number, 7)

list753 = []
ans = 0
N = int(input())
listup(0, 0)
for i in range(len(list753)):
    if N - list753[i] >= 0:
        ans += 1

print(ans)

Measured memory_bytes: 6844
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long int n,c=0,c1=0;
  cin >> n;
  char a[n];
  for(int i=0;i<n;i++)
  {
    cin >> a[i];
  }
  for(int i=0;i<n;i++)
  {
    if(a[i] == 'R')
    {
      c++;
    }
  }
  for(int i=0;i<c;i++)
  {
    if(a[i] == 'W')
    {
      c1++;
    }
  }
  cout << c1 << endl;
  return 0;
}


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

using namespace std;

int *h;

int cost(int i, int j) {
	return abs(h[j] - h[i]);
}

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

	h = new int[n];
	int *DP = new int[n];
	for (int i = 0; i < n; i++) {
		cin >> h[i];
	}

	DP[0] = 0;

	int min;
	for (int i = 1; i < n; i++) {
		min = DP[i - 1] + cost(i - 1, i);
		for (int j = 2; j <= k && i - j >= 0; j++) {
			if (min > DP[i - j] + cost(i - j, i))
				min = DP[i - j] + cost(i - j, i);
		}
		DP[i] = min;
	}

	cout << DP[n - 1] << endl;

	delete[] DP;
	delete[] h;

	return 0;
}

Measured memory_bytes: 1024
S = input()
flag = 1

for i in range(0,len(S),2):
  if S[i] != 'R' and S[i] != 'U' and S[i] != 'D':
    flag = 0
    break
if flag == 1:
  for i in range(1,len(S),2):
    if S[i] != 'L' and S[i] != 'U' and S[i] != 'D':
      flag = 0
      break
if flag == 0:
  print('No')
else:
  print('Yes')
  

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define int long long
#define INF 1000000000000000000
using namespace std;

#define ANS(f) if(f) cout << "YES" << endl; else cout << "NO" << endl;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readi(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }
void debug(mat m){REP(i, m.size()){ REP(j, m[i].size()){ cout << m[i][j] << ","; } cout << endl; }}



signed main(){

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

    int a;
    if(d == 0) a = n;
    else a = 2 * (n - d);
    double ans = (double)a / (double)(n * n) * (double)(m - 1);
    cout << setprecision(15) << ans;
    
    return 0;
}

Measured memory_bytes: 256
#s=list('abcdefghijklmnopqrstuvwxyz')
k=int(input())

from functools import lru_cache

@lru_cache(maxsize=1000)
def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)

print(num2alpha(k).lower())


Measured memory_bytes: 9544
#include<iostream>
#include<string.h>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> pii;

int main()
{
  int i,j,k;
  int h,w;
  int dx[8]={0,1,0,-1,1,1,-1,-1};
  int dy[8]={1,0,-1,0,1,-1,1,-1};

  while(1){

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

    int sum=0;
    int c[55][55]={};

    for(i=1;i<=h;i++)for(j=1;j<=w;j++)cin>>c[i][j];

    while(1){

      queue<pii> q;
      rep(i,h+1)rep(j,w+1)
	if(c[i][j]==1)goto START;
      break;//????????????

    START :
      q.push(pii(i,j));//y,x
      sum++;
      
      while(q.size()){
	i=q.front().first;
	j=q.front().second;
	q.pop();
	c[i][j]=0;
	rep(k,8){
	  int y=i+dy[k];
	  int x=j+dx[k];
	  if(c[y][x]==1){
	    q.push(pii(y,x));
	    c[y][x]=0;
	  }
	}
      }

    }
    cout<<sum<<endl;

  }
}

Measured memory_bytes: 3088
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <utility>
#include <memory>
#include <functional>
#include <deque>
#include <cctype>
#include <ctime>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


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

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll;
typedef vector<vector<long long> > vvll;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#define GET_MACRO(_1, _2, _3, NAME, ...) NAME
#define _rep(i,n) _rep2((i),0,(n))
#define _rep2(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) GET_MACRO(__VA_ARGS__, _rep2, _rep)(__VA_ARGS__)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define fi first
#define se second
#define mkp make_pair
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	string s;
	cin>>s;
	if(s.substr(0,4) == "YAKI"){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
}


signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(20);
    mainmain();
}

Measured memory_bytes: 764
#include<iostream>
#include<vector>
#include<string>

using namespace std;

int main() {
	string s;
	cin >> s;
	int n = s.size();
	char bef = s[0];
	vector<int> v;
	for (int i = 1; i < n; i++) {
		if (bef != s[i]) {
			v.push_back(i - 1);
			bef = s[i];
		}
	}
	if(v.back() != n - 1)v.push_back(n - 1);

	int ans[100000] = {};
	int vp = 0;
	for (int i = 0; i < n; i++) {
		if (v[vp] < i)vp++;
		if (s[i] == 'R') {
			if ((v[vp] - i) % 2 == 0) {
				ans[v[vp]]++;
			}
			else {
				ans[v[vp] + 1]++;
			}
		}
		else {
			if ((i - v[vp - 1]) % 2 == 0) {
				ans[v[vp - 1]]++;
			}
			else {
				ans[v[vp - 1] + 1]++;		
			}
		}
	}
	for (int i = 0; i < n; i++)cout << ans[i] << " ";
	cout << endl;
	return 0;
}

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

using namespace std;

bool is_prime[100010];
int cum[100010];

int main() {
  fill(is_prime, is_prime + 100010, true);
  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i <= 100000; i++) {
    if (!is_prime[i]) continue;
    if (is_prime[(i + 1) / 2]) cum[i] = 1;
    for (int j = 2 * i; j <= 100000; j += i) {
      is_prime[j] = false;
    }
  }
  for (int i = 1; i <= 100000; i++) {
    cum[i] += cum[i - 1];
  }

  int Q;
  cin >> Q;

  for (int i = 0; i < Q; i++) {
    int l, r;
    cin >> l >> r;
    cout << cum[r] - cum[l - 1] << endl;
  }

  return 0;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(), (c).end());
const long long MOD = 1e9 + 7;
typedef long long ll;

int main(){
	int X, Y;
	cin >> X >> Y;
	cout << X + Y / 2 << endl;
}

Measured memory_bytes: 256
#include <iostream>
//#include <conio.h>
using namespace std;

int main() {
	//scc何組か
	unsigned long s; unsigned long c; unsigned long ans;
	cin >> s >> c;
	if (s * 2 >= c) cout << c / 2 << endl;
	else {
		ans = s;
		c -= s * 2;
		while (c / 4 != 0) {
			ans++;
			c -= 4;
		}
		cout << ans << endl;
	}
	//_getch();
}



Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,m,s=0,c=0,i;
	cin>>n>>m;
	long long a[n+1];
	for(i=0;i<n;i++)
	{
    cin>>a[i];
    s=s+a[i];
	}
	double x;
	x=s*(1.00/(4*m));
	for(i=0;i<n;i++)
	{
		if(a[i]>=x)
		{
    c++;
		}
	}
	if(c>=m)
	{
		cout<<"Yes"<<endl;
	}else
	{
		cout<<"No"<<endl;
	}
	return 0;

	 
}


Measured memory_bytes: 256
#include <stdio.h>
#define N 100
void swap(int *x, int *y) {
	int tmp;
	tmp = *x;
	*x = *y;
	*y = tmp;
}
int BubbleSort(int array[], int n) {
	int i, j, count;

	count = 0;
	for (i = 0; i < n; i++) {
		for (j = n - 1; j > i; j--) {
			if (array[j - 1] > array[j]) {
				swap(&array[j - 1], &array[j]);
				count++;
			}
		}
	}
	return count;
}
int main() {

	int n,k, array[N];
	scanf("%d", &n);
	for (k = 0; k < n; k++)
		scanf("%d", &array[k]);

	int count = BubbleSort(array, n);

	int i;
	for (i = 0; i < n; i++) {
		if (i != 0) 
			printf(" ");
		printf("%d", array[i]); 
	}
	printf("\n%d\n", count);
	return 0;
}

Measured memory_bytes: 604
def bellmanFord(edges):
    dist = [float('inf')] * N
    dist[0] = 0
    for _ in range(N-1):
        for u, v, w in edges:
            if dist[u] + w < dist[v]:
                dist[v] = dist[u] + w
    res = -dist[-1]
    neg = [False] * N
    for _ in range(N):
        for u, v, w in edges:
            if dist[u] + w < dist[v]:
                dist[v] = dist[u] + w
                neg[v] = True
            if neg[u]:
                neg[v] = True
    if neg[-1]:
        res = 'inf'
    return res

N, M = map(int, input().split())
A = [tuple()] * M
for i in range(M):
    a, b, c = map(int, input().split())
    A[i] = (a-1, b-1, -c)
ans = bellmanFord(A)
print(ans)

Measured memory_bytes: 3388
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <limits.h>
using namespace std;

int main(){
  int A, B , ans=0 ;
  cin >> A >> B ;
  while(A>0){
    ans++ ;
    A /= B ;
  }  
  cout << ans << endl ;
  return 0 ;
}

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

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

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

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

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


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

void Solve() {
	int n, m,k;
	cin >> n >> m >> k;

	for (size_t i = 0; i <= n; i++)
	{
		int sum = m * i;
		for (size_t j = 0; j <= m; j++)
		{
			int over = 2 * (i * j);
			if (sum + (j * n) - over  == k) {
				cout << "Yes" << endl;
				return;
			}
		}
	}
	cout << "No" << endl;
} 


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



Measured memory_bytes: 6016
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <bitset>

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define INF 2000000000
#define rep(i,n) for(int i=0;i<(n);i++)
typedef pair<int, int> P;
const ll MOD=1000000007;
using Graph = vector<vector<int>>;

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


ull gcd(ull a, ull b) {
    while (a % b != 0) {
        ull tmp = b;
        b = a % b;
        a = tmp;
    }
    return b;
}

ull lcm(ull a, ull b) {
    if (a == b) return b;
    ull g = gcd(a, b);
    return (a / g) * b;
}

int up(int a, int b) {
    return (a + a % b) / b;
}

int main() {
    double n, m;
    cin >> n >> m;
    vector<double> a(n);
    int sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i];
    }
    sort(a.rbegin(), a.rend());
    if (a[m - 1] < sum/(4*m)) {
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
(defparameter abcde
  (loop repeat 5
        collect (read)))

(defun f (abcde)
  (+ (* 10 (1- (loop for i in abcde
                     sum (ceiling i 10))))
     (let ((min-mod10 (remove 0 (mapcar (lambda (i) (mod i 10))
                               abcde))))
       (if min-mod10
           (reduce #'min min-mod10)
           10))))

(princ (f abcde))


Measured memory_bytes: 15976