Borderou de evaluare (job #2875874)
Utilizator | Data | 22 martie 2022 15:18:39 | |
---|---|---|---|
Problema | Numinum | Status | done |
Runda | Arhiva de probleme | Compilator | cpp-64 | Vezi sursa |
Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int get_height(int, int, std::vector<int>&)':
main.cpp:13:36: error: expected primary-expression before 'return'
13 | if(a > b) prefix.push_back(0), return a / b + get_height(a % b, b);
| ^~~~~~
main.cpp:14:26: error: expected primary-expression before 'return'
14 | prefix.push_back(1), return b / a + get_height(a, b % a);
| ^~~~~~
main.cpp: In function 'int find_longest_prefix(std::vector<int>, std::vector<int>)':
main.cpp:20:44: error: expected primary-expression before 'return'
20 | prefix1[i] == prefix2[i] ? ans++ : return ans;
| ^~~~~~
main.cpp: In function 'void solve()':
main.cpp:28:33: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<bool>'
28 | int h1 = get_height(x1, y1, prefix1);
| ^~~~~~~
main.cpp:10:44: note: in passing argument 3 of 'int get_height(int, int, std::vector<int>&)'
10 | int get_height(int a, int b, vector <int> &prefix){
| ~~~~~~~~~~~~~~^~~~~~
main.cpp:29:33: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<bool>'
29 | int h2 = get_height(x2, y2, prefix2);
| ^~~~~~~
main.cpp:10:44: note: in passing argument 3 of 'int get_height(int, int, std::vector<int>&)'
10 | int get_height(int a, int b, vector <int> &prefix){
| ~~~~~~~~~~~~~~^~~~~~
main.cpp:30:34: error: could not convert 'prefix1' from 'vector<bool>' to 'vector<int>'
30 | int hc = find_longest_prefix(prefix1, prefix2);
| ^~~~~~~
| |
| vector<bool>
main.cpp: In function 'int get_height(int, int, std::vector<int>&)':
main.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
15 | }
| ^
Non zero exit status: 1
Ceva nu functioneaza?
- Citeste despre borderoul de evaluare.
- Daca tot nu e bine, contacteaza-ne pe forum !