Submission #573121

#TimeUsernameProblemLanguageResultExecution timeMemory
573121DevigoPalindromic FizzBuzz (NOI19_palindrome)C++14
100 / 100
14 ms1860 KiB
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair const int siz = 0; const int mod = 0; bool pal(long long i) { string s = to_string(i); int j = 0; int k = s.length()-1; while(j<k) { if(s[j] != s[k]) return false; j++; k--; } return true; } int main() { ios::sync_with_stdio(0); cin.tie(0); long long s, e; cin >> s >> e; for(long long i=s; i<=e; i++) { if(pal(i)) { cout << "Palindrome!\n"; } else { cout << i << "\n"; } } 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...