#include <iostream>
using namespace std;
int v[15];
bool pal(int a)
{
while(a>0)
{
v[++v[0]]=a%10;
a/=10;
}
for(int i=1;i<=v[0];i++)
if(v[i]!=v[v[0]-i+1])
return false;
return true;
}
int main()
{
int n,a,sum=0;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a;
if(pal(a))
sum+=a;
v[0]=0;
}
cout<<sum;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
296 KB |
Output is correct |
2 |
Correct |
2 ms |
212 KB |
Output is correct |
3 |
Correct |
76 ms |
1676 KB |
Output is correct |
4 |
Correct |
154 ms |
3084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
296 KB |
Output is correct |
2 |
Correct |
2 ms |
212 KB |
Output is correct |
3 |
Correct |
76 ms |
1676 KB |
Output is correct |
4 |
Correct |
154 ms |
3084 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
4 ms |
340 KB |
Output is correct |
7 |
Correct |
156 ms |
3336 KB |
Output is correct |
8 |
Correct |
191 ms |
4096 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |