# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
648082 | baibhav26062008 | Intercastellar (JOI22_ho_t1) | C++14 | 87 ms | 3956 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() {
int N;cin>>N;
int A[N];
for (int i=0; i<N; i++) {
cin >> A[i];
}
int Q; cin>>Q;
int X[Q];
for (int i=0; i<Q; i++) {
cin >> X[i];
}
vector<int>L;
for (int i = 0; i < N; i++) {
int curr = A[i];
int ctr = 0;
while (curr % 2 == 0) {
curr /= 2;
}
for (int i = 0; i < (A[i]/curr); i++) {
L.push_back(curr);
}
// (aL.push_back(curr);
if (A[i] % 2 != 0) L.push_back(curr);
}
// (it x : L) cout << x <<
for (int i = 0; i < Q; i++) {
cout << L[X[i]-1] << endl;
}
}
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... |