# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1071935 |
2024-08-23T12:34:35 Z |
hq77 |
Snail (NOI18_snail) |
C++17 |
|
2 ms |
348 KB |
// Source: https://usaco.guide/general/io
#include <bits/stdc++.h>
using namespace std;
int main() {
int h,n;cin>>h>>n;
vector<float>v(n);
float perday=0,Max=0;
for(int i=0;i<n;i++){
cin>>v[i];
Max=max(Max,v[i]);
perday+=v[i];
}
if(perday<=0 && h>0){
cout<<"-1 -1";
return 0;
}
int days_required = ceil((h-Max)/perday);
cout<<days_required<<" ";
int now = days_required*perday;
if(now>=h){cout<<0;return 0;}
for(int i=0;i<n;i++){
now+=v[i];
if(now>=h){cout<<i;return 0;}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |