제출 #1236196

#제출 시각아이디문제언어결과실행 시간메모리
1236196GeforgsSoccer (JOI17_soccer)C++20
5 / 100
0 ms328 KiB
#include <iostream> #include <iomanip> #include <vector> #include <cmath> #include <algorithm> #include <set> #include <queue> #include <map> #include <unordered_map> #include <stack> #include <bitset> #include <string> #include <cstring> #include <iterator> #include <random> #define ll long long #define ld long double #define inf (ll)(2*1e18) //#define sort(a) sort(a.begin(), a.end()) #define reverse(a) reverse(a.begin(), a.end()) #define pb push_back #define endl "\n" using namespace std; ll n, m, k, A, B, C; ll dis(pair<ll, ll> a, pair<ll, ll> b){ return min({(abs(a.first - b.first) + abs(a.second - b.second))*C, abs(a.first - b.first)*C + B + A*abs(a.second - b.second), abs(a.second - b.second)*C + B + A*abs(a.first - b.first)}); } void solve(){ ll i; cin>>n>>m; cin>>A>>B>>C; cin>>k; vector<pair<ll, ll>> a(k); for(i=0;i<k;++i){ cin>>a[i].first>>a[i].second; } cout<<dis(a[0], a[1])<<endl; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); srand(time(nullptr)); ll t=1; // cin>>t; for(;t>0;--t){ solve(); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...