akhauriyash/Code-Regression huggingface dataset:
import math,sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
lili=lambda:list(map(int,sys.stdin.readlines()))
li = lambda:list(map(int,input().split()))
#for deque append(),pop(),appendleft(),popleft(),count()
I=lambda:int(input())
S=lambda:input().strip()
mod = 1000000007

n=I()
a=li()
m=1000000
c=0
for i in range(n):
    if(a[i]<m):
        c+=1
        m=a[i]
print(c)



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

struct mint{
    static const long long MOD = 1000000007;

    long long v;

    mint() : v(0) {}
    mint(long long x){
        x = x % MOD;
        if(x < 0){ x += MOD; }
        v = x;
    }
    mint& operator+=(mint a){
        v += a.v;
        if(v >= MOD){ v -= MOD; }
        return *this;
    }
    mint& operator*=(mint a){
        v *= a.v;
        v %= MOD;
        return *this;
    }
    mint& operator-=(mint a){
        v -= a.v;
        if(v < 0){ v += MOD; }
        return *this;
    }
    mint& operator/=(mint a){
        return (*this) *= a.inv();
    }

    mint operator*(mint a) const{
        return mint(v) *= a;
    }

    mint operator+(mint a) const {
        return mint(v) += a;
    }

    mint operator-(mint a) const {
        return mint(v) -= a;
    }

    mint operator/(mint a) const {
        return mint(v) /= a;
    }

    mint pow(long long k) const {
        mint res(1),tmp(v);
        while(k){
            if(k&1) res *= tmp;
            tmp *= tmp;
            k >>= 1;
        }
        return res;
    }
    mint inv(){return pow(MOD - 2); }

    static mint comb(long long n, int k){
        mint res(1);
        for(int i = 0; i < k; ++i){
            res *= mint(n - i);
            res /= mint(i + 1);
        }
        return res;
    }

    static mint factorial(long long n){
        mint res(1);
        for(int i = n; i > 1; --i){
            res *= mint(i);
        }
        return res;
    }

    bool operator<(const mint &a) const {
        return v < a.v;
    };
};

mint operator*(long long l, mint r){ return r * l; }

std::ostream& operator<<(std::ostream& stream, const mint& m){
    stream << m.v;
    return stream;
}

struct mintcomb{
    vector<mint> fact;
    vector<mint> ifact;
    mintcomb(ll n) : fact(n + 1, 1), ifact(n + 1, 1) {
        for(ll i = 2; i <= n; ++i){
            fact.at(i) = fact.at(i - 1) * i;
            ifact.at(i) = fact.at(i).inv();
        }
    }

    mint factorial(ll k) const { return fact.at(k); }
    mint combination(ll k, ll l) const {
        return fact.at(k) * ifact.at(l) * ifact.at(k - l);
    }
};

mint sub(ll K, vector<ll>& A){
    sort(A.begin(), A.end());
    mintcomb mc(A.size());
    mint ret = 0;
    for(ll i = K - 1; i < A.size(); ++i){
        ret += A.at(i) * mc.combination(i, K - 1);
    }
    return ret;
}

void solve(long long N, long long K, std::vector<long long> A){
    const mint maxsum = sub(K, A);
    REP(i, N){ A.at(i) *= -1; }
    const mint minsum = -1 * sub(K, A);
    cout << maxsum - minsum << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, K, std::move(A));
    return 0;
}


Measured memory_bytes: 2688
a,b,h,m = map(int,input().split())

import math
deg_a = (360.0/12.0)*h+(360.0/12.0)*(m/60)
deg_b = (360.0/60.0)*m
deg = abs(deg_a-deg_b)
#print(deg_a,deg_b,deg)
d = math.sqrt((math.sin(math.radians(deg))*a)**2+(b-a*math.cos(math.radians(deg)))**2)
print('{:.11g}'.format(d))

Measured memory_bytes: 9488
weather = input()
answer = 0

if weather == 'SSS':
    answer = 0
elif weather == 'SSR' or weather == 'SRS' or weather == 'RSS' or weather == 'RSR':
    answer = 1
elif weather == 'RRR':
    answer = 3
else:
    answer = 2

print(answer)


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

using namespace std;

typedef long long ll;

double getTime() { 
  return clock() / (double) CLOCKS_PER_SEC;
}

void read() {};

template<typename T, typename... Args>
void read(T& a, Args&... args) {
  cin >> a;
  read(args...);
}

void write() {};

template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " \n"[sizeof...(args) == 0];
  write(args...);
}

int main() {
  string cur = "CODEFESTIVAL2016";
  string s; read(s);
  int ans = 0;
  for(int i = 0; i < s.length(); i++) {
    ans += s[i] != cur[i];
  }
  print(ans);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b)  for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max((x),(y))
#define mins(x,y) x=min((x),(y))
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define all(a) ((a).begin()),((a).end())
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>using P=pair<T,Y>;
template<class T,class Y>ostream& operator<<(ostream&o,P<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}
template<class A,size_t N,class T>void Fill(A(&a)[N],const T&v){fill((T*)a,(T*)(a+N),v);}

const int MOD = 1e9+7; //998244353;

