結果

問題 No.550 夏休みの思い出(1)
ユーザー ojisan_ITojisan_IT
提出日時 2017-07-29 00:11:56
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,499 bytes
コンパイル時間 1,423 ms
コンパイル使用メモリ 164,204 KB
実行使用メモリ 13,824 KB
最終ジャッジ日時 2024-04-18 13:51:58
合計ジャッジ時間 7,727 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define rep(i,n) for(ll i=0;i<(n);i++)  
#define pii pair<int,int>
#define piii pair<int,pii>
#define mp make_pair
#define pb push_back  
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second  
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-5;
const double PI = M_PI;  
#define DEB cout<<"!"<<endl
#define SHOW(a,b) cout<<(a)<<" "<<(b)<<endl
#define SHOWARRAY(ar,i,j) REP(a,i)REP(b,j)cout<<ar[a][b]<<((b==j-1)?((a==i-1)?("\n\n"):("\n")):(" "))
  
#define DIV 1000000007
typedef vector<ll> Array;
typedef vector<Array> matrix;

vector<ll> v;

void check_c(ll c){
  if(c < 0)
    c *= -1;
  for(ll i = 1; i*i <= c; i++)
    if(i != 0 && c%i == 0){
      v.pb(i);
      v.pb(-i);
      v.pb(c/i);
      v.pb(-c/i);
    }
}

int main(){
  ll a,b,c; cin >> a >> b >> c;
  
  
  if(c == 0){
    for(ll x = 1;;x++){
      if(b%x == 0 && x + a + b/x == 0){
        cout << - x << " " << 0 <<" "<< x << endl;
        if(x > DIV)//deb
          return 0;
        return 0;
      }
    }
  }
  check_c(c);
  sort(ALL(v));
  for(int i = 0; i < v.size();i++){
    ll x = v[i];
    for(int j = i+1; j < v.size(); j++){
      ll y = v[j];
        ll z = -a - x - y;
        if(c%z == 0 && x+y+z == -a && x*y+y*z+z*x == b && x*y == -c/z){
          cout << x << " " << y << " " << z <<endl;
          return 0;
      }
    }
  }
  return 0;
}
0