結果
| 問題 |
No.3280 Black-Tailed Gull vs Monster
|
| コンテスト | |
| ユーザー |
pengin_2000
|
| 提出日時 | 2025-09-27 13:17:51 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 555 bytes |
| コンパイル時間 | 448 ms |
| コンパイル使用メモリ | 27,216 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-09-27 13:17:55 |
| 合計ジャッジ時間 | 3,268 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 WA * 1 RE * 5 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d %d %d", &n, &x, &q);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:14:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf("%d", &m);
| ^~~~~~~~~~~~~~~
main.c:16:25: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | scanf("%d", &f[i]);
| ^~~~~~~~~~~~~~~~~~
ソースコード
#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