結果

問題 No.1032 数数え
ユーザー neko_the_shadowneko_the_shadow
提出日時 2020-04-24 09:48:21
言語 Bash
(Bash 5.1.16)
結果
AC  
実行時間 244 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 497 ms
コンパイル使用メモリ 7,072 KB
実行使用メモリ 31,104 KB
最終ジャッジ日時 2024-04-23 02:23:33
合計ジャッジ時間 1,411 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#!/bin/bash

awk '
  NR==1 {
    n=$1
    m=$2
    for(i=1;i<=m;i++) a[i]=0
  }
  NR==2 {
    for(i=1;i<=NF;i++) a[$i]++
  }
  END {
    for(i=1;i<=m;i++) print i, a[i]
  }
'
0