Wrong Answer

foo.cc: In function ‘int main()’:
foo.cc:19:31: warning: comparison of integer expressions of different signedness: ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
   19 |                 if(c[i].size()>=maxn)
      |                    ~~~~~~~~~~~^~~~~~
foo.cc:26:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<int>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   26 |         for(i=0;i<c[ans2].size();i++)
      |                 ~^~~~~~~~~~~~~~~
foo.cc:25:15: warning: ‘ans1’ may be used uninitialized [-Wmaybe-uninitialized]
   25 |         cout<<ans1<<endl<<ans2<<endl;
      |               ^~~~
foo.cc:7:23: note: ‘ans1’ was declared here
    7 |         int i,n,m,x,y,ans1,ans2,maxn=0;
      |                       ^~~~
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:26:24:
/nix/gcc-15.2.0/include/c++/15.2.0/bits/stl_vector.h:1119:67: warning: ‘ans2’ may be used uninitialized [-Wmaybe-uninitialized]
 1119 |         ptrdiff_t __dif = this->_M_impl._M_finish - this->_M_impl._M_start;
      |                                                     ~~~~~~~~~~~~~~^~~~~~~~
foo.cc: In function ‘int main()’:
foo.cc:7:28: note: ‘ans2’ was declared here
    7 |         int i,n,m,x,y,ans1,ans2,maxn=0;
      |                            ^~~~
# 状态 耗时 内存占用
#1 Accepted 2ms 764.0 KiB
#2 Accepted 2ms 768.0 KiB
#3 Wrong Answer On line 2: Read 2, expect 1. 2ms 764.0 KiB
#4 Wrong Answer On line 2: Read 3, expect 1. 2ms 588.0 KiB
#5 Wrong Answer On line 1: Read 0, expect 1. 3ms 700.0 KiB
#6 Accepted 2ms 768.0 KiB
#7 Accepted 2ms 656.0 KiB
#8 Accepted 2ms 768.0 KiB
#9 Wrong Answer On line 2: Read 2, expect 1. 3ms 1.0 MiB
#10 Wrong Answer On line 2: Read 99, expect 1. 2ms 768.0 KiB

信息

递交者
类型
递交
题目
P3100 找树根和孩子
语言
C++
递交时间
2026-05-02 13:34:01
评测时间
2026-05-02 13:34:01
评测机
分数
50
总耗时
27ms
峰值内存
1.0 MiB