akhauriyash/Code-Regression huggingface dataset:
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include<queue>
using namespace std;
//conversion
//------------------------------------------
inline long long toint(string s) {long long v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef long long ll;
typedef long long LL;
typedef vector<int > vi;
typedef vector<long long > VLL;
typedef vector<long long > vll;
typedef vector<string > ves;
typedef vector<char > vech;

typedef pair<long long , long long> pll;
typedef pair<long long , long long> PLL;
typedef map<ll , ll >mll;
typedef map<int , int >mii;
typedef map<char , int >mci;
typedef map<char , ll >mcl;


//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define VECMAX(x) *max_element(ALL(x))
#define VECMIN(x) *min_element(ALL(x))
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//#define MULTIPLE(i,n,k) for(int i = (k) ; i<(n) ; i+=k+1)//倍数ループ
//constant
//------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define SIZEOF(x) sizeof(x)/sizeof(x[0])

const long long INF = 100000000000000;
const long long NINF = -100000000000000;




//-------------------------------------------------------------




int main(){
    ll n , m ;//, k , A , B;    string s;    map<ll , ll>p;
    //vector<pll> Pairs;pll Ap;
    //cin >> n;
    //vll a(n);vll R(n+1);/*累積*/R[0] = 0;
    //REP(i,n)cin>>a[i];REP(i,n)R[i+1] = R[i]+a[i];

cin >> n;
m = 100;
ll ans = 0;
while(1){
    if(m>=n){
        break;
    }
    ans++;
    m*=1.01;



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







Measured memory_bytes: 3596
class Node:
    def __init__(self, key, priority):
        self.key = key
        self.priority = priority
        self.parent = None
        self.left = self.right = None
    def preorder(self):
        L = [self.key]
        if self.left: L += self.left.preorder()
        if self.right: L += self.right.preorder()
        return L
    def inorder(self):
        L = []
        if self.left: L += self.left.inorder()
        L.append(self.key)
        if self.right: L += self.right.inorder()
        return L

def rightRotate(t):
    s = t.left
    t.left = s.right
    s.right = t
    return s # root of the subtree
def leftRotate(t):
    s = t.right
    t.right = s.left
    s.left = t
    return s # root of the subtree

def insert(t, key, priority):
    if not t:
        return Node(key, priority) # 葉に到達したら新しい節点を生成して返す
    if key == t.key:
        return t # 重複したkeyは無視
    if key < t.key: # 左の子に移動
        t.left = insert(t.left, key, priority) # 左の子へのポインタを更新
        if t.priority < t.left.priority: # 左の子の方が優先度が高い場合右回転
            t = rightRotate(t)
    else: # 右の子へ移動
        t.right = insert(t.right, key, priority) # 右の子へのポインタを更新
        if t.priority < t.right.priority: # 右の子の方が優先度が高い場合左回転
            t = leftRotate(t)
    return t

def delete(t, key):
    if not t:
        return None
    if key < t.key: # 削除対象を検索
        t.left = delete(t.left, key)
    elif key > t.key:
        t.right = delete(t.right, key)
    else:
        return _delete(t, key)
    return t
def _delete(t, key):
    if not t.left and not t.right: # 葉の場合
        return None
    if not t.left: # 右の子のみを持つ場合左回転
        t = leftRotate(t)
    elif not t.right: # 左の子のみを持つ場合右回転
        t = rightRotate(t)
    else: # 左の子と右の子を両方持つ場合、優先度が高い方を持ち上げる
        if t.left.priority > t.right.priority:
            t = rightRotate(t)
        else:
            t = leftRotate(t)
    return delete(t, key)

def find(t, k):
    x = t
    while x:
        if x.key == k:
            return x
        x = x.left if k < x.key else x.right
    return None

t = None
m = int(input())
for _ in range(m):
    cmd = list(input().split())
    if cmd[0] == 'insert':
        t = insert(t, int(cmd[1]), int(cmd[2]))
    if cmd[0] == 'find':
        print('yes' if find(t, int(cmd[1])) else 'no')
    if cmd[0] == 'delete':
        t = delete(t, int(cmd[1]))
    if cmd[0] == 'print':
        print('', *t.inorder())
        print('', *t.preorder())



Measured memory_bytes: 57732
import java. util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

		String s = String.valueOf(n);

		char[] c = s.toCharArray();

		if(n<10) {
			if(c[0]=='3') {
				System.out.println("bon");
			}else if(c[0]=='0'||c[0]=='1'||c[0]=='6'||c[0]=='8') {
				System.out.println("pon");
			}else {
				System.out.println("hon");
			}
		}else if(10<n&&n<100) {
			if(c[1]=='3') {
				System.out.println("bon");
			}else if(c[1]=='0'||c[1]=='1'||c[1]=='6'||c[1]=='8') {
				System.out.println("pon");
			}else {
				System.out.println("hon");
			}
		}else {
			if(c[2]=='3') {
				System.out.println("bon");
			}else if(c[2]=='0'||c[2]=='1'||c[2]=='6'||c[2]=='8') {
				System.out.println("pon");
			}else {
				System.out.println("hon");
			}
		}

	}

}


Measured memory_bytes: 35788
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fileio freopen("in.in", "r", stdin),freopen("out.out", "w", stdout);
#define ll long long int
#define FF first
#define SS second
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define pd(x) printf("%d\n",x)
#define plld(x) printf("%lld\n",x)
#define pss printf
#define MOD 1000000007
#define INF 1e18
#define eps 0.00001
#define endl '\n'
#define debug(n1) cout<<n1<<endl
const int N = 1e5;  // limit for array size
ll n;  // array size

int main(){
	int d,n;cin>>d>>n;
	ll g=1;
	g=pow(100,d);
	
	if(n!=100)
	cout<<g*n<<endl;
	else{
		cout<<g*(n+1)<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}}
#define show(x) {for(auto i: x){cout << i << " ";} cout<<endl;}
#define showm(m) {for(auto i: m){cout << m.x << " ";} cout<<endl;}
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> llP;
ll gcd(int x, int y){ return y?gcd(y, x%y):x;}
ll lcm(ll x, ll y){ return (x*y)/gcd(x,y);}


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

    vector<int> dp(2019,0);

    ll ans = 0;
    rep(i, s.size()){
        vector<int> tdp(2019,0);
        int c = s[i] - '0';

        for (int j = 0; j < 2019; j++)
        {
            if (dp[j] == 0) continue;
            int new_key = j*10+c;
            new_key %= 2019;
            tdp[new_key] = dp[j];
        }
        tdp[c]++;        

        dp = tdp;
        ans += dp[0];
        // for(auto itr = dp.begin(); itr != dp.end(); ++itr){
        //     cout << itr->first << ":" << itr->second << endl;
        // }
        // cout << endl;
    }

    cout << ans << endl;

}



