Submission #7478510


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();
    Set<Integer> set = new HashSet<>();
    for (int i = 0; i < N; i++) {
      int a = sc.nextInt();
      set.add(div2(a));
    }
    
    System.out.println(set.size());
  }
  
  private static int div2(int a) {
    while (a % 2 == 0) {
      a /= 2;
    }
    return a;
  }
}

Submission Info

Submission Time
Task C - 高橋くんと魔法の箱
User sfuku7
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 451 Byte
Status
Exec Time 536 ms
Memory 65140 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 93 ms 21844 KB
subtask0_1.txt 92 ms 21588 KB
subtask0_2.txt 92 ms 19540 KB
subtask1_0.txt 152 ms 23888 KB
subtask1_1.txt 151 ms 25940 KB
subtask1_10.txt 162 ms 25988 KB
subtask1_11.txt 154 ms 25196 KB
subtask1_12.txt 151 ms 22512 KB
subtask1_13.txt 154 ms 25024 KB
subtask1_14.txt 150 ms 24552 KB
subtask1_15.txt 154 ms 23984 KB
subtask1_16.txt 158 ms 21972 KB
subtask1_17.txt 153 ms 25280 KB
subtask1_18.txt 150 ms 22372 KB
subtask1_19.txt 153 ms 23148 KB
subtask1_2.txt 155 ms 24808 KB
subtask1_3.txt 152 ms 26272 KB
subtask1_4.txt 161 ms 25868 KB
subtask1_5.txt 148 ms 25680 KB
subtask1_6.txt 150 ms 25576 KB
subtask1_7.txt 151 ms 22860 KB
subtask1_8.txt 149 ms 23860 KB
subtask1_9.txt 150 ms 22988 KB
subtask2_0.txt 467 ms 65140 KB
subtask2_1.txt 460 ms 62324 KB
subtask2_2.txt 473 ms 62844 KB
subtask2_3.txt 468 ms 61072 KB
subtask2_4.txt 471 ms 58684 KB
subtask2_5.txt 449 ms 59196 KB
subtask2_6.txt 461 ms 59140 KB
subtask2_7.txt 488 ms 62232 KB
subtask2_8.txt 469 ms 59184 KB
subtask2_9.txt 455 ms 62120 KB
subtask3_0.txt 457 ms 65136 KB
subtask3_1.txt 490 ms 58924 KB
subtask3_2.txt 519 ms 61288 KB
subtask3_3.txt 531 ms 61956 KB
subtask3_4.txt 519 ms 60524 KB
subtask3_5.txt 520 ms 63148 KB
subtask3_6.txt 502 ms 60492 KB
subtask3_7.txt 511 ms 63832 KB
subtask3_8.txt 520 ms 60672 KB
subtask3_9.txt 536 ms 62560 KB