Show all threads Hide all threads Show all messages Hide all messages |
WA, please help | Danica Porobic | 1057. Amount of Degrees | 15 Sep 2016 00:44 | 3 |
I've tried to use Lalescu Liviu's method described on the webboard, but my implementation has some minor bug I can't find. Can someone please help me by sending me ac program in pascal? In return, I can send some of my ac-ed programs... I had same problem. Maybe, you should pay attention to binomial coeficients' computation method (check long integers for overflow). I also had this problem with the binomial coefficients, because I was using the formula with factorials and long long. It shows up under this test: 1 2000000000 15 2 answer: 286658146 |
what's the case answer? | Glory | 1057. Amount of Degrees | 14 Aug 2015 09:30 | 1 |
111 211 3 10 the answer is 0 or 1... why? thanks you.. |
Who can give me some test data? I always get WA. | Li Yi | 1057. Amount of Degrees | 20 Mar 2015 01:59 | 13 |
maxlongint maxlongint 2 2 1 1 2 2 Good Luck !! Both of the answers are zero, is that right? > maxlongint maxlongint > 2 > 2 > > 1 1 > 2 > 2 > > Good Luck !! more Vua moi chay xuong nha xem phim duoc 1 ty, len chung no da lam x 3 Oct 2001 19:03 1 maxlongint 2 2 Good Luck ! Re: more Narate Taerat 10 Mar 2002 23:32 All Tests You Give I'm Right But I'm WA on Test7 Can you give me more Edited by author 31.08.2005 18:40 Test: 1 2147483647 20 2 Answer: 84672315 Test: 1 2147483647 13 3 Answer: 77520 Re: more sNow.winter.OIer 5 Jan 2011 11:43 I also got wa on test7,but the answer to your test is right.help. you kan use srank() function generate some random Numbers.then get answers! INPUT: 11445 15494 4 4 15058 26207 4 2 12750 12846 8 4 732 2989 9 3 749 12704 1 7 14656 26121 14 7 16994 21479 9 3 4648 19157 8 2 12866 14795 10 7 9980 30071 1 9 9052 17238 11 2 10029 19550 4 8 20819 23330 15 6 8962 30778 1 3 6203 19518 3 3 11637 31672 4 5 21687 23438 1 2 18506 19510 6 10 17544 25821 5 3 1348 10295 15 4 374 11047 5 4 18148 24741 10 6 915 13370 11 2 20304 20342 3 6 21842 26940 15 10 3256 23852 7 8 6582 23422 2 9 12158 21258 4 10 20670 29891 14 6 8045 12108 4 8 3143 7795 3 9 23581 25647 15 6 9414 31532 3 5 240 2698 1 2 13974 28320 8 2 22376 27437 12 2 3448 15240 2 3 26614 28463 5 8 1 100000000 20 2 ANSWER: 0 342 0 0 1 0 1 2928 0 0 286 0 0 1 28 20 0 0 70 0 21 0 154 0 0 0 2 0 0 0 6 0 15 4 3148 76 8 1 373295 Little correction to above answers :) one before the last and some other tests will result 0 instead of 1 and the answer 21 should be 20 Also, for 16994 21479 9 3 correct answer is 0, not 1 Some of your data is wrong →_→ |
why Time limit exceeded 7? how to solve this problem? | Raximov Ilxom(UrSU)//(r_ilxom2012@mail.ru) | 1057. Amount of Degrees | 12 Mar 2014 16:17 | 4 |
who know this problem!Time limit exceeded 7 help me please Edited by author 13.06.2013 22:47 Edited by author 13.06.2013 22:48 it may be stack overflow.can you speak chinese??? |
puzzle | lian lian | 1057. Amount of Degrees | 12 Feb 2013 20:54 | 5 |
puzzle lian lian 3 Sep 2008 10:23 my program output result: 1 1000000000 3 13 -> 84 1 1 2 2 ---> 0 1 100 2 4 ->6 1 300 4 8 ->0 1 400 4 2 ->111 1 2147483647 13 3 --> 77520 1 2147483647 20 2 --> 84672315 1 3 1 2 --> 2 is right? if full right , but i alway wa #7, who can give much testdata to me ? Edited by author 03.09.2008 10:39 Edited by author 05.09.2008 02:08 all your answers are correct. tests you asked: 1 8 2 3 --> 1 1 900 2 10 --> 3 1 123456789 4 10 --> 126 1 999999999 8 10 --> 9 Thanks for your test,I'v got AC this problem! all your answers are correct. tests you asked: 1 8 2 3 --> 1 1 900 2 10 --> 3 1 123456789 4 10 --> 126 1 999999999 8 10 --> 9 Thanks from me too for the excellent testset! |
if Wa on test#2,try this case | ykwd | 1057. Amount of Degrees | 18 Oct 2012 12:41 | 1 |
|
Why I always WA test #2 | hanguangxing | 1057. Amount of Degrees | 5 Oct 2011 17:59 | 1 |
|
WA 4 why? | WAVwind | 1057. Amount of Degrees | 15 Jul 2011 08:41 | 1 |
|
I'm mad | Mato_No1 | 1057. Amount of Degrees | 21 Oct 2010 15:17 | 4 |
Why does my program always get WA#1? I have tried all the tests in the forum, and all of them are correct. I think there is a very strange mistake in my program. #include <stdio.h> #define re(i, n) for (int i=0; i<n; i++) #define rre(i, n) for (int i=n-1; i>=0; i--) const int MAXN = 32; int b, k; long long c[MAXN][MAXN], res = 0; void prp(void) { re(i, MAXN) re(j, MAXN) if (i < j) c[i][j] = 0; else if (!j) c[i][j] = 1; else c[i][j] = c[i - 1][j - 1] * i / j; } long long xxx(long long v) { int a[MAXN], len = 0; long long r0 = 0; while (v) {a[len++] = v % b; v /= b;} int k0 = k; rre(i, len) { int x = a[i]; if (x >= 2) {r0 += c[i + 1][k0]; break;} if (x) {r0 += c[i][k0]; k0--;} } return r0; } int main(void) { long long s, t; scanf("%lld%lld%d%d", &s, &t, &k, &b); prp(); res = xxx(t + 1) - xxx(s); printf("%lld\n", res); return 0; } Edited by author 04.09.2010 20:07 I know where the mistake is. If "k0" is less than 0, it must exit. Now I got AC. The test is: 1 30 2 2 --> 10 Right! Right! you must book ticket to madhouse, ok? |
Any simple approach? | Artem Khizha [DNU] | 1057. Amount of Degrees | 5 Sep 2010 15:46 | 1 |
Well, after all, I solved this problem, but it took a long time for me to find all mistakes in my calculations. My idea was to generate F[N,K] in a O(log(N)*log(N)) time, which means an amount of numbers with N or less digits (in a certain base) with K one-digits. Then I wrote a function C(N, K), which finds an amount of numbers with K one-digits in [1, N] using F and deleting its first digit every time. Actually it's all about dynamic programming. But I think there must be more clear and efficient solutions, than mine (O(log(N)*log(N)) for time and memory). If it does, please, would you be so kind to share it? |
Error in Problem 1057 | Sardor | 1057. Amount of Degrees | 9 May 2010 13:56 | 2 |
It says: 17=2^4+2^0 18=2^4+2^1 20=2^4+2^2 But, since the limit is [15;20], 16 must also be included: 16=2^3+2^3 Create a code to determine the amount of integers, lying in the set [X;Y] and being a sum of exactly K different integer degrees of B. DIFFERENT degrees! |
HELP!!! | Saturn | 1057. Amount of Degrees | 5 Apr 2010 10:50 | 5 |
My program gives right answer all tests in the forum but T've got WA#2.Please give me some test Thanks I have WA #2 too. Can you give me some tests? Some tests: 1 100 2 4 ->6 1 300 4 8 ->0 1 400 4 2 ->111 You can use this full search program to check: ////////////// var x,y,k,b,p,q:longint; function kt(s:longint):longint; var a:array[1..40]of longint; sd,i,j:longint; begin sd:=0; repeat inc(sd); a[sd]:=s mod b; s:=s div b; until s=0; j:=0; for i:=1 to sd do if a[i]=1 then inc(j) else if a[i]>1 then begin kt:=0; exit; end; kt:=j; end; begin read(x,y,k,b); p:=0; for q:=x to y do if kt(q)=k then inc(p); writeln(p); end. ///////// Good luck! |
Why WA6 | Rabidstorm | 1057. Amount of Degrees | 5 Aug 2009 13:18 | 1 |
Why WA6 Rabidstorm 5 Aug 2009 13:18 This is my program: program Ural1057; var a,l,r,n,k,ans:longint; p:array[0..200]of longint; d:array[0..200]of qword; num:qword; procedure dfs(o:longint); var i:longint; begin for i:=p[o-1]+1 to 30 do begin p[o]:=i; num:=num+d[p[o]]; if num>r then begin num:=num-d[p[o]]; exit; end; if o=n then begin if l<=num then inc(ans); end else dfs(o+1); num:=num-d[p[o]]; end; end; begin readln(l,r,n,k); fillchar(p,sizeof(p),0); d[0]:=1; a:=1; while (d[a-1]<r)and(a<40) do begin d[a]:=d[a-1]*k; inc(a); end; ans:=0; num:=0; p[0]:=-1; dfs(1); writeln(ans); end. I don't know why Wa6, who can help me? |
I can`t understand why this prob gives 2 secs... | Chan-Min Kim | 1057. Amount of Degrees | 22 Apr 2009 12:29 | 4 |
Because not all from Korea :) Anything hostile very very very interested problem !!! :-) But you dont get AC хD I got WA on test 9 too =( |
Is it right? | Kopeliovitch Sergey (1) | 1057. Amount of Degrees | 21 Feb 2009 03:54 | 5 |
Test: B = 3 K = 2 X = 90 Y = 100 Result: 2 Is it right? If not what is the right result of this test and why? Right answer is 1: 90=3^2+3^4 Good luck! 1 2147483647 15 2 right answer = 300540195? |
What is test 2 | sillyboy | 1057. Amount of Degrees | 25 Nov 2008 22:15 | 1 |
All of test you gave in discuss , my program took the right answer , but it wa in test 2 . Can you help me ? Edited by author 25.11.2008 22:17 Edited by author 25.11.2008 22:17 Edited by author 25.11.2008 22:19 |
who has the new testdatas of ural 1057 ? | lian lian | 1057. Amount of Degrees | 19 Sep 2008 00:15 | 3 |
My program gives right answer all tests in the forum but T've got WA#1 You have WA#1, because input and output long long integers in the wrong way. Read FAQ, section "How to submit a C/C++ program" thank you, you are right, now i get ac! thanks |
Some new tests should be added. | Burunduk1 | 1057. Amount of Degrees | 9 Sep 2008 02:18 | 4 |
I've investigated my old solution... It doesn't pass tests like 1 8 2 3 1 900 2 10 1 123456789 4 10 1 999999999 8 10 but gets AC. Yes, tests in this problem are weak. Your tests were added, 204 submits lost AC verdict. If you have more tricky tests, you are welcome (acm_support@acm.timus.ru). Thanks. what is resutl the test data? As said, it results in 204 angry people. Approximate answers (to prevent hardcoding): 1 0<X<50 100<X<200 0<X<50 Edited by author 09.09.2008 02:20 |
look this | 连连 | 1057. Amount of Degrees | 27 Aug 2008 06:28 | 6 |
I input test data: 100 200 3 3 Is the example right? 100 = 3^ 4 + 2 * (3^2) + 1
109 = 3^4 + 3^3 + 3^0 117 = 3^4 + 3^2 + 3^1 141 = 3 ^4 + 2* (3^3) + 2 * 3 which model is right ? or all right ? Edited by author 07.08.2008 08:27 The models of 100 and 141 are wrong. The other two ones are right. the sum of exactly three integer degrees of number 3, why are models of 100 and 141 wrong? who can tell me why ? Edited by author 09.08.2008 22:57 Edited by author 09.08.2008 22:57 because the problem told us to do so 100 = 3^4 + 2 * (3^2) + 1 141 = 3^4 + 2 * (3^3) + 2 * 3 This ones are incorrect because when you miltiply one of the degree by 2 It becomes 100 = 3^4 + 3^2 + 3^2 + 1 141 = 3^4 + 3^3 + 3^3 + 3 + 3 so, it's sums of 4 and 5 degees, not 3. Besides, it are to be different. Edited by author 26.08.2008 13:13 thanks a lot, the qustions perplex me a long time, thank you |
what's the text8? | wjt | 1057. Amount of Degrees | 8 Jun 2008 15:14 | 2 |
If you get WA9 check your solve for tests when B = 10. :-) |