제출 #530275

#제출 시각아이디문제언어결과실행 시간메모리
530275yungyaoIntercastellar (JOI22_ho_t1)C++17
100 / 100
64 ms9184 KiB
using namespace std; #include <iostream> #include <algorithm> #include <utility> #include <vector> #include <stack> #include <queue> #include <set> #include <map> typedef long long LL; typedef pair<int,int> pii; #define pb push_back #define mkp make_pair #define F first #define S second #define iter(x) x.begin(),x.end() #define REP(n) for (int __=n;__--;) #define REP0(i,n) for (int i=0;i<n;++i) #define REP1(i,n) for (int i=1;i<=n;++i) const int maxn = 0, mod = 0; const LL inf = 0; void solve(){ int n, q; cin >> n; vector <pair<LL,LL>> v(n); REP0(i, n){ LL x; cin >> x; v[i] = mkp(x / (x & -x), x & -x); } cin >> q; LL cnt = 0; int i = -1; REP(q){ LL x; cin >> x; while (cnt < x) cnt += v[++i].S; cout << v[i].F << '\n'; } } int main(){ ios_base::sync_with_stdio(false); cin.tie(0); solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...