제출 #1335430

#제출 시각아이디문제언어결과실행 시간메모리
1335430nerrrmin추월 (IOI23_overtaking)C++20
0 / 100
1 ms344 KiB
#include "overtaking.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int maxn = 3e5 + 10;
long long l, n, m, x, y;
vector <  long long > t;
vector < int > w, s;

void init(int L, int N, std::vector<long long> T, std::vector<int> W, int X, int M, std::vector<int> S)
{
    l = L;
    n = N;
    t = T;
    x = X;
    w = W;
    m = M;
    s = S;
    return;
}
vector <int > predi;
struct bus
{
    int t, s, i;
    bus(){};
    bus(int _t, int _s, int _i)
    {
        t = _t;
        s = _s;
        i = _i;
    }
};
bus a[maxn];
int active[maxn];
int arrive[maxn];
long long arrival_time(long long Y)
{
    y = Y;
    vector < bus > g;
    for (int i = 0; i < n; ++ i)
    {
        long long t1 = t[i];
        long long s1 = w[i];
        if(t1 >= y)continue;
        active[i] = 1;
        arrive[i] = t1;
        g.pb(bus(t1, s1, i));

    }
    long long arrive = y;
    long long pre = s[0];
    for (int i = 1; i < m; ++ i)
    {
        long long dist = s[i] - pre;

        long long typical_arrive = arrive + dist * x;
       vector < bus > v;
        for (auto &[t1, s1, nomer]: g)
        {
            long long curr_arrive = (t1 + s[i] * s1);
            if(curr_arrive < typical_arrive)
            {
                arrive = curr_arrive;
            }
            else v.pb(bus(t1, s1, nomer));
        }

        pre = s[i];
    }
    return arrive;

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...