結果

問題 No.3615 Ge Gusser
コンテスト
ユーザー kazuppa
提出日時 2026-08-06 10:14:43
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 586 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,978 ms
コンパイル使用メモリ 336,968 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-08-06 13:40:28
合計ジャッジ時間 7,489 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
サブタスク 配点 結果
サンプル 0 % AC * 3
小課題1 40 % AC * 8
小課題2 40 % AC * 8 TLE * 1 -- * 6
小課題3 20 % AC * 11 TLE * 1 -- * 15
合計 2.5 * 40% = 100 点
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#define all(a) a.begin(),a.end()
using ll=long long;


int main(){
  int n,m;cin>>n>>m;
  vector<string> s(n);
  for(int i=0;i<n;i++)cin>>s[i];
  vector<int> p(n);
  for(int i=0;i<n;i++)p[i]=i;
  double ans=0;
  do{
    string t=string(m,'o');int o=m;
    for(int i=0;i<n;i++){
      for(int j=0;j<m;j++)
        if(s[p[i]][j]=='x'&&t[j]=='o')t[j]='x',o--;
      if(o==1){
        ans+=i+1;
        break;
      }
    }
  }while(next_permutation(all(p)));
  for(int i=1;i<=n;i++)ans/=i;
  cout<<fixed<<setprecision(15);
  cout<<ans<<endl;
}
0