Submission #1227379

#TimeUsernameProblemLanguageResultExecution timeMemory
1227379dizzy_groovyMagic Show (APIO24_show)C++20
0 / 100
1096 ms332 KiB
#include <bits/stdc++.h>
#include "Alice.h"

using namespace std;

// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

std::vector<std::pair<int,int>> Alice(){
    int n = 40;
    long long x = setN(n);
    vector<pair<int, int>> v;
    for (int i = 1; i < n; i++) {
        v.push_back({i + 1, (x % i) + 1});
    }
    return v;
}
#include <vector>
#include "Bob.h"

using namespace std;
using ll = long long;

// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

long long Bob(std::vector<std::pair<int,int>> V) {
	ll ans = 0;
    ll ansmod = 1;
    for (auto &i : V) {
        i.first--;
        i.second--;
        if (i.first > i.second) swap(i.first, i.second);
        while (ans % i.second != i.first) ans += ansmod;
        ansmod *= i.second;
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...