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

int main() {
    long long int A,B,C,K;
    long long int new_A, new_B, new_C, new_K;
    long long int a, b, c, d, e, f, g, h, i, j, k, l, m, n;

    cin >> a;
    cin >> b;
    long long int tmp, cnt = 0;
    tmp = b;
    for (;;) {
        tmp = tmp/10;
        cnt ++;
        if (tmp > 0) {
        }
        else {
            break;
        }
    } 
    long long int time = 1;
    for (int i = 0; i < cnt; i++) {
        time *= 10;
    }
    b += a*time;
    // cout << b<< endl;
    bool flag = false;
    for (long long int i = 0; i < sqrt(b)+1; i++) {
        if (i*i == b) {
            flag = true;
        }
    }
    if (flag) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }

    return 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;

template<typename integer>
integer __lcm(integer a, integer b) {
    return (a * b) / __gcd(a, b);
}

int solve(int n) {
    map<int, int> cnt;

    int k = 2;
    while (n >= k*k) {
        if (n % k == 0) {
            cnt[k]++;
            n /= k;
        }
        else {
            k += 1;
        }
    }

    // cout << "n=" << n << endl;
    if (n > 1) cnt[n]++;

    int ans = 1;
    for (auto p: cnt) {
        // cout << p.first << ", " << p.second << endl;
        ans *= (p.second+1);
    }
    return ans;
}

int main() {
    int n;
    cin >> n;
    vector<int> n_factor(n+1);
    fill(n_factor.begin(), n_factor.end(), 0);

    n_factor[0] = 0;
    n_factor[1] = 1;

    int ans = 0;
    for (int k=1; k<=n; k+=2) {
        /* n_factor[k] = solve(k); */
        // cout << "k=" << k << ", " << n_factor[k] << endl;
        if (solve(k) == 8) ans++;
    }

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



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

int main()
{
  while (true)
  {
    int n, x;
    cin >> n >> x;
    if (n == 0 && x == 0)
    {
      break;
    }

    int ans = 0;
    for (int i = 1; i < n - 1; ++i)
    {
      for (int j = i + 1; j < n; ++j)
      {
        for (int k = j + 1; k < n + 1; ++k)
        {
          if (i + j + k == x)
          {
            ans += 1;
          }
        }
      }
    }
    cout << ans << endl;
  }
}



Measured memory_bytes: 3104
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define repr4(i,s,n) for(ll i = (n);i>=(s);i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll,ll>>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
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>;
*/
const int mod = 1000000007;
const ll INF = 1LL<<50;

int main(){

string s,t,ans="";
    cin>>s>>t;
    int table[s.size()+1][t.size()+1];
    //テーブルセット（最大値を求めるので初期値は0)
    rep(i,s.size()+1){
        rep(j,t.size()+1){
            table[i][j]=0;
        }
    }
    //DP
    rep3(i,s.size()){
        rep3(j,t.size()){
            table[i][j]=max(table[i-1][j],table[i][j-1]);//最後尾が一致しないどちらか片方が1文字増えたときを考えれば十分（最後尾より少し前が一致している場合はこれで伸びてくる）
            if(s[i-1]==t[j-1]){
                table[i][j]=max(table[i][j],table[i-1][j-1]+1);//最後尾が一致している場合は両方1削ったものに1を足したものも考える
            }

        }
    }
    int i=s.size(),j=t.size();
    while((i>0)||(j>0)){
        if(s[i-1]==t[j-1]){
            if((i>0)&&(j>0)&&(table[i-1][j-1]==table[i][j]-1)){
                ans=string(1,s[i-1])+ans;
                i--;
                j--;
                
            }
            else if((j>0)&&(table[i][j]==table[i][j-1])){
                j--;
            }
            else if((i>0)&&(table[i][j]==table[i-1][j])){
                i--;
            }
        }
        else{
            if((j>0)&&(table[i][j]==table[i][j-1])){
                j--;
            }
            else if((i>0)&&(table[i][j]==table[i-1][j])){
                i--;
            }

        }
    }



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

Measured memory_bytes: 38788
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>

using namespace std;

int main()
{
    int i, j;
    int m, n;

    cin >> n >> m;
    vector<int> a(n);
    int all = 0;
    for (i = 0; i < n; i++) {
        cin >> a[i];
        all += a[i];
    }
    int cnt = 0;
    for (i = 0; i < n; i++) {
        int tmp;
        if (all % (4 * m) == 0) {
            tmp = all / (4 * m) - 1;
        } else {
            tmp = all / (4 * m);
        }
        if (a[i] > tmp) {
            cnt++;
        }
    }
    if (cnt >= m) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }


    return 0;
}


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


if __name__ == "__main__":
    n = int(input())
    ans = [0]*(n+1)
    for i in range(1,int(n**0.5)+1):
        for j in range(1,int(n**0.5)+1):
            for k in range(1,int(n**0.5)+1):
                if i**2 + j**2 + k**2 + i*j + j*k + i*k<=n:
                    ans[i**2 + j**2 + k**2 + i*j + j*k + i*k]+=1
    for i in range(1,n+1):
        print(ans[i])

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
typedef vector < vector<ll> > Mat;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int N, X, ans[int(2e5+5)];
bool used[int(2e5+5)];

int main(){
  cin >> N >> X;
  if (X == 1 || X == 2 * N - 1){
    No(); return 0;
  }
  Yes();

  if (N == 2){
    for (int i = 1; i <= 3; i++) cout << i << endl;
    return 0;
  }

  ans[N] = X; used[X] = true;
  if (X == 2){
    ans[N + 1] = 1; used[1] = true;
  }else{
    ans[N+1] = 2 * N - 1; used[2*N-1] = true;
    ans[N-1] = 1; used[1] = true;
    ans[N+2] = 2; used[2] = true;
  }

  int now = 1;
  for (int i = 1; i <= 2 * N - 1; i++){
    if (ans[i] > 0) continue;
    while (used[now]) now++;
    ans[i] = now; used[now] = true;
  }

  for (int i = 1; i <= 2 * N - 1; i++) cout << ans[i] << endl;



  return 0;
}


Measured memory_bytes: 4600
#include <stdio.h>

int main(){
  int a,b,n,i,j,cross[16][16],x,y;

  while(1){
    scanf("%d%d",&a,&b);
    if(a == 0 && b == 0) {break;}
    scanf("%d",&n);

      for(i=0;i<a;i++){
      for(j=0;j<b;j++){
        cross[i][j] = 0;
      }
    }
  
    for(i = 0;i < b;i++){
      cross[0][i] = 1;
    }

    for(i = 0;i < a;i++){
      cross[i][0] = 1;
    }
    
  for(i = 0;i < n;i++){
      scanf("%d%d",&x,&y);
      cross[x-1][y-1] = -1;
    if(x == 1) {for(j=y-1;j<b;j++){ cross[0][j] = 0;}}
    if(y == 1) {for(j=x-1;j<a;j++){ cross[j][0] = 0;  }}    
    }

    for(i=1;i<a;i++){
      for(j=1;j<b;j++){
        if(cross[i][j] == -1) {cross[i][j] = 0;}
        else {cross[i][j] = cross[i][j-1] + cross[i-1][j];}
      }
    }

    printf("%d\n",cross[a-1][b-1]);
  }

  return 0;
}

Measured memory_bytes: 0
# -*- coding: utf-8 -*-

N = int(input().strip())
a_list = [int(i) for i in input().rstrip().split()]
#-----

def gcd(a,b):
    if b == 0: 
        return a
    return gcd(b, a % b)

ans = a_list[0]
for i in a_list[1:]:
    ans = gcd(ans, i)

print(ans)


Measured memory_bytes: 14252
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>

using namespace std;

typedef pair<long long int, long long int> P;
long long int INF = 1e18;
long long int MOD = 1000000007;

using namespace std;

int main(){
	
	int N, W;
	cin >> N >> W;
	
	int w[300];
	
	for(int i = 0; i < N; i++){
		cin >> w[i];
	}
	
	sort(w, w + N);
	
	int S = 0;
	long long int ans = 0;
	for(int i = 0; i < N; i++){
		if(S > W){
			break;
		}
		long long int DP[11000] = {};
		DP[S] = 1;
		for(int j = i + 1; j < N; j++){
			for(int k = W; k >= w[j]; k--){
				DP[k] += DP[k - w[j]];
				DP[k] %= MOD;
			}
		}
		for(int j = W - w[i] + 1; j <= W; j++){
			ans += DP[j];
			ans %= MOD;
		}
		S += w[i];
	}
	
	if(S <= W){
		ans += 1;
		ans %= MOD;
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 3256
#include<iostream>
#include<bits/stdc++.h>
#define ll long long

using namespace std;

int main()
{
    ll n,k,h[100000], c=0;
    cin>>n>>k;
    for(int i=0; i<n; i++)
    {
        cin>>h[i];
        if(h[i]>=k)
            c++;
    }

    cout<<c;
    return 0;
}


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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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


// 素因数が何乗かをmapで返却する
map< ll, int > prime_factor(ll n) {
  map< ll, int > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

void solve() {
    int N; cin >> N;
    int ans = 0;
    rep1(i, N){
        if(i%2 == 0) continue;
        int res=1;
        auto pf = prime_factor(i);
        for(auto a: pf){
            res *= a.second+1;
        }
        if(res == 8) ans++;
    }

    cout << ans << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


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

const ll INF = 1e+18 + 10;

int N, M, X;
int cost[12];
int skills[12];
int point[12][12];
bool used[12];
ll ans = INF;

bool is_achieve_skills()
{
    for (int i = 0; i < M; i++)
    {
        if (skills[i] < X)
        {
            return false;
        }
    }

    return true;
}

void dfs(int i, ll sum_money)
{
    if (is_achieve_skills())
    {
        // 全てのスキルを達成
        ans = min(ans, sum_money);
        return;
    }

    // cout << "--------------------------" << endl;
    // cout << i << endl;
    // cout << sum_money << endl;
    // for (int j = 0; j < M; j++)
    // {
    //     cout << skills[j] << endl;
    // }
    // cout << "--------------------------" << endl;

    // 残りの本を購入
    for (int j = i + 1; j < N; j++)
    {
        if (!used[j])
        {
            // i番目の本を購入
            sum_money += cost[j];
            // スキルを吸収
            for (int k = 0; k < M; k++)
            {
                skills[k] += point[j][k];
            }
            used[j] = true;
            dfs(j, sum_money);
            used[j] = false;
            sum_money -= cost[j];
            // スキルを吸収
            for (int k = 0; k < M; k++)
            {
                skills[k] -= point[j][k];
            }
        }
    }
}

int main()
{
    cin >> N >> M >> X;
    for (int i = 0; i < N; i++)
    {
        cin >> cost[i];
        for (int j = 0; j < M; j++)
        {
            cin >> point[i][j];
        }
    }

    for (int i = 0; i < N; i++)
    {
        fill_n(used, N, false);
        fill_n(skills, M, 0);
        for (int j = 0; j < M; j++)
        {
            skills[j] += point[i][j];
        }
        dfs(i, cost[i]);
    }

    if (ans == INF)
    {
        cout << -1 << endl;
    }
    else
    {
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 3624
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <fstream>
#include <numeric>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#include <set>
#include <map>
#include <functional>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
using namespace std;
#define ll           long long
#define all(v)       (v).begin() , (v).end()
#define vi           vector <ll>
#define vii          vector <pair<ll,ll>>
#define ii           pair<ll,ll>
#define sz(v)	     ((int)((v).size()))
#define lp(i,a,b)    for(int i=a;i<b;i++)
#define pb           push_back
#define pf           push_front
#define F            first
#define S            second
#define endl         "\n"
#define IOS          ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const double PI = 3.14159265358979323846;
const ll inf=2e9,MOD=998244353,MAX=3e3+2;
int r,c,k,grid[MAX][MAX];
ll dp[MAX][MAX][4];

ll sol(int x,int y,int cnt){
    if(x>=r||y>=c)
        return -1e15;
    if(x==r-1&&y==c-1){
        if(cnt<3)
            return grid[r-1][c-1];
        return 0;
    }
    ll &ret=dp[x][y][cnt];
    if(~ret)
        return ret;
    ret=0;
    if(cnt<3){
        ret=max(sol(x,y+1,cnt+(grid[x][y]!=0))+grid[x][y],max(ret,sol(x+1,y,0)+grid[x][y]));
    }
    ret=max(ret,max(sol(x+1,y,0),sol(x,y+1,cnt)));
    return  ret;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    IOS;
    cin>>r>>c>>k;
    lp(i,0,k){
        int a,b,v;
        cin>>a>>b>>v;
        grid[a-1][b-1]=v;
    }
    memset(dp,-1,sizeof(dp));
    cout<<sol(0,0,0);
}

Measured memory_bytes: 321120
#include <cstdio>
#include <iostream> 
#include <cstring>

char s[201000];
 
int main()
{
	scanf("%s", s + 1); int n = strlen(s + 1);
	long long ans = 0; int sum = 0, t = 0;
	for(int i = 1; i <= n; i++)
	{
		if(s[i] == '0') 
		{
			ans += sum;
			if(t == 1) t = 0;
		}
		else
		{
			if(t == 0) sum++, t = 1;
			else t = 0;
		}
	}
	sum = 0;
	for(int i = 1; i <= n; i++)
	{
		if(s[i] == '0') sum++;
		else ans += sum / 2 + ((i & 1) & (sum & 1));
	}
	sum = 0;
	for(int i = 1; i <= n; i++)
		if(s[i] == '1')
		{
			sum++;
			ans += sum + 1 >> 1;
		}
	printf("%lld\n", ans);
}

//考虑倒着删，可以简单证明一定先删0，然后每个1往左移的次数是固定的，也就意味着删除0的时候对右边的贡献是固定的
//那么只需要让左边的贡献最大，这个可以贪心的取到上界。 

Measured memory_bytes: 4020
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int smallx[100000],bigx[100000],smally[100000],bigy[100000];
int main(){
	int n,h,w,x,y,z;
	cin>>n>>w>>h;
	for(int i=0;i<n;i++){
		cin>>x>>y>>z;
		smallx[i]=x-z,bigx[i]=x+z;
		smally[i]=y-z,bigy[i]=y+z;
	}
	sort(smallx,smallx+n),sort(bigx,bigx+n);
	sort(smally,smally+n),sort(bigy,bigy+n);
	bool tx=true,ty=true;
	for(int i=1;i<n;i++){
		if(smallx[i]>bigx[i-1])
			tx=false;
		if(smally[i]>bigy[i-1])
			ty=false;
	}
	if(smallx[0]>0||bigx[n-1]<w)
		tx=false;
	if(smally[0]>0||bigy[n-1]<h)
		ty=false;
	if(tx==true||ty==true)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 2732
import java.util.Scanner;

public class Main{
     
    public void solve(){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        System.out.println(x*x*x);
    }
     
    public static void main(String[] args){
        Main obj = new Main();
        obj.solve();
    }
}

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

typedef long long ll;

int main() {
    int a, b, c, d;
    cin >> a >> b >> c >>d;
    string ans = "No\n";
    if (abs(a - c) <= d) ans = "Yes\n";
    if (abs(a - b) <= d && abs(b - c) <= d) ans = "Yes\n";
    cout << ans << endl;
}

Measured memory_bytes: 256
def print_table(table)
	r = table.length
	c = table[0].length
	for row_i in 0..r-1
		print "#{table[row_i][0]}"
		for col_i in 1..c-1
			print " #{table[row_i][col_i]}"
		end
		puts ""
	end
end

inputs = gets.strip().split(" ").map{|i| i.to_i}
r, c = inputs[0], inputs[1]
table = Array.new(r+1){Array.new(c+1){0}}

for row_i in 0..r-1
	c_sum = 0
	rows = gets.strip().split(" ").map{|i| i.to_i}
	for col_i in 0..c-1
		table[row_i][col_i] = rows[col_i]
		c_sum += rows[col_i]
	end
	table[row_i][c] = c_sum
end
for col_i in 0..c
	for row_i in 0..r-1
		table[r][col_i] += table[row_i][col_i]
	end
end
print_table(table)


Measured memory_bytes: 7076
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define rrep(i,a,b) for(int i=(a);i>=(b);--i)
#define fore(i,a) for(auto &i:a)
#define all(a) (a).begin(),(a).end()
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
using ll = long long; constexpr int inf = INT_MAX / 2; constexpr ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

void _main() {
  int N;
  string s;
  cin >> N >> s;

  int r = 0, b = 0;
  rep(i, 0, N) {
    if (s[i] == 'R') r++;
    else b++;
  }

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

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

const int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
char s[105][105];

bool judge(int x, int y, char c){
    for(int i = 0; i < 8; ++i){
        int nx = x + dx[i], ny = y + dy[i];
        if(nx < 0 || nx >= 100 || ny < 0 || ny >= 100)  continue;
        
        if(s[nx][ny] == c)      return false;
    }
    
    return true;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int a, b;
    cin >> a >> b;
    
    for(int i = 0; i < 100; ++i){
        for(int j = 0; j < 100; ++j){
            if(i < 50){
                s[i][j] = '#';
            }
            else{
                s[i][j] = '.';
            }
        }
    }
    
    int cnt = 0;
    for(int i = 0; i < 49; ++i){
        for(int j = 0; j < 100; ++j){
            if(cnt >= a - 1)    break;
            if(judge(i, j, '.')){
                s[i][j] = '.';
                ++cnt;
            }
        }
    }
    cnt = 0;
    for(int i = 51; i < 100; ++i){
        for(int j = 0; j < 100; ++j){
            if(cnt >= b - 1)    break;
            if(judge(i, j, '#')){
                s[i][j] = '#';
                ++cnt;
            }
        }
    }
    
    cout << 100 << " " << 100 << endl;
    for(int i = 0; i < 100; ++i){
        for(int j = 0; j < 100; ++j){
            cout << s[i][j];
        }
        cout << "\n";
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>
#include <iomanip>
#include <unordered_map>
#include <map>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define reps(i,s,n) for(int i=s, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
typedef long double ld;
const char sp = ' ';

using namespace boost::multiprecision;
using namespace std;

int main(void){
    ll a=0, b=0, c=0;
    string S;
    cin>>S;
    rep(i, S.size()){
        if(S[i]=='a') a++;
        if(S[i]=='b') b++;
        if(S[i]=='c') c++;
    }
    if(a==1 && b==1) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3596
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;
vector<int> v[100010];
map<int,int> mp;
int main(){
	int i,j,n,m,x;
	long long ans=0;
	cin >> n >> m;
	for(i=0;i<n;i++){
		cin >> x;
		v[x%m].push_back(x);
		mp[x]++;
	}
	
	ans += v[0].size()/2;
	for(i=1;i<=(m-1)/2;i++){
		int cnt = 0,a = v[i].size(),b = v[m-i].size();
		ans += min(a,b);
		if(a>b){
			sort(v[i].begin(),v[i].end());
			v[i].erase(unique(v[i].begin(),v[i].end()),v[i].end());
			for(j=0;j<v[i].size();j++){
				cnt += mp[v[i][j]]/2;
			}
			
		}else{
			sort(v[m-i].begin(),v[m-i].end());
			v[m-i].erase(unique(v[m-i].begin(),v[m-i].end()),v[m-i].end());
				for(j=0;j<v[m-i].size();j++){
					cnt += mp[v[m-i][j]]/2;
				}
			}
		ans += min(max(a-b,b-a)/2,cnt);
	}
	if(m%2==0){
		ans += v[m/2].size()/2;
	}
	cout << ans << endl;
}


Measured memory_bytes: 10368
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
#include <string>

using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)

int main() {

	int N, M;
	scanf("%d%d", &N, &M);

	vector<int> divisor;

	for (int i = 1; i * i <= M; ++i) {
		if (!(M % i)) {
			divisor.push_back(i);
			if (i * i != M) {
				divisor.push_back(M / i);
			}
		}
	}

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

	for (int i = 0; i < divisor.size(); ++i) {
		if (divisor[i] > (double)M / N) {
			printf("%d\n", divisor[i - 1]);
			return 0;
		}
	}

	printf("%d\n", divisor[divisor.size() - 1]);
	return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static int Q;
	static int[] N;
	public static void main(String[] args) {
		while(read()){
			solve();
		}
	}
	
	static boolean read(){
		if(!sc.hasNext())return false;
		Q = sc.nextInt();
		N = new int[Q];
		for(int i = 0; i < N.length; i++){
			N[i] = sc.nextInt();
		}
		return true;
	}
	
	static void solve(){
		for(int i = 0; i < N.length; i++){
			int res = 0;
			String value = new String(Integer.toString(N[i]));
			boolean canSolve = true;
			while(value.length() != 1){
				int product = 0;
				for(int j = 1; j < value.length(); j++){
					String sub1 = value.substring(0, j);					
					String sub2 = value.substring(j);					
					int productNow = Integer.parseInt(sub1)*Integer.parseInt(sub2);
					if(productNow > product)product = productNow;
				}
				res++;
				if(product > Integer.parseInt(value)){
					canSolve = false;
					break;
				}
				value = Integer.toString(product);
			}
			System.out.println(canSolve ? res : -1);
		}
	}
}

Measured memory_bytes: 23336
from sys import setrecursionlimit
setrecursionlimit(100000)

n = int(input())
arr = []

for i in range(n-1):
    S = input()
    ar = [int(s) for s in S.split(" ")]
    arr.append(ar)

def prepare(n, arr):
    data = [[] for i in range(n)]
    nodeStates = [-1 for i in range(n)]
    childNums = [0 for i in range(n)]

    for ar in arr:
        start = ar[0] - 1
        to = ar[1] - 1
        data[start].append(to)
        data[to].append(start)
    return data, nodeStates, childNums


data, nodeStates, childNums = prepare(n, arr)
mmk = {}
def generateID(start,to):
    if start < to:
        start,to = to, start

    return start * 100000 + to

def dfs(currentNode, arr, x):
    childNodes = arr[currentNode]
    nodeStates[currentNode] = 1
    childNums[currentNode] = len(childNodes)
    kk = 0
    for ch in childNodes:
        if nodeStates[ch] == -1:
            kk = kk + 1
            if kk == x:
                kk = kk + 1
            mmk[generateID(currentNode+1,ch+1)] = kk
            dfs(ch, arr, kk)

dfs(0, data, -1)
print(max(childNums))
for ar in arr:
    start = ar[0]
    to = ar[1]
    print(mmk[generateID(start,to)])




Measured memory_bytes: 86760
N = int(input())
inputlist = [0] * N
a = 0
b = 0
for i in range(N):
    inputlist[i] = [0]*2
    inputlist[i][1], inputlist[i][0] = map(int, input().split())
    # 締め切りを[i][0]にしている点に注意

inputlist = sorted(inputlist)

time = 0
ans = 0
for j in range(N):
    time += inputlist[j][1]
    if time > inputlist[j][0]:
        ans = 1

if ans == 0:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 37152
N = int(input())
S = input()
ans=[]
for i in range(N):
    x =S[:i]
    y=S[i:]
    a = 0
    xs = set()
    ys = set()
    for s in x:
        xs.add(s)
    for s in y:
        ys.add(s)  
    ans.append(len(xs&ys))
print(max(ans))

Measured memory_bytes: 3064
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (true) {
int m= sc.nextInt();
int f= sc.nextInt();
int r= sc.nextInt();

if (m == -1 && f == -1 && r==-1) break;

if(m==-1||f==-1)System.out.println("F");
else if(m+f>=80)System.out.println("A");
else if(m+f>=65)System.out.println("B");
else if(m+f>=50)System.out.println("C");
else if(m+f>=30){
    if(r>=50)System.out.println("C");
    else System.out.println("D");
}
else System.out.println("F");
}
}
}


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

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

	for (int i = n - 1; i >= 0; i--)
	{
		if (i == 0)
		{
			cout << a[i] << endl;
		}
		else
		{
			cout << a[i] << " ";
		}
	}
}


Measured memory_bytes: 3068
#include<iostream>
#include<vector>

const long long MAX = 1e18;

int main() {

	int N;
	std::cin >> N;
	std::vector<long long> A(N);
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}

	for (int i = 0; i < N; i++) {
		if (A[i] == 0) {
			std::cout << 0 << std::endl;
			return 0;
		}
	}
	
	long long answer = 1;
	for (int i = 0; i < N; i++) {
		if (answer > MAX / A[i]) {
			std::cout << -1 << std::endl;
			return 0;
		}
		else answer *= A[i];
	}
	
	std::cout << answer << std::endl;
	return 0;
}

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

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs

using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <class It> bool all(It f,It l){return std::all_of(f,l,id<bool>);}
template <class It> bool any(It f,It l){return std::any_of(f,l,id<bool>);}
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }

int n;
vi d;

int main()
{
  fastio();

  cin >> n;
  d = vi(n);
  forn(i,n) cin >> d[i];

  ll total = 0;
  forn(i,n) forn(j,n)
    if (i != j) total += d[i] * d[j];

  cout << total/2 << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;

int main(){
    int a,b;
    string ans;
    cin >> a >> b;
    if ((a*b)%2 == 0) {
        ans = "Even";
    }else{
        ans = "Odd";
    }
    cout << ans << endl;
    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string s;
  cin>>n>>s;
  if(n%2==1) cout<<"No";
  else{
    string t=s;
    t=t.substr(0,n/2);
    t=t+t;
    if(t==s) cout<<"Yes";
    else cout<<"No";
  }
}


Measured memory_bytes: 3600
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            A();
        }

        static void A()
        {
            var dict = new Dictionary<string, string> {
                { "1", "1" },
                { "2", "2" },
                { "3", "3" },
            };

            dict.Remove(Read());
            dict.Remove(Read());
            Println(dict.Values.ToArray()[0]);
        }

        static List<long> ReadLines(long n)
        {
            var l = new List<long>();
            for (long i = 0; i < n; i++)
            {
                l.Add(ReadLong());
            }
            return l;
        }

        static void YESOrNO(bool e) => Println(e ? "YES" : "NO");

        static void YesOrNo(bool e) => Println(e ? "Yes" : "No");

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int SumDigits(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static long Gcd(long a, long b) => b == 0 ? a : Gcd(b, a % b);
        static long Lcm(long a, long b) => a / Gcd(a, b) * b;

        static bool IsPrime(int x)
        {
            if (x <= 1 || (x != 2 && x % 2 == 0)) return false;
            if (x == 2) return true;

            for (int i = 3; i < x; i += 2)
                if (x % i == 0) return false;

            return true;
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static List<string> ReadSplit() => Read().Split().ToList();
        static List<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
        static List<long> ReadSplitLong() => Read().Split().Select(long.Parse).ToList();

        static void Print(object value) => Console.Write(value.ToString());
        static void Println(object value) => Console.WriteLine(value.ToString());
        static string Join<T>(IEnumerable<T> list) => string.Join("", list);
    }

    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }
}



Measured memory_bytes: 11232
n = int(input())
a = list(input())
b = list(input())
c = list(input())
sum = 0
for i in range(n):
  if a[i] == b[i] == c[i]:
    sum = sum
  elif a[i] == b[i] or b[i] == c[i] or c[i] == a[i]:
    sum += 1
  else:
    sum += 2
print(sum)

Measured memory_bytes: 3064
#include<stdio.h>

int main() {
	int a,b,c;
	char op;

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

	while (op != '?') {
		if (op == '+') c = a + b;
		else if (op == '-')c = a - b;
		else if (op == '*')c = a * b;
		else c = a / b;

		printf("%d\n",c);

		scanf("%d %c %d", &a, &op, &b);
	}
		
	
	
	return 0;
}


Measured memory_bytes: 2040
#整数の入力
N = int(input())
#スペース区切りの整数の入力リスト
A_list = list(map(int, input().split()))

if((0 in A_list) ==True):
  print("0")
  exit()
  
ans = 1
for i in range(N):
  if(ans<=10**18):
    ans = ans * A_list[i]
  else:
    print("-1")
    exit()
    
if(ans<=10**18):
    print(ans)
else:
  print("-1")

Measured memory_bytes: 21780
#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 1024

int main(void)
{
  int i,j,c;
  int n;
  char *a;

  scanf("%d ",&n);
  
  for(i=0;i<n;i++)
    {
      a = (char *)malloc(sizeof(char)*MAXSIZE);
      scanf("%s ",a);
      j = 0;
      while(1)
	{
	  if(a[j]=='\0')break;
	  c = 0;
	  while(1)
	    { 
	      if(a[j]=='0'){
		break;
	      }else{
		j++;
		c++;
	      }
	    }
	      if(a[j-1] == '1'){
	        if(c%5==1){printf(".");}
	        else if(c%5==2){printf(",");}
					else if(c%5==3){printf("!");}
					else if(c%5==4){printf("?");}
					else{printf(" ");}
	      }else if(a[j-1]=='7'){
					if(c%4==1){printf("p");}
	        else if(c%4==2){printf("q");}
					else if(c%4==3){printf("r");}
					else{printf("s");}
	      }else if(a[j-1]=='9'){
					if(c%4==1){printf("w");}
	        else if(c%4==2){printf("x");}
					else if(c%4==3){printf("y");}
					else{printf("z");}
	      }else if(a[j-1]=='2'){
					if(c%3==1){printf("a");}
	        else if(c%3==2){printf("b");}
					else{printf("c");}
	      }else if(a[j-1]=='3'){
					if(c%3==1){printf("d");}
	        else if(c%3==2){printf("e");}
					else{printf("f");}
        }else if(a[j-1]=='4'){
					if(c%3==1){printf("g");}
	        else if(c%3==2){printf("h");}
					else{printf("i");}   
	      }else if(a[j-1]=='5'){
					if(c%3==1){printf("j");}
	        else if(c%3==2){printf("k");}
					else{printf("l");}	     
	      }else if(a[j-1]=='6'){
					if(c%3==1){printf("m");}
	        else if(c%3==2){printf("n");}
					else{printf("o");}	     
	      }else if(a[j-1]=='8'){
					if(c%3==1){printf("t");}
	        else if(c%3==2){printf("u");}
					else{printf("v");}
	      }	  
	      j++;
			}
      printf("\n");
    }
  return 0;
}

Measured memory_bytes: 0
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#define ordered_set tree<pair<int,int>, null_type,less<pair<int,int>>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_pbds;
#define int long long int
//#define ll long long int
#define pb push_back
#define vec vector<int>
#define fo(i, n) for (int i = 0; i < n; i++)
#define foo(i, a, b) for (int i = a; i < b; i++)
#define mp make_pair
#define deb(x) cout << #x << " --> " << x << endl;
#define deb1a(v) cout << #v << "--->" << endl; for (auto it : v)  cout << it << " "; cout << endl;
#define deb2a(v) cout << #v << "--->" << endl;for (auto it:v){for(auto it1 : it){cout << it1 << " ";}cout<< endl;}
#define deb3a(v) cout << #v << "-->" << endl; for(auto it:v){cout << it.fi << " " << it.se << endl;}
#define mod 998244353
#define so(v) sort(v.begin(),v.end())
#define fi first
#define se second
#define db1(x) cout<<#x<<"="<<x<<endl
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<endl
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<endl
int power(int x, unsigned int y, int p){ int res = 1;x = x % p;while (y > 0)  { if (y & 1)res = (res*x) % p;y = y>>1;  x = (x*x)% p;} return res;}
int mI(int a, int m)  {return power(a, m - 2, m);}
// vector<vector<int>> dir = {{1, 0}, {-1, 0}, {0, 1}, {0, -1},{1,1},{1,-1},{-1,1},{-1,-1}};
#define double long double
int n;
int s;
vec v;
int dp[3001][3001];
int fun(int in, int sum) 
{
    if(sum>s)
        return 0;
    if(in>=n){
        if(sum==s)
            return 1;
        else
            return 0;
    }
    if(dp[in][sum]!=-1){
        return dp[in][sum];
    }
    int ans = 0;
    ans = (2*fun(in + 1, sum))%mod+fun(in+1,sum+v[in])%mod;
    ans %= mod;
    return dp[in][sum] = ans;
} 
  
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> s;
    v.resize(n);
    fo(i,n){
        cin >> v[i];
    }
    memset(dp, -1, sizeof(dp));
    cout << fun(0, 0);

}


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

int main() {
	int N; cin >> N;
	vector<int>sumW(N + 1), sumE(N + 1);
	vector<int>D(N);
	for (int i = 0; i < N; i++) {
		char c; cin >> c;
		if (c == 'W')D[i] = 1;
	}
	for (int i = 0; i < N; i++) {
		if (D[i]) {
			sumW[i + 1] += sumW[i] + 1;
			sumE[i + 1] += sumE[i];
		}
		else {
			sumE[i + 1] += sumE[i] + 1;
			sumW[i + 1] += sumW[i];
		}
	}

	int cnt = 1e9;
	for (int i = 0; i < N; i++) {
		int tmp = sumW[i] - sumW[0] + sumE[N] - sumE[i+1];
		cnt = min(cnt, tmp);
	}
	cout << cnt << endl;
	
	return 0;
}

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

using namespace std;


int main(){
  int N;
  string S;
  cin >> N >> S;
  
  for(int i=0; i<S.size(); i++){
    S[i] = (S[i]-'A'+N)%26 + 'A';
  }
  
  cout << S << endl;


  return 0;
}

Measured memory_bytes: 3628
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define BIL ((ll)1e9)
#define MOD ((ll)1e9+7)
#define INF (1LL<<60)           //1LL<<63でオーバーフロー
#define inf (1<<29)             //1<<29でオーバーフロー

int main(int argc,char* argv[]){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);

    int n;
    cin >> n;
    vector<int> t(n);
    vector<pii> xy(n);
    for(int i=0;i<n;i++){
        cin >> t[i];
        cin >> xy[i].first >> xy[i].second;
    }

    bool ans=true;
    int prevx=0,prevy=0,prevtm=0;
    for(int i=0;i<n;i++){
        int xdist=abs(prevx-xy[i].first),ydist=abs(prevy-xy[i].second);
        if(xdist+ydist>t[i]-prevtm){
            ans=false;
            break;
        }else{
            int tmdiff=t[i]-prevtm-(xdist+ydist);
            if(tmdiff%2==1){
                ans=false;
                break;
            }else{
                prevtm=t[i];
                prevx=xy[i].first;
                prevy=xy[i].second;
            }
        }
    }

    if(ans)cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 4484
s=input()
m=len(s)
sm=0
for i in range(2**(m-1)):
  a=list(str(bin(i)))[::-1]
  b=list(s)
  for j in range(len(a)-1,-1,-1):
    if a[j]=='1':
      b.insert(-j-1,'+')
  sm+=eval(''.join(b))
print(sm)

Measured memory_bytes: 38768
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(begin, i, end) for (int i = begin; i < (int)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    int A, B, X;
    cin >> A >> B >> X;
    if (A > X || A + B < X)
    {
        cout << "NO" << endl;
    }
    else
    {
        cout << "YES" << endl;
    }
}

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

#define double long double
#define int long long
#define ALL(x) x.begin(),x.end()
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
#define pb(x) push_back(x)
#define eb emplace_back
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend()) 
#define mp(x, y) make_pair(x, y)
#define INF 1000000000
#define MOD 998244353 
#define F(i, a, n) for(i=a;i<n;i++)
#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z
#define SO(x) cout<<x<<"\n"
#define DO(x, y) cout<<x<<" "<<y<<"\n"
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<< "\n"
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)


int32_t main(void)
{
    FASTER;
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int i, j;
    int a, b, c, k;
    TI(a, b, c);
    SI(k);
    while(b <= a)
    {
    	b *= 2;
    	--k;
    }
    while(c <= b)
    {
    	c *= 2;
    	--k;
    }
    if(k >= 0)
    	SO("Yes");
    else
    	SO("No");
    
    #ifdef LOCAL
    	cout<<endl<<endl<<"Time: "<<(float)clock()/CLOCKS_PER_SEC<<" seconds"<<endl;
    #endif
    return 0;
}

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

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

  if (D == 25)
    cout << "Christmas" << endl;
  else if (D == 24)
    cout << "Christmas Eve" << endl;
  else if (D == 23)
    cout << "Christmas Eve Eve" << endl;
  else if (D == 22)
    cout << "Christmas Eve Eve Eve" << endl;
  return 0;
}

Measured memory_bytes: 3532
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define ll long long
int main()
{
    ll n,m;
    cin >> n >> m;
    char a[n][m];
    ll i,j,mod=1000000007;
    ll dp[n][m];
    for(i=0;i<n;i++)
    for(j=0;j<m;j++)
    cin >> a[i][j];
    for(i=0;i<n;i++)
    {
        for(j=0;j<m;j++)
        {
            if(i==0)
            {
                if(j==0)
                dp[i][j]=1;
                else
                {
                    if(a[i][j]=='.')
                    dp[i][j]=dp[i][j-1];
                    else
                    dp[i][j]=0;
                }
            }
            else
            {
                if(j==0)
                {
                    if(a[i][j]=='.')
                    dp[i][j]=dp[i-1][j];
                    else
                    dp[i][j]=0;
                }
                else
                {
                    if(a[i][j]=='.')
                    dp[i][j]=(dp[i-1][j]% mod + dp[i][j-1]%mod)%mod;
                    else
                    dp[i][j]=0;
                }
            }
        }
    }
    cout << dp[n-1][m-1] << endl;
    return 0;
}


Measured memory_bytes: 9088
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
#include <numeric>
using namespace std; using ll = long long; using ld = long double;  using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vpll = vector<pll>;
using vs = vector<string>; using tll = tuple<ll, ll, ll>; using vtll = vector<tll>;
const ld PI = 3.1415926535897932;
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define co(i) cout << i << endl;
#define co2(i,j) cout << i << " " << j << endl;
#define co3(i) cout << i << " ";
#define po(i) cout << i.first << " " << i.second << endl;
void in() {}
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head h, Tail... t) {
	cerr << " " << h;
	if (sizeof...(t) > 0) cerr << " :";
	debug_out(t...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vec) {
	for (size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	return os;
}
ll ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.first > secondElof.first;
}
//**Snippetリスト**//
//rep, vin, all, iteLoop, bitSearch, bitList, nod, digitDP, treeDP//
//gcdlcm, isPrime, eratos, primeFactorize, Npow, combination, divisor, modinv, doubling//
//dfs, bfs, dijkstra, WarshallFloyd, BellmanFord, UnionFind, Kruskal, RMQ, LCA//
ll i, j, k, l; ll N, M, K, H, W, L, X, Y, Z, R, Q;
ll MOD = 1000000007, INF = 1LL << 60, ans = 0, z = 0, o = 1;
vpll flag, D; vll path;
//***********//
int main() {
	ll D;
	cin >> D;
	vl C(26);
	for (i = 0; i < 26; i++) cin >> C[i];
	vll S(D, vl(26));
	for (i = 0; i < D; i++) {
		for (j = 0; j < 26; j++) {
			cin >> S[i][j];
		}
	}
	vl T(D);
	vl last(26, -1);
	for (i = 0; i < D; i++) {
		ll pre = 0;
		for (j = 0; j < 26; j++) {
			if (S[i][j]-C[j]*(i-last[j])/2 > S[i][pre] - C[pre] * (i - last[pre])/2) {
				pre = j;
			}
		}
		T[i] = pre;
		last[T[i]] = i;
		co(T[i] + 1);
	}
	exit(0);
	//debug用
	for (i = 0; i < D; i++) {
		ans += S[i][T[i]];
		for (j = 0; j < 26; j++) {
			ans -= C[j]*(i - last[j]);
		}
		debug(ans);
	}
}

Measured memory_bytes: 3684
const double = Float64
const int = Int64

parseint(x) = parse(double, x)
readdouble() = map(parseint, split(readline()))

function main()
  a,b = split(readline()) 
  a = parse(int, a)
  b = parse(double,b)
  #println(a," ",b)
  ba = round(int,100b)
  #bb = floor(int,100b)-100ba
  println((a * ba)÷100)
  
end

main()

Measured memory_bytes: 157372
import numpy as np
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
np_ab = np.array(ab)
max_a = max(np_ab[:, 0])
dp = [0]*(h+max_a)
for i in range(1, h+max_a):
    dp[i] = min(dp[i-a] + b for a,b in ab)
print(dp[h])

Measured memory_bytes: 27360