結果

問題 No.1443 Andd
ユーザー kotatsugamekotatsugame
提出日時 2021-03-26 23:18:09
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 1,086 ms
コンパイル使用メモリ 70,836 KB
実行使用メモリ 83,632 KB
最終ジャッジ日時 2023-08-19 10:07:15
合計ジャッジ時間 2,807 ms
ジャッジサーバーID
(参考情報)
judge11 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 5 ms
7,376 KB
testcase_04 AC 7 ms
7,372 KB
testcase_05 AC 6 ms
7,376 KB
testcase_06 AC 5 ms
7,428 KB
testcase_07 AC 7 ms
7,576 KB
testcase_08 AC 6 ms
7,584 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 8 ms
7,440 KB
testcase_11 AC 7 ms
7,492 KB
testcase_12 AC 6 ms
7,440 KB
testcase_13 AC 27 ms
23,888 KB
testcase_14 AC 28 ms
23,760 KB
testcase_15 AC 28 ms
23,864 KB
testcase_16 AC 28 ms
23,852 KB
testcase_17 AC 30 ms
23,864 KB
testcase_18 AC 118 ms
83,536 KB
testcase_19 AC 118 ms
83,428 KB
testcase_20 AC 117 ms
83,540 KB
testcase_21 AC 119 ms
83,632 KB
testcase_22 AC 117 ms
83,532 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    8 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int N;
int A[20202];
int C[20202][1<<10];
main()
{
	cin>>N;
	for(int i=0;i<N;i++)cin>>A[i];
	for(int i=0;i<N;i++)
	{
		for(int j=0;j<1<<10;j++)
		{
			if(C[i][j]&&j&A[i])C[i+1][j&A[i]]=1;
		}
		if(A[i]!=0)C[i+1][A[i]]=1;
		for(int j=0;j<1<<10;j++)
		{
			C[i+1][(j+A[i])&(1<<10)-1]+=C[i][j];
		}
		int ans=1;
		for(int j=0;j<1<<10;j++)ans+=C[i+1][j];
		cout<<ans<<endl;
	}
}
0