QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#709684 | #9142. Uniting Amoebas | rotcar07 | Compile Error | / | / | C++23 | 273b | 2024-11-04 16:14:27 | 2024-11-04 16:14:28 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
constexpr int mod=998244353;
int main(){
int t;cin>>t;
while(t--){
int n;cin>>n;
vector<long long> v(n);
for(int &x:v) cin>>x;
cout<<accumulate(v.begin(),v.end(),-*max_element(v.begin(),v.end()))<<'\n';
}
}
Details
answer.code: In function ‘int main()’: answer.code:9:28: error: cannot bind non-const lvalue reference of type ‘int&’ to a value of type ‘long long int’ 9 | for(int &x:v) cin>>x; | ^