Let'sdefinelogicalORasanoperationontwologicalvalues(i.e.valuesthatbelongtotheset{0, 1})thatisequalto1ifeitherorbothofthelogicalvaluesissetto1,otherwiseitis0.WecandefinelogicalORofthreeormorelogicalvaluesinthesamemanner:whereisequalto1ifsomeai = 1,otherwiseitisequalto0.NamhasamatrixAconsistingofmrowsandncolumns.Therowsarenumberedfrom1tom,columnsarenumberedfrom1ton.Elementatrowi(1 ≤ ...
Forapositiveintegernlet'sdefineafunctionf:f(n) = - 1 + 2 - 3 + .. + ( - 1)nnYourtaskistocalculatef(n)foragivenintegern.InputThesinglelinecontainsthepositiveintegern(1 ≤ n ≤ 1015).OutputPrintf(n)inasingleline.Sampletest(s)input[crayon-6804f4b64940c455023751/]output[crayon-6804f4b649414326827936/]input[crayon-6804f4b649417420788392/]output[crayon-6804f4b64941a761206496/]N...
近期评论