結果

問題 No.51 やる気の問題
ユーザー バカらっくバカらっく
提出日時 2018-03-06 09:34:19
言語 Swift
(5.10.0)
結果
AC  
実行時間 5 ms / 5,000 ms
コード長 203 bytes
コンパイル時間 2,516 ms
コンパイル使用メモリ 121,244 KB
実行使用メモリ 7,748 KB
最終ジャッジ日時 2023-08-20 10:30:46
合計ジャッジ時間 2,217 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,448 KB
testcase_01 AC 3 ms
7,748 KB
testcase_02 AC 3 ms
7,656 KB
testcase_03 AC 3 ms
7,640 KB
testcase_04 AC 3 ms
7,576 KB
testcase_05 AC 4 ms
7,712 KB
testcase_06 AC 4 ms
7,684 KB
testcase_07 AC 3 ms
7,640 KB
testcase_08 AC 3 ms
7,608 KB
testcase_09 AC 5 ms
7,668 KB
testcase_10 AC 4 ms
7,464 KB
testcase_11 AC 3 ms
7,544 KB
testcase_12 AC 4 ms
7,684 KB
testcase_13 AC 4 ms
7,600 KB
testcase_14 AC 4 ms
7,684 KB
testcase_15 AC 4 ms
7,544 KB
testcase_16 AC 4 ms
7,460 KB
testcase_17 AC 4 ms
7,548 KB
testcase_18 AC 4 ms
7,460 KB
testcase_19 AC 4 ms
7,728 KB
testcase_20 AC 4 ms
7,580 KB
testcase_21 AC 3 ms
7,688 KB
testcase_22 AC 4 ms
7,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

var totalSagyo = Int(readLine()!)!
let days = Int(readLine()!)!

for i in (1...days).reversed() {
    let sagyo = totalSagyo / (i * i)
    if(i==1) {
        print(sagyo)
    }
    totalSagyo -= sagyo
}
0