|
|
Common BoardTry 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 Test 47 is some number from 1e14 to 1e18 with correct answer "No". 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 you forgot about something It is something wrong. Can somebody help me? I have completed this problem. Test #7 is single '('. Thank you VERYYYYYY MUUUCH! I solved this problem because of yoy =) :-) :=) thanks a lot. After this test I got accepted My program passed this test '('. And also my program passed all the testes I've found here... but result is still WA7. I don't know why. Can someone help me? I've got an AC! Probably, my mystake was in wrong work with carrage return symbols.. Thankkkkkkkkkkkkkkkkkk a llotttttttt Exactly! Thank you very much. For all other users experiencing test#7 WA: Test your program exactly with this data: (<EOF> Got AC now thanks for test :) Probably, test 7 is 'a(' Add some letter before '(' 5 7 3 4 1 2 2 1 2 4 3 1 3 5 5 5 5 4 Answer: 0 |
|
|