Submission #3442222


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 382 Byte
Status CE

Compile Error

./Main.cpp:5:22: error: expected identifier before ‘;’ token
 using namespace std::;
                      ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:8:2: error: ‘ios’ has not been declared
  ios::sync_with_stdio(false);
  ^
./Main.cpp:10:2: error: ‘cin’ was not declared in this scope
  cin >> N;
  ^
./Main.cpp:10:2: note: suggested alternative:
In file included from ./Main.cpp:1:0:
/usr/include/c++/5/iostream:60:18: note:   ‘std::cin’
   extern istream cin;  /// Linked to standard input
                  ^
./Main.cpp:12:41: error: ‘endl’ was not declared in this scope
  for (i = 0; i < N; i++) cin >> d[i] >> endl;
                                         ^
./Main.cpp:12:41: note: suggested alternative:
In file included from /usr/include/c++/5/iostream:39:0,
                 from ./Main.cpp:1:
/usr/include/c++/5/ostream:590:5: note:   ‘std::endl’
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^
./Main.cpp:13:17: error: ‘greater’ was not declared in this scope
  sort(d, d + N, greater<int>())...