当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2827:Auto-Calculation Machine

题目描述

Alice has invented an Auto-Calculation Machine (ACM) that operates on very large integer arrays. The machine is so simple that only one operation of the format sum(i, j) can be performed on it. An operation sum(i, j) means to calculate the sum of all integers between the i-th and j-th ones (inclusive) in the array. Despite its simplicity, the machine is not carefully designed. From time to time, it makes mistakes.

Alice has recorded a list of operations on a certain integer array of the ACM. Your task is to check whether it has made any mistakes not given any information about the array. For any record in the list, it is considered mistaken if it conflicts with the former ones, otherwise it is all right.

输入解释

The input consists of multiple lines. The first line contains a single positive integer M ≤ 10,000 indicating the number of records in the list. Each of the next M lines contain a record i j v (1 ≤ i, j ≤ 109, −20,000 ≤ v ≤ 20,000) in the list meaning that the result of an operation sum(i, j) is v.

输出解释

Output one line for each record in the list. If the operation referred to by the record is all right, output a single word “Accept”; otherwise output the phrase “Bug Detected” followed by and separated from by a single space the correct result of the operation.

输入样例
6
1 2 1
1 2 2
5 6 3
1 6 7
3 4 50
7 10 10
输出样例
Accept
Bug Detected 1
Accept
Accept
Bug Detected 3
Accept

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2827

最后修改于 2020-10-29T06:45:17+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536