Pit = =
Selected several times the prime number, found that this group of reliable
Idea: After each mod to find out all the solution, and then mod again, look at the complexity of almost all the output will not repeat the line
ConstMiArray[1..7] ofInt64= (12537,15437,17647,14677,10003,10009,10007);varN,m,shi,sum,x:int64; I,j,k,y1:longint; A:Array[-1..102,-1..10000+9] ofInt64; Flag:Array[-1..1000000+9] ofBoolean; C:char; B:Array[-1..102,1..7] ofInt64; F:Array[-1..100000,1..7] ofBoolean; beginreadln (n,m); Fillchar (flag,sizeof (flag), true); Fillchar (F,sizeof (f), true); fori:=0 toN Do beginread (c); ifC='-' Then beginj:=0; y1:=-1;End Else beginy1:=1; j:=1; Val (C,a[i,1],K);End; A[i,1]:=a[i,1]*Y1; while notEoln Do beginInc (J); Read (c); Val (c,a[i,j],k); A[I,J]:=a[i,j]*Y1; End; A[i,0]:=J; READLN; End; fork:=1 to 7 Do fori:=0 toN Do beginShi:=1; forJ:=a[i,0]Downto 1 Do beginB[i,k]:= (B[i,k]+a[i,j]*shiMoDMI[K])MoDMi[k]; Shi:=shi*Ten MoDMi[k]; End; End; fork:=1 to 7 Do fori:=1 toMI[K] Do beginsum:=0; x:=1; forj:=0 toN Do beginsum:= (Sum+x*b[j,k]MoDMI[K])MoDMi[k]; X:=x*iMoDMi[k]; End; ifSum<>0 Thenf[i,k]:=false; End; Sum:=0; fori:=1 toM Do fork:=1 to 7 Do if notF[iMoDMI[K],K] Then beginFlag[i]:=false; BreakEnd; fori:=1 toM Do ifFlag[i] ThenInc (SUM); Writeln (sum); fori:=1 toM Do ifFlag[i] ThenWriteln (i); End.
The students who want to learn this problem must play it by themselves, very important 23333
Like on the collection, Vic private qq:1064864324, add me to discuss issues together, and progress
[noip2014] Solution equation hash+ Qin