結果

問題 No.945 YKC饅頭
ユーザー aajisakaaajisaka
提出日時 2019-12-08 02:45:16
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 150 ms / 2,000 ms
コード長 1,825 bytes
コンパイル時間 1,623 ms
コンパイル使用メモリ 174,112 KB
実行使用メモリ 14,312 KB
最終ジャッジ日時 2023-08-27 15:03:09
合計ジャッジ時間 7,812 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 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 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 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 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 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,384 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 12 ms
5,228 KB
testcase_32 AC 37 ms
9,192 KB
testcase_33 AC 50 ms
10,032 KB
testcase_34 AC 48 ms
8,216 KB
testcase_35 AC 88 ms
13,116 KB
testcase_36 AC 31 ms
5,072 KB
testcase_37 AC 31 ms
5,240 KB
testcase_38 AC 35 ms
5,916 KB
testcase_39 AC 31 ms
7,820 KB
testcase_40 AC 50 ms
10,740 KB
testcase_41 AC 30 ms
8,180 KB
testcase_42 AC 58 ms
9,016 KB
testcase_43 AC 27 ms
4,716 KB
testcase_44 AC 71 ms
10,964 KB
testcase_45 AC 54 ms
7,848 KB
testcase_46 AC 20 ms
6,564 KB
testcase_47 AC 51 ms
8,888 KB
testcase_48 AC 9 ms
4,384 KB
testcase_49 AC 38 ms
8,316 KB
testcase_50 AC 61 ms
8,880 KB
testcase_51 AC 100 ms
14,120 KB
testcase_52 AC 103 ms
14,112 KB
testcase_53 AC 102 ms
14,304 KB
testcase_54 AC 102 ms
14,296 KB
testcase_55 AC 101 ms
14,312 KB
testcase_56 AC 62 ms
12,740 KB
testcase_57 AC 58 ms
12,724 KB
testcase_58 AC 130 ms
13,556 KB
testcase_59 AC 137 ms
14,032 KB
testcase_60 AC 102 ms
12,828 KB
testcase_61 AC 131 ms
13,716 KB
testcase_62 AC 127 ms
13,604 KB
testcase_63 AC 59 ms
12,744 KB
testcase_64 AC 101 ms
13,048 KB
testcase_65 AC 98 ms
12,920 KB
testcase_66 AC 96 ms
12,796 KB
testcase_67 AC 134 ms
13,328 KB
testcase_68 AC 98 ms
13,064 KB
testcase_69 AC 82 ms
13,012 KB
testcase_70 AC 85 ms
13,048 KB
testcase_71 AC 85 ms
13,008 KB
testcase_72 AC 118 ms
13,120 KB
testcase_73 AC 150 ms
13,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using P = pair<ll, ll>;

constexpr double PI = 3.14159265358979323846;
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

class YKC {
public:
    void solve(istream& cin, ostream& cout) {
      SPEED;
      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;
      for(int i=1; i<=n; i++) {
        st.insert(i);
      }
      vector<int> cnt(3);
      rep(i, m) {
        auto it = st.lower_bound(l[i]);
        while(it != st.end() && (*it) <= r[i]) {
          it = st.erase(it);
          if (t[i] == 'Y') {
            cnt[0]++;
          } else if (t[i] == 'K') {
            cnt[1]++;
          } else {
            cnt[2]++;
          }
        }
      }
      cout << cnt[0] << ' ' << cnt[1] << ' ' << cnt[2] << endl;
    }
};

signed main() {
  YKC solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
0