From 2c7e8db8af758fca998146bb86ade3aaf8bfe5b3 Mon Sep 17 00:00:00 2001 From: oncsr Date: Fri, 26 Dec 2025 20:20:24 +0900 Subject: [PATCH] =?UTF-8?q?[20251226]=20BOJ=20/=20P5=20/=20Clubbing=20/=20?= =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=A4=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- khj20006/202512/26 BOJ P5 Clubbing.md | 47 +++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 khj20006/202512/26 BOJ P5 Clubbing.md diff --git a/khj20006/202512/26 BOJ P5 Clubbing.md b/khj20006/202512/26 BOJ P5 Clubbing.md new file mode 100644 index 00000000..b4c549a6 --- /dev/null +++ b/khj20006/202512/26 BOJ P5 Clubbing.md @@ -0,0 +1,47 @@ +```cpp +#include +using namespace std; + +int N; +bitset<131072> v; +int cnt[17]{}; + +void bck(int state) { + if(v[state]) return; + v[state].flip(); + for(int i=0;i<17;i++) if(!(state & (1<sync_with_stdio(0); + + v[131071].flip(); + + cin>>N; + for(int i=0;i>a; + int state = 0; + for(char c : a) state |= (1<<(c-'a')); + bck(state); + } + + string str; + cin>>str; + long long ans = 0; + int state = 0; + for(int i=0,j=-1;i