cpp26 백준 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. 백준 1654번 : 랜선 자르기 [C++] 주소 : https://www.acmicpc.net/problem/1654 1654번: 랜선 자르기 첫째 줄에는 오영식이 이미 가지고 있는 랜선의 개수 K, 그리고 필요한 랜선의 개수 N이 입력된다. K는 1이상 10,000이하의 정수이고, N은 1이상 1,000,000이하의 정수이다. 그리고 항상 K ≦ N 이다. 그 www.acmicpc.net 소스 코드 : #define _SRT_SECURE_NO_WARNINGS #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(0);cin.tie(0); int K, N; int result = 0; vector v; cin >> K >> N; for (int .. 2022. 8. 22. 이전 1 ··· 3 4 5 6 7 다음