結果
問題 | No.2118 遺伝的有限集合の数え上げ |
ユーザー |
|
提出日時 | 2022-11-05 05:43:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 344 bytes |
コンパイル時間 | 1,769 ms |
コンパイル使用メモリ | 167,180 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-19 02:07:10 |
合計ジャッジ時間 | 7,366 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 29 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){int n;cin >> n;string ans = "{";for(int i = 0; i < 20; i++){if(n >> i & 1){if(ans.back() != '{')ans += ',';ans += string(i + 1, '{');ans += string(i + 1, '}');}}ans += "}";cout << ans << '\n';}