結果

問題 No.55 正方形を描くだけの簡単なお仕事です。
ユーザー 0w10w1
提出日時 2016-11-27 18:35:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 1,363 ms
コンパイル使用メモリ 167,824 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-05 14:18:43
合計ジャッジ時間 2,212 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

signed main(){
  vector< int > x( 3 ), y( 3 );
  for( int i = 0; i < 3; ++i )
    cin >> x[ i ] >> y[ i ];
  for( int i = 0; i < 3; ++i )
    for( int j = i + 1; j < 3; ++j ){
      int h = abs( x[ i ] - x[ j ] );
      int w = abs( y[ i ] - y[ j ] );
      if( h != w ) continue;
      if( not ( abs( x[ 3 - i - j ] - x[ i ] ) == h and abs( y[ 3 - i - j ] - y[ j ] ) == w ) and
          not ( abs( x[ 3 - i - j ] - x[ j ] ) == h and abs( y[ 3 - i - j ] - y[ i ] ) == w ) ) continue;
      int g2x = x[ i ] + x[ j ];
      int g2y = y[ i ] + y[ j ];
      cout << g2x - x[ 3 - i - j ] << " " << g2y - y[ 3 - i - j ] << endl, exit( 0 );
    }
  cout << -1 << endl;
  return 0;
}
0