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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n;
    int cards[500]={};
    cin>>n;
    REP(i,n){
        char c;
        int a;
        cin>>c>>a;
        switch (c)
        {
        case 'S': a+=100; break;
        case 'H': a+=200; break;
        case 'C': a+=300; break;
        case 'D': a+=400; break;
        default:
            break;
        }

        cards[a]++;
    }

    FOR(i,1,4+1){
        char c;
        switch (i)
        {
        case 1: c='S'; break;
        case 2: c='H'; break;
        case 3: c='C'; break;
        case 4: c='D'; break;
        default:
            break;
        }
        FOR(j,1,13+1){
            if(cards[i*100+j]==0){
                cout << c <<" "<<j<< endl;
            }
        }
    }
    return 0;
}


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

signed main() {

  int K;
  string S;
  cin >> K >> S;

  if(S.length() <= K){
    cout << S << endl;
  }else{
    cout << S.substr(0, K) << "..." << endl;
  }
}


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

using namespace std;

bool check_ACGTchar(char c);

int main(){
    string s;
    cin >> s;
    int count = 0;
    int max_count = 0;

    for(int i = 0; i < s.size(); i++){
        if(check_ACGTchar(s[i])){
            count++;   
        }else{
            if(count > max_count)max_count = count;
            count = 0;
        }
    }
    max_count = max(max_count,count);
    cout << max_count << endl;
    return 0;
}

bool check_ACGTchar(char c){
    if(c == 'A' || c == 'C' || c == 'G' || c == 'T')return true;
    else return false;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a < b){
            System.out.println("a < b");
        }else if(a > b){
            System.out.println("a > b");
        }else{
            System.out.println("a == b");
        }
    sc.close();
    }

}


Measured memory_bytes: 26128
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = (n)-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = (s); i < (n); ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class S,class T> istream& operator>>(istream &is,pair<S,T> &p) { return is >> p.first >> p.second; }
template<class S,class T> ostream& operator<<(ostream &os,const pair<S,T> &p) { return os<<'{'<<p.first<<","<<p.second<<'}'; }
template<class T> istream& operator>>(istream &is,vector<T> &v) { for(T &t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) { os<<'[';rep(i,v.size())os<<v[i]<<(i==v.size()-1?']':','); return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
template<class T> bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n;
    ll k;
    cin >> n >> k;
    vi a(n),f(n);
    cin >> a >> f;
    sort(all(f));
    sort(all(a));
    reverse(all(a));
    ll ok = linf,ng = -1;
    auto F = [&](ll x) {
        ll cnt = 0;
        rep(i,n) cnt += max(0LL,a[i]-x/f[i]);
        return cnt <= k;
    };
    while(abs(ok-ng) > 1) {
        ll mid = (ng+ok)/2;
        if(F(mid)) ok = mid;
        else ng = mid;
    }
    cout << ok << endl;
}


Measured memory_bytes: 1792
#include <cstdio>
#include <vector>
using namespace std;

int main()
{
    int N, X;
    scanf("%d%d", &N, &X);
    vector<int> L(N);
    for (int i = 0; i < N; ++i)
    {
        scanf("%d", &L[i]);
    }
    int ans = 1;
    int d = 0;
    for (int i = 0; i < N; ++i)
    {
        d = d + L[i];
        if (d <= X) ++ans;
    }
    printf("%d", ans);
    return 0;
}


Measured memory_bytes: 256
from collections import Counter
N,MOD=map(int,input().split())
S=input()
res=0
if MOD==2 or MOD==5:
    for i in range(N):
        if(int(S[N-i-1])%MOD==0):
            res+=N-i
else:
    Cum=[0]*(N+1)
    for i in range(N):
        Cum[i+1]=(Cum[i]+int(S[N-i-1])*pow(10,i,MOD))%MOD
    c=Counter(Cum).most_common()
    for a,b in c:
        res+=b*(b-1)//2
print(res)

Measured memory_bytes: 12388
#include <vector>
#include <math.h>
#include <iostream>

using namespace std;

long long lpath[200001];
vector<vector<long long> > next_node(200001);


long long dfs(int node){

  if(lpath[node] !=  -1){
    return lpath[node];
  }

  long long max_path = 0;
  for(int i = 0; i < next_node[node].size(); i++){
    long long path = dfs(next_node[node][i]);
    max_path = (long long)max(max_path, path + 1);
  }

  lpath[node] = max_path;
  return max_path;

}

void print(int N){
  for(int i = 1; i <= N; i++){
    cout << lpath[i] << " ";
    cout << endl;
    for(int j = 0; j < next_node[i].size(); j++){
      cout << next_node[i][j] << " " ;
    }
    cout << endl;
  }

}

int main(){

  int N, M;
  cin >> N >> M;

  for(int i = 0; i < M; i++){
    int a, b;
    cin >> a >> b;
    next_node[a].push_back(b);
  }

  for(int i = 1; i <= N; i++){
    if(next_node[i].size() == 0) lpath[i] = 0;
    else lpath[i] = -1;
  }

  //print(N);
  
  long long max_path = 0;
  for(int i = 1; i <= N; i++){
    max_path = (long long)max(max_path, dfs(i));
  }

  //print(N);
  
  cout << max_path << endl;

  return 0;

  
}


Measured memory_bytes: 10880
#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N, M = map(int, readline().split())
x = M * (M - 1) // 2
x += N * (N - 1) // 2
print(x)

Measured memory_bytes: 2940
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <vector>

static const int IINF = 1 << 30;
static const long long LINF = 1LL << 60;
static const long long MOD = 1.0e+9 + 7;

template <typename T> std::vector<T> vectors(std::size_t n, T val) {
  return std::vector<T>(n, val);
}

template <typename T, typename... Args>
auto vectors(std::size_t n, Args... args) {
  return std::vector<decltype(vectors<T>(args...))>(n, vectors<T>(args...));
}

template <class T> inline bool chmin(T &a, const T &b) {
  return (a > b) ? a = b, true : false;
}

template <class T> inline bool chmax(T &a, const T &b) {
  return (a < b) ? a = b, true : false;
}

template <class T> inline void chadd(T &a, const T &b) {
  a += b, a %= MOD;
  // TODO minus case
}

template <class T>
std::ostream &operator<<(std::ostream &s, const std::vector<T> &v) {
  if (v.empty())
    return s;
  s << *v.begin();
  for (auto iter = v.begin() + 1; iter != v.end(); ++iter)
    if (std::is_fundamental<T>::value)
      s << " " << *iter;
    else
      s << std::endl << *iter;
  return s;
}

int main() {
  // Input
  int N;
  std::cin >> N;
  std::vector<int> p(N);
  for (int i = 0; i < N; ++i)
    std::cin >> p[i];

  // Main
  int res = 0;
  for (int i = 0; i < N; ++i) {
    if (p[i] != (i + 1))
      res += 1;
  }

  // Output
  if (res <= 2)
    std::cout << "YES" << std::endl;
  else
    std::cout << "NO" << std::endl;

  return 0;
}


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

int main(void){
    int n, m, sum = 0, result = 0;
    
    cin >> n >> m;
    
    vector<int> k(m), p(m), d(n), count(m);
    vector<vector<int>> s(m, vector<int>(n));
    
    rep(i, m){
        cin >> k.at(i);
        rep(j, k.at(i)){
            cin >> s.at(i).at(j);
        }
    }
    
    rep(i, n){
        d.at(i) = 0;
    }
    
    rep(i, m){
        cin >> p.at(i);
        count.at(i) = 0;
    }
    
    rep(i, n+1){
        do{
            rep(j, n){
                if(d.at(j) == 1){
                    rep(h, m){
                        rep(l, k.at(h)){
                            if(s.at(h).at(l) == j + 1){
                                count.at(h)++;
                            }
                        }
                    }
                }
            }
            rep(j, m){
                if(p.at(j) == count.at(j)%2){
                    sum++;
                }
                if(sum == m){
                    result++;
                }
                count.at(j) = 0;
            }
            sum = 0;
        }while(prev_permutation(d.begin(), d.end()));

        if(i != n){
            d.at(i) += 1;
        }
    }
    
    cout << result << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
long long int mod=1e9+7;
int main(){
	int n;
	cin>>n;
	int a[n],count=0;
	for(int i=0;i<n;i++)
	cin>>a[i];
	int min=20000005;
		for(int i=0;i<n;i++){
		if(a[i]<=min){
		count++;
		min=a[i];
	}
		}
	cout<<count;
}
		


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define fi first
#define se second
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
// head

const int N=201000;

VI e[N];
int n,cnt,dfn[N],low[N],st[N],bel[N],top,ind;
bool ins[N];
int x,a,o;
void tarjan(int u) {
	dfn[u]=low[u]=++ind;
	ins[u]=1;
	st[++top]=u;
	rep(i,0,SZ(e[u])) {
		int v=e[u][i];
		if (!dfn[v]) tarjan(v),low[u]=min(low[u],low[v]);
		else if (ins[v]) low[u]=min(low[u],low[v]);
	} 
	if (dfn[u]==low[u]) {
		++cnt;
		while (1) {
			bel[st[top]]=cnt;
			ins[st[top]]=0;
			if (st[top--]==u) break;
		}
	}
}

int main() {
	scanf("%d%d%d%d",&n,&x,&a,&o);
	if (x==0) {
		puts("No");
		return 0;
	}
	int m=1<<(n+1);
	rep(i,0,m) rep(j,i,m) {
		if ((i&j)==a) {
			e[i].pb(j^x);
			e[j].pb(i^x);
		}
		if ((i|j)==o) {
			e[i].pb(j^x);
			e[j].pb(i^x);
		}
	}
	rep(i,0,m) if (!dfn[i]) tarjan(i);
	VI ans;
	rep(i,0,m) {
		if (bel[i]==bel[i^x]) {
			puts("No");
			return 0;
		}
		if (bel[i]<bel[i^x]) ans.pb(i);
	}
	puts("Yes");
	rep(i,0,(m/2)) printf("%d%c",ans[i]," \n"[i==m/2-1]);
}


Measured memory_bytes: 73864
#include<iostream>
#include<cmath>
#include<vector>
#include<bitset>

using namespace std;

int main(){
    int x,n;
    cin >> x>> n;
    vector<int> a(102,0);
    int p;

    for(int i=0;i<n;i++){
        cin >> p;
        a.at(p)=1;
    }
    int minans;
    for(int j=x+1;j<102;j++){
        if(a.at(j)==0){
            minans=j;
            break;
        }
    }
    for(int j=x;j>=2*x-minans;j--){
        if(a.at(j)==0){
            minans=j;
            break;
        }
    }
    cout <<  minans << endl;
    return 0;
}

Measured memory_bytes: 3140
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<functional>
using namespace std;
int main(void){
	long long n,k;
	long long x[50];
	long long y[50];
	vector<long long>xx;
	vector<long long>yy;
	long long xx1, xx2, yy1, yy2;
	long long ans;
	long long s;

	scanf("%lld %lld",&n,&k);
	for (int i = 0; i < n; i++){
		scanf("%lld %lld", &x[i],&y[i]);
		xx.push_back(x[i]);
		yy.push_back(y[i]);
	}
	sort(xx.begin(), xx.end());
	sort(yy.begin(), yy.end());
	ans = 9000000000000000000;
	for (int x1 = 0; x1 < n; x1++){
		xx1 = xx[x1];
		for (int x2 = x1; x2 < n; x2++){
			xx2 = xx[x2];
			for (int y1 = 0; y1 < n; y1++){
				yy1 = yy[y1];
				for (int y2 = y1; y2 < n; y2++){
					yy2 = yy[y2];
					s = 0;
					for (int i = 0; i < n; i++)if (xx1 <= x[i] && x[i] <= xx2&&yy1 <= y[i] && y[i] <= yy2)s++;
					if (s >= k){
						if ((xx2 - xx1)*(yy2 - yy1) < ans)ans = (xx2 - xx1)*(yy2 - yy1);
					}
				}
			}
		}
	}

	printf("%lld\n", ans);

	return 0;
}



Measured memory_bytes: 256
//#include<bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>
#include <utility>
#include <climits>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define FOR(i, a, b) for(int i = a; i < b; ++i)
#define F first
#define S second
#define OUT(x) cout << (x) << "\n"
using namespace std;
using point = pair< int,int >;
using ll = long long;

int main() {
    string a, b, c;
    cin >> a >> b >> c;

    const int dif = 'a' - 'A';

    printf("%c%c%c\n", a[0] - dif, b[0] - dif, c[0] - dif);
    return 0;
}



Measured memory_bytes: 256
def calc(x, y)
    (0..x).each{|tsuru|
        kame = x - tsuru
        if (tsuru * 2 + kame * 4 == y) then
            return "Yes"
        end
    }

    return "No"
end

X, Y = gets.split.map(&:to_i)
puts calc(X, Y)

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

int main()
{
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n ;i++) cin >> a[i];

    int ans = 1e9;
    for(int i = -100; i <= 100; i++){
        int tmp = 0;
        for(int j = 0; j < n; j++){
            tmp += pow(i-a[j],2);
        }
        ans = min(ans,tmp);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);

void main()
{
    long n;
    scan(n);
    auto a = aryread();
    long cnt;
    foreach (i; 0 .. n)
    {
        if ((i % 2 == 0) && (a[i] % 2 != 0))
            cnt += 1;
    }
    writeln(cnt);
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}


Measured memory_bytes: 3644
use proconio::input;

fn main() {
    input! {
        a: i32,
        b: i32,
    }

    solve(a, b);
}

fn solve(a: i32, b: i32) {
    let mut ans = 0;
    let mut con = 1;
    while con < b {
        con -= 1;
        con += a;
        ans += 1;
    }

    println!("{}", ans);
}


Measured memory_bytes: 2116
#include<stdio.h>

int main(){
  int i,l,a;
  char s[16];
  scanf("%d%s%d",&l,s,&a);
  for(i=0;i<l;i++){
    if(s[i]!=s[a-1]){printf("*");}
    else{printf("%c",s[i]);}
  }
  printf("\n");
  return 0;
}

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


int main() {
int A,B,C,X,Y;
cin>>A>>B>>C>>X>>Y;
long ans=1e18;

for(int i=0;i<=2*max(X,Y);i+=2){
  int x=max(X-i/2,0);
  int y=max(Y-i/2,0);
  long tmp=i*C;
  tmp+=x*A+y*B;
  ans=min(tmp,ans);
}
cout<<ans<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        int K = Integer.parseInt(sc.next());
        String str = sc.next();
        sc.close();
        int count = 0;
        for (int i = 0; i < N-1; i++) {
        	if (str.charAt(i) == str.charAt(i+1)) {
        		count++;
        	}
        }
        count += 2 * K;
        if (count >= N) {
        	System.out.println(N-1);
        }
        else {
        	System.out.println(count);
        }


    }
}

Measured memory_bytes: 25940
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n, i, a[100009], b[100009], c[100009], cost[100009][3];
	cin >> n;
	for(i=0; i<n; i++)
		cin >> a[i] >> b[i] >> c[i];
	cost[0][0] = a[0]; cost[0][1] = b[0]; cost[0][2] = c[0];
	for(i=1; i<n; i++){
	
		cost[i][0] = max(cost[i-1][1], cost[i-1][2]) + a[i];
		cost[i][1] = max(cost[i-1][0], cost[i-1][2]) + b[i];
		cost[i][2] = max(cost[i-1][1], cost[i-1][0]) + c[i];
	}
	cout << max(max(cost[n-1][0], cost[n-1][1]), cost[n-1][2]) << endl;
	return 0;
}


