Submission #345356


Source Code Expand

#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#define ALL(v) begin(v),end(v)
#else
#define ALL(v) (v).begin(),(v).end()
#endif

using namespace std;


namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}


#define REP(i,n) for(int i=0;i<int(n);++i)
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8





void mainmain(){
	int n;
	scanf("%d", &n);
	set<int> st;
	for(int i = 0; i < n; ++i){
		int a;
		scanf("%d", &a);
		while(!(a & 1)){ a >>= 1; }
		st.insert(a);
	}
	cout << st.size() << endl;
}



}
int main() try{
//	ios::sync_with_stdio(false);
	cout << fixed << setprecision(10);
	cerr << fixed << setprecision(4);
	mainmain();
}
catch(...){}

Submission Info

Submission Time
Task C - 高橋くんと魔法の箱
User climpet
Language C++11 (GCC 4.8.1)
Score 100
Code Size 1860 Byte
Status AC
Exec Time 115 ms
Memory 5464 KB

Compile Error

./Main.cpp: In function ‘void {anonymous}::mainmain()’:
./Main.cpp:84:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &n);
                 ^
./Main.cpp:88:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &a);
                  ^

Judge Result

Set Name Sample Subtask1 Subtask2 All
Score / Max Score 0 / 0 20 / 20 30 / 30 50 / 50
Status
AC × 3
AC × 23
AC × 13
AC × 43
Set Name Test Cases
Sample subtask0_0.txt, subtask0_1.txt, subtask0_2.txt
Subtask1 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 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 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 AC 28 ms 792 KB
subtask0_1.txt AC 25 ms 804 KB
subtask0_2.txt AC 23 ms 924 KB
subtask1_0.txt AC 25 ms 1060 KB
subtask1_1.txt AC 24 ms 1056 KB
subtask1_10.txt AC 24 ms 932 KB
subtask1_11.txt AC 25 ms 1052 KB
subtask1_12.txt AC 25 ms 1056 KB
subtask1_13.txt AC 26 ms 936 KB
subtask1_14.txt AC 26 ms 920 KB
subtask1_15.txt AC 26 ms 1056 KB
subtask1_16.txt AC 26 ms 1060 KB
subtask1_17.txt AC 26 ms 1056 KB
subtask1_18.txt AC 24 ms 1060 KB
subtask1_19.txt AC 25 ms 928 KB
subtask1_2.txt AC 27 ms 1056 KB
subtask1_3.txt AC 26 ms 928 KB
subtask1_4.txt AC 25 ms 1052 KB
subtask1_5.txt AC 26 ms 928 KB
subtask1_6.txt AC 27 ms 936 KB
subtask1_7.txt AC 24 ms 924 KB
subtask1_8.txt AC 24 ms 932 KB
subtask1_9.txt AC 28 ms 924 KB
subtask2_0.txt AC 90 ms 5416 KB
subtask2_1.txt AC 100 ms 4644 KB
subtask2_2.txt AC 98 ms 4640 KB
subtask2_3.txt AC 98 ms 4644 KB
subtask2_4.txt AC 98 ms 4628 KB
subtask2_5.txt AC 98 ms 4640 KB
subtask2_6.txt AC 95 ms 4644 KB
subtask2_7.txt AC 98 ms 4640 KB
subtask2_8.txt AC 97 ms 4636 KB
subtask2_9.txt AC 99 ms 4640 KB
subtask3_0.txt AC 91 ms 5408 KB
subtask3_1.txt AC 106 ms 5464 KB
subtask3_2.txt AC 110 ms 5408 KB
subtask3_3.txt AC 108 ms 5412 KB
subtask3_4.txt AC 109 ms 5412 KB
subtask3_5.txt AC 106 ms 5416 KB
subtask3_6.txt AC 108 ms 5408 KB
subtask3_7.txt AC 111 ms 5408 KB
subtask3_8.txt AC 115 ms 5416 KB
subtask3_9.txt AC 109 ms 5416 KB