Borderou de evaluare (job #832307)
| Utilizator |
|
IP | ascuns |
|---|---|---|---|
| Problemă | Cristela (clasele 9-12) | Compilator | cpp-32 |
| Rundă | Arhiva de probleme | Status | evaluat |
| Dată | 6 aug. 2025 08:58:03 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp: In function 'int main()':
main.cpp:12:18: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
12 | fscanf(fin,"%d ",&n);
| ~^ ~~
| | |
| | long long int*
| int*
| %lld
main.cpp:21:25: error: no matching function for call to 'max(long long int&, int)'
21 | max_bits=max(max_bits,ch-'a');
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/algorithm:60,
from /usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/i686-pc-linux-gnu/bits/stdc++.h:51,
from main.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
main.cpp:21:25: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
21 | max_bits=max(max_bits,ch-'a');
| ~~~^~~~~~~~~~~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/algorithm:61:
/usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/lib/gcc/i686-pc-linux-gnu/14/include/g++-v14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
main.cpp:21:25: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
21 | max_bits=max(max_bits,ch-'a');
| ~~~^~~~~~~~~~~~~~~~~
main.cpp:39:20: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
39 | fprintf(fout,"%d\n",ans/2);
| ~^ ~~~~~
| | |
| int long long int
| %lld
main.cpp:12:11: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
12 | fscanf(fin,"%d ",&n);
| ~~~~~~^~~~~~~~~~~~~~