나무재테크
-
[BOJ] 16235 나무 재테크공부/PS (백준) 2022. 4. 19. 23:39
https://www.acmicpc.net/problem/16235 16235번: 나무 재테크 부동산 투자로 억대의 돈을 번 상도는 최근 N×N 크기의 땅을 구매했다. 상도는 손쉬운 땅 관리를 위해 땅을 1×1 크기의 칸으로 나누어 놓았다. 각각의 칸은 (r, c)로 나타내며, r은 가장 위에서부터 www.acmicpc.net 비교적 쉬운 문제였지만 (문제 설명대로 구현만 하면 됐기에) 시간 제한이 0.3초로 매우 짧았기때문에 처음 제출한 코드는 시간초과가 떴다. #include #include #include using namespace std; int N, M, K; int A[20][20]; // 로봇이 공급하는 양분 int nutrient[20][20]; struct TREE { int age, ..