Submission #700188

# Submission time Handle Problem Language Result Execution time Memory
700188 2023-02-18T19:26:15 Z Toxtaq Intercastellar (JOI22_ho_t1) C++17
100 / 100
79 ms 3032 KB
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int>v(n);
    for(int i = 0;i < n;++i)cin >> v[i];
    long long q, indx = -1, tempo = 0;
    cin >> q;
    while(q--){
        long long x;
        cin >> x;
        int tmp;
        while(tempo < x && indx + 1 < n){
            indx++;
            tmp = v[indx];
            while(tmp % 2 == 0){
                tmp /= 2;
            }
            tempo += v[indx] / tmp;
        }
        cout << tmp << '\n';
    }
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:25:24: warning: 'tmp' may be used uninitialized in this function [-Wmaybe-uninitialized]
   25 |         cout << tmp << '\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 16 ms 1108 KB Output is correct
4 Correct 37 ms 788 KB Output is correct
5 Correct 58 ms 1416 KB Output is correct
6 Correct 40 ms 1108 KB Output is correct
7 Correct 65 ms 1472 KB Output is correct
8 Correct 40 ms 1468 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 1 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 212 KB Output is correct
9 Correct 1 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 212 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 16 ms 1108 KB Output is correct
4 Correct 37 ms 788 KB Output is correct
5 Correct 58 ms 1416 KB Output is correct
6 Correct 40 ms 1108 KB Output is correct
7 Correct 65 ms 1472 KB Output is correct
8 Correct 40 ms 1468 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 1 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 212 KB Output is correct
17 Correct 1 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 212 KB Output is correct
23 Correct 24 ms 1600 KB Output is correct
24 Correct 30 ms 1608 KB Output is correct
25 Correct 55 ms 3032 KB Output is correct
26 Correct 42 ms 1396 KB Output is correct
27 Correct 42 ms 1364 KB Output is correct
28 Correct 72 ms 2248 KB Output is correct
29 Correct 75 ms 1412 KB Output is correct
30 Correct 44 ms 1028 KB Output is correct
31 Correct 79 ms 1876 KB Output is correct