結果

問題 No.571 3人兄弟(その2)
ユーザー spb9876spb9876
提出日時 2017-10-18 10:20:23
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 579 bytes
コンパイル時間 536 ms
コンパイル使用メモリ 59,400 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-11 20:11:20
合計ジャッジ時間 1,482 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <utility>
using namespace std;
int main(void){
  int h[3],w[3];
  char x[3]={'A','B','C'};
  for(int i=0;i<3;i++)
    cin >> h[i] >> w[i];
  for(int i=0;i<2;i++){
    for(int j=i;j<3;j++){
      if(h[i]<h[j]){
        swap(h[i],h[j]);
        swap(w[i],w[j]);
        swap(x[i],x[j]);
      }
    }
  }
  for(int i=0;i<2;i++){
    if(h[i]==h[i+1]){
      if(w[i]>w[i+1]){
        swap(w[i],w[i+1]);
        swap(x[i],x[i+1]);
      }
    }
  }
  cout << x[0] << "\n" << x[1] << "\n" << x[2] << "\n";
  return 0;
}
0