Submission #1069965

#TimeUsernameProblemLanguageResultExecution timeMemory
1069965vjudge1Sprinklers (CEOI24_sprinklers)C++17
3 / 100
7 ms1232 KiB
#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 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...
#Verdict Execution timeMemoryGrader output
Fetching results...