QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#646212#8726. Magic ShowkdylCompile Error//C++14557b2024-10-16 21:42:502024-10-16 21:42:51

Judging History

你现在查看的是最新测评结果

  • [2024-10-16 21:42:51]
  • 评测
  • [2024-10-16 21:42:50]
  • 提交

Alice

#include<bits/stdc++.h>
#include"Alice.h"
using namespace std;
std::vector<std::pair<int,int> > Alice(){
	std::vector<std::pair<int,int> > v;
        long long x=setN(500);
	for(int i=2;i<=500;i++){
		v.push_back({i,x%(i-1)+1}); 
	}
	return v;
}

Bob

#include<bits/stdc++.h>
#include"Bob.h"
using namespace std;
long long Bob(std::vector<std::pair<int,int> > V){
	__int128 ans=0,res=1;
	for(auto i:V){
		int x=i.first-1,y=i.second-1;swap(x,y);
		while(ans%x!=y)ans+=res;
		if(res>1e18) return ans;
		res=res*x/__gcd(res,x);
	}
	return ans;
}

Details

Bob.code: In function ‘long long int Bob(std::vector<std::pair<int, int> >)’:
Bob.code:10:32: error: no matching function for call to ‘__gcd(__int128&, int&)’
   10 |                 res=res*x/__gcd(res,x);
      |                           ~~~~~^~~~~~~
In file included from /usr/include/c++/13/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from Bob.code:1:
/usr/include/c++/13/bits/stl_algo.h:1185:5: note: candidate: ‘template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)’
 1185 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/13/bits/stl_algo.h:1185:5: note:   template argument deduction/substitution failed:
Bob.code:10:32: note:   deduced conflicting types for parameter ‘_EuclideanRingElement’ (‘__int128’ and ‘int’)
   10 |                 res=res*x/__gcd(res,x);
      |                           ~~~~~^~~~~~~