Show all threads Hide all threads Show all messages Hide all messages |
if you have a unintelligent algorithm where you run through the 3000x3000 table( c++ ) | 👑TIMOFEY👑 | 1249. Ancient Necropolis | 28 Aug 2022 12:38 | 1 |
delete iostream and using namespace std. all cin cout replace on scanf and pritf write in start of code: #define CRT_SECURE_NO_WARNINGS and #include<cstdio> and behind your vectors,pair and queue write std:: do vector WITHOUT ANY INTS, ALL BOOL DONT USE PUSH_BACK its really slow, just write size of vector Example: >std::vector<std::vector<bool>> a(n); >std::vector<bool> b(m); and call with a[i][j] or something else; If you look at other aspects of the task, then EASY BFS |
Use array of bitset | Сонечка | 1249. Ancient Necropolis | 24 Apr 2022 16:01 | 2 |
Or array of vector <bool>. It uses less memory too. |
Is it really needed? | maslowmw | 1249. Ancient Necropolis | 21 Aug 2019 18:33 | 1 |
Is it really needed to set 4mb memory limit? I really must to remember pascal for this task, because the same solution have TL (not a Scanner) or ML on java. May be it's possible to up memory limit to 8mb? |
why am i getting WA in test 12 | Grandmaster | 1249. Ancient Necropolis | 11 Nov 2017 01:59 | 1 |
#include <stdio.h> #include <iostream> using namespace std; int n, m, segRez[3004]; int segm1[3004]; char segm2[6005]; int main() { cin >> n >> m; for(int i = 0; i < n; ++i){ gets_s(segm2); for(int j = 0; j < m; ++j){ segRez[j] = segm1[j] + int(segm2[j<<1] - 48); segm1[j] = int(segm2[j<<1] - 48); if(j - 1 >= 0 && ((segRez[j - 1]|segRez[j])) == 3){ cout << "No"; return 0; } } } cout << "Yes"; } |
test 6, rejudge, C# | kasarino | 1249. Ancient Necropolis | 5 Jul 2016 09:20 | 1 |
GC.Collect(); on each iteration has helped |
No subject | Arseniy | 1249. Ancient Necropolis | 5 Jul 2016 08:15 | 2 |
why my O(N * M) solution works for 2.65 seconds? I think 9 * 10^6 operstions should be done faster... Because reading 3000 x 3000 integers takes a lot of time. |
Visual C++ vs. G++ | yongwhan | 1249. Ancient Necropolis | 11 Jun 2016 03:48 | 3 |
Just a passing note: the same exact code gets TLE in G++ but AC in Visual C++ (with a very comfortable margin). Make sure to test your code in both compilers before making a judgement that your code is too slow, for those who are coding in C/C++. That's ridiculous for some reason. TLE in G++ but AC in Visual C++ without a single edit in the source code. wow, the same one problem |
What's wrong? It's working! | Дмитрий | 1249. Ancient Necropolis | 13 Apr 2016 15:57 | 1 |
У меня получилось вот что I have this: > http://ideone.com/8CHWDd Почему проверка считает что ответ неверен Why it's wrong? |
Some tests | [MAI] Dron-elektron | 1249. Ancient Necropolis | 30 Jul 2014 23:49 | 1 |
1 1 0 ==== Yes 1 1 1 ==== Yes 3 1 1 1 0 ==== Yes 3 1 0 0 0 ==== Yes 2 2 0 0 0 0 ==== Yes 2 2 1 0 0 1 ==== Yes 3 3 1 1 1 1 0 1 1 1 1 ==== No 3 3 1 1 1 1 1 1 1 1 1 ==== Yes 3 3 1 0 1 0 1 0 1 0 1 ==== Yes 4 2 1 1 0 0 0 0 1 1 ==== Yes 4 2 1 1 1 0 0 1 1 1 ==== No 4 4 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 ==== Yes 4 4 1 1 1 1 0 0 0 0 1 0 1 1 0 1 0 0 ==== Yes 4 4 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 ==== Yes 4 2 1 1 0 1 1 1 1 1 ==== No |
What is the answer for this test? | Mickkie | 1249. Ancient Necropolis | 2 Mar 2014 20:57 | 1 |
3 3 1 1 1 1 0 1 1 1 1 Yes / No ? |
Hint | KingPin | 1249. Ancient Necropolis | 7 Mar 2012 07:14 | 4 |
Hint KingPin 2 Jun 2005 03:35 Can't solve this problem fast? I can give a little hint: Think about role of squares like 01 11 or 10 11 or 11 01 and finally 11 10 Thats all. Good luck! Edited by author 02.06.2005 03:45 thank you for this advice! Yeah, much better than doing DFS's and checking... |
Hint | Hakobyan Tigran (RAU) | 1249. Ancient Necropolis | 18 Jan 2011 23:35 | 1 |
Hint Hakobyan Tigran (RAU) 18 Jan 2011 23:35 |
0.89s 129kb AC | muhammad | 1249. Ancient Necropolis | 1 Jun 2010 17:56 | 1 |
|
The text of the problem is wrong. There should be N lines containing M characters. | Tiberiu Danet | 1249. Ancient Necropolis | 13 Nov 2009 11:32 | 5 |
{ ACCEPTED !!!!!!!!!! } Var S : Array [0..1,1..3000] of Byte; N,M,I,J,C : Longint; Begin {} Read(M,N); { <-- Read(N,M); !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! } C := 1; For J:=1 to N do S[1-C,J] := 0; { Обнуляем "предыдущую" строку } For I:=1 to M do { Цикл по всем строкам } Begin For J:=1 to N do Read(S[C,J]); { Читаем новую строку } For J:=1 to N-1 do { Ищем неприятности ;) } If (((S[1-C,J]=0) and (S[1-C,J+1]=1) and (S[C,J]=1) and (S [C,J+1]=1)) or ((S[1-C,J]=1) and (S[1-C,J+1]=0) and (S[C,J]=1) and (S [C,J+1]=1)) or ((S[1-C,J]=1) and (S[1-C,J+1]=1) and (S[C,J]=0) and (S [C,J+1]=1)) or ((S[1-C,J]=1) and (S[1-C,J+1]=1) and (S[C,J]=1) and (S [C,J+1]=0))) then Begin Writeln('No'); Halt; End; C := 1 - C; End; Writeln('Yes'); End. |
to Admins | Ibragim Atadjanov | 1249. Ancient Necropolis | 23 Sep 2009 22:45 | 3 |
to Admins Ibragim Atadjanov 23 Sep 2009 10:27 My prog uses only private static byte[] mat;// max 3000 * 1 byte private static boolean ok;// 1 byte private static byte x, y; // 2 byte private static int n, m, i, j; // 4*4 byte=16 byte field variables its memory cant be 5 510 KB. total memory is 3019 B. I cant understand why i'm getting memory limit on test6 Try to read input strings this way: BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ......... char[] input_str = new char[2 * m + 2]; ......... in.read(input_str, 0, 2 * m + 1); It help me to get AC with 0.296 sec. and 1662КБ. Good Luck! Edited by author 23.09.2009 17:08 Edited by author 23.09.2009 17:08 Thanks a lot. I got AC by your help |
No subject | KALO | 1249. Ancient Necropolis | 9 Aug 2009 23:32 | 1 |
Edited by author 09.08.2009 23:36 |
what is wrong??? | Rockman | 1249. Ancient Necropolis | 18 Mar 2009 09:11 | 1 |
#include<iostream> using namespace std; int main () { int a[3000],b[3000],c[3000]; long long int i,j,k,n,m; cin>>n>>m; for (i=0;i<n;i++){ cin>>a[i]; for(j=0;j<m;j++){ cin>>a[j]; } { c[j]= a[j] + b[j]; } for (j=0;j<m-1;j++){ if ((c[j] = 1) && (c[j+1] = 2) || (c[j] = 2) && (c[j+1] >= 1)) { cout<<"NO";
return 0; } else { cout<<"YES";} } } return 0; } |
Bad tests | Marginean Ciprian | 1249. Ancient Necropolis | 30 Nov 2008 21:38 | 2 |
Bad tests Marginean Ciprian 27 Nov 2008 21:04 Please, write letter to timus_support(at)acm.timus.ru and explain why tests in this problem are bad. |
WA4 | rohit | 1249. Ancient Necropolis | 23 May 2008 04:31 | 1 |
WA4 rohit 23 May 2008 04:31 Please give me some tests. |
why WA21? | Experimenter (Anton Ohitin Orenburg G1) | 1249. Ancient Necropolis | 13 Mar 2008 11:41 | 1 |
why WA21? Experimenter (Anton Ohitin Orenburg G1) 13 Mar 2008 11:41 now i have AC. it was very stupid bag..... Edited by author 13.03.2008 16:25 |