結果
問題 |
No.2493 K-th in L2 with L1
|
ユーザー |
|
提出日時 | 2023-10-06 22:40:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 562 bytes |
コンパイル時間 | 696 ms |
コンパイル使用メモリ | 68,372 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-26 16:43:18 |
合計ジャッジ時間 | 1,610 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 4 |
ソースコード
#include <iostream> #include <cmath> using namespace std; int main() { int Q; cin >> Q; for (int i = 0; i < Q; i++) { int D, K; cin >> D >> K; bool found = false; for (int x = 0; x <= D; x++) { int y = sqrt(D * D - x * x); if (x * x + y * y == D * D && x + y <= K) { cout << "Yes\n" << x << " " << y << endl; found = true; break; } } if (!found) { cout << "No" << endl; } } return 0; }