전체 글(6)
-
백준 1193 분수찾기 파이썬
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 X = int(input()) n=1 sum=1 while True: if sum >= X: if X-sum==0: frac_n_1 = n frac_n_2 = (n+1)-frac_n_1 if n%2==0: print(frac_n_1,"/",frac_n_2) break else: print(frac_n_2,"/",frac_n_1) break else: frac_n_1 = X-(sum-n) frac_n_2 = (n+1)-frac_n_1 if n%2==0: print(frac_n_1,"/",frac_n_2) break else: print(frac_n_2,"/",frac_n_1) brea..
2022.06.14 -
코드업 파이썬 기초 100제 6097 설탕과자 뽑기
1234567891011121314151617181920212223242526print("격자판의 세로(h), 가로(w) 입력 1<=w,h<=100")h,w = map(int,input().split()) d=[]for i in range(w): d.append([]) for j in range(h): d[i].append(0) print("막대의 개수 입력 1<=n<=10")n = int(input())print("각 막대의 길이,방향,좌표 입력 l<=w,h d=0or1 1<=x,y<=100-h,100-w")for i in range(n): print(i+1,"번째 막대") l,d,x,y= map(int,input().split()) if d==0: for a in range(l): d[x-1][y-1..
2022.06.02 -
파이썬 십자뒤집기
1234567891011121314151617181920212223242526d= [] #19x19 배열 d를 선언for i in range(19): d.append([]) for j in range(19): d[i].append(0) n = int(input()) #n개의 바둑알 좌표 입력받기for i in range(n): x,y = input().split() x=int(x) y=int(y) for j in range(19): #십자뒤집기 실행 if d[x-1][j]==1: d[x-1][j]=0 else: d[x-1][j]=1 if d[j][y-1]==1: d[j][y-1]=0 else: d[j][y-1]=1 d[x-1][y-1]=0 for i in range(19): #출력 for j in ran..
2022.06.02 -
Lec 2 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008
operators and operands, in particular branching, conditionals, and iteration. no matter how complex a data structure we create, and we're going to create a variety of data structures, fundamentally all of them have their basis, their atomic level if you like, are going to be some combinations of numbers, of strings, and the third type, which are booleans, which I'm going to introduce a little la..
2022.06.02 -
Lecture 1 | Modern Physics: Classical Mechanics (Stanford)
From 00:00 to 11:59 First he speaks about deterministic. He defined it in the following way: wherever you happen to be, you know exactly where to go next, so it's deterministic into the future. I.e. wherever you start, you know where you will be arbitrarily into the future and also you know where you were before. From 12:00 what kind of laws of physics do we not allow? Classical Mechanics forbid..
2022.06.02 -
Lec 1 | MIT 6.00 Introduction to Computer Science and Programming, Fall 2008
Our goal is to take problems and break them down into these computational steps, sequence of instructions that allow us to capture that process Our goal is to be able to have a set of primitives that we combine into complex expressions, which we can then abstract to treat as primitives, and we want to use that sequence of instructions(imperative knowledge) in this flow of control computing, in o..
2022.06.02