結果

問題 No.3615 Ge Gusser
コンテスト
ユーザー mocchi
提出日時 2026-08-06 16:15:10
言語 C++23(gnu拡張gcc16)
(gcc 16.1.0 + boost 1.90.0)
コンパイル:
g++-16 -O2 -lm -std=gnu++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 826 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,735 ms
コンパイル使用メモリ 363,536 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-08-06 16:15:19
合計ジャッジ時間 9,114 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
サブタスク 配点 結果
サンプル 0 % WA * 3
小課題1 40 % AC * 1 WA * 7
小課題2 40 % AC * 1 WA * 7 RE * 7
小課題3 20 % AC * 1 WA * 10 RE * 16
合計 2.5 * 0% = 0 点
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#include <cassert>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
using ll = long long;
constexpr int inf = 1e9;
signed main() {
    int N,M;
    cin >> N >> M;
    vector<string> S(N);
    rep(i,N) cin >> S[i];
    assert(N <= 6);
    vector<int> per(N);
    ranges::iota(per,0);
    ll cnt = 0;
    do
    {
        string p;
        rep(i,N) p.push_back('o');
        rep(i,N)
        {
            rep(j,N)
            {
                if (S[i][j] == 'x') p[j] = 'x';
            }
            if (ranges::count(p,'o') == 1) cnt += i + 1;
        }
    }while (ranges::next_permutation(per).found);
    ll div = 1;
    for (int i = 1; i <= N; i++) div *= i;
    cout << fixed << setprecision(10) << static_cast<long double>(cnt) / static_cast<long double>(div) << endl;
}
0