# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1062439 |
2024-08-17T06:54:44 Z |
jundi |
Snail (NOI18_snail) |
C++17 |
|
1 ms |
348 KB |
#include <bits/stdc++.h>
using namespace std;
int main(){
int h;
int n;
cin>>h>>n;
vector<int> a(n);
int now=0;
int sum=0;
for(int i=0;i<n;i++){
cin>>a[i];
sum+=a[i];
}
if(sum<=0 && h!=0) {cout<<-1<<" "<<-1; return 0;}
int day=0;
int re=0;
while(day++){
for(int i=0;i<n;i++){
now+=a[i];
if(now>=h) {re=i; break;}
}
}
cout<<day<<" "<<re;
}
# |
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 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
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 |
- |