2023-06-01から1ヶ月間の記事一覧

java.util.Comparatorの比較判定は適当に書くと実行時エラーが出る(ことがある)

また実装をサボって時間を浪費したので書きました。 <問題> atcoder.jp <実行時エラー(RE)が発生した提出> atcoder.jp 抜粋 Collections.sort(rowA, new Comparator<Map.Entry<Long,Long>>(){ @Override public int compare(Map.Entry<Long,Long> e1, Map.Entry<Long,Long> e2){ return (e1.getValue() =</long,long></long,long></map.entry<long,long>…