Measured memory_bytes: 3724
#pragma GCC optimize("Ofast")

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <random>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;

typedef
tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> orderedSet;

#define pb push_back
#define F first
#define S second
#define all(a) (a).begin(), (a).end()

#define for1(i0, l0, r0) for (int i0 = l0; i0 < r0; ++i0)
#define for2(i0, l0, r0) for (int i0 = l0; i0 <= r0; ++i0)
#define forn(i0, n0) for (int i0 = 0; i0 < n0; ++i0)
#define forn1(i0, n0) for (int i0 = 1; i0 < n0; ++i0)
#define forr(i0, n0) for (int i0 = n0; i0 >= 0; --i0)
#define forr1(i0, r0, l0) for (int i0 = r0; i0 > l0; --i0)
#define forr2(i0, r0, l0) for (int i0 = r0; i0 >= l0; --i0)

#define Sort(a) sort(all(a))
#define Reverse(a) reverse(all(a))
#define relaxMax(a, b) a = max(a, b)
#define relaxMin(a, b) a = min(a, b)

typedef long double ld;
#define ui unsigned int
#define ull unsigned long long

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef pair<string, string> pss;

typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef vector<ld> vld;
typedef vector<bool> vb;
typedef vector<string> vs;

typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<pdd> vpdd;

typedef vector<vi> vvi;
typedef vector<vd> vvd;
typedef vector<vll> vvll;
typedef vector<vb> vvb;

#define vpss vector<pss>
#define vvs vector<vs>
#define vvpii vector<vpii>
#define vvpll vector<vpll>
#define vpt vector<pt>
#define vvvi vector<vvi>
#define vsi vector<set<int>>
#define ss second
#define ff first

#define printvi(arr) for (int x0 : arr) cout << x0 << ' '; cout << '\n';
#define printvll(arr) for (ll x0 : arr) cout << x0 << ' '; cout << '\n';
#define printpair(pair0) cout << pair0.F << ' ' << pair0.S << '\n';
#define printvp(arr) for (auto pair0 : arr) printpair(pair0);
#define initArray(arr, N0, X0) memset(arr, X0, N0 * sizeof(int))
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void init() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.precision(16);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
}

void solve() {
    int n, k, x, y;
    cin >> n >> k >> x >> y;
    if (n <= k){
        cout << n * x << '\n';
        return;
    }
    cout << k * x + (n - k) * y << '\n';
}

bool multitest = false;

int main() {
    init();
    int t = 1;
    if (multitest) cin >> t;
    forn(i, t) solve();
}

Measured memory_bytes: 3612
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define mod 1000000007ll
#define mod1 998244353ll
#define endl '\n'
#define inf ((ll)1e18+1)
#include<chrono>
using namespace chrono;
mt19937_64 rng(high_resolution_clock::now().time_since_epoch().count());
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update>
#define debr(x,y) {cout<<"-->  "<<#x<<" to "<<#y<<" :  "; auto itr=x; while(itr!=y) cout<<(*itr++)<<' '; cout<<endl; }
#define deba(x) {cout<<"-->  "<<#x<<" :  "; for(auto ele:(x)) cout<<ele<<"  "; cout<<endl; }
#define deb(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s);istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {cout<<endl;}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a <<"  ,  ";
    err(++it, args...);
}

ll func(ll &val,ll &m){
    ll sq=val*val;
    return sq%m;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	ll n,X,m;
    cin>>n>>X>>m;
    vector<ll> ar;
    ar.push_back(X);
    set<ll> st;
    ll cur=X;
    st.insert(cur);
    while(ar.size()<n){
        cur=func(cur,m);
        if(st.find(cur)!=st.end())break;
        ar.push_back(cur);
        st.insert(cur);
    }
    ll sz=ar.size();
    ll ans=0;
    // deba(ar)return 0;
    if(ar.size()>=n){
        for(ll x=0;x<n;x++){
            ans+=ar[x];
        }
    }else{
        ll taken=0;
        ll x=0;
        for(x=0;taken<n && ar[x]!=cur;x++){
            taken++;
            ans+=ar[x];
        }
        // deb(x,taken)return 0;
        ll rem=n-taken;
        ll sum=0;
        ll y=x;
        while(x<sz){
            sum+=ar[x++];
        }
        ll tt=sz-taken;
        ll times=rem/tt; //CHECK
        ans+=times*sum;
        rem%=tt;
        while(rem--){
            ans+=ar[y++];
        }
    }

    cout<<ans<<endl;
}


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

