CSES - HIIT Open 2016 - Results
Submission details
Task:Fixed points
Sender:Ace of Spades
Submission time:2016-05-28 15:50:32 +0300
Language:C++
Status:READY
Result:
Test results
testverdicttime
#11.22 sdetails

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;
        uint64_t n=rand()*rand();
        for(int64_t tries=0;tries<100;tries++) {
            int64_t iter=0;
            n++;
            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";
    }
}

Test details

Test 1

Verdict:

input
100000
12865169357617740396 294321893...

correct output
5903494652862419412
-
13008184152928659765
9415006529485574473
16201136572240455608
...

user output
5903494652862419412
-
13008184152928659765
9415006529485574473
16201136572240455608
...