#include <iostream>
using namespace std;
typedef long long ll;
int n;
bool epal(int x) {
int cx = x;
ll pal = 0;
while (x) {
pal = pal * 10 + x % 10;
x /= 10;
}
return pal == cx;
}
int main() {
cin >> n;
ll ans = 0;
for (int i = 1; i <= n; i++) {
int x;
cin >> x;
ans += x * epal(x);
}
cout << ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
5 ms |
308 KB |
Output is correct |
3 |
Correct |
207 ms |
5124 KB |
Output is correct |
4 |
Correct |
316 ms |
7444 KB |
Output is correct |
5 |
Correct |
397 ms |
10064 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
312 KB |
Output is correct |
3 |
Correct |
81 ms |
1672 KB |
Output is correct |
4 |
Correct |
169 ms |
3080 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
312 KB |
Output is correct |
3 |
Correct |
81 ms |
1672 KB |
Output is correct |
4 |
Correct |
169 ms |
3080 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
4 ms |
376 KB |
Output is correct |
7 |
Correct |
155 ms |
3212 KB |
Output is correct |
8 |
Correct |
197 ms |
4092 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
5 ms |
308 KB |
Output is correct |
3 |
Correct |
207 ms |
5124 KB |
Output is correct |
4 |
Correct |
316 ms |
7444 KB |
Output is correct |
5 |
Correct |
397 ms |
10064 KB |
Output is correct |
6 |
Correct |
1 ms |
340 KB |
Output is correct |
7 |
Correct |
2 ms |
312 KB |
Output is correct |
8 |
Correct |
81 ms |
1672 KB |
Output is correct |
9 |
Correct |
169 ms |
3080 KB |
Output is correct |
10 |
Correct |
0 ms |
212 KB |
Output is correct |
11 |
Correct |
4 ms |
376 KB |
Output is correct |
12 |
Correct |
155 ms |
3212 KB |
Output is correct |
13 |
Correct |
197 ms |
4092 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
13 ms |
532 KB |
Output is correct |
16 |
Correct |
158 ms |
4104 KB |
Output is correct |
17 |
Correct |
354 ms |
8972 KB |
Output is correct |
18 |
Correct |
391 ms |
9876 KB |
Output is correct |
19 |
Correct |
389 ms |
9888 KB |
Output is correct |
20 |
Correct |
384 ms |
10004 KB |
Output is correct |