fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. #define loop(i,a,b) for(int i=a; i<b; i++)
  6. #define rep(i,b) loop(i,0,b)
  7.  
  8. int choose[][2] = {
  9. {0,1},
  10. {0,2},
  11. {0,3},
  12. {1,2},
  13. {1,3},
  14. {2,3}
  15. };
  16.  
  17. int main(){
  18. size_t ans[17]={0};
  19. rep(i,6)rep(j,6)rep(k,6)rep(l,6){
  20. int n=0;
  21. rep(choise,16){
  22. int used=0;
  23. used|=1<<(choose[i][choise>>0&1]);
  24. used|=1<<(choose[j][choise>>1&1]);
  25. used|=1<<(choose[k][choise>>2&1]);
  26. used|=1<<(choose[l][choise>>3&1]);
  27. if(used==15) n++;
  28. }
  29. ans[n]++;
  30. }
  31. rep(i,17){
  32. cout<<i<<" "<<ans[i]<<endl;
  33. }
  34. }
  35.  
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
0 342
1 0
2 936
3 0
4 18
5 0
6 0
7 0
8 0
9 0
10 0
11 0
12 0
13 0
14 0
15 0
16 0