結果

問題 No.652 E869120 and TimeZone
ユーザー pekempey
提出日時 2018-02-26 23:56:16
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 700 bytes
コンパイル時間 13,965 ms
コンパイル使用メモリ 391,012 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-17 13:46:05
合計ジャッジ時間 14,920 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4 WA * 1
other AC * 18 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
  let a: i32 = input();
  let b: i32 = input();
  let s: String = input();

  let y: f64 = s[3..].parse().unwrap();
  let x = (a + 48) * 60 + b;
  let x = x + ((y * 60.0 + 1e-8) as i32) - 9 * 60;

  println!("{:02}:{:02}", x / 60 % 24, x % 60);
}

fn input<T: std::str::FromStr>() -> T {
  use std::io::Read;
  let stdin = std::io::stdin();
  let stdin = stdin.bytes();
  let token = stdin
    .skip_while(|x| x.as_ref().unwrap().is_ascii_whitespace())
    .take_while(|x| !x.as_ref().unwrap().is_ascii_whitespace())
    .map(|x| x.unwrap())
    .collect();
  let token = String::from_utf8(token).unwrap();
  match token.parse() {
    Ok(x) => x,
    Err(_) => panic!("{}", token),
  }
}
0