Submission #648170

#TimeUsernameProblemLanguageResultExecution timeMemory
648170baibhav26062008Self Study (JOI22_ho_t2)C++14
10 / 100
336 ms2624 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...