| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 1248603 | camdovip | Snail (NOI18_snail) | C++20 | 1095 ms | 320 KiB | 
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pairll pair<ll,ll>
using namespace std;
const int N = 1e5 + 5, mod = 1e9 + 7, base = 256;
ll h, n;
ll x[N];
void solve() {
	cin >> h >> n;
	for (int i = 1; i <= n; i ++) {
		cin >> x[i];
	}
	ll up = 0;
	for (int i = 1; i <= n; i ++) {
		up += x[i];
	}
	if (up < 0) {
		cout << -1 << " " << -1;
	}
	ll day = 0, hour = 0;
	while (h >= up) {
		day ++;
		h -= up;
	}
	cout << max (day - 1, 0LL) << " ";
	for (int i = 1; i <= n; i ++) {
		if (h >= 0) {
			h -= x[i];
			hour ++;
		}
		else break;
	}
	cout << (hour - 1 + n) % n;
}
int main() {
	freopen ("SNAIL.INP", "r", stdin);
	freopen ("SNAIL.OUT", "w", stdout);
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	ll testcase = 1;
//	cin >> testcase;
	while (testcase --)
		solve();
}
//road to national prize
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
