# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
121647 | sams | Palindrome-Free Numbers (BOI13_numbers) | C++14 | 1091 ms | 396 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
ll a, b;
//string a, b;
int check(ll a)
{
int v[20];
int t = 0;
int r = 0;
while(a > 0)
{
ll c = a%10;
t++;
v[t] = c;
a -= c;
a /= 10;
}
for(int i = 2 ; i < t; ++i)
{
//cout << v[i] << " \n"[i == t];
if(v[i-1] == v[i+1]) r = 1;
else if(v[i-1] == v[i] || v[i] == v[i+1]) r = 1;
}
return r;
}
int main()
{
int resp = 0;
cin >> a >> b;
ll c = a;
while(a <= b)
{
//cout << a << '\n';
int x = check(a);
//if(x == 1) cout << a << '\n';
resp += check(a);
a++;
}
cout << b - c - resp + 1<< '\n';
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |