This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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()
{
long long 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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |