This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
// Author: Robert Jaworski
#include <bits/stdc++.h>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
vector<int> s(N, 0), f(M, 0);
for (auto&& x : s) {
cin >> x;
}
for (auto&& x : f) {
cin >> x;
}
if (N == 1) {
if (s.back() <= f[0]) {
cout << (f.back() - s.back()) << endl << "R" << endl;
}
else if (s[0] >= f.back()) {
cout << (s[0] - f[0]) << endl << "L" << endl;
}
else {
cout << -1 << endl;
}
return 0;
}
int K = max(f.back() - s[0], s[1] - f[0]);
cout << K << endl << "RL";
for (int x = 2; x < N; x++) {
cout << 'L';
}
cout << endl;
return 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... |