| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| there is a polynolyal time solution, my is O(N^3) | Alias aka Alexander Prudaev | 1431. Сертификаты | 28 ноя 2013 00:00 | 4 |
sorting array can help improving O(N^3) to O(N^2) |
| To admins: typo in statement | Smilodon_am [Obninsk INPE] | 1032. Найдите кратное | 27 ноя 2013 11:18 | 1 |
There is a typo in statement in the first part of it. The sentence: "This numbers are not necessarily different" should be written as: "These numbers are not necessarily different". |
| If you have WA #36 | Smilodon_am [Obninsk INPE] | 1032. Найдите кратное | 27 ноя 2013 11:08 | 1 |
Try this test (it helped me, but real test #36 has N = 10000): 7 4 4 4 5 5 5 5 Answer, of course, is for example 3 5 4 5 |
| Does this problem need FFT? | Sevenk | 1677. Обезьяна за клавиатурой | 27 ноя 2013 00:06 | 2 |
After AC, I find that the answer is NO. Edited by author 20.08.2010 09:25 You can speed up your solution by using FFT though. |
| CE what is my code problem ? | Aliaga Shirinov | 1354. Палиндром. Он же палиндром | 26 ноя 2013 13:58 | 1 |
#include <iostream> #include <vector> #include <math.h> #include <cstdio> #include <algorithm> #include <string> using namespace std; int main() { long long m,h = 0,i,t,l,n,f; string a,s; cin >> a; s = a; for(i = a.length()-1 ;i >= 0 ;i--) s[h] = a[i],h++; f = s.length()-2; i = 0; n = f; while(n >= 1 && m != 0) { t = n; m = 0; while(i <= n - (n / 2) - 1) { if(s[i] != s[t]) { m = 1; break; } i++; t--; } n--; i = 0; } if(m == 0) n++; for(i = 0 ;i < a.length() ;i++) cout << a[i]; for(i = n + 1 ;i < s.length() ;i++) cout << s[i]; cout << endl; return 0; } |
| help read data in Java | Anna | 1612. Трамвайный форум | 24 ноя 2013 23:16 | 1 |
Hello, pleaze help me to read data correctly in Java. I've spend a lot of time with no result. |
| Tests must be improved | raggzy | 1128. Деление на группы | 24 ноя 2013 22:00 | 1 |
The next 2^N worst-case algo gets AC. searchSolution(i) { if (i==N+1) { throw new FoundException(); } group[i] = 1; if (checkThisAndAdvsHasNotMoreThan1Adv(i)) { searchSolution(i+1); } group[i] = 2; if (checkThisAndAdvsHasNotMoreThan1Adv(i)) { searchSolution(i+1); } group[i] = 0; } ............ try { searchSolution(1); } catch (FoundException e) { outputResult(); } output("NO SOLUTION"); Judges, please do something with it :) This is cool graph problem, i think in order to get AC one should write O(N) solution :) But this obvious brute-force gets AC SAD :( |
| No subject | Ilya Zvigintsev [Tomsk PU] | 1466. Магический квадрат | 23 ноя 2013 23:52 | 1 |
No subject Ilya Zvigintsev [Tomsk PU] 23 ноя 2013 23:52 Edited by author 01.08.2016 10:52 |
| What's mean this problem? why the example one should output 14 3? | stat958 | 1900. Машина счастья | 23 ноя 2013 22:20 | 2 |
What's mean this problem? why the example one should output 14 3? |
| Hashing ... | vlyubin | 1517. Свобода выбора | 23 ноя 2013 18:00 | 3 |
It seems that lots of people can solve this problem with hashing. Well, I'm using 64 bit hashing and am using sufficiently large prime p (I'm using the usual polynomial hashing i.e. s[0]+s[1]*p+s[2]*p*p ...). I have tried 5 different p's and I'm always catching collisions at test 52 !!! I added code to check for collision and keep working with a different random chosen p ... and now I get TL !!! My question is: what is the smart solution to the problem that I have? What hashing have you used? To admins: How can you guys make solutions with random p get collisions? That's probably a really good test. I know how to build anti-hash for certain p, but I cannot imagine a test that hacks 10 random p's in a row. Good job! Or more like "my solution sucks" :) QProgS 1517. Свобода выбора Visual C++ 2010 Accepted 0.656 9 720 КБ Accepted with double hashing ) Edited by author 23.11.2013 18:01 |
| Ignore the root t <= 0 | alex4814 | 1600. Аэропорт | 22 ноя 2013 08:27 | 1 |
I got AC through t <- max(0, min(t1, t2)) if t = 0 do nothing Edited by author 22.11.2013 08:33 |
| what's the data of test#5? I really want to AC this pro... | zhanglg | 1990. Гонки на карах | 21 ноя 2013 21:13 | 1 |
use my own code..... my id: 151799QY The last time I submitted code, is my own code.... Edited by author 21.11.2013 21:17 |
| for admin : add new test | Aguero -=Yaroslavl SU #2=- | 1211. Круговая порука | 21 ноя 2013 19:52 | 2 |
16 25000 0 3 4 5 ... 1 25000 0 3 4 5 ... 1 .... .... 25000 0 3 4 5 ... 1 Edited by author 21.11.2013 02:11 My AC program works on this test for 15 seconds.. |
| WA #24 | FBI | 1612. Трамвайный форум | 21 ноя 2013 11:45 | 1 |
Who can tell test 24? May b someone also got in trouble with this test. |
| WA16 | Nikiror | 1944. Досье орбитальной атаки | 20 ноя 2013 19:41 | 2 |
WA16 Nikiror 11 янв 2013 19:33 I can't understand that wrong in my program. please, give me a test. Re: WA16 AYUBXON UBAYDULLAYEV TUIT 20 ноя 2013 19:41 If you dont have mistake, you should "clear" your array. It helped me |
| WA on #5 Why? | yuhc | 1671. Паутина Ананси | 19 ноя 2013 22:41 | 4 |
I don't think there are such threads as (2 Edges) 1 2 2 1 And although my program can solve that case, I still WA on test5. Can you help me and give me some advice? Thank you very much! Use union+Rank can AC.... Use union+Rank can AC.... Try this test: 4 4 1 2 1 2 2 3 3 4 3 1 2 3 Answer 1 2 3 |
| A Tip | Tural Neymanov | 1112. Покрытие | 19 ноя 2013 20:55 | 3 |
A Tip Tural Neymanov 21 май 2010 03:31 If you have a problem - WA4 - consider sorting input, not output for example: 5 1 5 3 6 1 3 9 6 4 2 answer 3 1 3 3 6 6 9 I pass the test,But I still got WA#4 thanks for helping me solve WA 1 Edited by author 19.11.2013 20:56 |
| Hint | Alexey Dergunov [Samara SAU] | 1933. Пушки к бою! | 19 ноя 2013 14:10 | 2 |
Hint Alexey Dergunov [Samara SAU] 16 ноя 2012 14:16 Re: Hint Smilodon_am [Obninsk INPE] 19 ноя 2013 14:10 Thanks, it was very useful to getting AC. |
| Accepted (Visual C++)!!!!! | Vensus | 1196. Экзамен по истории | 18 ноя 2013 22:11 | 4 |
#include <iostream> using namespace std; int main() { int n = 0, m = 0, a = 0, s = 0, k = 0; int arr[15001]; cin >> n; for(int i = 0; i < n; i ++) { cin >> arr[i]; } cin >> m; bool flag = true; int j = 0; int left = 0, right = n-1; for(int i = 0; i < m; i++) { cin >> a; j = 0; left = 0; right = n-1; flag = true; if(a == arr[0]) { flag = false; s++; } else { if(a == arr[n-1]) { flag = false; s++; } } if(a > arr[n-1]) { flag = false; } while(flag) { if(a > arr[j]) { left = j; j = (left + right)/2; if(a == arr[j]) { { flag = false; s++; } } if(right-left <= 1) { flag = false; if(a == arr[j+1]) s++; } } else { right = j; j = (left + right)/2; if(a == arr[j]) { { flag = false; s++; } } if(right-left <= 1) { flag = false; if(a == arr[j+1]) s++; } } } } cout << s; return 0; } Edited by author 17.11.2013 16:03 Публикация решений запрещена правилами. С чего бы это? Запрещено выкладывать решения заданий из текущего соревнования до его окончания. RTFM: 1. Messages should be written in English and correspond to the matter of the site. 2. Messages should not contain offences and obscene words. 3. Messages should not contain correct solutions. 1. Сообщения должны быть написаны на английском языке и соответствовать тематике сайта. 2. Сообщения не должны содержать оскорблений и нецензурной лексики. 3. Сообщения не должны содержать правильных решений. |
| What's up with test #6 ? | Haile | 1081. Двоичная последовательность | 18 ноя 2013 14:46 | 1 |
My damned solution keep giving WA on test 6 with C11. I tested on big numbers and every corner case (yes, it works with 1 1 -> '0', yes, it gives '-1' on 3 6, etc..) Suggestions? What's in test 6? The exact same algorithm in python gives AC.. (and it's not a bignum issue, I tested the C version with 43 and 10**9) Edited by author 24.11.2013 01:26 |