結果
| 問題 |
No.3184 Make Same
|
| コンテスト | |
| ユーザー |
a01sa01to
|
| 提出日時 | 2025-06-24 00:36:03 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 819 bytes |
| コンパイル時間 | 3,274 ms |
| コンパイル使用メモリ | 284,372 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-06-24 00:36:21 |
| 合計ジャッジ時間 | 18,156 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 RE * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "settings/debug.cpp"
#else
#define Debug(...) void(0)
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int n;
cin >> n;
vector<int> a(n);
rep(i, n) cin >> a[i];
a.push_back((1 << 30) - 1); // 番兵
cout << 30 << '\n';
for (int b = 29; b >= 0; --b) {
sort(a.begin(), a.end());
for (int i = 0; i <= n; ++i) {
if (a[i] & (1 << b) && i != 0) {
cout << 1 << ' ' << i << ' ' << (1 << b) << '\n';
for (int j = 0; j < i; ++j) a[j] += (1 << b);
break;
}
}
rep(i, n) assert(a[i] & (1 << b));
}
sort(a.begin(), a.end());
assert(a.front() == a.back());
return 0;
}
a01sa01to