| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 86995 | sh25_shenpy | 什么时候开会 | C++ | 通过 | 0 MS | 252 KB | 1242 | 2026-04-10 15:02:25 |
#include <iostream> #include <map> #include <vector> #include <algorithm> #include <climits> using namespace std; int main() { int n, k; cin >> n >> k; map<int, int> dayCount; // 统计每天能来的人数 for (int i = 0; i < n; i++) { int m; cin >> m; for (int j = 0; j < m; j++) { int day; cin >> day; dayCount[day]++; } } // 找出最多能来的人数 int max_people = 0; for (auto &p : dayCount) { if (p.second > max_people) { max_people = p.second; } } // 如果达不到最少人数,会议取消(按题意可能需要输出0或特殊值) // 但题目样例未说明,假设一定有解 if (max_people < k) { // 题目未明确输出,但为保险可输出0 cout << 0 << endl; return 0; } // 找最早(最小)的天数,使得人数等于max_people int ans = INT_MAX; for (auto &p : dayCount) { if (p.second == max_people) { ans = p.first; break; // map按键升序,第一个就是最小的 } } cout << ans << endl; return 0; }