Skip to content

Commit

Permalink
1 성공
Browse files Browse the repository at this point in the history
  • Loading branch information
suzzingV committed Mar 22, 2023
1 parent 15093d6 commit 4713547
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
7 changes: 7 additions & 0 deletions b15651/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": "bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}
18 changes: 18 additions & 0 deletions b15651/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Getting Started

Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.

## Folder Structure

The workspace contains two folders by default, where:

- `src`: the folder to maintain sources
- `lib`: the folder to maintain dependencies

Meanwhile, the compiled output files will be generated in the `bin` folder by default.

> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
## Dependency Management

The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).
30 changes: 30 additions & 0 deletions b15651/src/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import java.io.*;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
String[] nm = new String[2];
nm = bf.readLine().split(" ");
int n = Integer.parseInt(nm[0]);
int m = Integer.parseInt(nm[1]);
int[] arr = new int[m];

DFS(arr, 0, n, bw);
bw.close();
}

public static void DFS(int[] arr, int i, int n, BufferedWriter bw) throws IOException {
if(i == arr.length) {
for(int j = 0; j < arr.length; j++) {
bw.write(Integer.toString(arr[j]) + " ");
}
bw.write("\n");
return;
}
for(int v = 1; v <= n; v++) {
arr[i] = v;
DFS(arr, i + 1, n, bw);
}
}
}

0 comments on commit 4713547

Please sign in to comment.