akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

signed main() {
    cin >> N >> K;
    vi a(N);
    cin >> a;
    for (int i = K; i < N; i++) {
        if (a[i] > a[i - K]) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
}

Measured memory_bytes: 4048
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner stdIn=new Scanner(System.in);
		long N=stdIn.nextLong();
		int ir=1;
		if(N<0)
			ir=-1;
		long a[]=new long[100];
		int ans[]=new int[100];
		String A="";String s="";
		int x=0;
		long pl=0,mi=0,z=1;
		int n=99;
		boolean key=false;
		if(N!=0)
		while(true){
			if(z>0)
				pl+=z;
			if(z<0)
				mi+=z;
			a[x]=z;
			z*=-2;
			if(N<0&&mi<=N){
				N-=a[x];
				ans[x]=1;
				z=1;mi=0;pl=0;x=-1;
			}
			if(N>0&&pl>=N){
				N-=a[x];
				ans[x]=1;
				z=1;mi=0;pl=0;x=-1;
			}
			if(N==0)
				break;
			x++;
		}
		while(n>=0){
			if(ans[n]==1)
				key=true;
			if(key)
				A+=String.valueOf(ans[n]);
			n--;
		}
		if(A.equals(s))
			System.out.println(0);
		else
			System.out.println(A);
	}
}


Measured memory_bytes: 23892
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int gcd1(int a, int b) { return b ? gcd1(b, a%b) : a; }
int main() {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll e = c/gcd1(c, d)*d;

    ll k=b-(b / c + b / d - b / e);
    ll l = a-1-((a-1) / c + (a-1) / d - (a-1 )/ e);
   // cerr << k << l << endl;
    
    cout << k - l << endl;

    return 0;
}

Measured memory_bytes: 384
import math
def main():
  n=int(input())
  p = list(map(int,input().split()))
  first=-1
  last=-1
  
  for i in range(0,n-1):
    if p[i]>p[i+1]:
      first=i
      break
  for i in reversed(range(1,n)):
    if p[i]<p[i-1]:
      last=i
      break
  
  if first!=-1 and last!=-1:
    tmp=p[first]
    p[first]=p[last]
    p[last]=tmp

  for i in range(0,n-1):
    if p[i]>p[i+1]:
      print("NO")
      break
    if i==n-2:
      print("YES")  
main()

Measured memory_bytes: 9168
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(int i=0;i<(n);++i)
#define RANGE(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(n)-1;i>= 0;--i)

#define endl '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define uset unordered_set
#define BIG 2000000000
#define VERYBIG 1000000000000000ll
#define PI 3.141592653589793238
#define dcout cout<<fixed<<setprecision(20)

const long long dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long
#define double long double

template<typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
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;}

typedef pair<int, int> INTP;
typedef vector<int> INTV;
struct edge2 {int to, cost;};
struct edge3 {int from, to, cost;};

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

  int N, M; string S; cin >> N >> M >> S;
  stack<int> ans;
  int pos = N;
  while(pos != 0){
  	bool change = 0;
  	for(int i = M; i > 0; i--){
  		int nxt = pos - i;
  		if(nxt < 0) continue;
  		if(S[nxt] == '1') continue;
  		ans.push(i);
  		pos = nxt;
  		change = 1;
  		break;
  	}
  	if(!change){
  		cout << -1 << endl;
  		return 0;
  	}
  }
  while(!ans.empty()){
  	cout << ans.top() << ' ';
  	ans.pop();
  }
  cout << endl;
}


Measured memory_bytes: 1232
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.NoSuchElementException;

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

	void run() {
		FastScanner sc=new FastScanner();
		int A=sc.nextInt();
		int B=sc.nextInt();
		System.out.println(A*B);
	}
	
	void tr(Object...objects) {System.out.println(Arrays.deepToString(objects));}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    
    public double nextDouble() { return Double.parseDouble(next());}
}


Measured memory_bytes: 32404
#include<stdio.h>


int main(void){

  int train[30];
  int count=0;
  int n;

  while(scanf("%d", &n)!=EOF){
    if(n==0){
      printf("%d\n", train[--count]);
    }
    else{
      train[count++]=n;
    }
  }

  return(0);
}



