結果

問題 No.945 YKC饅頭
ユーザー yakkiyakki
提出日時 2019-12-08 02:24:03
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 220 ms / 2,000 ms
コード長 1,156 bytes
コンパイル時間 655 ms
コンパイル使用メモリ 91,028 KB
実行使用メモリ 12,924 KB
最終ジャッジ日時 2023-08-27 15:02:38
合計ジャッジ時間 8,428 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 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,384 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,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,384 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,380 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,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,384 KB
testcase_31 AC 14 ms
4,964 KB
testcase_32 AC 33 ms
9,028 KB
testcase_33 AC 60 ms
9,920 KB
testcase_34 AC 85 ms
7,620 KB
testcase_35 AC 152 ms
11,992 KB
testcase_36 AC 88 ms
4,384 KB
testcase_37 AC 83 ms
4,380 KB
testcase_38 AC 80 ms
5,184 KB
testcase_39 AC 36 ms
7,668 KB
testcase_40 AC 51 ms
10,372 KB
testcase_41 AC 29 ms
8,160 KB
testcase_42 AC 120 ms
7,748 KB
testcase_43 AC 76 ms
4,380 KB
testcase_44 AC 117 ms
10,280 KB
testcase_45 AC 121 ms
6,444 KB
testcase_46 AC 18 ms
6,500 KB
testcase_47 AC 87 ms
8,340 KB
testcase_48 AC 18 ms
4,380 KB
testcase_49 AC 50 ms
8,152 KB
testcase_50 AC 134 ms
7,360 KB
testcase_51 AC 177 ms
12,688 KB
testcase_52 AC 175 ms
12,924 KB
testcase_53 AC 169 ms
12,696 KB
testcase_54 AC 179 ms
12,796 KB
testcase_55 AC 171 ms
12,776 KB
testcase_56 AC 55 ms
12,668 KB
testcase_57 AC 49 ms
12,652 KB
testcase_58 AC 199 ms
12,692 KB
testcase_59 AC 220 ms
12,668 KB
testcase_60 AC 122 ms
12,692 KB
testcase_61 AC 201 ms
12,684 KB
testcase_62 AC 202 ms
12,728 KB
testcase_63 AC 52 ms
12,716 KB
testcase_64 AC 128 ms
12,784 KB
testcase_65 AC 111 ms
12,652 KB
testcase_66 AC 112 ms
12,792 KB
testcase_67 AC 171 ms
12,672 KB
testcase_68 AC 128 ms
12,740 KB
testcase_69 AC 76 ms
12,780 KB
testcase_70 AC 82 ms
12,688 KB
testcase_71 AC 82 ms
12,756 KB
testcase_72 AC 143 ms
12,752 KB
testcase_73 AC 217 ms
12,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;



int main(){
    int N,M; cin >> N >> M;
    int y = 0,k = 0,c = 0;
    set<int> st;
    rep(i,N) st.insert(i);
    rep(i,M){
        int l,r; cin >> l >> r;
        l--; r--;
        char t; cin >> t;
        auto a = st.lower_bound(l);
        auto b = st.upper_bound(r);
        int s = st.size();
        st.erase(a,b);
        int d = st.size();
        int update = s-d;
        if(t == 'Y') y += update;
        if(t == 'K') k += update;
        if(t == 'C') c += update;
    }
    cout << y << " " << k << " " << c << endl;
}
0