A. Borya's Diagnosis 传送门:http://codeforces.com/contest/879/problem/A 本题是一个模拟问题. 依次访问n个元素,第i个元素首次出现于si时刻,之后相邻两次出现的时间间隔为di.求访问结束的时刻. 贪心地模拟之. 注意事项:当运算符“/”用于负操作数时,在C89中,其结果由实现定义:在C99中,除法的结果总是向零截取的!! 注意特判si>cur的情形,以避免“由实现定义”的负操作数除法“/”. 参考程序如下: #include <…