diff --git a/HDOJ/5875_chen9510.cpp b/HDOJ/5875_chen9510.cpp new file mode 100644 index 0000000..780de3d --- /dev/null +++ b/HDOJ/5875_chen9510.cpp @@ -0,0 +1,48 @@ +// From http://www.cnblogs.com/chen9510/p/5862834.html +// ONLY For Test +#include +#include +#include +#include +#include +using namespace std; +int A[100005]; +int pos[100005]; +int s[100005]; + +int main() +{ + int T,N,M; + cin>>T; + while(T--) + { + scanf("%d",&N); + for(int i=1;i<=N;i++) + scanf("%d",&A[i]); + int num=1; + A[N+1]=-1; + s[1]=N+1; + for(int i=N;i>=1;i--)///单调栈; + { + while(A[i]r) break; + tmp=tmp%A[pos[l]]; + l=pos[l]; + } + printf("%d\n",tmp); + } + } + return 0; +}