提出 #33836675
ソースコード 拡げる
from sys import stdin
def rec(A, index, N, M):
if index == N - 1:
for a in range(A[index - 1] + 1, M + 1):
A[index] = a
print(" ".join([str(x) for x in A]))
else:
for a in range(A[index - 1] + 1, M - (N - index) + 2):
A[index] = a
rec(A, index + 1, N, M)
def main():
N, M = map(int, stdin.readline().rstrip().split())
A = [0 for _ in range(N)]
if N == 1:
for a in range(1, M + 1):
print(a)
return
for a in range(1, M - N + 2):
A[0] = a
rec(A, 1, N, M)
if __name__ == "__main__":
main()
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - Monotonically Increasing |
| ユーザ | Astriclypeus |
| 言語 | Python (3.8.2) |
| 得点 | 300 |
| コード長 | 648 Byte |
| 結果 | AC |
| 実行時間 | 24 ms |
| メモリ | 9192 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 300 / 300 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example_00.txt, example_01.txt |
| All | example_00.txt, example_01.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| example_00.txt | AC | 23 ms | 9076 KiB |
| example_01.txt | AC | 18 ms | 9192 KiB |
| test_00.txt | AC | 18 ms | 9192 KiB |
| test_01.txt | AC | 19 ms | 9124 KiB |
| test_02.txt | AC | 19 ms | 8892 KiB |
| test_03.txt | AC | 18 ms | 9132 KiB |
| test_04.txt | AC | 24 ms | 8900 KiB |
| test_05.txt | AC | 22 ms | 8900 KiB |
| test_06.txt | AC | 23 ms | 9056 KiB |
| test_07.txt | AC | 17 ms | 8892 KiB |
| test_08.txt | AC | 19 ms | 9060 KiB |
| test_09.txt | AC | 18 ms | 8992 KiB |
| test_10.txt | AC | 18 ms | 8856 KiB |
| test_11.txt | AC | 18 ms | 8888 KiB |
| test_12.txt | AC | 19 ms | 8992 KiB |
| test_13.txt | AC | 18 ms | 8896 KiB |
| test_14.txt | AC | 18 ms | 8996 KiB |