結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
78,180 KB
testcase_01 AC 136 ms
85,280 KB
testcase_02 AC 133 ms
83,340 KB
testcase_03 AC 176 ms
92,376 KB
testcase_04 AC 93 ms
71,716 KB
testcase_05 AC 91 ms
71,656 KB
testcase_06 AC 91 ms
71,404 KB
testcase_07 AC 97 ms
76,448 KB
testcase_08 AC 110 ms
78,204 KB
testcase_09 AC 148 ms
85,856 KB
testcase_10 AC 1,076 ms
287,196 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(i, n*2//3):
            if j > n-i-j:
                break
            t = tuple([i, j, n-i-j])
            if ansdict[t]:
                ansdict[t] = False
    print("\n".join([" ".join(map(str, elem)) for elem in sorted(ansdict.keys())]))

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