akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

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

#define N 100010
int n, q;
ll m;
vector<pii> f;
int rt[N];

int findrt(int x) {
	if (rt[x] != x) rt[x] = findrt(rt[x]);
	return rt[x];
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin>>n>>m>>q;
	for (int i = 0; i < n; i ++) rt[i] = i;
	while (q --) {
		int a, b, c;
		cin>>a>>b>>c;
		if (c) {
			f.emplace_back(a, b);
		}
		else {
			int x = findrt(a), y = findrt(b);
			if (x != y) rt[x] = y;
		}
	}
	if (m == n - 1) {
		cout<<(f.empty()?"Yes":"No");
		return 0;
	}
    for (auto &p:f) {
		if (findrt(p.first) == findrt(p.second)) {
			cout<<"No";
			return 0;
		}
    }
    int k = 0;
    for (int i = 0; i < n; i ++) if (findrt(i) == i) k ++;
    cout<<((m <= n + 1ll * k * (k - 3) / 2)?"Yes":"No");
}


Measured memory_bytes: 4592
#pragma region
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit32(x) (1 << (x))
#define bit64(x) (1ll << (x))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T exp(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> inline T bis(T ok, T ng, function<bool(T)> f, T eps = 1) { while (abs(ok - ng) > eps) { T mi = (ok + ng) / 2; (f(mi) ? ok : ng) = mi; } return ok; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
#pragma endregion

