Submission #1134897

#TimeUsernameProblemLanguageResultExecution timeMemory
1134897UnforgettableplIntercastellar (JOI22_ho_t1)C++20
100 / 100
66 ms5584 KiB
#include <bits/stdc++.h> using namespace std; #define int long long const int INF = 1e10; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; vector<int> arr(n); for(int&i:arr)cin>>i; int q; cin >> q; vector<int> queries(q); for(int&i:queries)cin>>i; auto iter = queries.begin(); int total = 0; for(int&i:arr) { int cnt = 1; while(i%2==0) { i>>=1; cnt*=2; } total+=cnt; while(iter!=queries.end() and *iter<=total) { cout << i << '\n'; iter++; } } assert(iter==queries.end()); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...