結果

問題 No.1443 Andd
ユーザー kotatsugamekotatsugame
提出日時 2021-03-26 23:07:57
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 371 bytes
コンパイル時間 700 ms
コンパイル使用メモリ 76,300 KB
実行使用メモリ 10,780 KB
最終ジャッジ日時 2024-05-06 17:08:12
合計ジャッジ時間 9,758 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,752 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 333 ms
5,376 KB
testcase_04 AC 732 ms
5,376 KB
testcase_05 AC 334 ms
5,376 KB
testcase_06 AC 269 ms
5,376 KB
testcase_07 AC 672 ms
5,376 KB
testcase_08 AC 497 ms
5,376 KB
testcase_09 AC 9 ms
5,376 KB
testcase_10 AC 1,020 ms
5,376 KB
testcase_11 AC 750 ms
5,376 KB
testcase_12 AC 806 ms
5,376 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int N;
main()
{
	cin>>N;
	vector<int>X(1,0);
	for(int i=0;i<N;i++)
	{
		int A;
		cin>>A;
		int n=X.size();
		X.reserve(n*2);
		for(int j=0;j<n;j++)
		{
			X.push_back(X[j]+A);
			X[j]&=A;
		}
		sort(X.begin(),X.end());
		X.erase(unique(X.begin(),X.end()),X.end());
		cout<<X.size()<<"\n";
	}
}
0