void solve() {
  int n;
  cin >> n;
  vi32 a(n), b(n), c(n - 1);
  cin >> a >> b >> c;
  rep(i, n) a[i]--;
  int ans = 0;
  int prev = -1;
  rep(i, n) {
    int x = a[i];
    ans += b[x];
    if (prev == x - 1) {
      ans += c[prev];
    }
    prev = x;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.PrintWriter;
public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		TreeMap<Integer,Integer> map=new TreeMap<>();
		for(int i=0; i<n; i++){
			int a=sc.nextInt();
			if(map.containsKey(a)){
				map.put(a,map.get(a)+1);
			}else{
				map.put(a,1);
			}
			Integer tmp=map.lowerKey(a);
			if(tmp!=null){
				if(map.get(tmp)>1){
					map.put(tmp,map.get(tmp)-1);
				}else{
					map.remove(tmp);
				}
			}
		}
		int ans=0;
		for(int i:map.keySet()){
			ans+=map.get(i);
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 63196
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define F first
#define S second
#define _READ freopen("input.txt","r", stdin);
#define _FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
void solve()
{
    lli n,w;
    cin>>n>>w;
    vector<pair<lli,lli>> v(n);
    for(auto &i:v)
        cin>>i.F>>i.S;
    vector<lli> dp(w+1,0);
    //(weight, value)
    //1 1 1 1 1 1
    //dp[i]--> max price of items having weight i
    for(lli i=0;i<n;i++)//iterate over all items one by one
    {
        // weight of item be w
        // its value is v
        lli cur_weight=v[i].F,cur_price=v[i].S;

        for(lli j=w;j-cur_weight>=0;j--)
            dp[j]=max(dp[j],dp[j-cur_weight]+cur_price);
        // this item= some item whose weight is less than this
        //              + value of current item 
    }
    cout<<*max_element(dp.begin(),dp.end());
}















int main()
{
    // clock_t tStart = clock();
    // #ifndef ONLINE_JUDGE
    // _READ
    // #endif
    lli T;
    // cin>>T;
    T=1;
    while(T--)
        solve();
    
    // #ifndef ONLINE_JUDGE
    // cout<<fixed<<setprecision(5)<<"\nTime taken: "<<(double)(clock() - tStart)/CLOCKS_PER_SEC;
    // #endif
    
    return 0;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

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

		int n= sc.nextInt();
		int x=sc.nextInt();

		int ans = 0;
		int pos = 0;
		for (int i=0;i<n;i++) {
			if (pos<=x) {
				ans++;
			}
			pos+=sc.nextInt();

		}

		if (pos<=x) {
			ans++;
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 23764
#include <iostream>
#include<string>
#include<fstream>
#include<vector>
#include <algorithm>
#include <set>
#include <math.h>
using namespace ::std;
#define int long long 
vector<int > v;
signed  main()
{
	int n, k;
	
	cin >> n>>k;
	v.resize(k+1, -1);
	v[0] = 0;
	int f = 0;
	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		int w;
		int q;
		cin >> w>>q;
		for (int j = f; j >= 0; j--)
		{
			if (v[j] == -1)
				continue;
			if (j + w >k)
				continue;
			v[w + j] = max(v[w + j], v[j] + q);
			f = max(f, w + j);
			ans = max(ans, v[w + j]);
		}
	}
	cout << ans;
}
//   aaaddda

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll a,b,i,n,c=1;
    cin>>n;
    vector<ll>v;
    for(i=0;i<n;i++)
    {
        cin>>a;
        v.push_back(a);
    }
    b=v[0];
    for(i=1;i<n;i++)
    {
        if(v[i]<=b)
        {
            c++;
            b=v[i];
        }
    }
    cout<<c<<endl;
    return 0;
}


Measured memory_bytes: 2420
#include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
const int INF =1e7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, k, n) for (int i = (k); i < (int)(n); ++i)
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
lint f(int n){
    if(n==1){
        return 1;
    }
    return (n * f(n - 1))%MOD;
}
int main(){
    int n;
    cin >> n;
    cout << f(n) << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;

int main()
{
  cin.tie(0);
  int a, b, c;
  cin >> a >> b >> c;
  cout << (a * b / 2) << endl;
}

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

int main(){
	int info[2];
	int math[2];
	int science[2];
	int english[2];
	int S,T;
	cin>>info[0]>>math[0]>>science[0]>>english[0];
	cin>>info[1]>>math[1]>>science[1]>>english[1];
	S=info[0]+math[0]+science[0]+english[0];
	T=info[1]+math[1]+science[1]+english[1];
	if(S<T)cout<<T<<endl;
	else cout<<S<<endl;
	return 0;
}

Measured memory_bytes: 1164
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let v = read_vec::<usize>();
    let (n, m) = (v[0], v[1]);
    let mut students = vec![];
    for i in 0..n {
        let v = read_vec::<i64>();
        students.push((v[0], v[1]));
    }
    let mut checkpoints = vec![];
    for i in 0..m {
        let v = read_vec::<i64>();
        checkpoints.push((v[0], v[1]));
    }
    for (x, y) in students {
        let mut ans = 0;
        let mut min_dist = std::i64::MAX;
        for (i, &(cx, cy)) in checkpoints.iter().enumerate() {
            let dist = (cx - x).abs() + (cy - y).abs();
            if dist < min_dist {
                ans = i;
                min_dist = dist;
            }
        }
        println!("{}", ans + 1);
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 4352
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>
#include <limits>
#include <math.h>
using namespace std;

int main() {
    int a,b;
    cin >> a >> b;
    
    if(a <= 5){
        cout << 0 << endl;
    }
    else if(a <= 12){
        cout << b/2 << endl;
    }
    else{
        cout << b << endl;
    }
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<math.h>
#include<bitset>
#include <numeric>
using namespace std;
using ll=long long;
using ld=long double;
using pint=pair<int,int>;
using pll=pair<ll,ll>;
#define LONG_INF 9223372036854775807
#define INF 1000000000LL
#define EPS 1e-10
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define dump(a) rep(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define all(v) v.begin(),v.end()
#define pb push_back


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

    int S, W;
    cin >> S >> W;
    if (W>=S) cout << "unsafe" << endl;
    else cout << "safe" << endl;

    return 0;
}

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

using namespace std;

int main(){
    
    int a,b, x;

    scanf("%d %d %d", &a, &b, &x);

    if((a+b) >= x &&  b >= (x - a) && x >= a){
        printf("YES\n");
    }else{
        printf("NO\n");
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String s1=sc.nextLine();
    String s2=sc.nextLine();
    int ans=0;
    for(int i=0;i<3;i++){
      if(s1.charAt(i)==s2.charAt(i))
        ans++;
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 23764
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a = sc.nextInt();
		boolean ans = false;
		for (int i = 0; i <= a; i++) {
			if ((n - i) % 500 == 0) {
				ans = true;
				break;
			}
		}
		System.out.println(ans ? "Yes" : "No");
	}
}


Measured memory_bytes: 35828
#include <bits/stdc++.h>
#define ll long long
using namespace std;
/* vector <vector <ll>> v(2e6);
 vector <bool> vis(2e6,false);
 vector <bool> vis2(2e6,false);
 vector <bool> res(2e6,false);
 long long s=0;
  bool flag=true;
void dfs(int x,int n)
{
      vis[x]=true;
      if(x==n-1)
        s++;
    for(int i=0;i<v[x].size()&&flag;i++)
        {
            if(!vis[v[x][i]])
           {
               dfs(v[x][i],n);
           }
           else if(v[x][i]==n-1)
            s++;
        }
}
*/

int main()
{
 ll t,n,m,k,x,l,r,i,sum=0,y,sx,sy,ex,ey,ans=0;
 cin>>n>>m>>k;
 x=n/m;
 if(n%m!=0)
    x++;
 cout<<x*k;
}




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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  ll n, t;
  cin >> n;
  vector<ll> ans(n + 1, 0);

  for (ll i = 1; i * i <= n; ++i) {
    for (ll j = i; j * j <= n; ++j) {
      for (ll k = j; k * k <= n; ++k) {
        if (i * i + j * j + k * k + i * j + i * k + j * k > n) break;

        t = i * i + j * j + k * k + i * j + i * k + j * k;
        if (i == j && j == k)
          ans[t]++;
        else if (i != j && i != k && j != k)
          ans[t] += 6;
        else
          ans[t] += 3;
      }
    }
  }

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


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

#define int long long
#define INT int
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second

long double a, b;
int n;

int f(int x)
{

    return floor((a * (long double)x) / b) - (int)a * floor(x / b);
}

signed main()
{

    cin >> a >> b >> n;
    int c1 = floor(n / 3.0);
    int c2 = floor((2.0 * n) / 3.0);
    int l = 0;
    int r = n;

    while (1)
    {
        int templ = f(c1);
        int tempr = f(c2);
        if (templ < tempr)
        {
            l = c1;
        }
        else if (templ > tempr)
        {
            r = c2;
        }
        else
        {
            break;
        }
        c1 = l + floor((r - l) / 3.0);
        c2 = l + floor((2.0 * (r - l)) / 3.0);

        if (c2 - c1 <= 1)
        {
            break;
        }
    }

    int ans = max(f(c1), max(f(c2), max(f(r), f(l))));
    if (r + 1 <= n)
    {
        ans = max(ans, f(r + 1));
    }
    if (r - 1 >= 0)
    {
        ans = max(ans, f(r - 1));
    }
    if (l + 1 <= n)
    {
        ans = max(ans, f(l + 1));
    }

    if (l - 1 >= 0)
    {
        ans = max(ans, f(l - 1));
    }
    if (c1 - 1 >= 0)
    {
        ans = max(ans, f(c1 - 1));
    }
    if (c1 + 1 <= n)
    {
        ans = max(ans, f(c1 + 1));
    }
    if (c2 - 1 >= 0)
    {
        ans = max(ans, f(c2 - 1));
    }
    if (c2 + 1 <= n)
    {
        ans = max(ans, f(c2 + 1));
    }

    cout << ans << endl;

    return 0;
}


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

int main(){
	int a,b;
	int s[5002],t[5002];
	scanf("%d%d",&a,&b);
	for(int i=0;i<a;i++){
		scanf("%d",&s[i]);
	}
	for(int i=0;i<b;i++){
		scanf("%d",&t[i]);
	}

	int ret=0;
	for(int i=0;i<b;i++){
		int p=0,q=i;
		int cnt=0;
		while(1){
			if(s[p]==t[q]){
				cnt++;
				p++;
				q++;
			}
			else {
				p++;
			}
			if(p==a)break;
		}
		ret=max(ret,cnt);
	}

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

Measured memory_bytes: 1064
# Problem C - Subarray Sum

# input
N, K, S = map(int, input().split())

# initialization
num_list = [S]*N

# check
for i in range(K, N):
    if S==10**9:
        num_list[i] = S - 1
    else:
        num_list[i] = S + 1

# output
print(" ".join(list(map(str, num_list))))


Measured memory_bytes: 15140
master = list(map(int, input().split()))
participant = []
criteria = master[1] - master[2]

for i in range(master[0]):
    participant.append(0)


for q in range(master[2]):
    answer = int(input()) - 1
    participant[answer] = participant[answer] + 1

for p in participant:
    if (criteria + p > 0):
        print("Yes")
    else:
        print("No")

Measured memory_bytes: 4732
#include <cstdio>

int main(){
    int a,b,n,k[100],res=0;

    
    for(a = 0; a <= 9; a++){
        for(b = 0; b <= 9; b++){
            k[a * 10 + b] = a + b;
        }
    }

    while(scanf("%d",&n) == 1){
        res = 0;
        for(a = 0; a <= 9; a++){
            for(b = 0; b <= 9; b++){
                for(int i = 0; i < 100; i++){
                    if( n == a + b + k[i] ) res++;
                }
            }
        }

        printf("%d\n", res);
    }
    return 0;
}

Measured memory_bytes: 1024
//#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<cstdio>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<utility>
#include<algorithm>
#include<cstring>
#include<sstream>
#include <iomanip>

typedef long long ll ;
typedef double db;
typedef unsigned long long ull ;
const double pi = 2*acos(0) ;

#define pf		  	printf
#define sf			  scanf
#define pb(a)         push_back(a)
#define for0(i,n)          for(int i=0;i<n;i++)
#define for1(i,n)          for(int i=1;i<=n;i++)
#define forab(a,b)       for(int i=a;i<=b;i++)
//#define gcd(a, b)     __gcd(a, b)
#define lcm(a, b)     ((a)*((b)/gcd(a,b)))
#define sq(a)		   (a)*(a)
#define nw				"\n"
#define abs(x)		fabs(x)
#define pcase(z,x)     cout<<"Case "<<z<<": "<<x<<"\n"
#define CIN	ios_base::sync_with_stdio(0); cin.tie(0)

using namespace std;

int main()
{
	ll a,b,n,x,mx;
	cin>>a>>b>>n;
	if(n>=b) x = b-1;
	else x = n;
	
	mx = ((a*x)/b);
	mx -= a*(x/b);
	
	cout<<mx<<nw;
	return 0;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
#define ll long long
#define ii pair<int, int>
#define pll pair<ll, ll>
#define N 200123
#define vi vector<int>
#define vii vector<ii>
#define vll vector<ll>
#define vpll vector<pll>
#define pb emplace_back
#define fs first
#define sc second
#define sz(x) ((int)((x).size()))
#define oo 100000012
#define mod 1000000007LL
#define M 10000123

using namespace std;

int n;

int main(){
    ios_base::sync_with_stdio(0);
int x;
n = 5;
    for(int i = 1; i <= n; ++i){
        cin >> x;
        if(x == 0) cout << i << '\n';
    }
    return 0;
}


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

using namespace std;

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

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

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

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


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

	ll n;
	cin >> n;
	ll a, b;
	cin >> a >> b;

	if ((b - a) % 2 == 1)
	{
		ll m = a - 1;
		m = min(m, n - b);
		cout << m + 1+ (b - a) / 2LL << endl;
	}
	else
	{
		cout << (b - a) / 2LL << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define NIL -1
typedef struct{
  int p;
  int l;
  int r;

}data;

void pre();
void in();
void post();
data A[25];
int main(){
  int n,i,id,left,right,root;
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    A[i].p=NIL;
    
  }

  
  for(i=0;i<n;i++){
    scanf("%d%d%d",&id,&left,&right);
    A[id].l=left;
    A[id].r=right;
    if(left!=NIL)A[left].p=id;
    if(right!=NIL)A[right].p=id;
	       
  }
 for(i=0;i<n;i++){
      if(A[i].p==NIL) root=i;
	}


 printf("Preorder\n");
 pre(root);
 printf("\n");
 printf("Inorder\n");
 in(root);
 printf("\n");
 printf("Postorder\n");
 post(root);
 printf("\n");
 return 0;
}

void pre(int root){
  if(root==NIL) return;
  printf(" %d",root);
  pre(A[root].l);
  pre(A[root].r);
  
}
void in(int root){
  if(root==NIL) return;
  in(A[root].l);
  printf(" %d",root);
  in(A[root].r);
  
}
void post(int root){
  if(root==NIL) return;
  post(A[root].l);
  post(A[root].r);
  printf(" %d",root);
}

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

int main() {
  int n,k;
  cin >> n >> k;
  vector<int> vec(n);
  for (int i=0;i<n;i++) {
    cin>>vec.at(i);
  }
  int ans=0;
  for (int x:vec) {
    if (x>=k) {
      ans++;
    }
  }
  cout<<ans<<endl;
}

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

int n, a[9]{3, 9, 2, 4, 8, 10, 6, 12};
int main()
{
	int i;
	cin >> n;
	if (n == 3) {cout << "2 5 63"; return 0;}
	if (n % 2) n--, cout << "30000 ";
	for (i = 0; i < n; i++) printf("%d ", a[i % 8] + i / 8 * 12);
    return 0;
}

Measured memory_bytes: 384
#[allow(unused_macros)]
macro_rules! get {
    ([$t:ty] ; $n:expr) => {
        (0..$n)
        .map(|_| get!([$t])).collect::<Vec<_>>()
    };
    ($($t:ty),+ ; $n:expr) => {
        (0..$n).map(|_| get!($($t),+)).collect::<Vec<_>>()
    };
    ([$t:ty]) => {
        rl().split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect::<Vec<$t>>()
    };
    ($t:ty) => {
        rl().parse::<$t>().unwrap()
    };
    ($($t:ty),*) => {
        {
            let line =rl();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap()),*)
        }
    };
}
fn rl() -> String {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.trim().to_string()
}

#[derive(Debug)]
enum Kind {
    D,
    S,
}
fn main() {
    const MOD: usize = 1000000007;
    let n = get!(usize);
    let s1: Vec<char> = get!(String).chars().collect();
    let s2: Vec<char> = get!(String).chars().collect();
    if n == 1 {
        println!("3");
        return;
    }
    if n == 2 {
        println!("6");
        return;
    }
    let mut ans;
    let mut ptr;
    let mut prev;
    if s1[0] == s2[0] {
        ans = 3;
        ptr = 1;
        prev = Kind::S;
    } else {
        ans = 6;
        ptr = 2;
        prev = Kind::D;
    }
    while ptr < n {
        match prev {
            Kind::D => {
                if s1[ptr] == s2[ptr] {
                    ans = (ans * 1) % MOD;
                    ptr += 1;
                    prev = Kind::S;
                } else {
                    ans = (ans * 3) % MOD;
                    ptr += 2;
                    prev = Kind::D;
                }
            }
            Kind::S => {
                if s1[ptr] == s2[ptr] {
                    ans = (ans * 2) % MOD;
                    ptr += 1;
                    prev = Kind::S;
                } else {
                    ans = (ans * 2) % MOD;
                    ptr += 2;
                    prev = Kind::D;
                }
            }
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>

using namespace std;

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

  vector <int> A(N);
  for (int i = 0; i < N; i++){
    cin >> A[i];
  }
  sort(A.begin(), A.end());

  vector <int> C;
  int cnt = 1;
  for (int i = 0; i < N; i++){
    if (A[i] == A[i + 1]){
      cnt++;
    }else{
      if (cnt != 1){
        C.push_back(cnt);
      }
      cnt = 1;
    }
  }
  
  if (cnt != 1){
    C.push_back(cnt);
  }
  C.push_back(1);
  
  int ans = 0;
  for (int i = 0; i < C.size() - 1; i++){
    if (C[i] % 2 != 0){
      ans += C[i] / 2;
    }else{
      ans += C[i] / 2;
      C[i + 1]--;
    }
  }
  
  
  cout << N - 2 * ans << endl;


  return 0;
}


Measured memory_bytes: 768
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

a, b, c, d = map(int, input().split())
ans = b - a + 1
ans -= b // c - (a - 1) // c
ans -= b // d - (a - 1) // d
ans += b // lcm(c, d) - (a - 1) // lcm(c, d)
print(ans)

Measured memory_bytes: 5048
s = gets.chomp
if s.size == 26
    t = []
    t << s[-1]
    24.downto(0) do |i|
        if t[-1] > s[i]
            print s[0..i-1] if i > 0
            t.each do |c|
                if c > s[i]
                    puts c
                    exit
                end
            end
        end
        t << s[i]
    end
    puts -1
else
    print s
    a = Hash.new(false)
    s.size.times do |i|
        a[s[i]] = true
    end
    c = "a"
    loop do
        if !a[c]
            puts c
            break
        end
        c.succ!
    end
end

Measured memory_bytes: 1788
N=int(input())
S = []
for i in range(N):
  S.append(input())

import collections
c = collections.Counter(S)
values, counts = zip(*c.most_common())
#print(c)
if len(counts)==1:
  print(values[0])
else:
  n = 0
  for j in range(1,N):
    if counts[j]!=counts[j-1]:
      n = j
      break
    else:
      n = j+1
  #print(n)
  ans = list(values[:n])
  ans = sorted(list(ans))
  #print(ans)
  for k in ans:
    print(k)

Measured memory_bytes: 59532
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREP1(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(c) begin(c), end(c)

int _ = (
#ifndef LOCAL
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
#endif
    std::cout.precision(10), std::cout.setf(std::ios::fixed));

using ll = long long;
using ld = long double;
// constexpr auto mod = 1000000007;
using namespace std;

int main() {
  int A, B, C, X;
  cin >> A >> B >> C >> X;
  int answer = 0;
  REP(a, A + 1) {
    REP(b, B + 1) {
      REP(c, C + 1) {
        if (500 * a + 100 * b + 50 * c == X) {
          answer++;
        }
      }
    }
  }
  cout << answer << endl;
  return 0;
}


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

#define INF INT_MAX
#define UINF UINT_MAX
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()

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

using namespace std;

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

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

    int temp = a;
    a = b;
    b = temp;

    temp = a;
    a = c;
    c = temp;

    cout << a <<" " << b  << " "<< c << endl;
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>

using namespace std;

#define min(a,b) (a < b ? a : b)

int main(void){
    int n;
    long sunuke=0,araisan=0,d=INT_FAST64_MAX;
    cin >> n;
    vector<long> a;
    int i;
    for(i=0;i<n;i++){
        long x;
        cin >> x;
        a.push_back(x);
        sunuke += x;
    }
    for(i=0;i<n-1;i++){
        sunuke -= a[i];
        araisan += a[i];
        d = min(d,abs(sunuke - araisan));
    }
    cout << d << endl;
}

Measured memory_bytes: 2420
import numpy as np
n,k = [int(i) for i in input().split()]

ans = np.array([0 for _ in range(n)])

for i in range(k):
    d = int(input())
    al = [int(i) -1 for i in input().split()]
    for j in al:
        ans[j] = 1 if ans[j] == 0 else ans[j]
        

print(n - np.count_nonzero(ans))

Measured memory_bytes: 27128
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for _ in range(M)]

N,M,C=map(int, input().split())
B=list(map(int, input().split()))
A=[list(map(int,input().split())) for _ in range(N)]

ans = 0

for i in range(N):
    tmp = 0
    for j in range(M):
        tmp += A[i][j]*B[j]
    if tmp+C>0:
        ans += 1

print(ans)


Measured memory_bytes: 72692
import sys
import re
import math
import collections
import decimal
import bisect
import itertools

# import copy
# import heapq
# from collections import deque
# import decimal

# sys.setrecursionlimit(100001)
INF = sys.maxsize
# MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    s = input()
    n = ni()

    front = ""
    rear = ""

    cnt = 0
    for i in range(n):
        d = list(sys.stdin.readline().split())
        if int(d[0]) == 1:
            cnt = (cnt + 1) % 2
        else:
            if not cnt:
                if int(d[1]) == 1:
                    front = d[2] + front
                else:
                    rear = rear + d[2]
            else:
                if int(d[1]) == 1:
                    rear = rear + d[2]
                else:
                    front = d[2] + front

    if cnt:
        s = s[::-1]
        front = front[::-1]
        rear = rear[::-1]
        ans = rear + s + front
    else:
        ans = front + s + rear

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 6496
#include<iostream>
#include<cstring>
#include<queue>
using namespace std;
int x[900][900], h, w, a, y[900], s;
queue<int>Q;
queue<int>R;
int main() {
	while (true) {
		memset(x, 0, sizeof(x));
		memset(y, 0, sizeof(y));
		cin >> w >> h;
		if (!w) { break; }
		for (int i = 0; i < h * 2 - 1; i++) {
			if (i % 2 == 1) {
				for (int j = 0; j < w; j++) {
					cin >> a;
					if (a == 0) {
						x[(i / 2) * 30 + j][(i / 2 + 1) * 30 + j] = 1;
					}
				}
			}
			else {
				for (int j = 0; j < w - 1; j++) {
					cin >> a;
					if (a == 0) {
						x[(i / 2) * 30 + j][(i / 2) * 30 + j + 1] = 1;
					}
				}
			}
		}
		Q.push(0);
		s = 1;
		y[0] = 1;
		while (y[(h-1) * 30 + (w-1)] == 0) {
			while (!Q.empty()) {
				a = Q.front();
				for (int j = 0; j < 900; j++) {
					if ((x[a][j] == 1 || x[j][a] == 1) && y[j] == 0) {
						y[j] = 1;
						R.push(j);
					}
				}
				Q.pop();
			}
			while (!R.empty()) {
				Q.push(R.front());
				R.pop();
			}
			s++;
			if (s >= 1000) { s = 0; break; }
		}
		while (!Q.empty()) {
			Q.pop();
		}
		cout << s << endl;
	}
}

Measured memory_bytes: 4388
#include <iostream>
#include <string>

using namespace std;

bool check(string str_f)
{
	if (str_f.empty() == 1)return true;
	for (unsigned int i = 0; i<str_f.length() ; i++)
	{
		if ((str_f[i] == '(' && str_f[i + 1] == ')') || (str_f[i] == '[' && str_f[i + 1] == ']'))
		{
			str_f.erase(str_f.begin() + i);
			str_f.erase(str_f.begin() + i);
			return check(str_f);         
		}
	}
	return false;
}

int main()
{
	while (true)
	{
		string str = "";
		string str_f = "";
		getline(cin, str);
		if (str[0] == '.')break;
		for (unsigned int i = 0; i < str.length(); i++)
		{
			if (str[i] == '(' ||
				str[i] == '[' ||
				str[i] == ')' ||
				str[i] == ']') str_f += str[i];
		}
		int a = str_f.length();
		if (a % 2 == 1)							
		{
			cout << "no" << endl;
			continue;
		}
		if (check(str_f))cout << "yes" << endl;
		else cout << "no" << endl;
	}
	return 0;
}

Measured memory_bytes: 3108
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
using namespace std;
 
signed main()
{
	string s;
	cin >> s;
 
	for (int i = 0; i < s.length() - 8; i++) cout << s[i];
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    int N,M;


    scanf("%d %d",&N,&M);
    int flag[N],l,hight[N],i,j,A,B;
    
    for(l=0;l<N;l++){
        flag[l]=0;
    }

    for(i=0;i<N;i++){
        scanf("%d",&hight[i]);
    }

    for(j=0;j<M;j++){
        scanf("%d %d",&A,&B);
        if(hight[A-1]-hight[B-1]==0){
            flag[A-1]=1;
            flag[B-1]=1;
        }
        else if(hight[A-1]-hight[B-1]>0){
            flag[B-1]=1;
        }
        else{
            flag[A-1]=1;
        }
    }

    int count=0,m;
    for(m=0;m<N;m++){
        if(flag[m]==0){
            count++;
        }
    }

    printf("%d",count);
    return 0;
}

Measured memory_bytes: 2512
n,m = map(int,input().split())
drink = []
for _ in range(n):
    a,b = map(int,input().split())
    drink.append((a,b))
d = sorted(drink)

ans = 0
x = 0

for t in d:
    if x+t[1] < m:
        ans += t[0]*t[1]
        x += t[1]
    else:
        ans += t[0]*(m-x)
        break

print (ans)


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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()

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

  double W,H,x,y;
  cin>>W>>H>>x>>y;
  cout<<fixed<<setprecision(10)<<1.*H*W/2;
  cout<<" ";
  if(W/2==x&&H/2==y)cout<<1<<endl;
  else cout<<0<<endl;
  return 0;
}


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

int main() {
  int N, K;
  cin >> N >> K;
  int A[N], d[N] = {0};
  for (int i = 0; i < N; i++){
    cin >> A[i];
    d[A[i]]++;
  }

  sort(d, d + N, greater<int>());
  
  int S = 0;
  for (int i = 0; i < N; i++) {
    if (i < K) S += d[i];
  }
  
  cout << N - S << endl;
}

Measured memory_bytes: 1792
n=int(input())
L=[0,0,0,0]
x = [input() for i in range(n)]

for i in range(n):

  if x[i]=='AC':
    L[0]=L[0]+1
  elif x[i]=='WA':
    L[1]=L[1]+1
  elif x[i]=='TLE':
    L[2]=L[2]+1
  else:
    L[3]=L[3]+1


print('AC'+' x '+str(L[0]))
print('WA'+' x '+str(L[1]))
print('TLE'+' x '+str(L[2]))
print('RE'+' x '+str(L[3]))



Measured memory_bytes: 16212
#include <stdio.h>

#define lli long long int

int main() {
	lli n, m;
	scanf("%lld %lld", &n, &m);
	if ((n < 2) && (m < 2))
		puts("1");
	else if (n < 2)
		printf("%lld\n", m - 2);
	else if (m < 2)
		printf("%lld\n", n - 2);
	else
		printf("%lld\n", (n - 2) * (m - 2));
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
const int MOD = (int) 1e9 + 7;
const int INF = (int) 1e9+21;
const long long LINF = (long long) 1e18;
const long double PI = 2 * acos((long double)0);
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
#define Mahmud main()
#define endl "\n"
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define SQR(x) ((LL)(x) * (x))
#define RESET(a,b) memset(a,b,sizeof(a))
#define alla(arr,n) arr,arr+n
#define sz(x) ((int)(x).size())
#define all(x) x.begin(),x.end()
#define pb push_back
///Debug
#define dbg1(x) std::cerr<<#x<<"="<<(x)<<endl;
#define dbg2(x,y) std::cerr<<#x<<"="<<(x)<<','<<#y<<"="<<(y)<<endl;
#define dbg3(x,y,z) std::cerr<<#x<<"="<<(x)<<','<<#y<<"="<<(y)<<','<<#z<<"="<<(z)<<endl;
#define dbgArr(arr,n) cerr<<#arr<<"=["; printArray(arr,n,0,93); cerr<<endl;
///traversing
#define rep(n) for(int i=0;i<n;++i)
#define trv(i,t) for(__typeof(t.begin()) i=t.begin();i!=t.end();++i)
///necessary functions
inline ll Int()
{
    ll _x=0,_tmp=1;
    char _tc=getchar();
    while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
    if( _tc == '-' ) _tc=getchar(), _tmp = -1;
    while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
    return _x*_tmp;
}
inline long double Double()
{
    long double d;
    scanf("%Lf",&d);
    return d;
}
ll lcm(ll a,ll b)
{
    return a/__gcd(a,b)*b;
}
int ton(string x)
{
    int y;
    std::istringstream ss(x);
    ss >> y;
    return y;
}
template<typename T>
string tostring(T x)
{
    ostringstream ss;
    ss << x ;
    return ss.str();
}

///Current Code vars
#define N 100010
long long n,k,c,d;
int arr[N+1],brr[N+1];
///Current Code functions

string s;

void solve()
{
    n = Int();
    k = Int();
    if(n==2)
    {
        if(k==2)
            puts("Yes");
        else puts("No");
    }
    else if(n==4 || n==6 || n==11 || n==9)
    {
        if(k==4 || k==6 || k==11 || k==9)
        {
            puts("Yes");
        }
        else puts("No");
    }
    else if(n >= 1 && n<= 12)
    {
        if(k==4 || k==6 || k==11 || k==9 || k==2)
        {
            puts("No");
        }
        else puts("Yes");
    }
}

int Mahmud
{
    // ios_base::sync_with_stdio(0); //cin.tie(0);
  //#ifdef _LOCAL_
    //freopen("in", "r", stdin);
    // freopen("out", "w", stdout);
  //while(1)
    solve();
  //#ifdef _LOCAL_
    //printf("\nTime elapsed: %dms", 1000 * clock() / CLOCKS_PER_SEC);
  //#endif
    return 0;
}


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

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<double> vd;
typedef vector<vd> vdd;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define debug_print(x...) cerr << "line " << __LINE__ << " : "; debug_print_in(x);

template <typename First>
void debug_print_in(First first){
  cerr << first << endl;
  return;
}

template <typename First, typename... Rest>
void debug_print_in(First first, Rest... rest){
  cerr << first << " ";
  debug_print_in(rest...);
  return;
}

void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

template <typename First>
void OUT(First first){
  cout << first << endl;
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

template<class t, class u> t chmax(t&a,u b){if(a<b)a=b; return a;};
template<class t, class u> t chmin(t&a,u b){if(a>b)a=b; return a;};
int popcount(int t){return __builtin_popcount(t);} //GCC
int popcount(ll t){return __builtin_popcountll(t);} //GCC

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cerr << VEC[i] << " ";
  }
  cerr << endl;
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i,MAT.size()){
    REP(j,MAT[i].size()){
      cerr << MAT[i][j] << " ";
    }
    cerr << endl;
  }
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll H, W;
  IN(H,W);
  vvll dp(H, vll(W, 0));
  dp[0][0] = 1;

  vvb A(H, vb(W, true));

  REP(i,H){
    string str;
    IN(str);
    REP(j,W){
      if(str[j]=='#') A[i][j]=false;
    }
  }

  REP(i,H) REP(j,W){
    if(!A[i][j]) continue;
    if(i+1<H) if(A[i+1][j]){
      dp[i+1][j] += dp[i][j];
      dp[i+1][j] %= MOD;
    }
    if(j+1<W) if(A[i][j+1]){
      dp[i][j+1] += dp[i][j];
      dp[i][j+1] %= MOD;
    }
  }

  OUT(dp[H-1][W-1]%MOD);

  return 0;
}

Measured memory_bytes: 8320
#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,m;
    cin >> n >> m;
    vector<int> l(m);
    vector<int> r(m);
    rep(i,m) cin >> l.at(i) >> r.at(i);
    vector<int> a(n+1);
    rep(i,m){
        a.at(0)++;
        a.at(l.at(i)-1)--;
        a.at(r.at(i))++;
        a.at(n)--;
    }
    vector<int> b(n+1);
    int sum=0;
    rep(i,n){
        sum+=a.at(i);
        b.at(i)=sum;
    }
    int ans=0;
    rep(i,n){
        if(b.at(i)==0)ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 4796
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#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 rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr ll inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
bool isprime(int n) { //素数判定
    if(n==1)return false;
    if(n==2)return true;
    for(int i = 2;i<=sqrt(n);i++) {
        if(n%i==0) return false;
    }
    return true;
}
/* ----------------------end----------------------- */
#pragma endregion
signed main() {
    int d,t,s;cin >> d >> t >> s;
    if(t*s>=d) cout << "Yes\n";
    else cout << "No\n";
    return 0;
}

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

#ifdef NOKI
#include "debug.h"
#else
#define debug(args...)
#endif

int main(){
    string s; cin>>s;
    if(*s.rbegin() == 's') s = s + 'e';
    cout<<s<<"s\n";
    return 0;
}

Measured memory_bytes: 3552
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
inline ll calc(ll x) {
	return (x+1)*x/2; 
}
int main() {
	ll n,ans;
	cin>>n;
	ans=calc(n)-calc(n/3)*3-calc(n/5)*5+calc(n/15)*15;
	cout<<ans<<endl;
	return 0;
} 

Measured memory_bytes: 3620
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Kein Yukiyoshi
 */

#include "bits/stdc++.h"
#define int long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(obj) begin(obj), end(obj)
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
#define LOWER_BOUND(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define UPPER_BOUND(A, key) distance(A.begin(), upper_bound(ALL(A), key))

using namespace std;
using ll      = long long;
const int MOD = (int)(1e9 + 7);
const int INF = (int)(1e13 + 7);

int ceil_(int a, int b) { return (a + (b - 1)) / b; }
int positive_surplus(int &a) { return (a + MOD) % MOD; }
int bpm(int x, unsigned int y) {
  if (x == 0) return 0;
  if (y == 0) return 1;
  int ans   = 1;
  int digit = (int)((log((double)y) / log((double)2) / 1 + 1));
  x %= MOD;
  for (unsigned int i = 0; i < digit; i++) {
    if (((y >> i) & 1u) == 1) ans = ans * x % MOD;
    x = x * x % MOD;
  }
  return ans;
}
template <class T>
void cumulative_sum(T &container) {
  for (int i = 0; i < container.size() - 1; i++) container[i + 1] += container[i];
}

class AHitachiString {
public:
  static void solve(std::istream &cin, std::ostream &cout) {
    string S;
    cin >> S;
    string temp{};
    rep(i, 5) {
      temp += "hi";
      if (temp == S) {
        cout << "Yes" << endl;
        return;
      }
    }
    cout << "No" << endl;
  }
};


signed main() {
  AHitachiString solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
 
public class Main {
    public static String solve(int N, int Yen){
        for(int x=0;x<=Yen/10000;x++){//max 2000
        	for(int y=0;y<=(Yen-x*10000)/5000;y++){//max 4000
        	    int z = (Yen - x*10000 - y*5000) /1000;
        	    if(x+y+z==N) return x+" "+y+" "+z;
        	}
        }
        return "-1 -1 -1";
    }
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int Yen = sc.nextInt();
        
        System.out.println(solve(N,Yen));
    }
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1e9+7;
const int INF=1e9;
const ll LINF=(ll)1e18;

int main(){
    string s;
    cin>>s;
    int n=s.size();
    for(int i=0;i<=7;i++){
        if(s.substr(0,i)+s.substr(n-(7-i))=="keyence"){
            cout<<"YES"<<endl;
            return 0;
        }
    }
    cout<<"NO"<<endl;
}


Measured memory_bytes: 256
#a, b, k = map(int, input().split( ))
n = int(input())
A = list(map(int,input().split()))

s = 0
m = 10**9
nimus = 0
for a in A:
  s += abs(a)
  m = min(m,abs(a))
  if a <0:
    nimus += 1

if nimus%2 == 0:
  print(s)
else:
  print(s-2*m)
  

Measured memory_bytes: 20108
///...................SUBHASHIS MOLLICK...................///
///.....DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING....///
///.............ISLAMIC UNIVERSITY,BANGLADESH.............///
///....................SESSION-(14-15)....................///
#include<bits/stdc++.h>
using namespace std;
#define sf(a) scanf("%d",&a)
#define sf2(a,b) scanf("%d %d",&a,&b)
#define sf3(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define pf(a) printf("%d",a)
#define pf2(a,b) printf("%d %d",a,b)
#define pf3(a,b,c) printf("%d %d %d",a,b,c)
#define sfl(a) scanf("%lld",&a)
#define sfl2(a,b) scanf("%lld %lld",&a,&b)
#define sfl3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)
#define pfl(a) printf("%lld",a)
#define pfl2(a,b) printf("%lld %lld",a,b)
#define pfl3(a,b,c) printf("%lld %lld %lld",a,b,c)
#define nl printf("\n")
#define   timesave              ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
#define pb push_back
#define MPI map<int,int>mp;
#define fr(i,n) for(i=0;i<n;i++)
#define fr1(i,n) for(i=1;i<=n;i++)
#define frl(i,a,b) for(i=a;i<=b;i++)
#define tz 100000
#define clr0(a) memset(a,0,sizeof(a))
#define clr1(a) memset(a,-1,sizeof(a))
/*primes in range 1 - n
1 - 100(1e2) -> 25 pimes
1 - 1000(1e3) -> 168 primes
1 - 10000(1e4) -> 1229 primes
1 - 100000(1e5) -> 9592 primes
1 - 1000000(1e6) -> 78498 primes
1 - 10000000(1e7) -> 664579 primes
large primes ->
104729 1299709 15485863 179424673 2147483647 32416190071 112272535095293 48112959837082048697
*/
//freopen("Input.txt","r",stdin);
//freopen("Output.txt","w",stdout);
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
main()
{
    timesave;
    ll n,i,j,k,sum=0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n;j++)
        {
            for(k=1;k<=n;k++)
            {
                ll x=__gcd(i,__gcd(j,k));
                sum+=x;
            }
        }
    }
    cout<<sum<<endl;
}






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

int main() {
    int N;
    cin >> N;
    int a = N % 10;
    if (a == 2 || a == 4 || a == 5 || a == 7 || a == 9) {
        cout << "hon" << endl;
    } else if (a == 0 || a == 1 || a == 6 || a == 8) {
        cout << "pon" << endl;
    } else {
        cout << "bon" << endl;
    }
    return 0;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std;
string a;
int main()
{    
	cin>>a;
	for(int i=0;i<=a.size();i++)
	{
		if(a[i]=='C')
		{
			for(int j=i+1;j<=a.size();j++)
			if(a[j]=='F')
			{
				cout<<"Yes";
				return 0;
			}
		}
	}
	cout<<"No";
}

Measured memory_bytes: 256