結果
| 問題 |
No.945 YKC饅頭
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-08 08:43:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 230 ms / 2,000 ms |
| コード長 | 475 bytes |
| コンパイル時間 | 720 ms |
| コンパイル使用メモリ | 71,796 KB |
| 実行使用メモリ | 12,928 KB |
| 最終ジャッジ日時 | 2024-12-29 14:05:27 |
| 合計ジャッジ時間 | 8,572 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 74 |
ソースコード
//coding on smartphone
#include<iostream>
#include<set>
using namespace std;
int main(){
int n, m, ans[3] = {};
cin >> n >> m;
set<int> s;
while(n > 0) s.insert(n--);
while(m--){
int l, r;
char c;
cin >> l >> r >> c;
int ind = c=='Y' ? 0 : c=='K' ? 1 : 2;
for(auto it = s.lower_bound(l); it != s.end() && *it <= r;){
ans[ind]++;
it = s.erase(it);
}
}
for(int i = 0; i < 3; i++) cout << ans[i] << " \n"[i==2];
return 0;
}