제출 #1191085

#제출 시각아이디문제언어결과실행 시간메모리
1191085zyntherixPalindromic FizzBuzz (NOI19_palindrome)C++20
100 / 100
15 ms1864 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pi pair<int, int> #define vi vector<int> #define vs vector<string> #define vb vector<bool> #define vpi vector<pi> #define pb push_back #define all(a) (a).begin(), (a).end() const int mod = 1e9 + 7; bool p(int x) { vi v; while (x > 0) { v.pb(x % 10); x /= 10; } int i = 0; int j = v.size() - 1; while (i < j) { if (v[i] != v[j]) { return false; } i++; j--; } return true; } void solve() { int i, j; cin >> i >> j; for (int k = i; k <= j; k++) { if (p(k)) { cout << "Palindrome!\n"; } else { cout << k << '\n'; } } } signed main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int t = 1; // cin >> t; while (t--) { solve(); } 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...