結果

問題 No.945 YKC饅頭
ユーザー mkawa2mkawa2
提出日時 2019-12-16 10:19:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 393 ms / 2,000 ms
コード長 850 bytes
コンパイル時間 1,766 ms
コンパイル使用メモリ 181,304 KB
実行使用メモリ 25,396 KB
最終ジャッジ日時 2023-09-15 17:22:27
合計ジャッジ時間 12,072 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 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,376 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,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 3 ms
4,376 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
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,380 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 3 ms
4,380 KB
testcase_24 AC 3 ms
4,376 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 3 ms
4,376 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 11 ms
4,384 KB
testcase_32 AC 3 ms
4,376 KB
testcase_33 AC 55 ms
7,320 KB
testcase_34 AC 177 ms
14,828 KB
testcase_35 AC 292 ms
23,516 KB
testcase_36 AC 266 ms
22,656 KB
testcase_37 AC 238 ms
22,096 KB
testcase_38 AC 202 ms
14,676 KB
testcase_39 AC 31 ms
5,492 KB
testcase_40 AC 24 ms
5,200 KB
testcase_41 AC 8 ms
4,380 KB
testcase_42 AC 284 ms
22,720 KB
testcase_43 AC 236 ms
22,736 KB
testcase_44 AC 216 ms
15,632 KB
testcase_45 AC 350 ms
24,520 KB
testcase_46 AC 3 ms
4,376 KB
testcase_47 AC 168 ms
13,244 KB
testcase_48 AC 35 ms
5,756 KB
testcase_49 AC 59 ms
7,564 KB
testcase_50 AC 355 ms
24,940 KB
testcase_51 AC 381 ms
25,160 KB
testcase_52 AC 387 ms
24,772 KB
testcase_53 AC 393 ms
25,396 KB
testcase_54 AC 385 ms
24,560 KB
testcase_55 AC 392 ms
24,240 KB
testcase_56 AC 2 ms
4,380 KB
testcase_57 AC 2 ms
4,380 KB
testcase_58 AC 181 ms
13,520 KB
testcase_59 AC 227 ms
14,240 KB
testcase_60 AC 67 ms
6,260 KB
testcase_61 AC 192 ms
14,728 KB
testcase_62 AC 184 ms
13,472 KB
testcase_63 AC 4 ms
4,376 KB
testcase_64 AC 75 ms
6,520 KB
testcase_65 AC 58 ms
5,732 KB
testcase_66 AC 54 ms
5,564 KB
testcase_67 AC 127 ms
8,412 KB
testcase_68 AC 70 ms
6,196 KB
testcase_69 AC 20 ms
4,380 KB
testcase_70 AC 27 ms
4,380 KB
testcase_71 AC 27 ms
4,464 KB
testcase_72 AC 96 ms
8,132 KB
testcase_73 AC 215 ms
13,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
const ll inf = 1e16;
const ll md = 1000000007;

int main() {
  int n,m;
  cin>>n>>m;
  priority_queue<vi> q;
  priority_queue<vi> cmd;
  map<char,int> ttoi{{'Y',0},{'K',1},{'C',2}};
  vi ans(3,0);
  rep(i,m){
    int l,r;
    char t;
    cin>>l>>r>>t;
    l--;r--;
    cmd.push({-l,-i,r,ttoi[t]});
  }
  rep(di,n){
    while(cmd.size()>0 && -cmd.top()[0]<=di){
      q.push({cmd.top()[1],cmd.top()[2],cmd.top()[3]});
      cmd.pop();
    }
    if(q.size()>0) ans[q.top()[2]]++;
    while(q.size()>0 && q.top()[1]<=di) q.pop();
  }
  cout<<ans[0]<<" "<<ans[1]<<" "<<ans[2]<<endl;
  return 0;
}
0