Submission #1075887

# Submission time Handle Problem Language Result Execution time Memory
1075887 2024-08-26T09:38:37 Z amin Ancient Books (IOI17_books) C++14
0 / 100
1 ms 348 KB
#include "books.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
long long minimum_walk(vector<int> p, int s) {
	ll ans=0;
	ll n=p.size();
	ll ma=0;
	ll mi=-1;
	for(int i=0;i<n;i++)
    {
        if(p[i]==i)
        {
            continue;
        }
        if(mi==-1)
            mi=i;
        ma=i;
        if(p[i]>i)
            ans+=p[i]-i;
    }
    return ans+ma+mi;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB 3rd lines differ - on the 1st token, expected: '8', found: '7'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB 3rd lines differ - on the 1st token, expected: '8', found: '7'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB 3rd lines differ - on the 1st token, expected: '8', found: '7'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 3rd lines differ - on the 1st token, expected: '3304', found: '2371'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB 3rd lines differ - on the 1st token, expected: '8', found: '7'
4 Halted 0 ms 0 KB -