๋ฐ์ํ
Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
Tags
- sql
- BFS
- Do it
- ์ฐธ์กฐ ๋ณ์
- np.zeros_like
- ์์ด
- ์ด๊ฒ์ด ์ทจ์ ์ ์ํ ์ฝ๋ฉํ ์คํธ๋ค
- mysql
- ์๋ฐ
- matplotlib
- dacon
- DFS
- ํ๋ก๊ทธ๋๋จธ์ค
- java
- ๋ฐ์ค๊ทธ๋ํ
- jdbc
- Extended Slices
- ๋ธ๋ผ์ฐ์ ์คํ
- ๋ค์ต์คํธ๋ผ ์๊ณ ๋ฆฌ์ฆ
- ํ์ ๋ณ์
- ์ ํ ํฌ ํ์ด์ฌ
- ํฉํ ๋ฆฌ์ผ ์ง๋ฒ
- Do_it
- ์ด์ง์ ๋ณํ
- MacOS
- PYTHON
- 2BPerfect
- ์ง ๊ฐ ์์ธก ๋ถ์
- ๋ฐฑ์ค
- ์ต์
Archives
- Today
- Total
๋ชฉ๋กhashing (1)
๐ฆ ๊ณต๋ฃก์ด ๋์!
[๋ฐฑ์ค] Python ํด์ฑ(hashing)
a1='abcdefghijklmnopqrstuvwxyz' b1=int(input()) b2=list(input()) a3=[(a1.index(i)+1)*(31**j) for i,j in zip(b2,range(b1))] print(sum(a3)%1234567891) ๋ค๋ฅธ ๋ต์ L = int(input()) string = input() answer = 0 for i in range(L): answer += (ord(string[i])-96) * (31 ** i) #์์คํค ์ฝ๋ ๊ฐ์ ๋๋ ค์ฃผ๋ ordํจ์ print(answer % 1234567891)
Development/CodingTest
2022. 1. 18. 01:43