Submission #689772

#TimeUsernameProblemLanguageResultExecution timeMemory
689772zeroesandonesPalindromic FizzBuzz (NOI19_palindrome)C++17
100 / 100
14 ms1876 KiB
#include "bits/stdc++.h" using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; typedef pair<ll, ll> pi; #define FOR(i, j, k) for (ll i = j; i < (ll) k; ++i) #define FORD(i, j, k) for (ll i = j; i >= (ll) k; --i) #define nl "\n" #define sp " " #define all(x) (x).begin(), (x).end() #define sc second #define fr first #define pb emplace_back bool pali(ll x) { string s = to_string(x); ll n = s.size(); ll l = 0, r = n -1; while(l < r) { if(s[l] == s[r]) { ++l, --r; } else { return false; } } return true; } void solve() { ll s, e; cin >> s >> e; FOR(i, s, e + 1) { cout << (pali(i) ? "Palindrome!" : to_string(i)) << nl; } } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll t = 1; // cin >> t; while (t--) { solve(); } }
#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...