#pragma GCC optimize("O2,O3,Ofast,unroll-loops")
#pragma GCC target("sse,sse2,sse3,sse4,sse4.1,sse4.2,popcnt,lzcnt,abm,mmx,avx,avx2,fma,bmi,bmi2")
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
using namespace std;
int main(){
fast;
ll n,m,s=0;
cin>>n>>m;
string a,b;
a=to_string(n);
b=to_string(m);
vector<ll>v;
for(ll j=n;j<m;j++){
string c=to_string(j);
c+='&';
c+='&';
for(ll i=0;i<c.size()-2;i++){
if(c[i]==c[i+1] or c[i]==c[i+2]){
s++;
// cout<<s<<' ';
break;
}
}
}
cout<<m-n-s+1;
}
Compilation message
numbers.cpp: In function 'int main()':
numbers.cpp:20:21: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
20 | for(ll i=0;i<c.size()-2;i++){
| ~^~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Incorrect |
8 ms |
460 KB |
Output isn't correct |
4 |
Incorrect |
3 ms |
336 KB |
Output isn't correct |
5 |
Correct |
1 ms |
460 KB |
Output is correct |
6 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
8 |
Correct |
1 ms |
336 KB |
Output is correct |
9 |
Correct |
1 ms |
504 KB |
Output is correct |
10 |
Correct |
1 ms |
508 KB |
Output is correct |
11 |
Correct |
1 ms |
336 KB |
Output is correct |
12 |
Correct |
1 ms |
336 KB |
Output is correct |
13 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
14 |
Incorrect |
4 ms |
336 KB |
Output isn't correct |
15 |
Incorrect |
3 ms |
512 KB |
Output isn't correct |
16 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
17 |
Incorrect |
2 ms |
336 KB |
Output isn't correct |
18 |
Correct |
1 ms |
504 KB |
Output is correct |
19 |
Incorrect |
9 ms |
336 KB |
Output isn't correct |
20 |
Incorrect |
3 ms |
336 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
150 ms |
336 KB |
Output isn't correct |
2 |
Execution timed out |
1061 ms |
336 KB |
Time limit exceeded |
3 |
Execution timed out |
1087 ms |
336 KB |
Time limit exceeded |
4 |
Execution timed out |
1072 ms |
336 KB |
Time limit exceeded |
5 |
Execution timed out |
1079 ms |
336 KB |
Time limit exceeded |
6 |
Execution timed out |
1054 ms |
336 KB |
Time limit exceeded |
7 |
Incorrect |
85 ms |
336 KB |
Output isn't correct |
8 |
Correct |
61 ms |
336 KB |
Output is correct |
9 |
Incorrect |
144 ms |
440 KB |
Output isn't correct |
10 |
Correct |
176 ms |
336 KB |
Output is correct |
11 |
Incorrect |
178 ms |
336 KB |
Output isn't correct |
12 |
Incorrect |
986 ms |
444 KB |
Output isn't correct |
13 |
Incorrect |
244 ms |
336 KB |
Output isn't correct |
14 |
Execution timed out |
1093 ms |
336 KB |
Time limit exceeded |
15 |
Execution timed out |
1067 ms |
512 KB |
Time limit exceeded |
16 |
Execution timed out |
1076 ms |
336 KB |
Time limit exceeded |
17 |
Execution timed out |
1042 ms |
336 KB |
Time limit exceeded |
18 |
Execution timed out |
1052 ms |
336 KB |
Time limit exceeded |
19 |
Execution timed out |
1043 ms |
336 KB |
Time limit exceeded |
20 |
Execution timed out |
1061 ms |
336 KB |
Time limit exceeded |
21 |
Execution timed out |
1064 ms |
336 KB |
Time limit exceeded |
22 |
Execution timed out |
1016 ms |
336 KB |
Time limit exceeded |
23 |
Execution timed out |
1065 ms |
336 KB |
Time limit exceeded |
24 |
Execution timed out |
1047 ms |
336 KB |
Time limit exceeded |
25 |
Execution timed out |
1048 ms |
336 KB |
Time limit exceeded |
26 |
Execution timed out |
1068 ms |
336 KB |
Time limit exceeded |
27 |
Execution timed out |
1056 ms |
336 KB |
Time limit exceeded |
28 |
Execution timed out |
1045 ms |
336 KB |
Time limit exceeded |
29 |
Execution timed out |
1075 ms |
336 KB |
Time limit exceeded |
30 |
Execution timed out |
1057 ms |
336 KB |
Time limit exceeded |
31 |
Execution timed out |
1070 ms |
336 KB |
Time limit exceeded |
32 |
Execution timed out |
1060 ms |
336 KB |
Time limit exceeded |
33 |
Execution timed out |
1054 ms |
336 KB |
Time limit exceeded |
34 |
Execution timed out |
1052 ms |
336 KB |
Time limit exceeded |
35 |
Execution timed out |
1046 ms |
336 KB |
Time limit exceeded |
36 |
Execution timed out |
1041 ms |
336 KB |
Time limit exceeded |
37 |
Execution timed out |
1042 ms |
336 KB |
Time limit exceeded |
38 |
Execution timed out |
1041 ms |
336 KB |
Time limit exceeded |
39 |
Execution timed out |
1073 ms |
336 KB |
Time limit exceeded |
40 |
Execution timed out |
1067 ms |
336 KB |
Time limit exceeded |
41 |
Execution timed out |
1037 ms |
336 KB |
Time limit exceeded |
42 |
Execution timed out |
1080 ms |
336 KB |
Time limit exceeded |
43 |
Execution timed out |
1077 ms |
336 KB |
Time limit exceeded |
44 |
Execution timed out |
1046 ms |
336 KB |
Time limit exceeded |
45 |
Execution timed out |
1045 ms |
336 KB |
Time limit exceeded |