結果

問題 No.2871 Universal Serial Bus
ユーザー GOTKAKO
提出日時 2024-09-06 21:39:01
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,299 bytes
コンパイル時間 2,484 ms
コンパイル使用メモリ 199,968 KB
最終ジャッジ日時 2025-02-24 04:06:15
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
プレゼンテーションモードにする

#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int H,W; cin >> H >> W;
vector<string> S(H),T(H);
for(auto &s : S) cin >> s;
for(auto &t : T) cin >> t;
for(auto &s : S) for(auto &c : s) c ^= '.'^'#';
vector<string> S2(H,string(W,'.'));
for(int i=0; i<H; i++) for(int k=0; k<W; k++) S2.at(H-1-i).at(W-1-k) = S.at(i).at(k);
if(S != T){
{
swap(S,S2);
for(auto &s : S){
for(auto &c : s) cout << c;
cout << endl;
}
}
if(S == T){
double answer = 0,all = 1;
for(int i=1; i<=100; i+=2){
double now = 1.0-pow(0.5,i);
answer += all*now*(i+1);
all -= all*now;
}
cout << fixed << setprecision(20) << answer << endl;
}
else cout << "-1" << endl;
}
else if(S2 != T) cout << fixed << setprecision(20) << 3.5317401904617327 << endl;
else{
double answer = 0,all = 1;
for(int i=0; i<=100; i++){
double now = 1.0-pow(0.5,i);
answer += all*now*(i+1);
all -= all*now;
}
cout << fixed << setprecision(20) << answer << endl;
}
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0