This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fixbug true
const int maxn = 1e3;
int K , n , m , A , B;
int s[maxn+2] , t[maxn+2] , v[maxn+2];
namespace subtask1{
bool check(){
return K==1;
}
void main_code(){
if (n < m){
cout << n * v[1] + B * (m - n) + A;
exit(0);
}
cout << m * v[1] << '\n';
exit(0);
}
}
namespace subtask2{
bool check(){
return A==B&&B==0;
}
void main_code(){
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin >> K >> n >> m >> A >> B;
for (int i = 1; i <= K; ++i) cin >> v[i];
for (int i = 1; i <= n; ++i) cin >> s[i];
for (int i = 1; i <= m; ++i) cin >> t[i];
if (subtask1::check()){
subtask1::main_code();
exit(0);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |