Submission #7475480


Source Code Expand

Copy
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();

    int[] a = new int[N];

    for (int i = 0; i < N; i++) {
      a[i] = sc.nextInt();
    }

    sc.close();

    HashMap<Integer, Integer> hashMap = new HashMap<>();

    hashMap.put(a[0] * 2,1);

    int count = 1;

    for (int i = 1; i < N; i++) {
      if (!(hashMap.containsKey(a[i]))){
        count++;
      } 
      hashMap.put(a[i] * 2, 1);
    }

    System.out.println(count);

  }

}

Submission Info

Submission Time
Task C - 高橋くんと魔法の箱
User TakahiroNakamori
Language Java8 (OpenJDK 1.8.0)
Score 0
Code Size 589 Byte
Status
Exec Time 533 ms
Memory 58828 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
Subtask1 0 / 20 subtask1_0.txt, subtask1_1.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_2.txt, subtask1_3.txt, subtask1_4.txt, subtask1_5.txt, subtask1_6.txt, subtask1_7.txt, subtask1_8.txt, subtask1_9.txt, subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
Subtask2 0 / 30 subtask2_0.txt, subtask2_1.txt, subtask2_2.txt, subtask2_3.txt, subtask2_4.txt, subtask2_5.txt, subtask2_6.txt, subtask2_7.txt, subtask2_8.txt, subtask2_9.txt, subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
All 0 / 50 subtask0_0.txt, subtask0_1.txt, subtask0_2.txt, subtask1_0.txt, subtask1_1.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_2.txt, subtask1_3.txt, subtask1_4.txt, subtask1_5.txt, subtask1_6.txt, subtask1_7.txt, subtask1_8.txt, subtask1_9.txt, subtask2_0.txt, subtask2_1.txt, subtask2_2.txt, subtask2_3.txt, subtask2_4.txt, subtask2_5.txt, subtask2_6.txt, subtask2_7.txt, subtask2_8.txt, subtask2_9.txt, subtask3_0.txt, subtask3_1.txt, subtask3_2.txt, subtask3_3.txt, subtask3_4.txt, subtask3_5.txt, subtask3_6.txt, subtask3_7.txt, subtask3_8.txt, subtask3_9.txt
Case Name Status Exec Time Memory
subtask0_0.txt 98 ms 21716 KB
subtask0_1.txt 98 ms 23764 KB
subtask0_2.txt 98 ms 19796 KB
subtask1_0.txt 158 ms 22992 KB
subtask1_1.txt 151 ms 22896 KB
subtask1_10.txt 155 ms 23400 KB
subtask1_11.txt 159 ms 24620 KB
subtask1_12.txt 157 ms 24968 KB
subtask1_13.txt 156 ms 23788 KB
subtask1_14.txt 158 ms 25356 KB
subtask1_15.txt 161 ms 21100 KB
subtask1_16.txt 155 ms 23276 KB
subtask1_17.txt 156 ms 21232 KB
subtask1_18.txt 163 ms 27732 KB
subtask1_19.txt 157 ms 21232 KB
subtask1_2.txt 154 ms 23404 KB
subtask1_3.txt 153 ms 23532 KB
subtask1_4.txt 155 ms 23124 KB
subtask1_5.txt 157 ms 22992 KB
subtask1_6.txt 159 ms 25508 KB
subtask1_7.txt 153 ms 25648 KB
subtask1_8.txt 152 ms 25580 KB
subtask1_9.txt 154 ms 25168 KB
subtask2_0.txt 457 ms 49292 KB
subtask2_1.txt 483 ms 53676 KB
subtask2_2.txt 456 ms 48140 KB
subtask2_3.txt 456 ms 52032 KB
subtask2_4.txt 455 ms 51648 KB
subtask2_5.txt 464 ms 48724 KB
subtask2_6.txt 454 ms 48548 KB
subtask2_7.txt 466 ms 50544 KB
subtask2_8.txt 462 ms 53684 KB
subtask2_9.txt 461 ms 54536 KB
subtask3_0.txt 468 ms 51024 KB
subtask3_1.txt 523 ms 56300 KB
subtask3_2.txt 501 ms 55536 KB
subtask3_3.txt 533 ms 51792 KB
subtask3_4.txt 507 ms 54004 KB
subtask3_5.txt 467 ms 52172 KB
subtask3_6.txt 518 ms 55128 KB
subtask3_7.txt 493 ms 58828 KB
subtask3_8.txt 519 ms 55964 KB
subtask3_9.txt 491 ms 49736 KB