Submission #1197834

#TimeUsernameProblemLanguageResultExecution timeMemory
1197834ansoriMagic Show (APIO24_show)C++20
0 / 100
1097 ms356 KiB
#include <vector>
#include "Alice.h"
#include<bits/stdc++.h>
using namespace std;
const int N = 5000;
// 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 setN(int N);
std::vector<std::pair<int,int>> Alice(){
    long long x = setN(N);
	vector<pair<int , int>> G;
    for(int i = 2;i <= N; ++ i){
    	G.push_back({x % (i - 1) + 1 , i});
    }
    return G;
}
#include <vector>
#include "Bob.h"
#include<bits/stdc++.h>
#define fi first
#define se second
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().

long long Bob(std::vector<std::pair<int,int>> V){
	long long ans = 0;
	__int128 lc = 1;
	for(auto to : V){
		int m = to.se , r = to.fi;
		while(ans % r != m) ans += lc;
		lc *= (r / __gcd(__int128(r) , lc));
		if(lc > 1e18) break;
	}
    return ans; 
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...