QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#508719 | #7660. Investigating Frog Behaviour on Lily Pad Patterns | ziripo | WA | 0ms | 4072kb | C++20 | 535b | 2024-08-07 19:33:23 | 2024-08-07 19:33:24 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
int n, c; cin >> n;
vector<int> a;
set<int> b;
scanf("%lld", &c); a.push_back(c);
for (int i = 1; i < n; i++) {
scanf("%lld", &c), a.push_back(c);
for (int j = a[i - 1] + 1; j < c; j++) b.insert(j);
}
for (int j = a[n - 1] + 1; j < a[n - 1] + n; j++) b.insert(j);
int q; cin >> q;
for (int i = 0; i < q; i++) {
scanf("%lld", &c);
a[c] = *b.equal_range(a[c]).first;
b.erase(a[c]);
printf("%lld\n", a[c]);
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3852kb
input:
5 1 2 3 5 7 3 1 2 4
output:
4 6 8
result:
ok 3 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
5 1 2 3 5 7 4 1 1 1 1
output:
4 6 8 9
result:
ok 4 lines
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 4072kb
input:
5 1 2 3 4 5 20 1 4 4 3 5 3 3 5 2 2 5 4 1 4 2 3 1 5 3 3
output:
6 7 8 9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
result:
wrong answer 4th lines differ - expected: '4', found: '9'