# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1039602 | 2024-07-31T05:16:35 Z | 김은성(#10990) | Sprinklers (CEOI24_sprinklers) | C++17 | 157 ms | 2584 KB |
#include <bits/stdc++.h> using namespace std; int s[100009], f[100009]; bool ch[100009]; int main(){ int n, m, i, j, k; scanf("%d %d", &n, &m); for(i=1; i<=n; i++) scanf("%d", &s[i]); for(i=1; i<=m; i++) scanf("%d", &f[i]); int lo = 0, hi = 1000000009, mid; while(lo < hi){ k = mid = (lo+hi)/2; for(i=1; i<=m; i++){ if(lower_bound(s+1, s+n+1, f[i]+k+1) == lower_bound(s+1, s+n+1, f[i]-k)) break; } if(i==m+1) hi = mid; else lo=mid+1; } if(lo==1000000009) printf("-1\n"); else{ printf("%d\n", lo); for(i=0; i<n/3; i++) printf("LLR"); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Correct |
2 | Incorrect | 0 ms | 348 KB | Unexpected end of file - token expected |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Unexpected end of file - token expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Correct |
2 | Correct | 85 ms | 1364 KB | Correct |
3 | Correct | 9 ms | 640 KB | Correct |
4 | Correct | 151 ms | 2584 KB | Correct |
5 | Correct | 157 ms | 2384 KB | Correct |
6 | Correct | 0 ms | 344 KB | Correct |
7 | Correct | 0 ms | 348 KB | Correct |
8 | Correct | 78 ms | 2480 KB | Correct |
9 | Correct | 65 ms | 2384 KB | Correct |
10 | Correct | 150 ms | 2392 KB | Correct |
11 | Correct | 9 ms | 1628 KB | Correct |
12 | Correct | 106 ms | 1876 KB | Correct |
13 | Correct | 103 ms | 1888 KB | Correct |
14 | Correct | 114 ms | 2100 KB | Correct |
15 | Correct | 97 ms | 2140 KB | Correct |
16 | Correct | 98 ms | 1876 KB | Correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Correct |
2 | Incorrect | 0 ms | 348 KB | Unexpected end of file - token expected |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Correct |
2 | Incorrect | 101 ms | 1544 KB | Incorrect string length |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Correct |
2 | Incorrect | 0 ms | 348 KB | Unexpected end of file - token expected |
3 | Halted | 0 ms | 0 KB | - |