Wrong Answer

foo.cc: In function ‘int main()’:
foo.cc:30:31: warning: comparison of integer expressions of different signedness: ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
   30 |                 if(g[i].size()>maxg)
      |                    ~~~~~~~~~~~^~~~~
foo.cc:38:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   38 |     for(int i=0;i<g[mx].size();i++)
      |                 ~^~~~~~~~~~~~~
In file included from /nix/gcc-15.2.0/include/c++/15.2.0/vector:68,
                 from /nix/gcc-15.2.0/include/c++/15.2.0/queue:69,
                 from stdc++.h:160:
In member function ‘std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>]’,
    inlined from ‘int main()’ at foo.cc:38:29:
/nix/gcc-15.2.0/include/c++/15.2.0/bits/stl_vector.h:1119:41: warning: array subscript -1 is outside array bounds of ‘std::vector<int> [1005]’ [-Warray-bounds=]
 1119 |         ptrdiff_t __dif = this->_M_impl._M_finish - this->_M_impl._M_start;
      |                           ~~~~~~~~~~~~~~^~~~~~~~~
foo.cc: In function ‘int main()’:
foo.cc:4:12: note: at offset -24 into object ‘g’ of size 24120
    4 | vector<int>g[1005];
      |            ^
In member function ‘std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>]’,
    inlined from ‘int main()’ at foo.cc:38:29:
/nix/gcc-15.2.0/include/c++/15.2.0/bits/stl_vector.h:1119:67: warning: array subscript -1 is outside array bounds of ‘std::vector<int> [1005]’ [-Warray-bounds=]
 1119 |         ptrdiff_t __dif = this->_M_impl._M_finish - this->_M_impl._M_start;
      |                                                     ~~~~~~~~~~~~~~^~~~~~~~
foo.cc: In function ‘int main()’:
foo.cc:4:12: note: at offset -24 into object ‘g’ of size 24120
    4 | vector<int>g[1005];
      |            ^
# 状态 耗时 内存占用
#1 Wrong Answer On line 2: Read -1, expect 1. 2ms 768.0 KiB
#2 Wrong Answer On line 2: Read -1, expect 1. 2ms 512.0 KiB
#3 Wrong Answer On line 1: Read -1, expect 1. 2ms 512.0 KiB
#4 Wrong Answer On line 2: Read -1, expect 1. 3ms 508.0 KiB
#5 Wrong Answer On line 2: Read -1, expect 2. 2ms 508.0 KiB
#6 Wrong Answer On line 2: Read -1, expect 1. 2ms 512.0 KiB
#7 Wrong Answer On line 2: Read -1, expect 1. 3ms 508.0 KiB
#8 Wrong Answer On line 2: Read -1, expect 1. 2ms 512.0 KiB
#9 Wrong Answer On line 2: Read -1, expect 1. 3ms 512.0 KiB
#10 Wrong Answer On line 2: Read -1, expect 1. 3ms 508.0 KiB

信息

递交者
类型
递交
题目
P3100 找树根和孩子
语言
C++
递交时间
2026-05-02 14:51:14
评测时间
2026-05-02 14:51:14
评测机
分数
0
总耗时
29ms
峰值内存
768.0 KiB