답안 #938199

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
938199 2024-03-05T02:31:27 Z ezzzay Palindrome-Free Numbers (BOI13_numbers) C++14
43.3333 / 100
1000 ms 548 KB
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
bool check(string s){
    for(int i=0;i<s.size()-1;i++){
        if(s[i]==s[i+1]){
            return 0;
        }
    }
    for(int i=0;i<s.size()-2;i++){
        if(s[i]==s[i+2]){
            return 0;
        }
    }
    return 1;
}
int main(){
    int a,b;
    cin>>a>>b;
    int t=0;
    for(int i=a;i<=b;i++){
        if(check(to_string(i))){
            t++;
        }
    }
    cout<<t;
}

Compilation message

numbers.cpp: In function 'bool check(std::string)':
numbers.cpp:6:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 |     for(int i=0;i<s.size()-1;i++){
      |                 ~^~~~~~~~~~~
numbers.cpp:11:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i=0;i<s.size()-2;i++){
      |                 ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Incorrect 3 ms 348 KB Output isn't correct
5 Incorrect 0 ms 348 KB Output isn't correct
6 Incorrect 0 ms 344 KB Output isn't correct
7 Incorrect 0 ms 348 KB Output isn't correct
8 Incorrect 1 ms 348 KB Output isn't correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 1 ms 436 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Incorrect 2 ms 348 KB Output isn't correct
15 Incorrect 2 ms 348 KB Output isn't correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 1 ms 348 KB Output is correct
18 Incorrect 1 ms 348 KB Output isn't correct
19 Incorrect 0 ms 348 KB Output isn't correct
20 Correct 3 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 141 ms 412 KB Output is correct
2 Incorrect 0 ms 344 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Incorrect 0 ms 344 KB Output isn't correct
5 Execution timed out 1068 ms 348 KB Time limit exceeded
6 Execution timed out 1026 ms 548 KB Time limit exceeded
7 Correct 63 ms 344 KB Output is correct
8 Correct 48 ms 344 KB Output is correct
9 Correct 94 ms 412 KB Output is correct
10 Correct 110 ms 412 KB Output is correct
11 Correct 140 ms 412 KB Output is correct
12 Correct 828 ms 412 KB Output is correct
13 Correct 165 ms 344 KB Output is correct
14 Execution timed out 1006 ms 344 KB Time limit exceeded
15 Execution timed out 1038 ms 344 KB Time limit exceeded
16 Incorrect 0 ms 344 KB Output isn't correct
17 Correct 1 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Incorrect 0 ms 348 KB Output isn't correct
22 Correct 1 ms 348 KB Output is correct
23 Incorrect 1 ms 348 KB Output isn't correct
24 Correct 1 ms 436 KB Output is correct
25 Incorrect 0 ms 348 KB Output isn't correct
26 Incorrect 0 ms 348 KB Output isn't correct
27 Incorrect 0 ms 348 KB Output isn't correct
28 Incorrect 0 ms 348 KB Output isn't correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 0 ms 348 KB Output is correct
31 Incorrect 1 ms 348 KB Output isn't correct
32 Correct 1 ms 348 KB Output is correct
33 Incorrect 1 ms 344 KB Output isn't correct
34 Correct 0 ms 348 KB Output is correct
35 Incorrect 1 ms 348 KB Output isn't correct
36 Incorrect 1 ms 348 KB Output isn't correct
37 Incorrect 0 ms 348 KB Output isn't correct
38 Incorrect 0 ms 348 KB Output isn't correct
39 Incorrect 0 ms 348 KB Output isn't correct
40 Correct 0 ms 436 KB Output is correct
41 Incorrect 0 ms 348 KB Output isn't correct
42 Correct 1 ms 344 KB Output is correct
43 Incorrect 0 ms 348 KB Output isn't correct
44 Incorrect 0 ms 348 KB Output isn't correct
45 Incorrect 0 ms 348 KB Output isn't correct