QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#345127 | #4954. Eliminating Ballons | Perejil | WA | 0ms | 3496kb | C++20 | 481b | 2024-03-06 10:00:08 | 2024-03-06 10:00:09 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,a=0,cont=0;
cin>>n;
vector<int> s;
for(int i=0;i<n;i++){
int x;
cin>>x;
s.push_back(x);
}
while(s.size()>0){
int r=1;
for(int j=1;j<s.size();j++){
if(s[0]==s[j]+r){ s.erase(s.begin() + j);
r++;}
}
s.erase(s.begin() + 0);
cont++;
}
cout<<cont<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3496kb
input:
5 3 2 1 5 4
output:
3
result:
wrong answer 1st lines differ - expected: '2', found: '3'