# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
700186 | Toxtaq | Intercastellar (JOI22_ho_t1) | C++17 | 414 ms | 6836 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int main()
{
// ios_base::sync_with_stdio(0);
// cin.tie(0);
int n;
cin >> n;
vector<int>v(n);
for(int i = 0;i < n;++i)cin >> v[i];
long long q, indx = -1, tempo = 0;
cin >> q;
while(q--){
long long x;
cin >> x;
int tmp;
while(tempo < x && indx + 1 < n){
indx++;
tmp = v[indx];
while(tmp % 2 == 0){
tmp /= 2;
}
tempo += v[indx] / tmp;
}
cout << tmp << '\n';
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |