結果
| 問題 | No.2118 遺伝的有限集合の数え上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-05 05:43:56 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 344 bytes |
| 記録 | |
| コンパイル時間 | 1,002 ms |
| コンパイル使用メモリ | 181,124 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-17 21:14:13 |
| 合計ジャッジ時間 | 6,474 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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';
}