QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#569773 | #9313. Make Max | jxxiaoyu | WA | 0ms | 5196kb | C++14 | 545b | 2024-09-17 10:32:20 | 2024-09-17 10:32:21 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using namespace std;
//int x[9]={0,1,0,1,-1,0,-1,1,-1};
//int y[9]={0,0,1,1,0,-1,-1,-1,1};
void solve(){
int n;
cin>>n;
int a[200005]={0};
for(int i=1;i<=n;i++){
cin>>a[i];
}
int ans=0;
for(int i=1;i<=n;i++){
int l=0,r=0;
while(a[i-l-1]<a[i]&&a[i-l-1]>0)l++;
while(a[i+r+1]<a[i]&&a[i+r+1]>0)r++;
if(a[i+r+1]==a[i]){
continue;
}
ans+=(l+r);
}
cout<<ans<<endl;
}
signed main() {
int t=1;
cin>>t;
while(t--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 5196kb
input:
4 2 1 2 2 2 2 7 1 1 1 2 2 2 2 3 1 2 3
output:
1 0 0 3
result:
wrong answer 3rd numbers differ - expected: '3', found: '0'