# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
882828 | NintsiChkhaidze | Palindromes (info1cup18_palindromes) | C++17 | 255 ms | 14156 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>
#define s second
#define f first
#define ll long long
#define pb push_back
#define pii pair <int,int>
using namespace std;
const int N = 1e6 + 5,mod = 1e9 + 7;
ll ans;
int a[N];
signed main (){
ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
int n;
cin>>n;
for (int i = 1; i <= n; i++){
cin >> a[i];
int old = a[i];
vector <int> vec;
while (a[i] > 0){
vec.pb(a[i] % 10);
a[i] /= 10;
}
int ch=1,len = vec.size();
for (int j =0;j < vec.size()/2;j++){
if (vec[j] != vec[len - 1 - j]) ch=0;
}
if (ch) ans += old;
}
cout<<ans;
}
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... |