# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1130163 | matthew | Palindromes (info1cup18_palindromes) | C++20 | 112 ms | 400 KiB |
#include <stdio.h>
using ll = long long;
int ogl(int num) {
int ret = 0;
while(num > 0) {
ret = ret * 10 + num % 10;
num /= 10;
}
return ret;
}
bool is_palindrome(int num) {
return ogl(num) == num;
}
int main() {
int n;
scanf("%d", &n);
ll sum = 0;
for(int i = 0; i < n; i++) {
int num;
scanf("%d", &num);
sum += is_palindrome(num) * num;
}
printf("%lld\n", sum);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |