QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#557506#8723. 乘二xfs001WA 258ms12988kbC++14495b2024-09-11 10:01:282024-09-11 10:01:28

Judging History

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

  • [2024-09-11 10:01:28]
  • 评测
  • 测评结果:WA
  • 用时:258ms
  • 内存:12988kb
  • [2024-09-11 10:01:28]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve(){
	int n,k;cin>>n>>k;
	multiset<int>st;
	for(int i=1;i<=n;i++){
		int x;cin>>x;
		st.insert(x);
	}
	while(k--){
		auto x=st.begin();
		st.erase(x);
		st.insert((*x)*2);
	}
	int res=0;
	while(st.size()){
		res+=*st.begin();
		st.erase(st.begin());
	}
	cout<<res;
}
signed main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	int t=1;
	// cin>>t;
	while(t--){
		solve();
	}
}

详细

Test #1:

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

input:

3 3
7 2 1

output:

15

result:

ok 1 number(s): "15"

Test #2:

score: -100
Wrong Answer
time: 258ms
memory: 12988kb

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:

10953707110844

result:

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