#include #include #include using namespace std;int T, W;int arr[1001];int dp[1001][31][2]; // [시간][이동횟수][위치(0:1번, 1:2번)]int go(int time, int move, int pos) { // 기저 조건: 시간이 끝났다면 자두 못 받음 if (time > T) return 0; // 메모이제이션 되어 있다면 반환 int &ret = dp[time][move][pos]; if (ret != -1) return ret; ret = 0; // 현재 위치에서 자두를 받을 수 있는 경우 int get = (arr[time] == pos + 1) ? 1 : 0; // 1. ..