結果

問題 No.2185 平方数の下6桁
ユーザー 👑 箱
提出日時 2023-01-13 21:24:52
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 885 ms / 2,000 ms
コード長 971 bytes
コンパイル時間 14,567 ms
コンパイル使用メモリ 415,908 KB
実行使用メモリ 59,756 KB
最終ジャッジ日時 2023-08-26 02:55:49
合計ジャッジ時間 38,303 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 288 ms
53,236 KB
testcase_01 AC 393 ms
56,348 KB
testcase_02 AC 885 ms
56,124 KB
testcase_03 AC 378 ms
58,112 KB
testcase_04 AC 858 ms
58,044 KB
testcase_05 AC 859 ms
56,024 KB
testcase_06 AC 853 ms
58,240 KB
testcase_07 AC 380 ms
58,252 KB
testcase_08 AC 859 ms
56,092 KB
testcase_09 AC 384 ms
57,968 KB
testcase_10 AC 855 ms
58,244 KB
testcase_11 AC 301 ms
55,056 KB
testcase_12 AC 866 ms
58,036 KB
testcase_13 AC 383 ms
57,988 KB
testcase_14 AC 869 ms
58,128 KB
testcase_15 AC 333 ms
56,052 KB
testcase_16 AC 326 ms
55,168 KB
testcase_17 AC 290 ms
53,608 KB
testcase_18 AC 868 ms
57,972 KB
testcase_19 AC 329 ms
53,120 KB
testcase_20 AC 860 ms
56,352 KB
testcase_21 AC 859 ms
56,452 KB
testcase_22 AC 392 ms
58,044 KB
testcase_23 AC 858 ms
58,172 KB
testcase_24 AC 376 ms
56,360 KB
testcase_25 AC 856 ms
56,208 KB
testcase_26 AC 857 ms
58,252 KB
testcase_27 AC 386 ms
56,072 KB
testcase_28 AC 390 ms
58,008 KB
testcase_29 AC 389 ms
57,928 KB
testcase_30 AC 869 ms
59,756 KB
testcase_31 AC 856 ms
56,104 KB
testcase_32 AC 381 ms
56,348 KB
testcase_33 AC 335 ms
57,944 KB
testcase_34 AC 859 ms
56,324 KB
testcase_35 AC 854 ms
58,232 KB
testcase_36 AC 374 ms
58,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

fun PrintWriter.solve() {
    val s = nextLine()
    for (n in 1000L..10000000L) {
        val t = (n * n).toString()
        if (t.endsWith(s)) {
            println("YES")
            return
        }
    }
    println("NO")
}

fun main() {
    Thread(null, {
        val writer = PrintWriter(System.out, false)
        writer.solve()
        writer.flush()
    }, "solve", abs(1L.shl(26)))
        .apply { setUncaughtExceptionHandler { _, e -> e.printStackTrace(); kotlin.system.exitProcess(1) } }
        .apply { start() }.join()
}

// 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