1 9 1 1 1 2 3 3 3 3 3
3 1 1 2 5 3
AC碼:有點耗內存!
#includestruct node { int m,count; }num[100001]; int main() { int n,T,i,j,a; scanf("%d",&T); while(T--) { scanf("%d",&n); j=0; num[0].m=0; num[0].count=0; for(i=0;i
沒想到輸出還可以先放到緩存!
AC碼:
#includeint main() { int n,T,i,j,a,count; scanf("%d",&T); while(T--) { scanf("%d",&n); scanf("%d",&j); count=1; for(i=1;i