# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1062453 |
2024-08-17T07:12:26 Z |
jundi |
Snail (NOI18_snail) |
C++17 |
|
1000 ms |
348 KB |
#include <bits/stdc++.h>
using namespace std;
int main(){
int h;
int n;
cin>>h>>n;
vector<int> a(n);
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=-1;
int now=0;
int re=0;
while(now<h){
//cout<<day<<" "<<now<<endl;
day++;
for(int i=0;i<n;i++){
re=i;
now+=a[i];
if(now>=h) break;
}
}
cout<<day<<" "<<re;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1032 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1061 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1074 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1070 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1032 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |