#180. 检查相邻满分

    ID: 180 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatAp-1gesp1循环结构条件结构

检查相邻满分

Adjacent 100 Scores

Background

Congcong recently took a series of exams. He wants to know if there are any instances where he scored a perfect 100 twice in a row.

Problem Description

Given an array of integers representing a series of exam scores, return true if there are two adjacent elements in the array that are both 100100; otherwise, return false. The array length is guaranteed to be at least 22.

Input Format

Input is given from standard input in the following format.

A single line containing multiple space-separated integers, representing the exam scores.

Output Format

Output is printed to standard output in the following format.

Output true if there are adjacent 100100 scores; otherwise, output false.

Sample

1 100 100
true
1 100 99 100
false
100 1 100 100
true

Sample Explanation

Sample 1: The array is [1, 100, 100]. At indices 11 and 22, there are two adjacent 100100 scores, so true is returned. Sample 2: The array is [1, 100, 99, 100]. There are no adjacent 100100 scores, so false is returned. Sample 3: The array is [100, 1, 100, 100]. At indices 22 and 33, there are two adjacent 100100 scores, so true is returned.

Constraints

  • Array length N2N \ge 2.
  • Each score scorescore satisfies 0score1000 \le score \le 100.
  • Time limit: 11 second, Memory limit: 10241024 KiB.