QOJ.ac

QOJ

Süre Sınırı: 1.0 s Bellek Sınırı: 512 MB Toplam puan: 100

#76. 鋼琴家

İstatistikler

有位鋼琴家想彈鋼琴。

呢部鋼琴有 $10^{100}$ 個琴鍵,由左至右依次標示為 $A,B,C,D,E,F,G,A,B,\cdots$。鋼琴家想滿足以下限制:

  • 佢會揀一個 $A$ 鍵,按低揀好嘅琴鍵開始彈奏。
  • 佢按低第 $i$ 個琴鍵之後,下一步可以按第 $i-1$ 個或者第 $i+1$ 個琴鍵。
  • 佢按低一個 $A$ 鍵之後,亦可以停止彈奏。
  • 佢彈嘅第一個 $A$ 鍵同最後一個 $A$ 鍵唔一定係同一個琴鍵。
  • 佢必須恰好按 $A$ 鍵 $C_1$ 次(按邊啲 $A$ 鍵都冇所謂)。
  • 同樣,佢必須分別恰好按 $B,C,D,E,F,G$ 鍵 $C_2,\ldots,C_7$ 次。

判斷可唔可以滿足以上所有限制。

輸入

$C_1\ C_2\ C_3\ C_4\ C_5\ C_6\ C_7$

  • $0\le C_i\le10^{10}$
  • $\sum C_i>0$

輸出

如果可以滿足所有限制,就輸出 YES;否則輸出 NO。

範例

輸入 1

2 1 1 1 1 1 1

輸出 1

YES

輸入 2

1 1 1 1 1 1 1

輸出 2

NO

輸入 3

3 1 0 10000000000 10000000000 0 1

輸出 3

NO

輸入 4

1 0 0 0 0 0 0

輸出 4

YES

註解

喺範例 1,佢可以依次彈 $A,B,C,D,E,F,G,A$。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.