Submission #42955

# Submission time Handle Problem Language Result Execution time Memory
42955 2018-03-06T21:08:37 Z MatheusLealV Ancient Books (IOI17_books) C++14
0 / 100
2 ms 476 KB
#include <bits/stdc++.h>
#define N 501
using namespace std;
typedef long long ll;

int n, s, ans[1000050];

ll minimum_walk(vector<int> v, int s_)
{
    ll maior = 0;

    n = v.size(), s = s_;

    for(ll i = 0; i < v.size(); i++) if(v[i] != i) maior = max(maior, i);

    return 2*maior;
}

Compilation message

books.cpp: In function 'll minimum_walk(std::vector<int>, int)':
books.cpp:14:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(ll i = 0; i < v.size(); i++) if(v[i] != i) maior = max(maior, i);
                     ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 1 ms 352 KB Output is correct
3 Incorrect 1 ms 424 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 1 ms 352 KB Output is correct
3 Incorrect 1 ms 424 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 1 ms 352 KB Output is correct
3 Incorrect 1 ms 424 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 476 KB 3rd lines differ - on the 1st token, expected: '3304', found: '1998'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 1 ms 352 KB Output is correct
3 Incorrect 1 ms 424 KB 3rd lines differ - on the 1st token, expected: '8', found: '6'
4 Halted 0 ms 0 KB -