#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 |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
4 ms |
212 KB |
Output is correct |
11 |
Correct |
231 ms |
2616 KB |
Output is correct |
12 |
Correct |
336 ms |
2616 KB |
Output is correct |
13 |
Correct |
159 ms |
2516 KB |
Output is correct |
14 |
Correct |
198 ms |
2616 KB |
Output is correct |
15 |
Correct |
0 ms |
212 KB |
Output is correct |
16 |
Correct |
80 ms |
2516 KB |
Output is correct |
17 |
Correct |
267 ms |
2624 KB |
Output is correct |
18 |
Correct |
231 ms |
2516 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
80 ms |
2516 KB |
Output is correct |
3 |
Correct |
267 ms |
2624 KB |
Output is correct |
4 |
Correct |
231 ms |
2516 KB |
Output is correct |
5 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
4 ms |
212 KB |
Output is correct |
11 |
Correct |
231 ms |
2616 KB |
Output is correct |
12 |
Correct |
336 ms |
2616 KB |
Output is correct |
13 |
Correct |
159 ms |
2516 KB |
Output is correct |
14 |
Correct |
198 ms |
2616 KB |
Output is correct |
15 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
0 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
4 ms |
212 KB |
Output is correct |
11 |
Correct |
231 ms |
2616 KB |
Output is correct |
12 |
Correct |
336 ms |
2616 KB |
Output is correct |
13 |
Correct |
159 ms |
2516 KB |
Output is correct |
14 |
Correct |
198 ms |
2616 KB |
Output is correct |
15 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |