結果
| 問題 | No.3280 Black-Tailed Gull vs Monster |
| コンテスト | |
| ユーザー |
nhtloc
|
| 提出日時 | 2025-12-04 12:41:46 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 2,000 ms |
| コード長 | 868 bytes |
| 記録 | |
| コンパイル時間 | 1,876 ms |
| コンパイル使用メモリ | 201,076 KB |
| 実行使用メモリ | 9,744 KB |
| 最終ジャッジ日時 | 2025-12-04 12:41:50 |
| 合計ジャッジ時間 | 4,398 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 40 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, X, Q;
cin >> N >> X >> Q;
double expected_value = 0.0;
for (int i = 0; i < Q; ++i) {
int M;
cin >> M;
vector<int> F(M);
for (int j = 0; j < M; ++j) cin >> F[j];
bool gull_acted = false;
unordered_map<int, int> count;
for (int f : F) {
if (f == X) gull_acted = true;
count[f]++;
}
if (gull_acted) expected_value += 1.0;
else {
bool multiple = false;
for (auto &p : count) {
if (p.second >= 2) { multiple = true; break; }
}
if (multiple) expected_value += 0.5;
}
}
cout << fixed << setprecision(5) << expected_value << "\n";
return 0;
}
nhtloc