Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Use next_permutation | buyolitsez | 2011. Длинное условие | 24 мар 2020 21:29 | 2 |
I used next_permutation and get AC i used next_permutation and got TLE |
9th test | Shohin | 2011. Длинное условие | 21 мар 2018 07:12 | 3 |
test 2 1 1 1 1 1 1 ans: Yes |
No Need To Use Loop, Only If can solve it | Sherxon WIUT | 2011. Длинное условие | 30 авг 2017 18:43 | 10 |
... Edited by author 06.12.2014 19:30 I solve without loop but is return WA#4 There is my algorithm : if in list has 1 , 2 , 3 together always "Yes" otherwise "No" am I right or any case is there ? Edited by author 09.08.2017 09:41 Edited by author 09.08.2017 09:42 You can get six combinations with two a's and two b's You can get six combinations with one a and five b's Sorry but I don't understand what do you mean ! Give me Test Case #4 0011 0101 0110 1001 1010 1100 That is six 000001 000010 000100 001000 010000 100000 That is also six 012 021 102 120 201 210 And that is six Answer is No , Correct ? 0011 0101 0110 1001 1010 1100 That is six |
How many tests are there, lol? | Mahilewets Nikita [BSUIR] | 2011. Длинное условие | 12 авг 2017 16:21 | 1 |
There are at LEAST, 70 tests. |
Why WA?Who can help me? | Frank | 2011. Длинное условие | 11 май 2017 12:16 | 2 |
int main(int argc,char *argv[]){ //freopen("data.txt","r",stdin); int n,i,key = 0,count = 0; char p[105],input[105]; scanf("%d",&n); getchar(); for(i = 0; i < n; i++){ scanf("%c",&input[i]); getchar(); } input[i] = '\0'; strcpy(p,input); while(next_permutation(p,p+n)){ if(strcmp(p,input) == 0){ break; } else { count++; if(count >= 5){ printf("Yes\n"); return 0; } } } if(count >= 5){ printf("Yes\n"); } else { printf("No\n"); } } count should be at least 6 :) |
What is 56th test | Mukhammadali | 2011. Длинное условие | 18 ноя 2016 20:52 | 1 |
|
Explaining combinations for school students | IlushaMax | 2011. Длинное условие | 23 апр 2016 17:32 | 1 |
|
Just use next_permutation() in C++! | GastonFontenla | 2011. Длинное условие | 15 янв 2016 17:36 | 1 |
next_permutation() generates distinct permutations of a given iterable object (vector, string, etc). Just make 6 permutations, and save each of them in a set<vector<int> >. Finally, check if the size of the set is 6, because the set only saves different elements. Pretty easy solution. |
wrong ans #26.Is there any test. | Bahodir | {TUIT} | | 2011. Длинное условие | 15 сен 2015 20:04 | 4 |
wrong ans #26.Is there any test. 2 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 2 |
Wrong answer 55, give me some tests, please | Ivan Metelev | 2011. Длинное условие | 17 июн 2015 01:35 | 1 |
// code deleted Edited by author 17.06.2015 01:38 |
What's WA#5? | novopashinwm | 2011. Длинное условие | 17 июн 2015 01:15 | 3 |
4 1 1 1 1 No 4 1 1 2 2 Yes 4 1 1 1 2 No 4 2 1 1 1 NO Try this tests. It helps me. But I have WA #55 and I need a help Edited by author 17.06.2015 02:16 |
13th test | Popovici Mircea | 2011. Длинное условие | 7 дек 2014 15:16 | 8 |
I'm wondering if anyone knows the 13th test... i think it's some kind of special case. These are 3 test i suppose cause, it doesn't specificate that we have multiple test cases in one input. Am I right? No, you are not right. There is just one test case in every input, multiple tests were written just for you. Test: 7 1 1 1 1 1 1 2 YES Test: 4 1 1 2 2 Ans: Yes Edited by author 11.11.2013 15:19 4 1 1 2 2 Yes cause: 1122 1212 1221 2121 2211 2112 Edited by author 16.12.2013 23:57 i thinks these tests are not suitable for 13th s. 'casue i passed these ,but get 13th wrong. Two-Eight-Nine.Thanks...!!! |
very annoying problem | arrammis | 2011. Длинное условие | 4 дек 2014 20:48 | 1 |
i had 9 wroung attempts, 10 was AC lol |
Runtime error (integer division by zero) in test 70 | Anton Malyuta | 2011. Длинное условие | 5 сен 2014 06:04 | 11 |
My code: /* Code deleted. */ we get the WA12. What's the problem? Edited by author 09.11.2013 22:57 You will easily get overflow... 100! ~ 9*10^157 which is a "little" too big Oh, right! Thank you very much. It turns out I have the wrong formula? Thank you very much. I change long long to double. ;) This problem is possible to solve without any formulas - just using one sorting of 3-element array and 3 IF statements - so, you won't have problems with overflows Please, could you explain a bit more your approach? Edited by author 05.09.2014 03:37 Just got A.C Just need to change all variable and return values to double. Count number of 1s 2s and 3s. Take the factorials of these numbers however you feel right, divide by total length,n. Please, could you explain a bit more your approach? Thanks you very much! I did this: 4 If. One for n > 5, the another threes for n == 5, n == 4 and n == 3. |
scala too slow? | Vassili Skarine | 2011. Длинное условие | 17 июн 2014 14:20 | 3 |
tried tons of optimizations but Scala solution still TLE, any suggestions? ok so I got AC the key difference seems to be in using correct way to read the input if I use readLine().split(' ').map(_.toInt) then it always TLE but if I read input using Java Scanner: val sc = new Scanner(System.in); .... sc.nextInt() ... then it works fine Edited by author 31.03.2014 08:45 I also have many problems with scala. My scala code runs two times slow than the corresponding java code. Sometimes it's really hard to optimize. My tips (in general, not specifically about this problem): * don't use vars if not really necessary * foldLeft and similar functions are slow unfortunately (although I tend to use them anyways, only switch to for when I got a TLE) * array initialization is REALLY slow especially if you use fill (much more slower than java). try to keep your arrays as small as possible. For example sometimes it's possible to keep only the last two rows of a matrix. |
easy solution | sonamon | 2011. Длинное условие | 4 июн 2014 00:09 | 1 |
if you deal with n>5 and n<=5 cases separately. The former does not require any factorial calculation |
No subject | bdm2505 | 2011. Длинное условие | 17 фев 2014 15:31 | 1 |
Edited by author 18.02.2014 14:04 |
хотя бы шесть различных слов длины n | Sinigami17 | 2011. Длинное условие | 13 фев 2014 20:28 | 1 |
Ребята будьте внимательный когда читаете условия. Я потратил пол часа пока понял что нужно составить не менее 6 а не не менее n слов... |
12 test WA | Лерник Казарян | 2011. Длинное условие | 10 дек 2013 12:48 | 3 |
|
13th test | Md. Mostafizur Rahman | 2011. Длинное условие | 9 ноя 2013 14:55 | 1 |
13th test Md. Mostafizur Rahman 9 ноя 2013 14:55 I test the 13th case which has been given before but it gives WA for test 13. please can any body tell me what's the wrong |