程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程解疑 >> word-Auto-Calculation Machine

word-Auto-Calculation Machine

編輯:編程解疑
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

最佳回答:


http://www.2cto.com/kf/201408/323468.html

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved