Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136239 彭士宝 统计硬币 C++ Accepted 3 MS 276 KB 480 2025-11-09 22:28:41

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n, m; cin >> n >> m; int cnt = 0; for (int a = 0; a <= n; ++a) { for (int b = 0; b <= n; ++b) { int c = n - a - b; if (c >= 0 && a * 1 + b * 2 + c * 5 == m) { ++cnt; } } } cout << cnt << endl; } return 0; }