結果
問題 |
No.328 きれいな連立方程式
|
ユーザー |
![]() |
提出日時 | 2016-04-27 08:11:52 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 738 bytes |
コンパイル時間 | 1,515 ms |
コンパイル使用メモリ | 168,628 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 00:05:59 |
合計ジャッジ時間 | 2,422 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for (int i=0;i<(n);i++) #define rep2(i,a,b) for (int i=(a);i<(b);i++) #define rrep(i,n) for (int i=(n)-1;i>=0;i--) #define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--) #define all(a) (a).begin(),(a).end() typedef long long ll; typedef pair<int, int> P; signed main() { std::ios::sync_with_stdio(false); std::cin.tie(0); vector<double> c(5); rep(i, 4) cin >> c[i + 1]; double det = c[2] * (-c[2]) - (-c[1]) * c[3]; double Z1 = ((-c[2]) * c[3] + c[1] * c[4]) / det; double Z2 = ((-c[3]) * c[3] + c[2] * c[4]) / det; double D = Z1 * Z1 - 4 * Z2; if (D >= 0) { cout << "R" << endl; } else { cout << "I" << endl; } }