# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1120217 | vjudge1 | Palindrome-Free Numbers (BOI13_numbers) | C++17 | 1084 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld double
const int INF = 1e18;
const int mod = 12345;
const int sz = 1e5 + 5;
bool pal(string z)
{
string s = z;
reverse(s.begin() , s.end());
return z == s;
}
bool f(int x)
{
string s;
s = to_string(x);
for(int i = 0;i < s.size() - 1;i++)
{
string c = "";
c += s[i];
for(int j = i + 1;j < s.size();j++)
{
c += s[j];
if(c[0] == c[c.size() - 1] && c[1] == c[c.size() - 2]){
if(pal(c)) return false;
}
}
}
return true;
}
signed main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
int a , b;
cin >> a >> b;
int ans = 0;
for(int i = a;i <= b;i++)
{
if(f(i))
{
ans++;
}
}
cout << ans << endl;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |