提出 #29504566
ソースコード 拡げる
#include<cstdio>
#include<unordered_map>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
unordered_map<int, bool> a;
for (int i = 1; i <= n; ++i)
{
int x;
scanf("%d", &x);
a[x] = 1;
}
printf("%zd", a.size());
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Count Distinct Integers |
| ユーザ | LXl491214 |
| 言語 | C++ (GCC 9.2.1) |
| 得点 | 200 |
| コード長 | 260 Byte |
| 結果 | AC |
| 実行時間 | 7 ms |
| メモリ | 3244 KiB |
コンパイルエラー
./Main.cpp: In function ‘int main()’:
./Main.cpp:7:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
7 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
./Main.cpp:12:8: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
12 | scanf("%d", &x);
| ~~~~~^~~~~~~~~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| example_00.txt | AC | 7 ms | 3244 KiB |
| example_01.txt | AC | 2 ms | 3168 KiB |
| example_02.txt | AC | 2 ms | 3172 KiB |
| test_00.txt | AC | 2 ms | 3184 KiB |
| test_01.txt | AC | 2 ms | 3204 KiB |
| test_02.txt | AC | 2 ms | 3240 KiB |
| test_03.txt | AC | 2 ms | 3200 KiB |
| test_04.txt | AC | 2 ms | 3176 KiB |
| test_05.txt | AC | 3 ms | 3084 KiB |
| test_06.txt | AC | 2 ms | 3132 KiB |