์ƒˆ์†Œ์‹

๐Ÿงฎ PS

์ฝ”๋“œ์—… (Code up)1093 ~ 1099 (์ข…ํ•ฉ) ํŒŒ์ด์ฌ ํ’€์ด

  • -

๋ฌธ์ œ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23

 

๋ฌธ์ œ์ง‘ / ๊ธฐ์ดˆ 100์ œ

 

codeup.kr

*1093๋ฒˆ

n = int(input())
array = list(map(int,input().split()))
all = [0]*23
for i in array :
    all[i-1] += 1
for j in all :
    print(j,end=" ")

*1094๋ฒˆ

n = int(input())
array = list(map(int,input().split()))
result = reversed(array)
for i in result :
    print(i,end=' ')

*1095๋ฒˆ

n = int(input())
array = list(map(int,input().split()))
n = sorted(array)[0]
print(n)

*1096๋ฒˆ

n = int(input())
array = [[0 for col in range(19)] for row in range(19)] 
for i in range(n):
    x , y = map(int,input().split())
    array[x-1][y-1] = 1
for j in array :
    for k in j :
        print(k, end=" ")
    print()

*1097๋ฒˆ

array = [[0 for col in range(19)] for row in range(19)]

for i in range(19):
    a = list(map(int,input().split()))
    array[i] = a

n = int(input()) #๋’ค์ง‘์„ ์ˆ˜
for w in range(n) :
    x , y = map(int,input().split())
    for z in range(19) :
        if array[x-1][z] == 1 :array[x-1][z]=0
        else :array[x-1][z]=1
        if array[z][y-1] == 1 :array[z][y-1]=0 
        else :array[z][y-1]=1 

for z in array :
    for o in z :
        print(o,end=" ")
    print()

*1098๋ฒˆ

h,w = map(int,input().split())
n = int(input())
   # d = 0 ๊ฐ€๋กœ d=1 ์„ธ๋กœ

array = [[0 for col in range(w)] for row in range(h)]

for i in range(n):
    l,d,x,y = map(int,input().split())
    if d == 1 :   #๋ง‰๋Œ€๊ฐ€ ์„ธ๋กœ๋ผ๋ฉด
        for q in range(l) :
            array[x-1+q][y-1] = 1
    if d == 0 :   #๋ง‰๋Œ€๊ฐ€ ๊ฐ€๋กœ๋ผ๋ฉด
        for w in range(l) :
            array[x-1][y+w-1] = 1

for z in array :
    for k in z :
        print(k, end=" ")
    print()

*1099๋ฒˆ

all = [] ; x=1;y=1
for i in range(10):
    a = list(map(int,input().split()))
    all.append(a)
while(True) :
    if all[x][y] == 2 : #๋จน์ด ๋ฐœ๊ฒฌํ–ˆ์„๋•Œ break
        all[x][y] = 9
        break
    elif all[x+1][y] ==1 and all[x][y+1] ==1 :  #๋ฒฝ์œผ๋กœ ๊ฐ€๋กœ ๋ง‰ํ˜”์„๋•Œ break
        all[x][y] = 9
        break
    all[x][y] = 9
    if all[x][y+1] == 1 :  #์˜ค๋ฅธ์ชฝ์ด ๋ฒฝ์ด๋ฉด ์•„๋ž˜๋กœ 1์นธ
        x +=1
    elif all[x+1][y] == 1 :  # ์•„๋ž˜์ชฝ์ด ๋ฒฝ์ด๋ฉด ์˜ค๋ฅธ์ชฝ์œผ๋กœ 1์นธ
        y += 1
    else : y+=1 # ์ฃผ๋ณ€์— ๋ฒฝ์ด ์—†์œผ๋ฉด ์˜ค๋ฅธ์ชฝ์œผ๋กœ 1์นธ
for p in all :
    for o in p:
        print(o,end=" ")
    print()

 

๋งˆ์ง€๋ง‰ ๋นจ๊ฐ„์ƒ‰ ๋ถ€๋ถ„ ์ „๊นŒ์ง€๋Š” ์—„์ฒญ ์‰ฝ๋‹ค๊ฐ€, ๋นจ๊ฐ„๋ถ€๋ถ„๋ถ€ํ„ฐ๋Š” ๋‚œ์ด๋„๊ฐ€ ๊ธ‰๊ฒฉํžˆ ์˜ฌ๋ผ๊ฐ€์„œ ๋‚˜์ค‘์— ๋‹ค์‹œํ•œ๋ฒˆ ๋ด์•ผ๊ฒ ๋‹ค.

*C++/CPPํ’€์ด๋„ code up ์นดํ…Œ๊ณ ๋ฆฌ์— ์žˆ์Šต๋‹ˆ๋‹ค.

Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.