C. 蜂窝探险

    Type: Default 1000ms 512MiB

蜂窝探险

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

【题目描述】

有一个无限范围的蜂窝状的网格,小明决定在这个网格中探险。 我们看一下这一张图,来看整个网格的坐标结构。

小明从 00(0,0) 点出发,按照旋涡状移动(见下图),求移动 nn 步后,小明所处的坐标。

【输入格式】

输入一行一个整数 nn

【输出格式】

输出一行两个整数 x,yx,y 表示小明 nn 步之后所处的坐标。

【样例输入1】

3

【样例输出1】

-2 0

【样例输入2】

7

【样例输出2】

3 2

【数据范围】

对于 30%30\% 的数据, n30n\leq 30

对于 50%50\% 的数据, n500n\leq 500

对于 100%100\% 的数据, n1018n\leq 10^{18} ;

2023CSP考前冲刺模拟1

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2023-9-23 8:30
End at
2023-9-23 12:00
Duration
3.5 hour(s)
Host
Partic.
2