๋ฐฑ์ค€ 15

[๋ฐฑ์ค€ 11655] ROT13

๋ฌธ์ œ 11655๋ฒˆ: ROT13 ์ฒซ์งธ ์ค„์— ์•ŒํŒŒ๋ฒณ ๋Œ€๋ฌธ์ž, ์†Œ๋ฌธ์ž, ๊ณต๋ฐฑ, ์ˆซ์ž๋กœ๋งŒ ์ด๋ฃจ์–ด์ง„ ๋ฌธ์ž์—ด S๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. S์˜ ๊ธธ์ด๋Š” 100์„ ๋„˜์ง€ ์•Š๋Š”๋‹ค. www.acmicpc.net ํ’€์ด ๋กœ๊ทธ์ธ www.acmicpc.net using namespace std; // ์•”ํ˜ธํ™” > ์•ŒํŒŒ๋ฒณ ์œ„์น˜ +13 // ๋ณตํ˜ธํ™” > ์•”ํ˜ธํ™”๋œ ์•ŒํŒŒ๋ฒณ ์œ„์น˜ +13 // ์˜ˆ์™ธ > ์•ŒํŒŒ๋ฒณ์ด ์•„๋‹Œ ๋ฌธ์ž๋Š” ํŒจ์Šค // A : 65 // Z : 90 // a : 97 // z : 122 string input; void encrypt(char c, bool isBig) { int start = 'a'; if (isBig) start = 'A'; int result = c - start + 13; if (26

Algorithm 2023.04.03

[๋ฐฑ์ค€ 10988] ํŒฐ๋ฆฐ๋“œ๋กฌ์ธ์ง€ ํ™•์ธํ•˜๊ธฐ

๋ฌธ์ œ 10988๋ฒˆ: ํŒฐ๋ฆฐ๋“œ๋กฌ์ธ์ง€ ํ™•์ธํ•˜๊ธฐ ์ฒซ์งธ ์ค„์— ๋‹จ์–ด๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ๋‹จ์–ด์˜ ๊ธธ์ด๋Š” 1๋ณด๋‹ค ํฌ๊ฑฐ๋‚˜ ๊ฐ™๊ณ , 100๋ณด๋‹ค ์ž‘๊ฑฐ๋‚˜ ๊ฐ™์œผ๋ฉฐ, ์•ŒํŒŒ๋ฒณ ์†Œ๋ฌธ์ž๋กœ๋งŒ ์ด๋ฃจ์–ด์ ธ ์žˆ๋‹ค. www.acmicpc.net ํ’€์ด ์ž…๋ ฅํ•œ ๋ฌธ์ž์—ด์„ ๋ฐ˜์œผ๋กœ ๋‚˜๋ˆ„๊ณ , ์•ž ๋ถ€๋ถ„๊ณผ ์ด๋ฅผ ๋’ค์ง‘์€ ๊ณณ์— ์œ„์น˜ํ•œ ๊ฐ’์„ ๋น„๊ตํ•˜๋Š” ๋ฐฉ๋ฒ• #include using namespace std; int solve(string str) { int center = (str.length() / 2) + (str.length() % 2); // ์ค‘๊ฐ„์˜ ์ „๋ฉด๊ณผ ํ›„๋ฉด์„ ๋น„๊ต for (int i = 0; i < center; i++) { int j = str.length() - i - 1; if (str[i] != str[j]) return 0; } return 1; } ..

Algorithm 2023.03.29

[๋ฐฑ์ค€ 2979] ํŠธ๋Ÿญ ์ฃผ์ฐจ

๋ฌธ์ œ 2979๋ฒˆ: ํŠธ๋Ÿญ ์ฃผ์ฐจ ์ฒซ์งธ ์ค„์— ๋ฌธ์ œ์—์„œ ์„ค๋ช…ํ•œ ์ฃผ์ฐจ ์š”๊ธˆ A, B, C๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. (1 ≤ C ≤ B ≤ A ≤ 100) ๋‹ค์Œ ์„ธ ๊ฐœ ์ค„์—๋Š” ๋‘ ์ •์ˆ˜๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์ด ์ •์ˆ˜๋Š” ์ƒ๊ทผ์ด๊ฐ€ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ํŠธ๋Ÿญ์ด ์ฃผ์ฐจ์žฅ์— ๋„์ฐฉํ•œ ์‹œ๊ฐ„๊ณผ ์ฃผ์ฐจ์žฅ www.acmicpc.net ํ’€์ด #include using namespace std; int timeCount[101], feeTable[3], parkingTime[3][2], amount; int main() { // ์š”๊ธˆ ํ…Œ์ด๋ธ” ์ž…๋ ฅ scanf("%d %d %d", &feeTable[0], &feeTable[1], &feeTable[2]); for (int i = 0; i < 3; i++) { // ์ฃผ์ฐจ์‹œ๊ฐ„ ์ž…๋ ฅ scanf("%d %d", &parkingTi..

Algorithm 2023.03.28

[๋ฐฑ์ค€ 10808] ์•ŒํŒŒ๋ฒณ ๊ฐœ์ˆ˜

๋ฌธ์ œ 10808๋ฒˆ: ์•ŒํŒŒ๋ฒณ ๊ฐœ์ˆ˜ ๋‹จ์–ด์— ํฌํ•จ๋˜์–ด ์žˆ๋Š” a์˜ ๊ฐœ์ˆ˜, b์˜ ๊ฐœ์ˆ˜, …, z์˜ ๊ฐœ์ˆ˜๋ฅผ ๊ณต๋ฐฑ์œผ๋กœ ๊ตฌ๋ถ„ํ•ด์„œ ์ถœ๋ ฅํ•œ๋‹ค. www.acmicpc.net ํ’€์ด #include using namespace std; string s; int result['z' + 1]; int main() { cin >> s; for (char c: s) { result[c]++; } for (int i = 'a'; i

Algorithm 2023.03.28

[๋ฐฑ์ค€ 2309] ์ผ๊ณฑ ๋‚œ์Ÿ์ด

๋ฌธ์ œ 2309๋ฒˆ: ์ผ๊ณฑ ๋‚œ์Ÿ์ด ์•„ํ™‰ ๊ฐœ์˜ ์ค„์— ๊ฑธ์ณ ๋‚œ์Ÿ์ด๋“ค์˜ ํ‚ค๊ฐ€ ์ฃผ์–ด์ง„๋‹ค. ์ฃผ์–ด์ง€๋Š” ํ‚ค๋Š” 100์„ ๋„˜์ง€ ์•Š๋Š” ์ž์—ฐ์ˆ˜์ด๋ฉฐ, ์•„ํ™‰ ๋‚œ์Ÿ์ด์˜ ํ‚ค๋Š” ๋ชจ๋‘ ๋‹ค๋ฅด๋ฉฐ, ๊ฐ€๋Šฅํ•œ ์ •๋‹ต์ด ์—ฌ๋Ÿฌ ๊ฐ€์ง€์ธ ๊ฒฝ์šฐ์—๋Š” ์•„๋ฌด๊ฑฐ๋‚˜ ์ถœ๋ ฅํ•œ๋‹ค. www.acmicpc.net ํ’€์ด #include using namespace std; int main() { // ์ž…๋ ฅ๋œ ๋‚œ์Ÿ์ด๋“ค์˜ ํ‚ค int array[9]; for (int i = 0; i > array[i]; } // ๋‚œ์Ÿ์ด ์ •๋ ฌ (์˜ค๋ฆ„์ฐจ์ˆœ) for (int n = 0; n < 9; n++) { for (int m = n + 1; m < 9; m++) { if (array[m]

Algorithm 2023.03.28