Submission #780651

# Submission time Handle Problem Language Result Execution time Memory
780651 2023-07-12T11:26:00 Z raphaelp Intercastellar (JOI22_ho_t1) C++14
0 / 100
2000 ms 3660 KB
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N;
    cin >> N;
    vector<long long> value(N);
    vector<long long> len(N, 1);
    for (int i = 0; i < N; i++)
    {
        cin >> value[i];
        while (value[i] % 2 == 0)
        {
            value[i] /= 2;
            len[i] *= 2;
        }
    }
    for (int i = 1; i < N; i++)
    {
        len[i] += len[i - 1];
    }
    int Q;
    cin >> Q;
    for (int i = 0; i < Q; i++)
    {
        int x;
        cin >> x;
        int j = 0;
        while (x > len[j])
        {
            j++;
        }
        cout << value[j] << '\n';
    }
}
# 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 1347 ms 3380 KB Output is correct
4 Correct 1535 ms 1284 KB Output is correct
5 Execution timed out 2065 ms 3660 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 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 1 ms 256 KB Output is correct
5 Correct 1 ms 236 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 2 ms 212 KB Output is correct
9 Incorrect 1 ms 212 KB Output isn't correct
10 Halted 0 ms 0 KB -
# 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 1347 ms 3380 KB Output is correct
4 Correct 1535 ms 1284 KB Output is correct
5 Execution timed out 2065 ms 3660 KB Time limit exceeded
6 Halted 0 ms 0 KB -