제출 #923310

#제출 시각아이디문제언어결과실행 시간메모리
923310goodspeed0208Intercastellar (JOI22_ho_t1)C++14
0 / 100
0 ms344 KiB
#include<bits/stdc++.h> #define int long long #define pii pair<int, int> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int>v(n); for (auto &i : v) cin >> i; vector<pii>p(n); for (int i = 0 ; i < n ; i++) { int num = 1; while (v[i] % 2 == 0) { v[i] /= 2; num *= 2; } if (i == 0) p[i] = {num, v[i]}; else p[i] = {num + p[i-1].first, v[i]}; cout << p[i].first << " " << p[i].second << "\n"; } int q, x, l = 0; cin >> q; while (q--) { cin >> x; while (x > p[l].first) l++; cout << p[l].second << "\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...