結果

問題 No.945 YKC饅頭
ユーザー ngtkanangtkana
提出日時 2020-04-14 21:47:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 291 ms / 2,000 ms
コード長 970 bytes
コンパイル時間 2,507 ms
コンパイル使用メモリ 204,768 KB
実行使用メモリ 19,936 KB
最終ジャッジ日時 2024-04-09 18:12:15
合計ジャッジ時間 10,794 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,948 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 AC 2 ms
6,940 KB
testcase_14 AC 3 ms
6,940 KB
testcase_15 AC 3 ms
6,940 KB
testcase_16 AC 3 ms
6,944 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 3 ms
6,940 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 3 ms
6,944 KB
testcase_26 AC 2 ms
6,940 KB
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 2 ms
6,944 KB
testcase_29 AC 2 ms
6,940 KB
testcase_30 AC 2 ms
6,944 KB
testcase_31 AC 8 ms
6,940 KB
testcase_32 AC 5 ms
6,944 KB
testcase_33 AC 41 ms
9,272 KB
testcase_34 AC 128 ms
11,776 KB
testcase_35 AC 229 ms
17,484 KB
testcase_36 AC 157 ms
11,264 KB
testcase_37 AC 141 ms
10,752 KB
testcase_38 AC 138 ms
10,752 KB
testcase_39 AC 25 ms
6,940 KB
testcase_40 AC 19 ms
8,228 KB
testcase_41 AC 7 ms
6,940 KB
testcase_42 AC 196 ms
14,592 KB
testcase_43 AC 129 ms
9,856 KB
testcase_44 AC 171 ms
14,340 KB
testcase_45 AC 244 ms
14,592 KB
testcase_46 AC 5 ms
6,940 KB
testcase_47 AC 124 ms
11,896 KB
testcase_48 AC 22 ms
6,940 KB
testcase_49 AC 44 ms
8,448 KB
testcase_50 AC 258 ms
15,616 KB
testcase_51 AC 285 ms
19,688 KB
testcase_52 AC 290 ms
19,936 KB
testcase_53 AC 284 ms
19,768 KB
testcase_54 AC 291 ms
19,804 KB
testcase_55 AC 283 ms
19,628 KB
testcase_56 AC 5 ms
7,984 KB
testcase_57 AC 5 ms
7,920 KB
testcase_58 AC 103 ms
13,240 KB
testcase_59 AC 126 ms
13,932 KB
testcase_60 AC 47 ms
10,584 KB
testcase_61 AC 114 ms
13,452 KB
testcase_62 AC 110 ms
13,396 KB
testcase_63 AC 7 ms
8,060 KB
testcase_64 AC 52 ms
10,916 KB
testcase_65 AC 40 ms
10,400 KB
testcase_66 AC 40 ms
10,416 KB
testcase_67 AC 85 ms
12,144 KB
testcase_68 AC 48 ms
10,792 KB
testcase_69 AC 16 ms
8,996 KB
testcase_70 AC 20 ms
9,156 KB
testcase_71 AC 20 ms
9,252 KB
testcase_72 AC 66 ms
11,448 KB
testcase_73 AC 124 ms
13,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
using lint=long long;
using ld=long double;
template<class T>using numr=std::numeric_limits<T>;
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint n,m;std::cin>>n>>m;
    std::string s(m+1,'$');
    std::vector<std::vector<lint>>events(n+1);
    for(lint i=0;i<m;i++){
        lint l,r;std::cin>>l>>r;l--;
        std::cin>>s.at(i);
        events.at(l).push_back(i+1);
        events.at(r).push_back(-i-1);
    }
    events.at(0).push_back(m+1);
    events.at(n).push_back(-m-1);
    std::set<lint>set;
    lint y=0,k=0,c=0,z=0;
    for(lint i=0;i<n;i++){
        for(lint x:events.at(i)){
            if(0<x)set.insert(x-1);
            else set.erase(-x-1);
        }
        char now=s.at(*set.begin());
        (now=='Y'?y:now=='K'?k:now=='C'?c:z)++;
    }
    std::cout<<y<<' '<<k<<' '<<c<<'\n';
}
0