結果

問題 No.945 YKC饅頭
ユーザー miscalcmiscalc
提出日時 2019-12-08 00:44:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 229 ms / 2,000 ms
コード長 1,028 bytes
コンパイル時間 1,819 ms
コンパイル使用メモリ 178,852 KB
実行使用メモリ 12,832 KB
最終ジャッジ日時 2023-08-27 11:51:45
合計ジャッジ時間 10,906 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 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 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,384 KB
testcase_13 AC 3 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,384 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,384 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 15 ms
5,076 KB
testcase_32 AC 39 ms
9,084 KB
testcase_33 AC 67 ms
9,912 KB
testcase_34 AC 90 ms
7,648 KB
testcase_35 AC 158 ms
11,892 KB
testcase_36 AC 88 ms
4,500 KB
testcase_37 AC 84 ms
4,376 KB
testcase_38 AC 81 ms
5,528 KB
testcase_39 AC 40 ms
7,564 KB
testcase_40 AC 58 ms
10,360 KB
testcase_41 AC 34 ms
8,188 KB
testcase_42 AC 123 ms
7,852 KB
testcase_43 AC 76 ms
4,376 KB
testcase_44 AC 124 ms
10,232 KB
testcase_45 AC 127 ms
6,432 KB
testcase_46 AC 22 ms
6,560 KB
testcase_47 AC 92 ms
8,356 KB
testcase_48 AC 19 ms
4,376 KB
testcase_49 AC 55 ms
8,196 KB
testcase_50 AC 136 ms
7,344 KB
testcase_51 AC 184 ms
12,752 KB
testcase_52 AC 187 ms
12,832 KB
testcase_53 AC 185 ms
12,724 KB
testcase_54 AC 184 ms
12,700 KB
testcase_55 AC 186 ms
12,756 KB
testcase_56 AC 65 ms
12,796 KB
testcase_57 AC 61 ms
12,756 KB
testcase_58 AC 205 ms
12,756 KB
testcase_59 AC 229 ms
12,764 KB
testcase_60 AC 137 ms
12,732 KB
testcase_61 AC 219 ms
12,728 KB
testcase_62 AC 207 ms
12,732 KB
testcase_63 AC 61 ms
12,704 KB
testcase_64 AC 144 ms
12,828 KB
testcase_65 AC 129 ms
12,696 KB
testcase_66 AC 126 ms
12,820 KB
testcase_67 AC 182 ms
12,700 KB
testcase_68 AC 143 ms
12,760 KB
testcase_69 AC 89 ms
12,760 KB
testcase_70 AC 95 ms
12,704 KB
testcase_71 AC 98 ms
12,728 KB
testcase_72 AC 157 ms
12,700 KB
testcase_73 AC 221 ms
12,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
//const ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
const ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
ll myctoi(char C) {return C - '0';}
char myitoc(ll N) {return '0' + N;}
#define FINALANS(A) {cout << (A) << '\n'; exit(0);}

int main()
{
  ll N, M;
  cin >> N >> M;

  set<ll> S;
  for (ll i = 1; i <= N; i++)
  {
    S.emplace(i);
  }

  map<char, ll> ans;
  for (ll i = 0; i < M; i++)
  {
    ll L, R;
    char T;
    cin >> L >> R >> T;

    auto itr = S.lower_bound(L);
    while (itr != S.end() && *itr <= R)
    {
      ans[T]++;

      auto itr0 = itr;
      itr0++;
      S.erase(itr);
      itr = itr0;
    }
  }
  cout << ans['Y'] << " " << ans['K'] << " " << ans['C'] << endl;
}
0