結果
問題 | No.1523 +/- Tree |
ユーザー | nrkt |
提出日時 | 2021-05-31 21:07:18 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 984 bytes |
コンパイル時間 | 325 ms |
コンパイル使用メモリ | 82,012 KB |
実行使用メモリ | 73,600 KB |
最終ジャッジ日時 | 2024-04-26 09:36:58 |
合計ジャッジ時間 | 5,023 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 43 ms
54,528 KB |
testcase_01 | AC | 41 ms
54,400 KB |
testcase_02 | AC | 44 ms
54,656 KB |
testcase_03 | AC | 39 ms
54,528 KB |
testcase_04 | AC | 41 ms
54,656 KB |
testcase_05 | AC | 40 ms
54,272 KB |
testcase_06 | AC | 43 ms
54,272 KB |
testcase_07 | AC | 39 ms
54,528 KB |
testcase_08 | AC | 38 ms
54,656 KB |
testcase_09 | AC | 41 ms
54,912 KB |
testcase_10 | AC | 37 ms
54,528 KB |
testcase_11 | AC | 40 ms
54,656 KB |
testcase_12 | AC | 70 ms
71,936 KB |
testcase_13 | AC | 68 ms
72,832 KB |
testcase_14 | AC | 63 ms
70,144 KB |
testcase_15 | AC | 49 ms
62,512 KB |
testcase_16 | AC | 64 ms
70,016 KB |
testcase_17 | AC | 46 ms
54,528 KB |
testcase_18 | AC | 70 ms
73,600 KB |
testcase_19 | AC | 38 ms
54,272 KB |
testcase_20 | AC | 38 ms
54,656 KB |
testcase_21 | AC | 39 ms
54,584 KB |
testcase_22 | AC | 40 ms
54,584 KB |
testcase_23 | AC | 41 ms
54,656 KB |
testcase_24 | AC | 39 ms
54,784 KB |
testcase_25 | AC | 58 ms
70,656 KB |
testcase_26 | AC | 52 ms
66,688 KB |
testcase_27 | AC | 62 ms
70,144 KB |
testcase_28 | AC | 59 ms
69,888 KB |
testcase_29 | AC | 47 ms
63,360 KB |
testcase_30 | AC | 47 ms
65,024 KB |
testcase_31 | AC | 58 ms
69,504 KB |
testcase_32 | AC | 41 ms
54,472 KB |
testcase_33 | AC | 58 ms
70,528 KB |
testcase_34 | AC | 52 ms
66,432 KB |
testcase_35 | AC | 59 ms
70,016 KB |
testcase_36 | AC | 53 ms
65,920 KB |
testcase_37 | AC | 55 ms
66,692 KB |
testcase_38 | AC | 44 ms
61,312 KB |
testcase_39 | AC | 57 ms
69,248 KB |
testcase_40 | AC | 58 ms
70,528 KB |
testcase_41 | AC | 57 ms
69,504 KB |
testcase_42 | AC | 38 ms
54,656 KB |
testcase_43 | AC | 57 ms
70,528 KB |
testcase_44 | AC | 62 ms
71,168 KB |
testcase_45 | WA | - |
ソースコード
#!/usr/bin/env python3 import sys import math from bisect import bisect_right as br from bisect import bisect_left as bl sys.setrecursionlimit(2147483647) from heapq import heappush, heappop,heappushpop from collections import defaultdict from itertools import accumulate from collections import Counter from collections import deque from operator import itemgetter from itertools import permutations mod = 10**9 + 7 inf = float('inf') def I(): return int(sys.stdin.readline()) def LI(): return list(map(int,sys.stdin.readline().split())) n, k = LI() if (n-1) % k == 0: print("No") else: print("Yes") a = (n - 1) // k b = a + 1 for x in range(n+1): for y in range(x+1, n+1): if -a*y + b*x > 0: break else: continue break for i in range(1, n): if i % k == 0: print(i, i+1, -y) elif i % k == 1: print(i, i+1, x) else: print(i, i+1, 0)