Submission #1016004

#TimeUsernameProblemLanguageResultExecution timeMemory
1016004ZeroCoolIntercastellar (JOI22_ho_t1)C++14
100 / 100
55 ms9404 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define ar array #define ld long double const int N = 3e5 + 30; const int M = 10; const int MOD = 998244353; #pragma GCC target ("avx2") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") const int inv = 499122177; signed main(){ios::sync_with_stdio(false);cin.tie(0); int n; cin>>n; int c = 0; vector<ar<int, 2> > v; for(int i = 0;i < n;i++){ int x; cin>>x; int cnt = 1; while(x % 2 == 0){ x /= 2; cnt *= 2; } v.push_back({c, x}); c += cnt; } //for(auto [a, b]: v)cout<<a<<" "<<b<<endl; int q; cin>>q; while(q--){ int x; cin>>x; auto it = upper_bound(v.begin(), v.end(), ar<int,2>{x, 0}); --it; cout<<(*it)[1]<<'\n'; } }

Compilation message (stderr)

Main.cpp:15: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
   15 | #pragma GCC optimization ("O3")
      | 
Main.cpp:16: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
   16 | #pragma GCC optimization ("unroll-loops")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...