結果

問題 No.182 新規性の虜
ユーザー d_seid_sei
提出日時 2019-08-27 14:21:31
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 555 bytes
コンパイル時間 669 ms
コンパイル使用メモリ 85,508 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-27 14:58:16
合計ジャッジ時間 2,190 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 24 ms
6,940 KB
testcase_09 AC 38 ms
6,948 KB
testcase_10 AC 36 ms
6,944 KB
testcase_11 AC 28 ms
6,940 KB
testcase_12 AC 12 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 RE -
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 23 ms
6,940 KB
testcase_19 AC 17 ms
6,940 KB
testcase_20 AC 10 ms
6,944 KB
testcase_21 AC 26 ms
6,940 KB
testcase_22 AC 13 ms
6,948 KB
testcase_23 RE -
testcase_24 AC 27 ms
6,940 KB
testcase_25 AC 17 ms
6,944 KB
testcase_26 AC 6 ms
6,940 KB
testcase_27 AC 1 ms
6,944 KB
evil01.txt AC 39 ms
6,940 KB
evil02.txt AC 40 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
#include<iomanip>
using namespace std;
typedef long long int lont;
int main() {
	int N;
	cin >> N;
	vector<int>veca(N);
	for (int ia = 0; ia < N; ia++) {
		cin >> veca.at(ia);
	}
	sort(veca.begin(), veca.end());
	int cnta = 0;
	if (veca.at(0) != veca.at(1)) {
		cnta++;
	}
	if (veca.at(N - 2) != veca.at(N - 1)) {
		cnta++;
	}
	for (int ib = 1; ib < N - 1; ib++) {
		if (veca.at(ib - 1) != veca.at(ib) && veca.at(ib) != veca.at(ib + 1)) {
			cnta++;
		}
	}
	cout << cnta << endl;
	}
0