답안 #917036

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
917036 2024-01-27T03:55:14 Z penguin133 Truck Driver (IOI23_deliveries) C++17
컴파일 오류
0 ms 0 KB
#include "deliveries.h"
#include <bits/stdc++.h>
vector <int> w, t;
void init(int N, std::vector<int> U, std::vector<int> V, std::vector<int> T, std::vector<int> W) {
  w = W;
  t = T;
	return;
}

long long max_time(int S, int X) {
  w[S] = X;
	return 1ll * min(w[0] + 1, w[1]) * t[0];
}

Compilation message

deliveries.cpp:3:1: error: 'vector' does not name a type
    3 | vector <int> w, t;
      | ^~~~~~
deliveries.cpp: In function 'void init(int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
deliveries.cpp:5:3: error: 'w' was not declared in this scope
    5 |   w = W;
      |   ^
deliveries.cpp:6:3: error: 't' was not declared in this scope
    6 |   t = T;
      |   ^
deliveries.cpp: In function 'long long int max_time(int, int)':
deliveries.cpp:11:3: error: 'w' was not declared in this scope
   11 |   w[S] = X;
      |   ^
deliveries.cpp:12:15: error: 'min' was not declared in this scope; did you mean 'std::min'?
   12 |  return 1ll * min(w[0] + 1, w[1]) * t[0];
      |               ^~~
      |               std::min
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from deliveries.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
deliveries.cpp:12:37: error: 't' was not declared in this scope
   12 |  return 1ll * min(w[0] + 1, w[1]) * t[0];
      |                                     ^