QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#661226 | #5149. Best Carry Player | Tytytony# | WA | 0ms | 5796kb | C++23 | 476b | 2024-10-20 15:21:54 | 2024-10-20 15:21:59 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#define N 500010
using namespace std;
int n,a[N],Map[N],cnt;
int main(){
int T; cin>>T;
while(T--){
cin>>n;
cnt=0;
for(int i=1;i<=n+1;i++){
Map[i]=0;
}
for(int i=0;i<n;i++){
cin>>a[i];
if(Map[a[i]+1]==1){
Map[a[i]+1]=0;
Map[a[i]]=1;
}
else{
cnt++;
Map[a[i]]=1;
}
}
cout<<cnt<<endl;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 5796kb
input:
2 3 9 99 999 1 12345
output:
3 1
result:
wrong answer 1st numbers differ - expected: '5', found: '3'