| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| Does "that it is accurate to 8 inches" requirement mean anything? | ToadMonster | 1185. Wall | 29 фев 2016 18:25 | 1 |
There is task fragment: "However, you must round the result in such a way, that it is accurate to 8 inches (1 foot is equal to 12 inches)" I thought it means that result should be int and (result*12) should be divided by 8 without reminder. I received WA3. When I ignored requirement and used simple rounding like int(result+0.5) I got ac. So, does requirement mean anything? Maybe it should be removed from task? |
| WA 2 | Vova | 1658. Сумма цифр | 28 фев 2016 07:37 | 2 |
WA 2 Vova 6 янв 2016 18:43 I have WA 2. I don't understand why? Give me some tests please, which will help me understand my mistake. Thank you. Re: WA 2 Drunken Statue 28 фев 2016 07:37 Hint: read requirements in careful way Closely look at _output_ requirements |
| Работающая версия [Worked] | sovaz1997 | 1197. Один в поле воин | 28 фев 2016 00:05 | 1 |
#include <iostream> #include <string> #include <vector> using namespace std; int test_horse(int, int); int test(string); int test(string run) { return test_horse(run[0] - 'a', run[1] - '1'); } int test_horse(int x, int y) { int count = 0; if(x + 1 < 8 && y + 2 < 8) {count++;} if(x + 1 < 8 && y - 2 >= 0) {count++;} if(x - 1 >= 0 && y + 2 < 8) {count++;} if(x - 1 >= 0 && y - 2 >= 0) {count++;}
if(x + 2 < 8 && y + 1 < 8) {count++;} if(x + 2 < 8 && y - 1 >= 0) {count++;} if(x - 2 >= 0 && y + 1 < 8) {count++;} if(x - 2 >= 0 && y - 1 >= 0) {count++;}
return count; } int main() { vector<string>vec;
int N; cin >> N;
for(int i = 0; i < N; ++i) { string str; cin >> str; vec.push_back(str); }
for(int i = 0; i < vec.size(); ++i) { cout << test(vec[i]) << endl; }
} |
| for C/C++ try this | yuzeming | 1074. Очень короткая задача | 27 фев 2016 19:42 | 1 |
|
| Editorial 1222. Chernobyl’ Eagles | knok16 | 1222. Chernobyl’ Eagles | 27 фев 2016 15:36 | 1 |
Editorial 1222. Chernobyl’ Eagles We need to find set of numbers k > 0 and a[i] > 0: a1 + a2 + ... + ak = n a1 * a1 * ... * ak -> inf 0. If n = 1 answer = 1, later let's suppose n > 1 1. First of all let's see that in optimal solution a[i] > 1: Assume a[j] == 1 for some j, also it means that k > 1 (i.e. there is another a[f] in our solution, f != j): a1 * a2 * ... * a[j-1] * 1 * a[j+1] * ... * ak = a1 * a2 * ... * a[j-1] * a[j+1] * ... * ak < a1 * a2 * ... * a[j-1] * a[j+1] * ... * (ak + 1) = a1 * a2 * ... * a[j-1] * a[j+1]) * ... * ak + a1 * a2 * ... a[j-1] * a[j+1]) * ... * a[k-1] It means that such set of number (a1, a2, ..., a[j-1], 1, a[j+1], ..., ak) is not optimal solution 2. Now let's see that in optimal solution a[i] < 4: Assume a[j] >= 4 for some j, now we can split a[j] to (a[j] - 2) and 2, and find which a[j] will give us better results: a1 * a2 * ... * a[j] * ... * ak >= a1 * a2 * ... * (a[j] - 2) * 2 * ... * ak (a[j] - 2) * 2 >= a[j] 2 * a[j] - 4 >= a[j] a[j] - 4 >= 0 a[j] >= 4 (as we assumed) It means that optimal solution will be consist 2's and 3's: 2 * a + 3 * b = n 2 ^ a + 3 ^ b -> max 3. Consider all leftover form of solution which was not proved to be not optimal: 1) 3 * 3 * 3 * 3 * ... (a = 0) 2) 2 * 3 * 3 * 3 * ... (a = 1) 3) 2 * 2 * 3 * 3 * ... (a = 2) 4) 2 * 2 * 2 * 3 * ... (a = 3) 5...) .... a > 3 Solution's 4), 5), 6), ... - is not optimal because we can take any 3 of 2's and replace it with 2 of 3', because 2 * 2 * 2 = 8 < 9 = 3 * 3 It means that 1), 2), 3) potential form of optimal solution 4. Now show that none of the solutions 1), 2), 3) can be compared to each other and it will be mean that 1), 2) and 3) can not be improved, i.e. it is optimal solution. For this let's look at constraint: 2 * a + 3 * b = n 1) 3 * b1 = n => n % 3 = 0 2) 3 * b2 + 2 = n => n % 3 = 2 3) 3 * b3 + 2 * 2 = 3 * b3 + 4 = 3 * (b3 + 1) + 1 = n => n % 3 = 1 Now we can see that form of optimal solution (1), 2) or 3)) depend on n % 3, e.g. if n % 3 == 2, then form 2) is optimal solution and nor 1) nor 3) can be formed. |
| ML :C | amishenev | 1050. Подготавливая статью | 27 фев 2016 11:32 | 1 |
ML :C amishenev 27 фев 2016 11:32 Memory limit test 1. C++. using: vector<string> str str[i].erase() str[i].insert() using erace and insert it creats another string object. I know, so how can i insert '' or `` instead of " ? |
| WA 3 | JavaClass | 1002. Телефонные номера | 27 фев 2016 00:26 | 1 |
WA 3 JavaClass 27 фев 2016 00:26 How can I recognize mistake in my programm? |
| интересное усложнение | Dubsage | 1013. K-ичные числа. Версия 3 | 26 фев 2016 20:05 | 3 |
|
| Condition clarification | ToadMonster | 1836. Вавилонская рыбка | 25 фев 2016 21:01 | 1 |
What is expected answer for test like "10 0 1 3 1"? Should answer be some number or "ambiguous"? Thanks |
| WA #7 Hint | index | 1523. K-инверсии | 25 фев 2016 17:52 | 1 |
If you use fenwick tree and got WA #7, don't write Get(r) - Get(l - 1). Write (Get(r) - Get(l - 1) + mod) % mod. |
| Hint | index | 1028. Звёзды | 25 фев 2016 08:38 | 1 |
Hint index 25 фев 2016 08:38 Stars are listed in ascending order of Y coordinate. Stars with equal Y coordinates are listed in ascending order of X coordinate. |
| WA#4 | P.S. | 1123. Зарплата | 25 фев 2016 01:17 | 3 |
WA#4 P.S. 19 окт 2013 19:08 Не могу понять что не так. Уже понял! 1999 2002 Edited by author 19.10.2013 21:24 Edited by author 19.10.2013 21:25 Re: WA#4 Arseniy_Pavlov 25 фев 2016 01:17 1992 -> 2002 this is right answer, isn't it? |
| C#, wrong answer at test #6 | Anem | 1992. CVS | 24 фев 2016 22:16 | 1 |
Used built-in Stack class, memory and time constraints seem to be OK. What could be the source of the problem? |
| WA#19 | Maksim | 1635. Мнемоника и палиндромы | 24 фев 2016 16:20 | 1 |
WA#19 Maksim 24 фев 2016 16:20 pls help Edited by author 24.02.2016 16:20 |
| Too much difficulty but too easy problem | index | 1085. Встреча | 24 фев 2016 09:58 | 1 |
|
| Simpler solution | index | 1846. НОД 2010 | 23 фев 2016 20:00 | 1 |
I solved this problem by map for keeping count of numbers and dynamic segment tree. Is there any simpler solution that don't use data structures. |
| Every testcase given here is WORKING with the expected answer but still WA 3. Please help. | Dev_Python | 1607. Такси | 23 фев 2016 09:16 | 2 |
Could someone tell me what WA - 3 is. all the test cases are working with the expected output but still get WA 3. NOt sure where the problem is. Kindly help. I myself have found the solution for test case - 3. Try: 1 3 4 3 the answer should be 4 |
| Idea | __Andrewy__ | 2021. Страшно интересно! | 22 фев 2016 23:22 | 5 |
Idea __Andrewy__ 14 июл 2015 12:37 Можно жадиной решать,заметив,что всё зависит от суммы набранных очков.В зависимости от ситуации( Sum1<Sum2 Sum1>=Sum2) построить решение. К примеру с помощью двух сортировок. Условие задачи, ИМХО, сформировано ужасно, в результате чего мы завалили эту задачу на контесте В условии нет ни слова про то, что понимается под "держать в напряжении", в результате наше решение максимальное количество раундов держало минимамальную разницу между командами, что является неправильным решением *кидает камень в огород жюри* this idea gives wa9 Very interesting to find test when it is bad. May be situation when Sum1=Sum2 is important For example: with idea we have 0 6 0 0 0 0 6 0 and in i=3 2-st doesn't loser but for 0 0 0 0 6 6 we have uncertainty for i<=3 Edited by author 21.01.2016 13:10 Да,но ведь победа всё равно не очевидна(ведь в конце может быть 6) Re: Idea Jane Soboleva (SumNU) 22 фев 2016 23:22 Фраза «держать в напряжении» действительно достаточно неясная. Я посчитала, что алгоритм должен быть таким: на каждом шаге я подбираю какую-нибудь одну из пар, которая максимально приблизит суммарную разницу в очках к нулю (неважно, с какой стороны). В итоге WA17, как у людей в соседней ветке, и не вполне понятно, почему... |
| Test question | MOPDOBOPOT (USU) | 1314. Погоня в метро | 22 фев 2016 20:07 | 2 |
Need help, WA9! 2 2 1 2 2 3 4 1 1 Is this test possible or not? |
| who gets wa6? | frost | 1484. Кинорейтинг | 22 фев 2016 19:28 | 31 |
what's the trick? 3% of the ac rating..... what's the trick? 3% of the ac rating..... A lot of wrong tests - is all you need for low AC rating. I don't find mistakes in my program, but WA6 too my prog returns: 10.0 1.0 1000000 179000001 10.0 9.9 1 1 1.1 1.0 12345 123456 10.0 10.0 10 0 "Impossible" answer never returns
My AC program outputs 29851 How did you got that??? I use n*(y-x)/(1-y) (14926+4.4*1000)/(14926+1000000)=4.34999793088.. ((14926+4.4*1000)/(14926+1000000)):0:1=4.3 Edited by author 07.10.2006 21:08 You formula is incorrect. What if y == 1.0 ??? You are dividing by 0 ? y:=y+0.05-eps without rounding 1.0 will not be achieved Edited by author 07.10.2006 21:21 first: not (14926+4.4*1000)/(14926+1000000)=4.34999793088.. but (14926+4.4*1000000)/(14926+1000000)=4.34999793088.. second: not (14926+4.4*1000)/(14926+1000000)=4.34999793088.. but (14926+4449999)/(14926+1000000)=4.399261621 third: (29851+4449999)/(29851+1000000)=4.349998204 Yes you are right - i've made mistake while printing: 1000 -> 1000000, Thank you but i don't understand how we should compute not rounded X value I think that this task more harder than it seems after first reading:)
Edited by author 07.10.2006 22:45 x*n can be X=(x+.05)*n while (X/n>=x+0.05)X-- Edited by author 08.10.2006 00:45 mine is also 29851, but i still wa@6. I used y=y+0.05 in my program and get WA6. Why x should be increased x=x+0.05? 1.1 1.0 12345 My prog:24676 But Ihave Wa11 1.1 1.0 12345 My prog:24676 But Ihave Wa11 Can't understand Ans ((1.149999999) * 12345 + 24676) / (12345 + 24676) > 1.5 My Ans is 24692 for test 1.1 1.0 12345 rigth answer IMHO 24676, 24676 < 123456 my AC program works on this test cases 4.4 3.4 12478 5094 10 3.4 23577 63033 9.9 8.3 1000000 217687 4.6 1.2 12997 176760 6.6 2.2 44766 157576 10 1 2 359 2 1.9 1000000 105263 Edited by author 18.10.2006 02:45 Ivanidze, did you get AC? 9.9 8.3 1000000 217688 - 217687 makes into over 8.35 -> 8.4 6.6 2.2 44766 157577 - 157576 makes into over 2.25 -> 2.3 2.0 1.9 1000000 105264 - 105263 makes into over 1.95 -> 2.0 9.9 8.3 1000000 217688 - 217687 makes into over 8.35 -> 8.4 6.6 2.2 44766 157577 - 157576 makes into over 2.25 -> 2.3 2.0 1.9 1000000 105264 - 105263 makes into over 1.95 -> 2.0 Really? I think you are mistaken. For example: 6.6 2.2 44766 x<6.65=>x*n<6.65*n=297693.9 MAX(x*n)=297693, not 297694 because 297694/44766=6.6500..->6.7 (297693+157576)/(44766+157576)=2.24999752....->2.2 I suppose 9.9 8.3 1000000 217687 6.6 2.2 44766 157576 2.0 1.9 1000000 105263
Edited by author 10.10.2006 18:54 May be this test is useful. At least, it helped me :) 7.8 2.3 100 407 In this snare (x+0.05)*n is integer. In this case we should use (x+0.05)*n-1. Thank you. I had: "... SI:=(ceil((x+0.05)*n)-1)*100; ..." And now I have "... SI:=(ceil((x+0.05)*n-1e-10)-1)*100; ..." AC Re: Test cases Ustad Bediuzzaman Said Nursi Hazretleri Rulezzzzzz 30 окт 2006 00:22 I think 7.8 2.3 100 must be 408. Am I right? AC rating became 2% try to submit your code 50 times and you'll get AC:))) How many times do I need to submit to get 1% rating??) Edited by author 22.02.2016 19:36 |