QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#418631 | #5122. Strange Sum | reverSilly | Compile Error | / | / | C++23 | 429b | 2024-05-23 14:55:01 | 2024-05-23 14:55:02 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
constexpr int mxn{100005};
int n;
set<int,greater<>>a;
int main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
cin>>n;
for(int i=0,ai;i<n;++i)
{
cin>>ai;
a.insert(ai);
}
int ans=0;
ans+=max(*a.front(),0);
a.erase(a.front());
if(!a.empty())
ans+=max(*a.front(),0);
cout<<ans;
return 0;
}
詳細信息
answer.code: In function ‘int main()’: answer.code:17:17: error: ‘class std::set<int, std::greater<void> >’ has no member named ‘front’ 17 | ans+=max(*a.front(),0); | ^~~~~ answer.code:18:15: error: ‘class std::set<int, std::greater<void> >’ has no member named ‘front’ 18 | a.erase(a.front()); | ^~~~~ answer.code:20:21: error: ‘class std::set<int, std::greater<void> >’ has no member named ‘front’ 20 | ans+=max(*a.front(),0); | ^~~~~