|
|
back to boardwhat difference in this code? for (int z = i+1; z < n; z++) { __int64 r = (((__int64)a[j][z])*a[d][i] - ((__int64)a[j][i])*a[d][z]); a[j][z] = mod(r); } a[j][i] = 0; for (int z = i; z < n; z++) { __int64 r = (((__int64)a[j][z])*a[d][i] - ((__int64)a[j][i])*a[d][z]); a[j][z] = mod(r); } first get AC, but second WA9 by the way, mod(0) == 0 const int P = (1<<30)-17; int mod(__int64 x) { int r = x % P; if (r < 0) r += P; return r; } Edited by author 05.05.2007 18:49 Re: what difference in this code? n = 2 i = d = 0 j = 1 a: 1 1 1 1 First result: 1 1 0 0 Second result: 1 1 0 1 Re: what difference in this code? thank you very much! |
|
|