結果
| 問題 | No.648 お や す み |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-30 08:21:54 |
| 言語 | Kotlin (2.3.20) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 250 bytes |
| 記録 | |
| コンパイル時間 | 7,509 ms |
| コンパイル使用メモリ | 431,236 KB |
| 実行使用メモリ | 51,228 KB |
| 最終ジャッジ日時 | 2026-05-14 17:57:41 |
| 合計ジャッジ時間 | 24,159 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 69 WA * 15 |
ソースコード
package net.ipipip0129.kotlin.yukicoder
import kotlin.math.sqrt
fun main(args: Array<String>) {
val n = readLine()!!.toLong()
val m = sqrt((n*2).toDouble()).toInt()
println(if ((m*(m+1)/2).toLong() == n) "YES\n" + m else "NO")
}