제출 #1051384

#제출 시각아이디문제언어결과실행 시간메모리
1051384boyliguanhan마술쇼 (APIO24_show)C++17
100 / 100
2 ms1088 KiB
#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<5000;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*(j-1)/ gcdd(curlcm,j-1);
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...