# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
931081 | hugsfromadicto | Palindromes (info1cup18_palindromes) | C++14 | 216 ms | 17820 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.
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int mxN = 1e6+1;
int a[mxN];
bool isp(int n)
{
vector<int>v;
while(n)
{
v.push_back(n%10);
n/=10;
}
for(int i = 0; i < v.size(); ++i)
{
if(v[i] != v[v.size() - i - 1])
{
return false;
}
}
return true;
}
void _()
{
int n,sum = 0;
cin >> n;
for(int i = 0; i < n; ++i)
{
cin >> a[i];
if(isp(a[i]))
sum += a[i];
}
cout << sum;
}
main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int tc = 1;
//cin>>tc;
while(tc--)
{
_();
}
}
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... |