akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define IOS ios_base::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define PI acos(-1)
#define EPS 1e-5
#define sz(v) ((int)(v).size())
#define all(v) v.begin(),v.end()
#define forn(i, n) for(ll i=0;i<(ll)n;i++)
#define fi first
#define se second
 
int n, m, q;
vector<int> A;
vector<int> a, b, c, d;
int r = 0;

void dfs(int pos, int val) {
	if(pos == n) {
		int sum = 0;
		forn(i, q) {
			if(A[b[i]]-A[a[i]] == c[i])
				sum += d[i];
		}
		r = max(r, sum);
	} else {
		for(int i = val; i <= m; i++) {
			A[pos] = val;
			dfs(pos+1, i);
		}
	}
}

int main() {
	cin >> n >> m >> q;
	A.resize(n);
	a.resize(q);
	b.resize(q);
	c.resize(q);
	d.resize(q);

	forn(i, q) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
		a[i]--, b[i]--;
	}	
	dfs(0, 1);

	cout << r << endl;

	return 0;
}



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

using namespace std;

int main() {
    int k, x;
    cin >> k >> x;
    if (500 * k >= x) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
    return 0;
}


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

int main() {
	int n,s;
	while(1){
		cin >> n >> s ; if(!n && !s) break;
		long long dp[10][1001][101]; memset(dp,0,sizeof(dp));
		for(int i=0;i<=100;i++) dp[0][i][i]=1;
		for(int i=0;i<n;i++){
			for(int k=0;k<=100*(i+1);k++){
				for(int l=0;l<=100;l++){
					for(int j=l+1;j<=100;j++) dp[i+1][k+j][j]+=dp[i][k][l];
				}
			}
		}
		long long sum=0;
		for(int i=0;i<=100;i++) sum+=dp[n-1][s][i];
		cout << sum << '\n' ;
	}
}

Measured memory_bytes: 9060
#include<bits/stdc++.h>
using namespace std;
int n;
int ans,cnt;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        int a;
        scanf("%d",&a);
        if(a>cnt)
		{
			ans+=a-cnt;
		}
        cnt=a;
    }
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdlib>
#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

int main() {
  int a, b, c;
  string ans;
  cin >> a >> b >> c;
  if (a == b && b == c) ans = "No";
  else if ((a != b) && (b != c) && (c != a)) ans = "No";
  else ans = "Yes";
  cout << ans << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

const int MAX = 1e5 + 10;
int N, M;
pair<int, string> ps[MAX];

int main(void) {
    cin >> N >> M;
    REP(i, M) {
        cin >> ps[i].first >> ps[i].second;
        ps[i].first--;
    }

    VI pena(N);
    set<int> ac;
    REP(i, M) {
        if (ps[i].second == "AC") {
            ac.emplace(ps[i].first);
        } else {
            if (ac.count(ps[i].first) == 0) {
                pena[ps[i].first]++;
            }
        }
    }

    int pena_cnt = 0;
    REP(i, N) {
        if (ac.count(i)) {
            pena_cnt += pena[i];
        }
    }

    cout << ac.size() << " " << pena_cnt << endl;
}


Measured memory_bytes: 11520
#!/usr/bin/env python
# coding: utf-8

# In[11]:


W,H,N = map(int, input().split())
l,r,u,d = 0,W,H,0
for _ in range(N):
    x,y,a = list(map(int, input().split()))
    if a == 1:
        l = max(l,x)
    elif a == 2:
        r = min(r,x)
    elif a == 3:
        d = max(d,y)
    else:
        u = min(u,y)
print(max(0,(r-l))*max(0,(u-d)))


# In[ ]:






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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define rep(i, a) for (int i=0; i<(a); i++) 
#define ub        upper_bound            // first element >  val(itr)
#define lb        lower_bound            // first element >= val(itr)

#define mp make_pair
#define pb push_back
#define pi 3.141592653589793
#define endl "\n"
#define FAST ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define bitcount(a) __builtin_popcount(a) // count set bits
#define all(x) (x).begin(),(x).end()

const ll MOD = 1e9 + 7;
const int inf = 1e9+9;
const long long INF = 1e18+3;

//to debug 
#define dbg(x) cout << "Line " << __LINE__ << " | " #x ": " << (x) << endl

template<typename T> T gcd(T a,T b){ if(b>a) return gcd(b,a);return b==0?a:gcd(b,a%b); }
template<typename T> T lcm(T a, T b) { return a * b / gcd(a, b); }
template<typename T> T fast_power(T x,T y,ll m=MOD){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}

inline ll mod(ll x,ll n) {if (x < n) return x; if (x >= n) return x - n;}
string IntToString(ll a){ ostringstream temp; temp << a; return temp.str();}
ll findMMI_fermat(ll n,ll M) {ll ans= fast_power(n,M-2,M);return ans;}//i.e In (a/b)%M..it calculates MMI of b wrt M
ll add(ll a,ll b,ll M)  { return ( mod(a,M ) + mod(b,M ))%M;     }
ll sub(ll a, ll b,ll M) { return (mod(a,M ) + M - mod(b,M ))%M;   }
ll mult(ll a,ll b,ll M) { return  ( mod(a,M)*mod(b,M) ) %M ; }
bool isprime(ll a){ if(a==2) {return 1;}if(!(a&1) ) {return 0;}for(ll i=3;i*i<=a;i+=2){if(a%i==0) {return 0;} } return 1;} 

  
               /* -------------------------------Main Code------------------------------- */

void max_self(ll &a,ll b){
	a = max(a,b);
}
void min_self(ll &a,ll b){
	a = min(a,b);
}

int main(){
	FAST;
	int n,W;
	scanf("%d%d",&n,&W);
	vector <int> weight(n),value(n);
	for(int i=0;i<n;++i){
		scanf("%d%d",&weight[i],&value[i]);
	}
	int sum_value = 0;
	for(int x:value){
		sum_value+=x;
	}

	vector <ll> dp(sum_value+1,INF); 
	dp[0] = 0;
	//dp[i] - the minimum total weight with value exactly i
	for(int item = 0;item<n;++item){
		for(int value_already = sum_value - value[item];value_already>=0;--value_already){
			min_self( dp[value_already+value[item]] , dp[value_already] + weight[item]);
		}
	}
	ll answer = 0;
	for(int i=0; i<=sum_value;++i){
		if(dp[i]<=W) max_self(answer, (ll)i);
	}
	printf("%lld",answer);
	
	
	return 0;
}

	

Measured memory_bytes: 1024
from bisect import bisect_left
N = int(input())
A = sorted(list(map(int,input().split())))
B = sorted(list(map(int,input().split())))
C = sorted(list(map(int,input().split())))
B1 = []
for i in range(N):
    B1.append(bisect_left(A,B[i]))
Br = [0]
for i in range(N):
    Br.append(Br[-1]+B1[i])
cnt = 0
for i in range(N):
    ind = bisect_left(B,C[i])
    cnt += Br[ind]
print(cnt)

Measured memory_bytes: 113892
#include <stdio.h>
int main(){
    int n,m,l;
long long temp;
    scanf("%d%d%d",&n,&m,&l);
    int a[n][m],b[m][l];
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            scanf("%d",&a[i][j]);
        }
    }
    for(int i=0;i<m;i++){
        for(int j=0;j<l;j++){
            scanf("%d",&b[i][j]);
        }
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<l;j++){
            temp=0;
            for(int k=0;k<m;k++){
                temp+=a[i][k]*b[k][j];
            }
            if(j==0)printf("%lld",temp);
            else printf(" %lld",temp);
        }
        printf("\n");
    }
    
}

