Submission #345163


Source Code Expand

Copy
import java.util.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;



public class Main{
	
	// ArrayList<Integer> lis = new ArrayList<Integer>();
	// ArrayList<String> lis = new ArrayList<String>();
	// PriorityQueue<P> que = new PriorityQueue<P>();
	// PriorityQueue<Integer> que = new PriorityQueue<Integer>();
	//  Stack<Integer> que = new Stack<Integer>();
	//HashMap<Long,Long> map = new HashMap<Long,Long>();
    //	static long sum=0;
	// 1000000007 (10^9+7)
	static int mod = 1000000007;
	//static int mod = 1000000009; ArrayList<Integer> l[]= new ArrayList[n];
 //   static int dx[]={1,-1,0,0};
	//static int dy[]={0,0,1,-1};
//	static int dx[]={1,-1,0,0,1,1,-1,-1};
//  static int dy[]={0,0,1,-1,1,-1,1,-1};
	
	//static Set<Integer> set = new HashSet<Integer>();
	//static ArrayList<Integer> l[];
    //static int parent[][],depth[],node,max_log;
//   static ArrayList<Integer> nd[]= new ArrayList[2001];

public  static void main(String[] args)   throws Exception, IOException{

	//Scanner sc =new Scanner(System.in);
	
	Reader sc = new Reader(System.in);
   

	//int n=sc.nextInt();//,m=sc.nextInt(),k=sc.nextInt();
	//int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt();
	
	int n=sc.nextInt();//,k=sc.nextInt(),s=0;
	HashSet<Integer> set = new HashSet<Integer>();
	
	for (int i = 0; i < n; i++) {
		int x=sc.nextInt();
		while(x%2==0)x/=2;
		set.add(x);
	}
System.out.println(set.size());
}



 

/*
  static class P implements Comparable<P>{
	int id, d; ;
	P(int id,int d){
		this.id=id;
		this.d=d;
	} 
	
	public int compareTo(P x){
	//	return  (-x.d+d)>=0?1:-1  ; // ascend long
	//	return   -x.d+d  ; // ascend
		 return   x.d-d  ; //descend
	   }
 
}//*/


static void db(Object... os){
    System.err.println(Arrays.deepToString(os));

}

static boolean validpos(int x,int y,int r, int c){
	
	return x<r && 0<=x && y<c && 0<=y;
	
}

static boolean bit(int x,int k){
	// weather k-th bit (from right) be one or zero
	return  ( 0 < ( (x>>k) & 1 )  )  ? true:false;
}


}




class Reader
{ 
	private BufferedReader x;
	private StringTokenizer st;
	
	public Reader(InputStream in)
	{
		x = new BufferedReader(new InputStreamReader(in));
		st = null;
	}
	public String nextString() throws IOException
	{
		while( st==null || !st.hasMoreTokens() )
			st = new StringTokenizer(x.readLine());
		return st.nextToken();
	}
	public int nextInt() throws IOException
	{
		return Integer.parseInt(nextString());
	}
	public long nextLong() throws IOException
	{
		return Long.parseLong(nextString());
	}
	public double nextDouble() throws IOException
	{
		return Double.parseDouble(nextString());
	}
}

Submission Info

Submission Time
Task C - 高橋くんと魔法の箱
User mukku
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 2823 Byte
Status
Exec Time 1022 ms
Memory 38140 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 384 ms 20640 KB
subtask0_1.txt 298 ms 20616 KB
subtask0_2.txt 297 ms 20636 KB
subtask1_0.txt 355 ms 24180 KB
subtask1_1.txt 364 ms 24200 KB
subtask1_10.txt 367 ms 24196 KB
subtask1_11.txt 381 ms 24500 KB
subtask1_12.txt 374 ms 24552 KB
subtask1_13.txt 374 ms 24236 KB
subtask1_14.txt 1022 ms 24260 KB
subtask1_15.txt 390 ms 24168 KB
subtask1_16.txt 386 ms 24256 KB
subtask1_17.txt 470 ms 24160 KB
subtask1_18.txt 387 ms 24520 KB
subtask1_19.txt 446 ms 24256 KB
subtask1_2.txt 382 ms 24172 KB
subtask1_3.txt 443 ms 24284 KB
subtask1_4.txt 455 ms 24260 KB
subtask1_5.txt 361 ms 24348 KB
subtask1_6.txt 365 ms 23952 KB
subtask1_7.txt 361 ms 24292 KB
subtask1_8.txt 362 ms 24572 KB
subtask1_9.txt 366 ms 24600 KB
subtask2_0.txt 539 ms 37864 KB
subtask2_1.txt 556 ms 37340 KB
subtask2_2.txt 564 ms 37156 KB
subtask2_3.txt 595 ms 36860 KB
subtask2_4.txt 567 ms 37748 KB
subtask2_5.txt 614 ms 37536 KB
subtask2_6.txt 550 ms 37384 KB
subtask2_7.txt 545 ms 37128 KB
subtask2_8.txt 582 ms 37452 KB
subtask2_9.txt 566 ms 37600 KB
subtask3_0.txt 559 ms 37676 KB
subtask3_1.txt 579 ms 37656 KB
subtask3_2.txt 550 ms 38040 KB
subtask3_3.txt 623 ms 37724 KB
subtask3_4.txt 606 ms 37720 KB
subtask3_5.txt 635 ms 38140 KB
subtask3_6.txt 624 ms 37800 KB
subtask3_7.txt 726 ms 37736 KB
subtask3_8.txt 568 ms 38004 KB
subtask3_9.txt 691 ms 37788 KB