Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
108941 | 彭士宝 | 美丽数 | C++ | Time Limit Exceeded | 1000 MS | 268 KB | 334 | 2025-01-23 17:13:44 |
#include <iostream> #include <cmath> // 引入数学库,用于计算向上取整 using namespace std; int main() { int N; while (cin >> N) { // 直接计算第N个美丽数 int result = (N * 15 + 6) / 7; // 等价于向上取整 (N * 15) / 7 cout << result << endl; } return 0; }