|
|
Show all threads Hide all threads Show all messages Hide all messages | Help! I can't find error | Felix_Mate | 1995. Illegal spices | 4 Feb 2017 23:36 | 1 | My code: const nmax=111111; var a:array[1..nmax] of int64; n,k,p:longint; i,cnt,cntmax,max:longint; sum:int64; BEGIN readln(n,k); read(p);
for i:=1 to n-k do a[i]:=1; sum:=n-k; cnt:=n-k; cntmax:=1; max:=2;
for i:=n-k+1 to n do begin if(100*cnt<p*(i-1)) then begin inc(max); inc(cnt,cntmax-1); cntmax:=1; end else inc(cntmax);
a[i]:=max; inc(sum,max); end;
writeln(sum); for i:=1 to n do write(a[i],' '); END.
| 11 10 34, 11 10 33, 11 5 100 | esbybb | 1995. Illegal spices | 16 Aug 2016 04:06 | 2 | 31 1 2 2 3 3 3 3 3 3 4 4 28 1 2 2 2 3 3 3 3 3 3 3 26 1 1 1 1 1 1 2 3 4 5 6 Edited by author 16.08.2016 04:04 11 5 50 16 1 1 1 1 1 1 2 2 2 2 2 11 5 75 18 1 1 1 1 1 1 2 2 2 3 3 | one puzzle | wust_tuzhaofeng | 1995. Illegal spices | 12 Jun 2015 00:15 | 6 | It is says, at least p percent from the total number of the bags that have already been checked If the total number includes current one? It does NOT include the current one. (and the statement should say "of the total number" and not "from the total number") | deleted | Krasnov | 1995. Illegal spices | 3 May 2014 16:56 | 2 | deleted Edited by author 26.10.2013 14:34 What is Test #6. Edited by author 11.10.2014 10:31 | %lld >> %I64d | twocoldz | 1995. Illegal spices | 28 Oct 2013 12:05 | 1 | i use the greedy,but wa on #5! the faq say "use %lld to output the long long" but it's should be %I64d.. F**K waste my two days. the server use windows instand of linux??? Edited by author 29.10.2013 13:14 |
|
|
|