akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<string.h>
#include<set>
#include<fstream>
#include<map>
#include<string>
#include <stdio.h>
#include<bitset>
#include<queue>
#include<iomanip>
#include<cmath>
#include<stack>
#include<climits>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll>vl;
typedef vector<int>vi;
typedef vector<bool>vb;
typedef vector<double>vd;
typedef vector<char>vc;
typedef vector<string>vs;
#define MP make_pair
#define all(v) v.begin(),v.end()
const ll mod = 1000000007;
const ll OO = (ll)1e18;
const int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };
const int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };
ll gcd(ll a, ll b){ if (b == 0){ return a; }return gcd(b, a % b); }
ll fast_power(double base, ll power){
	if (power == 1) return base;
	if (power % 2 == 0) return fast_power((base*base), power / 2);
	else return(base*fast_power((base*base), power / 2));
}
//#pragma warning (disable : 4996)
void Qalbaz()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

}

int dp[2][100], arr[2][100], n;
int solve(int i, int j)
{
	if (i == 1 && j == n - 1)
		return arr[i][j];
	if (i >= 2 || j >= n)
		return 0;
	int &ret = dp[i][j];
	if (ret != -1)
		return dp[i][j];
	ret = 0;
	ret = max(ret, solve(i, j + 1) + arr[i][j]);
	ret = max(ret, solve(i + 1, j) + arr[i][j]);
	return ret;
}

int main(){

	
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	memset(dp, -1, sizeof dp);

	cin >> n;
	for (int i = 0; i < 2; i++)
	{
		for (int j = 0; j < n; j++)
			cin >> arr[i][j];
	}
	cout << solve(0, 0);

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF (1<<29)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
const int dx[] = {-1,0,0,1},dy[] = {0,1,-1,0};

typedef long long int ll;

using namespace std;

int main(){
    int ans = 0;
    REP(i,4){
	int t;
	cin >> t;
	ans += t;
    }
    int s = 0;
    REP(i,4){
	int t = 0;
	cin >> t;
	s += t;
    }
    ans = max(ans,s);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1160
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
import decimal

if __name__ == "__main__":
    a,b = input().split()
    a = decimal.Decimal(a)
    b = decimal.Decimal(b)
    print(int(a*b))


Measured memory_bytes: 10232
#include<bits/stdc++.h>
using namespace std;
namespace SegmentTree{
	const int N = 3e5 + 5;
	struct node	//设计线段树节点
	{
		int l, r;
		int tmax;
		int tag;
		
	}t[N * 4];
	void push_up(node &rt, const node &ls, const node &rs)//定义上传操作
	{
		rt.tmax = max(ls.tmax, rs.tmax);
	}
	void mark(node &rt, int val)//定义标记操作
	{
		rt.tmax = max(rt.tmax, val);
		rt.tag = max(rt.tag, val);
	}
	void push_down(int k) //定义下传操作
	{
		if(t[k].tag == 0) return;
		mark(t[k << 1], t[k].tag);
		mark(t[k << 1 | 1], t[k].tag);
		t[k].tag = 0;
	}
	void build(int k, int l, int r)
	{
		if(l == r)//定义叶节点初始化操作
		{	
			t[k] = {l, r, 0, 0};
			return;
		}
		int mid = (l + r) / 2;
		build(k << 1, l, mid);
		build(k << 1 | 1, mid + 1, r);
		push_up(t[k], t[k << 1], t[k << 1 | 1]);
		//定义非叶节点的初始化操作
		t[k].l = l, t[k].r = r;
		t[k].tmax = t[k].tag = 0;
	}
	void modify(int k, int x, int y, long long val)
	{
		if(x > y) return;
		if(x <= t[k].l && t[k].r <= y) return mark(t[k], val);
		push_down(k);
		int mid = (t[k].l + t[k].r) / 2;
		if(x <= mid) modify(k << 1, x, y, val);
		if(y > mid) modify(k << 1 | 1, x, y, val);
		push_up(t[k], t[k << 1], t[k << 1 | 1]);
	}
	node query(int k, int x, int y)
	{
		
		if(x <= t[k].l && t[k].r <= y) return t[k];
		push_down(k);
		int mid = (t[k].l + t[k].r) / 2;
		if(y <= mid) return query(k << 1, x, y);
		else if(x > mid) return query(k << 1 | 1, x, y);
		else
		{
			node L = query(k << 1, x, y), R = query(k << 1 | 1, x, y);
			node rt;
			push_up(rt, L, R);
			return rt;
		}
	}
}
int n, k;
int main () {
	scanf("%d%d", &n, &k);
	int LIM = 300000;
	SegmentTree :: build(1, 1, LIM);
	int ans = 0;
	for(int i = 1; i <= n; ++ i)
	{
		int x;
		scanf("%d", &x);
		int L = max(0, x - k), R = min(LIM, x + k);
		int _ans = SegmentTree :: query(1, x, x).tmax + 1;
		ans = max(ans, _ans);
		SegmentTree :: modify(1, L, R, _ans);
	}
	printf("%d", ans);
    return 0;
}

Measured memory_bytes: 20184
N=int(input())
alp=["a","b","c","d","e","f","g","h","i",
     "j","k","l","m","n","o","p","q","r",
     "s","t","u","v","w","x","y","z"]
S=""
while N>0:
  Q=N%26
  if Q==0:
    N=N//26-1
  else:
    N=N//26
  S+=alp[Q-1]
print(S[::-1])

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

int LinearSearch(int x, int s[], int N){
  for(int i=0; i<N; i++){
    if(s[i]==x)
      return i;
  }

  return -1;
}

int main(){
  int n, q;
  int S[1000000], T[1000000];

  cin>>n;
  for(int i=0; i<n; i++){
    cin>>S[i];
  }
  cin>>q;
  for(int i=0; i<q; i++){
    cin>>T[i];
  }

  int checker=0;
  for(int i=0; i<q; i++){
    int search=-1;
    search=LinearSearch(T[i], S, n);
    if(search>=0){
      checker++;
    }
  }

  cout<<checker<<endl;

  return 0;
}



Measured memory_bytes: 3088
def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

n=int(input())
al=[int(x) for x in input().split()]

fg = [0] * n
bg = [0] * n

fg[0] = al[0]
bg[0] = al[n-1]

for x in range(1,n):
    fg[x] = gcd(fg[x-1], al[x])
    bg[x] = gcd(bg[x-1], al[n-1-x])

gm = max(bg[n-2], fg[n-2])

for x in range(1,n-1):
   g = gcd(fg[x-1],bg[n-2-x])
   if (g > gm):
      gm = g

print(gm)

Measured memory_bytes: 14428
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		int S,h,m,s;
		S=scan.nextInt();
		h=S/3600;
		m=(S-h*3600)/60;
		s=(S-(h*3600+m*60));
		System.out.println(h + ":" + m + ":" + s);

	}

}

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

