Submission #648165

#TimeUsernameProblemLanguageResultExecution timeMemory
648165baibhav26062008Intercastellar (JOI22_ho_t1)C++14
25 / 100
994 ms524288 KiB
#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 j = 0; j < (A[i]/curr); j++) { L.push_back(curr); } // (aL.push_back(curr); // (A[i] % 2 != 0) L.push_back(curr); } //for (int x: L) cout << x << endl; for (int i = 0; i < Q; i++) { cout << L[X[i]-1] << endl; } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:18:7: warning: unused variable 'ctr' [-Wunused-variable]
   18 |   int ctr = 0;
      |       ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...