QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#699783#6770. Antsjkliao#WA 0ms3852kbC++171.0kb2024-11-02 10:42:522024-11-02 10:43:27

Judging History

This is the latest submission verdict.

  • [2024-11-02 10:43:27]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3852kb
  • [2024-11-02 10:42:52]
  • Submitted

answer

#include <iostream>
#include <set>
#include <vector>
using namespace std;

using ll = unsigned long long;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  int x = min(a, b);
  // a = x % n;
  // b = x % n;
  a -= (x / n) * (n);
  b -= (x / n) * (n);
  ll ans = (ll)(x / n) * (2e9 + 1);
  vector<ll> pos(n);
  for (int i = 0; i < n; i++)
    cin >> pos[i];
  multiset<pair<ll, int>> pq;
  for (int i = 0; i < n; i++) {
    int d;
    cin >> d;
    if (d == 0) {
      pq.emplace(pos[i], 0);
    } else {
      pq.emplace(1e9 + 1 - pos[i], 1);
    }
  }
  ll finishtime = 0;
  while (!pq.empty()) {
    auto pp = *pq.begin();
    // cout << pp.first << ' ' << pp.second << endl;
    pq.erase(pq.begin());
    finishtime = max(finishtime, pp.first);
    if (pp.second == 0) {
      if (a != 0) {
        a--;
        pq.emplace(pp.first + (1e9 + 1), 1);
      }
    } else {
      if (b != 0) {
        b--;
        pq.emplace(pp.first + (1e9 + 1), 0);
      }
    }
  }
  cout << finishtime + ans << endl;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3852kb

input:

2 2 4
2 3
0 1

output:

4000000000

result:

wrong answer 1st lines differ - expected: '4000000001', found: '4000000000'