結果
| 問題 |
No.442 和と積
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-05 15:35:43 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 302 bytes |
| コンパイル時間 | 12,149 ms |
| コンパイル使用メモリ | 378,096 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-08-05 15:35:57 |
| 合計ジャッジ時間 | 13,474 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
コンパイルメッセージ
warning: unused imports: `HashMap`, `HashSet`
--> src/main.rs:1:24
|
1 | use std::collections::{HashMap, HashSet};
| ^^^^^^^ ^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
ソースコード
use std::collections::{HashMap, HashSet};
fn main() {
proconio::input! {
a: u128,
b: u128,
}
let add = a + b;
let mul = a * b;
println!("{}", gcd(add, mul));
}
fn gcd(a: u128, b: u128) -> u128 {
if b == 0 {
a
} else {
gcd(b, a % b)
}
}