Measured memory_bytes: 2560
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#include<iomanip>
#include<cassert>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 50;
 
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;
}
using namespace std;
 

void solve(){
   int n;
   cin>>n;
   int d,ans=0,dmin=30;
   map<int,int>mp;
   rep(i,n){
       cin>>d;
       dmin=min(d,dmin);
       mp[d]++;
   }
   vector<int>v,w;
   for(auto x:mp){
       if(x.second>2){
           cout<<0<<"\n";
           return;
       }
       else if(x.second==2){
           v.pb(x.first);
           v.pb(24-x.first);
       }
       else w.pb(x.first);
   }
   int m=w.size();
    if(m)for(int i=0;i<(1<<m);++i){//最大で2^11の全列挙(この実装だと2^12)
        vector<int>w2(m);
       rep(j,m){
           if((1<<j)&i)w2[j]=24-w[j];
           else w2[j]=w[j];
       }
       rep(j,v.size())w2.pb(v[j]);
       int minv=dmin;
       rep(j,w2.size()-1){
           for(int k=j+1;k<w2.size();++k){
               minv=min(minv,abs(w2[j]-w2[k]));
           }
       }
       ans=max(ans,minv);
   }
   else {
       int minv=dmin;
       rep(j,v.size()-1)for(int k=j+1;k<v.size();++k)minv=min(minv,abs(v[j]-v[k]));
       ans=max(ans,minv);
   }
   cout<<ans<<"\n";
}
 
 
signed main(){
	ios::sync_with_stdio(false);
        cin.tie(0);
	cout<<fixed<<setprecision(15);
	solve();
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define p(s) cout<<(s)<<endl
#define REP(i,n,N) for(int i=n;i<N;i++)
#define RREP(i,n,N) for(int i=N-1;i>=n;i--)
#define CK(n,a,b) ((a)<=(n)&&(n)<(b))
#define F first
#define S second
typedef long long ll;
using namespace std;
const ll inf = 1e18;

ll N, x;
ll a[2010];
ll ans;
ll dp[2010][2010];
int main(){
    cin>>N>>x;
    REP(i,0,N){
        cin>>a[i];
    }
    REP(i,0,N){
        REP(j,0,N){
            dp[i][j]=inf;
        }
    }
    REP(i,0,N){
        REP(k,0,N){
            dp[i][k] = min(dp[i][(k+N-1)%N], a[(i+N-k)%N]);
        }
    }
    ans = inf;
    REP(i,0,N){
        ll sum = x*i;
        REP(j,0,N) sum += dp[j][i];
        ans = min(ans,sum);
    }
    p(ans);
    return 0;
}

Measured memory_bytes: 31616
#include <bits/stdc++.h>
using namespace std;
const int N=505*505;
int n;
int a[N];
struct Node{
	int i,x;
	friend bool operator < (Node A,Node B){
		return A.x<B.x;
	}
}x[N];
int main(){
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
		scanf("%d",&x[i].x),x[i].i=i;
	sort(x+1,x+n+1);
	int L=1,R=n*n;
	memset(a,0,sizeof a);
	for (int i=1;i<=n;i++)
		a[x[i].x]=x[i].i;
	for (int i=1;i<=n;i++){
		int t=x[i].i-1;
		while (t--){
			while (L<=n*n&&a[L])
				L++;
			if (L>x[i].x)
				return puts("No"),0;
			a[L]=x[i].i;
		}
	}
	for (int i=n;i>=1;i--){
		int t=n-x[i].i;
		while (t--){
			while (R>=1&&a[R])
				R--;
			if (R<x[i].x)
				return puts("No"),0;
			a[R]=x[i].i;
		}
	}
	puts("Yes");
	for (int i=1;i<=n*n;i++)
		printf("%d ",a[i]);
	return 0;
}

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

class UnionFind {
    vector<int> parent;
    vector<int> rank;

public:
    UnionFind(int size) {
        parent = vector<int>(size);
        rep(i, size) parent[i] = i;
        rank = vector<int>(size, 1);
    }

    int root(int x) {
        return parent[x] == x ? x : parent[x] = root(parent[x]);
    }

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

    void unite(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) rank[x]++;
        parent[y] = x;
    }
};

class UndirectedGraph {
    struct Edge {
        int from, to, cost;

        Edge(int from, int to, int cost):
            from(from), to(to), cost(cost)
        {}
    };

    int node_size;
    vector<Edge> edges;

public:
    UndirectedGraph(int n): node_size(n) {}

    void connect(int from, int to, int cost) {
        edges.push_back(Edge(from, to, cost));
    }

    int kluskal() {
        sort(all(edges), [](Edge x, Edge y) {
            return x.cost < y.cost;
        });
        UnionFind uf(node_size);
        int res = 0;
        for (Edge e : edges) {
            if (!uf.same(e.from, e.to)) {
                uf.unite(e.from, e.to);
                res += e.cost;
            }
        }
        return res;
    }
};

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

    int n; cin >> n;
    vector<tuple<int, int, int>> xs(n), ys(n);
    rep(i, n) {
        int x, y; cin >> x >> y;
        xs[i] = make_tuple(x, y, i);
        ys[i] = make_tuple(y, x, i);
    }
    sort(all(xs));
    sort(all(ys));
    UndirectedGraph g(n + 1);
    rep(i, n - 1) {
        int a, b, from, to;
        tie(a, ignore, from) = xs[i];
        tie(b, ignore, to) = xs[i + 1];
        g.connect(from, to, abs(b - a));
        tie(a, ignore, from) = ys[i];
        tie(b, ignore, to) = ys[i + 1];
        g.connect(from, to, abs(b - a));
    }
    cout << g.kluskal() << "\n";
}

Measured memory_bytes: 7284
#include <iostream>
#include <algorithm>
#define INF 1000000000
#define MOD 1000000007

using namespace std;

int main()
{
    int n, m;
    int ans;
    int max;
    struct Point {int x, y;} stu[55];
    struct Point che[55];

    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        cin >> stu[i].x >> stu[i].y;
    }
    for (int i = 1; i <= m; i++) {
        cin >> che[i].x >> che[i].y;
    }

    for (int i = 1; i <= n; i++) {
        max = INF;

        for (int j = 1; j <= m; j++) {
            int d = abs(stu[i].x - che[j].x) + abs(stu[i].y - che[j].y);

            if (d < max) {
                max = d;
                ans = j;
            }
        }

        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <utility>
#include <vector>
#include <tuple>
#include <cmath>

using namespace std;

const int N = 100101;
int a[N];

int main() {
  #ifdef DEBUG
  freopen("5-08-b.txt", "r", stdin);
  #endif

  for (int i = 1; i <= floor(sqrt(N)); i++) {
    a[i * i] = 1;
  }

  string s1, s2;
  while (cin >> s1 >> s2) {
    string s = s1 + s2;
    int n = stoi(s);
    cout << (a[n] ? "Yes" : "No") << endl;
  }

  return 0;
}


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

int main() {
  string s;
  cin >> s;
  int a = s.size();
  int count = 0;
  for(int i =0;i<a;i++) {
    if(s.at(i) != s.at(a-1-i)) {
      count++;
    }
  }
  cout << count/2 <<endl;
}

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

int main(){
  int n;cin>>n;
  vector <string> city;
  vector <int> points;
  vector <int> rank;

  city.resize(n);
  points.resize(n);
  rank.resize(n);
  for (int i=0;i<n;++i) {
    cin >> city[i]>>points[i];
    rank[i] = i;
  }
  sort(rank.begin(),rank.end(),[&](int x,int y){
    if (city[x] == city[y]) return points[x]>points[y];
    else return city[x]<city[y];
  });
  for(int i=0;i<n;++i) cout << rank[i]+1 << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdtr1c++.h>
#include <time.h>
#define stat akjcjalsjcjalscj
#define hash ajkscjlsjclajsc
#define next ackjalscjaowjico
#define prev ajcsoua0wucckjsl
#define y1 alkscj9u20cjeijc
#define left lajcljascjljl
#define right aucouasocjolkjl
#define y0 u9cqu3jioajc

using namespace std;
#define TASK "solve"

const int N = 1e5;
const long long Base = 500000004;
const int module = 1e9 + 7;
mt19937 rnd(chrono::system_clock::now().time_since_epoch().count());

long long rand(long long l, long long r){
    return 1LL * (1LL * rnd() * RAND_MAX + rnd()) % (r - l + 1) + l;
}

void doc() {
    //freopen(TASK ".inp","r",stdin);
    //freopen(TASK ".out","w",stdout);
}

void solve() {
    int a,b,c,n;
    cin >> a >> b >> c >> n;
    int Res = 0;
    for (int i = 0; i <= n / a; i++) {
        for (int j = 0; j <= n / b; j++) {
            int x = n - (i * a + j * b);
            if (x < 0) break;
            if (x % c == 0) Res++;
        }
    }
    cout << Res;
}

int main(int argc,char *argv[]) {
    srand(time(nullptr));
    ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr);
    doc();
    solve();
}



Measured memory_bytes: 256
#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;
    ll K;
    cin >> N >> M >> K;
    vector<ll> A(N), B(M);
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    ll sum = 0;
    for (int i = 0; i < M; i++)
    {
        cin >> B[i];
        sum += B[i];
    }

    int ans = 0;
    if (sum <= K)
    {
        ans = M;
    }  
    int b = M;
    for (int a = 0; a < N + 1; a++)
    {
        while (b > 0 && ((a > 0 && sum + A[a - 1] > K) || (a == 0 && sum > K)))
        {
            sum -= B[b - 1];
            b--;
        }
        
        if (a > 0 && sum + A[a - 1] > K) break;
        ans = max(a + b, ans);
        if (a > 0) sum += A[a - 1];
    }
    
    cout << ans << endl;
  return 0;
}


Measured memory_bytes: 6412
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (int64_t)(n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

#define chmax(a, b) (a) = max(a, b)
#define chmin(a, b) (a) = min(a, b)

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

  vector<int> t;
  char curr = s[0];
  t.push_back(0);
  for (char c : s) {
    if (curr != c) {
      t.push_back(0);
      curr = c;
    }
    t.back()++;
  }

  int result = 0;
  int r = 0;
  for (int a : t) {
    result += r;
    a -= r;
    result += a / 3 * 2;
    if (a % 3 != 0) {
      result += 1;
    }
    if (a % 3 == 2) {
      r = 1;
    } else {
      r = 0;
    }
  }
  cout << result << endl;
  return 0;
}

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

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T>
string join(const vector<T>&v, string del=", "){ stringstream s;
    for(auto x : v) s << del << x; return s.str().substr(del.size());
}
template<typename T>
ostream& operator<<(ostream& o, const vector<T>&v){
    if(v.size()) o << "[" << join(v) << "]"; return o;
}
template<typename T>
ostream& operator<<(ostream& o, const vector<vector<T> >&vv){
    int l = vv.size();
    if(l){ o<<endl; rep(i,l) o << (i==0 ? "[ " : ",\n  " ) << vv[i] << (i==l-1 ? " ]" : ""); }
    return o;
}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

vi g[200010];
vl a, l;
vl dp;

void dfs(int v, int p=-1){
    int pos = lower_bound(all(dp), a[v]) - dp.begin();
    ll tmp = dp[pos];
    dp[pos] = a[v];
    l[v] = lower_bound(all(dp), INFL) - dp.begin();
    for(auto u : g[v]){
        if(u == p) continue;
        dfs(u, v);
    }
    dp[pos] = tmp;
}

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");
    int n; cin >> n;
    a = vl(n);
    l = vl(n, 0);
    rep(i,n) cin >> a[i];
    rep(i,n-1){
        int u, v; cin >> u >> v;
        u--; v--;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    dp = vl(n+1, INFL);
    dfs(0);
    rep(i,n) cout << l[i] << endl;
    return 0;
}

Measured memory_bytes: 30320
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

#define ll long long
#define el '\n'
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repi(i, a, b) for (int i = a; i >= b; i--)

ll bf(ll n)
{
    ll ans = 0;
    rep(k, 2, n + 1)
    {
        int work = n;
        while (work >= k)
        {
            if (work % k == 0)
            {
                work /= k;
            }
            else
            {
                work -= k;
            }
        }
        if (work == 1)
        {
            // cout << k << el;
            ans++;
        }
    }
    return ans;
}

bool good(ll i, ll n)
{
    ll p = i;
    while (p <= n && n % p == 0)
    {
        if ((n / p - 1) % i == 0)
        {
            return true;
        }
        if (p > n / i) {
            break;
        }
        p *= i;
    }
    return false;
}

vector<ll> factors(ll n)
{
    vector<ll> ans;
    ans.push_back(1);
    if (n == 1) {
        return ans;
    }
    ans.push_back(n);
    rep(i, 2, (int)sqrt(n) + 1)
    {
        if (n % i == 0)
        {
            ans.push_back(i);
            if ((ll)i * i != n)
            {
                ans.push_back(n / i);
            }
        }
    }
    // sort(ans.begin(), ans.end());
    return ans;
}

ll solve(ll n)
{
    // n = k^a*(b*k+1)
    // a == 0
    ll ans = factors(n - 1).size() - 1; // exclude 1
    // cout << "---------\n";
    // for (auto i : factors(n - 1))
    // {
    //     cout << i << el;
    // }
    // cout << "---------\n";
    // a > 0
    for (auto i : factors(n))
    {
        if (i == 1)
        {
            continue;
        }
        // if (i == n) {
        //     cout << "assert" << el;
        //     assert(good(i,n));
        // }
        if (good(i, n))
        {
            // cout << i << el;
            ans++;
        }
    }
    return ans;
}

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

    // rep(i, 2, 3142)
    // {
    //     if (3140 % i == 0)
    //     {
    //         cout << i << el;
    //     }
    // }

    // cout << log(1e12) / log(2) << el;

    // rep(i,2,10000) {
    //     printf("bf(%d)=%lld,solve(%d)=%lld\n", i,bf(i),i,solve(i));
    //     // cout << 'i' << i << el;
    //     // cout << bf(i) << el;
    //     // cout << solve(i) << el;
    //     assert(bf(i)==solve(i));
    // }

    ll n;
    cin >> n;

    // cout << bf(n);
    cout << solve(n);
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pi 3.141592653589793238
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MOD 1000000007

void solve()
{
	ll w,h,n,x,y,a;
	cin>>w>>h>>n;
	ll x1=0,x2=w,y1=0,y2=h;
	
	while(n--)
	{
		cin>>x>>y>>a;
		if(a==1)
			x1=max(x1,x);
		else if(a==2)
			x2=min(x2,x);
		else if(a==3)
			y1=max(y1,y);
		else
			y2=min(y2,y);
	}

	if(x2>x1&&y2>y1)
	cout<<abs((x1-x2)*(y1-y2));
	else
	cout<<0;
	
	return;
}

int main()
{
	fast;
	ll q=1;
	// cin>>q;
	while(q--)
		solve();
	return 0;
}



Measured memory_bytes: 3632
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val s = sc.next()
    println(problem098b(n, s))
}

fun problem098b(n: Int, s: String): Int {
    var max = 0
    for (i in 1 until n) {
        val x = s.take(i).toSet()
        val y = s.takeLast(n - i).toSet()
        max = Math.max(max, x.filter { y.contains(it) }.count())
    }
    return max
}

Measured memory_bytes: 31652
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi vector<vector<int> >
#define vvl vector<vector<ll> >
#define vll vector<ll>
#define rep(c, a, b) for(ll c=a;c<b;c++)
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
using namespace std;

