#include <stdio.h> int main() { int test, bn, ch, cm, ah, am, dur, i, cur_time, arr_time, min_time, spend, kase=1; scanf("%d",&test); while (test--) { min_time = 1000000; scanf("%d %d:%d",&bn,&ch,&cm); cur_time = ch*60 + cm; for (i=0 ; i<bn ; i++) { scanf("%d:%d %d",&ah,&am,&dur); arr_time = ah*60 + am; if (arr_time<cur_time) spend = 1440 - cur_time + arr_time + dur; else spend = arr_time - cur_time + dur; if (min_time>spend) min_time = spend; } printf("Case %d: %d\n",kase++,min_time); } return 0; }
Thursday, November 10, 2011
[UVa] 11958 - Coming Home
Subscribe to:
Post Comments (Atom)
Connect Rapoo MT750S with Linux (Tested on Manjaro)
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
I like coding a lot, keeps me glued to the PC for hours. For that reason it's a need to edit the Syntax Highlighter to suit my eyes for...
-
I bought this obvious copy of MX Master 2S in hopes of having the device switching functionality along with a lightweight body because I ha...
-
Install MinGW GCC Port on Windows. 1. Just go to this address [ http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/ ]...
No comments:
Post a Comment
Post your comment here. If you want to say something about programming problems, scripts, software etc, please try to be as descriptive as possible.