제출 #1320057

#제출 시각아이디문제언어결과실행 시간메모리
1320057hyyhIntercastellar (JOI22_ho_t1)C++20
25 / 100
218 ms2532 KiB
#include <iostream> #include <math.h> #include <vector> #include <string> #include <algorithm> #include <queue> #include <stack> #include <map> #include <cstring> #include <iomanip> #include <stdio.h> #include <unordered_map> #include <bitset> #include <tuple> using namespace std; using ll = long long; using pii = pair<int,int>; using piii = tuple<int,int,int>; #define endl '\n' #define f first #define s second int main(){ int n;cin >> n; vector<pii> vc = {{0,0}}; for(int i{};i < n;i++){ int g;cin >> g; int j = 2; for(;g%j == 0;j*=2){} j/=2; vc.emplace_back(vc.back().f+j,g/j); } int m;cin >> m; for(int j{};j < m;j++){ int g;cin >> g; cout << upper_bound(vc.begin(),vc.end(),make_pair(g,0))->s << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...