Wrong Answer

/in/foo.cc: In function 'int main()':
/in/foo.cc:9:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |         for(int i=0;i<s.length();i++)
      |                     ~^~~~~~~~~~~
/in/foo.cc:10:46: warning: array subscript has type 'char' [-Wchar-subscripts]
   10 |                 if(s[i]>'0'&&'9'>=s[i])a[s[i]]++;
      |                                              ^
/in/foo.cc:10:46: warning: array subscript 49 is above array bounds of 'int [15]' [-Warray-bounds]
   10 |                 if(s[i]>'0'&&'9'>=s[i])a[s[i]]++;
      |                                        ~~~~~~^
/in/foo.cc:5:5: note: while referencing 'a'
    5 | int a[15];
      |     ^
/in/foo.cc:10:46: warning: array subscript 49 is above array bounds of 'int [15]' [-Warray-bounds]
   10 |                 if(s[i]>'0'&&'9'>=s[i])a[s[i]]++;
      |                                        ~~~~~~^
/in/foo.cc:5:5: note: while referencing 'a'
    5 | int a[15];
      |     ^
# 状态 耗时 内存占用
#1 Wrong Answer 2ms 532.0 KiB

信息

递交者
类型
自测
题目
P1000 大象喝水
语言
C++
递交时间
2025-11-02 16:26:44
评测时间
2025-11-02 16:26:44
评测机
分数
0
总耗时
2ms
峰值内存
532.0 KiB