QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#345127#4954. Eliminating BallonsPerejilWA 0ms3496kbC++20481b2024-03-06 10:00:082024-03-06 10:00:09

Judging History

你现在查看的是最新测评结果

  • [2024-03-06 10:00:09]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3496kb
  • [2024-03-06 10:00:08]
  • 提交

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;
}

詳細信息

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'