| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 106171 | sofhiasouza | 수열 (BOI14_sequence) | C++14 | 41 ms | 512 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int k, a;
	string s;
	cin >> k;
	for(int i = 0 ; i < k ; i++) cin >> a;
	k--;
	stringstream ans;
	ans << k;
	ans >> s;
	if(k == 0 and a != 0) cout << a << endl;
	else if(a == 0)
	{
		long long int p = 0;
		for(int i = 1 ; i <= s.size() ; i++) p += (long long int)pow(10, s.size() - i);
		if(k == 0) cout << 10 << endl;
		else if(p >= k+1) cout << (long long int)pow(10, s.size()) << endl;
		else cout << (long long int)pow(10, s.size()+1) << endl;
	}
	else if(a == 9)
	{
		long long int p = 0, p2 = 0;
		p2 += (long long int)pow(10, s.size() - 1);
		for(int i = 2 ; i <= s.size() ; i++) p += (long long int)pow(10, s.size() - i);
		p2 += p;
		if(s.size() == 1) cout << 89 << endl;
		else if((long long int)p + (long long int)pow(10, s.size()-1) >= k+1) cout << (long long int)pow(10, s.size()-1)*9 - p << endl; 
		else cout << (long long int)pow(10, s.size())*9 - p2 << endl;
	}
	else cout << (long long int)pow(10, s.size())*a << endl;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
