/ Vijos /

记录详情

Runtime Error

/in/foo.cc: In function 'int calc(int, int*)':
/in/foo.cc:36:17: warning: operation on 'k' may be undefined [-Wsequence-point]
   36 |         else f[k=find(1,len,c[i])]=min(f[k],c[i]);
      |                ~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/12/string:50,
                 from /usr/include/c++/12/bits/locale_classes.h:40,
                 from /usr/include/c++/12/bits/ios_base.h:41,
                 from /usr/include/c++/12/ios:42,
                 from /usr/include/c++/12/ostream:38,
                 from /usr/include/c++/12/iostream:39,
                 from /in/foo.cc:2:
In function 'const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]',
    inlined from 'int calc(int, int*)' at /in/foo.cc:36:39:
/usr/include/c++/12/bits/stl_algobase.h:235:15: warning: 'k' may be used uninitialized [-Wmaybe-uninitialized]
  235 |       if (__b < __a)
      |           ~~~~^~~~~
/in/foo.cc: In function 'int calc(int, int*)':
/in/foo.cc:33:15: note: 'k' was declared here
   33 |     int len=0,k;
      |               ^
# 状态 耗时 内存占用
#1 Runtime Error 6ms 2.152 MiB
#2 Runtime Error 3ms 1.68 MiB
#3 Accepted 3ms 1.719 MiB
#4 Runtime Error 3ms 1.719 MiB
#5 Runtime Error 3ms 1.711 MiB
#6 Accepted 3ms 1.719 MiB
#7 Accepted 3ms 1.52 MiB
#8 Runtime Error 15ms 3.301 MiB
#9 Accepted 4ms 1.961 MiB
#10 Runtime Error 13ms 3.305 MiB

信息

递交者
类型
递交
题目
P1369 难解的问题
语言
C++
递交时间
2026-02-20 14:13:50
评测时间
2026-02-20 14:13:50
评测机
分数
40
总耗时
60ms
峰值内存
3.305 MiB