Submission #1047821

#TimeUsernameProblemLanguageResultExecution timeMemory
1047821ArturgoMagic Show (APIO24_show)C++17
100 / 100
2 ms1072 KiB
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;

vector<pair<int,int>> Alice() {
    int N = 5000;
    long long X = setN(N);

    vector<pair<int, int>> arbre;
    for(int i = 2;i <= N;i++) {
        arbre.push_back({1 + X % (i - 1), i});
    }

    return arbre;
}
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;

long long Bob(vector<pair<int, int>> aretes){
	__int128 X = 0;
    __int128 N = 1;

    for(pair<int, int>& arete : aretes) {
        __int128 modX = arete.first - 1, p = arete.second - 1; 

        while(X % p != modX) {
            X += N;
        }

        N = (N * p) / __gcd(N, p);

        if(N > 1e18) break;
    }

    return X;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...