제출 #1132306

#제출 시각아이디문제언어결과실행 시간메모리
1132306nuutsnoyntonIntercastellar (JOI22_ho_t1)C++20
100 / 100
250 ms5764 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; vector < ll > O[3002], I[3002]; int main() { ll n, m, r, x, y, i, j,j1, o1, i1, p, cnt,s,next, ans, t, z; cin >> n; vector < pair < ll, ll > > v; for (i = 1; i <= n; i ++) { cin >> x; s = x; while ( x % 2 == 0) { x/= 2; } v.push_back({s/x, x}); } cin >> t; r = 0; s =0 ; while (t --) { cin >> x; x -= s; while ( v[r].first < x) { x -= v[r].first; s += v[r].first; r ++; } cout << v[r].second << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...