Submission #3442225
Source Code Expand
#include<iostream> #include <string> #include<algorithm> #include <set> using namespace std; int main(void){ ios::sync_with_stdio(false); int N,i,j,k; cin >> N; int d[N]; for (i = 0; i < N; i++) cin >> d[i] >> endl; sort(d, d + N, greater<int>()); j = 0; k = 0; for (i = 0; i < N-1; i++) { if(d[i]!=d[i+1]) j++ } cout << j <<endl return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Kagami Mochi |
User | umekaeru |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 380 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:12:38: error: no match for ‘operator>>’ (operand types are ‘std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}’ and ‘<unresolved overloaded function type>’) for (i = 0; i < N; i++) cin >> d[i] >> endl; ^ In file included from /usr/include/c++/5/iostream:40:0, from ./Main.cpp:1: /usr/include/c++/5/istream:120:7: note: candidate: std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__istream_type& (*)(std::basic_istream<_CharT, _Traits>::__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>] operator>>(__istream_type& (*__pf)(__istream_type&)) ^ /usr/include/c++/5/istream:120:7: note: no known conversion for argument 1 from ‘<unresolved overloaded function type>’ to ‘std::basic_istream<char...