QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#418105#8723. 乘二ehdxbcWA 160ms5204kbC++20905b2024-05-23 10:44:492024-05-23 10:44:50

Judging History

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

  • [2024-05-23 10:44:50]
  • 评测
  • 测评结果:WA
  • 用时:160ms
  • 内存:5204kb
  • [2024-05-23 10:44:49]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define PII pair<int, int> 
const int N = 1e5+10;
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, 1, 0, -1};
int gcd(int x,int y){
    return y ? gcd(y, x % y) : x;
}
const int mod = 1e9 + 7;
void solve()
{
    int n, m;
    cin >> n >> m;
    priority_queue<int,vector<int>,greater<int>>q;
    for (int i = 0; i < n; i++){
        int x;
        cin >> x;
        q.push(x);
    }
    while(m --){
        auto u = q.top();
        q.pop();
        q.push(u * 2);
    }
    int ans = 0; 
    while(q.size()){
        auto u = q.top();
        q.pop();
        ans += u;
    }
    cout << ans <<  endl;
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int _;
    _ = 1;
    //cin >> _;
    while (_--)
    {
        solve();
    }

    return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3876kb

input:

3 3
7 2 1

output:

15

result:

ok 1 number(s): "15"

Test #2:

score: -100
Wrong Answer
time: 160ms
memory: 5204kb

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'