Measured memory_bytes: 2740
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<stdlib.h>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
int dp[500][500];
int main(){
	int a,b,c;scanf("%d%d%d",&a,&b,&c);
	for(int i=0;i<500;i++)for(int j=0;j<500;j++)dp[i][j]=mod;
	dp[0][0]=0;
	for(int i=0;i<a;i++){
		int p,q,r;scanf("%d%d%d",&p,&q,&r);
		for(int j=499;j>=0;j--)for(int k=499;k>=0;k--){
			if(dp[j][k]>=mod)continue;
			dp[j+p][k+q]=min(dp[j+p][k+q],dp[j][k]+r);
		}
	}
	int ret=mod;
	for(int i=1;i<499;i++){
		int s=b*i;
		int t=c*i;
		if(max(s,t)>=499)continue;
		ret=min(ret,dp[s][t]);
	}
	if(ret>=mod)printf("-1\n");else printf("%d\n",ret);
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define db double
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bin(x) (1ll<<(x))
#define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
#define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
#define mem(x,val) memset(x,val,sizeof x)
#define Swap(a,b,n) for(int I=0;I<=n;I++) swap(a[I],b[I])
#define PC __builtin_popcountll
#ifdef DEBUG
	#define debug(A,args...) fprintf(stderr,A,##args)
#else
	#define debug(A,args...) printf("")
#endif
#define deb debug("line %d\n",__LINE__)
namespace mine
{
	ll qread()
	{
		ll ans=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	template<typename T>inline bool chmax(T&a,const T&b){return a<b?a=b,1:0;}
	template<typename T>inline bool chmin(T&a,const T&b){return a>b?a=b,1:0;}
	ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
	bool IN(ll x,ll l,ll r){return l<=x and x<=r;}
	void GG(){puts("-1");exit(0);}
	
	const db eps=1e-8;
	const int INF=0x3f3f3f3f;
	const int MOD=1e9+7;
	int mm(const int x){return x>=MOD?x-MOD:x;}
	template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
	ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
	ll invm(ll x){return qpower(x,MOD-2);}
	const int MM=1e6+10;
	ll fac[MM],facinv[MM],Inv[MM];ll Comb(int n,int m){return n<0 or n<m?0:fac[n]*facinv[m]%MOD*facinv[n-m]%MOD;}
	void PRE()
	{
		fac[0]=1;fo(i,1,MM-1) fac[i]=fac[i-1]*i%MOD;
		facinv[MM-1]=invm(fac[MM-1]);fd(i,MM-1,1) facinv[i-1]=facinv[i]*i%MOD;
		Inv[1]=1;fo(i,2,MM-1) Inv[i]=(MOD-MOD/i)*Inv[MOD%i]%MOD;
	}
	const int N=2e3+10;
	//------------------FIXED------------------
	int f[N],g[N],a[N];
	void main()
	{
		int n=qread();qread();fo(i,0,n) a[i]=qread();
		fd(i,n,1)
		{
			f[i]=g[i]=abs(a[n]-a[i-1]);
			fo(j,i+1,n) chmax(f[i],g[j]),chmin(g[i],f[j]);
		}write(f[1]);
	}
};//����������
signed main()
{
	#ifdef DEBUG
	//freopen("a.in","r",stdin);
	freopen("z.txt","r",stdin);
	//freopen("a.out","w",stdout);
	#endif
	srand(time(0));
	mine::PRE();
	mine::main();
	debug("\n------------------------------------------\nTime: %.2lf s",1.0*clock()/CLOCKS_PER_SEC);
}

Measured memory_bytes: 23680
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

#define rep(i, n) for(int i = 0;i < n;i++)
const int INF = 1LL << 30;
const int MOD = 1000000007;

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

    int ans = 0; 

    rep(i,5){
        int x; cin >> x;
        if(x==0) ans = i;
    }

    cout << ans+1 << endl;

    return 0;
}

Measured memory_bytes: 3556
#include<bits/stdc++.h>
using namespace std;
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
//const long double PI = 3.14159265358979323846;
#pragma GCC optimize ("-O3")

int32_t main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    int x;
    cin >> x;
    cout << !x;
    return 0;
}

