1 条题解
-
1
洛谷?
题解自己写的(我抄袭我自己)。
思路
居然还能写题解。首先过去需要 (向上取整)天,体力也一样。
然后则需要 (向上取整)天。
两者和就是答案。
代码
注:新版 C++ 支持日文、中文字符当变量名。
#include <bits/stdc++.h> // #pragma GCC optimize("Ofast", "-funroll-all-loops") #define ll long long #define pii pair<int, int> #define y1 gigay #define x first #define y second using namespace std; int n, x, k, の, ans; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> n >> x >> k; ans = の = (n + x - 1) / x; ans += (max(の - k, 0) + k - 1) / k; cout << ans << endl; return 0; }
信息
- ID
- 35495
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 1
- 标签
- (无)
- 递交数
- 4
- 已通过
- 4
- 上传者