QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#843671#9917. The Story of Emperor BieMegGriffin#WA 16ms3656kbC++14659b2025-01-04 21:37:062025-01-04 21:37:06

Judging History

你现在查看的是最新测评结果

  • [2025-01-04 21:37:06]
  • 评测
  • 测评结果:WA
  • 用时:16ms
  • 内存:3656kb
  • [2025-01-04 21:37:06]
  • 提交

answer

#include <bits/stdc++.h>
#define forr(i,l,r) for(int i=l;i<=r;i++)
#define int long long
#define endl '\n'
using namespace std;
void solve(){
    int n;
    cin>>n;
    vector<int>a(n+1);
    int maxn=0,maxp;
    forr(i,1,n){
        cin>>a[i];
        if(a[i]>maxn){
            maxn=a[i];
            maxp=i;
        }
    }
    while (maxp<=n&&a[maxp]==maxn)
    {
        cout<<maxp++<<' ';
    }
    cout<<endl;
    return;
}
signed main()
{
    ios::sync_with_stdio(false), std::cin.tie(nullptr), std::cout.tie(nullptr);
    int _ ;
    _ = 1;
    cin >> _;
    while (_--)
    {
        solve();
    }
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3656kb

input:

3
1
5
2
1 3
3
3 3 3

output:

1 
2 
1 2 3 

result:

ok 5 number(s): "1 2 1 2 3"

Test #2:

score: -100
Wrong Answer
time: 16ms
memory: 3512kb

input:

10000
25
25 39 31 40 11 29 9 4 42 32 39 5 21 33 19 50 19 20 7 41 13 45 34 23 7
6
33 14 11 25 24 37
6
50 35 17 42 37 10
11
22 17 45 17 48 29 2 42 19 19 50
91
12 27 3 20 37 39 4 48 4 29 44 37 38 11 39 15 38 28 20 19 50 20 48 28 43 6 19 16 7 10 30 44 9 25 13 9 21 8 3 39 11 10 34 28 23 13 49 44 45 4 23 ...

output:

16 
6 
1 
11 
21 
14 
17 
10 
14 
31 
53 
19 
11 
7 
4 
71 
40 
96 
2 
2 
46 
2 
1 
14 
47 
45 
1 
1 
16 
33 
1 
3 
4 
6 
4 
37 
54 
33 
7 
2 
27 
10 
7 
41 
9 
88 
68 
2 
2 
17 
6 
32 
5 
12 
80 
20 
23 
22 
14 
24 
40 
16 
7 
27 
27 
58 
34 
8 
1 
1 
4 
8 
12 
43 
1 
18 
5 
3 
5 
29 
4 5 
17 
34 
...

result:

wrong answer 6th numbers differ - expected: '70', found: '14'