namespace ConsoleApp15
{
    class Class47
    {
        static void Main()
        {
            string S = Console.ReadLine();
            int leng = S.Length - 7;
            bool ans = false;
            if (leng >= 0)
            {
                for(int i = 0; i <= S.Length - leng; i++)
                {
                    string s = S.Remove(i, leng);
                    if (s == "keyence") ans = true;
                }
            }
            Console.WriteLine(ans ? "YES" : "NO");
        }
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define maxs(a, b) a = max(a, b)
#define mins(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll linf = (ll)4e18;
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll a, b;
	cin >> a >> b;
	if (a > 0) cout << "Positive" << endl;
	else {
		if (a <= 0 && b >= 0) cout << "Zero" << endl;
		else {
			ll res = b - a + 1;
			if (res % 2 == 0) cout << "Positive" << endl;
			else cout << "Negative" << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 256
N, S = map(int,input().split())
A = list(map(int,input().split()))
mod = 998244353
dp = [0 for j in range(S + 1)]
dp[0] = 1
for i in range(N) : 
    for j in range(S, -1, -1) : 
        if j + A[i] <= S : 
            dp[j + A[i]] += dp[j]
            dp[j + A[i]] %= mod
        dp[j] *= 2
        dp[j] %= mod 
        
print(dp[S])


Measured memory_bytes: 68728
fn main() {
    let n: i32 = read_line_as_value();
    if n % 2 == 0 {
        println!("0.5");
    } else {
        println!("{:?}", ((n/2)+1) as f32 / n as f32);
    }
}

fn read_line_as_value<T: std::str::FromStr>() -> T {
    let mut input = String::new();
    let res = std::io::stdin().read_line(&mut input);
    if let Err(error) = res {
        panic!("io error at stdin.read_line: {}", error);
    };
    match input.trim().parse() {
        Ok(val) => val,
        _ => panic!("error while parsing input: {}", input)
    }
}

Measured memory_bytes: 2144
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2")  //Enable AVX

using namespace std;

using ll = long long;

#define mp make_pair

const int p = 1e9 + 7;


int mul(int a, int b) {
    return (1LL * a * b) % p;
}

int add(int a, int b) {
    int s = (a+b);
    if (s>=p) s-=p;
    return s;
}

int sub(int a, int b) {
    int s = (a+p-b);
    if (s>=p) s-=p;
    return s;
}

int po(int a, int deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    int t = po(a, deg/2);
    return mul(t, t);
}

int inv(int n)
{
    return po(n, p-2);
}

struct DSU {
    vector<int> sz;
    vector<int> parent;

    void make_set(int v) {
        parent[v] = v;
        sz[v] = 1;
    }

    int find_set(int v) {
        if (v == parent[v])
            return v;
        return parent[v] = find_set(parent[v]);
    }

    void union_sets(int a, int b) {
        a = find_set(a);
        b = find_set(b);
        if (a != b) {
            if (sz[a] < sz[b])
                swap(a, b);
            parent[b] = a;
            sz[a] += sz[b];
        }
    }

    DSU(int n) {
        sz.resize(n);
        parent.resize(n);
        for (int i = 0; i < n; i++) make_set(i);
    }
};



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

    int a, b;
    cin>>a>>b;
    for (int i = 0; i<100000; i++) if ((i*8)/100 == a && (i*10)/100 == b) {cout<<i; return 0;}
    cout<<-1;

}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define stop char nyaa;cin>>nyaa;

//keta,Nより小さい,51?3の回数
ll dp[19][2][5];



void solve() {
	ll n; cin >> n;
	dp[0][0][0] = 1;
	vector<ll> v;
	ll cop = n;
	rep(i, 18) {
		v.push_back(n % 10); n /= 10;
	}
	rep(i, 18) {
		int z = v[17 - i];
		if (i <= 14) {
			//51?3を追加

			//Case <N
			rep(k, 4) {
				dp[i + 4][1][k + 1] += dp[i][1][k] * 10;
			}

			//Case ==N

			//既に小さい
			if (v[17 - i] > 5||(v[17-i]==5&&v[16-i]>1)) {
				rep(k, 4) {
					dp[i + 4][1][k + 1] += dp[i][0][k] * 10;
				}
			}
			//一緒、?に依存
			else if (v[17 - i] == 5 && v[16 - i] == 1) {
				if (v[14 - i] < 3) {
					int num = v[15 - i];
					rep(k, 4) {
						dp[i + 4][1][k + 1] += dp[i][0][k] * num;
					}
				}
				else if(v[14-i]>3){
					int num = v[15 - i]+1;
					rep(k, 4) {
						dp[i + 4][1][k + 1] += dp[i][0][k] * num;
					}
				}
				else {
					int num = v[15 - i]+1;
					rep(k, 4) {
						dp[i + 4][1][k + 1] += dp[i][0][k] * num;
					}
					rep(k, 4) {
						dp[i + 4][1][k + 1] -= dp[i][0][k];
						dp[i + 4][0][k + 1] += dp[i][0][k];
					}
				}
			}
			//既に大きい
			else {
				//することない
			}

		}
		//自由に追加

		//Case <N
		rep(k, 5) {
			dp[i + 1][1][k] += dp[i][1][k] * 10;
		}
		//Case ==N
		int num = v[17 - i];
		rep(k, 5) {
			dp[i + 1][1][k] += dp[i][0][k] * num;
			dp[i + 1][0][k] += dp[i][0][k];
		}
	}
	ll ans = 0;
	rep1(i, 4) {
		ll s = -1;
		if (i % 2)s = 1;
		ll sum = dp[18][0][i] + dp[18][1][i];
		ans += sum * s;
	}
	cout << ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	//stop
	return 0;
}


Measured memory_bytes: 3216
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,n) for(int i=(a); i<(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;

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

    while (true) {
        int n, m, a; cin >> n >> m >> a;
        if (n+m+a==0) break;

        vector<tuple<int, int, int>> vec(m);
        rep(i, m) {
            int x, y, z; cin >> x >> y >> z;
            vec[i] = make_tuple(x, y, z);
        }
        sort(all(vec), greater<>());

        int cur = a;
        rep(i, m) {
            int y = get<1>(vec[i]), z = get<2>(vec[i]);
            if (cur==y) cur=z;
            else if (cur==z) cur=y;
        }

        cout << cur << endl;
    }
}


Measured memory_bytes: 3164
#include <stdio.h>
#include <cmath>
#include <algorithm>


void func(int m){
	int dp[1001][m+1],num,count,div;

	for(int i = 0; i <= 1000; i++){
		for(int k = 0; k <= m; k++)dp[i][k] = 0;
	}

	for(int i = m-1; i >= 0; i--){
		scanf("%d %d",&num,&count);

		for(int k = 1; k <= count;k++){
			div = num*k;
			if(dp[div][i] == 0){
				dp[div][i] = dp[div][i+1]+1;
			}else{
				dp[div][i]++;
			}

			for(int p = div+1; p <= 1000; p++){
				if(dp[p-div][i+1] > 0){
					if(dp[p][i] == 0){
						dp[p][i] = dp[p][i+1]+dp[p-div][i+1];
					}else{
						dp[p][i] += dp[p-div][i+1];
					}
				}
			}
		}
		for(int k = 1; k <= 1000; k++){
			if(dp[k][i] == 0 && dp[k][i+1] > 0)dp[k][i] = dp[k][i+1];
		}
	}

	int game_count,to_make;
	scanf("%d",&game_count);

	for(int i = 0; i < game_count; i++){
		scanf("%d",&to_make);
		printf("%d\n",dp[to_make][0]);
	}
}

int main(){

	int m;

	while(true){
		scanf("%d",&m);
		if(m == 0)break;

		func(m);
	}


	return 0;
}

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

int main() {
	string ss;
	cin>>ss;
	bool b =1;
	map<char, int>arr;
	for (int i=0; i<ss.length(); i++){
		arr[ss[i]] ++;
	}
	for(auto &pair : arr){
		if (pair.second%2==1){
			b = 0;
			break;
		}
	}
	/*for (auto &pair : arr) { 
          cout << pair.first << ' ' << pair.second << endl; 
        }*/

	if (b==1) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 256
using System;


    class MainClass
    {
    public static void Main(string[] args)
    {

        int input = int.Parse(Console.ReadLine());

        int gcd = 0;

        int sum = 0;

        int a = 0;

        int b = 0;

        int r = 1;

        


        for (int i = 1; i <= input; i++)
        {
            for (int j = 1; j <= input; j++)
            {
                for (int k = 1; k <= input; k++)
                {
                    if (i == j && i == k)
                    {
                        gcd = i;
                    }

                    else 
                    {
                        if (i >= j) {
                            a = i;
                            b = j;
                        }
                        else
                        {
                            a = j;
                            b = i;
                        }

                        r = a % b;

                        while (r != 0)
                        {
                            a = b;
                            b = r;
                            r = a % b;

                        }

                        if (b >= k)
                        {
                            a = b;
                            b = k;

                        }
                        else
                        {
                            a = k;

                        }

                        r = a % b;

                        while (r != 0)
                        {
                            a = b;
                            b = r;
                            r = a % b;
                        }

                        gcd = b;

                    }







                    sum += gcd;
                }
            }
        }

        Console.WriteLine(sum);

    }
}



Measured memory_bytes: 27540
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <math.h>
typedef long long ll;
#define mod 998244353
#define N 300005
using namespace std;

ll inv[N],fac[N],ifac[N];

int main(){
  ll n,a,b,k,ans=0;
  cin>>n>>a>>b>>k;

  inv[0]=1;inv[1]=1;fac[1]=1;ifac[1]=1;fac[0]=1;ifac[0]=1;
  for(int i=2;i<=n;i++){
    inv[i]=(-mod/i)*inv[mod%i]%mod;
    fac[i]=fac[i-1]*i%mod;
    ifac[i]=ifac[i-1]*inv[i]%mod;
    //cout<<inv[i]<<" "<<fac[i]<<" "<<ifac[i]<<endl;
  }

  for(int i=0;i<=n;i++){
    if(((k-a*i)%b==0)&&(k>=a*i)){
      ll j=(k-a*i)/b;
      if(j>n) continue;
      ans=(ans+fac[n]*ifac[i]%mod*ifac[n-i]%mod*fac[n]%mod*ifac[j]%mod*ifac[n-j])%mod;
    }
  }

  /*for(int i=0;i<=n;i++){
    cout<<(fac[n]*ifac[i]%mod*ifac[n-i]%mod+mod)%mod<<endl;
  }*/
  cout<<(ans+mod)%mod<<endl;
  return 0;
}


Measured memory_bytes: 7296
#include <bits/stdc++.h>
#define rep(var,cnt) for(int (var)=0; (var)<(int)(cnt); ++(var))
#define Rep(var,init,cnt) for(int (var)=(init); (var)<(cnt); ++(var))
#define ran(var,vec) for(auto &(var):(vec))
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define SORT(v) sort(all(v))
#define RSORT(v) sort(rall(v))
#define SUM(v) accumulate(all(v),0)
#define tget(tp,idx) get<idx>(tp)
#define TF(flag) (flag)?1:0
#define yn(f) cout<<(f?"yes":"no")<<endl
#define Yn(f) cout<<(f?"Yes":"No")<<endl
#define YN(f) cout<<(f?"YES":"NO")<<endl
#define COUT(x) cout<<(x)<<endl
using namespace std;

using ll = long long;
using ull = unsigned long long;
using pi = pair<int,int>;
using pl = pair<ll,ll>;
using ti = tuple<int,int,int>;
using tl = tuple<ll,ll,ll>;

template<typename T>
using vec = vector<T>;
template<typename T>
using mat = vector<vec<T>>;
template<typename T>
using cub = vector<mat<T>>;
template<typename T>
using val = valarray<T>;

template<typename T>
using pq = priority_queue<T>;
template<typename T>
using rpq = priority_queue<T,vec<T>,greater<T>>;

template<typename T1,typename T2>
ostream &operator<<(ostream &os, const pair<T1,T2> &p){
  os<<"P("<<p.first<<", "<<p.second<<") ";
  return os;
}

template<typename T1,typename T2>
istream &operator>>(istream &is, pair<T1,T2> &p){
  is>>p.first>>p.second;
  return is;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  cout<<"V{";
  for(int i=0; i<(int)v.size(); ++i){
    os<<v[i]<<(i+1!=v.size()?" ":"");
  }
  cout<<"}";
  return os;
}

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

template<typename T>
ostream &operator<<(ostream &os, const valarray<T> &v){
  cout<<"V{";
  for(int i=0; i<(int)v.size(); ++i){
    os<<v[i]<<(i+1!=v.size()?" ":"");
  }
  cout<<"}";
  return os;
}

template<typename T>
istream &operator>>(istream &is, valarray<T> &v){
  for(T &in:v) is>>in;
  return is;
}

// Usual Template End ================================================

// Template End ======================================================

constexpr int MOD=1e9+7;

int main(void){
  int x,t; cin>>x>>t;
  COUT(max(x-t,0));
}













Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Main {

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }
}

class Task {


    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int h = in.nextInt();
        int n = in.nextInt();
        int sum = 0;
        for (int i = 0; i < n; i++) {
            int x = in.nextInt();
            sum += x;
        }
        out.println(sum >= h ? "Yes" : "No");

    }

}

class InputReader {

