結果
問題 |
No.467 隠されていたゲーム
|
ユーザー |
|
提出日時 | 2016-12-17 00:57:30 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 638 bytes |
コンパイル時間 | 725 ms |
コンパイル使用メモリ | 118,436 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-12 05:39:14 |
合計ジャッジ時間 | 1,671 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 WA * 1 |
ソースコード
import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop, core.stdc.stdio; void main() { auto N = readln.chomp.to!int; auto D = readln.split.map!(to!int).array; auto X = readln.split.map!(x => x.to!int.abs).array.reduce!(max); auto ans = int.max; foreach (d; D) { auto a = X / d * d; if (d > X) ans = min(ans, 2); else if (a == X) ans = min(ans, X/d); else if (find(D, X-a)) ans = min(ans, X/d+1); else ans = min(ans, X/d+2); } ans.writeln; }