結果
問題 |
No.2871 Universal Serial Bus
|
ユーザー |
![]() |
提出日時 | 2024-09-06 21:37:08 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 663 bytes |
コンパイル時間 | 2,134 ms |
コンパイル使用メモリ | 198,416 KB |
最終ジャッジ日時 | 2025-02-24 04:04:50 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 18 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int H,W; cin>>H>>W; vector<string>S(H),T(H); for(int i=0;i<H;i++)cin>>S[i]; for(int i=0;i<H;i++) { cin>>T[i]; for(char &c:T[i])c=(c=='.'?'#':'.'); } auto R=S; reverse(R.begin(),R.end()); for(auto &r:R)reverse(r.begin(),r.end()); if(S==T&&R==T) { cout<<"2.6416325606551538"<<endl; } else if(S==T) { cout<<"3.5317401904617327"<<endl; } else if(R==T) { cout<<"3.128936827211877"<<endl; } else { cout<<"-1"<<endl; } }