Submission #691709

#TimeUsernameProblemLanguageResultExecution timeMemory
691709MateiKing80Palindromes (info1cup18_palindromes)C++14
50 / 100
191 ms4096 KiB
#include <iostream> using namespace std; int v[15]; bool pal(int a) { while(a>0) { v[++v[0]]=a%10; a/=10; } for(int i=1;i<=v[0];i++) if(v[i]!=v[v[0]-i+1]) return false; return true; } int main() { int n,a,sum=0; cin>>n; for(int i=0;i<n;i++) { cin>>a; if(pal(a)) sum+=a; v[0]=0; } cout<<sum; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...