結果

問題 No.3280 Black-Tailed Gull vs Monster
ユーザー forest3
提出日時 2025-09-27 17:19:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 490 bytes
コンパイル時間 1,299 ms
コンパイル使用メモリ 162,792 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-27 17:19:14
合計ジャッジ時間 4,451 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 35 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for (int i = a; i < b; i++)
using ll = long long;

int main() {
	int n, x, q;
	cin >> n >> x >> q;
	double ans = 0;
	rep(qi, 0, q) {
		int m, xc = 0, fc = 0;
		cin >> m;
		vector<int> v(n + 1);
		rep(i, 0, m) {
			int f;
			cin >> f;
			if(f == x) xc++;
			else {
				if(v[f]) fc = 1;
				else v[f]++;
			}
		}
		if(xc) ans += 2;
		else {
			if(fc) ans += 1;
		}
	}
	cout << fixed << setprecision(12) << ans / 2 << endl;
}
0