QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#858294 | #9917. The Story of Emperor Bie | the_same_prayers# | WA | 5ms | 7764kb | C++14 | 928b | 2025-01-16 15:42:50 | 2025-01-16 15:43:11 |
Judging History
answer
#include<bits/stdc++.h>
#define N 1000005
using namespace std;
long long t,n,m,k,flag1[N],flag2[N],ans=1,mod=998244353,a[N],cnt;
inline long long rd()
{
long long x = 0, f = 1;
char ch = getchar();
while(ch<'0'||ch>'9')
{
if(ch == '-') f=-1;
ch = getchar();
}
while(ch>='0'&&ch<='9')
{
x = ( x << 1 ) + ( x << 3 ) + ( ch ^ 48 );
ch = getchar();
}
return x * f;
}
int main()
{
cin>>t;
for(int i=1;i<=t;i++)
{
n=rd();ans=0;
for(int j=1;j<=n;j++){a[j]=rd();}
flag1[1]=1;flag2[n]=1;
for(int j=2;j<=n;j++)
{
if(a[j-1]<=a[j])flag1[j]=1;
else break;
}
for(int j=n-1;j>=1;j--)
{
if(a[j+1]<=a[j])flag2[j]=1;
else break;
}
for(int j=1;j<=n;j++)
{
if(flag1[j]&&flag2[j])cout<<j<<" ";
flag1[j]=flag2[j]=0;
}
cout<<endl;
// if(flag)cout<<"YES\n";
// else cout<<"NO\n";
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 7756kb
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: 5ms
memory: 7764kb
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:
2 1 1 1 2 1 1 1 1 1 2 1 1 ...
result:
wrong answer 1st numbers differ - expected: '16', found: '2'