Submission #33540

# Submission time Handle Problem Language Result Execution time Memory
33540 2017-10-29T16:56:39 Z top34051 Ancient Books (IOI17_books) C++14
0 / 100
0 ms 9828 KB
#include "books.h"
#include<bits/stdc++.h>
using namespace std;

#define pii pair<int,int>
#define X first
#define Y second
const int maxn = 1000005;

int n;
long long sum[maxn];

long long minimum_walk(vector<int> pos, int s) {
    int i;
    long long ans = 0;
    n = pos.size();
    for(i=0;i<n;i++) sum[min(i,pos[i])]++, sum[max(i,pos[i])]--;
    for(i=0;i<n-1;i++) {
        sum[i] += sum[i-1];
        ans += sum[i];
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 9828 KB 3rd lines differ - on the 1st token, expected: '6', found: '4'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 9828 KB 3rd lines differ - on the 1st token, expected: '6', found: '4'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 9828 KB 3rd lines differ - on the 1st token, expected: '6', found: '4'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 9828 KB 3rd lines differ - on the 1st token, expected: '3304', found: '2744'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 9828 KB 3rd lines differ - on the 1st token, expected: '6', found: '4'
2 Halted 0 ms 0 KB -