提出 #3493215
ソースコード 拡げる
from itertools import combinations
import sys
N=int(input())
flag=True
for k in range(1000):
    s=(k*(k+1))//2
    if s==N:
        flag=False
        break
if flag:
    print('No')
    sys.exit()
table=[[k] for i in range(k+1)]
s=1
for elem in combinations(range(k+1),2):
    table[elem[0]].append(s)
    table[elem[1]].append(s)
    s+=1
print('Yes')
print(k+1)
for i in range(k+1):
    print(' '.join(map(str,table[i])))
			提出情報
| 提出日時 | |
|---|---|
| 問題 | D - Crossing | 
| ユーザ | okumura | 
| 言語 | PyPy3 (2.4.0) | 
| 得点 | 500 | 
| コード長 | 449 Byte | 
| 結果 | AC | 
| 実行時間 | 210 ms | 
| メモリ | 43484 KiB | 
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 500 / 500 | ||||
| 結果 | 
										
											
											
  | 
								
									
										
											
											
  | 
								
							
| セット名 | テストケース | 
|---|---|
| Sample | s1.txt, s2.txt | 
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, s1.txt, s2.txt | 
| ケース名 | 結果 | 実行時間 | メモリ | 
|---|---|---|---|
| 01.txt | AC | 171 ms | 38640 KiB | 
| 02.txt | AC | 168 ms | 38512 KiB | 
| 03.txt | AC | 166 ms | 38256 KiB | 
| 04.txt | AC | 165 ms | 38256 KiB | 
| 05.txt | AC | 165 ms | 38384 KiB | 
| 06.txt | AC | 167 ms | 38256 KiB | 
| 07.txt | AC | 167 ms | 38256 KiB | 
| 08.txt | AC | 165 ms | 38256 KiB | 
| 09.txt | AC | 174 ms | 38256 KiB | 
| 10.txt | AC | 165 ms | 38256 KiB | 
| 11.txt | AC | 209 ms | 43100 KiB | 
| 12.txt | AC | 210 ms | 43484 KiB | 
| 13.txt | AC | 165 ms | 38256 KiB | 
| 14.txt | AC | 164 ms | 38256 KiB | 
| 15.txt | AC | 165 ms | 38256 KiB | 
| 16.txt | AC | 164 ms | 38384 KiB | 
| 17.txt | AC | 169 ms | 38256 KiB | 
| 18.txt | AC | 179 ms | 39024 KiB | 
| 19.txt | AC | 189 ms | 41196 KiB | 
| 20.txt | AC | 171 ms | 38256 KiB | 
| 21.txt | AC | 193 ms | 40560 KiB | 
| 22.txt | AC | 188 ms | 40304 KiB | 
| 23.txt | AC | 164 ms | 38256 KiB | 
| 24.txt | AC | 165 ms | 38256 KiB | 
| s1.txt | AC | 165 ms | 38256 KiB | 
| s2.txt | AC | 165 ms | 38256 KiB |