제출 #1120807

#제출 시각아이디문제언어결과실행 시간메모리
1120807vjudge1Palindrome-Free Numbers (BOI13_numbers)C++14
38.33 / 100
1073 ms504 KiB
#include"bits/stdc++.h"
using namespace std;

using ll = long long;

main() {
    ll A, B;
    cin >> A >> B;

    ll ans = 0;
    for (ll i = A; i <= B; i ++) {
        string S = to_string(i);
        int n = S.size();
        if (2 <= n && S[1] == S[0]) {
            continue;
        }
        int f = 1;
        for (int j = 2; j < n; j ++) {
            if (S[j] == S[j - 1] || S[j] == S[j - 2]) {
                f = 0;
                break;
            }
        }
        if (f) {
            ans ++;
        }
    }

    cout << ans << endl;
}

컴파일 시 표준 에러 (stderr) 메시지

numbers.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main() {
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...