結果

問題 No.182 新規性の虜
ユーザー Eclair1015
提出日時 2018-09-05 23:02:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 654 bytes
コンパイル時間 800 ms
コンパイル使用メモリ 68,092 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-15 17:24:25
合計ジャッジ時間 2,252 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 19 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

//inlclude前用define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>

using namespace std;
//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;

int main() {
	int n;
	cin >> n;
	VI a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	sort(a.begin(), a.end());
	int memo = a[0],cnt=0;
	bool sinki = true,first=true;
	for (int i = 1; i < n; i++) {
		if (memo == a[i]) {
			sinki = false;
		} else {
			memo = a[i];
			if (sinki) {
				if (first) cnt++;
				first = false;
				cnt++;
			}
			sinki = true;
		}
	}
	cout << cnt << endl;
	return 0;
}
0