akhauriyash/Code-Regression huggingface dataset:
/*
               _____
              /     \
              vvvvvvv  /|__/|
                 I   /O,O   |
                 I /_____   |      /|/|
                J|/^ ^ ^ \  |    /00  |    _//|
                 |^ ^ ^ ^ |W|   |/^^\ |   /oo |
                  \m___m__|_|    \m_m_|   \mm_|


 */
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

#define fori(a, r) for(long long int a = 0; a < (r); ++a)
#define forI(a, r) for(long long int a = 1; a <= (r); ++a)

#define ff first
#define ss second
#define pll pair<ll, ll>

//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
//#pragma GCC optimize("fast-math")
//#pragma GCC optimize("unroll-loops")

using namespace std;
typedef long long int ll;
typedef long double ld;
typedef long long ull;

#define pt pair<ll, ll>
#define x first
#define y second

pt dxy[] = {{1,  0},
            {0,  1},
            {-1, 0},
            {0,  -1}};
const long long MAXN = 10 * 1000 + 100, MOD = 1e9 + 7, INF = ((1ll << 60) - 1) * 2 + 1;

//mt19937 random(time(0));

ll n, m;
vector<ll> v, a;

ll rec(ll div, ll id){
    if(id == v.size())
        return div < n / div - 1 ? n / div - 1 : 0;

    ll c = rec(div, id + 1);
    fori(i, a[id]){
        div *= v[id];
        c += rec(div, id + 1);
    }
    return c;
}

void solve() {
    cin >> n;
    ll N = n;
    for(ll i = 2; i * i <= N; ++i){
        if(N % i == 0){
            ll c = 0;
            while(N % i == 0){
                ++c;
                N /= i;
            }
            v.push_back(i);
            a.push_back(c);
        }
    }
    if(N != 1){
        v.push_back(N);
        a.push_back(1);
    }
    cout << rec(1, 0);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#define DEBUG0
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    solve();
    //another();
}

Measured memory_bytes: 3136
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>
#include <ios>
#include <cctype>
#include <cstdio>
#include <functional>
#include <cassert>
#include <fstream>
#include <ctime>

using namespace std;
using ll = long long;

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define FORR(i,a,b) for(int i = (a) - 1;i >=(b);--i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())
#define ASSERT(cond,mes) assert(cond && mes)

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())is >> v[i];
    return is;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a)n = a;
    if (n > b)n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

std::vector<int> enum_div(int n) {
    std::vector<int> ret;
    for (int i = 1; i*i <= n; ++i) {
        if (n%i == 0) {
            ret.push_back(i);
            if (i != 1 && i*i != n) {
                ret.push_back(n / i);
            }
        }
    }
    return ret;
}

template<typename T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template<typename T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

struct ToUpper {
    char operator()(char c) { return toupper(c); }
};

struct ToLower {
    char operator()(char c) { return tolower(c); }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int N;
    cin >> N;

    int x = 1;
    REP(i, N + 1) {
        if ((i) * (i + 1) < 2 * N)x = i + 1;
        else break;
    }

    vector<int> ans;
    FORR(i, x + 1, 1) {
        if (N - i >= 0) {
            N -= i;
            ans.emplace_back(i);
        }
    }

    REP(i, ans.size()) {
        cout << ans[i] << endl;
    }
    return 0;
}

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

const ll INF = 1LL << 60;


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

    ll cnt = N.size();

    if (N[cnt - 1] == '3') {
        cout << "bon" << endl;
    } else if (N[cnt - 1] == '0' || N[cnt - 1] == '1' || N[cnt - 1] == '6' || N[cnt - 1] == '8') {
        cout << "pon" << endl;
    } else {
        cout << "hon" << endl;
    }
}


Measured memory_bytes: 3592
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, P, Q):
    for i, R in enumerate(permutations(range(1, N+1), r=N)):
        R = list(R)
        for a, r in zip(P, R):
            if a != r:
                break
        else:
            p = i
        for a, r in zip(Q, R):
            if a != r:
                break
        else:
            q = i

    return abs(p-q)


def main():
    N = read_int()
    P = read_int_n()
    Q = read_int_n()
    print(slv(N, P, Q))


if __name__ == '__main__':
    main()


Measured memory_bytes: 6732
#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<utility>
#include<string>
#include<queue>
#include<stack>
using namespace std;

typedef long long ll; 
#define REP(i,n) for(int i=0;i<(int)(n);i++)

int main(void)
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a+b==15)printf("+");
    else if(a*b==15)printf("*");
    else printf("x");
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  unsigned int n;
  unsigned long long int a[100010];
  cin >> n;
  for(int i=0; i<n; i++){
    cin >> a[i];
  }
  if(n==1)a[1] = a[0] + 10;
  for(int i=n-2; i>=0; i--){
    if(a[i+1]+1==a[i]){
      a[i]-=1;
    }
  }
  bool flag = true;
  for(int i=0; i<n-1; i++){
    if(a[i] > a[i+1]){
      flag = false;
      break;
    }
  }
  cout << (flag?"Yes":"No") << endl;
  return 0;
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
#define reg(i,a,b) for(int i=a;i<=b;i++)
#define reh(i,a,b) for(int i=a;i>b;i--)
#define in(x) scanf("%d",&x)
#define fro freopen("D:\\testdata.in", "r", stdin)
#define il inline
#define lson(q) q<<1
#define rson(q) q<<1|1
using namespace std;
typedef long long ll;
const int mx=1e5+10;
int t;
int a[mx];
int b[mx];
int n,m;

