#include <bits/stdc++.h>
#define int long long
using namespace std;
int ans = 0;
int f(int x){
string s = to_string(x), t; t = s; reverse(t.begin(), t.end());
return (s == t) * x;
}
int32_t main(){
int n; cin >> n;
for(int i = 0; i < n; i++){
int x; cin >> x; ans += f(x);
}
cout << ans << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
5 ms |
340 KB |
Output is correct |
3 |
Correct |
191 ms |
5012 KB |
Output is correct |
4 |
Correct |
289 ms |
7432 KB |
Output is correct |
5 |
Correct |
379 ms |
9992 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
212 KB |
Output is correct |
3 |
Correct |
90 ms |
1680 KB |
Output is correct |
4 |
Correct |
181 ms |
3092 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
212 KB |
Output is correct |
3 |
Correct |
90 ms |
1680 KB |
Output is correct |
4 |
Correct |
181 ms |
3092 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
5 ms |
316 KB |
Output is correct |
7 |
Correct |
182 ms |
3208 KB |
Output is correct |
8 |
Correct |
216 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 |
340 KB |
Output is correct |
3 |
Correct |
191 ms |
5012 KB |
Output is correct |
4 |
Correct |
289 ms |
7432 KB |
Output is correct |
5 |
Correct |
379 ms |
9992 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
2 ms |
212 KB |
Output is correct |
8 |
Correct |
90 ms |
1680 KB |
Output is correct |
9 |
Correct |
181 ms |
3092 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
5 ms |
316 KB |
Output is correct |
12 |
Correct |
182 ms |
3208 KB |
Output is correct |
13 |
Correct |
216 ms |
4092 KB |
Output is correct |
14 |
Correct |
0 ms |
212 KB |
Output is correct |
15 |
Correct |
14 ms |
468 KB |
Output is correct |
16 |
Correct |
162 ms |
4104 KB |
Output is correct |
17 |
Correct |
344 ms |
8964 KB |
Output is correct |
18 |
Correct |
385 ms |
9876 KB |
Output is correct |
19 |
Correct |
388 ms |
9880 KB |
Output is correct |
20 |
Correct |
385 ms |
9876 KB |
Output is correct |