結果
| 問題 |
No.648 お や す み
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-30 08:21:54 |
| 言語 | Kotlin (2.1.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 250 bytes |
| コンパイル時間 | 10,434 ms |
| コンパイル使用メモリ | 429,056 KB |
| 実行使用メモリ | 54,420 KB |
| 最終ジャッジ日時 | 2024-11-20 15:15:06 |
| 合計ジャッジ時間 | 37,382 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 69 WA * 15 |
コンパイルメッセージ
Main.kt:5:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
^
ソースコード
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")
}