QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#591246#5465. Maximum GCDice_cup#WA 0ms3612kbC++14386b2024-09-26 14:56:352024-09-26 14:56:35

Judging History

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

  • [2024-09-26 14:56:35]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3612kb
  • [2024-09-26 14:56:35]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,a[100100],ans;
bool ck(int x){
	int fl=1;
	for(int i=1;i<=n;i++){
		if(a[i]%x!=0&&a[i]/2-1<x)fl=0;
	}
	return fl;
}
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
	}
	sort(a+1,a+1+n);
	ans=a[1]/2-1;
	for(int i=1;i*i<=a[1];i++){
		if(a[1]%i==0&&ck(a[1]/i)){
			ans=max(ans,a[1]/i);
		}
	}
	cout<<ans;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3612kb

input:

3
3 10 7

output:

0

result:

wrong answer 1st numbers differ - expected: '3', found: '0'