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_39096985_32036.cpp: In function 'bool canPack(int, int, int)':
0_0_39096985_32036.cpp:8:12: error: request for member 'begin' in 'v', which is of non-class type 'int'
    8 |     sort(v.begin(), v.end());
      |            ^~~~~
0_0_39096985_32036.cpp:8:23: error: request for member 'end' in 'v', which is of non-class type 'int'
    8 |     sort(v.begin(), v.end());
      |                       ^~~
0_0_39096985_32036.cpp:9:12: error: request for member 'begin' in 'w', which is of non-class type 'int'
    9 |     sort(w.begin(), w.end());
      |            ^~~~~
0_0_39096985_32036.cpp:9:23: error: request for member 'end' in 'w', which is of non-class type 'int'
    9 |     sort(w.begin(), w.end());
      |                       ^~~
0_0_39096985_32036.cpp:12:14: error: invalid types 'int[int]' for array subscript
   12 |         if (v[i] < w[i]) {
      |              ^
0_0_39096985_32036.cpp:12:21: error: invalid types 'int[int]' for array subscript
   12 |         if (v[i] < w[i]) {
      |                     ^
0_0_39096985_32036.cpp: In function 'int main()':
0_0_39096985_32036.cpp:38:24: error: cannot convert 'std::vector<int>' to 'int'
   38 |         if (canPack(n, v, w)) {
      |                        ^
      |                        |
      |                        std::vector<int>
0_0_39096985_32036.cpp:7:24: note:   initializing argument 2 of 'bool canPack(int, int, int)'
    7 | bool canPack(int n,int v,int w) {
      |                    ~~~~^


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-11-22 22:18:52, Gzip enabled