Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
23798 | qwertyuiop | 接水问题 | C++ | 通过 | 2 MS | 292 KB | 324 | 2023-07-16 17:59:34 |
#include<bits/stdc++.h> using namespace std; int s[11000],ans; int main() { int n,m;cin>>n>>m; for(int i=1;i<=n;i++) cin>>s[i]; int t=m+1; while(t<=n+m) { for(int i=1;i<=m;i++) { s[i]--; if(s[i]==0) { s[i]=s[t]; t++; } } ans++; } cout<<ans; return 0; }