結果
問題 | No.312 置換処理 |
ユーザー |
![]() |
提出日時 | 2018-06-07 15:04:18 |
言語 | Swift (6.0.3) |
結果 |
AC
|
実行時間 | 21 ms / 2,000 ms |
コード長 | 303 bytes |
コンパイル時間 | 12,365 ms |
コンパイル使用メモリ | 123,272 KB |
実行使用メモリ | 9,344 KB |
最終ジャッジ日時 | 2024-11-15 12:21:06 |
合計ジャッジ時間 | 13,235 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
ソースコード
let num = Int64(readLine()!)!var ans: Int64?for i in 3...num {if i * i > num {break}if num % i == 0 {ans = ibreak}}if let _ = ans {} else {if num % 2 == 0 && num != 4 {ans = num / 2} else {ans = num}}print(ans!)