QOJ.ac

QOJ

実行時間制限: 1.0 s メモリ制限: 512 MB 満点: 100

#76. Pianista

統計

Um pianista quer tocar piano.

O piano tem $10^{100}$ teclas, identificadas por $A, B, C, D, E, F, G, A, B, \ldots$ da esquerda para a direita. O pianista quer satisfazer as seguintes condições:

  • Escolhe uma tecla $A$ e começa a tocar piano premindo a tecla escolhida.
  • Depois de premir a $i$-ésima tecla, no passo seguinte pode premir a $(i-1)$-ésima ou a $(i+1)$-ésima tecla.
  • Depois de premir uma tecla $A$, também pode parar de tocar piano.
  • A primeira tecla $A$ e a última tecla $A$ que toca não são necessariamente a mesma.
  • Tem de premir teclas $A$ (não importa quais teclas $A$) exatamente $C_1$ vezes.
  • Analogamente, tem de premir teclas $B, C, D, E, F, G$ exatamente $C_2, \ldots, C_7$ vezes, respetivamente.

Determine se é possível satisfazer todas as condições acima.

Entrada

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

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

Saída

Imprima YES se for possível satisfazer todas as condições, e NO caso contrário.

Exemplos

Entrada 1

2 1 1 1 1 1 1

Saída 1

YES

Entrada 2

1 1 1 1 1 1 1

Saída 2

NO

Entrada 3

3 1 0 10000000000 10000000000 0 1

Saída 3

NO

Entrada 4

1 0 0 0 0 0 0

Saída 4

YES

Nota

No exemplo 1, pode tocar $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.