Submission #73811

#TimeUsernameProblemLanguageResultExecution timeMemory
73811KLPPSoccer (JOI17_soccer)C++14
5 / 100
4 ms584 KiB
#include<iostream> #include<stdio.h> using namespace std; typedef long long int lld; lld absol(lld x){ if(x>0)return x; return -x; } int main(){ int h,w; cin>>h>>w; lld a,b,c; cin>>a>>b>>c; int n; cin>>n; lld x1,y1; lld x2,y2; cin>>x1>>y1>>x2>>y2; lld ans=absol(x1-x2)+absol(y1-y2); ans*=c; ans=min(ans,absol(x1-x2)*c+absol(y1-y2)*a+b); ans=min(ans,absol(x1-x2)*a+b+absol(y1-y2)*c); cout<<ans<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...