akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define ll long long
using namespace std;

int n, m, aim, fa[101000], a[101000], id[101000], die[101000], sz[101000];
ll ans;

int GF(int x){
  return x==fa[x]? x: fa[x]=GF(fa[x]);
}

bool cmp(int x,int y){
  return a[x]<a[y];
}

int main(){
  cin>>n>>m; aim=(n-1-m)*2;
  for (int i=1;i<=n;++i) scanf("%d",&a[fa[i]=id[i]=i]);
  sort(id+1,id+n+1,cmp);
  int x, y, las=aim;
  for (;m--;){
    scanf("%d%d",&x,&y); ++x; ++y;
    fa[GF(x)]=GF(y);
  }
  for (int i=1;i<=n&&las;++i){
    x=id[i];
    if (sz[GF(x)]) continue;
    die[x]=1; ++sz[GF(x)]; ans+=a[x]; --las;
  }
  for (int i=1;i<=n&&las;++i){
    x=id[i];
    if (die[x]||(sz[GF(x)]+1)*2>aim) continue;
    die[x]=1; ++sz[GF(x)]; ans+=a[x]; --las;
  }
  if (las) return 0*puts("Impossible");
  cout<<ans<<endl;
}

Measured memory_bytes: 2304
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string s;
  cin>>n>>s;
  if(n%2==0){
    int bb=0;
    for(int i=0;i<n/2;i++){
      if(s[i]==s[n/2+i]){
        bb++;
      }
    }
    if(bb==n/2){
      cout<<"Yes"<<endl;
    }
    else{
      cout<<"No"<<endl;
    }
  }
  else{
    cout<<"No"<<endl;
  }
        
}

Measured memory_bytes: 256
S=gets.chomp
T=gets.chomp

def eq?(str1,str2)
	0.upto(str1.size){|i|
		if(str1[i]!="?" && str1[i]!=str2[i])
			return false
		end
	}
	return true
end

(S.size-1-T.size+1).downto(0){|i|
	if(eq?(S[i..(i+T.size-1)], T))
		S[i..(i+T.size-1)]=T
		puts S.gsub(/\?/, "a")
		exit(0)
	end
}
puts "UNRESTORABLE"

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

int main() {
  long long N;
  cin >> N;
  
  long long ans=N-1;
  for(int i=1;i<=sqrt(N);i++){
    if(N%i==0){
      long long x = (i-1) + (N/i-1);
      ans = min(ans,x);
    }
  }
  
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		List<Integer> L = new ArrayList<Integer>();
		
		for(int i=0;i<N;i++) {
			L.add(sc.nextInt());
		}
		
		Collections.sort(L);
		//小さい順に並んでいる。
		
		
		//三角形ができない組み合わせを数える。
		long count=0;
		long count_memo=0;
		
		int sh =0;
		int mi =0;
		int sum=0;
		for(int i=0;i<N-2;i++) {
			sh=L.get(i);
			for(int j=i+1;j<N-1;j++) {
				mi=L.get(j);
				sum = sh + mi;
				int k=L.size();
				count_memo=count;
				while(sum<=L.get(k-1)) {
					count++;
					k--;
				}
				if(count_memo==count) {
					break;
				}
			}
		}
		
		//組み合わせの総数　
		long total = (N*(N-1)*(long)(N-2))/(3*2); 
		
		long ans = total-count;
		
		System.out.println(ans);
	}
}


Measured memory_bytes: 26604
#include <iostream>
using namespace std;
int main(void){
 int a,b,c,d;
 cin>>a;
 cin>>b>>c;
 d=0;
 for(int i=b;i<c+1;i++){
     if(i%a==0){
         d++;
     }
 }
 if(b%a==0){
     cout<<"OK"<<endl;
 }
 
 else if(d==0){
     cout<<"NG"<<endl;
 }
 else{
     cout<<"OK"<<endl;
 }
   
    
}


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

int main() {
  int n; cin >> n;
  rep(i,9) {
    rep(j,9) {
      if ((i+1) * (j+1) == n) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int r, d, xi;
	cin >> r >> d >> xi;

	for (int i = 0; i < 10; ++i) {
		long long curr = (long long) r * xi - d;
		xi = curr;
		cout << curr << "\n";
	}

	return 0;

}

Measured memory_bytes: 256
using System;
using static System.Console;
using static System.Math;
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 = Read().Split(' ');
            int a = int.Parse(input[0]);
            int b = int.Parse(input[1]);

            if (a + b >= 24)
            {
                Write(Abs(24 - (a + b)));
            }
            else Write(a + b);
        }

        //メインじゃない関数
        private static string Read() { return ReadLine(); }
        private static int ReadI() { return int.Parse(ReadLine()); }
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
#define fi first
#define se second
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int (i) = 1; (i) <= (n); (i++))
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define yn {puts("Yes");}else {puts("No");}
#define printd(x) printf("%.12f\n", x);
template<class T> bool chmin(T& a, const T& b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> bool chmax(T& a, const T& b) {if (a < b) {a = b; return 1;} return 0;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

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


	vector<int> numR(n + 1, 0), numG(n + 1, 0), numB(n + 1, 0);
	for (int i = n - 1; i >= 0; i--) {
		if (s[i] == 'R') numR[i]++;
		if (s[i] == 'G') numG[i]++;
		if (s[i] == 'B') numB[i]++;
	}

	for (int i = n - 1; i >= 0; i--) {
		numB[i] += numB[i + 1];
		numG[i] += numG[i + 1];
		numR[i] += numR[i + 1];
	}

	ll ans = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (s[i] == s[j]) continue;
			if (s[i] == 'R' && s[j] == 'G' || s[i] == 'G' && s[j] == 'R') {
				ans += numB[j + 1];
				if (j - i + j < n) {
					if (s[j - i + j] == 'B') ans--;
				}
			}
			else if (s[i] == 'G' && s[j] == 'B' || s[i] == 'B' && s[j] == 'G') {
				ans += numR[j + 1];
				if (j - i + j < n) {
					if (s[j - i + j] == 'R') ans--;
				}
			}
			else {
				ans += numG[j + 1];
				if (j - i + j < n) {
					if (s[j - i + j] == 'G') ans--;
				}
			}
		}
	}

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

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

