Submission #60343067


Source Code Expand

Copy
N, M = map(int, input().split())
class Main():
def __init__(self):
self.ans = []
def main(self, N, M, ints, pre):
length =len(ints)
if length == N:
self.ans.append(ints)
return
for i in range(pre + 10 , M - 10*(N - 1 - length) + 1):
self.main(N, M, ints + [i], i)
main_class = Main()
for j in range(1, M):
main_class.main(N, M, [j], j)
print(len(main_class.ans))
for answer in main_class.ans:
print(*answer)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
N, M = map(int, input().split())
class Main():
  def __init__(self):
    self.ans = []
  def main(self, N, M, ints, pre):
    length =len(ints)
    if length == N:
      self.ans.append(ints)
      return

    for i in range(pre + 10 , M - 10*(N - 1 - length) + 1):
      self.main(N, M, ints + [i], i)
        
main_class = Main()
for j in range(1, M):
  main_class.main(N, M, [j], j)
  

print(len(main_class.ans))
for answer in main_class.ans:
  print(*answer)

Submission Info

Submission Time
Task D - Keep Distance
User Verniy73
Language Python (CPython 3.11.4)
Score 425
Code Size 483 Byte
Status AC
Exec Time 1015 ms
Memory 63052 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 425 / 425
Status
AC × 1
AC × 31
Set Name Test Cases
Sample sample00.txt
All sample00.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt, testcase11.txt, testcase12.txt, testcase13.txt, testcase14.txt, testcase15.txt, testcase16.txt, testcase17.txt, testcase18.txt, testcase19.txt, testcase20.txt, testcase21.txt, testcase22.txt, testcase23.txt, testcase24.txt, testcase25.txt, testcase26.txt, testcase27.txt, testcase28.txt, testcase29.txt
Case Name Status Exec Time Memory
sample00.txt AC 9 ms 8532 KB
testcase00.txt AC 9 ms 8416 KB
testcase01.txt AC 9 ms 8488 KB
testcase02.txt AC 9 ms 8500 KB
testcase03.txt AC 9 ms 8504 KB
testcase04.txt AC 9 ms 8448 KB
testcase05.txt AC 9 ms 8536 KB
testcase06.txt AC 10 ms 8880 KB
testcase07.txt AC 11 ms 9228 KB
testcase08.txt AC 11 ms 9164 KB
testcase09.txt AC 9 ms 8540 KB
testcase10.txt AC 10 ms 8976 KB
testcase11.txt AC 10 ms 8424 KB
testcase12.txt AC 10 ms 8876 KB
testcase13.txt AC 17 ms 9524 KB
testcase14.txt AC 15 ms 9420 KB
testcase15.txt AC 9 ms 8532 KB
testcase16.txt AC 9 ms 8456 KB
testcase17.txt AC 66 ms 11988 KB
testcase18.txt AC 49 ms 11036 KB
testcase19.txt AC 239 ms 21376 KB
testcase20.txt AC 10 ms 8532 KB
testcase21.txt AC 9 ms 8420 KB
testcase22.txt AC 10 ms 8948 KB
testcase23.txt AC 11 ms 9220 KB
testcase24.txt AC 16 ms 9276 KB
testcase25.txt AC 31 ms 10096 KB
testcase26.txt AC 74 ms 12160 KB
testcase27.txt AC 178 ms 17372 KB
testcase28.txt AC 430 ms 29576 KB
testcase29.txt AC 1015 ms 63052 KB


2025-03-21 (Fri)
13:17:53 +00:00