結果

問題 No.945 YKC饅頭
ユーザー tarattata1tarattata1
提出日時 2019-12-08 00:12:12
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 1,370 bytes
コンパイル時間 932 ms
コンパイル使用メモリ 82,108 KB
実行使用メモリ 13,092 KB
最終ジャッジ日時 2023-08-27 07:04:24
合計ジャッジ時間 8,198 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,384 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,384 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,384 KB
testcase_15 AC 1 ms
4,384 KB
testcase_16 AC 1 ms
4,384 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,384 KB
testcase_19 AC 2 ms
4,384 KB
testcase_20 AC 2 ms
4,384 KB
testcase_21 AC 1 ms
4,384 KB
testcase_22 AC 2 ms
4,384 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,384 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 2 ms
4,388 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 13 ms
4,860 KB
testcase_32 AC 44 ms
9,012 KB
testcase_33 AC 60 ms
9,664 KB
testcase_34 AC 57 ms
7,696 KB
testcase_35 AC 105 ms
11,608 KB
testcase_36 AC 38 ms
4,380 KB
testcase_37 AC 37 ms
4,384 KB
testcase_38 AC 41 ms
5,012 KB
testcase_39 AC 36 ms
7,420 KB
testcase_40 AC 59 ms
10,248 KB
testcase_41 AC 37 ms
7,924 KB
testcase_42 AC 68 ms
7,464 KB
testcase_43 AC 33 ms
4,380 KB
testcase_44 AC 85 ms
10,128 KB
testcase_45 AC 64 ms
6,312 KB
testcase_46 AC 23 ms
6,388 KB
testcase_47 AC 61 ms
8,100 KB
testcase_48 AC 10 ms
4,380 KB
testcase_49 AC 46 ms
7,948 KB
testcase_50 AC 72 ms
7,172 KB
testcase_51 AC 122 ms
12,564 KB
testcase_52 AC 126 ms
12,532 KB
testcase_53 AC 123 ms
12,548 KB
testcase_54 AC 122 ms
12,728 KB
testcase_55 AC 123 ms
12,516 KB
testcase_56 AC 76 ms
13,092 KB
testcase_57 AC 58 ms
12,568 KB
testcase_58 AC 201 ms
12,428 KB
testcase_59 AC 217 ms
12,452 KB
testcase_60 AC 152 ms
12,428 KB
testcase_61 AC 208 ms
12,368 KB
testcase_62 AC 202 ms
12,368 KB
testcase_63 AC 56 ms
12,432 KB
testcase_64 AC 154 ms
12,432 KB
testcase_65 AC 144 ms
12,428 KB
testcase_66 AC 142 ms
12,376 KB
testcase_67 AC 183 ms
12,432 KB
testcase_68 AC 156 ms
12,432 KB
testcase_69 AC 95 ms
12,448 KB
testcase_70 AC 104 ms
12,372 KB
testcase_71 AC 106 ms
12,424 KB
testcase_72 AC 166 ms
12,440 KB
testcase_73 AC 211 ms
12,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;
using namespace std;



int main(int argc, char* argv[])
{
    int n,m;
    scanf("%d%d", &n, &m);

    char str[4]={0};
    set<int> z;
    int cnt[3]={0};
    int i;
    for(i=0; i<n; i++) {
        z.insert(i);
    }
    for(i=0; i<m; i++) {
        int l,r;
        scanf("%d%d%s", &l, &r, str); l--;
        auto it0=z.lower_bound(l);
        auto it1=z.lower_bound(r);
        int now=2;
        if(str[0]=='Y') {
            now=0;
        }
        else if(str[0]=='K') {
            now=1;
        }
        vector<int> del;
        for(; it0!=it1; ++it0) {
            int tmp=(*it0);
            cnt[now]++;
            del.push_back(tmp);
        }
        int p;
        for(p=0; p<(int)del.size(); p++) {
            z.erase(del[p]);
        }
    }
    for(i=0; i<3; i++) {
        printf("%d ", cnt[i]);
    }
    printf("\n");

    return 0;
}
0