제출 #1063838

#제출 시각아이디문제언어결과실행 시간메모리
1063838ProtonDecay314추월 (IOI23_overtaking)C++17
컴파일 에러
0 ms0 KiB
#include "overtaking.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pi; typedef pair<ll, ll> pll; typedef vector<pi> vpi; typedef vector<pll> vpll; typedef vector<vpi> vvpi; typedef vector<vpll> vvpll; typedef vector<bool> vb; typedef vector<vb> vvb; typedef short int si; typedef vector<si> vsi; typedef vector<vsi> vvsi; #define IOS ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); #define L(varll, mn, mx) for(ll varll = (mn); varll < (mx); varll++) #define LR(varll, mx, mn) for(ll varll = (mx); varll > (mn); varll--) #define LI(vari, mn, mx) for(int vari = (mn); vari < (mx); vari++) #define LIR(vari, mx, mn) for(int vari = (mx); vari > (mn); vari--) #define INPV(varvec) for(auto& varveci : (varvec)) cin >> varveci #define fi first #define se second #define pb push_back #define INF(type) numeric_limits<type>::max() #define NINF(type) numeric_limits<type>::min() #define TCASES int t; cin >> t; while(t--) struct bus { ll v; ll t; }; typedef vector<bus> vbu; typedef vector<vbu> vvbu; ll n; vbu init_buses; void init(int L, int N, vll T, vi W, int X, int M, vi S) { // ! No need to clear variables! This procedure is only called once :)) LI(i, 0, N) { if(W[i] > X) { init_buses.pb({W[i] - X, T[i]}); } } n = init_buses.size(); // Learning: vector assignment in C++ // implicitly calls the copy constructor sort(init_buses.begin(), init_buses.end(), [](bus& b1, bus& b2) {return b1.t < b2.t || (b1.t == b2.t && b1.v < b2.v);}); return; } ll arrival_time(ll Y) { // for each bus whose arrival time is less than the current, get the maximum time ll max_t = Y + X * S[1]; L(i, 0ll, n) { if(init_buses[i].t < Y) { max_t = max(max_t, init_buses[i].t + init_buses[i].v * S[1]); } } return max_t; }

컴파일 시 표준 에러 (stderr) 메시지

overtaking.cpp: In function 'll arrival_time(ll)':
overtaking.cpp:68:20: error: 'X' was not declared in this scope
   68 |     ll max_t = Y + X * S[1];
      |                    ^
overtaking.cpp:68:24: error: 'S' was not declared in this scope
   68 |     ll max_t = Y + X * S[1];
      |                        ^