結果
| 問題 | No.2118 遺伝的有限集合の数え上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-04 21:26:00 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 361µs | |
| コード長 | 256 bytes |
| 記録 | |
| コンパイル時間 | 323 ms |
| コンパイル使用メモリ | 74,752 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-08-17 15:02:42 |
| 合計ジャッジ時間 | 2,340 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 37 |
コンパイルメッセージ
main.cpp:15:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
15 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
string S(int N)
{
if(N==0)return"{}";
else
{
string ret="{";
for(int i=0;1<<i<=N;i++)if(N>>i&1)ret+=S(i),ret+=',';
ret.pop_back();
ret+='}';
return ret;
}
}
main()
{
int N;cin>>N;
cout<<S(N)<<endl;
}