Deep Learning study
백준 14501문제 본문
반응형
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a ; i<b ; i++)
int N, T[16], P[16], dp[10];
int main(){
cin >> N;
FOR(i,1,N+1) cin >> T[i] >> P[i];
FOR(i,1,N+2) FOR(j,1,i)
if(T[i-j] - j <= 0)
dp[i] = max(dp[i], dp[i-j] + P[i-j]);
cout << dp[N+1] << endl;
return 0;
}
백준 '퇴사'문제 풀이입니다.
반응형
'백준 문제 코드' 카테고리의 다른 글
백준 14500문제 (0) | 2019.12.16 |
---|---|
백준 14499문제 (0) | 2019.12.12 |
백준 17135문제 (0) | 2019.12.08 |
백준 3945문제 (0) | 2019.12.08 |
백준 17406문제 (0) | 2019.12.07 |
Comments