int	main() {
	string S;
	long K;
	cin >>S >>K;
	vector<long> s(0);
	int i=1;
	int l=1;
	while (i<S.size()) {
		if (S.at(i)==S.at(i-1)) {
			l++;
		} else {
			s.push_back(l);
			l=1;
		}
		i++;
	}
	s.push_back(l);
	long ss=0;
	for (int i=0; i<s.size(); i++) {
		ss +=s.at(i)/2;
	}
	if (S.front()!=S.back()) {
		ss *=K;
	} else if (1==s.size()) {
		ss = (s.at(0)*K)/2;
	} else {
		ss -=s.front()/2+s.back()/2;
		ss *=K;
		ss +=s.front()/2+s.back()/2;
		ss +=(s.front()+s.back())/2*(K-1);
	}
	cout <<ss <<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(c) begin(c), end(c)
#define dump(x) cerr << __LINE__ << ":\t" #x " = " << x << endl

using ld = long double;
using P = complex<ld>;
using G = vector<P>;
const ld pi = acos(-1);

namespace std {
    bool operator < (const P& a, const P& b) {
        return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
    }
}

template<class iter>
tuple<ld, P, P> closest_pair(iter left, iter right) {
    int n = distance(left, right);
    if(n <= 1) return make_tuple(numeric_limits<ld>::max(), *left, *left);
    iter middle = next(left, n/2);
    ld x = middle->real();
    auto d = min(closest_pair(left, middle), closest_pair(middle, right));
    inplace_merge(left, middle, right, [](const P &a, const P &b){
            return a.imag() < b.imag();
        });
    vector<iter> around;
    for(iter i = left; i != right; ++i){
        ld dx = fabs(i->real() - x);
        ld &opt = get<0>(d);
        if(dx*dx >= opt) continue;
        for(auto j = around.rbegin(); j != around.rend(); ++j){
            ld dx = i->real() - (**j).real();
            ld dy = i->imag() - (**j).imag();
            if(dy*dy >= opt) break;
            ld norm = dx*dx + dy*dy;
            if(get<0>(d) > norm){
                d = make_tuple(norm, *i, **j);
            }
        }
        around.push_back(i);
    }
    return d;
};

// http://www.spoj.com/problems/CLOPPAIR/
// 18124516

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout << fixed << setprecision(6) << endl;
    int n;
    cin >> n;
    vector<P> a;
    map<P,int> idx;
    rep(i,n){
        ld x,y;
        cin >> x >> y;
        a.emplace_back(x,y);
        idx[P(x,y)] = i;
    }
    ld z;
    P x, y;
    sort(all(a));
    tie(z, x, y) = closest_pair(all(a));
    int A = idx[x], B = idx[y];
    if(A > B) swap(A, B);
    cout << sqrt(z) << endl;
}

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

int classify(int age){
    if(age < 10)    return 0;
    if(age < 20)    return 1;
    if(age < 30)    return 2;
    if(age < 40)    return 3;
    if(age < 50)    return 4;
    if(age < 60)    return 5;
    return 6;
}

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

        if(n == 0)  break;

        int A[7] = {};

        while(n-- > 0){
            int age;
            cin >> age;
            A[classify(age)]++;
        }

        for(int x : A)  cout << x << endl;
    }
    return 0;
}


Measured memory_bytes: 3092
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define f(i,a,n) for(ll i=a;i<n;i++)
#define w(_t) ll _t;cin>>_t;while(_t--)


int main() {
    ios::sync_with_stdio(false);cin.tie(0);
    ll n;string s;
    cin>>n>>s;
    ll ans=0;
    ll nr=0,nw=0;
    f(i,0,n){
        if(s[i]=='R') nr++;
        else nw++;
    }
    string s1="";
    f(i,0,nr) if(s[i]!='R') ans++;
    cout<<ans;
    
    return 0;
}

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

int main(){
    int n;cin>>n;
    const int NM = 1e5+1;
    map<int,int> a;
    rep(i,n){
        int t;cin>>t;
        if(t>0) a[t-1]+=1;
        a[t]+=1;
        a[t+1]+=1;
    }
    int ans = 0;
    for(auto t : a){
        ans = max(ans, t.second);
    }
    cout<<ans<<endl;

}

Measured memory_bytes: 4736
using System;
using System.Collections.Generic;//list用
using System.Text;//StringBuilder用
using System.Collections;
class Program
{
    static List<int> s = new List<int>();
static long result;
static string[] S;
  static int A,B;
    static void Main()
    {
      A=int.Parse(Console.ReadLine());
if(A==1){result=0;}
      if(A==2){result=1;}
      if(A>2){for(int i=0;i<A;i++){result+=i;}}
      
      
      
                    Console.WriteLine(result.ToString());

    }

}

Measured memory_bytes: 13140
#include<iostream>
#include<utility>
#include<climits>
#include<cmath>
using namespace std;

int main()
{
	double a, b, c;
	int n;

	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a >> b >> c;

		if (pow(a, 2)  == pow(b, 2) + pow(c, 2)
			||pow(b, 2)  == pow(c, 2) + pow(a, 2)
			||pow(c, 2)  == pow(a, 2) + pow(b, 2))
		{cout << "YES" << endl;}
		else {cout << "NO" << endl;}
	}

	return 0;
}

Measured memory_bytes: 1220
#!/usr/bin/env python3


def solve(r, D, x_2000):
    temp = x_2000
    for i in range(2001, 2010+1):
        temp = r * temp - D
        print(temp)
        

# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    r, D, x_2000 = map(int, input().split())
    solve(r, D, x_2000)
    # Failed to predict input format
    pass

if __name__ == '__main__':
    main()


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

using namespace std;

int main()
{
    int a=0;
    string s;
    cin>>a>>s;
    int z=a/2;
    int m=0;
    if(a%2==1){
        goto here;
    }
    else if(a%2==0){
    for (int y=0;y<z;y++){
        if(s.at(y)==s.at(y+z)){
            m++;
        }
    }
    if(m==z){
       cout<<"Yes";
    }

        else if(m!=z){
                here:
            cout<<"No";
        }
    }
    return 0;
}


Measured memory_bytes: 256
public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();

			if (a >= b && a >= c) {
				if (a*a == b*b + c*c) System.out.println("YES");
				else System.out.println("NO");
			} else if (b >= c && b >= a) {
				if (b*b == c*c + a*a) System.out.println("YES");
				else System.out.println("NO");
			} else { // c >= a && c >= b
				if (c*c == a*a + b*b) System.out.println("YES");
				else System.out.println("NO");
			}
		}
	}

}

Measured memory_bytes: 33204
#include<bits/stdc++.h>
using ll=long long;
using namespace std;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true;} return false;}
int dh[4] = {-1, 0, 0, 1};
int dw[4] = {0, -1, 1, 0}; 
using P = pair<int, int>;
const double pi = acos(-1.0);

int main(){
  ll n;
  cin>>n;
  vector<ll>a(n);
  //vector<ll>cnt(1e9+1);
  rep(i,n){cin>>a[i];}
  sort(all(a));

  ll id=a[0];
  ll tmp=1;
  ll ans=0;
  Rep(i,1,n){
    if(id==a[i]){tmp++;}
    else {
      if(tmp>id)ans+=tmp-id;
      else if(tmp<id)ans+=tmp;
      tmp=1;
      id=a[i];
    }
  }
  if(tmp>id)ans+=tmp-id;
  else if(tmp<id)ans+=tmp;

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


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

int dist[100][100];

int main()
{
	int a,b,k;
	cin >> a >> b >> k;
	
  for(int i = 0; i < k; i++) {
    if(i% 2 == 0) {
    	if(a%2 == 1) 
      		a--;
      	a /= 2;
      	b += a;
    } else {
      	if(b%2 == 1) 
      		b--;
      	b /= 2;
      	a += b;
    }
  }
	cout << a << " " << b << endl;
}



Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <climits>
#include <cmath>
#include <utility>
#include <vector>

#define MAX 10010

using namespace std;

template <typename T>
class Sort
{
public:
  Sort();
  Sort(vector<T> &arr){A = arr;}
  vector<T> A;
  void dispArr()
  {
    for(int i = 0; i < A.size()-1 ; i++) cout << A[i] << " ";
    cout << A[A.size()-1] << endl;
  }
  void merge(int l, int m, int r)
  {
    int n1 = m - l;
    int n2 = r - m;
    vector<T> L, R;
    L.resize(n1+1);
    R.resize(n2+1);
    for(int i = 0; i < n1; i++) L[i] = A[l + i];
    for(int i = 0; i < n2; i++) R[i] = A[m + i];
    L[n1] = INT_MAX;
    R[n2] = INT_MAX;
    int a = 0;
    int b = 0;
    for(int i = l; i < r; i++)
    {
      if(L[a] <= R[b])
      {
        A[i] = L[a];
        a++;
      }
      else
      {
        A[i] = R[b];
        b++;
      }
    }
  }

  void mergeSort(int l, int r)
  {
    if(l + 1 < r){
      int m = (l + r) / 2;
      mergeSort(l, m);
      mergeSort(m, r);
      merge(l, m ,r);
    }
  }

  int partition(int p, int r)
  {
    T x = A[r];
    int i = p-1;
    T tmp;
    for(int j = p; j < r; j++)
    {
      if(A[j] <= x)
      {
        i++;
        tmp = A[i];
        A[i] = A[j];
        A[j] = tmp;
      }
    }
    tmp = A[i+1];
    A[i+1] = A[r];
    A[r] = tmp;
    return i+1;
  }

  void quicksort(int p, int r)
  {
    if(p < r)
    {
      int q = partition(p,r);
      quicksort(p, q-1);
      quicksort(q+1, r);
    }
  }
};

class Card
{
public:
  char suit;
  int num;

  bool operator < (const Card& another) const
  {
    return num < another.num;
  }
  bool operator <= (const Card& another) const
  {
    return num <= another.num;
  }
  bool operator > (const Card& another) const
  {
    return num > another.num;
  }
  bool operator >= (const Card& another) const
  {
    return num >= another.num;
  }
  bool operator == (const Card& another) const
  {
    return (suit == another.suit) && (num == another.num);
  }
  void operator = (const int another)
  {
    num = another;
  }
};

int main()
{
  int n;
  cin >> n;
  vector<Card> arr;
  for(int i = 0; i < n; i++)
  {
      Card tmp;
      //cin >> tmp;
      cin >> tmp.suit >> tmp.num;
      arr.push_back(tmp);
  }
  Sort <Card> merge(arr), quick(arr);
  merge.mergeSort(0,n);
//  merge.dispArr();
  quick.quicksort(0,n-1);
//  quick.dispArr();
  bool flag = true;
  for(int i = 0; i < n; i++)
    flag = (flag && merge.A[i] == quick.A[i]);
  cout << (flag ? "Stable" : "Not stable") << endl;
  for(int i = 0; i < n; i++)
    cout << quick.A[i].suit << " " << quick.A[i].num << endl;
  return 0;
}

Measured memory_bytes: 4176
#include <stdio.h>
#include <cmath>
#include <bits/stdc++.h>



using namespace std;

typedef vector<int> VI;
typedef vector<string> VS;


//container util
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)



