結果

問題 No.571 3人兄弟(その2)
ユーザー tnakao0123tnakao0123
提出日時 2017-10-07 02:07:39
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 945 bytes
コンパイル時間 837 ms
コンパイル使用メモリ 84,760 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-10 18:33:17
合計ジャッジ時間 1,645 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 571.cc: No.571 3人兄弟(その2) - yukicoder
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int N = 3;

/* typedef */

struct Stat {
  int h, w, i;
  Stat() {}
  Stat(int _h, int _w, int _i): h(_h), w(_w), i(_i) {}
  bool operator<(const Stat &s) const {
    return h > s.h || (h == s.h && w < s.w);
  }
};

/* global variables */

Stat hws[N];

/* subroutines */

/* main */

int main() {
  for (int i = 0; i < N; i++) {
    int hi, wi;
    scanf("%d%d", &hi, &wi);
    hws[i] = Stat(hi, wi, i);
  }
  sort(hws, hws + N);

  for (int i = 0; i < N; i++) printf("%c\n", 'A' + hws[i].i);
  return 0;
}
0