| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| HINT | Dawid Drozd | 1034. Ферзи в мирной позиции | 4 янв 2011 05:25 | 1 |
HINT Dawid Drozd 4 янв 2011 05:25 9 1 1 2 3 3 6 4 8 5 2 6 4 7 9 8 7 9 5 Analyze this test answer is 2 you must count combinations of y and x.Do this on paper that helps me and i got AC |
| HINT | hoan | 1441. Из истории банка Гринготтс | 3 янв 2011 23:27 | 1 |
HINT hoan 3 янв 2011 23:27 if your algo use euleraen tour and also add edge to the graph, note that the edge can be over that 20000. this test is good: 20000 19999 1 2 1 3 1 4 . . . 1 20000 GOOD LUCK & HAPPY NEW YEAR!!! |
| How use scanf for read short? | hoan | | 3 янв 2011 22:49 | 2 |
how i can read short ineger in C ++ with scanf ? i know that we can use "%d", for this but it's the only way to do this ??? (i think other way exist because my compiler has write warning for this: short n; scanf ("%d", &n); sorry for my very poor english.
Edited by author 04.01.2011 18:55 please HELP!!!! thanx. Edited by author 04.01.2011 18:55 |
| please give me idea to solve this problem, thanks!!! | hoan | 1430. Преступление и наказание | 3 янв 2011 19:57 | 5 |
Just full search. ~O(sqrt(N)) in the worst case. To avoid TL before search do: C = GCD(A,B); A /= C; B /= C; N -= (N%C); Think why you always can do this. GOOD LUCK! Oh! I forgot, that after that N must be divided by C too :) got AC now. thanx again & HAPPY NEW YEAR!!! |
| WA8 | r1d1 | 1154. Сражение магов | 3 янв 2011 19:20 | 2 |
WA8 r1d1 12 апр 2010 03:53 I have WA8. Many authors also haved WA8. Anybody, help me! Re: WA8 [RSU_Tash]Shavkat_Khusanov 3 янв 2011 19:20 I got WA8 too. Now AC. check it if Plights-Pdarkness<=0.0 then We can't win!!! if Plights-Pdarkness<0.0 then you will get WA8 Edited by author 03.01.2011 19:23 Edited by author 03.01.2011 19:24 |
| an interesting test | taobingxue | 1419. Карта мира 40 островов | 3 янв 2011 18:28 | 2 |
15 15 O-O-O-O-O-O-O-O |\| | | | | |/| O O-O-O-O-O-O O |\ /| O-O O-O-O-O O-O |/ /| | | |\ \| O O-O O-O O-O O | | | | | | | | O O-O O-O O-O O |\ \| | | |/ /| O-O O-O-O-O O-O |/ \| O O-O-O-O-O-O O |/| | | | | |\| O-O-O-O-O-O-O-O Edited by author 01.10.2009 19:57 Wow! This test really helped me with WA#12. I just forgot to check if the graph is connected before finding bridges. Thank you a lot! Edited by author 03.01.2011 18:28 Edited by author 03.01.2011 18:28 |
| Why WA6? | Slava Muravjev | 1259. Как стать звездой | 3 янв 2011 17:42 | 1 |
Why WA6? Slava Muravjev 3 янв 2011 17:42 Edited by author 03.01.2011 18:06 |
| Happy New Year, Timus ! | Oleg Strekalovsky [Vologda SPU] | | 3 янв 2011 16:34 | 2 |
|
| How to choose from answers the shortest one ? | nc | 1042. Центральное отопление | 3 янв 2011 14:28 | 1 |
we make equations for the input 3 1 3 -1 2 -1 1 2 3 -1 whe construct the maxtrix 1 0 1 = 1 0 1 1 = 1 1 0 1 = 1 The two answers 1 2 and 3 which is right ? |
| FLOOR SPACE IS INFINITE | Denis Koshman | 1490. Огненный круг | 3 янв 2011 12:50 | 2 |
Ignore statement about 1'000'000 square kilometers or you will get WA9 This statement is unnecessary. The size of the room is 1000 km, half of it is 500 km, but max radius is only 100 km. |
| Give me some tests please! | Loky_Yuri [USTU] | 1091. Тмутараканские экзамены | 3 янв 2011 07:03 | 8 |
And what answer for this test 2 50 -- Is it 462 or not? OK! I changed my code. It give the same answer, but I have WA#4 again. Can you give some tests? Try this: 26 12 0 --------- 2 2 0 --------- 6 24 952 Good Luck) Thank you! AC Now! Just stupid mistake! I wrote incorrect procedure to find is the number prime or not. Congradulations my friend) If you have WA4 try test 2 12 Edited by author 11.07.2007 12:43 Hi, Few test cases here: k = 2 s = 2 answer = 0 k = 2 s = 3 answer = 0 k = 2 s = 4 answer = 1 k = 2 s = 5 answer = 1 k = 2 s = 6 answer = 4 k = 2 s = 7 answer = 4 k = 2 s = 8 answer = 7 k = 2 s = 9 answer = 9 k = 2 s = 10 answer = 14 k = 2 s = 11 answer = 14 k = 2 s = 12 answer = 21 k = 2 s = 13 answer = 21 k = 2 s = 14 answer = 28 k = 2 s = 15 answer = 34 k = 2 s = 16 answer = 41 k = 2 s = 17 answer = 41 k = 2 s = 18 answer = 52 k = 2 s = 19 answer = 52 k = 2 s = 20 answer = 63 k = 2 s = 21 answer = 71 k = 2 s = 22 answer = 82 k = 2 s = 23 answer = 82 k = 2 s = 24 answer = 97 k = 2 s = 25 answer = 101 k = 2 s = 26 answer = 114 k = 2 s = 27 answer = 122 k = 2 s = 28 answer = 137 k = 2 s = 29 answer = 137 k = 2 s = 30 answer = 158 k = 2 s = 31 answer = 158 k = 2 s = 32 answer = 173 k = 2 s = 33 answer = 185 k = 2 s = 34 answer = 202 k = 2 s = 35 answer = 212 k = 2 s = 36 answer = 235 k = 2 s = 37 answer = 235 k = 2 s = 38 answer = 254 k = 2 s = 39 answer = 268 k = 2 s = 40 answer = 291 k = 2 s = 41 answer = 291 k = 2 s = 42 answer = 320 k = 2 s = 43 answer = 320 k = 2 s = 44 answer = 343 k = 2 s = 45 answer = 363 k = 2 s = 46 answer = 386 k = 2 s = 47 answer = 386 k = 2 s = 48 answer = 417 k = 2 s = 49 answer = 423 k = 2 s = 50 answer = 452 k = 3 s = 2 answer = 0 k = 3 s = 3 answer = 0 k = 3 s = 4 answer = 0 k = 3 s = 5 answer = 0 k = 3 s = 6 answer = 1 k = 3 s = 7 answer = 1 k = 3 s = 8 answer = 4 k = 3 s = 9 answer = 5 k = 3 s = 10 answer = 11 k = 3 s = 11 answer = 11 k = 3 s = 12 answer = 24 k = 3 s = 13 answer = 24 k = 3 s = 14 answer = 39 k = 3 s = 15 answer = 46 k = 3 s = 16 answer = 67 k = 3 s = 17 answer = 67 k = 3 s = 18 answer = 104 k = 3 s = 19 answer = 104 k = 3 s = 20 answer = 143 k = 3 s = 21 answer = 159 k = 3 s = 22 answer = 204 k = 3 s = 23 answer = 204 k = 3 s = 24 answer = 277 k = 3 s = 25 answer = 283 k = 3 s = 26 answer = 349 k = 3 s = 27 answer = 377 k = 3 s = 28 answer = 458 k = 3 s = 29 answer = 458 k = 3 s = 30 answer = 588 k = 3 s = 31 answer = 588 k = 3 s = 32 answer = 693 k = 3 s = 33 answer = 739 k = 3 s = 34 answer = 859 k = 3 s = 35 answer = 880 k = 3 s = 36 answer = 1061 k = 3 s = 37 answer = 1061 k = 3 s = 38 answer = 1214 k = 3 s = 39 answer = 1281 k = 3 s = 40 answer = 1470 k = 3 s = 41 answer = 1470 k = 3 s = 42 answer = 1732 k = 3 s = 43 answer = 1732 k = 3 s = 44 answer = 1945 k = 3 s = 45 answer = 2063 k = 3 s = 46 answer = 2294 k = 3 s = 47 answer = 2294 k = 3 s = 48 answer = 2631 k = 3 s = 49 answer = 2646 k = 3 s = 50 answer = 2952 Make sure that if your answer is greater than 10000 then only print 10000. |
| 1014 | Fadeev.E.V | | 2 янв 2011 22:24 | 5 |
1014 Fadeev.E.V 2 янв 2011 01:32 Has written an aaplet, but writes that 4 errors, nevertheless are correct. Help please. ________________________________________________________________________________________________________________ import java.io.*; class MyCl { public static String Min(int value) { if (value < 0) return ""; if (value == 0) return "0"; if (value == 1) return "1"; StringBuilder Sb = new StringBuilder();
for (int div = 9; div > 1; --div) { while (value % div == 0) { value = value / div; Sb.insert(0, div); } } if (value > 1) return "-1"; return Sb.toString(); } } class MyClass { public static void main(String[] arqs) throws IOException { int n; String str; BufferedReader br = new BufferedReader ( new InputStreamReader(System.in)); str = br.readLine(); n = Integer.parseInt(str); System.out.println(MyCl.Min(n));
} } ________________________________________________________________________________________________________________ please!!!!!!!!!!!!!!!!!!!!! Re: 1014 Sergey Lazarev (MSU Tashkent) 2 янв 2011 22:12 For n=0 answer is 10, not 0. |
| Very easy :D | kutenin | 1639. Шоколад 2 | 2 янв 2011 12:06 | 1 |
Edited by author 19.01.2011 21:01 Edited by author 19.01.2011 21:01 |
| Please, Help to find problem!!! | Slava Muravjev | | 2 янв 2011 02:03 | 1 |
There is number n in input. There is count of three numbers a,b,c<=n in output; a*b=c; sequence of numbers is important (a*b!=b*a); I can't find this problem! Help!!! Please!!! Write number or name of this problem!!! |
| Problem 1302 "Delta-wave" has been rejudged (+) | Sandro (USU) | 1302. Дельта-волна | 2 янв 2011 01:27 | 1 |
New tests were added. 153 authors lost AC. |
| Help me! | AXIS | 1145. Нить в лабиринте | 1 янв 2011 16:11 | 14 |
I always got Stack Overflow on test 6, help! [code deleted] Edited by moderator 13.02.2007 20:52 I don't remeber... Add this text in your program, before {APPTYPE CONSOLE} {$MAXSTACKSIZE $10000000} This number it is your stack size. Thanks) Stack size don't work, i tried. P.S. How to BFS?) Thanks) Stack size don't work, i tried. ) Whats the problem?? {$M 16000000} //From FAQ It's a kind of magic) i've forgotten Pascal completely... MaxStackSize - this is Delphi code... Now, it's WA6=) This problem gonna take my brain... Why WA??? It's a kind of magic) i've forgotten Pascal completely... MaxStackSize - this is Delphi code... Now, it's WA6=) The $MINSTACKSIZE and $MAXSTACKSIZE directives are used in Windows programming only. As I know 2 DFS is needed for this problem I've written two BFS - WA6. My idea in this code - finding in the vertex V the furthest vertexes, that they are in different subtrees in tree with root V. Something like that, hard to explain) First BFS - finding the free cell A that is the furthest from some free cell. Second BFS - finding the free cell B that is the furthest from cell A. AC finally.. But i don't understand, why dfs solve doesn't work AC finally.. But i don't understand, why dfs solve doesn't work I've solved it with dfs It's very simple and fast If you want I can send my solution to you Just 2 waves. I had WA#6, when I used short int instead of int for my lenght variable. Thanks {$M 16000000} helped me. finaly AC with 0.046s, but 10Mb memory. I used simple recursion. |
| No subject | NeMo | 1195. Крестики-нолики | 31 дек 2010 20:00 | 1 |
Edited by author 25.01.2011 21:45 |
| WA 8 and 9 | Dawid Drozd | 1795. Мужья в магазине | 31 дек 2010 14:05 | 1 |
These tests helps me 1 10 of milk 3 2 of milk 10 of milk 10 of milk Answer 5 1 2 of milk 3 10 of milk 1 of milk 10 of milk Answer 6 |
| Compilation Error..Please help | Shalini Sah | 1083. Факториалы!!! | 31 дек 2010 13:00 | 1 |
I have written this code in C++, and its running fine in Bloodshed DEV C++ and code::blocks. Then why am i getting compilation error whenever i submit it? Please help. #include<iostream> #include<conio.h> using namespace std; int main() { int n,j=0,i,m,r; long long fact=1; char space,c; n=getch(); n=n-48; cout<<n; space=getche(); c=getche();
while(c=='!') { c=getche(); j++; } cout<<endl; if(n%j==0) { i=0; m=n; while(m>=j) { fact=fact*m; i++; m=(n-(i*j)); } } else { i=0; m=n; r=n%j; while(m>=r) { fact=fact*m; i++; m=(n-(i*j)); } } cout<<fact<<"\n"; system("pause"); return 0; } Thanks in advance. Regards, Shalini Sah |
| Programme 1068 o | Fadeev.E.V | 1068. Сумма | 31 дек 2010 03:36 | 4 |
Greetings to all. I want to learn that such here with a problem number 1068, I all have correctly written that kompiliator from me demands, tell please. Here the *_Pascal_* language program: ___________________________________________ var s,i,n:integer; BEGIN s:=0; read(n); if (n>=0) then for i:=1 to N do s:=s+i; if (n<=0) then for i:=-1 downto N do s:=s+i; Writeln(s); END. ___________________________________________ You need calculate sum between 1 and N. So, if n<=0, you should sum 1,0,-1,-2,...N. But not -1,-2,...-N. |