| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 602592 | CyberCow | Sightseeing in Kyoto (JOI22_kyoto) | C++17 | 9 ms | 8208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <fstream>
#include <iomanip>
#include <iterator>
#include <stack>
#include <deque>
using namespace std;
using ll = long long;
ll dp[1005][1005];
vector<ll> a, b;
void solve()
{
ll n, i, j, x, y, h, w;
cin >> h >> w;
for ( i = 0; i < h; i++)
{
cin >> x;
a.push_back(x);
}
for ( i = 0; i < w; i++)
{
cin >> x;
b.push_back(x);
}
for ( i = 0; i < h; i++)
{
dp[i][0] = i * b[0];
}
for ( i = 0; i < w; i++)
{
dp[0][i] = i * a[0];
}
for ( i = 1; i < h; i++)
{
for ( j = 1; j < w; j++)
{
dp[i][j] = min(dp[i - 1][j] + b[j], dp[i][j - 1] + a[i]);
}
}
cout << dp[h - 1][w - 1];
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int tt = 1;
//cin >> tt;
while (tt--)
{
solve();
}
return 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... | ||||
