akhauriyash/Code-Regression huggingface dataset:
"""
C - ID
"""
import numpy as np

n, m = map(int, input().split())

# [index pref year rank]
p_y = []
list_n = 0
for n in range(m):
    p, y = map(int, input().split())
    p_y.append([list_n, p, y, 0])
    list_n += 1

p_y_np = np.array(p_y, dtype=np.int)
#print(p_y_np)

# 一意なリストには順位が
pref_set = list(set(list(p_y_np[:, 1])))

# 県の順位表
pref_count = {}
for part in pref_set:
    pref_count[part] = 1

#print(pref_count)

year_sort = np.argsort(p_y_np[:, 2])

for p_y_row in p_y_np[year_sort]:
    #print(p_y_row)
    pref = p_y_row[1]
    index = p_y_row[0]

    p_y_np[index, 3] = pref_count[pref]
    pref_count[pref] += 1

#print(p_y_np)

for part in p_y_np:
    print("%06d%06d" % (part[1], part[3]))

Measured memory_bytes: 55868
using System;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var x = int.Parse(Console.ReadLine());
            var rate = 0;
            if (400 <= x && x <= 599)
            {
                rate = 8;
            }
            else if (600 <= x && x <= 799)
            {
                rate = 7;
            }
            else if (800 <= x && x <= 999)
            {
                rate = 6;
            }
            else if (1000 <= x && x <= 1199)
            {
                rate = 5;
            }
            else if (1200 <= x && x <= 1399)
            {
                rate = 4;
            }
            else if (1400 <= x && x <= 1599)
            {
                rate = 3;
            }
            else if (1600 <= x && x <= 1799)
            {
                rate = 2;
            }
            else if (1800 <= x && x <= 1999)
            {
                rate = 1;
            }
            Console.WriteLine(rate);
        }
    }
}


Measured memory_bytes: 17632
a,b=map(int, input().split())  
import math
x=math.floor(a/0.08)
y=math.floor(b/0.1)
minxy=min(x,y)
for i in range(minxy, minxy+100):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        exit()
print(-1)

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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#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 FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

bool conv(char a){
 return a == 'H';  
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  ll w,a,b;
  cin >> w >> a >> b;
  if(a+w < b)
    cout << b-(a+w) << endl;
  else if(b+w < a)
    cout << a-(b+w) << endl;
  else
    cout << 0 << endl;
  
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>
#include <bitset>
 
using namespace std;
int switchMask[10];
int p[10];
void init(){
	for(int i = 0 ; i < 10; i++){
		switchMask[i] = 0x00;
	}
}

int bitCount(int bits) {
    int cnt = 0;
    for(int mask = 1; mask != 0; mask<<=1) {
        if( (bits & mask) != 0 )
            ++cnt;
    }
    return cnt;
}

int main()
{
	init();
	int n,m;
	cin>>n>>m;
	for(int i = 0; i < m; i++){
		int k;
		cin >>k;
		for(int j = 0; j < k; j++){
			int num;
			cin>>num;
			num--;
			switchMask[i] |= (1 << num);
		}
	}
	for(int i = 0; i < m; i++){
		cin>>p[i];
	}
	/*for(int i = 0; i < m; i++){
		cout<<bitset<8>(switchMask[i])<<endl;
	}*/
	int count = 0;
	for(int bit = 0; bit < (1<<n); ++bit){
		bool canMake = true;
		for(int i = 0; i < m; i++){
			if(  bitCount( bit & switchMask[i]) % 2 != p[i]){
				canMake = false;
				break;
			} 
		}
		if(canMake == true) count++;
	}
	cout<<count<<endl;
	return 0;
}

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

int main(void) {
    int N;cin>>N;
    vector<char> S(N);
    for (int i = 0; i < N; i++) cin >> S[i];
    if (count(S.begin(), S.end(), 'Y') > 0) cout << "Four" << endl;
    else cout << "Three" << endl;
    return 0;
}

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

#include <limits.h>

using namespace std;

typedef long long ll;

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

const int INF = INT_MAX / 2;

vector<int> dp1;
vector<int> dp2;

int solve(int pos, const int orig_carry, const string S, const int slen) {
    if (orig_carry) {
        if (dp1[pos] != INF) {
            return dp1[pos];
        }
    } else {
        if (dp2[pos] != INF) {
            return dp2[pos];
        }
    }

    int acc = 0;

    if (pos < slen) {
        int d = S[pos] - '0';
        int carry;
        d += orig_carry;
        if (d == 0) {
            carry = 0;
            acc += solve(pos + 1, carry, S, slen);
        } else if (d < 5) {
            acc += d;
            carry = 0;
            acc += solve(pos + 1, carry, S, slen);
        } else if (d == 5) {
            acc += d;
            acc += min(solve(pos + 1, 0, S, slen), solve(pos + 1, 1, S, slen));
        } else {
            acc += 10 - d;
            carry = 1;
            acc += solve(pos + 1, carry, S, slen);
        }
    } else {
        acc += orig_carry;
    }

    if (orig_carry) {
        dp1[pos] = acc;
    } else {
        dp2[pos] = acc;
    }

    return acc;
}

int main(void) {
    string S;
    cin >> S;
    int slen = (int) S.size();

    reverse(S.begin(), S.end());

    // int acc = 0;
    // int carry = 0;
    // for (int i = 0; i < slen; i++) {
    //     int d = S[i] - '0';
    //     d += carry;
    //     if (d == 0) {
    //         carry = 0;
    //     } else if (d <= 5) {
    //         acc += d;
    //         carry = 0;
    //     } else {
    //         acc += 10 - d;
    //         carry = 1;
    //     }
    // }
    // if (carry) {
    //     acc += carry;
    // }
    //
    // cout << acc << endl;

    dp1.resize(slen + 1, INF);
    dp2.resize(slen + 1, INF);

    cout << solve(0, 0, S, slen) << endl;

    return 0;
}


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

typedef long long ll;

ll MOD = 1e9 + 7, fac[1000005], v[1000005];

ll modRec(ll a, ll b) {
	if (b == 0)return 1;
	if (b % 2 == 0)return modRec((a * a) % MOD, b / 2);
	return ((a % MOD) * (modRec((a * a) % MOD, b / 2))) % MOD;
}

int main() {
	fac[0] = 1, v[0] = 1;
	for (int i = 1; i <= 1000000; i++) {
		fac[i] = (i * fac[i - 1]) % MOD;
		v[i] = modRec(fac[i], MOD - 2);
	}
	ll h, w, a, b, ans = 0; cin >> h >> w >> a >> b;
	for (ll i = b; i < w; i++) {
		ll p = i, q = h - a - 1, r = w - i - 1, s = a - 1;
		ll x = (((fac[p + q] * v[p]) % MOD) * v[q]) % MOD;
		x *= (((fac[r + s] * v[r]) % MOD) * v[s]) % MOD;
		ans = (ans + x) % MOD;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 16000
import java.util.*;
public class Main {
	public static void main(String[] args){
       Scanner sc = new Scanner(System.in);
	  int N = sc.nextInt();
      int[] H = new int[N];
      for(int i=0;i<N;i++){
        H[i]= sc.nextInt();
      }
      int max =0;
      int count = 0;
      for(int i=0;i<N-1;i++){
        if(H[i]>=H[i+1]){
          count++;
        }else{
          count =0;
        }
        max = Math.max(max,count);
      }
       System.out.println(max);
    }
}

Measured memory_bytes: 58432
using System;

public class hello
{
    public static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = int.Parse(line[0]);
        var b = int.Parse(line[1]);
        Console.WriteLine(gcd(a, b));
    }
    public static int gcd(int a, int b)
    {
        if (a < b) return gcd(b, a);
        while (b != 0)
        {
            var w = a % b;
            a = b;
            b = w;
        }
        return a;
    }
}


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

#define vi vector<int>
#define ii pair<int,int>
#define vii vector<pair<int,int>>

typedef long long ll;
typedef unsigned long long ull;

#define pb push_back
#define mp make_pair
#define fi first
#define se second

using namespace std;

int gcd (int a, int b) {
    if (a < b) swap(a,b);
    if (b == 0) return a;
    else return gcd(b, a%b);
}

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

    int N, X, result, x;
    cin >> N >> X;
    for (int i = 0; i < N; i++) {
        cin >> x;
        if (i == 0)
            result = abs(x-X);
        else
            result = gcd(result, abs(x-X));
        X = x;
    }

    cout << result << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define MAX 10000
#define NIL -1

struct Node { int p, l, r; };
struct Node T[MAX];
int n;

/* 先行順巡回 */
void preParse(int u) {
  if ( u == NIL ) return;
  printf(" %d", u);
  preParse(T[u].l);
  preParse(T[u].r);
}

/* 中間順巡回 */
void inParse(int u) {
  if ( u == NIL ) return;
  inParse(T[u].l);
  printf(" %d", u);
  inParse(T[u].r);
}

/* 後行順巡回 */
void postParse(int u) {
  if ( u == NIL ) return;
  postParse(T[u].l);
  postParse(T[u].r);
  printf(" %d", u);
}

int main() {
  int i, v, l, r, root;

  scanf("%d", &n);
  for( i = 0; i < n; i++ )
    T[i].p = NIL;

  for ( i = 0; i < n; i++ ) {
    scanf("%d %d %d", &v, &l, &r);
    T[v].l = l;
    T[v].r = r;
    if ( l != NIL ) T[l].p = v;
    if ( r != NIL ) T[r].p = v;
  }

  for ( i = 0; i < n; i++ ) if ( T[i].p == NIL ) root = i;

  printf("Preorder\n");
  preParse(root);
  printf("\n");
  printf("Inorder\n");
  inParse(root);
  printf("\n");
  printf("Postorder\n");
  postParse(root);
  printf("\n");

  return 0;
}


Measured memory_bytes: 2752
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;

#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define INF (1 << 29)
#define LLINF (1LL << 60)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

using Pi = pair<int, int>;
using ll = long long;

string to_string(string s) { return s; }

template <class S, class T>
string to_string(pair<S, T> p) {
  return "{" + to_string(p.first) + "," + to_string(p.second) + "}";
}

template <class S>
string to_string(unordered_set<S> s) {
  string ret = "{";
  for (S x : s) ret += to_string(x) + ",";
  return ret + "}";
}

template <class S, class T>
string to_string(map<S, T> m) {
  string ret = "{";
  for (pair<S, T> x : m) ret += to_string(x) + ",";
  return ret + "}";
}

template <class T>
string to_string(vector<T> v) {
  string ret = "{";
  for (int i = 0; i < (int)v.size() - 1; ++i) {
    ret += to_string(v[i]) + ",";
  }
  if (v.size() > 0) {
    ret += to_string(v.back());
  }
  ret += "}";
  return ret;
}

void debug() { cerr << endl; }

template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

void print() { cout << endl; }

template <class Head, class... Tail>
void print(Head head, Tail... tail) {
  cout << to_string(head);
  print(tail...);
}
	int A[500001];

int main() {
  cin.tie(0);
	string S;
	cin>>S;
	S=">"+S+"<";
	int N=S.size()-1;
	FORIN(i,1,N+1){
		if(S[i-1]=='>'&&S[i]=='<'){
			A[i]=0;
			for(int j=i-1;j>0&&S[j]=='>';--j){
				A[j-1]=max(A[j-1],A[j]+1);
			}
			for(int j=i;j<N&&S[j]=='<';++j){
				A[j]=max(A[j],A[j-1]+1);
			}
		}//debug(A);
	}//debug("Ok,",A);
	print(accumulate(A,A+N,0LL));
  return 0;
}

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

int main(){
  int N;
  cin>>N;
  vector<ll> a(N);
  vector<int> b(N);
  rep(i,N){
  	cin>>a.at(i);
    while(a.at(i)%2==0){
      a.at(i)=a.at(i)/2;
      b.at(i)++;
    }
  }
  sort(b.begin(),b.end());
  cout<<b[0]<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int A,B,C,D;
    cin >> A >> B >> C >> D;
    int L=A+B,R=C+D;
    if(L>R){
        cout << "Left" << endl;
    }
    else if(L<R){
        cout << "Right"<< endl;
    }
    else  {
        cout <<"Balanced"<< endl;
    }
}

Measured memory_bytes: 256
def list_count(my_list):
    dic={} #辞書型の宣言
    for num in my_list:
        if num in dic: #もしnumがkeyとして辞書にあれば
            dic[num]+=1 #valueに+1
        else: #なければ
            dic[num]=1 #dicにnumというkeyを追加し、対応するvalueを1とする
    return dic
n=int(input())
a=list(map(int,input().split()))
b=[0]*(3*n)
for i in range(3):
    for j in range(n):
        b[i*n+j]=a[j]+i-1
dict=list_count(b)
print(max(dict.values()))

Measured memory_bytes: 29692
#include <bits/stdc++.h>
#include <stdlib.h>
#include <string>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define pi 3.141592653589793
int nx[4]={0,-1,0,1};
int ny[4]={-1,0,1,0};

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    ll r=a%b;
    while(r!=0){
        a=b;
        b=r;
        r=a%b;
    }
    return b;
}

int main (){
    ll n;
    ll ans=0;
    cin >> n;
    vector<ll>num(n,0);
    vector<ll>A(n);
    rep(i,n){
        ll a;
        cin >> a;
        A[i]=a;
        num[a-1]++;
    }
    rep(i,n) ans+=num[i]*(num[i]-1)/2;
    rep(i,n){
        ll x=num[A[i]-1];
        cout << ans-x*(x-1)/2+(x-1)*(x-2)/2 <<endl;
    }
    return 0;


}

Measured memory_bytes: 5760
use std::io;
use std::collections::BTreeMap;
use io_ext::Reader;

fn main() {
    let stdin = io::stdin();
    let mut r = Reader::new(stdin.lock());
    let n: u64 = r.read_line().parse().unwrap();
    println!("{}", n * n);
}

/// Extension of io module.
pub mod io_ext {
    use std::io::BufRead;

    pub struct Reader<R> {
        buf: String,
        inner: R,
    }

    impl<R> Reader<R> {
        #[inline]
        pub fn new(inner: R) -> Self {
            Reader { buf: String::new(), inner: inner }
        }

        #[inline]
        pub fn into_inner(self) -> R {
            self.inner
        }
    }

    impl<R: BufRead> Reader<R> {
        #[allow(deprecated)]
        #[inline]
        pub fn read_line(&mut self) -> &str {
            self.buf.clear();
            self.inner.read_line(&mut self.buf).unwrap_or_else(|e| panic!("{}", e));
            self.buf.trim_right()
        }
    }
}

/// Module supporting to parse strings.
pub mod parse {
    use std::str::FromStr;
    use std::borrow::Borrow;

    pub trait ParseNext: Iterator {
        fn parse_next<F: FromStr>(&mut self) -> F;
    }

    impl<'a, S: Borrow<str>, I: Iterator<Item=S>> ParseNext for I {
        fn parse_next<F: FromStr>(&mut self) -> F {
            if let Some(s) = self.next() {
                match s.borrow().parse() {
                    Ok(x) => x,
                    Err(_) => panic!("provided string cannot be parsed")
                }
            } else {
                panic!("iterator has no next element")
            }
        }
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
#define de(x) cout<<#x<<"="<<x<<endl
#define dd(x) cout<<#x<<"="<<x<<" "
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define repd(i,a,b) for(int i=a;i>=(b);--i)
#define repp(i,a,b,t) for(int i=a;i<(b);i+=t)
#define mt(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define mp(u,v) make_pair(u,v)
#define sz(a) (int)a.size()
#define pb push_back
#define PI acos(-1.0)
#define qc std::ios::sync_with_stdio(false)
#define all(a) a.begin(),a.end()
using namespace std;
typedef vector<int> vi;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;

const int mod = 1e9+7;
const int N = 606;
const int M = 2e6+6;
const double eps = 1e-6;
const int inf = 0x3f3f3f3f;

bool eq(const db &a, const db &b) { return fabs(a - b) < eps; }
bool ls(const db &a, const db &b) { return a + eps < b; }
bool le(const db &a, const db &b) { return eq(a, b) || ls(a, b); }
ll gcd(ll a,ll b) { return a==0?b:gcd(b%a,a); };
ll lcm(ll a,ll b) { return a/gcd(a,b)*b; }
ll kpow(ll a,ll b) {ll res=1;a%=mod; if(b<0) return 1; for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll read(){
    ll x=0,f=1;char ch=getchar();
    while (ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while (ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
//inv[1]=1;
//for(int i=2;i<=n;i++) inv[i]=(mod-mod/i)*inv[mod%i]%mod;
int n, m;
vi e[N];
db dp[N];
db DP(int x) {
    //de(x);
    rep(i, 1, n + 1) dp[i] = 0;
    repd(u, n-1, 1) {
        int cnt = sz(e[u]);
        if(u == x) {
            cnt--;
            if(!cnt) dp[u] = 1e9;
            else {
                db mx = 0, id = 0;
                for(auto v:e[u]) {
                    if(mx < dp[v] + 1.0) mx = dp[v] + 1.0, id = v;
                }
                for(auto v:e[u]) {
                    if(v == id) continue;
                    dp[u] += ( dp[v] + 1.0 ) / cnt;
                }
            }
        } else {
            for(auto v:e[u]) {
                dp[u] += ( dp[v] + 1.0 ) / cnt;
            }
        }
    }
    //rep(i, 1, n + 1) dd(i),de(dp[i]);
    return dp[1];
}
int main() {
    scanf("%d%d",&n,&m);
    rep(i, 0, m) {
        int u, v; scanf("%d%d",&u,&v);
        e[u].pb(v);
    }
    db ans = DP(0);
    rep(i, 1, n + 1) {
        ans = min(ans, DP(i));
    }
    printf("%.9f\n", ans);
    return 0;
}


Measured memory_bytes: 1408
import java.io.PrintWriter

val pw = PrintWriter(System.out)

fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    val (n, a, b) = listOfInt()
    println((n * a).let { if (it < b) it else b })
}

fun next() = readLine()!!
fun nextInt() = next().toInt()
fun listOfString() = next().split(" ")
fun listOfInt()= listOfString().map { it.toInt() }

fun println(value : Any) {
    pw.println(value)
}

Measured memory_bytes: 37656
class BIT:
    def __init__(self, n):
        self.size = n
        self.tree = [0]*(n+1)
    
    def make(self, list):
        self.tree[1:] = list.copy()
        for i in range(self.size+1):
            j = i + (i & (-i))
            if j < self.size+1:
                self.tree[j] += self.tree[i]
 
    def sum(self, i):
        # [0, i) の要素の総和を返す
        s = 0
        while i>0:
            s += self.tree[i]
            i -= i & -i
        return s
    # 0 index を 1 index に変更  転倒数を求めるなら1を足していく
    def add(self, i, x):
        i += 1
        while i <= self.size:
            self.tree[i] += x
            i += i & -i

    # 総和がx以上になる位置のindex をbinary search
    def bsearch(self,x):
        le = 0
        ri = 1<<(self.size.bit_length()-1)
        while ri > 0:
            if le+ri <= self.size and self.tree[le+ri]<x:
                x -= self.tree[le+ri]
                le += ri
            ri >>= 1
        return le+1

n,q = map(int,input().split())
a = list(map(int,input().split()))
bit = BIT(n)
bit.make(a)
for i in range(q):
    t,l,r = map(int,input().split())
    if t == 0:
        bit.add(l,r)
    else:
        print(bit.sum(r)-bit.sum(l))

Measured memory_bytes: 65116
#include <bits/stdc++.h>
using namespace std;
int sum(int N){
  return N/10000+(N%10000)/1000+(N%1000)/100+(N%100)/10+N%10;
}
int main(){
  int N,A,B,counter=0;
  cin>>N>>A>>B;
  for(int i=1;i<=N;i++){
    if(sum(i)>=A&&sum(i)<=B)
      counter+=i;
  }
  cout<<counter<<endl;
}

Measured memory_bytes: 256
a, b, c, k = [int(x) for x in input().split()]
amari = k % 2

if amari == 0:#k偶数の時の処理
    X = a-b
    if abs(X) > 10**18:
        print('Unfair')
    else:
        print(X)

else:#k奇数の時の処理
    X = b-a
    if abs(X) > 10**18:
        print('Unfair')
    else:
        print(X)

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

int main(){
  int n;
  cin >> n;
  vector<int> rights(1,-1);

  for (int i = 0; i < n; i++)
  {
    int a;
    cin >> a;

    if(a<=rights[rights.size()-1]){
      rights.push_back(a);
      continue;
    }

    for (int j = 0; j < (int)rights.size(); j++)
    {
      if(rights[j] < a){
        rights[j] = a;
        break;
      }
    }
  }

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

Measured memory_bytes: 892
#include <stdio.h>
 
void main(){
    int N,A[80];
    long long G =1000,a = 0;
    scanf("%d",&N);
    for(int i = 0;i < N;i++){
        scanf("%d",A+i);
    }
    for(int i = 0;i < N-1;i++){
        if(A[i] < A[i+1]){
            a = G/A[i];
            G = G%A[i];
            G = G + a*A[i+1];
        }
    }
    printf("%ld\n",G);
}

Measured memory_bytes: 1712
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>

using namespace std;

//#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ; //何もしない文
#endif

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size()) //unsignedのサイズをint型に変換
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;

LL func(LL b, LL n)
{
    if(n < b) return n;
    else return func(b,n/b) + n % b;
}

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    LL n,s; cin >> n >> s;

    if(s == n){
        cout << n+1 << endl;
        return 0;
    }
    if(n == 1){
        if(s == 1){
            cout << 2 << endl;
            return 0;
        }
        else{
            cout << -1 << endl;
            return 0;
        }
    }
    if(n < s){
        cout << -1 << endl;
        return 0;
    }

    for(LL i = 2; i * i <= n; i++)
    {
        if(func(i,n) == s){
            cout << i << endl;
            return 0;
        }
    }
    dump("ok")

    for(LL p = LL(sqrt(n))+1; p >= 1; p--){
        dump(p)
        dump(n-s+p)
        if((n-s+p) % p == 0){
            LL tmpb = (n-s+p) / p;
            if(func(tmpb,n) == s){
                cout << tmpb << endl;
                return 0;
            }
        }
    }
    cout << -1 << endl;
    return 0;


}

Measured memory_bytes: 256
import java.util.*;

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

        int h=S/3600;
        int m=S%3600/60;
        int s=S%60;

        /*分数計算
        　　S/3600%60%60
         */


        System.out.println(h+":"+m+":"+s);
    }
}


Measured memory_bytes: 26288
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <bitset>

#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define debug(x) cerr << #x << ": " << x << endl

using namespace std;

typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;

const ll MOD = 1000000007;
const long double EPS = 1e-10;
const int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int n;
vector<int> ans;
vector<int> b(101);
vector<int> removed(101, 0);

int main() {
    cin >> n;
    for(int i=1;i<=n;++i) {
        cin >> b[i];
    }


    for(int i=1;i<=n;++i) {
        int k = 0;
        for(int j=1;j<=n;++j) {
            if(b[j] && j-removed[j] == b[j]) k = j;
        }
        if(k == 0) {
            cout << -1 << endl;
            return 0;
        }
        ans.push_back(b[k]);
        b[k] = 0;
        for(int j=k;j<=n;++j) ++removed[j];
    }
    reverse(all(ans));

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


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(true){
            int H = scanner.nextInt();
            int W = scanner.nextInt();
            if(H == 0 && W == 0){
                break;
            }
            for(int i=0;i<H;i++){
                for(int j=0;j<W;j++){
                    System.out.print("#");
                }
                System.out.println();
            }
            System.out.println();
        }
        scanner.close();
    }
}


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


int main(int argc, char *argv[]) {
  // C-style stdio functions should not be used.
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  int s; cin >> s;
  vector<bool> t(1000001);
  int i = 1;
  for ( ; !t.at(s); i++) {
    t.at(s) = true;
    if (s % 2 == 0) {
      s = s / 2;
    }else {
      s = s * 3 + 1;
    }
  }
  cout << i << endl;

  return 0;
}



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

int main() {
  long long A, B;
  cin >> A >> B;
  long long ans;
  if (A*B < 0) ans = abs(A+B)+1;
  else {
    if (A < B) ans = B-A;
    else {
      ans = A-B+2;
      if (A*B == 0) ans -= 1;
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
//#define ll long long
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; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll t1,t2,t3;
const ll mod = 1000000007;
const int INF = 1e9;
const ll INFLONG = 1e18;
ll n;
class Point{
public:
    double x;
    double y;
    Point(){

    }
    Point(double x,double y):x(x),y(y){

    }
};
void print(Point p){
  printf("%.10f %.10f\n",p.x,p.y);
}
void dfs(ll depth,Point p1,Point p2){
  if(depth == n){
    return;
  }else{
    vector<Point> vec(3);
    double tm1,tm2;
    vec[0].x = (2 * p1.x + p2.x) / 3;
    vec[0].y = (2 * p1.y + p2.y) / 3;
    tm1 = (p1.x + p2.x) / 2;
    tm2 = (p1.y + p2.y) / 2;
    vec[2].x = (p1.x + 2 * p2.x) / 3;
    vec[2].y = (p1.y + 2 * p2.y) / 3;
    vec[1].x = tm1 - (tm2 - vec[0].y) * sqrt(3);
    vec[1].y = tm2 + (tm1 - vec[0].x) * sqrt(3);
    dfs(depth+1,p1,vec[0]);
    print(vec[0]);
    dfs(depth+1,vec[0],vec[1]);
    print(vec[1]);
    dfs(depth+1,vec[1],vec[2]);
    print(vec[2]);
    dfs(depth+1,vec[2],p2);
  }
}
int main(){
  cin >> n;
  Point p1(0.0,0.0),p2(100.0,0.0);
  print(p1);
  dfs(0,p1,p2);
  print(p2);
}


Measured memory_bytes: 3212
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<cctype>
#include<math.h>
using namespace std;
#define ll long long
int main(){
    ll N;
    cin >> N;
    ll A[N];
    ll i,j;
    ll MOD=1000000007;
    for(i=0;i<N;i++){
        cin >> A[i];
    }
    ll c,t=1,ans=0;
    for(i=0;i<=60;i++){
        c=0;
        for(j=0;j<N;j++){
            c+=A[j]%2;
            A[j]=A[j]/2;
        }
        ans=(ans+c*(N-c)%MOD*t%MOD)%MOD;
        t=t*2%MOD;
    }
    cout << ans <<endl;
    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

constexpr ll mod = 1e9 + 7;

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

/*-------------------------------------------*/

vector<int> e[2][100001];
bool used[2][100001];

pair<int, int> dfs(int a, int b) {
    used[a][b] = true;
    pair<int, int> ret = {0, 0};
    (a == 0 ? ret.first : ret.second)++;
    for(const auto &x : e[a][b]) {
        if(!used[!a][x]) {
            pair<int, int> p = dfs(!a, x);
            ret.first += p.first;
            ret.second += p.second;
        }
    }
    return ret;
}

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

    int n;
    cin >> n;
    rep(i, n) {
        int a, b;
        cin >> a >> b;
        e[0][a].push_back(b);
        e[1][b].push_back(a);
    }

    ll ans = 0;
    FOR(i, 1, 100001) {
        if(!used[0][i]) {
            pair<ll, ll> p = dfs(0, i);
            ans += p.first * p.second;
        }
        if(!used[1][i]) {
            pair<ll, ll> p = dfs(1, i);
            ans += p.first * p.second;
        }
    }

    cout << ans - n << endl;

    return 0;
}

Measured memory_bytes: 14464
#include <bits/stdc++.h>
#define rep( i, n ) for( int ( i ) = 0; ( i ) < ( n ); ( i )++ )
#define repr( i, n ) for( int ( i ) = ( n ); ( i ) >= 0; ( i )-- )
#define FOR( i, m, n ) for( int ( i ) = ( m ); ( i ) < ( n ); ( i )++ )
#define all( x ) ( x ).begin(), ( x ).end()
typedef long long lint;
using namespace std;

int main( void ){
	
	lint n, k, cnt;
	
	cnt = 0;
	
	cin >> n >> k;
	
	FOR(i, 1, n + 1){
		if( i % 2 != 0){
			cnt++;
		}
	}
	
	if( cnt >= k ){
		cout << "YES" <<endl;
	}else{
		cout << "NO" << endl;
	}
	
	return 0;
	
}

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

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> x(m), y(m); 
    for (int i = 0; i < m; i++) {
        cin >> x.at(i) >> y.at(i);
        x.at(i)--;
        y.at(i)--;
    }

    vector<int> cnt(n, 1);
    vector<bool> has_red(n);
    has_red.at(0) = true;
    for (int i = 0; i < m; i++) {
        cnt.at(x.at(i))--;
        cnt.at(y.at(i))++;
        has_red.at(y.at(i)) = has_red.at(y.at(i)) || has_red.at(x.at(i));
        if (cnt.at(x.at(i)) == 0) has_red.at(x.at(i)) = false;
    }

    int ans = 0;
    for (int i = 0; i < n; i++) {
        if (has_red.at(i)) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 1408
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC114A
{
	class Program
	{
		static void Main(string[] args)
		{
            int x = int.Parse(Console.ReadLine());
            if (x == 3 || x == 5 || x == 7)
                Console.WriteLine("YES");
            else
                Console.WriteLine("NO");
            Console.ReadKey();

		}
	}
}


Measured memory_bytes: 11092
import bisect

a, b, q = map(int,input().split())
a_lst,b_lst = [],[]
for _ in range(a):
    a_lst.append(int(input()))
for _ in range(b):
    b_lst.append(int(input()))

for _ in range(q):
    n = int(input())
    a_index = bisect.bisect_left(a_lst, n)
    b_index = bisect.bisect_left(b_lst, n)
    a_next = 10 ** 100 if a_index == a else a_lst[a_index] - n
    b_next = 10 ** 100 if b_index == b else b_lst[b_index] - n
    a_bef = 10 ** 100 if a_index == 0 else n - a_lst[a_index-1]
    b_bef = 10** 100 if b_index == 0 else n - b_lst[b_index-1]
    
    if a_next >= b_next:
        ans = min(a_next, 2*b_next + a_bef)
    else:
        ans = min(b_next, 2*a_next + b_bef)
    if a_bef >= b_bef:
        ans = min(ans, a_bef, 2*b_bef + a_next)
    else:
        ans = min(ans, b_bef, 2*a_bef + b_next)
    print(ans)

Measured memory_bytes: 12080
S = gets.chomp
Qn = gets.to_i
Q = readlines.map(&:split)

revd = false
fs = ''
bs = ''

Q.each do |t,f,c|
  case t
  when '1'   then revd = !revd
  when '2'
    case f
    when '1' then revd ? bs << c : fs << c
    when '2' then revd ? fs << c : bs << c
    end
  end
end

puts revd ? bs.reverse + S.reverse + fs
          : fs.reverse + S + bs

Measured memory_bytes: 47712
#include <bits/stdc++.h>
using namespace std;
const long long mod = pow(10, 9) + 7;
const long long MOD = 998244353;
const long long INF = 1LL << 60;
const int inf = pow(10, 9) + 7;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, int B) {return (A + (B - 1)) / B;}
long long divCeil(int A, long long B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;}

int main()
{
  int N;
  cin >> N;
  
  long long ans = 1;
  for (int i = 1; i <= N; i++)
  {
    ans *= i;
    ans %= mod;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;

int n;
int dp[16][4][4];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int fie[4][4];
int main(void){
	while(1){
		scanf("%d%*c",&n);
		if(n==0)break;
		char a,b,c;
		scanf("%c %c %c",&a,&b,&c);
		memset(dp,0,sizeof(dp));
		dp[0][(a-'A')%3][(a-'A')/3]=1;
		memset(fie,0,sizeof(fie));
		fie[(c-'A')%3][(c-'A')/3]=-1;
		for(int i=0;i<n;i++){
			for(int j=0;j<3;j++){
				for(int k=0;k<3;k++){
					if(dp[i][j][k]>=1){
						for(int l=0;l<4;l++){
							int nx=j+dx[l],ny=k+dy[l];
							if(nx>=0 && nx<3 && ny>=0 && ny<3 && fie[nx][ny]==0){
								dp[i+1][nx][ny]+=dp[i][j][k];
							}else dp[i+1][j][k]+=dp[i][j][k];
						}
					}
				}
			}
		}
		printf("%.10f\n",(double)dp[n][(b-'A')%3][(b-'A')/3]/pow(4,n));
	}
	return 0;
}

Measured memory_bytes: 1108
import java.util.*;


public class Main {
	int n;
	int [] data;
	long ans;
	
	private void dfs(int ind, long sum){
		if(ind == n){
			if(sum%2 == 0)ans++;
			return;
		}
		
		int now = data[ind];
		dfs(ind+1, sum * (now -1));
		dfs(ind+1, sum * now);
		dfs(ind+1, sum * (now+1));
	}
	
	private void doit(){
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			n = sc.nextInt();
			data = new int[n];
			for(int i =0 ; i < n; i++){
				data[i] = sc.nextInt();
			}
			ans = 0;
			dfs(0, 1);
			System.out.println(ans);
		}
	}



	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

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

}


Measured memory_bytes: 23636
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N = int(readline())
  A = [None] + list(map(int, readline().split()))
  ans = []
  choosen = [0] * (N+1)
  
  for n in range(N,0,-1):
    x = sum(choosen[n::n])
    if x %2 == A[n]:
      continue
    choosen[n] += 1
    ans.append(str(n))
  print(len(ans))
  print(' '.join(ans))
  
  
if __name__ == '__main__':
  main()

Measured memory_bytes: 17696
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5+10;
int a[maxn];
int b[maxn];

int main()
{
     int n;
     cin>>n;
     cout<<(n-2)*180<<endl;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i,a,b) for(ll i=(a);i<(b);i++)
#define all(a)  (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)
//#define INF (1LL<<59)

//verified AOJ GRL_1
#define MAX_V 100000
struct edge{int to,cost;};

void dijkstra(int s, vector<int> &d, vector<edge> G[MAX_V]){
    priority_queue< pii,vector<pii>,greater<pii> > que;
    rep( i,d.size() )d[i]=INF;
    d[s] = 0;
    que.push( pii(0,s) );
    
    while( que.size() ){
        pii p=que.top();
        que.pop();
        
        int v=p.second;
        if(d[v]<p.first)continue;
        
        rep(i,G[v].size()){
            edge e=G[v][i];
            if(d[e.to]>d[v]+e.cost){
                d[e.to]=d[v]+e.cost;
                que.push(pii(d[e.to],e.to));
            }
        }
    }
}

int main(){
    int v;
    cin>>v;
    
    vector<edge> G[MAX_V];
    rep(i,v-1){
        int s,t;
        cin>>s>>t;
        s--,t--;
        G[s].pb(edge{t,1});
        G[t].pb(edge{s,1});
    }
    
    vector<int> d1(v),d2(v);
    
    dijkstra(0,d1,G);
    dijkstra(v-1,d2,G);
    
    int sum = 0;
    rep(i,v){
        if(d1[i]<=d2[i]){
            sum++;
        }
    }
    if(sum>v/2)cout<<"Fennec"<<endl;
    else cout<<"Snuke"<<endl;
}

Measured memory_bytes: 7492
#include<stdio.h>

#define N 100000

int main(){
  int hp;
  int a;
  int b[N],i;
  if(scanf("%d%d",&hp,&a)!=2) return 1;
  
  for(i=0;i<a;i++){
  	if(scanf("%d",&b[i])!=1) return -1;
  }
  
  for(i=0;i<a;i++){
  	hp-=b[i];
  }
  
  if(hp<=0) printf("Yes\n");
  else printf("No\n");
return 0;
}

Measured memory_bytes: 512
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    S=list(input())
    l=[0]*len(S)
    c_r=0
    c_l=0
    tmp=-1
    for i in range(len(S)-1):
        if S[i]=='R':
            c_r+=1
        elif S[i]=='L':
            c_l+=1
        if S[i]=='R' and S[i+1]=='L':
            l[i]+=-(-c_r//2)
            l[i+1]+=c_r//2
            l[tmp]+=c_l//2
            l[tmp+1]+=-(-c_l//2)
            tmp=i
            c_r,c_l=0,0
    c_l+=1
    l[tmp]+=c_l//2
    l[tmp+1]+=-(-c_l//2)
    print(*l)

if __name__ == '__main__':
    main()


Measured memory_bytes: 51192
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=998244353;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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; }

//aの逆元求めるならn=mod-2
long long modpow(long long a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
int main(){
int n;
cin>>n;
vector<ll> a(n,0);
bool check=true,ng=false;
for(int i=0;i<n;i++){ 
    int t;cin>>t;
    if(i==0&&t!=0)ng=true;
    a[t]++;
}
ll ans=1;
for(int i=0;i<n;i++){
   if(a[i]==0)check=false;
   else if(!check)ng=true;
}
if(ng||a[0]!=1)cout<<0<<endl;
else{
    for(int i=1;i<n;i++){
      
            (ans*=modpow(a[i-1],a[i]))%=mod;
        
    }
   cout<<ans<<endl;
}
}


Measured memory_bytes: 1024
#include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;
int button[100016];
bool check[100016];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&button[i]);
    int e=1,ans=0;
    bool w=false;
    while(!check[e])
    {
        check[e]=true;
        ans++;
        e=button[e];
        if(e==2){
            w=true;
            break;
        }
    }
    if(w)
    printf("%d\n",ans);
    else printf("-1\n");
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef tuple<ll, ll, ll> ti;
 
#define REP(a,b,c) for(ll a=b;a<(c);a++)
#define PER(a,b,c) for(ll a=b;a>=(c);a--)
 
inline ll ii(){ ll x; cin >> x; return x; }
inline string is(){ string x; cin >> x; return x; }
inline ld id(){ ld x; cin >> x; return x; }
inline void oi(ll x){ cout << x; }
inline void od(ld x){ cout << fixed << setprecision(10) << x; }
inline void os(string x){ cout << x; }
inline void oe(){ cout << endl; }
inline void oie(ll x){ oi(x); oe(); }
inline void ode(ld x){ od(x); oe(); }
inline void ose(string x){ os(x); oe(); }
inline void maxin(ll &a, ll b){ a=max(a,b); }

int main(){
    ll D=ii(), T=ii(), S=ii();
    if(T*S>=D){
        ose("Yes");
    }else{
        ose("No");
    }

    return 0;
}

Measured memory_bytes: 3628
N, M = map(int,input().split())
X = list(map(int,input().split()))

X.sort()
if N>=M:
    print(0)
else:
    tmp=[]
    for i in range(M-1):
        tmp.append(X[i+1] - X[i])
    tmp.sort(reverse = True)
    interval = 0
    for i in range(N-1):
        if i+1 == M-1:
            break
        interval += tmp[i]
    print(sum(tmp) - interval)

Measured memory_bytes: 13968
#include <bits/stdc++.h> 
using namespace std; 
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
const long long int m=pow(10,9)+7;

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll x ;
    cin >> x ;
    ll sum = 0 , ans = 1 ;
    while ( 1 )
    {
        sum += ans ;
        if ( x <= sum )
        {
            cout << ans << endl ;
            return 0 ; 
        }
        ans ++;
    }
    return 0;
}

Measured memory_bytes: 3608
#include <iostream>

using namespace std;

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

    long long A, B, C, K;
    cin >> A >> B >> C >> K;

    long long max_val = max(A, max(B, C));
    long long rest = A + B + C - max_val;
    for (int i = 0; i < K; ++i) {
        max_val *= 2;
    }

    cout << rest + max_val << endl;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(void){
  int n;
  double h;
  int hight[6]={};

  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%lf",&h);
    if(h<165.0){hight[0]++;}
    else if(h>=165.0 && h<170.0){hight[1]++;}
    else if(h>=170.0 && h<175.0){hight[2]++;}
    else if(h>=175.0 && h<180.0){hight[3]++;}
    else if(h>=180.0 && h<185.0){hight[4]++;}
    else if(h>=185.0){hight[5]++;}
  }

  for(int i=0;i<6;i++){
    printf("%d:",i+1);
    for(int j=0;j<hight[i];j++){
      printf("*");
    }
    printf("\n");
  }

  return 0;
}



Measured memory_bytes: 1924
n = int(input())
now = [0, 0, 0]
def ng():
  print('No')
  exit()
for i in range(n):
  t, x, y = map(int, input().split())
  if t % 2 != (x + y) % 2:
    ng()
  if abs(x - now[1]) + abs(y - now[2]) > t - now[0]:
    ng()
  now = [t, x, y]
print('Yes')

Measured memory_bytes: 9204
#!/usr/bin/env python

def main():
    N = int(input())
    K = int(input())
    
    ans = 1
    for _ in range(N):
        tmp1 = ans * 2
        tmp2 = ans + K
        if tmp1 > tmp2:
            ans = tmp2
        else:
            ans = tmp1
    print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstdlib>
#include <stack>
#include <vector>
#define INF 0x3f3f3f3f
#define MOD 1000000009
# define FOR(i,a,n) for(register int i=a; i<=n; ++i)
# define FDR(i,a,n) for(register int i=a; i>=n; --i)
typedef long long ll;
typedef unsigned long long ull;

inline int scan() {
    int x=0,f=1; char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-') f=-1; ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
    return x*f;
}
inline void Out(int a) {
    if(a<0) {putchar('-'); a=-a;}
    if(a>=10) Out(a/10);
    putchar(a%10+'0');
}
using namespace std;
int a[3][1000];
int dp[3][1000];
int main()
{
    int n;
    cin >> n;
    for(int j = 1; j <= 2; j++)
    for(int i = 1; i <= n; i++)
    {
        cin >> a[j][i];
    }
    for(int i = 1; i <= 2; i++)
    for(int j = 1; j <= n; j++)
    {
        dp[i][j] = max(dp[i][j-1], dp[i-1][j])+a[i][j];
    }
    cout << dp[2][n] << endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
L = [tuple(map(int, input().split())) for n in range(N)]
Roads = []
for n in range(N):
    for m in range(n + 1, N):
        distance = ((L[n][0] - L[m][0]) ** 2 + (L[n][1] - L[m][1]) ** 2) ** 0.5
        Roads.append(distance)
mean = sum(Roads) / len(Roads)
print(mean * (N - 1))


Measured memory_bytes: 3188
import static java.lang.Math.*;

import java.util.Scanner;


public class Main {
	static int N,A,B,C;
	static int[] take;
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		 N = sc.nextInt();
		 A = sc.nextInt();
		 B = sc.nextInt();
		 C = sc.nextInt();
		 take = new int[N];
;
		for(int i = 0 ; i < N ; i++){
			take[i] = sc.nextInt();
		}

		sc.close();

		System.out.println(calmp(0,0,0,0));
	}

		static int calmp(int n, int a , int b, int c){
			if(n == N){
				return (min(min(a,b),c) > 0 ) ? (abs(A-a)+abs(B-b)+abs(C-c)-30) : 30000;
			}
			int mp0 = calmp(n+1, a, b, c);
			//System.out.println("mp0 : "+mp0);

			int mp1 = calmp(n+1, a+take[n], b, c) + 10;
			//System.out.println("mp1 : "+mp1);

			int mp2 = calmp(n+1, a, b+take[n], c) + 10;
			//System.out.println("mp2 : "+mp2);

			int mp3 = calmp(n+1, a, b, c+take[n]) + 10;
			//System.out.println("mp3 : "+mp3);

			return min(min(mp0, mp1),min(mp2, mp3));
		}
	}



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


int main() {

  long long W,H;
  cin>>W>>H;

  if(W==1||H==1)
    cout<<1<<endl;
  else if(W*H%2==0)
    cout<<W*H/2<<endl;
  else
  {
    cout<<W*H/2+1<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
const main = input => {
  let lines = input.split('\n')
  let k = Number(lines[0])
  let a = lines[1].split(' ').map(e=>Number(e))
  
  for(let i = a[0]; i <= a[1]; i++) {
    if(i%k == 0) return "OK"
  }
  return "NG"
}

console.log(main(require("fs").readFileSync("/dev/stdin", "utf8")))

Measured memory_bytes: 29600
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <map>
#include <functional>
#include <cstring>
#include <queue>
#include <cmath>
#include <deque>
#include <list>
#include <iomanip>
#include <fstream>
#include <string>
#include <iterator>
#include <set>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
#define mp make_pair
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, N) FOR(i, 0, N)
#define SZ(x) ((int)(x).size())

const int MAXN = 100007, MAXK = 12, MOD = 100000000;

int n, q, k;
ll dep[MAXN];
vector <pii> G[MAXN];
bool used[MAXN];

void dfs(int v){
	used[v] = true;
	REP(i, SZ(G[v])){
		int to = G[v][i].first;		
		if (!used[to]){
			dep[to] = dep[v] + G[v][i].second;
			dfs(to);
		}
	}
}

int main()
{
	cin >> n;
	REP(i, n - 1){
		int a, b, c;
		cin >> a >> b >> c;
		--a; --b;
		G[a].push_back(mp(b, c));
		G[b].push_back(mp(a, c));
	}
	memset(used, 0, MAXN);
	cin >> q >> k;
	dfs(k - 1);
	REP(i, q){
		int x, y;
		cin >> x >> y;
		--x; --y;
		cout << dep[x] + dep[y] << endl;
	}
	//cout << endl; system("pause");//please
	return 0;
}

Measured memory_bytes: 12800
#include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<math.h>
using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	if (a % 2 == 1 && b % 2 == 1) {
		cout << "Odd";
		return 0;
	}
	else cout << "Even";
}

Measured memory_bytes: 256
#include <cstdio>

int n,W=0;
char s[200010];

int main()
{
	scanf("%d %s",&n,s+1);
	for(int i=1;i<=n;i++)if(s[i]=='W')W++;
	for(int i=n-W+1;i<=n;i++)if(s[i]=='W')W--;
	printf("%d",W);
}

Measured memory_bytes: 1912