Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158156 袁昊贝 统计硬币 C++ Accepted 2 MS 272 KB 500 2026-08-20 16:53:18

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; int main(){ long long n,m,T; cin>>T; for (int i=0;i<T;i++){ int cut=0; cin>>n>>m; for (int z=0;z<=m/5;z++){ for (int y=0;y<=m/2;y++){ int x=n-z-y; if (x<0){ break; } if (x+y*2+z*5==m){ cut++; } } } cout<<cut<<endl; } return 0; }