結果

問題 No.1443 Andd
ユーザー kotatsugame
提出日時 2021-03-26 23:07:57
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 371 bytes
コンパイル時間 736 ms
コンパイル使用メモリ 77,240 KB
実行使用メモリ 13,640 KB
最終ジャッジ日時 2024-11-29 01:20:29
合計ジャッジ時間 37,714 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 TLE * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
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