結果

問題 No.1820 NandShift
ユーザー 👑 tamatotamato
提出日時 2022-01-21 22:46:08
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 772 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,724 KB
実行使用メモリ 76,268 KB
最終ジャッジ日時 2023-08-17 07:06:48
合計ジャッジ時間 4,378 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,560 KB
testcase_01 AC 73 ms
71,848 KB
testcase_02 AC 71 ms
72,024 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 72 ms
71,620 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 76 ms
75,624 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 73 ms
71,584 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+1, 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 + k, N + 3 + k))
        if X[M - K + k+1] == "1":
            ans.append((2, L, N + 4 + k, N + 3))
            ans.append((2, N + 4 + k, L, 0))
    ans.append((2, L+1, N + 4 + K - 2, 0))
    ans.append((2, 0, L+1, L+2))

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


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