結果
| 問題 | No.499 7進数変換 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-03 09:00:07 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 484 bytes |
| コンパイル時間 | 12,368 ms |
| コンパイル使用メモリ | 383,180 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-28 17:43:18 |
| 合計ジャッジ時間 | 11,706 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
use std::io::*;
fn main() {
let mut s: String = String::new();
std::io::stdin().read_to_string(&mut s).ok();
let mut itr = s.trim().split_whitespace();
let mut n: usize = itr.next().unwrap().parse().unwrap();
if n == 0 {
println!("0");
return;
}
let mut out = Vec::new();
while n > 0 {
write!(out, "{}", n % 7).ok();
n /= 7;
}
out.reverse();
writeln!(out, "").ok();
stdout().write_all(&out).unwrap();
}