Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136093 蔡胤泽 统计硬币 C++ Accepted 459 MS 268 KB 441 2025-11-09 15:01:31

Tests(1/1):


Code:

#include <iostream> using namespace std; int main() { int t; cin >> t; for(int i = 1; i <= t;i++) { int n, m; cin >> n; cin >> m; int s = 0; for(int a = 0;a <= n;a++) { for(int b = 0;b <= n;b++) { for(int c= 0;c <= n;c++) { if(a + 2 * b + 5 * c == m&& a + b + c == n) { s++; } } } } cout << s << endl; } return 0; }