| Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
| weak test | Celebrate | 1652. Банковский кризис | 11 окт 2021 11:48 | 1 |
My friends solve it with dicnic. But its time complexity can be up to O(nm^sqrt(n+m)),and its space compexity can be up to O(nm). I think admin should add the test that all the bank belong to one country. |
| Why WA#4? | Al.Cash | 1565. Необычная дуэль | 10 окт 2021 22:27 | 4 |
I see many people had this WA. Can someone give me a hint about it? I think it will be useful for others. I had WA 4 because of wrong supposition: let probabilities are p0=1.0, p1, p2 p1 > p2 "p1" always should shoot into "p0" "p2" always should shoot into the air Thank you! There are really much more cases. Another way is to type (i-1) instead of (1-i) somewhere in your code without noticing and then spend 90 minutes going over the code and try to figure out how your logic could possibly be wrong. |
| SUS???? | Incognito | 1290. Саботаж | 9 окт 2021 06:11 | 1 |
|
| С++ solution | VlasovNikita | 2001. Математики и ягоды | 8 окт 2021 21:42 | 2 |
#include <iostream> using namespace std; main() { int a, b ; int a1 , b1; int a2 , b2; cin >> a >> b; cin >> a1 >> b1; cin >> a2 >> b2;
int c = b - b1; int c1 = a - a2; cout << c1 << " " << c; return 0; } ____________________________________ Держите) Не правильно #include <iostream> using namespace std; main() { int a, b ; int a1 , b1; int a2 , b2; cin >> a >> b; cin >> a1 >> b1; cin >> a2 >> b2;
int c = b - b1; int c1 = a - a2; cout << c1 << " " << c; return 0; } ____________________________________ Держите) |
| Что не так пишет неверный ответ все пересчитал ответы правильные дает | Евгений | 2111. Платон | 8 окт 2021 15:49 | 1 |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner a = new Scanner(System.in); int x = a.nextInt(); //String x1 = a.nextLine(); int y = 0; int z = 0; int [] array1 = new int[x]; for(int i=0;i<x;i++) { array1[i] = a.nextInt(); y+=array1[i];
if(i==1 && array1[i] < array1[i-1] ) { int tmp = array1[i]; array1[i] = array1[i-1]; array1[i-1] = tmp; } }
for(int i=array1.length-1;i>-1;i--) { z+=array1[i]*y; y-=array1[i]; z+=array1[i]*y; }
System.out.println(z); } } |
| С++ решение(нужно ускорить) | Romanchillihotpepper | 1068. Сумма | 8 окт 2021 14:32 | 1 |
#include <iostream> int main() { short n;int a=0; std::cin>>n; if(n<=0){ for(int i=n;i<=1;i++){ a+=i; } std::cout<<a; } else{ for(int i=1;i<=n;i++){ a+=i; } std::cout<<a; } return 0; } |
| hint | Razumnuy(MISIS) | 2050. 3D-моделирование | 8 окт 2021 12:15 | 2 |
hint Razumnuy(MISIS) 25 июн 2015 09:26 The answer is the symmetry axis In test 3 the angle between the lines is very small Edited by author 26.06.2015 02:34 thx! <code> #include <stdio.h> int main(){ printf("1 1 0\n0 0 0\n180\n"); } </code> gives WA3 ^) |
| Помогите понять мою ошибку | Romanchillihotpepper | 1820. Уральские бифштексы | 8 окт 2021 11:40 | 1 |
Почему так не проходит(ошибка на 13): #include <iostream> int main() { int n,k; std::cin>>n>>k; if(n<=k) std::cout<<2; else std::cout<<n*2/k+n*2%k; return 0; } А так проходит: #include <iostream> int main() { int n,k; std::cin>>n>>k; if(n<=k) std::cout<<2; else{ if(n*2 % k == 0) std::cout<<n*2/k; else std::cout<<n*2/k+1; } return 0; } Ну или тернар(тоже не проходит - ошибка на 13): #include <iostream> int main() { int n,k; std::cin>>n>>k; (n<=k)?std::cout<<2:std::cout<<n*2/k+n*2 % k; return 0; } Может я чего не понимаю, может всё-таки где-то приоритет потерял, но ведь идентично же. Edited by author 08.10.2021 11:51 Теперь понял, %k может вернуть и больше, чем 1 Edited by author 08.10.2021 12:00 Edited by author 08.10.2021 12:02 C++ ответ: #include <iostream> int main() { int n,k; std::cin>>n>>k; (n<=k)?std::cout<<2:(n*2%k==0)?std::cout<<n*2/k:std::cout<<n*2/k+1; return 0; } Edited by author 08.10.2021 12:03 |
| good idea to avoid mistake | Celebrate | 1575. Екатеринбургское метро 2 | 8 окт 2021 04:45 | 1 |
I have some mistake in the staion name which I can't find it in my code. Then I search all the string my write and calculate LCS. The string has maximal LCS is what we want to find. Like that: int __(string ss){ if(f.find(ss)==f.end()){ int ans=0,pos=0; rep(ki,1,cnt){ mst(dp,0); for(int i=1;i<=ss.length();i++){ for(int j=1;j<=s[ki].length();j++){ if(ss[i-1]==s[ki][j-1])dp[i][j]=dp[i-1][j-1]+1; else dp[i][j]=max(dp[i-1][j],dp[i][j-1]); } } if(dp[ss.length()][s[ki].length()]>ans)ans=dp[ss.length()][s[ki].length()],pos=ki; } return pos; } return f[ss]; } Then I got AC from wa2 Edited by author 08.10.2021 04:46 |
| why runtime error | Kolodkin Konstantin | 1876. Утро сороконожки | 7 окт 2021 18:55 | 1 |
using System; namespace _1876_Csharp { class Program { static void Main(string[] args) { int a= Convert.ToInt32(Console.ReadLine()), b = Convert.ToInt32(Console.ReadLine()); int c = Math.Max(2 * a + 39, 2 * b + 40); Console.WriteLine(c); } } } |
| WA2 | andreyDagger`~ | 1922. Команда супергероев | 7 окт 2021 18:48 | 1 |
WA2 andreyDagger`~ 7 окт 2021 18:48 There are two variants: 1) You forgot to sort the array 2) You forgot that after sorting the array, indexes are messing up |
| If you get WA10 | Ulugbek#& | 1027. Снова D++ | 5 окт 2021 14:34 | 2 |
I've got several times WA 10 and in the forum I couldn't find any test for this test, and finally I found where was the mistake. Try this: (* WTF?!! * ) answer is yes No! It's wrong. The asnwer is NO because the comment isn't closed. The comment should end by '*)', not '*\n)' |
| WA13 | cust2112 | 1732. Министерство правды | 3 окт 2021 02:54 | 1 |
WA13 cust2112 3 окт 2021 02:54 Edited by author 04.10.2021 02:11 |
| Help, to understanding | coder | 1886. Перелёт 2 | 2 окт 2021 20:50 | 1 |
Let a bit change first test 4 5 1 4 10 10 90 20 1 2 5 5 50 10 --> 5 changed to 10 2 4 15 10 50 5 2 3 1 14 10 1 3 4 15 1 50 1 Is 2-->4 flying guaranteed arrive to Las Vegas? Answer -> ? |
| WA18 | tepamid | 1275. Knights of the Round Table | 1 окт 2021 07:13 | 2 |
WA18 tepamid 18 мар 2021 19:02 Try this if you have WA18: 10 7 3 0 5 9 2 3 7 3 1 4 4 Re: WA18 Nedyalko Borisov 1 окт 2021 07:13 The answer is: 12 1 8 + 1 8 + 4 1 + 9 6 + 2 9 - 2 9 - 3 10 - 6 3 - 6 3 - 6 3 - 6 3 - 6 3 - |
| Interesting notice about ML | TheCrawfish | 1220. Stacks | 29 сен 2021 18:54 | 2 |
Earlier this problem has got a strict result about a lot of realizations - about two years ago I have a submit which got a MLE 10 (7603331), but now this code on same compiler (VS C++ 2017) have only 252 KB! But on G++ - MLE 1. Similarly - my older AC code now have less memory. How it works? Why it has got such difference in memory after two years and between compilers? Changing virtual machine get this strange result? I think there is a bug with measuring memory used |
| IF WA 7 | zwqzwq | 2132. Разбиение графа. Версия 2 | 27 сен 2021 06:38 | 1 |
This text helped me:) 1 2 1 4 1 3 2 4 2 3 3 4 3 5 5 6 5 8 8 7 7 6 6 8 |
| To admins: "Memory Used" is broken? | Zergatul | | 27 сен 2021 02:15 | 1 |
Check my submission #9470674 for problem 1306. It says 184 KB memory used. I am allocating vector of 125000 int32 values, at least it should be 500 KB. Very few solutions go in range 500-600KB, and I don't see anyone under 500 for C/C++/Pascal. Something is wrong. Edited by author 27.09.2021 02:20 |
| Why is WA14? | Kostyareh | 1863. Мирный атом | 25 сен 2021 21:46 | 1 |
Edited by author 29.09.2021 19:50 |
| SPOILER. Hint | andreyDagger`~ | 2065. Различные суммы | 25 сен 2021 20:31 | 1 |
Fill n - k + 1 elements with zeros |