제출 #1295145

#제출 시각아이디문제언어결과실행 시간메모리
1295145ako_aqsinPalindrome-Free Numbers (BOI13_numbers)C++20
25 / 100
1098 ms648 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define double long double #define f first #define s second #define pb push_back #define yes cout << "yes" << endl; #define YES cout << "YES" << endl; #define no cout << "no" << endl; #define NO cout << "NO" << endl; bool ispal(string s){ string h = s; reverse(h.begin(), h.end()); bool ko = true; for(int i = 0; i < s.size(); i++){ if(s[i] != h[i]){ ko = false; break; } } return ko; } void never_give_up() { int n; //cin >> n; int a, b, c = 0, d = 0; cin >> a >> b; for(int k = a; k <= b; k++){ string s = to_string(k); bool ok = true; n = s.size(); for(int i = 0; i < n; i++){ if(ok){ for(int j = i + 1; j < n; j++){ if(ok){ string f = ""; for(int ha = i; ha <= j; ha++){ f = f + s[ha]; } if(ispal(f) && i != j){ ok = false; } } else{ break; } } } else{ break; } } if(ok){ c++; //cout << s << endl; } } cout << c << endl; } void You_can_do_it() { } signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int THE_wasd = 1; //cin >> THE_wasd; while(THE_wasd--){ never_give_up(); //You_can_do_it(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...