結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー latte0119latte0119
提出日時 2016-01-12 19:24:17
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 692 bytes
コンパイル時間 1,511 ms
コンパイル使用メモリ 165,812 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 22:53:53
合計ジャッジ時間 2,422 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 WA -
testcase_12 AC 1 ms
4,348 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
4,348 KB
testcase_16 WA -
testcase_17 AC 2 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 WA -
testcase_21 AC 2 ms
4,348 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

//#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

signed main(){
    vpint vec(3);
    rep(i,3)cin>>vec[i].first>>vec[i].second;
    sort(all(vec));


    do{
        if(vec[0].first!=vec[1].first)continue;
        if(vec[0].second!=vec[2].second)continue;
        if(abs(vec[0].second-vec[1].second)!=abs(vec[0].first-vec[2].first))continue;
        cout<<vec[2].first<<" "<<vec[1].second<<endl;
        return 0;
    }while(next_permutation(all(vec)));
    cout<<"-1"<<endl;
    return 0;
}
0