记录详情

Compile Error

foo.cc:7:24: error: 'vector' has not been declared
    7 | bool TravelPlan(int k, vector<int>& nums)
      |                        ^~~~~~
foo.cc:7:30: error: expected ',' or '...' before '<' token
    7 | bool TravelPlan(int k, vector<int>& nums)
      |                              ^
foo.cc: In function 'bool TravelPlan(int, int)':
foo.cc:9:13: error: 'nums' was not declared in this scope
    9 |     int n = nums.size();
      |             ^~~~
foo.cc: In function 'int main()':
foo.cc:28:5: error: 'vector' was not declared in this scope
   28 |     vector<int> nums(n);
      |     ^~~~~~
foo.cc:4:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    3 | #include <unordered_map>
  +++ |+#include <vector>
    4 | 
foo.cc:28:12: error: expected primary-expression before 'int'
   28 |     vector<int> nums(n);
      |            ^~~
foo.cc:29:40: error: 'nums' was not declared in this scope
   29 |     for (int i = 0; i < n; i++) cin >> nums[i];
      |                                        ^~~~
foo.cc:31:27: error: 'nums' was not declared in this scope
   31 |     cout << TravelPlan(k, nums) << "\n";
      |                           ^~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1401 Problem 4A. 制定城市旅行计划
语言
C++
递交时间
2023-06-03 22:19:52
评测时间
2023-06-03 22:19:52
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes