結果

問題 No.29 パワーアップ
ユーザー 🐧しゅんチャマ🌸🐧しゅんチャマ🌸
提出日時 2023-09-21 21:53:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 153 ms / 5,000 ms
コード長 463 bytes
コンパイル時間 2,783 ms
コンパイル使用メモリ 71,476 KB
実行使用メモリ 57,584 KB
最終ジャッジ日時 2023-09-21 21:53:53
合計ジャッジ時間 6,817 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,488 KB
testcase_01 AC 126 ms
55,944 KB
testcase_02 AC 128 ms
55,800 KB
testcase_03 AC 129 ms
55,744 KB
testcase_04 AC 129 ms
55,480 KB
testcase_05 AC 147 ms
55,772 KB
testcase_06 AC 141 ms
55,776 KB
testcase_07 AC 146 ms
55,792 KB
testcase_08 AC 132 ms
55,480 KB
testcase_09 AC 128 ms
55,776 KB
testcase_10 AC 145 ms
55,708 KB
testcase_11 AC 153 ms
57,584 KB
testcase_12 AC 132 ms
55,684 KB
testcase_13 AC 142 ms
56,068 KB
testcase_14 AC 146 ms
55,928 KB
testcase_15 AC 149 ms
55,696 KB
testcase_16 AC 149 ms
55,708 KB
testcase_17 AC 142 ms
55,528 KB
testcase_18 AC 144 ms
55,676 KB
testcase_19 AC 144 ms
55,820 KB
testcase_20 AC 129 ms
55,532 KB
testcase_21 AC 129 ms
55,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Y29{
    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] item=new int[11];
        for(int i=0;i<n*3;i++){
            item[sc.nextInt()]++;
        }
        int count=0;
        int ans=0;
        for(int i=1;i<=10;i++){
            ans+=item[i]/2;
            count+=item[i]%2;
        }
        ans+=count/4;
        System.out.println(ans);
    }
}
0