# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
915804 | andrei_iorgulescu | Palindromes (info1cup18_palindromes) | C++14 | 470 ms | 10068 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
bool palin(int x)
{
vector<int>dig;
while (x != 0)
{
dig.push_back(x % 10);
x /= 10;
}
for (int i = 0; i < dig.size(); i++)
if (dig[i] != dig[dig.size() - 1 - i])
return false;
return true;
}
signed main()
{
int n,sm = 0;
cin >> n;
for (int i = 1; i <= n; i++)
{
int x;
cin >> x;
if (palin(x) == true)
sm += x;
}
cout << sm;
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... |