이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |