結果

問題 No.945 YKC饅頭
ユーザー chocoruskchocorusk
提出日時 2019-12-08 05:33:28
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 216 ms / 2,000 ms
コード長 984 bytes
コンパイル時間 929 ms
コンパイル使用メモリ 113,100 KB
実行使用メモリ 13,016 KB
最終ジャッジ日時 2023-08-27 15:42:58
合計ジャッジ時間 8,595 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,500 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,384 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 3 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 3 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,384 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 15 ms
5,040 KB
testcase_32 AC 38 ms
9,352 KB
testcase_33 AC 66 ms
9,884 KB
testcase_34 AC 89 ms
7,864 KB
testcase_35 AC 156 ms
11,760 KB
testcase_36 AC 89 ms
4,384 KB
testcase_37 AC 85 ms
4,380 KB
testcase_38 AC 82 ms
5,536 KB
testcase_39 AC 39 ms
7,672 KB
testcase_40 AC 56 ms
10,484 KB
testcase_41 AC 33 ms
8,124 KB
testcase_42 AC 122 ms
8,028 KB
testcase_43 AC 77 ms
4,380 KB
testcase_44 AC 122 ms
10,220 KB
testcase_45 AC 127 ms
6,512 KB
testcase_46 AC 20 ms
6,480 KB
testcase_47 AC 92 ms
8,312 KB
testcase_48 AC 18 ms
4,384 KB
testcase_49 AC 55 ms
8,192 KB
testcase_50 AC 137 ms
7,352 KB
testcase_51 AC 185 ms
12,824 KB
testcase_52 AC 185 ms
12,700 KB
testcase_53 AC 184 ms
12,824 KB
testcase_54 AC 182 ms
12,972 KB
testcase_55 AC 183 ms
12,820 KB
testcase_56 AC 62 ms
12,692 KB
testcase_57 AC 58 ms
13,016 KB
testcase_58 AC 194 ms
12,696 KB
testcase_59 AC 216 ms
12,692 KB
testcase_60 AC 130 ms
12,692 KB
testcase_61 AC 204 ms
12,712 KB
testcase_62 AC 194 ms
12,760 KB
testcase_63 AC 59 ms
12,684 KB
testcase_64 AC 144 ms
12,700 KB
testcase_65 AC 125 ms
12,676 KB
testcase_66 AC 118 ms
12,708 KB
testcase_67 AC 165 ms
12,792 KB
testcase_68 AC 131 ms
12,792 KB
testcase_69 AC 83 ms
12,748 KB
testcase_70 AC 90 ms
12,816 KB
testcase_71 AC 92 ms
12,752 KB
testcase_72 AC 153 ms
12,768 KB
testcase_73 AC 209 ms
12,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;

int main()
{
    int n, m;
    cin>>n>>m;
    int a[3]={};
  set<int> st;
  for(int i=0; i<=n; i++) st.insert(i);
  for(int i=0; i<m; i++){
    int l, r, p; char t;
    cin>>l>>r>>t;
    l--; r--;
    if(t=='Y') p=0;
    else if(t=='K') p=1;
    else p=2;
    int x=l;
    auto itr=st.lower_bound(x);
    while(1){
      if(*itr>r) break;
      a[p]++;
      itr=st.erase(itr);
    }
  }
  cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<endl;
    return 0;
}
0