# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
654650 |
2022-11-01T05:24:10 Z |
horiseun |
Snail (NOI18_snail) |
C++11 |
|
1 ms |
376 KB |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long
ll h, n, p[10005], s, d;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> h >> n;
for (int i = 0; i < n; i++) {
cin >> p[i];
s += p[i];
}
if (s <= 0) {
cout << -1 << " " << -1 << "\n";
return 0;
}
d = h / s;
s = h % s;
for (int i = 0; i < n; i++) {
s -= p[i];
if (s <= 0) {
cout << d - 1 << " " << i << "\n";
return 0;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Incorrect |
1 ms |
376 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |