結果
問題 | No.3023 Utility is Max? |
ユーザー |
![]() |
提出日時 | 2025-02-14 23:40:09 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 588 bytes |
コンパイル時間 | 616 ms |
コンパイル使用メモリ | 90,712 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-02-14 23:41:28 |
合計ジャッジ時間 | 6,639 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 1 WA * 16 |
ソースコード
import std.algorithm, std.array, std.container, std.conv, std.math, std.range, std.stdio, std.typecons;void main() {auto Q = readln[0 .. $-1].to!uint;bool[] ans;foreach (q; 0 .. Q) {auto I = readln[0 .. $-1].to!long;auto tmp1 = readln.split.to!(long[]), tmp2 = readln.split.to!(long[]);auto A1 = tmp1[0], B1 = tmp1[1], X1 = tmp1[2], Y1 = tmp1[3];auto A2 = tmp2[0], B2 = tmp2[1], X2 = tmp2[2], Y2 = tmp2[3];ans~= (A1*X1 + B1*Y1 == I && A2*X2 + B2*Y2 == I)&& (A1*X2 + B1*Y2 >= I && A2*X1 + B2*Y1 >= I);}foreach (a; ans) {writeln(a ? "Yes" : "No");}}