結果

問題 No.571 3人兄弟(その2)
ユーザー spb9876spb9876
提出日時 2017-10-18 10:20:23
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 579 bytes
コンパイル時間 682 ms
コンパイル使用メモリ 58,504 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-18 14:27:56
合計ジャッジ時間 1,360 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 WA * 2
権限があれば一括ダウンロードができます

ソースコード

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