Submission #1227388

#TimeUsernameProblemLanguageResultExecution timeMemory
1227388dizzy_groovyMagic Show (APIO24_show)C++20
0 / 100
0 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 = 100;
    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 <bits/stdc++.h>
#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);
        cout << i.first << " " << i.second << " " << endl;
        while (ans % i.second != i.first) ans += ansmod;
        ansmod *= i.second / __gcd((ll)i.second, ansmod);
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...