编程介的小学生 2016-12-23 11:37 采纳率: 20.5%
浏览 1012
已采纳

Auto-Calculation Machine

Description

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.

Input

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

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.

Sample Input

6
1 2 1
1 2 2
5 6 3
1 6 7
3 4 50
7 10 10
Sample Output

Accept
Bug Detected 1
Accept
Accept
Bug Detected 3
Accept

  • 写回答

1条回答 默认 最新

  • threenewbee 2016-12-23 16:40
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)