結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー 👑 yumechiyumechi
提出日時 2017-03-19 09:42:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,897 ms / 2,000 ms
コード長 405 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 86,816 KB
実行使用メモリ 287,972 KB
最終ジャッジ日時 2023-09-25 12:42:25
合計ジャッジ時間 5,727 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
78,960 KB
testcase_01 AC 165 ms
82,324 KB
testcase_02 AC 153 ms
81,760 KB
testcase_03 AC 225 ms
90,844 KB
testcase_04 AC 92 ms
71,636 KB
testcase_05 AC 93 ms
71,728 KB
testcase_06 AC 93 ms
71,752 KB
testcase_07 AC 101 ms
76,196 KB
testcase_08 AC 121 ms
77,980 KB
testcase_09 AC 190 ms
84,816 KB
testcase_10 AC 1,897 ms
287,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

def solve():
    n = int(input())
    ansdict = defaultdict(lambda: True)
    for i in range(1, n//3+1):
        for j in range(1, n*2//3):
            t = tuple(sorted([i, j, n-i-j]))
            if ansdict[t]:
                ansdict[t] = False
    for ans in sorted(list(ansdict.keys())):
        print(" ".join(map(str, ans)))

if __name__=="__main__":
    solve()
0