编程介的小学生 2019-04-25 09:09 采纳率: 20.5%
浏览 234

稀疏矩阵的一个判断的算法,如何利用C语言的程序的编写的办法去实现的?

Problem Description
Wiskey buys a cake and wants to eat with Michelle. The cake is very delicious with many chocolates on it.
The cake is big; Wiskey need cut it to 6 pieces.
Michelle is a perfectionist and she sets perfect standard for Wiskey that each piece must contains the same weight of chocolates.
At first the cake may be not perfect, so Wiskey get some chocolate sticks, but the chocolate stick is too long, it will occupy adjacent two pieces and add same weight on the adjacent two pieces.
You can assume Wiskey have infinite various weight chocolate sticks.
Quick, Help Wiskey! Michelle is beginning to be angry.

Input
First line will contain one integer means how many cases will be follow.
Each line will contain six integers means the weight of chocolates at first.
All integers range in signed 32 bits.

Output
Print "YES" if Wiskey could finish the task.
Else print "NO", and then you could visit Wiskey in hospital.

Sample Input
4
1 1 1 1 1 1
1 1 1 1 1 0
1 1 1 1 0 0
2 1 0 0 1 2

Sample Output
YES
NO
YES
YES

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 ELGamal和paillier计算效率谁快?
    • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
    • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
    • ¥15 Arcgis相交分析无法绘制一个或多个图形
    • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
    • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
    • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
    • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
    • ¥30 3天&7天&&15天&销量如何统计同一行
    • ¥30 帮我写一段可以读取LD2450数据并计算距离的Arduino代码