Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Страница 1 |
Hint | frochbg | 1034. Ферзи в мирной позиции | 8 окт 2020 13:15 | 2 |
Hint frochbg 3 окт 2020 13:37 I have been trying to solve this problem for several days, but suddenly I ran out of ideas. Could you give me some hints on the task? I have tried brute force and some pruning, but it got TLE. I would be really happy! :) I've got AC! The main observation is that no two queens can be in the same row or column. Thus, we make an array perm[i], which stands for queen in the ith row and perm[i]th column. The problem is to find the number of permutations, which differs from the initial by 3 elements and check for each possibility whether we have conflicts on the diagonals. perm[i] is the initial permutation. I hope this hint was helpful! |
Some facts about the test | Myrcella | 1034. Ферзи в мирной позиции | 6 сен 2018 19:57 | 1 |
All the X of the input are difference. (Maybe Y are different too. I haven't tried That means, the following test won't exist: ----- 4 1 1 2 3 2 2 4 4 ----- This may be important for you to solve this question more easily (at least for me, my code won't work that situation and get AC in 0.031s though) Good luck! |
Problem 1034 "Queens in Peaceful Positions". New tests were added. (+) | Sandro (USU) | 1034. Ферзи в мирной позиции | 7 янв 2011 00:24 | 1 |
50 authors lost AC after rejudge. |
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 |
AC! O(n^6)???????? | waterlink | 1034. Ферзи в мирной позиции | 6 янв 2016 12:54 | 3 |
how could it have been passed??? and with 0.031 because of the test cases are to easy.... you can use (next_permutation) easyly... |
The testdata is too small | Sevenk | 1034. Ферзи в мирной позиции | 6 сен 2009 18:06 | 1 |
My program is O(n^3). I think n can be added to 100. |
Why T。L。E??? | sherry | 1034. Ферзи в мирной позиции | 23 июл 2008 10:52 | 1 |
Should cut branch? Ireally don't think so... |
pls, help! i can't understand this problem, yet!! | Bobur | 1034. Ферзи в мирной позиции | 26 апр 2008 22:11 | 1 |
hi! really i can't understand it. who can explain it to me with some examples, please!! thanks!! |
Rearrange EXACTLY three queens! | Sergey Baskakov, Raphail and Denis | 1034. Ферзи в мирной позиции | 24 янв 2012 18:59 | 4 |
I was not attentive reading this problem's situations, so I did not pay enough attention to the fact, that EXACTLY three queens should be rearranged. My first solution did count situations, when only two queens were moved... It produced a WA (-: Well, i think that you can simulate the 2 movements rearrangement, with exactly 3 queens, i think this problem statement should be clarified in that sense. If you have a queen "a" in position 0 0, another "b" in position 1 1 and a last "c" in position 2 2... in a N=3 chessboard, you can put a in position 1 2, b in position 0 0 and c in position 2 1. Its like a 2 queens movement, but i moved 3 queens. This test is incorrect because queen "a" attacks "b" Edited by author 15.03.2010 20:52 This hint has helped me to AC.thx |
please give me some hints of optimization (i've got AC in 0.35 sec it's too slowly(-) | xdex | 1034. Ферзи в мирной позиции | 28 апр 2004 14:39 | 4 |
> Post your source code or email me personally if you intend to have a faster time being recorded. Email me to drajmsadeq@yahoo.com How can you solve it? I got TLE! |
Can anybody write test with answer more than 0? | RoVD | 1034. Ферзи в мирной позиции | 28 апр 2004 14:37 | 8 |
9 1 1 2 3 3 6 4 8 5 2 6 4 7 9 8 7 9 5 the answer is 2 good luck baddiex 30 авг 2003 22:44 You are great !!! How can you find such a great test,i am no idea of searching,thank you your good test help me much,much... > 9 > 1 1 > 2 3 > 3 6 > 4 8 > 5 2 > 6 4 > 7 9 > 8 7 > 9 5 > > the answer is 2 > good luck baddiex 30 авг 2003 22:47 > > 9 > > 1 1 > > 2 3 > > 3 6 > > 4 8 > > 5 2 > > 6 4 > > 7 9 > > 8 7 > > 9 5 > > > > the answer is 2 > > good luck > > 9 > > 1 1 > > 2 3 > > 3 6 > > 4 8 > > 5 2 > > 6 4 > > 7 9 > > 8 7 > > 9 5 > > > > the answer is 2 > > good luck Re ahyangyi_newid 20 апр 2004 07:02 Sorry, I still don't know what the 2 answers are , Could sb tell me? Re: Re ZouYuChong 28 апр 2004 14:37 You should move 1st 2nd and 7th Queen. 1st 2nd and 8th Queen. |
I didn't understand this problem... please help me | Costel::icerapper@k.ro | 1034. Ферзи в мирной позиции | 28 фев 2002 05:46 | 2 |
|