# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
925373 | 2024-02-11T13:54:58 Z | 8pete8 | Brunhilda’s Birthday (BOI13_brunhilda) | C++17 | 9 ms | 1376 KB |
#include<iostream> #include<stack> #include<map> #include<vector> #include<string> #include<unordered_map> #include <queue> #include<cstring> #include<cassert> #include<limits.h> #include<cmath> #include<set> #include<numeric> //gcd(a,b) #include<algorithm> #include<bitset> #include<stack> using namespace std; #define ll long long #define f first #define endl "\n" #define s second #define pii pair<int,int> #define pppiiii pair<pii,pii> #define ppii pair<int,pii> #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define pb push_back #define mp make_pair #define lb lower_bound #define ub upper_bound #define fastio ios::sync_with_stdio(false);cin.tie(NULL); #pragma GCC optimize ("03,unroll-loops") //#define int long long const int mod=1e9+7,mxn=20,lg=30;//inf=1e18,minf=-1e18,Mxn=100000,root=700; void setIO(string name){ ios_base::sync_with_stdio(0); cin.tie(0); freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout); } int n,q; int ans[mxn+1],mx[mxn+1]; int32_t main(){ //setIO("redistricting"); fastio cin>>n>>q; vector<int>v(n); for(int i=0;i<n;i++)cin>>v[i]; sort(all(v)); v.erase(unique(all(v)),v.end()); for(auto i:v)for(int j=i-1;j<=mxn;j+=i)mx[j]=max(mx[j],i-1); for(int i=mxn;i>=0;i--)mx[i]=max(mx[i],mx[i+1]-1); for(int i=1;i<=mxn;i++){ ans[i]=ans[i-mx[i]]; if(ans[i]!=-1)ans[i]++; if(i<v.back())ans[i]=1; if(mx[i]<=0)ans[i]=-1; } while(q--){ int g;cin>>g; if(ans[g]!=-1)cout<<ans[g]<<'\n'; else cout<<"oo"<<'\n'; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 600 KB | Execution killed with signal 11 |
2 | Runtime error | 1 ms | 600 KB | Execution killed with signal 11 |
3 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
4 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
5 | Incorrect | 0 ms | 348 KB | Output isn't correct |
6 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
7 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
8 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
9 | Incorrect | 0 ms | 348 KB | Output isn't correct |
10 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
11 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
12 | Incorrect | 1 ms | 344 KB | Output isn't correct |
13 | Runtime error | 1 ms | 600 KB | Execution killed with signal 11 |
14 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
15 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
16 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
17 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
18 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 2 ms | 604 KB | Execution killed with signal 11 |
2 | Runtime error | 8 ms | 1116 KB | Execution killed with signal 11 |
3 | Runtime error | 6 ms | 1004 KB | Execution killed with signal 11 |
4 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
5 | Runtime error | 5 ms | 860 KB | Execution killed with signal 11 |
6 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
7 | Runtime error | 2 ms | 604 KB | Execution killed with signal 11 |
8 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
9 | Runtime error | 6 ms | 996 KB | Execution killed with signal 11 |
10 | Runtime error | 7 ms | 1368 KB | Execution killed with signal 11 |
11 | Runtime error | 4 ms | 860 KB | Execution killed with signal 11 |
12 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
13 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
14 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
15 | Runtime error | 4 ms | 860 KB | Execution killed with signal 11 |
16 | Runtime error | 8 ms | 1112 KB | Execution killed with signal 11 |
17 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
18 | Runtime error | 8 ms | 1372 KB | Execution killed with signal 11 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 4 ms | 860 KB | Execution killed with signal 11 |
2 | Runtime error | 5 ms | 860 KB | Execution killed with signal 11 |
3 | Runtime error | 4 ms | 860 KB | Execution killed with signal 11 |
4 | Runtime error | 1 ms | 600 KB | Execution killed with signal 11 |
5 | Runtime error | 8 ms | 1372 KB | Execution killed with signal 11 |
6 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
7 | Runtime error | 8 ms | 1368 KB | Execution killed with signal 11 |
8 | Runtime error | 4 ms | 860 KB | Execution killed with signal 11 |
9 | Runtime error | 4 ms | 856 KB | Execution killed with signal 11 |
10 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
11 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
12 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
13 | Runtime error | 3 ms | 584 KB | Execution killed with signal 11 |
14 | Runtime error | 1 ms | 600 KB | Execution killed with signal 11 |
15 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
16 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
17 | Runtime error | 4 ms | 860 KB | Execution killed with signal 11 |
18 | Runtime error | 4 ms | 860 KB | Execution killed with signal 11 |
19 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
20 | Runtime error | 4 ms | 860 KB | Execution killed with signal 11 |
21 | Runtime error | 1 ms | 348 KB | Execution killed with signal 11 |
22 | Runtime error | 8 ms | 1372 KB | Execution killed with signal 11 |
23 | Runtime error | 3 ms | 604 KB | Execution killed with signal 11 |
24 | Runtime error | 1 ms | 600 KB | Execution killed with signal 11 |
25 | Runtime error | 1 ms | 600 KB | Execution killed with signal 11 |
26 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
27 | Runtime error | 8 ms | 1372 KB | Execution killed with signal 11 |
28 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
29 | Runtime error | 8 ms | 1372 KB | Execution killed with signal 11 |
30 | Runtime error | 7 ms | 1116 KB | Execution killed with signal 11 |
31 | Runtime error | 1 ms | 600 KB | Execution killed with signal 11 |
32 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
33 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
34 | Runtime error | 9 ms | 1376 KB | Execution killed with signal 11 |
35 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
36 | Runtime error | 8 ms | 1336 KB | Execution killed with signal 11 |
37 | Runtime error | 9 ms | 1368 KB | Execution killed with signal 11 |
38 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
39 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
40 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |
41 | Runtime error | 8 ms | 1368 KB | Execution killed with signal 11 |
42 | Runtime error | 1 ms | 604 KB | Execution killed with signal 11 |