int size(long X){
    int cnt=0;
    for(int i = 0; i<10 ; i++){
        if(X/10 == 0){
            cnt++;
            break;
        }
        X = X/10;
        cnt++;
    }
    return cnt;
}

long calc(long X){
    vector<long> ten{1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000,10000000000};
    vector<long> two{1,1,2,4,8,16,32,64,128,256,512,1024,2048};
	long Xsize = size(X);
    long A = X/ ten.at(Xsize-1);
    if(Xsize == 1){
        return X;
    }

    long N=0;
    for(int i = 0; i < Xsize; i++){
        N += ten.at(Xsize-1-i) * two.at(i);
    }
    long down = X%ten.at(Xsize-1);
    long ans = N*A + calc(down)*2;
    return ans;
}


int main(){
    long X;
    cin >> X;
    cout << calc(X) << endl;
}

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

int main()
{
  int num;
  int skill;
  cin >> num >> skill;
  unsigned int enemy[num];
  for(int i = 0; i < num; i++)
  {
    cin >> enemy[i];
  }
  sort(enemy, enemy + num);
  long long sum = 0;
  for(int i = 0; i < num - skill; i++)
  {
    sum += enemy[i];
  }
  cout << sum << endl;
}


Measured memory_bytes: 1024
/**
 * Title: D - Gathering Children
 * Url: https://atcoder.jp/contests/abc136/tasks/abc136_d
 */
#include<bits/stdc++.h>

using namespace std;

#define ll long long

const int ODD = 1;
const int EVEN = 0;

const int MAX_N = 100000;
int r[MAX_N][2];
int l[MAX_N][2];

int main() {
    string s; cin >> s;
    vector<int> ans(s.length());
    for(int i=0; i<s.length(); i++) {
        if(s[i]=='R') {
            r[i+1][ODD] = r[i][EVEN]+1;
            r[i+1][EVEN] = r[i][ODD];
        }
    }

    for(int i=s.length()-1; i>=0; i--) {
        if(s[i]=='L') {
            l[i-1][ODD] = l[i][EVEN]+1;
            l[i-1][EVEN] = l[i][ODD];
        }
    }

    for(int i=0; i<s.length(); i++) {
        if(s[i]=='R'&&s[i+1]=='L') {
            ans[i] = r[i+1][ODD]+l[i][EVEN];
            ans[i+1] = r[i+1][EVEN]+l[i][ODD];
        }
    }

    for(int i=0; i<s.length(); i++) {
        if(i==s.length()-1) {
            cout << ans[i] << endl;
        } else {
            cout << ans[i] << " ";
        }
    }

    return 0;
}

Measured memory_bytes: 2560
/**
  * author : thegeniushead
**/
#include <bits/stdc++.h>
 
/*.....DEFINITIONS...... */
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define T() int tt; cin>>tt; while(tt--)
#define rep(i,start,lim) for(int i=start;i<lim;i++)
#define rep1(i,start,lim) for(int i=start; i<=lim; ++i)
#define repd(i,start,lim) for(int i=start;i>=lim;i--)
#define mp make_pair
#define pb push_back
#define lchild (2*node+1)
#define rchild (2*node+2)
#define ff first
#define ss second
#define br cout<<"\n"
#define MOD (1000000007LL)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define eps (1e-6)
#define sll(n) scanf("%lld", &n);
#define si(n) scanf("%d", &n);
#define what_is(x) cerr << #x << " is " << x << "\n";
#define int long long int
#define infll 9e18
#define inf 1e12

using namespace std;
 
/*.....TYPEDEFS ....*/
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef long double ld;
 
/*....USEFUL FUNCTIONS....*/
ll pwr(ll base, ll exp, ll mod=MOD){ll res=1; while(exp>0){if(exp%2){res=(res*base)%mod;}base=(base*base)%mod;exp/=2;}return res;}
ll gcd(ll a, ll b){ if(b==0)return a; else gcd(b, a%b);}
bool isPrime(ll n){if(n<=1)return false;if(n<=3)return true;if (n%2==0||n%3==0)return false;for(int i=5; i*i<=n; i=i+6)if(n%i==0||n%(i+2)==0)return false;return true;}
 
/*....I/O Functions...*/
inline string rs(){char x[1234567];scanf("%s", x);string s = x; return s;}
inline int ri(){int x; scanf("%d", &x);return x;}
inline long long rl(){long long x; scanf("%lld", &x); return x;}
 
/*---------Solution below this line --------*/
 
const int N = 1234567;

string s, t;

bool isPali(string t){
	int l = 0, r = t.length() - 1;
	while(l < r){
		if(t[l] != t[r]) return false;
		++l, --r;
	}
	return true;
}



int32_t main()
{
	FIO
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	
	cin >> s;
	
	rep(i,0,s.length()){
		if(s[i]!= 'x') t += s[i];
	}
	
	if(!isPali(t)){
		return cout << -1, 0;
	}
	
	int l = 0, r = s.length() - 1;
	
	int res = 0;
	
	while(l <= r){
		if((s[l]=='x' and s[r]=='x') or (s[l]!='x' and s[r]!='x')) {
			++l, --r;
			continue;
		}
		if(s[l]=='x'){
			++res, ++l;
		}
		if(s[r]=='x'){
			++res, --r;
		}
	}
	
	cout << res << '\n';
	
	
	return 0;
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
using namespace std;
int x[105];
int main() {
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> x[i];
	}
	int ans = 1e9;
	for (int p = 1; p <= 100; p++) {
		int temp = 0;
		for (int i = 1; i <= n; i++) {
			temp += (p - x[i])*(p - x[i]);
		}
		ans = min(ans, temp);
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<ctime>
#include<map>
#include<bitset>
#include<set>
#include<assert.h>
#include<chrono>
#include<random>
#define LL long long
#define mp(x,y) make_pair(x,y)
#define pll pair<long long,long long>
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline LL read()
{
	LL f=1,x=0;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
int stack[20];
template<typename T>inline void write(T x)
{
	if(x<0){putchar('-');x=-x;}
    if(!x){putchar('0');return;}
    int top=0;
    while(x)stack[++top]=x%10,x/=10;
    while(top)putchar(stack[top--]+'0');
}
template<typename T>inline void pr1(T x){write(x);putchar(' ');}
template<typename T>inline void pr2(T x){write(x);putchar('\n');}
template<typename T>inline void chkmin(T &x,T y){x=x<y?x:y;}
template<typename T>inline void chkmax(T &x,T y){x=x>y?x:y;}
const int MAXN=1000005;
const int mod=1e9+7;
int f[MAXN],g[2*MAXN],n;
void ad(int &x,int y){x+=y;if(x>=mod)x-=mod;}
void dl(int &x,int y){x-=y;if(x<0)x+=mod;}
int main()
{
	n=read();f[0]=1;int sum=0;
	for(int i=0;i<=n;i++)
	{
		ad(sum,g[i]);
		ad(f[i],sum);
		if(i<n)
		{
			ad(g[i+1],f[i]);
			dl(g[i+2],f[i]);ad(g[i+3],f[i]);
			dl(g[i+(n+1)+1],f[i]);
		}
	}
	int ans=0;
	for(int i=n+1;i<=2*n;i++)
	{
		ad(sum,g[i]);
		ad(ans,sum);
	}
	for(int i=0;i<n-1;i++)ad(ans,1LL*f[i]*(n-1)%mod*(n-1)%mod);
//	ad(ans,1LL*f[n-1]*(n-1)%mod);
	ad(ans,f[n]);
	pr2(ans);
	return 0;
}



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

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1e9+7; 
//}}}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string a,b;
	cin >> a >> b;
	int as = a.size(),bs = b.size();
	if(as < bs){
		cout << "LESS\n";
		return 0;
	}
	else if(as > bs){
		cout << "GREATER\n";
		return 0;
	}
	if(a == b) cout << "EQUAL\n";
	else if(a > b) cout << "GREATER\n";
	else cout << "LESS\n";
	return 0;
}


Measured memory_bytes: 256
import math

A, B, H, M = map(int, input().split())

KA = H / 12 * 360 + ((M / 60) * (360 / 12))
KB = M / 60 * 360

K = abs(KA - KB)
if K > 180:
    K = 360 - K
# if K == 180:
#     print(A + B)
#     exit()
# if K == 0:
#     print(abs(B - A))
#     exit()
# cosB = round(math.cos(math.radians(K)), 13)
cosB = math.cos(math.radians(K))
cc = A ** 2 + B ** 2 - (2 * B * A * cosB)
print(math.sqrt(cc))


Measured memory_bytes: 9504
package main

import (
	"bufio"
	"fmt"
	"os"
)

var scan = bufio.NewScanner(os.Stdin)

func main() {
	index := 1
	for {
		input := scanNextValue()
		if input == "0" {
			break
		}

		fmt.Printf("Case %d: %s\n", index, input)
		index++
	}
}

func scanNextValue() string {
	scan.Scan()
	return scan.Text()
}



Measured memory_bytes: 1404
#include <bits/stdc++.h>
using namespace std;
using ll = long long; using ull = unsigned long long;
//#define int ll
using vb = vector<bool>; using vvb = vector<vb>;
using vi = vector<int>; using vvi = vector<vi>;
using vl = vector<ll>; using vvl = vector<vl>;
template<class T> using V = vector<T>;
template<class T> using VV = vector<V<T>>;
#define fi first
#define se second
#define maxs(x,y) (x=max(x,y))
#define mins(x,y) (x=min(x,y))
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); ++i)
#define REP(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(ll i = (ll)(b)-1;i >= a;--i)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1), EPS = 1e-10;
const ll MOD = 1e9+7;
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,x;
  cin >> n >> x;
  vi l(n);
  REP(i,n) cin >> l[i];
  int d = 0;
  int ans = 0;
  while(ans<n){
    d += l[ans];
    if(d>x) break;
    ans++;
  }
  cout << min(ans+1,n+1) << endl;
}


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

int main(){
    string s;
    cin >> s;
    string d = "abcdefghijklmnopqrstuvwxyz";
    for(int i=0;i<d.size();i++){
        if(s.find(d[i]) == string::npos){
            cout << d[i] << endl;
            return 0;
        }
    }
    cout << "None" << endl;

return 0;
}

Measured memory_bytes: 512
size = int(input())
a = list(map(int,input().split()))

tmpmax = a[0]
tmpmin = a[0]
tmpsum = 0
for i in range(size):
    if tmpmax < a[i]:
        tmpmax = a[i]
    if tmpmin > a[i]:
        tmpmin = a[i]
    tmpsum += a[i]
    
print(str(tmpmin) + " " + str(tmpmax) + " " + str(tmpsum))



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

const int MAX_H=100;
int h, w;
string c[MAX_H];

int main(){
	cin >> h >> w;
	for(int i=0;i<h;i++){
		cin >> c[i];
	}
	for(int i=0;i<w+2;i++){
		cout << "#";
	}
	cout << endl;
	for(int i=0;i<h;i++){
		cout << "#";
		cout << c[i];
		cout << "#" << endl;
	}
	for(int i=0;i<w+2;i++){
		cout << "#";
	}
	cout << endl;		
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iomanip>
#include <math.h>
#define rep(i,x) for(ll i = 0;i<x;i++)
#define all(a) (a).begin(),(a).end()
using ll = long long;
using ld = long double;
using namespace std;
const ll INF = 1001001001;
const ll mod = 1000000007;
typedef pair<ll,ll> P;
using graph = vector<vector<ll>>;
ll gcd(ll a,ll b){
    if(a < b)swap(a,b);
    if(a % b == 0)return b;
    else return gcd(b,a%b);
}
bool isp(ll n){
    bool res = true;
    if(n == 1)return false;
    else{
        for(ll i = 2;i * i <= n;i++){
            if(n % i == 0){
                res = false;
                break;
            }
        }
        return res;
    }
}
//printf("%.10f\n", N);
/*
ll memo[100000];
ll fibo(ll n){
    if(memo[n] != 0)return memo[n];
    if(n <= 1)return n;
    else return memo[n] = fibo(n - 1)+ fibo(n - 2);
}*/

int main(){
    ll N,W;
    cin >> N >> W;
    vector<ll> weight(N);
    vector<ll> value(N);
    ll wa = 0;
    rep(i,N){
        cin >> weight[i] >> value[i];
        wa += value[i];
    }
    vector<vector<ll>> memo(N + 1,vector<ll>(wa + 1,INF));
    rep(i,N + 1){
        memo[i][0] = 0;
    }
    rep(i,N){
        rep(j,wa + 1){
            if(j < value[i]){
                memo[i + 1][j] = min(memo[i][j],memo[i][0] + weight[i]);
            }
            else{
                memo[i + 1][j] = min(memo[i][j],memo[i][j - value[i]] + weight[i]);
            }
        }
    }
    ll ans = 0;
    rep(i,wa + 1){
        if(memo[N][i] <= W)ans = i;
    }
    cout << ans << endl;
}

Measured memory_bytes: 80256
#include <stdio.h>
int main() {
	int n, l, r;
	int audience = 0;
	scanf("%d", &n);

	for (int i = 0; i < n; i++)
	{
		scanf("%d%d", &l, &r);
		audience += r - l + 1;
	}
	
	printf("%d", audience);
	return 0;
}

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

int main()
{
	char a, b;
	cin >> a >> b;
	if (a == 'H')
	{
		if (b == 'H')
			printf("H\n");
		else
			printf("D\n");
	}
	else
	{
		if (b == 'H')
			printf("D\n");
		else
				printf("H\n");
	}
	return 0;
}

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

int main()
{
    int N, X, Y;
    cin >> N >> X >> Y;

    for (int k = 1; k <= N - 1; k++)
    {
        int res = 0;
        for (int i = 1; i <= N; i++)
        {
            if (i < X)
            {
                if (i + k <= X)
                    res++;
                else
                {
                    if ((i + k) - X < Y - (i + k) + 1)
                        res += 2;
                    if ((i + k) - X == Y - (i + k) + 1)
                        res += 1;

                    int j = i + k + (Y - X - 1);
                    if (Y < j && j <= N)
                        res++;
                }
            }
            else if (i < Y)
            {
                if (i + k <= Y)
                {
                    if (X <= i - k)
                        res++;
                    else
                    {
                        if (k * 2 < Y - X + 1)
                            res += 2;
                        else if (k * 2 == Y - X + 1)
                            res += 1;
                    }
                }
                if (i < (Y - X) / 2 + X)
                {
                    int j = k - (i - X + 1) + Y;
                    if (Y < j && j <= N)
                        res++;
                }
                else
                {
                    if (Y < i + k && i + k <= N)
                        res++;
                }
            }
            else
            {
                if (i + k <= N)
                    res++;
            }
        }
        cout << res << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1e9+7;

int main(void) {

    int N; cin>>N;
    int a = N;
    string S;

    while(N != 0){
        if(N % 2 == 0){
            S = '0' + S;
        }else{
            S = '1' + S;
            N--;
        }
        N /= -2;
    }
    if(a==0) S = '0';
    cout<<S<<endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
   int n, i;
   double x[10], s=0;
   char u[10][4];

   scanf("%d",&n);
   for(i=0;i<n;i++){
      scanf("%lf%s",&x[i],&u[i]);
      if(u[i][0]=='J')
         s+=x[i];
      else
         s+=x[i]*380000;
   }
   printf("%lf\n",s);
   return 0;
}

Measured memory_bytes: 128
//#define _GLIBCXX_DEBUG

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

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

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll num=13;
  vector<ll>d(num);
  d[0]++;
  ll n;cin>>n;
  rep(i,0,n){
    ll x;cin>>x;d[x]++;
  }
  rep(i,0,1<<num){
    ll ret=INF;
    vector<ll>v;
    rep(j,0,num){
      if(d[j]==2)v.PB(j),v.PB(24-j);
      if(d[j]>=3)v.PB(j),v.PB(j);
      if(d[j]==1){
        if(i&1<<j)v.PB(j);
        else v.PB(24-j);
      }
    }
    ll sz=v.size();
    rep(p,0,sz)rep(q,p+1,sz){
      ll k=abs(v[p]-v[q]);
      chmin(ret,min(k,24-k));
    }
    /*if(i<10){
      debug(v,sz);
      cout<<i spa ret<<endl;
    }*/
    chmax(res,ret);
  }
  cout<<res<<endl;
  return 0;
}

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

using namespace std;

typedef long long ll;

#define pf(n) printf("%d\n",n)
#define sf(n) scanf("%d",&n)
#define in(n) for(int i=0;i<n;i++)
#define vi vector<int>
#define vs vector<string>
#define sort(a) sort(a.begin(),a.end())

int main()
{
    int A,B;
    sf(A);
    sf(B);
    if(A>=13)pf(B);
    else if(A>5)pf(B/2);
    else pf(0);
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>

int main()
{
  long long nboxes, nchildren;
  std::cin >> nboxes >> nchildren;
  std::vector<long long> candy;
  std::map<long long, long long> rest;
  long long total = 0;
  long long result = 0;
  rest[0]++;
  for (long long i = 0; i < nboxes; i++) {
    long long tmp;
    std::cin >> tmp;
    candy.push_back(tmp);
    total += tmp;
    result += rest[total % nchildren];
    rest[total % nchildren]++;
  }
  std::cout << result << '\n';
  return 0;
}


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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>bool chmin(T&a,const T&b){return a>b?(a=b,1):0;}
template<class T>bool chmax(T&a,const T&b){return a<b?(a=b,1):0;}


const int MAX_N = 200000 + 10;

/**
 * Sparse Table による RMQ の実装。
 * 区間のmin
 * 構築O(nlogn), クエリO(1)
 * 更新ができない。
 * SegmentTreeによる実装よりも定数倍がかなり高速。
 */
 struct RMQStatic {
  int *a;
  int dp_min[20][MAX_N]; // [i][j] := answer index of start_pos == j, len == 2^i

  int log2(int b) {return 31 - __builtin_clz(b);}

  // O(NlogN)
  void build(int* a, int N) {
    this->a = a;
    int M = log2(N) + 1;
    REP(i, N) dp_min[0][i] = i;
    for (int i = 1, len = 1; i < M; i++, len <<= 1) {
      for (int j = 0; j + len < N; j++) {
        int s = dp_min[i - 1][j];
        int t = dp_min[i - 1][j + len];
        dp_min[i][j] = a[s] <= a[t] ? s : t;
      }
    }
  }

  // O(1)
  // [from..to]の間で最小の値の添字を返す。複数ある場合は一番最初のを返す
  int query(int from, int to) {
    int k = log2(to - from + 1);
    int s = dp_min[k][from];
    int t = dp_min[k][to - (1 << k) + 1];
    return a[s] <= a[t] ? s : t;
  }
};

int P[MAX_N];
int P_o[MAX_N];
int P_e[MAX_N];

RMQStatic rmq_e, rmq_o;

struct Range {
  int beg, end, t1, t2;
  bool operator < (const Range& o) const {
    return P[t1] > P[o.t1]; // c++ priority_queue is greater first
  }
};

Range createRange(int beg, int end) {
  if (end - beg <= 0) 
    return (Range) {-1, -1, -1, -1};
  int t1, t2;
  if (beg % 2 == 0) {
    t1 = rmq_e.query(beg, end - 2);
    t2 = rmq_o.query(t1 + 1, end - 1);
  } else {
    t1 = rmq_o.query(beg, end - 2);
    t2 = rmq_e.query(t1 + 1, end - 1);
  }
  return (Range) {beg, end, t1, t2};
}

int main2() {
  int N; scanf("%d", &N);
  REP(i, N) scanf("%d", &P[i]);
  REP(i, N) {
    P_e[i] = (i % 2 == 0 ? P[i] : N+1);
    P_o[i] = (i % 2 == 1 ? P[i] : N+1);
  }
  rmq_e.build(P_e, N);
  rmq_o.build(P_o, N);

  priority_queue<Range> pq;
  pq.push(createRange(0, N));
  vector<int> ans;
  int k = 0;
  while (!pq.empty()) {
    k++;
    Range cur = pq.top();
    pq.pop();
    ans.push_back(P[cur.t1]);
    ans.push_back(P[cur.t2]);
    {
      Range nxt = createRange(cur.beg, cur.t1);
      if (nxt.beg != -1) pq.push(nxt);
    }
    {
      Range nxt = createRange(cur.t1 + 1, cur.t2);
      if (nxt.beg != -1) pq.push(nxt);
    }
    {
      Range nxt = createRange(cur.t2 + 1, cur.end);
      if (nxt.beg != -1) pq.push(nxt);
    }
  }

  REP(i, N) { 
    if (i > 0) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");

  return 0;
}

int main() {
  for ( ; !cin.eof(); cin >> ws) main2();
  return 0;
}



Measured memory_bytes: 36596
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 3;
        String[] arr = new String[n];
        String count = "";

        for(int i = 0; i < n; i++) {
            arr[i] = sc.next();
            count += arr[i];
        }
        int result = Integer.parseInt(count);

        if(result % 4 == 0) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}


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

// int/long:		-2,147,483,648 - 2,147,483,648 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

#define	INF (1<<29)
//536,870,912

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

#define	MOD 1000000007

int	main() {
	int N, M;
	cin >>N >>M;
	vector<vector<int>> A;
	vector<vector<int>> C;
	for (int i=0; i<N; i++) {
		int a, b;
		cin >>a >>b;
		A.push_back({a, b});
	}
	for (int i=0; i<M; i++) {
		int a, b;
		cin >>a >>b;
		C.push_back({a, b});
	}
	for (int i=0; i<N; i++) {
		int D=INF;
		int ix=-1;
		int a=A.at(i).at(0);
		int b=A.at(i).at(1);
		for (int j=0; j<M; j++) {
			int DD=abs(a-C.at(j).at(0))+abs(b-C.at(j).at(1));
			if (D>DD) {
				D=DD;
				ix=j;
			}
		}
		cout <<ix+1 <<endl;
	}
	return 0;
}



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

int main(){
  string S;
  cin >> S;
  bool flag=1;
  for(int i=0; i<S.size(); ++i){
    if(S[i]=='L' && i%2==0) flag=0;
    if(S[i]=='R' && i%2==1) flag=0;
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
n, w = list(map(int, input().split(' ')))

wv = []
for i in range(n):
    wv.append(list(map(int, input().split(' '))))


dp = [[0 for i in range(w + 1)] for j in range(n + 1)]

for i in range(1, n + 1):
    for j in range(1, w + 1):
        wi = wv[i - 1][0]
        vi = wv[i - 1][1]

        if j - wi >= 0:
            dp[i][j] = max([
                dp[i][j - 1],
                dp[i - 1][j - wi] + vi
            ])
            
        dp[i][j] = max([
            dp[i - 1][j],
            dp[i][j]
        ])

print(dp[n][w])


Measured memory_bytes: 173832
import std.stdio;
import std.conv;
import std.string;
import std.array;
import std.algorithm;

void main() {
  auto s = readln.chomp.split.map!(to!char).array;

  if (s[0] < s[1]) "<".writeln;
  else if (s[0] > s[1]) ">".writeln;
  else "=".writeln;
}

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


public class Main {
	public static void main(String[] aegs){
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int a = 0;
		String t = "";
		/*
		while (true){
			try {
				t = br.readLine();
				if(t == null){
					break;
				}
				a = Integer.parseInt(t);
			} catch (NumberFormatException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			} catch (IOException e) {
				// TODO 自動生成された catch ブロック
				e.printStackTrace();
			}
		

		int b = 0;
		for(int i=0;i<10;i++){
			for(int j=0;j<10;j++){
				for(int k=0;k<10;k++){
					for(int l=0;l<10;l++){
						if((i+j+k+l) == a){
							b++;
							
						}
					}
				}
			}
		
		}
		
		System.out.println(b);
		}*/
		try {
			t = br.readLine();
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
		a = Integer.parseInt(t);
		int s = 100000;
		for(int i=0;i<a;i++){
			s = (int) ((double)s * 1.05);
			int ss = s;
			s = s/1000;
			s = s*1000;
			if((ss - s) > 0){
				s = s + 1000;
			}
		}
		System.out.println(s);
		
	}

}

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

#define ll long long
#define pb push_back
#define speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define fr freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define mp make_pair
#define F first
#define S second

using namespace std;

const int N = 5e5 + 2;
const int mod = 1e9 + 7;

int n,m;
int main ()
{
	#define int long long
	cin>>n>>m;
	if (n==m)
	{
		cout<<"Yes";
	}
	else {
		cout<<"No";
	}
}



Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
const double EPS = 1e-7;
const double INF = 1e12;
struct Vec {
    double x,y;
    Vec(){}
    Vec(double x,double y){ this->x=x,this->y=y; }
    void read(){ scanf("%lf%lf",&x,&y); }
    void prt() {printf("%.9f %.9f\n",x,y); }
    double len(){ return sqrt(x*x+y*y); }
    double len2(){ return x*x+y*y; }
    
    Vec operator+(const Vec&o)const{ return Vec(x+o.x,y+o.y); }
    Vec operator-(const Vec&o)const{ return Vec(x-o.x,y-o.y); }
    Vec operator*(const double&k)const{ return Vec(k*x,k*y); }
    double operator*(const Vec&o)const {return x*o.x+y*o.y; }
    double operator^(const Vec&o)const {return x*o.y-y*o.x; }
    Vec rotate(double ang){ return Vec(x*cos(ang)-y*sin(ang), x*sin(ang)+y*cos(ang)); }
    Vec change(double l){ if(len()<EPS) return *this; return (*this)*(l/len()); }
    double disToLine(Vec A, Vec B) {
        return abs((A-*this)^(B-*this))/(B-A).len();
    }
};

Vec Lineintersect(Vec A1,Vec A2,Vec B1,Vec B2) {
    if (abs((A2-A1)^(B2-B1)) < EPS) return Vec(INF,INF);
    return A1 + (A2 - A1) * ((abs((A2-A1)^(B2-B1)) - abs((A2-B1)^(B2-B1)) ) / abs((A2-A1)^(B2-B1)));
}

Vec Segintersect(Vec A1,Vec A2,Vec B1,Vec B2) {
    Vec P = Lineintersect(A1,A2,B1,B2);
    if ((P-A1)*(P-A2)<=0 && (P-B1)*(P-B2)<=0) return P; 
    return Vec(INF,INF);
}

Vec A,B,C,D; int q;
int main(){
    scanf("%d",&q);
    while(q--){
        A.read(); B.read(); C.read(); D.read();
        if(abs((B-A)*(D-C)) < EPS) 
            printf("1\n");
        else if(abs((B-A)^(D-C))<EPS)
            printf("2\n"); 
        else
            printf("0\n");
    }
}


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

int main(){
  long long n,m;
  cin >> n >> m;
  long long k=n%m;
  long long j=m-k;
  if(k < 0)k = k*-1;
  if(j < 0)j = j+-1;
  cout << min(k,j) << endl;
}


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

typedef long long ll;

void solve() {
	string a, b;
	cin >> a >> b;
	string c = a + b;
	int x;
	stringstream geek(c);
	geek >> x;
	long double x1 = 1.0 * sqrt(x);
	int x2 = sqrt(x);
	if (x1 == x2) cout << "Yes";
	else cout << "No";
}


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

	int tt = 1;
	// cin >> tt;
	for (int i = 1; i <= tt; ++i) {
		// cout << "Case #" << i << ": ";
		solve();
	}

	return 0;
}


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

int main()
{
	int64_t n;
	cin >> n;
	vector<int64_t> as(n);
	for (auto &&a : as)
	{
		cin >> a;
	}

	int64_t ans = 0;
	for (int64_t i = 1, maxi = as[0]; i < n; i++)
	{
		ans += max<int64_t>(0, maxi - as[i]);
		maxi = max(maxi, as[i]);
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 4832
using System;
using System.Linq;
using static System.Console;
 
public class C{
  static void Main(string[] args)
  {
    var n = long.Parse(ReadLine());
    var s = Array.ConvertAll(new string[] { ReadLine(), ReadLine(), ReadLine(), ReadLine(), ReadLine() }, long.Parse);
    var ss = n % s.Min() == 0 ? n / s.Min() : (n / s.Min()) + 1;
    WriteLine(ss + 4);
  }
}

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

int main() {
  string s, t; cin >> s >> t;
  vector<char> s2(s.size()), t2(t.size());
  rep(i, s.size()) {
    s2[i] = s[i];
  }
  rep(i, t.size()) {
    t2[i] = t[i];
  }
  sort(s2.begin(), s2.end());
  sort(t2.begin(), t2.end());
  reverse(t2.begin(), t2.end());
  rep(i, s.size()) {
    s[i] = s2[i];
  }
  rep(i, t.size()) {
    t[i] = t2[i];
  }
  if (s < t) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(a,b) for(long long a = 0;a < b;++a)
int main(){
	vector<int> a;
	REP(i,4){
		int tmp;
		cin >> tmp;
		a.push_back(tmp);
	}
	sort(a.begin(),a.end());
	if(a[0] == a[1]&&a[2] == a[3]){
		cout << "yes" << endl;
	}else{
		cout << "no" << endl;
	}
}


Measured memory_bytes: 3108
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
#define PI 3.14159265359
#define EPS 0.0000000001
#define MOD 1000000007
//cout << std::fixed << std::setprecision(15) << y << endl;


int main(){
    char c;
    cin >> c;

    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u'){
        cout << "vowel" << endl;
    }else{
        cout << "consonant" << endl;
    }

    return 0;
}

Measured memory_bytes: 3576
/**
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

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

#define DEBUG
#ifndef DEBUG
#define endl "\n"
#define log(args...)
#else
#define log(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); logf(_it, args); }
void logf(istream_iterator<string> it) {
}
template<typename T, typename ... Args>
void logf(istream_iterator<string> it, T a, Args ... args) {
	cout << *it << " = " << a << endl;
	logf(++it, args...);
}
#endif

#define forn(i,k,n) for(ll i=(k); i<(n); i++)

const double PI = acos(-1);
typedef long long ll;
#define fori(n) for(ll i=0; i<(n); i++)

#define cins(s) string s; cin>>s;
#define cini(i) int i; cin>>i;
#define cinll(l) ll l; cin>>l;
#define cind(d) double d; cin>>d;
#define cinai(a, n) vi a(n); fori(n) { cin>>a[i]; }
#define cinall(a, n) vll a(n); fori(n) { cin>>a[i]; }
#define cinas(s, n) vs s(n); fori(n) { cin>>s[i]; }
#define cinad(a, n) vd a(n); fori(n) { cin>>a[i]; }

typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<string> vs;
typedef vector<ll> vll;

void solve() {
	cini(h);
	cini(n);
	ll sum = 0;
	for (int i = 0; i < n; i++) {
		cini(a);
		sum += a;
	}
	if (sum >= h)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

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



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,k,ans=0,mod=1e9+7;cin>>n>>k;
  for(ll num=k;num<=n+1;++num) {
    ans+=((2*n-num+1)*num/2)-(num-1)*num/2+1;
    ans%=mod;
  }
  print(ans);
  return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define ll long long                                    // long long省略
#define pb push_back                                    // push_back省略
#define mp make_pair                                    // make_pair省略
#define fi first                                        // first省略
#define se second                                       // second省略
#define itn int                                         // int誤字保険
#define count cout                                      // cout誤字保険
#define vecotr vector                                   // vector誤字保険
#define ednl endl                                       // endl誤字保険
#define opt() cin.tie(0); ios::sync_with_stdio(false)   // 入出力速度改善

#define rep(i,l,r) for(ll i=(l);i<(r);i++)               // 範囲[l, r)で刻み1のfor文(順方向)
#define repp(i,l,r,k) for(ll i=(l);i<(r);i+=(k))         // 範囲[l, r)で刻みkのfor文(順方向)
#define rrep(i,l,r) for(ll i=(r-1);i>=(l);i--)           // 範囲[l, r)で刻み1のfor文(逆方向)
#define rrepp(i,l,r,k) for(ll i=(r-1);i>=(l);i-=(k))     // 範囲[l, r)で刻みkのfor文(逆方向)
#define all(x) (x).begin(), (x).end()                   // vectorのポインタ位置指定用
#define max(p,q)((p)>(q)?(p):(q))                       // max拡張
#define min(p,q)((p)<(q)?(p):(q))                       // min拡張
#define bit(n,m)(((n)>>(m))&1)                          // 変数nのm番目のbitを取り出す

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 (b<a) { a=b; return 1; } return 0; }

int dy[]={0, 1, 0, -1};                                 // 4方向近傍
int dx[]={1, 0, -1, 0};                                 // 4方向近傍

int main(){
    ll a,b,c,d;cin>>a>>b>>c>>d;
    cout << (a <= 8 && b <= 8 ? "Yay!" : ":(") << ednl;
}

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

int main()
{
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];

	int ans = INT_MAX;
	for (int i = -100; i <= 100; i++) {
		int tmp = 0;
		for (int j = 0; j < n; j++) tmp += (i - a[j]) * (i - a[j]);
		ans = min(ans, tmp);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(sc.hasNextLine()) {
			String s = sc.nextLine();
			String t = sc.nextLine();
			int ss = s.length();
			int tt = t.length();
			int[][] dp = new int[ss][tt];
			for(int j = 0; j < tt; j++) {
				dp[0][j] = s.charAt(0) == t.charAt(j) ? 1 : 0;
			}
			for(int i = 0; i < ss; i++) {
				dp[i][0] = s.charAt(i) == t.charAt(0) ? 1 : 0;
			}
			int m = 0;
			for(int i = 1; i < ss; i++) {
				for(int j = 1; j < tt; j++) {
					dp[i][j] = s.charAt(i) == t.charAt(j) ? dp[i - 1][j - 1] + 1 : 0;
					m = Math.max(m, dp[i][j]);
				}
			}
			System.out.println(m);
		}
	}
}




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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  string s; cin >> s;
  if(s.back() == 's')cout << s+"es" << endl;
  else cout << s+"s" << endl;
  return 0;
}


Measured memory_bytes: 3628
import java.util.*;


class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        while(true){
        int n = scanner.nextInt();
        if(n == 0){
            System.exit(0);
        }
        int[] a = new int[n];
        int sub = 1000000000;
        for(int i = 0;i<n;i++){
            a[i] = scanner.nextInt();
        }
        for(int i = 0; i < n-1 ;i++){
            for(int j = i+1; j<n;j++){
                if(sub>Math.abs(a[i]-a[j])){
                    sub = Math.abs(a[i]-a[j]);
                }
            }
        }
        System.out.println(sub);
    }
    }
}


Measured memory_bytes: 48680
import java.util.Scanner;

public class Main {
  public static void main(String[] args) throws Exception {
    Scanner scanner = new Scanner(System.in);
    try {
      int a = scanner.nextInt();
      int b = scanner.nextInt();
      int c = scanner.nextInt();

      int doku = Math.min(a+b+1,c);
      int ans = b + doku;
      System.out.print(ans);
    } finally {
      scanner.close();
    }
  }
}


Measured memory_bytes: 22740
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        input_inner!{$s, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($exp_input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                let start = std::time::Instant::now();
                let input = solve($exp_input);
                let end = start.elapsed();
                assert_eq!(input, $output, "{}.{:03}", end.as_secs(), end.subsec_millis());
                assert!(end.as_secs() <= 2, "expected_sec: {}sec, actual_sec: {}sec", 2, end.as_secs());
                assert!(end.as_secs() <= 1, "expected_sec: {}sec, actual_sec: {}sec", 1, end.as_secs());
                assert!(end.subsec_millis() <= 10, "expected_ms: {}ms, actual_ms: {}ms", 10, end.subsec_millis());
                assert!(end.subsec_millis() <= 2, "expected_ms: {}ms, actual_ms: {}ms", 2, end.subsec_millis());
            )*
        }
    };
}

test! {
r#"5
4 2 5 1 3"# => r#"3"#,

r#"4
4 3 2 1"# => r#"4"#,

r#"6
1 2 3 4 5 6"# => r#"1"#,

r#"8
5 7 4 2 6 8 1 3"# => r#"4"#,

r#"1
1"# => r#"1"#,
}

fn solve(src: &str) -> String {
    let mut src_iter = src.split_whitespace();
    input! {
        source = src_iter,
        n: usize,
        p: [usize; n],
    }

    let mut ans = 1;
    let mut min = p[0];

    for j in 1..n {
        if p[j] <= min {
            ans += 1;
            min = p[j];
        }
    }

    ans.to_string()
}

Measured memory_bytes: 8444
from collections import Counter
n = int(input())
s = [input() for i in range(n)]

s2 = Counter(s)
mx = 0
for k in s2:
    mx = max(mx,s2[k])
ans = []
for k in s2:
    if s2[k]==mx:
        ans.append(k)
ans.sort()
for st in ans:
    print(st)

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

int findSumOfDigits(int n){
  int sum=0;
  while(n>0){
    sum+=n%10;
    n/=10;
  }
  return sum;
}

int main(){
  int n,a,b;
  cin>>n>>a>>b;
  int total=0;
  for(int i=1;i<=n;i++){
    int sum=findSumOfDigits(i);
    if(sum>=a and sum<=b){
      total+=i;
    }
  }
  cout<<total<<endl;
  return 0;
}

Measured memory_bytes: 3604