QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#554857#8726. Magic ShowaCssenCompile Error//C++14628b2024-09-09 16:41:552024-09-09 16:41:55

Judging History

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

  • [2024-09-09 16:41:55]
  • 评测
  • [2024-09-09 16:41:55]
  • 提交

Alice

#include "iostream"
#include "vector"
#include "Alice.h"
using namespace std;
typedef long long ll;
ll setN(int n);
vector<pair<int,int> >Alice(){
	int n=5000;ll x=setN(n);
	vector<pair<int,int> >ans;
	for(int i=1;i<n;i++)
		ans.push_back(make_pair(x%i+1,i+1));
	return ans;
}

Bob

#include "iostream"
#include "vector"
#include "Bob.h"
using namespace std;
typedef __int128 ll;
ll gcd(ll a,ll b){
	return b==0?a:gcd(b,a%b);
}
ll Bob(vector<pair<int,int> >V){
	ll x=0,M=1;
	for(auto now:V){
		int a=now.first-1,m=now.second-1;
		while(x%m!=a) x+=M;
		M=M/gcd(M,m)*m;
		if(M>1e18) return x;
	}
	return x;
}

Details

Bob.code:9:4: error: ambiguating new declaration of ‘ll Bob(std::vector<std::pair<int, int> >)’
    9 | ll Bob(vector<pair<int,int> >V){
      |    ^~~
In file included from Bob.code:3:
Bob.h:3:11: note: old declaration ‘long long int Bob(std::vector<std::pair<int, int> >)’
    3 | long long Bob(std::vector<std::pair<int,int>> V);
      |           ^~~