akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=2147483647;
inline ll read(){
	ll x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
ll n,m,x,minn=INF;
struct mas{
	int c;
	int a[15];
}mass[15],sum;
void dfs(int cnt,mas tmp){
	if(cnt==n+1) return ;
	int flag=1;
	dfs(cnt+1,tmp);
	tmp.c+=mass[cnt].c;
	for(int i=1;i<=m;i++){
		tmp.a[i]+=mass[cnt].a[i];
		if(tmp.a[i]<x) flag=0;
	}
	if(flag&&tmp.c<minn) minn=tmp.c;
	dfs(cnt+1,tmp);
}
int main(){
	n=read(),m=read(),x=read();
	for(int i=1;i<=n;i++){
		mass[i].c=read();
		for(int j=1;j<=m;j++) mass[i].a[j]=read();
	}
	dfs(1,sum);
	if(minn!=INF) printf("%lld\n",minn);
	else printf("-1\n");
	return 0;
}

Measured memory_bytes: 3744
N, M = map(int, input().split())
N2 = 2**N
INF = float("inf")
X = [INF]*N2
X[0] = 0

for i in range(M):
  a, b = map(int, input().split())
  C = list(map(int, input().split()))
  
  k = sum(1<<(c-1) for c in C)
    
  for j in range(N2):
    if X[j|k] > X[j] + a:
      X[j|k] = X[j] + a

ans = X[-1]      
if ans >= INF:
  ans = -1
print(ans)  

Measured memory_bytes: 3188
#include<stdio.h>
int main()
{
    long long int n,i,j=0,k,a[20020],sum=0;
    scanf("%lld",&n);
    for(i=0; i<n; i++)
    {
        scanf("%lld",&a[i]);
    }
    int max=a[0];
    for(i=0; i<n; i++)
    {
        if(a[i]>max)
        {
            max=a[i];
            j=i;
        }
    }
    a[j]=max/2;
    for(i=0; i<n; i++)
    {
        sum=sum+a[i];
    }
    printf("%lld\n",sum);
    return 0;

}


Measured memory_bytes: 128
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Console = System.Console;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var KN = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var As = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var distance =int.MaxValue;
            for (int i = 0; i < KN[1]; i++)
            {
                if (i == 0)
                {
                    distance = Math.Min(distance,KN[0] - (As[i] - 0));
                    distance = Math.Min(distance,As[KN[1] - 1] - As[0]);
                }else if (i == KN[1] - 1)
                {
                    distance = Math.Min(distance, KN[0] - (KN[1] - As[i]));
                    distance = Math.Min(distance,As[KN[1] - 1] - As[0]);
                }
                else
                {
                    distance = Math.Min(distance,KN[0] - (As[i] - As[i - 1]));
                    distance = Math.Min(distance, KN[0] - (As[i + 1] - As[i]));
                }
            }

            Console.WriteLine(distance);
        }
    }
}

Measured memory_bytes: 34780
package main
 
import "fmt"

func main() {
  var x int
  fmt.Scan(&x)
  var ans = x/11 * 2
  if x%11 >= 1 {
    if x%11 > 6 {
      ans += 1
    }
    ans += 1
  }
  fmt.Println(ans)
}

Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<set>
using namespace std;
int main(){
	ios::sync_with_stdio(false); 
    int n;
    cin>>n;
    set<int>s;
    for(int i=1;i<=n;i++){
        int x;
        cin>>x;
        if(s.find(x)!=s.end()) s.erase(x);
        else s.insert(x);
    }
    cout<<s.size();
    return 0;
 } 

Measured memory_bytes: 4992
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int area = a * b;
    int length = a * 2 + b * 2;
    System.out.println(area + " " + length);
    sc.close();
  }
}


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

int search(int A[], int n, int key) {
    int i = 0;
    A[n] = key;
    while (A[i] != key) i++;
    return i != n;
}

int main(void) {
    int n, q, i, k;
    int A[15000];
    int c = 0;

    scanf("%d", &n);
    for (i = 0; i < n; i++) scanf("%d", &A[i]);

    scanf("%d", &q);
    for (i = 0; i < q; i++) {
        scanf("%d", &k);
        if (search(A, n, k)) c++;
    }

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

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


#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fr(x) freopen(x,"r",stdin)
#define fw(x) freopen(x,"w",stdout)
#define iout(x) printf("%d\n",x)
#define lout(x) printf("%lld\n",x)
#define REP(x,l,u) for(int x = (l);x<=(u);x++)
#define RREP(x,l,u) for(int x = (l);x>=(u);x--)
#define mst(x,a) memset(x,a,sizeof(x))
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
#define se second
#define fi first
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define sz(x) ((int)x.size())
#define cl(x) x.clear()

typedef  long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
using namespace std;

const int maxn = 100010;
const int mod = 1e9+7;
const int MAX = 1000000010;
const double eps = 1e-6;
const double PI = acos(-1);

template<typename T> inline void read(T &x){
x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}

template<typename A,typename B> inline void read(A&x,B&y){read(x);read(y);}
template<typename A,typename B,typename C> inline void read(A&x,B&y,C&z){read(x);read(y);read(z);}
template<typename A,typename B,typename C,typename D> inline void read(A&x,B&y,C&z,D&w){read(x);read(y);read(z);read(w);}
template<typename A,typename B> inline A fexp(A x,B p){A ans=1;for(;p;p>>=1,x=1LL*x*x%mod)if(p&1)ans=1LL*ans*x%mod;return ans;}
template<typename A,typename B> inline A fexp(A x,B p,A mo){A ans=1;for(;p;p>>=1,x=1LL*x*x%mo)if(p&1)ans=1LL*ans*x%mo;return ans;}

int n;

int A[maxn],f[maxn];

vector<int> G[maxn];

void dfs(int u){
	f[u]=0;
	for(auto v:G[u])if(A[u]>A[v]){
		dfs(v);
		if(!f[v])f[u]=1;
	}
}

void Work(){
	REP(i,1,n){
		dfs(i);
		if(f[i])printf("%d " ,i);
	}
}

void Init(){
	read(n);
	REP(i,1,n)read(A[i]);
	REP(i,2,n){
		int u,v;read(u,v);
		G[u].PB(v);G[v].PB(u);
	}
}

int main(){
	Init();
	Work();
	return 0;
}


Measured memory_bytes: 2688
#include <bits/stdc++.h>
using namespace std;
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; }
using ll = long long;
using P = pair<int, int>;
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; }


int main() {
    int n; cin >> n;
    vector<int> v(n, 0);
    for(int i = 0; i < n; ++i) cin >> v.at(i);

    map<int, int> mpodd;
    map<int, int> mpeven;
    for(int i = 0; i < n; ++i) {
        if(i % 2 == 0) {
            mpodd[v.at(i)]++;
        }else {
            mpeven[v.at(i)]++;
        }
    }

    int odd1 = 0; int odd2 = 0;
    int oddcnt = 0; int oddcnt2 = 0;
    int even1 = 0; int even2 = 0;
    int evencnt = 0; int evecnt2 = 0;
    for(auto p : mpodd) {
        if(p.second > oddcnt) {
            odd2 = odd1;
            oddcnt2 = oddcnt;
            odd1 = p.first;
            oddcnt = p.second;
        }else if(p.second > oddcnt2) {
            odd2 = p.first;
            oddcnt2 = p.second;
        }
    }
    for(auto p : mpeven) {
        if(p.second > evencnt) {
            even2 = even1;
            evecnt2 = evencnt;
            even1 = p.first;
            evencnt = p.second;
        }else if(p.second > evecnt2) {
            even2 = p.first;
            evecnt2 = p.second;
        }
    }

    int ans = 0;
    if(mpodd.size() == 1 && mpeven.size() == 1) {
        if(odd1 == even1) {
            ans = n - (mpeven[even1]);
        }else {
            ans = 0;
        }
    }else if(mpodd.size() == 1) {
        if(odd1 == even1) {
            ans = n - (mpeven[even2]+oddcnt);
        }else {
            ans = n - (oddcnt+mpeven[even1]);
        }
    }else if(mpeven.size() == 1) {
        if(odd1 == even1) {
            ans = n - (evencnt+mpodd[odd2]);
        }else {
            ans = n - (evencnt+mpodd[odd1]);
        }
    }else {
        if(odd1 == even1) {
            ans = n - max(evencnt+mpodd[odd2], oddcnt+mpeven[even2]);
        }else {
            ans = n - (evencnt+oddcnt);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 5376
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set <int>
#define sll set <ll>
#define spii set <pii>
#define vs vector <string>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define mp make_pair
#define vvll vector <vll>
#define vsi vector <si>
#define forn(i, n) for (int i = 0; i < (n); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()


const ll INFLL = 1e18;
const int MAXN = 1e6+100;
const ll INF = 1e9;
const ll mod1=1e9+7;
const ll mod2=2e9+11;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    #ifdef LOCAL
    freopen("a.in","r",stdin);
    #endif
    string s,t;
    cin>>s>>t;
    t.pop_back();
    if (s==t)
        cout<<"Yes";
    else
        cout<<"No";





}

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

int main() {
  int h, w;
  cin >> h >> w;

  vector<string> s(h);
  rep(i,h) cin >> s.at(i);
  
  rep(i,h) {
    rep(j,w) {
      if (s.at(i).at(j) == '.') {
        int a = 0;
        for (int m = -1; m <= 1; m++) {
          for (int l = -1; l <= 1; l++) {
            if (m == 0 && l == 0) continue;
            if (i + m >= 0 && i + m < h && j + l >= 0 && j + l < w && s.at(i + m).at(j + l) == '#') {
              a++;
            }
            s.at(i).at(j) = '0' + a;
          }
        }
      }
    }
  }
  
  rep(i,h) cout << s.at(i) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;

using PLL = pair<long long, long long>;

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

	long long x, l;

	vector<PLL> robots;
	for (int i = 0; i < n; i++) {
		cin >> x >> l;
		robots.emplace_back(make_pair(x, x + l));
	}

	sort(robots.begin(), robots.end(),
		[](const PLL &a, const PLL &b) {
			if (a.second == b.second) {
				return a.first > b.second;
			} else {
				return a.second < b.second;
			}
		});

	int ans = 0;
	int upper = -1e9;
	for (auto p: robots) {
		// printf("chk upper %4d: x %4lld, x+l %4lld\n", upper, p.first, p.second);
		if (p.first - (p.second - p.first) >= upper) {
			ans++;
			upper = p.second;
			// printf("  ok!\n");
		}
	}

	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 2420
//Tanzim bin nasir
#include<bits/stdc++.h>
typedef long long ll;
#define ff first
#define ss second
using namespace std;
void fast()
{
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
}
ll gcd(ll a,ll b)
{
    if(b==0)
    return a;
    else
    gcd(b,a%b);
}
ll lcd(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}
int main()
{
    int f=0,s=0;
    for(int i=0;i<3;i++)
    {
        int temp;
        cin>>temp;
        if(temp==5)
        f++;
        else if(temp==7)
        s++;
    }
    if(f==2&&s==1)
    cout<<"YES\n";
    else
    cout<<"NO\n";
}


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

int main(){
    int a, b, c;
    int count = 0;
    scanf("%d %d %d", &a, &b, &c);
    
    for(int i = a; i <= b; i++){
        if( c % i == 0){
            count += 1;
        }
    }
    printf("%d\n", count);
    
    return 0;
}


Measured memory_bytes: 3204
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  string S1, S2, S3;
  cin>>S2;
  int Q;
  cin>>Q;
  int query, f;
  char c;
  bool gyaku = false;
  for(int i=0;i<Q;++i) {
    cin>>query;
    if(query==1) {
      gyaku ^= 1;
    }
    else {
      cin>>f>>c;
      if(gyaku) {
        if(f==1) S3.push_back(c);
        else S1.push_back(c);
      }
      else {
        if(f==1) S1.push_back(c);
        else S3.push_back(c);
      }
    }
  }
  if(gyaku) {
    reverse(S2.begin(), S2.end());
    reverse(S3.begin(), S3.end());
    cout<<S3+S2+S1<<endl;
  }
  else {
    reverse(S1.begin(), S1.end());
    cout<<S1+S2+S3<<endl;
  }
}



Measured memory_bytes: 4248
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#include <bitset>
#include <complex>
#include <cmath>
#include <array>
using namespace std;
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3fLL
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=350;
//ここまでテンプレ
int main(){
	int N;
	cin>>N;
	string S[SIZE];
	for(int i=0;i<N;i++)
		cin>>S[i];
	int ans=0;
	for(int b=0;b<N;b++){
		char T[SIZE][SIZE];
		for(int i=0;i<N;i++)
			for(int j=0;j<N;j++)
				T[i][(j+b)%N]=S[i][j];
		bool flag=0;
		for(int i=0;i<N;i++)
			for(int j=0;j<N;j++)
				if(T[i][j]!=T[j][i])
					flag=1;
		if(!flag)
			ans+=N;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 512
// ITP1_4_A:   A / B Problem
#include <stdio.h>
#include <stdlib.h>

#define PI  3.141592653589793

int main()
{
	double r;

	scanf("%lf", &r);
	printf("%lf %lf\n", PI*r*r, 2*PI*r);
	return 0;
}



Measured memory_bytes: 2104
# 最初に入れておくとinputが早くなる
#import sys
from fractions import gcd
#input = sys.stdin.readline

a, b, c, d = map(int, input().split())
# warikireru = set()
# for i in range(b//c+1):
#    for j in range(b // d+1):
#        k = c ** i * d ** j
#        if(a <= k <= b):
#            warikireru.add(k)
# print(warikireru)
# print(b-a+1-len(warikireru))

k = int(c * d / gcd(c, d))
x1 = b-b//c-b//d+b//k
a -= 1
x2 = a - a // c - a // d + a // k
print(x1-x2)

Measured memory_bytes: 5048
#include<iostream>
#include<string>
using namespace std;
typedef long long ll;

int main() {
    string s;
    ll count = 0;
    cin >> s;
    for (int i = 0; i < (1 << (s.length() - 1)); i++) {
        string sub_s = s;
        int pattern = i, s_len = 1;
        for (int j = 0; j < s.length() - 1; j++) {
            if ((pattern & 1) == 1) {
                count += stoll(sub_s.substr(0, s_len));
                sub_s = sub_s.substr(s_len, sub_s.length());
                s_len = 1;
            }
            else s_len++;
            pattern /= 2;
        }
        count += stoll(sub_s);
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#define ll long long
#define ffor(i,a,b) for (int i=(a);i<(b);i++)
#define rfor(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define rep(i,n) for (int i=0;i<(n);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<queue>
#define SIZE 100001
#define MOD 1000000007
#define INF 100000000
using namespace std;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b,c;
	cin >> a >> b >> c;

	int flag = 0;

	int sum = 0;
	int i = 1;
	while(sum <= b* 100){
		sum = a*i;
		if(sum % b == c){
			flag = 1;
			break;
		}
		i++;
	}

	if(flag == 1) cout << "YES" << endl;
	else cout << "NO" << endl;


	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		sc.close();

		String result = n == m ? "Yes" : "No";

		System.out.println(result);
	}
}


Measured memory_bytes: 23764
S = input()
N = len(S)
a = N % 4
ans = "Yes"
if N == 3:
    if S[0] != S[2]:
        ans = "No"
elif a == 1:
    x = N // 4
    for i in range(x):
        if (S[i] != S[2 * x - i - 1]) or (S[2 * x + 1 + i] != S[4 * x - i]):
            ans = "No"
    for i in range (2 * x):
        if S[i] != S[N - 1 - i]:
            ans = "No"
elif a == 3:
    x = N // 4
    for i in range(x):
        if (S[i] != S[2 * x - i]) or (S[2 * x + 2 + i] != S[4 * x + 2 - i]):
            ans = "No"
    for i in range (2 * x + 1):
        if S[i] != S[N - 1 - i]:
            ans = "No"
print(ans)


Measured memory_bytes: 3064
from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))

A=list(map(lambda x:x%K-1,A))
sa=[0]*(N+1)
for i in range(1,N+1):
  sa[i]=(sa[i-1]+A[i-1])%K

c=Counter(sa[:K-1])

ans=0
for i in c.values():
  ans+=i*(i-1)//2
  
for i in range(K-1,N+1):
  ans+=c[sa[i]]
  c[sa[i-(K-1)]]-=1
  c[sa[i]]+=1

  
print(ans)

Measured memory_bytes: 42560
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

//無限大
const ll INF = 1LL << 60;


//------------------------------------------------
int main(){

    //main
    ll N,K;
    cin >> N >> K;
    
    ll ans = 0;
    ll mnum = 1000000007;

    for(int m = K; m<N+2; ++m){
        ans += m*(N+1-m) +1;
        ans = ans%mnum;
    }
    
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3624
#include <iostream>

#include <map>
#include <string>

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cinttypes>


using namespace std;

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

	typedef pair<int, int> answer;
	vector<answer> que;
	que.push_back(answer(0, 0));

	vector<answer> nextQue;

	for (int index = n.size() - 1; index >= 0; --index)
	{
		int d = n[index] - '0';

		while (!que.empty())
		{
			answer ans = que.back();
			que.pop_back();

			int c = d + ans.second;
			int nextCarry = 0;

			if (c >= 10)
			{
				c -= 10;
				++nextCarry;
			}

			if( c <= 5)
				nextQue.push_back(answer(ans.first + c, nextCarry));

			if( c >= 5)
				nextQue.push_back(answer(ans.first + 10 - c, nextCarry + 1));
		}

		que.swap(nextQue);
		nextQue.clear();

		sort(que.begin(), que.end());
		que.erase(unique(que.begin(), que.end()), que.end());
		
		for (int i = 0; i < que.size(); ++i)
		{
			for (int j = i + 1; j < que.size(); ++j)
			{
				if (que[i].second == que[j].second)
					que.erase(que.begin() + j);
			}
		}
	}

	int ans = 1 << 30;
	
	for( auto a : que )
	{
		ans = min(a.first + a.second, ans);
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1412
#include <iostream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <tuple>
#include <math.h>
#include <set>
#include <stack>
#include <bitset>
#include <map>
#include <queue>
#include <random>
#include <unordered_set>
#include <unordered_map>
#define DEBUG
#define fi first
#define se second
#define pqueue priority_queue
#define pb(x) push_back(x)
// #define endl '\n'
#define all(x) x.begin(), x.end()
#define int long long
#define mk(a, b) make_pair(a, b)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ull> vull;
typedef vector<ll> vll;
// typedef tuple<int, int, int> tiii;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector< vector<int> > vvi;
typedef vector<char> vc;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1000000007;
const int MAXN = 3e5;
//const ld eps = 1e-6;
const ld eps2 = 1e-9;
const int MOD2 = 998244353;
const int dosz = 5e5;
const int SZ = (1<<18);
const ld PI = atan2l(0, -1);


void fast_io(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef DEBUG
        // freopen("a.in", "r",stdin);
#else
       // freopen("mxnl.in", "r", stdin);
       // freopen("mxnl.out", "w", stdout);
#endif
}

int gcd(int a, int b){
    return (b?gcd(b, a%b):a);
}

void solve(){ 
    int n, m;
    cin >> n >> m;
    vi nums(n);
    int sum = 0;
    for(int &i:nums){
        cin >> i;
        sum += i;
    }
    int ans = n;
    for(int i=0; i<n; i++){
        if(((sum+(4*m)-1) / (4*m)) > nums[i])
            ans--;
    }
    cout << (ans>=m?"Yes":"No") << endl;
}

signed main() {
    fast_io();
    int q = 1;
    // cout << fixed << setprecision(6);
    // cin >> q;
    // cout << 1 << endl;
    while(q--){
        solve();
    }
    return 0;
}



Measured memory_bytes: 256
li = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

i = gets.to_i

puts li[i-1]


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
 
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

int main(){
    ll n,x;
    cin>>n>>x;
    ll a[n];
    rep(i,n)cin>>a[i];
    ll mins[n];
    rep(i,n)mins[i]=a[i];
    ll ans=(1ll<<60);
    rep(i,n){
        ll tmp=0;
        rep(j,n){
            if(j<i)chmin(mins[j],a[j-i+n]);
            else chmin(mins[j],a[j-i]);
            tmp+=mins[j];
        }
        tmp+=(i*x);
        chmin(ans,tmp);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int>P;
typedef tuple<ll,ll,ll>T;
const int MAX = 510000;
const int MOD = 1000000007;
//この設定だとn<10^7が限界。maxの０を一個増やせば100msかかるが一桁増やせる。
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;
}

int main(){
  COMinit();
  string s;
  cin>>s;
  int K;
  cin>>K;
  int N=s.size();
  vector<int>num(N);
  rep(i,N){
    num[i]=s[i]-'0';
  }
  ll ans=0;
  queue<P>qu;
  qu.push(P(0,0));
  qu.push(P(0,1));
  ans+=(num[0]-1)*pow(9,K-1)*COM(N-1,K-1);
  while(!qu.empty()){
    auto t=qu.front();qu.pop();
    int a=t.first,b=t.second;
    if(b==0){
      if(a==N-1){continue;}
      qu.push(P(a+1,0));
      ans+=9*pow(9,K-1)*COM(N-a-2,K-1);
    }
    else{
     
      if(b==K){ans+=1;continue;}
      if(a==N-1){if(b==K)ans+=1;continue;}
    
      int x=num[a+1];
      if(x==0){qu.push(P(a+1,b));}
      else{
      	qu.push(P(a+1,b+1));
        ans+=pow(9,K-b)*COM(N-a-2,K-b);
        ans+=(x-1)*pow(9,K-b-1)*COM(N-a-2,K-b-1);
      }
    }
  }
  cout<<ans;
}

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

#define ll long long
using namespace std;

ll gcd(int a, int b){
    if (a == 0)
        return b;

return gcd(b % a, a);
}

ll lcm(ll a, ll b)
 {
    return (a*b)/gcd(a, b);
 }

int main()
{
        ll a,b;
        cin>>a>>b;
        ll out = lcm(a,b);
        cout<<out<<endl;
        return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//using ProCon.Util;

namespace ProCon
{
    class Program
    {
        static void Main(string[] args)
        {
            AC133B();
        }

        static void AC133B()
        {
            //https://atcoder.jp/contests/abc135/tasks

            var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var n = input[0];
            var d = input[1];
            int count = 0;
            int[,] listX = new int[n,d];

            for(int i = 0; i < n; i++)
            {
                var inputX = Console.ReadLine().Split().Select(int.Parse).ToArray();
                for(int j = 0; j < d; j++)
                {
                    listX[i, j] = inputX[j];
                }
            }


            for(int i = 0; i < n - 1; i++)
            {
                for (int j = i + 1; j < n; j++)
                {
                    int a = 0;
                    for (int k = 0; k < d; k++)
                    {
                        a += (int)Math.Pow((listX[i, k] - listX[j, k]), 2);
                    }
                    var sq = (int)Math.Sqrt(a);
                    if ((Math.Pow(sq, 2)) == a)
                    {
                        //整数
                        count++;
                    }
                }
            }

            Console.WriteLine(count);
            Console.ReadKey();
        }

    }
}


Measured memory_bytes: 13396
N = int(input())
A = list(map(int, input().split()))
 
# Aのどの2つの要素も互いに異なること ⇔ 重複しない要素の個数がN
# 上記の事実を用いずに考えると・・・N=10^5なので、O(N)で解く
# 二重ループはO(N^2)なので間に合わない
 
# 数列に等しい値がある場合、ソートしたとき、隣接する場所に値が集まる
# まずソートし、全ての隣接する2項を比較すればよい
A = sorted(A)
 
ans = 'YES'
for i in range(N-1):
  if A[i] == A[i+1]:
    ans = 'NO'
    break
    
print(ans)

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

int n,k,m,h[100005];
string s;

int main() {
  cin >> n >> k;
  rep(i,n) cin >> h[i];
  sort(h,h+n);
  int ans=1e9+1;
  rep(i,n-k+1) ans=min(h[i+k-1]-h[i],ans);
  cout << ans << endl;
}

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

int n, m, q;
int a[50], b[50], c[50], d[50];
int A[10], ans;

void dfs(int dep, int pre) {
    if (dep == n) {
        int sum = 0;
        for (int i = 0; i < q; i++) 
            if (A[b[i]] - A[a[i]] == c[i]) sum += d[i];
        ans = max(ans, sum);
        return;
    }
    for (int i = pre; i <= m; i++) {
        A[dep] = i;
        dfs(dep + 1, i);
    }
}

int main() {
    cin >> n >> m >> q;
    for (int i = 0; i < q; i++) {
        cin >> a[i] >> b[i] >> c[i] >> d[i];
        --a[i], --b[i];
    }
    dfs(0, 1);
    cout << ans << "\n";
}

Measured memory_bytes: 3564
def isPalin(x):
    for i in range(len(x)//2):
        if x[i] != x[-(i+1)]:
            return False
    return True

S = input()
N = len(S)

def a():
    if not(isPalin(S)):
        return False
    if not(isPalin(S[:(N-1)//2])):
        return False
    if not(isPalin(S[(N+3)//2-1:])):
        return False
    return True

print(["No","Yes"][a()])

Measured memory_bytes: 38460
N, X = list(map(lambda a: int(a), input().split(" ")))
L = list(map(lambda b: int(b), input().split(" ")))

i = 0
s = 0
while(s <= X and i < len(L)):
  s += L[i]
  i += 1

if s <= X:
  i += 1

print(i)

Measured memory_bytes: 9104
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"

using namespace std;

const long long int MOD = 1000000007;
//const int MOD = 998244353;

//long long int N, M, K, H, W, L, R;
int N, M, K, H, W, L, R;


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

	cin >> N;
	vector<int>v(N * 2 - 1);
	for (auto &i : v)cin >> i;
	L = 2; R = N * 2 - 1;
	while (R - L > 1) {
		int mid = (R + L) / 2;
		auto w = v;
		for (auto &j : w)j = j >= mid;
		int maru = MOD;
		int batu = MOD;
		for (int j = 1; j < N * 2 - 1; j++) {
			if (w[j] == w[j - 1]) {
				if (w[j]) {
					maru = min(maru, abs(N - 1 - j));
					maru = min(maru, abs(N - 1 - j + 1));
				}
				else {
					batu = min(batu, abs(N - 1 - j));
					batu = min(batu, abs(N - 1 - j + 1));
				}
			}
		}
		if (maru == MOD && batu == MOD) {
			if (w[0])L = mid;
			else R = mid;
		}
		else {
			if (maru < batu)L = mid;
			else R = mid;
		}
	}
	cout << L << endl;
	return 0;
}

Measured memory_bytes: 1808
s=input()
a=int(s[0:2])
b=int(s[2:])
if 1<=a<=12 and 1<=b<=12:
    print('AMBIGUOUS')
elif 1<=b<=12:
    print('YYMM')
elif 1<=a<=12:
    print('MMYY')
else:
    print('NA')

Measured memory_bytes: 9116
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_B main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
#endif

#ifdef _DEBUG
void init_global_B() {}
#else
ll digit_sum(ll n) {
    if (n < 10) return n;
    return digit_sum(n / 10) + n % 10;
}
#endif

int main_B() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll X; cin >> X;

    ll sum = digit_sum(X);

    string ans = X%sum == 0 ? "Yes" : "No";
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int n;
    bool flg = true;

    cin>>n;
    vector<long long> vec(n);
    for(int i=0;i<n;i++){
        cin>>vec.at(i);
    }

    sort(vec.begin(), vec.end());
    for(int i=0;i<n-1;i++){
        if(vec.at(i)==vec.at(i+1)){
            cout<<"NO"<<endl;
            flg=false;
            break;
        }
    }
    if(flg){
        cout<<"YES"<<endl;
    }
    return 0;
}

Measured memory_bytes: 1792
#include<stdio.h>

void next_prime(int x){
    int divcnt = 0;
    while(1){
        divcnt = 0;
        for(int i = 1; i <= x; i++){
            if(x % i == 0){
                divcnt ++;
                if(divcnt > 2){
                    break;
                }
            }
        }
        if(divcnt == 2){
            printf("%d\n", x);
            return;
        }
        x++;
    }
}

int main(void){
    int x;
    scanf("%d", &x);
    next_prime(x);
    return 0;
}

Measured memory_bytes: 128
import string

while(1):
    [N,M]=raw_input().split()
    N=int(N)
    if N==0: break
    S=string.digits+string.ascii_uppercase

    prime=[2,3,5,7,11,13,17,19,23,29,31]
    pc   =[0 for i in range(len(prime))]
    ans=999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
    for i in range(len(prime)):
        n=N
        while(1):
            if n%prime[i]==0:
                n/=prime[i]
                pc[i]+=1
            else:
                break
    L=0
    for i in range(1,len(M)+1):
        c=M[-i]
        L += S.index(c)*N**(i-1)
    
    for i in range(len(prime)):
        p=prime[i]
        if pc[i]!=0:
            k=1
            tmp=0
            while(p**k<=L):
                e=L/p**k
                tmp+= e
                k+=1
            tmp/=pc[i]
            ans=min(ans,tmp)
    print ans
    

Measured memory_bytes: 6356
#include<bits/stdc++.h>
using namespace std;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9+21;
const long long LINF = (long long) 1e18;
const long double PI = 2 * acos((long double)0);
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
#define Mahmud main()
#define endl "\n"
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define SQR(x) ((LL)(x) * (x))
#define RESET(a,b) memset(a,b,sizeof(a))
#define alla(arr,n) arr,arr+n
#define sz(x) ((int)(x).size())
#define all(x) x.begin(),x.end()
#define pb push_back
///Debug
#define dbg1(x) std::cerr<<#x<<"="<<(x)<<endl;
#define dbg2(x,y) std::cerr<<#x<<"="<<(x)<<','<<#y<<"="<<(y)<<endl;
#define dbg3(x,y,z) std::cerr<<#x<<"="<<(x)<<','<<#y<<"="<<(y)<<','<<#z<<"="<<(z)<<endl;
#define dbgArr(arr,n) cerr<<#arr<<"=["; printArray(arr,n,0,93); cerr<<endl;
///traversing
#define rep(n) for(int i=0;i<n;++i)
#define trv(i,t) for(__typeof(t.begin()) i=t.begin();i!=t.end();++i)
///necessary functions
inline ll Int()
{
    ll _x=0,_tmp=1;
    char _tc=getchar();
    while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
    if( _tc == '-' ) _tc=getchar(), _tmp = -1;
    while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
    return _x*_tmp;
}
inline long double Double()
{
    long double d;
    scanf("%Lf",&d);
    return d;
}
ll lcm(ll a,ll b)
{
    return a/__gcd(a,b)*b;
}
int ton(string x)
{
    int y;
    std::istringstream ss(x);
    ss >> y;
    return y;
}
template<typename T>
string tostring(T x)
{
    ostringstream ss;
    ss << x ;
    return ss.str();
}

///Current Code vars
#define N 210010
long long n,k,c,d;
long long  arr[N+1],brr[N+1],a[N+1];
///Current Code functions

string s;

void solve()
{
    n = Int();
    arr[0] = 0;
    for(int i=1;i<=n;++i)
    {
        long long x = Int();
        arr[i] = arr[i-1] + x;
        a[i] = x;
    }
    for(int i = n - 1; i>=1;--i)
    {
        a[i] += a[i+1];
    }
    long long ans = 1e16;
    for(int i=2;i<=n;++i)
    {
        long long now = 1e16;
        long long lft = arr[i-1],rgt = a[i];
        now = abs(lft-rgt);
        ans = min(ans,now);
    }
    cout<<ans<<endl;
}

int Mahmud
{
    // ios_base::sync_with_stdio(0); //cin.tie(0);
  //#ifdef _LOCAL_
    //freopen("in", "r", stdin);
    // freopen("out", "w", stdout);
  //while(1)
    solve();
  //#ifdef _LOCAL_
    //printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
  //#endif
    return 0;
}


Measured memory_bytes: 4608
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

int mp[555][555];
bool iru[555][555];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, -1, 0, 1};

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

	ll n;cin >> n;
	REP(i, n){
		REP(j, n){
			ll now = INF;
			now = min(now, i);
			now = min(now, (n - 1) - i);
			now = min(now, j);
			now = min(now, (n - 1) - j);
			mp[i][j] = now;
			iru[i][j] = true;
		}
	}

	vector<ll> v(n*n);REP(i, n*n)cin >> v[i], v[i]--;

	ll ans = 0;
	queue<P> q;
	REP(i, v.size()){
		ll y = v[i] / n;
		ll x = v[i] % n;
		ans += mp[y][x];
		iru[y][x] = false;

		q.push(MP(y, x));
		while(!q.empty()){
			auto yy = q.front().FI;
			auto xx = q.front().SE;
			q.pop();
			REP(i, 4){
				ll ny = yy + dy[i];
				ll nx = xx + dx[i];
				if(ny < 0 || nx < 0 || ny >= n || nx >= n)continue;
				if(mp[ny][nx] <= mp[yy][xx] + iru[yy][xx])continue;
				mp[ny][nx] = mp[yy][xx] + iru[yy][xx];
				q.push(MP(ny, nx));
			}
		}

		//SHOW2d(mp, n, n);
	}

	cout << ans << endl;

	return 0;
}


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

int main(){
    long long int n;
    cin>>n;
    long long int ans=0;
    
    if(n%2==1){
        cout<<0<<endl;
    }
    else{
    	long long int f=10;
        for(int i=0;i<50;i++){
            ans=ans+n/(f);
            f=5*f;
        }
        cout<<ans<<endl;
    }


    return 0;
}







Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    int a[101][101],b[101],c[101];
    int i,j;
    int n,m;
    scanf("%d %d",&n,&m);
    for(i=0;i<n;i++) {
        for (j=0;j<m;j++){
            scanf("%d", &a[i][j]);
        }
    }
    for(j=0;j<m;j++){
        scanf("%d",&b[j]);
    }
    for (i=0;i<n;i++) {
        c[i]=0;
        for(j=0;j<m;j++){
            c[i]=a[i][j]*b[j]+c[i];
        }
    }
    for (i=0;i<n;i++){
        printf("%d\n",c[i]);
    }
    return 0;
}


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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define PI 3.14159265358979
#define MOD 1000000007 // = 10^9 + 7

using namespace std;
using ll = long long;


void solve()
{
	int n;
	cin >> n;
	vector<int> p(n);
	for(int i = 0; i < n; ++i)
	{
		cin >> p[i];
	}

	int differ_num = 0;
	for(int i = 0; i < n; ++i)
	{
		if(p[i] != i + 1) differ_num++;
	}
	cout << (differ_num <= 2 ? "YES" : "NO");
}

int main()
{
	fastio;
	solve();

	return 0;
}

Measured memory_bytes: 3648
// finish date: 2018/02/18

#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvvi vector<vector<vector<int>>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vvd vector<vector<double>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define bigmod 1000000007
#define INF 1050000000
#define pii pair<int,int>


int main() {
    vvi c(3, vi(3));
    rep(i, 3) {
        rep(j, 3) {
            cin >> c[i][j];
        }
    }
    bool con1, con2, con3;

    FOR(i, 0, 101) {
        FOR(j, 0, 101) {
            FOR(k, 0, 101) {
                con1 = (c[0][0]-i)==(c[1][0]-j)&&(c[1][0]-j)==(c[2][0]-k);
                con2 =  (c[0][1]-i)==(c[1][1]-j)&&(c[1][1]-j)==(c[2][1]-k);
                con3 =  (c[0][2]-i)==(c[1][2]-j)&&(c[1][2]-j)==(c[2][2]-k);
                if(con1&&con2&&con3){
                    cout<<"Yes"<<endl;
                    return 0;
                }
            }
        }
    }
    cout<<"No"<<endl;

    return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string s;
    cin >> s;
    int count=0;
    
    for(int i=1;i<s.size();i++){
        if(s[i]==s[i-1]){
            count++;
            if(s[i] == '1') s[i]='0';
            else s[i]='1';
        }
    }
    
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;
class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner() {
        s = new string[0];
        i = 0;
    }

    public string next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int Int() {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0) {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++) {
            Array[i] = Int() + add;
        }
        return Array;
    }

    public long Long() {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0) {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++) {
            Array[i] = Long() + add;
        }
        return Array;
    }
}
class Program {
    
    static Scanner cin = new Scanner();
    static void Main() {
        //string X = Console.ReadLine();
        //string tmp = "";
        //long cnt = 0; //減らす文字数
        //for (int i = 0; i < X.Length; i++) {
        //    if(X[i] == 'S') {
        //        if (tmp == "") tmp += "S";
        //        else if (tmp[tmp.Length - 1] == 'S') tmp += "S";
        //        else {
        //            cnt += 2 * Math.Min(tmp.ToCharArray().Count(x => x == 'S'), tmp.ToCharArray().Count(x => x == 'T'));
        //            tmp = "S";
        //        }
        //    }
        //    else {
        //        if (tmp != "") tmp += "T";
        //    }
        //}

        //cnt += Math.Min(tmp.ToCharArray().Count(x => x == 'S'), tmp.ToCharArray().Count(x => x == 'T'));
        //Console.WriteLine(X.Length - cnt);

        int a = cin.Int();
        int b = cin.Int();
        int negative = 0, zero = 0;
        for (int i = a; i <= b; i++) {
            if (i == 0) zero++;
            else if (i < 0) negative++;
        }
        Console.WriteLine(zero > 0 ? "Zero" : negative % 2 == 0 ? "Positive" : "Negative");
        Console.ReadLine();
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
    int x,y,w,h,r;
    cin>>w>>h>>x>>y>>r;
    if(x-r<0||x+r>w||y-r<0                                  ||y+r>h)
        cout 
        
        
        << 
        
        "No" ;
    else cout << R"(Yes)"   
        ;
    
    
    
    cout <<  R"(
)";
}


Measured memory_bytes: 3096
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <math.h>
using namespace std;
typedef long long ll;
ll cnt[5], ans;
int main() {
	ll n;
	string s;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> s;
		if (s[0] == 'M')cnt[0]++;
		if (s[0] == 'A')cnt[1]++;
		if (s[0] == 'R')cnt[2]++;
		if (s[0] == 'C')cnt[3]++;
		if (s[0] == 'H')cnt[4]++;
	}
	for (int i = 0; i < 5; i++)for (int j = i + 1; j < 5; j++)for (int k = j + 1; k < 5; k++) {
		ans += cnt[i] * cnt[j] * cnt[k];
	}
	cout << ans << endl;
	return 0;
}

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

#define REP(i, start, count) for (int i = (start); i < (int)(count); ++i)
#define rep(i, count) REP(i, 0, count)
#define ALLOF(c) (c).begin(), (c).end()

using ll = long long;
using ull = unsigned long long;
using veci = vector<int>;
using vecll = vector<ll>;
using vecull = vector<ull>;

constexpr ll INF = 1LL << 60;

int main(void)
{
    ll N, W;
    cin >> N >> W;
    vecll w(N + 1);
    vecll v(N + 1);

    vecll vsum(N + 1);

    rep(i, N)
    {
        cin >> w[i + 1] >> v[i + 1];
        vsum[i + 1] = vsum[i] + v[i + 1];
    }

    vector<vecll> dp(N + 1, vecll(vsum[N] + 1, INF));

    rep(i, N + 1) {
        dp[i][0] = 0;
    }

    ll best = 0;
    for (int i = 1; i <= N; ++i)
    {
        for (int k = 0; k <= vsum[i]; ++k)
        {
            ll pk = max(0LL, k - v[i]);

            // dp[i][k] : 品物iまで選択してよいとき、価値kを達成するための最小のW
            // i をいれない : dp[i - 1][k]
            // i をいれる   : dp[i - 1][k - v[i]] + w[i]

            dp[i][k] = min(dp[i - 1][k], dp[i - 1][pk] + w[i]);

            if (dp[i][k] <= W) {
                best = max(best, (ll)k);
            }

        }
    }

    cout << best << endl;
    return 0;
}


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

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int r = 0, b = 0;
    for (char c : s) {
        if (c == 'R') r++;
        else b++;
    }
    cout << (r > b ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

MOD = 10**9 + 7

dp = [0] * (n+1)
flag = [False] * (n+1)
for i in a:
    flag[i] = True

dp[0] = 1
if 1 not in a:
    dp[1] = 1

for i in range(2, n+1):
    if flag[i]:
        continue
    dp[i] = (dp[i-1] + dp[i-2]) % MOD

print(dp[-1])

Measured memory_bytes: 8616
#include <stdio.h>
#define NIL -1
int F[45];

int fib(int );

main(){
  int n,i;
  F[0]=1;
  F[1]=1;
  scanf("%d",&n);
  for(i=2 ; i<45 ; i++){
    F[i] = NIL;
  }
  
  printf("%d\n",fib(n));
  
  return 0;
}

int fib(int n){
  int l;
  
  if(F[n] != NIL)return F[n];
  
  l = fib(n-1)+fib(n-2);
  F[n] = l;
  return l;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int x, y;
  cin >> x >> y;
  
  int count = 0;
  
  if (x == 1 || x == 3 || x == 5 || x == 7 || x == 8 || x == 10 || x == 12) {
    if (y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12) {
      count++;
      cout << "Yes" << endl;
    }
  }
  if (x == 4 || x == 6 || x == 9 || x == 11) {
    if (y == 4 || y == 6 || y == 9 || y == 11) {
      count++;
      cout << "Yes" << endl;
    }
  }
  if (x == 2 && y == 2) {
    count++;
    cout << "Yes" << endl;
  }
  if (count == 0) {
    cout << "No" << endl;
  }
  
  
  return 0;  
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <map>
using namespace std;
typedef long long ll;

ll n, ans, a[200005];
map<ll,ll> mp;
int main() {
	ll i;
	cin >> n;
	for(i=0; i<n; i++) {
		scanf("%lld", &a[i]);
		mp[i+a[i]]++;
	}
	for(i=0; i<n; i++) ans += mp[i-a[i]];
	cout << ans;
	return 0;
}

Measured memory_bytes: 27956
#include<bits/stdc++.h>
using namespace std;
#define FastRead ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long int
#define endl '\n'
#define ld long double
#define FOR(i,a,n) for (int i=(a);i<=(n);++i)
#define RFOR(i,a,n) for (int i=(n);i>=(a);--i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define ZERO(a) memset((a),0,sizeof((a)))
#define MINUS(a) memset((a),-1,sizeof((a)))
#define f first
#define s second
#define pb push_back
#define mk make_pair
#define all(g) g.begin(),g.end()
int fastMax(int x, int y) { return (((y-x)>>(32-1))&(x^y))^y; }
int fastMin(int x, int y) { return (((y-x)>>(32-1))&(x^y))^x; }

// #include <ext/pb_ds/assoc_container.hpp> // Common file
// #include <ext/pb_ds/tree_policy.hpp>     // Including tree_order_statistics_node_updat
// using namespace __gnu_pbds;
// typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

// I am questioning life and universe and 
// everything else after looking at this

ll n,d;

ll a[12][12];

bool distance(ll i,ll j){
    ll dist = 0;
    FOR(coord,1,d){
        dist = dist + (a[i][coord] - a[j][coord])*(a[i][coord] - a[j][coord]);
    }

    ll sqrt_dist = sqrt(dist + .0);
    return (sqrt_dist*sqrt_dist == dist);
}

void solve(){ 

    cin>>n>>d;

    FOR(i,1,n){
        FOR(j,1,d){
            cin>>a[i][j];
        }
    }

    ll ans = 0;

    FOR(i,1,n){
        FOR(j,i+1,n){
            ans += distance(i,j);
        }
    }

    cout<<ans<<endl;
}

signed main(){

   FastRead;    


    ll t;
    t = 1; 
   // cin>>t;
    FOR(i,1,t){
        // cout<<"Case "<<i<<":\n";
        solve();
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <cstdio>

using namespace std;

int main(void) {

    int i = 0;
    while (true) {
        int x;
        scanf("%d", &x);
        if (x == 0) { break; }
        printf("Case %d: %d\n", ++i, x);
    }

    return 0;
}

Measured memory_bytes: 1188