标签:scan printf hdu2566 枚举 amp stream == void str
思路:暴力枚举。
#include<cmath> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> int main(void) { int t; scanf("%d",&t); while(t--) { int cnt = 0 ; int n,m; scanf("%d%d",&n,&m); for(int i = 0; i <= n; i++) for(int j = 0; j <= n; j++) for(int k = 0; k <= n; k++) if(i+2*j+5*k==m&&i+j+k==n) cnt++; printf("%d\n",cnt); } return 0; }
标签:scan printf hdu2566 枚举 amp stream == void str
原文地址:https://www.cnblogs.com/AC-AC/p/9739633.html