| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| a simple test | Briana Banks | 1320. Разбиение графа | 4 авг 2014 10:42 | 2 |
input 5 4 4 2 2 1 1 3 3 4 I think output should "1" but most of my colleagues' accepted programs print "0". Do I misunderstand the problem ? This is not valid input because the graph has to have an even number of edges. |
| My implementation of FFT is not fast enough, or there is more simple solution to the problem? (-) | Vedernikoff 'Goryinyich' Sergey (HSE: АОП) | 1996. Шифровка 3 | 4 авг 2014 02:14 | 3 |
Edited by author 10.02.2014 00:44 Use the FFTW (such fast wow) for AC. Thanks, I already got AC with usual FFT (heavily optimized). Could you give some link to FFTW? |
| why Runtime error (access violation)??? | Saeed | 1001. Обратный корень | 3 авг 2014 22:39 | 1 |
#include<iostream> #include<conio.h> #include<Math.h> using namespace std; int main() { long long int a[ 100000 ]; int i = 0; do { cin>>a[ i ]; i ++; }while( a[ i - 1 ] != EOF ); for( int j = i - 1; j > -1; j -- ) { if( a[ j ] >= 0 ) cout<<sqrt((double)a[ j ])<<endl; } } |
| My algo | Aram Shatakhtsyan | 1682. Чокнутый профессор | 3 авг 2014 11:48 | 4 |
My algo Aram Shatakhtsyan 3 май 2009 20:32 I don't know what is the fastest way to solve this, but I think mine is more complicated than it can be. I've keeped a vector for each remainder i mod k and i*i mod k, to quickly find the numbers which give remainder r. Then you can add edge by edge in graph and use union-find algo to check for cycles. Maybe there is a faster math solution? Yep, graph is very sparse. Almost always (without several trivial cases) you can consider only range [0..2*k]. To avoid any kinds of checking simply get n = max(10, 2*k). For each number in [1..n] try to find cycle with previous ones. Use e.g. disjoint sets for simplicity. Note, that solution always exists! Almost always (without several trivial cases) you can consider only range [0..2*k]. To avoid any kinds of checking simply get n = max(10, 2*k). Is there any mathematical proof for this? if k=1 =>ans is 3 if k=2 =>ans is 5 if k>2 => you can take numbers 1, k-1, 2*k-1, and it will be a cycle |
| WA14 | Biplan | 1993. Чизбургер этот не нужен тебе | 3 авг 2014 02:48 | 1 |
WA14 Biplan 3 авг 2014 02:48 |
| Can't understand the first test case | BUET_Bats | 1996. Шифровка 3 | 2 авг 2014 17:59 | 3 |
3 2 11110001 11110001 11110000 11110000 11110000 If you alter one bit, it will become 11110000 11110000 11110001 So how the answer is 1 2? Shouldn't it be 1 1? Or we have to alter only the first byte? What you suggest changes 2 bits and you want the replacement with minimal number of bits ("And if it is, find the minimum number of bits to alter."). Edited by author 26.10.2013 17:33 Edited by author 26.10.2013 17:36 |
| What is the minimum number of bits? | impetus | 1996. Шифровка 3 | 2 авг 2014 17:59 | 4 |
I have 3 different understandings of the target value: 1. Whole number of bits in all bytes to be changed to make bit substrings equal (any bit(s) of each byte can be changed); 2. The same as p. 1, but only last consecutive bits of byte (suffix) can be changed; 3. The number from the 0..8 range which is the minimum number of bits that can be changed in all bytes. Tests do not clarify this. Which one is right? It's allowed to change only last bit in every byte. |
| does the order of the secret information files can be changed? | hehaodele | 1996. Шифровка 3 | 2 авг 2014 17:58 | 2 |
image: 00000010 00000001 secret: 00000000 00000011 can they match? Use the FFTW for AC. Edited by author 02.08.2014 17:59 |
| can this problem solved by linear programming?(1000 veraibles and 110 Inequalities) | test_tset | 1394. Корабли. Версия 2 | 2 авг 2014 12:28 | 3 |
At least, it can be written as linear programming problem. However, it is INTEGER linear programming problem, which still remains to be NP-hard. can we use simplex() to solve floating version of lp, then use it as heuristics: brute force to search in descending order of veriable x.. I will try this approach to test case 70(toooooooooooooo hard....) |
| I can't believe, but it was right idea! | Levon Oganesyan | 1605. Дьявольская последовательность | 1 авг 2014 12:33 | 2 |
I have AC in O(1), I use 2 formulas for odd and even n. Good problem, thanks to author! Now I combining both formulas in one. |
| Test Case3 | Bruno Braga | 1203. Научная конференция | 1 авг 2014 03:05 | 1 |
|
| More test! | Daniel | 1964. Китайский язык | 1 авг 2014 00:41 | 1 |
Please, give me a more test with answer. |
| What is the test 32 | Berol | 1880. Собственные числа Psych Up | 31 июл 2014 13:56 | 1 |
Please help me! Got the WA#32 with the next code. #include <iostream> #include <math.h> using namespace std; int main() { int a,b,c,i,j,x=0, f=0, count=0;
cin>>a; long long int mass[a]; for(i=0;i<a;i++) cin>>mass[i]; cin>>b; long long int mass1[b]; for(i=0;i<b;i++) cin>>mass1[i]; cin>>c; long long int mass2[c]; for(i=0;i<c;i++) cin>>mass2[i];
int y = min(min(a,b), min(b,c));
long long int mass3[y]; for(int u=0; u<y; u++) mass3[u]=-1;
long long int mass4[y]; for(int u=0; u<y; u++) mass4[u]=-1;
for(i=0;i<a;i++) { for(j=0;j<b;j++) { if(mass[i]==mass1[j]) { mass3[x]=mass[i]; x++; } } } for(i=0;i<c;i++) { for(j=0;j<c;j++) { if(mass1[i]==mass2[j]) { mass4[f]=mass1[i]; f++; } } } for(i=0;i<y;i++) { for(j=0;j<y;j++) { if(mass3[i]==mass4[j]&& mass3[i]!=-1 &&mass4[j]!=-1) count++; } } cout<<count; return 0;
} |
| Some tests | Dron-elektron | 1249. Древний некрополь | 30 июл 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 |
| WA#2 - Answer | Deem | 1086. Криптография | 30 июл 2014 14:54 | 2 |
You probably get WA#2 because your "for" goes untill 15001. Like this: for (i = 7; i < 15001; i++). Actually amount of prime numbers when i == 15001 is nearly about 2500. You need to make a counter of prime numbers and generate primes while (count <= 15001). Then your programm will be AC! |
| To admins: please add this test | MVM | 1004. Экскурсия | 30 июл 2014 03:31 | 1 |
Please add this test (if it is not already here and if it is not too hard): 100 133 1 2 1 1 34 300 2 3 1 3 4 1 4 5 1 5 6 1 6 7 1 7 8 1 8 9 1 9 10 1 10 11 1 11 12 1 12 13 1 13 14 1 14 15 1 15 16 1 16 17 1 17 18 1 18 19 1 19 20 1 20 21 1 21 22 1 22 23 1 23 24 1 24 25 1 25 26 1 26 27 1 27 28 1 28 29 1 29 30 1 30 31 1 31 32 1 32 33 1 33 34 1 34 36 300 34 35 1 35 36 1 36 37 1 36 38 150 37 38 1 38 39 1 38 40 75 39 40 1 40 41 1 40 42 38 41 42 1 42 43 1 42 44 19 43 44 1 44 45 1 44 46 10 45 46 1 46 48 5 46 47 1 47 48 1 48 50 3 48 49 1 49 50 1 50 52 2 50 51 1 51 52 1 52 54 1 52 53 1 53 54 1 54 55 1 54 56 1 55 56 1 56 57 1 56 58 1 57 58 1 58 60 1 58 59 1 59 60 1 60 62 1 60 61 1 61 62 1 62 64 1 62 63 1 63 64 1 64 65 1 64 66 1 65 66 1 66 67 1 66 68 1 67 68 1 68 70 1 68 69 1 69 70 1 70 72 1 70 71 1 71 72 1 72 74 1 72 73 1 73 74 1 74 76 1 74 75 1 75 76 1 76 77 1 76 78 1 77 78 1 78 79 1 78 80 1 79 80 1 80 82 1 80 81 1 81 82 1 82 84 1 82 83 1 83 84 1 84 86 1 84 85 1 85 86 1 86 87 1 86 88 1 87 88 1 88 89 1 88 90 1 89 90 1 90 91 1 90 92 1 91 92 1 92 93 1 92 94 1 93 94 1 94 96 1 94 95 1 95 96 1 96 98 1 96 97 1 97 98 1 98 99 1 98 100 300 99 100 1 repeated 5 times. One of my AC submissions works 0.8 seconds locally on this test, but works 0.187 seconds max on judge. Even though my computer is slower than judge, it still looks like a big difference. |
| WA on test#13 . Can someone help ^ ... ^ | wanggp3 | 1453. Ферзь | 30 июл 2014 00:00 | 1 |
|
| ввод данных | Denison1023 [USU] | 2000. Grand Theft Array V | 29 июл 2014 22:21 | 2 |
существует ли способ записи данных в массив без использования строк?? А причем тут строка и массив в принцепи? Берем и записываем в нужный индекс считанное число. // В случае C++ #include <iostream> #include <vector> int main() { int n; int start1, start2; std::vector<int> v; std::cin >> n; v.resize(n); for (size_t i = 0; i < n; i++) std::cin >> v[i]; std::cin >> start1 >> start2; // Решение return 0; } Edited by author 29.07.2014 22:22 |
| Very easy & interesting problem!!! | Azimboy Odilov (TUIT of Urgench Branch) | 1837. Число Исенбаева | 29 июл 2014 16:50 | 2 |
I completely agree with you! Also, it is very good for training with maps(c++)/dictionaries(python). |
| WA 1, Runtime error (access violation), C#. | susimus[SESC17] | 1601. АнтиКАПС | 29 июл 2014 13:08 | 1 |
var temp = ""; var cond = false; var list = new List<string>(); while ((temp = Console.ReadLine()) != "") { list.Add(""); foreach (var item in temp) if (char.IsLetter(item)) if (cond == false) { cond = true; list[list.Count() - 1] += char.ToUpper(item); } else list[list.Count() - 1] += char.ToLower(item); else if ((item == 33) || (item == 46) || (item == 63)) { cond = false; list[list.Count() - 1] += item; } else list[list.Count() - 1] += item; } foreach (var item in list) Console.WriteLine(item); Console.Read(); Can anybody help me? |