Submission #288037

# Submission time Handle Problem Language Result Execution time Memory
288037 2020-09-01T08:04:51 Z user202729 Ancient Books (IOI17_books) C++17
50 / 100
167 ms 18812 KB
// moreflags=grader.cpp
// 11
// :(
// Definitely cheating.
#include "books.h"
#include<algorithm>
#include<numeric>


long long minimum_walk(std::vector<int> p, int s) {
	if(s!=0) return 1;
	std::vector<int> total(p.size());
	for(int index=0; index<(int)p.size(); ++index){
		if(index<p[index]){
			++total[index];--total[p[index]];
		}
	}
	std::partial_sum(begin(total), end(total), total.begin());
	std::for_each(
			std::find_if(total.rbegin(), total.rend(),[&](int it){return it!=0;}),
			total.rend(),[&](int& it){if(it==0) it=1;});
	return 2*std::accumulate(begin(total), end(total), (int64_t)0);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Correct 0 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 0 ms 256 KB Output is correct
14 Correct 0 ms 256 KB Output is correct
15 Correct 0 ms 256 KB Output is correct
16 Correct 0 ms 256 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Correct 0 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 0 ms 256 KB Output is correct
14 Correct 0 ms 256 KB Output is correct
15 Correct 0 ms 256 KB Output is correct
16 Correct 0 ms 256 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
19 Correct 1 ms 256 KB Output is correct
20 Correct 1 ms 256 KB Output is correct
21 Correct 1 ms 256 KB Output is correct
22 Correct 0 ms 256 KB Output is correct
23 Correct 1 ms 256 KB Output is correct
24 Correct 0 ms 256 KB Output is correct
25 Correct 1 ms 256 KB Output is correct
26 Correct 1 ms 256 KB Output is correct
27 Correct 1 ms 256 KB Output is correct
28 Correct 0 ms 256 KB Output is correct
29 Correct 0 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Correct 0 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 0 ms 256 KB Output is correct
14 Correct 0 ms 256 KB Output is correct
15 Correct 0 ms 256 KB Output is correct
16 Correct 0 ms 256 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
19 Correct 1 ms 256 KB Output is correct
20 Correct 1 ms 256 KB Output is correct
21 Correct 1 ms 256 KB Output is correct
22 Correct 0 ms 256 KB Output is correct
23 Correct 1 ms 256 KB Output is correct
24 Correct 0 ms 256 KB Output is correct
25 Correct 1 ms 256 KB Output is correct
26 Correct 1 ms 256 KB Output is correct
27 Correct 1 ms 256 KB Output is correct
28 Correct 0 ms 256 KB Output is correct
29 Correct 0 ms 256 KB Output is correct
30 Correct 165 ms 18808 KB Output is correct
31 Correct 167 ms 18808 KB Output is correct
32 Correct 166 ms 18808 KB Output is correct
33 Correct 148 ms 18808 KB Output is correct
34 Correct 146 ms 18724 KB Output is correct
35 Correct 154 ms 18808 KB Output is correct
36 Correct 148 ms 18808 KB Output is correct
37 Correct 148 ms 18808 KB Output is correct
38 Correct 153 ms 18808 KB Output is correct
39 Correct 152 ms 18808 KB Output is correct
40 Correct 157 ms 18808 KB Output is correct
41 Correct 160 ms 18724 KB Output is correct
42 Correct 167 ms 18812 KB Output is correct
43 Correct 145 ms 18808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB 3rd lines differ - on the 1st token, expected: '3304', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Correct 0 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Correct 0 ms 256 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 0 ms 256 KB Output is correct
14 Correct 0 ms 256 KB Output is correct
15 Correct 0 ms 256 KB Output is correct
16 Correct 0 ms 256 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
19 Correct 1 ms 256 KB Output is correct
20 Correct 1 ms 256 KB Output is correct
21 Correct 1 ms 256 KB Output is correct
22 Correct 0 ms 256 KB Output is correct
23 Correct 1 ms 256 KB Output is correct
24 Correct 0 ms 256 KB Output is correct
25 Correct 1 ms 256 KB Output is correct
26 Correct 1 ms 256 KB Output is correct
27 Correct 1 ms 256 KB Output is correct
28 Correct 0 ms 256 KB Output is correct
29 Correct 0 ms 256 KB Output is correct
30 Correct 165 ms 18808 KB Output is correct
31 Correct 167 ms 18808 KB Output is correct
32 Correct 166 ms 18808 KB Output is correct
33 Correct 148 ms 18808 KB Output is correct
34 Correct 146 ms 18724 KB Output is correct
35 Correct 154 ms 18808 KB Output is correct
36 Correct 148 ms 18808 KB Output is correct
37 Correct 148 ms 18808 KB Output is correct
38 Correct 153 ms 18808 KB Output is correct
39 Correct 152 ms 18808 KB Output is correct
40 Correct 157 ms 18808 KB Output is correct
41 Correct 160 ms 18724 KB Output is correct
42 Correct 167 ms 18812 KB Output is correct
43 Correct 145 ms 18808 KB Output is correct
44 Incorrect 1 ms 256 KB 3rd lines differ - on the 1st token, expected: '3304', found: '1'
45 Halted 0 ms 0 KB -