Back to Category
d235: [12.05] A - Perfect Pitchers
Keyword:

Difficulity: N/A | Test Data Sets: 1 (Hidden) | Judging: Traditional Judge
Accepted : 8 Times | Submit :30 Times | Clicks : 470
Accepted : 3 Users | Submit : 3 Users | Accepted rate : 100%
Time Limit :1000 ms | Memory Limit : 64000 KBytes
Update : 2012-10-25 11:15

Content:

As shown in the following table, on April 21, 2012, Philip Humber became
the 21-st perfect-game pitchers in the history the Major League Baseball.
 
-------------------------------------------------------------------------
American League                          National League
-------------------------------------------------------------------------
1880 6/12 Lee Richmond
                                                              (Cleveland 0:1 Worcester)
6/17 John Ward
                                                              (Buffalo 0:5 Providence)
 5/ 5 Cy Young (PHI 0:3 BOS) 1904
      10/ 2 Addie Joss (CHI 0:1 CLE) 1908
4/30 Charlie Robertson (CHI 2:0 DET) 1922
10/ 8 Don Larsen*(Brooklyn 0:2 NYY) 1956
1964 6/21 Jim Bunning (PHI 6:0 NYM)
1965 9/ 9 Sandy Koufax (CHI 0:1 LA)
5/ 8 Catfish Hunter (MIN 0:4 OAK) 1968
5/15 Len Barker (TOR 0:3 CLE) 1981
9/30 Mike Witt (CAL 1:0 TEX) 1984
1988 9/16 Tom Browning (LA 0:1 CIN)
1991 7/28 Dennis Martinez (MON 2:0 LA)
       7/28 Kenny Rogers (CAL 0:4 TEX)1994
5/17 David Wells (MIN 0:4 NYY) 1998
7/18 David Cone (MON 0:6 NYY) 1999
2004 5/18 Randy Johnson (ARI 2:0 ATL)
7/23 Mark Buehrle (TB 0:5 CHI)   2009
5/ 9 Dallas Braden (TB 0:4 OAK)  2010 5/29 Roy Halladay (PHI 1:0 FLA)
        4/21 Philip Humber (CHI 4:0 SEA)2012 
 

A baseball fan is obsessed with the last names of these 21 perfect-game
pitchers. He devised a computer program to detect the number of times the
following 21 last names occur

Richmond, Ward, Young, Joss, Robertson, Larsen, Bunning, Koufax,
Hunter, Barker, Witt, Browning, Martinez, Rogers,Wells, Cone, John-
son, Buehrle, Braden, Halladay, Humber.
Given an N-character string S, the required output is the overall number
of occurrences of these twenty-one names, ignoring the cases. 
 

 Technical Speci cation

 1  ≤ N  ≤ 10000000

Input:

In the first line of the input fi le there is an integer C, indicating the number
of distinct test cases to be followed. Each of the next C lines stands for a
test cases. For each test case, there is an integer N, followed by a string of
N characters.

Output:

Output should be T lines of integers. The integers in j-th line represents the
overall number of occurrences of those 21 names, ignoring the cases.

Sample Input:help

若題目沒有特別說明,則應該以多測資的方式讀取,若不知如何讀取請參考 a001 的範例程式。
2
45 Philip Humber threw the 96th and final pitch.
53 Sandy caught a young catfish in her holiday vacation.

Sample Output :

1
1

Hint :

click here to download the problem solving hint

Author :


  Solve it!   Status Forum

C
C++
JAVA
PASCAL
46187. whitedog
(60ms, 1934KB, 1624B)

Program running time may be affected by various factors. Check server system environment information here