#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
5 ms |
340 KB |
Output is correct |
3 |
Correct |
185 ms |
5068 KB |
Output is correct |
4 |
Correct |
277 ms |
7700 KB |
Output is correct |
5 |
Correct |
366 ms |
9880 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
212 KB |
Output is correct |
3 |
Correct |
83 ms |
284 KB |
Output is correct |
4 |
Correct |
150 ms |
280 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
212 KB |
Output is correct |
3 |
Correct |
83 ms |
284 KB |
Output is correct |
4 |
Correct |
150 ms |
280 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
4 ms |
212 KB |
Output is correct |
7 |
Correct |
150 ms |
276 KB |
Output is correct |
8 |
Correct |
213 ms |
272 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
5 ms |
340 KB |
Output is correct |
3 |
Correct |
185 ms |
5068 KB |
Output is correct |
4 |
Correct |
277 ms |
7700 KB |
Output is correct |
5 |
Correct |
366 ms |
9880 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
2 ms |
212 KB |
Output is correct |
8 |
Correct |
83 ms |
284 KB |
Output is correct |
9 |
Correct |
150 ms |
280 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
4 ms |
212 KB |
Output is correct |
12 |
Correct |
150 ms |
276 KB |
Output is correct |
13 |
Correct |
213 ms |
272 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
13 ms |
468 KB |
Output is correct |
16 |
Correct |
149 ms |
4116 KB |
Output is correct |
17 |
Correct |
352 ms |
8856 KB |
Output is correct |
18 |
Correct |
375 ms |
9932 KB |
Output is correct |
19 |
Correct |
363 ms |
10008 KB |
Output is correct |
20 |
Correct |
373 ms |
10004 KB |
Output is correct |