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

8-YIM2UL2ET #27

Merged
merged 6 commits into from
Mar 10, 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
5 changes: 4 additions & 1 deletion YIM2UL2ET/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
| 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.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.01 | ์žฌ๊ท€ | [BOJ 10994](https://www.acmicpc.net/problem/10994) | [BOJ 10994 ํ’€์ด](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/27) |
---
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;
}
36 changes: 36 additions & 0 deletions YIM2UL2ET/์ •๋ ฌ/6์ฐจ์‹œ - BOJ 1599.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include <iostream>
#include <algorithm>

std::string translation(std::string min_str)
{
int s_diff = 0;
std::string alpha_str = min_str;
for (int i = 0; i < min_str.size(); i++) {
if (min_str[i] == 'k') alpha_str[i-s_diff] = 'c';
else if (min_str[i] > 'n') alpha_str[i-s_diff]++;
else if (min_str[i] == 'n' && i+1 < min_str.size() && min_str[i+1] == 'g') {
alpha_str.erase(alpha_str.begin() + (i++) - s_diff);
alpha_str[i - (++s_diff)] = 'o';
}
}
return alpha_str;
}

bool compare(std::string str1, std::string str2)
{
return translation(str1) < translation(str2);
}

int main(void)
{
int n;
std::cin >> n;

std::string min_str[n];
for (int i = 0; i < n; i++) std::cin >> min_str[i];

std::sort(min_str, min_str+n, compare);

for (int i = 0; i < n; i++) std::cout << min_str[i] << std::endl;
return 0;
}