Logo
(追記) (追記ここまで)

21588번 - Circle of Friends 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
7 초 1024 MB64181525.862%

문제

There is a posse of friends sitting in a circle. Each friend is holding a card containing a positive integer.

You would like to split the circle of friends into one or more groups. Each group must be a contiguous subsection of the circle. In addition, for each group, the bitwise AND of all values on the cards of the members of the group, taken together, must be nonzero.

Count the number of ways you could split the circle of friends into groups.

입력

The first line of input contains a single integer $n$ (1ドル \le n \le 2 \cdot 10^5$), which is the number of friends in the circle.

Each of the next $n$ lines contains a single integer $a$ (1ドル \le a < 2^{60}$). These are the positive integers on the cards held by the friends in the circle, in the order that the friends are sitting. Note that since they’re in a circle, the last friend in the list is sitting next to the first friend in the list.

출력

Output a single integer, which is the number of ways to split the circle of friends into groups. Since this number may be very large, output it modulo 998,244,353.

제한

예제 입력 1

4
14
13
11
7

예제 출력 1

11

힌트

출처

ICPC > Regionals > North America > North America Division Championships > 2021 ICPC North America Division Championships D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /