| Show all threads Hide all threads Show all messages Hide all messages |
| Convex hull implementation | Orient | 1062. Triathlon | 29 Jun 2014 02:15 | 1 |
|
| Some coments | Leniwwwiy | 1294. Mars Satellites | 28 Jun 2014 23:07 | 2 |
* don't use double (use float) * don's foget fabs() I used double without problem! And there are solution without fabs(), your comment are not helpful |
| Say me why? | [PNTU]Sergiy D | 1079. Maximum | 28 Jun 2014 12:19 | 5 |
a_10=a_5=a_2+a_3=a_1+a_1+a_2=1+1+1=3 Why it's 4? 3 is the 10th element. So you should find a maximum of 10 elements. It's 4. Edited by author 22.03.2011 01:05 |
| Some tests for this problem... | Adhambek | 1866. Poetic Foot | 27 Jun 2014 18:41 | 2 |
My accepted program... test 1: 2 [a]-b-c-[d] [dac] kav-buar [ges] answer : dactyl test 2: 1 kab-car-[rvas]-rasr-ssrd [dsese] ad answer : anapaest test 3: 1 a b c [d] answer : not a poem If u have WA#5 also try this test: 1 [a] b c d answear: not a poem |
| About using BFS | skrcode | 1930. Ivan's Car | 27 Jun 2014 01:14 | 1 |
BFS solution gets accepted.. but it fails in many cases. However the perfect solution to be used is Dijkstra's. The test cases do not contain cases where cycles terminate at nodes in between source and destination. |
| Hint. | Gleb_Kazantaev(NNSTU) | 1640. Circle of Winter | 26 Jun 2014 23:58 | 1 |
Hint. Gleb_Kazantaev(NNSTU) 26 Jun 2014 23:58 It takes me 2 hours. Algo: x,y - the coordinates of a point Sandro. Use random values like this x = 0.666, y = 0.666. Radius of the circle = max distance to the enemy point. Good Luck! Sory for my english. |
| WR6 TEST | Chukharev | 1725. Sold Out! | 26 Jun 2014 22:00 | 2 |
# include <iostream> using namespace std; int main () { int n,k,sol; cin>>n>>k; if(int(n/2) && 1<=k<=n<=50){ if(k<=n/2) sol=n-3; if(k>n/2) sol=k-3; if(n==2) sol=0; } cout<<sol<<endl; } Edited by author 26.06.2014 22:00 ac Chukharev 26 Jun 2014 22:00 AC if(k<=n/2) sol=n-2-k; Edited by author 09.07.2014 22:52 |
| WA #4 | igloo | 1020. Rope | 26 Jun 2014 19:51 | 2 |
WA #4 igloo 21 Jun 2013 20:16 Thank you so much! I forget this... |
| Little hint to make writing of this stupid problem a bit easier | Vedernikoff 'Goryinyich' Sergey (HSE: АОП) | 1858. Magic Cube | 25 Jun 2014 01:33 | 1 |
When you consider placing of a new cube to partially built construct, not to consider several cases of rotations (depending on the position of face with non-zero number) - try to rotate randomly till the cube will fit already-constructed part. This is the most tedious part of the code (at least for me) that could be avoided. Edited by author 25.06.2014 03:19 |
| wa #13 | Igor Sarcevic | 1592. Chinese Watches | 24 Jun 2014 22:19 | 2 |
wa #13 Igor Sarcevic 8 Apr 2009 02:34 i can't find the bug in my code, pls give me some tests :D Try this test: input: 3 12:00:00 5:00:00 8:30:00 output: 12:00:00 My program passed all of the tests given in this forum and still failed on this one! |
| if WA 19 | [RISE] Levon Oganesyan [RAU] | 1748. The Most Complex Number | 24 Jun 2014 04:47 | 1 |
if WA 19 [RISE] Levon Oganesyan [RAU] 24 Jun 2014 04:47 try: 1 897612484786617600 answer: 897612484786617600 103680 |
| where is mistake? SOS | Dior | 1636. Penalty Time | 23 Jun 2014 21:05 | 1 |
var m:array [1..10] of integer; q,z,i,s:integer; begin read(q); write(' '); read(z); readln(m[1]); s:=m[1]; for i:=2 to 10 do begin write(' '); read(m[i]); s:=s+m[i]; end; s:=s*20; if z-s>=q then write('No chance.') else write('Dirty debug :('); end. |
| "Условие не пойму не как плиз объясните на русском! Я читал английский слова понятны но все же не пойму!" | kami_botanik | 1636. Penalty Time | 23 Jun 2014 20:53 | 2 |
"Насколько я понял чем меньше сумма штрафных минут которые прибавляются по 20 за попытку, тем выигрышнее позиция, но почему в примере у комманды ЗЗЗ 719 минут а еще и 21 попыток и при этом ответ dirty debug :(" Please explain! 21*20=420 719-420=299 299<300 я так понял |
| Test 8 | Adil | 1820. Ural Steaks | 23 Jun 2014 18:37 | 5 |
And me too, please. Old 8th test passed correct but that give me a wrong answer error. #include <iostream> using namespace std; int main() { int n, k; cin >> n >> k; if (k>n) cout << 2; else { if (2*n%k>=1) cout << 2*n/k+1; else cout << 2*n/k; } return 0; } Check my post for explanation Hint: Think of all possible cases. Edited by author 18.06.2014 08:01 Edited by author 18.06.2014 08:01 |
| WA 11 | Sergey | 2000. Grand Theft Array V | 23 Jun 2014 03:43 | 2 |
WA 11 Sergey 31 May 2014 21:18 any ideas on WA11 (solution passes all the tests posted here in discussions) ? sorry folks I found the mistake it was a runaway loop that was not i < n but i <= n ( less or equal). funny thing that it went through 10 tests with this - I did not expect anything this nasty because it went through 10 tests. |
| I made. | Mescheryakov_Kirill | 1787. Turn for MEGA | 22 Jun 2014 18:15 | 2 |
I made. Mescheryakov_Kirill 27 Mar 2014 17:29 Just instead of "byte" put "integer". And have done so if the machine is at the crossroads of less than 0 means the machines at the crossroads of 0. And it worked. Edited by author 27.03.2014 17:32 This guy is correct !!! Dont know how, but after the change the code works... If someone can explain the reason behind the change from byte to int ?? |
| Some tips about this problem. | ElPsyCongroo | 1049. Brave Balloonists | 22 Jun 2014 15:41 | 1 |
1.You only need to identify the number of divisors. So, follow this: http://mathschallenge.net/library/number/number_of_divisors 2.Getting the product and then getting the number of divisors is going to take a LOT of time than getting the number of each of the 10 divisors. -> This is an important trick. All the best. ElPsyCongroo. |
| Выгодное строительство дорог | MaxWonder | | 21 Jun 2014 17:50 | 1 |
Привет, столкнулся с интересной задачкой, которую очень хочется решить правильно. Натолкните пожалуйста на мысль, о возможных алгоритмах для ее решения, спасибо. В двух соседних королевствах есть по N городов в каждом. Правители договорились соединить их N дорогами таким образом, чтобы между двумя городами из разных королевств была только одна дорога. Строительство дорог ведется совместными усилиями, но количество работников для строительства дороги между двумя городами может быть разной для каждого из королевств. При строительстве самой первой дороги, жребием определяется королевство, которое первое выбирает один из своих городов. Затем другое королевство выбирает один из своих городов и между ними строится дорога. Для строительства следующей дороги, право первым выбрать город, еще не соединенный никакой дорогой, переходит к королевству, которое выбирало город для предыдущей дороги во вторую очередь и так далее меняется очередность права первым выбрать город для очередной дороги, пока не будут построены все N дорог. Задачей каждого королевства, является трудоустройство большего числа работников, чем у соседнего королевства. Исходные данные: Количество городов в каждом из королевств: 2 <= N <= 10 Разница в количестве работников, необходимых для постройки дорог, между первым и вторым королевством: W[1..N, 1..N], где W[i, j] - это целое число от -255 до 255, разница в количестве работников между первым и вторым королевством, которые будут заняты при постройке дороги между i-м городом первого и j-м городом второго королевства. Каких алгоритмов необходимо придерживаться при ведении строительства дорог от лица первого королевства, если второе королевство также будет стараться использовать самый оптимальный алгоритм для своей победы при выборе городов? Пример: N = 2 W = {{ 2, 2 }, { -4, -2 }} Предположим, что второе королевство для первой дороги делает выбор первым и предлагает первый город, тогда нам как представителю первого королевства выгоднее соединить его дорогой с первым городом и трудоустроить на 2 работника больше. Тогда для второй дороги мы трудоустроим на 2 работника меньше и в результате будет ничья. Если мы для первой дороги выберем второй город первого королевства, то по результатам строительства двух дорог мы трудоустроим на 2 работника меньше и проиграем. Edited by author 21.06.2014 17:51 |
| Why would this fail test 1 | ElPsyCongroo | 1220. Stacks | 21 Jun 2014 12:19 | 1 |
#include<vector> #include<stack> #include<iostream> int main() { int noOfInstructions = 0; std::cin>> noOfInstructions; std::vector< std::stack< int > > myVectorOfStacks; myVectorOfStacks.reserve( 1001 ); for( int inx = 0; inx < 1001; ++inx ) { myVectorOfStacks.push_back( std::stack<int>() ); } char instruction[3]; int stackNumber = 0; int stackValue = 0;
for( int inx = 0; inx < noOfInstructions; ++inx ) { std::cin>> instruction; std::cin>> stackNumber; std::stack< int > & tempStack = myVectorOfStacks.at( stackNumber );
if( instruction[1] == 'U' ) { std::cin>> stackValue; tempStack.push( stackValue ); } else { std::cout<< tempStack.top()<< "\n"; tempStack.pop(); } } return 0; } |
| Why would this fail test 1 | ElPsyCongroo | 1220. Stacks | 21 Jun 2014 12:14 | 1 |
#include<vector> #include<stack> #include<iostream> int main() { int noOfInstructions = 0; std::cin>> noOfInstructions; std::vector< std::stack< int > > myVectorOfStacks; myVectorOfStacks.reserve( 1001 ); for( int inx = 0; inx < 1001; ++inx ) { myVectorOfStacks.push_back( std::stack<int>() ); } char instruction[3]; int stackNumber = 0; int stackValue = 0;
for( int inx = 0; inx < noOfInstructions; ++inx ) { std::cin>> instruction; std::cin>> stackNumber; std::stack< int > & tempStack = myVectorOfStacks.at( stackNumber );
if( instruction[1] == 'U' ) { std::cin>> stackValue; tempStack.push( stackValue ); } else { std::cout<< tempStack.top()<< "\n"; tempStack.pop(); } } return 0; } |