Submission #640693

#TimeUsernameProblemLanguageResultExecution timeMemory
640693peter940324Intercastellar (JOI22_ho_t1)C++17
100 / 100
104 ms9196 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define double long double #define IO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define pii pair<int,int> #define ff first #define ss second #define mp make_pair #define pb push_back #define pf push_front #define all(x) x.begin(),x.end() #define de(x) cout << #x << ':' << x << '\n'; template<class T> void prt(T l,T r){ while(l!=r) cout << *l << '\n',l++; cout << '\n'; } const int N=1e6+5,M=1e9+7,INF=1e18; signed main(){ IO int n;cin >> n; vector<int> a(n),b(n,1); for(int i=0;i<n;i++){ cin >> a[i]; while(a[i]%2==0){ a[i]/=2; b[i]*=2; } } int q;cin >> q; int li=0,x; while(q--){ cin >> x; while(b[li]<x){ b[li+1]+=b[li]; li++; } cout << a[li] << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...