akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rep1(i,n) for(int i = 1; i < (n); i++)

int main(){
    int n;
    cin >> n;
    char s[n];
    char t[n];
    rep(i,n){
        cin >> s[i];
    }
    rep(i,n){
        cin >> t[i];
    }
    rep(i,n){
        cout << s[i] << t[i];
    }
    cout << endl;
}

Measured memory_bytes: 256
n = int(input())
a = [0,0,0,0]
for i in range(n):
    s = str(input())
    if s == 'AC':
        a[0] += 1
    elif s == 'WA':
        a[1] += 1
    elif s == 'TLE':
        a[2] += 1
    else:
        a[3] += 1
print('AC x',a[0])
print('WA x',a[1])
print('TLE x',a[2])
print('RE x',a[3])


Measured memory_bytes: 9208
#include <algorithm>
#include <bitset>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define MOD (1000000007l)
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)

using namespace std;

bool foo(ll n) {
  if (n % 10 == 3) return true;
  if (n) return foo(n / 10);
  return false;
}

void solve() {
  ll N;
  cin >> N;
  for (ll i = 1; i <= N; i++) {
    if (i % 3 == 0 or foo(i)) cout << " " << i;
  }
  cout << endl;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(12);
  cout << fixed;
  solve();
  return 0;
}



Measured memory_bytes: 3168
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*
cout<<setprecision(20)
cin.tie(0);
ios::sync_with_stdio(false);
*/
const llint mod=1e9+7;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
//llint lcm(llint a,llint b){return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
int n,k;
bool toku=false;
vector<llint>solve(vector<int>in,int m){
	//スタート値を求める
	//実際にはなんかinはREVされてたりする
	vector<bool>use(k+1);
	int sta=0;
	for(auto it:in){
		if(use[it]){break;}
		use[it]=true;
		sta++;
	}
	vector<llint>ans(n-m+5);
	vector<llint>dp(k+1);
	dp[sta]=1;
	ans[0]=1;
	int h,i;
	for(h=1;h<=n-m+4;h++){
		vector<llint>ddp(k+1);
		for(i=k-1;i>0;i--){ddp[i]=ddp[i+1]+dp[i];}
		for(i=k-2;i>0;i--){ddp[i+1]+=dp[i]*(k-i);}
		for(i=1;i<k;i++){dp[i]=ddp[i]%mod;ans[h]+=dp[i];}
		ans[h]%=mod;
		//cout<<ans[h]<<endl;
	}
	return ans;
}
int main(void){
	llint i,j,m;cin>>n>>k>>m;
	if(n<k){cout<<0<<endl;return 0;}
	vector<int>a(m);
	for(i=0;i<m;i++){cin>>a[i];}
	//なんかカラフルでないやつをもとめて、イロイロする
	
	//なんかaの中でできちゃったやつを特殊処理します
	vector<int>kabu(k+1,-1);
	bool deki=false;
	int mae=-1;
	for(i=0;i<m;i++){
		maxeq(mae,kabu[a[i]]);
		kabu[a[i]]=i;
		if(i-mae>=k){deki=true;break;}
	}
	if(deki){
		llint kota=n-m+1;
		for(i=0;i<n-m;i++){kota*=k;kota%=mod;}
		cout<<kota<<endl;
		return 0;
	}
	
	
	auto hi=solve(a,m);
	REV(a);
	auto mg=solve(a,m);
	llint ans=0;
	llint mto=1;
	for(i=0;i<n-m;i++){mto*=k;mto%=mod;}
	for(i=0;i<=n-m;i++){
		ans+=mto;
		ans-=hi[i]*mg[n-m-i];
		ans%=mod;
	}
	ans+=mod;ans%=mod;
	//cerr<<ans<<endl;
	if(mae==-1){
		vector<int>in(k-1);
		for(i=0;i<k-1;i++){in[i]=i+1;}
		auto ret=solve(in,k-1);
		for(llint j=m+2;j<=k;j++){
			//cerr<<"in";
			llint hos=j-m-1;
			for(i=2;i<=k-m;i++){hos*=i;hos%=mod;}
			for(i=2;i<=k-j;i++){hos*=i;hos%=mod;}
			//if(n-k-k+j<0){cerr<<"d";break;}
			for(i=0;i<=n-k-k+j;i++){
				ans+=((ret[i]*ret[n-k-k+j-i])%mod)*hos;
				ans%=mod;
			}
		}
		//cerr<<hos<<endl;
		//for(auto it:ret){cerr<<it<<endl;}
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 896
n, w = map(int, input().split())
wv = [list(map(int, input().split())) for _ in range(n)]

dp = [[0] * (w + 1) for _ in range(n + 1)]
for i in range(n):
  for j in range(w + 1):
    if j + wv[i][0] <= w:
      dp[i + 1][j + wv[i][0]] = max(dp[i + 1][j + wv[i][0]], dp[i][j] + wv[i][1])
    dp[i + 1][j] = max(dp[i][j], dp[i + 1][j])
print(max(dp[-1]))
      

Measured memory_bytes: 120812
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
 
const LL inf = 11234567890123;
LL N, W;
std::vector<LL>w, v;
std::vector<std::vector<LL>>memo;
 
LL dp(LL i, LL j)
{
	if (j == 0) return 0;
	if (i == -1) return inf;
	if (memo[i][j] != -1) return memo[i][j];
	LL res;
	if (j < v[i]) res = dp(i - 1, j);
	else res = std::min(dp(i - 1, j - v[i]) + w[i], dp(i - 1, j));
	return memo[i][j] = res;
}
 
int main()
{
	in >> N >> W;
	w.resize(N); v.resize(N);
	rep(i, N) in >> w[i] >> v[i];
 
	memo.resize(N);
	rep(i, memo.size()) memo[i].resize(112345, -1);
	LL ans = 0;
	for (LL j = 112344; j >0; --j)
	{
		if (dp(N - 1, j) <= W){
        ans=j;
          break;
        }
	}
	out << ans << std::endl;
}

Measured memory_bytes: 88192
{-# LANGUAGE BangPatterns #-}
import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.Char
import           Data.Maybe
import qualified Data.Vector           as V

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

getIntVec n = V.unfoldrN n (BS.readInteger . BS.dropWhile isSpace) <$> BS.getLine

main = do
  n <- getInt
  as <- getIntVec n
  let m = V.foldr' lcm 1 as
      as' = V.map (\ !i -> m `div` i) as
  print $ (sum as') `mod` 1000000007


Measured memory_bytes: 6524
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;
using ll = long long;

const ll INF = 1ll << 60;

int main() {
  int N, W;
  int V = 1e5;
  cin >> N >> W;
  vector<ll> w(N + 1);
  vector<ll> v(N + 1);
  rep(i, N) cin >> w[i + 1] >> v[i + 1];

  vector<vector<ll> > dp(N + 1, vector<ll>(V + 1, INF));
  dp[0][0] = 0;
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j <= V; j++) {
      if (v[i] <= j) {
        dp[i][j] = dp[i - 1][j - v[i]] + w[i];
      }
      dp[i][j] = min(dp[i][j], dp[i - 1][j]);
    }
  }
  int ii = 0;
  for (int j = 0; j <= V; j++) {
    if (dp[N][j] <= W) {
      ii = max(ii, j);
    }
  }
  cout << ii << endl;
  return 0;
}

Measured memory_bytes: 83112
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	r := bufio.NewReaderSize(os.Stdin, 200000)
	s, _, _ := r.ReadLine()

	if daydream(string(s)) {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}

func daydream(s string) bool {
	if s == "" {
		return true
	}

	if strings.HasPrefix(s, "dreamer") {
		return daydream(s[7:]) || daydream(s[5:])
	} else if strings.HasPrefix(s, "dream") {
		return daydream(s[5:])
	} else if strings.HasPrefix(s, "eraser") {
		return daydream(s[6:])
	} else if strings.HasPrefix(s, "erase") {
		return daydream(s[5:])
	}

	return false
}

Measured memory_bytes: 8192
// https://atcoder.jp/contests/abc127/tasks/abc127_c
package main

import "fmt"
import "bufio"
import "os"
import "strconv"

var _sw = bufio.NewScanner(os.Stdin)

func main() {
	N := NextInt()
	M := NextInt()
	L := make([]int, M)
	R := make([]int, M)

	min, max := 0, N+1
	for i := range L {
		L[i] = NextInt()
		R[i] = NextInt()

		min = Max(min, L[i])
		max = Min(max, R[i])
	}

	fmt.Println(Max(max-min+1, 0))
}

func init() {
	_sw.Split(bufio.ScanWords)
}

func NextInt() int {
	if _sw.Scan() == false {
		panic(_sw.Err())
	}
	i, e := strconv.Atoi(_sw.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func NextString() string {
	if _sw.Scan() == false {
		panic(_sw.Err())
	}
	return _sw.Text()
}

func Max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func Min(x, y int) int {
	if x > y {
		return y
	}
	return x
}


Measured memory_bytes: 3328
import sys

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MATINT(h): return [list(map(int, input().split())) for _ in range(h)]
def MATSTR(h): return [input() for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
inf = float('inf')
mod = 10 ** 9 + 7

def main():
    S = input()
    for i in range(len(S)):
        if S[i] == "L" and (i + 1) % 2 == 1:
            No()
            exit()
        if S[i] == "R" and (i + 1) % 2 == 0:
            No()
            exit()
    Yes()

if __name__ == '__main__':
    main()


Measured memory_bytes: 38556
#![allow(unused_imports)]
use itertools::Itertools;
use num_traits::clamp;
use ordered_float::OrderedFloat;
use proconio::{fastout, input, marker::*};
use std::cmp::*;
use std::collections::*;
use superslice::*;

#[fastout()]
fn main() {
    input! {
        n: usize, k: usize,
        mut a: [i64; n],
    }
    let m = 1000000007i64;
    let mod_product = |acc: i64, &value: &i64| {
        (acc * value).rem_euclid(m)
    };

    if k == n || k % 2 == 1 && a.iter().all(|v| *v <= 0) {
        a.sort_by_key(|v| -*v);
        let ans = a.iter().take(k).fold(1, mod_product);
        println!("{}", ans);
        return;
    }

    a.sort_by_key(|v| Reverse(v.abs()));
    let mut plus = Vec::new();
    let mut minus = Vec::new();
    for i in 0..n {
        if a[i] >= 0 {
            plus.push(a[i]);
        } else {
            minus.push(a[i]);
        }
    }

    let mut ppos = 0;
    let mut mpos = 0;
    let mut vals = Vec::new();
    let mut retry = false;
    while vals.len() < k {
        if vals.len() < k - 1 && ppos + 1< plus.len() && mpos + 1 < minus.len() {
            if plus[ppos] * plus[ppos+1] < minus[mpos] * minus[mpos+1] {
                vals.push(minus[mpos]);
                vals.push(minus[mpos+1]);
                mpos += 2;
            } else {
                vals.push(plus[ppos]);
                vals.push(plus[ppos+1]);
                ppos += 2;
            }
        } else if vals.len() < k - 1 && mpos + 1 < minus.len() {
            vals.push(minus[mpos]);
            vals.push(minus[mpos+1]);
            mpos += 2;
        } else if ppos < plus.len() {
            vals.push(plus[ppos]);
            ppos += 1;
        } else {
            retry = true;
            break;
        }
    }
    let ans = if !retry {
        vals.iter().fold(1, mod_product)
    } else {
        a.sort_by_key(|v| v.abs());
        assert!(a.iter().take(k).filter(|v| **v > 0).count() == 1);
        a.iter().take(k).fold(1, mod_product)
    };
    println!("{}", ans);
}


Measured memory_bytes: 9752
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using lint = 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 (b<a) { a=b; return 1; } return 0; }
const long long INF = 1LL << 60;

int main()
{
    int n,k,q;
    cin >> n >> k >> q;
    vector<int> a(q);
    rep(i,q) cin >> a[i];
    rep(i,q) a[i]--;

    vector<int> point(n,k-q);

    rep(i,q){
        point[a[i]]++;
    }

    rep(i,n){
        if(point[i] > 0) cout << "Yes" << endl;
        else cout << "No" << endl;
    } 
    return 0;
}

Measured memory_bytes: 1408
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<iomanip>
#include<set>
using namespace std ;

#define MAXN 57

int n ;
int a[ MAXN ] ;

void input ( ) {
    scanf ( "%d" , &n ) ;
    for ( int i = 1 ; i <= n ; ++ i ) {
        scanf ( "%d" , &a[ i ] ) ;
    }
    sort ( a + 1 , a + n + 1 ) ;
}

void solve ( ) {
    double ans = a[ 1 ] ;
    for ( int i = 2 ; i <= n ; ++ i ) {
        ans += a[ i ] ;
        ans /= 2.0 ;
    }
    printf ( "%.12lf\n" , ans ) ;
}

int main ( ) {
    ios_base :: sync_with_stdio ( false ) ;
    cin.tie ( NULL ) ;
    input ( ) ;
    solve ( ) ;
    return 0 ;
}



Measured memory_bytes: 256
N = int(input())
A = [int(input()) for _ in range(N)]
max_A = max(A)

# 複数の最大値のインデックスを全て取得
max_index = [i for i, v in enumerate(A) if v == max_A]

# 最大値は1個か?
one_max = (len(max_index) == 1)
answer = [max_A] * N

if one_max:
    Second = A.copy()
    Second.remove(max_A)
    Second_A = max(Second)
    for i in max_index:
        answer[i] = Second_A
for i in range(N):
    print(answer[i])

Measured memory_bytes: 23836
while True:
    n = int(input())
    if n == 0:
        break
    ls = []
    for i in range(n):
        v = list(map(int,input().split()))
        ls.append((sum(v[1:]),v[0]))
    ls.sort()
    ls.reverse()
    print(ls[0][1],ls[0][0])


Measured memory_bytes: 7004
#include <bits/stdc++.h>
#define FOR(x,n) for(int x = 0; x < n; x++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(a) ((int)(a).size())
#define FIN ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using namespace std;
typedef long long ll;

ll solve(ll a, ll b){
  ll ans = 1e10;
  for(ll x = 1; x < a; x++){
    ll mx1 = max({x * b, (a-x) * (b/2), (a-x) * (b/2+b%2)});
    ll mn1 = min({x * b, (a-x) * (b/2), (a-x) * (b/2+b%2)});
    ll mx2 = max({x * b, ((a-x)/2) * b, ((a-x)/2+(a-x)%2) * b});
    ll mn2 = min({x * b, ((a-x)/2) * b, ((a-x)/2+(a-x)%2) * b});
    ans = min({ans, mx1 - mn1, mx2 - mn2});
  }
  return ans;
}

int main() { FIN;
  ll H, W; cin >> H >> W;
  cout << min(solve(H,W), solve(W,H)) << "\n";
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <iomanip>

using namespace std;

#define FAST       			ios_base :: sync_with_stdio(false); cin.tie(NULL); 
#define endl "\n"

typedef long long int  ll;


int main()
{
	FAST;
	string str[1000];

	int row,c;
	cin >> row >> c;

	for(int i=0 ; i<row ; i++)
		cin >> str[i];


	for(int i=0 ; i<row ; i++)
	{
		cout << str[i] << "\n";
		cout << str[i] << "\n";
	}
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <map>
#define F first
#define S second
using namespace std;
int n,m;
int x[111111];
int a[111111];
int main(void){
  scanf("%d%d",&n,&m);
  for(int i = 0; i < n; i++){
    scanf("%d",x+i);
    a[x[i]]++;
  }


  int sum = 0;
  for(int i = 1; i*2 <= m; i++){
    int ag = 0;
    int ak = 0;
    int bg = 0;
    int bk = 0;
    int b = (m-i);
    //if(b==i) b += m;
    for(int j = 0; i+m*j < 111111;  j++){
      ag += a[i+m*j]/2;
      ak += a[i+m*j]%2;
    }
    for(int j = 0; b+m*j < 111111;  j++){
      bg += a[b+m*j]/2;
      bk += a[b+m*j]%2;
    }
    /*
    printf("a %d b %d\n",i,b);
    printf("ak %d bk %d\n",ak,bk);
    printf("ag %d bg %d\n",ag,bg);
    */

    if(i != b){
      int mk = min(ak,bk);
      sum += mk;
      if(ak > bk){
	bk -= mk;
	ak -= mk;
	int kk = min(ak/2,bg);
	sum += kk*2;
	ak -= kk*2;
	bg -= kk;
      }
      if(ak < bk){
	ak -= mk;
	bk -= mk;
	int kk = min(bk/2,ag);
	sum += kk*2;
	bk -= kk*2;
	ag -= kk;
      }
      sum += ag+bg;
      //qprintf("sum %d\n",sum);
    }else{
      sum += ak/2 + ag;
      //printf("sum %d\n",sum);
    }
  }
  int ggg = 0;
  int kkk = 0;
  for(int i = 1; m*i < 111111; i++){
    ggg += a[m*i]/2;
    kkk += a[m*i]%2;
  }
  sum += kkk/2 + ggg;


  printf("%d\n",sum);
}


Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#define rep(i, n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int h, w;
	cin>>h>>w;
	string m;
	vector<string> v;
	int b=0,c;
	rep(i, h){
		c=0;
		cin>>m;
		rep(j, w){
			if(m[j]=='.')
				c++;
		}
		if(c!=w){
			v.push_back(m);
			b++;
		}
	}
	int d;
	vector<int> a;
	rep(i, w){
		d=0;
		rep(j, b){
			if(v[j][i]=='.')
				d++;
		}
		if(d==b)
			a.push_back(i);
	}
	a.push_back(1000);
	int e;
	rep(i, b){
		e=0;
		rep(j, w){
			if(j!=a[e])
				cout<<v[i][j];
			else
				e++;
		}
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define rrep(i, n) for (ll i = n - 1; i >= 0; i--)
#define Rep(i, r, n) for (ll i = r; i < n; i++)
#define RRep(i, r, n) for (ll i = n - 1; i <= r; i--)
#define debug(x) cout << #x << ' ' << '=' << ' ' << (x) << endl;
#define fs first
#define sc second
#define int long long
#define pb push_back
const int dx[] = {0, -1, 0, 1};
const int dy[] = {1, 0, -1, 0};
const int MOD = (1000000007);
//const int MOD = (998244353);
//const int INF = (1 << 30)-1;
const int INF = (1LL << 60)-1;
const double EPS = (1 >> 30);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return 1;} return 0;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return 1;} return 0;}

using Graph = vector<vector<pair<int, int>>>;
ll mod_pow(ll x, ll y) { ll res = 1; while (y > 0) { if (y & 1) { res = res * x % MOD; } x = x * x % MOD; y >>= 1; } return res; }
ll comb(ll n, ll k) { k = min(k, n - k); ll nnn = 1; for (ll i = n - k + 1; i <= n; i++) { nnn *= i; nnn %= MOD; } ll kkk = 1; for (ll i = 1; i <= k; i++) { kkk *= i; kkk %= MOD; } return (nnn * mod_pow(kkk, MOD - 2)) % MOD; }


signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);
    //---------------------------------------------
    
    int x,y;
    cin>>x>>y;
    if((x+y)%3==0){
        int ma=max(x,y);
        int mi=min(x,y);
        int sa=ma-mi;
        int kai=(x+y)/3;
        if(sa<=mi){
            if(sa==0){
                cout<<comb(kai,kai/2)<<endl;
            }
            else{
                cout<<comb(kai,mi-kai)<<endl;
            }
        }
        else{
            cout<<0<<endl;
        }
    }
    else{
        cout<<0<<endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define FILL(a,n,x); REP(i,(n)){ (a)[i]=(x); }
template<class T> void chmin(T& a, T b){ if(a>b){a=b;} }
int main() {
	// your code goes here
	int n;
	cin>>n;
	int h[n+1];
	for(int i=1;i<=n;i++)
	cin>>h[i];
	
	 int dp[n+1];
	  FILL(dp,n+1,1e9+10);
	dp[1]=0;
	for(int i=1;i+1<=n;++i){
    int temp=dp[i]+abs(h[i+1]-h[i]);
    chmin(dp[i+1],temp);
    if(i+2<=n) chmin(dp[i+2],dp[i]+abs(h[i+2]-h[i]));
  }

	cout<<dp[n]<<"\n";
	
	return 0;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h,m,s,h2,m2,s2;
    while(cin >> h >> m >> s >> h2 >> m2 >> s2){
        int ansh,ansm,anss;
        anss=s2-s;
        ansm=m2-m;
        ansh=h2-h;
        if(anss<0){
            anss=60-abs(anss);
            ansm--;
        }
        if(ansm<0){
            ansm=60-abs(ansm);
            ansh--;
        }
        cout << ansh << " " << ansm << " " << anss << endl;
    }

    return 0;
}


Measured memory_bytes: 3232
N = str(input())

n = int(N[-1])

if n == 2 or n == 4 or n == 5 or n == 7 or n == 9:
    print('hon')

if n == 0 or n == 1 or n == 6 or n == 8:
    print('pon')

if n == 3:
    print('bon')

Measured memory_bytes: 9180
#include <iostream>

using namespace std;

int dp[41][401][401] = {};


int main(){
  int n, ma, mb, result;
  cin >> n >> ma >> mb;
  for (int i=0;i<41;i++) {
    for (int j=0;j<401;j++) {
      for (int k=0;k<401;k++) {
	dp[i][j][k] = 1<<30;
      }
    }
    dp[i][0][0] = 0;
  }

  result = 1<<30;
  for (int i=1;i<=n;i++) {
    int a, b, c;
    cin >> a >> b >> c;
    for (int j=0;j<401;j++) {
      for (int k=0;k<401;k++) {
	if (j==0&&k==0)
	  continue;
	if (dp[i][j][k] > dp[i-1][j][k]) {
	  dp[i][j][k] = dp[i-1][j][k];
	}
	if (j >= a && k >= b && dp[i][j][k] > dp[i-1][j-a][k-b] + c) {
	  dp[i][j][k] = dp[i-1][j-a][k-b] + c;
	}
	if (j*mb == k*ma) {
	  //	  cout << j << "/" << k << " = " << ma << "/" << mb << "\t" << dp[i][j][k] << "\t" << result << endl;
	  if (result > dp[i][j][k]) {
	    result = dp[i][j][k];
	  }
	}
      }
    }
  }

  // for (int i=0;i<=n;i++) {
  //   for (int j=0;j<n*10;j++) {
  //     for (int k=0;k<n+10;k++) {
  // 	cout << dp[i][j][k] << "\t";
  //     }
  //     cout << endl;
  //   }
  //   cout << endl;
  // }
  
  if (result < 1<<30) {
    cout << result << endl;
  } else {
    cout << -1 << endl;
  }
  return(0);
}


Measured memory_bytes: 25984
N = int(input())
A = list(map(int,input().split()))
ans ="APPROVED"
for i in range(len(A)):
    if A[i]%2 == 1:
        continue
    if A[i]%3 == 0 or A[i]%5 == 0:
        continue
    ans = "DENIED"
print(ans)

Measured memory_bytes: 3060
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <cstring>
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef unsigned long long ll;

int main(){
	ll A,B,N; cin >> N >> A >> B;
	ll count = N / (A + B)   * A;
	if(A <= N % (A + B) ) count += A;
	else count += N % (A + B) ;
	cout << count << endl;
}

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

int cmp(string s1, string s2)
{
  if (s1[1] == s2[1]) return 0;
  if (s1[1] > s2[1]) return 1;
  return -1;
}

void bubble_sort(vector<string> &arr)
{
  for (int i = 0; i < arr.size(); i++) {
    for (int j = arr.size()-1; j > i; j--) {
      if (cmp(arr[j], arr[j-1]) < 0) {
        swap(arr[j], arr[j-1]);
      }
    }
  }
}

void selection_sort(vector<string> &arr)
{
  for (int i = 0; i < arr.size(); i++) {
    int min_i = i;
    for (int j = i; j < arr.size(); j++) {
      if (cmp(arr[j], arr[min_i]) < 0) {
        min_i = j;
      }
    }
    swap(arr[i], arr[min_i]);
  }
}

bool is_stable(vector<string> &original, vector<string> &sorted)
{
  for (int i1 = 0; i1 < sorted.size()-1; i1++) {
    for (int i2 = i1+1; i2 < sorted.size(); i2++) {
      if (cmp(sorted[i1], sorted[i2]) != 0)
        continue;
      for (int j1 = 0; j1 < original.size()-1; j1++) {
        for (int j2 = j1+1; j2 < original.size(); j2++) {
          if (cmp(original[j1], original[j2]) != 0)
            continue;
          if (sorted[i1] == original[j2] && sorted[i2] == original[j1])
            return false;
        }
      }
    }
  }
  return true;
}

void output(vector<string> &original, vector<string> &sorted)
{
  int n = sorted.size();
  for (int i = 0; i < n; i++)
    cout << sorted[i] << (i==n-1?'\n':' ');
  cout << (is_stable(original, sorted)?"Stable":"Not stable") << endl;
}

int main()
{
  int n;
  vector<string> arr, arr1, arr2;

  cin >> n;
  arr = vector<string>(n);
  for (int i = 0; i < n; i++)
    cin >> arr[i];

  arr1 = vector<string>(n); copy(arr.begin(), arr.end(), arr1.begin());
  bubble_sort(arr1);
  arr2 = vector<string>(n); copy(arr.begin(), arr.end(), arr2.begin());
  selection_sort(arr2);

  output(arr, arr1);
  output(arr, arr2);

  return EXIT_SUCCESS;
}




Measured memory_bytes: 3212
#include <stdio.h>
#include <math.h>

int main(void)
{
    int n, m, t, x;

    scanf("%d%d", &n, &m);

    // 回数の期待値x
    x = pow(2, m);

    t = 1900*m + 100*(n-m);
    t *= x;

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

    return 0;
}

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

#define rep2(x,fr,to) for(int x=(fr);x<(to);x++)
#define rep(x,to) for(int x=0;x<(to);x++)
#define repr(x,fr,to) for(int x=(fr);x>=(to);x--)
#define all(c) c.begin(),c.end()
#define sz(v) (int)v.size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<ll,int> pii;
typedef vector<ll> VL; const int MD = (int)1e9 + 7;
void dbg(){ cerr << "\n"; } template <typename T,typename ...T2> void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
template <class T, class T2> void amax(T& a,T2 b){ if(a < b) a = b;}

int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	VI x(n),y(n), h(n);
	rep(i, n) cin >>x[i] >>y[i] >>h[i];
	int MX=101;
	rep(i,  MX) rep(j, MX) {
		bool ok = true; int hi = -1;
		rep(z, n) if(hi==-1 && h[z] > 0){
			hi = h[z] + abs(x[z]-i) + abs(y[z]-j);
			break;
		}
		rep(z, n){
			if( max(hi - abs(x[z]-i) - abs(y[z]-j), 0) != h[z]){
				ok=false; break;
			}
		}
		if(ok){
			cout << i <<" "<<j <<" "<<hi <<"\n";
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
int main(){
    int n;
    while(scanf("%d",&n),~n){
        double x=0.0,y=0.0,r=0.0;
        for(int i=0;i<n;i++){
            x+=cos(r);
            y+=sin(r);
            r=atan2(y,x)+M_PI/2;
        }
        printf("%f\n%f\n",x,y);
    }
    return 0;
}

Measured memory_bytes: 1144
import java.util.*;

import java.lang.*;

import java.math.*;



public class Main {

	Scanner sc = new Scanner(System.in);

	void p(String s){

		System.out.println(s);

	}

	void run(){

		for(;sc.hasNextDouble();){

			double d =sc.nextDouble();

			if(d<=48){

				p("light fly");

			}else if(d <= 51){

				p("fly");

			}else if(d <= 54){

				p("bantam");

			}else if(d <= 57){

				p("feather");

			}else if(d <= 60){

				p("light");

			}else if(d <= 51){

				p("fly");

			}else if(d<=64){

				p("light welter");

			}else if(d<=69){

				p("welter");

			}else if(d<=75){

				p("light middle");

			}else if(d<=81){

				p("middle");

			}else if(d<=91){

				p("light heavy");

			}else{

				p("heavy");

			}

		}

	}

	public static void main(String[] args){

		Main m = new Main();

		m.run();

		

	}

}

Measured memory_bytes: 12000
#pragma region header
#include <bits/stdc++.h>
using namespace std;

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;

constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
constexpr char EL[] = "\n";

#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());

template<typename T = i64>
T IN() { T x; cin >> x; return (x); }

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}

void print() {
	cout << EL;
}
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
	cout << head;
	if (sizeof...(tail) != 0) cout << " ";
	print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
	for (auto& a : vec) {
		cout << a;
		if (&a != &vec.back()) cout << " ";
	}
	cout << EL;
}
template <class T>
void print(vector<vector<T>> &df) {
	for (auto& vec : df) {
		print(vec);
	}
}

struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

#ifdef LOCALCODE
signed solve()
#else
signed main()
#endif
{
	auto H = IN();
	auto W = IN();
	vector<vector<int>> C(H);
	REP(i, H)
	{
		string s;
		cin >> s;
		C[i].resize(W);
		REP(j, W)
		{
			C[i][j] = s.substr(j, 1) == "#" ? 1 : 0;
		}
	}

	REP(i, H)
	{
		REP(j, W)
		{
			if (C[i][j] == 0) continue;
			if (i > 0     && C[i - 1][j] == 1) continue;
			if (i < H - 1 && C[i + 1][j] == 1) continue;
			if (j > 0     && C[i][j - 1] == 1) continue;
			if (j < W - 1 && C[i][j + 1] == 1) continue;
			print("No");
			return 0;
		}
	}
	print("Yes");
	return 0;
}


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

for i in range(N):
  ans = 0
  for j in range(N):
    f = {}
    b = {}
    for k in range(j):
      if S[k] in f.keys():
        f[S[k]] += 1
      else:
        f[S[k]] = 1
        
    for k in range(N-j):
      if S[N-k-1] in b.keys():
        b[S[N-k-1]] += 1
      else:
        b[S[N-k-1]] = 1

    for k in range(N):
      common = 0
      for l in f.keys():
        if l in b.keys():
          common += 1
     
      if common > ans:
        ans = common
        
print(ans)


Measured memory_bytes: 69332
#include<iostream>
#include<string>
int a,b,c,x;
int counter;
using namespace std;

int main(){
    cin>>a>>b>>c>>x;
    for(int i=0;i<=a;i++){
        for(int j=0;j<=b;j++){
            for(int k=0;k<=c;k++){
//                printf("%d\n",i*500+j*100+k*50);
                if(i*500+j*100+k*50==x) counter++;
            }
        }
    }
    cout<<counter<<endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
input:
10
insert 30
insert 88
insert 12
insert 1
insert 20
find 12
insert 17
insert 25
find 16
print

output: in_order + pre_order
yes
no
 1 12 17 20 25 30 88
 30 12 1 20 17 25 88

"""

import sys


class Node(object):
    def __init__(self, data):
        self.data = data
        self.left, self.right = None, None

    def insert(self, data):
        """
        insert data according to BST rules
        """
        if data < self.data:
            if not self.left:
                self.left = Node(data)
            else:
                self.left.insert(data)
        # insert duplicate value to right
        else:
            if not self.right:
                self.right = Node(data)
            else:
                self.right.insert(data)

        return self.data

    def find(self, data, parent=None):
        """
        tree walk as insert goes
        """
        if data < self.data:
            if not self.left:
                print('no')
                return None, None
            return self.left.find(data=data, parent=self)
        elif data > self.data:
            if not self.right:
                print('no')
                return None, None
            return self.right.find(data=data, parent=self)
        else:
            print('yes')
            return self, parent


def pre_order(node):
    if node is not None:
        print('', node.data, end='')
        pre_order(node.left)
        pre_order(node.right)
    return None


def in_order(node):
    if node is not None:
        in_order(node.left)
        print('', node.data, end='')
        in_order(node.right)
    return None


def action(command, content):
    if command.startswith('in'):
        tree_root.insert(int(content))
    elif command.startswith('fi'):
        tree_root.find(int(content))
    # print tree walk
    else:
        in_order(tree_root)
        print('')
        pre_order(tree_root)
        print('')

    return None


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    array_length = int(_input[0])
    command_list = list(map(lambda x: x.split(), _input[1:]))
    # assert len(command_list) == array_length
    # print(array_length, *command_list)

    flag, tree_root = False, None
    for each in command_list:
        command, content = each[0], each[-1]
        if (not flag) and command.startswith('in'):
            tree_root = Node(data=int(content))
            flag = True
            continue
        action(command, content)

Measured memory_bytes: 272120
#include<bits/stdc++.h>
using namespace std;
int m,n,k;
char cl[2][2]={{'R','B'},{'G','Y'}};

inline int in(){
	int X=0,W=1;
	char ch=0;
	while(!isdigit(ch)){
		if(ch=='-') W=-1;
		ch=getchar();
	}
	while(isdigit(ch)){
		X=(X<<1)+(X<<3)+(ch^'0');
		ch=getchar();
	}
	return X;
}

char co(int x,int y){
	int u=x+y+2000,v=x-y+2000;
	u/=k,v/=k;
	u&=1,v&=1;
	return cl[u][v];
}

int main(){
	m=in(),n=in(),k=in();
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++)
			printf("%c",co(i,j));
		puts("");
	}
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF INT_MAX/3
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))

typedef long long int ll;

using namespace std;

int main(){
    while(true){
	int n;
	cin >> n;
	if(n==0) break;
	vector< pair<int,int> > patients;
	REP(i,n){
	    int p,d1,d2;
	    cin >> p >> d1 >> d2;
	    patients.PB(pair<int,int>(d1+d2,p));
	}
	sort(RALL(patients));
	cout << patients[0].second << " " << patients[0].first << endl;
    }
    return 0;
}

Measured memory_bytes: 1328
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

vector<int> A[10010],B;
int color[10010],indeg[10010];
int v,e;

void bfs(int s){
  queue<int> q;
  q.push(s);
  color[s]=1;
  while(!q.empty()){
    int u=q.front(); q.pop();
    B.push_back(u);
    for(auto x:A[u]){
      indeg[x]--;
      if(indeg[x]==0 && color[x]==0){
        color[x]=1;
        q.push(x);
      }
    }
  }  
}

int main(){
  cin>>v>>e;
  
  int s,t;
  rep(i,e){
    cin>>s>>t;
    indeg[t]++;
    A[s].push_back(t);
  }
  
  rep(i,v){
    if(indeg[i]==0 && color[i]==0) bfs(i);
  }
  
  rep(i,v) cout<<B[i]<<endl;
  
  return 0;
}


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

int main() {
  int k,x;
  cin >> k >> x;
  x = x-k+1;
  rep(i,0,2*k-1){
    cout << x+i;
    if(i != 2*k-2) cout << " ";
    else cout << "" << endl;
  }
}

Measured memory_bytes: 3504
#include <iostream>
#include <algorithm>
#include <cstring>
#include <queue>
#include <vector>

using namespace std;

int main(){
  int n,m;
  cin>>n>>m;
  int x[111111];
  int y[111111];
  int mod = 1000000007;
  for(int i = 0;i<n;i++)
    cin>>x[i];
  for(int i = 0;i<m;i++)
    cin>>y[i];

  long long ans_x = 0;
  for(long long i = 0;i<n;i++){
    ans_x += (i*x[i] - (n-i-1)*x[i])%mod;
    ans_x %= mod;
    // cout<<ans_x<<endl;
  }
  //cout<<ans_x<<endl;

  long long ans_y = 0;
  for(long long i = 0;i<m;i++){
    ans_y += (i*y[i] - (m-i-1)*y[i])%mod;
    ans_y %= mod;
  }
  //cout<<ans_y<<endl;
  cout<<(ans_x * ans_y)%mod<<endl;

  return 0;
}


Measured memory_bytes: 1152
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <bits/stdc++.h>
using namespace std;

int main(){
    int P,Q,R;
    cin >> P >> Q >> R;
    int m=999;
    m = min(m, P+Q);
    m = min(m, Q+R);
    m = min(m, R+P);

    cout << m << endl;
}


Measured memory_bytes: 256
/* ex 7_1
   Graku */
#include <stdio.h>

typedef struct point {
    int x;
    int y;
} point;

point shift_point(point p, int x, int y) {
    point new_p;
    new_p.x = p.x + x;
    new_p.y = p.y + y;
    return new_p;
}

int main(void){
    point p1, p2, p3, p4;
    scanf("%d %d %d %d", &p1.x, &p1.y, &p2.x, &p2.y); //input
    
    /*
    v:p1p2 vector = {p2.x-p1.x, p2.y-p1.y},
    p2p3 vector
    = {{cos(PI/2),-sin(pi/2)}, {sin(PI/2),cos(PI/2)}} x v
    = {{0, -1}, {1, 0}} x {p2.x-p1.x, p2.y-p1.y}
    = {-(p2.y-p1.y), p2.x-p1.x}
    */
    p3 = shift_point(p2, -(p2.y-p1.y), p2.x-p1.x);
    p4 = shift_point(p1, -(p2.y-p1.y), p2.x-p1.x);

    printf("%d %d %d %d", p3.x, p3.y, p4.x, p4.y); //output

    return 0;
}

Measured memory_bytes: 1704
#include<iostream>
#include<cmath>

using namespace std;
const int M = 2e5;
long long a[M];
long long sum[M];
int main()
{
	int n;
	while (cin >> n)
	{
		long long s = 0;
		sum[0] = 0;
		for (int i = 1; i <= n; i++)
		{
			cin >> a[i];
			sum[i] = sum[i - 1] + a[i];
			s += a[i];
		}

		long long Min = abs(2 * sum[1] - s);
		for (int i = 1; i<n; i++)
		{
			if (Min > abs(2 * sum[i] - s))
				Min = abs(2 * sum[i] - s);
		}
		cout << Min << endl;
	}

	return 0;
}

Measured memory_bytes: 3328
n = int(input())
s = input()
r = 0
g = 0
b = 0
for letter in s:
    if letter == "R":
        r +=1
    elif letter == "G":
        g +=1
    elif letter == "B":
        b +=1
total = r * g * b
subs = 0
for i in range(n):
    for j in range(i + 1, n):
        k = 2 * j - i
        if k <= n - 1:
            if s[i] == s[j]:
                continue
            elif s[j] == s[k]:
                continue
            elif s[k] == s[i]:
                continue
            else:
                subs += 1
        else:
            break
ans = total - subs
print(ans)

Measured memory_bytes: 9108
package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func main() {
	args := readLine()
	argv := strings.Split(args, " ")
	var preWord byte
	result := "YES"
	for _, word := range argv {
		if !(preWord == 0 || preWord == word[0]) {
			result = "NO"
			break
		}
		preWord = word[len(word)-1]
	}
	fmt.Println(result)
}

Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static int INF = 1 << 30;
	static int modP = 1000000007;

	static class TaskX {
		public void solve(int testNumber, InputReader in, PrintWriter out) {


			int N = in.nextInt();
			int maxT = 100000;
			int C = in.nextInt();
			boolean[][] tt = new boolean[C+1][maxT+1];

			for (int i = 0; i < N; i++) {
				int s = in.nextInt();
				int t = in.nextInt();
				int c = in.nextInt();
				for (int j = s ; j <= t; j++) {
					tt[c][j] = true;
				}
			}

			int ans = 0;

			for (int j = 1; j <= maxT; j++) {
				int tmp = 0;
				for (int i = 1; i <= C; i++) {
					if (tt[i][j]) tmp++;
				}
				ans = Math.max(ans, tmp);
			}

			out.println(ans);


		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public double nextDouble() {
			return Double.parseDouble(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}

	}

}


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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}

ll nextLong() { ll x; scanf("%lld", &x); return x;}

int main2() {
  int D = nextLong();
  int T = nextLong();
  int S = nextLong();
  if (S * T >= D)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}

Measured memory_bytes: 3756
n=int(input())
a=list(map(int,input().split()))
memo=list([0]*n)
max=0
calc=list([0]*n)
ncalc=list([0]*n)
for i in range(n):
    memo[a[i]-1]+=1
for i in range(n):
    calc[i]=memo[i]*(memo[i]-1)//2
    ncalc[i]=(memo[i]-1)*(memo[i]-2)//2
    max+=calc[i]
for i in range(n):
    print(max-calc[a[i]-1]+ncalc[a[i]-1])


Measured memory_bytes: 33268
#include<iostream>
#include<vector>
#include<climits>
using namespace std;
long int diff(long int a, long int b)
{
    if(a>b)
        return(a-b);
    else
        return(b-a);
}
int main()
{
    long int n,i,k,j;
    cin>>n>>k;
    vector<long int>v(n);
    for(i=0;i<n;i++)
    {
        cin>>v[i];
    }
    long int dp[n];
    dp[0]=0;
    if(v[1]>v[0])
        dp[1]=v[1]-v[0];
    else
        dp[1]=v[0]-v[1];
    for(i=2;i<n;i++)
    {
        long long int min1=INT_MAX;
        for(j=k;j>0;j--)
        {
            if(i-j>=0)
            {
            if(min1>dp[i-j]+diff(v[i],v[i-j]))
                min1=dp[i-j]+diff(v[i],v[i-j]);
            }
        }
        dp[i]=min1;


    }
    cout<<dp[n-1];
}


Measured memory_bytes: 1792
N=int(input())
A=list(map(int,input().strip().split(' ')))
total=sum(A)
MIN=10**10+abs(total)
temp=0
for i in range(len(A)):
    temp+=A[i]
    if i==len(A)-1:
        break
    if abs(total-2*temp)<MIN:
        MIN=abs(total-2*temp)
print(MIN)        
    

Measured memory_bytes: 73948
from collections import deque

k=int(input())
ans=deque([1,2,3,4,5,6,7,8,9])
if k<=9:
  print(ans[k-1])
  exit()
k-=9
while True:
  x=ans.popleft()
  r=x%10
  if r==0:
    q=x*10
    ans.append(q)
    k-=1
    if k==0:
      print(q)
      exit()
    q+=1
    ans.append(q)
    k-=1
    if k==0:
      print(q)
      exit()
  elif r!=0 and r!=9:
    q=x*10+r-1
    ans.append(q)
    k-=1
    if k==0:
      print(q)
      exit()
    q+=1
    ans.append(q)
    k-=1
    if k==0:
      print(q)
      exit()
    q+=1
    ans.append(q)
    k-=1
    if k==0:
      print(q)
      exit()
  elif r==9:
    q=x*10-1+r
    ans.append(q)
    k-=1
    if k==0:
      print(q)
      exit()
    q+=1
    ans.append(q)
    k-=1
    if k==0:
      print(q)
      exit()
    










Measured memory_bytes: 6120
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
#include <queue>

using namespace std;

int n,m,q,from,to;
int rank[100000],parent[100000];

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

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

void unite(int x,int y){
	x = find(x);
	y = find(y);

	if(x == y)return;

	if(rank[x] < rank[y]){
		parent[x] = y;
	}else{
		parent[y] = x;
		if(rank[x] == rank[y])rank[x]++;
	}
}

int main(){

	scanf("%d %d",&n,&m);

	for(int i = 0; i < n; i++){
		rank[i] = 0;
		parent[i] = i;
	}

	for(int i = 0; i < m; i++){
		scanf("%d %d",&from,&to);

		if(isSame(from,to))continue;
		unite(from,to);
	}

	scanf("%d",&q);

	int left,right;

	for(int i = 0; i < q; i++){
		scanf("%d %d",&left,&right);

		if(isSame(left,right))printf("yes\n");
		else{
			printf("no\n");
		}
	}
	return 0;
}

Measured memory_bytes: 3340
#include <stdio.h>
#include <stdlib.h>

int main(void){
    long long int n,d;
    scanf("%lld %lld", &n,&d);
    long long int kyori=d*d;
    long long int x,y;
    int ans=0;
    for(int i=0;i<n;i++){
        scanf("%lld %lld", &x,&y);
        
        //printf("%lld %lld %lld\n",x,y,kyori);
        if(x*x+y*y<=kyori){
            ans++;
        }
    }
    
    printf("%d",ans);

}


Measured memory_bytes: 1732