Submission #7475839


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();

    Set<Integer> hashSet = new HashSet<Integer>();

    for (int i = 0; i < N; i++) {
      
      int a_ = a[i];

      while(a_ % 2 == 0){
        a_ = a_ / 2;
      }

      hashSet.add(a_);

    }

    System.out.println(hashSet.size());

  }

}

Submission Info

Submission Time
Task C - 高橋くんと魔法の箱
User TakahiroNakamori
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 553 Byte
Status
Exec Time 508 ms
Memory 55252 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
Subtask1 20 / 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 30 / 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 50 / 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 91 ms 20820 KB
subtask0_1.txt 91 ms 18644 KB
subtask0_2.txt 93 ms 18900 KB
subtask1_0.txt 152 ms 27860 KB
subtask1_1.txt 152 ms 23996 KB
subtask1_10.txt 150 ms 23732 KB
subtask1_11.txt 154 ms 27112 KB
subtask1_12.txt 157 ms 25568 KB
subtask1_13.txt 151 ms 23488 KB
subtask1_14.txt 153 ms 25016 KB
subtask1_15.txt 153 ms 23272 KB
subtask1_16.txt 146 ms 23272 KB
subtask1_17.txt 147 ms 23536 KB
subtask1_18.txt 147 ms 22380 KB
subtask1_19.txt 152 ms 23532 KB
subtask1_2.txt 147 ms 25200 KB
subtask1_3.txt 154 ms 24148 KB
subtask1_4.txt 147 ms 24780 KB
subtask1_5.txt 146 ms 25168 KB
subtask1_6.txt 147 ms 23528 KB
subtask1_7.txt 148 ms 25960 KB
subtask1_8.txt 151 ms 23596 KB
subtask1_9.txt 156 ms 26184 KB
subtask2_0.txt 453 ms 50832 KB
subtask2_1.txt 436 ms 47128 KB
subtask2_2.txt 438 ms 45588 KB
subtask2_3.txt 428 ms 49712 KB
subtask2_4.txt 448 ms 47632 KB
subtask2_5.txt 429 ms 46804 KB
subtask2_6.txt 405 ms 48608 KB
subtask2_7.txt 449 ms 50088 KB
subtask2_8.txt 436 ms 51752 KB
subtask2_9.txt 438 ms 52492 KB
subtask3_0.txt 435 ms 51496 KB
subtask3_1.txt 500 ms 54692 KB
subtask3_2.txt 470 ms 50472 KB
subtask3_3.txt 486 ms 54296 KB
subtask3_4.txt 485 ms 53216 KB
subtask3_5.txt 467 ms 47324 KB
subtask3_6.txt 488 ms 55252 KB
subtask3_7.txt 508 ms 54180 KB
subtask3_8.txt 501 ms 51272 KB
subtask3_9.txt 500 ms 49760 KB