akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{

    static class Program
    {
        static void Main()
        {
            Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            //

            var cin = GetCharArray();
            var ans = cin[0] > cin[1] ? ">" : cin[0] == cin[1] ? "=" : "<";

            Console.WriteLine(ans);

            //
            Console.Out.Flush();
            Console.ReadKey();
        }

        static void Solve()
        {

        }

        static long GCD(long a, long b) { return b != 0 ? GCD(b, a % b) : a; }


        static public string GetStr() { return Console.ReadLine().Trim(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public string[] GetStrArray() { return Console.ReadLine().Split(' '); }
        static public int[] GetIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
        static public long[] GetLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public char[] GetCharArray() { return Console.ReadLine().Split(' ').Select(char.Parse).ToArray(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteObjects<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
        static string yesno(this bool b) { return b ? "yes" : "no"; }
        static string YesNo(this bool b) { return b ? "Yes" : "No"; }
        static string YESNO(this bool b) { return b ? "YES" : "NO"; }

        static bool eq<T, U>() => typeof(T).Equals(typeof(U));
        static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
        static T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                           : eq<T, long>() ? ct<T, long>(long.Parse(s))
                           : eq<T, double>() ? ct<T, double>(double.Parse(s))
                           : eq<T, char>() ? ct<T, char>(s[0])
                                             : ct<T, string>(s);
        static void Multi<T>(out T a) => a = cv<T>(GetStr());
        static void Multi<T, U>(out T a, out U b)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c, out V d)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<V>(ar[3]);
        }
    }
}

Measured memory_bytes: 13396
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<double,double> pdd;
#define SQ(i) ((i)*(i))
#define MEM(a, b) memset(a, (b), sizeof(a))
#define SZ(i) int(i.size())
#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 REP1(i,j) FOR(i, 1, j+1, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define ALL(_a) _a.begin(),_a.end()
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define X first
#define Y second
#ifdef tmd
#define TIME(i) Timer i(#i)
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,deque<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
class Timer {
private:
    string scope_name;
    chrono::high_resolution_clock::time_point start_time;
public:
    Timer (string name) : scope_name(name) {
        start_time = chrono::high_resolution_clock::now();
    }
    ~Timer () {
        auto stop_time = chrono::high_resolution_clock::now();
        auto length = chrono::duration_cast<chrono::microseconds>(stop_time - start_time).count();
        double mlength = double(length) * 0.001;
        debug(scope_name, mlength);
    }
};
#else
#define TIME(i)
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
#endif

const ll MOD = 1000000007;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int iNF = 0x3f3f3f3f;
// const ll MAXN = 

ll m, sum, cnt;
/********** Good Luck :) **********/
int main () {
    TIME(main);
    IOS();

    cin >> m;
    REP (i, m) {
        ll d, c;
        cin >> d >> c;
        cnt += c;
        sum += d * c;
    }

    cout << cnt - 1 + (sum - 1) / 9 << endl;

    return 0;
}


Measured memory_bytes: 256
n,k = map(int,input().split())
x = list(map(int,input().split()))
ans = 10**10
for i in range(n-k+1):
    s,e = x[i],x[i+k-1]
    ans = min(ans,abs(s)+abs(e-s),abs(e)+abs(e-s))
print(ans)

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

int main() {
  int N,Y;
  int a=-1,b=-1,c=-1;
  cin >> N >> Y;
  Y = Y/1000;
  int z;
  bool finished = false;
  for (int x=0; x<=N; x++) {
    for (int y=0; y<=N-x; y++) {
      z = N-x-y;
      if (10*x+5*y+z==Y) {
        a=x;b=y;c=z;
        finished =true;
        break;
      }
    }
    if (finished) {
        break;
      }
  }
  cout << a << " " << b << " " << c << endl; 
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

using namespace std;

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

    int A[3];
    cin >> A[0] >> A[1] >> A[2];
    sort(A,A+3);

    int sum = 2 * A[2] - A[0] - A[1];

    if(sum % 2 == 0){
        cout << sum / 2 <<endl;
    }else{
        cout << sum / 2 + 2;
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int gcd(int x,int y){return y?gcd(y,x%y):x;}
int main(){
	string s;
	for(;cin>>s;){
		if(s=="#")break;
		vector<string>v;
		for(int idx=0;idx<s.size();){
			if(s.substr(idx,4)=="west"){
				v.push_back("west");
				idx+=4;
			}else{
				v.push_back("north");
				idx+=5;
			}
		}

		int n=v.size()-1;
		int cur=1<<20;
		int numerator=cur;
		int d=v[n]=="west"?cur:0;
		for(n--,cur>>=1;n>=0;n--,cur>>=1){
			if(v[n]=="west"){
				d+=cur;
			}else{
				d-=cur;
			}
		}
		d*=90;
		int g=gcd(d,numerator);
		d/=g;numerator/=g;
		if(numerator==1){
			cout<<d<<endl;
		}else{
			cout<<d<<'/'<<numerator<<endl;
		}
	}
}

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

int main(){
  string a;
  getline(cin,a);
  int q=a.find(" ");
  for(int i=1;i<a.size()-q;i++){
  cout << a[q+i];
  }
  for(int i=0;i<q;i++){
  cout << a[i];}
  cout << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please



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

	int N;

	ll A[300];
	cin >> N;
	rep(i, N) cin >> A[i];

	ll kei = 0;
	for (int i = 2; i < N; i++) kei ^= A[i];
	ll tasu = A[0] + A[1];

	int are[45] = {};
	int kuri[45] = {};
	int OK = 1;
	for (int i = 43; i >= 0; i--) {
		int a = (tasu >> i & 1);
		int b = (kei >> i & 1);

		if (a && b) {
			if (kuri[i + 1]) OK = 0;
			else {
				are[i] = 1;
			}
		}
		else if (a) {
			if (kuri[i + 1]) {
				are[i] = 2;
				kuri[i] = 1;
			}
			else {
				kuri[i] = 1;
			}
		}
		else if (b) {
			if (kuri[i + 1]) {
				are[i] = 1;
				kuri[i] = 1;
			}
			else {
				OK = 0;
			}
		}
		else {
			if (kuri[i + 1]) {
				are[i] = 2;
			}
		}
	}

	if (!OK || kuri[0]) {
		co(-1);
		return 0;
	}

	int ika = 0;
	ll kotae = -1;
	ll tmp = 0;
	for (int i = 43; i >= 0; i--) {
		if (A[0] >> i & 1) {
			if (are[i] == 0) {
				ll tmp2 = tmp;
				for (int j = i - 1; j >= 0; j--) {
					if (are[j]) tmp2 += (1ll << j);
				}
				chmax(kotae, tmp2);
				break;
			}

			if (are[i] == 1) {
				ll tmp2 = tmp;
				for (int j = i - 1; j >= 0; j--) {
					if (are[j]) tmp2 += (1ll << j);
				}
				chmax(kotae, tmp2);

				tmp += (1ll << i);
			}

			if (are[i] == 2) {
				tmp += (1ll << i);
			}

		}
		else {
			if (are[i] == 2) {
				OK = 0;
				break;
			}
		}
	}
	if (OK) chmax(kotae, tmp);

	if (kotae <= 0) co(-1);
	else co(A[0] - kotae);




	Would you please return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

template <class T, class U>
inline bool chmin(T &lhs, const U &rhs) {
  if (lhs > rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}

template <class T, class U>
inline bool chmax(T &lhs, const U &rhs) {
  if (lhs < rhs) {
    lhs = rhs;
    return true;
  }
  return false;
}

// [l, r) from l to r
struct range {
  struct itr {
    int i;
    constexpr itr(int i_): i(i_) { }
    constexpr void operator ++ () { ++i; }
    constexpr int operator * () const { return i; }
    constexpr bool operator != (itr x) const { return i != x.i; }
  };
  const itr l, r;
  constexpr range(int l_, int r_): l(l_), r(std::max(l_, r_)) { }
  constexpr itr begin() const { return l; }
  constexpr itr end() const { return r; }
};

// [l, r) from r to l
struct revrange {
  struct itr {
    int i;
    constexpr itr(int i_): i(i_) { }
    constexpr void operator ++ () { --i; }
    constexpr int operator * () const { return i; }
    constexpr bool operator != (itr x) const { return i != x.i; }
  };
  const itr l, r;
  constexpr revrange(int l_, int r_): l(l_ - 1), r(std::max(l_, r_) - 1) { }
  constexpr itr begin() const { return r; }
  constexpr itr end() const { return l; }
};

int main() {
  int N, M;
  std::cin >> N >> M;
  if (N & 1) {
    for (int i: range(0, M)) {
      std::cout << i + 1 << ' ' << N - i << '\n';
    }
  }
  else {
    int half = (N / 2) - 1;
    for (int i: range(0, std::min((half + 1) / 2, M))) {
      std::cout << i + 1 << ' ' << N - i << '\n';
    }
    for (int i: range((half + 1) / 2, M)) {
      std::cout << i + 1 << ' ' << N - i - 1 << '\n';
    }
  }
  return 0;
}


Measured memory_bytes: 3624
import sys

ipt = []
for line in sys.stdin:
  ipt.append(line)
dic = {}
dic[1] = True
dic[2] = True

for i in xrange(len(ipt)):
  s = ipt[i]
  a,b = map(int, s.split())
  if a==b==0:
    if len(dic) == 0:
      print "OK"
    else:
      print "NG"
    dic = {}
    dic[1] = True
    dic[2] = True
    continue
  if a in dic:
    del dic[a]
  else:
    dic[a] = True
  if b in dic:
    del dic[b]
  else:
    dic[b] = True

Measured memory_bytes: 6316
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

	static Scanner scanner;

	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int K=gi();
	    int s=0;
        for(int i=1; i<=K; i++) {
        	for(int j=1; j<=K; j++) {
        		int u1=uclid(i,j);
        		for(int k=1; k<=K; k++) {
                	int u=uclid(u1,k);
                	s+=u;
                }
            }
        }
        

        System.out.print(s);

//        if (b>=1 && b<=12) {
//        	if(a>=1 && a<=12) {
//        	    System.out.println("AMBIGUOUS");
//        	} else {
//        		System.out.println("MMYY");
//        	}
//        }else {
//        	if(a>=1 && a<=12) {
//        	    System.out.println("YYMM");
//        	} else {
//        		System.out.println("NA");
//        	}
//        }
	}
	
	// ユークリッドの互除法
    public static int uclid(int m, int n) {
    	if (m<n) {
			m^=n;
			n^=m;
			m^=n;
		}

		while(true) {
			int t=m%n;
			if (t==0) {
				return n;
			} else {
				m=n;
				n=t;
			}
		}
    }

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

Measured memory_bytes: 35796
#include <bits/stdc++.h>
#define MOD 1000000007

using namespace std;

typedef long long ll;

inline void add(int &x,int y) {
  ((x+=y)>=MOD)?x-=MOD:0;
} 

ll C[105][105];

void pre(int n) {
  for(int i=0;i<=n;i++) C[i][0]=1;
  for(int i=1;i<=n;i++)
    for(int j=1;j<=i;j++) C[i][j]=(C[i-1][j-1]+C[i-1][j])%MOD;
}

int f[85][85][85],up[85];
int sum[85];

void dp(int n,int m,int c) {
  memset(f,0,sizeof(f));
  int t=m+2*c-1;
  f[0][0][0]=1;
  for(int i=0;i<m;i++)
    for(int j=0;j<=up[i]&&2*j-m+t<=n;j++) {
      int s=f[i][j][0];
      for(int k=1;k<=up[m]&&j+(m-i)*k<=up[m];k++) {
      	for(int l=1;i+l<=m&&j+l*k<=up[i+l];l++)
      	  add(f[i+l][j+l*k][k],s*C[i+l][l]%MOD);
      	add(s,f[i][j][k]);
	  }
    }
  for(int i=0;i<=up[m]&&2*i-m+t<=n;i++) {
  	int s=0;
  	for(int j=0;j<=i;j++) add(s,f[m][i][j]);
  	if (!s) continue;
  	int v=2*i-m+t;
  	for(int j=0;j<=2*m+2&&v+j<=n;j++)
  	  add(sum[v+j],s*C[m+c][c]%MOD*C[2*m+2][j]%MOD);
  }
}

char str[85];

int q[85],lpos[85];
bool vis[85];

int main() {
  int n,k;
  scanf("%d%d%s",&n,&k,str+1);
  pre(100);
  for(int i=0;2*i<=k;i++) {
  	memset(vis,0,sizeof(vis));
  	int cnt=0;
  	int lx=1,rx=0;
  	for(int j=1;j<=k&&cnt<i;j++)
  	  if (str[j]=='r') q[++rx]=j;
  	  else if (lx<=rx) {
  	  	  vis[q[lx++]]=vis[j]=1;
  	  	  lpos[++cnt]=j;
		}
	if (cnt<i) continue;
	int s=0;
	for(int j=1;j<=k;j++)
	  if (!vis[j]&&str[j]=='r') s++;
	int r=1;
	lpos[i+1]=k+1;up[i+1]=0;
	for(int j=0;j<=s;j++) {
		if (j) {
			while (vis[r]||str[r]!='r') r++;
			vis[r]=1;
		}
		for(int t1=i;t1>0;t1--) {
			up[t1]=up[t1+1];
			for(int t2=lpos[t1+1]-1;t2>lpos[t1];t2--)
			  if (!vis[t2]) up[t1]++;
			up[t1]++;
		}
		reverse(up+1,up+i+1);
		dp(n,i,j);
	}
  }
  int ans=0;
  for(int i=1;i<=n;i++) add(ans,sum[i]*C[n-1][i-1]%MOD);
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 2688
#include<iostream>
 #include<algorithm>

 using namespace std;

 static const int MMAX = 20;
 static const int NMAX = 50000;
 static const int INFTY = (1 << 29);

 main() {
 int n, m;
 int C[MMAX + 1];
 int T[NMAX + 1];

 cin >> n >> m;

 for ( int i = 1; i <= m; i++ ) {
 cin >> C[i];
 }

 for ( int i = 0; i <= NMAX; i++ ) T[i] = INFTY;
 T[0] = 0;
 for ( int i = 1; i <= m; i++ ) {
 for ( int j = 0; j + C[i] <= n; j++ ) {
 T[j + C[i]] = min(T[j + C[i]], T[j] + 1 );
 }
 }

 cout << T[n] << endl;

 return 0;
 }

Measured memory_bytes: 3288
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<int, int> pi;
const int mod = 1e9 + 7;
const int MAXN = 100005;

lint a, b, c, d, n;

int main(){
	cin >> a >> b >> c >> d >> n;
	n *= 4;
	b = min(b, 2 * a);
	c = min(c, 2 * b);
	d = min(d, 2 * c);
	lint ans = 0;
	ans += (n / 8) * d;
	n %= 8;
	ans += (n / 4) * c;
	n %= 4;
	ans += (n / 2) * b;
	n %= 2;
	ans += (n / 1) * a;
	cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
  public static int figure(int a){
    int count=0;
    while(a>0){
      count += a%10;
      a = a/10;
    }
    return count;
  }
    public static void main(String[] args) {
      Scanner scan = new Scanner(System.in);
      int n =  scan.nextInt();
      int a =  scan.nextInt();
      int b =  scan.nextInt();
      int count =0;

      for(int i=1;i<n+1;i++){
        if(figure(i)>=a&&figure(i)<=b){
          count += i;
      }
      
      }
		System.out.println(count);
        scan.close();
  }
}


Measured memory_bytes: 23892
N = int(input())
h_list = map(int, input().strip().split())

count = 0
max_count = 0
prev = 0
for h in h_list:
	if h <= prev:
		count += 1
		if count > max_count:
			max_count = count
	else:
		count = 0
	prev = h

print(max_count)


Measured memory_bytes: 11132
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <queue>
#include <vector>
#include <cstdlib>
#define mp make_pair
#define pb push_back
#define mem(i,a) memset(i,a,sizeof(i))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
const int DMAX=1000000+5;
const int MOD=1000000007;
template<class T> inline void read(T &x){
	x=0; 
	T f=1;
	char ch=getchar();
	while(ch<'0' || ch>'9'){
		if(ch=='-'){
			f=-1;
		}
		ch=getchar();
	}
	while(ch<='9' && ch>='0'){
		x=x*10+(ch-'0');
		ch=getchar();
	}
	x*=f;
}
ll n;
int main(){
	read(n);
	ll p=n/1000;
	if(n%1000==0){
		cout<<0<<endl;
	}
	else{
		cout<<(p+1)*1000-n<<endl;
	}
	return 0;
}	

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace std;
using namespace __gnu_pbds;

#define pbds tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
#define ll long long
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
 
// debug templates 
#define debug(x)       cerr<< #x <<" : "<< x << endl;
#define debuga(A,N)    cerr<< #A <<" : [";for(int i = 0; i<N;i++) cerr<<A[i]<<" "; cerr<<"]\n";
#define debuga2(A,N,M) cerr<< #A << " : \n"; for(int i=0;i<N;i++){cerr<<"[";for(int j=0;j<M;++j) cerr<<A[i][j]<<" ";cerr<<"]\n";}
#define debugp(p)      cerr<< #p <<" : "<<"("<<(p).first<<","<<(p).second<<")\n";
#define debugv(v)      cerr<< #v <<" : "<<"[";for(int i = 0; i< (v).size(); i++) cerr<<v[i]<<" "; cerr<<"]\n";
#define debugv2(v)     cerr<< #v << " : \n"; for(int i=0;i<v.size();i++){cerr<<"[";for(int j=0;j<(v[0].size());++j) cerr<<v[i][j]<<" ";cerr<<"]\n";}
#define debugs(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin(); itr!=m.end();itr++) cerr<<*itr<<" "; cerr<<"]\n";
#define debugm(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin();itr!=m.end(); itr++) cerr<<"("<<itr->first<<","<<itr->second<<") ";cerr<<"]\n";
 

void solve(){
    bool x; cin >> x; cout << !x;
}
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	solve();
	return 0;
}
 


Measured memory_bytes: 3652
#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <map>
#define inf 1e9
#define eps 1e-8
#define MAXT 500000
#define MAXN 1010
using namespace std;

int n,q;
struct Node
{
    char nam[20];
    int st,ed;
    int id;
}a[MAXN];
int main()
{
    while(scanf("%d%d",&n,&q))
    {
        if(n==0&&q==0)break;
        for(int i=1;i<=n;i++)
        {
            scanf("%s",a[i].nam);
            int x,y;
            scanf("%d%d",&x,&y);
            a[i].st=y-x+1;a[i].ed=y;
        }
        while(q--)
        {
            int tp;
            scanf("%d",&tp);
            int flag=0;
            for(int i=1;i<=n;i++)
            {
                if(tp>=a[i].st&&tp<=a[i].ed)
                {
                    printf("%s %d\n",a[i].nam,tp-a[i].st+1);
                    flag=1;
                    break;
                }
            }
            if(!flag)printf("Unknown\n");
        }
    }
    return 0;
}

Measured memory_bytes: 1232
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <iomanip>
#include <set>
#include <sstream>
using namespace std;
typedef long long ll;

void rec(int d, ll val, vector<ll> &all) {
  all.push_back(val);

  if (d == 10) {
    return;
  }

  for (int j = -1; j <= 1; j++) {
    int add = (val % 10) + j;
    if (add >= 0 && add <= 9) {
      rec(d + 1, val * 10 + add, all);
    }
  }
}

int main() {
  int K;
  cin >> K;
  vector<ll> all;
  for (int v = 1; v < 10; v++) {
    rec(1, v, all);
  }

  sort(all.begin(), all.end());

  cout << all[K-1] << endl;
}

Measured memory_bytes: 5372
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include <cstdlib>
using namespace std;

int main(int argc,char** argv)
{

	string a , b ;
	int c;
	cin >> a >> b;
	a = a+b;
	c = atoi(a.c_str());
	for(int i = 1; i <= 320; i++){
		if( c == i*i){
			cout << "Yes" <<endl;
			return 0;
		}
	}
	cout << "No" <<endl;

	return 0;

}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<numeric>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};

int main()
{

    int N;
    vector<int> X;
    cin >> N;
    for (int i=0; i<N; ++i)
    {
        int tmp;
        cin >> tmp;
        X.push_back(tmp);
    }

    sort(X.begin(),X.end());
    ll ans = inf;
    ll tmp;
    for (int i=X[0]; i<=X[N-1]; ++i)
    {
        tmp = 0;
        for (int j=0; j<(int)X.size(); ++j)
        {
            tmp += (X[j]-i)*(X[j]-i);
        }
        if(ans > tmp) ans = tmp;
    }

    cout << ans << endl;

    return 0;
}

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


int main() {
  int n; string m; cin >> n >> m;
  cout << (3200 <= n ? m : "red") << endl;
  return 0;
}


Measured memory_bytes: 256
import Control.Monad
import Data.List
main = do
  [n,m] <- map read . words <$> getLine
  as <- map read . words <$> getLine
  bcs <- replicateM m $ map read . words <$> getLine
  let cs = concat [replicate b c | [c,b] <- reverse $ sort $ map reverse bcs]
  print $ sum $ map toInteger $ zipWith max (sort as) (cs ++ repeat 0)

Measured memory_bytes: 167164
#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;

    int a,b;
    int c=0;
    cin>>a>>b;
    for(int i=a;i<=b;i++){
        if(i%t==0){
            c=1;
            break;
        }
    }
    if(c==1){
        cout<<"OK";
    }
    else
        cout<<"NG";



    return 0;
}


Measured memory_bytes: 3632
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		
			int n=Integer.parseInt(br.readLine().trim());	
			String[] s=br.readLine().split(" ");
			int[] a=new int[n];
			for(int i=0;i<n;i++)
			{
				a[i]=Integer.parseInt(s[i].trim());
			}
			
			int res=0;
			for(int i=1;i<=n;i++) {
				if(i%2!=0 && a[i-1]%2!=0) {
					res++;
				}
			}
			System.out.println(res);
			
		
	}

}


Measured memory_bytes: 32396
import sys
from itertools import combinations
from math import sqrt
import numpy as np

read = sys.stdin.read
readline = sys.stdin.readline


def main():
    N, K, *xyc = map(int, read().split())
    x = xyc[::3]
    y = xyc[1::3]
    xy = list(zip(x, y))
    c = xyc[2::3]
    left = 0
    right = 10 ** 6
    delta = 0.1 ** 7
    while right - left > delta:
        mid = (left + right) / 2
        intersections = []
        r = [(mid / i) ** 2 for i in c]
        for i, j in combinations(range(N), 2):
            x1, y1 = xy[i]
            x2, y2 = xy[j]
            X = x2 - x1
            Y = y2 - y1
            XY = X ** 2 + Y ** 2
            r1 = r[i]
            r2 = r[j]

            a = (XY + r1 - r2) / 2
            b = XY * r1 - a ** 2
            if b < delta:
                continue
            b = sqrt(b)
            xi1 = (a * X + Y * b) / XY + x1
            yi1 = (a * Y - X * b) / XY + y1
            xi2 = (a * X - Y * b) / XY + x1
            yi2 = (a * Y + X * b) / XY + y1
            intersections.append((xi1, yi1))
            intersections.append((xi2, yi2))

        intersections.extend(xy)
        intersections = np.array(intersections, np.float)
        cnt = np.zeros(len(intersections), np.int64)

        for (i, j), k in zip(xy, r):
            XY = (intersections[:, 0] - i) ** 2 + (intersections[:, 1] - j) ** 2
            cnt[XY < k + delta] += 1

        if np.any(cnt >= K):
            right = mid
        else:
            left = mid

    print(right)


if __name__ == '__main__':
    main()


Measured memory_bytes: 14544
//////////////      VATSAL AGARWAL       ////////////////////////
////////////// Codeforces id : warhead38 ////////////////////////
////////////// Codechef   id : vatsal38  //////////////////////// 


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define endl '\n'
#define loop(var,a,b,c) for(ll var=a;var<=b;var+=c)
#define intarr(arr,n) ll arr[n];for(ll i=0;i<n;i++)cin>>arr[i]
#define inparr(arr,n) for(ll i=0;i<n;i++)cin>>arr[i]
#define inpvec(vec,n) for(ll i=0;i<n;i++){ll var;cin>>var;vec.push_back(var);}
#define pb push_back
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mod 1000000007
#define newline cout<<endl
#define ump unordered_map<ll,ll>
#define vec vector<ll>
#define mkp make_pair
#define disp(var1,var2) cout<<var1<<" "<<var2<<endl;
#define all(v)             v.begin(),v.end()
#define cout(var) cout<<var<<endl
#define mod2 998244353
#define fbo find_by_order  /// find kth smallest by passing k-1
#define ook order_of_key  //// find no of smaller items less than k
#define teensort(a,r,g,b) a[0]=r;a[1]=g;a[2]=b;sort(a,a+3);
#define ss second
#define ff first
#define displayarray(a,n) for(ll i=0;i<n;i++)cout<<a[i]<<" "; cout<<endl;
#define pi pair<ll,ll>
#define meramax 1e18
#define meramin -1e18
#define percentile 1000000007
#define PI 3.14159265358979323846
#define input2darr(n,m,in) ll a[n+1][m+1];if(in==0){loop(i,0,n-1,1)loop(j,0,m-1,1)cin>>a[i][j];}else{loop(i,1,n,1)loop(j,1,m,1)cin>>a[i][j];}
#define minheap priority_queue<ll>
#define maxheap priority_queue<ll,vector<ll>,greater<ll>>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////                                     ///////////////////////////////////////////////////////////////
////////////////////////////////////////              CODE                   ///////////////////////////////////////////////////////////////
////////////////////////////////////////                                     ///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
void AcDegaYe()
{
    ll x,y;
    cin>>x>>y;
    if(y&1)
    {
        cout("No");
        return;
    }
    else
    {
        ll a=2*x-y/2;
        ll b=y/2-x;
        if(a>=0 && b>=0)
        {
            cout("Yes");
        }
        else
        {
            cout("No");
        }
    }
}
int main()
{   
    fastio
    //ll t;
    //cin>>t;
    ll t=1;
    while(t--)
    {
        AcDegaYe();
    }
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}

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

int main(){
    int N;
    cin >>N;
    long long int L_n1=1;
    long long int L_n2=2;

    long long int ans=0;
    for(int i=2;i<N+1;i++){
      ans=L_n1+L_n2;
      L_n2=L_n1;
      L_n1=ans;
    }
    if(N==1)ans=L_n1;
    cout<<ans<<endl;
  }


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

int main() {
    int n, k;
    cin >> n >> k;
    int m = (n-1) * (n-2) / 2 - k;
    if (m < 0) {
        cout << -1 << endl;
        return 0;
    }
    cout << n-1+m << endl;
    for (int i = 1; i < n; ++i) {
        cout << 1 << " " << i+1 << endl;
    }
    int s = 0;
    for (int i = 1; i < n; ++i) {
        if (s >= m) break;
        for (int j = i+1; j < n; ++j) {
            if (s >= m) break;
            cout << i+1 << " " << j+1 << endl;
            s++;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    // Your code here!
  int i=1;
  int x;
  while(1){
      cin>>x;
      if(x==0){
          break;
      }
      cout<<"Case "<<i<<": "<<x<<endl;
    i++;  
  }
}  



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


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

    long x, k, d;
    cin >> x >> k >> d;
    if (x < 0) x = -x;
    long step = min(k, x / d);
    x -= d * step;
    k -= step;

    cout << (k % 2 == 0 ? x : abs(x - d)) << endl;

    return 0;
}


Measured memory_bytes: 3560
N,X = map(int,input().split())
L = list(map(int,input().split()))
D = [0]*(N+1)
for i in range(N):
    D[i+1] = D[i]+L[i]
cnt = 0
for i in range(N+1):
    if D[i] > X:
        break
    else:
        cnt += 1
print(cnt)

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
class Program
{
/*
1以上N以下の整数のうち、10進法での各桁の和が A以上B以下であるものの総和を求めてください。
制約
1≤N≤10^4
1≤A≤B≤36入力はすべて整数である
*/
    static void Main(string[] args) 
    {
        string[] input = Console.ReadLine().Split(' ');
        int N = int.Parse( input[ 0 ] );
        int A = int.Parse( input[ 1 ] );
        int B = int.Parse( input[ 2 ] );
        
        List<int> nums = new List<int>();
        for( int i = 1; i <= N; ++i )
        {
            int div = i;
            int remainder = 0;
            while ( div / 10 != 0 )
            {
                remainder += div % 10;
                div /= 10;
            }
            remainder += div % 10;
            if ( A <= remainder && remainder <= B )
            {
                nums.Add( i );
            }
        }
        
        int total = 0;
        foreach( int num in nums )
        {
            total += num;
        }
        Console.WriteLine( total );
    }
}

Measured memory_bytes: 13268
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<set>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const ll INF = 1e9 + 7;
const ll MOD = 1e9 + 7;

int dx[4] = { 1,0,0,-1 };
int dy[4] = { 0,1,-1,0 };


struct Combination {

	vector<ll> fact, rfact;

	Combination(ll sz) : fact(sz + 1), rfact(sz + 1) {

		fact[0] = 1;
		for (ll i = 1; i < fact.size(); i++) {
			fact[i] = fact[i - 1] * i % MOD;
		}
		//逆元
		rfact[sz] = inv(fact[sz]);
		for (ll i = sz - 1; i >= 0; i--) {
			rfact[i] = rfact[i + 1] * (i + 1) % MOD;
		}
	}

	ll inv(ll x) {
		//modpow
		return pow(x, MOD - 2);
	}
	ll pow(ll x, ll n) {
		//累乗
		ll ret = 1;
		while (n > 0) {
			if (n & 1) (ret *= x) %= MOD;
			(x *= x) %= MOD;
			n >>= 1;
		}
		return (ret);
	}
	ll P(ll n, ll r) {
		//順列
		if (r < 0 || n < r) return (0);
		return (fact[n] * rfact[n - r] % MOD);
	}

	ll C(ll p, ll q) {
		//組み合わせ
		if (q < 0 || p < q) return (0);
		return (fact[p] * rfact[q] % MOD * rfact[p - q] % MOD);
	}

	ll H(ll n, ll r) {
		//重複組み合わせ
		if (n < 0 || r < 0) return (0);
		return (r == 0 ? 1 : C(n + r - 1, r));
	}
};


/******************************************************************************************/

template<typename T>
T LIS(vector<T>& a) {/*長さに対する最小の最終要素*/

	T siz = a.size();
	vector<T> dp(a.size() + 10, INF);

	for (T i = 0; i < siz; i++) {
		*lower_bound(dp.begin(), dp.begin() + siz, a[i]) = a[i];
	}
	return lower_bound(dp.begin(), dp.begin() + siz, INF) - dp.begin();
}



int main() {

	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;
	
	int ans = 0;
	for (int i = a; i < b; i++)
	{
		if (i < 0) {
			ans += c;
		}
		else if (i == 0) {
			ans += d;
			ans += e;
		}
		else
		{
			ans += e;
		}
	}

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


Measured memory_bytes: 3084
/*input
4 3
1 2 3 4
1 3
2 3
2 4
*/

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

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> h(n);
  rep(i, n) cin >> h[i];
  vector<vector<int>> g(n);
  rep(i, m) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  vector<int> cnt(n, 1);
  rep(i, n) for (int to: g[i]) {
    if (h[i] <= h[to]) cnt[i] = 0;
  }
  int ans = 0;
  rep(i, n) ans += cnt[i];
  cout << ans << endl;
  // rep(i, n) cout << h[i] << endl;
  return 0;
}

Measured memory_bytes: 9004
s = gets.chomp
words = []
s.length.times do |i|
    words << s[i] if !(words.include?(s[i]))
end
result = true
if words.length != 2
    result = false
else
    words.each do |word|
        if s.count(word) != 2
            result = false
            break
        end
    end
end
puts result ? "Yes" : "No"

Measured memory_bytes: 1788
#include <stdio.h>
int main() {
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  if (a+b+c != 17) {
    printf("NO\n");
    return 0;
  }
  if (a == 5) {
    if (b == 5) {
      printf("YES\n");
    } else if (b == 7) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  } else if (a == 7) {
    if (b == 5) {
      printf("YES\n");
    } else if (b == 7) {
      printf("NO\n");
    } else {
      printf("NO\n");
    }
  } else {
    printf("NO\n");
  }
  return 0;
}


Measured memory_bytes: 128
from collections import Counter
N, M = map(int, input().split())
correct_cnt = 0
pena_cnt = 0
pena_counter = Counter()

is_AC = dict()
for i in range(N):
    is_AC[i] = False

for i in range(M):
    p, s = input().split()
    p = int(p) - 1
    if is_AC[p] == False:
        if s == "AC":
            is_AC[p] = True
            correct_cnt += 1
        else:
            pena_counter[p] += 1

for key, value in is_AC.items():
    if is_AC[key]:
        pena_cnt += pena_counter[key]
print(str(correct_cnt), str(pena_cnt))


Measured memory_bytes: 20700
import math
c = 0
n = int(input())

for j in range(n):
    x = int(input())
    
    if x == 2:
        c = c + 1
        
    if x < 2 or x % 2 == 0:
        c = c
        
    else:
        if x > 2 and x % 2 != 0:    
            i = 3
            a = 0
            while i <= math.sqrt(x):
                if x % i == 0:
                    c = c
                    a = a + 1
                    break
                else:
                    i = i + 2
            if a == 0:
                c = c + 1
print(c)


Measured memory_bytes: 5672
#include <stdio.h>
#include <stdlib.h>

void swap(int *, int *);

int main(){

  int i, j, n, *A, minj, count=0;

  scanf("%d",&n);

  A = (int *)malloc(sizeof(int) * n);

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

  for(i=0; i<n-1; i++){
    minj = i;
    for(j=i; j<n; j++){
      if(A[j] < A[minj]){
	minj = j;
      }
    }
    swap(&A[i], &A[minj]);
    if(A[i] != A[minj]){
      count++;
    }
  }

  for(i=0; i<n-1; i++){
    printf("%d ", A[i]);
  }

  printf("%d\n",A[i]);
  printf("%d\n",count); 

  return 0;
}

void swap(int *a, int *b){
  int c;

  c = *a;
  *a = *b;
  *b = c;

}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
 
int main(){
    ll N;
    cin >> N;
    vector<ll> data(N);
    rep(i,N){
        cin >> data.at(i);
    }

    sort(data.begin(),data.end());
    
    
    ll min=9e9;
    for(ll j=data.at(0); j<=data.at(N-1); j++){
        ll x=0;
        for(ll i=0; i<N; i++){
            x+=(data.at(i)-j)*(data.at(i)-j);
        }
        if(x<=min){
            min=x;
        }
    }

    cout << min << endl;
    
    }

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
using namespace std;
int list[100];
int main()
{
  for(;;){
    int n,a,b,c,x;
    cin >> n >> a >> b >> c >> x;
    if(n==0 && a==0 && b==0 && c==0 && x==0) break;
    memset(list,0,sizeof(list));
    for(int i=0; i<n; i++){
      cin >> list[i];
    }
    int count=0,index=0;
    for(;;){
      if(count > 10000){
        cout << -1 << endl;
        break;
      }
      if(list[index] == x) index++;
      if(n == index){
        cout << count << endl;
        break;
      }
      x = (a * x + b) % c;
      count++;
    }
  }
  return 0;
}

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

using namespace std;

const int N = 1e5 + 5;
int n, m, vis[N], dp[N];
vector<int> g[N];

void dfs(int v){
	vis[v] = 1;
	for(int u : g[v]){
		if(!vis[u])dfs(u);
		dp[v] = max(dp[v], 1 + dp[u]);
	}
}

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

	cin>>n>>m;
	for(int i=0;i<m;++i){
		int u, v; cin>>u>>v;
		g[u].push_back(v);
	}

	int ans = 0;
	for(int i=1;i<=n;++i)if(!vis[i]){
		dfs(i);
		ans = max(ans, dp[i]);
	}

	cout<<ans<<"\n";
}

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

int main(){
	int N, X; cin >> N >> X;
	vector<int>L(N);
	for(int j=0; j<N; j++){
		cin >> L[j];
	}
	int i,D=0;
	for(i=0; i<N; i++){
		D+=L[i];
		if(X<D){
			break;
		}
	}
	cout << i+1 << endl;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.Collections;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int H = Integer.parseInt(in.next());//体力
            int N = Integer.parseInt(in.next());//種類
            Integer[] A = new Integer[N];//必殺
            for (int i = 0; i < N; i++) {
                A[i] = Integer.valueOf(in.next());
            }
            Arrays.sort(A, Collections.reverseOrder());

            for (int i = 0; i < N; i++) {
                H -= A[i];
                if (H <= 0) {
                    out.println("Yes");
                    return;
                }
            }
            out.println("No");

        }

    }
}



Measured memory_bytes: 50528
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]

s = [i for i in input()]
l = len(s)
a = s[:int((l-1)/2)]
b = s[int((l+3)/2)-1:]
if s==s[::-1] and a==a[::-1] and b==b[::-1]:
    print("Yes")
else:
    print('No')

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

 int count2(int x){
   int c = 0;
   while(true){
     if(x%2 == 0){
       x = x/2;
       c++;
     }
   if(x%2 != 0) break;
  }
  return c;
 }
int main(){
  int N;
  cin >> N;
  vector<pair<int,int>> p(N);

  for(int i = 0;i<N;i++){
    p[i].first = count2(i+1);
    p[i].second = i+1;
  }
  sort(p.begin(),p.end());
  reverse(p.begin(),p.end());

  cout << p[0].second << endl;
 }

Measured memory_bytes: 256
#include <iostream>

int main()
{
    int a, b;
    std::cin >> a >> b;
    
    char* text;
    
    if (a > b)
        text = "a > b";
    else if (a < b)
        text = "a < b";
    else
        text = "a == b";
        
    std::cout << text << std::endl;
    
    return 0;
}


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

int main()
{
  string S;
  cin >> S;
  int ans = 0;
  int cnt = 0;

  for (int i = 0; i < S.size(); i++)
  {
    if (S.at(i) == 'A' or S.at(i) == 'G' or S.at(i) == 'C' or S.at(i) == 'T')
    {
      cnt++;
    }
    else
    {
      cnt = 0;
    }
    ans = max(ans, cnt);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define rep(i,a,b) for(int i=a;i<b;i++)
#define pb push_back

int main() {
    ios
    int tests=1 ;
//    cin>>  tests;
    while(tests--)
    {
        int n;cin>> n;
        vector<int> v;
        vector<int> dp(n+1);
        
        rep(i,0,n)
        {
            int data;
            cin>> data;
            v.pb(data);
        }
        dp[1]=0; dp[2]=abs(v[0]-v[1]);
//        cout << dp[0] << "  " << dp[1]<< "  " << dp[2];
        rep(i,3,n+1)
        {
            dp[i]=min(dp[i-1]+abs(v[i-2]-v[i-1]),dp[i-2]+abs(v[i-3]-v[i-1]));
//            cout << dp[i] << endl;
        }
        cout << dp[n];
        
    }
    
    return 0;
}


Measured memory_bytes: 1276
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pci pair <char, int>
#define pld pair <ld, ld>
#define ppld pair <pld, pld>
#define ppll pair <pll, pll>
#define pldl pair <ld, ll>
#define vll vector <ll>
#define vvll vector <vll>
#define vpll vector <pll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mll map <ll, ll>
#define fastmap gp_hash_table
#define cd complex <double>
#define vcd vector <cd>
#define PI 3.14159265358979
#pragma 03
using namespace std;
using namespace __gnu_pbds;
bool ok(ll n, ll k){
	while (n % k == 0) n /= k;
	if (n % k == 1) return 1;
	else return 0;
}
int main(){
	ll n; cin >> n;
	if (n == 2){
		cout << 1 << endl;
		return 0;
	}
	vll divs;
	ll ans = 0;
	for (ll i = 2; i < sqrt(n); i++){
		if (n % i == 0){
			divs.pb(i); divs.pb(n / i);
		}
	}
	ll x = sqrt(n); if (x * x == n) divs.pb(x);
	for (ll i = 2; i < sqrt(n - 1); i++){
		if ((n - 1) % i == 0) ans += 2;
	}
	x = sqrt(n - 1); if (x * x == (n - 1)) ans++;
	for (ll i = 0; i < divs.size(); i++){
		if (ok(n, divs[i])) ans++;
	}
	cout << ans + 2 << endl;
}

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

int main(){
  int k,x;
  cin>>k>>x;
  int a=x-k+1;//最小値
  int b=x+k-1;//最大値
  for(int i=a;i<=b;i++){
    cout<<i<<" ";
  }

  cout<<endl;
}


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

int main(){
  int ans=0;
  int n,k,d,s;
  cin>>n;
  vector<int> A(n,0);
  cin>>k;
  for(int i =0;i<k;i++){
    cin>>d;
    for(int j=0;j<d;j++){
      cin>>s;
      A[s-1]=1;
    }
  }
  for(int i=0;i<n;i++){
    if(A[i]!=1){
      ans+=1;
    }
  }
  cout<<ans;
}


Measured memory_bytes: 3632
Sp = list(input())
T = list(input())

len_Sp = len(Sp)
len_T = len(T)
restorable = False
max_i = 0
if len_Sp >= len_T:
    for i in range(len_Sp - len_T + 1):
        for j in range(len_T):
            if Sp[i + j] != '?' and Sp[i + j] != T[j]:
                break
        else:
            restorable = True
            max_i = i
if restorable:
    Sp[max_i : max_i + len_T] = T
    print(''.join(Sp).replace('?', 'a'))
else:
    print('UNRESTORABLE')


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

int main(){
    int n,k,r,m,tmp,bad1,bad2,cnt = 0;
    cin >> n >> k;
    vector <set<int> > data(k);
    vector <bool> ju(n+1,false);
    for(int i=0;i<k;i++){
        cin >> m;
        for(int j=0;j<m;j++){
            cin >> tmp;
            data[i].insert(tmp);
        }
    }
    cin >> r;
    for(int i=0;i<r;i++){
        cin >> bad1 >> bad2;
        for(int j=0;j<k;j++){
            if(data[j].find(bad1) != data[j].end() && data[j].find(bad2) != data[j].end()){
                ju[bad1] = true;
                ju[bad2] = true;
            }
        }
    }
    for(int i=0;i<n+1;i++){
        if(ju[i]) cnt++;
    }
    cout << cnt << endl;
}

Measured memory_bytes: 1200