結果
問題 | No.630 門松グラフ |
ユーザー | mkawa2 |
提出日時 | 2020-06-11 14:24:52 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,261 bytes |
コンパイル時間 | 134 ms |
コンパイル使用メモリ | 11,028 KB |
実行使用メモリ | 25,316 KB |
最終ジャッジ日時 | 2023-09-06 08:12:13 |
合計ジャッジ時間 | 6,748 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 20 ms
8,800 KB |
testcase_02 | AC | 24 ms
8,672 KB |
testcase_03 | AC | 20 ms
8,720 KB |
testcase_04 | AC | 20 ms
8,732 KB |
testcase_05 | AC | 20 ms
8,756 KB |
testcase_06 | AC | 20 ms
8,764 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 21 ms
8,712 KB |
testcase_10 | AC | 21 ms
8,704 KB |
testcase_11 | AC | 21 ms
8,656 KB |
testcase_12 | AC | 21 ms
8,676 KB |
testcase_13 | AC | 20 ms
8,704 KB |
testcase_14 | AC | 20 ms
8,672 KB |
testcase_15 | AC | 20 ms
8,672 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 21 ms
8,800 KB |
testcase_22 | WA | - |
testcase_23 | AC | 20 ms
8,636 KB |
testcase_24 | AC | 142 ms
16,436 KB |
testcase_25 | AC | 20 ms
8,684 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 177 ms
24,456 KB |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | AC | 152 ms
20,620 KB |
testcase_32 | WA | - |
testcase_33 | AC | 81 ms
13,956 KB |
testcase_34 | AC | 122 ms
18,072 KB |
testcase_35 | WA | - |
ソースコード
from operator import itemgetter from itertools import * from bisect import * from collections import * from heapq import * import sys sys.setrecursionlimit(10 ** 6) def II(): return int(sys.stdin.readline()) def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def SI(): return sys.stdin.readline()[:-1] def LLI(rows_number): return [LI() for _ in range(rows_number)] def LLI1(rows_number): return [LI1() for _ in range(rows_number)] int1 = lambda x: int(x) - 1 def MI1(): return map(int1, sys.stdin.readline().split()) def LI1(): return list(map(int1, sys.stdin.readline().split())) p2D = lambda x: print(*x, sep="\n") dij = [(1, 0), (0, 1), (-1, 0), (0, -1)] def main(): n,m=MI() n1=n//2 n0=n-n//2 if m<n-1 or m>n0*n1: print("NO") exit() uv=[] for v in range(n0+1,n+1):uv+=[(v-n0,v),(v-n0+1,v)] #print(uv) cnt=n-1 for v in range(n0 + 1, n + 1): for u in range(1,n0+1): if cnt==m: print("YES") print(*list(range(1,n+1))) for u,v in uv:print(u,v) exit() if v-n0==u or v-n0+1==u:continue uv.append((u,v)) cnt+=1 main()