Submission #837323

#TimeUsernameProblemLanguageResultExecution timeMemory
837323LiudasSoccer (JOI17_soccer)C++17
5 / 100
1 ms212 KiB
#include <bits/stdc++.h> #define int long long using namespace std; signed main(){ int H, W, A, B, C, N; cin >> H>> W>> A>> B>> C>> N; vector<int> px(N), py(N); for(int i = 0; i < N; i ++){ cin >> px[i] >> py[i]; } if(N == 2){ int dx = labs(px[0]-px[1]), dy = labs(py[0]-py[1]); int a = (dx + dy) * C; int b = min({dx * A + B + dy * C, dy * A + B + dx * C, a}); cout << b << endl; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...