Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

函数参数类型不一致 #32

Closed
Anudorannador opened this issue Feb 24, 2022 · 1 comment
Closed

函数参数类型不一致 #32

Anudorannador opened this issue Feb 24, 2022 · 1 comment

Comments

@Anudorannador
Copy link

原题的函数定义是 findMinArrowShots(vector<vector<int>>& points),类型是 vector<vector<int>> ,不是 vector<pair<int, int>>。所以代码里的 firstsecond 对应也需要修改。

我试了下,修改函数会报编译错误。

Line 30: Char 46: error: non-const lvalue reference to type 'vector<pair<int, int>>' cannot bind to a value of unrelated type 'vector<vector<int>>'
      int ret = Solution().findMinArrowShots(param_1); return ret;
                                             ^~~~~~~
Line 7: Char 51: note: passing argument to parameter 'points' here
    int findMinArrowShots(vector<pair<int, int>>& points)
                                                  ^
1 error generated.

PS:是不是关神做的时候题目是 pair 后来改成 vector : )

@wisdompeak
Copy link
Owner

是的,在远古的时候很多题目参数都是用的pair。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants