結果
| 問題 | No.51 やる気の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-07-16 17:13:41 |
| 言語 | Go (1.26.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 418 bytes |
| 記録 | |
| コンパイル時間 | 11,786 ms |
| コンパイル使用メモリ | 294,244 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-04 15:38:22 |
| 合計ジャッジ時間 | 15,617 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
package main
import "fmt"
func main() {
var work, limit int
fmt.Scanf("%d", &work)
fmt.Scanf("%d", &limit)
fmt.Println(solve(work, limit))
}
func solve(work int, limit int) int {
current := limit
restWork := work
for current > 1 {
todayWork := current * current
current = current - 1
if todayWork > restWork {
continue
}
restWork = restWork - (restWork / todayWork)
}
return restWork
}