int main(void){

	int A, B, C, D; cin >> A >> B >> C >> D;
	int ans = min(A, B) + min(C, D);
	cout << ans << endl;


	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define PB(x)	push_back(x)
#define ALL(x)	(x).begin(), (x).end()
#define ALLR(x) (x).rbegin(), (x).rend()
#define MP(x)	make_pair(x);
    
#define debug(x)        cerr << #x << '=' << x << endl;
#define debug2(x, y)    cerr << #x << '=' << x << ' ' << #y << '=' << y << endl;
#define debugn(_a)      cerr << #_a << ": "; for (const auto _x: _a) cerr << _x << ' '; cerr << endl;
#define debugm(a)       cerr << #a << ":\n"; \
                        for (auto v: a) { for(const auto x: v) cout << x << ' '; cerr << "\n"; }
 
#define FAST_IO ios::sync_with_stdio(false); cin.tie(0)

#define int long long
 
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vii;
typedef vector<string> vs;
typedef unsigned long long ull;
 
const int INF  = LONG_LONG_MAX;
const int NINF = LONG_LONG_MIN;
const int mmod = 998244353;

int32_t main()
{
	FAST_IO;
	
	int n, a, b;
	cin >> n >> a >> b;
	
	if (a > b) swap(a, b);
	
	if ((b-a-1)%2 == 0) {
		if (n-b < a-1) {
			int ans = 0;
			ans += n-b;
			ans++;
			a++;
			ans += (b+a)/2-a;
			cout << ans << endl;
		} else {
			int ans = 0;
			ans += a-1;
			ans++;
			b--;
			ans += (b+a)/2-a;
			cout << ans << endl;
		}
	} else {
		cout << ((b+a)/2-a) << endl;
	}
}
// g++ -Wall -Wextra -Wshadow -fsanitize=undefined 


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

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

    ll n;
    cin >> n;
    vector<vector<ll>> dp(4, vector<ll>(n + 1)), r(3, vector<ll>(2));

    rep(j, 2) rep(i, 3) cin >> r[i][j];

    rep(i, 3)
    {
        if (r[i][0] >= r[i][1])
        {
            dp[i + 1] = dp[i];
            continue;
        }
        forx(j, 1, n + 1)
        {
            if (j >= r[i][0])
                dp[i + 1][j] = max({dp[i + 1][j], dp[i][j], dp[i + 1][j - r[i][0]] + r[i][1] - r[i][0]});
            else
                dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);
        }
    }
    n += dp[3][n];
    vector<vector<ll>> dq(4, vector<ll>(n + 1));

    rep(i, 3)
    {
        if (r[i][0] <= r[i][1])
        {
            dq[i + 1] = dq[i];
            continue;
        }
        forx(j, 1, n + 1)
        {
            if (j >= r[i][1])
                dq[i + 1][j] = max({dq[i + 1][j], dq[i][j], dq[i + 1][j - r[i][1]] + r[i][0] - r[i][1]});
            else
                dq[i + 1][j] = max(dq[i + 1][j], dq[i][j]);
        }
    }

    cout << n + dq[3][n] << endl;

    return 0;
}

Measured memory_bytes: 977024
package main

import (
	"bufio"
	"fmt"
	"io"
	"os"
	"strconv"
)

func main() {
	fmt.Printf("%d\n", resolve(parseProblem(os.Stdin)))
}

func parseProblem(r io.Reader) (int, []int) {
	const (
		initialBufSize = 100000
		maxBufSize     = 1000000
	)
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	n, k := scanInt(sc), scanInt(sc)
	gs := make([]int, n)
	for i := 0; i < n; i++ {
		// 0-indexed
		gs[i] = scanInt(sc) - 1
	}
	return k, gs
}

func resolve(k int, gs []int) int {
	visited := newSet()
	order := make([]int, 0, len(gs))
	cur := 0
	order = append(order, cur)
	t := 0
	for t < k && !visited.doesContain(cur) {
		visited.add(cur)
		order = append(order, gs[cur])
		cur = gs[cur]
		t++
		if t == k {
			return cur + 1
		}
	}
	idx := 0
	for i := 0; i < len(order); i++ {
		if order[i] == cur {
			idx = i
			break
		}
	}
	pos := (k-idx)%(t-idx) + idx
	return order[pos] + 1
}

type intSet map[int]none

func newSet() intSet {
	return make(map[int]none)
}

func (s intSet) add(item int) {
	s[item] = mark
}

func (s intSet) doesContain(item int) bool {
	_, ok := s[item]
	return ok
}

func (s intSet) size() int {
	return len(s)
}

func (s intSet) members() (l []int) {
	for k := range s {
		l = append(l, k)
	}
	return l
}

var mark none

type none struct{}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 11404
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		double[] x = new double[3];
		double[] y = new double[3];
		for(int j = 0; j < n; j++) {
			for(int i = 0; i < 3; i++) {
				x[i] = sc.nextDouble();
				y[i] = sc.nextDouble();
			}
			double S = ((x[0] - x[2]) * (y[1] - y[2]) - (x[1] - x[2]) * (y[0] - y[2]));
			S = Math.abs(S / 2.0);
			double A = (x[1] - x[2])* (x[1] - x[2]) + (y[1] - y[2])* (y[1] - y[2]);
			double B = (x[0] - x[2])* (x[0] - x[2]) + (y[0] - y[2])* (y[0] - y[2]);
			double C = (x[1] - x[0])* (x[1] - x[0]) + (y[1] - y[0])* (y[1] - y[0]);
			double px = (A*(B+C-A)*x[0] + B*(C+A-B)*x[1] + C*(A+B-C)*x[2])/(16.0*S*S);
			double py = (A*(B+C-A)*y[0] + B*(C+A-B)*y[1] + C*(A+B-C)*y[2])/(16.0*S*S);
			double r = (px - x[0]) * (px - x[0]) + (py - y[0]) * (py - y[0]);
			r = Math.sqrt(r);
			System.out.printf("%.3f %.3f %.3f\n", px, py, r);
		}
		sc.close();
	}
}


Measured memory_bytes: 28916
import java.util.Scanner;
import java.util.Stack;

class Main {

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

    void compute() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[][] A = new int[N][N];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                A[i][j] = sc.nextInt();
            }
        }
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                for (int k = 0; k < N; k++) {
                    if (A[i][j] + A[i][k] < A[j][k]) {
                        System.out.println("-1");
                        return;
                    }
                }
            }
        }
        long ans = 0;
        for (int i = 0; i < N; i++) {
            check:
            for (int j = 0; j < N; j++) {
                for (int k = 0; k < N; k++) {
                    if (A[j][k] + A[i][k] == A[i][j] && i != k && i != j && j != k) {
                        continue check;
                    }
                }
                ans += A[i][j];
            }
        }
        System.out.println(ans / 2);
    }
}


Measured memory_bytes: 52132
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    string s;
    set<string>a;
    for(int i=0;i<n;i++)
    {
      cin>>s;
      a.insert(s);
    }
    cout<<a.size()<<endl;
  return 0;
}

Measured memory_bytes: 19080
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


#mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np


def main():
	n,m=map(int,input().split())
	
	print("Yes" if n==m else "No")







if __name__ == "__main__":
	main()


Measured memory_bytes: 38256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int max = 0;
        int len = sc.nextInt();
        int prev = sc.nextInt();
        int num;

        for (int i = 1; i < len; i++) {
            num = sc.nextInt();
            if (prev >= num) {
                count++;
                if (max < count) {
                    max = count;
                } 
            } else {
                count = 0;
            }
            prev = num;
        }

        System.out.println(max);
    }
}

Measured memory_bytes: 48536
n, q = map(int, raw_input().split())

que = []
for i in range(n):
    name, time = raw_input().split()
    que.append([name, int(time)])

stime = 0
while que:
    job = que.pop(0)
    if job[1]<=q:
        stime += job[1]
        print job[0], stime
    else:
        stime += q
        job[1] -= q
        que.append(job)

Measured memory_bytes: 13496
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a,b = LI()
if b % a == 0:
    print(a+b)
else:
    print(b-a)

Measured memory_bytes: 38384
import sys
from decimal import Decimal

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

A, B = map(Decimal, ins().split())
print(int(A * B))


Measured memory_bytes: 10048
N,L=map(int, input().split())
taste = [0]*N
for i in range(N):
    taste[i] = L+i
zenbu = sum(taste)

dif = 10**9
for i in taste:
    if abs(zenbu - (zenbu-i)) < dif:
        dif = abs(zenbu - (zenbu-i))
        ans = zenbu-i

print(ans)

Measured memory_bytes: 38384
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	num, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return num
}

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

	n := nextInt()
	m := nextInt()

	total := 0
	for i := 0; i < m; i++ {
		a := nextInt()
		total += a
	}

	if total > n {
		fmt.Println(-1)
	} else {
		fmt.Println(n - total)
	}
}


Measured memory_bytes: 1792
#include <iostream>
using ll = long long;
using namespace std;

/* initialize */
struct card{
    char suit;
    int value;
};
card A[100000];
card L[60000], R[60000];
/* main */

int partition(card A[],int p,int r);


int quicksort(card A[], int p, int r) {
    if (p < r){
        int q = partition(A, p, r);
        quicksort(A, p, q-1);
        quicksort(A, q+1, r);
    }

}

int partition(card A[], int p, int r) {
    card temp{};
    card x = A[r];
    int i = p-1;
    for (int j = p; j < r; j++) {
        if (A[j].value <= x.value){
            i++;
            temp = A[i];
            A[i] = A[j];
            A[j] = temp;
        }
    }
    temp = A[i+1];
    A[i+1] = A[r];
    A[r] = temp;
    return i+1;
}

void merge(card A[],int left, int right){
    int mid = (left + right) / 2;
    int n1 = mid - left;
    int n2 = right - mid;
    for (int i = 0; i < n1; ++i)  L[i] = A[left+i];
    for (int j = 0; j < n2; ++j) R[j] = A[mid+j];
    L[n1].value = R[n2].value = INT32_MAX;
    int i = 0, j = 0;
    for ( int k = left; k < right; k++ ){
        if (L[i].value <= R[j].value) A[k] = L[i++];
        else A[k] = R[j++];
    }
}

void mergeSort(card A[], int n, int left, int right){
    if(left+1 < right){
        mergeSort(A, n, left,(left+right)/2);
        mergeSort(A, n, (left+right)/2, right);
        merge(A, left, right);
    }
}

