結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー 👑 yumechiyumechi
提出日時 2017-03-19 09:51:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,742 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 10,548 KB
実行使用メモリ 156,864 KB
最終ジャッジ日時 2023-09-25 12:43:24
合計ジャッジ時間 4,275 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
9,048 KB
testcase_01 AC 74 ms
12,608 KB
testcase_02 AC 59 ms
10,916 KB
testcase_03 AC 127 ms
17,032 KB
testcase_04 AC 18 ms
8,624 KB
testcase_05 AC 18 ms
8,556 KB
testcase_06 AC 18 ms
8,500 KB
testcase_07 AC 18 ms
8,676 KB
testcase_08 AC 22 ms
8,864 KB
testcase_09 AC 91 ms
13,272 KB
testcase_10 AC 1,742 ms
156,864 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 = (i, j, n-i-j)
            if ansdict[t]:
                ansdict[t] = False
                print(i, j, n-i-j)

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