Common BoardShow all threads Hide all threads Show all messages Hide all messages | Why 2 | MYV | 1638. Bookworm | 7 Aug 2011 05:20 | 11 | Why 2 MYV 11 Oct 2008 13:25 Почему в примере ответ 2 ? Непонимаю условия! Please post in english , It was my problem too!! I want to know the answer А я знаю. Последний лист книги слева а первый справа. Like yeah, the books _are_ on the bookshelf. i want to know,too Edited by author 11.10.2008 13:48 because the front-cover of the i_th book is next to the back-cover of the (i+1)_th book Re: Why 2 Siroj Matchanov [TUIT] 28 Jul 2011 01:04 Hint: Imagine the books mounted on the bookshelf... | Give me answer n=2,3,4 plz.... | Poleshuk_N | 1385. Interesting Number | 7 Aug 2011 05:09 | 5 | My answer is n=2 : 140 n=3 : 1400 n=4 : 14000 Edited by author 23.12.2005 20:41 You can find answer for n=2 yourself with bruteforce solution. And it's not 140. :) Good luck! I solve this problem: n=1 -> write(14) n=2 -> write(155) n=3 -> write(1575) n=4 -> write(15750) n=5 -> write(157500) ................. n=m -> write(157500...00) (n-3 zeros) Edited by author 24.12.2005 07:42 Edited by author 24.12.2005 07:43 Угу... счас! WA#7! Хотя моя программа выдаёт те же самые числа до n = 5 включительно, дальше считать не стал, ибо придётся загнать комп до чёрного дыма >___<" Poleshuk_N is right. Try to solve this as a mathematical problem! Here are some ideas for you. Let "m=a*10^n+b". 'a' divides 'm', hence 'a' divides "b=m-a*10^n", too. Let "b=k*a", where 'k' is a natural number (it cannot be zero as 'b' cannot be zero). Moreover, "k<10" (obvious). On the other hand, 'b' divides 'm', hence 'b' divides "a*10^n=m-b", too. This means that "(a*10^n)/b=(a*10^n)/(k*a)=(10^n)/k" is integer. Thus 'k' is a divisor of '10^n': 1,2,4,5 or 8. But don't forget two special cases: 1) if "n=1", 'k' may be one of: 1,2,5; 2) if "n=2", 'k' may be one of: 1,2,4,5. Then you can perform some simple calculations and find out the answer. Edited by author 07.08.2011 05:12 | Бред! | NickSergeev[MSU MindCraft] | 1741. Communication Fiend | 6 Aug 2011 21:45 | 6 | Бред! NickSergeev[MSU MindCraft] 1 Nov 2009 15:05 поменял long long на int64 все прошло, полный Бред! 0_o как?? int64 дает Compilation In the FAQ there are recomendations about using of 64-bit numbers with different compilers. I spend about 1 hour to find a bug in my programm, then I change long long to __int64 and got Ac. It is a full SHIT!!! Edited by author 02.11.2009 17:06 I got AC using "long long". The last post was in 2009 year... may be things changed since | WA 19 in java and c but accepted in c++ .please help. Oh finally AC in all c,c++ and java. | Anupam Ghosh, Wipro Technologies | 1785. Lost in Localization | 6 Aug 2011 21:28 | 1 | was doing a silly spelling mistake. Edited by author 06.08.2011 22:32 Edited by author 06.08.2011 22:32 | Trivial O(N^4) algorithm easily passes system tests | it4.kp | 1146. Maximum Sum | 6 Aug 2011 21:25 | 4 | My algo is O(N^4) too,AC in 0.046sec... Do you know a method how to solve it faster??? My algo is O(N^3). I just read the input matrix row by row and store the maximal sum of subrectangle for each bottom side projection using DP. I did it with 0.015 secs (never did faster). | Sorry. Problem specification is not correct. It will be corrected soon. | Pavel Egorov (USU) | 1328. Fireball | 6 Aug 2011 21:11 | 3 | In fact, you should consider, that until the last collision, fireball can fly through the wizard and the target. Sorry once again... Problem Author На самом деле надо считать, что вплоть до последнего столкновения файрболл может пролетать сквозь чародея и цель. Еще раз прошу прощения. Автор задачи. Text is still unclear... if fireball is passing through the enemy and not loosing its level, so why do 0-level one hit the enemy? this contradicts to statement (fireball can pass through any obstacle except wall)... even more - why in this case 0-level fireball is not hitting us? Edited by author 06.08.2011 21:40 | TLE 36 | Anton Chaplygin[Kungur,Perm kray] | 1406. Next Number | 6 Aug 2011 20:40 | 1 | TLE 36 Anton Chaplygin[Kungur,Perm kray] 6 Aug 2011 20:40 | What test7 looks like? | lenny | 1316. Electronic Auction | 6 Aug 2011 14:25 | 1 | WA7, and I want to know is it round problem or fault in my data structure. Tests like test7 will be very helpful for me Edited by author 06.08.2011 14:27 | shit!I'm not familiar with java.......why i always got crash!!! | AC | 1074. Very Short Problem | 6 Aug 2011 13:42 | 1 | | what's the edition of ural's pascal?why my code got Compilation error? | xiaoc | 1519. Formula 1 | 6 Aug 2011 12:04 | 2 | const zs=699967; type size=record di,zhuan:longint; x,y:integer; end; var dz:array[0..14329,1..2] of longint; dui:Array[0..14329,1..2] of int64; hash:array[0..700000] of size; xx,s1,s2,pd,n,m,i1,i2,zhuan,l1,l2,nzhuan,k:longint; d:Array[1..2] of longint; map:Array[0..13,0..13] of char; san:array[0..13] of longint; zhi:int64; i,j,ii:longint; procedure swap(var a,b:longint); var t:longint; begin t:=a; a:=b; b:=t; end; function zb(nzhuan:longint):longint; begin zb:=nzhuan mod zs; while (hash[zb].x=i) and (hash[zb].y=j) and (hash[zb].zhuan<>nzhuan) do begin inc(zb); zb:=zb mod zs; end; end; procedure jiaru(nzhuan:longint;zhi:int64); var nzb:longint; begin if ((map[i+1,j]='*')and (nzhuan div san[j-1] mod 3>0)) or ((map[i,j+1]='*')and (nzhuan div san[j] mod 3>0)) then exit; nzb:=zb(nzhuan); if (hash[nzb].x<>i)or (hash[nzb].y<>j) then begin inc(d[i2]); dz[d[i2],i2]:=nzhuan; dui[d[i2],i2]:=zhi; hash[nzb].x:=i; hash[nzb].y:=j; hash[nzb].di:=d[i2]; hash[nzb].zhuan:=nzhuan; end else begin inc(dui[hash[nzb].di,i2],zhi); end; end; begin san[0]:=1; for i:=1 to 13 do san[i]:=san[i-1]*3; readln(n,m); for i:=1 to n do begin for j:=1 to m do begin read(map[i,j]); if i=1 then map[i-1,j]:='*'; if i=n then map[i+1,j]:='*'; if j=1 then map[i,j-1]:='*'; if j=m then map[i,j+1]:='*'; end; readln; end; map[0,0]:='*'; map[0,m]:='*'; for i:=0 to 600000 do hash[i].x:=0; dui[1,1]:=1; dz[1,1]:=0; i1:=1; i2:=2; d[1]:=1; for i:=1 to n do begin for j:=1 to m do begin d[i2]:=0; for ii:=1 to d[i1] do begin zhuan:=dz[ii,i1]; zhi:=dui[ii,i1]; l1:=zhuan div san[j-1] mod 3; l2:=zhuan div san[j] mod 3; if l1+l2=3 then begin if (l1=1)and (l2=2)and ((i<>n) or (j<>m)) then continue; nzhuan:=zhuan-san[j-1]*l1-san[j]*l2; jiaru(nzhuan,zhi); end else if l1+l2=0 then begin if map[i,j]='.' then nzhuan:=zhuan+san[j-1]*1+san[j]*2 else nzhuan:=zhuan; jiaru(nzhuan,zhi); end else if l1=l2 then begin if l1=1 then begin pd:=0; k:=j+1; while pd<>1 do begin inc(k); xx:=zhuan div san[k-1] mod 3; if xx=1 then dec(pd); if xx=2 then inc(pd); if pd=1 then s1:=k; end; nzhuan:=zhuan-san[j-1]-san[j]-san[s1-1]; jiaru(nzhuan,zhi); end else begin pd:=0; k:=j; while pd<>1 do begin dec(k); xx:=zhuan div san[k-1] mod 3 ; if xx=1 then inc(pd); if xx=2 then dec(pd); if pd=1 then s2:=k; end; nzhuan:=zhuan-san[j-1]*2-san[j]*2+san[s2-1]; jiaru(nzhuan,zhi); end; end else begin jiaru(zhuan,zhi); nzhuan:=zhuan-san[j-1]*l1-san[j]*l2; swap(l1,l2); nzhuan:=nzhuan+san[j-1]*l1+san[j]*l2; jiaru(nzhuan,zhi); end; end; swap(i1,i2); end; j:=m; d[i2]:=0; for ii:=1 to d[i1] do begin if (dz[ii,i1]div san[j]) >0then begin writeln('nimeia'); continue; end; inc(d[i2]); dz[d[i2],i2]:=dz[ii,i1]*3; dui[d[i2],i2]:=dui[ii,i1]; end; swap(i1,i2); end; if d[i1]<>1 then writeln('0')else writeln(dui[1,i1]); end. I see! ural no function ,only procedure! (haha Chinglish!) | WA 3 | Grasshopper | 1001. Reverse Root | 6 Aug 2011 09:21 | 2 | WA 3 Grasshopper 27 Jul 2011 02:10 Where can be a problem? Wrong answer 3 Pascal program coun; var a:array[1..1000000] of extended; i,j:integer; k:extended; begin i:=0; repeat read(k); i:=i+1; a[i]:=sqrt(k); until eof(); for j:=i-1 downto 1 do begin writeln(a[j]:0:5); end; end. Do read() unite separated digits in correct values, to sqrt`em further? I think, something is here. | why | waterlink | 1402. Cocktails | 6 Aug 2011 02:57 | 2 | why waterlink 11 Apr 2011 00:51 why is solution with long double not working, long double must have 18 digits according to ISO c++, which must be enough to solve this problem i've calculated everything using g++ and long double, and formed a constant and got AC, which means that system compiler is bad.. The solution for the hardest case is the number "138879579704209680000" which has 21 decimal digits. You are just a lucky guy :) Maybe, because of its terminating zeroes, who knows. | Wrong answer 3 Help pls: ) | Tom | 1001. Reverse Root | 5 Aug 2011 14:21 | 4 | what s test 3 ? #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main(){
long double x; int i=0; long double tab[32768];
cout << setprecision(4) << fixed; cin >> x; while(!cin.eof()){ tab[i]=sqrt(x); i+=1; cin >> x; } for(int k=0;k<i;k++){ cout << tab[i-1-k] << endl; } getchar();getchar(); } Don't use "cout" or "cin",because they're not fast. WA is not about speed mate, besides my guess is they r fast enough here: ) thx anyway, will remember it WA is not about array size either. is would be memory crash than or smh like that thx again any other suggestions ? Edited by author 05.08.2011 14:24 Edited by author 05.08.2011 14:24 may be array tab is too small | WA#10 help pls | Tom | 1083. Factorials!!! | 5 Aug 2011 14:19 | 1 | what s test 10 ? here s my code, if U know what s wrong with the code without test 10 i would be most greatful to know it. thx - tom and btw what s the answer for n = 0 ? 1 or 0 ? anyway i checked it and it s not test 10. #include<iostream> #include<cstring> #include<string> using namespace std; int main(){
int k,n; string a; cin >> n; cin >> a; int i; i=0; k=0; int x =1; while(a[i]=='!'){ i++; k++; } if(!(n%k==0)){ if(n%k==1){ while(n!=1){ x*=n; n-=i; } } else x=n; } else{ while(n!=0){ x*=n; n-=i; } } cout << x; getchar();getchar(); } Edited by author 05.08.2011 14:34 | Why I ma getting wrong answer | Jai | 1005. Stone Pile | 5 Aug 2011 01:48 | 1 | | Don't forget to put "." at the end of No solution | marat | 1004. Sightseeing Trip | 5 Aug 2011 01:28 | 1 | | Test Cases Here (Enjoy) | Varun Sharma | 1638. Bookworm | 5 Aug 2011 00:42 | 2 | Input:- 10 20 3 6 Output:- 140 Input:- 30 65 45 12 Output:- 5310 Input:- 99 99 2 100 Output:- 29007 Input:- 50 50 1 87 Output:- 12850 Input:- 33 66 43 100 Output:- 9372 Input:- 54 100 2 77 Output:- 18996 Input:- 1 1 100 54 Output:- 139 Edited by author 30.04.2009 12:11 Edited by author 30.04.2009 12:11 Thank you very much. These are useful considering the not-so-clear problem statement. | what s wrong here ? WA2 | Tom | 1639. Chocolate 2 | 4 Aug 2011 23:05 | 2 | i dont get it at all...it looks good though. at least to me help pls #include<iostream> using namespace std; int main(){
int m,n,a; cin >> m >> n; a=(m*n)%2; if(a==0) cout << "[:=[first]"; else if(a==1) cout << "[second]:=]"; } ok. = mark in "[second]:=]" is in the wrong place. should be "[second]=:]" . O_O - embarrassed. always something to learn. | why 19? | void | 1788. On the Benefits of Umbrellas | 4 Aug 2011 22:43 | 5 | how we get 19 in example? don't understand how got odd number. my answer is 20. i also can't catch it.Explain it pls,if it is possible. And I also can't understand the answer 19(( All right!!! one boy take one girl and ans=8*1+6*1+4*1+1=19 | Crash (access violation) on test data 12 | alkaid | 1019. Line Painting | 4 Aug 2011 21:43 | 3 | Can you help me with this, I'm getting this error on 12th test data. Thanks test 12 contains large amount of intervals. I've had access violation on this test too. Expansion of your data structure should help. Oh, I see :). btw this problem can be solved by simple storing sorted white intervals into array. For each new interval it takes O(log(N)) to detect set of previous interval, that have to be affected. And then - memmove (in cpp) for shifting array. That was my first solution. |
|
|