|
|
Common Boardsuper incomprehensible, in general the tests are about some kind of accuracy, you need to make 100 parcels and try different epsilons everywhere to pass these tests, it pissed me off hypercircle does not interfere with the thread Yeah, but i hate bfs on grid dont forgot about solo points Try this one 0 0 1 1 1 0 2 -1 Ans: 0 Try: 101 203 1000 Or: 1 3 1000 I think this test should break some AC solutions: 443 -39 457 33 386 -773 561 127 Correct answer is -1, but I think some AC solutions can print 0 read the tags before you decide, and think a few times before you start wa5 - check how you calculate time when change direction at the station Test: 12 1 2 45 64 31 23 128 61 2 2 7 8 7 3 5 ans: 805 Test: 4 7 6 3 3 12 3 4 ans : 60 Good luck! Here's my wrong solution, can sb view the code and help me? #include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> pos; vector<vector<int>> in; vector<vector<int>> out; vector<int> ans; void lets_go(int i) { for (int j = 0; j < in[i].size(); j++) { if (pos[in[i][j]] == 0) { lets_go(in[i][j]); } } pos[i] = 1; ans.push_back(i); for (int j = 0; j < out[i].size(); j++) { if (pos[out[i][j]] == 0) { lets_go(out[i][j]); } } } int main() { int n; cin >> n; in.resize(n); out.resize(n); pos.resize(n, 0); for (int i = 0; i < n; i++) { int a; cin >> a; while (a != 0) { if (a != 0) { in[a - 1].push_back(i); out[i].push_back(a - 1); cin >> a; } } } for (int i = 0; i < n; i++) { if (pos[i] == 0) { lets_go(i); } } for (int i = 0; i < n; i++) { cout << ans[i] + 1 << " "; } } Try this test: 1 1 2 0 1 -1 0 1 Answer: 1 1 2 0 error in path recovery at a fixed level for 2 = 2 3 = 12 4 = 104 can u give some tests? Edited by author 21.10.2012 12:05 011 ans: 11 maybe forgot some reverse |
|
|