結果

問題 No.1820 NandShift
ユーザー 👑 tamatotamato
提出日時 2022-01-21 22:52:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 775 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 87,584 KB
実行使用メモリ 76,144 KB
最終ジャッジ日時 2023-08-17 07:13:53
合計ジャッジ時間 4,138 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,772 KB
testcase_01 AC 68 ms
71,876 KB
testcase_02 AC 68 ms
71,464 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 69 ms
71,608 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 75 ms
75,740 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 67 ms
71,608 KB
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N, M = map(int, input().split())
    X = input().rstrip('\n')

    ans = []
    # make 1
    ans.append((2, N+1, 0, 0))
    ans.append((1, N+2, N+1))
    ans.append((2, N+3, N+2, 0))
    ans.append((2, N+4, N+2, 0))

    K = 0
    L = 10 ** 5
    for i in range(M):
        if X[i] == "1":
            K = M - i
            break
    for k in range(K - 1):
        ans.append((1, N + 4, N + 4))
        if X[M - K + k + 1] == "1":
            ans.append((2, L, N+4, N+3))
            ans.append((2, N+4, L, 0))
    ans.append((2, L+1, N+4, 0))
    ans.append((2, 0, L+1, L+2))

    print(len(ans))
    for line in ans:
        print(*line)


if __name__ == '__main__':
    main()
0