제출 #829300

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8293002023-08-18 08:30:06tolbiCatfish Farm (IOI22_fish)C++17
52 / 100
662 ms508384 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#include "fish.h"
ll dp[3001][3001][3];
int grid[3001][3001];
int N;
long long f(int x, int y, int flag){
if (dp[x][y][flag]!=-1) return dp[x][y][flag];
if (flag==1){
dp[x][y][flag]=0;
if (y<N){
ll crr = 0;
if (x>0) crr = grid[x-1][y];
dp[x][y][flag]=crr+f(x,y+1,1);
}
if (x+1<N){
dp[x][y][flag]=max(dp[x][y][flag],f(x+1,y,1));
dp[x][y][flag]=max(dp[x][y][flag],f(x+1,y,0));
}
}
else if (flag==0){
dp[x][y][flag]=0;
if (y-1>=0){
dp[x][y][flag]=grid[x][y-1]+f(x,y-1,0);
}
if (x+1<N){
dp[x][y][flag]=max(dp[x][y][flag],f(x+1,y,0));
if (y==0){
dp[x][y][flag]=max(dp[x][y][flag],f(x+1,y,2));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

fish.cpp:64:5: warning: multi-line comment [-Wcomment]
   64 |     //2 increasing, \
      |     ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...