結果

問題 No.3280 Black-Tailed Gull vs Monster
ユーザー a01sa01to
提出日時 2025-09-29 00:15:47
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 777 bytes
コンパイル時間 2,595 ms
コンパイル使用メモリ 281,012 KB
実行使用メモリ 10,368 KB
最終ジャッジ日時 2025-09-29 00:15:52
合計ジャッジ時間 5,070 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;

int main() {
  cin.tie(nullptr)->sync_with_stdio(false);
  int n, x, q;
  cin >> n >> x >> q;
  int ansx2 = 0;
  while (q--) {
    int m;
    cin >> m;
    vector<int> a(m);
    rep(i, m) cin >> a[i];
    {
      bool exi = false;
      rep(i, m) if (a[i] == x) exi = true;
      if (exi) {
        ansx2 += 2;
        continue;
      }
    }
    {
      set<int> st;
      bool exi = false;
      rep(i, m) {
        if (st.contains(a[i])) exi = true;
        st.insert(a[i]);
      }
      if (exi) {
        ansx2 += 1;
        continue;
      }
    }
  }
  cout << ansx2 / 2 << '.' << (ansx2 % 2 * 5) << "\n";
  return 0;
}
0