Submission #60963


ソースコード

ステータス

項目 データ
問題 1281 - 病気の山本くん
ユーザー名 ei1903
投稿日時 2020-07-16 16:43:25
言語 C++17
状態 Compile Error
得点 0
ソースコード長 433 Byte
最大実行時間 -
最大メモリ使用量

コンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:9:10: error: reference to ‘data’ is ambiguous
     cin>>data[i];
          ^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/string:51,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/locale_classes.h:40,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/ios_base.h:41,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:42,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/istream:38,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/sstream:38,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/complex:45,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/ccomplex:39,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:52,
                 from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/range_access.h:318:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’
     data(initializer_list<_Tp> __il) noexcept
     ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/range_access.h:309:5: note:                 ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’
     data(_Tp (&__array)[_Nm]) noexcept
     ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/range_access.h:299:5: note:                 ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’
     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
     ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/range_access.h:289:5: note:                 ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’
     data(_Container& __cont) noexcept(noexcept(__cont.data()))
     ^~~~
./Main.cpp:3:11: note:                 ‘long long int data [100005]’
 long long data[100005], sum[100005];
           ^~~~
./Main.cpp:13:21: error: reference to ‘data’ is ambiguous
     sum[i]=sum[i-1]+data[i];
                     ^~~~
In file included from /usr/local/gcc-8.2.0/include/c++/8.2.0/string:51,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/locale_classes.h:40,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/bits/ios_base.h:41,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/ios:42,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/istream:38,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/sstream:38,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/complex:45,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/ccomplex:39,
                 from /usr/local/gcc-8.2.0/include/c++/8.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:52,
                 from ./Main.cpp:1:
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/range_access.h:318:5: note: candidates are: ‘template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)’
     data(initializer_list<_Tp> __il) noexcept
     ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/range_access.h:309:5: note:                 ‘template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])’
     data(_Tp (&__array)[_Nm]) noexcept
     ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/range_access.h:299:5: note:                 ‘template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)’
     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
     ^~~~
/usr/local/gcc-8.2.0/include/c++/8.2.0/bits/range_access.h:289:5: note:                 ‘template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)’
     data(_Container& __cont) noexcept(noexcept(__cont.data()))
     ^~~~
./Main.cpp:3:11: note:                 ‘long long int data [100005]’
 long long data[100005], sum[100005];
           ^~~~

セット

セット 得点 Cases

テストケース

ファイル名 状態 実行時間 メモリ使用量 #