Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:10:51: error: 'x' was not declared in this scope
   10 |         for(int i=1;i<=n;i++){cin>>t[i].a>>t[i].c;x+=t[i].a;}
      |                                                   ^
/in/foo.cc:13:27: error: 'x' was not declared in this scope
   13 |                 for(int j=x;j>=t[i].a;j--)
      |                           ^
/in/foo.cc:15:24: error: 'x' was not declared in this scope
   15 |         for(int i=2;i<=x;i++)if(dp[i]<=k)ans=i;
      |                        ^

信息

递交者
类型
递交
题目
P3018 道具商店202512GESP6级T2
语言
C++
递交时间
2026-02-25 08:30:19
评测时间
2026-02-25 08:30:19
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes