cswork / OA打开练习工作台

RampOA #3

Banking System II (Optional Returns + Scheduled Payments + Merge)

估计困难评测数据准备中,可先阅读题面

考点(AI 标注)迭代器设计模拟/实现单调栈与堆

同类可判练习:银行账本(四关递进)

Same 4-level structure as Problem 1, signatures use Optional<Integer> / Optional<String>.

Level 1

  • createAccount(ts, accountId) -> boolean
  • Optional<Integer> deposit(ts, accountId, amount)
  • Optional<Integer> transferMoney(ts, sourceAccountId, targetAccountId, amount)

Level 2 — Ranking

  • topSpenders(ts, n) — top n accounts by total outgoing. Format "accountId(total)".

Level 3 — Scheduled Payments

  • schedulePayment(ts, accountId, amount, delay) — schedule a payment that executes at ts + delay. Returns paymentN id.
  • cancelScheduledPayment(ts, paymentId) — only if still SCHEDULED.

Level 4 — Merge Accounts

  • boolean mergeAccounts(ts, accountId1, accountId2)
  • Optional<Integer> getBalance(ts, accountId, timeAt)