제출 #1128201

#제출 시각아이디문제언어결과실행 시간메모리
1128201yumemysteryIntercastellar (JOI22_ho_t1)C++20
25 / 100
975 ms589824 KiB
#include <iostream> #include <vector> using namespace std; int main() { int n; cin >> n; vector <int> castella; for (int i=0; i<n; i++) { int len; cin >> len; if (len%2!=0) castella.push_back(len); else { int tmp=len; int cnt; while (tmp%2==0) { tmp/=2; cnt = len/tmp; } for (int i=1; i<=cnt; i++) { castella.push_back(tmp); } } } int Q; cin >> Q; for (int i=0; i<Q; i++) { int search; cin >> search; cout << castella[search-1] << "\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...