結果
問題 | No.2871 Universal Serial Bus |
ユーザー |
![]() |
提出日時 | 2024-09-06 21:49:31 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 748 bytes |
コンパイル時間 | 155 ms |
コンパイル使用メモリ | 82,600 KB |
実行使用メモリ | 54,692 KB |
最終ジャッジ日時 | 2024-09-06 21:49:38 |
合計ジャッジ時間 | 1,644 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 18 |
ソースコード
h,w=map(int,input().split())s=[list(input()) for i in range(h)]t=[list(input()) for i in range(h)]f1=1for i in range(h):for j in range(w):f1&=s[i][j]!=t[i][j]ns=[["."]*w for i in range(h)]for i in range(h):for j in range(w):ns[i][j]=s[~i][~j]s=nsf2=1for i in range(h):for j in range(w):f2&=s[i][j]!=t[i][j]if f1==1 and f2==0:p=0o=0x=1for i in range(1,200,2):o,x=x*(1-2**(-(i-1))),x*(2**(-(i-1)))p+=i*oprint(p)elif f1==0 and f2==1:p=0o=0x=1for i in range(2,200,2):o,x=x*(1-2**(-(i-1))),x*(2**(-(i-1)))p+=i*oprint(p)elif f1==1 and f2==1:p=0o=0x=1for i in range(1,200,1):o,x=x*(1-2**(-(i-1))),x*(2**(-(i-1)))p+=i*oprint(p)else:print(-1)