Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
101951 Tom0 换零钱2 C++ 通过 100 0 MS 240 KB 298 2023-09-11 14:31:59

Tests(10/10):


#include <iostream> #include <algorithm> using namespace std; typedef long long LL; LL n, ans; int main() { cin >> n; for (int i = 1; i <= n/10; i++) { int j = (n - i*10) / 5; ans += j; if (j && i * 10 + j * 5 == n) ans--; } cout << ans << endl; return 0; }


测评信息: