結果
| 問題 |
No.2871 Universal Serial Bus
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-06 21:28:57 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 920 bytes |
| コンパイル時間 | 2,054 ms |
| コンパイル使用メモリ | 199,436 KB |
| 最終ジャッジ日時 | 2025-02-24 04:01:11 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 WA * 5 |
ソースコード
#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 ^= '.'^'#';
if(S != T){
{
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);
swap(S,S2);
}
if(S == T){
double answer = 0,all = 1;
for(int i=1; i<=100; i+=2){
double now = 1-pow(0.5,i);
answer += all*now*(i+1);
all -= all*now;
}
cout << fixed << setprecision(20) << answer << endl;
}
else cout << "-1" << endl;
}
else cout << fixed << setprecision(20) << 3.5317401904617327 << endl;
}