蓝桥杯c-c++省赛试题及答案解析 下载本文

sort(arr,arr+n,cmp); int top = 1;

for(i = 1; i < n ; i ++)

if(arr[i] != arr[i-1]) arr[top++] = arr[i]; n = top;

for(i = 0 ; i < n - 1; i ++) {

LL gcd = Gcd(arr[i],arr[i+1]); Fs[i].up = arr[i] / gcd; Fs[i].down = arr[i+1] / gcd; }

LL x = Fs[0].up; for(i = 0 ; i < n - 1 ; i ++) x = Get(x,Fs[i].up); LL y = Fs[0].down; for(i = 0 ; i < n - 1; i ++) y = Get(y,Fs[i].down); printf(\ return 0; }

(此文档部分内容来源于网络,如有侵权请告知删除,文档可自行编辑修改内容,

供参考,感谢您的配合和支持)

编辑版word