gerrob (Thành viên)
gerrob+1
Biết code binary-indexed tree
Bài viết: 47
|
POWER-3026 12 năm, 4 tháng trước
|
(+0)
|
The assert(L>=2); has failed, it gets SIGABRT.
This problem ask for the largest integer k value for that there exist an integer x for that L<=x^k<=R ? In this case it is really important the L>=2 condition, otherwise k can be any integer, since 1^k=1.
|
|
|
Đã lưu IP
|
|
Đã khóa chức năng gửi bài. |
|
Trả lời: POWER-3026 12 năm, 4 tháng trước
|
(+0)
|
Sorry, let me check again.
|
|
|
Đã lưu IP
|
|
Đã khóa chức năng gửi bài. |
|
Trả lời: POWER-3026 12 năm, 4 tháng trước
|
(+0)
|
I can't ac this problem because the function pow(x,y) does not give correct result. For instance, pow(10^12,1/12)!=10.0 . Can you help me?
|
|
|
Đã lưu IP
|
|
Đã khóa chức năng gửi bài. |
|
Trả lời: POWER-3026 12 năm, 4 tháng trước
|
(+0)
|
The test case has been modified!
@pirate: your compare expression should be abs(pow(10^12, 1/12)-10) < EPSILON instead. Here EPSILON can be 1E-3/1E-4/... It helps avoid floating point errors.
|
|
|
Đã lưu IP
|
|
Đã khóa chức năng gửi bài. |
|
Trả lời: POWER-3026 12 năm, 4 tháng trước
|
(+0)
|
then I got AC immediately :P
|
|
|
Đã lưu IP
|
|
There are times when you can't save others with just love and kindness.
|
|
Đã khóa chức năng gửi bài. |
|
Trả lời: POWER-3026 12 năm, 4 tháng trước
|
(+0)
|
Me too, after using binary search!
|
|
|
Đã lưu IP
|
|
Đã khóa chức năng gửi bài. |
gerrob (Thành viên)
gerrob+1
Biết code binary-indexed tree
Bài viết: 47
|
Trả lời: POWER-3026 12 năm, 4 tháng trước
|
(+0)
|
Thanks for the modification!
|
|
|
Đã lưu IP
|
|
Đã khóa chức năng gửi bài. |
|