結果

問題 No.945 YKC饅頭
ユーザー trineutron
提出日時 2019-12-08 04:40:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 725 bytes
コンパイル時間 1,893 ms
コンパイル使用メモリ 170,900 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-12-27 15:17:38
合計ジャッジ時間 52,049 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 60 TLE * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> l(m), r(m);
    vector<char> t(m), s(n);
    for (int i = 0; i < m; i++) {
        cin >> l.at(i) >> r.at(i) >> t.at(i);
        l.at(i)--;
    }
    reverse(l.begin(), l.end());
    reverse(r.begin(), r.end());
    reverse(t.begin(), t.end());
    for (int i = 0; i < m; i++) {
        for (int j = l.at(i); j < r.at(i); j++) {
            s.at(j) = t.at(i);
        }
    }
    int y = 0, k = 0, c = 0;
    for (char x : s) {
        switch (x) {
            case 'Y': y++; break;
            case 'K': k++; break;
            case 'C': c++; break;
        }
    }
    cout << y << " " << k << " " << c << endl;
}
0