记录详情

Runtime Error

foo.c: In function 'main':
foo.c:12:17: warning: array subscript <unknown> is outside array bounds of 'int[<U 2d0>]' [-Warray-bounds]
   12 |         a=number[k];
      |           ~~~~~~^~~
foo.c:7:13: note: while referencing 'number.7'
    7 |         int number[n];
      |             ^~~~~~
foo.c:15:15: warning: array subscript 1 is outside array bounds of 'int[<U 2d0>]' [-Warray-bounds]
   15 |         number[1]=a;
      |         ~~~~~~^~~
foo.c:7:13: note: while referencing 'number.7'
    7 |         int number[n];
      |             ^~~~~~
foo.c:16:32: warning: array subscript i is outside array bounds of 'int[<U 2d0>]' [-Warray-bounds]
   16 |         for(int i=1;i<n+1;i++){printf("%d ",number[i]);
      |                                ^~~~~~~~~~~~~~~~~~~~~~~
foo.c:7:13: note: while referencing 'number.7'
    7 |         int number[n];
      |             ^~~~~~
foo.c:13:46: warning: array subscript <unknown> is outside array bounds of 'int[<U 2d0>]' [-Warray-bounds]
   13 |         for(int i=k;i>1;i--){number[i]=number[i-1];
      |                                        ~~~~~~^~~~~
foo.c:7:13: note: while referencing 'number.7'
    7 |         int number[n];
      |             ^~~~~~
foo.c:13:36: warning: array subscript i is outside array bounds of 'int[<U 2d0>]' [-Warray-bounds]
   13 |         for(int i=k;i>1;i--){number[i]=number[i-1];
      |                              ~~~~~~^~~
foo.c:7:13: note: while referencing 'number.7'
    7 |         int number[n];
      |             ^~~~~~
foo.c:10:32: warning: array subscript i is outside array bounds of 'int[<U 2d0>]' [-Warray-bounds]
   10 |         for(int i=1;i<n+1;i++){scanf("%d",&number[i]);
      |                                ^~~~~~~~~~~~~~~~~~~~~~
foo.c:7:13: note: while referencing 'number.7'
    7 |         int number[n];
      |             ^~~~~~
foo.c:13:39: warning: '__builtin_memmove' offset [0, 3] is out of the bounds [0, 0] of object 'number.7' with type 'unsigned char[0]' [-Warray-bounds]
   13 |         for(int i=k;i>1;i--){number[i]=number[i-1];
      |                              ~~~~~~~~~^~~~~~~~~~~~
foo.c:7:13: note: 'number.7' declared here
    7 |         int number[n];
      |             ^~~~~~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Wrong Answer 0a1 > -305 -34 308 718 61 -309 1ms 284.0 KiB
#2 Runtime Error Segmentation fault 2ms 284.0 KiB
#3 Runtime Error Segmentation fault 1ms 284.0 KiB
#4 Runtime Error Segmentation fault 2ms 284.0 KiB
#5 Runtime Error Segmentation fault 1ms 284.0 KiB

信息

递交者
类型
递交
题目
2-4 点名上前
比赛
2023年新生赛(第三场)
语言
C
递交时间
2023-09-09 21:46:35
评测时间
2023-09-09 21:46:35
评测机
分数
0
总耗时
10ms
峰值内存
284.0 KiB