結果
問題 |
No.1816 MUL-DIV Game
|
ユーザー |
![]() |
提出日時 | 2022-01-21 21:30:33 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 419 bytes |
コンパイル時間 | 2,287 ms |
コンパイル使用メモリ | 214,432 KB |
実行使用メモリ | 8,964 KB |
最終ジャッジ日時 | 2024-06-22 14:06:37 |
合計ジャッジ時間 | 3,356 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 21 |
ソースコード
module no1801_1850.no1816; import std; void main() { int N; readf("%d\n", N); auto A = readln.chomp.split.to!(long[]); auto heap = A.heapify; int cnt; while (heap.length > 1) { long x = heap.front; heap.popFront; long y = heap.front; heap.popFront; heap.insert(cnt % 2 == 0 ? x * y : (x + y - 1) / y); ++cnt; } heap.front.writeln; }