int main() {
    int v;
    card A[100000], B[100000];
    char S[10];
    int stable = 1, n = 0;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        scanf("%s %d" , S, &v);
        A[i].suit = B[i].suit = S[0];
        A[i].value = B[i].value = v;
    }

    quicksort(B, 0, n-1);
    mergeSort(A, n, 0, n);


    for (int i = 0; i < n; ++i) {
        if (A[i].suit != B[i].suit) stable = 0;
    }
    if (stable) printf("Stable\n"); else printf("Not stable\n");
    for (int j = 0; j < n; j++) {
        printf("%c %d\n", B[j].suit, B[j].value);
    }
    return 0;
}



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

typedef long long ll;
const ll INF = 1LL<<60, MOD = 1e9 + 7;
const double EPS = 1e-9, PI = 3.141592653589793;
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define all(v) (v).begin(), (v).end()
#define fi first
#define se second
#define m_p make_pair

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll n,ans=INF;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  vector<ll> sum(n+1,0);
  rep(i,n){
    sum[i+1] = sum[i];
    sum[i+1] += a[i];
  }
  REP(i,1,n){
    ans = min(ans,abs(sum[i]-(sum[n]-sum[i])));
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3456
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <limits.h>
#include <cstring>
#include <tuple>
#include <cassert>
#include <numeric>
using namespace std;
// type alias
typedef long long LL;
typedef vector < int > VI;
typedef unordered_map < int, int > MAPII;
typedef unordered_set < int > SETI;
typedef pair< int , int > II;
typedef tuple< int, int, int > III;
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// minmax
#define SMAX(a,b) a = max(a,b)
#define SMIN(a,b) a = min(a,b)
// debug cerr
#define TRACE true
#define dump(x) if(TRACE) { cerr << #x << " = " << (x) << endl; }
#define dump2(x,y) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << endl; }
#define dump3(x,y,z) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << ", " << #z << " = " << (z) << endl; }
#define dump4(x,y,z,a) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << ", " << #z << " = " << (z) << ", " << #a << " = " << (a) << endl; }
#define dumpAR(ar) if(TRACE) { FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }

/*
 
 8/13/2018
 
 16:50-17:07 analysis
 17:18 submti and got WA
 
 */

// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG x.cpp && ./a.out
//const int MAX_N=1e5+1;
int H,W;
int cnt[26];
bool solve() {
  int x4=(H/2)*(W/2);
  dump(x4);
  REP(i,26) if(x4>0) {
    int a=min(cnt[i]/4,x4);
    x4-=a,cnt[i]-=4*a;
  }
  dump(x4);
  if(x4>0) return false;
  int x2=0;
  if(H%2==1)x2+=(W/2);
  if(W%2==1)x2+=(H/2);
  dump(x2);
  REP(i,26) if(x2>0) {
    int a=min(cnt[i]/2,x2);
    x2-=a,cnt[i]-=2*a;
  }
  dump(x2);
  if(x2>0) return false;
//  int x1=((H%2==1)&&(W%2==1));
  int x1=(H%2==1&&W%2==1);
  dump(x1);
  return accumulate(cnt,cnt+26,0)==x1;
}

string yes="Yes",no="No";
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  
  cin>>H>>W;
  REP(i,H)REP(j,W) {
    char c; cin>>c;
    cnt[c-'a']++;
  }
  cout<<(solve()?yes:no)<<endl;
  return 0;
}


Measured memory_bytes: 888
#include<stdio.h>
#define gray 1
#define white 0
#define black 2
#define MAX 101

int a[MAX][MAX],f[MAX],d[MAX],color[MAX],time,n;

void visit(int u)
{
  int i;
  color[u]=gray;
  d[u]=++time;
  for(i=0;i<n;i++){
    if(a[u][i]==1){
      if(color[i]==0)visit(i);
    }
  }
  color[u]=black;
  f[u]=++time;
}


int main()
{
  int i,j,v,u,k;

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

  time=0;
  for(i=0;i<n;i++){
    scanf("%d%d",&u,&k);
    for(j=0;j<k;j++){
      scanf("%d",&v);
      a[u-1][v-1]=1;
    }
  }

  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      if(a[i][j] == NULL)a[i][j]=0;
    }
  }

  for(i=0;i<n;i++){
    if(color[i]==white)visit(i);
  }

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

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

typedef long long ll;

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

    string s; cin >> s;
    int ans = 0;
    for(int i=0;i<3;i++){
        if(s[i]=='1') ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
/* winners never quit and quitters never win.
      #swap                                 */
      
#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;
#pragma GCC optimize ("-O3")
using ll = long long;
using ld = long double;
const ll mod = 1000000007;
const ll inf = 1000000000000000000;
const ll rk = 256;

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

#define pb push_back
#define mp make_pair
#define vc vector
#define fs first
#define sec second
#define pq priority_queue
#define lb lower_bound
#define ub upper_bound
#define pll pair<ll,ll> 
#define pls pair<ll,string>
#define psl pair<string,ll>
#define plc pair<ll,char>
#define pcl pair<char,ll>
#define pss pair<string,string>
#define all(v) v.begin(),v.end()
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper);

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}

#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define T ll t=0;cin>>t;for(ll test=0;test<t;test++)


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
	//isprime();
	//coeff();
	/*freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);*/
    ll n,m;
    cin>>n>>m;
    ll sum=0;
    rep(a,0,m)
    {
        ll b;
        cin>>b;
        sum+=b;
    }
    if(sum>=n)
        cout<<"Yes\n";
    else
        cout<<"No\n";
	return 0;
}

Measured memory_bytes: 256
n,m=map(int,input().split())
a=[]
b=[]
c=[]
d=[]
for i in range(n):
  A,B=map(int,input().split())
  a.append(A)
  b.append(B)
