結果

問題 No.525 二度寝の季節
ユーザー mlpj56d
提出日時 2017-06-18 23:20:02
言語 JavaScript
(node v23.5.0)
結果
WA  
実行時間 -
コード長 716 bytes
コンパイル時間 38 ms
コンパイル使用メモリ 6,820 KB
実行使用メモリ 41,596 KB
最終ジャッジ日時 2024-10-13 00:09:31
合計ジャッジ時間 3,185 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
    var data = input.split(":")

    var hh  = parseInt(data[0]);
    var mm  = parseInt(data[1]);

    justDoIt(hh,mm);
}

function justDoIt (hh,mm){
   if ( mm + 5 > 59) {
      if( hh >= 0 && hh <= 8) {
          console.log( "0" + (hh + 1) + ":0" + (mm + 5) % 60 + "\n");
      } else if ( hh == 23) {
          console.log( "00:0" + (mm + 5) % 60 + "\n"); 
      } else {
          console.log( (hh + 1) + ":0" + (mm + 5) % 60 + "\n");
      }
   } else {
       if ( hh >= 0 && hh <= 9) {
           console.log("0" + hh + ":" + (mm + 5) + "\n");
       } else {
           console.log( hh + ":" + (mm + 5) + "\n");
       }
   }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0