結果

問題 No.3324 ハイライト動画
コンテスト
ユーザー Tyto alba
提出日時 2025-11-03 23:22:39
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 944 bytes
コンパイル時間 814 ms
コンパイル使用メモリ 77,064 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-11-03 23:22:43
合計ジャッジ時間 3,949 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

# include <iostream>
# include <vector>

using namespace std;

int main()
{
    int v_base, v_cut;
    int i = 1, fst = 0, flen = 1;
    bool flg = false;

    vector<vector<int>> ans;

    cin >> v_base >> v_cut;
    int fl_cut[v_cut] = {};

    cin >> fl_cut[0];
    while (i < v_cut){
        cin >> fl_cut[i];
        if (fl_cut[i-1] == fl_cut[i] - 1) {
            if (!flg) {
                fst = fl_cut[i-1];
                flg = true;
            }
            flen += 1;
        }
        else {
            if (flg) {
                ans.push_back({fst, flen});
                flen = 1;
                flg = false;
            }
        }

        i++;
    }

    if (flg) {
        ans.push_back({fst, flen});
    }
    else {
        ans.push_back({fl_cut[v_cut-1], 1});
    }

    cout << ans.size() << endl;

    for (i=0; i<ans.size(); i++) {
        cout << ans[i][0] << " " << ans[i][1] << endl;
    }
    
    return 0;

}
0