QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#767965#5301. Modulo Ruins the Legend_DioWA 0ms3572kbC++17493b2024-11-20 23:03:302024-11-20 23:03:30

Judging History

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

  • [2024-11-20 23:03:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3572kb
  • [2024-11-20 23:03:30]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long


signed main() {
    int n,m;
    cin>>n>>m;
    vector<int> a(n+1);
    int sum=0;
    for(int i=1;i<=n;i++) {
        cin>>a[i];
        sum+=a[i];
    }
    if(__gcd(n,m)==1) {
        cout<<"0\n"<<1<<" "<<0<<'\n';
    }
    else {
        sum%=m;
        int x=__gcd(n,m);
        while(sum-x>=0) {
            sum-=x;
        }
        cout<<sum<<"\n"<<1<<" "<<0<<'\n';
    }
    return 0;
}

详细

Test #1:

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

input:

6 24
1 1 4 5 1 4

output:

4
1 0

result:

wrong answer Result not equal to solution.