Measured memory_bytes: 1912
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
	ll d[2];
	clr(d,0);
	ll n;
	cin>>n;
	string s;
	cin>>s;
	rep(i,0,s.sz){
		if(s[i]=='R')d[0]++;
		else d[1]++;
	}
	if(d[0]>d[1]){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
N, m = map(int, input().split())
s = []
for _ in range(m):
    i = list(map(int, input().split()))
    s.append(i)
if N == 1:
  l = [i for i in range(0,10)]
else:
  l = [i for i in range(10**(N-1),10**N)]
for i in l:
  cnt = 0
  for j in s:
    if int(str(i)[j[0]-1]) != j[1]:
      cnt = 1
  if cnt == 0:
    print(i)
    exit(0)
print(-1)

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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int A = int.Parse(input[0]);
            int B = int.Parse(input[1]);
            if (A <= 8 && B <= 8)
            {
                Console.WriteLine("Yay!");
            }
            else
            {
                Console.WriteLine(":(");
            }
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
#define fast_io(); std::ios_base::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0);
const std::string yes = "Yes";
const std::string no  = "No";

int main(){
    int n,m;
    std::cin >> n;
    std::set<std::string> st;
    std::multiset<std::string> s,t;
    rep(i,n){
        std::string si;
        std::cin >> si;
        s.insert(si);
        st.insert(si);
    }
    std::cin >> m;
    rep(i,m){
        std::string ti;
        std::cin >> ti;
        t.insert(ti);
        //st.insert(ti);
    }

    int ans = 0;
    for(auto itr=st.begin(); itr!=st.end(); itr++){
        int buf = s.count(*itr);
        buf -= t.count(*itr);
        ans = std::max(ans, buf);
    }
    std::cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 3556
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=int(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
using ll = long long;

int main(){
    ll N;
    cin>>N;
    int ans=10;
    rep(i,1,sqrt(N)+1){
        if(N%i!=0) continue;
        ll A=i,B=N/i;
        int dA=0,dB=0;
        while(A){
            dA++;
            A/=10;
        }
        while(B){
            dB++;
            B/=10;
        }
        ans=min(ans,max(dA,dB));
    }
    cout<<ans<<endl;
}


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

using namespace std;
using ll=long long;
const ll mod = 1e9 + 7;
int dy[] = {1, -1, 0, 0};
int dx[] = {0, 0, 1, -1};

ll calcans(int N,vector<ll> a,ll b){
    ll ans=0;
    for (int i = 0; i <N ; ++i) {
        ans+=(ll)abs(a[i]-b);
    }
    return ans;
}

int main() {
    int N;
    cin>>N;
    vector<ll> a(N,0);

    for (int i = 0; i <N; ++i) {
        cin>>a[i];
        a[i]-=i+1;
        //cout<<a[i]<<" ";
    }
    sort(a.begin(),a.end());
    if(N%2){
        ll b=a[N/2];
        cout<<calcans(N,a,b)<<endl;
    }else {
        ll b = (a[N / 2] + a[N / 2 - 1]) / 2;
        if ((a[N / 2] + a[N / 2 - 1]) % 2) { //中央値が小数
            cout << min(calcans(N, a, b), calcans(N, a, b + 1))<<endl;
        } else {
            cout << calcans(N, a, b) << endl;
        }
    }
    return 0;
}



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

int mod = 1000000007;

int pow(int a, int b){
    long long c=1;
    rep(i,b){
        c*=a;
        c=c%mod;
    }
    return c;
}

int main() {
    int N,K;
    cin>>N>>K;
    ll ans = 0;
    vector<ll> kazu(K+1);
    vector<ll> ruizyou(K+1,-1);
    ll num;
    for(int i=K;i>0;i--){
        int syurui=K/i;
        if(ruizyou[syurui]==-1){
            num = pow(syurui,N);
            ruizyou[syurui]=num;
        }else{
            num = ruizyou[syurui];
        }

        if(syurui>=2){
            for(int j=2;j<syurui+1;j++){
                num-=kazu[i*j];
                if(num<0) num+=mod;
            }
        }
        kazu[i]=num;
        ans+=num*i;
        ans=ans%mod;
    }
    cout << ans << endl;
}

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

int main(){
	string s,t;
	int q;
	int a[100010],b[100010],c[100010],d[100010];
	cin >> s >> t;
	scanf("%d",&q);
	for(int i = 0 ; i < q ; i ++){
		scanf("%d%d%d%d",&a[i],&b[i],&c[i],&d[i]);
	}
	
	int cnt[2][100010] = {};
	for(int i = 0 ; i < s.size() ; i ++){
		if(s[i] == 'A')cnt[0][i+1] = cnt[0][i]+1;
		else cnt[0][i+1] = cnt[0][i]-1;
	}
	for(int i = 0 ; i < t.size() ; i ++){
		if(t[i] == 'A')cnt[1][i+1] = cnt[1][i]+1;
		else cnt[1][i+1] = cnt[1][i]-1;
	}
	for(int i = 0 ; i < q ; i ++){
		if((cnt[0][b[i]]-cnt[0][a[i]-1]+300000)%3 == (cnt[1][d[i]]-cnt[1][c[i]-1]+300000)%3)puts("YES");
		else puts("NO");
	}
}

Measured memory_bytes: 3200
from functools import reduce
inf = 10**10
import sys
input = sys.stdin.readline


def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
def gcd_list(numbers):
    return reduce(gcd,numbers)
n = int(input())
a = list(map(int,input().split()))
index = inf
if n == 2:
    print(max(a))
else:
    a.sort()
    if gcd(a[0],a[n-1]) == 1:
        print(max(gcd_list(a[1:n]),gcd_list(a[0:n-1])))
    else:
        ans = gcd(a[0],a[n-1])
        for i in range(1,n-1):
            if gcd(a[i]-a[0],a[n-1]-a[i]) <= ans:
                index = i
                ans = gcd(a[i]-a[0],a[n-1]-a[i])
        print(max(gcd_list(a[0:index]+a[index+1:n]),gcd_list(a[1:n]),gcd_list(a[0:n-1])))

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

using namespace std;

int main()
{
    int n;
    cin >> n;
    double t, a;
    cin >> t >> a;

    int min_index = -1;
    double min_diff = 1e100;
    for (int i = 1; i <= n; i++)
    {
        int h;
        cin >> h;
        double temp = t - 0.006 * h;
        const double diff = abs(a - temp);
        if (min_diff > diff)
        {
            min_diff = diff;
            min_index = i;
        }
    }
    cout << min_index << endl;
}

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

int main(){
	int H,W;
	cin>>H>>W;
	char a[H][W];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			cin>>a[i][j];
		}
	}
	int L[H][W];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			if(a[i][j]=='#')L[i][j]=0;
			else{
				if(j==0)L[i][j]=1;
				else{
					L[i][j]=L[i][j-1]+1;
				}
			}
		}
	}
	// for(int i=0;i<H;i++){
	// 	for(int j=0;j<W;j++){
	// 		cout << L[i][j];
	// 	}
	// 	cout << endl;
	// }
	int R[H][W];
	for(int i=0;i<H;i++){
		for(int j=W-1;j>=0;j--){
			if(a[i][j]=='#')R[i][j]=0;
			else{
				if(j==W-1)R[i][j]=1;
				else{
					R[i][j]=R[i][j+1]+1;
				}
			}
		}
	}
	int D[H][W];
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			if(a[i][j]=='#')D[i][j]=0;
			else{
				if(i==0)D[i][j]=1;
				else{
					D[i][j]=D[i-1][j]+1;
				}
			}
		}
	}
	int U[H][W];
	for(int i=H-1;i>=0;i--){
		for(int j=0;j<W;j++){
			if(a[i][j]=='#')U[i][j]=0;
			else{
				if(i==H-1)U[i][j]=1;
				else{
					U[i][j]=U[i+1][j]+1;
				}
			}
		}
	}
	int ans = 0;
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			ans = max(ans,L[i][j]+R[i][j]+D[i][j]+U[i][j]-3);
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 66688
#include <iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	int m, n,kk;
	cin >> m >> n>>kk;
	vector<vector<int> > t(m, vector<int>(n));
	string s = "JOI";
	for (int i = 0; i < m; i++) {
		string u;
		cin >> u;
		for (int j = 0; j < n; j++) {
			char x = u[j];
			for (int k = 0; k < 3; k++) {
				if (x == s[k]) {
					t[i][j] = k;
				}
			}
		}
	}
	vector<vector<vector<int> > > joi(m+1, vector<vector<int> >(n+1,vector<int>(3,0)));
	for (int i = 1; i <= m; i++) {
		for (int j = 1; j <= n; j++) {
			for (int k = 0; k < 3; k++) {
				joi[i][j][k] = joi[i - 1][j][k] + joi[i][j - 1][k] - joi[i - 1][j - 1][k];
			}
			joi[i][j][t[i-1][j-1]]++;
		}
	}
	vector<vector<int> > ans(kk,vector<int> (3));
	for (int i = 0; i < kk; i++) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		for (int k = 0; k < 3; k++) {
		    ans[i][k]=joi[c][d][k] - joi[c][b - 1][k] - joi[a - 1][d][k] + joi[a - 1][b - 1][k];
		}
	}
	for(int i=0;i<kk;i++){
	    for(int j=0;j<3;j++){
	        cout << ans[i][j];
	        if(j<2){
	            cout << " ";
	        }
	    }
	    cout << endl;
	}
}


Measured memory_bytes: 66364
#include<bits/stdc++.h>
using namespace std;
int n,a,b,tar;
int pos[20],cnt;

int step=1;
int stk[1<<20];

int main()
{
	cin >> n >> a >> b;
	tar=b^a;
	if(__builtin_popcount(tar)%2==0){
		puts("NO");return 0;
	}
	for(int i=0;i<n;i++)if((tar>>i)&1){
		pos[++cnt]=1<<i;
	}
	step=2;
	stk[2]=pos[1];
	for(int i=3;i<=cnt;i+=2){
		for(int j=step+1;j<=2*step;j++){
			stk[j]=pos[i]+stk[step+1-(j-step)];
		}
		for(int j=step*2+4;j<=step*4;j+=4){
			stk[j-3]=stk[j]=pos[i]+pos[i-1];
			stk[j-1]=stk[j-2]=pos[i-1];
		}
		int pos=step*2;
		for(int i=1;i<=step;i++){
			stk[++pos]+=stk[i];
			stk[++pos]+=stk[i];
		}
		step*=4;
	}
	for(int j=0;j<n;j++)if(((tar>>j)&1)==0){
		int last=step*2;
		for(int i=step;i;i--){
			stk[last--]=stk[i]; stk[last--]=stk[i];
		}
		for(int i=4;i <=step*2;i+=4){
			stk[i-1]+=1<<j;
			stk[i-2]+=1<<j;
		}
		step*=2;
	}
	puts("YES");
	for(int i=1;i<=step;i++)printf("%d ",stk[i]^a);
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define FOR(i, n, m) for (int i = m; i < n; i++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()

typedef long long ll;

/**
 * 不安なら ll を使う.
 * 小数は double を忘れない.
 * nC2の求め方 (1/2)*n*(n-1)
 * vector<型> 変数名(要素数, 初期値)
 * pair<型, 型> 変数名
 * map<型, 型> 変数名  // 連想配列
 * priority_queue<型> 変数名  // 最大値から出てくるヒープ
 * 比較するときは型まで注意
 * 区間の計算は累積和
*/

/* ===== コーナーケースに気をつけろ ===== */

int main()
{
    int N, M;
    cin >> N >> M;
    vector<int> A(N);
    double sum = 0;
    REP(i, N) {
        cin >> A.at(i);
        sum += A.at(i);
    }
    int cnt = 0;

    REP(i, N) {
        if (A.at(i) >= (double)sum / (4*M)) {
            ++cnt;
        }
    }
    cout << (cnt >= M ? "Yes" : "No") << endl;
    return 0;
}

Measured memory_bytes: 256
def main():
    A, B = map(int, input().split())
    S = list(input())
    ans = "Yes"
    for i, c in enumerate(S):
        if i < A and c == "-":
            ans = "No"
            break
        elif i == A and c != "-":
            ans = "No"
            break
        elif i > A and c == "-":
            ans = "No"
            break
    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 38384
#include <bits/stdc++.h>
#define lsb(x) (x & (-x))
#define ll long long
#define ull unsigned long long
#define Test(tt) cout << "Case #" << tt << ": "

using namespace std;

inline int firstBit(ll x) {
	int bit = 60;
	while(bit >= 0 && ((1LL << bit) & x) == 0) {
		bit--;
	}
	return bit;
}

int main() {
#ifdef HOME
    ifstream cin("B.in");
    ofstream cout("B.out");
#endif
    int i;
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

  	// A = 0...
  	// B = 1...

  	// A ... B ==> ok

  	// 1) firstBit(A) + 1  < firstBit(B)
  	// 2) firstBit(A) + 1 == firstBit(B)
  	
  	// 10001
  	// 01100

    ll A, B; cin >> A >> B;
    while(A > 0 && firstBit(A) == firstBit(B)) {
    	int bit = firstBit(A);
    	A ^= (1LL << bit);
    	B ^= (1LL << bit);
    }

    if(B == 0) {
    	assert(A == 0);
    	cout << 1;
    	return 0;
    }

    ll ans;

	int bit = firstBit(B ^ (1LL << firstBit(B)));
	B |= ((1LL << (bit + 1)) - 1);

	ll pw = 1;
	while(pw <= B) {
		pw *= 2LL;
	}

	if(B - (1LL << firstBit(B)) >= A) {	
		ans = pw - A;
	}
	else {
		ans = B - A + 1 + (pw / 2 - A);
	}
    
    cout << ans;

    return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {

        String s = sc.next();

        String ans = null;
        if (isYYMM(s) && isMMYY(s)) {
            ans = "AMBIGUOUS";
        } else if (isYYMM(s)) {
            ans = "YYMM";
        } else if (isMMYY(s)) {
            ans = "MMYY";
        } else {
            ans = "NA";
        }

        System.out.println(ans);
    }

    private static boolean isYYMM(String s) {
        int mm = Integer.valueOf(s.substring(2, 4));
        return s.substring(0, 2).matches("[0-9]{2}") && 0 < mm && mm <= 12;
    }

    private static boolean isMMYY(String s) {
        int mm = Integer.valueOf(s.substring(0, 2));
        return s.substring(2, 4).matches("[0-9]{2}") && 0 < mm && mm <= 12;
    }


}


Measured memory_bytes: 21588
#include<iostream>
#include<cstdio>
#include<iomanip>
#include<algorithm>
#include<cmath>
using namespace std;
int n, l, a[205], cnt=0, min1=(1<<30), b[205], mark;
int main()
{
	cin>>n>>l;
	for(int i=1; i<=n; i++)
	{
		a[i]=abs(i+l-1);
		cnt+=i+l-1;
		if(i+l-1<0)
			b[a[i]]=1;
	}
	sort(a+1, a+n+1);
	if(b[a[1]]==1)
		mark=cnt+a[1];
	else
		mark=cnt-a[1];
	cout<<mark<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int x,y,z;
	int a,b,c;
	
	while(1){
		scanf("%d %d",&x ,&y);
		if(x==0 && y==0) break;
		
		z=y-x;
		a=0; b=0; c=0;
		
		while(1){
			if(z>=1000){
				z-=1000;
				a++;
			}
			else if(z>=500){
				z-=500;
				b++;
			}
			else if(z>=100){
				z-=100;
				c++;
			}
			else if(z==0) break;
		}
		
		printf("%d %d %d\n",c ,b ,a);
	}
	
return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); i++)
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())
#define sort_g(v) sort(all(v), greater<int>())
#define dump(x) cerr << #x << ' ' << '=' << ' ' << x << endl

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

    int max_n = 0;
    rep(i, 100) {
        repi(j, 2, 100) {
            int N = pow(i, j);
            if(N > X) {
                break;
            } else {
                max_n = max(max_n, N);
            }
        }
    }

    cout << max_n << endl;
}

Measured memory_bytes: 256
function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  var d = input[1].split(" ").map(i => parseInt(i));
  d.sort(function(a,b){return a-b});
  var ans =0;
  if(d[N/2-1]!=d[N/2]){
    ans=d[N/2]-d[N/2-1];
  }

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 28236
#include <bits/stdc++.h>
#define ll long long
#define INF 0x3f3f3f3f
#define mem( f, x ) memset( f, x, sizeof( f ) )
#define pii pair<int, int>
#define fi first
#define se second
#define mk(x, y) make_pair( x, y )
#define pk push_back
using namespace std;
const int M = 1e5 + 5;
const int N = 1e5 + 5;
const double PI = acos(-1.0);
int m, n;

int main( ){
    ll x1, y1;
    ll x2, y2;
    while( scanf( "%lld %lld %lld %lld", &x1, &y1, &x2, &y2 ) != EOF ){
        ll num1 = x1/y2;
        ll num2 = x2/y1;
        if( x1%y2 ) num1++;
        if( x2%y1 ) num2++;
        if( num1 >= num2 ) printf( "Yes\n" );
        else printf( "No\n" );
    }
    return 0;
}


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

#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define OUT(a) cout << (a) << "\n"
#define ll long long
#define uint unsigned int
#define ushort unsigned short
#define ulong unsigned long

ll MOD = 10e9 + 7;
int n,m;

int dfs(vector<vector<int> > rinsetsu, vector<int> dist, int now) {
    if (dist[now] == n) return 1;
    int size = rinsetsu[now].size();
    int res = 0;
    REP(i, size) {
        if (dist[rinsetsu[now][i]] != 0) continue;
        dist[rinsetsu[now][i]] = dist[now] + 1;
        res += dfs(rinsetsu, dist, rinsetsu[now][i]);
        dist[rinsetsu[now][i]] = 0;
    }
    return res;
}

int main() {
    cin >> n >> m;
    auto rinsetsu = vector<vector<int> >(n, vector<int>());
    REP(i, m) {
        int a,b;
        cin >> a >> b;
        rinsetsu[a-1].push_back(b-1);
        rinsetsu[b-1].push_back(a-1);
    }
    vector<int> dist(n, 0);
    dist[0] = 1;
    cout << dfs(rinsetsu, dist, 0) << endl;
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <stdio.h>
#include <cmath>
#include <sstream>
#include <algorithm>
#include <iomanip>

#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define sz size()
#define x first
#define y second
#define pii pair<int, int>
#define pll pair<ll, ll>


using namespace std;

int a[20];

int main() {
	a[1] = a[3] = a[5] = a[7] = a[8] = a[10] = a[12] = 1;
	a[4] = a[6] = a[9] = a[11] = 2;
	a[2] = 3;
	int x, t;
	cin >> x >> t;
	if(a[x] == a[t]) {
		cout << "Yes";
	} else {
		cout << "No";
	}


	return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {

    sc.Split(bufio.ScanWords)
    n := nextInt()
    a := make(map[int]int)
    ans := "YES"
    for i := 0; i < n; i++ {
        aa := nextInt()
        _, ok := a[aa]
        if ok {
            ans = "NO"
            break
        } else {
            a[aa] = 0
        }
    }
    fmt.Println(ans)

}



//===========================
//
// Library
//
//===========================

//===========================
//  round(12.54, 0) -> 13.0
//  round(12.54, -1) -> 12.5
//===========================

func round(num float64, digit uint) float64 {
    d := float64(digit)
    return float64(int(num * math.Pow(10, d) + 0.5)) / math.Pow(10, d)
}

func max(a, b int) int {
    return int(math.Max(float64(a), float64(b)));
}

func min(a, b int) int {
    return int(math.Min(float64(a), float64(b)));
}

func gcd(x, y int) int {
    if y == 0 {
        return x
    }

    return gcd(y, x%y)
}

//===========================
//  var q Queue
//  q.Enqueue(n)
//  n := q.Dequeue()
//===========================
type Queue struct {
    data []int
}

func (q *Queue) Enqueue(n int) {
    q.data = append(q.data, n)
}

func (q *Queue) Dequeue() int {
    tmp := q.data[0]
    q.data = q.data[1:]
    return tmp
}

// 数値を桁区切りのスライスにする
func digit(n int, list []int) []int {
   if n > 0 {
       return digit(n/10, append(list, n%10))
   }
   return list
}

func sortIntsRev(list []int) {
    sort.Sort(sort.Reverse(sort.IntSlice(list)))
}

func strReverse(s string) string {
    runes := []rune(s)
    for i := 0; i < len(s)/2; i++ {
        runes[i], runes[len(s)-1-i] = runes[len(s)-1-i], runes[i]
    }
    return string(runes)
}

func nextInt() int {
    sc.Scan()
    i, _ := strconv.Atoi(sc.Text())
    return i
}

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



Measured memory_bytes: 12544
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T>
bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false;}
template<typename T>
bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false;}
// clang-format on

int calc(int n) {
    auto digit = [](int t) {
        int res = 0;
        while (t) {
            res += t % 10;
            t /= 10;
        } 
        return res;
    };
    int ans = 1 << 30;
    REP(i, n, 10000010) {
        int t = i - n;
        chmin(ans, digit(i) + digit(t));
    }
    return ans;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int number = atoi(s.c_str());
    int n = s.size();
    reverse(s.begin(), s.end());
    s += "0";
    int ans = 0;
    REP(i, 0, n) {
        int a = s[i] - '0';
        if (a > 5) {
            s[i + 1]++;
            ans += 10 - a;
        } else if (a < 5) {
            ans += a;
        } else {
            int nxt = s[i + 1] - '0';
            if (nxt >= 5) {
                s[i + 1]++;
            }
            ans += 5;
        }
    }
    ans += (s.back() > '0');
    cout << ans << endl;
    dump(number, calc(number));
    return 0;
}


Measured memory_bytes: 1948
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

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

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

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

// Data :
type Data struct {
	day, pay int
}

// Datas :
type Datas []Data

func (p Datas) Len() int {
	return len(p)
}

func (p Datas) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p Datas) Less(i, j int) bool {
	return p[i].day < p[j].day
}

// Priority Queue
type Item struct {
	priority, index int
}

type PQ []*Item

func (pq PQ) Len() int {
	return len(pq)
}

func (pq PQ) Less(i, j int) bool {
	return pq[i].priority > pq[j].priority
}

func (pq PQ) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *PQ) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Item)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *PQ) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	item.index = -1
	*pq = old[0 : n-1]
	return item
}

// End Priority Queue
func search(day, M int, used []bool) (int, bool) {
	for i := M - day; i >= 0; i-- {
		if used[i] == false {
			return i, true
		}
	}
	return -1, false
}

func main() {
	sc.Split(bufio.ScanWords)

	N, M := getInt(), getInt()

	var J Datas
	J = make(Datas, N)
	for i := 0; i < N; i++ {
		a, b := getInt(), getInt()
		J[i] = Data{a, b}
	}

	sort.Sort(J)
	// out(J)
	pq := make(PQ, 0)
	heap.Init(&pq)

	idx := 0
	ans := 0
	for i := 1; i <= M; i++ {
		// out(i)
		for idx != len(J) && J[idx].day == i {
			heap.Push(&pq, &Item{J[idx].pay, 0})
			idx++
		}
		if pq.Len() == 0 {
			continue
		}
		item := heap.Pop(&pq).(*Item)
		ans += item.priority
	}
	out(ans)
}


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

int main() {
  int N, A;
  cin >> N >> A;

  if ( A >= (N % 500) ) {
    cout << "Yes"<< endl;
  }
  else {
    cout << "No" << endl;
  }
  // ここにプログラムを追記
}

Measured memory_bytes: 256
use proconio::*;

fn main() {
    input! {
        n:usize,
        d:[(i64, i64); n],
    }

    let mut f = false;
    for i in 0..n - 2 {
        if d[i].0 == d[i].1 && d[i + 1].0 == d[i + 1].1 && d[i + 2].0 == d[i + 2].1 {
            f = true;
            break;
        }
    }

    if f {
        println!("Yes");
    } else {
        println!("No");
    }
}


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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

#define UF_NUM 505050

li a[222];
li b[222];

int main() {
    li n, m, c;
    cin >> n >> m >> c;
    rep(i, m) {
        cin >> b[i];
    }

    li res = 0;
    rin{
        li tmp = 0;
        rep(j, m) {
            cin >> a[j];
            tmp += b[j] * a[j];
        }
        tmp += c;
        if (tmp > 0)res++;
    }
    cout << res << endl;


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sz(v)   ((int)(v).size())
#define  all(v)    ((v).begin()),((v).end())
#define  allr(v)    ((v).rbegin()),((v).rend())
#define   pb         push_back
#define   mp         make_pair
#define    clr(v,d)      memset( v, d ,sizeof(v))
#define     PI                       acos(-1)
typedef  long long     ll ;
typedef  unsigned long long ull;
const double eps= (1e-9);
using namespace std;
int dcmp(long double a,long double b){   return fabsl(a-b)<=eps ? 0: (a>b)? 1:-1  ;}
int getBit(ll num, int idx) {return ((num >> idx) & 1ll) == 1;}
int setBit1(int num, int idx) {return num | (1<<idx);}
ll setBit0(ll num, int idx) {return num & ~(1ll<<idx);}
ll flipBit(ll num, int idx) {return num ^ (1ll<<idx);}
void GO(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);}
int countNumBit1(int mask) {int ret=0; while (mask) 	{mask &= (mask-1);++ret;	}return ret;}
const int N=300000+5,mod=1e9+7;

int main(){
    GO();

    int T;
   // cin>>T;
   T=1;
    while(T--){

        string s,t;
        cin>>s>>t;
        int mi=INT_MAX;
        for(int i=0;i<sz(s);i++)
        {
            if(i+sz(t)-1>=sz(s)) break;
            int cnt=0;
            for(int j=i;j<i+sz(t);j++){
                if(s[j]!=t[j-i]) cnt++;
            }
            mi=min(mi,cnt);
        }
        cout<<mi<<"\n";

    }

}





































































Measured memory_bytes: 3664
N,M = map(int,input().split())
A = [int(x) for x in input().split()]

cnt = 0
for i in range(N) :
    if A[i] >= sum(A) * 1 / (4*M) :
        cnt += 1

if cnt >= M :
    print("Yes")
else :
    print("No")

Measured memory_bytes: 3060
#include<iostream>
using namespace std;
int main(void)
{
    int a,b,c;
    int count=0;
    cin>>a>>b>>c;
    for(int i=a;i<=b;++i)
    {
        if(c%i==0)
        {
            count++;
        }
    }
    cout<<count<<endl;
}


Measured memory_bytes: 3124
#include <bits/stdc++.h>
#define int int64_t
#define rp(i, N) for(int i=0; i<N; i++);
using namespace std;
using pair = pair<int, int>;
using tup  = tuple<int, int, int>;
using vec  = vector<int>;
using vvec = vector<vec>;
const int INF = 100000000;
// " ", ' '

// プロトタイプ宣言
// int myfunc(int, vvec);

// グローバル変数
// int N, M;
// vvec data(N, vec(M));

// 関数：

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	string S, T;
	cin >> S; cin >> T;

	int ct = 0;
	for(int i=0; i<3; i++) {
		if(S.at(i)==T.at(i)) ct += 1;
	}

	cout << ct << endl;
}


Measured memory_bytes: 256
import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.List;
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		
		System.out.println((A + B >= C)?"Yes":"No");
	}
}

Measured memory_bytes: 21844
a,b = gets.split.map &:to_i
s = gets.chomp

f = true
for i in 0...a
  f = false if s[i]=='-'
end

f = false if s[a]!='-'

for i in 0...b
  f = false if s[a+i+1]=='-'
end

puts f ? 'Yes' : 'No'

Measured memory_bytes: 1788
import re,sys
def S(): return sys.stdin.readline().rstrip()
S = S()
str = 'keyence'
pattern_keyence = []
for i in range(len(str)+1):
    pattern_keyence.append(r'{}'.format(str[:i]+'.*'+str[i:]))
for p in pattern_keyence:
    if re.fullmatch(p,S):
        print('YES')
        break
else:
    print('NO')


Measured memory_bytes: 3188
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)

int main(){
    int n,k;
    cin >> n >> k;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    cout << (n-3 + k)/ (k-1) << endl;
    return 0;

}


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

namespace AtCoder2 {
	class Program {
		static void Main(string[] args) {
          
          
			var inputArray = retreiveLongArray();
			var inputCount = 2;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			long A = inputArray[0];
			long V = inputArray[1];

			var input2 = retreiveLongArray();
			long B = input2[0];
			long W = input2[1];
			var input3 = retreiveLongArray();
			long T = input3[0];

			//逃げる子供が早い時は捕まえられない
			if (V <=W) {
				Console.WriteLine("NO");
				return;
			}

			var kyori = Math.Abs(A - B);

			var oitukerukyori = T * (V - W);

			if (oitukerukyori >= kyori) {
				Console.WriteLine("YES");
			}
			else {
				Console.WriteLine("NO");
			}

		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray = Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static long[] retreiveLongArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var longArray = inputArray.Select(s => long.Parse(s));
			return longArray.ToArray();
		}
	}
}

Measured memory_bytes: 28240
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll h, w; int n; cin >> h >> w >> n;
  map<pair<ll, ll>, int> mp;
  rep(i, n) {
    ll a, b;
    cin >> a >> b;
    a--; b--;
    for(int j=-1; j<=1; j++) {
      for(int k=-1; k<=1; k++) {
        if(a+j<=0 || a+j>=h-1 || b+k<=0 || b+k>=w-1) continue;
        mp[{a+j, b+k}]++;
      }
    }
  }
  vector<ll> cnt(10);
  for(auto ele: mp) cnt[ele.second]++;
  cnt[0] = (h-2)*(w-2) - accumulate(cnt.begin()+1, cnt.end(), 0LL);
  rep(i, 10) cout << cnt[i] << "\n";
  return 0;
}


