Submission #685452

#TimeUsernameProblemLanguageResultExecution timeMemory
685452TomitaMateiPalindromes (info1cup18_palindromes)C++14
35 / 100
413 ms9804 KiB
#include <iostream> using namespace std; int palindrom (int x) { int p=1,nr=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...