백준27 백준 1676번 : 팩토리얼 0의 개수 [C++] 주소 : https://www.acmicpc.net/problem/1676 1676번: 팩토리얼 0의 개수 N!에서 뒤에서부터 처음 0이 아닌 숫자가 나올 때까지 0의 개수를 구하는 프로그램을 작성하시오. www.acmicpc.net #define _CRT_SECURE_NO_WARINGS #include using namespace std; int main() { int ans = 0; int n; cin >> n; for (int i = 5;i 2022. 8. 25. 백준 18111번 : 마인크래프트 [C++] 주소 : https://www.acmicpc.net/problem/18111 18111번: 마인크래프트 팀 레드시프트는 대회 준비를 하다가 지루해져서 샌드박스 게임인 ‘마인크래프트’를 켰다. 마인크래프트는 1 × 1 × 1(세로, 가로, 높이) 크기의 블록들로 이루어진 3차원 세계에서 자유롭게 www.acmicpc.net 소스 코드 : #define _CRT_SECURE_NO_WARNINGS #include using namespace std; int main() { ios_base::sync_with_stdio(0);cin.tie(0); int N, M, B; int arr[500][500]; int least_time = 987654321; int H; cin >> N >> M >> B; for (i.. 2022. 8. 23. 백준 2805번 : 나무 자르기 [C++] 주소 : https://www.acmicpc.net/problem/2805 2805번: 나무 자르기 첫째 줄에 나무의 수 N과 상근이가 집으로 가져가려고 하는 나무의 길이 M이 주어진다. (1 ≤ N ≤ 1,000,000, 1 ≤ M ≤ 2,000,000,000) 둘째 줄에는 나무의 높이가 주어진다. 나무의 높이의 합은 항상 M보 www.acmicpc.net 소스 코드 : #define _CRT_SECURE_NO_WARNINGS #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int start, end, mid, N, M; int max = 0; .. 2022. 8. 23. 백준 1874번 : 스택 수열 [C++] 주소 : https://www.acmicpc.net/problem/1874 1874번: 스택 수열 1부터 n까지에 수에 대해 차례로 [push, push, push, push, pop, pop, push, push, pop, push, push, pop, pop, pop, pop, pop] 연산을 수행하면 수열 [4, 3, 6, 8, 7, 5, 2, 1]을 얻을 수 있다. www.acmicpc.net 소스 코드 : #define _CRT_SECURE_NO_WARNINGS #include #include #include using namespace std; int main() { int n; int check; int arr[100001]; string str1 = "push"; string str2 = .. 2022. 8. 23. 이전 1 ··· 3 4 5 6 7 다음