結果

問題 No.110 しましまピラミッド
ユーザー ei1333333ei1333333
提出日時 2015-04-21 15:49:53
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 668 bytes
コンパイル時間 1,372 ms
コンパイル使用メモリ 151,120 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-18 02:17:56
合計ジャッジ時間 2,425 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

struct Query {
  int length;
  bool type;
  bool operator<(const Query& q) const {
    return(length < q.length);
  }
};

int main()
{
  vector< Query > query;

  for(int i = 0; i < 2; i++) {
    int N;
    cin >> N;
    while(N--) {
      int Digit;
      cin >> Digit;
      query.push_back((Query){Digit, i});
    }
  }
  sort(query.rbegin(), query.rend());
  int height = 0, type = -1, length = 1 << 30;
  for(int i = 0; i < query.size(); i++) {
    Query& q = query[i];
    if(type != q.type && length > q.length) {
      height++;
      type = q.type;
      length = q.length;
    }
  }
  cout << height << endl;
}
0