J - 超大型LED显示屏
2017-08-07 11:51
295 查看
#include #include #include #include #include #pragma warning(disable:4996) using namespace std; int show[10] = { 6,2,5,5,4,5,6,3,7,6 }; int get(int a) { int sum = 0; if (a == 0) return 6; while (a) { sum += show[a % 10]; a /= 10; } return sum; } int main() { int a,b,c,statime,endtime,d,time,arr[100],count=1; char s[100],st[100]; while (~scanf("%s %d:%d:%d", s,&a,&b,&c)) { memset(arr, 0, sizeof(arr)); statime = a * 3600 + b * 60 + c; int num = 0; while (1) { scanf("%s %d:%d:%d", s, &a, &b, &c); if (strcmp(s, "END") == 0) { endtime = a * 3600 + b*60 + c; break; } scanf("%s %d", st, &d); time= a * 3600 + b*60 + c; num+= (get(arr[1]) + get(arr[0]))*(time - statime); statime = time; if (strcmp(st, "home") == 0) arr[0] += d; else arr[1] += d; } num+= (get(arr[1]) + get(arr[0]))*(endtime - statime); printf("Case %d: ", count++); printf("%d\n", num); } return 0; }
相关文章推荐
- 湖南2014CPC 超大型LED显示屏
- csuoj 1507: 超大型LED显示屏
- csu 1507: 超大型LED显示屏(要重新敲一遍)
- CSU 1507 超大型LED显示屏
- 超大型LED显示屏
- CSU_1507_超大型LED显示屏
- J - 超大型LED显示屏
- 超大型LED显示屏
- 超大型 LED 显示屏
- 超大型LED显示屏(模拟)
- CSU 1507: 超大型LED显示屏(数学啊)
- CSU 1507 超大型LED显示屏 第十届湖南省赛题
- O-超大型LED显示屏
- CSU 1507 超大型LED显示屏
- 超大型LED显示屏
- CSU1507 超大型LED显示屏_模拟题
- 超大型LED显示屏
- 大型LED显示屏之色彩均匀调校
- LED显示屏二次开发接口的设计方案
- 2620 LED显示屏