結果
| 問題 |
No.3219 Ruler to Maximize
|
| コンテスト | |
| ユーザー |
Iroha_3856
|
| 提出日時 | 2025-08-01 22:44:34 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 440 bytes |
| コンパイル時間 | 2,966 ms |
| コンパイル使用メモリ | 278,404 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-08-01 22:44:43 |
| 合計ジャッジ時間 | 7,710 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 WA * 31 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N; cin >> N;
vector<int> A(N); for (int& a : A) cin >> a;
int ans = 0;
int y = 0;
for (int x = 0; x < 4096; x++) {
int w = 0, b = 0;
for (int a : A) {
if ((a|x) == x) w |= a;
else b |= a;
}
if (ans < w * b) {
ans = w * b;
y = x;
}
}
cout << ans << endl;
for (int a : A) {
if ((a|y) == y) cout << "W";
else cout << "B";
}
cout << endl;
}
Iroha_3856