QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#689255 | #9313. Make Max | 202314170131 | WA | 0ms | 3632kb | C++14 | 629b | 2024-10-30 16:03:15 | 2024-10-30 16:03:17 |
Judging History
answer
#include <iostream>
#include <vector>
using namespace std;
void readCase(){
int n;
cin>>n;
vector<int>m(n);
for(int i=0;i<n;i++){
cin>>m[i];
}
vector<int>a(n),b(n);
a[0]=m[0];
for(int i=1;i<n;i++){
a[i]=max(a[i-1],m[i]);
}
b[n-1]=m[n-1];
for(int i=n-2;i>=0;i--){
b[i]=max(b[i+1],m[i]);
}
int maxps=0;
for(int i=0;i<n;++i){
if(a[i]!=b[i]){
maxps++;
}
}
cout<<maxps<<endl;
}
int main(){
int t;
cin>>t;
while(t--){
readCase();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3632kb
input:
4 2 1 2 2 2 2 7 1 1 1 2 2 2 2 3 1 2 3
output:
1 0 3 2
result:
wrong answer 4th numbers differ - expected: '3', found: '2'