for i in range(m):
  C,D=map(int,input().split())
  c.append(C)
  d.append(D)
for i in range(n):
  minimum=1000000000
  ans=0
  for j in range(m):
    if abs(a[i]-c[j])+abs(b[i]-d[j])<minimum:
      minimum=abs(a[i]-c[j])+abs(b[i]-d[j])
      ans=j+1
  print(ans)
      

Measured memory_bytes: 3188
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;

int main(){
    int p[3], j[2];
    cin >>p[0] >>p[1] >>p[2] >>j[0] >>j[1];
    int ans = INF;
    REP(i, 3){
        REP(k, 2){
            ans = min(ans, p[i] + j[k] - 50);
        }
    }
    cout <<ans <<endl;

    return 0;
}

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

struct Point{
  double x,y;
  void init(double a,double b){x=a;y=b;}
  bool turn(Point p){return (x*p.y - y*p.x)>=0;}
};

int main()
{
  Point A,B,C,D,AB,BC,CD,DA;
  while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&A.x,&A.y,&B.x,&B.y,&C.x,&C.y,&D.x,&D.y)){
    AB.init(B.x-A.x,B.y-A.y);
    BC.init(C.x-B.x,C.y-B.y);
    CD.init(D.x-C.x,D.y-C.y);
    DA.init(A.x-D.x,A.y-D.y);
    if( (AB.turn(BC)==BC.turn(CD))&&(BC.turn(CD)==CD.turn(DA))&&(CD.turn(DA)==DA.turn(AB)) )puts("YES");
    else puts("NO");
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
using Int = int_fast64_t;

class edge{
public:
	Int cost;
	size_t from, to;
	edge(Int c, size_t f, size_t t){
		cost = c;
		from = f;
		to = t;
	}
};
using edges = vector<edge>;
using graph = vector<edges>;

bool fr(size_t t, graph &g, vector<Int> &v){
	if(v[t] == 1) return false;
	if(v[t] == 0) return true;
	v[t] = 0;
	for(size_t i=0; i<g[t].size(); ++i)
		if(fr(g[t][i].to, g, v))
			return true;
	v[t] = 1;
	return false;
}

bool f(graph &g){
	vector<Int> v(g.size(), -1);
	for(size_t i=0; i<v.size(); ++i){
		if(v[i] == 1) continue;
		v[i] = 0;
		for(size_t j=0; j<g[i].size(); ++j)
			if(fr(g[i][j].to, g, v))
				return true;
		v[i] = 1;
	}
	return false;
}

Int hr(size_t v, graph &g, vector<Int> &d){
	if(d[v] != -1) return d[v];
	d[v] = 0;
	for(size_t i=0; i<g[v].size(); ++i)
		d[v] = max(d[v], hr(g[v][i].to, g, d)+1);
	return d[v];
}

void h(graph &g, vector<Int> &d){
	for(size_t i=0; i<g.size(); ++i) d[i] = hr(i, g, d);
}

int main(){
//	cin.tie(0);
//	ios::sync_with_stdio(false);
	Int n; cin >> n;
	graph g(n*n);
	for(Int i=0; i<n; ++i){
		Int a; cin >> a;
		--a;
		Int x = i, y = a;
		if(x > y) swap(x, y);
		Int t = n*x + y;
		for(Int j=0; j<n-2; ++j){
			cin >> a;
			--a;
			x = i;
			y = a;
			if(x > y) swap(x, y);
			Int u = n*x + y;
			g[t].push_back(edge(1, t, u));
			t = u;
		}
	}
	if(f(g)){
		cout << -1 << "\n";
		return 0;
	}
	vector<Int> d(n*n, -1);
	h(g, d);
	Int ans = 0;
	for(auto i:d) ans = max(ans, i+1);
	cout << ans << "\n";
}

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

int main() {
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++)
        cin >> a[i];
    int SelectionSort(int, int[]);
    int count = SelectionSort(n, a);
    for(int i = 0; i < n - 1; i++)
        cout << a[i] << ' ';
    cout << a[n - 1] << '\n' << count << endl;
    return 0;
}

int SelectionSort(int n, int a[]) {
    int count = 0;
    void swap(int &, int &);
    for(int i = 0, min; i < n - 1; i++) {
        min = i;
        for(int j = i + 1; j < n; j++) 
            if(a[min] > a[j])
                min = j;
        if(min != i) {
            swap(a[min], a[i]);
            count++;
        }
    }
    return count;
}

void swap(int &a, int &b) {
    int temp = a;
    a = b;
    b = temp;
}


Measured memory_bytes: 3092
// Problem: B - Multiple of 9
// Contest: AtCoder - AtCoder Beginner Contest 176
// URL: https://atcoder.jp/contests/abc176/tasks/abc176_b
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <algorithm>
#include <cmath>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>

#define fastio  ios_base::sync_with_stdio(false); cin.tie(0);

using namespace std;

int main()
{
	string s;
	cin>>s;
	long long ans=0;
	for(auto&e:s)
	{
		ans += e - '0';
	}
	cout << (ans%9?"No":"Yes");
	return 0;
}


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

using namespace std;

int main() {

	long n;
	cin >> n;
	vector<long> s(n);
	for (long i = 0; i < n; i++) {
		cin >> s[i];
	}
	sort(s.begin(), s.end());
	long ans;
	ans = accumulate(s.begin(), s.end(), 0);
	if (ans % 10 == 0) {
		for (long i = 0; i < n; i++) {
			if (s[i] % 10 != 0) {
				ans -= s[i];
				break;
			}
			if (i == n - 1) {
				cout << 0 << endl;
				return 0;
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256