Submission #375876

# Submission time Handle Problem Language Result Execution time Memory
375876 2021-03-10T07:18:50 Z astoria Soccer (JOI17_soccer) C++14
5 / 100
1 ms 364 KB
#include "bits/stdc++.h"
using namespace std;

#define int long long

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int h,w,a,b,c,n;
	cin>>h>>w>>a>>b>>c>>n;
	
	int s[n],t[n];
	for(int i=0; i<n; i++) cin>>s[i]>>t[i];
	
	int difs = abs(s[0]-s[1]);
	int dift = abs(t[0]-t[1]);
	
	int optOne = (a*difs) + b + (c*dift);
	if(difs==0) optOne-=b;
	int optTwo = (a*dift) + b + (c*difs);
	if(dift==0) optTwo-=b;
	int optThree = (c*difs) + (c*dift);
	cout<<min(min(optOne,optTwo),optThree);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Incorrect 1 ms 364 KB Output isn't correct
7 Halted 0 ms 0 KB -