From e908e7df806c97d15328f47ae43e71e4d4dd5af2 Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Sun, 23 Feb 2025 19:00:34 +0900 Subject: [PATCH] =?UTF-8?q?[20250223]=20SWEA=20/=20D4=20/=20=EB=8F=99?= =?UTF-8?q?=EC=95=84=EB=A6=AC=EC=8B=A4=20=EA=B4=80=EB=A6=AC=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20/=20=EC=9D=B4=EA=B0=95=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...00\353\246\254\355\225\230\352\270\260.md" | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 "lkhyun/202502/23 SWEA D4 \353\217\231\354\225\204\353\246\254\354\213\244 \352\264\200\353\246\254\355\225\230\352\270\260.md" diff --git "a/lkhyun/202502/23 SWEA D4 \353\217\231\354\225\204\353\246\254\354\213\244 \352\264\200\353\246\254\355\225\230\352\270\260.md" "b/lkhyun/202502/23 SWEA D4 \353\217\231\354\225\204\353\246\254\354\213\244 \352\264\200\353\246\254\355\225\230\352\270\260.md" new file mode 100644 index 00000000..19be9991 --- /dev/null +++ "b/lkhyun/202502/23 SWEA D4 \353\217\231\354\225\204\353\246\254\354\213\244 \352\264\200\353\246\254\355\225\230\352\270\260.md" @@ -0,0 +1,67 @@ +```java +import java.util.*; +import java.io.*; + +public class solution { + static final int MOD = 1000000007; + + public static void main(String[] args) throws Exception{ + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + int T = Integer.parseInt(br.readLine()); + for(int t = 1;t<=T; t++){ + String str = br.readLine(); + int N = str.length(); + int[] respBits = new int[N]; + for (int i = 0; i < N; i++) { + respBits[i] = charToInt(str.charAt(i)); + } + List[] daySubsets = new List[N]; + for(int i=0;i(); + for(int mask=1;mask<16;mask++){ + if((mask & respBits[i])==0) continue; + if(i==0 && (mask&1)==0) continue; + daySubsets[i].add(mask); + } + } + long[] dpPrev = new long[16]; + long[] dpCur = new long[16]; + + for(int mask : daySubsets[0]){ + dpPrev[mask] = 1; + } + for(int day=1; day