답안 #105647

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

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

int32_t 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 = 1; i < maxn - n - 1; i++)
	{
		bool ok = true;
		for(int j = 0; j < n; j++)
		{
			if(num[i + j][v[j]] == false) ok = false;
		}

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

}
# 결과 실행 시간 메모리 Grader output
1 Correct 193 ms 108024 KB Output is correct
2 Correct 188 ms 108104 KB Output is correct
3 Correct 196 ms 107896 KB Output is correct
4 Correct 182 ms 108024 KB Output is correct
5 Correct 194 ms 107896 KB Output is correct
6 Correct 192 ms 108076 KB Output is correct
7 Correct 189 ms 107896 KB Output is correct
8 Correct 202 ms 107896 KB Output is correct
9 Correct 207 ms 108024 KB Output is correct
10 Correct 174 ms 108000 KB Output is correct
11 Correct 172 ms 107936 KB Output is correct
12 Correct 199 ms 108008 KB Output is correct
13 Correct 187 ms 108084 KB Output is correct
14 Correct 176 ms 108004 KB Output is correct
15 Correct 172 ms 107896 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 181 ms 107968 KB Output is correct
2 Correct 189 ms 108092 KB Output is correct
3 Correct 186 ms 107924 KB Output is correct
4 Correct 185 ms 107940 KB Output is correct
5 Correct 212 ms 108048 KB Output is correct
6 Correct 236 ms 107972 KB Output is correct
7 Correct 197 ms 107992 KB Output is correct
8 Correct 191 ms 108084 KB Output is correct
9 Correct 225 ms 108004 KB Output is correct
10 Correct 195 ms 107896 KB Output is correct
11 Execution timed out 1076 ms 108028 KB Time limit exceeded
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 187 ms 108020 KB Output is correct
2 Execution timed out 1068 ms 108152 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 193 ms 108024 KB Output is correct
2 Correct 187 ms 108124 KB Output is correct
3 Correct 177 ms 107972 KB Output is correct
4 Correct 225 ms 107976 KB Output is correct
5 Execution timed out 1090 ms 108252 KB Time limit exceeded
6 Halted 0 ms 0 KB -