AlgorithmOJ
Problem
Local Problems
All Problems
Problem Category
Status
Contest
Standard Contests
Replay Contests
Virtual Contests
Ranklist
More...
News
About
F.A.Q
Recent Contests
Coming Soon...
Login
Register
2026-11-22 23:16:07
无题III
Time Limit:
5000ms
Memory Limit:
100000KB
This problem will be judged on
HDU
. Original ID:
2237
64-bit integer IO format:
%I64d
Java class name:
Main
Prev
Submit
Status
Statistics
Next
Font Size:
Description
一天机器人小B在玩一个电脑游戏,在游戏中他有4把枪,枪中有若干的子弹(子弹有很多种)并按一定的顺序排列,每次他可以选择一把枪进行射击,子弹将打向一个魔力靶子并留在靶子上,当两个一样的子弹留在靶子上时这两个子弹就会同时消失,但是靶子上留有5颗子弹的时候游戏就将结束,请问小B最多能消除几颗子弹。
Input
先输入一个数字T表示有T组数据
对于每组数据输入4行数据,每行的第一个数字n(0<=n<=40)表示这把枪有n个子弹,接下来有n个整数表示子弹的样式。
Output
对于每组数据输出一个整数表示消除的子弹数。
Sample Input
1 1 1 1 2 1 3 1 1
Sample Output
2
Source
HDOJ 2008 Summer Exercise(2)- Hold by Captain Xu
Language:
C++
C++11
C++14
C
Java
Pascal
Python2
Python3
C#
Fortran
Perl
Ruby
Ada
SML
Visual C++
Visual C
CLang
CLang++
Theme:
Monokai
Solarized Light
Material
Share Code?
Yes
No
×
Login
Username:
Password:
Cookie:
Never
One Day
One Week
One Month
One Year
×
Register
Username:
Password:
Repeat Password:
Nickname:
School:
Email:
×
News Title
by