結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー 👑 KazunKazun
提出日時 2021-02-14 17:57:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 590 ms / 2,000 ms
コード長 705 bytes
コンパイル時間 662 ms
コンパイル使用メモリ 86,296 KB
実行使用メモリ 217,448 KB
最終ジャッジ日時 2023-09-29 09:34:09
合計ジャッジ時間 5,157 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
76,768 KB
testcase_01 AC 98 ms
80,596 KB
testcase_02 AC 95 ms
80,028 KB
testcase_03 AC 116 ms
87,076 KB
testcase_04 AC 69 ms
71,504 KB
testcase_05 AC 67 ms
71,264 KB
testcase_06 AC 68 ms
71,152 KB
testcase_07 AC 72 ms
75,588 KB
testcase_08 AC 90 ms
76,728 KB
testcase_09 AC 110 ms
82,788 KB
testcase_10 AC 590 ms
217,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

class T:
    def __init__(self,a,b,c):
        self.a=a
        self.b=b
        self.c=c

    def __str__(self):
        return "({}, {}, {})".format(self.a,self.b,self.c)

    def __repr__(self):
        return str(self)

    def __lt__(self,other):
        if self.a<other.a:
            return True
        elif self.a==other.a and self.b<other.b:
            return True
        return False

    def __iter__(self):
        yield from (self.a,self.b,self.c)

import sys
write=sys.stdout.write

N=int(input())
X=[]
for a in range(1,N):
    for b in range(a,N):
        c=N-(a+b)
        if b<=c:
            X.append(T(a,b,c))

X.sort()
X=["{} {} {}".format(a,b,c) for a,b,c in X]
write("\n".join(X))
0