# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
161285 | pr3pony | Coin Collecting (JOI19_ho_t4) | C++14 | 3 ms | 632 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define F first
#define S second
const int N = 1087;
const ll inf = 9e18;
pii p[N];
ll f(int i,int x,int y)
{
return abs(x-p[i].F) + abs(y-p[i].S);
}
ll dp[N][N];
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
ll ans = 0;
int n;
cin >> n;
for (int i = 1; i <= 2*n; ++i) {
int x,y;
cin >> x >> y;
if (x < 1) ans += 1 - x, x = 1;
if (x > n) ans += x - n, x = n;
if (y < 1) ans += 1 - y, y = 1;
if (y > 2) ans += y - 2, y = 2;
p[i] = {x, y};
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |