結果
| 問題 |
No.1443 Andd
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-26 23:18:09 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 118 ms / 2,000 ms |
| コード長 | 452 bytes |
| コンパイル時間 | 666 ms |
| コンパイル使用メモリ | 69,948 KB |
| 実行使用メモリ | 83,584 KB |
| 最終ジャッジ日時 | 2024-11-29 01:33:39 |
| 合計ジャッジ時間 | 2,418 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
main.cpp:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
8 | main()
| ^~~~
ソースコード
#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;
}
}