    private final BufferedReader reader;
    private StringTokenizer      tokenizer;

    public InputReader(InputStream stream){
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(nextLine());
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

}


Measured memory_bytes: 34152
#coding:utf-8
a, b, c = map(int, input().split())

#解毒剤入が毒入りより多ければ助かり、美味しい分すべて完食
if a+b+1 >= c:
    print(b+c)
#死亡ルートはおいしい解毒剤すべてと、毒入りは解毒剤全部+もう1枚の和
else:
    print((a+b+1)+b)

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

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, ll> pill;
typedef pair<ll, pill> pllpill;
typedef pair<pii, pii> pipii;

set<int> gen(int a, int b, int cap) {
  set<int> ret;
  if(a <= cap) ret.insert(a);
  if(b <= cap) ret.insert(b);
  while(true) {
    set<int> nret;
    for(int out: ret) {
      nret.insert(out);
      if(out + a <= cap) nret.insert(out+a);
      if(out + b <= cap) nret.insert(out+b);
    }
    if(ret.size() == nret.size()) break;
    ret = nret;
  }
  return ret;
}

void solve() {
  int a, b, c, d, e, f;
  cin >> a >> b >> c >> d >> e >> f;
  set<int> sugars = gen(c, d, f);
  set<int> waters = gen(100*a, 100*b, f);
  int n = 0;
  d = *waters.begin();
  for(int out: sugars) {
    for(int out2: waters) {
      if(out > out2 / 100 * e) continue;
      if(out + out2 > f) continue;
      // n/d < out / (out + out2)
      if(n * (out + out2) < out * d) {
        n = out;
        d = out + out2;
      }
    }
  }
  cout << d << " " << n << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
}


Measured memory_bytes: 512
n = int(input())
ac, wa, tle, re = 0, 0, 0, 0
for _ in range(n):
    s = input()
    if s == 'AC':
        ac += 1
    if s == 'WA':
        wa += 1
    if s == 'TLE':
        tle += 1
    if s == 'RE':
        re += 1

print('AC x', ac)
print('WA x', wa)
print('TLE x', tle)
print('RE x', re)

Measured memory_bytes: 69832
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
#define MOD 1000000007

int main() {
	string s;
	cin >> s;
	int ans = 0;
	int max = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'A' || s[i] == 'T' || s[i] == 'C' || s[i] == 'G') {
			ans++;
		}
		else {
			if (max < ans)max = ans;
			ans = 0;
		}
	}
	if (max < ans)max = ans;
	cout << max;
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<set>
#include<utility>
#include<vector>
#include<map>
#include<algorithm>
#include<queue>
#include<stack>
#include<iomanip>

#define	rep(i, n) for(int i=0; i<n; i++)

#define P pair<int, int>

typedef long long ll;

using namespace std;

#include <string>
#include <cctype>
typedef string::const_iterator State;
class ParseError {};


int main() {
	ll x, y;
	cin >> x >> y;
	ll rx=0, lx=0, uy=0, dy=0, l=0, bf=1, bff = 0, dir=0;
	for(int i=0;;i = (i+1)%3)
	{
		if (lx <= x && x <= rx && dy <= y && y <= uy) {
			cout << i + 1 << endl;
			return 0;
		}
		l = bf + bff;
		bff = bf, bf = l;
		if (dir == 0) {
			rx += l;
		}
		if (dir == 1) {
			uy += l;
		}
		if (dir == 2) {
			lx -= l;
		}
		if (dir == 3) {
			dy -= l;
		}
		dir = (dir+1)%4;
	}

	return 0;
}



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

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0;
  for (int i = 0; i <= n - 3; i++) {
    if (s.substr(i, 3) == "ABC") {
      count++;
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 256
#include <iostream>

int main()
{
  int a, b, k;
  std::cin >> a >> b >> k;
  int cnt = 0;
  int i;
  for (i = 100; 1 <= i; i--) {
    if (a % i == 0 && b % i == 0) {
      cnt++;
      if (k <= cnt) {
        break;
      }
    }
  }
  std::cout << i << '\n';
  return 0;
}


Measured memory_bytes: 256
import sys

N, Q = map(int, input().split())
S = input()
s = [0]
for i, c in enumerate(S):
    if i == 0:
        s.append(0)
    elif S[i-1] == 'A' and S[i] == 'C':
        s.append(s[-1] + 1)
    else:
        s.append(s[-1])

#print(s)
for i in range(Q):
    l, r = map(int, input().split())
    print(s[r] - s[l])

Measured memory_bytes: 11612
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
 
 
public class Main {
 
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		
		int a[] = new int[n];
		int b[] = new int[n];
		
		long result = 0;
		
		long minB = Long.MAX_VALUE;
		
		boolean same = true;
		for(int i = 0; i < n; i++){
			String[] tmpArray = br.readLine().split(" ");
			
			a[i] = Integer.parseInt(tmpArray[0]);
			b[i] = Integer.parseInt(tmpArray[1]);
			
			result += a[i];
			
			if(a[i] > b[i] && minB > b[i]){
				minB = b[i];
			}
			
			if(a[i] != b[i])
				same = false;
		}
		
		if(!same) 	result -= minB;
		else   result = 0;
		System.out.println(result);
	}
 
}

Measured memory_bytes: 33148
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
string s[101];
static bool  cmp(string s1, string s2){
     return (s1 + s2) < (s2 + s1)? true : false;
}
int main(){
	int n,m,count=0,i,j;
	cin>>n>>m;
	
	for( i=0;i<n;i++){
		cin>>s[i];
		count++;
	}
	sort(s,s+count,cmp);
	for(i=0;i<n;i++){
		cout<<s[i];
	}
	cout<<endl; 
	return 0;
}  

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
typedef long long lint;
typedef unsigned int uint;
typedef pair<int, int> pii;
typedef pair<lint, lint> pll;
typedef unsigned long long ulint;
#define endl '\n'
#define fst first
#define sed second
#define pb push_back
#define mp make_pair
#define rint register int
#define newline putchar('\n')
#define leave_space putchar(' ')
#define all(x) (x).begin(), (x).end()
#define reveal(x) cerr << #x << " = " << (x) << endl
#define rep(it, f, e) for (rint it = (f); it <= (e); ++it)
#define per(it, f, e) for (rint it = (f); it >= (e); --it)
const int MAXN = 1e5 + 5;
queue<pii> que;
int dis[MAXN];
int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
	int k;
	cin >> k;
	memset(dis, 0x3f, sizeof(dis));
	rep (i, 1, 9) {
		que.push(mp(i % k, i));
		dis[i % k] = min(i, dis[i % k]);
	}
	while (!que.empty()) {
		pii u = que.front(); que.pop();
		if (!u.fst) continue;
		if (u.sed != dis[u.fst]) continue;
		rep (i, 0, 9) {
			int vi = (u.fst * 10 + i) % k;
			int vj = u.sed + i;
			if (dis[vi] > vj) {
				dis[vi] = vj;
				que.push(pii(vi, vj));
			}
		}
	}
	cout << dis[0] << endl;
	return 0;
}

Measured memory_bytes: 1960
#include<bits/stdc++.h>
#define ll long long
using namespace std;
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

int main()
{
    fast
    int q=1;

    while(q--)
    {
     int n;  cin>>n;
     bool b=0;
     int arr[n][2];
     for(int i=0;i<n;i++){
        cin>>arr[i][0]>>arr[i][1];
        if(i>=2)
        {
            if(arr[i][1]==arr[i][0]&&arr[i-1][1]==arr[i-1][0]&&arr[i-2][1]==arr[i-2][0])
                b=1;
        }
       




    }
     if(b)
            cout<<"Yes";
        else
            cout<<"No";
    }

    return 0;
}


Measured memory_bytes: 3648
#include<iostream>    
#include<cstdio>  
#include<stdio.h>  
#include<cstring>    
#include<cstdio>    
#include<climits>    
#include<cmath>   
#include<vector>  
#include <bitset>  
#include<algorithm>    
#include <queue>  
#include<map>  
using namespace std;

struct point
{
	bool check;
	int number;
}p[100][100];
int n, i, m, ans, j;
int a[50];
int main()
{
	cin >> n;
	memset(p, 0, sizeof(p));
	for (i = 1; i <= n; i++)
	{
		string str;
		cin >> str;
		m = str.length();
		for (j = 0; j < m; j++)
		{
			p[i][str[j] - 'a'].check = true;
			p[i][str[j] - 'a'].number++;
		}
	}
	for (i = 0; i < 26; i++)
	{
		ans = 1000000;
		for (j = 1; j <= n; j++)
		{
			if (p[j][i].check == true)
			{
				ans = min(ans, p[j][i].number);
			}
			else
			{
				ans = 0;
				break;
			}
		}
		a[i] = ans;
	}
	for (i = 0; i < 26; i++)
	{
		while (a[i]--)
		{
			cout << char(i + 'a');
		}
	}
	cout << endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define REV(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define ts to_string
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vs vector <string>
#define vvs vector <vector<string>>
#define pq  priority_queue<int>
using ll = long long;
/* ----------------よく使う数字や配列----------------- */
int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
const int INF = 2000000000;
constexpr ll mod = 1e9 + 7;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */
/*---------------------template----------------------*/
/*----------------------end--------------------------*/
/* --------------------ライブラリ--------------------*/
bool isprime(ll a)//素数判定、primeならtrue,違うならfalse
{
    if (a < 2) return false;
    else if (a == 2) return true;
    else if (a % 2 == 0) return false;
    double m = sqrt(a);
    for (int i = 3; i <= m; i += 2)
    {
        if (a % i == 0)
        {
            return false;
        }
    }
    // 素数である
    return true;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
/*---------------------臨時関数----------------------*/
/*----------------------end-------------------------*/
signed main(){
  int A,B;string S;cin>>A>>B>>S;
  bool b=true;
  rep(i,A+B+1){
    if(i!=A){
      if(S[i]-'0'>=10||S[i]-'0'<0){
        b=false;
        break;
      }
    }
    else {
      if(S[i]!='-'){
        b=false;
        break;
      }
    }
  }
  if(b)puts("Yes");
  else puts("No");
}


Measured memory_bytes: 3660
#include <iostream>
#include <algorithm>
#include <numeric>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl


int main() {
    ll h, w, cnt;
    string shape;
    while(1){
        
        cin >> h >> w;

        if(h == 0 && w == 0){
            break;
        }
        

        for(int i = 0;i < h;i++){
            shape = "";
            cnt = i % 2;
            for(int j = 0;j < w;j++){
                if(cnt % 2 == 0){
                    shape += "#";
                } else {
                    shape += ".";
                }

                cnt += 1;
            }
            cout << shape << endl;
        }
        cout << "" << endl;
    }

    return 0;
}


Measured memory_bytes: 3212
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long

ll M= 1000000007;

int main() {

    ll n;
    cin>>n;
    vector<ll> v(n);
    for(ll i=0;i<n;i++) {
        cin>>v[i];
    }

    vector<ll> sumv;
    ll sum=0;
    for(ll i=n-1;i>0;i--) {
        sum+=v[i];
        sumv.pb(sum);
    }
    reverse(sumv.begin(),sumv.end());


    ll ans=0,res=0;
    for(ll i=0;i<n-1;i++) {
        ll a=v[i];
        ll b=sumv[i];
        ans=((a % M) * ( b % M))%M;
        res+=ans;
        res=res%M;
    }
    res=res%M;

    cout<<res<<endl;

    return 0;

}

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

int main() {
  int A, B;
  int N, ans;
  ans = 0;
  cin >> A >> B;
  for (int i=0; i < (B - A + 1); i++) {
    N = A + i;
    if (((N - (N % 10 * 10001) - (N / 10 % 10 * 1010)) == (N / 10 / 10 % 10 * 100))
        && N % 10 != 0 ) {
      ans++;
    }
  }
  cout << ans << endl;
}

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

bool check_kaibun(string s){
    int len_s = s.size();
        
    int limit;
    if(len_s % 2 == 0){
        limit = len_s / 2;
    }else{
        limit = (len_s-1)/2;
    }
    
    for(int i = 0; i < limit;i++){
        if(s.at(i) != s.at(len_s - 1 - i)){
            return false; 
        }
    }
    
    return true;
}
    
int main(){ 
    string s;
    cin >> s;
    
    string half_s;
    
    bool ans;
    int len_s = s.size();
    for(int i = 0; i < (len_s - 1) / 2; i++){
        half_s.push_back(s.at(i));
    }
    
    
    ans = check_kaibun(s) && check_kaibun(half_s);
    if(ans){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    
}
        


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

using namespace std;

//mem(a, b) memset(a, (b), sizeof(a))

typedef long long ll;

#define f(i,a,b) for (ll i=a ; i<b ; i++)

#define FOR(i, j, k, in) for (int i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define REP(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define faster ios::sync_with_stdio(0);cin.tie(0);
typedef pair<int, int> p;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<p> vii;
typedef vector<vi> vvi;
typedef map<int,int> mp;
typedef set<int> se;
typedef multiset<int> MSETI;


// to be used with algorithms that processes a container Eg: find(all(c),42)
#define all(x) (x).begin(), (x).end() //Forward traversal
#define rall(x) (x).rbegin, (x).rend() //reverse traversal

// traversal function to avoid long template definition. Now with C++11 auto alleviates the pain.
#define tr(c,i) for(__typeof__((c)).begin() i = (c).begin(); i != (c).end(); i++)

// find if a given value is present in a container. Container version. Runs in log(n) for set and map
#define present(c,x) ((c).find(x) != (c).end())

//find version works for all containers. This is present in std namespace.
#define cpresent(c,x) (find(all(c),x) != (c).end())

// Avoiding wrap around of size()-1 where size is a unsigned int.
#define sz(a) int((a).size())


struct duo{
    ll x,y;
};

bool mycomp(duo a,duo b) { return a.x < b.x ;}

bool comp(int a,int b){
	return a<b;
}


int main()
{
	faster


	ll t,n,a=0,m,b=0,d,i,j,k,c,sum=0;
    cin>>n;
  	cin>>m;
  	k=pow(m,2);
  	f(i,0,n)
    {
      cin>>a>>b;
      a=abs(a);b=abs(b);
      d=pow(a,2)+pow(b,2);
      //cout<<d<<" ";
      if(d<=k)
      {
        sum++;
      }
    }
  	cout<<sum;
  
  
  
    
    
	
	
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
/*
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cstring>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_map>
#include <map>
 */
#define INF 10e9
#define rep(i, a) for (int i = 0; i < (a); i++)
using namespace std;
 
int main() {
    int dp[1010][1010];

    int q;
    cin >> q;

    string x, y;

    int i, j, k;
    for(k = 0; k < q; k++){
        cin >> x >> y;
        dp[0][0] = 0;
        dp[0][1] = 0;
        dp[1][0] = 0;

        for(i = 1; i <= x.size(); i++){
            for(j = 1; j <= y.size(); j++){
                if(x[i-1] == y[j-1]){
                    dp[i][j] = dp[i-1][j-1] + 1;
                }else{
                    dp[i][j] = max(dp[i][j-1], dp[i-1][j]);
                }
            }
        }

        cout << dp[x.size()][y.size()] << endl;
    }
}


Measured memory_bytes: 7132
function Main(input) {
  input = input.split("\n");
  var n = parseInt(input[0].split(" ")[0]);
  var k = parseInt(input[0].split(" ")[1]);
  a = new Array();
  b = new Array();
  c = new Array();
  for(i=0;i<n;i++){
    a[i]=parseInt(input[i+1].split(" ")[0]);
    b[i]=parseInt(input[i+1].split(" ")[1]);
    c[i]=[a[i],b[i]];
  }
  c.sort(function(a,b){
    if( a[0] < b[0] ) return -1;
    if( a[0] > b[0] ) return 1;
    return 0;
  });
  s = new Array();
  var count=0;
  var ans=0;
  for(i=0;i<=n;i++){
    if(count>=k){
      ans=c[i-1][0];
      break;
    }else{
      count+=c[i][1];
    }
  }
  console.log('%s', ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int main(){
	int H,W;
	cin>>H>>W;
	string c = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	for(int i=0;i<H;i++){
		for(int j=0;j<W;j++){
			string s;
			cin>>s;
			if(s == "snuke"){
				cout<<c[j]<<i+1<<endl;
			}
		}
	}
}

Measured memory_bytes: 256
N=int(input())
a=list(map(int,input().split()))
distribution={}
for element in a:
    for num in [element-1,element,element+1]:
        if num not in distribution:
            distribution[num]=1
        else:
            distribution[num]+=1
ans=0
for key in distribution:
    ans = max(ans,distribution[key])
print(ans)

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

namespace abc113
{
    class abc113b
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var buf = Console.ReadLine().Split();
            var T = int.Parse(buf[0]);
            var A = int.Parse(buf[1]);
            var H = Console.ReadLine().Split().ToList().ConvertAll(int.Parse);

            var diffMin = 999.0;
            var candidate = 0;
            for(var i = 1; i <= N; ++i)
            {
                var diff = Math.Abs(A - (T - H[i - 1] * 0.006));
                if (diff == 0)
                {
                    candidate = i;
                    break;
                }
                else if(diff < diffMin){
                    diffMin = diff;
                    candidate = i;
                }
            }
            Console.WriteLine(candidate);
        }
    }
}


Measured memory_bytes: 13212
#include <iostream>
#include <string>
#include <set>
#include <utility>
#include <vector>
#include <map>
#include <queue>

using namespace std;

int h, w;
string s[20];

char gs(int y, int x) {
    if (y < h && y >= 0 && x < w && x >= 0) return s[y][x];
    else return '#';
}

int maxdist(int y, int x) {
    queue<pair<int, int>> q;
    int d[20][20];
    for (int i = 0; i < 20; i++) for (int j = 0; j < 20; j++) d[i][j] = 100000000;
    q.push(make_pair(y, x));
    d[y][x] = 0;
    while (!q.empty()) {
        auto c = q.front();
        q.pop();
        int v[4][2] = {{-1, 0},
                       {1,  0},
                       {0,  -1},
                       {0,  1}};
        for (auto e:v) {
            if (gs(c.first + e[0], c.second + e[1]) == '.' && d[c.first + e[0]][c.second + e[1]] > d[c.first][c.second] + 1) {
                q.push((make_pair(c.first + e[0], c.second + e[1])));
                d[c.first + e[0]][c.second + e[1]] = d[c.first][c.second] + 1;
            }
        }
    }
    int ret = 0;
    for(int i = 0;i < h;i++) for(int j = 0;j < w;j++) {
        if(gs(i,j) == '.') {
            if(d[i][j] == 100000000) throw;
            ret = max(ret,d[i][j]);
        }
    }
    return ret;
}

int main() {
    cin >> h >> w;
    for (int i = 0; i < h; i++) cin >> s[i];
    int ret = 0;
    for(int i = 0;i < h;i++) for(int j = 0;j < w;j++) if(gs(i,j) == '.') ret = max(ret,maxdist(i,j));
    cout << ret << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int const max = 100000;
    int n, k;
    int arr[max];

    cin >> n >> k;

    for (int i = 0; i < n; ++i)
        cin >> arr[i];

    long long sol[max];

    for (int i = 0; i < k; ++i)
        sol[i] = abs(arr[i] - arr[0]);

    for (int i = k; i < n; ++i)
    {
        sol[i] = sol[i - k] + abs(arr[i] - arr[i - k]);
        for (int j = 1; j < k; ++j)
            sol[i] = min(sol[i], sol[i - k + j] + abs(arr[i] - arr[i - k + j]));
    }

    cout << sol[n - 1];
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)

class Dice
{
    int faces[6], left, back, bottom;

  public:
    int top, front, right;
    void in()
    {
        rep(i, sizeof(faces) / sizeof(int))
        {
            cin >> faces[i];
        }
        top = faces[0];
        front = faces[1];
        right = faces[2];
        left = faces[3];
        back = faces[4];
        bottom = faces[5];
    }

    void rotate(char command)
    {
        int pre_top = top;
        switch (command)
        {
        case 'N':
            top = front;
            front = bottom;
            bottom = back;
            back = pre_top;
            break;
        case 'E':
            top = left;
            left = bottom;
            bottom = right;
            right = pre_top;
            break;
        case 'W':
            top = right;
            right = bottom;
            bottom = left;
            left = pre_top;
            break;
        case 'S':
            top = back;
            back = bottom;
            bottom = front;
            front = pre_top;
            break;
        case 'R':
            int pre_front = front;
            front = left;
            left = back;
            back = right;
            right = pre_front;
            break;
        }
    }
};

int main()
{
    Dice dice_x;
    dice_x.in();

    int q;
    cin >> q;
    rep(i, q)
    {
        int top, front;
        cin >> top >> front;

        rep(j, 6)
        {
            if (top == dice_x.top)
            {
                break;
            }
            dice_x.rotate('S');
        }
        rep(j, 6)
        {
            if (top == dice_x.top)
            {
                break;
            }
            dice_x.rotate('E');
        }
        while (front != dice_x.front)
        {
            dice_x.rotate('R');
        }
        cout << dice_x.right << endl;
    }
}



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

using namespace std;

long long inf=1000000007;

long long modpow(long long n,long long p,long long mod);

int main(){
	long long n;
	cin>>n;
	vector<long long> dp(n+1);
	for(long long i=0;i<=n;i++){
		if(i==0 || i==1){
			dp.at(i)=1;
		}else{
			dp.at(i)=dp.at(i-1)+dp.at(i-2);
		}
	}

	cout<<dp.at(n)<<endl;

	return 0;
}

long long modpow(long long n,long long p,long long mod){
	if(p==0) return 1;
	if(p%2==0) return (modpow(n,p/2,mod)*modpow(n,p/2,mod))%mod;
	if(p%2==1) return (modpow(n,p-1,mod)*n)%mod;
	cerr<<"ERROR"<<endl;
	return 1;
}



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

using Edge = pair<int64_t,int64_t>;
using Graph = vector<vector<Edge>>;

int64_t N;
vector<int64_t> ans;
Graph G;

// vは今見ている頂点, pはvの親, cをvに塗る
void dfs(int64_t v, int64_t p, int64_t c ) {
    ans[v] = c;
    for ( auto u: G[v] ){
        int64_t nv = u.first;
        int64_t w = u.second;
        if ( nv == p ) continue;
        if ( w % 2 == 0 ){
            // 距離が偶数の場合
            dfs(nv,v,c);
        } else {
            // 距離が奇数の場合
            dfs(nv,v,(c+1)%2);
        }
    }
}

int main() {
    cin >> N;
    vector<int64_t> u(N-1),v(N-1),w(N-1);
    for ( int64_t i = 0; i < N-1; ++i){
        int64_t U,V;
        cin >> U >> V >> w.at(i);
        u.at(i) = U - 1;
        v.at(i) = V - 1;
    }
    
    G.assign(N,vector<Edge>());
    for ( int64_t i = 0; i < N-1; ++i){
        G[u.at(i)].push_back(Edge(v.at(i),w.at(i)));
        G[v.at(i)].push_back(Edge(u.at(i),w.at(i)));
    }
    
    for ( int64_t i = 0; i < N; ++i ){
        for ( auto e: G[i] ){
            int64_t j = e.first;
            int64_t k = e.second;
            //cout << i << " " << j << " " << k << endl;
        }
    }
    
    ans.assign(N,-1);
    
    dfs(0,-1,0);
    
    for ( auto c: ans){
        cout << c << endl;
    }
    
    
    return 0;
}


Measured memory_bytes: 12928
#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long a[2000];
int main() {
	long long n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	a[n] = 0;
	bool b = false;
	long long now = 1000;
	long long l;
	for (int i = 0; i < n; i++) {
		if (a[i] <= a[i + 1]) {
			if (!b) {
				l = a[i];
			}
			b = true;
		}
		else {
			if (b) {
				long long k = now / l;
				now -= now / l * l;
				now += k * a[i];
				b = false;
			}
		}
	}
	cout << now << endl;
	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <string>
#include <queue>
#include <numeric>
#include <ctype.h>
#include <limits>
#include <iomanip>

#define rep(i,n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
using namespace std;

int main() {
	/*int r;
	cin >> r;
	cout << 3 * r * r;*/


	/*int N, D;
	cin >> N >> D;
	int ans;
	ans = N / (2 * D + 1) + 1;
	if ( N % (2 * D + 1) == 0)ans = N / (2 * D + 1);
	cout << ans;*/


	/*int N;
	cin >> N;
	vector<pair<int, int>>a(N);
	rep(i, N) {
		cin >> a[i].first;
		a[i].second = i;
	}
	sort(all(a), greater<pair<int, int>>());
	int ans;
	rep(i, N) {
		if (i == a[0].second) {
			ans = a[1].first;
		}
		else {
			ans = a[0].first;
		}
		cout << ans << "\n";
	}*/


	int N;
	cin >> N;
	vector<int>a(N + 1), h(N + 1);
	rep(i, N)cin >> a[i + 1];
	int i, j, M = 0;;
	for (i = N; i > 0; i--) {
		j = 2;
		h[i] ^= a[i];
		while (i * j <= N) {
			h[i] ^= h[i * j];
			j++;
		}
		if (h[i] == 1)M++;
	}
	cout << M << "\n";
	if (M > 0) {
		rep(i, N) {
			if (h[i + 1] == 1)cout << i + 1 << " ";
		}
	}

	return 0;
}

Measured memory_bytes: 2432
# ABC106B

n=int(input())

cnt8=0
for i in range(1,n+1):
    if i % 2 ==0:
        continue
    cntd=0
    for j in range(1,i+1):
        if i % j == 0:
            cntd+=1
    if cntd==8:
        cnt8+=1
print(cnt8)

Measured memory_bytes: 38768
#include <bits/stdc++.h>
using namespace std;
//#define int long long
#define endl "\n"
#define pii pair<int, int>
#define fi first
#define se second
#define vi vector<int>
#define pb push_back
#define make_pair mp
#define MAX (long long )1e18
#define INF (int)1e9+7
#define K 26
#define rep(i,a,b) for(int i = a; i<b; i++)
#define ll long long 

bool v[100];



int32_t main(){
	int n,k,i,j;
	cin >> n >> k;
	for(i = 0; i<k; i++){
		int c,s;
		cin >> c;
		for(j = 0; j<c; j++){
			cin >> s;
			v[s] = true;
		}
	}
	int c = 0;
	for(j = 1; j<=n; j++){
		if(v[j] == 0){
			c++;
		}
	}
	cout << c << endl;
	return 0;
}

Measured memory_bytes: 3584
#include<iostream>
using namespace std;
 
int main(){
  int n,flag[4]={},i;
  char s[100];
  cin >> n;
  for(i=0;i<n;i++){
    cin >> s[i];
    if(s[i]=='Y'){
      flag[0]=1;
       break;
    } 
  }
  if(flag[0]){
    cout<<"Four"<<endl;  
  }
  else{
cout<<"Three"<<endl;
  }
  }

Measured memory_bytes: 3480
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    string s; cin>>s;
    int cnt[26]={0};
    REP(i,s.size()){
        cnt[s[i]-'a']++;
    }
    REP(i,26){
        if(cnt[i]>1){
            cout<<"no"<<endl;
            return 0;
        }
    }
    cout<<"yes"<<endl;
}


Measured memory_bytes: 256