Submission #421849

# Submission time Handle Problem Language Result Execution time Memory
421849 2021-06-09T12:59:02 Z Drew_ Sequence (BOI14_sequence) C++17
0 / 100
1 ms 224 KB
#include <iostream>
using namespace std;

const int MAX = 1069;

int n;
int ar[MAX];
int pwr[6] = {1, 10, 100, 1000, 10000, 100000};

inline bool yes(int num)
{
	for (int i = 0; i < n; ++i)
	{
		bool ok = false;
		int tmp = num + i;

		while (tmp)
		{
			if (tmp % 10 == ar[i]) { ok = true; break; }
			tmp /= 10;
		}

		if (!ok)
			return false;
	}
	return true;
}

int main()
{
	ios :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	cin >> n;
	for (int i = 0; i < n; ++i)
		cin >> ar[i];

	int id = -1;
	for (int i = 0; i < 6; ++i)
	{
		if (pwr[i] >= n)
		{
			id = i;
			break;
		}
	}
	cout << ar[0];
	for (int i = 0; i < id; ++i)
		cout << 0;
	cout << '\n';
	return 0;

	for (int i = 1;; ++i)
	{
		if (yes(i))
		{
			cout << i << '\n';
			break;
		}
	}


	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 224 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -