hdu 5774 Where Amazing Happens(2016 Multi-University Training Contest 4——打表)

來源:互聯網
上載者:User

標籤:

題目連結:http://acm.hdu.edu.cn/showproblem.php?pid=5774

Where Amazing Happens Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 443    Accepted Submission(s): 300


Problem DescriptionAs the premier men‘s professional basketball league in the world, the National Basketball Association (NBA) has witnessed many superstars, legendary teams and precious friendships. 



Here is a list of every season’s champion from the league‘s inception in 1946 to 2015.

Season Champion
2015-16 Cleveland Cavaliers
2014-15 Golden State Warriors
2013-14 San Antonio Spurs
2012-13 Miami Heat
2011-12 Miami Heat
2010-11 Dallas Mavericks
2009-10 L.A. Lakers
2008-09 L.A. Lakers
2007-08 Boston Celtics
2006-07 San Antonio Spurs
2005-06 Miami Heat
2004-05 San Antonio Spurs
2003-04 Detroit Pistons
2002-03 San Antonio Spurs
2001-02 L.A. Lakers
2000-01 L.A. Lakers
1999-00 L.A. Lakers
1998-99 San Antonio Spurs
1997-98 Chicago Bulls
1996-97 Chicago Bulls
1995-96 Chicago Bulls
1994-95 Houston Rockets
1993-94 Houston Rockets
1992-93 Chicago Bulls
1991-92 Chicago Bulls
1990-91 Chicago Bulls
1989-90 Detroit Pistons
1988-89 Detroit Pistons
1987-88 L.A. Lakers
1986-87 L.A. Lakers
1985-86 Boston Celtics
1984-85 L.A. Lakers
1983-84 Boston Celtics
1982-83 Philadelphia 76ers
1981-82 L.A. Lakers
1980-81 Boston Celtics
1979-80 L.A. Lakers
1978-79 Seattle Sonics
1977-78 Washington Bullets
1976-77 Portland Trail Blazers
1975-76 Boston Celtics
1974-75 Golden State Warriors
1973-74 Boston Celtics
1972-73 New York Knicks
1971-72 L.A. Lakers
1970-71 Milwaukee Bucks
1969-70 New York Knicks
1968-69 Boston Celtics
1967-68 Boston Celtics
1966-67 Philadelphia 76ers
1965-66 Boston Celtics
1964-65 Boston Celtics
1963-64 Boston Celtics
1962-63 Boston Celtics
1961-62 Boston Celtics
1960-61 Boston Celtics
1959-60 Boston Celtics
1958-59 Boston Celtics
1957-58 St. Louis Hawks
1956-57 Boston Celtics
1955-56 Philadelphia Warriors
1954-55 Syracuse Nats
1953-54 Minneapolis Lakers
1952-53 Minneapolis Lakers
1951-52 Minneapolis Lakers
1950-51 Rochester Royals
1949-50 Minneapolis Lakers
1948-49 Minneapolis Lakers
1947-48 Baltimore Bullets
1946-47 Philadelphia Warriors

(quoted from http://www.nba.com/history/nba-season-recaps/)

Given the team name, it won’t be difficult for you to count how many times this team(with exactly the same name) has made amazing happen.
 
InputThe first line gives the number of test cases. Each case contains one string S representing the team to be queried.
T<=30.S consists of English letters, digits, punctuations and spaces. And 1<=length(S)<=30.
 
OutputFor each test case, output one line containing "Case #x: y", where x is the test case number (starting from 1) and y is the times this team has won the championship according to the list above.
 
Sample Input
2Cleveland CavaliersOklahoma City Thunder
 
Sample Output
Case #1: 1Case #2: 0
 
AuthorFZU 
Source2016 Multi-University Training Contest 4 題目大意:判斷題目中所給字串出現的次數。

解題思路:寫段代碼處理一下題面,接下去就是暴力~~~~


詳見代碼。

#include<iostream>#include<cmath>#include<cstdio>#include<algorithm>#include<vector>#include<cstring>#include<map>const  double INF=0x3fffffff;const  double eps=1e-10;const double PI=acos(-1.0);using namespace std;int hah[1000]= {1,2,5,3,1,11,17,3,6,2,2,1,1,1,2,1,1,2,1,5,1,1};char s[30][1000]= {{"Cleveland Cavaliers"}    ,{"Golden State Warriors"}    ,{"San Antonio Spurs"}    ,{"Miami Heat"}    ,{"Dallas Mavericks"}    ,{"L.A. Lakers"}    ,{"Boston Celtics"}    ,{"Detroit Pistons"}    ,{"Chicago Bulls"}    ,{"Houston Rockets"}    ,{"Philadelphia 76ers"}    ,{"Seattle Sonics"}    ,{"Washington Bullets"}    ,{"Portland Trail Blazers"}    ,{"New York Knicks"}    ,{"Milwaukee Bucks"}    ,{"St. Louis Hawks"}    ,{"Philadelphia Warriors"}    ,{"Syracuse Nats"}    ,{"Minneapolis Lakers"}    ,{"Rochester Royals"}    ,{"Baltimore Bullets"}};int main(){    int t;    int tt=1;    scanf("%d",&t);    getchar();    while(t--)    {        char ch[1000];        gets(ch);        bool flag=false ;        printf("Case #%d: ",tt++);        for(int i=0; i<22; i++)        {            if(strcmp(ch,s[i])==0)            {                flag=true ;                printf("%d\n",hah[i]);                break;            }        }        if(!flag) printf("0\n");    }    return 0;}


hdu 5774 Where Amazing Happens(2016 Multi-University Training Contest 4——打表)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.