#include <iostream>
using namespace std;
long long n,s,x;
bool palindrom(long long n)
{
long long cn=n,rn=0;
while(cn)
{
rn*=10;
rn+=cn%10;
cn/=10;
}
if(n==rn)
return true;
return false;
}
int main()
{
cin>>n;
while(n--)
{
cin>>x;
if(palindrom(x))
s+=x;
}
cout<<s;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
292 KB |
Output is correct |
2 |
Correct |
5 ms |
332 KB |
Output is correct |
3 |
Correct |
211 ms |
4996 KB |
Output is correct |
4 |
Correct |
281 ms |
7556 KB |
Output is correct |
5 |
Correct |
393 ms |
9860 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
2 ms |
304 KB |
Output is correct |
3 |
Correct |
77 ms |
1704 KB |
Output is correct |
4 |
Correct |
153 ms |
3076 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
2 ms |
304 KB |
Output is correct |
3 |
Correct |
77 ms |
1704 KB |
Output is correct |
4 |
Correct |
153 ms |
3076 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
5 ms |
284 KB |
Output is correct |
7 |
Correct |
149 ms |
3200 KB |
Output is correct |
8 |
Correct |
189 ms |
3968 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
292 KB |
Output is correct |
2 |
Correct |
5 ms |
332 KB |
Output is correct |
3 |
Correct |
211 ms |
4996 KB |
Output is correct |
4 |
Correct |
281 ms |
7556 KB |
Output is correct |
5 |
Correct |
393 ms |
9860 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Correct |
2 ms |
304 KB |
Output is correct |
8 |
Correct |
77 ms |
1704 KB |
Output is correct |
9 |
Correct |
153 ms |
3076 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
5 ms |
284 KB |
Output is correct |
12 |
Correct |
149 ms |
3200 KB |
Output is correct |
13 |
Correct |
189 ms |
3968 KB |
Output is correct |
14 |
Correct |
0 ms |
204 KB |
Output is correct |
15 |
Correct |
16 ms |
460 KB |
Output is correct |
16 |
Correct |
148 ms |
4096 KB |
Output is correct |
17 |
Correct |
342 ms |
9212 KB |
Output is correct |
18 |
Correct |
400 ms |
9868 KB |
Output is correct |
19 |
Correct |
365 ms |
9932 KB |
Output is correct |
20 |
Correct |
365 ms |
10052 KB |
Output is correct |