結果
| 問題 | No.1443 Andd |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-31 05:53:54 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 574 bytes |
| 記録 | |
| コンパイル時間 | 337 ms |
| コンパイル使用メモリ | 82,120 KB |
| 実行使用メモリ | 9,808 KB |
| 最終ジャッジ日時 | 2026-09-02 11:36:06 |
| 合計ジャッジ時間 | 3,046 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 20 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int> ans(n-1, 0);
int x = 0;
for (int i = 0; i < n-1; i++) {
x = x + a[i];
int y = x;
for (int j = i+1; j < n; j++) {
y = y & a[j];
ans[j-i-1] |= y;
}
}
int cnt = 0;
for (int i = 0; i < n-1; i++) {
if (ans[i] != 0) {
cnt++;
}
}
cout << cnt << endl;
return 0;
}