Measured memory_bytes: 3604
import sys
sys.setrecursionlimit(1000000)

def step(n, memo={}):
    if n <= 1:
        return 1
    elif n == 2:
        return 2
    elif n in memo:
        return memo[n]
    else:
        memo[n] = (step(n-1,memo)+step(n-2,memo))%1000000007
        return memo[n]

N, M = map(int, input().split())
a = [-1]

if M == 0:
    print(step(N))

else:
    for m in range(M):
        a.append(int(input()))
        if a[m+1] - a[m] == 1:
            print(0)
            break
    else:
        a.append(N+1)
        ans = 1
        for m in range(M+1):
            ans = (ans*(step(a[m+1]-a[m]-2)))%1000000007
        print(ans)

Measured memory_bytes: 116972
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using static kyoupuro.Input;
using static kyoupuro.MyMath;

namespace kyoupuro {

    class MainClass {

        public static void Main() {
            var N = NextLong();
            var list = LongList();
            int now = 0;

            for (int i = 0; i < N; i++) {
                if(now + 1 == list[i]) {
                    now++;
                }
            }

            if(now == 0) {
                Console.WriteLine(-1);
            } else {
                Console.WriteLine(N - now);
            }
        }
    }

    class MyMath {
        public static long mod = 1000000007;

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

        public static List<long> Factor(long n) {
            var list = new List<long>();
            n = DivideToLimit(n, 2, list);
            n = DivideToLimit(n, 3, list);
            long sqrt = Sqrt(n);
            for (int i = 5; i <= n && i <= sqrt; i += 4) {
                n = DivideToLimit(n, i, list);
                i += 2;
                n = DivideToLimit(n, i, list);
            }
            if(n > 1) list.Add(n);
            return list;
        }

        public static long Sqrt(long n) {
            if (n < 0) return 0;
            long a = 0, tmp = 0, b = 0;
            for (int i = 62; i >= 0; i -= 2) {
                tmp = (b << 1) + 1 <= (n >> i) ? 1 : 0;
                a = a << 1 | tmp;
                n -= (((b << 1) + 1) * tmp) << i;
                b = (b << 1) + tmp + tmp;
            }
            return a;
        }

        static long DivideToLimit(long divisor, long dividend, List<long> list) {
            while(divisor % dividend == 0) {
                list.Add(dividend);
                divisor /= dividend;
            }
            return divisor;
        }
    }

    class Input {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line() {
            return Console.ReadLine();
        }

        public static int NextInt() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return int.Parse(enumerator.Current);
        }

        public static long NextLong() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return long.Parse(enumerator.Current);
        }

        public static string[] StrArr() {
            return Line().Split(' ');
        }

        public static List<int> IntList() {
            return StrArr().Select(int.Parse).ToList();
        }

        public static List<long> LongList() {
            return StrArr().Select(long.Parse).ToList();
        }

        public static void Skip(int line = 1) {
            enumerator.Reset();
            for (int i = 0; i < line; i++) Console.ReadLine();
        }

        public static void Reset() {
            enumerator.Reset();
        }
    }
}

Measured memory_bytes: 34012
use std::io::*;
use std::str::FromStr;

fn main() {
    let n: u64 = read();
    let a: u64 = read();
    let b: u64 = read();
    let ans = (n/(a+b))*a+ if n%(a+b)>=a {a} else {n%(a+b)};
    println!("{}", ans);
}

fn read<T: FromStr>() -> T {
	let stdin = stdin();
	let stdin = stdin.lock();
	let token: String = stdin
		.bytes()
		.map(|c| c.expect("failed to read char") as char)
		.skip_while(|c| c.is_whitespace())
		.take_while(|c| !c.is_whitespace())
		.collect();
	token.parse().ok().expect("failed to parse token")
}



Measured memory_bytes: 4352
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	static long [][] memo ;
	static int [] w ;
	static int [] v;
	public static long dp(int i,int max) {
		if(i==memo.length)return 0;
		if(memo[i][max]!=-1)return memo[i][max];
		if (w[i]>max) { 	
		return 	memo[i][max]=dp(i+1, max);
		}
		long take = dp(i+1, max-w[i])+ v[i];
		long leave = dp(i+1, max);
		 return memo[i][max]= Math.max(take, leave);
	}

	public static void main(String[] args) throws IOException {
		  BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		   StringTokenizer st = new StringTokenizer(br.readLine());
			int n = Integer.parseInt(st.nextToken());
			int W = Integer.parseInt(st.nextToken());
			memo = new long [n][W+1];
			 w = new int [n];
			 v= new int [n];
			for (int i = 0; i < n; i++) {
				st = new StringTokenizer(br.readLine());
				w[i] = Integer.parseInt(st.nextToken());
				v[i]= Integer.parseInt(st.nextToken());
				Arrays.fill(memo[i],-1);
			}
			System.out.println(dp(0, W));

	}

}


Measured memory_bytes: 125740
#include <bits/stdc++.h>
#define pb push_back
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n, s) for (int i = (s); i < (n); i++)
#define rrep(i, n) for (int i = (n - 1); i >= 0; i--)
#define rreps(i, n, s) for (int i = s; i >= n; i--)
#define MOD 1000000007
using ll = long long;
using namespace std;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x, y, z;
    cin >> x >> y >> z;
    int a = z;
    int b = x;
    int c = y;
    cout << a << " " << b << " " << c << endl;
 //   system("pause");
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e9;
const ll mod = 1e9+7;
typedef pair<int,int> P;
typedef pair<pair<int,int>,pair<int,int>> PP;
#define rep(i,N) for(int i=0;i<N;i++)

int main(){
    ll n;
    cin>>n;
    vector<string> s(n);
    rep(i,n)cin>>s[i];
    //ll sum[n];
    //memset(sum,0,sizeof(sum));
    rep(i,n){
        sort(s[i].begin(),s[i].end());
    }
    //sort(sum,sum+n);
    sort(s.begin(),s.end());
    ll ans=0;
    ll cnt=0;
    int c = 0;
    // rep(i,n){
    //     cout<<s[i]<<endl;
    // }
    rep(i,n-1){
        c=0;
        rep(j,10){
            if(s[i][j]==s[i+1][j]){
                c++;
            }
        }
        if(c==10){
            cnt++;
        }else{
            for(int j=cnt;j>0;j--)ans+=j;
            cnt=0;
//            cout<<"i:"<<i<<" "<<ans<<endl;
        }
    }
    if(cnt>0){
        for(ll j=cnt;j>0;j--)ans+=j;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 7296
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug1: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug2: "<<x<<" "<<y<<endl;
#define bug3(x, y, z) cout<<"zdongdebug3: "<<x<<" "<<y<<" "<<z<<endl;
using namespace std;
typedef long long ll;
const int maxn = 105;
const int mod = 1000000007;



int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int n,m;
  cin>>n>>m;
  cout<<m + 100 * (10 - min(10, n))<<endl;
  return 0;
}

Measured memory_bytes: 256
// "static void main" must be defined in a public class.
import java.util.* ;
public class Main {
    public static void main(String[] args) {
        Scanner S = new Scanner( System.in ) ;
        Main obj = new Main() ;
        // AC, , , and 
        int t = S.nextInt() ;
        HashMap<String,Integer> map = new HashMap<>() ;
        map.put( "AC" , 0 ) ;
        map.put( "WA" , 0 ) ;
        map.put( "TLE" , 0 ) ;
        map.put( "RE" , 0 ) ;
        int  i = 0 ;
        while( i<=t ){
            i++ ;
            String s = S.nextLine() ;
            // System.out.println( s ) ;
            map.put( s , map.getOrDefault( s , 0 )+1 ) ;
        }
            // System.out.println( map ) ;
        System.out.println( "AC x "+map.get("AC") ) ;
        System.out.println( "WA x "+map.get("WA") ) ;
        System.out.println( "TLE x "+map.get("TLE") ) ;
        System.out.println( "RE x "+map.get("RE") ) ;
    }
}

Measured memory_bytes: 60216
#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
using namespace std;

int main()
{
    long long x;
    cin >> x;
    long long ans=x/11*2;
    if(x%11!=0){
        if(x%11<=6){
            ans++;
        }else{
            ans+=2;
        }
    }
    cout << ans;
    return 0;
}


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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define DBG(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define DBG(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define CIN(type, ...) \
  type __VA_ARGS__;    \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define COUT(...) write_to_cout(__VA_ARGS__);

#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int main() {
  CIN(int, H, A);
  COUT(H/A+(H%A>0));
}


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

int main() {
  int n, left, right;
  vector<int> p;

  while (cin >> n >> left >> right, n) {
    p.resize(n);
    rep (i, n) cin >> p[i];

    // sort(p.begin(), p.end());
    // reverse(p.begin(), p.end());

    int n_passed = 0;
    int max_gap = 0;

    rep (i, n-1) {
      // cout << "i: " << i << endl;
      if (! (left <= i+1 && i+1 <= right) ) continue;
      // cout << "passed " << i+1 << " students (lowest: " << left << ", highest: " << right << ")" << endl;
      // cout << "current gap: " << p[i] - p[i+1] << endl;

      if (max_gap <= p[i] - p[i+1]) {
        // cout << "new gap: " << p[i] - p[i+1] << endl;
        // cout << left << ", " << i+1 << ", " << right << endl;
        // cout << "update" << endl;
        n_passed = i+1;
        max_gap = p[i] - p[i+1];
      }
    }
    cout << n_passed << endl;
  }
  return 0;
}

Measured memory_bytes: 3120
using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        new Program().SolveC();
    }

    Scanner sc = new Scanner();
    void Solve()
    {
        int w = sc.NextInt();
        int h = sc.NextInt();
        int n = sc.NextInt();
        int maxX = w;
        int minX = 0;
        int maxY = h;
        int minY = 0;
        for (int i = 0; i < n; i++)
        {
            int x = sc.NextInt();
            int y = sc.NextInt();
            int a = sc.NextInt();
            if (a == 1)
            {
                if (minX <= x) minX = x;
            }
            if (a == 2)
            {
                if (maxX >= x) maxX = x;
            }
            if (a == 3)
            {
                if (minY <= y) minY = y;
            }
            if (a == 4)
            {
                if (maxY >= y) maxY = y;
            }
        }
        int ans = (maxX - minX) * (maxY - minY);
        if (ans <= 0) wl(0);
        else wl(ans);
        rk();
    }
    void SolveC()
    {
        char[] s = sc.Next().ToCharArray();
        char c = s[0];
        int cnt = 0;
        for (int i = 1; i < s.Length; i++)
        {
            if (c == s[i]) continue;
            c = s[i];
            cnt++;
        }
        wl(cnt);
        rk();
    }
    // ------------------------------------- //
    void wl(string v) { Console.WriteLine(v); }
    void wl(int v) { Console.WriteLine(v); }
    void rk() { Console.ReadKey(); }
    int calcDivisorCount(int n)
    {
        if (n == 1) return n;

        int res = 0;
        int i = 2;
        while (n != 1)
        {
            int cnt = 0;
            while (n % i == 0)
            {
                n /= i;
                cnt++;
            }
            if (cnt > 0) res += (cnt + 1);
            i++;
        }
        return res;
    }
    long gcd(long a, long b) { return b == 0 ? a : gcd(b, a % b); }
    long lcm(long a, long b) { return a / gcd(a, b) * b; }
}
class Scanner
{
    public Scanner() { }
    private string[] buff = null;
    private int bIndex = 0;
    public string Next()
    {
        if (buff == null || bIndex >= buff.Length)
        {
            buff = Console.ReadLine().Split(' ');
            bIndex = 0;
        }
        return buff[bIndex++];
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
}
class Pair<T, K>
{
    public Pair() { }
    public Pair(T f, K s)
    {
        first = f;
        second = s;
    }
    public T first {get; set;}
    public K second {get; set;}
}


Measured memory_bytes: 3928
import sys

N = int(input())
A = list(map(int, sys.stdin.readline().split()))
ans = 1

if 0 in A:
    print('0')
    sys.exit()

for i in range(0, N):
    ans *= A[i]
    if ans > 10 ** 18:
        print('-1')
        sys.exit()
print(ans)


Measured memory_bytes: 82888
#include<stdio.h>
#include<string.h>
 
#define MAX 36
 
int main(){
 
  int i, j, a, b, num, min, ans1, ans2;
  int temp[MAX];
 
  char oridata[MAX][3];
  char data1[MAX][3];
  char data2[MAX][3];
 
  ans1 = 0;
  ans2 = 0;
 
  scanf("%d", &num);
 
  for(i = 0; i < num; i++){
 
    scanf("%s", &oridata[i]);
 
    data1[i][0] = oridata[i][0];
    data1[i][1] = oridata[i][1];
    data1[i][2]='\0';
    data2[i][0] = oridata[i][0];
    data2[i][1] = oridata[i][1];
    data2[i][2]='\0';
  }
 
  for(i = 0; i < num - 1; i++){
 
    for(j = num - 1; j > i; j--){
 
      if(data1[j][1] < data1[j - 1][1]){
     
    temp[0] = data1[j - 1][0];
    temp[1] = data1[j - 1][1];
 
    data1[j - 1][0] =  data1[j][0];
    data1[j - 1][1] =  data1[j][1];
 
    data1[j][0] = temp[0];
    data1[j][1] = temp[1];
     
      }
     
    }
 
  }
 
  for(i = 0; i < num - 1; i++){
 
    min = i;
 
    for(j = i + 1; j < num; j++){
 
      if(data2[min][1] > data2[j][1]){
     
    min = j;
     
      }
     
    }
 
 
    if(data2[i][1] != data2[min][1]){
 
      temp[0] = data2[min][0];
      temp[1] = data2[min][1];
 
      data2[min][0] =  data2[i][0];
      data2[min][1] =  data2[i][1];
 
      data2[i][0] = temp[0];
      data2[i][1] = temp[1];
 
    }
      
  }
 
 
 
  for(i = 0; i < num; i++){
 
    for(j = i + 1; j < num; j++){
 
      for(a = 0; a < num; a++){
 
    for(b = a + 1; b < num; b++){
 
      if(oridata[i][1] == oridata[j][1] && (strcmp(oridata[i],data1[b])==0) && (strcmp(oridata[j],data1[a])==0))
        ans1 = 1;
 
    }   
 
      }
 
    }
 
  }
 
  for(i = 0; i < num; i++){
 
    for(j = i + 1; j < num; j++){
 
      for(a = 0; a < num; a++){
 
    for(b = a + 1; b < num; b++){
 
      if(oridata[i][1] == oridata[j][1] && (strcmp(oridata[i],data2[b])==0) &&( strcmp(oridata[j],data2[a])==0)) 
        ans2 = 1;
 
    }   
 
      }
 
    }
 
  }
 
  for(i = 0; i < num - 1; i++){
 
    printf("%c%c ", data1[i][0],data1[i][1]);
 
  }
    
  if(ans1 == 0)
    printf("%c%c\nStable\n", data1[i][0], data1[i][1]);
  else
    printf("%c%c\nNot stable\n", data1[i][0], data1[i][1]);
 
 
  for(i = 0; i < num - 1; i++){
 
    printf("%c%c ", data2[i][0],data2[i][1]);
 
  }
 
  if(ans2 == 0)
    printf("%c%c\nStable\n", data2[i][0], data2[i][1]);
  else
    printf("%c%c\nNot stable\n", data2[i][0], data2[i][1]);
 
  return 0;
 
}

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

int main() {
  int N,A,B;
  cin>>N>>A>>B;
  if(N*A>B){
    cout<<B<<endl;
  }
  if(N*A<B){
    cout<<N*A<<endl;
  }
  if(N*A==B){
    cout<<B<<endl;
  }
}

Measured memory_bytes: 256
#include<queue>
#include<stack>
#include<math.h>
#include<cmath>
#include<bitset>
#include<stdio.h>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<iostream>
#include<utility>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF=(1<<29);
int main(){
  ll n,p,i,j,dp[55][3],a[55];
  scanf("%lld %lld\n",&n,&p);
  for(i=1;i<=n;i++){
    scanf("%lld ",&a[i]);
    a[i]=a[i]%2;
  }
  for(i=0;i<=n;i++){
    for(j=0;j<=1;j++){
      dp[i][j]=0;
    }
  }
  dp[0][0]=1;
  for(i=1;i<=n;i++){
    if(a[i]==0){
      dp[i][0]=2*dp[i-1][0];
      dp[i][1]=2*dp[i-1][1];
    }
    else{
      dp[i][0]=dp[i-1][0]+dp[i-1][1];
      dp[i][1]=dp[i-1][1]+dp[i-1][0];
    }
  }
  printf("%lld\n",dp[n][p]);
  return 0;
}

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

typedef long long int LLI;

LLI n;
LLI s;

LLI f(LLI b, LLI n) {
  if (b == 1) return -1;
  if (n < b) return n;
  return n%b + f(b, n/b);
}

int main() {
  scanf("%lld%lld", &n, &s);

  LLI low = -1;
  LLI high = 1000000;
  while (high - low > 1) {
    LLI mid = (high+low)/2;
    if (mid*mid > n) high = mid;
    else low = mid; 
  }
 
  LLI ans = n+2;
  if (n >= s) {
    for (LLI c=1; c<=high; c++) {
      if ((n-s) % c != 0) continue;
      LLI b = (n-s)/c+1;
      if (n/b != c) continue;
      if (f(b, n) == s) {
        ans = min(ans, b);
      }
    }
  }

  for (LLI b=1; b<=high; b++) {
    if (f(b, n) == s) {
      ans = min(ans, b);
    }
  }

  if (n == s) {
    ans = min(ans, n+1);
  }

  if (s == 1) {
    ans = min(ans, max(2LL, n));
  }

  if (ans == n+2) puts("-1");
  else printf("%lld\n", ans);
}
  


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

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> h(n);
  for(int i=0;i<n;i++)
    cin >> h.at(i);
  
  sort(h.begin(),h.end());
  
  long long int a=0;
  
  for(int i=0;i<n-k;i++){
    a+=h.at(i);
  }
  
  cout << a << endl;
}

Measured memory_bytes: 1024
N=list(str(input()))
ans=0
if len(N)==1:
    print(int(N[0]))
    exit()
for i in range(1,len(N)):
    if N[i]!='9':
        ans+=int(N[0])-1
        ans+=(len(N)-1)*9
        print(ans)
        exit()
for i in range(len(N)):
    ans+=int(N[i])
print(ans)
        

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

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

	int n, k;
	cin >> n >> k;

	if ((n+1)/2 >= k) {
		cout << "YES\n";
	} else {
		cout << "NO\n";
	}
}


Measured memory_bytes: 256
import math
A,B,N=map(int,input().split())
if N<B:
  ans=math.floor(A*N/B)
  if (ans+1)*B<=A*N:
    ans+=1
else:
  ans=math.floor(A*(B-1)/B)
  if (ans+1)*B<=A*(B-1):
    ans+=1
print(ans)

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

int main() {
  int N, A, J;
  // N = 500*x + 1*A
  cin >> N >> A ;
  J = N - (N / 500) * 500 ;//これがAの範囲にあればおk 
  if ( J <= A ) {
    cout << "Yes" << endl;
  }
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define IOS ios_base::sync_with_stdio(false);
#define ee endl
#define lli long long int
#define li long int
#define vi vector <int>
#define vp vector <pair<int,int>>
#define pb push_back
#define pob pop_back
#define mp make_pair
#define fr(i,s,n) for(int i=s;i<n;i++)
using namespace std;
///author by sahil_dabhi

int my_own()
{
lli n;
cin>>n;
cout<<(n+(n*n)+(n*n*n));
return 0;
}

int main()
{
    IOS
    int t=1;
   // cin>>t;  ///for test-case
    while(t--)
    my_own();
    return 0;
}


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

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

    if(N % 1000 != 0){
        cout << (N / 1000 + 1 ) * 1000- N << endl;
    }
    else{
        cout << "0" << endl;
    }
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,N) for(ll i=0;i<N;++i)
const ll INF = 1LL<<60;
// test purpose
unsigned euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) return euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

int main(){
    ll N,M; cin >> N >> M;
    string S,T; cin >> S >> T;

    ll lcm = N * M / (euclidean_gcd(N,M));

    map<ll,char> mp;

    if(S.size() < T.size()) swap(S,T);
    bool ok = true;
    rep(i,S.size()){
        ll index = (lcm/(S.size()))*i;
        mp[index] = S[i];
    }
    rep(i,T.size()){
        ll index = (lcm/(T.size()))*i;
        if(mp[index]){
            if(mp[index] != T[i]) ok = false;
        }
    }

    if(ok) cout << lcm << endl;
    else cout << "-1" << endl;
}

Measured memory_bytes: 10880
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
// Hey! 僕の提出を見てくれてありがとう.
// ロボ子さん可愛いぞ！！！！！君もV沼にはまろう↓
// https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g
using namespace std;
namespace mp = boost::multiprecision;
// 任意長整数型
using bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using real1024 = mp::number<mp::cpp_dec_float<1024>>;
// ついでに有理数型
using rat = boost::rational<bint>;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
//sortを降順にする時は greater<型>()
const string YES = "Yes";
const string NO = "No";

void solve(long long X, long long Y){
  bool ans = false;
  for (int i = 0; i <= X; i++) {
      if(i * 2 + (X-i)*4 == Y)ans = true;
  }
  cout << (ans ? YES:NO) << endl;
}

int main(){
    long long X;
				scanf("%lld",&X);
				long long Y;
				scanf("%lld",&Y);
    solve(X, Y);
    return 0;
}


Measured memory_bytes: 3696
n = int(input())
a = list(map(int, input().split()))

input_num = [0 for _ in range(n)]

for i in range(n-1, -1, -1):
    tmp = 0
    j = i+i+1
    while j < n:
        tmp += input_num[j]
        j += i+1

    if tmp % 2 != a[i]:
        input_num[i] = 1

print(sum((input_num)))
for i, j in enumerate(input_num):
    if j:
        print(i+1, end=' ')

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


void solve(
    long long N, long long T,
    std::vector<long long> A, std::vector<long long> B){

    vector<pair<ll, ll>> ab(N);
    REP(i, N){
        ab.at(i).first = A.at(i);
        ab.at(i).second = B.at(i);
    }
    sort(ab.begin(), ab.end());

    vector<ll> dp(T + 3000, 0);
    REP(i, N){
        const ll ai = ab.at(i).first;
        const ll bi = ab.at(i).second;
        for(ll j = T - 1; j >= 0; --j){
            dp.at(j + ai) = max(
                dp.at(j + ai),
                dp.at(j) + bi
            );
        }
    }
    ll ans = *max_element(dp.begin(), dp.end());
    cout << ans << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long T;
    scanf("%lld",&T);
    std::vector<long long> A(N);
    std::vector<long long> B(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
        scanf("%lld",&B[i]);
    }
    solve(N, T, std::move(A), std::move(B));
    return 0;
}


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

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

  for(int i=1;i<=9;i++){
    if(N % i == 0 && (N / i > 0 && N / i < 10)){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}


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

#define int long long

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  string s;
  cin >> s;

  int l = s.size();

  int cnt = 0;
  for ( int i = 0; i < l; i++ ) {
    if ( s[i] == 'o' ) cnt++;
  }

  if ( cnt+15-l >= 8 ) cout << "YES" << endl;
  else cout << "NO" << endl;
  
  return 0;
}


Measured memory_bytes: 256
import os
import sys

import numpy as np


def solve(inp):
    r, c, k = inp[:3]
    items = np.zeros((r + 1, c + 1), dtype=np.int64)
    rrr = inp[3::3]
    ccc = inp[4::3]
    vvv = inp[5::3]
    for r_, c_, v in zip(rrr, ccc, vvv):
        items[r_][c_] = v

    dp = np.zeros((r + 1, c + 1, 4), dtype=np.int64)

    for i in range(1, r + 1):
        for j in range(1, c + 1):
            up = dp[i - 1][j][3]
            for w in range(4):
                dp[i][j][w] = max(dp[i][j - 1][w], up)
            v = items[i][j]
            if v == 0:
                continue
            for w in range(2, -1, -1):
                dp[i][j][w + 1] = max(dp[i][j][w + 1], dp[i][j][w] + v)

    return dp[-1][-1][3]


if sys.argv[-1] == 'ONLINE_JUDGE':
    from numba.pycc import CC

    cc = CC('my_module')
    cc.export('solve', '(i8[:],)')(solve)
    cc.compile()
    exit()

if os.name == 'posix':
    # noinspection PyUnresolvedReferences
    from my_module import solve
else:
    from numba import njit

    solve = njit('(i8[:],)', cache=True)(solve)
    print('compiled', file=sys.stderr)

inp = np.fromstring(sys.stdin.read(), dtype=np.int64, sep=' ')
ans = solve(inp)
print(ans)


Measured memory_bytes: 387036
#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<algorithm>

using namespace std;

