QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#640719 | #6258. Find my Family | dohoon# | WA | 28ms | 3832kb | C++17 | 646b | 2024-10-14 15:32:02 | 2024-10-14 15:32:02 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
vector<int> ansvec;
int solve(){
int n; cin >> n;
priority_queue<int> pq;
int now = 1e18;
for(int i=0;i<n;i++){
int a; cin >> a;
if(now<a) return 1;
while (pq.size() && pq.top()>a) {
now = min(pq.top(),now);
pq.pop();
}
pq.push(a);
}
return 0;
}
signed main() {
cin.tie(0)->sync_with_stdio(0);
int tc; cin >> tc;
for(int i=1;i<=tc;i++) if(solve()) ansvec.push_back(i);
cout << ansvec.size() << '\n';
for(int i : ansvec) cout << i << '\n';
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3624kb
input:
1 3 2 1 3
output:
1 1
result:
ok 2 lines
Test #2:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
4 4 140 157 160 193 5 15 24 38 9 30 6 36 12 24 29 23 15 6 170 230 320 180 250 210
output:
2 2 4
result:
ok 3 lines
Test #3:
score: 0
Accepted
time: 28ms
memory: 3832kb
input:
1 271273 43747 45949 45991 59771 62951 78721 90843 96669 105382 125056 190481 223823 234273 241140 245677 331310 332730 342496 346873 364619 374954 395547 396228 402197 405521 425867 463937 465115 480404 509574 527742 529523 531604 542717 555276 567633 607526 642706 675568 702732 726193 728907 74120...
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
1 278011 727061307 368308202 520895620 233571177 962866275 741680843 264488440 68105796 948966820 466360363 79235752 189876633 279183294 707022089 551954537 533095838 391251801 821128899 372263578 515707123 232234930 644859992 86801330 757154237 807459900 586448507 672723131 452745534 295498461 6162...
output:
1 1
result:
ok 2 lines
Test #5:
score: -100
Wrong Answer
time: 24ms
memory: 3796kb
input:
179 6 172113495 59803164 782209477 34402441 69284247 650685671 5 985712353 368711252 482009833 526445043 916859899 4 590307238 387574595 458391611 853071135 5 955235353 236771554 596823814 599387985 431401542 5 671335527 489612401 642100211 68409147 878368953 6 221011605 485556690 458137100 74629254...
output:
155 1 2 3 4 5 6 7 8 9 10 11 14 15 16 17 18 19 20 21 22 23 25 26 27 29 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 63 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 108 109 110 1...
result:
wrong answer 1st lines differ - expected: '111', found: '155'