| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1294505 | Johan | Palindrome-Free Numbers (BOI13_numbers) | C++20 | 1096 ms | 580 KiB |
#include<bits/stdc++.h>
using namespace std;
bool pol(string s){
for(int i = 0; i < s.size(); i++){
if(s[i] != s[s.size() - i - 1])
return false;
}
return true;
}
bool ok(int x){
string s = to_string(x);
int n = s.size();
for(int i = 0; i < n; i++){
string sn = "";
sn += s[i];
for(int j = i + 1; j < n; j++){
sn += s[j];
if(pol(sn) == true){
return false;
}
}
}
return true;
}
int main(){
long long a, b, ans = 0;
cin >> a >> b;
for(int i = a; i <= b; i++){
ans += ok(i);
}
cout << ans << endl;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