lll gcd(lll a,lll b,lll&x,lll&y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll modInv(ll a,ll m=MOD){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m=MOD){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
//V<ll>Fac,Rac;void setF(int n,int m=MOD){Fac=Rac=V<ll>(++n);Fac[0]=1;FOR(i,1,n)Fac[i]=Fac[i-1]*i%m;Rac[n-1]=modInv(Fac[n-1],m);FORR(i,n-1,1)Rac[i-1]=Rac[i]*i%m;}
//ll comb(int a,int b,int m=MOD){return a<b||b<0?0:Fac[a]*Rac[b]%m*Rac[a-b]%m;}

const int IINF = 1e9+6;
const ll LINF = 1e18;
string s, t;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> s >> t;
  int ans = 0;
  FOR(i, 0, sz(s)) ans += s[i]!=t[i];
  cout << ans << endl;
}

Measured memory_bytes: 3776
N=int(input())
abc="abcdefghijklmn"

def saiki(s,m):
  if len(s)==N:
    print(s)
  else:
    for i in range(m+2):
      if i<m+1:
        saiki(s+abc[i],m)
      else:
        saiki(s+abc[i],m+1)
    
saiki("a",0)

Measured memory_bytes: 4340
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

long long inputValueLongLong(){
    long long a;
    cin >> a;
    return a;
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

void inputVectorString(vector<string> * p, long long a){
    rep(i, a){
        string input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

const long long MOD = 10*10*10*10*10*10*10*10*10+7;

int main(int argc, const char * argv[]) {
    const double PI=3.14159265358979323846;
    // source code
    long long N = inputValueLongLong();
    vector<string> S;
    long long counter = 1;

    //inputVectorString(*S,N);
    for(long long i=0;i<N;i++){
        string input;
        cin >> input;
        S.push_back(input);
    }

    std::sort(S.begin(), S.end());
    S.erase(std::unique(S.begin(), S.end()), S.end());
    cout << S.size() <<endl;



    

    // for(int i=1;i<N;i++){
    //     cin >> S[i];
    //     bool flag = false;
    //     for(int j=0;j<i;j++){
    //         if(S[j].compare(S[i]) == 0){
    //             flag = true;
    //             break;
    //         }
    //     }
    //     if(flag == false){
    //         counter++;
    //     }
    // }

    // cout << counter << endl;



    
    return 0;
}

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

using namespace std;
using pii = pair <int, int>;

const int mx = 1e5 + 9;

int clr[mx];
vector <pii> adj[mx];

void color(int u, int par = -1) {
    for (auto v : adj[u]) {
        if (v.first == par) continue;
        clr[v.first] = clr[u];
        if (v.second & 1) clr[v.first] = 1 - clr[v.first];
        color(v.first, u);
    }
}

int main() {
    int n; scanf("%d", &n);
    for (int i = 1; i < n; i++) {
        int u, v, w; scanf("%d %d %d", &u, &v, &w);
        adj[u].emplace_back(v, w);
        adj[v].emplace_back(u, w);
    }

    clr[1] = 0;
    color(1);

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


Measured memory_bytes: 12364
use std::io::stdin;
use std::str::FromStr;
use std::cmp::max;

fn main(){
    let n: usize = get_one();
    let xs: Vec<i64> = get_vec();
    let ys: Vec<i64> = get_vec();
    let cxs = cumsum(xs);
    let cys = cumsum(ys);
    let mut ans = 0;
    for i in 0..n {
        let candy = cxs[i+1] - cys[i] + cys.last().unwrap();
        ans = max(candy, ans);
    }
    println!("{}", ans);
}

fn cumsum(v: Vec<i64>) -> Vec<i64> {
    let mut outcome = vec![0];
    for &e in v.iter() {
        let last = *outcome.last().unwrap();
        outcome.push(last + e);
    }
    outcome
}

#[allow(dead_code)]
fn get_line() -> String {
    let mut s = String::new();
    match stdin().read_line(&mut s){
        Ok(_) => {s.trim().to_string()}
        Err(_) => String::new()
    }
}

#[allow(dead_code)]
fn get_vec<T: std::str::FromStr>() -> Vec<T> {
    let line = get_line();
    line.split_whitespace().filter_map(|x| x.parse().ok()).collect()
}

#[allow(dead_code)]
fn get_one<T: FromStr + Copy>() -> T {
    let v = get_vec();
    v[0]
}

#[allow(dead_code)]
fn get_pair<T: FromStr + Copy>() -> (T, T) {
    let v = get_vec();
    (v[0], v[1])
}

#[allow(dead_code)]
fn get_triple<T: FromStr + Copy>() -> (T, T, T) {
    let v = get_vec();
    (v[0], v[1], v[2])
}

#[allow(dead_code)]
fn get_chars() -> Vec<char> {
    get_line().chars().collect()
}


Measured memory_bytes: 4352
#include <stdio.h>
int main(void) {
    int n,x,i,j,k,count;
    while (1) {
        scanf("%d %d",&n,&x);
        if (n==0&&x==0) break;
        count=0;
        for (i=1; i<=n-2; i++) {
            for (j=i+1; j<=n-1; j++) {
                for (k=j+1; k<=n; k++) {
                	if (i+j+k==x) count++;
                }
            }
        }
        printf("%d\n",count);
    }
    return 0;
}

Measured memory_bytes: 600
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    even_count = 0
    odd_count = 0
    for a in A:
        if a % 2 == 0:
            even_count += 1
        else:
            odd_count += 1
    print(3 ** N - (2 ** even_count))


Measured memory_bytes: 2940
//By Don4ick 
//#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

typedef long long ll;
typedef long double ld;
typedef unsigned int ui;

#define forn(i, n) for (int i = 1; i <= n; i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define y1 qewr1234

const double PI = acos(-1.0);
const int DIR = 4;
const int X[] = {1, 0, -1, 0};
const int Y[] = {0, 1, 0, -1};

const int N = (int)1e5 + 228;

using namespace std;

int n, ans[N];
vector < int > g[N];

void dfs(int v)
{
	vector < int > t;
	t.pb(0);
	for (auto to : g[v])
	{
		dfs(to);
		t.pb(ans[to] + 1);
	}
	sort(all(t));
	for (int i = 0; i < (int)t.size(); i++)
	{
		ans[v] = max(ans[v], t[i] + (int)g[v].size() - i);
	}
}

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

	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);

	scanf("%d", &n);
	for (int i = 2; i <= n; i++)
	{
		int j;
		scanf("%d", &j);
		g[j].pb(i);
	}             
	dfs(1);
	cout << ans[1] << endl;

	return 0;
}



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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

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

  int d, n; std::cin >> d >> n;
  int x = 0;
  while(n) {
    x++;
    int tmp = x, cnt = 0;
    while (tmp%100==0) tmp /= 100, cnt++;
    if (cnt == d) n--;
  }
  std::cout << x << "\n";
}


Measured memory_bytes: 256
import java.util.Scanner;
 
 
 
class Main {
 
	public static void main(String[] argv){
 
		Scanner sc = new Scanner(System.in);
 
		String s = sc.nextLine();
 
		sc.close();
 
		char[] c = s.toCharArray(); 
		for(int i = 0;i<4;i++){
System.out.print(c[i]);
}
System.out.print(" ");
for(int i=4;i<12;i++){ System.out.print(c[i]); }
System.out.println(); 
 
 
 
	}
 
}

Measured memory_bytes: 9676
/*
	Bakul Gaur (caesar1551)
*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PrePro ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define fr(i,n) for(ll i = 0; i < n; i++)
#define fre(i,a,b) for(ll i = a; i <= b; i++)
#define fb(i,n) for(ll i = n; i >= 0; i--)
#define fbe(i,a,b) for(ll i = a; i >= b; i--)
#define umap(x,y) unordered_map<x,y>
#define uset(x) unordered_set<x>
#define vv(x) vector<x>
#define pp(x,y) pair<x,y>
#define prar(a,n) fr(i,n){cout << a[i] << " ";}
#define inar(a,n) fr(i,n){cin >> a[i];}
#define mk make_pair
#define pb push_back
#define ff first
#define ss second
#define endl "\n"
#define mod 1000000007
#define MAX 1000001
inline ll gcd(ll a, ll b){
	if(b == 0){
		return a;
	}
	return gcd(b,a%b);
}
inline ll pwr(ll a, ll b, ll modulo = mod){
	if(a == 0 && b == 0){
		return 0;
	}
	ll ans = 1;
	while(b > 0){
		if(b&1){
			ans = ((ans%modulo) * (a%modulo))%modulo;
		}
		b >>= 1;
		a = ((a%modulo) * (a%modulo))%modulo;
	}
	return (ans+modulo)%modulo;
}
inline ll modInverse(ll a, ll p){
	// Only if p is prime.
	return pwr(a,p-2,p);
}



/* #############
   START SOLVING 
   ############# */

ll ans(vv(ll) &arr, ll n, ll k, ll index, vv(ll) &dp){
	if(index == n-1){
		return dp[index] = 0;
	}
	if(dp[index] != -1){
		return dp[index];
	}
	ll res = INT_MAX;
	for(ll i = 1; i <= k; i++){
		if(i+index < n){
			ll op = abs(arr[index] - arr[index+i]) + ans(arr,n,k,index+i,dp);
			res = min(res,op);
		}
		else{
			continue;
		}
	}
	return dp[index] = res;
}
void solve(){
	ll n, k;
	cin >> n >> k;
	vv(ll) arr(n);
	inar(arr,n);
	vv(ll) dp(n+1,-1);
	cout << ans(arr,n,k,0,dp) << endl;
}

int main(){
	PrePro
	/* #ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif */
    ll t = 1;
    // cin >> t;
    fr(i,t){
    	// cout << "Case #" << i+1 << ": ";
    	solve();
    	// cout << endl;
    }
	return 0;
}

Measured memory_bytes: 14240
#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
//#include <stdbool.h>
//#include <limits.h>
//#include <math.h>

#define MAX(a, b) ((a>b) ? a : b)
#define MAX3(a, b, c) (MAX(a, MAX(b, c)))

int main() {
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c);
  int s=MAX3(a, b, c)*3 -a-b-c;
  if (s%2) printf("%d\n", (s+3)/2);
  else printf("%d\n", s/2);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>   //PBDS
#include <ext/pb_ds/tree_policy.hpp>       //PBDS
#define int long long int
#define vi vector<int>
#define vii vector<pair<int,int>>
#define pi pair<int,int>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define mi map<int,int>
#define PI  3.141592653589
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define f(i,x,n) for(int i=x;i<n;i++)
#define rf(i,x,n) for(int i=n-1;i>=x;i--)
#define check(x)   cerr<<#x<<" : "<<x<<endl;
#define ordered_set tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update>
#define fbo find_by_order                    //return iterator PBDS
#define ook order_of_key                     //return number :)) PBDS
#define baar exit(0)
using namespace __gnu_pbds;
using namespace std;
int powmod(int base,int exponent,int mod)
{
    int ans=1;
    while(exponent){
        if(exponent&1)ans=(ans*base)%mod;
        base=(base*base)%mod;
        exponent/=2;
    }
    return ans;
}
signed main()
{
//   #ifndef ONLINE_JUDGE
//   freopen("input.txt", "r", stdin);
//   freopen("output.txt", "w", stdout);
//   #endif
    fast
    int k;
    cin>>k;
    if(k%2==0)
    {
    	cout<<-1;
    	baar;
	}
	if(k%10==5)
	{
		cout<<-1;
		baar;
	}
	int num=7;
	int cnt=0;
	while(num%k!=0)
	{
		num=num%k;
		num*=10;
		num+=7;
		cnt++;
	}
	cout<<cnt+1;
	//cerr << "Time elapsed: " << clock() / 1000 << " ms" << endl;
    return 0;
}

Measured memory_bytes: 3648
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] A = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);

            StringBuilder sb = new StringBuilder();
            sb.AppendLine(ArrayToString(A));

            for (int i = 1; i < n; i++)
            {
                int v = A[i];
                int j = i - 1;

                while (j >= 0 && A[j] > v)
                {
                    A[j + 1] = A[j];
                    j--;
                }

                A[j + 1] = v;

                sb.AppendLine(ArrayToString(A));
            }

            Console.Write(sb);
        }

        static string ArrayToString(int[] a)
        {
            string ret = a[0].ToString();
            
            for (int i = 1; i < a.Length; i++)
            {
                ret += " " + a[i];
            }

            return ret;
        }
    }
}

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

int C[1001][1001];
string N1, N2;

int lcs()
{
	int m = N1.size();
	int n = N2.size();
	int maxl = 0;

	N1 = " " + N1;
	N2 = " " + N2;

	for (int i = 1; i <= m; i++)
		C[i][0] = 0;
	for (int i = 1; i <= n; i++)
		C[0][i] = 0;

	for (int i = 1; i <= m; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			if (N1[i] == N2[j])
				C[i][j] = C[i - 1][j - 1] + 1;
			else
				C[i][j] = max(C[i - 1][j], C[i][j - 1]);

			maxl = max(maxl, C[i][j]);
		}
	}

	return maxl;
}

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

	int q;

	cin >> q;
	for (int i = 0; i < q; i++)
	{
		cin >> N1 >> N2;
		cout << lcs() << endl;
	}
		
	return 0;                                                                            
}


Measured memory_bytes: 7056
x=int(input())
if x==0:
    print(0)
else:
    s=[]
    while x:
        if x>0:
            t=0
            d=0
            while t<x:
                t += 4**d
                d += 1
            s.append(d*2-1)
            x -= 4**(d-1)
        elif x<0:
            t=0
            d=0
            while t>x:
                t -= 2*(4**d)
                d += 1
            s.append(d*2)
            x += 2*4**(d-1)
    s2 = [0]*max(s)
    for i in s:
        s2[i-1] = 1
    print("".join([str(i) for i in s2[::-1]]))

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

#define all(a) a.begin(), a.end()
#define allr(a) a.rbegin(), a.rend()
#define rev(v) reverse(v.begin(), v.end());
#define io() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); srand(time(NULL));
#define check cout<<"?\n";
 
using namespace std;

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

signed main(){
    io();
    double n; cin >> n;
    double x = floor((n + 1)/2);
    cout << fixed << setprecision(9);
    cout << x/n << '\n';
    return 0;
}

Measured memory_bytes: 3784
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = s, i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = s, i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = s; i < (n); ++i)
#define VFORS(i, s, n) for(int i = s; i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = s, i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = s, i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define SZ(x) ((int)(x).size())
#define PB push_back
#define MP make_pair
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end());

using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
using VD = vector<double>;

const int MOD = 1000000007;
const int INF = 1000000000;

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

int main(){
    int a, b; cin >> a >> b;
    cout << ((a*b)%2 ? "Yes\n" : "No\n");
    return 0;
}


Measured memory_bytes: 256
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        c: char
    };
    let v = vec!['a', 'i', 'u', 'e', 'o'];
    println!("{}", if v.contains(&c) { "vowel" } else { "consonant" });
}


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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void solve() {
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    ll ok = INF;
    ll ng = 0;
    auto f = [&](ll x) {
        ll r = K;
        rep(i, N) {
            ll a = A[i];
            if (a > x) {
                r -= a / x;
            }
        }
        return r >= 0;
    };

    while (ok - ng > 1) {
        ll mid = (ok + ng) / 2;
        if (f(mid)) {
            ok = mid;
        } else {
            ng = mid;
        }
    }
    cout << ok << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    return 0;
}


