結果

問題 No.51 やる気の問題
ユーザー kaiyori_labkaiyori_lab
提出日時 2014-11-11 05:43:00
言語 Scala(Beta)
(3.4.0)
結果
AC  
実行時間 1,000 ms / 5,000 ms
コード長 297 bytes
コンパイル時間 8,380 ms
コンパイル使用メモリ 235,848 KB
実行使用メモリ 63,812 KB
最終ジャッジ日時 2023-09-11 07:24:29
合計ジャッジ時間 34,042 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 979 ms
62,716 KB
testcase_01 AC 978 ms
62,736 KB
testcase_02 AC 981 ms
62,984 KB
testcase_03 AC 980 ms
62,500 KB
testcase_04 AC 977 ms
62,592 KB
testcase_05 AC 988 ms
62,824 KB
testcase_06 AC 979 ms
62,632 KB
testcase_07 AC 1,000 ms
62,632 KB
testcase_08 AC 964 ms
62,500 KB
testcase_09 AC 979 ms
62,832 KB
testcase_10 AC 970 ms
62,604 KB
testcase_11 AC 965 ms
62,580 KB
testcase_12 AC 967 ms
62,944 KB
testcase_13 AC 973 ms
62,576 KB
testcase_14 AC 981 ms
62,672 KB
testcase_15 AC 991 ms
62,564 KB
testcase_16 AC 987 ms
62,832 KB
testcase_17 AC 982 ms
63,812 KB
testcase_18 AC 975 ms
62,572 KB
testcase_19 AC 991 ms
62,564 KB
testcase_20 AC 967 ms
62,768 KB
testcase_21 AC 962 ms
62,536 KB
testcase_22 AC 979 ms
62,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

object Main extends App{
    val sc = new java.util.Scanner(System.in)
    val w, d = sc.nextInt
    def work(w: Int, d: Int): Unit = d match{
        case 1 => println(w)
        case _ => work(w - (w / d / d).toInt, d - 1)    // d * d : intの範囲を超える
    }
    work(w, d)   
}
0