Submission #1069965

# Submission time Handle Problem Language Result Execution time Memory
1069965 2024-08-22T10:40:59 Z vjudge1 Sprinklers (CEOI24_sprinklers) C++17
3 / 100
7 ms 1232 KB
#include <bits/stdc++.h>
#define int long long

using namespace std;

void solve() {
   int n, m;
   cin >> n >> m;
   int s[n], f[m];
   for(int i=0; i<n; ++i) cin >> s[i];
   for(int i=0; i<m; ++i) cin >> f[i];
   if(n == 1) {
        if(f[0] < s[0] && f[m-1] > s[0]) {
            cout << -1 << endl;
            return;
        }
        cout << max(abs(f[0]-s[0]), abs(f[m-1]-s[0])) << endl;
        if(f[0] < s[0]) cout << "L" << endl;
        else cout << "R" << endl;
   }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    int t = 1;
    while(t--) solve();
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Correct
2 Correct 7 ms 1104 KB Correct
3 Correct 1 ms 348 KB Correct
4 Correct 7 ms 1116 KB Correct
5 Correct 7 ms 1232 KB Correct
6 Correct 1 ms 348 KB Correct
7 Correct 0 ms 348 KB Correct
8 Correct 2 ms 344 KB Correct
9 Correct 0 ms 348 KB Correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -