Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:10:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   10 |     for(int l=1,r=n;l<r;)
      |     ^~~
/in/foo.cc:12:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   12 |         if(s[l]!=s[r])ans+=t;
      |         ^~
/in/foo.cc:11:13: warning: unused variable 't' [-Wunused-variable]
   11 |         int t=min(a[l],a[r]);
      |             ^
/in/foo.cc:12:14: error: 'l' was not declared in this scope
   12 |         if(s[l]!=s[r])ans+=t;
      |              ^
/in/foo.cc:12:20: error: 'r' was not declared in this scope
   12 |         if(s[l]!=s[r])ans+=t;
      |                    ^
/in/foo.cc:12:28: error: 't' was not declared in this scope; did you mean 'tm'?
   12 |         if(s[l]!=s[r])ans+=t;
      |                            ^
      |                            tm
/in/foo.cc:13:11: error: 'l' was not declared in this scope
   13 |         a[l]-=t,a[r]-=t;
      |           ^
/in/foo.cc:13:15: error: 't' was not declared in this scope; did you mean 'tm'?
   13 |         a[l]-=t,a[r]-=t;
      |               ^
      |               tm
/in/foo.cc:13:19: error: 'r' was not declared in this scope
   13 |         a[l]-=t,a[r]-=t;
      |                   ^
/in/foo.cc: At global scope:
/in/foo.cc:17:5: error: 'cout' does not name a type
   17 |     cout<<ans;
      |     ^~~~
/in/foo.cc:18:5: error: expected unqualified-id before 'return'
   18 |     return 0;
      |     ^~~~~~
/in/foo.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^

信息

递交者
类型
递交
题目
P3198 回文串
语言
C++
递交时间
2026-11-21 20:34:01
评测时间
2026-11-21 20:34:01
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes