# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
954419 | 2024-03-27T20:46:45 Z | amirhoseinfar1385 | Intercastellar (JOI22_ho_t1) | C++17 | 263 ms | 8876 KB |
#include<bits/stdc++.h> using namespace std; const long long maxn=200000+10; long long n; long long all[maxn]; vector<long long>alls,allv; void vorod(){ cin>>n; for(long long i=1;i<=n;i++){ cin>>all[i]; } } void pre(){ alls.resize(n+2); allv.resize(n+2); for(long long i=1;i<=n;i++){ allv[i]=all[i]; while((allv[i]&1)==0){ allv[i]>>=1; } alls[i+1]=alls[i]+all[i]/allv[i]; } } void solve(){ long long q; cin>>q; for(long long i=0;i<q;i++){ long long x; cin>>x; long long p=lower_bound(alls.begin(),alls.end(),x)-alls.begin(); p--; cout<<allv[p]<<"\n"; } } int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen("inp.txt","r",stdin); vorod(); pre(); solve(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 250 ms | 8788 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 263 ms | 8876 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 250 ms | 8788 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |