Submission #105644

# Submission time Handle Problem Language Result Execution time Memory
105644 2019-04-13T18:57:56 Z pamaj Sequence (BOI14_sequence) C++14
9 / 100
1000 ms 1536 KB
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 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 = 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;
		}
	}

}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1408 KB Output is correct
2 Correct 5 ms 1408 KB Output is correct
3 Correct 4 ms 1408 KB Output is correct
4 Correct 5 ms 1408 KB Output is correct
5 Correct 5 ms 1408 KB Output is correct
6 Correct 4 ms 1408 KB Output is correct
7 Correct 4 ms 1408 KB Output is correct
8 Correct 5 ms 1408 KB Output is correct
9 Correct 3 ms 1408 KB Output is correct
10 Correct 3 ms 1408 KB Output is correct
11 Correct 4 ms 1408 KB Output is correct
12 Correct 4 ms 1408 KB Output is correct
13 Correct 5 ms 1408 KB Output is correct
14 Correct 7 ms 1408 KB Output is correct
15 Correct 5 ms 1408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1408 KB Output is correct
2 Correct 4 ms 1408 KB Output is correct
3 Correct 3 ms 1408 KB Output is correct
4 Correct 4 ms 1408 KB Output is correct
5 Correct 4 ms 1408 KB Output is correct
6 Correct 4 ms 1408 KB Output is correct
7 Correct 15 ms 1536 KB Output is correct
8 Correct 4 ms 1408 KB Output is correct
9 Correct 7 ms 1408 KB Output is correct
10 Correct 5 ms 1408 KB Output is correct
11 Incorrect 128 ms 1408 KB Output isn't correct
12 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 1408 KB Output is correct
2 Execution timed out 1057 ms 1408 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1408 KB Output is correct
2 Correct 4 ms 1408 KB Output is correct
3 Correct 3 ms 1408 KB Output is correct
4 Correct 3 ms 1408 KB Output is correct
5 Execution timed out 1091 ms 1536 KB Time limit exceeded
6 Halted 0 ms 0 KB -