結果

問題 No.1571 All Your Cycles Are Same Lengths
ユーザー 👑 KazunKazun
提出日時 2021-06-28 03:28:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 76,836 KB
最終ジャッジ日時 2023-09-07 18:12:03
合計ジャッジ時間 2,739 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,348 KB
testcase_01 AC 74 ms
71,076 KB
testcase_02 WA -
testcase_03 AC 81 ms
75,200 KB
testcase_04 WA -
testcase_05 AC 88 ms
76,216 KB
testcase_06 WA -
testcase_07 AC 91 ms
76,752 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

Q=int(input())

for _ in range(Q):
    N,T=map(int,input().split())

    if T%2==1:
        if T%N==0:
            print("Yes")
            for i in range(1,N+1):
                for j in range(i+1,N+1):
                    print(i,j,T//N)
        else:
            print("No")
    else:
        print("Yes")
        for i in range(1,N+1):
            for j in range(i+1,N+1):
                if i==1:
                    print(i,j,T//2)
                else:
                    print(i,j,0)
0