結果
問題 | No.1377 Half xor Half |
ユーザー |
![]() |
提出日時 | 2022-03-18 13:54:57 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 51 ms / 2,000 ms |
コード長 | 367 bytes |
コンパイル時間 | 1,050 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 59,392 KB |
最終ジャッジ日時 | 2024-10-02 16:41:55 |
合計ジャッジ時間 | 4,400 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 46 |
ソースコード
import sys input=lambda:sys.stdin.readline().rstrip() N=int(input()) S=input() T=input() ans=[] for i in range(N): a=int(S[i]+S[i+N],2) b=int(T[i]+T[i+N],2) if a*b: if (b-a+3)%3==1: ans.append(i) ans.append(i+1) elif (b-a+3)%3==2: ans.append(i+N) ans.append((i+N+1)%(2*N)) elif a+b: print(-1) sys.exit() print(len(ans)) for i in ans: print(i)