luogu#P6052. [RC-02] yltx 数对
[RC-02] yltx 数对
Background
yltx has once again come up with a problem that they cannot solve...
Problem Description
yltx defines that if a prime pair satisfies that is prime, then it is called a yltx pair.
He gives you pairs . Please check whether they are yltx pairs.
The data is given in the form of a seed .
Perform times of $x_0\leftarrow (7x_0+13)\ \mathrm{xor}\ (x_0\div 13-7)$. For the value obtained in the -th execution, first take modulo , add , take modulo again, then add , and you get the of the -th test case. Here division means integer division, and is treated as a 32-bit signed integer.
Use the same method to get .
Data generation template:
#include<bits/stdc++.h>
using namespace std;
int T,x_0,y_0;
int main() {
scanf("%d%d%d",&T,&x_0,&y_0);
while(T--){
x_0=((7*x_0+13)^(x_0/13-7));
y_0=((7*y_0+13)^(y_0/13-7));
int x=(x_0%10000+10000)%10000+1,y=(y_0%10000+10000)%10000+1;
//x,y即为一组(x,y)。
}
return 0;
}
Input Format
The first line contains three integers .
Output Format
line. Output how many pairs are yltx pairs.
100000 1 2
321
Hint
The Constraints for each test point are as follows:
| Test Point | T | Subtask |
|---|---|---|
| 1 | 1 | |
| 2 | ||
| 3 | ||
| 4 | ||
| 5 | ||
| 6 | ||
| 7 | 2 | |
| 8 | ||
| 9 | ||
| 10 | ||
| 11 | ||
| 12 | ||
| 13 | 3 | |
| 14 | ||
| 15 | ||
| 16 | ||
| 17 | ||
| 18 | ||
| 19 | ||
| 20 |
Each Subtask is tested as a bundled group of test points.
This problem provides testdata for download, but we hope you will use the data to do the right thing.
Translated by ChatGPT 5