# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
199067 | mahmoudbadawy | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++17 | 367 ms | 180124 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
vector<int> pos[3];
int mem[404][404][404][3];
int vis[404][404][404][3];
int sum[404][3];
int n;
string s;
int go(int x,int y,int z,int las)
{
if(x+y+z==n) return 0;
int &ret=mem[x][y][z][las];
if(vis[x][y][z][las]) return ret;
vis[x][y][z][las]=1;
ret=(1<<30);
int cpos=x+y+z;
if(x<pos[0].size()&&(las!=0||cpos==0))
{
int dif=0;
dif+=max(sum[pos[0][x]][1]-y,0);
dif+=max(sum[pos[0][x]][2]-z,0);
ret=min(ret,go(x+1,y,z,0)+dif);
}
if(y<pos[1].size()&&(las!=1||cpos==0))
{
int dif=0;
dif+=max(sum[pos[1][y]][0]-x,0);
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |