結果
| 問題 | No.51 やる気の問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-07-16 17:13:41 |
| 言語 | Go (1.27.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 327µs | |
| コード長 | 418 bytes |
| 記録 | |
| コンパイル時間 | 13,834 ms |
| コンパイル使用メモリ | 262,908 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-09-18 09:28:46 |
| 合計ジャッジ時間 | 15,920 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_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
}