RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
문제 COCI00687

Različitost

설명

Two infinite periodic sequences of integers, \(a_{i}\) and \(b_{i}\), are given, defined by their periods of lengths \(n\)
and \(m\), respectively. This means that the natural numbers \(n\) and \(m\) are given, as well as the numbers
\(a_{1}\), \(a_{2}\), . . . , \(a_{n}\) and \(b_{1}\), \(b_{2}\), . . . , \(b_{m}\), for which \(a_{i} = a_{i+n}\) and \(b_{i} = b_{i+m}\) hold for every natural number \(i\).
Additionally, given a natural number \(k\), we define the "diversity" of these two sequences as the sum \(a_{i}\)\(b_{i}\)
for each \(i = 1\), 2, . . . , k. (Here, ⊕denotes the bitwise exclusive OR operation, which produces ones in
the positions where the binary digits of the two numbers differ. For example, 5 ⊕3 = (101){2} ⊕(011) =
(110)_{2} = 6.)
Your task is to calculate the diversity of the given sequences.

제약
입력 형식

In the first line, there are \(n\), \(m\), and \(k\) (\(1 \le n\), \(m \le 2 \cdot 10^{5}\), \(1 \le k \le 10^{18}\)), which are the numbers from the
task description.
In the second line, there are \(n\) integers \(a_{1}\), . . . , \(a_{n}\) (\(0 \le a_{i} \le 10^{18}\), \(i = 1\), 2, . . . , n).
In the third line, there are \(m\) integers \(b_{1}\), . . . , \(b_{m}\) (\(0 \le b_{i} \le 10^{18}\), \(i = 1\), 2, . . . , m).

출력 형식

Because the answer can be very large, output the remainder of the answer when divided by \(10^{9} + 7\) in a
single line.

서브태스크
서브태스크점수설명

1

25점

\(k \le 2 \cdot 10^{5}\)

2

13점

\(n = m\)

3

9점

\(n = 1\)

4

43점

No additional constraints.

예제 1
입력
3 2 10
1 6 4
5 2
출력
33
예제 2
입력
10 5 30
5 16 2 10 7 2 4 20 5 12
4 11 14 23 5
출력
435
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2024/2025 Contest 2

평가 및 의견

Različitost

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Različitost

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8