Показать все ветки Спрятать все ветки Показать все сообщения Спрятать все сообщения |
Страница 2 |
To admins: there is an error in test cases | ivzh | 1280. Topological Sorting | 13 май 2020 22:45 | 1 |
Hi! Could you please check the next test case: ``` 3 2 1 2 1 3 3 1 2 ``` result should be `no`, but 4 my case i have `yes`. Despite this i had AC. Thanks in advance! Edited by author 13.05.2020 22:47 Edited by author 13.05.2020 22:47 |
AC IN 0.234 SEC | abid1729 | 1280. Topological Sorting | 25 июн 2019 19:21 | 1 |
#include<bits/stdc++.h> using namespace std; int main() { long long m,i,n,a[100005][2],k,b[1005]; cin>>n>>m; for(i=0;i<m;i++){ cin>>a[i][0]>>a[i][1]; } for(i=0;i<n;i++){ cin>>k; b[k]=i; } for(i=0;i<m;i++){ if(b[a[i][0]]>b[a[i][1]]){ cout<<"NO"; return 0; } } cout<<"YES"; } |
O(n^3) got 0.826s AC! | paulzrm | 1280. Topological Sorting | 21 июн 2018 17:34 | 1 |
I can't belive it! for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ if(can[i][j]) for(k=1;k<=n;k++) if(can[j][k]) can[i][k]=1; } } |
Weak Dataset | Saifullah Talukder | 1280. Topological Sorting | 25 июл 2017 14:16 | 1 |
I think the dataset for this problem is weak. I got AC without checking for cycles. Input: 3 3 1 3 3 2 2 1 1 3 2 Correct output: NO But my code ( http://ideone.com/ZljGZ5 ) returns YES and it got Accepted. Edited by author 25.07.2017 14:17 Edited by author 25.07.2017 14:18 |
Can anyone explain 1# test case? | Just_do_it | 1280. Topological Sorting | 8 фев 2017 13:01 | 2 |
in 1 test case we can't determine whether subject 3 should be earlier than 4 or 4 than 3, because there's isn't any edge that show which one should be sdutied ealrier, why answer is YES???? I think if we can't verify it answer should be NO Verify correctness = see if there's such a pair in the first list, that goes in reverse order on the second list. For test 2 it's pairs (3 5), (5 2), (4 2), for test 1 there's no such pairs. |
Wrong Answer on Test #16 | Shabab Karim | 1280. Topological Sorting | 14 сен 2019 01:26 | 4 |
What is Test #16? Please someone help! What is Test #16? Please someone help! Same here... got stuck in Test-16 . so why did you get the WA16? Well maybe someone gonna read this but i got WA #16 cause my logic was wrong. i thought that i need to check if i studied any of prerequisite BUT i must check if i studied ALL OF them. maybe my code would help idk #include <iostream> #include <vector> using namespace std; int N, M, a[(int)1e3 + 5], b, c; bool visited[(int)1e3 + 5], flag, ans = true; vector <vector <int> > adj((int)1e3 + 5); int main() { cin >> N >> M; while(M--) cin >> b >> c, adj[c].push_back(b); for(int i = 0; i < N;++i) { cin >> a[i]; flag = true; visited[a[i]] = true; if(adj[a[i]].empty()) continue; for(int j = 0; j < adj[a[i]].size();++j) if(!visited[adj[a[i]][j]]) flag = false; if(!flag) ans = false; } if(!ans) cout <<"NO"; else cout << "YES"; } |
Tip for resolution | GastonFontenla | 1280. Topological Sorting | 9 авг 2015 02:37 | 1 |
You don't need to calculate the topological order. If you first calculate the topological order, and then try to "verify" the study order, will complicate a simple problem. |
WA8? | Илья | 1280. Topological Sorting | 28 апр 2015 16:16 | 1 |
WA8? Илья 28 апр 2015 16:16 I dont understand why i get WA # 8 |
Why this problem has so high complexity estimation? | breezemaster | 1280. Topological Sorting | 25 дек 2013 23:59 | 2 |
It is very easy problem, i think complexity estimation 192 is overestimation. Very simple search was accepted: static bool Solve(IEnumerable<Tuple<int, int>> limitations, int[] proposedOrder) { foreach (Tuple<int, int> limitation in limitations) { int less = limitation.Item1; int greater = limitation.Item2; if (less == greater) return false; // wrong rule foreach (int currentSubj in proposedOrder) { if (currentSubj == greater) return false; // first is greater, so rule is contradicted if (currentSubj == less) break; // first is smaller, so rule is satisfied, go to next one } } return true; // all rules was satisfied } 1. Some time ago ML for it was 1MB. Try to solve within this limitation. 2. Average difficulty of a problem on Timus is ~1300, so 192 means that it is very simple problem (~15% of average difficulty), how did you get it is overestimation? |
TL on test #15 | Andy Pilate | 1280. Topological Sorting | 1 окт 2013 05:06 | 1 |
|
Why WA #8 ????? | Bristy | 1280. Topological Sorting | 30 ноя 2012 17:52 | 2 |
I have isolated the trees at first, then i ran a topsort. I dont understand why i get WA #8 It is not topological sorting task :) |
Страница 1 |
Very very bad title | ucs6 | 1280. Topological Sorting | 22 дек 2022 19:15 | 3 |
Don't be trapped by the title of this problem...it would just make it more complicated I see no problem in the title. It's a very simple straight forward TOP_SORT problem. And I have seen some critical cases in other threads which cases would appear 'critical' if and only if any process other than simple top_sort is approached. I`d say don`t be trapped by the category of the problem. It says Graph Theory, but can be easily solved with other data structures. |
If you have WA #31... | Smilodon_am [Obninsk INPE] | 1280. Topological Sorting | 20 апр 2011 17:22 | 1 |
This test perhaps contain double links between vertices... |
What about 15 test | rodge(Vologda ML) | 1280. Topological Sorting | 18 сен 2010 20:30 | 2 |
What it can be???i have TL 15 if i change code i have wa 15 it's terrible) Sorry, my problem was in array)Read conditions more attentively, not as I))) |
Too easy | Sevenk | 1280. Topological Sorting | 16 сен 2009 19:22 | 1 |
|
WA#13 ! Please pay attention... | Phan Hoài Nam - Đại học Ngoại ngữ Tin Học TP.HCM | 1280. Topological Sorting | 13 июн 2009 15:35 | 1 |
for example test : 2 2 1 2 2 1 1 2 the answer is NO, not YES |
WA #5 | Lebedev_Nicolay[Ivanovo SPU] | 1280. Topological Sorting | 10 май 2011 21:14 | 2 |
WA #5 Lebedev_Nicolay[Ivanovo SPU] 28 сен 2008 02:15 What is test #5. Please help! Re: WA #5 Denis Astanin (KPI) 10 май 2011 21:14 |
WA #5 | Lebedev_Nicolay[Ivanovo SPU] | 1280. Topological Sorting | 28 сен 2008 02:15 | 1 |
WA #5 Lebedev_Nicolay[Ivanovo SPU] 28 сен 2008 02:15 |
if you have WA15 | Alexander (201 - P TNU) | 1280. Topological Sorting | 28 янв 2008 12:10 | 1 |
Some limitations are identical, and when I used counter for entering edges to each vertex, I get WA15). Edited by author 28.01.2008 12:26 |
Really N<=1000 | Eugene Zavgorodny | 1280. Topological Sorting | 13 ноя 2012 02:17 | 3 |
I don't think, that N<=1000. Because when I submit mas[1001][1001], I get WA2. But when I submit mas[2000][2000], I get AC May be you use mas[i][j], where is i = 1001, j = 1001 or something like that My solution with mas[2000][2000] got WA 14 but with mas[3000][3000] got AC :) |