8000 Merge pull request #446 from CLOUDoort/master · sms3025/basic-algo-lecture@7e1cb86 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7e1cb86

Browse files
Merge pull request encrypted-def#446 from CLOUDoort/master
Create 6602_2.cpp
2 parents 2051f72 + f1f4d01 commit 7e1cb86

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

0x0C/solutions/6602_2.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
cout << '\n';
30+
}
31+
}

0 commit comments

Comments
 (0)
0