int main(void) 
{

	int A, B;

	cin >> A >> B;

	if (A<=8&&B<=8&&A+B<=16) 
	{
		cout << "Yay!" << endl;
	}
	else 
	{
		cout << ":(" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
//Author:: Pham Ngoc Minh- Chuyen Thai Binh
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define fl float
#define db double
#define ii pair<ll,ll>
#define pii pair<ii,ii>
#define ford(i,a,b) for(int i=a;i<=b;i++)
#define foru(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,a,b) for(int i=a;i<b;i++)
#define oo 10000000000001
#define ooo -1000000000001
#define bost  ios_base::sync_with_stdio(false); cin.tie(0);
long long a,b,c,d;
int main()
{
    cin>>a>>b>>c>>d;
    long long gcd=__gcd(c,d);
    long long t=c*(d/gcd);
    long long x=(b/c)-(a-1)/c;
    long long y=(b/d)-(a-1)/d;
    long long z=(b/t)-(a-1)/t;
    cout<<(b-a+1)-(x+y-z);
    return 0;
}
// I love Chuyen Thai Binh Verry much ! Now, you alaways in my code of me <3
// Chuyen Thai Binh La Nha :>>


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

using namespace std;

const int MAX_N = 2e5 + 5;
const long long MOD = 1e9 + 7;

typedef long long ll;

struct event {
    int loc, time, type;
    event(int _loc = 0, int _time = 0, int _type = 0) {
        loc = _loc; time = _time; type = _type;
    }
};

bool cmp(event a, event b) {
    if (a.time == b.time) return a.type < b.type;
    return a.time < b.time;
}

int N, Q;
int ans[MAX_N];
multiset<int> S;
vector<event> arr;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    cin >> N >> Q;
    for (int i = 0; i < N; i++) {
        int s, t, x; cin >> s >> t >> x;
        arr.push_back({x, s - x, 1});
        arr.push_back({x, t - x, 2});
    }
    for (int i = 0; i < Q; i++) {
        int x; cin >> x;
        arr.push_back({i, x , 3});
    }
    sort(arr.begin(), arr.end(), cmp);

    for (auto cur : arr) {
        int loc = cur.loc, time = cur.time, type = cur.type;
        if (type == 1) S.insert(loc);
        else if (type == 2) S.erase(S.find(loc));
        else ans[loc] = (S.empty()) ? -1 : *S.begin();
    }
    for (int i = 0; i < Q; i++)
        cout << ans[i] << "\n";
}



Measured memory_bytes: 19560
#include <iostream>
using namespace std;
int main(void){
    int n;
    cin>>n;
    
    int num=0,ans=0;
    for(int i=0;i<n;i++){
        int t; cin>>t;
        num|=t;
    }
    while(num%2==0){
        ans++;
        num/=2;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<stdio.h>


int main(){

  int a, b, d ,r;
  double f;

  scanf("%d %d", &a, &b);

  d = a / b;
  r = a % b;
  f = 1.0 * a / b;

  printf("%d %d %f\n", d, r, f);

  
  return 0;
}

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

int main(){
    string T;
    cin >> T;
    int len = T.size();
    for(int i = len - 1; i >= 0; i--){
        if( T[i] == '?'){
            if(i == len - 1){
                T[i] = 'D';
            }
            if(i == 0){
                T[i] = 'D';
            }

            if(T[i+1] == 'D'){
                T[i] = 'D';
            }else if(T[i+1] == 'P'){
                T[i] = 'D';
            }
        }
    }
    cout << T << endl;
}

Measured memory_bytes: 3484
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;

ll N, K;
vector<ll> A, F;

bool check(ll v) {
  ll num = 0;
  for (int i = 0; i < N; i++) {
    if (A[i] * F[i] > v) {
      num += (A[i] - (v / F[i]));
    }
  }
  return num <= K;
}

ll binary_search(ll k) {
  ll left = 0;
  ll right = k;
  ll ans = k;
  while (left < right) {
    ll mid = (left + right) / 2;
    if (check(mid)) {
      ans = min(ans, mid);
      right = mid;
    } else {
      left = mid + 1;
    }
  }
  return ans;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> K;
  A.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  F.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> F[i];
  }
  sort(A.begin(), A.end());
  sort(F.begin(), F.end(), greater<ll>());
  ll m = 0;
  for (int i = 0; i < N; i++) {
    m = max(m, A[i] * F[i]);
  }

  cout << binary_search(m) << endl;
  return 0;
}

Measured memory_bytes: 3456
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define SZ(x) ((int)(x).size())
#define rep(i,n) for(int i=0;i<(n);++i)
#define fore(i,a) for(auto &i:a)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define answer cout << ans << endl;
signed _main(); signed main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
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; }
template<class T> using v = vector<T>;
template<class T> using vv = vector<v<T>>;
const int MOD=1e9+7;
const long long INF = 1LL << 60;

signed _main(){
  int n,m; cin >> n >> m;
  v<int> c(m);
  rep(i,m) cin >> c[i];
  //sort(c.begin(),c.end());
  vv<int> dp(m+1,v<int>(n+1,INF));
  for(int i=0;i<=m;i++) dp[i][0]=0;
  for(int i=0;i<m;i++){
    for(int k=1;k<=n;k++){
      if(k-c[i]<0) dp[i+1][k]=dp[i][k];
      else dp[i+1][k]=min(dp[i+1][k-c[i]]+1,dp[i][k]);
    }
  }
  cout << dp[m][n] << endl;
  return 0;
}



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

int main () {
    string s;
    cin >> s;
    int cc, fc;
    cc = s.size();
    fc = 0;

    for (int i = s.size() - 1; i >= 0; i--) {
        if (s.at(i) == 'C') cc = i;
    }

    for (int i = 0; i < s.size(); i++) {
        if (s.at(i) == 'F') fc = i;
    }

    if (cc < fc) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define pii pair<ll, ll>
#define pb push_back
#define rep0(i, n) for(ll i = 0;i<n;i++)
#define rep1(i, n) for(ll i = 1;i<n;i++)
#define all(v) v.begin(),v.end()
#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
using namespace std;
const int N = 1e5 + 5;
void solve(){
    string s;
    cin >> s;
    ll sum = 0;
    for(auto i: s){
        sum += (i-'0');
    }
    if(sum%9 == 0){
        cout << "Yes";
    }
    else{
        cout << "No";
    }
}

int main()
{
    fast;
    solve();
    // int t;
    // cin >> t;
    // while(t--){
    //     solve();
    // }
    return 0;
}


Measured memory_bytes: 3700