제출 #171299

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1712992019-12-28 08:53:05dennisstarGrowing Vegetable is Fun 3 (JOI19_ho_t3)C++11
100 / 100
222 ms196768 KiB
#include <bits/stdc++.h>
#define fi first
#define se second
#define ryan bear
#define now mem[co][r][g][y]
#define all(V) ((V).begin()), ((V).end())
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;
typedef vector<int> vim;
typedef vector<ll> vlm;
int n, ar[410], mem[3][410][410][410], cnt[3][410];
char s[410];
vim c[3];
int f(int co, int r, int g, int y) {
if (!(r+g+y)) return 0;
if (now!=-1) return now;
now=(1<<30);
if (r&&co==0) now = min( now , min(f(1, r-1, g, y), f(2, r-1, g, y))+abs(g-cnt[1][c[0][r-1]])+abs(y-cnt[2][c[0][r-1]]));
if (g&&co==1) now = min( now , min(f(0, r, g-1, y), f(2, r, g-1, y))+abs(r-cnt[0][c[1][g-1]])+abs(y-cnt[2][c[1][g-1]]));
if (y&&co==2) now = min( now , min(f(0, r, g, y-1), f(1, r, g, y-1))+abs(r-cnt[0][c[2][y-1]])+abs(g-cnt[1][c[2][y-1]]));
return now;
}
int main() {
scanf("%d %s", &n, s);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

joi2019_ho_t3.cpp: In function 'int main()':
joi2019_ho_t3.cpp:30:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %s", &n, s);
  ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...