結果

問題 No.1032 数数え
ユーザー otackyotacky
提出日時 2020-04-23 13:48:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 339 ms / 2,000 ms
コード長 1,123 bytes
コンパイル時間 1,006 ms
コンパイル使用メモリ 100,612 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-21 13:53:13
合計ジャッジ時間 2,412 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 339 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 16 ms
5,376 KB
testcase_10 AC 3 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 308 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

typedef long long ll;
using namespace std;
int main(void){
    // Your code here!
    ll N, M, L;
    cin >> N >> M;
    ll* arr = new ll[M];
    while(cin >> L){
        if (L > M) continue;
        arr[L - 1] = arr[L - 1] + 1;
    }
    for(ll i = 0; i < M; i++){
        cout << i+1 << " " << arr[i] << endl;;
    }
}
0