Skip to content

초급반 / 이지우 / 돌게임 -9655, 합분해-2225, 선수과목-14567 #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions week2/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions week2/.idea/git_toolbox_blame.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions week2/.idea/material_theme_project_new.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions week2/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions week2/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions week2/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions week2/.idea/week2.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions week2/dynamic_programming/돌게임/dlwldn30/Main.java
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저도 규칙이 간단해서 이렇게 작성하긴했는데 더 복잡해진다면 동적프로그래밍 점화식으로 어떻게 풀지 생각해보면 좋을거 같아요~

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package 돌게임.dlwldn30;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

int N = Integer.parseInt(br.readLine());

if(N%2==0){
System.out.println("CY");
}
else {
System.out.println("SK");
}
}
}
14 changes: 14 additions & 0 deletions week2/dynamic_programming/선수과목/dlwldn30/Main.java
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

끝까지 화이팅입니다!

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package 선수과목.dlwldn30;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

int N = Integer.parseInt(br.readLine());
int M = Integer.parseInt(br.readLine());
}
}
28 changes: 28 additions & 0 deletions week2/dynamic_programming/합분해/dlwldn30/Main.java
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 제출 했을 때 정상 작동되나요 ??

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package 합분해.dlwldn30;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

int N = Integer.parseInt(br.readLine());
int K = Integer.parseInt(br.readLine());

int[][] dp= new int[K+1][N+1];

for (int i = 0; i <= N; i++){
dp[1][i] = 1;
}

for (int i = 2; i <= K; i++){
for (int n = 0; n <= N; n++){
dp[i][n] = (dp[i][n-1] + dp[i-1][n]) % 1000000000;
}
}
System.out.println(dp[K][N]);
}

}
82 changes: 82 additions & 0 deletions week2/out/production/week2/README.md

Large diffs are not rendered by default.

Binary file not shown.