結果

問題 No.182 新規性の虜
ユーザー _k_a_n_i__k_a_n_i_
提出日時 2015-04-23 18:37:44
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 910 bytes
コンパイル時間 2,165 ms
コンパイル使用メモリ 71,780 KB
実行使用メモリ 68,364 KB
最終ジャッジ日時 2023-09-18 08:38:03
合計ジャッジ時間 10,157 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
59,936 KB
testcase_01 AC 124 ms
55,844 KB
testcase_02 AC 126 ms
55,576 KB
testcase_03 AC 126 ms
55,644 KB
testcase_04 AC 125 ms
56,128 KB
testcase_05 AC 126 ms
55,920 KB
testcase_06 AC 125 ms
55,636 KB
testcase_07 AC 125 ms
55,776 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
evil01.txt -- -
evil02.txt -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main
{
    private final static Main main = new Main();

    public static void main(String[] args)
    {
        long l = System.currentTimeMillis();
        main.solve();
        //System.out.println("処理時間:" + (System.currentTimeMillis() - l));
    }

    private void solve()
    {
        Scanner sc = new Scanner(System.in);
        sc.nextLine();
        String s = sc.nextLine();
        String[] list = s.split(" ");
        for(String number : list)
        {
            if(s.indexOf(number) != s.lastIndexOf(number))
            {
                s = s.replace(number, "NULL");
            }
        }
        int ans = 0;
        String[] newList = s.split(" ");
        for(String item : newList)
        {
            if(!item.equals("NULL"))
            {
                ++ans;
            }
        }
        System.out.println(ans);
    }
}
0