Submission #38574

# Submission time Handle Problem Language Result Execution time Memory
38574 2018-01-04T13:37:03 Z Waschbar Sequence (BOI14_sequence) C++14
0 / 100
0 ms 2016 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
	
	int k, K, x, ans;
	cin >> k;
	for(int i = 1; i <= k; i++)
	cin >> x;
	K = k;
	if(k == 1){
		cout << x; return 0;
	}
	ans = 1;
	while(k > 0){
		k /= 10;
		ans *= 10;
	}
	if(x != 0)
		ans *= x;
	else
	   ans *= 10;
	int cnt = 0;
	int pp = ans;
	if(x == 9){
		ans = 88; cnt = 11;
		k =K;
		while(cnt < k){
			cnt *= 10; cnt++;
			ans *= 10; ans += 8;
		}
		ans++;
	}
	ans = min(ans,pp);
	cout << ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 2016 KB Output isn't correct
2 Halted 0 ms 0 KB -