제출 #1061786

#제출 시각아이디문제언어결과실행 시간메모리
1061786rainboy마술쇼 (APIO24_show)C++17
100 / 100
3 ms1072 KiB
#include "Alice.h"
#include <vector>

using namespace std;

typedef pair<int, int> pi;
typedef vector<pi> vpi;

const int N = 5000;

vpi Alice() {
	long long x = setN(N);
	vpi ij;
	for (int j = 1; j < N; j++) {
		int i = x % j;
		ij.push_back(make_pair(i + 1, j + 1));
	}
	return ij;
}
#include "Bob.h"
#include <vector>

using namespace std;

typedef pair<int, int> pi;
typedef vector<pi> vpi;

long long Bob(vpi ij) {
	const long long M = 1000000000000000000;
	int m = ij.size();
	long long md = 1, x = 0;
	for (int h = 0; h < m && md <= M; h++) {
		int i = ij[h].first - 1, j = ij[h].second - 1;
		while (x % j != i)
			x += md;
		int k = 1;
		while (md * k <= M && md * k % j != 0)
			k++;
		md *= k;
	}
	return x;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...