[알고리즘] 백준 15781 - 헬멧과 조끼 (C++) [문제 링크] : https://www.acmicpc.net/problem/15781#include #include using namespace std;int main(){ int N, M, A = 0, B = 0, inp; cin >> N >> M; for(int i=0; i> inp; A = max(A, inp); } for(int i=0; i> inp; B = max(B, inp); } cout 알고리즘 2025.03.06
[알고리즘] 백준 28431 - 양말 짝 맞추기 (C++) [문제 링크] : https://www.acmicpc.net/problem/28431#include using namespace std;int Arr[10];int main(){ int inp; for(int i=0; i> inp; Arr[inp]++; } for(int i=0; i 알고리즘 2025.03.05
[알고리즘] 백준 19602 - Dog Treats (C++) [문제 링크] : https://www.acmicpc.net/problem/19602#include using namespace std;int A, B, C, Ans;int main(){ cin >> A >> B >> C; Ans = 1 * A + 2 * B + 3 * C; if(Ans >= 10){ cout 알고리즘 2025.03.04
[알고리즘] 백준 15059 - Hard choice (C++) [문제 링크] : https://www.acmicpc.net/problem/15059#include using namespace std;int A[3], B[3], Ans;int main(){ for(int i=0; i> A[i]; } for(int i=0; i> B[i]; } for(int i=0; i 알고리즘 2025.03.03
[알고리즘] 백준 26489 - Gum Gum for Jay Jay (C++) [문제 링크] : https://www.acmicpc.net/problem/26489#include using namespace std;int main(){ string S; int Cnt = 0; while(getline(cin, S)){ Cnt++; } cout 알고리즘 2025.03.02
[알고리즘] 백준 27324 - ゾロ目 (Same Numbers) (C++) [문제 링크] : https://www.acmicpc.net/problem/27324#include using namespace std;char a, b;int main() { cin >> a >> b; if(a == b){ cout 알고리즘 2025.03.01
[알고리즘] 백준 3449 - 해밍 거리 (C++) [문제 링크] : https://www.acmicpc.net/problem/3449#include using namespace std;int main(){ string A, B; int T; cin >> T; for(int i=0; i> A >> B; int cnt = 0; for(int j=0; j 알고리즘 2025.02.28
[알고리즘] 백준 17202 - 핸드폰 번호 궁합 (C++) [문제 링크] : https://www.acmicpc.net/problem/17202#include using namespace std;string A, B, S = "";int main(){ cin >> A >> B; for(int i=0; i 2){ for(int i=0; i 알고리즘 2025.02.27
[알고리즘] 백준 2858 - 기숙사 바닥 (C++) [문제 링크] : https://www.acmicpc.net/problem/2858#include using namespace std;int R, B, S;bool flag;void solve(int cnt, int tmp){ int r = 0, b = 0; for(int i=0; i> R >> B; S = R + B; int l = 1; while(true){ if(S % l == 0){ int tmp = l; int cnt = S / l; solve(tmp, cnt); if(flag == true){ cout 알고리즘 2025.02.27
[알고리즘] 백준 29731 - 2033년 밈 투표 (C++) [문제 링크] : https://www.acmicpc.net/problem/29731#include #include using namespace std;long long T;string S;string check[7] = { "Never gonna give you up", "Never gonna let you down", "Never gonna run around and desert you", "Never gonna make you cry", "Never gonna say goodbye", "Never gonna tell a lie and hurt you", "Never gonna stop"};int main(){ .. 알고리즘 2025.02.25