結果

問題 No.1377 Half xor Half
ユーザー KudeKude
提出日時 2021-02-10 16:06:34
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 442 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 87,320 KB
実行使用メモリ 76,404 KB
最終ジャッジ日時 2023-09-22 10:28:57
合計ジャッジ時間 8,003 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,148 KB
testcase_01 AC 79 ms
71,312 KB
testcase_02 AC 79 ms
71,192 KB
testcase_03 AC 80 ms
71,036 KB
testcase_04 AC 80 ms
71,424 KB
testcase_05 AC 83 ms
71,412 KB
testcase_06 AC 84 ms
71,424 KB
testcase_07 AC 80 ms
71,288 KB
testcase_08 AC 84 ms
75,736 KB
testcase_09 AC 78 ms
71,028 KB
testcase_10 AC 86 ms
75,732 KB
testcase_11 AC 79 ms
71,316 KB
testcase_12 AC 81 ms
71,296 KB
testcase_13 AC 87 ms
75,912 KB
testcase_14 AC 79 ms
71,176 KB
testcase_15 AC 77 ms
71,108 KB
testcase_16 AC 77 ms
71,240 KB
testcase_17 AC 80 ms
75,860 KB
testcase_18 AC 83 ms
75,584 KB
testcase_19 AC 82 ms
75,612 KB
testcase_20 AC 86 ms
75,724 KB
testcase_21 AC 88 ms
75,564 KB
testcase_22 AC 85 ms
75,760 KB
testcase_23 AC 86 ms
75,652 KB
testcase_24 AC 85 ms
75,892 KB
testcase_25 AC 87 ms
75,568 KB
testcase_26 AC 84 ms
75,672 KB
testcase_27 AC 86 ms
75,888 KB
testcase_28 AC 85 ms
75,616 KB
testcase_29 AC 87 ms
75,720 KB
testcase_30 AC 83 ms
75,644 KB
testcase_31 AC 84 ms
75,632 KB
testcase_32 AC 84 ms
75,948 KB
testcase_33 AC 84 ms
75,736 KB
testcase_34 AC 87 ms
76,404 KB
testcase_35 AC 88 ms
76,240 KB
testcase_36 AC 87 ms
76,252 KB
testcase_37 AC 83 ms
75,752 KB
testcase_38 AC 87 ms
75,980 KB
testcase_39 AC 86 ms
76,220 KB
testcase_40 AC 87 ms
76,168 KB
testcase_41 AC 84 ms
75,744 KB
testcase_42 AC 85 ms
75,976 KB
testcase_43 AC 86 ms
76,220 KB
testcase_44 AC 87 ms
76,244 KB
testcase_45 AC 83 ms
75,664 KB
testcase_46 AC 85 ms
76,052 KB
testcase_47 AC 86 ms
76,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = list(map(int, input()))
t = list(map(int, input()))
ans = []
for i in range(n):
    if s[i] | s[i+n] != t[i] | t[i+n]:
        print(-1)
        exit()
    if (s[i], s[i+n]) == (t[i], t[i+n]):
        continue
    if (s[i] ^ s[i+n], s[i]) == (t[i], t[i+n]):
        ans.append(i)
        ans.append(i + 1)
    else:
        ans.append(i + n)
        ans.append((i + 1 + n) % (2 * n))
print(len(ans))
print(*ans, sep='\n')
0