Task: | Pizzeriat |
Sender: | intoo |
Submission time: | 2018-01-14 21:27:07 +0200 |
Language: | C++ |
Status: | READY |
Result: | 11 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 11 |
#2 | TIME LIMIT EXCEEDED | 0 |
#3 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.05 s | 1 | details |
#2 | ACCEPTED | 0.05 s | 1 | details |
#3 | ACCEPTED | 0.05 s | 1 | details |
#4 | TIME LIMIT EXCEEDED | -- | 2 | details |
#5 | TIME LIMIT EXCEEDED | -- | 2 | details |
#6 | TIME LIMIT EXCEEDED | -- | 2 | details |
#7 | TIME LIMIT EXCEEDED | -- | 3 | details |
#8 | TIME LIMIT EXCEEDED | -- | 3 | details |
#9 | TIME LIMIT EXCEEDED | -- | 3 | details |
Compiler report
input/code.cpp: In function 'int minni(std::vector<long long int>)': input/code.cpp:7:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (long long i = 0; i < v.size(); i++) { ^ input/code.cpp:11:9: warning: 'm' may be used uninitialized in this function [-Wmaybe-uninitialized] return m; ^ input/code.cpp: In function 'int main()': input/code.cpp:11:9: warning: 'm' may be used uninitialized in this function [-Wmaybe-uninitialized] input/code.cpp:6:12: note: 'm' was declared here long long m; ^
Code
#include <iostream> #include <vector> using namespace std; int minni(vector<long long> v) { long long m; for (long long i = 0; i < v.size(); i++) { if (!i) m = v[0]; else if (v[i] < m) m = v[i]; } return m; } int main() { long long n, q, p, r, x; int k; vector<long long> h, e; cin >> n >> q; for (long long i = 0; i < n; i++) { cin >> p; h.push_back(p); } for (long long z = 0; z < q; z++) { cin >> k >> r; if (k-1) { for (long long i = 0; i < n; i++) { e.push_back(abs(i+1-r)+h[i]); } cout << "\n" << minni(e) << "\n"; e.clear(); } else { cin >> x; h[r-1] = x; } } }
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
1000 1000 720 271 760 576 363 23 368 995... |
correct output |
---|
43 12 40 22 18 ... |
user output |
---|
43 12 ... |
Test 2
Group: 1
Verdict: ACCEPTED
input |
---|
1000 1000 720 18 984 261 344 257 686 441... |
correct output |
---|
10 20 27 37 73 ... |
user output |
---|
10 20 ... |
Test 3
Group: 1
Verdict: ACCEPTED
input |
---|
1000 1000 120 764 890 848 949 59 894 916... |
correct output |
---|
24 25 13 16 19 ... |
user output |
---|
24 25 ... |
Test 4
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 100000 11763 43585 3126 3787 79765 64... |
correct output |
---|
284 143 346 203 157 ... |
user output |
---|
(empty) |
Test 5
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 100000 76947 78386 71190 65478 90345 ... |
correct output |
---|
459 297 128 234 204 ... |
user output |
---|
(empty) |
Test 6
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 100000 39277 33504 98385 58115 28655 ... |
correct output |
---|
234 221 156 455 78 ... |
user output |
---|
(empty) |
Test 7
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 100000 46508 6952 22836 54480 91235 2... |
correct output |
---|
427 409 352 39 388 ... |
user output |
---|
(empty) |
Test 8
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 100000 15918 8771 36223 76330 39229 7... |
correct output |
---|
316 387 435 330 446 ... |
user output |
---|
(empty) |
Test 9
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 100000 87734 39225 78667 43704 17207 ... |
correct output |
---|
228 83 176 428 273 ... |
user output |
---|
(empty) |