結果
| 問題 | No.945 YKC饅頭 |
| コンテスト | |
| ユーザー |
chocorusk
|
| 提出日時 | 2019-12-08 05:33:28 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 234 ms / 2,000 ms |
| コード長 | 984 bytes |
| 記録 | |
| コンパイル時間 | 1,289 ms |
| コンパイル使用メモリ | 114,032 KB |
| 実行使用メモリ | 12,800 KB |
| 最終ジャッジ日時 | 2024-12-27 17:01:47 |
| 合計ジャッジ時間 | 9,008 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 74 |
ソースコード
#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;
}
chocorusk