TheBoringGameDivTwo
SRM 488 · 2010-03-12 · by Vasyl[alphacom]
Problem Statement
You are given six integers. scoreJ, scoreB and scoreF are scores of John, Brus and the friend, respectively. killedJ, killedB and killedF are the number of times John, Brus and the friend were shot, respectively. Return the
Constraints
- scoreJ will be between -47 and 47, inclusive.
- scoreB will be between -47 and 47, inclusive.
- scoreF will be between -47 and 47, inclusive.
- killedJ will be between 0 and 47, inclusive.
- killedB will be between 0 and 47, inclusive.
- killedF will be between 0 and 47, inclusive.
Statement by TopCoder, Inc. — view the original on the archive.
1
1
1
1
2
2
Returns: {2, 3 }
The possible scenario with two rounds is: friend kills John, Brus kills friend, round ends, friend kills Brus, John kills friend, round ends. And with three rounds - John kills friend, round ends, Brus kills friend, round ends, friend kills John, friend kills Brus, round ends.
0
0
0
0
0
0
Returns: {0, 0 }
No rounds here.
4
7
-2
5
1
9
Returns: { }
This is impossible.
1
5
-1
4
3
6
Returns: {8, 9 }
-2
5
-10
0
8
1
Returns: { }
Submissions are judged against all 64 archived test cases, of which 5 are shown here. Case numbers match the judge’s.
Language: C++17 · define a public class TheBoringGameDivTwo with a public method vector<int> find(int scoreJ, int killedJ, int scoreB, int killedB, int scoreF, int killedF) · 64 test cases · 2 s / 256 MB per case