Submission #1120768

#TimeUsernameProblemLanguageResultExecution timeMemory
1120768vjudge1Palindrome-Free Numbers (BOI13_numbers)C++14
55.83 / 100
1099 ms508 KiB
#include"bits/stdc++.h" using namespace std; main() { int A, B; cin >> A >> B; int ans = 0; for (int 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; }

Compilation message (stderr)

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