Общий форумПоказать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения | i need help on Lonesome Knight ( coordinate sol) | roseiris | 1197. Один в поле воин | 24 янв 2023 20:45 | 1 | can anyone please explain the solution which uses the coordinates i think ... Edited by author 24.01.2023 20:46 Edited by author 24.01.2023 20:46 Edited by author 24.01.2023 20:46 | A Question | lasercat | 1292. Марсианские космобазы | 24 янв 2023 09:55 | 2 | I get WA 1 with calculating distance in this way for(int i=0;i<len;i++) { ans+=pow(((int)(buf[i]-'0')),3); } while accepted in this way for(int i=0;i<len;i++) { ans+=(buf[i]-'0')*(buf[i]-'0')*(buf[i]-'0'); } WHY?!!!! Is this a bug on judge or bug in function?!! the compiler is g++ why not try this ans+=round(pow(((int)(buf[i]-'0')),3)); | Weird statement | Igor Parfenov | 1282. Game Tree | 22 янв 2023 02:48 | 1 | Notice, that +1 and -1 mean not victory and defeat states. INPUT 2 L 1 +1 OUTPUT +1 | WA23 | andreyDagger`~ | 1630. Талисман | 21 янв 2023 02:11 | 1 | WA23 andreyDagger`~ 21 янв 2023 02:11 4 3 1 2 2 3 3 4 Luck is possible | hint for all test case | Almas Turganbayev | 1083. Факториалы!!! | 19 янв 2023 16:22 | 1 | be attentive with loop (while)! we know formule n - x * k =) and in depends of number parity condition will be >= (ex. [n - x * k >= n mod k] or [n - x * k >= k]). Good luck!) Edited by author 19.01.2023 16:23 | WA3: possible scenarios | Badr | 2115. День знаний | 17 янв 2023 21:12 | 3 | Can anyone check if I missed any scenario ? 1, 2, 3, 4, 5 => Nothing to do here" 5, 4, 3, 2, 1 => Nothing to do here" 5, 2, 3, 4, 1 => "Yes\n1 5" 1, 8, 3, 4, 5, 6, 7, 2, 9 => "Yes\n2 8" 1, 8, 7, 6, 5, 4, 3, 2, 9 => "Yes\n1 9" 9, 8, 3, 6, 5, 4, 7, 2, 1 => "Yes\n3 7" 1 => Nothing to do here" 1, 1, 1, 1, 1 => "Nothing to do here" 9, 2, 3, 5, 4, 6, 7, 8, 1 => "No hope" 1, 2, 3, 9, 5, 6, 7 => "No hope" 7, 6, 5, 9, 3, 2, 1 => "No hope" 1, 1 => "Nothing to do here" 1, 2 => "Nothing to do here" 1, 2, 4, 3, 5, 6 => "Yes\n3 4" 6, 5, 3, 4, 2, 1 => "Yes\n3 4" 2, 1, 3 => "Yes\n1 2" 1, 3, 2 => "Yes\n2 3" 1, 2, 3, 2, 3, 4, 5 => "Yes\n3 4" 1, 5, 7, 2, 4, 5 => "No hope" If there are repeated digits, make sure you switch the right one. For example: 5 2 1 1 1 3 Try to generate tests containing a lot of same numbers, e.g. the next test: 9 1 5 1 3 3 3 5 1 5 has answer: Yes 2 8 | Some tests | † SiriuS † | 2140. BitMazeCraft | 17 янв 2023 10:39 | 3 | WA-3: 1 2 3 .# #. .. 1 1 1 1 1 3 ----- NO WA-12: 3 3 3 .#. ... ... ..# ... ..# ... ... ... 1 2 2 3 3 3 ----- YES 2 climb east jump south WA-108: 1 1 1 . 1 1 1 1 1 1 ---- YES 0 Edited by author 11.08.2022 10:30 WA-3: 3 4 2 .#.. .#.. .#.. .... .... .... 1 1 1 3 4 1 ----- YES 5 walk south walk south climb east drop east walk east | Interesting observation (together with a suggestion) | Ramil | 1394. Корабли. Версия 2 | 16 янв 2023 03:00 | 3 | Interesting that test48, test70 (with reservations) and test80 do not look so hard to my solution. At least if the commenters in previous threads were right with examples of these tests. But mysterious test30 and test31 - I don't even imagine what structure they got. Test70 is "randomly" solvable: with time distributed between 0.3 and 2.9 seconds (with avg = 1.1 sec) on my Intel i5-9400 (by "randomly" - I mean, of course, that could be 2.9 seconds which is TLE and would not pass) And my suggestion: It would be nice to have a separate section on the site with parallel running of tests for such hard computational tasks. I mean: maybe someone also passes test 70, but fails test 30, for example. And the total percentage: passed N tests, failed tests with numbers K, L, M Now I know what's been wrong with my solution (TLE30), but now TLE46 If you read SPb-MaxBuzz's article about test generation for the problem, then you can see tests rearranged intentionally for top of solutions at some time point in the past. You can think your solution is very special. | How to divide over non prime modulo | andreyDagger`~ | 1749. Периодическая сумма | 15 янв 2023 02:26 | 1 | | Some tests | Tunez(ITMO) | 1006. Квадратные рамки | 14 янв 2023 23:39 | 2 | .................................................. .......................┌──────┐................... .......................│......│................... .......................│......│................... .......................│......│................... .......................│......│................... .......................│......│................... ┌────────┐.............│......│................... │........│.............└──────┘................... │........│........................................ │........│........................................ │─────┐..│........................................ │.....│..│........................................ │.....│..│........................................ │.....│..│..............┌──┐...................... │.....│..│..............│..│...................... └────────┘..............│..│...................... └─────┘.................└──┘...................... .................................................. .................................................. .................................┌┐............... .................................└┘............... ..┌──────┐.................................┌─────┐ ..│......│........┌────────┐...............│.....│ ..│......│........│........│...............│.....│ ..│......│........│........│...┌───┐.......│.....│ ..│.┌───┐│........│........│...│...│.......│.....│ ..│.│┌──││───┐....│........│..┌│──┐│.......│.....│ ..│.││..││...│....│........│..││..││.......└─────┘ .┌└─│───│┘┐..│....│........│..┌─┐──┘.............. .┌──└───┘.│..│....│........│..│.│.│............... .│...││...│..│┌─────┐......│..└─┘─┘............... .│...││...│..││...└─│──────┘...┌───┐.............. .│...││...│..││.....│..........│...│.............. .│...││...│..││.....│..........│...│.............. .└────┘──────┘│.....│........┌───┐.│.............. .│........│...│.....│........│.└─│─┘.............. .│........│...└─────┘........│..┌│................ .└────────┘..................│..└│................ .............................└───┘................ .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. ..........┌─┐─┌─┐................................. ..........│.│.│.│................................. ..........┌─────┐................................. ..........│.....│................................. ..........│.....│................................. ..........│.....│.....................┌┌┐......... ..........│.....│.....................┌┐┐......... ..........│.....│.....................└┘┘......... ..........└─────┘................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. ..┌┐.............................................. ..└┌┐┌┐........................................... ...└┌└┘........................................... ....└┘............................................ .................................................. .................................................. ...............................┌┌┌┐┐┐............. ...............................└└└┘┘┘............. .....┌───┐........................................ .....│┘─└│........................................ .....││.││........................................ .....│┐─┌│........................................ .....└───┘........................................ .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. ┌┌──┌┌──┐────┐┐───┌┐─┌───────┐─┌─────┌──┐┐───┌───┐ ┌│──│││││─│──│──┌─────────┐───┐┌────┐─┐┌││┐││││┐┐│ │││││││┌│────│──┌────┐─┘──││││││┌─────────┐──││──│ ││┌┌│└──┘─│─┌│┐─││││││││││││┌─│││││─││││┘│││─││─││ │┌──┌──┐──┘─┌───│──┐─│─┐──│┌───││┐│┐│─│───│┌─────┐ └│──││││││┌─│││─││┐│─│┐│└┌││──┘│││──││││││││──┘│││ └│──│──││─│┌────│──┐││││┌┐│││┌─└│───┘│││┌─││─────│ ┌│││└──┘┌─└│││──└────┘││└┘│││││┌││└─│─│┘│─││────┘│ ┌│┐││─┐│││││││││││││┌─┐│──││─│││││─┐││││││││││││││ │││─└──────││┘│┌│││││─││─┌││└│└─││──│─┘│││││─┐│┘││ └└─────││││││─│└││││└─┘│──│└────│┘││││─││┘│└─────┘ │││││││││─││└──────│──────┘└─│──│──┌│───┌──────┐─│ └─┘┌│┌─└│──│─────┌─│──┐│───┘┌└─┌└───────│─┘│┘│││││ ││└││││││└└│──┐──│─│──│┘─│└──│─│││││││─│││││─┌││─┐ ││┌─│┌──│─┐└───────┘││││││─│││┌│┐│││││││││││─└││││ ┌──┐││┘││││││─┌┐││─│││││┌┐─││││││││││──┘││───│││─│ ││└│└───└──└──└┘─│─└──││└┘──││└│┘│││││─┘│└────┘│││ │└└│─│┘─│││││──││└────┘│─┘─││└─└───└────│──┘┌└─│─┘ └──┘─│└─││││└───│──│──┘│────│─┘│─└─┘──┘─└──────┘─┘ └────└────┘└────└──────┘────└──────┘┘┘───└┘─┘─┘┘└┘ Edited by author 08.09.2019 16:59 Edited by author 08.09.2019 17:01 Edited by author 08.09.2019 17:01 Edited by author 08.09.2019 17:06 Edited by author 08.09.2019 17:06 Edited by author 08.09.2019 17:07 Edited by author 08.09.2019 17:07 Edited by author 08.09.2019 17:15 Wow! The last one is not with 15 square frames, but you did a great job! Thanx! | WA #10 , can you help me??? | datct0407 | 1495. Раз-два, раз-два 2 | 13 янв 2023 15:16 | 4 | #include <stdio.h> #define maxn 1000001 long n; short result[31],b[maxn]; int tr[maxn]; long count,i,j; main() { scanf("%ld",&n); for (i=0;i<n;i++) b[i]=0; b[1%n]=1; tr[1%n]=0; if (n!=1) b[2%n]=2; tr[2%n]=0; count=1; while (b[0]==0 && count <30) { count++; for (i=1;i<n;i++) if (b[i]!=0) { if (b[(i*10+1)%n]==0) { b[(i*10+1)%n]=1; tr[(i*10+1)%n]=i; }; if (b[(i*10+2)%n]==0) { b[(i*10+2)%n]=2; tr[(i*10+2)%n]=i; }; } } if (b[0]==0) { printf("Impossible"); } else { i=0; j=1; result[j]=b[i]; while (tr[i]!=0) { i=tr[i]; j++; result[j]=b[i]; } for (i=j;i>0;i--) printf("%d",result[i]); } getchar(); } When i had wa 10 i found out that my solution on test like 101 gives me 1212 instead of 1111. It doesnt helped me on this test, but i found mistake anyway | What's wrong with my codes?It WA at 8 | Little Murphy | 1282. Game Tree | 13 янв 2023 12:56 | 3 | var f,q,be:array[0..1000] of integer; n,x,a,b,c:integer; m:char; begin {assign(input,'1282.txt'); reset(input); } readln(n); for x:=1 to n do be[x]:=-3; for x:=2 to n do begin read(m); if m='L' then begin readln(a,b); if be[a]=-3 then begin inc(c); q[c]:=a; be[a]:=-1; end; if b=-1 then be[a]:=1; if (b=0) and (be[a]<0) then be[a]:=0; end else readln(f[x]); end; b:=1; while q[b]<>1 do begin if be[f[q[b]]]<-2 then begin inc(c); q[c]:=f[q[b]]; be[f[q[b]]]:=-1; end; if be[q[b]]=-1 then be[f[q[b]]]:=1; if (be[q[b]]=0) and (be[f[q[b]]]<0) then be[f[q[b]]]:=0; inc(b); end; if be[1]=1 then writeln('+1') else writeln(be[1]); end. {be[n]==the best value it then player play best f[n]==the father of n be[n]=-3===>it hasn't been visited } Read these sentences carefully: The leaf nodes of the tree of this game may have values equal to one of three numbers: “+1” – victory of the first competitor, “–1” – victory of the second competitor, “0” – draw. For example, Input 3 L 1 +1 L 1 +1 Output +1 Input 3 L 1 +1 L 1 -1 Output +1 Input 3 L 1 -1 L 1 -1 Output -1 Hope it can help:) | If WA1, check that "The radio receiver cannot be placed in a square occupied by a radio station." | Igor Parfenov | 1168. Radio Stations | 13 янв 2023 01:59 | 1 | The test 1 is different, and checks this condition. | What shape is the football gate? | Nodir NAZAROV Komiljonovich | 1874. Футбольные ворота | 12 янв 2023 15:20 | 4 | I tried to figure it out, how 1 tree and two sticks with the length of 2 can form the area more than 4? The largest area would be rectangle. What is the trick on this problem, can anybody explain with Geometry language. Thanks. The key point of the problem statement is "She knew that the standard football goal was rectangular, but, being creative, she assumed that her goal could have the form of an arbitrary quadrangle." So, it may be not a rectangle. I tried trapezoid like: /| 2/_| | | 2|__| x and tried to maximize the function - f(x) for total area which answer is sqrt(3) and total area is ~4.33 How to get ~4.8 for the given test? Try placing sticks a and b as follows: # #`. a # `. # `. x # \ # \ b # \ # \ ===================== y Hint: It can be proved that the area is maximal when x = y and angle between a and b is 135 degrees. | WA3 | andreyDagger`~ | 2013. Не взбалтывать и не смешивать | 10 янв 2023 20:54 | 1 | WA3 andreyDagger`~ 10 янв 2023 20:54 Test: 10 2 3 2 3 6 0 1 1 0 2 4 10 0 3 5 7 9 0 1 3 0 1 3 0 1 8 0 1 7 1 1 7 2 1 5 Answer: unknown 2 2 2 2 2 2 2 2 2 2 2 unknown unknown unknown unknown 2 1 2 2 | This help understand statement about islands | 👑TIMOFEY👑 | 1250. Захоронения в океане | 7 янв 2023 18:47 | 1 | Definition: "inside the island" Let's define the definition recursively: 1)If an island/sea touches the edge of the map, then it does not lie inside the sea/island 2)If an island/sea does not have internal seas/islands, then all the seas/islands it touches (it should be one if it does not touch the edge of the map) contain this island/sea inside themselves. 3)If an island/sea has internal seas/islands, then all these seas/islands in this island/sea, and all the seas of which these island/sea touch, which are not internal, contain this island/sea. this all means that if the island lies inside the sea, which is inside the island, which is inside the sea, which is inside the island that touches the end of the map, and the illuminated sea is selected, the sea that is inside the island touching the map, then all the islands inside the sea are not part of the island touching the end of the map, and if the outer sea is selected, then since it is not exactly contains an island touching the map, then it should not contain islands inside this island | WA 30 | LLI_E_P_JI_O_K | 1163. Chapaev | 6 янв 2023 21:44 | 1 | WA 30 LLI_E_P_JI_O_K 6 янв 2023 21:44 If you get WA 30 check this: 1) correct calculation of tangent line angle (asin(2R/D), NOT asin(R/D)) 2) check not only enemies circles to make your movement, but angles to your own circles too. You can destroy your circles and win by this angle (don't forget about this). These tests helped me: Test 1: 7.100 2.280 3.530 4.410 2.690 2.990 1.770 4.360 5.850 1.770 1.960 1.720 6.550 1.870 2.200 4.940 4.090 0.920 6.580 3.590 1.970 1.070 2.390 2.700 0.360 4.030 1.520 6.730 5.820 5.280 1.640 5.520 Answer: WHITE Test 2: 2.670 6.880 2.140 2.820 0.830 6.960 2.180 4.600 6.220 7.170 7.130 1.290 3.010 6.320 2.880 4.690 0.350 6.670 6.680 5.820 7.230 5.020 7.160 4.100 0.120 0.430 2.950 7.780 5.630 2.400 2.290 1.310 Answer: RED Edited by author 06.01.2023 21:45 | easy bfs | 👑TIMOFEY👑 | 2029. Ханойские башни наносят ответный удар | 6 янв 2023 13:44 | 1 | just read some titles abot hanoi tower and learn some algorithm like floyd and u 100% will can solve this problem | whats wrong with 10-b and 10-a | md adullah al mamun udoy | 1409. Два бандита | 5 янв 2023 23:38 | 2 | whats wrong with this logic? cout<<10-a<<" "<<10-b<<endl; All cans = Harry shot + Larry shot - 1; Not shot by Harry = All cans - Harry shot; Not shot by Larry = All cans - Larry shot; Edited by author 05.01.2023 23:48 | wa 40 | 👑TIMOFEY👑 | 1043. Закрыть дугу | 5 янв 2023 09:24 | 1 | wa 40 👑TIMOFEY👑 5 янв 2023 09:24 |
|
|