F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_39841040_2796.cpp:12:32: error: 'vector' does not name a type
   12 | long long findLCM(int n, const vector<int>& numbers) {
      |                                ^~~~~~
0_0_39841040_2796.cpp:12:38: error: expected ',' or '...' before '<' token
   12 | long long findLCM(int n, const vector<int>& numbers) {
      |                                      ^
0_0_39841040_2796.cpp: In function 'long long int findLCM(int, int)':
0_0_39841040_2796.cpp:13:36: error: expected primary-expression before '[' token
   13 |     long long current_lcm = numbers[0];
      |                                    ^
0_0_39841040_2796.cpp:15:47: error: expected primary-expression before '[' token
   15 |         current_lcm = lcm(current_lcm, numbers[i]);
      |                                               ^
0_0_39841040_2796.cpp: In function 'int main()':
0_0_39841040_2796.cpp:23:9: error: 'vector' was not declared in this scope
   23 |         vector<int> numbers(n);
      |         ^~~~~~
0_0_39841040_2796.cpp:3:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    2 | #include <numeric> // std::gcd 函数所在的头文件
  +++ |+#include <vector>
    3 | 
0_0_39841040_2796.cpp:23:16: error: expected primary-expression before 'int'
   23 |         vector<int> numbers(n);
      |                ^~~
0_0_39841040_2796.cpp:25:27: error: expected primary-expression before '[' token
   25 |             cin >> numbers[i]; // 读取每个测试实例中的数字
      |                           ^
0_0_39841040_2796.cpp:29:35: error: expected primary-expression before ')' token
   29 |         cout << findLCM(n, numbers) << endl;
      |                                   ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-12-05 10:40:18, Gzip enabled