int main(int argc, char const *argv[]) {
  string s;std::cin >> s;
  vll num(26, 0);
  re(i, s.size()) num[s[i]-'a']++;
  bool flag = true;
  re(i, 26)if(num[i]%2==1) flag = false;
  std::cout << (flag?"Yes":"No") << '\n';
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<iomanip>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(int i = a;i < b; i++)

int main() {

	int r;
	cin >> r;

	cout << r * r * 3 << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define ar array
const int mxn=3e3;
int n;
ar<ll,2> dp[mxn+1][mxn+1];

int main()
{
	//#ifndef ONLINE_JUDGE
		//freopen("input.txt","r",stdin);
		//freopen("output.txt","w",stdout);
	//#endif
	
	//int t;
	//cin>>t;
	//while(t--)
	{
		cin>>n;
		int a[n];
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		for(int i=n-1;i>=0;i--)
		{
			ar<ll,2> tr={a[i],0};
			for(int j=i;j<n;j++)
			{
				if(i+1<n&&j-1>=0&&(dp[i+1][j][1]+a[i]<dp[i][j-1][1]+a[j]))
				{
					tr={dp[i][j-1][1]+a[j],dp[i][j-1][0]};
				}
				else
				{
					tr={dp[i+1][j][1]+a[i],dp[i+1][j][0]};
				}
				dp[i][j]=tr;
			}
		}
		cout<<dp[0][n-1][0]-dp[0][n-1][1]<<'\n';
	}
		
}


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

using namespace std;

typedef long long ll;

#define p(x) cout << x << endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define range(i, begin, end) for (int i = begin; i < (int)(end + 1); i++)
#define all(x) (x).begin(), (x).end()

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

  priority_queue<double, vector<double>, greater<double>> que;
  for (int i = 0; i < n; i++) {
    double v;
    cin >> v;
    que.emplace(v);
  }

  rep(i, n - 1) {
    double v1 = que.top();
    que.pop();
    double v2 = que.top();
    que.pop();

    que.emplace((v1 + v2) / 2);
  }

  p(que.top());
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
#define MAX 100000
#define INFTY 2000000000

struct Card {
    char suit;
    int value;
};

struct Card L[MAX/2 +2], R[MAX/2 +2];

void merge(struct Card *A, int n, int left, int mid, int right) {
    int i,j,k;
    int n1 = mid - left;
    int n2 = right - mid;
    for (i=0; i<n1; i++) L[i] = A[left+i];
    for (i=0; i<n2; i++) R[i] = A[mid+i];
    L[n1].value = R[n2].value = INFTY;
    i = j = 0;
    for (k=left; k<right; k++) {
        if(L[i].value <= R[j].value) {
            A[k] = L[i];
            i++;
        } else {
            A[k] = R[j];
            j++;
        }
    }
}

void mergeSort(struct Card *A, int n,  int left, int right) {
    int mid;
    if (left+1<right) {
        mid = (left + right) / 2;
        mergeSort(A, n, left, mid);
        mergeSort(A, n, mid, right);
        merge(A, n, left, mid, right);
    }
}

int partition(struct Card *A, int n, int p, int r) {
    int i, j;
    struct Card x;
    x = A[r];
    i = p -1;
    for (j=p; j<r; j++) {
        if(A[j].value <= x.value) {
            i++;
            swap(A[i],A[j]);
        }
    }
    swap(A[i+1], A[r]);
    return i+1;
}

void quickSort(struct Card *A, int n, int p, int r) {
    int q;
    if (p<r) {
        q = partition(A, n, p, r);
        quickSort(A, n, p, q-1);
        quickSort(A, n, q+1, r);
    }
}

int main () {
    int n, v;
    struct Card A[MAX], B[MAX];
    char ch;
    int stable = 1;
    cin >> n;
    for(int i=0; i< n; i++) {
        cin >> ch >> v;
        A[i].suit = B[i].suit = ch;
        A[i].value = B[i].value = v;
    }
    
    mergeSort(A, n, 0, n);
    quickSort(B, n, 0, n-1);
    
    for (int i=0; i<n; i++) {
        if(A[i].suit != B[i].suit) stable = 0;
    }
    if(stable==1) cout << "Stable" << endl;
    else cout << "Not stable" << endl;
    for (int i=0; i<n; i++) {
        cout << B[i].suit << " " << B[i].value << endl;
    }
    
    return 0;
}


Measured memory_bytes: 5420
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 2147483647 / 2;
const long long int llINF = 9223372036854775807 / 2;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VV(T, a, b, c) vector<vector<T>>(a, vector<T>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define VVV(T, a, b, c, d)                                                     \
  vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, d)))
#define SP(a) fixed << setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))
#define UNIQUE(vec)                                                            \
  do {                                                                         \
    sort(ALL((vec)));                                                          \
    (vec).erase(std::unique(ALL((vec))), (vec).end());                         \
  } while (0)

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp);
  } else {
    return (n * POW(n, m - 1));
  }
}

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string N;
  cin >> N;
  ll ans = 0;
  REP(i, N.size()) { ans += N[i] - '0'; }
  if (ans % 9 == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 3740
#include "bits/stdc++.h"
using namespace std;

// 定義
typedef long long         ll;
typedef pair<ll, ll>      P;
#define ALL(x)            (x).begin(),(x).end()
#define REP(i, n)         for(ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)     for(ll i = m ; i < (ll)n ; ++i)
#define REVREP(i, n)      for(ll i = n - 1; i >= 0 ; i--)
#define VL                vector<ll>
#define VVL               vector<vector<ll>>
#define VVVL              vector<vector<vector<ll>>>
#define VC                vector<char>
#define VVC               vector<vector<char>>
#define INF               (ll)2e9
#define INF_LL            1LL<<60
#define MOD               998244353

ll Ceil(ll val, ll div)   { return (val + div - 1) / div; }
ll CeilN(ll val, ll div)  { return Ceil(val, div) * div; }
ll FloorN(ll x, ll n)     { return (x - x % n); }
bool IsOdd(ll x)          { return ((x & 1) == 1); }
bool IsEven(ll x)         { return ((x & 1) == 0); }
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void Solve()
{
	ll A, V, B, W, T;
	cin >> A >> V >> B >> W >> T;
	string ans = "NO";
	if (A == B) {
		cout << "YES" << endl;
		return;
	}
	if (W >= V) {
		cout << ans << endl;
		return;
	}

	ll diff = V  - W;
	ll tAns = Ceil(abs(A - B), diff);
	if (tAns <= T) ans = "YES";
	cout << ans << endl;
}

// メイン
int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Solve();
	return 0;
}


Measured memory_bytes: 3652
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<cstring>
#include<cstdlib>
#include<utility>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pi acos(-1)
#define pb push_back
#define all(v) v.begin(),v.end()
using namespace std;
typedef pair<int,int> p;
typedef pair<double,p> pdii;
typedef long long ll;

int a,b,c,d,e,f,tmp;

double calc(double a,double b){
	return 100*b/(a+b);
}

int func(int num){
	bool dp[num+1];
	rep(i,num+1)dp[i]=false;
	dp[0]=true;
	rep(i,num+1){
		if(!dp[i])continue;
		if(i+c<=num)dp[i+c]=true;
		if(i+d<=num)dp[i+d]=true;
	}
	int res=0;
	for(int i=num;i>=0;i--){
		if(dp[i]){
			res=i;
			break;
		}
	}
	return res;
}

int main(){
	cin>>a>>b>>c>>d>>e>>f;
	queue<int> que;
	que.push(0);
	while(que.front()<=f){
		tmp=que.front();
		que.pop();
		que.push(tmp+a*100);
		que.push(tmp+b*100);
		que.push(tmp);
	}
	vector<pdii> vec;
	map<int,int> mp;
	while(!que.empty()){
		tmp=que.front();
		que.pop();
		if(tmp>=(f-min(c,d)) ||tmp<=0)continue;
		if(mp.find(tmp)!=mp.end())continue;
		else mp[tmp]++;
		int suger=func(min(tmp/100*e,f-tmp));
		vec.pb(pdii(calc((double)tmp,(double)suger),p(tmp,suger)));
	}
	sort(all(vec),greater<pdii>());
	cout<<vec[0].second.first+vec[0].second.second<<" "<<vec[0].second.second<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000>> cpp_dec_float_1000;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }

void solve(void)
{
  int N; cin >> N;
  vector<int> L(N);
  for(auto& i : L) cin >> i;
  boost::sort(L);

  ll res{};
  for (int i = 0; i < N; ++i) {
    for (int j = i + 1; j < N; ++j) {
      auto max = L[i] + L[j];
      auto itr1 = std::lower_bound(std::next(L.begin(), j + 1), L.end(), max);
      auto num = std::distance(L.begin() + j + 1, itr1);
      res += num;
      continue;
    }
  }

  cout << res << CRLF;
  return;
}

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

  solve();

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
// #define int ll
#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)
// const int MOD = 1000000007;

template <typename T>
void __print__(std::ostream &os, const char *, const char *tail, const T &fst) {
    os << fst << tail;
}
template <typename Fst, typename... Rst>
void __print__(std::ostream &os, const char *del, const char *tail, const Fst &fst,
               const Rst &... rst) {
    os << fst << del;
    __print__(os, del, tail, rst...);
}

#ifdef LOCAL
#define dump(...)                                         \
    do {                                                  \
        std::ostringstream os;                            \
        os << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; \
        __print__(os, ", ", "\n", __VA_ARGS__);           \
        std::cerr << os.str();                            \
    } while (0)
#else
#define dump(...)
#endif

template <typename Fst, typename... Rst>
void println(const Fst &fst, const Rst &... rst) {
    __print__(std::cout, "\n", "\n", fst, rst...);
}
template <typename Fst, typename... Rst>
void print(const Fst &fst, const Rst &... rst) {
    __print__(std::cout, " ", "\n", fst, rst...);
}

template <typename iter>
void println_(iter bgn, iter end) {
    while (bgn != end) println(*bgn++);
}

template <typename iter>
void print_(iter bgn, iter end) {
    while (bgn != end) {
        std::cout << *bgn++;
        std::cout << (bgn == end ? "\n" : " ");
    }
}

int _ = (std::cout.precision(10), std::cout.setf(std::ios::fixed), std::cin.tie(0),
         std::ios::sync_with_stdio(0), 0);

template <typename T>
std::vector<T> ndarray(int n, T v) {
    return std::vector<T>(n, v);
}
template <typename... Args>
auto ndarray(int n, Args... args) {
    auto val = ndarray(args...);
    return std::vector<decltype(val)>(n, move(val));
}

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

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

using namespace std;

int main() {
    int t;
    while (cin >> t) {
        int h = t / 30;
        int m = t % 30 * 2;
        print(h, m);
    }
}

Measured memory_bytes: 3184
s = str(input())
t = str(input())
ds = {chr(i+97): -1 for i in range(26)}
dt = {chr(i+97): -1 for i in range(26)}
for i in range(len(s)):
    if ds[s[i]] >= 0:
        if ds[s[i]] != ord(t[i]):
            print('No')
            break
    if dt[t[i]] >= 0:
        if dt[t[i]] != ord(s[i]):
            print('No')
            break
    if ds[s[i]] < 0:
        ds[s[i]] = ord(t[i])
    if dt[t[i]] < 0:
        dt[t[i]] = ord(s[i])
else:
    print('Yes')


Measured memory_bytes: 3632