QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#188251#5481. Beast BulliesIsaacMoris#WA 62ms5208kbC++14702b2023-09-25 17:27:252023-09-25 17:27:26

Judging History

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

  • [2023-09-25 17:27:26]
  • 评测
  • 测评结果:WA
  • 用时:62ms
  • 内存:5208kb
  • [2023-09-25 17:27:25]
  • 提交

answer

#include<iostream>
#include <bits/stdc++.h>

#define ll long long
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int N = 1e6 + 5, mod = 1e9 + 7;


void doWork() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a.rbegin(), a.rend());
    for (int i = 1; i < n; i++) {
        a[0] -= a[i];
        if (a[0] <= 0) {
            cout << i + 1;
            return;
        }
    }
    cout << 1;
}

int main() {
    IO
    int t = 1;
    //cin >> t;
    for (int i = 1; i <= t; i++) {
        //  cout << "Case #" << i << ": ";
        doWork();
    }
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 62ms
memory: 5208kb

input:

500000
976631732
51389671
729809897
630844317
294721017
903231515
477913449
871071076
636104080
345822085
97441187
499323378
522845426
310022664
199310190
776622973
602672555
646874222
214723272
285341530
962727359
681361226
47426538
272153520
693133904
542337627
556307610
325596239
95738088
5495543...

output:

3

result:

wrong answer 1st lines differ - expected: '155101', found: '3'