#abc336g. G - 16 Integers
G - 16 Integers
Score: points
问题描述
给定16个非负整数 ,按照 的升序排列。
令 $N = \displaystyle \sum_{i=0}^1 \sum_{j=0}^1 \sum_{k=0}^1 \sum_{l=0}^1 X_{i,j,k,l}$。
求满足以下条件的长度为 、仅包含0和1的序列 的数量,模 后的结果。
- 对于所有四元组 ,存在恰好 个整数 ,满足 ,且:
- ,,,以及 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given non-negative integers in ascending order of .
Let $N = \displaystyle \sum_{i=0}^1 \sum_{j=0}^1 \sum_{k=0}^1 \sum_{l=0}^1 X_{i,j,k,l}$.
Find the number, modulo , of sequences of length consisting of s and s that satisfy the following condition.
- For every quadruple of integers , there are exactly integers between and , inclusive, that satisfy:
- , , , and .
Constraints
- are all non-negative integers.
- $1 \leq \displaystyle \sum_{i=0}^1 \sum_{j=0}^1 \sum_{k=0}^1 \sum_{l=0}^1 X_{i,j,k,l} \leq 10^6$
Input
The input is given from Standard Input in the following format:
Output
Print the number, modulo , of sequences that satisfy the condition in the problem statement.
Sample Input 1
0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0
Sample Output 1
1
This input corresponds to the case where and are and all others are .
In this case, only one sequence satisfies the condition, which is .
Sample Input 2
1 1 2 0 1 2 1 1 1 1 1 2 1 0 1 0
Sample Output 2
16
Sample Input 3
21 3 3 0 3 0 0 0 4 0 0 0 0 0 0 0
Sample Output 3
2024
Sample Input 4
62 67 59 58 58 69 57 66 67 50 68 65 59 64 67 61
Sample Output 4
741536606
update @ 2024/3/10 01:26:33