akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<n;i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/

ll h_pow(ll x,ll n){
    ll ret=1;
    while(n>0){
        if(n&1) ret = ret * x;
        x = x * x;
        n>>=1;
    }
    return ret;
}

ll N;
vector<ll> A;

int main(){
    cin >> N;
    A.resize(N);
    rep(i,N){
        cin >> A[i];
    }

    ll cnt1 = 0;
    rep(i,N){
        if(A[i]%2==1) cnt1++;
    }
    ll cnt2 = N - cnt1;

    ll t = h_pow(3,N);
    ll t2 = h_pow(2,cnt2);
    cout << t -t2 << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;

int main(){
  string s; cin >> s;
  string t;
  for(int i = 0; i < s.size(); i++){
    if(s[i] == '0') t += '0';
    else if(s[i] == '1') t += '1';
    else if(s[i] == 'B'){
      if(t.size() != 0) t.pop_back(); 
    }
  }
  cout << t << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    ll a,b,c;
    cin>>a>>b>>c;
    cout<<min((a+b),min((a+c),(b+c)))<<endl;
    return 0;
}


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

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);i--)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll) 1e9 + 7;
//constexpr long long MOD = 998244353LL;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}
void solve(){
    ll n;
    cin>>n;
    set<string> s;
    REP(i,n){
        string t;
        cin>>t;
        s.insert(t);
    }
    cout<<s.size()<<en;
}

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

    solve();
    //ll t;cin>>t;REP(i,t) solve();

    return 0;
}

Measured memory_bytes: 19216
#include <iostream>
#include <cstdio>

int main (){
	int a,b,c;
	scanf("%d%d%d",&a,&b,&c);
	if (b-a==c-b)
		std::cout <<"YES"<<std::endl;
	else std::cout <<"NO"<<std::endl;
	return 0 ;
}

Measured memory_bytes: 256
N, Ma, Mb = map(int, input().split())
a = [0] * N
b = [0] * N
c = [0] * N
for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())

INF = 10 ** 5
nums = 401

dp = [[[INF for _ in range(nums)] for _ in range(nums)] for _ in range(N+1)]

dp[0][0][0] = 0

for i in range(N):
    for sum_a in range(nums):
        for sum_b in range(nums):
            if dp[i][sum_a][sum_b] == INF:
                continue
            dp[i+1][sum_a][sum_b] = min(dp[i+1][sum_a][sum_b], dp[i][sum_a][sum_b])
            dp[i+1][sum_a+a[i]][sum_b+b[i]] = min(dp[i+1][sum_a+a[i]][sum_b+b[i]], dp[i][sum_a][sum_b] + c[i])
            # print(i, dp[i][sum_a][sum_b], sum_a, sum_b)


res = INF
for i in range(1, nums):
    for j in range(1, nums):
        if i * Mb == j * Ma:
            res = min(res, dp[N][i][j])

if res == INF:
    res = -1

print(res)


Measured memory_bytes: 59984
N, K = map(int, input().split())
P = list(map(int, input().split()))

B = [0]
for i in range(N):
    B.append(B[i] + P[i])

total = 0
start = 0
for i in range(K, N+1):
    if total < B[i] - B[i-K]:
        total = max(total, B[i] - B[i-K])
        start = i-K

table = [0]*1001
for i in range(1, 1001):
    for j in range(1, i+1):
        table[i] += j * (1 / i)

ans = 0
for i in range(start, start+K):
    ans += table[P[i]]

print(ans)



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

int main (){
    string S;
    cin >> S;
    int ans = 0;
    for(int i = 0; i < S.size(); i++) {
        char temp = S[i];
        ans += temp - '0';
    }

    if(ans%9) {
    cout << "No" << endl;
    } else {
    cout << "Yes" << endl;
    }

    
}

Measured memory_bytes: 3708
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int A = 0;//1円
            int N = 0;//払う
            int s =0;
            N =int.Parse(Console.ReadLine());
            A = int.Parse(Console.ReadLine());

            while (N-500*s>0) {
                s++;
            }

            if (N%500==0) {
                Console.WriteLine("Yes");
            }
                else if (N - A - 500 * (s - 1) <= 0) {

                Console.WriteLine("Yes");

                }
                else
                {
               
                Console.WriteLine("No");

                }
           


        }
    }
}


Measured memory_bytes: 13140
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
typedef long long ll;
vector<int>G[100010];
int d[100010];
int ans=0;
struct node{
	int a;int k;int num;
};
bool vis[100010][4];
queue<node>q;
int main(){
	 std::ios::sync_with_stdio(false);std::cin.tie(0);
	int n,m;
	cin>>n>>m;
	for(int i=0,u,v;i<m;i++){
		cin>>u>>v;
		G[u].push_back(v);
	}
	int s,t;
	cin>>s>>t;
	node fir;
	fir.a=s;
	fir.k=0;
	fir.num=0;
	q.push(fir);
	vis[s][0]=1;
	while(!q.empty()){
		node temp=q.front();
		q.pop();
		if(temp.a==t&&temp.num==0){
		  cout<<temp.k<<'\n';
			return 0;
		}
		int b=temp.a;
		for(int i=0;i<G[b].size();i++){
		//	if(d[G[b][i]]<temp.num) break;
			if(vis[G[b][i]][temp.num+1]);
			else {
				node f1;
				f1.a=G[b][i];
				   vis[G[b][i]][temp.num+1]=1;
		   if(temp.num==2){
				f1.k=temp.k+1;
				f1.num=0;
				q.push(f1);
				}
				else{
				 f1.k=temp.k;
				 f1.num=temp.num+1;
			  };
				q.push(f1);
			}
		}
	}
	cout<<-1<<'\n';
}


