結果
問題 |
No.182 新規性の虜
|
ユーザー |
![]() |
提出日時 | 2018-08-26 02:13:22 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 369 bytes |
コンパイル時間 | 521 ms |
コンパイル使用メモリ | 60,644 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-27 13:32:09 |
合計ジャッジ時間 | 2,321 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 12 WA * 15 |
ソースコード
#include <iostream> #include <algorithm> using namespace std; int main(){ int n; cin >> n; int a[n]; for(int i = 0; i < n; i++) cin >> a[i]; sort(a,a+n); int ans = n; for(int i = 0; i < n; i++) if(a[i] == a[i+1]) ans--; if(a[0] == a[n-1]) ans--; cout << ans << endl; return 0; }