# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
398968 | almothana05 | 수열 (BOI14_sequence) | C++14 | 18 ms | 14668 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<vector>
#include<set>
#include<algorithm>
using namespace std;
vector<vector<int> >re(100000 , vector<int>(10 , 0));
vector<int>num;
int main(){
int menge , numm , nummer = 0 , erg = 100000;
re[0][0] = 1;
for(int i = 1 ; i < 100000 ;i++){
numm = i;
while(numm > 0){
re[i][numm % 10]++;
if(numm == 0){
break;
}
numm/=10;
}
}
cin >> menge;
for(int i = 0 ; i < menge ; i++){
cin >> numm ;
num.push_back(numm);
}
for(int i = 0 ; i < 100000 ; i++){
bool ok = 1;
for(int j = i , k = 0 ; k < menge ; k++ , j++){
if(re[j][num[k]] == 0){
ok = 0;
break;
}
}
if(ok == 1){
erg = i;
break;
}
}
for(int i = 0 ; i < 100000 ; i++){
bool ok = 1;
for(int j = i , k = menge - 1 ; k >= 0 ; k-- , j++){
if(re[j][num[k]] == 0){
ok = 0;
break;
}
}
if(ok == 1){
int cpm = i + menge - 1;
erg = min(erg , cpm);
break;
}
}
cout << erg;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |