Submission #1680785
Source Code Expand
#include <iostream> #include <string> using namespace std; int main(){ int N; int a[100000]; unsigned __int64 ans=0; int num; int i; int j; int c; int temp; cin>>N; for(i=0;i<N*3;i++){ cin>>a[i]; } for(i=0;i<N;i++){ num=i*3; for(j=0;j<2;j++){ for(c=0;c<2;c++){ if(a[num+c]>a[num+c+1]){ temp=a[num+c+1]; a[num+c+1]=a[num+c]; a[num+c]=temp; } } } } for(i=1;i<N*3;i=i+3){ ans=ans+a[i]; } cout<<ans; }
Submission Info
Submission Time | |
---|---|
Task | A - AtCoder Group Contest |
User | watamario15 |
Language | C++14 (Clang 3.8.0) |
Score | 0 |
Code Size | 493 Byte |
Status | CE |
Compile Error
./Main.cpp:8:18: error: expected ';' at end of declaration unsigned __int64 ans=0; ^ ; ./Main.cpp:33:3: error: use of undeclared identifier 'ans' ans=ans+a[i]; ^ ./Main.cpp:33:7: error: use of undeclared identifier 'ans' ans=ans+a[i]; ^ ./Main.cpp:36:8: error: use of undeclared identifier 'ans'; did you mean 'abs'? cout<<ans; ^~~ abs /usr/local/include/c++/v1/stdlib.h:117:44: note: 'abs' declared here inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} ^ ./Main.cpp:36:8: warning: address of function 'abs' will always evaluate to 'true' [-Wpointer-bool-conversion] cout<<ans; ~~^~~ ./Main.cpp:36:8: note: prefix with the address-of operator to silence this warning cout<<ans; ^ & 1 warning and 4 errors generated.