Accepted

foo.cc: In function ‘int main()’:
foo.cc:10:4: warning: array subscript 3 is above array bounds of ‘long long int [3]’ [-Warray-bounds=]
   10 | a[3]=n%10;
      | ~~~^
foo.cc:3:13: note: while referencing ‘a’
    3 | long long n,a[3];
      |             ^
In file included from /nix/gcc-14.3.0/include/c++/14.3.0/algorithm:61,
                 from stdc++.h:51:
In function ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = long long int*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’,
    inlined from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = long long int*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ at /nix/gcc-14.3.0/include/c++/14.3.0/bits/stl_algo.h:1900:5,
    inlined from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = long long int*]’ at /nix/gcc-14.3.0/include/c++/14.3.0/bits/stl_algo.h:4772:18,
    inlined from ‘int main()’ at foo.cc:11:5:
/nix/gcc-14.3.0/include/c++/14.3.0/bits/stl_algo.h:1905:32: warning: array subscript 4 is outside array bounds of ‘long long int [3]’ [-Warray-bounds=]
 1905 |           std::__introsort_loop(__first, __last,
      |           ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
 1906 |                                 std::__lg(__last - __first) * 2,
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1907 |                                 __comp);
      |                                 ~~~~~~~
foo.cc: In function ‘int main()’:
foo.cc:3:13: note: at offset 32 into object ‘a’ of size 24
    3 | long long n,a[3];
      |             ^
In function ‘void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = long long int*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’,
    inlined from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = long long int*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ at /nix/gcc-14.3.0/include/c++/14.3.0/bits/stl_algo.h:1908:31,
    inlined from ‘void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = long long int*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]’ at /nix/gcc-14.3.0/include/c++/14.3.0/bits/stl_algo.h:1900:5,
    inlined from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = long long int*]’ at /nix/gcc-14.3.0/include/c++/14.3.0/bits/stl_algo.h:4772:18,
    inlined from ‘int main()’ at foo.cc:11:5:
/nix/gcc-14.3.0/include/c++/14.3.0/bits/stl_algo.h:1822:30: warning: array subscript 4 is outside array bounds of ‘long long int [3]’ [-Warray-bounds=]
 1822 |         std::__insertion_sort(__first, __last, __comp);
      |         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function ‘int main()’:
foo.cc:3:13: note: at offset 32 into object ‘a’ of size 24
    3 | long long n,a[3];
      |             ^
foo.cc:12:10: warning: array subscript 3 is above array bounds of ‘long long int [3]’ [-Warray-bounds=]
   12 | cout<<a[3]<<a[2]<<a[1];
      |          ^
foo.cc:3:13: note: while referencing ‘a’
    3 | long long n,a[3];
      |             ^
# 状态 耗时 内存占用
#1 Accepted 2ms 504.0 KiB
#2 Accepted 2ms 504.0 KiB
#3 Accepted 2ms 480.0 KiB
#4 Accepted 2ms 496.0 KiB
#5 Accepted 2ms 512.0 KiB

信息

递交者
类型
递交
题目
P1715 最大的三位数
语言
C++
递交时间
2026-04-18 15:06:12
评测时间
2026-04-18 15:06:12
评测机
分数
100
总耗时
12ms
峰值内存
512.0 KiB