結果

問題 No.945 YKC饅頭
ユーザー zekezeke
提出日時 2019-12-16 16:58:07
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 267 ms / 2,000 ms
コード長 2,528 bytes
コンパイル時間 990 ms
コンパイル使用メモリ 106,604 KB
実行使用メモリ 33,952 KB
最終ジャッジ日時 2023-09-15 18:03:03
合計ジャッジ時間 7,604 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,388 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 3 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,384 KB
testcase_31 AC 9 ms
5,148 KB
testcase_32 AC 9 ms
7,052 KB
testcase_33 AC 43 ms
12,436 KB
testcase_34 AC 89 ms
19,048 KB
testcase_35 AC 217 ms
29,752 KB
testcase_36 AC 126 ms
24,488 KB
testcase_37 AC 100 ms
24,172 KB
testcase_38 AC 93 ms
19,176 KB
testcase_39 AC 28 ms
8,600 KB
testcase_40 AC 23 ms
10,220 KB
testcase_41 AC 10 ms
6,884 KB
testcase_42 AC 140 ms
27,600 KB
testcase_43 AC 93 ms
23,672 KB
testcase_44 AC 122 ms
22,688 KB
testcase_45 AC 149 ms
29,272 KB
testcase_46 AC 6 ms
5,432 KB
testcase_47 AC 87 ms
18,876 KB
testcase_48 AC 20 ms
6,680 KB
testcase_49 AC 46 ms
11,488 KB
testcase_50 AC 157 ms
29,848 KB
testcase_51 AC 238 ms
33,952 KB
testcase_52 AC 262 ms
33,620 KB
testcase_53 AC 205 ms
33,692 KB
testcase_54 AC 188 ms
33,360 KB
testcase_55 AC 267 ms
33,388 KB
testcase_56 AC 11 ms
9,340 KB
testcase_57 AC 7 ms
9,244 KB
testcase_58 AC 119 ms
17,700 KB
testcase_59 AC 152 ms
19,668 KB
testcase_60 AC 49 ms
12,768 KB
testcase_61 AC 129 ms
18,420 KB
testcase_62 AC 122 ms
17,984 KB
testcase_63 AC 8 ms
9,252 KB
testcase_64 AC 58 ms
13,280 KB
testcase_65 AC 41 ms
12,264 KB
testcase_66 AC 39 ms
12,164 KB
testcase_67 AC 85 ms
15,572 KB
testcase_68 AC 49 ms
12,892 KB
testcase_69 AC 17 ms
10,364 KB
testcase_70 AC 22 ms
10,688 KB
testcase_71 AC 21 ms
10,856 KB
testcase_72 AC 67 ms
14,108 KB
testcase_73 AC 141 ms
19,124 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:93:25: 警告: ‘t’ may be used uninitialized [-Wmaybe-uninitialized]
   93 |         vec[L].push_back({-i, R, t});
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
main.cpp:84:12: 備考: ‘t’ はここで定義されています
   84 |         ll t;
      |            ^

ソースコード

diff #

/*
    Author:zeke
    
    pass System Test!
    GET AC!!
*/
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
#include <iomanip>
#include <math.h>
#include <utility>
#include <stack>
#include <bitset>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rep3(var, min, max) for (ll(var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll(var) = (max)-1; (var) + 1 > (min); --(var))
#define Mp(a, b) make_pair((a), (b))
#define F first
#define S second
#define Icin(s) \
    ll(s);      \
    cin >> (s);
#define Scin(s) \
    ll(s);      \
    cin >> (s);
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll mod = 1e9 + 7;
unsigned long long MOD = 1e9 + 7;
ll INF = 1e18;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,m;
    cin>>n>>m;
    vector<vector<vector<ll>>> vec(n);
    priority_queue<vector<ll>> q;
    rep(i, m)
    {
        ll L,R;
        char T;
        cin >> L >> R >> T;
        ll t;
        if(T=='Y')
            t = 1;
        if(T=='K')
            t = 2;
        if(T=='C')
            t = 3;
        L--;
        R--;
        vec[L].push_back({-i, R, t});
    }
    V result(n);
    rep(i,n){
        rep(j,vec[i].size()){
            q.push(vec[i][j]);
        }
     //   cout<<i<<" "<<q.size()<<" "<<q.top()[0]<<endl;
        while(!q.empty()){
            V temp = q.top();
            if(temp[1]>=i)
                break;
           // cout<<i<<" "<<temp[1]<<"消す"<<endl;
            q.pop();
        }
        if(!q.empty()){
            result[i] = q.top()[2];
        }
        
    }
    ll Yreg=0;
    ll Kreg=0;
    ll Creg=0;
    rep(i,n){
        if(result[i]==1){
            Yreg++;
        }else if(result[i]==2){
            Kreg++;
        }else if(result[i]==3){
            Creg++;
        }
     //   cout << result[i] << " ";
    }
    
//    cout << endl;
    cout<<Yreg<<" "<<Kreg<<" "<<Creg<<endl;
}
0