답안 #105575

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
105575 2019-04-13T17:32:15 Z pamaj 수열 (BOI14_sequence) C++17
0 / 100
1000 ms 11392 KB
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 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; 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 20 ms 11136 KB Output is correct
2 Correct 20 ms 11136 KB Output is correct
3 Correct 20 ms 11136 KB Output is correct
4 Correct 25 ms 11128 KB Output is correct
5 Correct 21 ms 11136 KB Output is correct
6 Incorrect 22 ms 11136 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 11128 KB Output is correct
2 Correct 24 ms 11164 KB Output is correct
3 Correct 22 ms 11128 KB Output is correct
4 Correct 23 ms 11136 KB Output is correct
5 Correct 23 ms 11128 KB Output is correct
6 Incorrect 24 ms 11136 KB Output isn't correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 22 ms 11128 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 11136 KB Output is correct
2 Correct 26 ms 11128 KB Output is correct
3 Correct 20 ms 11136 KB Output is correct
4 Correct 22 ms 11256 KB Output is correct
5 Execution timed out 1064 ms 11392 KB Time limit exceeded
6 Halted 0 ms 0 KB -