# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
631268 | 2022-08-18T01:50:37 Z | Hiennoob123 | Brunhilda’s Birthday (BOI13_brunhilda) | C++14 | 34 ms | 2512 KB |
#include<bits/stdc++.h> #define ll int #define ld double #define cd complex<ld> #define pll pair<ll,ll> #define pb push_back #define mp make_pair #define fi first #define se second using namespace std ; ll m , q ; ll A[100005] = {} ; void solve() { cin >> m >> q ; for(int i = 1 ; i<= m ; i++) cin >> A[i] ; vector<ll> ans ; ll cur = 0 ; ans.push_back(0) ; ll last = 0 ; while(cur<=10000000) { ll F = 0 ; for(int j = 1 ; j<= m ; j++) { F = max(F , cur-cur%A[j]+A[j]-1) ; } if(F<=cur) break ; ans.push_back(F) ; cur = F ; } last = cur ; //for(int i = 0 ; i< ans.size() ; i++) cout << ans[i] << "\n" ; for(int i = 1 ; i<= q ; i++) { if(i>=100) assert(0) ; ll k ; cin >> k ; ll save = k ; if(save>last) { cout << "oo\n" ; continue ; } ll lo = 0 , hi = ans.size() ; hi-- ; if(hi<0) { cout << "oo\n" ; continue ; } while(hi-lo>1) { ll mid = ((hi+lo)>>1) ; if(ans[mid]>k) hi = mid ; else lo = mid ; } if(ans[hi]<=k) { cout << hi ; } else cout << lo ; cout << "\n" ; } } int main() { ios_base::sync_with_stdio(NULL) ; cin.tie(nullptr) ; cout.tie(nullptr) ; //freopen("LINES.inp" , "r" , stdin) ; //freopen("LINES.out" , "w" , stdout) ; //freopen("IN.txt" , "r" , stdin) ; int t = 1; //cin >> t ; for(int i = 1 ; i<= t ; i++) { solve() ; } }
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 468 KB | Execution killed with signal 6 |
2 | Runtime error | 8 ms | 956 KB | Execution killed with signal 6 |
3 | Incorrect | 1 ms | 340 KB | Output isn't correct |
4 | Runtime error | 2 ms | 468 KB | Execution killed with signal 6 |
5 | Runtime error | 15 ms | 2000 KB | Execution killed with signal 6 |
6 | Runtime error | 1 ms | 468 KB | Execution killed with signal 6 |
7 | Incorrect | 1 ms | 340 KB | Output isn't correct |
8 | Incorrect | 2 ms | 596 KB | Output isn't correct |
9 | Incorrect | 34 ms | 2512 KB | Output isn't correct |
10 | Runtime error | 16 ms | 1496 KB | Execution killed with signal 6 |
11 | Runtime error | 16 ms | 1492 KB | Execution killed with signal 6 |
12 | Runtime error | 3 ms | 468 KB | Execution killed with signal 6 |
13 | Runtime error | 8 ms | 468 KB | Execution killed with signal 6 |
14 | Runtime error | 8 ms | 468 KB | Execution killed with signal 6 |
15 | Runtime error | 6 ms | 920 KB | Execution killed with signal 6 |
16 | Runtime error | 8 ms | 964 KB | Execution killed with signal 6 |
17 | Runtime error | 9 ms | 840 KB | Execution killed with signal 6 |
18 | Runtime error | 2 ms | 468 KB | Execution killed with signal 6 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 340 KB | Output isn't correct |
2 | Incorrect | 8 ms | 596 KB | Output isn't correct |
3 | Incorrect | 9 ms | 468 KB | Output isn't correct |
4 | Correct | 3 ms | 212 KB | Output is correct |
5 | Incorrect | 6 ms | 468 KB | Output isn't correct |
6 | Incorrect | 2 ms | 340 KB | Output isn't correct |
7 | Incorrect | 2 ms | 340 KB | Output isn't correct |
8 | Incorrect | 3 ms | 212 KB | Output isn't correct |
9 | Incorrect | 11 ms | 596 KB | Output isn't correct |
10 | Incorrect | 9 ms | 604 KB | Output isn't correct |
11 | Incorrect | 8 ms | 468 KB | Output isn't correct |
12 | Correct | 3 ms | 212 KB | Output is correct |
13 | Correct | 1 ms | 212 KB | Output is correct |
14 | Correct | 2 ms | 340 KB | Output is correct |
15 | Incorrect | 8 ms | 468 KB | Output isn't correct |
16 | Incorrect | 11 ms | 596 KB | Output isn't correct |
17 | Incorrect | 7 ms | 344 KB | Output isn't correct |
18 | Incorrect | 10 ms | 712 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 8 ms | 864 KB | Execution killed with signal 6 |
2 | Runtime error | 9 ms | 852 KB | Execution killed with signal 6 |
3 | Runtime error | 11 ms | 908 KB | Execution killed with signal 6 |
4 | Runtime error | 4 ms | 468 KB | Execution killed with signal 6 |
5 | Runtime error | 14 ms | 1296 KB | Execution killed with signal 6 |
6 | Runtime error | 5 ms | 468 KB | Execution killed with signal 6 |
7 | Runtime error | 10 ms | 1236 KB | Execution killed with signal 6 |
8 | Runtime error | 7 ms | 852 KB | Execution killed with signal 6 |
9 | Runtime error | 8 ms | 852 KB | Execution killed with signal 6 |
10 | Runtime error | 5 ms | 480 KB | Execution killed with signal 6 |
11 | Runtime error | 4 ms | 468 KB | Execution killed with signal 6 |
12 | Runtime error | 5 ms | 508 KB | Execution killed with signal 6 |
13 | Runtime error | 7 ms | 724 KB | Execution killed with signal 6 |
14 | Runtime error | 22 ms | 1460 KB | Execution killed with signal 6 |
15 | Runtime error | 5 ms | 468 KB | Execution killed with signal 6 |
16 | Runtime error | 7 ms | 484 KB | Execution killed with signal 6 |
17 | Runtime error | 8 ms | 852 KB | Execution killed with signal 6 |
18 | Runtime error | 9 ms | 916 KB | Execution killed with signal 6 |
19 | Runtime error | 2 ms | 468 KB | Execution killed with signal 6 |
20 | Runtime error | 9 ms | 800 KB | Execution killed with signal 6 |
21 | Runtime error | 9 ms | 716 KB | Execution killed with signal 6 |
22 | Runtime error | 12 ms | 1184 KB | Execution killed with signal 6 |
23 | Runtime error | 5 ms | 724 KB | Execution killed with signal 6 |
24 | Runtime error | 1 ms | 468 KB | Execution killed with signal 6 |
25 | Runtime error | 5 ms | 468 KB | Execution killed with signal 6 |
26 | Runtime error | 3 ms | 468 KB | Execution killed with signal 6 |
27 | Runtime error | 13 ms | 1236 KB | Execution killed with signal 6 |
28 | Runtime error | 2 ms | 468 KB | Execution killed with signal 6 |
29 | Runtime error | 12 ms | 1236 KB | Execution killed with signal 6 |
30 | Runtime error | 11 ms | 980 KB | Execution killed with signal 6 |
31 | Runtime error | 2 ms | 468 KB | Execution killed with signal 6 |
32 | Runtime error | 3 ms | 468 KB | Execution killed with signal 6 |
33 | Runtime error | 2 ms | 468 KB | Execution killed with signal 6 |
34 | Runtime error | 11 ms | 1260 KB | Execution killed with signal 6 |
35 | Runtime error | 2 ms | 468 KB | Execution killed with signal 6 |
36 | Runtime error | 10 ms | 1108 KB | Execution killed with signal 6 |
37 | Runtime error | 10 ms | 1236 KB | Execution killed with signal 6 |
38 | Runtime error | 5 ms | 468 KB | Execution killed with signal 6 |
39 | Runtime error | 2 ms | 468 KB | Execution killed with signal 6 |
40 | Runtime error | 4 ms | 588 KB | Execution killed with signal 6 |
41 | Runtime error | 10 ms | 1204 KB | Execution killed with signal 6 |
42 | Runtime error | 6 ms | 468 KB | Execution killed with signal 6 |