結果

問題 No.945 YKC饅頭
ユーザー pekempeypekempey
提出日時 2019-12-08 00:04:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 1,043 bytes
コンパイル時間 1,737 ms
コンパイル使用メモリ 173,176 KB
実行使用メモリ 14,400 KB
最終ジャッジ日時 2023-08-27 06:53:34
合計ジャッジ時間 7,838 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 12 ms
4,780 KB
testcase_32 AC 38 ms
9,148 KB
testcase_33 AC 50 ms
10,120 KB
testcase_34 AC 49 ms
8,572 KB
testcase_35 AC 89 ms
13,112 KB
testcase_36 AC 32 ms
5,128 KB
testcase_37 AC 32 ms
5,384 KB
testcase_38 AC 35 ms
6,260 KB
testcase_39 AC 32 ms
7,480 KB
testcase_40 AC 50 ms
10,384 KB
testcase_41 AC 32 ms
8,248 KB
testcase_42 AC 60 ms
9,084 KB
testcase_43 AC 28 ms
4,604 KB
testcase_44 AC 72 ms
11,252 KB
testcase_45 AC 55 ms
8,052 KB
testcase_46 AC 21 ms
6,600 KB
testcase_47 AC 52 ms
9,152 KB
testcase_48 AC 9 ms
4,380 KB
testcase_49 AC 39 ms
8,248 KB
testcase_50 AC 62 ms
8,960 KB
testcase_51 AC 102 ms
14,336 KB
testcase_52 AC 104 ms
14,252 KB
testcase_53 AC 103 ms
14,348 KB
testcase_54 AC 103 ms
14,400 KB
testcase_55 AC 102 ms
14,360 KB
testcase_56 AC 63 ms
12,892 KB
testcase_57 AC 60 ms
12,680 KB
testcase_58 AC 130 ms
13,808 KB
testcase_59 AC 142 ms
14,076 KB
testcase_60 AC 99 ms
13,000 KB
testcase_61 AC 131 ms
13,856 KB
testcase_62 AC 131 ms
13,840 KB
testcase_63 AC 60 ms
12,744 KB
testcase_64 AC 104 ms
13,104 KB
testcase_65 AC 95 ms
12,932 KB
testcase_66 AC 94 ms
13,068 KB
testcase_67 AC 135 ms
13,464 KB
testcase_68 AC 102 ms
12,988 KB
testcase_69 AC 82 ms
12,764 KB
testcase_70 AC 87 ms
12,828 KB
testcase_71 AC 85 ms
12,800 KB
testcase_72 AC 120 ms
13,316 KB
testcase_73 AC 137 ms
14,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
using ll = long long;
 
#define rep(i, n)      for (int i = 0; i < (n); i++)
#define repr(i, n)     for (int i = (n) - 1; i >= 0; i--)
#define repe(i, l, r)  for (int i = (l); i < (r); i++)
#define reper(i, l, r) for (int i = (r) - 1; i >= (l); i--)
#define repi(i, l, r)  for (int i = (l); i <= (r); i++)
#define repir(i, l, r) for (int i = (r); i >= (l); i--)
#define range(a) a.begin(), a.end()
void initio() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }

int main() { initio();
  int N, M; cin >> N >> M;
  vector<int> L(M), R(M); vector<char> T(M); rep(i, M) cin >> L[i] >> R[i] >> T[i];
  set<int> st;
  rep(i, N + 1) st.insert(i);
  vector<char> color(N, '*');
  rep(i, M) {
    L[i]--; R[i]--;
    auto it = st.lower_bound(L[i]);
    while (*it <= R[i]) {
      color[*it] = T[i];
      it = st.erase(it);
    }
  }
  cout << count(range(color), 'Y') << ' ';
  cout << count(range(color), 'K') << ' ';
  cout << count(range(color), 'C') << endl;
}
0