結果
| 問題 |
No.2555 Intriguing Triangle
|
| ユーザー |
|
| 提出日時 | 2023-12-01 07:31:25 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 772 bytes |
| コンパイル時間 | 2,749 ms |
| コンパイル使用メモリ | 104,320 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-26 15:31:29 |
| 合計ジャッジ時間 | 3,716 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 WA * 6 |
ソースコード
import std.stdio;
import std.conv;
import std.string;
import std.bigint;
void main(){
auto a = readln.chomp.to!long;
auto b = readln.chomp.to!long;
auto c = readln.chomp.to!long;
for(long x = 1; x + a < b + c; x++){
for(long y = 1; x + y + a < b + c; y++){
if(solve(a, b, c, x, y)){
writeln("Yes");
return;
}
}
}
writeln("No");
}
bool solve(long a, long b, long c, long x, long y){
long l = a + x + y;
long s = l ^^ 2 + b ^^ 2 - c ^^ 2;
long t = l ^^ 2 + c ^^ 2 - b ^^ 2;
BigInt left = l * c ^^ 2 + l * y ^^ 2 - y * t;
left *= (2 * b ^^ 2 * l - x * s) ^^ 2;
left *= c ^^ 2;
BigInt right = l * b ^^ 2 + l * x ^^ 2 - x * s;
right *= (2 * c ^^ 2 * l - y * t) ^^ 2;
right *= b ^^ 2;
return left == right;
}