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;
int main() {
int n , m;
cin >> n >> m;
int A[n],B[n];
for (int i = 0; i < n; i++) {
cin >> A[i];
}
for (int j = 0; j < n; j++) {
cin >> B[j];
}
if (m == 1) {
int min1= INT_MAX;
for (int i = 0; i < n; i++) {
int v = max(A[i],B[i]);
if (v < min1) min1 = v;
}
cout << min1 << endl;
return 0;
}
vector <int> v(n);
for (int i = 0; i < n; i++) {
v[i] = A[i] * m;
}
int min2 = INT_MAX;
for (int i = 0; i < n; i++) {
if (v[i] < min2) {
min2 = v[i];
}
}
cout << min2 << endl;
}
# | 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... |