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
                                        
                                    
                                        
                                    - 영재교육원
- boj
- 2605
- 2501
- 공주대 정보보호
- acmicpc
- 10833
- 영재원
- 1547
- 10995
- 2476
- EOF
- 5086
- 리뷰
- BoB 7기
- Best of the Best
- 2506
- BoB 후기
- 11109
- 2965
- 5586
- 11943
- Python
- BOB
- 차세대 보안 리더 양성
- 차세대 보안 리더 양성 프로그램
- 정보보호 영재원
- text
- 정보보호 영재교육원
- 4101
                                        Archives
                                        
                                    
                                        
                                    - Today
- Total
짱해커가 되어보자
boj 2153 본문
* Solved 기준 브론즈2 단순 풀이
def gp(m):
	l = [True]*(m+1)
	for i in range(2,int(m**0.5)+1):
		if l[i]:
			for j in range(i*2,m+1,i): l[j] = False
	return l
p = gp(1040); n,s = input(),0
for i in n: s += ord(i)-96 if i>='a' and i<='z' else ord(i)-38
print('It is a prime word.' if p[s] else 'It is not a prime word.')
                          Comments