結果

問題 No.1585 Cubic Number
ユーザー koboshikoboshi
提出日時 2021-07-08 23:32:15
言語 Kotlin
(1.6.10)
結果
AC  
実行時間 249 ms / 1,000 ms
コード長 725 bytes
コンパイル時間 10,453 ms
使用メモリ 45,064 KB
最終ジャッジ日時 2023-02-01 20:08:08
合計ジャッジ時間 19,426 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 249 ms
44,960 KB
testcase_01 AC 225 ms
44,268 KB
testcase_02 AC 218 ms
44,452 KB
testcase_03 AC 221 ms
44,408 KB
testcase_04 AC 233 ms
44,376 KB
testcase_05 AC 232 ms
44,524 KB
testcase_06 AC 235 ms
44,464 KB
testcase_07 AC 235 ms
44,412 KB
testcase_08 AC 234 ms
44,396 KB
testcase_09 AC 221 ms
44,176 KB
testcase_10 AC 232 ms
44,928 KB
testcase_11 AC 234 ms
44,960 KB
testcase_12 AC 235 ms
44,344 KB
testcase_13 AC 226 ms
44,468 KB
testcase_14 AC 221 ms
44,472 KB
testcase_15 AC 241 ms
45,008 KB
testcase_16 AC 227 ms
44,404 KB
testcase_17 AC 225 ms
44,404 KB
testcase_18 AC 222 ms
44,544 KB
testcase_19 AC 221 ms
44,452 KB
testcase_20 AC 218 ms
44,608 KB
testcase_21 AC 220 ms
44,256 KB
testcase_22 AC 219 ms
44,264 KB
testcase_23 AC 227 ms
44,344 KB
testcase_24 AC 228 ms
44,428 KB
testcase_25 AC 216 ms
44,212 KB
testcase_26 AC 230 ms
44,660 KB
testcase_27 AC 234 ms
45,064 KB
testcase_28 AC 217 ms
44,444 KB
testcase_29 AC 218 ms
44,404 KB
testcase_30 AC 228 ms
44,584 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