QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#843667#9917. The Story of Emperor BieMegGriffin#TL 0ms3808kbC++14661b2025-01-04 21:33:432025-01-04 21:33:43

Judging History

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

  • [2025-01-04 21:33:43]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:3808kb
  • [2025-01-04 21:33:43]
  • 提交

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)
    {
        if(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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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
Time Limit Exceeded

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:


result: