Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
wa9 | Лев | 1795. Мужья в магазине | 25 ноя 2021 23:39 | 1 |
wa9 Лев 25 ноя 2021 23:39 the store had the product, but sold it = the store did not have the product if (!Products.count(name) || !Products[name]) Purchases.erase(Purchases.begin() + i); |
If you get WA9 | Mescheryakov_Kirill [SESC17] | 1795. Мужья в магазине | 25 ноя 2021 23:18 | 2 |
Test: 1 10 of gg 3 1 of ff 10 of gg 9 of gg Correct Answer: 3 Edited by author 25.11.2021 23:40 |
For whom, who get WA 26 | SFU ISIT Jr. | 1795. Мужья в магазине | 27 сен 2019 00:25 | 2 |
Try this: 3 2 of sweets 5 of milk 1 of sausage 4 6 of milk 3 of milk 1 of milk 3 of sweets Correct answer is: 8 Good luck! |
WA 2 | Andris | 1795. Мужья в магазине | 30 мар 2018 10:32 | 1 |
WA 2 Andris 30 мар 2018 10:32 Could anyone give me some tests for this one? |
WA 11 | NumbMoon | 1795. Мужья в магазине | 2 янв 2017 23:52 | 1 |
WA 11 NumbMoon 2 янв 2017 23:52 Could anyone give me some tests for this one? |
Runtime error test 9 | NumbMoon | 1795. Мужья в магазине | 2 янв 2017 21:14 | 1 |
Could someone give me some tests for this one? |
If you have WA 3 | Moonstone [Samara SAU] | 1795. Мужья в магазине | 2 янв 2017 21:09 | 5 |
Try this test case: 1 1 of vodka 1 2 of vodka Answer = 1 Thank you! I was being mad about this WA during the contest. :) Why answer is 1? He wants more than is in the shop, so he calls his wife and asks her. This means that the answer is 2. Or I misunderstood? Because he is letting our hero go in front of him, which is the main objective. |
Can't figure out the "swap" part | NumbMoon | 1795. Мужья в магазине | 2 янв 2017 18:20 | 1 |
Could anyone, please, explain it to me? I can't understand how to program it. I'm filling the "amount of name" for the storage in the shop and for the queue, then, for each human from the queue, I check, firstly, whether the shop has the product the customer needs to buy, and then, if the shop has it, I compare the amounts. But I have a problem in understanding the part where the shop doesn't have enough of the product and the customers switch places. Could anyone explain it to me? |
WA20 | Lev_Kireenko 🐬 [SESC 17] | 1795. Мужья в магазине | 27 июл 2016 17:25 | 1 |
WA20 Lev_Kireenko 🐬 [SESC 17] 27 июл 2016 17:25 What it is test 20 ? Edited by author 27.07.2016 17:35 Edited by author 27.07.2016 17:35 Edited by author 27.07.2016 18:36 |
WA #10 | vtalgo16_alysenko | 1795. Мужья в магазине | 6 июн 2016 02:46 | 1 |
WA #10 vtalgo16_alysenko 6 июн 2016 02:46 My programm passes all tests from forum, but i still got WA 10. Have anybody some more tricky tests? |
For whom, who get WA 9 | Gleb_Kazantaev(NNSTU) | 1795. Мужья в магазине | 11 окт 2015 20:19 | 3 |
It's too funy! I forgot to check one little moment if(goods[v[0].s] == 0){ time++; v.pop_front(); continue; } Or try this test: 1 1 of hell 3 1 of lol 2 of azaz 3 of bug Answer: 3, but my old programm gives 5 LOL, Good Luck! My problem is not this that gives the correct answer, but despite that WA9 Try this: 1 1 of a 3 1 of a 1 of a 1 of b Correct answer is 3. |
test 22 | Dmitriy Black | 1795. Мужья в магазине | 3 сен 2014 15:54 | 2 |
test 22 Dmitriy Black 28 авг 2011 19:14 Help please. give please test #22. I can't Imagine what can be wrong in my programm hi ,do you konw why it's wrong now? Could you please help me? |
WA8. What the f??k :) | Evgeniy++ | 1795. Мужья в магазине | 13 фев 2014 18:49 | 8 |
Hello gentlemen! Who can explain why I get WA8? Are there any test data available to anyone? 1 10 of anawa 2 10 of anawa 1 of anawa answer = 2 not 3 Edited by author 24.10.2010 04:07 I've got this answer, but WA8 too. Try this test 1 2 of vodka 1 3 of vodka answer 1 Yes, it is ;) Edited by author 22.07.2012 20:26 Edited by author 22.07.2012 20:26 Edited by author 22.07.2012 20:31 2 100 of vodka 1 of matryoshka 3 100 of vodka 1 of vodka 1 of matryoshka |
WA9 | PrankMaN | 1795. Мужья в магазине | 18 авг 2013 02:42 | 1 |
WA9 PrankMaN 18 авг 2013 02:42 I had a stupid mistake Instead of: shop[want] -= q[r].amount; I had: shop[want] = q[r].amount; |
Admins, please check test 8 for submission 4909253 on Java | d3m0n1c | 1795. Мужья в магазине | 27 апр 2013 00:39 | 3 |
Or give me some tests please. All tests that were proposed on the forum shows correct result. The main loop is: while (head != n) { if (id[head] != -1) { int have = shop[id[head]].count; if (have > 0) { if (want[head] > have) { if (head == n - 1) { ++time; break; } swap(id[head], id[head + 1]); swap(want[head], want[head + 1]); want[head + 1] = have; } else { shop[id[head]].count = have - want[head]; ++head; } } else ++head; } else ++head; ++time; } Edited by author 19.04.2013 14:14 Edited by author 19.04.2013 14:14 I think that the problem is in the function swap() which doesn't work in Java. Your guess is wrong. I wrote swap method. Also I used my own hashing. Maybe this is the root cause. |
wa14 | mihaildemidoff | 1795. Мужья в магазине | 22 июл 2012 21:00 | 4 |
wa14 mihaildemidoff 20 окт 2010 22:06 please, give me some test Check the situation when one husband comes back for the second time, the quantity he wants to buy was modified meanwhile ... I had the same WA, but now I have AC Re: wa14 Pavel Pisligin [IATE] 22 июл 2012 21:00 I had wa 14 in this case: when husband returns the second time and amount was not changed then I forgot to set amount to 0 (husband buy this product) |
Question | Andrew Sboev | 1795. Мужья в магазине | 5 июл 2012 14:41 | 2 |
May answer be a floating point number? "телефонный разговор с женой длится полминуты." Or I should to round answer? Sorry, I understand what does this statement mean. Edited by author 23.05.2012 16:33 Too easy and fun problem :) deque + map = Accepted. |
WA13 PLEASE, give me some test | ANDREY | 1795. Мужья в магазине | 10 мар 2012 19:28 | 3 |
#include <iostream> using namespace std; int main() {long n,m,a[1010],b[1010],c[1010],k,i,e,j,q; char t[1010][25],g[1010][25]; cin >> m; for (i=1;i<=m;i++){ cin >> a[i] >> t[0] >> t[i]; } cin >> n; for (i=1;i<=n;i++){ cin >> b[i] >> g[0] >> g[i]; } for (i=1;i<=n;i++)c[i]=0; for (i=1;i<=n;i++){ for (j=1;j<=m;j++){ k=1; for (e=0;e<=21;e++){ if (g[i][e]!=t[j][e])k=0; } if (k==1)c[i]=j; } } a[0]=0; q=0; for (i=1;i<=n;i++){ asd:; q++; if (a[c[i]]==0){goto lkj;} if (a[c[i]]>=b[i]){ a[c[i]]=a[c[i]]-b[i]; goto lkj; } if ((a[c[i]]<b[i])&&(i<n)){ b[i]=b[i+1]; b[i+1]=a[c[i]]; k=c[i]; c[i]=c[i+1]; c[i+1]=k; goto asd; } if ((a[c[i]]<b[i])&&(i==n)){ b[i]=a[c[i]]; goto lkj; } lkj:; } cout << q; cin >> i; return 0; } you compare strings by the cycle k=1; for (e=0;e<=21;e++){ if (g[i][e]!=t[j][e])k=0; } if (k==1)c[i]=j; this will be correct if you init arrays char t[1010][25],g[1010][25]; to 0. And your program will take AC!!! |
WA 9 | Azad | 1795. Мужья в магазине | 15 ноя 2011 02:34 | 2 |
WA 9 Azad 28 окт 2010 09:54 Can anyone give me test 9? Edited by author 22.11.2011 01:47 |
WA #10 | Mirsaid Mirolimjonov (MSU Tashkent) | 1795. Мужья в магазине | 10 ноя 2011 18:49 | 2 |
WA #10 Mirsaid Mirolimjonov (MSU Tashkent) 22 авг 2011 15:46 Can you give some tests for WA#10 Re: WA #10 Smilodon_am [Obninsk INPE] 10 ноя 2011 18:49 This simple test helped me: 1 2 of sweets 4 2 of sweets 3 of sweets 3 of sweets 5 of sweets Answer is: 4 |