Measured memory_bytes: 6144
#include <bits/stdc++.h>
#define pb push_back
#define pi pair<int, int>
#define l first
#define r second
#define all(x) x.begin(), x.end()
#define fori(a, b, step) for (int i = a; i < b; i += step)
#define forj(a, b, step) for (int j = a; j < b; j += step)
#define int long long

const int maxn = 5e5 + 1, mod = 1e9 + 7;

using namespace std;

signed main() {
    int n, a, b;
    cin >> n >> a >> b;
    if ((a + b) % 2 == 0) {
        cout << abs(b - a) / 2;
        return 0;
    }
    if (a > b) swap(a, b);
    int c = a, d = b;
    b -= a;
    int ans = a + (b - 1) / 2;
    c += (n - d);
    ans = min(ans, (n - d) + 1 + (n - c) / 2);
    cout << ans;
    return 0;
}


Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <string.h>

int main()
{
  int array[6];
  int count = 0;
  for (int i =0;i<5;i++)
  {
    scanf("%d\n",&array[i]);
  }
  scanf("%d",&array[5]);

 for (int j=0;j<5;j++)
{
  for (int i=j+1;i<5;i++)
   {
     if (abs(array[j]-array[i])<=array[5])
        count++;

   }
}
  if (count==10)printf("Yay!");
  else printf(":(");




}



Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#define all(a) a.begin(),a.end()
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> a(2 * n);
	for (int i = 0; i < 2 * n; i++) cin >> a[i];
	sort(all(a));
	int l = 0;
	for (int i = 2 * n - 1; i > l; i--) {
		while (a[i] + a[l] < m && l < i - 1) l++;
		if (a[i] + a[l] >= m) {
			a[i] -= m; l++;
		}
	}
	sort(all(a));
	int ans = 0;
	for (int i = 0; i < n; i++) ans = max(ans, a[i] + a[2 * n - 1 - i]);
	cout << ans << endl;
}

Measured memory_bytes: 4032
#include <iostream>
#include <cstdio>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cmath>
#include <complex>
#include <map>
#include <climits>
#include <sstream>
using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

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

//v.erase(unique(v.begin(),v.end()),v.end());


int main(){
	int a[4]={6000,4000,3000,2000};
	rep(i,4){
		int c,b;
		cin>>c>>b;
		cout<<a[c-1]*b<<endl;
	}
}

Measured memory_bytes: 1164
N, M = map(int, input().split())
data = [list(map(int, input().split())) for _ in range(M)]

class Unionfind:
    def __init__(self, num):
        self.par = [i for i in range(num+1)]
        self.rank = [0] * (num+1)

    def root(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.root(self.par[x])
            return self.par[x]

    def unite(self, u, v):
        ru = self.root(u)
        rv = self.root(v)
        if self.rank[ru] < self.rank[rv]:
            self.par[ru] = rv
        else:
            self.par[rv] = ru
            if self.rank[ru] == self.rank[rv]:
                self.rank[ru] += 1

    def same(self, u, v):
        return self.root(u) == self.root(v)

ans = 0

for i in range(M):
    uni = Unionfind(N)
    for j in range(M):
        if i != j:
            uni.unite(data[j][0], data[j][1])
        else:
            check = j
    if not uni.same(data[check][0], data[check][1]):
        ans += 1

print(ans)



Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

import static java.lang.Integer.parseInt;

/**
 * Miscalculation
 */
public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;
		String[] words;

		String exp = br.readLine();
		int ans = parseInt(br.readLine());

		int M, L;
		M = M(exp);
		L = L(exp);
		if (ans == M && ans == L) {
			System.out.println('U');
		} else if (ans == M) {
			System.out.println('M');
		} else if (ans == L) {
			System.out.println('L');
		} else {
			System.out.println('I');
		}
	}

	static int M(String exp) {
		char[] pri = new char[127];
		for (int i = '0'; i <= '9'; i++) pri[i] = 3;
		pri['*'] = 2;
		pri['+'] = 1;
		pri[0] = 0;
		return calc(exp, pri);
	}

	static int L(String exp) {
		char[] pri = new char[127];
		for (int i = '0'; i <= '9'; i++) pri[i] = 3;
		pri['*'] = 1;
		pri['+'] = 1;
		pri[0] = 0;
		return calc(exp, pri);
	}

	static int calc(String exp, char[] pri) {
		Deque<Character> stack = new ArrayDeque<>();
		Deque<Character> queue = new ArrayDeque<>();

		stack.push('\0');
		for (char c : exp.toCharArray()) {
			if (pri[c] > pri[stack.peek()]) {
				stack.push(c);
			} else {
				while (pri[c] <= pri[stack.peek()]) {
					queue.offer(stack.pop());
				}
				stack.push(c);
			}
		}
		while (stack.peek() != '\0') queue.offer(stack.pop());

		//
		String rpn = "";
		Deque<Integer> ans = new ArrayDeque<>();

		for (char c : queue) rpn += String.valueOf(c);
		for (char c : rpn.toCharArray()) {
			int a, b;
			switch (c) {
				case '*':
					b = ans.pop();
					a = ans.pop();
					ans.push(a * b);
					break;
				case '+':
					b = ans.pop();
					a = ans.pop();
					ans.push(a + b);
					break;
				default:
					ans.push(c - '0');
					break;
			}
		}
		return ans.peek();
	}
}

Measured memory_bytes: 24540
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())
l=[]
for i in range(n):
  x,y,h=nii()
  l.append([x,y,h])
  if h!=0:
    ini_x=x
    ini_y=y
    ini_h=h

for tx in range(101):
  for ty in range(101):
    n_h=abs(tx-ini_x)+abs(ty-ini_y)+ini_h
    for x,y,h in l:
      t_h=max(n_h-(abs(tx-x)+abs(ty-y)),0)
      if h!=t_h:
        break
    else:
      print(tx,ty,n_h)
      exit()

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

#define rep(i, a, b) for (ll i = (a); i < (b); i++)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

signed main() {
    ll N,M;
    cin>>N>>M;
    if(N>M)
        N=M;
    vector<ll> X(M);
    rep(i,0,M){
        cin>>X[i];
    }
    sort(begin(X),end(X));
    vector<ll> diff(M-1);
    rep(i,0,M-1){
        diff[i] = X[i+1]-X[i];
    }
    sort(begin(diff),end(diff));
    ll ans=0;
    rep(i,0,M-1-(N-1)){
        ans+=diff[i];
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#include<cmath>
#define pb push_back
#define ld long double
#define mp make_pair
#define vl vector<ll> 
#define vd vector<double>
#define vld vector<long double>
#define ll long long int
#define pl pair<ll, ll>
#define all(a) a.begin(), a.end()
#define forr(i, n) for(ll i=0; i<n; i++) 
#define forr1(i, n) for(ll i=1; i<=n; i++)
using namespace std;
const ld PI =3.1415926535897923846;
const ll MOD = 1e9+7;
const ll N=998244353;
void solve()
{
    ll n;
    cin>>n;
    vl a(n);
    map<ll, ll> mp1;
    ll prod=0;
    forr(i, n)
    {
        cin>>a[i];
        mp1[a[i]]++;
    }
    map<ll, ll>:: iterator itr;
    for(itr=mp1.begin(); itr!=mp1.end(); itr++)
    {
        ll x=itr->second;
        prod+=x*(x-1)/2;
    }
    for(ll i=0; i<n; i++)
    {
        ll num=mp1[a[i]];
        ll prod2=prod;
        prod2-=(num*(num-1))/2;
        num--;
        prod2+=(num*(num-1))/2;
        cout<<prod2<<endl;
    }
}
int main()
{
    ll test=1;
    //cin>>test;
    while(test--)
        solve();
}

Measured memory_bytes: 12800
#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, a, b;
  string s;
  int _a, _b;
  _a = _b = 0;
  cin >> n >> a >> b >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'c') {
      cout << "No" << endl;
    } else if (s[i] == 'a') {
      if (_a + _b < a + b) {
        cout << "Yes" << endl;
        _a++;
      } else {
        cout << "No" << endl;
      }
    } else {
      if (_a + _b < a + b && _b < b) {
        cout << "Yes" << endl;
        _b++;
      } else {
        cout << "No" << endl;
      }
    }
  }
}


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

result = 0
for i in range(1, N+1):
    if i % 2 == 0:
        continue
    k = 0
    for j in range(1, i+1):
        if i % j == 0:
            k += 1
    if k == 8:
        result += 1

print(result)


Measured memory_bytes: 2940
read A
read B
read C
read X
{
N=0
for AI in `seq 0 $A`
do
        if [[ $X -ge $((500*$AI)) ]]; then
                AM=$(( $X-(500*$AI) ))
                for BI in `seq 0 $B`
                do
                        if [[ $AM -ge $((100*$BI)) ]]; then
                                BM=$(( $AM-(100*$BI) ))
                                for CI in `seq 0 $C`
                                do
                                        if [[ $(($BM-50*$CI)) = 0 ]]; then
                                                N=$((++N))
                                        fi
                                done
                        fi
                done
        fi
done
echo $N
}

Measured memory_bytes: 1616
S=input()
ans=0
ans2=0
for i in range(len(S)):
  if S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C':
    ans+=1
  else:
    if ans2<ans:
      ans2=ans
    ans=0
if ans<ans2:
  print(ans2)
else:
  print(ans)

Measured memory_bytes: 3060
#pragma warning(disable:4786)
#pragma warning(disable:4996)
#include<list>
#include<bitset>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<functional>
#include<string>
#include<cstring>
#include<cstdlib>
#include<queue>
#include<utility>
#include<fstream>
#include<sstream>
#include<cmath>
#include<stack>
#include<assert.h>
using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))
#define CLR(a) memset(a, 0, sizeof(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(X) ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X) ( (X) * (X) )
#define SZ(V) (int )V.size()
#define FORN(i, n) for(i = 0; i < n; i++)
#define FORAB(i, a, b) for(i = a; i <= b; i++)
#define ALL(V) V.begin(), V.end()
#define IN(A, B, C)  ((B) <= (A) && (A) <= (C))

typedef pair<int,int> PII;
typedef pair<double, double> PDD;
typedef vector<int> VI;
typedef vector<PII > VP;

#define AIN(A, B, C) assert(IN(A, B, C))

//typedef int LL;
typedef long long int LL;
//typedef __int64 LL;

VI V[100005];
int dp[100005];
int n;

int DP(int at) {
	if (V[at].size() == 0) {
		return dp[at] = 0;
	}
	VI X;
	for (int i : V[at]) {
		int x = DP(i);
		X.push_back(x);
	}

	sort(ALL(X));
	int ans = 0;
	for (int i = 0; i < X.size(); i++) {
		ans = MAX(ans, X[i] + X.size() - i);
	}
	return dp[at] = ans;

}

int main()
{
	scanf("%d", &n);
	for (int i = 2; i <= n; i++) {
		int a;
		scanf("%d", &a);
		V[a].push_back(i);
	}

	printf("%d\n", DP(1));
	return 0;
}


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

using namespace std;

#define ll long long