int main() {
	int n,lcm;
	scanf("%d",&n);
	reg(i,1,n) {
		scanf("%d",a+i);
		b[i]=a[i];
		if(i!=1) {
			b[i]=b[i-1]/__gcd(b[i-1],b[i])*b[i];
		}
	}
	lcm=b[n];
	int num=0;
	reg(i,1,n){
		num+=lcm/a[i];
	}
//	cout<<(double)lcm/num<<endl;
	printf("%lf",lcm*1.0/num);
	return 0;
}




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

int const mod = 1e9 + 7;
signed main(void)
{
	int n;
	cin >> n;
	ll a[n];
	vector<ll> sum(n + 1, 0);
	ll ans;

	rep(i, n) cin >> a[i];
	for (int i = 1; i <= n; i++)
		sum[i] += sum[i - 1] + a[i - 1];
	ans = 0;
	rep(i, n - 1)
	{
		ans += ((sum[n] - sum[i + 1]) % mod * a[i]) % mod;
		ans %= mod;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 6380
#include<iostream>
#include<queue>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
#include<map>

using namespace std;

int main(){
    string s, t;
    int cnt=0;
    cin >> s >> t;
    for(int i=0;i<3;i++){
        if(s[i]==t[i]){
            cnt++;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second



int main()
{
    int n;
    cin>>n;
    vector<int>h(n);
    REP(i,n)cin>>h[i];
    vector<ll>dp(n,1e9);dp[0]=0;
    REP(i,n)
    {
        if(i+1<n)dp[i+1]=min(dp[i+1],dp[i]+abs(h[i+1]-h[i]));
        if(i+2<n)dp[i+2]=min(dp[i+2],dp[i]+abs(h[i+2]-h[i]));
    }
    cout<<dp[n-1]<<endl;
}

Measured memory_bytes: 1408
import java.util.*;
import java.awt.geom.Point2D;
import java.awt.*;
import static java.lang.System.*;
import static java.lang.Math.*;
//Loopで使う文字列の長さは固定！
//intで大丈夫？オーバーフローしない？
//Loop回数は本当に10⁹以内になってる？Loopは回る？？
public class Main {
    public static void main(String[]$){
        Scanner sc = new Scanner(in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int[] x=new int[n];
        for (int i = 0; i < n; i++) {
            x[i]=sc.nextInt();
        }
        long ans=1000000000;
        for (int i = 0; i <= n-k; i++) {
            ans=min(min(x[i+k-1]-x[i]+abs(x[i]),x[k-1+i]-x[i]+abs(x[k-1+i])),ans);
        }
        out.println(ans);
    }
    static long power(long x,int n){
        long mod=1000000007;
        long ans=1;
        while (n>0) {
            if((n&1)==1){
                ans=(ans*x)%mod;
            }
            x=(x*x)%mod;
            n>>=1;
        }
        return ans;
    }
    //最大公約数
    static int gcd (int a, int b) {
        int temp;
        while((temp = a%b)!=0) {
            a = b;
            b = temp;
        }
        return b;
    }
//※最小公倍数はa*b/gcd(a,b)である
}


Measured memory_bytes: 49744
def main():
    n = int(input())
    c = input()
    r,w = 0,0
    for i in range(n):
        if c[i]=="R":
            r += 1
        else:
            w += 1
    m = 0
    for i in range(r):
        if c[i] == "W":
            m += 1
    print(m)

if __name__ == "__main__":
    main()


Measured memory_bytes: 9320
def main():
	# a,b,k = map(int,input().split())
	n,k = map(int,input().split())
	# s = int(input())
	# a = list(map(int,input().split()))
	# rsp = list(str(input()))
	# l = [list(map(int, input().split())) for _ in range(n-1)]
	# s = list(s)
 
	if n < 10 and k < 10:
		print(int(n*k))
	else:
 		print(-1)
 
 
if __name__ == '__main__':
	main()

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

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rept(i,k,n) for(ll i = (k); i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<long long,long long> Pll;
typedef tuple<int,int,int> Tii;
long long powm(long long a, long long b, long long mod=1000000007){
    if(b<0) b+=mod-1;
    if(b>0){
        if(b%2==1) return a*powm(a*a%mod,b/2)%mod;
        else return powm(a*a%mod,b/2)%mod;
    }else{
        return 1;
    }
}


void exptb(long long a, long long mod, vector<long long> &tb){
    tb[0]=1;
    for(long long i=1;i<tb.size();i++){
        tb[i]=tb[i-1]*a%mod;
    }
}
ll mod = 1e10;
int main(){
    string s,t;
    cin>>s>>t;
    int n = s.size(),ans=0;
    rep(i,n) if(s[i]!=t[i]) ans++;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3884
# include <bits/stdc++.h>
# define ll long long
using namespace std;
const ll N = 3005;
int dp[N][N], n, m;
string s, t, ans;
int main(){
    cin >> s >> t;
    n = s.size(), m = t.size();
    s = "#" + s; t = "#" + t;
    for(int i = 1; i <= n; i++)
        for(int j = 1; j <= m; j++)
            if(s[i] == t[j])dp[i][j] = dp[i - 1][j - 1] + 1;
            else dp[i][j] = max(dp[i][j - 1], dp[i - 1][j]);
    while(n > 0 && m > 0){
        if(s[n] == t[m])
            ans += s[n],n --,m --;
        else
            if(dp[n][m] == dp[n - 1][m])n --;
            else m --;
    }
    reverse(ans.begin(), ans.end());
    cout << ans << endl;
}   

Measured memory_bytes: 35456
#include<stdio.h>
int main(void){
	char f[3];
	int a=0,b=0,c=0;
for(int i=0;i<3;i++){
		scanf("%c",&f[i]);
	}
		for(int i=0;i<3;i++){
		if(f[i]=='a'){
		a++;
		}
		if(f[i]=='b'){
		b++;
		}
		if(f[i]=='c'){
		c++;
		}
	}
	if(a==1&&b==1&&c==1){
		printf("Yes");
	return 0;
	}
	printf("No");
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define INF 2000000000
typedef long long int ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
#define getbit(n,i) (((n)&(1<<(i)))!=0)
#define setbit0(n,i) ((n)&(~(1<<(i))))
#define setbit1(n,i) ((n)(1<<(i)))
#define togglebit(n,i) ((n)^(1<<(i)))
#define lastone(n) ((n)&(-(n)))
#define read freopen("debug\\in.txt","r",stdin)
#define write freopen("debug\\out.txt","w",stdout)
#define fi first
#define se second
#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("d",&a,&b)
#define PI (acos(-1))
#define fastread ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mod (1000000007)
#define asz 500005
#define t int t;scanf("%d",&t);for(int v=1;v<=t;v++)
#define loop_arr(i,a,b) for(int i=a;i<b;i++)
#define loop_norm(i,a,b) for(int i=a;i<=b;i++)
#define minheap priority_queue<int,vector<int>,greater<int> >
#define maaheap priority_queue<int>
#define pb push_back()
#define pop pop_back()
ll BIGMOD ( ll a, ll p, ll m )
{
    ll result = 1;
    ll x = a;

    while ( p )
    {
        if ( p & 1 ) //p is odd
        {
            result = ( result * x ) % m;
        }
        x = ( x * x ) % m;
        p = p >> 1;
    }

    return result;
}

bool isPrime(int n)
{
    if (n <= 1)  return false;
    if (n <= 3)  return true;
    if (n%2 == 0 || n%3 == 0) return false;

    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;

    return true;
}

void SieveOfEratosthenes(int n)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));

    for (int p=2; p*p<=n; p++)
    {

        if (prime[p] == true)
        {
            for (int i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
}

int main()
{
   //fastread;
   string str;
   cin>>str;
   if(str=="SUN")
   {
       cout<<"7"<<"\n";
   }
   else if(str=="MON")
   {
       cout<<"6"<<"\n";
   }
     else if(str=="TUE")
   {
       cout<<"5"<<"\n";
   }
     else if(str=="WED")
   {
       cout<<"4"<<"\n";
   }
     else if(str=="THU")
   {
       cout<<"3"<<"\n";
   }
     else if(str=="FRI")
   {
       cout<<"2"<<"\n";
   }
     else if(str=="SAT")
   {
       cout<<"1"<<"\n";
   }

  return 0;
}


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

const int MAXN = 300;
int a[MAXN + 1][MAXN + 1];

int main() {
	int n; cin >> n;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			cin >> a[i][j];
		}
	}
	bool valid = true;
	long long ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = i+1; j <= n; j++) {
			int dis = 2e9 + 5;
			for (int k = 1; k <= n; k++) {
				if (k == i || k == j)continue;
				dis = min(dis, a[i][k] + a[k][j]);
			}
			if (dis < a[i][j])valid = false;
			else if (dis > a[i][j])ans += a[i][j];
		}
	}
	cout << (valid ? ans : -1) << endl;

	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std ;
typedef long long int ll;
int main()
{
	ll n;
	cin>>n;
	ll a[n],b[n+1],c[n];
	for(ll i=0;i<n;i++)
		cin>>a[i];
	for(ll i=1;i<=n;i++)
		cin>>b[i];
	for(ll i=1;i<=n-1;i++)
		cin>>c[i];
	ll ans=0;
	ans=ans+b[a[0]];
	for(ll i=1;i<n;i++)
	{
		if(a[i]-a[i-1]==1)
		{
			ans=ans+b[a[i]]+c[a[i]-1];
		}
		else
		{
			ans=ans+b[a[i]];
		}
	}
	cout<<ans<<endl;
} 

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

using namespace std;

bool palindromic(int i);
bool palindromic(string s);

bool palindromic(string s){
    if(s.length() == 0){
	return true;
    }else if(s.length() == 1){
	return true;
    }else if(s.length() == 2){
	return (s[0] == s[1]);
    }else{
	if(s[0] != s[s.length()-1]){
	    return false;
	}else{
	    return palindromic(s.substr(1,s.length()-2));
	}
    }
}

bool palindromic(int i){
    ostringstream oss;
    oss << i;
    string s = oss.str();
    return palindromic(s);
}

int main(){

    int a, b;
    cin >> a >> b;

    int sum = 0;
    for(int i = a; i <= b; i++){
	if(palindromic(i)){
	    sum++;
	}
    }
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
NN = N
L = []
p = 2
while p <= int(N**0.5):
    if N % p == 0:
        L.append([p])
        N /= p
        while N % p == 0:
            L[-1].append(p)
            N /= p
    p += 1
if N != 1:
    L.append([int(N)])
ans = 0
for i in range(len(L)):
    for j in range(1,len(L[i])+1):
        if NN % (L[i][0])**j == 0:
            NN = NN // (L[i][0])**j
            ans += 1
        else:
            break
print(ans)

Measured memory_bytes: 64964
import java.util.Scanner;

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

		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());

		//		int[] d = new int[n];
		//
		//		for (int i = 0; i < n; i++) {
		//			d[i] = Integer.parseInt(sc.next());
		//		}

		int sum = a + b + c;
		if (sum >= 22) {
			System.out.println("bust");
		} else {
			System.out.println("win");
		}
		sc.close();
	}
}

Measured memory_bytes: 23764
H,W=map(int,input().split())
mat=[[False]*(W+2)]
for i in range(H):
  array=[x=="#" for x in input()]
  mat.append([False]+array+[False])
mat.append([False]*(W+2))
#print(mat)

for i in range(1,H+1):
  ans_list=[]
  for j in range(1,W+1):
    if mat[i][j]:
      ans_list.append("#")
    else:
      ans=0
      for x in range(-1,2):
        for y in range(-1,2):
          if mat[i+x][j+y]:
            ans+=1
      ans_list.append(str(ans))
  print("".join(ans_list))

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

int main() {
    int n,i,j;cin>>n;
    int a,b,c;
    vector<int> dp(3),tdp(3);
    for(i=0;i<n;i++){
        if(i==0) cin>>tdp[0]>>tdp[1]>>tdp[2];
        else{
            cin>>a>>b>>c;
            tdp[0]=a+max(dp[1],dp[2]);
            tdp[1]=b+max(dp[2],dp[0]);
            tdp[2]=c+max(dp[1],dp[0]);
        }
        dp=tdp;
    }
    cout<<*max_element(dp.begin(),dp.end());
}

Measured memory_bytes: 3612
N = int(input())

n = len(str(N))
if n == 1:
    print(N)
else:
    if n % 2 == 0:
        s = "90" * (n//2)
        print(s[:-1])
        
    else:
        s = "90" * ((n-1) // 2)
        ans = int(s[:-1]) + N - 10**(n-1) + 1
        print(ans)

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

using namespace std;


int main(){
  int c[200000]={},ans=0,n;
  cin>>n;
  for(int i=0,x;i<n;i++)
    cin>>x,c[x-1]++,c[x]++,c[x+1]++;

  for(int i=0;i<200000;i++)ans=max(ans,c[i]);
  cout<<ans<<endl;
  
  return 0;
}


Measured memory_bytes: 1024
<?php
fscanf(STDIN, "%d %d %d", $n, $k, $q);
for($i = 0; $i<$q; $i++){
    $a[] = trim(fgets(STDIN));
}

if($k > $q){
    for($i=0; $i<$n; $i++){
        echo "Yes";
        echo "\n";
    }
    exit;
}

$check = array_count_values($a);

for($i=1; $i<=$n; $i++){
    if(array_key_exists($i,$check)){
        if($k - ($q-$check[$i]) > 0){
            echo "Yes";
            echo "\n";
        }else{
            echo "No";
            echo "\n";
        }
    }else{
        echo "No";
        echo "\n";
    }
}
?>

Measured memory_bytes: 14836
import java.util.Scanner;


class Main{
// https://atcoder.jp/contests/dp/tasks/dp_a
// problem A

    public static int frog1(int[] costs){
        int n = costs.length;
        int[] dp = new int[n];

        dp[1] = Math.abs(costs[1]-costs[0]);
        for(int i=2;i<n;i++){
            dp[i] = Math.min( Math.abs(costs[i]-costs[i-2] )+ dp[i-2], Math.abs(costs[i]-costs[i-1])+dp[i-1] );
        }
        // for(int i:dp) System.out.print(i+" ");
        return dp[n-1];

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

    int n = sc.nextInt();
        int[] costs = new int[n];
        for(int i=0;i<n;i++){
            costs[i] = sc.nextInt();
        }
    System.out.println(frog1(costs));
}

}

Measured memory_bytes: 50936
io = DATA.eof? ? STDIN : DATA
a,b,c=io.gets.split.map(&:to_i)
k=io.gets.to_i
def check(a,b,c)
  a<b && b<c
end

(k+1).times do |i|
  j=k-i
  if check(a,b*2**i,c*2**j)
     puts 'Yes'
     exit
  end
end
puts 'No'
__END__


Measured memory_bytes: 14416
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; 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 (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};



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

	int n;
	cin >> n;
	vl a(n);
	rep(i,n){
		ll x;
		cin >> a[i];
	}
	sort(all(a));
	cout << a.back() - a[0] << endl;
	

	return 0;
}


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

using namespace std;

#define MAX 1100000
#define MAX_N 1010
#define MAX_H 1010
#define MAX_W 1010

int par[MAX],rank[MAX];

void init(){
  for(int i = 0 ; i < MAX ; i++){
    par[i] = i;
    rank[i] = 0;
  }
}

int find(int x){
  if(par[x] == x){
    return x;
  }
  return par[x] = find(par[x]);
}

void unite(int x,int y){
  x = find(x);
  y = find(y);
  if(x == y){ return; }
  if(rank[x] < rank[y]){
    par[x] = y;
  }else{
    par[y] = x;
    if(rank[x] == rank[y]){
      rank[x]++;
    }
  }
}

bool same(int x,int y){
  return find(x) == find(y);
}

int H,W,N,start,goal;
int x[MAX_N],y[MAX_N];
char field[MAX_H][MAX_W];
bool visited[MAX_H][MAX_W];
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};

int solve(){
  init();
  for(int i = 0 ; i < H ; i++){
    for(int j = 0 ; j < W ; j++){
      if(field[i][j] == '#'){ continue; }
      for(int k = 0 ; k < 4 ; k++){
	int nx = j + dx[k];
	int ny = i + dy[k];
	if(0 > nx || W <= nx || 0 > ny || H <= ny){
	  continue;
	}
	if(field[ny][nx] == '#'){ continue; }
	if(!same(i*W+j,ny*W+nx)){
	  unite(i*W+j,ny*W+nx);
	}
      }
    }
  }
  if(same(start,goal)){
    return 0;
  }
  for(int i = 0 ; i < N ; i++){
    field[y[i]][x[i]] = '.';
    for(int j = 0 ; j < 4 ; j++){
      int nx = x[i] + dx[j];
      int ny = y[i] + dy[j];
      if(0 > nx || W <= nx || 0 > ny || H <= ny){
        continue;
      }
      if(field[ny][nx] == '#'){ continue; }
      if(!same(y[i]*W+x[i],ny*W+nx)){
        unite(y[i]*W+x[i],ny*W+nx);
      }
    }
    if(same(start,goal)){
      return i+1;
    }
  }
  return -1;
}

int main(){
  while(cin >> W >> H){
    start = 0;
    for(int i = 0 ; i < H ; i++){
      for(int j = 0 ; j < W ; j++){
        cin >> field[i][j];
        if(field[i][j] == 't'){
          field[i][j] = '.';
          goal = i*W+j;
        }
      }
    }
    cin >> N;
    for(int i = 0 ; i < N ; i++){
      cin >> x[i] >> y[i];
    }
    cout << solve() << endl;
  }
  return 0;
}

Measured memory_bytes: 10756
#include <bits/stdc++.h>
using namespace std;
string arr[10];

void solve2(const int &n) {
    set<string> s;
    for (int i = 0; i < n-1; i++) {
        for (int j = i+1; j < n; j++) {
            s.insert(arr[i]+arr[j]);
            if (arr[i] != arr[j]) s.insert(arr[j] + arr[i]);
        }
    }
    cout << s.size() << endl;
}

void solve3(const int &n) {
    set<string> s;
    for (int i = 0; i < n-2; i++) {
        for (int j = i+1; j < n-1; j++) {
            for (int k = j+1; k < n; k++) {
                s.insert(arr[i]+arr[j]+arr[k]);
                s.insert(arr[i]+arr[k]+arr[j]);
                s.insert(arr[j]+arr[i]+arr[k]);
                s.insert(arr[j]+arr[k]+arr[i]);
                s.insert(arr[k]+arr[i]+arr[j]);
                s.insert(arr[k]+arr[j]+arr[i]);
            }
        }
    }
    cout << s.size() << endl;
}

void solve4(const int &n) {
    set<string> s;
    for (int i = 0; i < n-3; i++) {
        for (int j = i+1; j < n-2; j++) {
            for (int k = j+1; k < n-1; k++) {
                for (int l = k+1; l < n; l++) {

                    s.insert(arr[i]+arr[j]+arr[k]+arr[l]);
                    s.insert(arr[i]+arr[j]+arr[l]+arr[k]);
                    s.insert(arr[i]+arr[k]+arr[j]+arr[l]);
                    s.insert(arr[i]+arr[k]+arr[l]+arr[j]);
                    s.insert(arr[i]+arr[l]+arr[j]+arr[k]);
                    s.insert(arr[i]+arr[l]+arr[k]+arr[j]);

                    s.insert(arr[j]+arr[i]+arr[k]+arr[l]);
                    s.insert(arr[j]+arr[i]+arr[l]+arr[k]);
                    s.insert(arr[j]+arr[k]+arr[i]+arr[l]);
                    s.insert(arr[j]+arr[k]+arr[l]+arr[i]);
                    s.insert(arr[j]+arr[l]+arr[i]+arr[k]);
                    s.insert(arr[j]+arr[l]+arr[k]+arr[i]);

                    s.insert(arr[k]+arr[i]+arr[j]+arr[l]);
                    s.insert(arr[k]+arr[i]+arr[l]+arr[j]);
                    s.insert(arr[k]+arr[j]+arr[i]+arr[l]);
                    s.insert(arr[k]+arr[j]+arr[l]+arr[i]);
                    s.insert(arr[k]+arr[l]+arr[i]+arr[j]);
                    s.insert(arr[k]+arr[l]+arr[j]+arr[i]);

                    s.insert(arr[l]+arr[i]+arr[j]+arr[k]);
                    s.insert(arr[l]+arr[i]+arr[k]+arr[j]);
                    s.insert(arr[l]+arr[j]+arr[i]+arr[k]);
                    s.insert(arr[l]+arr[j]+arr[k]+arr[i]);
                    s.insert(arr[l]+arr[k]+arr[i]+arr[j]);
                    s.insert(arr[l]+arr[k]+arr[j]+arr[i]);

                }
            }
        }
    }
    cout << s.size() << endl;
}


int main() {

    int n, m;
    for(; ;) {
        cin >> n;
        if (n == 0) break;
        cin >> m;
        for (int i = 0; i < n; i++) cin >> arr[i];
        if (m == 2) solve2(n);
        else if (m == 3) solve3(n);
        else if (m == 4) solve4(n);
    }
    return 0;
}



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

int main() {
  int N,M;
  cin >> N >> M;
  
  vector <int> load(100);
  int counter = 0;

  for (int j = 1; j < N+1; j++) {
    for (int i = 0; i < 2 * M; i++) {
      cin >> load.at(i);
      if ( load.at(i) == j) counter++;
    }
    cout << counter << endl;
    counter = 0;
  }  
}

Measured memory_bytes: 256
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
using namespace std;

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

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

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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const ll INF = 1e18;
const ld PI = acos((ld)-1);
const ld EPS = 1e-6;
const int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};
const char nl = '\n';

template <typename T> inline T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <typename T> inline T lcm(T a, T b) { return a / gcd(a, b) * b; }
template <class T> void ckmin(T& a, T b) { a = min(a, b); }
template <class T> void ckmax(T& a, T b) { a = max(a, b); }

// (Integer/Long).bitCount(x)
int pct(int x) { return __builtin_popcount(x); }
int pct(ll x) { return __builtin_popcountll(x); }

void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) { cerr << h; if (sizeof...(t)) cerr << ", "; DBG(t...); }

void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
void setIO(string s = "") {
	unsyncIO();
	if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
}

// Binary Exponentiation
ll pow(ll b, ll e, ll m = 0LL, ll ans = 1LL) { while (e) { if (e & 1LL) { ans *= b; if (m) ans %= m; } b *= b, e >>= 1LL; if (m) b %= m; } return ans; }

void dfs(int u, int p, ll& ans, vector<vector<int> >& adj) {
	for (int v : adj[u])
		if (v != p)
			dfs(v, u, ans, adj);
	if (u != 0) {
		if (p < u)
			ans += (ll) (u - p) * (sz(adj) - u);
		else
			ans += (ll) (u + 1) * (p - u);
	}
	else
		ans += sz(adj);
}

void solve(int tcn) {
	int n;
	cin >> n;
	vector<vector<int> > adj(n);
	FOR(i, 1, n) {
		int u, v;
		cin >> u >> v;
		--u, --v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	ll ans = 0LL;
	dfs(0, -1, ans, adj);
	cout << ans << nl;
}

int main() {
    setIO();

    int t = 1; //cin >> t;
	for (int i = 1; i <= t; ++i) {
		solve(i);
	}
	return 0;
}

Measured memory_bytes: 26540
#include <bits/stdc++.h>
using namespace std;
#define rep(i,k,n) for(int i = (k); i < (n); i++)
#define repr(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
const int INF = 114514810;
const int MOD = 1000000007;
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int A,B,X;
	cin >> A >> B >> X;
	if(A+B>X&&A<=X){
		cout << "YES" << endl;
	}else{
		cout << "NO" << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

#define loop(i,n)for(i=0;i<n;i++)
#define INF 1000000000
using ll = long long int;
typedef pair<int,int> pii;
typedef vector<pii> vii;
typedef vector<int> vi;


#define MAX 100005


int main()
{
    IOS;
    //freopen("inputfile.txt","r",stdin);
  ll n,k;cin>>n>>k;
  ll ar[n];
  for(ll i=0;i<n;i++)cin>>ar[i];
  sort(ar,ar+n);ll sum = 0;
  for(ll i=0;i<(n-k);i++)sum+=ar[i];
  cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 5168
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <math.h>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	int ans=0;
	vector<string> a(n);
	vector<int> b(n);
	for(int i=0;i<n;i++){
		cin >> a[i] >> b[i];
	}
	string s; cin >> s;
	bool ok=0;
	for(int i=0;i<n;i++){
		if(ok){
			ans+=b[i];
		}
		if(s==a[i])ok=1;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    ll r,d,x; cin>>r>>d>>x;
    ll ans = x;
    rep(i,10) {
        ans *= r;
        ans -= d;
        cout << ans << '\n';
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <cctype>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <stack>
#include <unordered_set>
#include <sstream>
#include <cstring>
#include <iomanip>
#include <queue>
#include <unordered_map>

int main() {
	int32_t n, base;
	std::cin >> n >> base;

	int64_t max_representable = base - 1;
	int32_t num_digits = 1;
	while(max_representable < n) {
		num_digits++;
		max_representable = (max_representable + 1) * base - 1;
	}

	std::cout << num_digits;
	return 0;
}




Measured memory_bytes: 256
n, m = input().split()

H = list(map(int, input().split()))

AB = [ list(map(int, input().split())) for i in range(int(m))]

cands = set()
for a, b in AB:
	if H[a-1] > H[b-1]:
		cands.add(b)
	elif H[a-1] < H[b-1]:
		cands.add(a)
	else:
		cands.add(a)
		cands.add(b)

print(int(n)-len(cands))

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

#define pb push_back
#define mp make_pair

#define fi first
#define se second

typedef long long ll;

using namespace std;
ll n, x;
int main(){

cin >> n >> x;
if(x == 1 || x == 2 * n - 1){
    cout << "No";
    return 0;
}
cout << "Yes\n";
x--;
vector<int> v(n * 2 - 1);
for(int i=0;i<2*n-1;i++){
    v[(n + i - 1) % (2 * n - 1)] = x + 1;
    x++;
    x %= (2 * n - 1);
}
for(int i=0;i<2*n-1;i++){
    cout << v[i] << '\n';
}

return 0;
}


Measured memory_bytes: 2304
#pragma comment(linker, "/stack:247474112")
#pragma GCC optimize("Ofast")
#include"bits/stdc++.h"
using namespace std;
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define int long long
#define ends ' '
#define endl '\n'
#define pb emplace_back
#define x first
#define y second
#define pii pair<int, int>
#define sz(x) (int)(x).size()

const int prime = 1e9+7;

int mod(int a, int p = prime) {
	return (a%p + p) % p;
}

int xpo(int a, int b) {
	if(!b)
		return 1;
	int temp = xpo(mod(a*a), b/2);
	if(b&1)
		temp = mod(temp*a);
	return temp;
}

unordered_map<int, int> dp;

int f(int s) {
	if(s < 3) {
		return 0;
	}
	if(dp.find(s) != dp.end()) {
		return dp[s];
	}
	int ans = 1;
	
	for(int i = 3; s-i >= 3; ++i)
		ans = mod(ans + mod(f(s-i)));

	return dp[s] = ans;
}

void solve() {
	int s;
	cin >> s;
	cout << f(s) << '\n';
	// for(auto i : dp) {
	// 	cout << i.x << ' ' << i.y << '\n';
	// }
}

int32_t main() {
	IOS;

    int t = 1;
    while(t--) {
        solve();
    }
		
	return 0;
}

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

int main() {
  char c;
  cin >> c;

  if (c == 'a'||c == 'i'||c == 'u'||c == 'e'|| c == 'o') {
    cout << "vowel" << endl;
  } else {
    cout << "consonant" << endl;
  }

  return 0;
}

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

using namespace std;
const int maxn = 1e6+23;
typedef long long ll;

struct E
{
    int l,r,o;
    bool operator <(const E a) const
    {
        return r<a.r;
    }
};

int bit[maxn];
int a[maxn];
int pos[maxn];
E q[maxn];
int n,m;
int ans[maxn];

inline int lowbit(int x)
{
    return x&(-x);
}

inline int query(int x)
{
    int ans=0;
    for(int i=x;i;i-=lowbit(i)) ans+=bit[i];
    return ans;
}

inline void upd(int i,int x)
{
    for(;i<=n;i+=lowbit(i)) bit[i]+=x;
}


void read(int &x)
{
    int f=1;x=0;char s=getchar();
    while(s<'0'||s>'9'){if(s=='-')f=-1;s=getchar();}
    while(s>='0'&&s<='9'){x=x*10+s-'0';s=getchar();}
    x*=f;
}

int main()
{
    read(n),read(m);
    for(int i=1;i<=n;i++) read(a[i]);
    
    for(int i=1;i<=m;i++) read(q[i].l),read(q[i].r),q[i].o=i;
    sort(q+1,q+m+1);
    for(int now=0,i=1;i<=m;i++){
        //printf("%d %d\n",q[i].l,q[i].r);
        while(now<q[i].r){
            now++;
            if(pos[a[now]]) upd(pos[a[now]],-1);
            upd(now,1);pos[a[now]]=now;
        }
        ans[q[i].o]=query(q[i].r)-query(q[i].l-1);
    }
    for(int i=1;i<=m;i++) printf("%d\n",ans[i]);
}


Measured memory_bytes: 17448
import itertools

while True:
	n,s = map(int,raw_input().split())
	if n == 0 and s == 0:
		break
	
	count = 0
	num = list(itertools.combinations(xrange(10), n))
	for var in num:
		if sum(var) == s:
			count += 1
	
	print count

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

#define ll long long
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int mod = 1e9 + 7;
const int MAX = 1e5 + 1;

void solve()
{
	double d, t, s;
	cin >> d >> t >> s;
	double spd = d / t;
	if(spd <= s) cout << "Yes\n";
	else cout << "No\n";
}

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


Measured memory_bytes: 3736
import kotlin.math.*

fun str() = readLine()!!
fun int() = str().toInt()
fun long() = str().toLong()

fun read(d:String = " ") = str().split(d)
fun <T> list(d:String = " ",f:String.()->T) = read(d).map {f(it)}
fun list() = list {toInt()}

fun <T> MutableList<T>.removeLast() = this.removeAt(this.lastIndex)

const val mod = 1000000007L

fun main() {
	abc000X()
}

fun abc000X() {
	val (d,t,s) = list()
	println(if(t*s>=d) "Yes" else "No")
}


Measured memory_bytes: 36340
#include <iostream>

using namespace std;

int main(){
	int n, p, index, owan, answer;
	int person[1000];

	while(1){
		//ÏÌú»
		index = 0;
		for(int i=0 ; i<1000 ; i++){
			person[i] = 0;
		}
   
		//lüÍ  n:óâÒÌl  p:¬ÎÌ
		cin >> n >> p;
		if(n==0 && p==0) break;
		owan = p;//ßÍ¨oÉ¬Îª·×ÄüÁÄ¢é

		while(1){
			if(owan>0){//¨oÉÎª êÎÎð1ÂÆé
				owan--;
				person[index]++;
			}
			else{//ÎðSüêé
				owan += person[index];
				person[index] = 0;
			}

			// élª·×ÄÌ¬ÎðàÁÄ¢½ç»Ìlª¬·ÆÈé
			if(owan==0 && person[index]==p){
				answer = index;
				break;
			}
			index++;//ÐÆÂÆÈèÌÐÆÖ
			if(index>=n)index = 0;
		}

		//¦ÌoÍ
		cout << answer << endl;
	}

	return 0;
}

Measured memory_bytes: 0
n=int(input())
t,a=map(int,input().split())
h=[t-int(i)*0.006 for i in input().split()]
result=abs(a-h[0])
num=0
for i in range(n):
    if abs(a-h[i])<result:
        result=abs(a-h[i])
        num=i
print(num+1)


Measured memory_bytes: 3060
M,K=map(int,input().split())
if M==0:
    if K==0:
        print("0 0")
    else:
        print(-1)
elif M==1:
    if K==0:
        print("0 0 1 1")
    else:
        print(-1)
else:
    if 0<=K<2**M:
        X=[i^K for i in range(2**M)]+[K]+[i^K for i in range(1,2**M)][::-1]
        print(" ".join([str(i) for i in X]))
    else:
        print(-1)


Measured memory_bytes: 31756
#include <iostream>
using namespace std;
#define MAX 2000000

int H,A[MAX+1];

void maxHeapify(int i){
  int l,r,largest;
  l = 2*i;
  r = 2*i+1;

  if(l <= H && A[l] > A[i]) largest = l;
  else largest = i;
  if(r <= H && A[r] > A[largest]) largest = r;

  if(largest != i){
    swap(A[i],A[largest]);
    maxHeapify(largest);
  }
}

int main(){
  cin >> H;

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

  for(int i=H/2;i>=1;i--){
    maxHeapify(i);
  }

  for(int i=1;i<=H;i++){
    cout << " " << A[i];
  }
  cout << endl;

  return 0;
}



Measured memory_bytes: 5008
import collections

n=int(input())
g=[[] for _ in range(n+1)]
for _ in range(n-1):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
c=list(map(int,input().split()))
c=sorted(c,reverse=True)
m=sum(c)-c[0]
ans=[0]*(n+1)
ans[1]=c[0]
q=collections.deque()
q.append(1)
checked=[0]*(n+1)
checked[1]=1
cnt=1
while len(q):
  tmp=q.popleft()
  for v in g[tmp]:
    if checked[v]==0:
      checked[v]=1
      q.append(v)
      ans[v]=c[cnt]
      cnt+=1
print(m)
print(*ans[1:])

Measured memory_bytes: 6288
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;
using ll = long long;

#define REP(i, a) for (int i = 0; i < (a); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a)-1; i >= (b); --i)
#define ALL(obj) (obj).begin(), (obj).end()
#define SIZE(obj) (int)(obj).sizeT()
#define YESNO(cond, yes, no) \
    { cout << ((cond) ? (yes) : (no)) << endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(), (list).rend())
#define ASSERT(cond, mes) assert(cond&& mes)

constexpr int MOD = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template <typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())
    is >> v[i];
    return is;
}

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a) n = a;
    if (n > b) n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u / GCD(u, v) * v;
}

std::vector<int> enum_div(int n) {
    std::vector<int> ret;
    for (int i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i != 1 && i * i != n) { ret.push_back(n / i); }
        }
    }
    return ret;
}

template <typename T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

struct ToUpper {
    char operator()(char c) {
        return toupper(c);
    }
};

struct ToLower {
    char operator()(char c) {
        return tolower(c);
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    vector<int> A(4);
    cin >> A;
    SORT(A);
    YESNO(A[0] == 1 && A[1] == 4 && A[2] == 7 && A[3] == 9, "YES", "NO");
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int n,ans;
	double t,a,h,m=1e9;
	cin>>n>>t>>a;
	for(int i=0;i<n;i++)
	{
		cin>>h;
		if(abs(t-0.006*h-a)<m)m=abs(t-0.006*h-a),ans=i+1;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
N=int(input())
s=list(input())


cnt=0
Ws=s.count("W")
Rs=s.count("R")

for i in range(Rs):
    if s[i]=="R" :
        cnt+=1
        
if Rs-cnt<=N-Ws:
    if Rs-cnt<=N-Rs:
        print(Rs-cnt)

elif N-Ws<=N-Rs:
    print(N-Ws)

else:
    print(N-Rs)



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

using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF (1e10)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << setprecision(12) << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);}} premain;

#define N_MAX (2001)
int N, M;
int S[N_MAX];
int T[N_MAX];
ll dp[N_MAX][N_MAX];
ll dp_cumsum[N_MAX][N_MAX];

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

	REP(i, N) {
		cin >> S[i];
	}
	REP(j, M) {
		cin >> T[j];
	}

	REP(i, N) {
		REP(j, M) {
			if (S[i] == T[j]) {
				dp[i][j] =  1;
				if ((0 < i) && (0 < j)) {
					dp[i][j] += dp_cumsum[i-1][j-1];
					dp[i][j] %= MOD;
				}
			} else {
				dp[i][j] = 0;
			}

			dp_cumsum[i][j] = dp[i][j];
			if (0 < i) {
				dp_cumsum[i][j] += dp_cumsum[i-1][j];
			}
			if (0 < j) {
				dp_cumsum[i][j] += dp_cumsum[i][j-1];
			}
			if ((0 < i) && (0 < j)) {
				dp_cumsum[i][j] -= dp_cumsum[i-1][j-1];
				dp_cumsum[i][j] += MOD;
			}

			dp_cumsum[i][j] %= MOD;
		}
	}

	print(dp_cumsum[N-1][M-1] + 1);

	return 0;
}


Measured memory_bytes: 62848