# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
401220 | victoriad | Palindromes (info1cup18_palindromes) | C++14 | 277 ms | 9924 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 <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <queue>
#include <map>
#include <iomanip>
#include <stack>
#include <fstream>
#include <assert.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int n,a;
string s;
bool p=true;
cin>>n;
long long int x=0;
for(int i=0;i<n;i++){
cin>>a;
p=true;
s=to_string(a);
for(int k=0;k<s.size()/2+1;k++){
if(s[k]!=s[s.size()-1-k]){
p=false;
break;
}
}
if(p)x+=a;
}
cout<<x;
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... |