int main() {
	/* 入力の受け取り */
	int N;
	cin >> N;
	vector<ll> A(N);
	for (int i = 0; i < N; i++) cin >> A[i];

	/* 操作の回数を求める */
	ll remove = (ll)N * (N + 1) / 2; // 1回の操作で取り除く石の個数
	ll sum = accumulate(A.begin(), A.end(), 0LL); // 最初にある石の総個数
	if (sum % remove != 0) {
		cout << "NO" << endl;
		return 0;
	}
	ll rep = sum / remove; // 操作の回数

	/* 判定 */
	for (int i = 0; i < N; i++) {
		if (A[i] < rep) {
			cout << "NO" << endl;
			return 0;
		}
		A[i] %= N;
		ll sub = (ll)i * rep % N;
		A[i] = (A[i] - sub + N) % N;
	}
	bool f = true;
	for (int i = 0; i < N - 1; i++) f = f && (A[i] == A[i + 1]);
	cout << (f ? "YES" : "NO") << endl;

	return 0;
}

Measured memory_bytes: 1024
a, b, c = map(int, input().split())
fiveCount = 0
sevenCount = 0
if a == 5: fiveCount+= 1
if b == 5: fiveCount+= 1
if c == 5: fiveCount+= 1
if a == 7: sevenCount+= 1
if b == 7: sevenCount+= 1
if c == 7: sevenCount+= 1

if fiveCount == 2 and sevenCount == 1:
    print("YES")
else:
    print("NO")

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

int main(){
  int n; cin>>n;
  int i,j,k;
  int a[2][n];
  for(i=0;i<2;i++){
    for(j=0;j<n;j++){
      cin >> a[i][j];
    }
  }

int ame[101]={};
for(k=0;k<n;k++){
  for(i=0;i<k+1;i++) ame[k]+=a[0][i];
  for(i=k;i<n;i++) ame[k]+=a[1][i];
}
//cout<<ame[0]<<endl;
int ans=0;
if(n==1) ans =ame[0];
else {sort(ame,ame+n); ans=ame[n-1]; }
//cout << ame[6] <<endl;
cout << ans<<endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <string>
using namespace std;
set<char> s[4];
string st,ans;
string alp = "abcdefghijklmnopqrstuvwxyz";
string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int dx[4] = {-1,1,0,0};
int dy[4] = {0,0,1,-1};
int main(){
	int x = 0,y = 0,i,j,n;
	cin >> n >> st;
	for(i=0;i<13;i++){
		s[0].insert(alp[i]);
		s[2].insert(ALP[i]);
	}
	for(i=13;i<26;i++){
		s[1].insert(alp[i]);
		s[3].insert(ALP[i]);
	}
	for(i=0;i<n;i++){
		for(j=0;j<4;j++){
			if(s[j].count(st[i])){
				x += dx[j];
				y += dy[j];
			}
		}
	}
	if(x>0){
		for(i=0;i<x;i++) ans.push_back('z');
	}else{
		for(i=0;i<-x;i++) ans.push_back('a');
	}
	if(y>0){
		for(i=0;i<y;i++) ans.push_back('A');
	}else{
		for(i=0;i<-y;i++) ans.push_back('Z');
	}
	cout << ans.size() << endl;
	cout << ans << endl;
}


Measured memory_bytes: 3308
#156d
n,a,b = map(int, input().split())

##############################################
#https://tane-no-blog.com/976/
mod = pow(10, 9) + 7
 
def comb(N, x):
    #n*(n-1)*…*(n-1+1)を計算
    numerator = 1
    for i in range(N-x+1, N+1):
        numerator = numerator * i % mod
    
    #a!を計算 
    denominator = 1
    for j in range(1, x+1):
        denominator = denominator * j % mod
        
    #最後の項 a!**((10**9+7)-2)を計算
    d = pow(denominator, mod-2, mod)
    
    return numerator * d

################################

comb_all = pow(2,n,mod) - 1 #(2**n) - 1
comb_a = comb(n,a)
comb_b = comb(n,b)

#print(comb_all,comb_a,comb_b)
print((comb_all-comb_a-comb_b)%mod)

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;

public class Hello
{
    private const int MOD_N = 1000000000 + 7;

    public static void Main()
    {
        var list = Console.ReadLine().Split(' ');
        var n = int.Parse(list[0]);
        var a = int.Parse(list[1]);
        var b = int.Parse(list[2]);

        Console.WriteLine(Math.Min(n * a, b));
    }

    private static int GCD(int a, int b) => a > b ? GCD_impl(a, b) : GCD_impl(b, a);
    private static int GCD_impl(int a, int b) => b == 0 ? a : GCD_impl(b, a % b);
    private static long LCM(int a, int b) => (long)a * b / GCD(a, b);

    private static int Comb(int m, int n)
    {
        var t = m - n;
        if (n > t)
            n = t;

        long numerator = 1;
        for (int i = 0; i < n; ++i)
        {
            numerator *= m - i;
            numerator %= MOD_N;
        }
        long denominator = 1;
        for (; n != 0; --n)
        {
            denominator *= n;
            denominator %= MOD_N;
        }

        var inv_denominator = ModInv((int)denominator, MOD_N);
        var ret = (int)(numerator * inv_denominator % MOD_N);

        return ret >= 0 ? ret : ret + MOD_N;
    }

    private static int ModInv(int a, int m)
    {
        int b = m, x = 1, y = 0;
        while (b != 0)
        {
            var t = a / b;
            a -= t * b;
            Swap(ref a, ref b);
            x -= t * y;
            Swap(ref x, ref y);
        }
        x %= m;
        return x >= 0 ? x : x + m;
    }

    private static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define pb push_back
#define M 1000000007
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
const int N = 1e5 + 1;
int main(){	
	int x;
	cin >> x;
	cout << !x << endl;
	
}	

Measured memory_bytes: 3624
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<iomanip>
using namespace std;

int main(){
    int n;
    cin>>n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=1;i<n;i++){
        if(a[i-1]>a[i]){
            cout<<"No"<<endl;
            return 0;
        }else{
            if(a[i]!=a[i-1]){
                a[i]--;
            }
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}

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

int n, S;
int t[20002];

int main(){
  while(scanf("%d%d", &n, &S) != EOF, n || S){
    for(int i = 0; i < n; i++){
      scanf("%d", &t[i]);
    }
    sort(t, t + n);

    int ans = 0;

    for(int i = 0; i < n; i++){
      ans += n - (int)(upper_bound(t + i + 1, t + n, S - t[i]) - t);
    }

    printf("%d\n", ans);
  }
}

Measured memory_bytes: 0
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<cstring>
#include<math.h>
#include<bitset>
#include<queue>
#include<set>
#include<iomanip>
#include<math.h>
#include<assert.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long INF = 1LL << 40;
const double INFD = 1e100;
const ll mod = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
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;
}
// ----------------------------------------------------------------------------

int main(){
  ll N,K;
  cin >> N >> K;
  vector<vector<ll>> s(N);
  for(int i=0; i<N; i++){
    ll t,d;
    cin >> t >> d;
    t--;
    s[t].push_back(d);
  }
  for(auto &v: s){
    sort(v.begin(),v.end(),greater<ll>());
    if(v.empty()) v.push_back(-INF);
  }
  sort(s.begin(),s.end(),[&](vector<ll> a,vector<ll> b){
    return a[0] > b[0];
  });
  ll cur=0;
  priority_queue<ll> que;
  for(int i=0; i<K; i++){
    cur += s[i][0];
    for(int j=1; j<s[i].size(); j++){
      que.push(s[i][j]);
    }
  }
  for(int i=K; i<N; i++){
    for(int j=0; j<s[i].size(); j++){
      que.push(s[i][j]);
    }
  }
  ll res = cur + K*K;
  for(ll x=K-1; x>=1; x--){
    ll v = s[x][0];
    ll w = que.top();
    if(v < w){
      que.pop();
      cur += w;
      que.push(v);
      cur -= v;
    }
    res = max(res, cur + x*x);
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 8696
#include <iostream>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <cmath>
#define INF 100000000000
#define MOD 1000000007
#define ll long long int
//#define int long long int
using namespace std;


int main(){
    ll N,Q,K; cin>>N>>K>>Q;

    vector <ll> cnt(N+10,0);

    for(int i=0;i<Q;i++){
        int a; cin>>a;
        cnt[a]++;
    }

    vector <ll> point(N+10,0);

    for(int i=1;i<=N;i++){
        point[i] = K-(Q-cnt[i]);
    }


    for(int i=1;i<=N;i++){
        if(point[i] >0) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }




    return 0 ;
}

Measured memory_bytes: 2176
N, Q = map(int, input().split())
S=input()
A=[]
AC=[0]*100001
count=0
total=0
for i in range (Q):
    A.append(list(map(int, input().split())))

for i in range(1,N):
    if S[i]=='C' and S[i-1]=='A':
        count +=1
    AC[i]=count

for i in range(Q):
    total+=AC[int(A[i][1])-1]-AC[int(A[i][0])-1]
    print(total)
    total=0

Measured memory_bytes: 30660
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main{
	public static void main(String[] args){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int a=0,b=0;

		try {
			String str = br.readLine();

			a = Integer.parseInt(str.substring(0, str.indexOf(" ")));
			b = Integer.parseInt(str.substring(str.indexOf(" ")+1, str.length()));

		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		} catch (NumberFormatException e) {
			e.printStackTrace();
		}

		System.out.print((int)a/b + " " + a%b + " ");
		System.out.printf("%.5f\n",(double)a/b);
	}
}

Measured memory_bytes: 16924
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
typedef vector<int> vi;
typedef vector<ll> vl;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define IN cin >> 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (m-1); i >= (int)(n); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.end(), v.begin());
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - a) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}

//ll ncr[100][100];
//ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

//ll npr[100][100]={};
//ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

//ll nHr(int n,int r){ret nCr(n+r-1,r);}

///////////////////////////////////////////////////////////////////////////


int main(){
    int n,x;
    IN n >> x;
    int m[200] = {};
    inrep(n,m);
    sort(m,m+n);
    rep(i,0,n)x -= m[i];

    P(n + x/m[0]);
	return  0;
}

Measured memory_bytes: 256
S = list(input())
acgt = ['A', 'C', 'G', 'T']
ans = 0
for i in range(len(S)+1):
    for j in range(i):
        A = S[j:i]
        T = 1
        for a in A:
            if a not in acgt:
                T = 0
                break
        if T == 1:
            ans = max(ans,len(A))
print(ans)

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

using namespace std;

typedef long long int ll;

const ll mod = 1e9 + 7;
const ll MAXN = 5e5 + 5;

vector < vector < ll > > t(4 * MAXN, vector < ll > (26, 0));
ll n;
string s;

void build(ll v, ll tl, ll tr){
  if(tl == tr){
    t[v][s[tl] - 'a']++;
  }else{
    ll tm = (tr - tl) / 2 + tl;
    build(2 * v, tl, tm);
    build(2 * v + 1, tm + 1, tr);
    for(int i = 0; i < 26; i++) t[v][i] = t[2 * v][i] + t[2 * v + 1][i];
  }
}

void update(ll v, ll tl, ll tr, ll pos, char ch){
  if(tl == tr){
    t[v][s[tl] - 'a']--;
    t[v][ch - 'a']++;
  }else{
    ll tm = (tr - tl) / 2 + tl;
    if(pos <= tm) update(2 * v, tl, tm, pos, ch);
    else update(2 * v + 1, tm + 1, tr, pos, ch);
    for(int i = 0; i < 26; i++) t[v][i] = t[2 * v][i] + t[2 * v + 1][i];
  }
}

vector < ll > query(ll v, ll tl, ll tr, ll l, ll r){
  if(l > r){
    vector < ll > tmp(26, 0);
    return tmp;
  }
  if(tl == l && tr == r){
    return t[v];
  }else{
    ll tm = (tr - tl) / 2 + tl;
    vector < ll > a = query(2 * v, tl, tm, l, min(r, tm));
    vector < ll > b = query(2 * v + 1, tm + 1, tr, max(l, tm + 1), r);
    for(int i = 0; i < 26; i++) a[i] += b[i];
    return a;
  }
}

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

  cin >> n;
  cin >> s;

  build(1, 0, n - 1);

  ll q;
  cin >> q;
  while(q--){
    int a;
    cin >> a;
    if(a == 1){
      ll pos;
      cin >> pos;
      char ch;
      cin >> ch;
      update(1, 0, n - 1, pos - 1, ch);
      s[pos - 1] = ch;
    }else{
      ll l, r;
      cin >> l >> r;
      vector < ll > ans = query(1, 0, n - 1, l - 1, r - 1);
      ll cnt = 0;
      for(int i = 0; i < 26; i++){
        if(ans[i]) cnt++;
      }
      cout << cnt << '\n';
    }
  }
}


Measured memory_bytes: 485524
#include<bits/stdc++.h>
using namespace std;
#define loop(i,x,z) for (int i=x;i<z;i++)
using ll = long long;
ll n, A[82], ans = 1000, stock = 0, rem = 0;
int main()
{
	cin >> n;
	loop(i, 0, n)cin >> A[i];
	loop(i, 0, n-1)
	{
		if(A[i+1]>A[i])
		{
			stock = ans / A[i];
			rem = ans % A[i];
			ans = 0;
			ans = stock * A[i + 1] + rem;
			rem = stock = 0;
		}
	}
	cout << ans;
}

Measured memory_bytes: 3624
package main

import (
	"bufio"
	"container/heap"
	"fmt"
	"os"
	"strconv"
)

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	n := getNextInt(scanner)
	q := getNextInt(scanner)
	aa := make([]*intheap, n)
	for i := 0; i < n; i++ {
		aa[i] = &intheap{}
		heap.Init(aa[i])
	}
	for i := 0; i < q; i++ {
		s := getNextInt(scanner)
		switch s {
		case 0:
			t := getNextInt(scanner)
			x := getNextInt(scanner)
			heap.Push(aa[t], x)
		case 1:
			t := getNextInt(scanner)
			if aa[t].Len() == 0 {
				continue
			}
			fmt.Fprintln(writer, (*aa[t])[0])
		case 2:
			t := getNextInt(scanner)
			if aa[t].Len() == 0 {
				continue
			}
			heap.Pop(aa[t])
		}
	}
}

type intheap []int

