QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#767965 | #5301. Modulo Ruins the Legend | _Dio | WA | 0ms | 3572kb | C++17 | 493b | 2024-11-20 23:03:30 | 2024-11-20 23:03:30 |
Judging History
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.