NC208885. FindingtheOrder
描述
输入描述
The input contains multiple cases. The first line of the input contains a single integer , the number of cases.For each case, there are four integers in a line, indicating the distances between .It is guaranteed that each case corresponds to a valid solution.
输出描述
For each case, output 'AB//CD' (Quotation marks) if , or output 'AB//DC' (Quotation marks) if .
示例1
输入:
2 3 5 5 3 5 3 3 5
输出:
AB//CD AB//DC
C++11(clang++ 3.9) 解法, 执行用时: 3ms, 内存消耗: 376K, 提交时间: 2020-07-20 12:23:42
#include <cstdio> int T,a,b,c,d; int main(){ scanf("%d",&T); while(T--){ scanf("%d%d%d%d",&a,&b,&c,&d); puts(b+c>a+d?"AB//CD":"AB//DC"); } }
pypy3 解法, 执行用时: 54ms, 内存消耗: 21136K, 提交时间: 2023-05-02 17:15:38
T = int(input()) for t in range(T): ac, ad, bc, bd = map(int, input().split()) print("AB//CD" if ac + bd < ad + bc else "AB//DC")
Python3(3.5.2) 解法, 执行用时: 16ms, 内存消耗: 3320K, 提交时间: 2020-07-20 17:19:25
for i in range(int(input())): ac, ad, bc, bd = map(int, input().split()) print('AB//CD' if ac + bd < ad + bc else 'AB//DC')