Skip to content
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

9-YIM2UL2ET #29

Merged
merged 6 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 5 additions & 2 deletions YIM2UL2ET/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
| 2์ฐจ์‹œ | 2024.02.15 | ๊ทธ๋ฆฌ๋”” | [BOJ 1263](https://www.acmicpc.net/problem/1263) | [BOJ 1449 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/7) |
| 3์ฐจ์‹œ | 2024.02.18 | ์Šคํƒ | [BOJ 2504](https://www.acmicpc.net/problem/2504) | [BOJ 2504 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/9) |
| 4์ฐจ์‹œ | 2024.02.21 | ๋ฑ | [BOJ 1021](https://www.acmicpc.net/problem/1021) | [BOJ 1021 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/12) |
| 5์ฐจ์‹œ | 2024.02.21 | ํ | [BOJ 1158](https://www.acmicpc.net/problem/1158) | [BOJ 1158 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/16) |
| 5์ฐจ์‹œ | 2024.02.21 | ์ •๋ ฌ | [BOJ 1599](https://www.acmicpc.net/problem/1599) | [BOJ 1599 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/21) |
| 5์ฐจ์‹œ | 2024.02.24 | ํ | [BOJ 1158](https://www.acmicpc.net/problem/1158) | [BOJ 1158 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/16) |
| 6์ฐจ์‹œ | 2024.02.27 | ์ •๋ ฌ | [BOJ 1599](https://www.acmicpc.net/problem/1599) | [BOJ 1599 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/21) |
| 7์ฐจ์‹œ | 2024.03.01 | ์žฌ๊ท€ | [BOJ 2705](https://www.acmicpc.net/problem/2705) | [BOJ 2705 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/23) |
| 8์ฐจ์‹œ | 2024.03.04 | ์žฌ๊ท€ | [BOJ 10994](https://www.acmicpc.net/problem/10994) | [BOJ 10994 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/27) |
| 9์ฐจ์‹œ | 2024.03.07 | ์ž„์˜ ์ •๋ฐ€๋„ / ํฐ ์ˆ˜ ์—ฐ์‚ฐ && ์žฌ๊ท€ | [BOJ 1914](https://www.acmicpc.net/problem/1914) | [BOJ 1914 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/29) |
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include <iostream>

std::string FindValue(int n)
{
std::string result = "1";
for (int i = 0; i < n; i++) {
for (int j = 0; j < result.size(); j++) {
result[j] = (result[j] - '0') * 2 + '0';
if (result[j] > '9') {
result[j] -= 10;
if (j == 0) result.insert(result.begin(), '1'), j++;
else result[j-1]++;
}
}
}
result[result.size()-1]--;
return result;
}

void Hanoi(int level, int start, int between, int end)
{
if (level == 1) std::cout << start << " " << end << "\n";
else {
Hanoi(level-1, start, end, between);
std::cout << start << " " << end << "\n";
Hanoi(level-1, between, start, end);
}
return;
}

int main(void) {
int n;
std::cin >> n;
std::cout << FindValue(n) << "\n";
if (!(n > 20)) Hanoi(n, 1, 2, 3);
return 0;
}
23 changes: 23 additions & 0 deletions YIM2UL2ET/์žฌ๊ท€/7์ฐจ์‹œ - BOJ 2705.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <iostream>

int ary[1000] = {0};

int solve(int n)
{
if (ary[n-1] != 0) return ary[n-1];
for (int i = 0; n-i*2 > 1;) ary[n-1] += solve(++i);
return ++ary[n-1];
}

int main(void)
{
int n, input;
ary[0] = 1;

std::cin >> n;
for (int i = 0; i < n; i++) {
std::cin >> input;
std::cout << solve(input) << std::endl;
}
return 0;
}
42 changes: 42 additions & 0 deletions YIM2UL2ET/์žฌ๊ท€/8์ฐจ์‹œ - BOJ 10994.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include <iostream>

void cover1(int n, int level)
{
for (int i = 0; i < level; i++) std::cout << "* ";
for (int i = 0; i < 4*(n-level)-3; i++) std::cout << "*";
for (int i = 0; i < level; i++) std::cout << " *";
std::cout << "\n";
}

void cover2(int n, int level)
{
for (int i = 0; i < level; i++) std::cout << "* ";
std::cout << "*";
for (int i = 0; i < 4*(n-level)-5; i++) std::cout << " ";
std::cout << "*";
for (int i = 0; i < level; i++) std::cout << " *";
std::cout << "\n";
}

void star(int n, int level)
{
if (n == level+1) {
for (int i = 0; i < n*2-2; i++) std::cout << "* ";
std::cout << "*\n";
}
else {
cover1(n, level);
cover2(n, level);
star(n, level+1);
cover2(n, level);
cover1(n, level);
}
}

int main(void)
{
int n;
std::cin >> n;
star(n, 0);
return 0;
}