結果

問題 No.945 YKC饅頭
ユーザー mint6421mint6421
提出日時 2019-12-08 20:45:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 1,446 bytes
コンパイル時間 3,136 ms
コンパイル使用メモリ 164,752 KB
実行使用メモリ 6,772 KB
最終ジャッジ日時 2023-08-30 04:46:06
合計ジャッジ時間 6,366 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 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 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 1 ms
4,380 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 4 ms
4,380 KB
testcase_32 AC 4 ms
5,288 KB
testcase_33 AC 13 ms
5,564 KB
testcase_34 AC 26 ms
4,896 KB
testcase_35 AC 47 ms
6,184 KB
testcase_36 AC 32 ms
4,380 KB
testcase_37 AC 30 ms
4,376 KB
testcase_38 AC 28 ms
4,376 KB
testcase_39 AC 8 ms
4,788 KB
testcase_40 AC 8 ms
5,780 KB
testcase_41 AC 4 ms
5,044 KB
testcase_42 AC 39 ms
4,940 KB
testcase_43 AC 28 ms
4,380 KB
testcase_44 AC 35 ms
5,668 KB
testcase_45 AC 42 ms
4,440 KB
testcase_46 AC 3 ms
4,428 KB
testcase_47 AC 26 ms
5,020 KB
testcase_48 AC 7 ms
4,376 KB
testcase_49 AC 12 ms
5,008 KB
testcase_50 AC 44 ms
4,780 KB
testcase_51 AC 57 ms
6,580 KB
testcase_52 AC 57 ms
6,640 KB
testcase_53 AC 57 ms
6,644 KB
testcase_54 AC 58 ms
6,552 KB
testcase_55 AC 57 ms
6,552 KB
testcase_56 AC 5 ms
6,568 KB
testcase_57 AC 4 ms
6,516 KB
testcase_58 AC 42 ms
6,524 KB
testcase_59 AC 53 ms
6,496 KB
testcase_60 AC 22 ms
6,552 KB
testcase_61 AC 46 ms
6,512 KB
testcase_62 AC 42 ms
6,500 KB
testcase_63 AC 4 ms
6,492 KB
testcase_64 AC 22 ms
6,680 KB
testcase_65 AC 18 ms
6,488 KB
testcase_66 AC 17 ms
6,572 KB
testcase_67 AC 31 ms
6,548 KB
testcase_68 AC 20 ms
6,552 KB
testcase_69 AC 10 ms
6,500 KB
testcase_70 AC 11 ms
6,768 KB
testcase_71 AC 11 ms
6,700 KB
testcase_72 AC 26 ms
6,772 KB
testcase_73 AC 47 ms
6,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}
int Madd(int x,int y) {return (x+y)%M;}
int Msub(int x,int y) {return (x-y+M)%M;}
int Mmul(int x,int y) {return (x*y)%M;}

int n,m;
int c[200100];
int nextl[200100];

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);

  cin>>n>>m;
  rep(i,n+1){
    nextl[i]=i+1;
    c[i]=-1;
  }

  while(m--){
    int l,r;
    char d;
    cin>>l>>r>>d;
    l--;r--;
    int k;
    if(d=='Y') k=0;
    else if(d=='K') k=1;
    else k=2;
    while(l<=r){
      if(c[l]==-1){
        c[l]=k;
      }
      int nl=nextl[l];
      nextl[l]=max(nextl[l],r+1);
      l=nl;
    }
  }

  int cnt[3]={};
  rep(i,n){
    if(c[i]==-1) continue;
    cnt[c[i]]++;
  }

  cout<<cnt[0]<<' '<<cnt[1]<<' '<<cnt[2]<<endl;


}
0