結果

問題 No.182 新規性の虜
ユーザー hryshtk
提出日時 2015-06-28 00:10:08
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 475 bytes
コンパイル時間 2,462 ms
コンパイル使用メモリ 162,020 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-26 19:27:28
合計ジャッジ時間 2,512 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

using namespace std;
#include <bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for(int (I)=(A);(I)<(B);++(I))
#define ALL(C) (C).begin(),(C).end()
inline void solve()
{
	int N;cin>>N;
	vector<long>A(N+2);FOR(i,0,N)cin>>A[i];
	A[N]=-1;
	A[N+1]=1000000001;
	sort(ALL(A));
	int R=0;
	FOR(i,1,N+1)if(A[i]!=A[i-1]&&A[i]!=A[i+1])R++;
	cout<<R<<endl;
}
int main(int argc,char**argv)
{
	BEGIN
	solve();
	END
}
0