|
|
вернуться в форумWhere different? Послано Mirrus 9 июн 2006 18:35 Where different in Pascal 1) round(k/2) and 2) (k+1) div 2 with 1) - WA#1 with 2) - AC Edited by author 09.06.2006 18:41 Edited by author 09.06.2006 18:41 Edited by author 09.06.2006 18:41 Re: Where different? Послано ILYA 22 июн 2006 18:33 probably, not round(k/2), but trunc(k/2) Re: Where different? Послано Alexey 22 июн 2006 18:51 No, not trunc(k/2). For example, if k=5, round(k/2)=2 (k+1) div 2=3. Edited by author 23.06.2006 13:22 Re: Where different? Послано Cemil 14 фев 2007 22:05 Why (k+1) div 2 ?? Write (k) div 2 and it'll be ok. Re: Where different? I wrote g:=g + (a[i] div 2 + 1) because we have to take more than half. For example : if a[i] = 5 then majority will be 3, and 3 we can get only using this expression g:=g + (a[i] div 2 + 1) |
|
|