Submission #1039366

# Submission time Handle Problem Language Result Execution time Memory
1039366 2024-07-30T19:08:52 Z fv3 Overtaking (IOI23_overtaking) C++17
9 / 100
2 ms 452 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#include "overtaking.h"

ll L, N, M;
ll X;
vector<ll> T;
vector<int> W, S;

vector<ll> arrival;

void init(int l, int n, vector<ll> t, vector<int> w, int x, int m, vector<int> s)
{
    L = l; N = n;
    T = t; W = w;
    X = x; M = m;
    S = s;

    arrival = vector<ll>(M);
    for (int i = 0; i < M; i++)
        arrival[i] = T[0] + (ll)W[0] * (ll)S[i];

    return;
}

ll arrival_time(ll Y)
{
    for (int i = 1; i < M; i++)
    {
        if (Y + (ll)S[i-1] * X > arrival[i-1] && Y + (ll)S[i] * X < arrival[i])
            return arrival[i] + (L - (ll)S[i]) * X;
    }

    return Y + X * L;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 4th lines differ - on the 1st token, expected: '130', found: '110'
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 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 2 ms 452 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB 3rd lines differ - on the 1st token, expected: '17210507896', found: '17146630390'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 4th lines differ - on the 1st token, expected: '130', found: '110'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 4th lines differ - on the 1st token, expected: '130', found: '110'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB 4th lines differ - on the 1st token, expected: '130', found: '110'
2 Halted 0 ms 0 KB -