PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#QHD0000010. Dãy căn, logarit và sin (Sqrt Log Sin)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Dãy căn, logarit và sin (Sqrt Log Sin)
Sqrt Log Sin
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
Consider the integer sequence defined by
$$x_i=\big(x_{i-\lfloor\sqrt{i}\rfloor}+x_{\lfloor\ln i\rfloor}+x_{\lfloor i\sin^2(i)\rfloor}\big)\bmod 1\,000\,000\qquad(i\ge1).$$Here denotes the floor function, is the natural logarithm, and takes its argument in radians.
Compute the sequence value at the specified index.
Input
The input contains one integer , the required sequence index.
Output
Print one integer: modulo .
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
0
Output
1
Explanation
The sequence is initialized with . Since the input is , the recurrence is unnecessary and the answer is .