样例都过了,提交全WA,求调
查看原帖
样例都过了,提交全WA,求调
1042302
wu_si_qiao楼主2024/8/26 11:28
#include <bits/stdc++.h>
using namespace std;
int n, cnt;

int main() {
	cin >> n;

	if (n % 5 == 0) {
		cout << n / 5 << endl;
		return 0;
	}

	while (n >= 0) {

		if (n % 5 == 0) {
			cout << n / 5 + cnt << endl;
			return 0;
		}

		if (n < 5) {
			cout << cnt + n << endl;
			return 0;
		}

		if (n < 11) {
			cout << cnt + n - 5 + 1 << endl;
			return 0;
		}

		cnt++;
		n -= 11;
	}
}

真的是服了

2024/8/26 11:28
加载中...