# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1051375 | boyliguanhan | Magic Show (APIO24_show) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
std::vector<std::pair<int,int>> Alice(){
vector<pair<int,int>> ans;
long long x=setN(5000);
for(int i=1;i<N;i++)
ans.push_back({x%i+1,i+1});
return ans;
}
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
long long gcdd(long long a,long long b){
if(!b)return a;
return gcdd(b,a%b);
}
long long Bob(std::vector<std::pair<int,int>> V){
__int128_t ans=0, curlcm=1;
for(auto[i,j]:V){
if(curlcm>1e18) return ans;
while(ans%(j-1)!=i-1)
ans+=curlcm;
curlcm=curlcm*i/ gcdd(curlcm,i);
}
return ans;
}