結果

問題 No.2247 01 ZigZag
ユーザー 👑 colognecologne
提出日時 2023-03-21 13:31:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 584 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 81,624 KB
実行使用メモリ 54,052 KB
最終ジャッジ日時 2023-10-18 18:23:51
合計ジャッジ時間 3,896 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,512 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 37 ms
53,512 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 36 ms
53,512 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 36 ms
53,512 KB
testcase_16 WA -
testcase_17 AC 37 ms
53,512 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 36 ms
53,512 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 36 ms
53,512 KB
testcase_33 AC 36 ms
53,512 KB
testcase_34 AC 35 ms
53,512 KB
testcase_35 AC 36 ms
53,512 KB
testcase_36 AC 36 ms
53,512 KB
testcase_37 AC 36 ms
53,512 KB
testcase_38 AC 36 ms
53,512 KB
testcase_39 AC 36 ms
53,512 KB
testcase_40 WA -
testcase_41 AC 37 ms
53,512 KB
testcase_42 AC 36 ms
53,512 KB
testcase_43 AC 37 ms
53,512 KB
testcase_44 AC 36 ms
53,512 KB
testcase_45 WA -
testcase_46 AC 37 ms
54,040 KB
testcase_47 AC 36 ms
53,512 KB
testcase_48 AC 37 ms
53,512 KB
testcase_49 AC 36 ms
53,512 KB
testcase_50 AC 35 ms
53,512 KB
testcase_51 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def s(N, z, M, o, K):
    if N == 0 or M == 0:
        if K == 0:
            return N*z+M*o
        else:
            return -1
    if K == 0:
        return False
    if K > 2*M:
        return False
    if K >= 2*N:
        return False
    if K % 2 == 0:
        return (z+o)*(K//2) + o * (M-K//2) + z * (N-K//2)
    else:
        return z * (N-K//2) + (o+z)*(K//2) + o * (M-K//2)


def main():
    N, M, K = map(int, input().split())
    if N >= M:
        R = s(N, '0', M, '1', K)
    else:
        R = s(M, '1', N, '0', K)
    print(R)


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