Submission #3493215
Source Code Expand
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])))
Submission Info
| Submission Time | |
|---|---|
| Task | D - Crossing |
| User | okumura |
| Language | PyPy3 (2.4.0) |
| Score | 500 |
| Code Size | 449 Byte |
| Status | AC |
| Exec Time | 210 ms |
| Memory | 43484 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 500 / 500 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| 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 |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 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 |