Editorial for GMT
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Nguồn: Free Contest
Dễ thấy số phút không thay đổi, do đó ta chỉ cần in . Để đơn giản hóa bài toán, ta chia bài toán làm hai bước sau:
- Trừ
tiếng khỏi thời điểm hiện tại để ra thời điểm ở Greenwich
- Cộng
tiếng để ra thời điểm tại
Để cộng, trừ tiếng khỏi một thời điểm nào đó mà vẫn đảm bảo điều kiện
, ta có thể sử dụng phép toán
(mod). Cụ thể, để cộng thêm một số tiếng
(
có thể âm hoặc dương) nào đó, ta có thể thực hiện
Comments