結果
| 問題 | No.3280 Black-Tailed Gull vs Monster |
| コンテスト | |
| ユーザー |
pengin_2000
|
| 提出日時 | 2025-09-27 13:17:51 |
| 言語 | C (gcc 15.2.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 555 bytes |
| 記録 | |
| コンパイル時間 | 143 ms |
| コンパイル使用メモリ | 39,648 KB |
| 最終ジャッジ日時 | 2026-02-22 13:48:32 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 WA * 1 RE * 5 |
ソースコード
#include<stdio.h>
int f[200005];
int cnt[200005];
int main()
{
int n, x, q;
scanf("%d %d %d", &n, &x, &q);
int i, m;
for (i = 0; i <= n; i++)
cnt[i] = 0;
int ans = 0, v;
for (; q > 0; q--)
{
scanf("%d", &m);
for (i = 0; i < m; i++)
scanf("%d", &f[i]);
for (i = 0; i < m; i++)
cnt[f[i]]++;
v = 0;
for (i = 0; i < m; i++)
if (cnt[f[i]] > 1)
v = 1;
if (cnt[x] > 0)
v = 2;
ans += v;
for (i = 0; i < m; i++)
cnt[f[i]]--;
}
if (ans % 2 > 0)
printf("%d.5\n", ans / 2);
else
printf("%d\n", ans / 2);
return 0;
}
pengin_2000