# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
209514 | 2020-03-14T12:30:31 Z | model_code | Snail (NOI18_snail) | C++17 | 6 ms | 380 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 100005; ll H, N, A[MAXN], sum; int main() { scanf("%lld%lld", &H, &N); for (int i = 0; i < N; ++i) { scanf("%lld", &A[i]); sum += A[i]; if (sum >= H) { printf("0 %d\n", i); return 0; } } if (sum == 0) { puts("-1 -1"); return 0; } ll left = H % sum; if (left == 0) { printf("%lld %d\n", H/sum-1, N-1); return 0; } for (int i = 0; i < N; ++i) { left -= A[i]; if (left <= 0) { printf("%lld %d\n", H/sum, i); return 0; } } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | Output is correct |
2 | Correct | 4 ms | 256 KB | Output is correct |
3 | Incorrect | 5 ms | 376 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Incorrect | 5 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Incorrect | 5 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 376 KB | Output is correct |
2 | Correct | 6 ms | 380 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
5 | Correct | 5 ms | 380 KB | Output is correct |
6 | Correct | 6 ms | 376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | Output is correct |
2 | Correct | 4 ms | 256 KB | Output is correct |
3 | Incorrect | 5 ms | 376 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |