結果

問題 No.571 3人兄弟(その2)
ユーザー spb9876spb9876
提出日時 2017-10-19 14:48:53
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 579 bytes
コンパイル時間 492 ms
コンパイル使用メモリ 58,164 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 05:57:42
合計ジャッジ時間 1,183 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 WA -
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 WA -
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 1 ms
6,940 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