Submission #69511508
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
/////////////////// メイン ///////////////////
int main () {
//////////////////// 入力 ////////////////////
int n, m, k;
cin >> n >> m >> k;
vector<int> a(k), b(k);
for (int i=0; i<k; i++) {
cin >> a.at(i) >> b.at(i);
}
//////////////// 出力変数定義 ////////////////
vector<int> result;
//////////////////// 処理 ////////////////////
// その人が何問解いたか(実はどの問題を解いたかは管理する必要がない)
// 0番は無駄に置いておく
vector<int> counters(n+1,0);
// イベントを前から順にチェック
for (int i : a) {
// 正解者の正解数を1増やす
counters.at(i)++;
// m回目の正解だったら全完なので、resultに放り込む
if (counters.at(i)==m) result.emplace_back(i);
}
//////////////////// 出力 ////////////////////
for (size_t i=0; i<result.size(); i++) {
cout << result.at(i);
if (i!=result.size()-1) {
cout << " ";
}
}
cout << endl;
//////////////////// 終了 ////////////////////
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Perfect |
| User | wightou |
| Language | C++ 23 (gcc 12.2) |
| Score | 200 |
| Code Size | 1181 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3700 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt |
| All | example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 1 ms | 3564 KiB |
| example_01.txt | AC | 1 ms | 3500 KiB |
| hand_00.txt | AC | 1 ms | 3568 KiB |
| hand_01.txt | AC | 1 ms | 3564 KiB |
| hand_02.txt | AC | 1 ms | 3468 KiB |
| hand_03.txt | AC | 1 ms | 3700 KiB |
| hand_04.txt | AC | 1 ms | 3504 KiB |
| hand_05.txt | AC | 1 ms | 3544 KiB |
| hand_06.txt | AC | 1 ms | 3492 KiB |
| random_00.txt | AC | 1 ms | 3564 KiB |
| random_01.txt | AC | 1 ms | 3508 KiB |
| random_02.txt | AC | 1 ms | 3568 KiB |
| random_03.txt | AC | 1 ms | 3492 KiB |
| random_04.txt | AC | 1 ms | 3496 KiB |
| random_05.txt | AC | 1 ms | 3656 KiB |
| random_06.txt | AC | 1 ms | 3696 KiB |
| random_07.txt | AC | 1 ms | 3512 KiB |
| random_08.txt | AC | 1 ms | 3556 KiB |
| random_09.txt | AC | 1 ms | 3512 KiB |
| random_10.txt | AC | 1 ms | 3512 KiB |
| random_11.txt | AC | 1 ms | 3508 KiB |