Submission #1319397

#TimeUsernameProblemLanguageResultExecution timeMemory
1319397lrnnzMagic Show (APIO24_show)C++20
0 / 100
1 ms340 KiB
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;

#define ll long long
#define pb push_back

vector<pair<int,int>> Alice(){
    ll n = 100;
    ll x = setN(n);
    vector<pair<int,int>> tree;

    for (int i = 2; i <= n; i++) {
        tree.pb({i, x % i});
    }

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

#define ll long long

ll Bob(vector<pair<int,int>> V){
    
    ll ans = 1, d = 1;
    for (auto [rem, div] : V) {
        if (rem > div) swap(rem, div);
        while (ans % div != rem) {
            ans += d;
        }

        d = lcm(d, div);
    }

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