Problem-solving ideas: In fact, is to find the largest collection of energy composition. Max (A[1],a[2],a[3].........a[n])/gcd (a[1],a[2],a[3],...... a[n])
Problem Solving Code:
1 //File name:e.cpp2 //Author:darkdream3 //Created time:2015 April 13 Monday 13:56 11 seconds4 5#include <vector>6#include <list>7#include <map>8#include <Set>9#include <deque>Ten#include <stack> One#include <bitset> A#include <algorithm> -#include <functional> -#include <numeric> the#include <utility> -#include <sstream> -#include <iostream> -#include <iomanip> +#include <cstdio> -#include <cmath> +#include <cstdlib> A#include <cstring> at#include <ctime> - #defineLL Long Long - - using namespacestd; - intT; - intN; in intgcdintAintb) - { to returnb = =0? A:GCD (b,a%b); + } - intMain () { theCIN >>T; * inttmp; $ while(t--){Panax NotoginsengCIN >>N; -CIN >>tmp; the intAns =tmp; + intMX =tmp; A for(inti =1; i < N;i + +) the { +CIN >>tmp; -Ans =gcd (ans,tmp); $MX =Max (TMP,MX); $ } - if((mx/ans-n)%2==0 ) -printf"lose\n"); the Elseprintf"win\n"); - }Wuyi return 0; the}
View Code
Acdream Hut Freshman Training tournament E-Nana Sleepwalking Wonderland Series--inexplicable episode number theory