結果

問題 No.1585 Cubic Number
ユーザー 👑 箱
提出日時 2021-07-08 23:32:15
言語 Kotlin
(1.9.10)
結果
AC  
実行時間 287 ms / 1,000 ms
コード長 725 bytes
コンパイル時間 14,657 ms
コンパイル使用メモリ 422,732 KB
実行使用メモリ 50,716 KB
最終ジャッジ日時 2023-09-14 06:12:13
合計ジャッジ時間 23,698 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 273 ms
50,460 KB
testcase_01 AC 274 ms
50,260 KB
testcase_02 AC 277 ms
50,716 KB
testcase_03 AC 276 ms
50,228 KB
testcase_04 AC 274 ms
50,492 KB
testcase_05 AC 275 ms
50,260 KB
testcase_06 AC 276 ms
50,328 KB
testcase_07 AC 287 ms
50,592 KB
testcase_08 AC 271 ms
50,508 KB
testcase_09 AC 276 ms
50,316 KB
testcase_10 AC 280 ms
50,528 KB
testcase_11 AC 274 ms
50,444 KB
testcase_12 AC 272 ms
50,240 KB
testcase_13 AC 283 ms
50,452 KB
testcase_14 AC 280 ms
50,336 KB
testcase_15 AC 283 ms
50,232 KB
testcase_16 AC 279 ms
50,312 KB
testcase_17 AC 276 ms
50,512 KB
testcase_18 AC 275 ms
50,516 KB
testcase_19 AC 279 ms
50,300 KB
testcase_20 AC 276 ms
50,380 KB
testcase_21 AC 274 ms
50,228 KB
testcase_22 AC 281 ms
50,288 KB
testcase_23 AC 276 ms
50,348 KB
testcase_24 AC 275 ms
50,472 KB
testcase_25 AC 274 ms
50,360 KB
testcase_26 AC 280 ms
50,252 KB
testcase_27 AC 280 ms
50,656 KB
testcase_28 AC 272 ms
50,368 KB
testcase_29 AC 281 ms
50,600 KB
testcase_30 AC 282 ms
50,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter
import java.util.*
import kotlin.math.*

fun PrintWriter.solve() {
    val n = nextLong()
    for (m in 1..1000000L) {
        if (m * m * m == n) {
            println("Yes")
            return
        }
    }
    println("No")
}

fun main() {
    val writer = PrintWriter(System.out, false)
    writer.solve()
    writer.flush()
}

// region Scanner
private var st = StringTokenizer("")
private val br = System.`in`.bufferedReader()

fun next(): String {
    while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())
    return st.nextToken()
}

fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextLine() = br.readLine()
fun nextDouble() = next().toDouble()
// endregion
0