結果

問題 No.182 新規性の虜
ユーザー daradara_sanmadaradara_sanma
提出日時 2017-07-07 22:46:10
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 352 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 58,868 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 01:18:45
合計ジャッジ時間 3,783 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 20 ms
5,376 KB
testcase_19 AC 15 ms
5,376 KB
testcase_20 AC 10 ms
5,376 KB
testcase_21 AC 23 ms
5,376 KB
testcase_22 AC 13 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 30 ms
5,376 KB
testcase_25 AC 17 ms
5,376 KB
testcase_26 RE -
testcase_27 AC 2 ms
5,376 KB
evil01.txt RE -
evil02.txt RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;

int main() {
	int n, a[100001] = {};
	scanf("%d", &n);
	vector<int> b(n);
	for (int i = 0; i < n; i++)
	{
		cin >> b[i];
		a[b[i]] += 1;
	}

	int ans = 0;
	for (auto i = b.begin(); i != b.end(); i++)
	{
		if (a[*i] == 1)
		{
			ans++;
		}
	}
	cout << ans << endl;

	return 0;
}
0