| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 81404 | sh25_wuyy | 接水问题 | C++ | Accepted | 8 MS | 292 KB | 328 | 2026-01-04 17:54:37 |
#include<bits/stdc++.h> using namespace std; long long n,m; int a[10010]; bool cmp(int x,int y){ return x>y; }int main(){ scanf("%I64d%I64d",&n,&m); for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int i=m+1;i<=n;i++){ sort(a+1,a+1+m); a[1]=a[1]+a[i]; }sort(a+1,a+1+m,cmp); cout<<a[1]<<endl; return 0; }