QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#735295 | #9717. Defuse the Bombs | rotcar07 | WA | 93ms | 4152kb | C++23 | 417b | 2024-11-11 19:06:06 | 2024-11-11 19:06:06 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
inline void solve(int tc){
int n,ans=1e9;cin>>n;
vector<int> v(n);
for(int &x:v) cin>>x;
sort(v.begin(),v.end());
long long sum=0;
for(int i=0;i<n;i++){
sum+=v[i];
if(i) ans=min<int>(ans,sum/i+1);
}
cout<<"Case #"<<tc<<": "<<ans<<'\n';
}
int main(){
int t;cin>>t;
for(int _=1;_<=t;_++) solve(_);
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3460kb
input:
2 2 1 1 3 1 2 3
output:
Case #1: 3 Case #2: 4
result:
ok 2 lines
Test #2:
score: 0
Accepted
time: 87ms
memory: 4152kb
input:
3 100000 968870229 246637522 23867348 170512761 317727561 135784257 788061221 6692201 96102115 164513402 826612817 675345177 690177641 969959105 957765211 678805726 936166573 281739681 760822473 521447491 619742216 102531432 633299481 698320991 55968513 399427883 808303141 53228160 432641457 7250014...
output:
Case #1: 2 Case #2: 2 Case #3: 2
result:
ok 3 lines
Test #3:
score: -100
Wrong Answer
time: 93ms
memory: 3904kb
input:
12 99648 868508085 197551137 223963681 271716447 485636149 768477451 637746433 290912601 973354817 623217611 874717425 808610975 631236945 908326401 17087606 254068257 960429731 968635649 947450738 601921026 102237601 99225633 898941536 107413793 100995151 226235470 853952217 829469697 126588881 821...
output:
Case #1: 2 Case #2: 71597 Case #3: 2 Case #4: 2 Case #5: 2 Case #6: 1048007 Case #7: 15915 Case #8: 2 Case #9: 4302702 Case #10: 1000000000 Case #11: 11323251 Case #12: 6510461
result:
wrong answer 10th lines differ - expected: 'Case #10: 1036767035', found: 'Case #10: 1000000000'