結果

問題 No.1175 Simultaneous Equations
ユーザー chacoder1
提出日時 2021-06-15 22:06:37
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 3,022 ms
コンパイル使用メモリ 191,780 KB
最終ジャッジ日時 2025-01-22 08:25:38
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long

signed main(){
  double a,b,c,d,e,f,x,y;
  cin>>a>>b>>c>>d>>e>>f;
  if(a==d){
    y=(c-f)/(b-e);
    x=(c-b*y)/a;
    cout<<x<<" "<<y<<endl;
    return 0;
  }
  y=(a*f-c*d)/(a*e-d*b);
  x=(c-b*y)/a;
  cout<<x<<" "<<y<<endl;
  return 0;
}
  
0