답안 #105637

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
105637 2019-04-13T18:51:55 Z pamaj 수열 (BOI14_sequence) C++14
0 / 100
1000 ms 108252 KB
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e7 + 10, maxm = 1e5 + 10;

bool num[maxn][11];
int n, v[maxm];

int main()
{
	ios::sync_with_stdio(false), cin.tie(nullptr);

	num[0][0] = true;

	for(int i = 1; i < maxn; i++)
	{
		int p = i;
		while(p)
		{
			num[i][p%10] = true;
			p /= 10;
		}
	}

	cin >> n;



	for(int i = 0; i < n; i++)
	{
		cin >> v[i];
	}

	for(int i = 0; i < maxn - n - 1; i++)
	{
		bool ok = true;
		for(int j = 0; j < n; j++)
		{
			if(!num[i + j][v[j]]) ok = false;
		}

		if(ok)
		{
			cout << i << "\n";
			return 0;
		}
	}

}
# 결과 실행 시간 메모리 Grader output
1 Correct 212 ms 107924 KB Output is correct
2 Correct 210 ms 107932 KB Output is correct
3 Correct 208 ms 107956 KB Output is correct
4 Correct 204 ms 107896 KB Output is correct
5 Correct 227 ms 108076 KB Output is correct
6 Incorrect 221 ms 107896 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 199 ms 108016 KB Output is correct
2 Correct 208 ms 107920 KB Output is correct
3 Correct 214 ms 107896 KB Output is correct
4 Correct 204 ms 108032 KB Output is correct
5 Correct 215 ms 108004 KB Output is correct
6 Incorrect 215 ms 108024 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 225 ms 108020 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 222 ms 107996 KB Output is correct
2 Correct 211 ms 108024 KB Output is correct
3 Correct 229 ms 108028 KB Output is correct
4 Correct 220 ms 107948 KB Output is correct
5 Execution timed out 1077 ms 108252 KB Time limit exceeded
6 Halted 0 ms 0 KB -