Measured memory_bytes: 59804
using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
class Program
{
	static void Main()
	{
		string s = Console.ReadLine();
    string[] input = Console.ReadLine().Split(' ');//Splitで区切り文字を指定して複数個受け取る。
		long x = long.Parse(input[0]);
		long y = long.Parse(input[1]);
    long[,] dpx = new long[2,16001];//可能な到達地点+8000。0を保存、1で更新する
    long[,] dpy = new long[2,16001];
    bool answer = false;
    long memoForward = 0;
    long turnCount = 0;

    for(long i = 0; i < s.Length; i++)
    {
      if(s[(int)i] == 'F') memoForward++;
      if(s[(int)i] == 'T' || i == s.Length-1)
      {
        if(turnCount == 0)
        {
          dpx[0,memoForward+8000] = 1;
        }else if(turnCount == 1)
        {
          dpy[0,memoForward+8000] = 1;
          dpy[0,-memoForward+8000] = 1;
        }else if(turnCount % 2 == 0)
        {
          for(long j = 0; j < 16001; j++)
          {
            if(dpx[0,j] == 1)
            {
              dpx[1,j-memoForward] = 1;
              dpx[1,j+memoForward] = 1;
            }
          }
          for(long j = 0; j < 16001; j++)
          {
            dpx[0,j] = dpx[1,j];
            dpx[1,j] = 0;
          }
        }else if(turnCount % 2 == 1)
        {
          for(long j = 0; j < 16001; j++)
          {
            if(dpy[0,j] == 1)
            {
              dpy[1,j-memoForward] = 1;
              dpy[1,j+memoForward] = 1;
            }
          }
          for(long j = 0; j < 16001; j++)
          {
            dpy[0,j] = dpy[1,j];
            dpy[1,j] = 0;
          }
        }
        turnCount++;
        memoForward = 0;
      }
    }
    
    if(turnCount >= 2) Console.WriteLine((dpx[0,x+8000] == 1 && dpy[0,y+8000] == 1) ? "Yes" : "No");
    else Console.WriteLine((s.Length == x && y == 0) ? "Yes" : "No");
    
	}
}


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

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;
typedef tuple<ll, ll, char, ll> t4;

#define rep(a,n) for(ll a = 0;a < n;a++)
#define repi(a,b,n) for(ll a = b;a < n;a++)

const ll mod = 1000000007;

struct edge {
	ll to;
	ll cost;
};

int main(void)
{
	ll v, e, r;
	cin >> v >> e >> r;
	vector<vector<edge>> g(v);
	rep(i, e) {
		ll s, t, d;
		cin >> s >> t >> d;
		g[s].push_back({ t,d });
	}
	priority_queue<P, vector<P>, greater<P>> q;
	q.emplace(0, r);
	vector<bool> visit(v, false);
	vector<ll> distance(v, -1);
	while (!q.empty()) {
		auto p = q.top(); q.pop();
		auto d = p.first ;
		auto c = p.second;
		if (distance[c] >= 0) continue;
		distance[c] = d;
		for (auto element : g[c]) {
			auto to = element.to;
			if (distance[to] >= 0) continue;
			q.emplace(d + element.cost, to);
		}
	}
	rep(i, v) {
		if (distance[i] < 0) cout << "INF" << endl;
		else cout << distance[i] << endl;
	}
	return 0;
}



Measured memory_bytes: 21548
import types

# from atcoder.dsu import DSU

_atcoder_code = """
# Python port of AtCoder Library.
"""

atcoder = types.ModuleType('atcoder')
exec(_atcoder_code, atcoder.__dict__)

_atcoder_dsu_code = """
import typing


class DSU:
    '''
    Implement (union by size) + (path compression)
    Reference:
    Zvi Galil and Giuseppe F. Italiano,
    Data structures and algorithms for disjoint set union problems
    '''

    def __init__(self, n: int = 0):
        self._n = n
        self.parent_or_size = [-1] * n

    def merge(self, a: int, b: int) -> int:
        assert 0 <= a < self._n
        assert 0 <= b < self._n

        x = self.leader(a)
        y = self.leader(b)

        if x == y:
            return x

        if -self.parent_or_size[x] < -self.parent_or_size[y]:
            x, y = y, x

        self.parent_or_size[x] += self.parent_or_size[y]
        self.parent_or_size[y] = x

        return x

    def same(self, a: int, b: int) -> bool:
        assert 0 <= a < self._n
        assert 0 <= b < self._n

        return self.leader(a) == self.leader(b)

    def leader(self, a: int) -> int:
        assert 0 <= a < self._n

        if self.parent_or_size[a] < 0:
            return a

        self.parent_or_size[a] = self.leader(self.parent_or_size[a])
        return self.parent_or_size[a]

    def size(self, a: int) -> int:
        assert 0 <= a < self._n

        return -self.parent_or_size[self.leader(a)]

    def groups(self) -> typing.List[typing.List[int]]:
        leader_buf = [self.leader(i) for i in range(self._n)]

        result = [[] for _ in range(self._n)]
        for i in range(self._n):
            result[leader_buf[i]].append(i)

        return list(filter(lambda r: r, result))
"""

atcoder.dsu = types.ModuleType('atcoder.dsu')
exec(_atcoder_dsu_code, atcoder.dsu.__dict__)
DSU = atcoder.dsu.DSU



def main() -> None:
    import sys

    n, q = map(int, sys.stdin.readline().split())
    dsu = DSU(n)

    for _ in range(q):
        t, u, v = map(int, sys.stdin.readline().split())
        if t == 0:
            dsu.merge(u, v)
        if t == 1:
            if dsu.same(u, v):
                print(1)
            else:
                print(0)


if __name__ == '__main__':
    main()



Measured memory_bytes: 13148