QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#659700#6810. Array ConcatenationqkyWA 0ms3568kbC++17748b2024-10-19 21:24:292024-10-19 21:24:30

Judging History

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

  • [2024-10-19 21:24:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3568kb
  • [2024-10-19 21:24:29]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod=1000000007;
int n,m;
const int N=1e5+5;
int a[N];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>m;
	ll ab=0,ba=0,sum=0;
	for(int i=1;i<=n;i++) {cin>>a[i];
	sum+=a[i];sum%=mod;
	ab+=i*a[i];ab%=mod;
	ba+=(n-i+1)*a[i];ba%=mod;
	}
	cout<<ab<<" "<<ba<<" "<<sum<<endl;
	ll ans=0,ans1=0,ans2=0;
	ll shu=1;
	for(int i=1;i<=m;i++){
		if(i==m) {
			ans1=((ab+ba)%mod*shu)%mod;
			ans=sum*shu%mod;
		}
		shu*=2;
		shu%=mod;
		if(i==m) {
			ans=(ans*(shu-1))%mod;
		}
	}
	ans=(ans*n)%mod;
	ans2=(ba*shu)%mod;
	cout<<ans<<" "<<ans1<<" "<<ans2<<endl;
	ans1=(ans+ans1)%mod;
	ans2=(ans2+ans)%mod;
	cout<<max(ans1,ans2)<<endl;
	return 0;
}

详细

Test #1:

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

input:

2 1
1 2

output:

5 4 3
6 9 8
15

result:

wrong answer 1st lines differ - expected: '15', found: '5 4 3'