diff --git a/code_study/Baekjoon/python/23795.py b/code_study/Baekjoon/python/23795.py new file mode 100644 index 0000000..366c31b --- /dev/null +++ b/code_study/Baekjoon/python/23795.py @@ -0,0 +1,4 @@ +ans = 0 +while (n := int(input())) != -1 : + ans += n +print(ans) \ No newline at end of file diff --git a/code_study/Baekjoon/ts/1562.ts b/code_study/Baekjoon/ts/1562.ts new file mode 100644 index 0000000..bf47339 --- /dev/null +++ b/code_study/Baekjoon/ts/1562.ts @@ -0,0 +1,49 @@ +export {}; +const N: number = Number(require("fs").readFileSync(0).toString()); +const MOD: number = 1000000000; + +if(N < 10) { + console.log(0); + process.exit(0); +} + +let dp: number[][][] = Array.from({length : N }, + () => Array.from({length : 10}, () => new Array(1024).fill(0) + ) + ); + +for(let n=1; n<=9; n++) { + dp[0][n][1<= 0) { + dp[i][next_num][next_bit_state] += dp[i-1][n][bit_state]; + dp[i][next_num][next_bit_state] %= MOD; + } + } + } +} + +let ans: number = 0; +for(let n=0; n<10; n++) { + ans += dp[N-1][n][1023]; + ans %= MOD; +} + +console.log(ans); \ No newline at end of file