Submission #685454

#TimeUsernameProblemLanguageResultExecution timeMemory
685454TomitaMateiPalindromes (info1cup18_palindromes)C++14
100 / 100
409 ms9904 KiB
#include <iostream> using namespace std; int palindrom (int x) { int p=1,nr=0; if (x%10==0) return 0; while (x>=p) { p=p*10; nr=nr*10+x%10; if (nr==x) return 1; x=x/10; } if (x==nr) return 1; return 0; } int n,i; int unsigned long long s,a; int main() { cin>>n; for (i=1; i<=n; i++) { cin>>a; if (palindrom(a)) s=s+a; } cout<<s; 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...