목록전체 글 (40)
이것도 알아야 하네?

문제 https://www.acmicpc.net/problem/15748 15748번: Rest Stops The first line of input contains four integers: $L$, $N$, $r_F$, and $r_B$. The next $N$ lines describe the rest stops. For each $i$ between $1$ and $N$, the $i+1$-st line contains two integers $x_i$ and $c_i$, describing the position of the $i$-th rest st www.acmicpc.net 농부 John과 그의 트레이너 Bessie가 산행을 하는데, Bessie가 얻을 수 있는 최대 taste를 찾는 것이..
#include using namespace std; int main() { int N; cin >> N; vector map(2, vector(N+1, 0)); vector dp(N+1, vector(N+1, 0)); for (int i = 0; i > map[i][j]; } } for (int i = 1; i < N+1; i++) { for (int j = 1; j < N+1; j++) { dp[i][j] = max(dp[i-1][j], dp[i][j-1]); if (abs(map[0][i]-map[1][j])

문제 https://www.acmicpc.net/problem/11993 11993번: Circular Barn (Gold) Being a fan of contemporary architecture, Farmer John has built a new barn in the shape of a perfect circle. Inside, the barn consists of a ring of \(n\) rooms, numbered clockwise from \(1 \ldots n\) around the perimeter of the barn (\(3 \leq n \leq 100,00 www.acmicpc.net 간단하게, n 개의 공간과 n 마리의 소가 있을 때 각 방에 1마리의 소를 넣는 문제이다. 공간은 ..