結果
| 問題 |
No.945 YKC饅頭
|
| コンテスト | |
| ユーザー |
kmjp
|
| 提出日時 | 2019-12-08 00:16:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 566 ms / 2,000 ms |
| コード長 | 1,138 bytes |
| コンパイル時間 | 2,291 ms |
| コンパイル使用メモリ | 178,860 KB |
| 実行使用メモリ | 25,600 KB |
| 最終ジャッジ日時 | 2024-12-26 19:02:10 |
| 合計ジャッジ時間 | 12,375 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 74 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------
int N,M;
vector<pair<int,char>> add[202020];
vector<pair<int,char>> del[202020];
int cnt[256];
void solve() {
int i,j,k,l,r,x,y; string s;
cin>>N>>M;
FOR(i,M) {
cin>>x>>y>>s;
add[x].push_back({i,s[0]});
del[y+1].push_back({i,s[0]});
}
set<pair<int,int>> S;
S.insert({505050,'a'});
for(i=1;i<=N;i++) {
FORR(a,add[i]) S.insert(a);
FORR(a,del[i]) S.erase(a);
cnt[S.begin()->second]++;
}
cout<<cnt['Y']<<" "<<cnt['K']<<" "<<cnt['C']<<endl;
}
int main(int argc,char** argv){
string s;int i;
if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
cout.tie(0); solve(); return 0;
}
kmjp