結果

問題 No.29 パワーアップ
ユーザー カニ戯(ryカニ戯(ry
提出日時 2015-02-26 16:11:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 150 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 2,095 ms
コンパイル使用メモリ 71,676 KB
実行使用メモリ 57,516 KB
最終ジャッジ日時 2023-09-06 05:05:22
合計ジャッジ時間 6,306 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,708 KB
testcase_01 AC 126 ms
55,336 KB
testcase_02 AC 126 ms
53,884 KB
testcase_03 AC 128 ms
55,848 KB
testcase_04 AC 129 ms
55,564 KB
testcase_05 AC 144 ms
57,516 KB
testcase_06 AC 142 ms
55,500 KB
testcase_07 AC 136 ms
55,736 KB
testcase_08 AC 134 ms
55,804 KB
testcase_09 AC 126 ms
55,604 KB
testcase_10 AC 150 ms
55,560 KB
testcase_11 AC 150 ms
55,508 KB
testcase_12 AC 128 ms
55,320 KB
testcase_13 AC 140 ms
55,572 KB
testcase_14 AC 142 ms
55,572 KB
testcase_15 AC 138 ms
55,564 KB
testcase_16 AC 138 ms
55,564 KB
testcase_17 AC 132 ms
55,580 KB
testcase_18 AC 135 ms
55,888 KB
testcase_19 AC 135 ms
55,452 KB
testcase_20 AC 124 ms
55,384 KB
testcase_21 AC 130 ms
55,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main {
	public static void main(String[] a) {
		Scanner s=new Scanner(System.in);
		s.nextInt();
		int[] I=new int[11];
		int U=0,D=0,i;
		while(s.hasNext()){
			if(I[i=s.nextInt()]<0)U++;else D++;
			I[i]=~I[i];
		}
		System.out.println(U+(D-U)/4);
	}
}
0