제출 #282993

#제출 시각아이디문제언어결과실행 시간메모리
282993egekabasBrunhilda’s Birthday (BOI13_brunhilda)C++14
8.10 / 100
38 ms2944 KiB
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<int, int> pii;
typedef pair<ld, ld> pld;
ll n, q;
ll p[100009];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);

    cin >> n >> q;
    ll tot = 1;
    for(ll i = 0; i < n; ++i){
        cin >> p[i];
        tot = tot*p[i];
        tot = min(tot, 10000005LL);
    }
    while(q--){
        ll x;
        cin >> x;
        if(x >= tot){
            cout << "oo\n";
        }
        else{
            cout << x/(p[n-1])*2 + (x%p[n-1] != 0) << '\n';
        }
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...