# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1120197 | vjudge1 | Palindrome-Free Numbers (BOI13_numbers) | C++17 | 1090 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define SPEED \
ios_base::sync_with_stdio(0); \
cin.tie(NULL); \
cout.tie(NULL);
#define pb push_back
#define endl "\n"
#define ALL(x) x.begin(), x.end()
#define intt long long
const intt mxN = 2e5 + 5;
void solve() {
intt a, b;
cin >> a >> b;
intt ans = 0;
for(intt cur = a; cur <= b; cur++) {
string s = to_string(cur);
bool ok = true;
for(intt i = 0; i < s.size(); i++) {
for(intt j = i + 1; j < s.size(); j++) {
string t = "";
for(intt k = i; k <= j; k++) t += s[k];
string c = t;
reverse(ALL(c));
if(c == t) {
ok = false;
break;
}
}
if(!ok) break;
}
ans += ok;
}
cout << ans << endl;
}
int main(){
SPEED;
int tst = 1, i = 1;
// cin >> tst;
while(tst--) {
solve();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |