#26994: GCD


alison.acorn@gmail.com (aa w)

School : 國立交通大學
ID : 160943
IP address : [140.113.45.193]
Last Login :
2021-11-29 11:10:26
a158. 11827 - Maximum GCD -- UVa11827 | From: [140.113.45.193] | Post Date : 2021-09-06 16:28

兩個迴圈列舉所有可能

for(int i = 0; i < n; i++){

    for(int j = 0; j < n; j++){

        if(i == j) continue;

        ...

    }

}

https://ideone.com/qxoOxb

 
ZeroJudge Forum