2023/03/28 3

[๋ฐฑ์ค€ 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