Submission #1072643

#TimeUsernameProblemLanguageResultExecution timeMemory
1072643jer033Sprinklers (CEOI24_sprinklers)C++17
3 / 100
26 ms1628 KiB
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; vector<int> sprinks(N); vector<int> flowers(M); for (int i=0; i<N; i++) cin >> sprinks[i]; for (int i=0; i<M; i++) cin >> flowers[i]; if (N==1) { int left = flowers[0]-sprinks[0]; int righ = flowers[M-1]-sprinks[0]; if ((left<0) and (righ>0)) cout << "-1\n"; else { cout << max(abs(left), abs(righ)) << '\n'; if (left<0) cout << "L\n"; else cout << "R\n"; } } }
#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...