Submission #345278


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);
	vector<LL> as(n);
	for(int i = 0; i < n; ++i){
		scanf("%lld", &as[i]);
	}
	sort(ALL(as));
	as.erase(unique(ALL(as)), as.end());
	int ans = as.size();
	for(LL x : as){
		if(binary_search(ALL(as), x * 2)){ --ans; }
	}
	printf("%d\n", ans);
}



}
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 0
Code Size 1955 Byte
Status WA
Exec Time 60 ms
Memory 1700 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:87:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld", &as[i]);
                        ^

Judge Result

Set Name Sample Subtask1 Subtask2 All
Score / Max Score 0 / 0 0 / 20 0 / 30 0 / 50
Status
AC × 3
AC × 14
WA × 9
AC × 4
WA × 9
AC × 16
WA × 27
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 24 ms 804 KB
subtask0_1.txt AC 22 ms 916 KB
subtask0_2.txt AC 23 ms 916 KB
subtask1_0.txt AC 25 ms 812 KB
subtask1_1.txt WA 23 ms 812 KB
subtask1_10.txt AC 24 ms 804 KB
subtask1_11.txt AC 24 ms 932 KB
subtask1_12.txt AC 25 ms 736 KB
subtask1_13.txt AC 25 ms 920 KB
subtask1_14.txt AC 24 ms 800 KB
subtask1_15.txt AC 23 ms 928 KB
subtask1_16.txt AC 24 ms 928 KB
subtask1_17.txt AC 24 ms 796 KB
subtask1_18.txt AC 24 ms 932 KB
subtask1_19.txt AC 24 ms 932 KB
subtask1_2.txt WA 23 ms 920 KB
subtask1_3.txt WA 23 ms 932 KB
subtask1_4.txt WA 24 ms 928 KB
subtask1_5.txt WA 24 ms 928 KB
subtask1_6.txt WA 24 ms 728 KB
subtask1_7.txt WA 23 ms 932 KB
subtask1_8.txt WA 24 ms 924 KB
subtask1_9.txt WA 24 ms 928 KB
subtask2_0.txt AC 48 ms 1700 KB
subtask2_1.txt WA 55 ms 1700 KB
subtask2_2.txt WA 58 ms 1572 KB
subtask2_3.txt WA 57 ms 1572 KB
subtask2_4.txt WA 55 ms 1576 KB
subtask2_5.txt WA 56 ms 1516 KB
subtask2_6.txt WA 57 ms 1576 KB
subtask2_7.txt WA 55 ms 1696 KB
subtask2_8.txt WA 58 ms 1568 KB
subtask2_9.txt WA 55 ms 1692 KB
subtask3_0.txt AC 49 ms 1572 KB
subtask3_1.txt WA 59 ms 1696 KB
subtask3_2.txt WA 59 ms 1572 KB
subtask3_3.txt WA 59 ms 1696 KB
subtask3_4.txt WA 60 ms 1576 KB
subtask3_5.txt WA 60 ms 1580 KB
subtask3_6.txt WA 59 ms 1700 KB
subtask3_7.txt WA 60 ms 1580 KB
subtask3_8.txt WA 60 ms 1572 KB
subtask3_9.txt WA 59 ms 1540 KB