摘要: gcd为找最大公因数,数组要求从小到大,那么排序,表明下标,原序列下标和排序后序列下标不一,那么看能不能交换(能不能与最小的gcd)能yes不能no 代码 #include<stdio.h> #include<iostream> #include<algorithm> using namespace 阅读全文
posted @ 2021-05-03 13:10 TYoUer 阅读(184) 评论(0) 推荐(0)
摘要: 要求要c的值最大,就不能出现负数,只有当b中没有2时,才不出现负数。然后加上可以组成的正数就可以了(其他组合都是0); 代码 #include<stdio.h> int main(){ int n,a[4],b[4]; scanf("%d",&n); while(n--){ int c=0; sca 阅读全文
posted @ 2021-05-03 12:12 TYoUer 阅读(57) 评论(0) 推荐(0)