QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#793163#5465. Maximum GCDguodong#WA 0ms3512kbC++14591b2024-11-29 17:22:422024-11-29 17:22:54

Judging History

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

  • [2024-11-29 17:22:54]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3512kb
  • [2024-11-29 17:22:42]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define For(i,a,b) for(int i = a; i <= b; ++i)
signed main()
{
    #ifdef NICEGUODONG
        freopen("data.in","r",stdin);
    #endif
    int n;
    cin >> n;
    vector<int> a(n);
    For(i,1,n)
        cin >> a[i - 1];
    sort(a.begin(),a.end());
    int flag = 0;
    for(int i = 1; i < n; ++i){
        if(a[i] % a[0] != 0 || a[i] >= 2 * a[0] + 1){
            flag = 1;
            break;
        }
    }
    if(!flag)
        cout << a[0] << '\n';
    else
        cout << max((a[0] - 1) / 2,1);
    return 0;
}

详细

Test #1:

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

input:

3
3 10 7

output:

1

result:

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