Submission #363873

#TimeUsernameProblemLanguageResultExecution timeMemory
363873ogibogi2004Palindromes (info1cup18_palindromes)C++14
100 / 100
526 ms9984 KiB
#include<bits/stdc++.h> using namespace std; bool checkpal(int x) { string s=""; while(x) { s+=char(x%10);x/=10; } int i=0,j=s.size()-1; while(i<j) { if(s[i]!=s[j])return 0; i++;j--; } return 1; } int n; long long ans; int main() { cin>>n; for(int i=0;i<n;i++) { int k; cin>>k; if(checkpal(k)) { ans+=k; } } cout<<ans<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...