# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1062954 |
2024-08-17T12:27:30 Z |
jundi |
Snail (NOI18_snail) |
C++17 |
|
3 ms |
348 KB |
#include <bits/stdc++.h>
using namespace std;
int main(){
double h;
int n;
cin>>h>>n;
vector<double> a(n);
double maxx=0;
double one=0;
for(int i=0;i<n;i++){
cin>>a[i];
maxx=max(maxx,a[i]);
one+=a[i];
}
int day=max(double(0),ceil((h-maxx)/one));
h-=(one*day);
int re=0;
for(int i=0;i<n;i++){
re+=a[i];
if(re>=h){cout<<day<<" "<<i; return 0;}
}
cout<<-1<<" "<<-1;
}
# |
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 |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 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 |
2 ms |
348 KB |
Output is correct |
2 |
Incorrect |
2 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 |
- |