Show all threads Hide all threads Show all messages Hide all messages |
Can he eat his brothers and sisters? | Artem Fursenko [Brainstorm] | 1242. Werewolf | 28 Nov 2023 12:42 | 3 |
oh, i got AC. If anybody want to know - yes, he can! I got WA on test #5 can you tell me why? |
Test Case for WA#5 | azikar24 | 1242. Werewolf | 28 Nov 2023 12:36 | 3 |
This test case helped me. 6 1 2 2 4 4 5 5 6 BLOOD 3 5 Answer: 0 Why answer is not a 1 2 4? Edited by author 13.04.2019 11:10 I have ans = 0 but although it giving WA on test #5 can you suggest me some error or another test case |
Probable Fix for Wrong Ans on TC #5 | Ayush | 1242. Werewolf | 29 Aug 2022 21:23 | 1 |
Please remember that input can contain numbers with more than one digit. My WA was due to this, and I don't think anybody will be this silly. But still posting! :) Edited by author 29.08.2022 21:23 Edited by author 29.08.2022 21:23 |
WA test#7 | Rudo | 1242. Werewolf | 31 May 2022 02:24 | 1 |
Have no idea what's wrong I used simple plan with massive of relations and recursive function that checks all ancesters (only up moving) and all descendants (only down moving). There is some part of code in C++: int checkforblood(int index, int** mas, int* checkmas, int range, int direct) { if (checkmas[index - 1] == 1) return 0; checkmas[index-1] = 1; for (int i = 0; i < range; i++) { if (( mas[i][0] == index )&&(direct > -1)) { checkforblood(mas[i][1], mas, checkmas, range, 1); } if (( mas[i][1] == index ) && (direct < 1)) { checkforblood(mas[i][0], mas, checkmas, range, -1); } } return 0; } I can't see the problem, so if you can't too i will know, that problem in output method. Edited by author 31.05.2022 02:26 |
WA on test 5 | Kerem Puskullu | 1242. Werewolf | 25 Aug 2021 15:04 | 1 |
I tried all test cases which were written in the discussion part and my program gives the correct answer for all of them. How to find my error: #include <bits/stdc++.h> using namespace std; #define pb push_back #define endl "\n" /*DELETE IT ON INTERACTIVES!!*/ #define mod 1000000007 #define int long long #define double long double #define all(x) x.begin(), x.end() const int N = 1e3+5; vector<int> adj[N],marked(N,0),killed(N,0),vis_1(N,0),torun(N,1),vis_2(N,0); int ok; void dfs(int node){ vis_1[node] = 1; if(killed[node]) ok = 1; for(auto go : adj[node]){ if(!vis_1[go]){ dfs(go); } } } void mark(int node){ marked[node] = 1; vis_2[node] = 1; for(auto go : adj[node]){ if(!vis_2[go]){ mark(go); } } } void solve(){
int n; cin>>n; string s,t; while(cin>>s){ if(s == "BLOOD") break; cin>>t; adj[(int)s[0] - '0'].pb((int)t[0] - '0'); torun[(int)t[0] - '0'] = 0; } int a; while(cin>>a){ killed[a] = 1; } for(int i=1;i<=n;i++){ if(torun[i]){ dfs(i); if(ok){ mark(i); } fill(all(vis_1),0); fill(all(vis_2),0); ok = 0; } } int hehe = 0; for(int i=1;i<=n;i++){ if(!marked[i]){ hehe = 1; cout<<i<<' '; } } if(!hehe) cout<<0; } int32_t main(){
cin.tie(0); ios::sync_with_stdio(0); int t=1; //cin>>t;
while(t--) solve();
return 0; } |
INPUT | Berdnikov Sergey | 1242. Werewolf | 31 Jul 2020 21:16 | 2 |
INPUT Berdnikov Sergey 26 Jan 2017 04:10 To enter variables correctly is more difficult then solve this problem. I think, it isn't very good idea to issue input like this. |
WA 4 | BIGfoot | 1242. Werewolf | 26 Oct 2017 21:38 | 1 |
WA 4 BIGfoot 26 Oct 2017 21:38 I got WA on test 4, but on all tests I could make myself and also on those, which were in the problem, my program answered correctly. Please, suggest some tests, that could help. |
runtime error test 5 | Nico | 1242. Werewolf | 11 Nov 2015 09:53 | 2 |
I need you help. What could be the #5 test like? I lengthen my array so as to avoid the RE... |
If you have WA 5 | Andrew Hoffmann aka SKYDOS [Vladimir SU] | 1242. Werewolf | 27 Aug 2015 21:19 | 4 |
this test can help you: 9 4 1 2 4 3 4 6 4 5 4 7 5 8 5 9 7 BLOOD 5 answer is: 2 3 6 Good luck! My answer to this test is right,but i also get wa! why? Edited by author 18.10.2012 18:48 My answer is right but WA 5 ... I got runtime error at test 5. |
WA 5 | Ivan | 1242. Werewolf | 14 Jul 2015 21:46 | 1 |
WA 5 Ivan 14 Jul 2015 21:46 Can anybody send me the fifth test of this problem? My program always crushes on it. I think it's something wrong when input my data int size; struct point{ int number; bool pr; }; vector<point> matrix[1000]; int main(){ int name1, name2; point c; char hg='0'; vector<int> victims; cin >> size; while (hg != 'B'){ cin >> hg; if (hg != 'B'){ cin >> name2; name1 = atoi(&hg); c.pr = true; c.number = name2 - 1; matrix[name1 - 1].push_back(c); c.pr = false; c.number = name1 - 1; matrix[name2 - 1].push_back(c); } } for (int i = 0; i < 4; i++) cin >> hg; while (std::cin >> name1) victims.push_back(name1 - 1); |
How can i read input in C++ (my code doesn't work) | papaga3 | 1242. Werewolf | 8 Oct 2014 23:35 | 2 |
int victim; while (scanf("%d", &victim) != EOF) { /*do something*/ } it is an infinite loop scanf returns: number of the read charecter in finish scanf return 0 but EOF value is -1 |
be careful... | Razor | 1242. Werewolf | 10 May 2014 20:25 | 1 |
WereWolf can eat his sister or brother. But He cannot eat his father and mother, also grandfather ... so on....grandmother... |
a hint and a question | math404_3140 | 1242. Werewolf | 1 Feb 2012 07:46 | 2 |
I think this problem can be solved easily by using DFS algo. But there's sth I wantwd to ask. if our program is reading from the standard input, Can we use eof(f) in paskal? what should we do then? is it OK to use ASSIGN procedure for a file which has been made beore? I think it takes CRASH(ACCES VIOLATION) error. Is there anyone who can help me on the spot?!! I had the same problem, because I read char and if it was 'B', I go to next stage. It was always OK except this case: 100 BLOOD 1 2 I didn't eat the newline after 100, however I always did after numbers that went after it. Anyway - this is why test 4 is special. Hope that helps :-D |
Please! Give me some tests! | Tasman | 1242. Werewolf | 9 Nov 2008 17:01 | 5 |
I write a programm, but got WA. I think my program is right, but I can't check it! Please if you can, give me some tests. Thank you Try this 24 6 4 21 3 7 4 16 19 8 4 3 2 22 3 23 3 4 2 13 12 13 11 5 1 2 1 5 10 2 9 11 5 24 3 12 5 9 17 14 15 9 14 1 18 19 20 14 16 B L O OD 3 8 And the answer 5 6 7 10 11 12 13 Good luck Did you read this: "Posted by Tasman March 26, 2003 09:32"? Well, it can be useful for others ;-) Edited by author 12.12.2007 01:35 Edited by author 09.11.2008 17:03 Edited by author 09.11.2008 17:03 |
nonseen work going! | svr | 1242. Werewolf | 31 May 2008 03:47 | 3 |
What was made with simple 1242! During a long time i had Wa2 but with the same code have AC now! It should be said about mistakes in tests for 1242 and their correcting. Sorry. We have fixed a bug in 2'nd test several days ago and haven't rejudged all wrong verdicts yet. Now they are rejudged. Your old submissions are AC. Does it mean that you rejudged test like ' 'number' 'number to number' 'number? |
To admins | Брэнд | 1242. Werewolf | 4 Mar 2008 00:19 | 2 |
There is a space in the end of second line of second test. Probably in testing system this space is lacking. Please, correct the test in task. |
Sample input | devilkind | 1242. Werewolf | 10 Jun 2007 21:09 | 2 |
From the input description I understood that the first number is the child and the second number is the father, but in the first sample child number 4 has 2 parents, 5 and 6. "The data is correct - for each of the residents there are no more than two parents, and there are no cycles." father and mother |
1242("OBOROTEN") Very interesting trichy test2 | svr | 1242. Werewolf | 9 Feb 2007 10:55 | 2 |
For test2 my program think that number of victims=0,or oboroten has no his actions What answer must be in this case 1) 1 2 ... N because have no information to conclusions; 2) 0 3) All people who have N-1 strict relations, But also wa2 |
Help! Got Weird Things Happening | DarkeN | 1242. Werewolf | 19 Nov 2006 12:48 | 1 |
This is plain crazy! My program uses STL vectors and recursive function calls and it sure adds an extra overhead to the overall memory, but... 18 MB? That's a novelty! Of course I get MLE. If someone experienced something like it before please let me know! P.S. On my PC it shows 1MB of allocated memory for N=1000. Strange,huh? |
Problem 1242 "Werewolf" has been rejudged (+) | Sandro (USU) | 1242. Werewolf | 16 Nov 2006 11:58 | 1 |
Extra spaces were removed from the input. 26 authors got AC. Now you can use Pascal function val() for reading input data. |