akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include<string>
#include <iomanip>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<complex>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e9;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用
#define ret return 0

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

using Graph=vector<vector<ll>>;

#define ketasitei setprecision(15) //15桁表示

const ll MOD = 1000000007;


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

	int n, m;
	cin >> n >> m;

	if (n == 1 && m==0)
	{
		cout << 0 << endl;
		ret;
	}

	vector<int> ans(n, -1);

	if (m != 0)
	{
		vector<int> s(m), c(m);
		rep(i, m)
		{
			cin >> s[i] >> c[i];
			if (n == 1 && c[i] == 0)
			{
				cout << 0 << endl;
				ret;
			}
			if (s[i] == 1 && c[i] == 0)
			{
				cout << "-1" << endl;
				ret;

			}

			if (ans[s[i] - 1] == -1)
			{
				ans[s[i] - 1] = c[i];
			}
			else if (ans[s[i] - 1] == c[i])
				continue;
			else
			{
				cout << "-1" << endl;
				ret;
			}
		}
	}
	for (int i = 0; i < n; i++)
	{
		if (ans[i] == -1)
		{
			if (i == 0)
				ans[i] = 1;
			else
				ans[i] = 0;
		}
	}

	for (int i = 0; i < n; i++)
	{
		cout << ans[i];
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

using namespace std;

#define REP(a, i, n) for (int i = a; i < n; ++i)

int main() {

    int A, B;
    scanf("%d %d", &A, &B);

    REP(0, i, 16) {
        if (i % 2 == 0) {
            if (A != 0) {
                A--;
            }
        } else {
            if (B != 0) {
                B--;
            }
        }
    }

    if (A == 0 && B == 0) {
        printf("Yay!\n");
    } else {
        printf(":\(\n");
    }

    return 0;
}


Measured memory_bytes: 128
#include<cstdio>
int n,m,a[2000000],x,y,cnt[2000000],line[2000000];
int main()
{
	scanf("%d%d",&n,&m);
	int empty=n;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",a+i);
		int p=a[i]-cnt[a[i]]++;
		if(p>0&&!line[p]++)empty--;
	}
	while(m--)
	{
		scanf("%d%d",&x,&y);
		int p=a[x]-cnt[a[x]]--+1;
		if(p>0&&!--line[p])empty++;
		a[x]=y;
		int q=a[x]-cnt[a[x]]++;
		if(q>0&&!line[q]++)empty--;
		printf("%d\n",empty);
	}
	return 0;
}

Measured memory_bytes: 10496
import java.util.*;

public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int[]L = new int[N];

        int cou =1;
        int wa = 0;
        for(int i=0; i<N; i++){   
            L[i] = sc.nextInt();
             wa += L[i];
            if(wa<=K){
                    cou++;
        } 
    }        
	System.out.println(cou);
      }
}


Measured memory_bytes: 36100
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
	int n;
	cin>>n;
	if(n<=1000)
	{
		cout<<(1000-n)<<endl;
		return 0;
	}
	int p=1000;
	while(p<n)
	{
		p+=1000;
	}
	cout<<(p-n)<<endl;
}
	


Measured memory_bytes: 3592
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>

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

//prototype declaration
int getint();
long long getllint();
double getdint();
char getch();
void setstring(char *s);
void showint(int i);
void showllint(long long i);
void showdouble(double i);
void showchar(char c);
void showstring(char *s);

int myPower(int a, int n) { // aのn乗の計算
	int x = 1;
	while (n > 0) { // 全てのbitが捨てられるまで
		if ( n & 1) { // 一番右のbitが１のとき
			x *= a;
		}
		a *= a;
		n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
	}
	return x;
}

int min(int a, int b) {
	return a < b ? a : b;
}

int main(void) {
	int a, b;
	a = getint();
	b = getint();
	if (a > 12) {
		showint(b);
	} else if (a < 6) {
		showint(0);
	} else {
		showint(b / 2);
	}
	return 0;
}

int getint() {
	int i;
	scanf("%d", &i);
	return i;
}

long long getllint() {
	long long i;
	scanf("%lld", &i);
	return i;
}

double getdint() {
	double i;
	scanf("%lf", &i);
	return i;
}

char getch() {
	char c;
	scanf("%c", &c);
	return c;
}

void setstring(char *s) {
	scanf("%s", s);
}

void showint(int i) {
	printf("%d\n", i);
}

void showllint(long long i) {
	printf("%lld\n", i);
}

void showdouble(double i) {
	printf("%lf\n", i);
}

void showchar(char c) {
	printf("%c\n", c);
}

void showstring(char *s) {
	printf("%s\n", s);
}


Measured memory_bytes: 128
S=input()
N=len(S)
ans=S[0]
for i in range(1,N):
    if i%2==1:
        continue
    T=S[:i]
    T1=T[:i//2]
    T2=T[i//2:]
    if T1==T2:
        ans=T
        #print(T1,T2)
print(len(ans))

Measured memory_bytes: 3060
#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> inline bool int_ceil(T a, T b) { T res = a / b; if(a % b != 0) res++; return res; }
template<typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define print(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define print(...)
#endif

int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

  vector<int> v(5);
  int ans = 0;
  rep(i, 5){
    cin >> v[i];
    if(v[i] == 0){
      ans =  i + 1;
    }
  }

  cout << ans << endl;

	return 0;
}


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

int main()
{
	int N,i,l,r,nCount;
	cin >> N;
	
	nCount = 0;
	for (i=0;i<N;i++) {
		cin >> l >> r;
		
		nCount += (r - l + 1);
	}
	
	cout << nCount <<endl;

    return 0;
}

Measured memory_bytes: 256
use std::io;


/// https://beta.atcoder.jp/contests/abc087/tasks/abc087_b
fn main() {
    let a = read_one::<usize>() + 1;
    let b = read_one::<usize>() + 1;
    let c = read_one::<usize>() + 1;
    let x = read_one::<usize>();
    let mut cnt = 0;
    for i in 0..a { for j in 0..b { for k in 0..c {
        if i * 500 + j * 100 + k * 50 == x { cnt += 1; }
    }}}
    println!("{}", cnt)
}


#[allow(dead_code)]
fn read<T>() -> Vec<T>
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|s| s.trim().parse().unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_one<T>() -> T
where T:
    std::str::FromStr,
    T::Err: std::fmt::Debug {

    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim().parse().unwrap()
}

Measured memory_bytes: 4352
#include <iostream>

using namespace std;

int main(){
  char b;
  cin >> b;
  if(b=='T') cout << 'A';
  else if(b=='A') cout << 'T';
  else if(b=='G') cout << 'C';
  else if(b=='C') cout << 'G';
  cout << endl;
  return 0;
}


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

#define REP(i, n, N) for(ll i=(n); i<(N); i++)
#define RREP(i, n, N) for(ll i=(N-1); i>=(n); i--)
#define LREP(lst,itr) for(auto itr = lst.begin(); itr != lst.end(); ++itr)
#define CK(n, a, b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define MCP(a, b) memcpy(b,a,sizeof(b))
#define P(s) cout<<(s)<<endl
#define P2(a, b) cout<<(a)<<" "<<(b)<<endl
#define P3(a, b, c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl
#define V2(T) vector<vector<T>>
typedef long long ll;
using namespace std;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;

int main(){
    int N, gift;
    cin >> N;
    gift = N/15;
    P(N*800 - gift*200);
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <iterator>
 
using namespace std;
 
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
 
#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)c.size())

typedef unsigned long long ull;
const int INF = (int)1e8;

int main(){
	string s;
	while(getline(cin,s)){
		istringstream iss(s);
		string name;
		int x,y; iss>>name>>x>>y;
		printf("%s %d %d\n",name.c_str(),x+y,x*200+y*300);
	}
	return 0;
}

Measured memory_bytes: 1232
#include <iostream>
#include <vector>
#include <algorithm>

int main(int argc, char **argv)
{
    int N, M;
    std::cin >> N >> M;
    std::vector<int> A(N);
    long sum = 0;
    for(int i = 0; i < N; i++){
        std::cin >> A.at(i);
        sum += A.at(i);
    }
    std::sort(A.begin(), A.end(), std::greater<int>());
    
    long k = A.at(M-1);
    if(k * 4 * M >= sum){
        std::cout << "Yes" << std::endl;
    }else{
        std::cout << "No" << std::endl;
    }
    
}


Measured memory_bytes: 256
c = [list(map(int,input().split())) for i in range(3)]

ans = True
for i in range(3):
        for j in range(3):
            if c[i][j]-c[i][(j+1)%3] != c[(i+1)%3][j]-c[(i+1)%3][(j+1)%3]:
                ans = False
                break

for i in range(3):
        for j in range(3):
            if c[j][i]-c[(j+1)%3][i] != c[j][(i+1)%3]-c[(j+1)%3][(i+1)%3]:
                ans = False
                break

print("Yes" if ans else "No")

Measured memory_bytes: 61984
import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;
import java.math.BigInteger;

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

	void run() {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] s = new int[n];
		int[] l = new int[n];
		int[] p = new int[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.nextInt();
			l[i] = sc.nextInt();
			p[i] = sc.nextInt();
		}

		int[] dp = new int[400];
		fill(dp, -1);
		dp[0] = 0;

		for (int i = 0; i < n; i++) {
			for (int x = 0; x < 400; x++) {
				for (int j = s[i]; j <= l[i]; j++) {
					if (x - j >= 0) {
						dp[x] = max(dp[x], dp[x - j] + p[i]);
					}
				}
			}
		}


		int m = sc.nextInt();
		int[] ans = new int[m];

		boolean imp = false;
		for (int i = 0; i < m; i++) {
			int x = sc.nextInt();
			ans[i] = dp[x];
			if (ans[i] == -1) imp = true;
		}
		if (imp) {
			System.out.println(-1);
		} else {
			for (int x : ans) {
				System.out.println(x);
			}
		}
	}

	void tr(Object... os) {
		System.err.println(deepToString(os));
	}
}

Measured memory_bytes: 23720
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
int main(){
    int n;
    cin >> n;
    vector<int> mons(n+1);
    vector<int> defeat(n);
    rep(i,n+1) cin >> mons[i];
    rep(i,n) cin >> defeat[i];
    ll ans=0;
    for(int i=0;i<n;i++){
        int left=min(mons[i],defeat[i]);
        ans+=left;
        defeat[i]-=left;

        int right=min(mons[i+1],defeat[i]);
        ans+=right;
        mons[i+1]-=right;
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>

#define PI 3.1415926535897

typedef long long ll;

using namespace std;



int main() {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;

    while (1) {
        c -= b;
        if (c <= 0) {
            cout << "Yes";
            break;
        }
        a -= d;
        if (a <= 0) {
            cout << "No";
            break;
        }
    }

    return 0;
}

Measured memory_bytes: 3624
#include <iostream>
#include <cstdio>
#include <cassert>
#include <ctime>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>

using namespace std;

#define all(x) (x).begin(), (x).end()

#ifdef LOCAL
#define dbg(x) cerr << #x " = " << x << endl;
#define idbg(x) #x " = " << x
#include "pretty_print.h"
#else
#define dbg(x)
#define idbg(x) ""
#endif

#ifdef _WIN32
#  define LLD "%I64d"
#else
#  define LLD "%lld"
#endif

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

template <typename T> T sqr(T x) { return x * x; }
template <typename T> T abs(T x) { return x < 0? -x : x; }
template <typename T> T gcd(T a, T b) { return b? gcd(b, a % b) : a; }
template <typename T> bool chmin(T &x, const T& y) { if (x > y) { x = y; return true; } return false; }
template <typename T> bool chmax(T &x, const T& y) { if (x < y) { x = y; return true; } return false; }


int main(int /* argc */, char** /* argv */)
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifdef LOCAL
    assert(freopen("inp", "r", stdin));
    assert(freopen("out", "w", stdout));
    #endif
    ll n, a, b;
    while (cin >> n >> a >> b) {
        ll d = n / (a + b);
        ll ans = a * d + min(a, n % (a + b));
        cout << ans << endl;
    }

    cerr << "Time execute: " << clock() / (double)CLOCKS_PER_SEC << " sec" << endl;
    return 0;
}


Measured memory_bytes: 256
cubes = gets.chomp.to_s
original_length = cubes.length
while true do
  before_length = cubes.length
  cubes.gsub!(/0000000000000000000011111111111111111111/, "")
  cubes.gsub!(/1111111111111111111100000000000000000000/, "")
  cubes.gsub!(/10/, "")
  cubes.gsub!(/01/, "")
  after_length = cubes.length
  break if before_length == after_length
end
puts original_length - cubes.length

Measured memory_bytes: 59608
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define speedX ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cout<< name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_time() cout << "\n\nTime of execution: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define trace(...)
#define end_time()
#endif


#define int long long 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<pii, int> piii;
typedef vector<int> vi;
typedef vector<pii> vii;
inline bool equals(ld a, ld b) {return fabs(a - b) < 1e-9;}
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ff first
#define ss second
#define uset unordered_set
#define umap unordered_map
#define all(x) x.begin(), x.end()
#define mod 1000000007


void solve(){
	char c;
	cin>>c;
	char b = (char)((int)c + 1);
	cout<<b<<"\n";
}
signed main(){
	speedX;
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
	int t=1;
	//cin>>t;
	while(t--){
		solve();
	}
	end_time();
	return 0;
}

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

int max( int a, int b )
{
    if( a > b )
        return a;
    else
        return b;
}

int min( int a, int b )
{
    if( a < b )
        return a;
    else
        return b;
}

int main()
{
    int score[6];

    for( int i = 0; i < 6; i++ )
        cin >> score[i];
    
    int sum = 0;
    sum += max( score[0], score[1] );
    sum += max( score[2], score[3] );
    sum += max( min( score[0], score[1] ), min( score[2], score[3] ) );
    sum += max( score[4], score[5] );

    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 3092
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>


//qsort(pa,n,sizeof(int),(int(*)(const void* ,const void*))cmp);


int main(void){

  long long n;
  scanf("%lld",&n);
  long long i,j,k;
  long long max=1;
  long long ano;
  //素数の時
  /*for(i=2;i<n;i++){
    if(n%2==0)
    break;
  }
  if(i==n){
    printf("%lld",n-1);
    return 0;
  }*/

  for(i=2;i*i<=n;i++){
    if(n%i==0)
    max=i;
  }
  if(n==3){
    printf("%d",2);
    return 0;
  }
  if(n==2){
    printf("%d",1);
    return 0;
  }



  ano=n/max;

  printf("%lld",max+ano-2);


  return 0;
}


Measured memory_bytes: 128
module MultiSet = struct
  module type S = sig
    type elt
    type t
    val empty : t
    val is_empty : t -> bool
    val mem : elt -> t -> bool
    val count : elt -> t -> int
    val add : elt -> t -> t
    val remove : elt -> t -> t
    val clear : elt -> t -> t
    val cardinal : t -> int
    val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
    val max_elt : t -> elt
    val subset : t -> t -> bool
  end

  module Make (E : Set.OrderedType) : S with type elt = E.t = struct
    module EltMap = Map.Make (E)
    type elt = EltMap.key
    type t = int EltMap.t

    let empty = EltMap.empty
    let is_empty = EltMap.is_empty
    let mem = EltMap.mem
    let count x m = try EltMap.find x m with Not_found -> 0
    let add x m = EltMap.add x (count x m + 1) m
    let remove x m =
      match EltMap.find x m with
      | 1 -> EltMap.remove x m
      | n -> EltMap.add x (n - 1) m
      | exception Not_found -> m
    let clear = EltMap.remove
    let cardinal m = EltMap.fold (fun _ -> ( + )) m 0
    let fold f = EltMap.fold (fun x n -> Array.fold_right f (Array.make n x))
    let max_elt m = fst (EltMap.max_binding m)
    let subset m1 m2 = EltMap.for_all (fun x n1 -> n1 <= count x m2) m1
  end
end

module IntMultiSet = MultiSet.Make (struct
  type t = int
  let compare = compare
end)

let () =
  let n = Scanf.scanf "%d\n" (fun n -> n) in
  let ds = Array.init n (fun _ -> Scanf.scanf "%d%c" (fun d _ -> d)) in
  let m = Scanf.scanf "%d\n" (fun m -> m) in
  let ts = Array.init m (fun _ -> Scanf.scanf "%d%c" (fun t _ -> t)) in
  print_endline
    begin if IntMultiSet.subset (Array.fold_left (fun m x -> IntMultiSet.add x m) IntMultiSet.empty ts) (Array.fold_left (fun m x -> IntMultiSet.add x m) IntMultiSet.empty ds) then "YES"
    else "NO" end

Measured memory_bytes: 39040
#include <iostream>
#include <math.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>

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

typedef long long lint;

using namespace std;

int main(){
  string s,ans;
  cin>>s;
  for(auto c : s){
    if(c=='B'){
      if(!ans.empty())ans.pop_back();
    }else{
      ans+=c;
    }
  }
  cout<<ans<<endl;
  return 0;
}


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

int main() {
  int N;
  cin >> N;
  int sum = 0;
  int A = N;
  while(A > 0) {
    sum += A % 10;
    A /= 10;
  }
  if(N % sum == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define FILL(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define FILL2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define Liny "Yes\n"
#define Linn "No\n"
#define LINY "YES\n"
#define LINN "NO\n"

//cout << setfill('0') << right << setw(4) << 12; // "0012"
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
int __stoi(string s){ return atoi(s.c_str()); }
ll sum(ll a[],ll N){ return accumulate(a,a+N,0LL);}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a/gcd(a,b)*b;}
template<class T> void chmax(T& a, T b){ if(a<b){a=b;} }
template<class T> void chmin(T& a, T b){ if(a>b){a=b;} }
template<class T> bool isIn(T a,vector<T> v){ for(T x:v){ if(a==x){return true;}} return false;}
string strReplace(string s,string target, string replacement){
    if (!target.empty()) {
      std::string::size_type pos = 0;
      while ((pos = s.find(target, pos)) != std::string::npos) {
        s.replace(pos, target.length(), replacement);
        pos += replacement.length();
      }
    }
    return s;
}
const ll MOD = 1e9+7;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define MP make_pair

bool DEBUG = 0;
template<class T> void dprint(T s){
  if(DEBUG){ cout << s << "\n"; }
}

string board[1005];
ll dp[1005][1005];

const ll MAX = MOD;

ll a[200005];
ll cumu[200005];
void solve(){
  ll N; cin>>N;
  cumu[0] = 0LL;
  for(int i=1;i<=N;++i){
    cin >> a[i];
    cumu[i] = (cumu[i-1] + a[i])%MOD;
  }
  ll ans = 0LL;
  for(int i=1;i<N;++i){
    ll temp = (cumu[N]-cumu[i]+MOD)%MOD;
    ans += (a[i]*temp)%MOD;
    ans %= MOD;
  }
  cout << ans << "\n";
}

int main(int argc, char *argv[]){
  if(argc>1 && argv[1][0]=='D'){ DEBUG = 1;}
  solve();
  return 0;
}

Measured memory_bytes: 6744
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; i++)
#define all(a) (a).begin(), (a).end()

int H, W;
vector<string> S;

vector<vector<int>> dirs = {
  {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}
};

int main () {
  cin >> H >> W;
  S.resize(H);
  rep(i,H) cin >> S[i];

  rep(i,H) {
    rep(j,W) {
      if(S[i][j] == '.') {
        int c = 0;
        for(auto dx: dirs) {
          int ni = i + dx[0];
          int nj = j + dx[1];
          if(ni < 0 || ni >= H || nj < 0 || nj >= W) continue;
          if(S[ni][nj] == '#') c++;
        }
        cout << c;
      } else {
        cout << S[i][j];
      }
    }
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#define _GIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const double EPS = 1e-10;


int main(void) {
  string S2, T;
  cin >> S2 >> T;

  vector<string> ans;
  for (int i = 0; i < S2.length() - T.length() + 1; ++i) {
    int left = 0;
    while (left < T.size()) {
      if (S2[i + left] == '?' || S2[i + left] == T[left]) {
        ++left;
      } else {
        break;
      }
    }
    if (left == T.size()) {
      string s = S2;
      s.replace(i, T.size(), T);
      rep(j, s.length()) {
        if (s[j] == '?') s[j] = 'a';
      }
      ans.push_back(s);
    }
  }

  if (ans.size() > 0) {
    sort(ans.begin(), ans.end());
    cout << ans[0] << endl;
  } else {
    cout << "UNRESTORABLE" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 3624
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;

/*
<url:https://agc005.contest.atcoder.jp/tasks/agc005_b>
問題文============================================================
 すぬけ君はある日友人から長さ N の順列 a1,a2,…,aN を貰いました。
 
 Σ{l = 1..N}Σ{r = l..N} min(al,al+1,...,ar)
 
 を求めてください。
 
 制約
 1≦N≦200,000
 (a1,a2,…,aN) は (1,2,…,N) を並び替えたものである

=================================================================

解説=============================================================

 問題をそのまま計算すると O(N^2)となってTLE
 
 よって、別視点の考えをする。
 ある数値 a[i]に関して、その左右で a[i] が最小となるのがどの範囲であるか。
 この考えを行えば 左側に関して a[i] より小さいものの　位置を l, 右側に関して、a[i]よりも
 小さいものの　位置を r とすれば
 
 (i - l) * (r - l) 個分　a[i]が最小となる。
 
 よって各 a[i] に関して、その個数を 平衡木などを用いて数え上げてやれば良い
 
================================================================
*/
int main(void) {
	cin.tie(0); ios::sync_with_stdio(false);
    ll N; cin >> N;
    vector<ll> b(N+1,0);
    for(int i = 1; i <= N;i++){
        ll a; cin >> a;
        b[a] = i;
    }
    set<ll> s; s.insert(0); s.insert(N+1);
    ll ans = 0;
    for(ll i = 1; i <= N; i++){
        auto it = s.lower_bound(b[i]);
        ans += i * (*it - b[i]) * (b[i] - *(--it));
        s.insert(b[i]);
    }
    cout << ans << endl;
	return 0;
}


Measured memory_bytes: 11264
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int,int> pii;
typedef long long ll;
const long long MOD=1000000007;
#define rep(i,n) for(long long i=0;i<(n);i++)
#define rep2(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define pb push_back




int main(){

    ll n;
    cin>>n;

    vector<ll> data(10000001);

    for (ll i=1;i<=10000000;i++){
        for (ll j=i;j<=10000000;j+=i){
            data.at(j)++;
        }
    }

    ll answer=0;

    for (ll i=1;i<=n;i++){
        answer+=i*data.at(i);
    }

    cout<<answer<<endl;

  





}

Measured memory_bytes: 81396
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define dbg(x) cout<<#x<<"="<<x
#define nl cout<<"\n"
#define frn(i,n) for(int i = 0;i < n;i++)
#define fr(i,a,b) for(int i = a;i < b;i++)
#define pb push_back
#define trav(x,c) for(auto &x:c)
#define vi vector<int>
#define vpii vector<pair<int,int> >
#define pii pair<int,int>
using namespace std;
const int mod = 1e9+7;
int toint(string s) {
  int ans = 0;
  for(char x: s) ans = ans*10 + (x - '0');
  return ans;
}

int lcs(string a, string b) {
  int n = a.size(), m = b.size();
  int dp[2][m+1];
  for(int i = 0;i <= n;i++) {
    for(int j = 0;j <= m;j++) {
      if(i==0||j==0) dp[i%2][j] = 0;
      else {
        if(a[i-1] == b[j-1]) dp[i%2][j] = 1 + dp[1-i%2][j-1];
        else dp[i%2][j] = max(dp[i%2][j-1], dp[1-i%2][j]);
      }
    }
  }
  return dp[n%2][m];
}

int sum(int x) {
  int s = 0;
  while(x) {
    s += x%10;
    x /= 10;
  }
  return s;
} 

bool equal(string s) {
  for(int i = 0,j = s.size()/2;j < s.size();i++,j++) {
    if(s[i] != s[j]) return false;
  }
  return true;
}

ll fact(int n) {
  ll ans = 1;
  fr(i,2,n+1) ans = (ans*i)%mod;
  return ans;
}

ull f(ll a, ll x) {
  if(a < 0) return 0;
  return (a/x+1);
}

ll dig(ull x) {
  ll ans = 0;
  while(x) {ans++, x /= 10;}
  return ans;
}

int main() {
  int n;
  cin>>n;
  double x[n+1], y[n+1];
  fr(i,1,n+1) cin>>x[i]>>y[i];
  string s = "";
  fr(i,1,n+1) s.push_back((char)(i + '0'));
  double total = 0.0;
  do {
    fr(i,1,s.size()) {
      int f = s[i]-'0', sec = s[i-1]-'0';
      total += sqrt(pow(x[f]-x[sec],2) + pow(y[f]-y[sec],2));
    }
  } while(next_permutation(s.begin(), s.end()));
  int fact = 1;
  fr(i,1,n+1) fact *= i;
  total /= fact;
  printf("%.10lf\n", total);
}



Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define MOD 1000000007
#define MOD2 998244353
#define int long long
//#define PI 3.14159265358979

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

using namespace std;

template < typename T >
ostream &operator<<(ostream &os, const vector< T > &A) {
	for (int i = 0; i < A.size(); i++)
		os << A[i] << " ";
	os << endl;
	return os;
}
template <>
ostream &operator<<(ostream &os, const vector< vector< int > > &A) {
	int N = A.size();
	int M;
	if (N > 0)
		M = A[0].size();
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
			os << A[i][j] << " ";
		os << endl;
	}
	return os;
}

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

struct edge {
	int from, to, d, c;
	edge(int _from = 0, int _to = 0, int _d = 0, int _c = 0) {
		from = _from;
		to = _to;
		d = _d;
		c = _c;
	}
	bool operator<(const edge &rhs) const {
		return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
	}
};
struct aabb {
	int x1, y1, x2, y2;
	aabb(int x1, int y1, int x2, int y2) : x1(x1), y1(y1), x2(x2), y2(y2) {}
};

typedef vector< edge > edges;
typedef vector< edges > graph;
struct flow {
	int to, cap, rev, cost;
	flow(int to = 0, int cap = 0, int rev = 0, int cost = 0) : to(to), cap(cap), rev(rev), cost(cost) {}
};
typedef vector< vector< flow > > flows;

const int di[4] = {0, -1, 0, 1};
const int dj[4] = {-1, 0, 1, 0};
const int ci[5] = {0, 0, -1, 0, 1};
const int cj[5] = {0, -1, 0, 1, 0};
const ll LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const double PI = acos(-1);

int pow2(int n) { return 1 << n; }
template < typename T, typename U >
bool chmin(T &x, const U &y) {
	if (x > y) {
		x = y;
		return true;
	}
	return false;
}
template < typename T, typename U >
bool chmax(T &x, const U &y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}

struct initializer {
	initializer() {
		cout << fixed << setprecision(11);
	}
};
initializer _____;
struct kusuri {
	int a, b, c;
};
int N, M, K, T, Q;
signed main() {
	int Ma, Mb;
	cin >> N >> Ma >> Mb;
	vector< kusuri > A(N);
	rep(i, N) cin >> A[i].a >> A[i].b >> A[i].c;
	vector< vector< int > > dp(500, vector< int >(500, LINF));
	dp[0][0] = 0;
	rep(i, N) {
		kusuri k = A[i];
		for (int i = 499; i >= 0; i--)
			for (int j = 499; j >= 0; j--) {
				if (dp[i][j] != LINF) {
					chmin(dp[i + k.a][j + k.b], dp[i][j] + k.c);
				}
			}
	}
	int Ga = 0, Gb = 0, ans = LINF;
	rep(i, 1000) {
		Ga += Ma;
		Gb += Mb;
		if (Ga >= 500 || Gb >= 500)
			break;
		chmin(ans, dp[Ga][Gb]);
	}
	if (ans == LINF) {
		ans = -1;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2304
#include<bits/stdc++.h>
using namespace std;
int main()
{
 int n,flag,i;
  string s;
  cin>>n>>s;
  flag=0;
  if(n%2==1)
    	flag=1;
  else
  {
    for(i=0;i<n/2;++i)
    {
      if(s[i]!=s[i+(n/2)])
         {
           flag=1;
           break;
         }
         }
         }
 if(flag==0)
         cout<<"Yes";
  else
         cout<<"No";
  return 0;
}

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

int main()
{
  int n, ans = 0;
  cin >> n;

  for (int i = 0; i < 100; i++)
  {
    if (n >= pow(2, i))
    {
      ans = max(ans, (int)pow(2, i));
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 4024
import sys
sys.setrecursionlimit(10 ** 7)

n,q = map(int,input().split())
ab = [list(map(int,input().split()))for _ in range(n-1)]
px = [list(map(int,input().split()))for _ in range(q)]

graph = [[] for _ in range(n+3)]
for a,b in ab:
    graph[a].append(b)
    graph[b].append(a)

value = [0]*(n+1)
for p,x in px:
    value[p] += x

def dfs(v,parent,add):
    value[v] += add
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x,v,value[v])

dfs(1,0,0)
print(*value[1:],end="\t")


Measured memory_bytes: 288740
#include<bits/stdc++.h>
using namespace std;
const int N=3e5+10;

int gi() {
	int x=0,o=1;char ch=getchar();
	while(!isdigit(ch)&&ch!='-') ch=getchar();
	if(ch=='-') o=-1,ch=getchar();
	while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	return x*o;
}

void No() {
	cout<<"No";exit(0);
}

int n,a[N];

int main() {
	cin>>n;
	for(int i=1;i<=n;i++) a[i]=gi();
	for(int l=1;l<=n;l++)
		if(a[l]^l) {
			int r=l;
			for(;r<=n;r+=2) {
				if(r+1>n||a[r+1]!=r+1) break;
				if(r+2>n||a[r+2]==r+2) break;
			}
			for(int i=l;i<=r;i++)
				if(a[i]<l||a[i]>r) No();
			int x=0,y=0;
			for(int i=l;i<=r;i+=2)
				if(a[i]<i) {
					if(a[i]<x) No();
					x=a[i];
				}
				else {
					if(a[i]<y) No();
					y=a[i];
				}
			l=r;
		}
	cout<<"Yes";
	return 0;
}


Measured memory_bytes: 1408
import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int v[] = new int[N];
    for(int i=0; i<N; i++){
      v[i] = sc.nextInt();
    }
    Arrays.sort(v);
    double value = v[0];
    for(int i=1; i<N; i++){
      value = (value + v[i])/2;
    }
    System.out.println(value);
  }
}

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

typedef long long ll;
typedef vector<long long> vl;
typedef pair<long , long> pll;
typedef vector< pll > vll;
typedef set<ll> sl;
typedef map<string, int> msi;

#define pb push_back
#define mp make_pair
#define f first
#define s second
#define inf 0x3f3f3f3f
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))

const ll md = 1000000007;
//void mod(ll &x){if (x >= md) x -= md; if (x < 0) x += md;}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	ll n;
	cin>>n;
	ll dp[n+1];
	ll h[n+1];
	for(int i=1;i<=n;i++)
		cin>>h[i];
	dp[1] = 0;
	dp[2] = abs(h[1]-h[2]);
	for(int i=3;i<=n;i++){
		dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
	}
	cout<<dp[n];
    return 0;
}




Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <utility>
#include <map>
#define ll long long
using namespace std;
using p = pair<ll, ll>;
ll dx[4] = {-1, 0, 1, 0};
ll dy[4] = {0, 1, 0, -1};

int main(){
    ll h, w;
    cin >> h >> w;
    string s[h];
    for(ll i = 0; i < h; i++)
        cin >> s[i];
    vector<vector<ll>> dist(1500, vector<ll>(1500, -1));
    queue<p> que;
    for(ll i = 0; i < h; i++){
        for(ll j = 0; j < w; j++){
            if(s[i][j]=='#'){
                dist[i][j] = 0;
                que.push(p(i,j));
            }
        }
    }
    while(!que.empty()){
        p check = que.front();
        que.pop();
        for(ll i = 0; i < 4; i++){
            ll nx = check.first + dx[i], ny = check.second + dy[i];
            if(nx<0||ny<0||nx>=h||ny>=w) continue;
            if(dist[nx][ny]!=-1 || dist[nx][ny]=='#') continue;
            if(s[nx][ny]=='.'){
                dist[nx][ny] = dist[check.first][check.second] + 1;
                s[nx][ny] = '#';
                que.push(p(nx, ny));
            }
        }
    }
    ll ans = 0;
    for(ll i = 0; i < h; i++){
        for(ll j = 0; j < w; j++){
            ans = max(ans, dist[i][j]);
            //cout << dist[i][j];
        }
       //cout << endl;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 35252
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 10000000000000009
//#define INF 9223372036854775807
typedef long long ll;
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define ORREP(i,n) for(int i=(n);i>=1;--i)
#define ZREP(i,n) for(int i=1;i<(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define rollcall cout<<"I'm Sucu."<<endl;
#define YES(s) s?cout << "YES" << endl:cout << "NO" << endl
#define Yes(s) s?cout << "Yes" << endl:cout << "No" << endl
#define Taka(s) s?cout << "Takahashi" << endl:cout << "Aoki" << endl
#define out(s,t,u) s?cout << t << endl:cout << u << endl
#define int ll
#define Endl endl

signed main(){
    int N;
    string W[104];
    map<string,int> MP;
    cin >> N;
    REP(i,N){cin>>W[i];MP[W[i]]++;}
    REP(i,N){
        if(MP[W[i]]!=1){cout << "No" << endl;return 0;}
        if(i==0)continue;
        if(W[i][0]!=W[i-1][W[i-1].size()-1]){cout << "No" << endl;return 0;}
    }
    cout << "Yes" << endl;
    return 0;
}   

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int  num = scanner.nextInt();	//要素数
		double array_x[] = new double[num];
		double array_y[] = new double[num];
		double max = 0;
		double dif;
		double abs;
		double pow;
		double sum = 0;
		double sum_min[] = new double[5];
		
		//xの要素
		for(int i = 0 ; i < num ; i ++){
			array_x[i] = scanner.nextDouble();
		}
		//yの要素
		for(int i = 0 ; i < num ; i ++){
			array_y[i] = scanner.nextDouble();
		}
		
		////距離を求める
		//３まで
		for(int i = 1; i < 4 ; i++ ){
			for( int j = 0; j < num ; j ++ ){
				dif = ( array_x[j] - array_y[j] );
				abs = Math.abs(dif);
				pow = Math.pow(abs, i);
				sum += pow;
				
				if( max < abs ){
					max = abs;
				}
			}
			double man = (double)i;
			sum_min[i] = Math.pow(sum, 1/man);
			sum = 0;
		}
		sum_min[4] = max;
		
		for(int i = 1 ; i <= 4 ; i ++){
			System.out.println(sum_min[i]);
		}
		
		scanner.close();
	}
}



Measured memory_bytes: 29160
#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T>
map<T, T> primeFactor(T n) {
	map<T, T> res;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			res[i] ++;
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return true;
}


#define in(x) cin >> x
#define out(x) cout << x
#define outn(x) cout << x << '\n'
#define outs(x) cout << x << ' '
#define rep(i,s,e) for(ll i=s;i<e;i++)
#define repeq(i,s,e) for(ll i=s;i<=e;i++)

int main() {
	ll n, cnt = 0,s,a;
	in(n);
	s = sqrt(n);

	repeq(i, 1, s) {
		if (n % i == 0) {
			a = i;
		}
	}

	outn(to_string(n / a).length());
	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <random>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using Pt = pair<int, int>;

int main()
{
	int A, B, C;
	cin >> A >> B >> C;
	int K;
	cin >> K;
	int B0 = B;
	int C0 = C;

	for (int i = 0; i <= K; ++i)
	{
		B = B0;
		C = C0;
		for (int j = 0; j < i; ++j)
		{
			B *= 2;
		}
		for (int j = 0; j < K - i; ++j)
		{
			C *= 2;
		}
		if (A < B && B < C)
		{
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;

	return 0;
}


Measured memory_bytes: 3632
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int q = sc.nextInt();
        int h = sc.nextInt();
        int s = sc.nextInt();
        int d = sc.nextInt();
        int n = sc.nextInt();
        long use[] = new long[4];
        use[0] = q;
        use[1] = Math.min(q * 2, h);
        use[2] = Math.min(use[1] * 2, s);
        use[3] = Math.min(use[2] * 2, d);
        long ans = 0;
        if (n >= 2) {
            long count = n / 2;
            ans += count * use[3];
            n -= 2 * count;
        }
        if (n >= 1) {
            ans += use[2];
        }
        System.out.println(ans);
        sc.close();
    }
}


Measured memory_bytes: 23764
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;


#include "boost/multiprecision/cpp_int.hpp"
#include "boost/multiprecision/cpp_dec_float.hpp"
namespace mp = boost::multiprecision;
typedef mp::cpp_int LL;
typedef mp::number<mp::cpp_dec_float<1024>> DD;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)


typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

void mod_print(ll k){
    ll P=1000;
    rep(y,1,P){
        ll x=mod(y*k);
        if(x+P>=i_7){
            x-=i_7;
        }
        if(abs(x)<=P){
            cout<<x<<"/"<<y<<endl;
            return;
        }
    }
    cout<<"nun"<<endl;
}
#define all(c) c.begin(),c.end()
//////////////////////////


ll po(ll i,ll p){
    if(p==0)return 1;
    else{
        i=mod(i);
        if(p==1)return i;
        if(p%2==0)return po(mod(i*i),p/2);
        return mod(i*po(i,p-1));
    }
}
ll bunbo(ll n){
    return po(n,i_5);
}


#define N 2000004
ll kai[N];
ll kai2[N];
void calc(){
    kai[0]=1;
    kai2[0]=1;
    rep(i,1,N-1){
        kai[i]=mod(kai[i-1]*i);
    }
    kai2[N-1]=po(kai[N-1],i_5);
    for(ll i=N-2;i>=0;i--){
        kai2[i]=mod(kai2[i+1]*(i+1));
    }
}
ll comb(ll n,ll k){
    if(n<k)return 0;
    if(n==0)return 1;
    return mod(mod(kai[n]*kai2[n-k])*kai2[k]);
}


ll n,k;
ll cal(ll *a){
    sort(a,a+n);
    ll res=0;
    rep(i,k-1,n-1){
        Add(res,a[i]*comb(i,k-1));
    }
    return res;
}

int main(){fastio
    calc();
    cin>>n>>k;
    ll a[n];rep(i,0,n-1)cin>>a[i];
    ll ans=0;
    ans+=cal(a);
    rep(i,0,n-1)a[i]*=-1;
    ans+=cal(a);
    cout<<mod(ans)<<endl;
    
    return 0;
}



Measured memory_bytes: 32256
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) { cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl; }
#define mdebug(m) { cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;} }
#define pb push_back
#define fi first
#define se second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p){ cout << '(' << p.first << ',' << p.second << ')'; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void chOut(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using v_bool = vector<bool>;
using v_Pii = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;



signed main(){

    int d, t, s; cin >> d >> t >> s;
    chOut(s * t >= d, "Yes", "No");

    return 0;
}


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

int64_t mod = 1000000007;
int64_t large = 9223372036854775807;
double PI = 3.141592653589793;

vector<int> x{0, 0, 0, 0, 0, 0, 1, 1, 1, 2};
vector<int> y{1, 1, 1, 2, 2, 3, 2, 2, 3, 3};
vector<int> z{2, 3, 4, 3, 4, 4, 3, 4, 4, 4};

int main()
{
    int64_t N, M = 0, A = 0, R = 0, C = 0, H = 0;
    string tmp;
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        cin >> tmp;
        if (tmp[0] == 'M')
            M++;
        if (tmp[0] == 'A')
            A++;
        if (tmp[0] == 'R')
            R++;
        if (tmp[0] == 'C')
            C++;
        if (tmp[0] == 'H')
            H++;
    }
    vector<int64_t> top{M, A, R, C, H};
    int64_t ans = 0;
    for (int i = 0; i < 10; i++)
        ans += top[x[i]] * top[y[i]] * top[z[i]];
    cout << ans;
}

Measured memory_bytes: 256
#include <stdio.h>

int x, y, i=1;

int main(){
  while(1){
    scanf("%d %d",&x,&y);
    if (x==0 && y==0){
      break;
    }
    if(x<y){
      printf("%d %d\n",x,y);
      i++;
    } else {
      printf("%d %d\n",y,x);
      i++;
    }
  }
  return 0;
}

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

int main() { 
    long inf = 1000000000000;
    long n; cin >> n;
    vector<vector<long>> v;
    
    v.resize(n);
    for (auto &x: v) {
        x.resize(n);
        for (auto &y: x) cin >> y;
    }

    bool f = false;
    for (int k=0; k<n; k++)
        for (int i=0; i<n; i++)
            for (int j=0; j<n; j++) {
                if (k==i || k==j || i==j || v[i][j] == inf) {
                    continue;
                } else if (v[i][k] + v[k][j] == v[i][j]) {
                    v[i][j] = inf;
                } else if (v[i][k] + v[k][j] < v[i][j]) {
                    f |= true;
                }
            }

    if (f) {
        cout << -1 << endl;
    } else {
        long sum = 0;
        for (int i=0; i<n; i++)
            for (int j=0; j<=i; j++)
                if (v[i][j] < inf)
                    sum += v[i][j];
        cout << sum << endl;
    }
}

Measured memory_bytes: 1024
#include <cstdio>
#include <algorithm>
using namespace std;

const int N = 1e5 + 5;

int c[N];

int main() {
    int n;
    scanf("%d", &n);
    int a;
    int res = 0;
    for (int i = 0; i < n; ++ i) {
        scanf("%d", &a);
        c[a + 2] ++;

        res = max(res, c[a] + c[a + 1] + c[a + 2]);
        res = max(res, c[a + 1] + c[a + 2] + c[a + 3]);
        res = max(res, c[a + 2] + c[a + 3] + c[a + 4]);
    }
    printf("%d\n", res);
    return 0;
}

Measured memory_bytes: 512