Borderou de evaluare (job #1682551)

Utilizator radu.leonardoThe Doctor radu.leonardo Data 10 aprilie 2016 12:11:49
Problema Sume Status done
Runda Arhiva de probleme Compilator cpp | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: user.cpp: In function ‘bool check(int)’: user.cpp:21:51: error: invalid conversion from ‘int*’ to ‘std::multiset<int>::value_type {aka int}’ [-fpermissive] for(i=3;i<=p;i++) if(i!=position) s.insert(v); ^ In file included from /usr/include/c++/4.8/set:62:0, from user.cpp:3: /usr/include/c++/4.8/bits/stl_multiset.h:459:7: error: initializing argument 1 of ‘std::multiset<_Key, _Compare, _Alloc>::iterator std::multiset<_Key, _Compare, _Alloc>::insert(std::multiset<_Key, _Compare, _Alloc>::value_type&&) [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<int>; std::multiset<_Key, _Compare, _Alloc>::value_type = int]’ [-fpermissive] insert(value_type&& __x) ^ user.cpp:25:15: error: incompatible types in assignment of ‘int’ to ‘int [25010]’ answer=*s.begin()-answer[1]; ^ user.cpp:30:29: error: invalid conversion from ‘int*’ to ‘std::multiset<int>::key_type {aka int}’ [-fpermissive] it=s.find(answer+answer[j]); ^ In file included from /usr/include/c++/4.8/set:62:0, from user.cpp:3: /usr/include/c++/4.8/bits/stl_multiset.h:643:7: error: initializing argument 1 of ‘std::multiset<_Key, _Compare, _Alloc>::iterator std::multiset<_Key, _Compare, _Alloc>::find(const key_type&) [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree_const_iterator<int>; std::multiset<_Key, _Compare, _Alloc>::key_type = int]’ [-fpermissive] find(const key_type& __x) ^ user.cpp: In function ‘void print()’: user.cpp:43:28: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int*’ [-Wformat=] printf("%d ",answer); ^ user.cpp: In function ‘int main()’: user.cpp:51:37: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int (*)[25010]’ [-Wformat=] for(i=1;i<=p;i++) scanf("%d",&v); ^ user.cpp:47:33: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] freopen("sume.in","r",stdin); ^ user.cpp:48:35: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] freopen("sume.out","w",stdout); ^ user.cpp:50:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&p); ^ user.cpp:51:38: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] for(i=1;i<=p;i++) scanf("%d",&v); ^

Ceva nu functioneaza?