数据不是很大直接枚举约数判断4个条件是否满足这样就得到4种卡片总共2^4种情况枚举各种情况即可直接枚举约数判断4个条件是否满足 这样就得到4种卡片总共2^4种情况枚举各种情况即可
这样就得到4种卡片总共2^4种情况枚举各种情况即可


1 #include 2 #include 3 #include 4 #define MAX 5000005 5 #define ll long long 6 using namespace std; 7 bool ispri[MAX]; 8 int extra[4]; 9 struct card 10 { 11 int score,num,s; 12 }p[1002]; 13 bool cmp(const card 15 } 16 void init(){ 17 ll i,j; 18 ispri[1]1; 19 for (i2;i 转:https://www.cnblogs.com/xin-hua/p/3219218.html