結果

問題 No.3280 Black-Tailed Gull vs Monster
ユーザー srjywrdnprkt
提出日時 2025-10-15 18:12:23
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 751 bytes
コンパイル時間 3,204 ms
コンパイル使用メモリ 280,880 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2025-10-15 18:12:31
合計ジャッジ時間 7,041 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 40
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
//#include <atcoder/modint>

using namespace std;
//using namespace atcoder;
using ll = long long;
//using mint = modint998244353;

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    int N, X, Q, ans=0;
    cin >> N >> X >> Q;
    while(Q--){
        int M;
        cin >> M;
        set<int> st;
        bool f=0, g=0; //f:ウミネコが行動したか?g:2回以上行動したものがいるか?
        while(M--){
            ll z;
            cin >> z;
            if (z == X) f=1;
            if (st.count(z)) g=1;
            st.insert(z);
        }
        if (f) ans += 2;
        else if (g) ans += 1;
    }
    cout << setprecision(18) << (long double)ans/2 << endl;

    return 0;
}
0