| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 964213 | Amr | 웜뱃 (IOI13_wombats) | C++17 | 20081 ms | 33684 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "wombats.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define sz size()
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
int rows[5000][200], cols[5000][200],pre[5001][201],ans[5001][201];
int r,c;
void init(int R, int C, int H[5000][200], int V[5000][200]) {
r = R, c = C;
for(int i = 0; i < r; i++)
{
for(int j = 0; j < c-1; j++) rows[i][j] = H[i][j];
}
for(int i = 0; i < c; i++)
{
for(int j = 0; j < r-1; j++)
{
cols[j][i] = V[j][i];
}
}
}
void changeH(int P, int Q, int W) {
rows[P][Q] = W;
}
void changeV(int P, int Q, int W) {
cols[P][Q] = W;
}
int escape(int V1, int V2) {
for(int i = 0; i < r; i++)
{
for(int j = 0; j < c; j++) ans[i][j] = 0;
}
for(int i = 0; i < r; i++)
{
for(int j = 1; j < c; j++)
{
pre[i][j] = pre[i][j-1]+rows[i][j-1];
}
}
for(int i = 0; i < c; i++)
{
if(i==V1) ans[0][V1] = 0;
else if(i<V1) ans[0][i] = pre[0][V1]-pre[0][i];
else ans[0][i] = pre[0][i]-pre[0][V1];
// cout << ans[0][i] << " ";
}
//cout << endl;
for(int i = 1; i < r; i++)
{
for(int j = 0; j < c; j++)
{
ans[i][j] = 1e18;
for(int k = 0; k < c; k++)
{
if(k==j) ans[i][j] = min(ans[i][j],ans[i-1][k]+cols[i-1][k]);
else if(k<j) ans[i][j] = min(ans[i][j],ans[i-1][k]+cols[i-1][k]+pre[i][j]-pre[i][k]);
else ans[i][j] = min(ans[i][j],ans[i-1][k]+cols[i-1][k]+pre[i][k]-pre[i][j]);
}
}
}
//for(int i = 0; i < r; i++) {for(int j = 0; j < c; j++) cout << ans[i][j] << " "; cout << endl;}
int best = 1e9;
for(int i = 0; i < c ;i++)
{
if(i==V2) best = min(best,ans[r-1][i]);
else if(i<V2) best = min(best,ans[r-1][i] + pre[r-1][V2]-pre[r-1][i]);
else best = min(best,ans[r-1][i]+pre[r-1][i]-pre[r-1][V2]);
}
return best;
}
컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
