結果
問題 |
No.467 隠されていたゲーム
|
ユーザー |
|
提出日時 | 2017-12-11 11:30:40 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 382 bytes |
コンパイル時間 | 1,059 ms |
コンパイル使用メモリ | 102,128 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-12 22:58:34 |
合計ジャッジ時間 | 1,647 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 6 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { auto n = readln.chomp.to!int; auto d = readln.split.to!(int[]), dm = d.maxElement; auto rd = readln.split.to!(int[]), x = rd[0], y = rd[1]; auto z = max(x, y); auto r = (max(z-dm*2, 0) + dm - 1) / dm; z -= r * dm; if (d.canFind(z)) r += 1; else if (z > 0) r += 2; writeln(r); }