QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#364275#5075. Fenwick TreeZhangYiDeCompile Error//C++171.2kb2024-03-24 13:25:202024-03-24 13:25:20

详细

answer.code: In function ‘int main()’:
answer.code:25:20: error: reference to ‘data’ is ambiguous
   25 |         scanf("%s",data);
      |                    ^~~~
In file included from /usr/include/c++/13/string:53,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from answer.code:1:
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)’
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
answer.code:14:6: note:                 ‘char data [100010]’
   14 | char data[100010];
      |      ^~~~
answer.code:27:16: error: reference to ‘data’ is ambiguous
   27 |             if(data[r1-1]=='0'){
      |                ^~~~
/usr/include/c++/13/bits/range_access.h:346:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)’
  346 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:336:5: note:                 ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’
  336 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:325:5: note:                 ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’
  325 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/13/bits/range_access.h:314:5: note:                 ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’
  314 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
answer.code:14:6: note:                 ‘char data [100010]’
   14 | char data[100010];
      |      ^~~~
answer.code:17:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |     scanf("%d",&T);
      |     ~~~~~^~~~~~~~~
answer.code:24:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   24 |         scanf("%d",&n);
      |         ~~~~~^~~~~~~~~