#include <iostream>
using namespace std;
int palindrom (int x)
{
int p=1,nr=0;
while (x>=p)
{
p=p*10;
nr=nr*10+x%10;
if (nr==x) return 1;
x=x/10;
}
if (x==nr)
return 1;
return 0;
}
int n,i;
int unsigned long long s,a;
int main()
{
cin>>n;
for (i=1; i<=n; i++)
{
cin>>a;
if (palindrom(a)) s=s+a;
}
cout<<s;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
6 ms |
340 KB |
Output is correct |
3 |
Correct |
175 ms |
5008 KB |
Output is correct |
4 |
Correct |
267 ms |
7444 KB |
Output is correct |
5 |
Correct |
413 ms |
9804 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 |
82 ms |
1676 KB |
Output is correct |
4 |
Correct |
217 ms |
3076 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 |
82 ms |
1676 KB |
Output is correct |
4 |
Correct |
217 ms |
3076 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Incorrect |
5 ms |
316 KB |
Output isn't correct |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
6 ms |
340 KB |
Output is correct |
3 |
Correct |
175 ms |
5008 KB |
Output is correct |
4 |
Correct |
267 ms |
7444 KB |
Output is correct |
5 |
Correct |
413 ms |
9804 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
2 ms |
212 KB |
Output is correct |
8 |
Correct |
82 ms |
1676 KB |
Output is correct |
9 |
Correct |
217 ms |
3076 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Incorrect |
5 ms |
316 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |