QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#416597#8723. 乘二tanchimaoWA 174ms5276kbC++14429b2024-05-21 23:36:562024-05-21 23:36:57

Judging History

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

  • [2024-05-21 23:36:57]
  • 评测
  • 测评结果:WA
  • 用时:174ms
  • 内存:5276kb
  • [2024-05-21 23:36:56]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
long long mod=100000000007;
long long sum;
typedef long long ll;
priority_queue<long long,vector<long long>,greater<long long>> p;
int main()
{
	int n,k;
	cin>>n>>k;
	long long a;
	for(int i=1;i<=n;i++)
	{
		cin>>a;
		p.push(a);
		sum+=a;
		sum%=mod;
	}
	for(int i=1;i<=k;i++)
	{
		a=p.top();
		sum+=a;
		sum%=mod;
		p.pop();
		p.push(2*a);
	}
	cout<<sum;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3584kb

input:

3 3
7 2 1

output:

15

result:

ok 1 number(s): "15"

Test #2:

score: -100
Wrong Answer
time: 174ms
memory: 5276kb

input:

200000 1605067
366760624 67854 93901 693975 27016 1046 10808 6533158 54778 500941023 77236442 32173 10431454 2 9726 1553148 89282 411182309 494073 131299543 249904771 7906930 353 9909 3632698 29156 1917186 303 737 1189004 22 1983 263 711 4106258 2070 36704 12524642 5192 123 2061 22887 66 380 1 10153...

output:

53707110081

result:

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