func (h intheap) Len() int { return len(h) }
func (h intheap) Less(i, j int) bool {
	return h[i] > h[j]
}
func (h intheap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
func (h *intheap) Push(x interface{}) {
	*h = append(*h, x.(int))
}
func (h *intheap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}



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

ll solve() {
    ll N, K;
    cin >> N >> K;
    vector<ll> H(N);
    for ( int i = 0; i < N; i++ ) {
        cin >> H[i];
    }
    sort(H.begin(), H.end(),greater<>());
    ll ans = 0;
    for ( int i = K; i < N; i++ ) {
        ans += H[i];
    }
    return ans;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll par[800010];
ll len[800010];
void init(ll n){
    for(int i=0;i<n;i++){
        par[i]=i;
        len[i]=0;
    }
}
ll root(ll n){
    if(par[n]==n)return n;
    return par[n]=root(par[n]);
}
void unit(ll a,ll b){
    a=root(a);
    b=root(b);
    if(a==b)return;
    if(len[a]<len[b]){
        par[a]=b;
    }
    else{
        par[b]=a;
        if(len[a]==len[b])len[a]++;
    }
}
struct edge{
    ll from,to,cost;
};
bool cmp(edge a,edge b){
    return a.cost<b.cost;
}
int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    int n,m;cin>>n>>m;
    ll x[n];rep(i,0,n)cin>>x[i];
    vector<pll> v[n+1];
    vector<pll> w;
    ll a[m],b[m],c[m];
    rep(i,0,m){
        cin>>a[i]>>b[i]>>c[i];
        v[a[i]].push_back({b[i],i});
        v[b[i]].push_back({a[i],i});
        w.push_back({c[i],i});
    }
    sort(w.begin(),w.end());
    ll poi[m];
    init(n+1);
    ll sum[n+1];
    rep(i,0,n){
        sum[i+1]=x[i];
    }
    rep(i,0,m){
        ll num=w[i].second;
        ll f=a[num],g=b[num];
        if(root(f)==root(g)){
            poi[num]=sum[root(f)];
        }
        else{
            ll t=sum[root(f)]+sum[root(g)];
            ll u=f;
            unit(f,g);
            u=root(f);
            sum[u]=t;
            poi[num]=t;
        }
    }
    
    bool used[m];
    fill(used,used+m,false);
    ll ans=0;
    rrep(i,m-1,0){
        ll num=w[i].second;
        ll f=a[num],g=b[num];
        ll co=w[i].first;
        if(used[num])continue;
        used[num]=true;
        if(poi[num]>=co){
            queue<ll> q;
            q.push(f);
            q.push(g);
            while(q.size()>0){
                ll now=q.front();q.pop();
                rep(j,0,v[now].size()){
                    pll p=v[now][j];
                    ll ne=p.first;
                    ll nuu=p.second;
                    if(used[nuu])continue;
                    q.push(ne);
                    used[nuu]=true;
                    
                }
            }
        }
        else{
            ans++;
        }
       // cout<<ans<<endl;
    }
    cout<<ans<<endl;
}


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

int main(){
    string s; cin>>s;
    int n=s.length();
    
    string ans="No";
    if(n>=4){
        if(s[0]=='Y' and s[1]=='A' and s[2]=='K' and s[3]=='I') ans="Yes";
    }
    cout<<ans<<endl;
    return 0;
}


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

int w,h,c,ans;
int dx[4] = {0,0,-1,1};
int dy[4] = {-1,1,0,0};

void debug(vector< vector<int> >& p){
	for(int y=0 ; y < h ; y++ ){
		for(int x=0 ; x < w ; x++ ){
			cout << p[y][x];
		}
		cout << endl;
	}
}

void dfs_2(vector< vector<int> >& p , int x , int y , int a ){
	p[y][x] = 0;
	for(int i=0 ; i < 4 ; i++ ){
		int mx = x + dx[i];
		int my = y + dy[i];
		if( mx < 0 || my < 0 || mx >= w || my >= h ) continue;
		
		if( p[my][mx] == a ){
			dfs_2( p , mx , my , a );
		}
	}
}

int check(vector<vector<int> >& p){
	dfs_2( p , 0 , 0 , p[0][0] );
	int result = 0;
	for(int y=0 ; y < h ; y++ ){
		for(int x=0 ; x < w ; x++ ){
			if( p[y][x] == 0 ) result++;
		}
	}
	return result;
}

void dfs(vector< vector<int> >& p , int x , int y , int a , int b ){
	p[y][x] = b;
	for(int i=0 ; i < 4 ; i++ ){
		int mx = x + dx[i];
		int my = y + dy[i];
		if( mx < 0 || my < 0 || mx >= w || my >= h ) continue;
		
		if( p[my][mx] == a ){
			dfs( p , mx , my , a , b );
		}
	}
}

void solve(vector< vector<int> >& p, int cnt ){
	if( cnt == 6 ){
		int num = check(p);
		ans = max( ans , num );
		return;
	}
	
	for(int i=1 ; i <= 6 ; i++ ){
		if( p[0][0] == i ) continue;
		if( cnt == 5 && i != c ) continue;
		
		vector< vector<int> > next = p;
		dfs( next , 0 , 0 , p[0][0] , i );
		solve( next , cnt+1 );
	}
}

int main(){
	while( cin >> h >> w >> c, w || h || c ){
		vector< vector<int> > p(h);
		
		for(int y=0 ; y < h ; y++ ){
			p[y] = vector<int>(w);
			for(int x=0 ; x < w ; x++ ){
				cin >> p[y][x];
			}
		}
		
		ans = 0;
		solve( p , 1 );
		cout << ans << endl;
	}
}

Measured memory_bytes: 916
/* ex 7_2
   riverstone */

#include <stdio.h>
#include <stdlib.h>

int main(void){
    
    int row, column, i, j;
    //多次元配列の定義
    //black_rowとblack_colは各行と各列に1つ以上の黒が存在するかを記録
    char **block;
    int *black_row, *black_col;
 
    //入力の受け取り
    scanf("%d %d", &row, &column);

    //列の分のメモリ領域
    block = (char**)calloc(row, sizeof(char*));
    if(block == NULL){
        exit(1);
    }

    // 各行のメモリ領域の確保
    for(i = 0; i < row; i++){
        block[i] = (char*)calloc(column, sizeof(char));
        if(block[i] == NULL){
            exit(1);
        }
    }

    black_row = (int*)calloc(row, sizeof(int));
    if(black_row == NULL){
            exit(1);
    }

    black_col = (int*)calloc(column, sizeof(int));
    if(black_col == NULL){
            exit(1);
    }

 
//行列の各マスを読み取る
    //各行と各列に1つ以上の黒が存在するかをblack_rowとblack_colに記録
    for(i = 0; i < row; i++){
        for(j = 0; j < column; j++){
            scanf(" %c", &block[i][j]);
            if(block[i][j] == '#'){
                //マス(i,j)が黒のとき,black_row[i],black_col[j]を1にする
                black_row[i] = 1;
                black_col[j] = 1;
            }
        }   
    }
    
    //black_rowとblack_colを見て共に1であるようなマスの場合のみ出力
    for(i = 0; i < row; i++){
        if(black_row[i] == 1){
            for(j = 0; j < column; j++){
                if(black_col[j] == 1){
                    //black_row[i] = 1かつblack_col[j] = 1のときblock[i][j]を表示
                    printf("%c", block[i][j]);
                }
            }
            printf("\n"); //1行の処理が全て終わると改行する
 
        } 
    }

    //各メモリの開放
    for(i=0; i<row; i++){
        free(block[i]);
    }
    free(block);
 
    free(black_col);
    free(black_row);

    return 0;
}



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

l s(l a,l n,l m){
  l x=1;
  while (n>0){
    if(n&1) x=x*a%m;
    a=a*a%m;
    n=n/2;
  }
  return x; 
}
l t(l a,l m){
  return s(a,m-2,m);
}
l c(l x,l n,l m){
    l c=1;
    rep(i,x){
    c=c*(n-i)%m;
    c=c*t(i+1,m)%m;
  }
  return c;
}
int main(){
  l m=1000000007;
  l n,a,b,ans;
  cin>>n>>a>>b;
  cout<<(s(2,n,m)-1-c(a,n,m)-c(b,n,m)+3*m)%m;
}

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


int main() {
  int n;
  cin>>n;
  long long a[n];
  long long sum=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  sort(a,a+n);
  int count=0;
  int j=0;
  for(int i=n-1;i>=0;i--){ 
    count++;
  	sum-=a[i];
    if(sum*2<a[i]) break;
  }
  cout<<count<<endl;
}

Measured memory_bytes: 1024
//#pragma comment(linker, "/STACK:1024000000,1024000000")
/* vim: set fdm=marker */
//{{{
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int iinf = 0x7fffffff;
const ll linf = ~(1LL<<63);
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef map<ll, int> mli;
typedef map<ll, ll> mll;
template<typename T>
inline T gcd(T a, T b) {
	if(a < 0) return gcd(-a, b);
	if(b < 0) return gcd( a,-b);
	if(a < b) return gcd(b, a);
	if(b == 0) return a;
	return gcd(b, a%b);
}

ll qpow(ll a, ll n, ll mod) {
	a %= mod;
	ll ans = 1LL;
	while(n) {
		if(n & 1) ans = (ans*a % mod);
		a = (a*a % mod);
		n >>= 1;
	}
	return ans;
}

inline ll rev(ll a, ll p) {
	return qpow(a, p - 2, p);
}

#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define rep(x, st, en) for(int x = st; x < en; x++)
#define pb push_back
#define mp make_pair
#define dbgm(msg, var) cerr<<#msg<<" "<<#var<<" = "<<var<<endl; 
#define dbg(var) cerr<<#var<<" = "<<var<<endl;
#define X first
#define Y second
#ifdef ALNDBG
namespace alndbg {
	clock_t s, e;
}
#endif

inline void tic() {
#ifdef ALNDBG
	alndbg::s = clock();
#endif
}

inline void toc() {
#ifdef ALNDBG
	alndbg::e = clock();
	cerr<<1000.0 * (alndbg::e - alndbg::s) / CLOCKS_PER_SEC<<" ms"<<endl;
#endif
}

//}}}

// -------------------- Spliters ------------------------
const int maxn = 100010;

char s[maxn];
int A, B, N;

int main() {
	ios::sync_with_stdio(0);
	cin>>N>>A>>B>>s;
	int jp = 0, os = 0;
	rep(i, 0, N) {
		if(s[i] == 'c') { puts("No"); continue; }
		if(s[i] == 'a') {
			if(jp + os < A + B) {
				jp++;
				puts("Yes");
			} else {
				puts("No");
			}
		}
		if(s[i] == 'b') {
			if(jp + os < A + B && (os + 1) <= B) {
				os++;
				puts("Yes");
			} else {
				puts("No");
			}
		}
	}
	return 0;
}
// --USE C++11
// *-USE O2


Measured memory_bytes: 768
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

sec_time = {}
sec_time["A"] = A, A % 10 if A % 10 != 0 else 10
sec_time["B"] = B, B % 10 if B % 10 != 0 else 10
sec_time["C"] = C, C % 10 if C % 10 != 0 else 10
sec_time["D"] = D, D % 10 if D % 10 != 0 else 10
sec_time["E"] = E, E % 10 if E % 10 != 0 else 10

sorted_sec_time = sorted(sec_time.items(), key=lambda x:x[1][1], reverse=True) 

result = 0
i = 0
for time in sorted_sec_time:
    result += time[1][0]
    i += 1
    if result % 10 != 0 and i != 5:
        result += 10 - result % 10
    
print(result)

Measured memory_bytes: 3064
a = [[int(x) for x in input().split()] for _ in range(3)]

n = int(input())
for _ in range(n):
    b = int(input())

    for i in range(3):
        for j in range(3):
            if b == a[i][j]: a[i][j] = 0

ans = "No"
for i in range(3):
    if sum(a[i]) == 0: ans = "Yes"

for j in range(3):
    if a[0][j] + a[1][j] + a[2][j] == 0: ans = "Yes"

if a[0][0] + a[1][1] + a[2][2] == 0: ans = "Yes"
if a[2][0] + a[1][1] + a[0][2] == 0: ans = "Yes"

print(ans)


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

int main() {
	int n, a, b;
	cin >> n >> a >> b;
	
	int ans = 0;
	int tmp;
	for(int i = 0; i < n; i++){
		cin >> tmp;
		
		if(tmp < a || tmp >= b){
			ans++;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}

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

bool getAnswer(const string& S, string& T) {
  int N = S.size();
  for (int i = 1; i < N; ++i) {
    if ((S[i] == 'o' && T[i] == 'S') || (S[i] == 'x' && T[i] == 'W')) {
      T += T[i - 1];
    } else {
      T += (T[i - 1] == 'S') ? 'W' : 'S';
    }
  }
  if (T[0] != T.back()) return false;
  if ((S[0] == 'o' && T[0] == 'S') || (S[0] == 'x' && T[0] == 'W')) {
    if (T[1] != T[N - 1]) return false;
  } else {
    if (T[1] == T[N - 1]) return false;
  }
  return true;
}

int main(void) {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  string S;
  cin >> S;

  const vector<string> pattern = {"SS", "SW", "WS", "WW"};
  rep(i, (int)pattern.size()) {
    string answer = pattern[i];
    if (getAnswer(S, answer)) {
      cout << answer.substr(0, N) << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}


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

int main()
{
  vector<int> vec(3);
  int count = 3;
  cin >> vec.at(0) >> vec.at(1) >> vec.at(2);

  sort(vec.begin(), vec.end());
  if((vec.at(0) + vec.at(1)) == vec.at(2))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256