結果
問題 |
No.652 E869120 and TimeZone
|
ユーザー |
|
提出日時 | 2018-02-27 00:01:02 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 723 bytes |
コンパイル時間 | 14,694 ms |
コンパイル使用メモリ | 390,796 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-11 12:22:55 |
合計ジャッジ時間 | 16,121 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 30 |
ソースコード
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 + y.signum() * 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() as char).is_whitespace()) .take_while(|x| !(*x.as_ref().unwrap() as char).is_whitespace()) .map(|x| x.unwrap()) .collect(); let token = String::from_utf8(token).unwrap(); match token.parse() { Ok(x) => x, Err(_) => panic!("{}", token), } }