結果
問題 |
No.945 YKC饅頭
|
ユーザー |
![]() |
提出日時 | 2019-12-08 00:57:07 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,326 bytes |
コンパイル時間 | 1,544 ms |
コンパイル使用メモリ | 85,452 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-27 11:38:10 |
合計ジャッジ時間 | 8,662 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 36 WA * 38 |
ソースコード
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<bitset> #include<set> #include<map> #include<stack> #include<queue> #include<deque> #include<list> #include<iomanip> #include<cmath> #include<cstring> #include<functional> #include<cstdio> #include<cstdlib> using namespace std; #define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repr(i, 0, n) #define INF 2e9 #define MOD 1000000007 //#define MOD 998244353 #define LINF (long long)4e18 #define jck 3.141592 const double EPS = 1e-10; using ll = long long; using Pi = pair<int,int>; using Pl = pair<ll,ll>; int main(){ int N,M; cin >> N >> M; int y = 0,k = 0,c = 0; int a,b; cin >> a >> b; a--; b--; char d; cin >> d; int nowmin = a,nowmax = b; if(d == 'Y') y = b-a+1; if(d == 'K') k = b-a+1; if(d == 'C') c = b-a+1; repr(i,1,M){ int l,r; cin >> l >> r; l--; r--; char t; cin >> t; if(t == 'Y'){ y += max(nowmin-l,0)+max(r-nowmax,0); } if(t == 'K'){ k += max(nowmin-l,0)+max(r-nowmax,0); } if(t == 'C'){ c += max(nowmin-l,0)+max(r-nowmax,0); } nowmin = min(nowmin,l); nowmax = max(nowmax,r); } cout << y << " " << k << " " << c << endl; }