Measured memory_bytes: 4772
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long int n;
    cin>>n;
    long int stu[n];
    long int seq[n];
    for(int x = 1; x <= n; x++)
    {
        cin>>stu[x-1];
        int z = stu[x-1];
        seq[z-1] = x;
    }
    for(int y = 0; y < n; y++)
    {
        cout<<seq[y]<<" ";
    }
    return 0;
}


Measured memory_bytes: 2432
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int a = saori.saori_hayami();
		int b = saori.saori_hayami();
		int c = saori.saori_hayami();
		int x = saori.saori_hayami();
		int y = saori.saori_hayami();
		int ans = 0;
		boolean flg = true;
		while(flg){
			if(x > 0 && y > 0){
				if(a + b > 2*c){
					ans = ans + (c*2);
					x--;
					y--;
				} else {
					ans = ans + a + b;
					x--;
					y--;
				}
			} else {
				if(x == 0){
					if(b > 2*c){
						ans = ans + (2*c);
						y--;
					} else {
						ans += b;
						y--;
					}
				} else if(y == 0){
					if(a > 2*c){
						ans = ans + (2*c);
						x--;
					} else {
						ans += a;
						x--;
					}
				}
			}
			if(x == 0 && y == 0){
				flg = false;
				break;
			}
		}
		System.out.println(ans);
		
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 21588
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	int n;
	cin >> n;
	int cnt_odd = 0;
	for(int i = 0; i < n; i++){
		unsigned int a;
		cin >> a;
		if(a % 2 == 1) cnt_odd++;
	}

	if(cnt_odd % 2 == 1) cout << "NO" << endl;
	else cout << "YES" << endl;

	return 0;
}

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

int main() {
  int N;
  int t[100010], x[100010], y[100010];
  cin >> N;
  t[0] = x[0] = y[0] = 0;
  for (int i = 1; i <= N; ++i) cin >> t[i] >> x[i] >> y[i];

  bool flag = true;
  for (int i = 1; i <= N; ++i) {
    int dist = abs(x[i] - x[i-1]) + abs(y[i] - y[i-1]);
    int dt = t[i] - t[i-1];
    if (dist > dt) flag = false;
    if (dist % 2 != dt % 2) flag = false;
    if (!flag) break;
  }
  if (flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}


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

int main() {
  ll n;
  cin>>n;
  map<string,ll> bun;
  rep(i,n){
    string S;
    cin>>S;
    sort(S.begin(),S.end());
    bun[S]++;
  }
  ll ans=0;
  for(auto x:bun){
    if(x.second!=1){
      ans+=x.second*(x.second-1)/2;
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 11136
import math
n=int(input())

def is_prime(x):
    if x == 1: return False
    for i in range(2,int(math.sqrt(x))+1):
        if x%i==0:
            return False
    return True

c=0
for i in range(n):
    m=int(input())
    if is_prime(m) is True:
        c+=1
    
print(c)


Measured memory_bytes: 5672
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;

int gcd(int x, int y) {
    if (x < y) swap(x, y);
    if (y == 0) return x;
    return gcd(x % y, y);
}

int lcm(int x, int y) {
    return (x * y) / gcd(x, y);
}

int main() {
    int k;
    cin >> k;
    int sum = 0;
    for (int i = 1; i <= k; i++) {
        for (int j = 1; j <= k; j++) {
            for (int l = 1; l <= k; l++) {
                int gcd1 = gcd(i, j);
                int gcd2 = gcd(gcd1, l);
                sum += gcd2;
            }
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 3636
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
L = [0] * 100001
for i in A:
    L[i] += 1
Q = int(input())
for i in range(Q):
    B, C = map(int, input().split())
    S += (C - B) * L[B]
    L[C] += L[B]
    L[B] = 0
    print(S)

Measured memory_bytes: 20684
#include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<numeric>
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; }
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};

//エラトステネスの篩
bool isPrime[ (int)1e5 + 1 ];
vector<int> P;
void Eratosthenes( const int N )
{
    for( int i = 2; i <= N; i++ )
    {
        isPrime[ i ] = true;//初期化
    }
    
    isPrime[0] = isPrime[1] = false;

    for( int i = 2; i*i <= N; i++ )
    {
        if( isPrime[ i ] )
        {
            for( int j = 2 * i; j <= N; j += i )
            {
                isPrime[ j ] = false;
            }
            P.emplace_back( i );
        }
    }
}

int cumsum[(int)1e5+1] = {};

int main()
{
    Eratosthenes((int)1e5);
    cumsum[0] = 0;
    for (int i=1; i<(int)1e5+1; ++i)
    {
        if(i%2==0)
        {
            cumsum[i] = cumsum[i-1];
            continue;
        }

        if(isPrime[i] && isPrime[(int)(i+1)/2])
        {
            cumsum[i] = cumsum[i-1] + 1;
        }
        else
        {
            cumsum[i] = cumsum[i-1];
        }
        
    }
    int q,l,r;
    cin >> q;
    int ans[q];
    for (int i=0; i<q; ++i)
    {
        cin >> l >> r;
        ans[i] = cumsum[r] - cumsum[l-1];
    }
    rep(i,q)
    {
        cout << ans[i] << endl;
    }

    // for (int i=0; i<1000; ++i)
    // {
    //     cout << "i= " << i << " : "<< cumsum[i] << endl;
    // }
    return 0;
}

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

int main () {
  int N;
  cin >> N;
  vector<int> x(N);
  for (int i=0; i<N; i++) {
    cin >> x[i];
  }
  sort(x.begin(), x.end());
  reverse(x.begin(), x.end());
  int Alice = 0;
  int Bob = 0;
  for (int i=0; i<N; i++) {
    if (i%2 ==0) {
      Alice += x[i];
    }
    else if (i%2 ==1) {
      Bob += x[i];
    }
  }
  cout << Alice - Bob << endl;
}

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

int b;
string a;
int main()
{
	int i;
	cin >> a;
	b=a.size();
	for (i = 1; i < a.size(); i++) {
		if (a[i] != a[i - 1]) b = min(b, max(i, (int)a.size() - i));
	}
	cout << b;
    return 0;
}

Measured memory_bytes: 512
def myAnswer(O:list,E:list) -> str:
   ans = ""
   for n in range(len(E)):
      ans+=O.pop(0)+E.pop(0)
   return ans if(O == []) else ans+O.pop(0)

def modelAnswer():
   tmp=1
def main():
   O = list(input())
   E = list(input())
   print(myAnswer(O,E))

if __name__ == '__main__':
   main()

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

char D[1000];
int L[1000];
int N, ans;
int check[1000];
typedef pair<int, int> P;

int main() {
	cin >> N;

	vector<P> ord;
	for(int i = 0; i < N; i++) {
		cin >> D[i] >> L[i];
		if(D[i] == 'y') ord.push_back({ L[i], i });
	}
	sort(ord.begin(), ord.end());

	int ans = 0;
	for(auto p : ord) {
		int l = p.first, id = p.second;
		if(check[id]) continue;
		ans++;
		for(int i = id + 1; i < N; i++) {
			if(check[i]) continue;
			if(D[i] == 'y') {
				check[i] = 1;
			}
			else {
				if(l <= L[i]) break;
			}
		}
		for(int i = id - 1; i >= 0; i--) {
			if(check[i]) continue;
			if(D[i] == 'y') {
				check[i] = 1;
			}
			else {
				if(l <= L[i]) break;
			}
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 3120
n, m = gets.chomp.split(" ").map(&:to_i)
seiyaku = []
m.times do 
	seiyaku.push(gets.chomp.split(" ").map(&:to_i))
	seiyaku[-1][0] -= 1
end

start = n == 1 ? 0 : 10 ** (n-1)
(start..(10 ** n)).each do |i|
	flag = true
	seiyaku.each do |s|
		if i.to_s()[s[0]] != s[1].to_s then
			flag = false
			break
		end
	end
	if flag then
		puts i
		exit
	end
end
puts "-1"

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

int main() {
  int NowRating = 0;
  double NextRating = 0.0, Average = 0.0;
  cin >> NowRating;
  cin >> Average;
  NextRating = 2 * Average - NowRating;
  cout << NextRating << endl;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }


int
main(void){  
  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;
    
  int raw, col;

  raw = tx - sx;
  col = ty - sy;

  //cout << raw << " " << col << endl;

  REP(i, col){
    cout << "U";
  }
  REP(i, raw){
    cout << "R";
  }
  REP(i, col){
    cout << "D";
  }
  REP(i, raw){
    cout << "L";
  }

  //2syu-me
  cout << "L";  
  REP(i, col+1){
    cout << "U";
  }
  REP(i, raw+1){
    cout << "R";
  }
  cout << "D";
  cout << "R";
  REP(i, col+1){
    cout << "D";
  }
  REP(i, raw+1){
    cout << "L";
  }
  cout << "U" << endl;
  
  return 0;
}


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

int main(){
 string str;cin>>str;
 vector<string> vs(4);
 vector<int> vi(4);
 for(int i=0;i<str.size();i++){
   vs[i] = str[i];
   vi[i] = atoi(vs[i].c_str());
 }
 if(vi[0]+vi[1]+vi[2]+vi[3]==7) printf("%d+%d+%d+%d=7",vi[0],vi[1],vi[2],vi[3]);
 else if(vi[0]+vi[1]+vi[2]-vi[3]==7) printf("%d+%d+%d-%d=7",vi[0],vi[1],vi[2],vi[3]);
 else if(vi[0]+vi[1]-vi[2]-vi[3]==7) printf("%d+%d-%d-%d=7",vi[0],vi[1],vi[2],vi[3]);
 else if(vi[0]-vi[1]-vi[2]-vi[3]==7) printf("%d-%d-%d-%d=7",vi[0],vi[1],vi[2],vi[3]);
 else if(vi[0]+vi[1]-vi[2]+vi[3]==7) printf("%d+%d-%d+%d=7",vi[0],vi[1],vi[2],vi[3]);
 else if(vi[0]-vi[1]-vi[2]+vi[3]==7) printf("%d-%d-%d+%d=7",vi[0],vi[1],vi[2],vi[3]);
 else if(vi[0]-vi[1]+vi[2]+vi[3]==7) printf("%d-%d+%d+%d=7",vi[0],vi[1],vi[2],vi[3]);
 else if(vi[0]-vi[1]+vi[2]-vi[3]==7) printf("%d-%d+%d-%d=7",vi[0],vi[1],vi[2],vi[3]);
}

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

int p[100010];
int n, k = 0;

struct node
{
	int x,y,id;
} nodes[100010];

struct edge
{
	int u,v,cost;
} mst[100010];

int Union(int u)
{
	if (p[u] == u) {return p[u];}
    return p[u] = Union(p[u]);
}

bool cmp1(node &a, node &b)
{
	return a.x < b.x;
}

bool cmp2(node &a, node &b)
{
	return a.y < b.y;
}
bool cmp3(edge &a, edge &b)
{
	return a.cost < b.cost;
}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

	cin >> n;
	for(int i=1;i<=n;i++)
	{
		cin >> nodes[i].x >> nodes[i].y;
		nodes[i].id=i;
	}
	sort(nodes+1,nodes+1+n,cmp1);
	for(int i=1;i<=n-1;i++)
	{
		mst[k].u=nodes[i].id;
		mst[k].v=nodes[i+1].id;
		mst[k].cost=abs(nodes[i].x-nodes[i+1].x);
		k++;
	}
	sort(nodes+1,nodes+1+n,cmp2);
	for(int i=1;i<=n-1;i++)
	{
		mst[k].u=nodes[i].id;
		mst[k].v=nodes[i+1].id;
		mst[k].cost=abs(nodes[i].y-nodes[i+1].y);
		k++;
	}
	sort(mst,mst+k,cmp3);
	for(int i=0;i<=n;i++)
	{
		p[i]=i;
	}
	int ans = 0;
	for(int i=0;i<k;i++)
	{
		int a=mst[i].u,b=mst[i].v;
		a=Union(a);
		b=Union(b);
		if(a!=b)
		{
			ans+=mst[i].cost;
			p[a]=b;
		}
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 5760
import java.util.Scanner;

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

	String x = scan.next();
	String y = scan.next();

	if(x.charAt(0) > y.charAt(0)){
	    System.out.println('>');
	}else if(x.charAt(0) < y.charAt(0)){
	    System.out.println('<');
	}else{
	    System.out.println('=');
	}
    }
}


Measured memory_bytes: 21844
num=list(map(int, input().split()))
string=input()
countl=0
countr=num[1]
i=0
j=num[0]
L=[]
R=[]
#rR=[]
while countl!=num[1]:
  if string[i]=='o':
    L.append(i+1)
    countl=countl+1
    i=i+num[2]+1
  else:
    i=i+1
  if i>=num[0]:
    break
while countr!=0:
  if string[j-1]=='o':
    R.append(j)
    countr=countr-1
    j=j-num[2]-1
  else:
    j=j-1
  if j<0:
    break
#print(R)
R.reverse()
#print(L)
#print(rR)
for k in range(num[1]):
  if L[k]==R[k]:
    print(L[k])
  

Measured memory_bytes: 20620
#include <bits/stdc++.h>
#include <map>
#include <algorithm>
#include <vector>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <chrono>
#include <thread>
#include <string.h>
 
#define rep(i,n)    for(ll i=0;i<n;i++)
#define repu(i,k,n) for(ll i=k;i<=n;i++)
#define repd(i,k,n) for(ll i=k;i>=n;i--)
#define se second
#define fi first
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define endl "\n"
#define INF (ll)ll_MAX
 
typedef long long ll;
typedef long double ld;
typedef std::pair<ll, ll> pii;
typedef std::vector< ll > vi;
typedef std::vector< pii > vii;
typedef std::vector< ll > vll;
typedef std::vector< std::pair < pii, ll > > vpp;
 
const ll N = 3*1e5 +5 ;
const long long MOD = 1000000007;
const long long MOD2 = 998244353;
const long long inf = 1e18;
 
using namespace std;

// ll g[200000], ig[200000];




void solve()
{	

    ll d,t,s;

    cin>>d>>t>>s;

    if(s*t<d){
        cout<<"No";
    }
    else{
        cout<<"Yes";
    }




}

int main() {


    // #ifndef ONLINE_JUDGE
    //     // for getting input from input.txt
    //     freopen("input.txt", "r", stdin);
    //     // for writing output to output.txt
    //     freopen("output.txt", "w", stdout);
    // #endif


    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    ll t = 1;
    // cin>>t;
    ll ctr=0;
    while(t--)
    {   
        ctr++;
        // cout<<"Case #"<<ctr<<": ";
        solve();    
    } 
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
 
}

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

using namespace std;
#define rep(i, n) for(int i = 0; i < signed(n); i++)
#define REP(i, s, n) for(int i = (s); i < signed(n); i++)
#define rrep(i, n) for(int i = signed(n) - 1; i >= 0; i--)
#define all(co) co.begin(), co.end()
typedef pair<int, int> P;
typedef long long LL;
typedef pair<P, int> PI;
typedef pair<int, P> IP;
const int INF = 1 << 29;
const LL LINF = 1ll << 62ll;

struct edge{ int from, to, cost; };

int dr[] = { -1, 0, 1, 0 };
int dc[] = { 0, 1, 0, -1 };

template<typename T = int>
vector<vector<T>> vvector(int h, int w, T def = T()){ return move(vector<vector<T>>(h, vector<T>(w, def))); }
class range {
private: struct I{ int x; int operator*(){ return x; }bool operator!=(I& lhs){ return x < lhs.x; }void operator++(){ ++x; } }; I i, n;
public:range(int n) :i({ 0 }), n({ n }){}range(int i, int n) :i({ i }), n({ n }){}I& begin(){ return i; }I& end(){ return n; }
};

const int MOD = 10000;
signed main()
{
	int M, N;
	while (cin >> M >> N && M)
	{
		vector<int> manju(M + 1);
		rep(i, M) cin >> manju[i + 1];
		manju[0] = INF;
		sort(all(manju));
		reverse(all(manju));
		manju[0] = 0;
		rep(i, M) manju[i + 1] += manju[i];

		auto dp = vvector(N + 1, M + 1, INF);//idx, empty
		dp[0][0] = 0;
		rep(i, N)
		{
			int c, e; cin >> c >> e;
			rep(j, M + 1)
			{
				int nj = min(M, j + c);
				dp[i + 1][nj] = min(dp[i + 1][nj], dp[i][j] + e);
				dp[i + 1][j] = min(dp[i + 1][j], dp[i][j]);
			}
		}

		int ans = 0;
		rep(i, M + 1)
		{
			ans = max(ans, manju[i] - dp[N][i]);
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 20800
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define n_p(v) next_permutation(v.begin(),v.end())
#define to_ll(b) stoll(b)
#define MOD 1000000007
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; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	int n; cin>>n;
	int amax=-1,amin=MOD;;
	rep(i,0,n){
		int a; cin>>a;
		amax=max(amax,a);
		amin=min(amin,a);
	}
	cout<<amax-amin;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
int n;
int a[114], b[114], h[114];
int mx;
 
int main() {
bool setup = false, succ = true;  
int i,j;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i] >> b[i] >> h[i];
        if (h[i]) mx = i;
    }
    
    for (i = 0; i <= 100; ++i) {
        for (j = 0; j <= 100; ++j) {
        	setup = false;
			succ = true; 
            a[0] = i, b[0] = j;
            h[0] = abs(i - a[mx]) + abs(j - b[mx]) + h[mx];
            for (int k = 1; k <= n && succ; ++k) {
                if (h[k] != max(h[0] - abs(i - a[k]) - abs(j - b[k]), 0)) {
                    succ = false;
                }                   
            }
            if (succ) {
                cout<<i<<" "<<j<<" "<<h[0];
                return 0;
            } 
        }
    }
}

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

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> vec_a(n);

	int total = 0;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		vec_a.at(i) = a;
		total += a;
	}

	int res = 0;
	for (int i = 0; i < n; i++) {
		if ((double)vec_a.at(i) >= (double)total / (4 * m)) {
			res += 1;
		}
	}

	if (res >= m) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int N, M;
	cin >> N >> M;

	vector<vector<Int>> G(3 * N);
	Int u, v;
	for (Int i = 0; i < M; i++) {
		cin >> u >> v;
		u--;
		v--;
		G[3 * u].push_back(3 * v + 1);
		G[3 * u+1].push_back(3 * v + 2);
		G[3 * u+2].push_back(3 * v);
	}

	Int s, t;
	cin >> s >> t;
	s--;
	t--;
	//BFS
	vector<Int> dist(3 * N, -1);
	queue<Int> que;
	dist[3*s] = 0;
	que.push(3*s);

	while (!que.empty()) {
		Int v = que.front();
		que.pop();

		for (const auto& nv : G[v]) {
			if (dist[nv]!=-1) {
				continue;
			}

			dist[nv] = dist[v] + 1;
			que.push(nv);
		}
	}

	if (dist[3*t]==-1) {
		cout << -1 << "\n";
	}
	else {
		cout << dist[3*t]/3 << "\n";
	}
}


Measured memory_bytes: 19072
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=305,INF=1<<30;
ll dp[MAX][MAX][MAX];

int main(){
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N,M;cin>>N>>M;
    dp[0][1][0]=1;
    
    for(int i=0;i<M;i++){
        for(int j=1;j<=N;j++){
            for(int k=0;k<=N-j;k++){
                dp[i+1][j+k][0]+=dp[i][j][k]*j;
                dp[i+1][j+k][0]%=mod;
                
                dp[i+1][j][k]+=dp[i][j][k]*k;
                dp[i+1][j][k]%=mod;
                
                dp[i+1][j][k+1]+=dp[i][j][k]*(N-j-k);
                dp[i+1][j][k+1]%=mod;
            }
        }
    }
    
    cout<<dp[M][N][0]<<endl;
    
}


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

int main(){
  long long n;
  cin >> n;
  long long r=0, g=0, b=0;
  long long ans = 1;
  for(long long i=0; i<n; i++){
    long long num;
    cin >> num;
    long long tmp = 0;
    char which;
    if(b == num){
      tmp++;
      which = 'b';
    }
    if(g == num){
      tmp++;
      which = 'g';
    }
    if(r == num){
      tmp++;
      which = 'r';
    }
    ans *= tmp;
    ans %= 1000000007;
    if(which == 'r') r++;
    else if(which == 'g') g++;
    else b++;
  }
  cout << ans << endl;
  return 0;
}
    


Measured memory_bytes: 3636