Submission #941063

# Submission time Handle Problem Language Result Execution time Memory
941063 2024-03-08T06:09:12 Z Pring Intercastellar (JOI22_ho_t1) C++17
25 / 100
351 ms 524288 KB
#include <bits/stdc++.h>
using namespace std;

#ifdef MIKU
const string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m";
#define debug(x...) cout << dbmc << "[" << #x << "]: ", dout(x)
void dout() { cout << dbrs << endl; }
template <typename T, typename ...U>
void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); }
#else
#define dout(...) 39
#endif

#define int long long
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
typedef pair<int, int> pii;

const int MXN = 200005;
int n, q, a;
vector<int> v;

void PUT(int x) {
    int y = 1;
    while (x % 2 == 0) {
        x /= 2;
        y *= 2;
    }
    while (y--) v.push_back(x);
}

void miku() {
    cin >> n;
    while (n--) {
        cin >> a;
        PUT(a);
    }
    cin >> q;
    while (q--) {
        cin >> a;
        cout << v[--a] << '\n';
    }
}

int32_t main() {
    cin.tie(0) -> sync_with_stdio(false);
    cin.exceptions(cin.failbit);
    miku();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 18 ms 6356 KB Output is correct
4 Correct 22 ms 2764 KB Output is correct
5 Correct 49 ms 7120 KB Output is correct
6 Correct 25 ms 9680 KB Output is correct
7 Correct 39 ms 10444 KB Output is correct
8 Correct 42 ms 18892 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Runtime error 351 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 18 ms 6356 KB Output is correct
4 Correct 22 ms 2764 KB Output is correct
5 Correct 49 ms 7120 KB Output is correct
6 Correct 25 ms 9680 KB Output is correct
7 Correct 39 ms 10444 KB Output is correct
8 Correct 42 ms 18892 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Runtime error 351 ms 524288 KB Execution killed with signal 9
12 Halted 0 ms 0 KB -