結果
| 問題 | No.945 YKC饅頭 |
| コンテスト | |
| ユーザー |
eSeF
|
| 提出日時 | 2020-07-14 22:41:50 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 155 ms / 2,000 ms |
| コード長 | 614 bytes |
| 記録 | |
| コンパイル時間 | 1,449 ms |
| コンパイル使用メモリ | 215,752 KB |
| 実行使用メモリ | 13,312 KB |
| 最終ジャッジ日時 | 2026-06-11 09:13:55 |
| 合計ジャッジ時間 | 6,633 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 74 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
const ll INF = (ll) 1e18;
int main()
{
int N,M;
cin >> N >> M;
set<int>res;
rep(i,N)res.insert(i);
vector<int>ans(3,0);
rep(i,M){
if(res.empty())break;
int L,R;char T;
cin >> L >> R >> T;
L--;R--;
auto itr = res.lower_bound(L);
while (itr!=res.end()&&*itr<=R)
{
itr=res.erase(itr);
if(T=='Y')ans[0]++;
if(T=='K')ans[1]++;
if(T=='C')ans[2]++;
}
}
printf("%lld %lld %lld\n",ans[0],ans[1],ans[2]);
return 0;
}
eSeF