Submission #729236

# Submission time Handle Problem Language Result Execution time Memory
729236 2023-04-23T17:10:54 Z tch1cherin Intercastellar (JOI22_ho_t1) C++17
100 / 100
73 ms 4576 KB
#include <bits/stdc++.h>
using namespace std;

void solve() {
  int n;
  cin >> n;
  vector<long long> pref(n + 1);
  vector<int> l(n);
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    l[i] = x / (x & -x);
    pref[i + 1] = pref[i] + (x & -x);
  }
  int q;
  cin >> q;
  while (q--) {
    long long x;
    cin >> x;
    cout << l[lower_bound(pref.begin(), pref.end(), x) - pref.begin() - 1] << "\n";
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 17 ms 2596 KB Output is correct
4 Correct 39 ms 1124 KB Output is correct
5 Correct 47 ms 2996 KB Output is correct
6 Correct 27 ms 2388 KB Output is correct
7 Correct 46 ms 2960 KB Output is correct
8 Correct 46 ms 3032 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 17 ms 2596 KB Output is correct
4 Correct 39 ms 1124 KB Output is correct
5 Correct 47 ms 2996 KB Output is correct
6 Correct 27 ms 2388 KB Output is correct
7 Correct 46 ms 2960 KB Output is correct
8 Correct 46 ms 3032 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 0 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 28 ms 1876 KB Output is correct
24 Correct 33 ms 2752 KB Output is correct
25 Correct 65 ms 4576 KB Output is correct
26 Correct 40 ms 2380 KB Output is correct
27 Correct 42 ms 2384 KB Output is correct
28 Correct 73 ms 3792 KB Output is correct
29 Correct 66 ms 3020 KB Output is correct
30 Correct 41 ms 1236 KB Output is correct
31 Correct 71 ms 3524 KB Output is correct