QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#326517 | #1505. Last Supper | socpite | 0 | 22ms | 5508kb | C++20 | 1.1kb | 2024-02-13 12:22:02 | 2024-02-13 12:22:03 |
Judging History
advisor
#include "advisor.h"
#include<bits/stdc++.h>
using namespace std;
void ComputeAdvice(int *C, int N, int K, int M) {
vector<int> ans(N+K, 0), prv(N, N), next(N), active(N, 0);
set<pair<int, int>> st;
for(int i = N-1; i >= 0; i--){
next[i] = prv[C[i]];
prv[C[i]] = i;
}
for(int i = 0; i < K; i++){
active[i] = 1;
st.insert({prv[i], i});
prv[i] = i;
}
for(int i = 0; i < N; i++){
if(active[C[i]])ans[prv[C[i]]] = 1;
else{
auto tmp = *st.rbegin();
active[tmp.second] = 0;
active[C[i]] = 1;
st.erase(tmp);
st.insert({next[i], C[i]});
}
prv[C[i]] = i+K;
}
for(auto v: ans)WriteAdvice(v);
}
assistant
#include "assistant.h"
#include<bits/stdc++.h>
using namespace std;
void Assist(unsigned char *A, int N, int K, int R) {
vector<int> bad;
vector<int> active(N, 0);
for(int i = 0; i < K; i++){
active[i] = 1;
if(!A[i])bad.push_back(i);
}
for(int i = 0; i < N; i++){
int x = GetRequest();
if(!active[x]){
PutBack(bad.back());
bad.pop_back();
}
if(!A[i+K])bad.push_back(x);
}
}
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 8
Accepted
time: 0ms
memory: 3772kb
input:
4 2 65000 2 0 3 0
output:
1 0 0 1 0 0 2
input:
4 2 2 0 3 0 6 1 0 0 1 0 0
output:
P 1 P 2 E
result:
ok correct, Rmax = 6
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 4028kb
input:
100 30 65000 45 82 25 65 47 7 92 0 58 76 9 73 90 82 21 65 9 83 52 9 17 89 13 64 58 79 55 21 75 70 58 49 88 86 19 99 8 41 2 77 72 33 49 97 50 3 34 69 32 70 86 15 87 50 73 74 79 95 14 19 52 19 70 10 76 15 85 81 5 22 35 35 21 6 58 87 82 3 30 45 13 30 19 41 14 67 52 45 13 76 20 5 38 77 63 75 46 87 21 51
output:
1 0 1 1 0 1 1 1 1 1 1 0 0 1 1 1 0 1 0 1 0 1 1 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 1 1 1 1 0 1 1 0 1 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 1 1 0 0 0 1 0 1 1 0 0 0 0 0 1 1 1 1 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2
input:
100 30 45 82 25 65 47 7 92 0 58 76 9 73 90 82 21 65 9 83 52 9 17 89 13 64 58 79 55 21 75 70 58 49 88 86 19 99 8 41 2 77 72 33 49 97 50 3 34 69 32 70 86 15 87 50 73 74 79 95 14 19 52 19 70 10 76 15 85 81 5 22 35 35 21 6 58 87 82 3 30 45 13 30 19 41 14 67 52 45 13 76 20 5 38 77 63 75 46 87 21 51 130 1...
output:
P 29 P 45 P 25 P 28 P 7 P 0 P 92 P 47 P 27 Putting back a color when it is already on the scaffold
result:
wrong answer incorrect plan: failed on step 17
Subtask #2:
score: 0
Wrong Answer
Test #12:
score: 0
Wrong Answer
time: 4ms
memory: 3976kb
input:
10000 2000 2000000 5451 8333 6614 6013 8933 5291 4673 2423 1373 4369 6443 9253 4274 9813 1404 3960 7896 3621 5700 4193 4302 5955 7793 5650 5887 4827 8761 4162 3664 802 6193 1717 1760 677 1893 8480 486 5544 7521 8277 5347 5201 8364 596 1088 9041 9329 4868 3141 7279 5549 1111 754 55 8718 8854 7430 656...
output:
0 1 1 1 0 1 0 0 1 1 0 1 1 0 1 1 1 1 0 0 0 1 1 0 0 0 1 1 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 0 0 1 0 0 1 1 0 1 0 0 1 0 0 1 1 1 1 0 1 0 1 0 1 0 1 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0 0 1 1 0 0 1 0 1 0 0 0 0 0 1 1 0 1 0 1 1 0 1 0 0 0 0 1 1 1 0 0 1 0 0 0 1 ...
input:
10000 2000 5451 8333 6614 6013 8933 5291 4673 2423 1373 4369 6443 9253 4274 9813 1404 3960 7896 3621 5700 4193 4302 5955 7793 5650 5887 4827 8761 4162 3664 802 6193 1717 1760 677 1893 8480 486 5544 7521 8277 5347 5201 8364 596 1088 9041 9329 4868 3141 7279 5549 1111 754 55 8718 8854 7430 6563 4096 1...
output:
P 1998 P 1997 P 1988 P 6614 P 1987 P 8933 P 5291 P 1985 P 1373 P 4369 P 6443 P 9253 P 4274 P 1404 P 3960 P 7896 P 9813 P 2423 P 1984 P 4302 P 5955 P 1983 P 1982 P 5887 P 1981 P 1978 P 1976 P 802 P 677 P 486 P 5544 P 1760 P 8277 P 5347 P 1717 P 1088 P 596 P 6193 P 4868 P 1974 P 7279 P 5549 P 8718 P 8...
result:
wrong answer incorrect plan: failed on step 138
Subtask #3:
score: 0
Wrong Answer
Test #22:
score: 0
Wrong Answer
time: 18ms
memory: 4984kb
input:
80394 19021 1500000 72858 39151 63499 33072 48058 70885 51034 68453 51282 39279 36583 50232 45586 73715 50578 26059 67651 16908 63163 78449 68854 25125 72528 8350 19431 76913 65901 29633 11242 23714 51866 33698 53417 20066 74345 34798 46875 41956 13453 28693 52922 71783 11012 40345 61115 31634 34380...
output:
1 1 0 1 0 1 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 0 0 0 1 0 1 1 0 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 1 1 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1 1 1 1 1 0 0 1 0 1 1 0 0 1 1 0 1 1 1 0 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 1 1 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 1 1 0 1 1 0 1 1 1 0 0 0 0 ...
input:
80394 19021 72858 39151 63499 33072 48058 70885 51034 68453 51282 39279 36583 50232 45586 73715 50578 26059 67651 16908 63163 78449 68854 25125 72528 8350 19431 76913 65901 29633 11242 23714 51866 33698 53417 20066 74345 34798 46875 41956 13453 28693 52922 71783 11012 40345 61115 31634 34380 491 780...
output:
P 19020 P 19019 P 39151 P 63499 P 19018 P 19016 P 70885 P 51034 P 68453 P 51282 P 19015 P 19012 P 50232 P 45586 P 19009 P 19007 P 19006 P 16908 P 67651 P 19003 P 19000 P 18999 P 18997 P 18995 P 18994 P 65901 P 29633 P 23714 P 51866 P 18990 P 18988 P 20066 P 74345 P 34798 P 18986 P 41956 P 28693 P 52...
result:
wrong answer incorrect plan: failed on step 231
Subtask #4:
score: 0
Wrong Answer
Test #32:
score: 0
Wrong Answer
time: 2ms
memory: 3880kb
input:
4000 1192 10000 725 88 662 2834 3439 2402 52 606 1033 2124 2600 115 3859 2953 100 2209 2353 641 3833 1247 1971 3330 3754 1100 1734 2009 3397 1326 3455 3636 3203 3327 2403 1914 2815 850 2597 1969 2966 1382 2183 278 793 313 2368 2821 1158 3655 1454 442 2858 716 1115 3263 663 3497 2035 2102 1074 3319 1...
output:
0 1 1 1 0 1 0 1 0 1 0 0 1 1 0 1 0 0 1 1 0 1 0 0 0 0 1 1 0 1 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 1 1 1 1 0 1 0 1 1 0 0 0 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 0 0 0 0 1 1 0 1 0 1 1 1 0 1 1 1 1 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 1 0 1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0 1 0 0 1 0 1 1 1 0 0 1 0 ...
input:
4000 1192 725 88 662 2834 3439 2402 52 606 1033 2124 2600 115 3859 2953 100 2209 2353 641 3833 1247 1971 3330 3754 1100 1734 2009 3397 1326 3455 3636 3203 3327 2403 1914 2815 850 2597 1969 2966 1382 2183 278 793 313 2368 2821 1158 3655 1454 442 2858 716 1115 3263 663 3497 2035 2102 1074 3319 1241 64...
output:
P 88 P 2834 P 3439 P 52 P 2124 P 115 P 2600 P 2953 P 1190 P 641 P 2353 P 1189 P 1971 P 1187 P 3754 P 1734 P 1186 P 3397 P 1180 P 3455 P 3636 P 1176 P 1171 P 2403 P 1170 P 1168 P 1165 P 1969 P 1163 P 1162 P 313 P 793 P 1158 P 3655 P 442 P 716 P 663 P 3497 P 2821 P 1074 P 1161 P 645 P 2223 P 1241 P 24...
result:
wrong answer incorrect plan: failed on step 100
Subtask #5:
score: 0
Wrong Answer
Test #42:
score: 0
Wrong Answer
time: 22ms
memory: 5508kb
input:
100000 20000 1800000 21950 25220 44873 58672 9201 82569 27154 3312 82627 39771 91142 63204 25601 99930 17095 56663 30188 5056 9784 62200 19645 67214 53098 39607 83027 93403 1986 19889 23908 33429 29687 58256 98136 67907 18950 50288 33509 12296 17883 61477 14065 14037 29485 46063 18544 64149 52349 21...
output:
1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 1 1 1 1 1 0 0 1 0 1 1 1 0 1 0 1 0 1 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 0 1 0 1 1 1 1 1 1 0 1 1 0 1 0 0 0 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 1 0 1 1 0 0 0 1 0 1 0 0 0 1 1 1 1 1 0 1 0 0 0 0 1 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 0 1 1 1 0 0 1 1 1 1 1 0 0 1 ...
input:
100000 20000 21950 25220 44873 58672 9201 82569 27154 3312 82627 39771 91142 63204 25601 99930 17095 56663 30188 5056 9784 62200 19645 67214 53098 39607 83027 93403 1986 19889 23908 33429 29687 58256 98136 67907 18950 50288 33509 12296 17883 61477 14065 14037 29485 46063 18544 64149 52349 21491 4037...
output:
P 19999 P 21950 P 25220 P 19997 P 19995 P 19994 P 3312 P 27154 P 19992 P 91142 P 19991 P 25601 P 19989 P 56663 P 5056 P 30188 P 67214 P 53098 P 39607 P 83027 P 1986 P 23908 P 33429 P 29687 P 19986 P 19985 P 19979 P 50288 P 17883 P 61477 P 29485 P 18544 P 64149 P 33509 P 21491 P 19976 P 74765 P 62167...
result:
wrong answer incorrect plan: failed on step 274