ログインしてください。
提出 #33809373
ソースコード 拡げる
#include<bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &a) {
char c;for (c = getchar(); (c < '0' || c > '9') && c != '-'; c = getchar());bool f = c == '-';T x = f ? 0 : (c ^ '0');for (c = getchar(); c >= '0' && c <= '9'; c = getchar()) {x = x * 10 + (c ^ '0');}a = f ? -x : x;
}
template <typename T, typename ...Argv>
inline void read(T &a, Argv &...argv) {
read(a), read(argv...);
}
int n, m;
int a[100];
void dfs(int p) {
if (p == n) {
for (int i = 1; i <= n; ++i) {
printf("%d ", a[i]);
}
puts("");
} else {
for (int i = a[p] + 1; i <= m; ++i) {
a[p + 1] = i;
dfs(p + 1);
}
}
}
signed main() {
read(n, m);
dfs(0);
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - Monotonically Increasing |
| ユーザ | rsdbk_husky |
| 言語 | C++ (GCC 9.2.1) |
| 得点 | 300 |
| コード長 | 714 Byte |
| 結果 | AC |
| 実行時間 | 7 ms |
| メモリ | 3748 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 | 7 ms | 3644 KiB |
| example_01.txt | AC | 2 ms | 3736 KiB |
| test_00.txt | AC | 2 ms | 3524 KiB |
| test_01.txt | AC | 2 ms | 3560 KiB |
| test_02.txt | AC | 4 ms | 3680 KiB |
| test_03.txt | AC | 2 ms | 3636 KiB |
| test_04.txt | AC | 2 ms | 3644 KiB |
| test_05.txt | AC | 3 ms | 3520 KiB |
| test_06.txt | AC | 2 ms | 3748 KiB |
| test_07.txt | AC | 2 ms | 3504 KiB |
| test_08.txt | AC | 2 ms | 3748 KiB |
| test_09.txt | AC | 3 ms | 3552 KiB |
| test_10.txt | AC | 2 ms | 3560 KiB |
| test_11.txt | AC | 2 ms | 3640 KiB |
| test_12.txt | AC | 2 ms | 3640 KiB |
| test_13.txt | AC | 2 ms | 3524 KiB |
| test_14.txt | AC | 2 ms | 3572 KiB |