Accepted

foo.cc: In function ‘int main()’:
foo.cc:14:29: warning: iteration 9 invokes undefined behavior [-Waggressive-loop-optimizations]
   14 |                 cout<<h[i]<<' ';
      |                             ^~~
foo.cc:13:22: note: within this loop
   13 |         for(int i=1;i<=10;i++)
      |                     ~^~~~
In file included from /nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_pair.h:61,
                 from /nix/gcc-13.3.0/include/c++/13.3.0/bits/stl_algobase.h:64,
                 from /nix/gcc-13.3.0/include/c++/13.3.0/algorithm:60,
                 from stdc++.h:51:
In function ‘std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = int]’,
    inlined from ‘int main()’ at foo.cc:8:6:
/nix/gcc-13.3.0/include/c++/13.3.0/bits/move.h:198:11: warning: array subscript 10 is outside array bounds of ‘int [10]’ [-Warray-bounds=]
  198 |       __a = _GLIBCXX_MOVE(__b);
      |           ^
foo.cc: In function ‘int main()’:
foo.cc:3:5: note: at offset 40 into object ‘h’ of size 40
    3 | int h[10];
      |     ^
In function ‘std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = int]’,
    inlined from ‘int main()’ at foo.cc:8:6:
/nix/gcc-13.3.0/include/c++/13.3.0/bits/move.h:199:11: warning: array subscript 10 is outside array bounds of ‘int [10]’ [-Warray-bounds=]
  199 |       __b = _GLIBCXX_MOVE(__tmp);
      |           ^
foo.cc: In function ‘int main()’:
foo.cc:3:5: note: at offset 40 into object ‘h’ of size 40
    3 | int h[10];
      |     ^
# 状态 耗时 内存占用
#1 Accepted 2ms 536.0 KiB
#2 Accepted 2ms 560.0 KiB
#3 Accepted 3ms 536.0 KiB
#4 Accepted 2ms 536.0 KiB

信息

递交者
类型
递交
题目
P2567 逆序输出10 个数
比赛
2024.7.16暑期中级1班练习
语言
C++
递交时间
2024-07-16 10:37:20
评测时间
2024-07-16 10:37:20
评测机
分数
100
总耗时
11ms
峰值内存
560.0 KiB