Submission #1091049

#TimeUsernameProblemLanguageResultExecution timeMemory
1091049dpsaveslivesPalindromic FizzBuzz (NOI19_palindrome)C++17
100 / 100
18 ms1884 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll a,b; cin >> a >> b; ll cur = a; while(cur <= b){ int dig = 1; ll exp = 10; for(int i = 1;i<=18;++i){ if(cur >= exp){ ++dig; exp *= 10; } else{ break; } } vector<int> digs; ll ot = cur; for(int i = 0;i<dig;++i){ digs.push_back(ot%10); ot /= 10; } bool pal = true; for(int i = 0;i<dig;++i){ if(digs[i] != digs[dig-i-1]){ pal = false; break; } } if(pal){ cout << "Palindrome!\n"; } else{ cout << cur << "\n"; } ++cur; } 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...