結果

問題 No.3280 Black-Tailed Gull vs Monster
ユーザー 00 Sakuda
提出日時 2025-09-26 21:33:12
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 572 bytes
コンパイル時間 820 ms
コンパイル使用メモリ 107,432 KB
実行使用メモリ 10,604 KB
最終ジャッジ日時 2025-09-26 21:33:17
合計ジャッジ時間 4,248 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
using namespace std;
using ll = long long;
int main() {
	int N, X, Q;cin >> N >>X >> Q;
	int a = 0;int b = 0;
	while (Q--) {
		int m;cin >> m;
		vector<int> f;
		map<int, int> ap;
		bool flg = false;
		while (m--) {
			int a;cin >> a;
			f.push_back(a);
			ap[a]++;
			if (a == X) flg = true;
		}
		if (flg) {
			a++;
			continue;
		}
		for (auto v : f) {
			if (ap[v] >= 2) {
				b++;break;
			}
		}
	}
	double ans = (double)a;
	ans += (double)b / (2.0);
	cout << setprecision(20) << ans << endl;
}
0