Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- //#define int long long
- using ll = long long;
- const int N = 2e5 + 10;
- const ll mod = 1e9 + 7;
- int n;
- ll a[N], f[70];
- ll f2[N * 40];
- void pre () {
- f[0] = 1;
- for (int i = 1; i <= 60; i ++) {
- f[i] = f[i - 1] * 2;
- }
- f2[0] = 1;
- for (int i = 1; i < N * 40; i ++) {
- f2[i] = f2[i - 1] * 2 % mod;
- }
- }
- void init () {
- cin >> n;
- for (int i = 1; i <= n; i ++) {
- cin >> a[i];
- }
- }
- bool cmp (pair<int, ll> x, ll y) {
- if (x.first > 32) return 1;
- ll cur = f[x.first] * y;
- return x.second <= y;
- }
- void solve () {
- init();
- deque<pair<int, ll>> q;
- ll ans = 0;
- for (int i = 1; i <= n; i ++) {
- while (!q.empty() && cmp(q.back(), a[i])) {
- }
- cout << ans << ' ';
- }
- cout << endl;
- }
- signed main () {
- ios::sync_with_stdio(0);
- cin.tie(0);
- pre();
- int _ = 1;
- cin >> _;
- while (_ --) {
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement