| Task: | Fixed points |
| Sender: | Ace of Spades |
| Submission time: | 2016-05-28 15:48:36 +0300 |
| Language: | C++ |
| Status: | READY |
| Result: | TIME LIMIT EXCEEDED |
| test | verdict | time | |
|---|---|---|---|
| #1 | TIME LIMIT EXCEEDED | -- | details |
Code
#include<iostream>
using namespace std;
int main(void) {
int64_t t;
cin >> t;
for(;t>0;t--) {
uint64_t a,b;
cin >> a >> b;
bool fail=true;
for(int64_t tries=0;tries<1000;tries++) {
uint64_t n=rand()*rand();
int64_t iter=0;
while(iter<100) {
uint64_t nn=(a*n)^b;
if(nn == n) {
cout << n << "\n";
break;
}
n=nn;
iter++;
}
if(iter!=100) {
fail=false;
break;
}
}
if(fail)
cout << "-\n";
}
}
