[알고리즘] 백준 17389 - 보너스 점수 (C++) [문제 링크] : https://www.acmicpc.net/problem/17389#include #include #include using namespace std;int main(){ int N, cnt = 0, Ans = 0; string S; cin >> N >> S; for(int i=0; i 알고리즘 2025.04.30
[알고리즘] 백준 11179 - 2진수 뒤집기 (C++) [문제 링크] : https://www.acmicpc.net/problem/11179#include using namespace std;int main(){ long long N; string S = ""; cin >> N; while(N > 0){ if(N % 2 == 1){ S += "1"; } else{ S += "0"; } N /= 2; } long long Ans=0; for(int i=0; i 알고리즘 2025.04.29
[알고리즘] 백준 9501 - 꿍의 우주여행 (C++) [문제 링크] : https://www.acmicpc.net/problem/9501#include using namespace std;int main(){ int T, N, M, a, b, c; cin >> T; while(T--){ int Ans = 0; cin >> N >> M; while(N--){ cin >> a >> b >> c; if (a * b / c >= M){ Ans++; } } cout 알고리즘 2025.04.28
[알고리즘] 백준 9713 - Sum of Odd Sequence (C++) [문제 링크] : https://www.acmicpc.net/problem/9713#include using namespace std;int main(){ int N, inp; cin >> N; for(int i=0; i> inp; int sum = 0; for(int j=1; j 알고리즘 2025.04.27
[알고리즘] 백준 2596 - 비밀편지 (C++) [문제 링크] : https://www.acmicpc.net/problem/2596#include #include using namespace std;int N;string S;string Arr[8] = {"000000","001111","010011","011100","100110","101001","110101","111010"};int cmp(string s, int n){ int res = 0; for(int j=0; j> N >> S; string Ans; for(int i=0; i 알고리즘 2025.04.26
[알고리즘] 백준 14623 - 감정이입 (C++) [문제 링크] : https://www.acmicpc.net/problem/14623#include #include #include using namespace std;long long pow(int n){ int res = 1; for(int i=0; i 0){ res += n % 2 + '0'; n /= 2; } reverse(res.begin(), res.end()); return res;}int main(){ string A, B; cin >> A >> B; long long a = 0, b = 0; int x = A.length(), y = B.length(); for(int i=0; i 알고리즘 2025.04.25
[알고리즘] 백준 10834 - 벨트 (C++) [문제 링크] : https://www.acmicpc.net/problem/10834#include using namespace std;int main(){ int N, Ans = 1, tmp = 0, x, y, r; cin >> N; while(N--){ cin >> x >> y >> r; Ans /= x; Ans *= y; tmp ^= r; } cout 알고리즘 2025.04.24
[알고리즘] 백준 25704 - 출석 이벤트 (C++) [문제 링크] : https://www.acmicpc.net/problem/25704#include using namespace std;int main(){ int N, P; cin >> N >> P; int Ans = P; if(N >= 5){ Ans = min(Ans, P - 500); } if(N >= 10){ Ans = min(Ans, P / 10 * 9); } if(N >= 15){ Ans = min(Ans, P - 2000); } if(N >= 20){ Ans = min(Ans, P / 4 * 3); } cout 알고리즘 2025.04.23
[알고리즘] 백준 8723 - Patyki (C++) [문제 링크] : https://www.acmicpc.net/problem/8723#include #include using namespace std;int Arr[3];bool A, B;int main(){ cin >> Arr[0] >> Arr[1] >> Arr[2]; sort(Arr, Arr + 3); if(Arr[0] == Arr[1] && Arr[1] == Arr[2]){ A = true; } if(Arr[2] * Arr[2] == Arr[0] * Arr[0] + Arr[1] * Arr[1]){ B = true; } if(A == false && B == false){ cout 알고리즘 2025.04.22
[알고리즘] 백준 27219 - Робинзон Крузо (C++) [문제 링크] : https://www.acmicpc.net/problem/27219#include using namespace std;int main(){ int N; cin >> N; int a = N / 5, b = N % 5; for(int i=0; i 알고리즘 2025.04.21