Skip to content
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
2 changes: 2 additions & 0 deletions dohyeondol1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@
| 18μ°¨μ‹œ | 2025.07.04 | κΈ°ν•˜ν•™ | [Water Testing](https://www.acmicpc.net/problem/16057)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/70|
| 19μ°¨μ‹œ | 2025.07.09 | κ·Έλž˜ν”„ 이둠 | [μ΅œμ†Œ μŠ€νŒ¨λ‹ 트리](https://www.acmicpc.net/problem/1197)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/76|
| 20μ°¨μ‹œ | 2025.07.10 | λ¬Έμžμ—΄ | [접두사](https://www.acmicpc.net/problem/1141)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/78|
| 21μ°¨μ‹œ | 2025.07.14 | κ·Έλž˜ν”„ 이둠 | [석고 λͺ¨ν˜• λ§Œλ“€κΈ°](https://www.acmicpc.net/problem/32031)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/81|
| 21μ°¨μ‹œ | 2025.07.19 | 그리디 μ•Œκ³ λ¦¬μ¦˜ | [λŒ€νšŒ 개졜](https://www.acmicpc.net/problem/12915)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/87|
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#include <iostream>
using namespace std;

int totalCompetiton;

int main() {
int easy, easyMedium, medium, mediumHigh, high;
cin >> easy >> easyMedium >> medium >> mediumHigh >> high;

while(true) {
bool easySubmitted = false;
bool mediumSubmitted = false;
bool highSubmitted = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

bool이라 큰 상관은 없을 것 같은데, μ΄λ ‡κ²Œ λœλ‹€λ©΄ λ°˜λ³΅λ¬Έμ„ 돌 λ•Œλ§ˆλ‹€ 선언이 λ˜λ‹ˆ λ©”λͺ¨λ¦¬λ₯Ό 쑰금 더 먹을 것 κ°™μ•„μš”! γ…Žγ…Ž


if(easy) {
easy--;
easySubmitted = true;
}
else {
if(easyMedium) {
easyMedium--;
easySubmitted = true;
}
}

if(medium) {
medium--;
mediumSubmitted = true;
}
else {
if(easyMedium || mediumHigh) {
if(easyMedium >= mediumHigh)
easyMedium--;
else
mediumHigh--;
mediumSubmitted = true;
}
}

if(high) {
high--;
highSubmitted = true;
}
else {
if(mediumHigh) {
mediumHigh--;
highSubmitted = true;
}
}

if(!easySubmitted || !mediumSubmitted || !highSubmitted)
break;

++totalCompetiton;
}

cout << totalCompetiton << '\n';
return 0;
}