# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
107589 | patrikpavic2 | 수열 (BOI14_sequence) | C++17 | 12 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#include <map>
#define X first
#define Y second
#define PB push_back
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
typedef vector < int > vi;
typedef set < int > si;
const int N = 1e5 + 500;
const int M = 1e6 + 500;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int OFF = (1 << 18);
const int LOG = 20;
const double EPS = 1e-9;
const double PI = 3.1415926535;
int n, x, a[N];
bool inside(int i,int k){
for(;k;k /= 10)
if(k % 10 == i) return 1;
return 0;
}
int main(){
scanf("%d", &n);
if(n <= 1000){
for(int i = 0;i < n;i++) scanf("%d", a + i);
for(int st = 1;st <= 1000;st++){
int bad = 0;
for(int i = 0;i < n;i++){
if(!inside(a[i], st + i)) bad = 1;
}
if(!bad){
printf("%d\n", st);
return 0;
}
}
return 0;
}
scanf("%d", &x);
if(x == 0){
int pot = 1;
while(pot - (pot / 10 * 9) - 1 < n){
pot = 10 * pot + 1;
}
printf("%d\n", (pot / 10 * 9) + 1);
return 0;
}
if(x == 9){
int pot = 1, pot2 = 1;
while(pot2 - (pot / 10 * 8) - 1 < n){
pot = 10 * pot + 1;
pot2 = 10 * pot2;
}
printf("%d\n", (pot / 10 * 8) + 1);
return 0;
}
printf("%d", x);
for(int i = 1;i < n;i *= 10) printf("0");
printf("\n");
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... |