結果
問題 |
No.3280 Black-Tailed Gull vs Monster
|
ユーザー |
|
提出日時 | 2025-09-26 21:25:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 37 ms / 2,000 ms |
コード長 | 691 bytes |
コンパイル時間 | 1,817 ms |
コンパイル使用メモリ | 200,472 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-26 21:25:47 |
合計ジャッジ時間 | 3,939 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 40 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, x, q; cin >> n >> x >> q; int ans = 0; while(q--){ int m; cin >> m; vector<int> a(m); for(auto &&v : a) cin >> v; sort(a.begin(), a.end()); if(binary_search(a.begin(), a.end(), x)){ ans += 2; }else{ for(int i = 0; i + 1 < m; i++){ if(a[i] == a[i + 1]){ ans++; break; } } } } cout << ans / 2; if(ans & 1){ cout << ".5"; } cout << '\n'; }