# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
887552 | 2023-12-14T18:24:07 Z | salmon | Let's Win the Election (JOI22_ho_t3) | C++14 | 1 ms | 2396 KB |
#include <bits/stdc++.h> using namespace std; int N; long long int M; long long int A[300100]; long long int B[300100]; const long long int inf = 2e18; int main(){ scanf(" %d",&N); scanf(" %lld",&M); for(int i = 0; i < N; i++){ scanf(" %lld",&A[i]); } for(int i = 0; i < N; i++){ scanf(" %lld",&B[i]); } long long int s = 0; long long int e = inf; while(s != e){ long long int m = (s + e + 1)/2; long long int free = 0; for(int i = 0; i < N; i++){ //if(B[i] > A[i]){ free += M; free -= (m + B[i] - 1) / B[i]; if(free < (-M * N) ){ break; } /*} else{ if( (m + A[i] - 1)/A[i] >= M){ long long int v = max(0LL,m - A[i] * M); free -= (v + B[i] - 1)/ B[i]; } else{ free += M; free -= (m + A[i] - 1)/A[i]; } }*/ } if(free >= 0){ s = m; } else{ e = m - 1; } } printf("%lld",s); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 2396 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 2396 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2396 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2396 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 2396 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 2392 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 2396 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |