求助!!!全RE
查看原帖
求助!!!全RE
486158
Aludy楼主2022/7/23 20:19
#include<bits/stdc++.h>
#define ll long long

using namespace std;

const int M = 1e5 + 10;
int n, m, u, v, t, p, q, a[M];
queue<ll> q1, q2, q3;

bool cmp(ll x, ll y) {
    return x > y;
}

int jk() { // !!!!!!!!
    ll temp = -21473132, f;
    if (!q1.empty()) if (q1.front() > temp) temp = q1.front(), f = 1;
    if (!q2.empty()) if (q2.front() > temp) temp = q2.front(), f = 2;
    if (!q3.empty()) if (q3.front() > temp) temp = q3.front(), f = 3;
    if (f == 1) q1.pop(); if (f == 2) q2.pop(); if (f == 3) q3.pop();
    return temp;
}

int main(){
    scanf("%lld%lld%lld%lld%lld%lld",&n,&m,&q,&u,&v,&t);
    
    // p = u * 1.0 / v;
    
    for (int i = 1;i <= n;i ++) {
        scanf("%lld", &a[i]);
    }
    
    sort(a + 1, a + n + 1, cmp);
    
    for (int i = 1;i <= n;i ++) {
        q1.push(a[i]);
    }
    
    for (int i = 1;i <= m;i ++) {
        ll tp = jk(), t1, t2;
        
        tp += (i - 1) * q;
        
        t1 = tp * u / v;
        t2 = tp - t1;
        
        if (i % t == 0)
            cout << tp << ' ';
        
        q2.push(t1 - i * q);  q3.push(t2 - i * q);
        // !!!!!!
    }
    cout << endl;
    
    ll p = 1;
    while (1) {
        ll tp = jk();
        
        if (p % t == 0) 
            cout << tp + m * q << ' ';
        p ++;
        
        if (q1.empty() && q2.empty() && q3.empty())
            break;
    }
    
    return 0;
}
2022/7/23 20:19
加载中...