8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2051f72 + f1f4d01 commit 7e1cb86Copy full SHA for 7e1cb86
0x0C/solutions/6602_2.cpp
@@ -0,0 +1,31 @@
1
+// Authored by : qwee158
2
+// Co-authored by : -
3
+// https://www.acmicpc.net/source/58264738
4
+#include <bits/stdc++.h>
5
+using namespace std;
6
+
7
+int k, input[20], arr[10];
8
9
+void func(int cnt, int cur) {
10
+ if(cnt == 6) {
11
+ for(int i = 0; i < 6; i++) cout << arr[i] << ' ';
12
+ cout << '\n';
13
+ return;
14
+ }
15
+ for(int i = cur; i < k; i++) {
16
+ arr[cnt] = input[i];
17
+ func(cnt+1, i+1);
18
19
+}
20
21
+int main(void) {
22
+ ios::sync_with_stdio(0);
23
+ cin.tie(0);
24
+ while(1) {
25
+ cin >> k;
26
+ if(k == 0) break;
27
+ for(int i = 0; i < k; i++) cin >> input[i];
28
+ func(0, 0);
29
30
31
0 commit comments