CSU 1507 超大型LED顯示屏(數學)

2021-06-27 11:49:27 字數 1424 閱讀 4189

輸入包含不超過100組資料。每組資料第一行為"start hh:mm:ss",表示比賽開始時刻為hh:mm:ss。最後一行為"end hh:mm:ss",即比賽結束時刻。二者之間至少會有乙個score資訊,格式為"score hh:mm:ss team score",其中team要麼是"home"(主場)要麼是"guest"(客場), score表示得分,為1,2或者3。這些資訊保證按照時間從早到晚的順序排列,且任意兩條score資訊的時刻均不相同。比賽開始時間不會早於9:00,結束時間不會晚於同一天的21:00。注意,如果比賽開始時間為09:00:00,結束時間為09:00:01,比賽長度為1秒鐘,而不是2秒鐘。

對於每組資料,輸出測試點編號和總耗電量。

start 09:00:00

score 09:01:05 home 2

score 09:10:07 guest 3

end 09:15:00

start 09:00:00

score 10:00:00 home 1

score 11:00:00 home 1

score 12:00:00 home 1

score 13:00:00 home 1

score 14:00:00 home 1

score 15:00:00 home 1

score 16:00:00 home 1

score 17:00:00 home 1

score 18:00:00 home 1

score 19:00:00 home 1

score 20:00:00 home 1

end 21:00:00

case 1: 9672

case 2: 478800

湖南省第十屆大學生計算機程式設計競賽

**如下:

#include#includeint ti[1000];

int find(int a)//多少燈管

int get(int a)

return sum;

}int main()

scanf("%s %d",s,&sc);

time=a*3600+b*60+c;

ans+=(get(f[1])+get(f[0]))*(time-pre);

pre=time;

if(strcmp(s,"home")==0)

f[0]+=sc;

else

f[1]+=sc;

}ans+=(get(f[1])+get(f[0]))*(end_time-pre);

printf("case %d: ",cas++);

printf("%d\n",ans);

}return 0;

}

CSU 1507 超大型LED顯示屏

description input 輸入包含不超過100組資料。每組資料第一行為 start hh mm ss 表示比賽開始時刻為hh mm ss。最後一行為 end hh mm ss 即比賽結束時刻。二者之間至少會有乙個score資訊,格式為 score hh mm ss team score 其...

CSU 1507 超大型LED顯示屏

time limit 1 sec memory limit 128 mb submitted 625 solved 331 輸入包含不超過100組資料。每組資料第一行為 start hh mm ss 表示比賽開始時刻為hh mm ss。最後一行為 end hh mm ss 即比賽結束時刻。二者之間至...

CSU1507 超大型LED顯示屏 模擬題

csu1507 超大型led顯示屏 模擬題 輸入包含不超過100組資料。每組資料第一行為 start hh mm ss 表示比賽開始時刻為hh mm ss。最後一行為 end hh mm ss 即比賽結束時刻。二者之間至少會有乙個score資訊,格式為 score hh mm ss team sco...