Wrong Answer

/in/foo.cc: In function 'void js(int)':
/in/foo.cc:11:18: warning: array subscript 4 is above array bounds of 'int [4]' [-Warray-bounds]
   11 |         gra[xb][4]=b*2;
      |         ~~~~~~~~~^
/in/foo.cc:3:9: note: while referencing 'gra'
    3 | int n,k,gra[1000005][4],xb,visited[1000005],num,flag,ok,ans=1;
      |         ^~~
In function 'void js(int)',
    inlined from 'void bfs(int)' at /in/foo.cc:15:4:
/in/foo.cc:11:18: warning: array subscript 4 is above array bounds of 'int [4]' [-Warray-bounds]
   11 |         gra[xb][4]=b*2;
      |         ~~~~~~~~~^
/in/foo.cc: In function 'void bfs(int)':
/in/foo.cc:3:9: note: while referencing 'gra'
    3 | int n,k,gra[1000005][4],xb,visited[1000005],num,flag,ok,ans=1;
      |         ^~~
/in/foo.cc:19:80: warning: array subscript 4 is above array bounds of 'int [4]' [-Warray-bounds]
   19 |                 com1.push(gra[xb][2]),com1.push(gra[xb][3]),com1.push(gra[xb][4]);
      |                                                                       ~~~~~~~~~^
/in/foo.cc:3:9: note: while referencing 'gra'
    3 | int n,k,gra[1000005][4],xb,visited[1000005],num,flag,ok,ans=1;
      |         ^~~
/in/foo.cc:20:100: warning: array subscript 4 is above array bounds of 'int [4]' [-Warray-bounds]
   20 |                 visited[gra[xb][1]]=1,visited[gra[xb][2]]=1,visited[gra[xb][3]]=1,visited[gra[xb][4]]=1;
      |                                                                                           ~~~~~~~~~^
/in/foo.cc:3:9: note: while referencing 'gra'
    3 | int n,k,gra[1000005][4],xb,visited[1000005],num,flag,ok,ans=1;
      |         ^~~
In function 'void js(int)',
    inlined from 'void bfs(int)' at /in/foo.cc:27:6:
/in/foo.cc:11:18: warning: array subscript 4 is above array bounds of 'int [4]' [-Warray-bounds]
   11 |         gra[xb][4]=b*2;
      |         ~~~~~~~~~^
/in/foo.cc: In function 'void bfs(int)':
/in/foo.cc:3:9: note: while referencing 'gra'
    3 | int n,k,gra[1000005][4],xb,visited[1000005],num,flag,ok,ans=1;
      |         ^~~
# 状态 耗时 内存占用
#1 Wrong Answer 10ms 532.0 KiB

信息

递交者
类型
自测
题目
P2079 抓住那头牛
语言
C++
递交时间
2026-03-29 17:16:17
评测时间
2026-03-29 17:16:17
评测机
分数
0
总耗时
10ms
峰值内存
532.0 KiB