結果

問題 No.1032 数数え
ユーザー TokuzooTokuzoo
提出日時 2021-03-05 20:42:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 512 bytes
コンパイル時間 764 ms
コンパイル使用メモリ 75,616 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-04-16 08:10:26
合計ジャッジ時間 4,438 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,756 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
    int n,m;
    cin >> n >> m;
    vector<int> l(n);
    for(int i=0; i<n; i++){
        cin >> l[i];
    }

    sort(l.begin(),l.end());
    int cnt = 0;
    for(int i=1; i<=m; i++){
        for(int j=0; j<n; j++){
            if(i < l[j]){
                break;
            }
            if(i == l[j]){
                cnt++;
            }
        }
        cout << i << ' ' << cnt << endl;
        cnt = 0;
    }
}
0