[알고리즘] 백준 11034 - 캥거루 세마리 2 (C++) [문제 링크] : https://www.acmicpc.net/problem/11034#include using namespace std;int A, B, C;int main(){ while(cin >> A >> B >> C){ cout 알고리즘 2025.03.31
[알고리즘] 백준 2435 - 기상청 인턴 신현수 (C++) [문제 링크] : https://www.acmicpc.net/problem/2435#include using namespace std;int Arr[101];int main(){ int N, K, maxi = -9999, sum = 0; cin >> N >> K; for(int i=0; i> Arr[i]; } for(int i=0; i 알고리즘 2025.03.30
[알고리즘] 백준 15667 - 2018 연세대학교 프로그래밍 경시대회 (C++) [문제 링크] : https://www.acmicpc.net/problem/15667#include #include using namespace std;int N, A, B;int main(){ cin >> N; N -= 1; while(true){ A++; if(A * A + A == N){ break; } } cout 알고리즘 2025.03.29
[알고리즘] 백준 14568 - 2017 연세대학교 프로그래밍 경시대회 (C++) [문제 링크] : https://www.acmicpc.net/problem/14568#include using namespace std;int main(){ int N; cin >> N; int cnt = 0; for(int i=0; i j || i 알고리즘 2025.03.28
[알고리즘] 백준 32384 - 사랑은 고려대입니다 (C++) [문제 링크] : https://www.acmicpc.net/problem/32384#include using namespace std;int main(){ int N; cin >> N; for(int i=0; i 알고리즘 2025.03.27
[알고리즘 ]백준 5612 - 터널의 입구와 출구 (C++) [문제 링크] : https://www.acmicpc.net/problem/5612#include using namespace std;int main(){ int N, M, A, B; cin >> N >> M; int Ans = M; for(int i=0; i> A >> B; M += A - B; if(M = Ans){ Ans = M; } } cout 알고리즘 2025.03.26
[알고리즘] 백준 20361 - 일우는 야바위꾼 (C++) [문제 링크] : https://www.acmicpc.net/problem/20361#include #include using namespace std;int N, M, K, Ans;vector V;int main(){ cin >> N >> M >> K; V.resize(N + 1); for(int i=1; i> a >> b; swap(V[a], V[b]); } for(int i=1; i 알고리즘 2025.03.25
[알고리즘] 백준 7595 - Triangles (C++) [문제 링크] : https://www.acmicpc.net/problem/7595#include using namespace std;int N;int main(){ while(true){ cin >> N; if(N == 0){ break; } for(int i=0; i 알고리즘 2025.03.24
[알고리즘] 백준 14909 - 양수 개수 세기 (C++) [문제 링크] : https://www.acmicpc.net/problem/14909#include using namespace std;int main(){ int N = 0, inp; while(true){ cin >> inp; if(cin.eof() == 1){ break; } if(inp > 0){ N++; } } cout 알고리즘 2025.03.23
[알고리즘] 백준 2816 - 디지털 티비 (C++) [문제 링크] : https://www.acmicpc.net/problem/2816#include #include using namespace std;int N;string Arr[101];int main(){ cin >> N; int idx1 = 0, idx2 = 0; for(int i=1; i> Arr[i]; if(Arr[i] == "KBS1"){ idx1 = i; } if(Arr[i] == "KBS2"){ idx2 = i; } } int x = idx1 - 1; for(int i=1; i idx2){ idx2 += 1; } x = idx2 - 1; .. 알고리즘 2025.03.21